@dangl/angular-material-shared 1.2.1-beta0003 → 1.2.1-beta0013

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/package.json +1 -1
  2. package/tinymce-assets/plugins/advlist/plugin.js +1 -1
  3. package/tinymce-assets/plugins/advlist/plugin.min.js +1 -1
  4. package/tinymce-assets/plugins/anchor/plugin.js +1 -1
  5. package/tinymce-assets/plugins/anchor/plugin.min.js +1 -1
  6. package/tinymce-assets/plugins/autolink/plugin.js +1 -1
  7. package/tinymce-assets/plugins/autolink/plugin.min.js +1 -1
  8. package/tinymce-assets/plugins/autoresize/plugin.js +15 -7
  9. package/tinymce-assets/plugins/autoresize/plugin.min.js +2 -2
  10. package/tinymce-assets/plugins/autosave/plugin.js +1 -1
  11. package/tinymce-assets/plugins/autosave/plugin.min.js +1 -1
  12. package/tinymce-assets/plugins/bbcode/plugin.js +1 -2
  13. package/tinymce-assets/plugins/bbcode/plugin.min.js +2 -2
  14. package/tinymce-assets/plugins/charmap/plugin.js +1 -1
  15. package/tinymce-assets/plugins/charmap/plugin.min.js +1 -1
  16. package/tinymce-assets/plugins/code/plugin.js +1 -1
  17. package/tinymce-assets/plugins/code/plugin.min.js +1 -1
  18. package/tinymce-assets/plugins/codesample/plugin.js +1887 -2006
  19. package/tinymce-assets/plugins/codesample/plugin.min.js +2 -2
  20. package/tinymce-assets/plugins/colorpicker/plugin.js +1 -2
  21. package/tinymce-assets/plugins/colorpicker/plugin.min.js +2 -2
  22. package/tinymce-assets/plugins/contextmenu/plugin.js +1 -2
  23. package/tinymce-assets/plugins/contextmenu/plugin.min.js +2 -2
  24. package/tinymce-assets/plugins/directionality/plugin.js +1 -1
  25. package/tinymce-assets/plugins/directionality/plugin.min.js +1 -1
  26. package/tinymce-assets/plugins/emoticons/plugin.js +1 -1
  27. package/tinymce-assets/plugins/emoticons/plugin.min.js +1 -1
  28. package/tinymce-assets/plugins/fullpage/plugin.js +1 -2
  29. package/tinymce-assets/plugins/fullpage/plugin.min.js +2 -2
  30. package/tinymce-assets/plugins/fullscreen/plugin.js +385 -2
  31. package/tinymce-assets/plugins/fullscreen/plugin.min.js +2 -2
  32. package/tinymce-assets/plugins/help/plugin.js +68 -75
  33. package/tinymce-assets/plugins/help/plugin.min.js +2 -2
  34. package/tinymce-assets/plugins/hr/plugin.js +1 -1
  35. package/tinymce-assets/plugins/hr/plugin.min.js +1 -1
  36. package/tinymce-assets/plugins/image/plugin.js +38 -20
  37. package/tinymce-assets/plugins/image/plugin.min.js +2 -2
  38. package/tinymce-assets/plugins/imagetools/plugin.js +229 -195
  39. package/tinymce-assets/plugins/imagetools/plugin.min.js +2 -2
  40. package/tinymce-assets/plugins/importcss/plugin.js +1 -1
  41. package/tinymce-assets/plugins/importcss/plugin.min.js +1 -1
  42. package/tinymce-assets/plugins/insertdatetime/plugin.js +11 -8
  43. package/tinymce-assets/plugins/insertdatetime/plugin.min.js +2 -2
  44. package/tinymce-assets/plugins/legacyoutput/plugin.js +1 -2
  45. package/tinymce-assets/plugins/legacyoutput/plugin.min.js +2 -2
  46. package/tinymce-assets/plugins/link/plugin.js +20 -13
  47. package/tinymce-assets/plugins/link/plugin.min.js +2 -2
  48. package/tinymce-assets/plugins/lists/plugin.js +2 -2
  49. package/tinymce-assets/plugins/lists/plugin.min.js +2 -2
  50. package/tinymce-assets/plugins/media/plugin.js +43 -48
  51. package/tinymce-assets/plugins/media/plugin.min.js +2 -2
  52. package/tinymce-assets/plugins/nonbreaking/plugin.js +1 -1
  53. package/tinymce-assets/plugins/nonbreaking/plugin.min.js +1 -1
  54. package/tinymce-assets/plugins/noneditable/plugin.js +1 -1
  55. package/tinymce-assets/plugins/noneditable/plugin.min.js +1 -1
  56. package/tinymce-assets/plugins/pagebreak/plugin.js +1 -1
  57. package/tinymce-assets/plugins/pagebreak/plugin.min.js +1 -1
  58. package/tinymce-assets/plugins/paste/plugin.js +35 -3
  59. package/tinymce-assets/plugins/paste/plugin.min.js +2 -2
  60. package/tinymce-assets/plugins/preview/plugin.js +1 -1
  61. package/tinymce-assets/plugins/preview/plugin.min.js +1 -1
  62. package/tinymce-assets/plugins/print/plugin.js +1 -1
  63. package/tinymce-assets/plugins/print/plugin.min.js +1 -1
  64. package/tinymce-assets/plugins/quickbars/plugin.js +1 -1
  65. package/tinymce-assets/plugins/quickbars/plugin.min.js +1 -1
  66. package/tinymce-assets/plugins/save/plugin.js +1 -1
  67. package/tinymce-assets/plugins/save/plugin.min.js +1 -1
  68. package/tinymce-assets/plugins/searchreplace/plugin.js +1 -1
  69. package/tinymce-assets/plugins/searchreplace/plugin.min.js +1 -1
  70. package/tinymce-assets/plugins/spellchecker/plugin.js +1 -2
  71. package/tinymce-assets/plugins/spellchecker/plugin.min.js +2 -2
  72. package/tinymce-assets/plugins/tabfocus/plugin.js +1 -1
  73. package/tinymce-assets/plugins/tabfocus/plugin.min.js +1 -1
  74. package/tinymce-assets/plugins/table/plugin.js +456 -381
  75. package/tinymce-assets/plugins/table/plugin.min.js +2 -2
  76. package/tinymce-assets/plugins/template/plugin.js +1 -1
  77. package/tinymce-assets/plugins/template/plugin.min.js +1 -1
  78. package/tinymce-assets/plugins/textcolor/plugin.js +1 -2
  79. package/tinymce-assets/plugins/textcolor/plugin.min.js +2 -2
  80. package/tinymce-assets/plugins/textpattern/plugin.js +2 -2
  81. package/tinymce-assets/plugins/textpattern/plugin.min.js +2 -2
  82. package/tinymce-assets/plugins/toc/plugin.js +1 -1
  83. package/tinymce-assets/plugins/toc/plugin.min.js +1 -1
  84. package/tinymce-assets/plugins/visualblocks/plugin.js +1 -1
  85. package/tinymce-assets/plugins/visualblocks/plugin.min.js +1 -1
  86. package/tinymce-assets/plugins/visualchars/plugin.js +1 -1
  87. package/tinymce-assets/plugins/visualchars/plugin.min.js +1 -1
  88. package/tinymce-assets/plugins/wordcount/plugin.js +1 -1
  89. package/tinymce-assets/plugins/wordcount/plugin.min.js +1 -1
  90. package/tinymce-assets/skins/ui/oxide/content.css +1 -1
  91. package/tinymce-assets/skins/ui/oxide/content.inline.css +1 -1
  92. package/tinymce-assets/skins/ui/oxide/content.inline.min.css +1 -1
  93. package/tinymce-assets/skins/ui/oxide/content.min.css +1 -1
  94. package/tinymce-assets/skins/ui/oxide/skin.css +7 -7
  95. package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
  96. package/tinymce-assets/skins/ui/oxide/skin.shadowdom.css +7 -7
  97. package/tinymce-assets/skins/ui/oxide/skin.shadowdom.min.css +1 -1
  98. package/tinymce-assets/skins/ui/oxide-dark/content.css +1 -1
  99. package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +1 -1
  100. package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +1 -1
  101. package/tinymce-assets/skins/ui/oxide-dark/content.min.css +1 -1
  102. package/tinymce-assets/skins/ui/oxide-dark/skin.css +7 -7
  103. package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
  104. package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.css +7 -7
  105. package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -1
  106. package/tinymce-assets/themes/mobile/theme.js +225 -700
  107. package/tinymce-assets/themes/mobile/theme.min.js +2 -2
  108. package/tinymce-assets/themes/silver/theme.js +3224 -3686
  109. package/tinymce-assets/themes/silver/theme.min.js +2 -2
@@ -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.9.0 (2021-08-26)
7
+ * Version: 5.10.0 (2021-10-11)
8
8
  */
9
9
  (function () {
10
10
  'use strict';
@@ -403,8 +403,6 @@
403
403
 
404
404
  var global$1 = tinymce.util.Tools.resolve('tinymce.util.I18n');
405
405
 
406
- var premiumType = 'premium';
407
- var openSourceType = 'opensource';
408
406
  var urls = map([
409
407
  {
410
408
  key: 'advlist',
@@ -526,6 +524,10 @@
526
524
  key: 'print',
527
525
  name: 'Print'
528
526
  },
527
+ {
528
+ key: 'quickbars',
529
+ name: 'Quick Toolbars'
530
+ },
529
531
  {
530
532
  key: 'save',
531
533
  name: 'Save'
@@ -574,122 +576,112 @@
574
576
  key: 'wordcount',
575
577
  name: 'Word Count'
576
578
  },
579
+ {
580
+ key: 'a11ychecker',
581
+ name: 'Accessibility Checker',
582
+ type: 'premium'
583
+ },
577
584
  {
578
585
  key: 'advcode',
579
- name: 'Advanced Code Editor*',
580
- type: premiumType
586
+ name: 'Advanced Code Editor',
587
+ type: 'premium'
581
588
  },
582
589
  {
583
- key: 'formatpainter',
584
- name: 'Format Painter*',
585
- type: premiumType
590
+ key: 'advtable',
591
+ name: 'Advanced Tables',
592
+ type: 'premium'
586
593
  },
587
594
  {
588
- key: 'powerpaste',
589
- name: 'PowerPaste*',
590
- type: premiumType
595
+ key: 'autocorrect',
596
+ name: 'Autocorrect',
597
+ type: 'premium'
591
598
  },
592
599
  {
593
- key: 'tinydrive',
594
- name: 'Tiny Drive*',
595
- type: premiumType
600
+ key: 'casechange',
601
+ name: 'Case Change',
602
+ type: 'premium'
596
603
  },
597
604
  {
598
- key: 'tinymcespellchecker',
599
- name: 'Spell Checker Pro*',
600
- type: premiumType
605
+ key: 'checklist',
606
+ name: 'Checklist',
607
+ type: 'premium'
601
608
  },
602
609
  {
603
- key: 'a11ychecker',
604
- name: 'Accessibility Checker*',
605
- type: premiumType
610
+ key: 'export',
611
+ name: 'Export',
612
+ type: 'premium'
606
613
  },
607
614
  {
608
- key: 'linkchecker',
609
- name: 'Link Checker*',
610
- type: premiumType
615
+ key: 'mediaembed',
616
+ name: 'Enhanced Media Embed',
617
+ type: 'premium'
611
618
  },
612
619
  {
613
- key: 'mentions',
614
- name: 'Mentions*',
615
- type: premiumType
620
+ key: 'formatpainter',
621
+ name: 'Format Painter',
622
+ type: 'premium'
616
623
  },
617
624
  {
618
- key: 'mediaembed',
619
- name: 'Enhanced Media Embed*',
620
- type: premiumType
625
+ key: 'linkchecker',
626
+ name: 'Link Checker',
627
+ type: 'premium'
621
628
  },
622
629
  {
623
- key: 'checklist',
624
- name: 'Checklist*',
625
- type: premiumType
630
+ key: 'mentions',
631
+ name: 'Mentions',
632
+ type: 'premium'
626
633
  },
627
634
  {
628
- key: 'casechange',
629
- name: 'Case Change*',
630
- type: premiumType
635
+ key: 'pageembed',
636
+ name: 'Page Embed',
637
+ type: 'premium'
631
638
  },
632
639
  {
633
640
  key: 'permanentpen',
634
- name: 'Permanent Pen*',
635
- type: premiumType
641
+ name: 'Permanent Pen',
642
+ type: 'premium'
636
643
  },
637
644
  {
638
- key: 'pageembed',
639
- name: 'Page Embed*',
640
- type: premiumType
645
+ key: 'powerpaste',
646
+ name: 'PowerPaste',
647
+ type: 'premium'
641
648
  },
642
649
  {
643
- key: 'tinycomments',
644
- name: 'Tiny Comments*',
645
- type: premiumType,
646
- slug: 'comments'
650
+ key: 'rtc',
651
+ name: 'Real-Time Collaboration',
652
+ type: 'premium'
647
653
  },
648
654
  {
649
- key: 'advtable',
650
- name: 'Advanced Tables*',
651
- type: premiumType
655
+ key: 'tinymcespellchecker',
656
+ name: 'Spell Checker Pro',
657
+ type: 'premium'
652
658
  },
653
659
  {
654
- key: 'autocorrect',
655
- name: 'Autocorrect*',
656
- type: premiumType
660
+ key: 'tinycomments',
661
+ name: 'Tiny Comments',
662
+ type: 'premium',
663
+ slug: 'comments'
657
664
  },
658
665
  {
659
- key: 'export',
660
- name: 'Export*',
661
- type: premiumType
666
+ key: 'tinydrive',
667
+ name: 'Tiny Drive',
668
+ type: 'premium'
662
669
  }
663
670
  ], function (item) {
664
671
  return __assign(__assign({}, item), {
665
- type: item.type || openSourceType,
672
+ type: item.type || 'opensource',
666
673
  slug: item.slug || item.key
667
674
  });
668
675
  });
669
676
 
670
677
  var tab$1 = function (editor) {
671
678
  var availablePlugins = function () {
672
- var premiumPlugins = [
673
- 'Accessibility Checker',
674
- 'Advanced Code Editor',
675
- 'Advanced Tables',
676
- 'Case Change',
677
- 'Checklist',
678
- 'Export',
679
- 'Tiny Comments',
680
- 'Tiny Drive',
681
- 'Enhanced Media Embed',
682
- 'Format Painter',
683
- 'Link Checker',
684
- 'Mentions',
685
- 'MoxieManager',
686
- 'Page Embed',
687
- 'Permanent Pen',
688
- 'PowerPaste',
689
- 'Spell Checker Pro'
690
- ];
679
+ var premiumPlugins = filter(urls, function (_a) {
680
+ var key = _a.key, type = _a.type;
681
+ return key !== 'autocorrect' && type === 'premium';
682
+ });
691
683
  var premiumPluginList = map(premiumPlugins, function (plugin) {
692
- return '<li>' + global$1.translate(plugin) + '</li>';
684
+ return '<li>' + global$1.translate(plugin.name) + '</li>';
693
685
  }).join('');
694
686
  return '<div data-mce-tabstop="1" tabindex="-1">' + '<p><b>' + global$1.translate('Premium plugins:') + '</b></p>' + '<ul>' + premiumPluginList + '<li class="tox-help__more-link" "><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">' + global$1.translate('Learn more...') + '</a></li>' + '</ul>' + '</div>';
695
687
  };
@@ -703,8 +695,9 @@
703
695
  var getMetadata = editor.plugins[key].getMetadata;
704
696
  return typeof getMetadata === 'function' ? makeLink(getMetadata()) : key;
705
697
  }, function (x) {
698
+ var name = x.type === 'premium' ? x.name + '*' : x.name;
706
699
  return makeLink({
707
- name: x.name,
700
+ name: name,
708
701
  url: 'https://www.tiny.cloud/docs/plugins/' + x.type + '/' + x.slug
709
702
  });
710
703
  });
@@ -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.9.0 (2021-08-26)
7
+ * Version: 5.10.0 (2021-10-11)
8
8
  */
9
- !function(){"use strict";function i(e){return function(){return e}}function e(e){return e}function t(){return s}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),y=function(){return(y=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},u=i(!1),r=i(!0),s={fold:function(e,t){return e()},isSome:u,isNone:r,getOr:e,getOrThunk:a,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:e,orThunk:a,map:t,each:function(){},bind:t,exists:u,forall:r,filter:function(){return s},toArray:function(){return[]},toString:i("none()")};function a(e){return e()}function b(e,t){for(var n=e.length,a=new Array(n),o=0;o<n;o++){var i=e[o];a[o]=t(i,o)}return a}function f(e){var n=m.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl ",access:"Shift + Alt "},t=b(e.split("+"),function(e){var t=e.toLowerCase().trim();return A(n,t)?n[t]:e});return m.mac?t.join("").replace(/\s/,""):t.join("+")}function k(e){function a(e){return'<a href="'+e.url+'" target="_blank" rel="noopener">'+e.name+"</a>"}var t,o,n,i,r,s,l,c;return{name:"plugins",title:"Plugins",items:[{type:"htmlpanel",presets:"document",html:[null==e?"":'<div data-mce-tabstop="1" tabindex="-1">'+(s=b((i=w((n=o=e).plugins),void 0===(r=n.getParam("forced_plugins"))?i:function(e){for(var t=[],n=0,a=e.length;n<a;n++){var o=e[n];(function(e,t){return-1<h.call(e,t)})(r,o)||t.push(o)}return t}(i)),function(e){return"<li>"+(t=o,n=e,function(e,t,n){for(var a=0,o=e.length;a<o;a++){var i=e[a];if(t(i,a))return v.some(i);if(n(i,a))break}return v.none()}(d,function(e){return e.key===n},u).fold(function(){var e=t.plugins[n].getMetadata;return"function"==typeof e?a(e()):n},function(e){return a({name:e.name,url:"https://www.tiny.cloud/docs/plugins/"+e.type+"/"+e.slug})}))+"</li>";var t,n}),l=s.length,c=s.join(""),"<p><b>"+C.translate(["Plugins installed ({0}):",l])+"</b></p><ul>"+c+"</ul>")+"</div>",(t=b(["Accessibility Checker","Advanced Code Editor","Advanced Tables","Case Change","Checklist","Export","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>"+C.translate(e)+"</li>"}).join(""),'<div data-mce-tabstop="1" tabindex="-1"><p><b>'+C.translate("Premium plugins:")+"</b></p><ul>"+t+'<li class="tox-help__more-link" "><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">'+C.translate("Learn more...")+"</a></li></ul></div>")].join("")}]}}function l(d,g){return function(){var e,t,n,a,o,i,r,s,l,c,u,h=(e=d,t=g,r={name:"shortcuts",title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:b(x,function(e){var t=b(e.shortcuts,f).join(" or ");return[e.action,t]})}]},s={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 <li>the editor resize handle 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>"}]},l=k(e),a=T.majorVersion,o=T.minorVersion,i=0===a.indexOf("@")?"X.X.X":a+"."+o,c={name:"versions",title:"Version",items:[{type:"htmlpanel",html:"<p>"+C.translate(["You are using {0}",'<a href="https://www.tiny.cloud/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE '+i+"</a>"])+"</p>",presets:"document"}]},u=y(((n={})[r.name]=r,n[s.name]=s,n[l.name]=l,n[c.name]=c,n),t.get()),v.from(e.getParam("help_tabs")).fold(function(){return-1!==(n=(t=w(e=u)).indexOf("versions"))&&(t.splice(n,1),t.push("versions")),{tabs:e,names:t};var e,t,n},function(e){return t=u,n={},a=b(e,function(e){return"string"==typeof e?(A(t,e)&&(n[e]=t[e]),e):(n[e.name]=e).name}),{tabs:n,names:a};var t,n,a})),m=h.tabs,p=function(e){for(var t=[],n=function(e){t.push(e)},a=0;a<e.length;a++)e[a].each(n);return t}(b(h.names,function(e){return A(t=m,n=e)?v.from(t[n]):v.none();var t,n}));d.windowManager.open({title:"Help",size:"medium",body:{type:"tabpanel",tabs:p},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{}})}}var c=function(n){function e(){return o}function t(e){return e(n)}var a=i(n),o={fold:function(e,t){return t(n)},isSome:r,isNone:u,getOr:a,getOrThunk:a,getOrDie:a,getOrNull:a,getOrUndefined:a,or:e,orThunk:e,map:function(e){return c(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?o:s},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},v={some:c,none:t,from:function(e){return null==e?s:c(e)}},h=Array.prototype.indexOf,w=Object.keys,o=Object.hasOwnProperty,A=function(e,t){return o.call(e,t)},m=tinymce.util.Tools.resolve("tinymce.Env"),x=[{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:"Heading 1"},{shortcuts:["Access + 2"],action:"Heading 2"},{shortcuts:["Access + 3"],action:"Heading 3"},{shortcuts:["Access + 4"],action:"Heading 4"},{shortcuts:["Access + 5"],action:"Heading 5"},{shortcuts:["Access + 6"],action:"Heading 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"}],C=tinymce.util.Tools.resolve("tinymce.util.I18n"),p="premium",d=b([{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*",type:p},{key:"formatpainter",name:"Format Painter*",type:p},{key:"powerpaste",name:"PowerPaste*",type:p},{key:"tinydrive",name:"Tiny Drive*",type:p},{key:"tinymcespellchecker",name:"Spell Checker Pro*",type:p},{key:"a11ychecker",name:"Accessibility Checker*",type:p},{key:"linkchecker",name:"Link Checker*",type:p},{key:"mentions",name:"Mentions*",type:p},{key:"mediaembed",name:"Enhanced Media Embed*",type:p},{key:"checklist",name:"Checklist*",type:p},{key:"casechange",name:"Case Change*",type:p},{key:"permanentpen",name:"Permanent Pen*",type:p},{key:"pageembed",name:"Page Embed*",type:p},{key:"tinycomments",name:"Tiny Comments*",type:p,slug:"comments"},{key:"advtable",name:"Advanced Tables*",type:p},{key:"autocorrect",name:"Autocorrect*",type:p},{key:"export",name:"Export*",type:p}],function(e){return y(y({},e),{type:e.type||"opensource",slug:e.slug||e.key})}),T=tinymce.util.Tools.resolve("tinymce.EditorManager");n.add("help",function(e){var t,n,a,o=(t={},{get:function(){return t},set:function(e){t=e}}),i={addTab:function(e){var t=n.get();t[e.name]=e,n.set(t)}},r=l(e,n=o),s=r;return(a=e).ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:s}),a.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:s}),e.addCommand("mceHelp",r),e.shortcuts.add("Alt+0","Open help dialog","mceHelp"),i})}();
9
+ !function(){"use strict";function i(e){return function(){return e}}function e(e){return e}function t(){return s}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),g=function(){return(g=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},u=i(!1),r=i(!0),s={fold:function(e,t){return e()},isSome:u,isNone:r,getOr:e,getOrThunk:a,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:e,orThunk:a,map:t,each:function(){},bind:t,exists:u,forall:r,filter:function(){return s},toArray:function(){return[]},toString:i("none()")};function a(e){return e()}function b(e,t){for(var n=e.length,a=new Array(n),o=0;o<n;o++){var i=e[o];a[o]=t(i,o)}return a}function m(e,t){for(var n=[],a=0,o=e.length;a<o;a++){var i=e[a];t(i,a)&&n.push(i)}return n}function f(e){var n=p.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl ",access:"Shift + Alt "},t=b(e.split("+"),function(e){var t=e.toLowerCase().trim();return A(n,t)?n[t]:e});return p.mac?t.join("").replace(/\s/,""):t.join("+")}function k(e){function a(e){return'<a href="'+e.url+'" target="_blank" rel="noopener">'+e.name+"</a>"}var t,o,n,i,r,s,l,c;return{name:"plugins",title:"Plugins",items:[{type:"htmlpanel",presets:"document",html:[null==e?"":'<div data-mce-tabstop="1" tabindex="-1">'+(s=b((i=w((n=o=e).plugins),void 0===(r=n.getParam("forced_plugins"))?i:m(i,function(e){return!(-1<h.call(r,e))})),function(e){return"<li>"+(t=o,n=e,function(e,t,n){for(var a=0,o=e.length;a<o;a++){var i=e[a];if(t(i,a))return v.some(i);if(n(i,a))break}return v.none()}(d,function(e){return e.key===n},u).fold(function(){var e=t.plugins[n].getMetadata;return"function"==typeof e?a(e()):n},function(e){return a({name:"premium"===e.type?e.name+"*":e.name,url:"https://www.tiny.cloud/docs/plugins/"+e.type+"/"+e.slug})}))+"</li>";var t,n}),l=s.length,c=s.join(""),"<p><b>"+T.translate(["Plugins installed ({0}):",l])+"</b></p><ul>"+c+"</ul>")+"</div>",(t=b(m(d,function(e){var t=e.key,n=e.type;return"autocorrect"!==t&&"premium"===n}),function(e){return"<li>"+T.translate(e.name)+"</li>"}).join(""),'<div data-mce-tabstop="1" tabindex="-1"><p><b>'+T.translate("Premium plugins:")+"</b></p><ul>"+t+'<li class="tox-help__more-link" "><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">'+T.translate("Learn more...")+"</a></li></ul></div>")].join("")}]}}function l(d,y){return function(){var e,t,n,a,o,i,r,s,l,c,u,m=(e=d,t=y,r={name:"shortcuts",title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:b(x,function(e){var t=b(e.shortcuts,f).join(" or ");return[e.action,t]})}]},s={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 <li>the editor resize handle 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>"}]},l=k(e),a=C.majorVersion,o=C.minorVersion,i=0===a.indexOf("@")?"X.X.X":a+"."+o,c={name:"versions",title:"Version",items:[{type:"htmlpanel",html:"<p>"+T.translate(["You are using {0}",'<a href="https://www.tiny.cloud/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE '+i+"</a>"])+"</p>",presets:"document"}]},u=g(((n={})[r.name]=r,n[s.name]=s,n[l.name]=l,n[c.name]=c,n),t.get()),v.from(e.getParam("help_tabs")).fold(function(){return-1!==(n=(t=w(e=u)).indexOf("versions"))&&(t.splice(n,1),t.push("versions")),{tabs:e,names:t};var e,t,n},function(e){return t=u,n={},a=b(e,function(e){return"string"==typeof e?(A(t,e)&&(n[e]=t[e]),e):(n[e.name]=e).name}),{tabs:n,names:a};var t,n,a})),h=m.tabs,p=function(e){for(var t=[],n=function(e){t.push(e)},a=0;a<e.length;a++)e[a].each(n);return t}(b(m.names,function(e){return A(t=h,n=e)?v.from(t[n]):v.none();var t,n}));d.windowManager.open({title:"Help",size:"medium",body:{type:"tabpanel",tabs:p},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{}})}}var c=function(n){function e(){return o}function t(e){return e(n)}var a=i(n),o={fold:function(e,t){return t(n)},isSome:r,isNone:u,getOr:a,getOrThunk:a,getOrDie:a,getOrNull:a,getOrUndefined:a,or:e,orThunk:e,map:function(e){return c(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?o:s},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},v={some:c,none:t,from:function(e){return null==e?s:c(e)}},h=Array.prototype.indexOf,w=Object.keys,o=Object.hasOwnProperty,A=function(e,t){return o.call(e,t)},p=tinymce.util.Tools.resolve("tinymce.Env"),x=[{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:"Heading 1"},{shortcuts:["Access + 2"],action:"Heading 2"},{shortcuts:["Access + 3"],action:"Heading 3"},{shortcuts:["Access + 4"],action:"Heading 4"},{shortcuts:["Access + 5"],action:"Heading 5"},{shortcuts:["Access + 6"],action:"Heading 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"}],T=tinymce.util.Tools.resolve("tinymce.util.I18n"),d=b([{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:"quickbars",name:"Quick Toolbars"},{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:"a11ychecker",name:"Accessibility Checker",type:"premium"},{key:"advcode",name:"Advanced Code Editor",type:"premium"},{key:"advtable",name:"Advanced Tables",type:"premium"},{key:"autocorrect",name:"Autocorrect",type:"premium"},{key:"casechange",name:"Case Change",type:"premium"},{key:"checklist",name:"Checklist",type:"premium"},{key:"export",name:"Export",type:"premium"},{key:"mediaembed",name:"Enhanced Media Embed",type:"premium"},{key:"formatpainter",name:"Format Painter",type:"premium"},{key:"linkchecker",name:"Link Checker",type:"premium"},{key:"mentions",name:"Mentions",type:"premium"},{key:"pageembed",name:"Page Embed",type:"premium"},{key:"permanentpen",name:"Permanent Pen",type:"premium"},{key:"powerpaste",name:"PowerPaste",type:"premium"},{key:"rtc",name:"Real-Time Collaboration",type:"premium"},{key:"tinymcespellchecker",name:"Spell Checker Pro",type:"premium"},{key:"tinycomments",name:"Tiny Comments",type:"premium",slug:"comments"},{key:"tinydrive",name:"Tiny Drive",type:"premium"}],function(e){return g(g({},e),{type:e.type||"opensource",slug:e.slug||e.key})}),C=tinymce.util.Tools.resolve("tinymce.EditorManager");n.add("help",function(e){var t,n,a,o=(t={},{get:function(){return t},set:function(e){t=e}}),i={addTab:function(e){var t=n.get();t[e.name]=e,n.set(t)}},r=l(e,n=o),s=r;return(a=e).ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:s}),a.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:s}),e.addCommand("mceHelp",r),e.shortcuts.add("Alt+0","Open help dialog","mceHelp"),i})}();
@@ -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.9.0 (2021-08-26)
7
+ * Version: 5.10.0 (2021-10-11)
8
8
  */
9
9
  (function () {
10
10
  'use strict';
@@ -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.9.0 (2021-08-26)
7
+ * Version: 5.10.0 (2021-10-11)
8
8
  */
9
9
  !function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("hr",function(n){var o,t;function e(){return t.execCommand("InsertHorizontalRule")}(o=n).addCommand("InsertHorizontalRule",function(){o.execCommand("mceInsertContent",!1,"<hr />")}),(t=n).ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:e}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:e})})}();
@@ -4,12 +4,12 @@
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.9.0 (2021-08-26)
7
+ * Version: 5.10.0 (2021-10-11)
8
8
  */
9
9
  (function () {
10
10
  'use strict';
11
11
 
12
- var global$5 = tinymce.util.Tools.resolve('tinymce.PluginManager');
12
+ var global$6 = tinymce.util.Tools.resolve('tinymce.PluginManager');
13
13
 
14
14
  var __assign = function () {
15
15
  __assign = Object.assign || function __assign(t) {
@@ -282,9 +282,11 @@
282
282
  fromPoint: fromPoint
283
283
  };
284
284
 
285
- var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
285
+ var global$5 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
286
286
 
287
- var global$3 = tinymce.util.Tools.resolve('tinymce.util.Promise');
287
+ var global$4 = tinymce.util.Tools.resolve('tinymce.util.Promise');
288
+
289
+ var global$3 = tinymce.util.Tools.resolve('tinymce.util.URI');
288
290
 
289
291
  var global$2 = tinymce.util.Tools.resolve('tinymce.util.XHR');
290
292
 
@@ -332,7 +334,7 @@
332
334
  return Math.max(parseInt(val1, 10), parseInt(val2, 10));
333
335
  };
334
336
  var getImageSize = function (url) {
335
- return new global$3(function (callback) {
337
+ return new global$4(function (callback) {
336
338
  var img = document.createElement('img');
337
339
  var done = function (dimensions) {
338
340
  img.onload = img.onerror = null;
@@ -348,10 +350,10 @@
348
350
  width: width,
349
351
  height: height
350
352
  };
351
- done(global$3.resolve(dimensions));
353
+ done(global$4.resolve(dimensions));
352
354
  };
353
355
  img.onerror = function () {
354
- done(global$3.reject('Failed to get image dimensions for: ' + url));
356
+ done(global$4.reject('Failed to get image dimensions for: ' + url));
355
357
  };
356
358
  var style = img.style;
357
359
  style.visibility = 'hidden';
@@ -441,7 +443,7 @@
441
443
  imgElm.onerror = selectImage;
442
444
  };
443
445
  var blobToDataUri = function (blob) {
444
- return new global$3(function (resolve, reject) {
446
+ return new global$4(function (resolve, reject) {
445
447
  var reader = new FileReader();
446
448
  reader.onload = function () {
447
449
  resolve(reader.result);
@@ -455,8 +457,11 @@
455
457
  var isPlaceholderImage = function (imgElm) {
456
458
  return imgElm.nodeName === 'IMG' && (imgElm.hasAttribute('data-mce-object') || imgElm.hasAttribute('data-mce-placeholder'));
457
459
  };
460
+ var isSafeImageUrl = function (editor, src) {
461
+ return global$3.isDomSafe(src, 'img', editor.settings);
462
+ };
458
463
 
459
- var DOM = global$4.DOM;
464
+ var DOM = global$5.DOM;
460
465
  var getHspace = function (image) {
461
466
  if (image.style.marginLeft && image.style.marginRight && image.style.marginLeft === image.style.marginRight) {
462
467
  return removePixelSuffix(image.style.marginLeft);
@@ -782,6 +787,10 @@
782
787
  waitLoadImage(editor, data, image);
783
788
  }
784
789
  };
790
+ var sanitizeImageData = function (editor, data) {
791
+ var src = data.src;
792
+ return __assign(__assign({}, data), { src: isSafeImageUrl(editor, src) ? src : '' });
793
+ };
785
794
  var insertOrUpdateImage = function (editor, partialData) {
786
795
  var image = getSelectedImage(editor);
787
796
  if (image) {
@@ -789,8 +798,9 @@
789
798
  return normalizeCss$1(editor, css);
790
799
  }, image);
791
800
  var data = __assign(__assign({}, selectedImageData), partialData);
801
+ var sanitizedData = sanitizeImageData(editor, data);
792
802
  if (data.src) {
793
- writeImageDataToSelection(editor, data);
803
+ writeImageDataToSelection(editor, sanitizedData);
794
804
  } else {
795
805
  deleteImage(editor, image);
796
806
  }
@@ -1002,7 +1012,7 @@
1002
1012
  var urlListSanitizer = ListUtils.sanitizer(function (item) {
1003
1013
  return editor.convertURL(item.value || item.url, 'src');
1004
1014
  });
1005
- var futureImageList = new global$3(function (completer) {
1015
+ var futureImageList = new global$4(function (completer) {
1006
1016
  createImageList(editor, function (imageList) {
1007
1017
  completer(urlListSanitizer(imageList).map(function (items) {
1008
1018
  return flatten([
@@ -1504,12 +1514,19 @@
1504
1514
  };
1505
1515
  var imageSize = function (editor) {
1506
1516
  return function (url) {
1507
- return getImageSize(editor.documentBaseURI.toAbsolute(url)).then(function (dimensions) {
1508
- return {
1509
- width: String(dimensions.width),
1510
- height: String(dimensions.height)
1511
- };
1512
- });
1517
+ if (!isSafeImageUrl(editor, url)) {
1518
+ return global$4.resolve({
1519
+ width: '',
1520
+ height: ''
1521
+ });
1522
+ } else {
1523
+ return getImageSize(editor.documentBaseURI.toAbsolute(url)).then(function (dimensions) {
1524
+ return {
1525
+ width: String(dimensions.width),
1526
+ height: String(dimensions.height)
1527
+ };
1528
+ });
1529
+ }
1513
1530
  };
1514
1531
  };
1515
1532
  var createBlobCache = function (editor) {
@@ -1552,9 +1569,9 @@
1552
1569
  return function (blobInfo) {
1553
1570
  return global$1(editor).upload([blobInfo], false).then(function (results) {
1554
1571
  if (results.length === 0) {
1555
- return global$3.reject('Failed to upload image');
1572
+ return global$4.reject('Failed to upload image');
1556
1573
  } else if (results[0].status === false) {
1557
- return global$3.reject(results[0].error.message);
1574
+ return global$4.reject(results[0].error.message);
1558
1575
  } else {
1559
1576
  return results[0];
1560
1577
  }
@@ -1620,6 +1637,7 @@
1620
1637
  tooltip: 'Insert/edit image',
1621
1638
  onAction: Dialog(editor).open,
1622
1639
  onSetup: function (buttonApi) {
1640
+ buttonApi.setActive(isNonNullable(getSelectedImage(editor)));
1623
1641
  return editor.selection.selectorChangedWithUnbind('img:not([data-mce-object],[data-mce-placeholder]),figure.image', buttonApi.setActive).unbind;
1624
1642
  }
1625
1643
  });
@@ -1636,7 +1654,7 @@
1636
1654
  };
1637
1655
 
1638
1656
  function Plugin () {
1639
- global$5.add('image', function (editor) {
1657
+ global$6.add('image', function (editor) {
1640
1658
  setup(editor);
1641
1659
  register(editor);
1642
1660
  register$1(editor);
@@ -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.9.0 (2021-08-26)
7
+ * Version: 5.10.0 (2021-10-11)
8
8
  */
9
- !function(){"use strict";function e(r){return function(e){return n=typeof(t=e),(null===t?"null":"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)===r;var t,n}}function t(t){return function(e){return typeof e===t}}function D(e){return!(null==e)}function l(){}function i(e){return function(){return e}}function n(e){return e}function r(){return g}var a,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),y=function(){return(y=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},T=e("string"),s=e("object"),c=e("array"),N=t("boolean"),w=t("function"),u=t("number"),m=i(!1),d=i(!(a=null)),g={fold:function(e,t){return e()},isSome:m,isNone:d,getOr:n,getOrThunk:p,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:n,orThunk:p,map:r,each:l,bind:r,exists:m,forall:d,filter:function(){return g},toArray:function(){return[]},toString:i("none()")};function p(e){return e()}function f(e,i,o,l){return function(e){for(var t=v(e),n=0,r=t.length;n<r;n++){var a=t[n];!function(e,t){(i(e,t)?o:l)(e,t)}(e[a],a)}}(e),1}function h(e,t){return A.call(e,t)}function S(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!c(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);U.apply(t,e[n])}return t}var b=function(n){function e(){return a}function t(e){return e(n)}var r=i(n),a={fold:function(e,t){return t(n)},isSome:d,isNone:m,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return b(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?a:g},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return a},L={some:b,none:r,from:function(e){return null==e?g:b(e)}},v=Object.keys,A=Object.hasOwnProperty,U=Array.prototype.push;function C(e,t,n){!function(e,t,n){if(!(T(n)||N(n)||u(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}(e.dom,t,n)}function I(e){return e.getParam("image_dimensions",!0,"boolean")}function x(e,t){return Math.max(parseInt(e,10),parseInt(t,10))}function O(e){return e&&e.replace(/px$/,"")}function P(e){return 0<e.length&&/^[0-9]+$/.test(e)&&(e+="px"),e}function _(e){if(e.margin){var t=String(e.margin).split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e}function E(e){return"IMG"===e.nodeName&&(e.hasAttribute("data-mce-object")||e.hasAttribute("data-mce-placeholder"))}function R(e){return e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?O(e.style.marginLeft):""}function k(e){return e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?O(e.style.marginTop):""}function z(e){return e.style.borderWidth?O(e.style.borderWidth):""}function M(e,t){return e.hasAttribute(t)?e.getAttribute(t):""}function j(e,t){return e.style[t]||""}function B(e){return null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName}function H(e,t,n){""===n?e.removeAttribute(t):e.setAttribute(t,n)}function F(e,t){var n=e.getAttribute("style"),r=t(null!==n?n:"");0<r.length?(e.setAttribute("style",r),e.setAttribute("data-mce-style",r)):e.removeAttribute("style")}function G(e,r){return function(e,t,n){e.style[t]?(e.style[t]=P(n),F(e,r)):H(e,t,n)}}function W(e,t){return e.style[t]?O(e.style[t]):M(e,t)}function V(e,t){var n=P(t);e.style.marginLeft=n,e.style.marginRight=n}function $(e,t){var n=P(t);e.style.marginTop=n,e.style.marginBottom=n}function J(e,t){var n=P(t);e.style.borderWidth=n}function K(e,t){e.style.borderStyle=t}function X(e){return"FIGURE"===e.nodeName}function Z(e){return 0===we.getAttrib(e,"alt").length&&"presentation"===we.getAttrib(e,"role")}function q(){return{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}}function Q(e,t){return{src:M(t,"src"),alt:Z(n=t)?"":M(n,"alt"),title:M(t,"title"),width:W(t,"width"),height:W(t,"height"),class:M(t,"class"),style:e(M(t,"style")),caption:B(t),hspace:R(t),vspace:k(t),border:z(t),borderStyle:j(t,"borderStyle"),isDecorative:Z(t)};var n}function Y(e,t,n,r,a){n[r]!==t[r]&&a(e,r,n[r])}function ee(r,a){return function(e,t,n){r(e,n),F(e,a)}}function te(e,t){var n=_(e.dom.styles.parse(t)),r=e.dom.styles.parse(e.dom.styles.serialize(n));return e.dom.styles.serialize(r)}function ne(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return n?e.dom.select("img",n)[0]:t&&("IMG"!==t.nodeName||E(t))?null:t}function re(n,e){var r,t,a=n.dom,i=(f(n.schema.getTextBlockElements(),function(e,t){return!n.schema.isValidChild(t,"figure")},(r=t={},function(e,t){r[t]=e}),l),t),o=a.getParent(e.parentNode,function(e){return h(t=i,n=e.nodeName)&&null!=t[n];var t,n},n.getBody());return o?a.split(o,e):e}function ae(r,e){var t=function(e){var t=document.createElement("img");if(Ue(function(e){return te(r,e)},y(y({},e),{caption:!1}),t),Se(t,e.alt,e.isDecorative),e.caption){var n=we.create("figure",{class:"image"});return n.appendChild(t),n.appendChild(we.create("figcaption",{contentEditable:"true"},"Caption")),n.contentEditable="false",n}return t}(e);r.dom.setAttrib(t,"data-mce-id","__mcenew"),r.focus(),r.selection.setContent(t.outerHTML);var n,a=r.dom.select('*[data-mce-id="__mcenew"]')[0];r.dom.setAttrib(a,"data-mce-id",null),X(a)?(n=re(r,a),r.selection.select(n)):r.selection.select(a)}function ie(e){return T(e.value)?e.value:""}function oe(t){return void 0===t&&(t=ie),function(e){return e?L.from(e).map(function(e){return Oe(e,t)}):L.none()}}function le(e){var t=e.imageList.map(function(e){return{name:"images",type:"listbox",label:"Image list",items:e}}),n={name:"alt",type:"input",label:"Alternative description",disabled:e.hasAccessibilityOptions&&e.image.isDecorative},r=e.classList.map(function(e){return{name:"classes",type:"listbox",label:"Class",items:e}});return S([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],t.toArray(),e.hasAccessibilityOptions&&e.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],e.hasDescription?[n]:[],e.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],e.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[y(y({},e.classList.isSome()&&e.hasImageCaption?{type:"grid",columns:2}:{type:"panel"}),{items:S([r.toArray(),e.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])})]])}function se(e){return{src:{value:e.src,meta:{}},images:e.src,alt:e.alt,title:e.title,dimensions:{width:e.width,height:e.height},classes:e.class,caption:e.caption,style:e.style,vspace:e.vspace,border:e.border,hspace:e.hspace,borderstyle:e.borderStyle,fileinput:[],isDecorative:e.isDecorative}}function ce(e,t){return{src:e.src.value,alt:0===e.alt.length&&t?null:e.alt,title:e.title,width:e.dimensions.width,height:e.dimensions.height,class:e.classes,style:e.style,caption:e.caption,hspace:e.hspace,vspace:e.vspace,border:e.border,borderStyle:e.borderstyle,isDecorative:e.isDecorative}}function ue(e,t,n,r){var a,i,o,l,s,c,u,m,d,g,p,f,h,b,y,v,A,D,w,S,U,C,I,x,O;U=t,I=(C=r).getData(),x=U,O=I.src.value,(/^(?:[a-zA-Z]+:)?\/\//.test(O)?L.none():x.prependURL.bind(function(e){return O.substring(0,e.length)!==e?L.some(e+O):L.none()})).each(function(e){C.setData({src:{value:e,meta:I.src.meta}})}),h=t,w=(b=r).getData(),void 0!==(S=w.src.meta)&&(y=Ce({},w),A=y,D=S,(v=h).hasDescription&&T(D.alt)&&(A.alt=D.alt),v.hasAccessibilityOptions&&(A.isDecorative=D.isDecorative||A.isDecorative||!1),v.hasImageTitle&&T(D.title)&&(A.title=D.title),v.hasDimensions&&(T(D.width)&&(A.dimensions.width=D.width),T(D.height)&&(A.dimensions.height=D.height)),T(D.class)&&Pe(v.classList,D.class).each(function(e){A.classes=e.value}),v.hasImageCaption&&N(D.caption)&&(A.caption=D.caption),v.hasAdvTab&&(T(D.style)&&(A.style=D.style),T(D.vspace)&&(A.vspace=D.vspace),T(D.border)&&(A.border=D.border),T(D.hspace)&&(A.hspace=D.hspace),T(D.borderstyle)&&(A.borderstyle=D.borderstyle)),b.setData(y)),a=e,i=t,o=n,c=(s=(l=r).getData()).src.value,(u=s.src.meta||{}).width||u.height||!i.hasDimensions||(0<c.length?a.imageSize(c).then(function(e){o.open&&l.setData({dimensions:e})}).catch(function(e){return console.error(e)}):l.setData({dimensions:{width:"",height:""}})),m=t,d=n,p=(g=r).getData(),f=Pe(m.imageList,p.src.value),d.prevImage=f,g.setData({images:f.map(function(e){return e.value}).getOr("")})}function me(l,s,t,c){var e,n=c.getData();c.block("Uploading image"),(0<(e=n.fileinput).length?L.some(e[0]):L.none()).fold(function(){c.unblock()},function(n){function r(){c.unblock(),URL.revokeObjectURL(i)}function a(e){c.setData({src:{value:e,meta:{}}}),c.showTab("general"),ue(l,s,t,c)}var i=URL.createObjectURL(n),o=n;new Ae(function(e,t){var n=new FileReader;n.onload=function(){e(n.result)},n.onerror=function(){t(n.error.message)},n.readAsDataURL(o)}).then(function(e){var t=l.createBlobCache(n,i,e);s.automaticUploads?l.uploadImage(t).then(function(e){a(e.url),r()}).catch(function(e){r(),l.alertErr(e)}):(l.addToBlobCache(t),a(t.blobUri()),c.unblock())})})}function de(S,U,C){return function(e,t){var n,r,a,i,o,l,s,c,u,m,d,g,p,f,h,b,y,v,A,D,w;"src"===t.name?ue(S,U,C,e):"images"===t.name?(c=S,u=U,m=C,g=(d=e).getData(),(p=Pe(u.imageList,g.images)).each(function(e){""===g.alt||m.prevImage.map(function(e){return e.text===g.alt}).getOr(!1)?""===e.value?d.setData({src:e,alt:m.prevAlt}):d.setData({src:e,alt:e.text}):d.setData({src:e})}),m.prevImage=p,ue(c,u,m,d)):"alt"===t.name?C.prevAlt=e.getData().alt:"style"===t.name?(o=S,s=(l=e).getData(),y=o.parseStyle,v=o.serializeStyle,D=_(y((A=s).style)),(w=Ce({},A)).vspace=D["margin-top"]&&D["margin-bottom"]&&D["margin-top"]===D["margin-bottom"]?O(String(D["margin-top"])):"",w.hspace=D["margin-right"]&&D["margin-left"]&&D["margin-right"]===D["margin-left"]?O(String(D["margin-right"])):"",w.border=D["border-width"]?O(String(D["border-width"])):"",w.borderstyle=D["border-style"]?String(D["border-style"]):"",w.style=v(y(v(D))),l.setData(w)):"vspace"===t.name||"hspace"===t.name||"border"===t.name||"borderstyle"===t.name?(n=S,a=Ce(se(U.image),(r=e).getData()),f=n.normalizeCss,h=ce(a,!1),H(b=document.createElement("img"),"style",h.style),!R(b)&&""===h.hspace||V(b,h.hspace),!k(b)&&""===h.vspace||$(b,h.vspace),!z(b)&&""===h.border||J(b,h.border),!j(b,"borderStyle")&&""===h.borderStyle||K(b,h.borderStyle),i=f(b.getAttribute("style")),r.setData({style:i})):"fileinput"===t.name?me(S,U,C,e):"isDecorative"===t.name&&(e.getData().isDecorative?e.disable("alt"):e.enable("alt"))}}function ge(v){var t,n,r,a,i,o,l,s,c,A={onSubmit:function(n){return function(e){var t=Ce(se(n.image),e.getData());c.execCommand("mceUpdateImage",!1,ce(t,n.hasAccessibilityOptions)),c.editorUpload.uploadImagesAuto(),e.close()}},imageSize:function(e){return a=s.documentBaseURI.toAbsolute(e),new Ae(function(t){function n(e){r.onload=r.onerror=null,r.parentNode&&r.parentNode.removeChild(r),t(e)}var r=document.createElement("img");r.onload=function(){var e=x(r.width,r.clientWidth),t=x(r.height,r.clientHeight);n(Ae.resolve({width:e,height:t}))},r.onerror=function(){n(Ae.reject("Failed to get image dimensions for: "+a))};var e=r.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left="0px",e.width=e.height="auto",document.body.appendChild(r),r.src=a}).then(function(e){return{width:String(e.width),height:String(e.height)}});var a},addToBlobCache:function(e){l.editorUpload.blobCache.add(e)},createBlobCache:function(e,t,n){return o.editorUpload.blobCache.create({blob:e,blobUri:t,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,filename:e.name,base64:n.split(",")[1]})},alertErr:function(e){i.windowManager.alert(e)},normalizeCss:function(e){return te(a,e)},parseStyle:function(e){return r.dom.parseStyle(e)},serializeStyle:function(e,t){return n.dom.serializeStyle(e,t)},uploadImage:(t=n=r=a=i=o=l=s=c=v,function(e){return Ie(t).upload([e],!1).then(function(e){return 0===e.length?Ae.reject("Failed to upload image"):!1===e[0].status?Ae.reject(e[0].error.message):e[0]})})};return{open:function(){var i,r,t,e,a,n,o,l,s,c,u,m,d,g,p,f,h,b,y;r=v,a=Ne(function(e){return r.convertURL(e.value||e.url,"src")}),n=new Ae(function(t){var n=function(e){t(a(e).map(function(e){return S([[{text:"None",value:""}],e])}))},e=r.getParam("image_list",!1);T(e)?De.send({url:e,success:function(e){n(JSON.parse(e))}}):w(e)?e(n):n(e)}),o=Le(r.getParam("image_class_list")),l=r.getParam("image_advtab",!1,"boolean"),s=r.getParam("image_uploadtab",!0,"boolean"),c=D(r.getParam("images_upload_url")),u=D(r.getParam("images_upload_handler")),m=(e=ne(t=r))?Q(function(e){return te(t,e)},e):q(),d=r.getParam("image_description",!0,"boolean"),g=r.getParam("image_title",!1,"boolean"),p=I(r),f=r.getParam("image_caption",!1,"boolean"),h=r.getParam("a11y_advanced_options",!1,"boolean"),b=r.getParam("automatic_uploads",!0,"boolean"),y=L.some(r.getParam("image_prepend_url","","string")).filter(function(e){return T(e)&&0<e.length}),n.then(function(e){return{image:m,imageList:e,classList:o,hasAdvTab:l,hasUploadTab:s,hasUploadUrl:c,hasUploadHandler:u,hasDescription:d,hasImageTitle:g,hasDimensions:p,hasImageCaption:f,prependURL:y,hasAccessibilityOptions:h,automaticUploads:b}}).then((i=A,function(e){var t,n,r,a={prevImage:Pe((t=e).imageList,t.image.src),prevAlt:t.image.alt,open:!0};return{title:"Insert/Edit Image",size:"normal",body:(r=e).hasAdvTab||r.hasUploadUrl||r.hasUploadHandler?{type:"tabpanel",tabs:S([[Ee(r)],r.hasAdvTab?[_e(r)]:[],r.hasUploadTab&&(r.hasUploadUrl||r.hasUploadHandler)?[ke(r)]:[]])}:{type:"panel",items:Re(r)},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:se(e.image),onSubmit:i.onSubmit(e),onChange:de(i,e,a),onClose:(n=a,function(){n.open=!1})}})).then(v.windowManager.open)}}}function pe(b){b.addCommand("mceImage",ge(b).open),b.addCommand("mceUpdateImage",function(e,h){b.undoManager.transact(function(){var t,e,n,r,a,i,o,l,s,c,u,m,d,g,p;function f(){g.onload=g.onerror=null,m.selection&&(m.selection.select(g),m.nodeChanged())}e=h,(l=ne(t=b))?(n=Q(function(e){return te(t,e)},l),(r=y(y({},n),e)).src?(c=r,p=ne(s=t),Ue(function(e){return te(s,e)},c,p),s.dom.setAttrib(p,"src",p.getAttribute("src")),X(p.parentNode)?(u=p.parentNode,re(s,u),s.selection.select(p.parentNode)):(s.selection.select(p),m=s,d=c,(g=p).onload=function(){d.width||d.height||!I(m)||m.dom.setAttribs(g,{width:String(g.clientWidth),height:String(g.clientHeight)}),f()},g.onerror=f)):(a=t,(i=l)&&(o=a.dom.is(i.parentNode,"figure.image")?i.parentNode:i,a.dom.remove(o),a.focus(),a.nodeChanged(),a.dom.isEmpty(a.getBody())&&(a.setContent(""),a.selection.setCursorLocation())))):e.src&&ae(t,y(y({},q()),e))})})}function fe(i){return function(e){for(var t=e.length,n=function(e){e.attr("contenteditable",i?"true":null)};t--;){var r,a=e[t];(r=a.attr("class"))&&/\bimage\b/.test(r)&&(a.attr("contenteditable",i?"false":null),xe.each(a.getAll("figcaption"),n))}}}"undefined"!=typeof window||Function("return this;")();function he(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}var be,ye=he,ve=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Ae=tinymce.util.Tools.resolve("tinymce.util.Promise"),De=tinymce.util.Tools.resolve("tinymce.util.XHR"),we=ve.DOM,Se=function(e,t,n){n?(we.setAttrib(e,"role","presentation"),C(ye(e),"alt","")):(a===t?ye(e).dom.removeAttribute("alt"):C(ye(e),"alt",t),"presentation"===we.getAttrib(e,"role")&&we.setAttrib(e,"role",""))},Ue=function(e,t,n){var r=Q(e,n);Y(n,r,t,"caption",function(e,t,n){return B(r=e)?(o=r.parentNode,we.insertAfter(r,o),we.remove(o)):(a=r,i=we.create("figure",{class:"image"}),we.insertAfter(i,a),i.appendChild(a),i.appendChild(we.create("figcaption",{contentEditable:"true"},"Caption")),i.contentEditable="false"),0;var r,a,i,o}),Y(n,r,t,"src",H),Y(n,r,t,"title",H),Y(n,r,t,"width",G(0,e)),Y(n,r,t,"height",G(0,e)),Y(n,r,t,"class",H),Y(n,r,t,"style",ee(function(e,t){return H(e,"style",t),0},e)),Y(n,r,t,"hspace",ee(V,e)),Y(n,r,t,"vspace",ee($,e)),Y(n,r,t,"border",ee(J,e)),Y(n,r,t,"borderStyle",ee(K,e)),t.alt===r.alt&&t.isDecorative===r.isDecorative||Se(n,t.alt,t.isDecorative)},Ce=(be=function(e,t){return s(e)&&s(t)?Ce(e,t):t},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var a,i=e[r];for(a in i)h(i,a)&&(n[a]=be(n[a],i[a]))}return n}),Ie=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),xe=tinymce.util.Tools.resolve("tinymce.util.Tools"),Oe=function(e,i){var o=[];return xe.each(e,function(e){var t,n,r,a=T((t=e).text)?t.text:T(t.title)?t.title:"";void 0!==e.menu?(n=Oe(e.menu,i),o.push({text:a,items:n})):(r=i(e),o.push({text:a,value:r}))}),o},Te=function(e,a){return function(e){for(var t,n=0;n<e.length;n++){var r=h(t=e[n],"items")?Te(t.items,a):t.value===a?L.some(t):L.none();if(r.isSome())return r}return L.none()}(e)},Ne=oe,Le=function(e){return oe(ie)(e)},Pe=function(e,t){return e.bind(function(e){return Te(e,t)})},_e=function(e){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:"listbox",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"}]}]}]}},Ee=function(e){return{title:"General",name:"general",items:le(e)}},Re=le,ke=function(e){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}};o.add("image",function(e){var t,n;(t=e).on("PreInit",function(){t.parser.addNodeFilter("figure",fe(!0)),t.serializer.addNodeFilter("figure",fe(!1))}),(n=e).ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:ge(n).open,onSetup:function(e){return n.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),n.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:ge(n).open}),n.ui.registry.addContextMenu("image",{update:function(e){return X(e)||"IMG"===e.nodeName&&!E(e)?["image"]:[]}}),pe(e)})}();
9
+ !function(){"use strict";function e(r){return function(e){return n=typeof(t=e),(null===t?"null":"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)===r;var t,n}}function t(t){return function(e){return typeof e===t}}function D(e){return!(null==e)}function l(){}function a(e){return function(){return e}}function n(e){return e}function r(){return g}var i,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=function(){return(v=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},T=e("string"),s=e("object"),c=e("array"),N=t("boolean"),w=t("function"),u=t("number"),m=a(!1),d=a(!(i=null)),g={fold:function(e,t){return e()},isSome:m,isNone:d,getOr:n,getOrThunk:p,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(void 0),or:n,orThunk:p,map:r,each:l,bind:r,exists:m,forall:d,filter:function(){return g},toArray:function(){return[]},toString:a("none()")};function p(e){return e()}function f(e,a,o,l){return function(e){for(var t=y(e),n=0,r=t.length;n<r;n++){var i=t[n];!function(e,t){(a(e,t)?o:l)(e,t)}(e[i],i)}}(e),1}function h(e,t){return A.call(e,t)}function S(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!c(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);U.apply(t,e[n])}return t}var b=function(n){function e(){return i}function t(e){return e(n)}var r=a(n),i={fold:function(e,t){return t(n)},isSome:d,isNone:m,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return b(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?i:g},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return i},L={some:b,none:r,from:function(e){return null==e?g:b(e)}},y=Object.keys,A=Object.hasOwnProperty,U=Array.prototype.push;function I(e,t,n){!function(e,t,n){if(!(T(n)||N(n)||u(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}(e.dom,t,n)}function C(e){return e.getParam("image_dimensions",!0,"boolean")}function x(e,t){return Math.max(parseInt(e,10),parseInt(t,10))}function O(e){return e&&e.replace(/px$/,"")}function P(e){return 0<e.length&&/^[0-9]+$/.test(e)&&(e+="px"),e}function _(e){if(e.margin){var t=String(e.margin).split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e}function E(e){return"IMG"===e.nodeName&&(e.hasAttribute("data-mce-object")||e.hasAttribute("data-mce-placeholder"))}function R(e,t){return we.isDomSafe(t,"img",e.settings)}function k(e){return e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?O(e.style.marginLeft):""}function z(e){return e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?O(e.style.marginTop):""}function M(e){return e.style.borderWidth?O(e.style.borderWidth):""}function j(e,t){return e.hasAttribute(t)?e.getAttribute(t):""}function B(e,t){return e.style[t]||""}function H(e){return null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName}function F(e,t,n){""===n?e.removeAttribute(t):e.setAttribute(t,n)}function G(e,t){var n=e.getAttribute("style"),r=t(null!==n?n:"");0<r.length?(e.setAttribute("style",r),e.setAttribute("data-mce-style",r)):e.removeAttribute("style")}function W(e,r){return function(e,t,n){e.style[t]?(e.style[t]=P(n),G(e,r)):F(e,t,n)}}function V(e,t){return e.style[t]?O(e.style[t]):j(e,t)}function $(e,t){var n=P(t);e.style.marginLeft=n,e.style.marginRight=n}function J(e,t){var n=P(t);e.style.marginTop=n,e.style.marginBottom=n}function K(e,t){var n=P(t);e.style.borderWidth=n}function X(e,t){e.style.borderStyle=t}function Z(e){return"FIGURE"===e.nodeName}function q(e){return 0===Ue.getAttrib(e,"alt").length&&"presentation"===Ue.getAttrib(e,"role")}function Q(){return{src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}}function Y(e,t){return{src:j(t,"src"),alt:q(n=t)?"":j(n,"alt"),title:j(t,"title"),width:V(t,"width"),height:V(t,"height"),class:j(t,"class"),style:e(j(t,"style")),caption:H(t),hspace:k(t),vspace:z(t),border:M(t),borderStyle:B(t,"borderStyle"),isDecorative:q(t)};var n}function ee(e,t,n,r,i){n[r]!==t[r]&&i(e,r,n[r])}function te(r,i){return function(e,t,n){r(e,n),G(e,i)}}function ne(e,t){var n=_(e.dom.styles.parse(t)),r=e.dom.styles.parse(e.dom.styles.serialize(n));return e.dom.styles.serialize(r)}function re(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return n?e.dom.select("img",n)[0]:t&&("IMG"!==t.nodeName||E(t))?null:t}function ie(n,e){var r,t,i=n.dom,a=(f(n.schema.getTextBlockElements(),function(e,t){return!n.schema.isValidChild(t,"figure")},(r=t={},function(e,t){r[t]=e}),l),t),o=i.getParent(e.parentNode,function(e){return h(t=a,n=e.nodeName)&&null!=t[n];var t,n},n.getBody());return o?i.split(o,e):e}function ae(r,e){var t=function(e){var t=document.createElement("img");if(Ce(function(e){return ne(r,e)},v(v({},e),{caption:!1}),t),Ie(t,e.alt,e.isDecorative),e.caption){var n=Ue.create("figure",{class:"image"});return n.appendChild(t),n.appendChild(Ue.create("figcaption",{contentEditable:"true"},"Caption")),n.contentEditable="false",n}return t}(e);r.dom.setAttrib(t,"data-mce-id","__mcenew"),r.focus(),r.selection.setContent(t.outerHTML);var n,i=r.dom.select('*[data-mce-id="__mcenew"]')[0];r.dom.setAttrib(i,"data-mce-id",null),Z(i)?(n=ie(r,i),r.selection.select(n)):r.selection.select(i)}function oe(t,e){var n,r,i,a,o,l,s,c,u,m,d,g,p,f,h,b=re(t);function y(){f.onload=f.onerror=null,g.selection&&(g.selection.select(f),g.nodeChanged())}b?(n=Y(function(e){return ne(t,e)},b),r=v(v({},n),e),s=t,c=r.src,i=v(v({},r),{src:R(s,c)?c:""}),r.src?(m=i,h=re(u=t),Ce(function(e){return ne(u,e)},m,h),u.dom.setAttrib(h,"src",h.getAttribute("src")),Z(h.parentNode)?(d=h.parentNode,ie(u,d),u.selection.select(h.parentNode)):(u.selection.select(h),g=u,p=m,(f=h).onload=function(){p.width||p.height||!C(g)||g.dom.setAttribs(f,{width:String(f.clientWidth),height:String(f.clientHeight)}),y()},f.onerror=y)):(a=t,(o=b)&&(l=a.dom.is(o.parentNode,"figure.image")?o.parentNode:o,a.dom.remove(l),a.focus(),a.nodeChanged(),a.dom.isEmpty(a.getBody())&&(a.setContent(""),a.selection.setCursorLocation())))):e.src&&ae(t,v(v({},Q()),e))}function le(e){return T(e.value)?e.value:""}function se(t){return void 0===t&&(t=le),function(e){return e?L.from(e).map(function(e){return Ne(e,t)}):L.none()}}function ce(e){var t=e.imageList.map(function(e){return{name:"images",type:"listbox",label:"Image list",items:e}}),n={name:"alt",type:"input",label:"Alternative description",disabled:e.hasAccessibilityOptions&&e.image.isDecorative},r=e.classList.map(function(e){return{name:"classes",type:"listbox",label:"Class",items:e}});return S([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],t.toArray(),e.hasAccessibilityOptions&&e.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],e.hasDescription?[n]:[],e.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],e.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[v(v({},e.classList.isSome()&&e.hasImageCaption?{type:"grid",columns:2}:{type:"panel"}),{items:S([r.toArray(),e.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])})]])}function ue(e){return{src:{value:e.src,meta:{}},images:e.src,alt:e.alt,title:e.title,dimensions:{width:e.width,height:e.height},classes:e.class,caption:e.caption,style:e.style,vspace:e.vspace,border:e.border,hspace:e.hspace,borderstyle:e.borderStyle,fileinput:[],isDecorative:e.isDecorative}}function me(e,t){return{src:e.src.value,alt:0===e.alt.length&&t?null:e.alt,title:e.title,width:e.dimensions.width,height:e.dimensions.height,class:e.classes,style:e.style,caption:e.caption,hspace:e.hspace,vspace:e.vspace,border:e.border,borderStyle:e.borderstyle,isDecorative:e.isDecorative}}function de(e,t,n,r){var i,a,o,l,s,c,u,m,d,g,p,f,h,b,y,v,A,D,w,S,U,I,C,x,O;U=t,C=(I=r).getData(),x=U,O=C.src.value,(/^(?:[a-zA-Z]+:)?\/\//.test(O)?L.none():x.prependURL.bind(function(e){return O.substring(0,e.length)!==e?L.some(e+O):L.none()})).each(function(e){I.setData({src:{value:e,meta:C.src.meta}})}),h=t,w=(b=r).getData(),void 0!==(S=w.src.meta)&&(y=xe({},w),A=y,D=S,(v=h).hasDescription&&T(D.alt)&&(A.alt=D.alt),v.hasAccessibilityOptions&&(A.isDecorative=D.isDecorative||A.isDecorative||!1),v.hasImageTitle&&T(D.title)&&(A.title=D.title),v.hasDimensions&&(T(D.width)&&(A.dimensions.width=D.width),T(D.height)&&(A.dimensions.height=D.height)),T(D.class)&&Ee(v.classList,D.class).each(function(e){A.classes=e.value}),v.hasImageCaption&&N(D.caption)&&(A.caption=D.caption),v.hasAdvTab&&(T(D.style)&&(A.style=D.style),T(D.vspace)&&(A.vspace=D.vspace),T(D.border)&&(A.border=D.border),T(D.hspace)&&(A.hspace=D.hspace),T(D.borderstyle)&&(A.borderstyle=D.borderstyle)),b.setData(y)),i=e,a=t,o=n,c=(s=(l=r).getData()).src.value,(u=s.src.meta||{}).width||u.height||!a.hasDimensions||(0<c.length?i.imageSize(c).then(function(e){o.open&&l.setData({dimensions:e})}).catch(function(e){return console.error(e)}):l.setData({dimensions:{width:"",height:""}})),m=t,d=n,p=(g=r).getData(),f=Ee(m.imageList,p.src.value),d.prevImage=f,g.setData({images:f.map(function(e){return e.value}).getOr("")})}function ge(l,s,t,c){var e,n=c.getData();c.block("Uploading image"),(0<(e=n.fileinput).length?L.some(e[0]):L.none()).fold(function(){c.unblock()},function(n){function r(){c.unblock(),URL.revokeObjectURL(a)}function i(e){c.setData({src:{value:e,meta:{}}}),c.showTab("general"),de(l,s,t,c)}var a=URL.createObjectURL(n),o=n;new De(function(e,t){var n=new FileReader;n.onload=function(){e(n.result)},n.onerror=function(){t(n.error.message)},n.readAsDataURL(o)}).then(function(e){var t=l.createBlobCache(n,a,e);s.automaticUploads?l.uploadImage(t).then(function(e){i(e.url),r()}).catch(function(e){r(),l.alertErr(e)}):(l.addToBlobCache(t),i(t.blobUri()),c.unblock())})})}function pe(S,U,I){return function(e,t){var n,r,i,a,o,l,s,c,u,m,d,g,p,f,h,b,y,v,A,D,w;"src"===t.name?de(S,U,I,e):"images"===t.name?(c=S,u=U,m=I,g=(d=e).getData(),(p=Ee(u.imageList,g.images)).each(function(e){""===g.alt||m.prevImage.map(function(e){return e.text===g.alt}).getOr(!1)?""===e.value?d.setData({src:e,alt:m.prevAlt}):d.setData({src:e,alt:e.text}):d.setData({src:e})}),m.prevImage=p,de(c,u,m,d)):"alt"===t.name?I.prevAlt=e.getData().alt:"style"===t.name?(o=S,s=(l=e).getData(),y=o.parseStyle,v=o.serializeStyle,D=_(y((A=s).style)),(w=xe({},A)).vspace=D["margin-top"]&&D["margin-bottom"]&&D["margin-top"]===D["margin-bottom"]?O(String(D["margin-top"])):"",w.hspace=D["margin-right"]&&D["margin-left"]&&D["margin-right"]===D["margin-left"]?O(String(D["margin-right"])):"",w.border=D["border-width"]?O(String(D["border-width"])):"",w.borderstyle=D["border-style"]?String(D["border-style"]):"",w.style=v(y(v(D))),l.setData(w)):"vspace"===t.name||"hspace"===t.name||"border"===t.name||"borderstyle"===t.name?(n=S,i=xe(ue(U.image),(r=e).getData()),f=n.normalizeCss,h=me(i,!1),F(b=document.createElement("img"),"style",h.style),!k(b)&&""===h.hspace||$(b,h.hspace),!z(b)&&""===h.vspace||J(b,h.vspace),!M(b)&&""===h.border||K(b,h.border),!B(b,"borderStyle")&&""===h.borderStyle||X(b,h.borderStyle),a=f(b.getAttribute("style")),r.setData({style:a})):"fileinput"===t.name?ge(S,U,I,e):"isDecorative"===t.name&&(e.getData().isDecorative?e.disable("alt"):e.enable("alt"))}}function fe(v){var t,n,r,i,a,o,l,s,c,A={onSubmit:function(n){return function(e){var t=xe(ue(n.image),e.getData());c.execCommand("mceUpdateImage",!1,me(t,n.hasAccessibilityOptions)),c.editorUpload.uploadImagesAuto(),e.close()}},imageSize:function(e){return R(s,e)?(i=s.documentBaseURI.toAbsolute(e),new De(function(t){function n(e){r.onload=r.onerror=null,r.parentNode&&r.parentNode.removeChild(r),t(e)}var r=document.createElement("img");r.onload=function(){var e=x(r.width,r.clientWidth),t=x(r.height,r.clientHeight);n(De.resolve({width:e,height:t}))},r.onerror=function(){n(De.reject("Failed to get image dimensions for: "+i))};var e=r.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left="0px",e.width=e.height="auto",document.body.appendChild(r),r.src=i}).then(function(e){return{width:String(e.width),height:String(e.height)}})):De.resolve({width:"",height:""});var i},addToBlobCache:function(e){l.editorUpload.blobCache.add(e)},createBlobCache:function(e,t,n){return o.editorUpload.blobCache.create({blob:e,blobUri:t,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,filename:e.name,base64:n.split(",")[1]})},alertErr:function(e){a.windowManager.alert(e)},normalizeCss:function(e){return ne(i,e)},parseStyle:function(e){return r.dom.parseStyle(e)},serializeStyle:function(e,t){return n.dom.serializeStyle(e,t)},uploadImage:(t=n=r=i=a=o=l=s=c=v,function(e){return Oe(t).upload([e],!1).then(function(e){return 0===e.length?De.reject("Failed to upload image"):!1===e[0].status?De.reject(e[0].error.message):e[0]})})};return{open:function(){var a,r,t,e,i,n,o,l,s,c,u,m,d,g,p,f,h,b,y;r=v,i=Pe(function(e){return r.convertURL(e.value||e.url,"src")}),n=new De(function(t){var n=function(e){t(i(e).map(function(e){return S([[{text:"None",value:""}],e])}))},e=r.getParam("image_list",!1);T(e)?Se.send({url:e,success:function(e){n(JSON.parse(e))}}):w(e)?e(n):n(e)}),o=_e(r.getParam("image_class_list")),l=r.getParam("image_advtab",!1,"boolean"),s=r.getParam("image_uploadtab",!0,"boolean"),c=D(r.getParam("images_upload_url")),u=D(r.getParam("images_upload_handler")),m=(e=re(t=r))?Y(function(e){return ne(t,e)},e):Q(),d=r.getParam("image_description",!0,"boolean"),g=r.getParam("image_title",!1,"boolean"),p=C(r),f=r.getParam("image_caption",!1,"boolean"),h=r.getParam("a11y_advanced_options",!1,"boolean"),b=r.getParam("automatic_uploads",!0,"boolean"),y=L.some(r.getParam("image_prepend_url","","string")).filter(function(e){return T(e)&&0<e.length}),n.then(function(e){return{image:m,imageList:e,classList:o,hasAdvTab:l,hasUploadTab:s,hasUploadUrl:c,hasUploadHandler:u,hasDescription:d,hasImageTitle:g,hasDimensions:p,hasImageCaption:f,prependURL:y,hasAccessibilityOptions:h,automaticUploads:b}}).then((a=A,function(e){var t,n,r,i={prevImage:Ee((t=e).imageList,t.image.src),prevAlt:t.image.alt,open:!0};return{title:"Insert/Edit Image",size:"normal",body:(r=e).hasAdvTab||r.hasUploadUrl||r.hasUploadHandler?{type:"tabpanel",tabs:S([[ke(r)],r.hasAdvTab?[Re(r)]:[],r.hasUploadTab&&(r.hasUploadUrl||r.hasUploadHandler)?[Me(r)]:[]])}:{type:"panel",items:ze(r)},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:ue(e.image),onSubmit:a.onSubmit(e),onChange:pe(a,e,i),onClose:(n=i,function(){n.open=!1})}})).then(v.windowManager.open)}}}function he(a){return function(e){for(var t=e.length,n=function(e){e.attr("contenteditable",a?"true":null)};t--;){var r,i=e[t];(r=i.attr("class"))&&/\bimage\b/.test(r)&&(i.attr("contenteditable",a?"false":null),Te.each(i.getAll("figcaption"),n))}}}"undefined"!=typeof window||Function("return this;")();function be(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}var ye,ve=be,Ae=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),De=tinymce.util.Tools.resolve("tinymce.util.Promise"),we=tinymce.util.Tools.resolve("tinymce.util.URI"),Se=tinymce.util.Tools.resolve("tinymce.util.XHR"),Ue=Ae.DOM,Ie=function(e,t,n){n?(Ue.setAttrib(e,"role","presentation"),I(ve(e),"alt","")):(i===t?ve(e).dom.removeAttribute("alt"):I(ve(e),"alt",t),"presentation"===Ue.getAttrib(e,"role")&&Ue.setAttrib(e,"role",""))},Ce=function(e,t,n){var r=Y(e,n);ee(n,r,t,"caption",function(e,t,n){return H(r=e)?(o=r.parentNode,Ue.insertAfter(r,o),Ue.remove(o)):(i=r,a=Ue.create("figure",{class:"image"}),Ue.insertAfter(a,i),a.appendChild(i),a.appendChild(Ue.create("figcaption",{contentEditable:"true"},"Caption")),a.contentEditable="false"),0;var r,i,a,o}),ee(n,r,t,"src",F),ee(n,r,t,"title",F),ee(n,r,t,"width",W(0,e)),ee(n,r,t,"height",W(0,e)),ee(n,r,t,"class",F),ee(n,r,t,"style",te(function(e,t){return F(e,"style",t),0},e)),ee(n,r,t,"hspace",te($,e)),ee(n,r,t,"vspace",te(J,e)),ee(n,r,t,"border",te(K,e)),ee(n,r,t,"borderStyle",te(X,e)),t.alt===r.alt&&t.isDecorative===r.isDecorative||Ie(n,t.alt,t.isDecorative)},xe=(ye=function(e,t){return s(e)&&s(t)?xe(e,t):t},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var i,a=e[r];for(i in a)h(a,i)&&(n[i]=ye(n[i],a[i]))}return n}),Oe=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),Te=tinymce.util.Tools.resolve("tinymce.util.Tools"),Ne=function(e,a){var o=[];return Te.each(e,function(e){var t,n,r,i=T((t=e).text)?t.text:T(t.title)?t.title:"";void 0!==e.menu?(n=Ne(e.menu,a),o.push({text:i,items:n})):(r=a(e),o.push({text:i,value:r}))}),o},Le=function(e,i){return function(e){for(var t,n=0;n<e.length;n++){var r=h(t=e[n],"items")?Le(t.items,i):t.value===i?L.some(t):L.none();if(r.isSome())return r}return L.none()}(e)},Pe=se,_e=function(e){return se(le)(e)},Ee=function(e,t){return e.bind(function(e){return Le(e,t)})},Re=function(e){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:"listbox",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"}]}]}]}},ke=function(e){return{title:"General",name:"general",items:ce(e)}},ze=ce,Me=function(e){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}};o.add("image",function(e){var t,n,r;(t=e).on("PreInit",function(){t.parser.addNodeFilter("figure",he(!0)),t.serializer.addNodeFilter("figure",he(!1))}),(n=e).ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:fe(n).open,onSetup:function(e){return e.setActive(D(re(n))),n.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),n.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:fe(n).open}),n.ui.registry.addContextMenu("image",{update:function(e){return Z(e)||"IMG"===e.nodeName&&!E(e)?["image"]:[]}}),(r=e).addCommand("mceImage",fe(r).open),r.addCommand("mceUpdateImage",function(e,t){r.undoManager.transact(function(){return oe(r,t)})})})}();