@lotte-innovate/ui-component-test 0.0.114 → 0.0.115

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,2 @@
1
- import{__require as i}from"../public/tinymce/plugins/code/index.mjs";i();
1
+ import{__require as i}from"../public/tinymce/plugins/link/index.mjs";i();
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- import{__require as m}from"../public/tinymce/models/dom/index.mjs";m();
1
+ import{__require as i}from"../public/tinymce/plugins/advlist/index.mjs";i();
2
2
  //# sourceMappingURL=index11.mjs.map
@@ -1,2 +1,2 @@
1
- import{__require as i}from"../public/tinymce/plugins/link/index.mjs";i();
1
+ import{__require as i}from"../public/tinymce/plugins/code/index.mjs";i();
2
2
  //# sourceMappingURL=index3.mjs.map
@@ -1,2 +1,2 @@
1
- import{__require as i}from"../public/tinymce/plugins/advlist/index.mjs";i();
1
+ import{__require as i}from"../public/tinymce/plugins/table/index.mjs";i();
2
2
  //# sourceMappingURL=index5.mjs.map
@@ -1,2 +1,2 @@
1
- import{__require as i}from"../public/tinymce/plugins/table/index.mjs";i();
1
+ import{__require as m}from"../public/tinymce/models/dom/index.mjs";m();
2
2
  //# sourceMappingURL=index9.mjs.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{jsx as t}from"react/jsx-runtime";import{forwardRef as i,useEffect as r}from"react";import{cva as e}from"class-variance-authority";import{scalingVariants as n}from"../../constants.mjs";import o from"tinymce";import"../../../public/tinymce/icons/default/icons.mjs";import"../../../_virtual/index13.mjs";import"../../../_virtual/index11.mjs";import"../../../public/tinymce/skins/ui/oxide/skin.mjs";import"../../../_virtual/index5.mjs";import"../../../_virtual/index.mjs";import"../../../_virtual/index3.mjs";import"../../../_virtual/index7.mjs";import"../../../_virtual/index9.mjs";import"../../../public/tinymce/skins/ui/oxide/content.mjs";import"../../../public/tinymce/skins/content/default/content.mjs";var a=function(){return a=Object.assign||function(t){for(var i,r=1,e=arguments.length;r<e;r++)for(var n in i=arguments[r])Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n]);return t},a.apply(this,arguments)},c=function(t,i){var r={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.indexOf(e)<0&&(r[e]=t[e]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(e=Object.getOwnPropertySymbols(t);n<e.length;n++)i.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n])&&(r[e[n]]=t[e[n]])}return r};e("",{variants:{scaling:a({},n),size:{small:"w-[500px] h-[350px]",medium:"w-[550px] h-[400px]",large:"w-[600px] h-[450px]"}},defaultVariants:{scaling:"100%",size:"medium"}});var m=function(){"undefined"!=typeof window&&o.init({selector:"#tinymce",plugins:"link table code",toolbar:"undo redo | formatselect | bold italic | alignleft aligncenter alignright | code",skin:!1,tinymceScriptSrc:"",src:""})},s=i((function(i,e){return i.className,i.size,i.scaling,i.tinymceScriptSrc,c(i,["className","size","scaling","tinymceScriptSrc"]),r((function(){m()}),[]),t("textarea",{id:"tinymce",ref:e})}));s.displayName="Editor";export{s as Editor,s as default,m as initTinyMCE};
2
+ import{jsx as t}from"react/jsx-runtime";import{forwardRef as i,useEffect as r}from"react";import{cva as e}from"class-variance-authority";import{scalingVariants as n}from"../../constants.mjs";import o from"tinymce";import"../../../public/tinymce/icons/default/icons.mjs";import"../../../_virtual/index13.mjs";import"../../../_virtual/index9.mjs";import"../../../public/tinymce/skins/ui/oxide/skin.mjs";import"../../../_virtual/index11.mjs";import"../../../_virtual/index3.mjs";import"../../../_virtual/index.mjs";import"../../../_virtual/index7.mjs";import"../../../_virtual/index5.mjs";import"../../../public/tinymce/skins/ui/oxide/content.mjs";import"../../../public/tinymce/skins/content/default/content.mjs";var a=function(){return a=Object.assign||function(t){for(var i,r=1,e=arguments.length;r<e;r++)for(var n in i=arguments[r])Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n]);return t},a.apply(this,arguments)},c=function(t,i){var r={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.indexOf(e)<0&&(r[e]=t[e]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(e=Object.getOwnPropertySymbols(t);n<e.length;n++)i.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n])&&(r[e[n]]=t[e[n]])}return r};e("",{variants:{scaling:a({},n),size:{small:"w-[500px] h-[350px]",medium:"w-[550px] h-[400px]",large:"w-[600px] h-[450px]"}},defaultVariants:{scaling:"100%",size:"medium"}});var m=function(){"undefined"!=typeof window&&o.init({selector:"#tinymce",plugins:"link table code",toolbar:"undo redo | formatselect | bold italic | alignleft aligncenter alignright | code",skin:!1,tinymceScriptSrc:"",src:""})},s=i((function(i,e){return i.className,i.size,i.scaling,i.tinymceScriptSrc,c(i,["className","size","scaling","tinymceScriptSrc"]),r((function(){m()}),[]),t("textarea",{id:"tinymce",ref:e})}));s.displayName="Editor";export{s as Editor,s as default,m as initTinyMCE};
3
3
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- import{__exports as r}from"../../../../_virtual/index12.mjs";import{__require as e}from"./model.mjs";var o;function i(){return o||(o=1,e()),r}export{i as __require};
1
+ import{__exports as r}from"../../../../_virtual/index10.mjs";import{__require as e}from"./model.mjs";var o;function i(){return o||(o=1,e()),r}export{i as __require};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- import{__exports as r}from"../../../../_virtual/index6.mjs";import{__require as e}from"./plugin.mjs";var i;function o(){return i||(i=1,e()),r}export{o as __require};
1
+ import{__exports as r}from"../../../../_virtual/index12.mjs";import{__require as e}from"./plugin.mjs";var i;function o(){return i||(i=1,e()),r}export{o as __require};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../public/tinymce/plugins/advlist/index.js"],"sourcesContent":["\"use strict\";\n// Exports the \"advlist\" plugin for usage with module loaders\n// Usage:\n// CommonJS:\n// require('tinymce/plugins/advlist')\n// ES2015:\n// import 'tinymce/plugins/advlist'\nrequire('./plugin.js');\n"],"names":["require$$0"],"mappings":"uIAOsBA"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../public/tinymce/plugins/advlist/index.js"],"sourcesContent":["\"use strict\";\n// Exports the \"advlist\" plugin for usage with module loaders\n// Usage:\n// CommonJS:\n// require('tinymce/plugins/advlist')\n// ES2015:\n// import 'tinymce/plugins/advlist'\nrequire('./plugin.js');\n"],"names":["require$$0"],"mappings":"wIAOsBA"}
@@ -1,2 +1,2 @@
1
- import{__exports as t}from"../../../../_virtual/plugin3.mjs";var e;function n(){return e||(e=1,function(){var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t,e,n){var r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===n?null:{"list-style-type":n})},n=function(t){return function(e){return e.options.get(t)}},r=n("advlist_number_styles"),o=n("advlist_bullet_styles"),i=function(t){return null==t},u=function(t){return!i(t)},s=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(){function t(t,e){this.tag=t,this.value=e}return t.some=function(e){return new t(!0,e)},t.none=function(){return t.singletonNone},t.prototype.fold=function(t,e){return this.tag?e(this.value):t()},t.prototype.isSome=function(){return this.tag},t.prototype.isNone=function(){return!this.tag},t.prototype.map=function(e){return this.tag?t.some(e(this.value)):t.none()},t.prototype.bind=function(e){return this.tag?e(this.value):t.none()},t.prototype.exists=function(t){return this.tag&&t(this.value)},t.prototype.forall=function(t){return!this.tag||t(this.value)},t.prototype.filter=function(e){return!this.tag||e(this.value)?this:t.none()},t.prototype.getOr=function(t){return this.tag?this.value:t},t.prototype.or=function(t){return this.tag?this:t},t.prototype.getOrThunk=function(t){return this.tag?this.value:t()},t.prototype.orThunk=function(t){return this.tag?this:t()},t.prototype.getOrDie=function(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")},t.from=function(e){return u(e)?t.some(e):t.none()},t.prototype.getOrNull=function(){return this.tag?this.value:null},t.prototype.getOrUndefined=function(){return this.value},t.prototype.each=function(t){this.tag&&t(this.value)},t.prototype.toArray=function(){return this.tag?[this.value]:[]},t.prototype.toString=function(){return this.tag?"some(".concat(this.value,")"):"none()"},t}();l.singletonNone=new l(!1);var a=function(t){return function(e){return u(e)&&t.test(e.nodeName)}},c=a(/^(OL|UL|DL)$/),f=a(/^(TH|TD)$/),p=function(t,e,n){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return l.some(i);if(n(i,r))break}return l.none()}(e,(function(t){return c(t)&&!/\btox\-/.test(t.className)}),f).exists((function(e){return e.nodeName===n&&function(t,e){return t.dom.isChildOf(e,t.getBody())}(t,e)}))},d=function(t){return i(t)||"default"===t?"":t},g=function(t,e){return function(n){return function(t,e){var n=t.selection.getNode();return e({parents:t.dom.getParents(n),element:n}),t.on("NodeChange",e),function(){return t.off("NodeChange",e)}}(t,(function(r){return function(t,r){var o=t.selection.getStart(!0);n.setActive(p(t,r,e)),n.setEnabled(!function(t,e){var n=t.dom.getParent(e,"ol,ul,dl");return function(t,e){return null!==e&&!t.dom.isEditable(e)}(t,n)&&t.selection.isEditable()}(t,o)&&t.selection.isEditable())}(t,r.parents)}))}},h=function(t,n,r,o,i,u){t.ui.registry.addSplitButton(n,{tooltip:r,icon:"OL"===i?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(t){t(s.map(u,(function(t){var e="OL"===i?"num":"bull",n="disc"===t||"decimal"===t?"default":t,r=d(t),o=function(t){return t.replace(/\-/g," ").replace(/\b\w/g,(function(t){return t.toUpperCase()}))}(t);return{type:"choiceitem",value:r,icon:"list-"+e+"-"+n,text:o}})))},onAction:function(){return t.execCommand(o)},onItemAction:function(n,r){e(t,i,r)},select:function(e){var n=function(t){var e=t.dom.getParent(t.selection.getNode(),"ol,ul"),n=t.dom.getStyle(e,"listStyleType");return l.from(n)}(t);return n.map((function(t){return e===t})).getOr(!1)},onSetup:g(t,i)})},m=function(t,n,r,o,i,u){u.length>1?h(t,n,r,o,i,u):function(t,n,r,o,i,u){t.ui.registry.addToggleButton(n,{active:!1,tooltip:r,icon:"OL"===i?"ordered-list":"unordered-list",onSetup:g(t,i),onAction:function(){return t.queryCommandState(o)||""===u?t.execCommand(o):e(t,i,u)}})}(t,n,r,o,i,d(u[0]))};t.add("advlist",(function(t){t.hasPlugin("lists")?(function(t){var e=t.options.register;e("advlist_number_styles",{processor:"string[]",default:"default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman".split(",")}),e("advlist_bullet_styles",{processor:"string[]",default:"default,circle,square".split(",")})}(t),function(t){m(t,"numlist","Numbered list","InsertOrderedList","OL",r(t)),m(t,"bullist","Bullet list","InsertUnorderedList","UL",o(t))}(t),function(t){t.addCommand("ApplyUnorderedListStyle",(function(n,r){e(t,"UL",r["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",(function(n,r){e(t,"OL",r["list-style-type"])}))}(t)):console.error("Please use the Lists plugin together with the Advanced List plugin.")}))}()),t}export{n as __require};
1
+ import{__exports as t}from"../../../../_virtual/plugin5.mjs";var e;function n(){return e||(e=1,function(){var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t,e,n){var r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===n?null:{"list-style-type":n})},n=function(t){return function(e){return e.options.get(t)}},r=n("advlist_number_styles"),o=n("advlist_bullet_styles"),i=function(t){return null==t},u=function(t){return!i(t)},s=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(){function t(t,e){this.tag=t,this.value=e}return t.some=function(e){return new t(!0,e)},t.none=function(){return t.singletonNone},t.prototype.fold=function(t,e){return this.tag?e(this.value):t()},t.prototype.isSome=function(){return this.tag},t.prototype.isNone=function(){return!this.tag},t.prototype.map=function(e){return this.tag?t.some(e(this.value)):t.none()},t.prototype.bind=function(e){return this.tag?e(this.value):t.none()},t.prototype.exists=function(t){return this.tag&&t(this.value)},t.prototype.forall=function(t){return!this.tag||t(this.value)},t.prototype.filter=function(e){return!this.tag||e(this.value)?this:t.none()},t.prototype.getOr=function(t){return this.tag?this.value:t},t.prototype.or=function(t){return this.tag?this:t},t.prototype.getOrThunk=function(t){return this.tag?this.value:t()},t.prototype.orThunk=function(t){return this.tag?this:t()},t.prototype.getOrDie=function(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")},t.from=function(e){return u(e)?t.some(e):t.none()},t.prototype.getOrNull=function(){return this.tag?this.value:null},t.prototype.getOrUndefined=function(){return this.value},t.prototype.each=function(t){this.tag&&t(this.value)},t.prototype.toArray=function(){return this.tag?[this.value]:[]},t.prototype.toString=function(){return this.tag?"some(".concat(this.value,")"):"none()"},t}();l.singletonNone=new l(!1);var a=function(t){return function(e){return u(e)&&t.test(e.nodeName)}},c=a(/^(OL|UL|DL)$/),f=a(/^(TH|TD)$/),p=function(t,e,n){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return l.some(i);if(n(i,r))break}return l.none()}(e,(function(t){return c(t)&&!/\btox\-/.test(t.className)}),f).exists((function(e){return e.nodeName===n&&function(t,e){return t.dom.isChildOf(e,t.getBody())}(t,e)}))},d=function(t){return i(t)||"default"===t?"":t},g=function(t,e){return function(n){return function(t,e){var n=t.selection.getNode();return e({parents:t.dom.getParents(n),element:n}),t.on("NodeChange",e),function(){return t.off("NodeChange",e)}}(t,(function(r){return function(t,r){var o=t.selection.getStart(!0);n.setActive(p(t,r,e)),n.setEnabled(!function(t,e){var n=t.dom.getParent(e,"ol,ul,dl");return function(t,e){return null!==e&&!t.dom.isEditable(e)}(t,n)&&t.selection.isEditable()}(t,o)&&t.selection.isEditable())}(t,r.parents)}))}},h=function(t,n,r,o,i,u){t.ui.registry.addSplitButton(n,{tooltip:r,icon:"OL"===i?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(t){t(s.map(u,(function(t){var e="OL"===i?"num":"bull",n="disc"===t||"decimal"===t?"default":t,r=d(t),o=function(t){return t.replace(/\-/g," ").replace(/\b\w/g,(function(t){return t.toUpperCase()}))}(t);return{type:"choiceitem",value:r,icon:"list-"+e+"-"+n,text:o}})))},onAction:function(){return t.execCommand(o)},onItemAction:function(n,r){e(t,i,r)},select:function(e){var n=function(t){var e=t.dom.getParent(t.selection.getNode(),"ol,ul"),n=t.dom.getStyle(e,"listStyleType");return l.from(n)}(t);return n.map((function(t){return e===t})).getOr(!1)},onSetup:g(t,i)})},m=function(t,n,r,o,i,u){u.length>1?h(t,n,r,o,i,u):function(t,n,r,o,i,u){t.ui.registry.addToggleButton(n,{active:!1,tooltip:r,icon:"OL"===i?"ordered-list":"unordered-list",onSetup:g(t,i),onAction:function(){return t.queryCommandState(o)||""===u?t.execCommand(o):e(t,i,u)}})}(t,n,r,o,i,d(u[0]))};t.add("advlist",(function(t){t.hasPlugin("lists")?(function(t){var e=t.options.register;e("advlist_number_styles",{processor:"string[]",default:"default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman".split(",")}),e("advlist_bullet_styles",{processor:"string[]",default:"default,circle,square".split(",")})}(t),function(t){m(t,"numlist","Numbered list","InsertOrderedList","OL",r(t)),m(t,"bullist","Bullet list","InsertUnorderedList","UL",o(t))}(t),function(t){t.addCommand("ApplyUnorderedListStyle",(function(n,r){e(t,"UL",r["list-style-type"])})),t.addCommand("ApplyOrderedListStyle",(function(n,r){e(t,"OL",r["list-style-type"])}))}(t)):console.error("Please use the Lists plugin together with the Advanced List plugin.")}))}()),t}export{n as __require};
2
2
  //# sourceMappingURL=plugin.mjs.map
@@ -1,2 +1,2 @@
1
- import{__exports as r}from"../../../../_virtual/index2.mjs";import{__require as e}from"./plugin.mjs";var i;function o(){return i||(i=1,e()),r}export{o as __require};
1
+ import{__exports as r}from"../../../../_virtual/index4.mjs";import{__require as e}from"./plugin.mjs";var i;function o(){return i||(i=1,e()),r}export{o as __require};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- import{__exports as e}from"../../../../_virtual/plugin.mjs";var t;function n(){return t||(t=1,tinymce.util.Tools.resolve("tinymce.PluginManager").add("code",(function(e){return function(e){e.addCommand("mceCodeEditor",(function(){!function(e){var t=function(e){return e.getContent({source_view:!0})}(e);e.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:t},onSubmit:function(t){!function(e,t){e.focus(),e.undoManager.transact((function(){e.setContent(t)})),e.selection.setCursorLocation(),e.nodeChanged()}(e,t.getData().code),t.close()}})}(e)}))}(e),function(e){var t=function(){return e.execCommand("mceCodeEditor")};e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:t}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:t})}(e),{}}))),e}export{n as __require};
1
+ import{__exports as e}from"../../../../_virtual/plugin2.mjs";var t;function n(){return t||(t=1,tinymce.util.Tools.resolve("tinymce.PluginManager").add("code",(function(e){return function(e){e.addCommand("mceCodeEditor",(function(){!function(e){var t=function(e){return e.getContent({source_view:!0})}(e);e.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:t},onSubmit:function(t){!function(e,t){e.focus(),e.undoManager.transact((function(){e.setContent(t)})),e.selection.setCursorLocation(),e.nodeChanged()}(e,t.getData().code),t.close()}})}(e)}))}(e),function(e){var t=function(){return e.execCommand("mceCodeEditor")};e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:t}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:t})}(e),{}}))),e}export{n as __require};
2
2
  //# sourceMappingURL=plugin.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.mjs","sources":["../../../../../public/tinymce/plugins/code/plugin.js"],"sourcesContent":["\"use strict\";\n/**\n * TinyMCE version 6.8.5 (TBD)\n */\n(function () {\n 'use strict';\n var global = tinymce.util.Tools.resolve('tinymce.PluginManager');\n var setContent = function (editor, html) {\n editor.focus();\n editor.undoManager.transact(function () {\n editor.setContent(html);\n });\n editor.selection.setCursorLocation();\n editor.nodeChanged();\n };\n var getContent = function (editor) {\n return editor.getContent({ source_view: true });\n };\n var open = function (editor) {\n var editorContent = getContent(editor);\n editor.windowManager.open({\n title: 'Source Code',\n size: 'large',\n body: {\n type: 'panel',\n items: [{\n type: 'textarea',\n name: 'code'\n }]\n },\n buttons: [\n {\n type: 'cancel',\n name: 'cancel',\n text: 'Cancel'\n },\n {\n type: 'submit',\n name: 'save',\n text: 'Save',\n primary: true\n }\n ],\n initialData: { code: editorContent },\n onSubmit: function (api) {\n setContent(editor, api.getData().code);\n api.close();\n }\n });\n };\n var register$1 = function (editor) {\n editor.addCommand('mceCodeEditor', function () {\n open(editor);\n });\n };\n var register = function (editor) {\n var onAction = function () { return editor.execCommand('mceCodeEditor'); };\n editor.ui.registry.addButton('code', {\n icon: 'sourcecode',\n tooltip: 'Source code',\n onAction: onAction\n });\n editor.ui.registry.addMenuItem('code', {\n icon: 'sourcecode',\n text: 'Source code',\n onAction: onAction\n });\n };\n var Plugin = function () {\n global.add('code', function (editor) {\n register$1(editor);\n register(editor);\n return {};\n });\n };\n Plugin();\n})();\n"],"names":["tinymce","util","Tools","resolve","add","editor","addCommand","editorContent","getContent","source_view","windowManager","open","title","size","body","type","items","name","buttons","text","primary","initialData","code","onSubmit","api","html","focus","undoManager","transact","setContent","selection","setCursorLocation","nodeChanged","getData","close","register$1","onAction","execCommand","ui","registry","addButton","icon","tooltip","addMenuItem","register"],"mappings":"8FAMiBA,QAAQC,KAAKC,MAAMC,QAAQ,yBA+D7BC,IAAI,QAAQ,SAAUC,GAGzB,OAtBS,SAAUA,GACvBA,EAAOC,WAAW,iBAAiB,YAjC5B,SAAUD,GACjB,IAAIE,EAJS,SAAUF,GACvB,OAAOA,EAAOG,WAAW,CAAEC,aAAa,IAGpBD,CAAWH,GAC/BA,EAAOK,cAAcC,KAAK,CACtBC,MAAO,cACPC,KAAM,QACNC,KAAM,CACFC,KAAM,QACNC,MAAO,CAAC,CACAD,KAAM,WACNE,KAAM,UAGlBC,QAAS,CACL,CACIH,KAAM,SACNE,KAAM,SACNE,KAAM,UAEV,CACIJ,KAAM,SACNE,KAAM,OACNE,KAAM,OACNC,SAAS,IAGjBC,YAAa,CAAEC,KAAMf,GACrBgB,SAAU,SAAUC,IArCX,SAAUnB,EAAQoB,GAC/BpB,EAAOqB,QACPrB,EAAOsB,YAAYC,UAAS,WACxBvB,EAAOwB,WAAWJ,EAC9B,IACQpB,EAAOyB,UAAUC,oBACjB1B,EAAO2B,cAgCCH,CAAWxB,EAAQmB,EAAIS,UAAUX,MACjCE,EAAIU,OACpB,IAKYvB,CAAKN,EACjB,IAiBY8B,CAAW9B,GAfJ,SAAUA,GACrB,IAAI+B,EAAW,WAAc,OAAO/B,EAAOgC,YAAY,kBACvDhC,EAAOiC,GAAGC,SAASC,UAAU,OAAQ,CACjCC,KAAM,aACNC,QAAS,cACTN,SAAUA,IAEd/B,EAAOiC,GAAGC,SAASI,YAAY,OAAQ,CACnCF,KAAM,aACNtB,KAAM,cACNiB,SAAUA,IAMVQ,CAASvC,GACF,EACnB"}
1
+ {"version":3,"file":"plugin.mjs","sources":["../../../../../public/tinymce/plugins/code/plugin.js"],"sourcesContent":["\"use strict\";\n/**\n * TinyMCE version 6.8.5 (TBD)\n */\n(function () {\n 'use strict';\n var global = tinymce.util.Tools.resolve('tinymce.PluginManager');\n var setContent = function (editor, html) {\n editor.focus();\n editor.undoManager.transact(function () {\n editor.setContent(html);\n });\n editor.selection.setCursorLocation();\n editor.nodeChanged();\n };\n var getContent = function (editor) {\n return editor.getContent({ source_view: true });\n };\n var open = function (editor) {\n var editorContent = getContent(editor);\n editor.windowManager.open({\n title: 'Source Code',\n size: 'large',\n body: {\n type: 'panel',\n items: [{\n type: 'textarea',\n name: 'code'\n }]\n },\n buttons: [\n {\n type: 'cancel',\n name: 'cancel',\n text: 'Cancel'\n },\n {\n type: 'submit',\n name: 'save',\n text: 'Save',\n primary: true\n }\n ],\n initialData: { code: editorContent },\n onSubmit: function (api) {\n setContent(editor, api.getData().code);\n api.close();\n }\n });\n };\n var register$1 = function (editor) {\n editor.addCommand('mceCodeEditor', function () {\n open(editor);\n });\n };\n var register = function (editor) {\n var onAction = function () { return editor.execCommand('mceCodeEditor'); };\n editor.ui.registry.addButton('code', {\n icon: 'sourcecode',\n tooltip: 'Source code',\n onAction: onAction\n });\n editor.ui.registry.addMenuItem('code', {\n icon: 'sourcecode',\n text: 'Source code',\n onAction: onAction\n });\n };\n var Plugin = function () {\n global.add('code', function (editor) {\n register$1(editor);\n register(editor);\n return {};\n });\n };\n Plugin();\n})();\n"],"names":["tinymce","util","Tools","resolve","add","editor","addCommand","editorContent","getContent","source_view","windowManager","open","title","size","body","type","items","name","buttons","text","primary","initialData","code","onSubmit","api","html","focus","undoManager","transact","setContent","selection","setCursorLocation","nodeChanged","getData","close","register$1","onAction","execCommand","ui","registry","addButton","icon","tooltip","addMenuItem","register"],"mappings":"+FAMiBA,QAAQC,KAAKC,MAAMC,QAAQ,yBA+D7BC,IAAI,QAAQ,SAAUC,GAGzB,OAtBS,SAAUA,GACvBA,EAAOC,WAAW,iBAAiB,YAjC5B,SAAUD,GACjB,IAAIE,EAJS,SAAUF,GACvB,OAAOA,EAAOG,WAAW,CAAEC,aAAa,IAGpBD,CAAWH,GAC/BA,EAAOK,cAAcC,KAAK,CACtBC,MAAO,cACPC,KAAM,QACNC,KAAM,CACFC,KAAM,QACNC,MAAO,CAAC,CACAD,KAAM,WACNE,KAAM,UAGlBC,QAAS,CACL,CACIH,KAAM,SACNE,KAAM,SACNE,KAAM,UAEV,CACIJ,KAAM,SACNE,KAAM,OACNE,KAAM,OACNC,SAAS,IAGjBC,YAAa,CAAEC,KAAMf,GACrBgB,SAAU,SAAUC,IArCX,SAAUnB,EAAQoB,GAC/BpB,EAAOqB,QACPrB,EAAOsB,YAAYC,UAAS,WACxBvB,EAAOwB,WAAWJ,EAC9B,IACQpB,EAAOyB,UAAUC,oBACjB1B,EAAO2B,cAgCCH,CAAWxB,EAAQmB,EAAIS,UAAUX,MACjCE,EAAIU,OACpB,IAKYvB,CAAKN,EACjB,IAiBY8B,CAAW9B,GAfJ,SAAUA,GACrB,IAAI+B,EAAW,WAAc,OAAO/B,EAAOgC,YAAY,kBACvDhC,EAAOiC,GAAGC,SAASC,UAAU,OAAQ,CACjCC,KAAM,aACNC,QAAS,cACTN,SAAUA,IAEd/B,EAAOiC,GAAGC,SAASI,YAAY,OAAQ,CACnCF,KAAM,aACNtB,KAAM,cACNiB,SAAUA,IAMVQ,CAASvC,GACF,EACnB"}
@@ -1,2 +1,2 @@
1
- import{__exports as r}from"../../../../_virtual/index4.mjs";import{__require as e}from"./plugin.mjs";var i;function o(){return i||(i=1,e()),r}export{o as __require};
1
+ import{__exports as r}from"../../../../_virtual/index2.mjs";import{__require as e}from"./plugin.mjs";var i;function o(){return i||(i=1,e()),r}export{o as __require};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- import{__exports as t}from"../../../../_virtual/plugin2.mjs";var n;function e(){if(n)return t;n=1;var e=t&&t.__assign||function(){return e=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},e.apply(this,arguments)};return function(){var t,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t){return function(n){return u=typeof(e=n),(null===e?"null":"object"===u&&Array.isArray(e)?"array":"object"===u&&(a=r=e,(o=String).prototype.isPrototypeOf(a)||(null===(i=r.constructor)||void 0===i?void 0:i.name)===o.name)?"string":u)===t;var e,r,o,i,u,a}},o=function(t){return function(n){return typeof n===t}},i=r("string"),u=r("object"),a=r("array"),l=(t=null,function(n){return t===n}),c=o("boolean"),f=function(t){return!function(t){return null==t}(t)},s=o("function"),g=function(t,n){if(a(t)){for(var e=0,r=t.length;e<r;++e)if(!n(t[e]))return!1;return!0}return!1},d=function(){},m=function(t,n){return t===n},h=function(){function t(t,n){this.tag=t,this.value=n}return t.some=function(n){return new t(!0,n)},t.none=function(){return t.singletonNone},t.prototype.fold=function(t,n){return this.tag?n(this.value):t()},t.prototype.isSome=function(){return this.tag},t.prototype.isNone=function(){return!this.tag},t.prototype.map=function(n){return this.tag?t.some(n(this.value)):t.none()},t.prototype.bind=function(n){return this.tag?n(this.value):t.none()},t.prototype.exists=function(t){return this.tag&&t(this.value)},t.prototype.forall=function(t){return!this.tag||t(this.value)},t.prototype.filter=function(n){return!this.tag||n(this.value)?this:t.none()},t.prototype.getOr=function(t){return this.tag?this.value:t},t.prototype.or=function(t){return this.tag?this:t},t.prototype.getOrThunk=function(t){return this.tag?this.value:t()},t.prototype.orThunk=function(t){return this.tag?this:t()},t.prototype.getOrDie=function(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")},t.from=function(n){return f(n)?t.some(n):t.none()},t.prototype.getOrNull=function(){return this.tag?this.value:null},t.prototype.getOrUndefined=function(){return this.value},t.prototype.each=function(t){this.tag&&t(this.value)},t.prototype.toArray=function(){return this.tag?[this.value]:[]},t.prototype.toString=function(){return this.tag?"some(".concat(this.value,")"):"none()"},t}();h.singletonNone=new h(!1);var p=Array.prototype.indexOf,v=Array.prototype.push,k=function(t,n){return function(t,n){return p.call(t,n)}(t,n)>-1},y=function(t){for(var n=[],e=0,r=t.length;e<r;++e){if(!a(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);v.apply(n,t[e])}return n},x=function(t,n){return y(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))},b=function(t,n){for(var e=0;e<t.length;e++){var r=n(t[e],e);if(r.isSome())return r}return h.none()},_=function(t,n,e){return void 0===e&&(e=m),t.exists((function(t){return e(t,n)}))},w=function(t){for(var n=[],e=function(t){n.push(t)},r=0;r<t.length;r++)t[r].each(e);return n},O=function(t,n){return t?h.some(n):h.none()},C=function(t){return function(n){return n.options.get(t)}},N=C("link_assume_external_targets"),A=C("link_context_toolbar"),S=C("link_list"),E=C("link_default_target"),T=C("link_default_protocol"),P=C("link_target_list"),R=C("link_rel_list"),L=C("link_class_list"),M=C("link_title"),D=C("allow_unsafe_link_target"),U=C("link_quicklink"),j=tinymce.util.Tools.resolve("tinymce.util.Tools"),B=function(t){return i(t.value)?t.value:""},I=function(t,n){var e=[];return j.each(t,(function(t){var r=function(t){return i(t.text)?t.text:i(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=I(t.menu,n);e.push({text:r,items:o})}else{var u=n(t);e.push({text:r,value:u})}})),e},K=function(t){return void 0===t&&(t=B),function(n){return h.from(n).map((function(n){return I(n,t)}))}},z={sanitize:function(t){return K(B)(t)},sanitizeWith:K,createUi:function(t,n){return function(e){return{name:t,type:"listbox",label:n,items:e}}},getValue:B},q=Object.keys,V=Object.hasOwnProperty,F=function(t,n,e,r){!function(t,n){for(var e=q(t),r=0,o=e.length;r<o;r++){var i=e[r];n(t[i],i)}}(t,(function(t,o){(n(t,o)?e:r)(t,o)}))},W=function(t,n){return V.call(t,n)},G=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),H=tinymce.util.Tools.resolve("tinymce.util.URI"),J=function(t){return f(t)&&"a"===t.nodeName.toLowerCase()},Q=function(t){return J(t)&&!!Z(t)},X=function(t,n){if(t.collapsed)return[];var e=t.cloneContents(),r=e.firstChild,o=new G(r,e),i=[],u=r;do{n(u)&&i.push(u)}while(u=o.next());return i},Y=function(t){return/^\w+:/i.test(t)},Z=function(t){var n,e;return null!==(e=null!==(n=t.getAttribute("data-mce-href"))&&void 0!==n?n:t.getAttribute("href"))&&void 0!==e?e:""},$=function(t,n){var e=["noopener"],r=t?t.split(/\s+/):[],o=function(t){return t.filter((function(t){return-1===j.inArray(e,t)}))},i=n?function(t){return(t=o(t)).length>0?t.concat(e):e}(r):o(r);return i.length>0?function(t){return j.trim(t.sort().join(" "))}(i):""},tt=function(t,n){return n=n||rt(t.selection.getRng())[0]||t.selection.getNode(),at(n)?h.from(t.dom.select("a[href]",n)[0]):h.from(t.dom.getParent(n,"a[href]"))},nt=function(t,n){return tt(t,n).isSome()},et=function(t,n){return function(t){return t.replace(/\uFEFF/g,"")}(n.fold((function(){return t.getContent({format:"text"})}),(function(t){return t.innerText||t.textContent||""})))},rt=function(t){return X(t,Q)},ot=function(t){return j.grep(t,Q)},it=function(t){return ot(t).length>0},ut=function(t){var n=t.schema.getTextInlineElements();if(tt(t).exists((function(t){return t.hasAttribute("data-mce-block")})))return!1;var e=t.selection.getRng();return!!e.collapsed||0===X(e,(function(t){return 1===t.nodeType&&!J(t)&&!W(n,t.nodeName.toLowerCase())})).length},at=function(t){return f(t)&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},lt=function(t,n){var r=e({},n);if(0===R(t).length&&!D(t)){var o=$(r.rel,"_blank"===r.target);r.rel=o||null}return h.from(r.target).isNone()&&!1===P(t)&&(r.target=E(t)),r.href=function(t,n){return"http"!==n&&"https"!==n||Y(t)?t:n+"://"+t}(r.href,N(t)),r},ct=function(t,n,e){var r=t.selection.getNode(),o=tt(t,r),i=lt(t,function(t){var n,e,r;return n=["title","rel","class","target"],e=function(n,e){return t[e].each((function(t){n[e]=t.length>0?t:null})),n},r={href:t.href},function(t,n){for(var e=0,r=t.length;e<r;e++)n(t[e],e)}(n,(function(t,n){r=e(r,t,n)})),r}(e));t.undoManager.transact((function(){e.href===n.href&&n.attach(),o.fold((function(){!function(t,n,e,r){var o=t.dom;at(n)?mt(o,n,r):e.fold((function(){t.execCommand("mceInsertLink",!1,r)}),(function(n){t.insertContent(o.createHTML("a",r,o.encode(n)))}))}(t,r,e.text,i)}),(function(n){t.focus(),function(t,n,e,r){e.each((function(t){W(n,"innerText")?n.innerText=t:n.textContent=t})),t.dom.setAttribs(n,r),t.selection.select(n)}(t,n,e.text,i)}))}))},ft=function(t){var n=t.class,e=t.href,r=t.rel,o=t.target,i=t.text,u=t.title;return function(t,n){var e,r={};return F(t,n,(e=r,function(t,n){e[n]=t}),d),r}({class:n.getOrNull(),href:e,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:u.getOrNull()},(function(t,n){return!1===l(t)}))},st=function(t,n,r){var o=function(t,n){var r=t.options.get,o={allow_html_data_urls:r("allow_html_data_urls"),allow_script_urls:r("allow_script_urls"),allow_svg_data_urls:r("allow_svg_data_urls")},i=n.href;return e(e({},n),{href:H.isDomSafe(i,"a",o)?i:""})}(t,r);t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,ft(o)):ct(t,n,o)},gt=function(t){t.hasPlugin("rtc",!0)?t.execCommand("unlink"):function(t){t.undoManager.transact((function(){var n=t.selection.getNode();at(n)?dt(t,n):function(t){var n=t.dom,e=t.selection,r=e.getBookmark(),o=e.getRng().cloneRange(),i=n.getParent(o.startContainer,"a[href]",t.getBody()),u=n.getParent(o.endContainer,"a[href]",t.getBody());i&&o.setStartBefore(i),u&&o.setEndAfter(u),e.setRng(o),t.execCommand("unlink"),e.moveToBookmark(r)}(t),t.focus()}))}(t)},dt=function(t,n){var e,r=t.dom.select("img",n)[0];if(r){var o=t.dom.getParents(r,"a[href]",n)[0];o&&(null===(e=o.parentNode)||void 0===e||e.insertBefore(r,o),t.dom.remove(o))}},mt=function(t,n,e){var r,o=t.select("img",n)[0];if(o){var i=t.create("a",e);null===(r=o.parentNode)||void 0===r||r.insertBefore(i,o),i.appendChild(o)}},ht=function(t){return W(n=t,e="items")&&void 0!==n[e]&&null!==n[e];var n,e},pt=function(t,n){return b(n,(function(n){return ht(n)?pt(t,n.items):O(n.value===t,n)}))},vt=function(t,n,e,r){var o=r[n],i=t.length>0;return void 0!==o?pt(o,e).map((function(n){return{url:{value:n.value,meta:{text:i?t:n.text,attach:d}},text:i?t:n.text}})):h.none()},kt=function(t,n){var r={text:t.text,title:t.title},o=function(t){var n,o,i=(n=t.url,O(r.text.length<=0,h.from(null===(o=n.meta)||void 0===o?void 0:o.text).getOr(n.value))),u=function(t){var n;return O(r.title.length<=0,h.from(null===(n=t.meta)||void 0===n?void 0:n.title).getOr(""))}(t.url);return i.isSome()||u.isSome()?h.some(e(e({},i.map((function(t){return{text:t}})).getOr({})),u.map((function(t){return{title:t}})).getOr({}))):h.none()},i=function(t,e){var o,i,u=(o=n,i=e,"link"===i?o.link:"anchor"===i?o.anchor:h.none()).getOr([]);return vt(r.text,e,u,t)};return{onChange:function(t,n){var e=n.name;return"url"===e?o(t()):k(["anchor","link"],e)?i(t(),e):"text"===e||"title"===e?(r[e]=t()[e],h.none()):h.none()}}},yt=tinymce.util.Tools.resolve("tinymce.util.Delay"),xt=function(t){var n=t.href;return n.indexOf("@")>0&&-1===n.indexOf("/")&&-1===n.indexOf("mailto:")?h.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return e(e({},t),{href:"mailto:"+n})}}):h.none()},bt=function(t,n){return function(r){var o=r.href;return 1===t&&!Y(o)||0===t&&/^\s*www(\.|\d\.)/i.test(o)?h.some({message:"The URL you entered seems to be an external link. Do you want to add the required ".concat(n,":// prefix?"),preprocess:function(t){return e(e({},t),{href:n+"://"+o})}}):h.none()}},_t=function(t,n){return b([xt,bt(N(t),T(t))],(function(t){return t(n)})).fold((function(){return Promise.resolve(n)}),(function(e){return new Promise((function(r){!function(t,n,e){var r=t.selection.getRng();yt.setEditorTimeout(t,(function(){t.windowManager.confirm(n,(function(n){t.selection.setRng(r),e(n)}))}))}(t,e.message,(function(t){r(t?e.preprocess(n):n)}))}))}))},wt=function(t){var n=t.dom.select("a:not([href])"),e=x(n,(function(t){var n=t.name||t.id;return n?[{text:n,value:"#"+n}]:[]}));return e.length>0?h.some([{text:"None",value:""}].concat(e)):h.none()},Ot=function(t){var n=L(t);return n.length>0?z.sanitize(n):h.none()},Ct=function(t){try{return h.some(JSON.parse(t))}catch(t){return h.none()}},Nt=function(t){var n=function(n){return t.convertURL(n.value||n.url||"","href")},e=S(t);return new Promise((function(t){i(e)?fetch(e).then((function(t){return t.ok?t.text().then(Ct):Promise.reject()})).then(t,(function(){return t(h.none())})):s(e)?e((function(n){return t(h.some(n))})):t(h.from(e))})).then((function(t){return t.bind(z.sanitizeWith(n)).map((function(t){if(t.length>0){return[{text:"None",value:""}].concat(t)}return t}))}))},At=function(t,n){var e=R(t);if(e.length>0){var r=_(n,"_blank");return(!1===D(t)?z.sanitizeWith((function(t){return $(z.getValue(t),r)})):z.sanitize)(e)}return h.none()},St=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Et=function(t){var n=P(t);return a(n)?z.sanitize(n).orThunk((function(){return h.some(St)})):!1===n?h.none():h.some(St)},Tt=function(t,n,e){var r=t.getAttrib(n,e);return null!==r&&r.length>0?h.some(r):h.none()},Pt=function(t,n){return Nt(t).then((function(e){var r=function(t,n){var e=t.dom,r=ut(t)?h.some(et(t.selection,n)):h.none(),o=n.bind((function(t){return h.from(e.getAttrib(t,"href"))})),i=n.bind((function(t){return h.from(e.getAttrib(t,"target"))})),u=n.bind((function(t){return Tt(e,t,"rel")})),a=n.bind((function(t){return Tt(e,t,"class")}));return{url:o,text:r,title:n.bind((function(t){return Tt(e,t,"title")})),target:i,rel:u,linkClass:a}}(t,n);return{anchor:r,catalogs:{targets:Et(t),rels:At(t,r.target),classes:Ot(t),anchor:wt(t),link:e},optNode:n,flags:{titleEnabled:M(t)}}}))},Rt=function(t){var n=function(t){var n=tt(t);return Pt(t,n)}(t);n.then((function(n){var e=function(t,n){return function(e){var r=e.getData();if(!r.url.value)return gt(t),void e.close();var o=function(t){return h.from(r[t]).filter((function(e){return!_(n.anchor[t],e)}))},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},u={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:d};_t(t,i).then((function(n){st(t,u,n)})),e.close()}}(t,n);return function(t,n,e){var r=t.anchor.text.map((function(){return{name:"text",type:"input",label:"Text to display"}})).toArray(),o=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(t,n){var e=t.anchor,r=e.url.getOr("");return{url:{value:r,meta:{original:{value:r}}},text:e.text.getOr(""),title:e.title.getOr(""),anchor:r,link:r,rel:e.rel.getOr(""),target:e.target.or(n).getOr(""),linkClass:e.linkClass.getOr("")}}(t,h.from(E(e))),u=t.catalogs,a=kt(i,u);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:y([[{name:"url",type:"urlinput",filetype:"file",label:"URL",picker_text:"Browse links"}],r,o,w([u.anchor.map(z.createUi("anchor","Anchors")),u.rels.map(z.createUi("rel","Rel")),u.targets.map(z.createUi("target","Open link in...")),u.link.map(z.createUi("link","Link list")),u.classes.map(z.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;a.onChange(t.getData,{name:e}).each((function(n){t.setData(n)}))},onSubmit:n}}(n,e,t)})).then((function(n){t.windowManager.open(n)}))},Lt=tinymce.util.Tools.resolve("tinymce.util.VK"),Mt=function(t){var n=document.createElement("a");n.target="_blank",n.href=t,n.rel="noreferrer noopener";var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(t,n){document.body.appendChild(t),t.dispatchEvent(n),document.body.removeChild(t)}(n,e)},Dt=function(t,n){return t.dom.getParent(n,"a[href]")},Ut=function(t){return Dt(t,t.selection.getStart())},jt=function(t,n){if(n){var e=Z(n);if(/^#/.test(e)){var r=t.dom.select(e);r.length&&t.selection.scrollIntoView(r[0],!0)}else Mt(n.href)}},Bt=function(t){return function(){t.execCommand("mceLink",!1,{dialog:!0})}},It=function(t){return function(){jt(t,Ut(t))}},Kt=function(t,n){return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}},zt=function(t){return function(n){var e=function(){n.setActive(!t.mode.isReadOnly()&&nt(t,t.selection.getNode())),n.setEnabled(t.selection.isEditable())};return e(),Kt(t,e)}},qt=function(t){return function(n){var e=function(){n.setEnabled(t.selection.isEditable())};return e(),Kt(t,e)}},Vt=function(t){return function(n){var e=function(){return n.setEnabled(function(t){return 1===(t.selection.isCollapsed()?ot(t.dom.getParents(t.selection.getStart())):rt(t.selection.getRng())).length}(t))};return e(),Kt(t,e)}},Ft=function(t){return function(n){var e=function(n){return it(n)||(e=t.selection.getRng(),rt(e).length>0);var e},r=t.dom.getParents(t.selection.getStart()),o=function(r){n.setEnabled(e(r)&&t.selection.isEditable())};return o(r),Kt(t,(function(t){return o(t.parents)}))}},Wt=function(t){var n=function(n){var e=t.selection.getNode();return n.setEnabled(nt(t,e)),d};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:zt(t)},label:"Link",predicate:function(n){return A(t)&&nt(t,n)},initValue:function(){var n;return tt(t).fold((n="",function(){return n}),Z)},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(n){var e=t.selection.getNode();return n.setActive(nt(t,e)),zt(t)(n)},onAction:function(n){var e=n.getValue(),r=function(n){var e=tt(t),r=ut(t);if(e.isNone()&&r){var o=et(t.selection,e);return O(0===o.length,n)}return h.none()}(e);st(t,{href:e,attach:d},{href:e,text:r,title:h.none(),rel:h.none(),target:h.none(),class:h.none()}),function(t){t.selection.collapse(!1)}(t),n.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:n,onAction:function(n){gt(t),n.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:n,onAction:function(n){It(t)(),n.hide()}}]})};n.add("link",(function(t){!function(t){var n=t.options.register;n("link_assume_external_targets",{processor:function(t){var n=i(t)||c(t);return n?!0===t?{value:1,valid:n}:"http"===t||"https"===t?{value:t,valid:n}:{value:0,valid:n}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),n("link_context_toolbar",{processor:"boolean",default:!1}),n("link_list",{processor:function(t){return i(t)||s(t)||g(t,u)}}),n("link_default_target",{processor:"string"}),n("link_default_protocol",{processor:"string",default:"https"}),n("link_target_list",{processor:function(t){return c(t)||g(t,u)},default:!0}),n("link_rel_list",{processor:"object[]",default:[]}),n("link_class_list",{processor:"object[]",default:[]}),n("link_title",{processor:"boolean",default:!0}),n("allow_unsafe_link_target",{processor:"boolean",default:!1}),n("link_quicklink",{processor:"boolean",default:!1})}(t),function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Bt(t),onSetup:zt(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:It(t),onSetup:Vt(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return gt(t)},onSetup:Ft(t)})}(t),function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:It(t),onSetup:Vt(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onSetup:qt(t),onAction:Bt(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return gt(t)},onSetup:Ft(t)})}(t),function(t){t.ui.registry.addContextMenu("link",{update:function(n){return t.dom.isEditable(n)?it(t.dom.getParents(n,"a"))?"link unlink openlink":"link":""}})}(t),Wt(t),function(t){t.on("click",(function(n){var e=Dt(t,n.target);e&&Lt.metaKeyPressed(n)&&(n.preventDefault(),jt(t,e))})),t.on("keydown",(function(n){if(!n.isDefaultPrevented()&&13===n.keyCode&&function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey}(n)){var e=Ut(t);e&&(n.preventDefault(),jt(t,e))}}))}(t),function(t){t.addCommand("mceLink",(function(n,e){!0!==(null==e?void 0:e.dialog)&&U(t)?t.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"}):Rt(t)}))}(t),function(t){t.addShortcut("Meta+K","",(function(){t.execCommand("mceLink")}))}(t)}))}(),t}export{e as __require};
1
+ import{__exports as t}from"../../../../_virtual/plugin.mjs";var n;function e(){if(n)return t;n=1;var e=t&&t.__assign||function(){return e=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},e.apply(this,arguments)};return function(){var t,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t){return function(n){return u=typeof(e=n),(null===e?"null":"object"===u&&Array.isArray(e)?"array":"object"===u&&(a=r=e,(o=String).prototype.isPrototypeOf(a)||(null===(i=r.constructor)||void 0===i?void 0:i.name)===o.name)?"string":u)===t;var e,r,o,i,u,a}},o=function(t){return function(n){return typeof n===t}},i=r("string"),u=r("object"),a=r("array"),l=(t=null,function(n){return t===n}),c=o("boolean"),f=function(t){return!function(t){return null==t}(t)},s=o("function"),g=function(t,n){if(a(t)){for(var e=0,r=t.length;e<r;++e)if(!n(t[e]))return!1;return!0}return!1},d=function(){},m=function(t,n){return t===n},h=function(){function t(t,n){this.tag=t,this.value=n}return t.some=function(n){return new t(!0,n)},t.none=function(){return t.singletonNone},t.prototype.fold=function(t,n){return this.tag?n(this.value):t()},t.prototype.isSome=function(){return this.tag},t.prototype.isNone=function(){return!this.tag},t.prototype.map=function(n){return this.tag?t.some(n(this.value)):t.none()},t.prototype.bind=function(n){return this.tag?n(this.value):t.none()},t.prototype.exists=function(t){return this.tag&&t(this.value)},t.prototype.forall=function(t){return!this.tag||t(this.value)},t.prototype.filter=function(n){return!this.tag||n(this.value)?this:t.none()},t.prototype.getOr=function(t){return this.tag?this.value:t},t.prototype.or=function(t){return this.tag?this:t},t.prototype.getOrThunk=function(t){return this.tag?this.value:t()},t.prototype.orThunk=function(t){return this.tag?this:t()},t.prototype.getOrDie=function(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")},t.from=function(n){return f(n)?t.some(n):t.none()},t.prototype.getOrNull=function(){return this.tag?this.value:null},t.prototype.getOrUndefined=function(){return this.value},t.prototype.each=function(t){this.tag&&t(this.value)},t.prototype.toArray=function(){return this.tag?[this.value]:[]},t.prototype.toString=function(){return this.tag?"some(".concat(this.value,")"):"none()"},t}();h.singletonNone=new h(!1);var p=Array.prototype.indexOf,v=Array.prototype.push,k=function(t,n){return function(t,n){return p.call(t,n)}(t,n)>-1},y=function(t){for(var n=[],e=0,r=t.length;e<r;++e){if(!a(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);v.apply(n,t[e])}return n},x=function(t,n){return y(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))},b=function(t,n){for(var e=0;e<t.length;e++){var r=n(t[e],e);if(r.isSome())return r}return h.none()},_=function(t,n,e){return void 0===e&&(e=m),t.exists((function(t){return e(t,n)}))},w=function(t){for(var n=[],e=function(t){n.push(t)},r=0;r<t.length;r++)t[r].each(e);return n},O=function(t,n){return t?h.some(n):h.none()},C=function(t){return function(n){return n.options.get(t)}},N=C("link_assume_external_targets"),A=C("link_context_toolbar"),S=C("link_list"),E=C("link_default_target"),T=C("link_default_protocol"),P=C("link_target_list"),R=C("link_rel_list"),L=C("link_class_list"),M=C("link_title"),D=C("allow_unsafe_link_target"),U=C("link_quicklink"),j=tinymce.util.Tools.resolve("tinymce.util.Tools"),B=function(t){return i(t.value)?t.value:""},I=function(t,n){var e=[];return j.each(t,(function(t){var r=function(t){return i(t.text)?t.text:i(t.title)?t.title:""}(t);if(void 0!==t.menu){var o=I(t.menu,n);e.push({text:r,items:o})}else{var u=n(t);e.push({text:r,value:u})}})),e},K=function(t){return void 0===t&&(t=B),function(n){return h.from(n).map((function(n){return I(n,t)}))}},z={sanitize:function(t){return K(B)(t)},sanitizeWith:K,createUi:function(t,n){return function(e){return{name:t,type:"listbox",label:n,items:e}}},getValue:B},q=Object.keys,V=Object.hasOwnProperty,F=function(t,n,e,r){!function(t,n){for(var e=q(t),r=0,o=e.length;r<o;r++){var i=e[r];n(t[i],i)}}(t,(function(t,o){(n(t,o)?e:r)(t,o)}))},W=function(t,n){return V.call(t,n)},G=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),H=tinymce.util.Tools.resolve("tinymce.util.URI"),J=function(t){return f(t)&&"a"===t.nodeName.toLowerCase()},Q=function(t){return J(t)&&!!Z(t)},X=function(t,n){if(t.collapsed)return[];var e=t.cloneContents(),r=e.firstChild,o=new G(r,e),i=[],u=r;do{n(u)&&i.push(u)}while(u=o.next());return i},Y=function(t){return/^\w+:/i.test(t)},Z=function(t){var n,e;return null!==(e=null!==(n=t.getAttribute("data-mce-href"))&&void 0!==n?n:t.getAttribute("href"))&&void 0!==e?e:""},$=function(t,n){var e=["noopener"],r=t?t.split(/\s+/):[],o=function(t){return t.filter((function(t){return-1===j.inArray(e,t)}))},i=n?function(t){return(t=o(t)).length>0?t.concat(e):e}(r):o(r);return i.length>0?function(t){return j.trim(t.sort().join(" "))}(i):""},tt=function(t,n){return n=n||rt(t.selection.getRng())[0]||t.selection.getNode(),at(n)?h.from(t.dom.select("a[href]",n)[0]):h.from(t.dom.getParent(n,"a[href]"))},nt=function(t,n){return tt(t,n).isSome()},et=function(t,n){return function(t){return t.replace(/\uFEFF/g,"")}(n.fold((function(){return t.getContent({format:"text"})}),(function(t){return t.innerText||t.textContent||""})))},rt=function(t){return X(t,Q)},ot=function(t){return j.grep(t,Q)},it=function(t){return ot(t).length>0},ut=function(t){var n=t.schema.getTextInlineElements();if(tt(t).exists((function(t){return t.hasAttribute("data-mce-block")})))return!1;var e=t.selection.getRng();return!!e.collapsed||0===X(e,(function(t){return 1===t.nodeType&&!J(t)&&!W(n,t.nodeName.toLowerCase())})).length},at=function(t){return f(t)&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},lt=function(t,n){var r=e({},n);if(0===R(t).length&&!D(t)){var o=$(r.rel,"_blank"===r.target);r.rel=o||null}return h.from(r.target).isNone()&&!1===P(t)&&(r.target=E(t)),r.href=function(t,n){return"http"!==n&&"https"!==n||Y(t)?t:n+"://"+t}(r.href,N(t)),r},ct=function(t,n,e){var r=t.selection.getNode(),o=tt(t,r),i=lt(t,function(t){var n,e,r;return n=["title","rel","class","target"],e=function(n,e){return t[e].each((function(t){n[e]=t.length>0?t:null})),n},r={href:t.href},function(t,n){for(var e=0,r=t.length;e<r;e++)n(t[e],e)}(n,(function(t,n){r=e(r,t,n)})),r}(e));t.undoManager.transact((function(){e.href===n.href&&n.attach(),o.fold((function(){!function(t,n,e,r){var o=t.dom;at(n)?mt(o,n,r):e.fold((function(){t.execCommand("mceInsertLink",!1,r)}),(function(n){t.insertContent(o.createHTML("a",r,o.encode(n)))}))}(t,r,e.text,i)}),(function(n){t.focus(),function(t,n,e,r){e.each((function(t){W(n,"innerText")?n.innerText=t:n.textContent=t})),t.dom.setAttribs(n,r),t.selection.select(n)}(t,n,e.text,i)}))}))},ft=function(t){var n=t.class,e=t.href,r=t.rel,o=t.target,i=t.text,u=t.title;return function(t,n){var e,r={};return F(t,n,(e=r,function(t,n){e[n]=t}),d),r}({class:n.getOrNull(),href:e,rel:r.getOrNull(),target:o.getOrNull(),text:i.getOrNull(),title:u.getOrNull()},(function(t,n){return!1===l(t)}))},st=function(t,n,r){var o=function(t,n){var r=t.options.get,o={allow_html_data_urls:r("allow_html_data_urls"),allow_script_urls:r("allow_script_urls"),allow_svg_data_urls:r("allow_svg_data_urls")},i=n.href;return e(e({},n),{href:H.isDomSafe(i,"a",o)?i:""})}(t,r);t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,ft(o)):ct(t,n,o)},gt=function(t){t.hasPlugin("rtc",!0)?t.execCommand("unlink"):function(t){t.undoManager.transact((function(){var n=t.selection.getNode();at(n)?dt(t,n):function(t){var n=t.dom,e=t.selection,r=e.getBookmark(),o=e.getRng().cloneRange(),i=n.getParent(o.startContainer,"a[href]",t.getBody()),u=n.getParent(o.endContainer,"a[href]",t.getBody());i&&o.setStartBefore(i),u&&o.setEndAfter(u),e.setRng(o),t.execCommand("unlink"),e.moveToBookmark(r)}(t),t.focus()}))}(t)},dt=function(t,n){var e,r=t.dom.select("img",n)[0];if(r){var o=t.dom.getParents(r,"a[href]",n)[0];o&&(null===(e=o.parentNode)||void 0===e||e.insertBefore(r,o),t.dom.remove(o))}},mt=function(t,n,e){var r,o=t.select("img",n)[0];if(o){var i=t.create("a",e);null===(r=o.parentNode)||void 0===r||r.insertBefore(i,o),i.appendChild(o)}},ht=function(t){return W(n=t,e="items")&&void 0!==n[e]&&null!==n[e];var n,e},pt=function(t,n){return b(n,(function(n){return ht(n)?pt(t,n.items):O(n.value===t,n)}))},vt=function(t,n,e,r){var o=r[n],i=t.length>0;return void 0!==o?pt(o,e).map((function(n){return{url:{value:n.value,meta:{text:i?t:n.text,attach:d}},text:i?t:n.text}})):h.none()},kt=function(t,n){var r={text:t.text,title:t.title},o=function(t){var n,o,i=(n=t.url,O(r.text.length<=0,h.from(null===(o=n.meta)||void 0===o?void 0:o.text).getOr(n.value))),u=function(t){var n;return O(r.title.length<=0,h.from(null===(n=t.meta)||void 0===n?void 0:n.title).getOr(""))}(t.url);return i.isSome()||u.isSome()?h.some(e(e({},i.map((function(t){return{text:t}})).getOr({})),u.map((function(t){return{title:t}})).getOr({}))):h.none()},i=function(t,e){var o,i,u=(o=n,i=e,"link"===i?o.link:"anchor"===i?o.anchor:h.none()).getOr([]);return vt(r.text,e,u,t)};return{onChange:function(t,n){var e=n.name;return"url"===e?o(t()):k(["anchor","link"],e)?i(t(),e):"text"===e||"title"===e?(r[e]=t()[e],h.none()):h.none()}}},yt=tinymce.util.Tools.resolve("tinymce.util.Delay"),xt=function(t){var n=t.href;return n.indexOf("@")>0&&-1===n.indexOf("/")&&-1===n.indexOf("mailto:")?h.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return e(e({},t),{href:"mailto:"+n})}}):h.none()},bt=function(t,n){return function(r){var o=r.href;return 1===t&&!Y(o)||0===t&&/^\s*www(\.|\d\.)/i.test(o)?h.some({message:"The URL you entered seems to be an external link. Do you want to add the required ".concat(n,":// prefix?"),preprocess:function(t){return e(e({},t),{href:n+"://"+o})}}):h.none()}},_t=function(t,n){return b([xt,bt(N(t),T(t))],(function(t){return t(n)})).fold((function(){return Promise.resolve(n)}),(function(e){return new Promise((function(r){!function(t,n,e){var r=t.selection.getRng();yt.setEditorTimeout(t,(function(){t.windowManager.confirm(n,(function(n){t.selection.setRng(r),e(n)}))}))}(t,e.message,(function(t){r(t?e.preprocess(n):n)}))}))}))},wt=function(t){var n=t.dom.select("a:not([href])"),e=x(n,(function(t){var n=t.name||t.id;return n?[{text:n,value:"#"+n}]:[]}));return e.length>0?h.some([{text:"None",value:""}].concat(e)):h.none()},Ot=function(t){var n=L(t);return n.length>0?z.sanitize(n):h.none()},Ct=function(t){try{return h.some(JSON.parse(t))}catch(t){return h.none()}},Nt=function(t){var n=function(n){return t.convertURL(n.value||n.url||"","href")},e=S(t);return new Promise((function(t){i(e)?fetch(e).then((function(t){return t.ok?t.text().then(Ct):Promise.reject()})).then(t,(function(){return t(h.none())})):s(e)?e((function(n){return t(h.some(n))})):t(h.from(e))})).then((function(t){return t.bind(z.sanitizeWith(n)).map((function(t){if(t.length>0){return[{text:"None",value:""}].concat(t)}return t}))}))},At=function(t,n){var e=R(t);if(e.length>0){var r=_(n,"_blank");return(!1===D(t)?z.sanitizeWith((function(t){return $(z.getValue(t),r)})):z.sanitize)(e)}return h.none()},St=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Et=function(t){var n=P(t);return a(n)?z.sanitize(n).orThunk((function(){return h.some(St)})):!1===n?h.none():h.some(St)},Tt=function(t,n,e){var r=t.getAttrib(n,e);return null!==r&&r.length>0?h.some(r):h.none()},Pt=function(t,n){return Nt(t).then((function(e){var r=function(t,n){var e=t.dom,r=ut(t)?h.some(et(t.selection,n)):h.none(),o=n.bind((function(t){return h.from(e.getAttrib(t,"href"))})),i=n.bind((function(t){return h.from(e.getAttrib(t,"target"))})),u=n.bind((function(t){return Tt(e,t,"rel")})),a=n.bind((function(t){return Tt(e,t,"class")}));return{url:o,text:r,title:n.bind((function(t){return Tt(e,t,"title")})),target:i,rel:u,linkClass:a}}(t,n);return{anchor:r,catalogs:{targets:Et(t),rels:At(t,r.target),classes:Ot(t),anchor:wt(t),link:e},optNode:n,flags:{titleEnabled:M(t)}}}))},Rt=function(t){var n=function(t){var n=tt(t);return Pt(t,n)}(t);n.then((function(n){var e=function(t,n){return function(e){var r=e.getData();if(!r.url.value)return gt(t),void e.close();var o=function(t){return h.from(r[t]).filter((function(e){return!_(n.anchor[t],e)}))},i={href:r.url.value,text:o("text"),target:o("target"),rel:o("rel"),class:o("linkClass"),title:o("title")},u={href:r.url.value,attach:void 0!==r.url.meta&&r.url.meta.attach?r.url.meta.attach:d};_t(t,i).then((function(n){st(t,u,n)})),e.close()}}(t,n);return function(t,n,e){var r=t.anchor.text.map((function(){return{name:"text",type:"input",label:"Text to display"}})).toArray(),o=t.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=function(t,n){var e=t.anchor,r=e.url.getOr("");return{url:{value:r,meta:{original:{value:r}}},text:e.text.getOr(""),title:e.title.getOr(""),anchor:r,link:r,rel:e.rel.getOr(""),target:e.target.or(n).getOr(""),linkClass:e.linkClass.getOr("")}}(t,h.from(E(e))),u=t.catalogs,a=kt(i,u);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:y([[{name:"url",type:"urlinput",filetype:"file",label:"URL",picker_text:"Browse links"}],r,o,w([u.anchor.map(z.createUi("anchor","Anchors")),u.rels.map(z.createUi("rel","Rel")),u.targets.map(z.createUi("target","Open link in...")),u.link.map(z.createUi("link","Link list")),u.classes.map(z.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;a.onChange(t.getData,{name:e}).each((function(n){t.setData(n)}))},onSubmit:n}}(n,e,t)})).then((function(n){t.windowManager.open(n)}))},Lt=tinymce.util.Tools.resolve("tinymce.util.VK"),Mt=function(t){var n=document.createElement("a");n.target="_blank",n.href=t,n.rel="noreferrer noopener";var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(t,n){document.body.appendChild(t),t.dispatchEvent(n),document.body.removeChild(t)}(n,e)},Dt=function(t,n){return t.dom.getParent(n,"a[href]")},Ut=function(t){return Dt(t,t.selection.getStart())},jt=function(t,n){if(n){var e=Z(n);if(/^#/.test(e)){var r=t.dom.select(e);r.length&&t.selection.scrollIntoView(r[0],!0)}else Mt(n.href)}},Bt=function(t){return function(){t.execCommand("mceLink",!1,{dialog:!0})}},It=function(t){return function(){jt(t,Ut(t))}},Kt=function(t,n){return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}},zt=function(t){return function(n){var e=function(){n.setActive(!t.mode.isReadOnly()&&nt(t,t.selection.getNode())),n.setEnabled(t.selection.isEditable())};return e(),Kt(t,e)}},qt=function(t){return function(n){var e=function(){n.setEnabled(t.selection.isEditable())};return e(),Kt(t,e)}},Vt=function(t){return function(n){var e=function(){return n.setEnabled(function(t){return 1===(t.selection.isCollapsed()?ot(t.dom.getParents(t.selection.getStart())):rt(t.selection.getRng())).length}(t))};return e(),Kt(t,e)}},Ft=function(t){return function(n){var e=function(n){return it(n)||(e=t.selection.getRng(),rt(e).length>0);var e},r=t.dom.getParents(t.selection.getStart()),o=function(r){n.setEnabled(e(r)&&t.selection.isEditable())};return o(r),Kt(t,(function(t){return o(t.parents)}))}},Wt=function(t){var n=function(n){var e=t.selection.getNode();return n.setEnabled(nt(t,e)),d};t.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:zt(t)},label:"Link",predicate:function(n){return A(t)&&nt(t,n)},initValue:function(){var n;return tt(t).fold((n="",function(){return n}),Z)},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(n){var e=t.selection.getNode();return n.setActive(nt(t,e)),zt(t)(n)},onAction:function(n){var e=n.getValue(),r=function(n){var e=tt(t),r=ut(t);if(e.isNone()&&r){var o=et(t.selection,e);return O(0===o.length,n)}return h.none()}(e);st(t,{href:e,attach:d},{href:e,text:r,title:h.none(),rel:h.none(),target:h.none(),class:h.none()}),function(t){t.selection.collapse(!1)}(t),n.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:n,onAction:function(n){gt(t),n.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:n,onAction:function(n){It(t)(),n.hide()}}]})};n.add("link",(function(t){!function(t){var n=t.options.register;n("link_assume_external_targets",{processor:function(t){var n=i(t)||c(t);return n?!0===t?{value:1,valid:n}:"http"===t||"https"===t?{value:t,valid:n}:{value:0,valid:n}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),n("link_context_toolbar",{processor:"boolean",default:!1}),n("link_list",{processor:function(t){return i(t)||s(t)||g(t,u)}}),n("link_default_target",{processor:"string"}),n("link_default_protocol",{processor:"string",default:"https"}),n("link_target_list",{processor:function(t){return c(t)||g(t,u)},default:!0}),n("link_rel_list",{processor:"object[]",default:[]}),n("link_class_list",{processor:"object[]",default:[]}),n("link_title",{processor:"boolean",default:!0}),n("allow_unsafe_link_target",{processor:"boolean",default:!1}),n("link_quicklink",{processor:"boolean",default:!1})}(t),function(t){t.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Bt(t),onSetup:zt(t)}),t.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:It(t),onSetup:Vt(t)}),t.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return gt(t)},onSetup:Ft(t)})}(t),function(t){t.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:It(t),onSetup:Vt(t)}),t.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onSetup:qt(t),onAction:Bt(t)}),t.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return gt(t)},onSetup:Ft(t)})}(t),function(t){t.ui.registry.addContextMenu("link",{update:function(n){return t.dom.isEditable(n)?it(t.dom.getParents(n,"a"))?"link unlink openlink":"link":""}})}(t),Wt(t),function(t){t.on("click",(function(n){var e=Dt(t,n.target);e&&Lt.metaKeyPressed(n)&&(n.preventDefault(),jt(t,e))})),t.on("keydown",(function(n){if(!n.isDefaultPrevented()&&13===n.keyCode&&function(t){return!0===t.altKey&&!1===t.shiftKey&&!1===t.ctrlKey&&!1===t.metaKey}(n)){var e=Ut(t);e&&(n.preventDefault(),jt(t,e))}}))}(t),function(t){t.addCommand("mceLink",(function(n,e){!0!==(null==e?void 0:e.dialog)&&U(t)?t.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"}):Rt(t)}))}(t),function(t){t.addShortcut("Meta+K","",(function(){t.execCommand("mceLink")}))}(t)}))}(),t}export{e as __require};
2
2
  //# sourceMappingURL=plugin.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.mjs","sources":["../../../../../public/tinymce/plugins/link/plugin.js"],"sourcesContent":["\"use strict\";\n/**\n * TinyMCE version 6.8.5 (TBD)\n */\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n(function () {\n 'use strict';\n var global$5 = tinymce.util.Tools.resolve('tinymce.PluginManager');\n var hasProto = function (v, constructor, predicate) {\n var _a;\n if (predicate(v, constructor.prototype)) {\n return true;\n }\n else {\n return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;\n }\n };\n var typeOf = function (x) {\n var t = typeof x;\n if (x === null) {\n return 'null';\n }\n else if (t === 'object' && Array.isArray(x)) {\n return 'array';\n }\n else if (t === 'object' && hasProto(x, String, function (o, proto) { return proto.isPrototypeOf(o); })) {\n return 'string';\n }\n else {\n return t;\n }\n };\n var isType = function (type) { return function (value) { return typeOf(value) === type; }; };\n var isSimpleType = function (type) { return function (value) { return typeof value === type; }; };\n var eq = function (t) { return function (a) { return t === a; }; };\n var isString = isType('string');\n var isObject = isType('object');\n var isArray = isType('array');\n var isNull = eq(null);\n var isBoolean = isSimpleType('boolean');\n var isNullable = function (a) { return a === null || a === undefined; };\n var isNonNullable = function (a) { return !isNullable(a); };\n var isFunction = isSimpleType('function');\n var isArrayOf = function (value, pred) {\n if (isArray(value)) {\n for (var i = 0, len = value.length; i < len; ++i) {\n if (!pred(value[i])) {\n return false;\n }\n }\n return true;\n }\n return false;\n };\n var noop = function () {\n };\n var constant = function (value) {\n return function () {\n return value;\n };\n };\n var tripleEquals = function (a, b) {\n return a === b;\n };\n var Optional = /** @class */ (function () {\n function Optional(tag, value) {\n this.tag = tag;\n this.value = value;\n }\n Optional.some = function (value) {\n return new Optional(true, value);\n };\n Optional.none = function () {\n return Optional.singletonNone;\n };\n Optional.prototype.fold = function (onNone, onSome) {\n if (this.tag) {\n return onSome(this.value);\n }\n else {\n return onNone();\n }\n };\n Optional.prototype.isSome = function () {\n return this.tag;\n };\n Optional.prototype.isNone = function () {\n return !this.tag;\n };\n Optional.prototype.map = function (mapper) {\n if (this.tag) {\n return Optional.some(mapper(this.value));\n }\n else {\n return Optional.none();\n }\n };\n Optional.prototype.bind = function (binder) {\n if (this.tag) {\n return binder(this.value);\n }\n else {\n return Optional.none();\n }\n };\n Optional.prototype.exists = function (predicate) {\n return this.tag && predicate(this.value);\n };\n Optional.prototype.forall = function (predicate) {\n return !this.tag || predicate(this.value);\n };\n Optional.prototype.filter = function (predicate) {\n if (!this.tag || predicate(this.value)) {\n return this;\n }\n else {\n return Optional.none();\n }\n };\n Optional.prototype.getOr = function (replacement) {\n return this.tag ? this.value : replacement;\n };\n Optional.prototype.or = function (replacement) {\n return this.tag ? this : replacement;\n };\n Optional.prototype.getOrThunk = function (thunk) {\n return this.tag ? this.value : thunk();\n };\n Optional.prototype.orThunk = function (thunk) {\n return this.tag ? this : thunk();\n };\n Optional.prototype.getOrDie = function (message) {\n if (!this.tag) {\n throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');\n }\n else {\n return this.value;\n }\n };\n Optional.from = function (value) {\n return isNonNullable(value) ? Optional.some(value) : Optional.none();\n };\n Optional.prototype.getOrNull = function () {\n return this.tag ? this.value : null;\n };\n Optional.prototype.getOrUndefined = function () {\n return this.value;\n };\n Optional.prototype.each = function (worker) {\n if (this.tag) {\n worker(this.value);\n }\n };\n Optional.prototype.toArray = function () {\n return this.tag ? [this.value] : [];\n };\n Optional.prototype.toString = function () {\n return this.tag ? \"some(\".concat(this.value, \")\") : 'none()';\n };\n return Optional;\n }());\n Optional.singletonNone = new Optional(false);\n var nativeIndexOf = Array.prototype.indexOf;\n var nativePush = Array.prototype.push;\n var rawIndexOf = function (ts, t) { return nativeIndexOf.call(ts, t); };\n var contains = function (xs, x) { return rawIndexOf(xs, x) > -1; };\n var map = function (xs, f) {\n var len = xs.length;\n var r = new Array(len);\n for (var i = 0; i < len; i++) {\n var x = xs[i];\n r[i] = f(x, i);\n }\n return r;\n };\n var each$1 = function (xs, f) {\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n f(x, i);\n }\n };\n var foldl = function (xs, f, acc) {\n each$1(xs, function (x, i) {\n acc = f(acc, x, i);\n });\n return acc;\n };\n var flatten = function (xs) {\n var r = [];\n for (var i = 0, len = xs.length; i < len; ++i) {\n if (!isArray(xs[i])) {\n throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);\n }\n nativePush.apply(r, xs[i]);\n }\n return r;\n };\n var bind = function (xs, f) { return flatten(map(xs, f)); };\n var findMap = function (arr, f) {\n for (var i = 0; i < arr.length; i++) {\n var r = f(arr[i], i);\n if (r.isSome()) {\n return r;\n }\n }\n return Optional.none();\n };\n var is = function (lhs, rhs, comparator) {\n if (comparator === void 0) { comparator = tripleEquals; }\n return lhs.exists(function (left) { return comparator(left, rhs); });\n };\n var cat = function (arr) {\n var r = [];\n var push = function (x) {\n r.push(x);\n };\n for (var i = 0; i < arr.length; i++) {\n arr[i].each(push);\n }\n return r;\n };\n var someIf = function (b, a) { return b ? Optional.some(a) : Optional.none(); };\n var option = function (name) { return function (editor) { return editor.options.get(name); }; };\n var register$1 = function (editor) {\n var registerOption = editor.options.register;\n registerOption('link_assume_external_targets', {\n processor: function (value) {\n var valid = isString(value) || isBoolean(value);\n if (valid) {\n if (value === true) {\n return {\n value: 1,\n valid: valid\n };\n }\n else if (value === 'http' || value === 'https') {\n return {\n value: value,\n valid: valid\n };\n }\n else {\n return {\n value: 0,\n valid: valid\n };\n }\n }\n else {\n return {\n valid: false,\n message: 'Must be a string or a boolean.'\n };\n }\n },\n default: false\n });\n registerOption('link_context_toolbar', {\n processor: 'boolean',\n default: false\n });\n registerOption('link_list', { processor: function (value) { return isString(value) || isFunction(value) || isArrayOf(value, isObject); } });\n registerOption('link_default_target', { processor: 'string' });\n registerOption('link_default_protocol', {\n processor: 'string',\n default: 'https'\n });\n registerOption('link_target_list', {\n processor: function (value) { return isBoolean(value) || isArrayOf(value, isObject); },\n default: true\n });\n registerOption('link_rel_list', {\n processor: 'object[]',\n default: []\n });\n registerOption('link_class_list', {\n processor: 'object[]',\n default: []\n });\n registerOption('link_title', {\n processor: 'boolean',\n default: true\n });\n registerOption('allow_unsafe_link_target', {\n processor: 'boolean',\n default: false\n });\n registerOption('link_quicklink', {\n processor: 'boolean',\n default: false\n });\n };\n var assumeExternalTargets = option('link_assume_external_targets');\n var hasContextToolbar = option('link_context_toolbar');\n var getLinkList = option('link_list');\n var getDefaultLinkTarget = option('link_default_target');\n var getDefaultLinkProtocol = option('link_default_protocol');\n var getTargetList = option('link_target_list');\n var getRelList = option('link_rel_list');\n var getLinkClassList = option('link_class_list');\n var shouldShowLinkTitle = option('link_title');\n var allowUnsafeLinkTarget = option('allow_unsafe_link_target');\n var useQuickLink = option('link_quicklink');\n var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools');\n var getValue = function (item) { return isString(item.value) ? item.value : ''; };\n var getText = function (item) {\n if (isString(item.text)) {\n return item.text;\n }\n else if (isString(item.title)) {\n return item.title;\n }\n else {\n return '';\n }\n };\n var sanitizeList = function (list, extractValue) {\n var out = [];\n global$4.each(list, function (item) {\n var text = getText(item);\n if (item.menu !== undefined) {\n var items = sanitizeList(item.menu, extractValue);\n out.push({\n text: text,\n items: items\n });\n }\n else {\n var value = extractValue(item);\n out.push({\n text: text,\n value: value\n });\n }\n });\n return out;\n };\n var sanitizeWith = function (extracter) {\n if (extracter === void 0) { extracter = getValue; }\n return function (list) { return Optional.from(list).map(function (list) { return sanitizeList(list, extracter); }); };\n };\n var sanitize = function (list) { return sanitizeWith(getValue)(list); };\n var createUi = function (name, label) { return function (items) { return ({\n name: name,\n type: 'listbox',\n label: label,\n items: items\n }); }; };\n var ListOptions = {\n sanitize: sanitize,\n sanitizeWith: sanitizeWith,\n createUi: createUi,\n getValue: getValue\n };\n var keys = Object.keys;\n var hasOwnProperty = Object.hasOwnProperty;\n var each = function (obj, f) {\n var props = keys(obj);\n for (var k = 0, len = props.length; k < len; k++) {\n var i = props[k];\n var x = obj[i];\n f(x, i);\n }\n };\n var objAcc = function (r) { return function (x, i) {\n r[i] = x;\n }; };\n var internalFilter = function (obj, pred, onTrue, onFalse) {\n each(obj, function (x, i) {\n (pred(x, i) ? onTrue : onFalse)(x, i);\n });\n };\n var filter = function (obj, pred) {\n var t = {};\n internalFilter(obj, pred, objAcc(t), noop);\n return t;\n };\n var has = function (obj, key) { return hasOwnProperty.call(obj, key); };\n var hasNonNullableKey = function (obj, key) { return has(obj, key) && obj[key] !== undefined && obj[key] !== null; };\n var global$3 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');\n var global$2 = tinymce.util.Tools.resolve('tinymce.util.URI');\n var isAnchor = function (elm) { return isNonNullable(elm) && elm.nodeName.toLowerCase() === 'a'; };\n var isLink = function (elm) { return isAnchor(elm) && !!getHref(elm); };\n var collectNodesInRange = function (rng, predicate) {\n if (rng.collapsed) {\n return [];\n }\n else {\n var contents = rng.cloneContents();\n var firstChild = contents.firstChild;\n var walker = new global$3(firstChild, contents);\n var elements = [];\n var current = firstChild;\n do {\n if (predicate(current)) {\n elements.push(current);\n }\n } while (current = walker.next());\n return elements;\n }\n };\n var hasProtocol = function (url) { return /^\\w+:/i.test(url); };\n var getHref = function (elm) {\n var _a, _b;\n return (_b = (_a = elm.getAttribute('data-mce-href')) !== null && _a !== void 0 ? _a : elm.getAttribute('href')) !== null && _b !== void 0 ? _b : '';\n };\n var applyRelTargetRules = function (rel, isUnsafe) {\n var rules = ['noopener'];\n var rels = rel ? rel.split(/\\s+/) : [];\n var toString = function (rels) { return global$4.trim(rels.sort().join(' ')); };\n var addTargetRules = function (rels) {\n rels = removeTargetRules(rels);\n return rels.length > 0 ? rels.concat(rules) : rules;\n };\n var removeTargetRules = function (rels) { return rels.filter(function (val) { return global$4.inArray(rules, val) === -1; }); };\n var newRels = isUnsafe ? addTargetRules(rels) : removeTargetRules(rels);\n return newRels.length > 0 ? toString(newRels) : '';\n };\n var trimCaretContainers = function (text) { return text.replace(/\\uFEFF/g, ''); };\n var getAnchorElement = function (editor, selectedElm) {\n selectedElm = selectedElm || getLinksInSelection(editor.selection.getRng())[0] || editor.selection.getNode();\n if (isImageFigure(selectedElm)) {\n return Optional.from(editor.dom.select('a[href]', selectedElm)[0]);\n }\n else {\n return Optional.from(editor.dom.getParent(selectedElm, 'a[href]'));\n }\n };\n var isInAnchor = function (editor, selectedElm) { return getAnchorElement(editor, selectedElm).isSome(); };\n var getAnchorText = function (selection, anchorElm) {\n var text = anchorElm.fold(function () { return selection.getContent({ format: 'text' }); }, function (anchorElm) { return anchorElm.innerText || anchorElm.textContent || ''; });\n return trimCaretContainers(text);\n };\n var getLinksInSelection = function (rng) { return collectNodesInRange(rng, isLink); };\n var getLinks$1 = function (elements) { return global$4.grep(elements, isLink); };\n var hasLinks = function (elements) { return getLinks$1(elements).length > 0; };\n var hasLinksInSelection = function (rng) { return getLinksInSelection(rng).length > 0; };\n var isOnlyTextSelected = function (editor) {\n var inlineTextElements = editor.schema.getTextInlineElements();\n var isElement = function (elm) { return elm.nodeType === 1 && !isAnchor(elm) && !has(inlineTextElements, elm.nodeName.toLowerCase()); };\n var isInBlockAnchor = getAnchorElement(editor).exists(function (anchor) { return anchor.hasAttribute('data-mce-block'); });\n if (isInBlockAnchor) {\n return false;\n }\n var rng = editor.selection.getRng();\n if (!rng.collapsed) {\n var elements = collectNodesInRange(rng, isElement);\n return elements.length === 0;\n }\n else {\n return true;\n }\n };\n var isImageFigure = function (elm) { return isNonNullable(elm) && elm.nodeName === 'FIGURE' && /\\bimage\\b/i.test(elm.className); };\n var getLinkAttrs = function (data) {\n var attrs = [\n 'title',\n 'rel',\n 'class',\n 'target'\n ];\n return foldl(attrs, function (acc, key) {\n data[key].each(function (value) {\n acc[key] = value.length > 0 ? value : null;\n });\n return acc;\n }, { href: data.href });\n };\n var handleExternalTargets = function (href, assumeExternalTargets) {\n if ((assumeExternalTargets === 'http' || assumeExternalTargets === 'https') && !hasProtocol(href)) {\n return assumeExternalTargets + '://' + href;\n }\n return href;\n };\n var applyLinkOverrides = function (editor, linkAttrs) {\n var newLinkAttrs = __assign({}, linkAttrs);\n if (getRelList(editor).length === 0 && !allowUnsafeLinkTarget(editor)) {\n var newRel = applyRelTargetRules(newLinkAttrs.rel, newLinkAttrs.target === '_blank');\n newLinkAttrs.rel = newRel ? newRel : null;\n }\n if (Optional.from(newLinkAttrs.target).isNone() && getTargetList(editor) === false) {\n newLinkAttrs.target = getDefaultLinkTarget(editor);\n }\n newLinkAttrs.href = handleExternalTargets(newLinkAttrs.href, assumeExternalTargets(editor));\n return newLinkAttrs;\n };\n var updateLink = function (editor, anchorElm, text, linkAttrs) {\n text.each(function (text) {\n if (has(anchorElm, 'innerText')) {\n anchorElm.innerText = text;\n }\n else {\n anchorElm.textContent = text;\n }\n });\n editor.dom.setAttribs(anchorElm, linkAttrs);\n editor.selection.select(anchorElm);\n };\n var createLink = function (editor, selectedElm, text, linkAttrs) {\n var dom = editor.dom;\n if (isImageFigure(selectedElm)) {\n linkImageFigure(dom, selectedElm, linkAttrs);\n }\n else {\n text.fold(function () {\n editor.execCommand('mceInsertLink', false, linkAttrs);\n }, function (text) {\n editor.insertContent(dom.createHTML('a', linkAttrs, dom.encode(text)));\n });\n }\n };\n var linkDomMutation = function (editor, attachState, data) {\n var selectedElm = editor.selection.getNode();\n var anchorElm = getAnchorElement(editor, selectedElm);\n var linkAttrs = applyLinkOverrides(editor, getLinkAttrs(data));\n editor.undoManager.transact(function () {\n if (data.href === attachState.href) {\n attachState.attach();\n }\n anchorElm.fold(function () {\n createLink(editor, selectedElm, data.text, linkAttrs);\n }, function (elm) {\n editor.focus();\n updateLink(editor, elm, data.text, linkAttrs);\n });\n });\n };\n var unlinkSelection = function (editor) {\n var dom = editor.dom, selection = editor.selection;\n var bookmark = selection.getBookmark();\n var rng = selection.getRng().cloneRange();\n var startAnchorElm = dom.getParent(rng.startContainer, 'a[href]', editor.getBody());\n var endAnchorElm = dom.getParent(rng.endContainer, 'a[href]', editor.getBody());\n if (startAnchorElm) {\n rng.setStartBefore(startAnchorElm);\n }\n if (endAnchorElm) {\n rng.setEndAfter(endAnchorElm);\n }\n selection.setRng(rng);\n editor.execCommand('unlink');\n selection.moveToBookmark(bookmark);\n };\n var unlinkDomMutation = function (editor) {\n editor.undoManager.transact(function () {\n var node = editor.selection.getNode();\n if (isImageFigure(node)) {\n unlinkImageFigure(editor, node);\n }\n else {\n unlinkSelection(editor);\n }\n editor.focus();\n });\n };\n var unwrapOptions = function (data) {\n var cls = data.class, href = data.href, rel = data.rel, target = data.target, text = data.text, title = data.title;\n return filter({\n class: cls.getOrNull(),\n href: href,\n rel: rel.getOrNull(),\n target: target.getOrNull(),\n text: text.getOrNull(),\n title: title.getOrNull()\n }, function (v, _k) { return isNull(v) === false; });\n };\n var sanitizeData = function (editor, data) {\n var getOption = editor.options.get;\n var uriOptions = {\n allow_html_data_urls: getOption('allow_html_data_urls'),\n allow_script_urls: getOption('allow_script_urls'),\n allow_svg_data_urls: getOption('allow_svg_data_urls')\n };\n var href = data.href;\n return __assign(__assign({}, data), { href: global$2.isDomSafe(href, 'a', uriOptions) ? href : '' });\n };\n var link = function (editor, attachState, data) {\n var sanitizedData = sanitizeData(editor, data);\n editor.hasPlugin('rtc', true) ? editor.execCommand('createlink', false, unwrapOptions(sanitizedData)) : linkDomMutation(editor, attachState, sanitizedData);\n };\n var unlink = function (editor) {\n editor.hasPlugin('rtc', true) ? editor.execCommand('unlink') : unlinkDomMutation(editor);\n };\n var unlinkImageFigure = function (editor, fig) {\n var _a;\n var img = editor.dom.select('img', fig)[0];\n if (img) {\n var a = editor.dom.getParents(img, 'a[href]', fig)[0];\n if (a) {\n (_a = a.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(img, a);\n editor.dom.remove(a);\n }\n }\n };\n var linkImageFigure = function (dom, fig, attrs) {\n var _a;\n var img = dom.select('img', fig)[0];\n if (img) {\n var a = dom.create('a', attrs);\n (_a = img.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(a, img);\n a.appendChild(img);\n }\n };\n var isListGroup = function (item) { return hasNonNullableKey(item, 'items'); };\n var findTextByValue = function (value, catalog) { return findMap(catalog, function (item) {\n if (isListGroup(item)) {\n return findTextByValue(value, item.items);\n }\n else {\n return someIf(item.value === value, item);\n }\n }); };\n var getDelta = function (persistentText, fieldName, catalog, data) {\n var value = data[fieldName];\n var hasPersistentText = persistentText.length > 0;\n return value !== undefined ? findTextByValue(value, catalog).map(function (i) { return ({\n url: {\n value: i.value,\n meta: {\n text: hasPersistentText ? persistentText : i.text,\n attach: noop\n }\n },\n text: hasPersistentText ? persistentText : i.text\n }); }) : Optional.none();\n };\n var findCatalog = function (catalogs, fieldName) {\n if (fieldName === 'link') {\n return catalogs.link;\n }\n else if (fieldName === 'anchor') {\n return catalogs.anchor;\n }\n else {\n return Optional.none();\n }\n };\n var init = function (initialData, linkCatalog) {\n var persistentData = {\n text: initialData.text,\n title: initialData.title\n };\n var getTitleFromUrlChange = function (url) {\n var _a;\n return someIf(persistentData.title.length <= 0, Optional.from((_a = url.meta) === null || _a === void 0 ? void 0 : _a.title).getOr(''));\n };\n var getTextFromUrlChange = function (url) {\n var _a;\n return someIf(persistentData.text.length <= 0, Optional.from((_a = url.meta) === null || _a === void 0 ? void 0 : _a.text).getOr(url.value));\n };\n var onUrlChange = function (data) {\n var text = getTextFromUrlChange(data.url);\n var title = getTitleFromUrlChange(data.url);\n if (text.isSome() || title.isSome()) {\n return Optional.some(__assign(__assign({}, text.map(function (text) { return ({ text: text }); }).getOr({})), title.map(function (title) { return ({ title: title }); }).getOr({})));\n }\n else {\n return Optional.none();\n }\n };\n var onCatalogChange = function (data, change) {\n var catalog = findCatalog(linkCatalog, change).getOr([]);\n return getDelta(persistentData.text, change, catalog, data);\n };\n var onChange = function (getData, change) {\n var name = change.name;\n if (name === 'url') {\n return onUrlChange(getData());\n }\n else if (contains([\n 'anchor',\n 'link'\n ], name)) {\n return onCatalogChange(getData(), name);\n }\n else if (name === 'text' || name === 'title') {\n persistentData[name] = getData()[name];\n return Optional.none();\n }\n else {\n return Optional.none();\n }\n };\n return { onChange: onChange };\n };\n var DialogChanges = {\n init: init,\n getDelta: getDelta\n };\n var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay');\n var delayedConfirm = function (editor, message, callback) {\n var rng = editor.selection.getRng();\n global$1.setEditorTimeout(editor, function () {\n editor.windowManager.confirm(message, function (state) {\n editor.selection.setRng(rng);\n callback(state);\n });\n });\n };\n var tryEmailTransform = function (data) {\n var url = data.href;\n var suggestMailTo = url.indexOf('@') > 0 && url.indexOf('/') === -1 && url.indexOf('mailto:') === -1;\n return suggestMailTo ? Optional.some({\n message: 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?',\n preprocess: function (oldData) { return (__assign(__assign({}, oldData), { href: 'mailto:' + url })); }\n }) : Optional.none();\n };\n var tryProtocolTransform = function (assumeExternalTargets, defaultLinkProtocol) { return function (data) {\n var url = data.href;\n var suggestProtocol = assumeExternalTargets === 1 && !hasProtocol(url) || assumeExternalTargets === 0 && /^\\s*www(\\.|\\d\\.)/i.test(url);\n return suggestProtocol ? Optional.some({\n message: \"The URL you entered seems to be an external link. Do you want to add the required \".concat(defaultLinkProtocol, \":// prefix?\"),\n preprocess: function (oldData) { return (__assign(__assign({}, oldData), { href: defaultLinkProtocol + '://' + url })); }\n }) : Optional.none();\n }; };\n var preprocess = function (editor, data) { return findMap([\n tryEmailTransform,\n tryProtocolTransform(assumeExternalTargets(editor), getDefaultLinkProtocol(editor))\n ], function (f) { return f(data); }).fold(function () { return Promise.resolve(data); }, function (transform) { return new Promise(function (callback) {\n delayedConfirm(editor, transform.message, function (state) {\n callback(state ? transform.preprocess(data) : data);\n });\n }); }); };\n var DialogConfirms = { preprocess: preprocess };\n var getAnchors = function (editor) {\n var anchorNodes = editor.dom.select('a:not([href])');\n var anchors = bind(anchorNodes, function (anchor) {\n var id = anchor.name || anchor.id;\n return id ? [{\n text: id,\n value: '#' + id\n }] : [];\n });\n return anchors.length > 0 ? Optional.some([{\n text: 'None',\n value: ''\n }].concat(anchors)) : Optional.none();\n };\n var AnchorListOptions = { getAnchors: getAnchors };\n var getClasses = function (editor) {\n var list = getLinkClassList(editor);\n if (list.length > 0) {\n return ListOptions.sanitize(list);\n }\n return Optional.none();\n };\n var ClassListOptions = { getClasses: getClasses };\n var parseJson = function (text) {\n try {\n return Optional.some(JSON.parse(text));\n }\n catch (err) {\n return Optional.none();\n }\n };\n var getLinks = function (editor) {\n var extractor = function (item) { return editor.convertURL(item.value || item.url || '', 'href'); };\n var linkList = getLinkList(editor);\n return new Promise(function (resolve) {\n if (isString(linkList)) {\n fetch(linkList).then(function (res) { return res.ok ? res.text().then(parseJson) : Promise.reject(); }).then(resolve, function () { return resolve(Optional.none()); });\n }\n else if (isFunction(linkList)) {\n linkList(function (output) { return resolve(Optional.some(output)); });\n }\n else {\n resolve(Optional.from(linkList));\n }\n }).then(function (optItems) { return optItems.bind(ListOptions.sanitizeWith(extractor)).map(function (items) {\n if (items.length > 0) {\n var noneItem = [{\n text: 'None',\n value: ''\n }];\n return noneItem.concat(items);\n }\n else {\n return items;\n }\n }); });\n };\n var LinkListOptions = { getLinks: getLinks };\n var getRels = function (editor, initialTarget) {\n var list = getRelList(editor);\n if (list.length > 0) {\n var isTargetBlank_1 = is(initialTarget, '_blank');\n var enforceSafe = allowUnsafeLinkTarget(editor) === false;\n var safeRelExtractor = function (item) { return applyRelTargetRules(ListOptions.getValue(item), isTargetBlank_1); };\n var sanitizer = enforceSafe ? ListOptions.sanitizeWith(safeRelExtractor) : ListOptions.sanitize;\n return sanitizer(list);\n }\n return Optional.none();\n };\n var RelOptions = { getRels: getRels };\n var fallbacks = [\n {\n text: 'Current window',\n value: ''\n },\n {\n text: 'New window',\n value: '_blank'\n }\n ];\n var getTargets = function (editor) {\n var list = getTargetList(editor);\n if (isArray(list)) {\n return ListOptions.sanitize(list).orThunk(function () { return Optional.some(fallbacks); });\n }\n else if (list === false) {\n return Optional.none();\n }\n return Optional.some(fallbacks);\n };\n var TargetOptions = { getTargets: getTargets };\n var nonEmptyAttr = function (dom, elem, name) {\n var val = dom.getAttrib(elem, name);\n return val !== null && val.length > 0 ? Optional.some(val) : Optional.none();\n };\n var extractFromAnchor = function (editor, anchor) {\n var dom = editor.dom;\n var onlyText = isOnlyTextSelected(editor);\n var text = onlyText ? Optional.some(getAnchorText(editor.selection, anchor)) : Optional.none();\n var url = anchor.bind(function (anchorElm) { return Optional.from(dom.getAttrib(anchorElm, 'href')); });\n var target = anchor.bind(function (anchorElm) { return Optional.from(dom.getAttrib(anchorElm, 'target')); });\n var rel = anchor.bind(function (anchorElm) { return nonEmptyAttr(dom, anchorElm, 'rel'); });\n var linkClass = anchor.bind(function (anchorElm) { return nonEmptyAttr(dom, anchorElm, 'class'); });\n var title = anchor.bind(function (anchorElm) { return nonEmptyAttr(dom, anchorElm, 'title'); });\n return {\n url: url,\n text: text,\n title: title,\n target: target,\n rel: rel,\n linkClass: linkClass\n };\n };\n var collect = function (editor, linkNode) { return LinkListOptions.getLinks(editor).then(function (links) {\n var anchor = extractFromAnchor(editor, linkNode);\n return {\n anchor: anchor,\n catalogs: {\n targets: TargetOptions.getTargets(editor),\n rels: RelOptions.getRels(editor, anchor.target),\n classes: ClassListOptions.getClasses(editor),\n anchor: AnchorListOptions.getAnchors(editor),\n link: links\n },\n optNode: linkNode,\n flags: { titleEnabled: shouldShowLinkTitle(editor) }\n };\n }); };\n var DialogInfo = { collect: collect };\n var handleSubmit = function (editor, info) { return function (api) {\n var data = api.getData();\n if (!data.url.value) {\n unlink(editor);\n api.close();\n return;\n }\n var getChangedValue = function (key) { return Optional.from(data[key]).filter(function (value) { return !is(info.anchor[key], value); }); };\n var changedData = {\n href: data.url.value,\n text: getChangedValue('text'),\n target: getChangedValue('target'),\n rel: getChangedValue('rel'),\n class: getChangedValue('linkClass'),\n title: getChangedValue('title')\n };\n var attachState = {\n href: data.url.value,\n attach: data.url.meta !== undefined && data.url.meta.attach ? data.url.meta.attach : noop\n };\n DialogConfirms.preprocess(editor, changedData).then(function (pData) {\n link(editor, attachState, pData);\n });\n api.close();\n }; };\n var collectData = function (editor) {\n var anchorNode = getAnchorElement(editor);\n return DialogInfo.collect(editor, anchorNode);\n };\n var getInitialData = function (info, defaultTarget) {\n var anchor = info.anchor;\n var url = anchor.url.getOr('');\n return {\n url: {\n value: url,\n meta: { original: { value: url } }\n },\n text: anchor.text.getOr(''),\n title: anchor.title.getOr(''),\n anchor: url,\n link: url,\n rel: anchor.rel.getOr(''),\n target: anchor.target.or(defaultTarget).getOr(''),\n linkClass: anchor.linkClass.getOr('')\n };\n };\n var makeDialog = function (settings, onSubmit, editor) {\n var urlInput = [{\n name: 'url',\n type: 'urlinput',\n filetype: 'file',\n label: 'URL',\n picker_text: 'Browse links'\n }];\n var displayText = settings.anchor.text.map(function () { return ({\n name: 'text',\n type: 'input',\n label: 'Text to display'\n }); }).toArray();\n var titleText = settings.flags.titleEnabled ? [{\n name: 'title',\n type: 'input',\n label: 'Title'\n }] : [];\n var defaultTarget = Optional.from(getDefaultLinkTarget(editor));\n var initialData = getInitialData(settings, defaultTarget);\n var catalogs = settings.catalogs;\n var dialogDelta = DialogChanges.init(initialData, catalogs);\n var body = {\n type: 'panel',\n items: flatten([\n urlInput,\n displayText,\n titleText,\n cat([\n catalogs.anchor.map(ListOptions.createUi('anchor', 'Anchors')),\n catalogs.rels.map(ListOptions.createUi('rel', 'Rel')),\n catalogs.targets.map(ListOptions.createUi('target', 'Open link in...')),\n catalogs.link.map(ListOptions.createUi('link', 'Link list')),\n catalogs.classes.map(ListOptions.createUi('linkClass', 'Class'))\n ])\n ])\n };\n return {\n title: 'Insert/Edit Link',\n size: 'normal',\n body: body,\n buttons: [\n {\n type: 'cancel',\n name: 'cancel',\n text: 'Cancel'\n },\n {\n type: 'submit',\n name: 'save',\n text: 'Save',\n primary: true\n }\n ],\n initialData: initialData,\n onChange: function (api, _c) {\n var name = _c.name;\n dialogDelta.onChange(api.getData, { name: name }).each(function (newData) {\n api.setData(newData);\n });\n },\n onSubmit: onSubmit\n };\n };\n var open$1 = function (editor) {\n var data = collectData(editor);\n data.then(function (info) {\n var onSubmit = handleSubmit(editor, info);\n return makeDialog(info, onSubmit, editor);\n }).then(function (spec) {\n editor.windowManager.open(spec);\n });\n };\n var register = function (editor) {\n editor.addCommand('mceLink', function (_ui, value) {\n if ((value === null || value === void 0 ? void 0 : value.dialog) === true || !useQuickLink(editor)) {\n open$1(editor);\n }\n else {\n editor.dispatch('contexttoolbar-show', { toolbarKey: 'quicklink' });\n }\n });\n };\n var global = tinymce.util.Tools.resolve('tinymce.util.VK');\n var appendClickRemove = function (link, evt) {\n document.body.appendChild(link);\n link.dispatchEvent(evt);\n document.body.removeChild(link);\n };\n var open = function (url) {\n var link = document.createElement('a');\n link.target = '_blank';\n link.href = url;\n link.rel = 'noreferrer noopener';\n var evt = document.createEvent('MouseEvents');\n evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n appendClickRemove(link, evt);\n };\n var getLink = function (editor, elm) { return editor.dom.getParent(elm, 'a[href]'); };\n var getSelectedLink = function (editor) { return getLink(editor, editor.selection.getStart()); };\n var hasOnlyAltModifier = function (e) {\n return e.altKey === true && e.shiftKey === false && e.ctrlKey === false && e.metaKey === false;\n };\n var gotoLink = function (editor, a) {\n if (a) {\n var href = getHref(a);\n if (/^#/.test(href)) {\n var targetEl = editor.dom.select(href);\n if (targetEl.length) {\n editor.selection.scrollIntoView(targetEl[0], true);\n }\n }\n else {\n open(a.href);\n }\n }\n };\n var openDialog = function (editor) { return function () {\n editor.execCommand('mceLink', false, { dialog: true });\n }; };\n var gotoSelectedLink = function (editor) { return function () {\n gotoLink(editor, getSelectedLink(editor));\n }; };\n var setupGotoLinks = function (editor) {\n editor.on('click', function (e) {\n var link = getLink(editor, e.target);\n if (link && global.metaKeyPressed(e)) {\n e.preventDefault();\n gotoLink(editor, link);\n }\n });\n editor.on('keydown', function (e) {\n if (!e.isDefaultPrevented() && e.keyCode === 13 && hasOnlyAltModifier(e)) {\n var link_1 = getSelectedLink(editor);\n if (link_1) {\n e.preventDefault();\n gotoLink(editor, link_1);\n }\n }\n });\n };\n var toggleState = function (editor, toggler) {\n editor.on('NodeChange', toggler);\n return function () { return editor.off('NodeChange', toggler); };\n };\n var toggleLinkState = function (editor) { return function (api) {\n var updateState = function () {\n api.setActive(!editor.mode.isReadOnly() && isInAnchor(editor, editor.selection.getNode()));\n api.setEnabled(editor.selection.isEditable());\n };\n updateState();\n return toggleState(editor, updateState);\n }; };\n var toggleLinkMenuState = function (editor) { return function (api) {\n var updateState = function () {\n api.setEnabled(editor.selection.isEditable());\n };\n updateState();\n return toggleState(editor, updateState);\n }; };\n var hasExactlyOneLinkInSelection = function (editor) {\n var links = editor.selection.isCollapsed() ? getLinks$1(editor.dom.getParents(editor.selection.getStart())) : getLinksInSelection(editor.selection.getRng());\n return links.length === 1;\n };\n var toggleGotoLinkState = function (editor) { return function (api) {\n var updateState = function () { return api.setEnabled(hasExactlyOneLinkInSelection(editor)); };\n updateState();\n return toggleState(editor, updateState);\n }; };\n var toggleUnlinkState = function (editor) { return function (api) {\n var hasLinks$1 = function (parents) { return hasLinks(parents) || hasLinksInSelection(editor.selection.getRng()); };\n var parents = editor.dom.getParents(editor.selection.getStart());\n var updateEnabled = function (parents) {\n api.setEnabled(hasLinks$1(parents) && editor.selection.isEditable());\n };\n updateEnabled(parents);\n return toggleState(editor, function (e) { return updateEnabled(e.parents); });\n }; };\n var setup = function (editor) {\n editor.addShortcut('Meta+K', '', function () {\n editor.execCommand('mceLink');\n });\n };\n var setupButtons = function (editor) {\n editor.ui.registry.addToggleButton('link', {\n icon: 'link',\n tooltip: 'Insert/edit link',\n onAction: openDialog(editor),\n onSetup: toggleLinkState(editor)\n });\n editor.ui.registry.addButton('openlink', {\n icon: 'new-tab',\n tooltip: 'Open link',\n onAction: gotoSelectedLink(editor),\n onSetup: toggleGotoLinkState(editor)\n });\n editor.ui.registry.addButton('unlink', {\n icon: 'unlink',\n tooltip: 'Remove link',\n onAction: function () { return unlink(editor); },\n onSetup: toggleUnlinkState(editor)\n });\n };\n var setupMenuItems = function (editor) {\n editor.ui.registry.addMenuItem('openlink', {\n text: 'Open link',\n icon: 'new-tab',\n onAction: gotoSelectedLink(editor),\n onSetup: toggleGotoLinkState(editor)\n });\n editor.ui.registry.addMenuItem('link', {\n icon: 'link',\n text: 'Link...',\n shortcut: 'Meta+K',\n onSetup: toggleLinkMenuState(editor),\n onAction: openDialog(editor)\n });\n editor.ui.registry.addMenuItem('unlink', {\n icon: 'unlink',\n text: 'Remove link',\n onAction: function () { return unlink(editor); },\n onSetup: toggleUnlinkState(editor)\n });\n };\n var setupContextMenu = function (editor) {\n var inLink = 'link unlink openlink';\n var noLink = 'link';\n editor.ui.registry.addContextMenu('link', {\n update: function (element) {\n var isEditable = editor.dom.isEditable(element);\n if (!isEditable) {\n return '';\n }\n return hasLinks(editor.dom.getParents(element, 'a')) ? inLink : noLink;\n }\n });\n };\n var setupContextToolbars = function (editor) {\n var collapseSelectionToEnd = function (editor) {\n editor.selection.collapse(false);\n };\n var onSetupLink = function (buttonApi) {\n var node = editor.selection.getNode();\n buttonApi.setEnabled(isInAnchor(editor, node));\n return noop;\n };\n var getLinkText = function (value) {\n var anchor = getAnchorElement(editor);\n var onlyText = isOnlyTextSelected(editor);\n if (anchor.isNone() && onlyText) {\n var text = getAnchorText(editor.selection, anchor);\n return someIf(text.length === 0, value);\n }\n else {\n return Optional.none();\n }\n };\n editor.ui.registry.addContextForm('quicklink', {\n launch: {\n type: 'contextformtogglebutton',\n icon: 'link',\n tooltip: 'Link',\n onSetup: toggleLinkState(editor)\n },\n label: 'Link',\n predicate: function (node) { return hasContextToolbar(editor) && isInAnchor(editor, node); },\n initValue: function () {\n var elm = getAnchorElement(editor);\n return elm.fold(constant(''), getHref);\n },\n commands: [\n {\n type: 'contextformtogglebutton',\n icon: 'link',\n tooltip: 'Link',\n primary: true,\n onSetup: function (buttonApi) {\n var node = editor.selection.getNode();\n buttonApi.setActive(isInAnchor(editor, node));\n return toggleLinkState(editor)(buttonApi);\n },\n onAction: function (formApi) {\n var value = formApi.getValue();\n var text = getLinkText(value);\n var attachState = {\n href: value,\n attach: noop\n };\n link(editor, attachState, {\n href: value,\n text: text,\n title: Optional.none(),\n rel: Optional.none(),\n target: Optional.none(),\n class: Optional.none()\n });\n collapseSelectionToEnd(editor);\n formApi.hide();\n }\n },\n {\n type: 'contextformbutton',\n icon: 'unlink',\n tooltip: 'Remove link',\n onSetup: onSetupLink,\n onAction: function (formApi) {\n unlink(editor);\n formApi.hide();\n }\n },\n {\n type: 'contextformbutton',\n icon: 'new-tab',\n tooltip: 'Open link',\n onSetup: onSetupLink,\n onAction: function (formApi) {\n gotoSelectedLink(editor)();\n formApi.hide();\n }\n }\n ]\n });\n };\n var Plugin = function () {\n global$5.add('link', function (editor) {\n register$1(editor);\n setupButtons(editor);\n setupMenuItems(editor);\n setupContextMenu(editor);\n setupContextToolbars(editor);\n setupGotoLinks(editor);\n register(editor);\n setup(editor);\n });\n };\n Plugin();\n})();\n"],"names":["__assign","this","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","global$5","tinymce","util","Tools","resolve","isType","type","value","x","Array","isArray","o","v","constructor","String","isPrototypeOf","_a","name","isSimpleType","isString","isObject","isNull","a","isBoolean","isNonNullable","isNullable","isFunction","isArrayOf","pred","len","noop","tripleEquals","b","Optional","tag","some","none","singletonNone","fold","onNone","onSome","isSome","isNone","map","mapper","bind","binder","exists","predicate","forall","filter","getOr","replacement","or","getOrThunk","thunk","orThunk","getOrDie","message","Error","from","getOrNull","getOrUndefined","each","worker","toArray","toString","concat","nativeIndexOf","indexOf","nativePush","push","contains","xs","ts","rawIndexOf","flatten","r","f","findMap","arr","is","lhs","rhs","comparator","left","cat","someIf","option","editor","options","get","assumeExternalTargets","hasContextToolbar","getLinkList","getDefaultLinkTarget","getDefaultLinkProtocol","getTargetList","getRelList","getLinkClassList","shouldShowLinkTitle","allowUnsafeLinkTarget","useQuickLink","global$4","getValue","item","sanitizeList","list","extractValue","out","text","title","getText","undefined","menu","items","sanitizeWith","extracter","ListOptions","sanitize","createUi","label","keys","internalFilter","obj","onTrue","onFalse","props","k","has","key","global$3","global$2","isAnchor","elm","nodeName","toLowerCase","isLink","getHref","collectNodesInRange","rng","collapsed","contents","cloneContents","firstChild","walker","elements","current","next","hasProtocol","url","test","_b","getAttribute","applyRelTargetRules","rel","isUnsafe","rules","rels","split","removeTargetRules","val","inArray","newRels","addTargetRules","trim","sort","join","getAnchorElement","selectedElm","getLinksInSelection","selection","getRng","getNode","isImageFigure","dom","select","getParent","isInAnchor","getAnchorText","anchorElm","replace","trimCaretContainers","getContent","format","innerText","textContent","getLinks$1","grep","hasLinks","isOnlyTextSelected","inlineTextElements","schema","getTextInlineElements","anchor","hasAttribute","nodeType","className","applyLinkOverrides","linkAttrs","newLinkAttrs","newRel","target","href","handleExternalTargets","linkDomMutation","attachState","data","acc","each$1","getLinkAttrs","undoManager","transact","attach","linkImageFigure","execCommand","insertContent","createHTML","encode","createLink","focus","setAttribs","updateLink","unwrapOptions","cls","class","_k","link","sanitizedData","getOption","uriOptions","allow_html_data_urls","allow_script_urls","allow_svg_data_urls","isDomSafe","sanitizeData","hasPlugin","unlink","node","unlinkImageFigure","bookmark","getBookmark","cloneRange","startAnchorElm","startContainer","getBody","endAnchorElm","endContainer","setStartBefore","setEndAfter","setRng","moveToBookmark","unlinkSelection","unlinkDomMutation","fig","img","getParents","parentNode","insertBefore","remove","attrs","create","appendChild","isListGroup","findTextByValue","catalog","getDelta","persistentText","fieldName","hasPersistentText","meta","DialogChanges","initialData","linkCatalog","persistentData","onUrlChange","getTitleFromUrlChange","onCatalogChange","change","catalogs","onChange","getData","global$1","tryEmailTransform","preprocess","oldData","tryProtocolTransform","defaultLinkProtocol","DialogConfirms","Promise","transform","callback","setEditorTimeout","windowManager","confirm","state","delayedConfirm","AnchorListOptions","anchorNodes","anchors","id","ClassListOptions","parseJson","JSON","parse","err","LinkListOptions","extractor","convertURL","linkList","fetch","then","res","ok","reject","output","optItems","RelOptions","initialTarget","isTargetBlank_1","fallbacks","TargetOptions","nonEmptyAttr","elem","getAttrib","DialogInfo","linkNode","links","linkClass","extractFromAnchor","targets","classes","optNode","flags","titleEnabled","open$1","anchorNode","collectData","info","onSubmit","api","close","getChangedValue","changedData","pData","handleSubmit","settings","displayText","titleText","defaultTarget","original","getInitialData","dialogDelta","size","body","filetype","picker_text","buttons","primary","_c","newData","setData","makeDialog","spec","open","global","document","createElement","evt","createEvent","initMouseEvent","window","dispatchEvent","removeChild","appendClickRemove","getLink","getSelectedLink","getStart","gotoLink","targetEl","scrollIntoView","openDialog","dialog","gotoSelectedLink","toggleState","toggler","on","off","toggleLinkState","updateState","setActive","mode","isReadOnly","setEnabled","isEditable","toggleLinkMenuState","toggleGotoLinkState","isCollapsed","hasExactlyOneLinkInSelection","toggleUnlinkState","hasLinks$1","parents","updateEnabled","e","setupContextToolbars","onSetupLink","buttonApi","ui","registry","addContextForm","launch","icon","tooltip","onSetup","initValue","commands","onAction","formApi","onlyText","getLinkText","collapse","collapseSelectionToEnd","hide","add","registerOption","register","processor","valid","default","register$1","addToggleButton","addButton","setupButtons","addMenuItem","shortcut","setupMenuItems","addContextMenu","update","element","setupContextMenu","metaKeyPressed","preventDefault","isDefaultPrevented","keyCode","altKey","shiftKey","ctrlKey","metaKey","hasOnlyAltModifier","link_1","setupGotoLinks","addCommand","_ui","dispatch","toolbarKey","addShortcut","setup"],"mappings":"kGAIA,IAAIA,EAAYC,GAAQA,EAAKD,UAAa,WAStC,OARAA,EAAWE,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,GACOJ,OAAOS,UAAUC,eAAeC,KAAKR,EAAGK,KACzDN,EAAEM,GAAKL,EAAEK,IAEjB,OAAON,GAEJJ,EAASc,MAAMb,KAAMO,mBAEhC,WAEI,IA2BmBJ,EA3BfW,EAAWC,QAAQC,KAAKC,MAAMC,QAAQ,yBAyBtCC,EAAS,SAAUC,GAAQ,OAAO,SAAUC,GAAS,OAdjDlB,SADemB,EAegDD,IAbzD,OAANC,EACO,OAEI,WAANnB,GAAkBoB,MAAMC,QAAQF,GAC9B,QAEI,WAANnB,IAAgDsB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AAU,EAChDoU,QAASd,GAAkBtT,KA0G3B0V,CAAe1V,GAvGA,SAAUA,GAG7BA,EAAO8T,GAAGC,SAAS4B,eAAe,OAAQ,CACtCC,OAAQ,SAAUC,GAEd,OADiB7V,EAAOsF,IAAI2N,WAAW4C,GAIhCzP,GAASpG,EAAOsF,IAAIiF,WAAWsL,EAAS,MAR1C,uBACA,OAKM,EAG3B,IA8FYC,CAAiB9V,GACjB2T,GAAqB3T,GA9MR,SAAUA,GAC3BA,EAAOyS,GAAG,SAAS,SAAUiB,GACzB,IAAIhL,EAAOoJ,GAAQ9R,EAAQ0T,EAAEzM,QACzByB,GAAQ0I,GAAO2E,eAAerC,KAC9BA,EAAEsC,iBACF/D,GAASjS,EAAQ0I,GAEjC,IACQ1I,EAAOyS,GAAG,WAAW,SAAUiB,GAC3B,IAAKA,EAAEuC,sBAAsC,KAAdvC,EAAEwC,SAhChB,SAAUxC,GAC/B,OAAoB,IAAbA,EAAEyC,SAAkC,IAAfzC,EAAE0C,WAAoC,IAAd1C,EAAE2C,UAAmC,IAAd3C,EAAE4C,QA+BtBC,CAAmB7C,GAAI,CACtE,IAAI8C,EAASzE,GAAgB/R,GACzBwW,IACA9C,EAAEsC,iBACF/D,GAASjS,EAAQwW,GAErC,CACA,IA+LYC,CAAezW,GAjQR,SAAUA,GACrBA,EAAO0W,WAAW,WAAW,SAAUC,EAAK7b,IAC6B,KAAhEA,aAAqC,EAASA,EAAMuX,SAAqBxR,EAAab,GAIvFA,EAAO4W,SAAS,sBAAuB,CAAEC,WAAY,cAHrDvH,GAAOtP,EAKvB,IA0PYgV,CAAShV,GAzJL,SAAUA,GAClBA,EAAO8W,YAAY,SAAU,IAAI,WAC7B9W,EAAO8H,YAAY,UAC/B,IAuJYiP,CAAM/W,EAClB,GAGC,CA9sCD"}
1
+ {"version":3,"file":"plugin.mjs","sources":["../../../../../public/tinymce/plugins/link/plugin.js"],"sourcesContent":["\"use strict\";\n/**\n * TinyMCE version 6.8.5 (TBD)\n */\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n(function () {\n 'use strict';\n var global$5 = tinymce.util.Tools.resolve('tinymce.PluginManager');\n var hasProto = function (v, constructor, predicate) {\n var _a;\n if (predicate(v, constructor.prototype)) {\n return true;\n }\n else {\n return ((_a = v.constructor) === null || _a === void 0 ? void 0 : _a.name) === constructor.name;\n }\n };\n var typeOf = function (x) {\n var t = typeof x;\n if (x === null) {\n return 'null';\n }\n else if (t === 'object' && Array.isArray(x)) {\n return 'array';\n }\n else if (t === 'object' && hasProto(x, String, function (o, proto) { return proto.isPrototypeOf(o); })) {\n return 'string';\n }\n else {\n return t;\n }\n };\n var isType = function (type) { return function (value) { return typeOf(value) === type; }; };\n var isSimpleType = function (type) { return function (value) { return typeof value === type; }; };\n var eq = function (t) { return function (a) { return t === a; }; };\n var isString = isType('string');\n var isObject = isType('object');\n var isArray = isType('array');\n var isNull = eq(null);\n var isBoolean = isSimpleType('boolean');\n var isNullable = function (a) { return a === null || a === undefined; };\n var isNonNullable = function (a) { return !isNullable(a); };\n var isFunction = isSimpleType('function');\n var isArrayOf = function (value, pred) {\n if (isArray(value)) {\n for (var i = 0, len = value.length; i < len; ++i) {\n if (!pred(value[i])) {\n return false;\n }\n }\n return true;\n }\n return false;\n };\n var noop = function () {\n };\n var constant = function (value) {\n return function () {\n return value;\n };\n };\n var tripleEquals = function (a, b) {\n return a === b;\n };\n var Optional = /** @class */ (function () {\n function Optional(tag, value) {\n this.tag = tag;\n this.value = value;\n }\n Optional.some = function (value) {\n return new Optional(true, value);\n };\n Optional.none = function () {\n return Optional.singletonNone;\n };\n Optional.prototype.fold = function (onNone, onSome) {\n if (this.tag) {\n return onSome(this.value);\n }\n else {\n return onNone();\n }\n };\n Optional.prototype.isSome = function () {\n return this.tag;\n };\n Optional.prototype.isNone = function () {\n return !this.tag;\n };\n Optional.prototype.map = function (mapper) {\n if (this.tag) {\n return Optional.some(mapper(this.value));\n }\n else {\n return Optional.none();\n }\n };\n Optional.prototype.bind = function (binder) {\n if (this.tag) {\n return binder(this.value);\n }\n else {\n return Optional.none();\n }\n };\n Optional.prototype.exists = function (predicate) {\n return this.tag && predicate(this.value);\n };\n Optional.prototype.forall = function (predicate) {\n return !this.tag || predicate(this.value);\n };\n Optional.prototype.filter = function (predicate) {\n if (!this.tag || predicate(this.value)) {\n return this;\n }\n else {\n return Optional.none();\n }\n };\n Optional.prototype.getOr = function (replacement) {\n return this.tag ? this.value : replacement;\n };\n Optional.prototype.or = function (replacement) {\n return this.tag ? this : replacement;\n };\n Optional.prototype.getOrThunk = function (thunk) {\n return this.tag ? this.value : thunk();\n };\n Optional.prototype.orThunk = function (thunk) {\n return this.tag ? this : thunk();\n };\n Optional.prototype.getOrDie = function (message) {\n if (!this.tag) {\n throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');\n }\n else {\n return this.value;\n }\n };\n Optional.from = function (value) {\n return isNonNullable(value) ? Optional.some(value) : Optional.none();\n };\n Optional.prototype.getOrNull = function () {\n return this.tag ? this.value : null;\n };\n Optional.prototype.getOrUndefined = function () {\n return this.value;\n };\n Optional.prototype.each = function (worker) {\n if (this.tag) {\n worker(this.value);\n }\n };\n Optional.prototype.toArray = function () {\n return this.tag ? [this.value] : [];\n };\n Optional.prototype.toString = function () {\n return this.tag ? \"some(\".concat(this.value, \")\") : 'none()';\n };\n return Optional;\n }());\n Optional.singletonNone = new Optional(false);\n var nativeIndexOf = Array.prototype.indexOf;\n var nativePush = Array.prototype.push;\n var rawIndexOf = function (ts, t) { return nativeIndexOf.call(ts, t); };\n var contains = function (xs, x) { return rawIndexOf(xs, x) > -1; };\n var map = function (xs, f) {\n var len = xs.length;\n var r = new Array(len);\n for (var i = 0; i < len; i++) {\n var x = xs[i];\n r[i] = f(x, i);\n }\n return r;\n };\n var each$1 = function (xs, f) {\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n f(x, i);\n }\n };\n var foldl = function (xs, f, acc) {\n each$1(xs, function (x, i) {\n acc = f(acc, x, i);\n });\n return acc;\n };\n var flatten = function (xs) {\n var r = [];\n for (var i = 0, len = xs.length; i < len; ++i) {\n if (!isArray(xs[i])) {\n throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);\n }\n nativePush.apply(r, xs[i]);\n }\n return r;\n };\n var bind = function (xs, f) { return flatten(map(xs, f)); };\n var findMap = function (arr, f) {\n for (var i = 0; i < arr.length; i++) {\n var r = f(arr[i], i);\n if (r.isSome()) {\n return r;\n }\n }\n return Optional.none();\n };\n var is = function (lhs, rhs, comparator) {\n if (comparator === void 0) { comparator = tripleEquals; }\n return lhs.exists(function (left) { return comparator(left, rhs); });\n };\n var cat = function (arr) {\n var r = [];\n var push = function (x) {\n r.push(x);\n };\n for (var i = 0; i < arr.length; i++) {\n arr[i].each(push);\n }\n return r;\n };\n var someIf = function (b, a) { return b ? Optional.some(a) : Optional.none(); };\n var option = function (name) { return function (editor) { return editor.options.get(name); }; };\n var register$1 = function (editor) {\n var registerOption = editor.options.register;\n registerOption('link_assume_external_targets', {\n processor: function (value) {\n var valid = isString(value) || isBoolean(value);\n if (valid) {\n if (value === true) {\n return {\n value: 1,\n valid: valid\n };\n }\n else if (value === 'http' || value === 'https') {\n return {\n value: value,\n valid: valid\n };\n }\n else {\n return {\n value: 0,\n valid: valid\n };\n }\n }\n else {\n return {\n valid: false,\n message: 'Must be a string or a boolean.'\n };\n }\n },\n default: false\n });\n registerOption('link_context_toolbar', {\n processor: 'boolean',\n default: false\n });\n registerOption('link_list', { processor: function (value) { return isString(value) || isFunction(value) || isArrayOf(value, isObject); } });\n registerOption('link_default_target', { processor: 'string' });\n registerOption('link_default_protocol', {\n processor: 'string',\n default: 'https'\n });\n registerOption('link_target_list', {\n processor: function (value) { return isBoolean(value) || isArrayOf(value, isObject); },\n default: true\n });\n registerOption('link_rel_list', {\n processor: 'object[]',\n default: []\n });\n registerOption('link_class_list', {\n processor: 'object[]',\n default: []\n });\n registerOption('link_title', {\n processor: 'boolean',\n default: true\n });\n registerOption('allow_unsafe_link_target', {\n processor: 'boolean',\n default: false\n });\n registerOption('link_quicklink', {\n processor: 'boolean',\n default: false\n });\n };\n var assumeExternalTargets = option('link_assume_external_targets');\n var hasContextToolbar = option('link_context_toolbar');\n var getLinkList = option('link_list');\n var getDefaultLinkTarget = option('link_default_target');\n var getDefaultLinkProtocol = option('link_default_protocol');\n var getTargetList = option('link_target_list');\n var getRelList = option('link_rel_list');\n var getLinkClassList = option('link_class_list');\n var shouldShowLinkTitle = option('link_title');\n var allowUnsafeLinkTarget = option('allow_unsafe_link_target');\n var useQuickLink = option('link_quicklink');\n var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools');\n var getValue = function (item) { return isString(item.value) ? item.value : ''; };\n var getText = function (item) {\n if (isString(item.text)) {\n return item.text;\n }\n else if (isString(item.title)) {\n return item.title;\n }\n else {\n return '';\n }\n };\n var sanitizeList = function (list, extractValue) {\n var out = [];\n global$4.each(list, function (item) {\n var text = getText(item);\n if (item.menu !== undefined) {\n var items = sanitizeList(item.menu, extractValue);\n out.push({\n text: text,\n items: items\n });\n }\n else {\n var value = extractValue(item);\n out.push({\n text: text,\n value: value\n });\n }\n });\n return out;\n };\n var sanitizeWith = function (extracter) {\n if (extracter === void 0) { extracter = getValue; }\n return function (list) { return Optional.from(list).map(function (list) { return sanitizeList(list, extracter); }); };\n };\n var sanitize = function (list) { return sanitizeWith(getValue)(list); };\n var createUi = function (name, label) { return function (items) { return ({\n name: name,\n type: 'listbox',\n label: label,\n items: items\n }); }; };\n var ListOptions = {\n sanitize: sanitize,\n sanitizeWith: sanitizeWith,\n createUi: createUi,\n getValue: getValue\n };\n var keys = Object.keys;\n var hasOwnProperty = Object.hasOwnProperty;\n var each = function (obj, f) {\n var props = keys(obj);\n for (var k = 0, len = props.length; k < len; k++) {\n var i = props[k];\n var x = obj[i];\n f(x, i);\n }\n };\n var objAcc = function (r) { return function (x, i) {\n r[i] = x;\n }; };\n var internalFilter = function (obj, pred, onTrue, onFalse) {\n each(obj, function (x, i) {\n (pred(x, i) ? onTrue : onFalse)(x, i);\n });\n };\n var filter = function (obj, pred) {\n var t = {};\n internalFilter(obj, pred, objAcc(t), noop);\n return t;\n };\n var has = function (obj, key) { return hasOwnProperty.call(obj, key); };\n var hasNonNullableKey = function (obj, key) { return has(obj, key) && obj[key] !== undefined && obj[key] !== null; };\n var global$3 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');\n var global$2 = tinymce.util.Tools.resolve('tinymce.util.URI');\n var isAnchor = function (elm) { return isNonNullable(elm) && elm.nodeName.toLowerCase() === 'a'; };\n var isLink = function (elm) { return isAnchor(elm) && !!getHref(elm); };\n var collectNodesInRange = function (rng, predicate) {\n if (rng.collapsed) {\n return [];\n }\n else {\n var contents = rng.cloneContents();\n var firstChild = contents.firstChild;\n var walker = new global$3(firstChild, contents);\n var elements = [];\n var current = firstChild;\n do {\n if (predicate(current)) {\n elements.push(current);\n }\n } while (current = walker.next());\n return elements;\n }\n };\n var hasProtocol = function (url) { return /^\\w+:/i.test(url); };\n var getHref = function (elm) {\n var _a, _b;\n return (_b = (_a = elm.getAttribute('data-mce-href')) !== null && _a !== void 0 ? _a : elm.getAttribute('href')) !== null && _b !== void 0 ? _b : '';\n };\n var applyRelTargetRules = function (rel, isUnsafe) {\n var rules = ['noopener'];\n var rels = rel ? rel.split(/\\s+/) : [];\n var toString = function (rels) { return global$4.trim(rels.sort().join(' ')); };\n var addTargetRules = function (rels) {\n rels = removeTargetRules(rels);\n return rels.length > 0 ? rels.concat(rules) : rules;\n };\n var removeTargetRules = function (rels) { return rels.filter(function (val) { return global$4.inArray(rules, val) === -1; }); };\n var newRels = isUnsafe ? addTargetRules(rels) : removeTargetRules(rels);\n return newRels.length > 0 ? toString(newRels) : '';\n };\n var trimCaretContainers = function (text) { return text.replace(/\\uFEFF/g, ''); };\n var getAnchorElement = function (editor, selectedElm) {\n selectedElm = selectedElm || getLinksInSelection(editor.selection.getRng())[0] || editor.selection.getNode();\n if (isImageFigure(selectedElm)) {\n return Optional.from(editor.dom.select('a[href]', selectedElm)[0]);\n }\n else {\n return Optional.from(editor.dom.getParent(selectedElm, 'a[href]'));\n }\n };\n var isInAnchor = function (editor, selectedElm) { return getAnchorElement(editor, selectedElm).isSome(); };\n var getAnchorText = function (selection, anchorElm) {\n var text = anchorElm.fold(function () { return selection.getContent({ format: 'text' }); }, function (anchorElm) { return anchorElm.innerText || anchorElm.textContent || ''; });\n return trimCaretContainers(text);\n };\n var getLinksInSelection = function (rng) { return collectNodesInRange(rng, isLink); };\n var getLinks$1 = function (elements) { return global$4.grep(elements, isLink); };\n var hasLinks = function (elements) { return getLinks$1(elements).length > 0; };\n var hasLinksInSelection = function (rng) { return getLinksInSelection(rng).length > 0; };\n var isOnlyTextSelected = function (editor) {\n var inlineTextElements = editor.schema.getTextInlineElements();\n var isElement = function (elm) { return elm.nodeType === 1 && !isAnchor(elm) && !has(inlineTextElements, elm.nodeName.toLowerCase()); };\n var isInBlockAnchor = getAnchorElement(editor).exists(function (anchor) { return anchor.hasAttribute('data-mce-block'); });\n if (isInBlockAnchor) {\n return false;\n }\n var rng = editor.selection.getRng();\n if (!rng.collapsed) {\n var elements = collectNodesInRange(rng, isElement);\n return elements.length === 0;\n }\n else {\n return true;\n }\n };\n var isImageFigure = function (elm) { return isNonNullable(elm) && elm.nodeName === 'FIGURE' && /\\bimage\\b/i.test(elm.className); };\n var getLinkAttrs = function (data) {\n var attrs = [\n 'title',\n 'rel',\n 'class',\n 'target'\n ];\n return foldl(attrs, function (acc, key) {\n data[key].each(function (value) {\n acc[key] = value.length > 0 ? value : null;\n });\n return acc;\n }, { href: data.href });\n };\n var handleExternalTargets = function (href, assumeExternalTargets) {\n if ((assumeExternalTargets === 'http' || assumeExternalTargets === 'https') && !hasProtocol(href)) {\n return assumeExternalTargets + '://' + href;\n }\n return href;\n };\n var applyLinkOverrides = function (editor, linkAttrs) {\n var newLinkAttrs = __assign({}, linkAttrs);\n if (getRelList(editor).length === 0 && !allowUnsafeLinkTarget(editor)) {\n var newRel = applyRelTargetRules(newLinkAttrs.rel, newLinkAttrs.target === '_blank');\n newLinkAttrs.rel = newRel ? newRel : null;\n }\n if (Optional.from(newLinkAttrs.target).isNone() && getTargetList(editor) === false) {\n newLinkAttrs.target = getDefaultLinkTarget(editor);\n }\n newLinkAttrs.href = handleExternalTargets(newLinkAttrs.href, assumeExternalTargets(editor));\n return newLinkAttrs;\n };\n var updateLink = function (editor, anchorElm, text, linkAttrs) {\n text.each(function (text) {\n if (has(anchorElm, 'innerText')) {\n anchorElm.innerText = text;\n }\n else {\n anchorElm.textContent = text;\n }\n });\n editor.dom.setAttribs(anchorElm, linkAttrs);\n editor.selection.select(anchorElm);\n };\n var createLink = function (editor, selectedElm, text, linkAttrs) {\n var dom = editor.dom;\n if (isImageFigure(selectedElm)) {\n linkImageFigure(dom, selectedElm, linkAttrs);\n }\n else {\n text.fold(function () {\n editor.execCommand('mceInsertLink', false, linkAttrs);\n }, function (text) {\n editor.insertContent(dom.createHTML('a', linkAttrs, dom.encode(text)));\n });\n }\n };\n var linkDomMutation = function (editor, attachState, data) {\n var selectedElm = editor.selection.getNode();\n var anchorElm = getAnchorElement(editor, selectedElm);\n var linkAttrs = applyLinkOverrides(editor, getLinkAttrs(data));\n editor.undoManager.transact(function () {\n if (data.href === attachState.href) {\n attachState.attach();\n }\n anchorElm.fold(function () {\n createLink(editor, selectedElm, data.text, linkAttrs);\n }, function (elm) {\n editor.focus();\n updateLink(editor, elm, data.text, linkAttrs);\n });\n });\n };\n var unlinkSelection = function (editor) {\n var dom = editor.dom, selection = editor.selection;\n var bookmark = selection.getBookmark();\n var rng = selection.getRng().cloneRange();\n var startAnchorElm = dom.getParent(rng.startContainer, 'a[href]', editor.getBody());\n var endAnchorElm = dom.getParent(rng.endContainer, 'a[href]', editor.getBody());\n if (startAnchorElm) {\n rng.setStartBefore(startAnchorElm);\n }\n if (endAnchorElm) {\n rng.setEndAfter(endAnchorElm);\n }\n selection.setRng(rng);\n editor.execCommand('unlink');\n selection.moveToBookmark(bookmark);\n };\n var unlinkDomMutation = function (editor) {\n editor.undoManager.transact(function () {\n var node = editor.selection.getNode();\n if (isImageFigure(node)) {\n unlinkImageFigure(editor, node);\n }\n else {\n unlinkSelection(editor);\n }\n editor.focus();\n });\n };\n var unwrapOptions = function (data) {\n var cls = data.class, href = data.href, rel = data.rel, target = data.target, text = data.text, title = data.title;\n return filter({\n class: cls.getOrNull(),\n href: href,\n rel: rel.getOrNull(),\n target: target.getOrNull(),\n text: text.getOrNull(),\n title: title.getOrNull()\n }, function (v, _k) { return isNull(v) === false; });\n };\n var sanitizeData = function (editor, data) {\n var getOption = editor.options.get;\n var uriOptions = {\n allow_html_data_urls: getOption('allow_html_data_urls'),\n allow_script_urls: getOption('allow_script_urls'),\n allow_svg_data_urls: getOption('allow_svg_data_urls')\n };\n var href = data.href;\n return __assign(__assign({}, data), { href: global$2.isDomSafe(href, 'a', uriOptions) ? href : '' });\n };\n var link = function (editor, attachState, data) {\n var sanitizedData = sanitizeData(editor, data);\n editor.hasPlugin('rtc', true) ? editor.execCommand('createlink', false, unwrapOptions(sanitizedData)) : linkDomMutation(editor, attachState, sanitizedData);\n };\n var unlink = function (editor) {\n editor.hasPlugin('rtc', true) ? editor.execCommand('unlink') : unlinkDomMutation(editor);\n };\n var unlinkImageFigure = function (editor, fig) {\n var _a;\n var img = editor.dom.select('img', fig)[0];\n if (img) {\n var a = editor.dom.getParents(img, 'a[href]', fig)[0];\n if (a) {\n (_a = a.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(img, a);\n editor.dom.remove(a);\n }\n }\n };\n var linkImageFigure = function (dom, fig, attrs) {\n var _a;\n var img = dom.select('img', fig)[0];\n if (img) {\n var a = dom.create('a', attrs);\n (_a = img.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(a, img);\n a.appendChild(img);\n }\n };\n var isListGroup = function (item) { return hasNonNullableKey(item, 'items'); };\n var findTextByValue = function (value, catalog) { return findMap(catalog, function (item) {\n if (isListGroup(item)) {\n return findTextByValue(value, item.items);\n }\n else {\n return someIf(item.value === value, item);\n }\n }); };\n var getDelta = function (persistentText, fieldName, catalog, data) {\n var value = data[fieldName];\n var hasPersistentText = persistentText.length > 0;\n return value !== undefined ? findTextByValue(value, catalog).map(function (i) { return ({\n url: {\n value: i.value,\n meta: {\n text: hasPersistentText ? persistentText : i.text,\n attach: noop\n }\n },\n text: hasPersistentText ? persistentText : i.text\n }); }) : Optional.none();\n };\n var findCatalog = function (catalogs, fieldName) {\n if (fieldName === 'link') {\n return catalogs.link;\n }\n else if (fieldName === 'anchor') {\n return catalogs.anchor;\n }\n else {\n return Optional.none();\n }\n };\n var init = function (initialData, linkCatalog) {\n var persistentData = {\n text: initialData.text,\n title: initialData.title\n };\n var getTitleFromUrlChange = function (url) {\n var _a;\n return someIf(persistentData.title.length <= 0, Optional.from((_a = url.meta) === null || _a === void 0 ? void 0 : _a.title).getOr(''));\n };\n var getTextFromUrlChange = function (url) {\n var _a;\n return someIf(persistentData.text.length <= 0, Optional.from((_a = url.meta) === null || _a === void 0 ? void 0 : _a.text).getOr(url.value));\n };\n var onUrlChange = function (data) {\n var text = getTextFromUrlChange(data.url);\n var title = getTitleFromUrlChange(data.url);\n if (text.isSome() || title.isSome()) {\n return Optional.some(__assign(__assign({}, text.map(function (text) { return ({ text: text }); }).getOr({})), title.map(function (title) { return ({ title: title }); }).getOr({})));\n }\n else {\n return Optional.none();\n }\n };\n var onCatalogChange = function (data, change) {\n var catalog = findCatalog(linkCatalog, change).getOr([]);\n return getDelta(persistentData.text, change, catalog, data);\n };\n var onChange = function (getData, change) {\n var name = change.name;\n if (name === 'url') {\n return onUrlChange(getData());\n }\n else if (contains([\n 'anchor',\n 'link'\n ], name)) {\n return onCatalogChange(getData(), name);\n }\n else if (name === 'text' || name === 'title') {\n persistentData[name] = getData()[name];\n return Optional.none();\n }\n else {\n return Optional.none();\n }\n };\n return { onChange: onChange };\n };\n var DialogChanges = {\n init: init,\n getDelta: getDelta\n };\n var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay');\n var delayedConfirm = function (editor, message, callback) {\n var rng = editor.selection.getRng();\n global$1.setEditorTimeout(editor, function () {\n editor.windowManager.confirm(message, function (state) {\n editor.selection.setRng(rng);\n callback(state);\n });\n });\n };\n var tryEmailTransform = function (data) {\n var url = data.href;\n var suggestMailTo = url.indexOf('@') > 0 && url.indexOf('/') === -1 && url.indexOf('mailto:') === -1;\n return suggestMailTo ? Optional.some({\n message: 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?',\n preprocess: function (oldData) { return (__assign(__assign({}, oldData), { href: 'mailto:' + url })); }\n }) : Optional.none();\n };\n var tryProtocolTransform = function (assumeExternalTargets, defaultLinkProtocol) { return function (data) {\n var url = data.href;\n var suggestProtocol = assumeExternalTargets === 1 && !hasProtocol(url) || assumeExternalTargets === 0 && /^\\s*www(\\.|\\d\\.)/i.test(url);\n return suggestProtocol ? Optional.some({\n message: \"The URL you entered seems to be an external link. Do you want to add the required \".concat(defaultLinkProtocol, \":// prefix?\"),\n preprocess: function (oldData) { return (__assign(__assign({}, oldData), { href: defaultLinkProtocol + '://' + url })); }\n }) : Optional.none();\n }; };\n var preprocess = function (editor, data) { return findMap([\n tryEmailTransform,\n tryProtocolTransform(assumeExternalTargets(editor), getDefaultLinkProtocol(editor))\n ], function (f) { return f(data); }).fold(function () { return Promise.resolve(data); }, function (transform) { return new Promise(function (callback) {\n delayedConfirm(editor, transform.message, function (state) {\n callback(state ? transform.preprocess(data) : data);\n });\n }); }); };\n var DialogConfirms = { preprocess: preprocess };\n var getAnchors = function (editor) {\n var anchorNodes = editor.dom.select('a:not([href])');\n var anchors = bind(anchorNodes, function (anchor) {\n var id = anchor.name || anchor.id;\n return id ? [{\n text: id,\n value: '#' + id\n }] : [];\n });\n return anchors.length > 0 ? Optional.some([{\n text: 'None',\n value: ''\n }].concat(anchors)) : Optional.none();\n };\n var AnchorListOptions = { getAnchors: getAnchors };\n var getClasses = function (editor) {\n var list = getLinkClassList(editor);\n if (list.length > 0) {\n return ListOptions.sanitize(list);\n }\n return Optional.none();\n };\n var ClassListOptions = { getClasses: getClasses };\n var parseJson = function (text) {\n try {\n return Optional.some(JSON.parse(text));\n }\n catch (err) {\n return Optional.none();\n }\n };\n var getLinks = function (editor) {\n var extractor = function (item) { return editor.convertURL(item.value || item.url || '', 'href'); };\n var linkList = getLinkList(editor);\n return new Promise(function (resolve) {\n if (isString(linkList)) {\n fetch(linkList).then(function (res) { return res.ok ? res.text().then(parseJson) : Promise.reject(); }).then(resolve, function () { return resolve(Optional.none()); });\n }\n else if (isFunction(linkList)) {\n linkList(function (output) { return resolve(Optional.some(output)); });\n }\n else {\n resolve(Optional.from(linkList));\n }\n }).then(function (optItems) { return optItems.bind(ListOptions.sanitizeWith(extractor)).map(function (items) {\n if (items.length > 0) {\n var noneItem = [{\n text: 'None',\n value: ''\n }];\n return noneItem.concat(items);\n }\n else {\n return items;\n }\n }); });\n };\n var LinkListOptions = { getLinks: getLinks };\n var getRels = function (editor, initialTarget) {\n var list = getRelList(editor);\n if (list.length > 0) {\n var isTargetBlank_1 = is(initialTarget, '_blank');\n var enforceSafe = allowUnsafeLinkTarget(editor) === false;\n var safeRelExtractor = function (item) { return applyRelTargetRules(ListOptions.getValue(item), isTargetBlank_1); };\n var sanitizer = enforceSafe ? ListOptions.sanitizeWith(safeRelExtractor) : ListOptions.sanitize;\n return sanitizer(list);\n }\n return Optional.none();\n };\n var RelOptions = { getRels: getRels };\n var fallbacks = [\n {\n text: 'Current window',\n value: ''\n },\n {\n text: 'New window',\n value: '_blank'\n }\n ];\n var getTargets = function (editor) {\n var list = getTargetList(editor);\n if (isArray(list)) {\n return ListOptions.sanitize(list).orThunk(function () { return Optional.some(fallbacks); });\n }\n else if (list === false) {\n return Optional.none();\n }\n return Optional.some(fallbacks);\n };\n var TargetOptions = { getTargets: getTargets };\n var nonEmptyAttr = function (dom, elem, name) {\n var val = dom.getAttrib(elem, name);\n return val !== null && val.length > 0 ? Optional.some(val) : Optional.none();\n };\n var extractFromAnchor = function (editor, anchor) {\n var dom = editor.dom;\n var onlyText = isOnlyTextSelected(editor);\n var text = onlyText ? Optional.some(getAnchorText(editor.selection, anchor)) : Optional.none();\n var url = anchor.bind(function (anchorElm) { return Optional.from(dom.getAttrib(anchorElm, 'href')); });\n var target = anchor.bind(function (anchorElm) { return Optional.from(dom.getAttrib(anchorElm, 'target')); });\n var rel = anchor.bind(function (anchorElm) { return nonEmptyAttr(dom, anchorElm, 'rel'); });\n var linkClass = anchor.bind(function (anchorElm) { return nonEmptyAttr(dom, anchorElm, 'class'); });\n var title = anchor.bind(function (anchorElm) { return nonEmptyAttr(dom, anchorElm, 'title'); });\n return {\n url: url,\n text: text,\n title: title,\n target: target,\n rel: rel,\n linkClass: linkClass\n };\n };\n var collect = function (editor, linkNode) { return LinkListOptions.getLinks(editor).then(function (links) {\n var anchor = extractFromAnchor(editor, linkNode);\n return {\n anchor: anchor,\n catalogs: {\n targets: TargetOptions.getTargets(editor),\n rels: RelOptions.getRels(editor, anchor.target),\n classes: ClassListOptions.getClasses(editor),\n anchor: AnchorListOptions.getAnchors(editor),\n link: links\n },\n optNode: linkNode,\n flags: { titleEnabled: shouldShowLinkTitle(editor) }\n };\n }); };\n var DialogInfo = { collect: collect };\n var handleSubmit = function (editor, info) { return function (api) {\n var data = api.getData();\n if (!data.url.value) {\n unlink(editor);\n api.close();\n return;\n }\n var getChangedValue = function (key) { return Optional.from(data[key]).filter(function (value) { return !is(info.anchor[key], value); }); };\n var changedData = {\n href: data.url.value,\n text: getChangedValue('text'),\n target: getChangedValue('target'),\n rel: getChangedValue('rel'),\n class: getChangedValue('linkClass'),\n title: getChangedValue('title')\n };\n var attachState = {\n href: data.url.value,\n attach: data.url.meta !== undefined && data.url.meta.attach ? data.url.meta.attach : noop\n };\n DialogConfirms.preprocess(editor, changedData).then(function (pData) {\n link(editor, attachState, pData);\n });\n api.close();\n }; };\n var collectData = function (editor) {\n var anchorNode = getAnchorElement(editor);\n return DialogInfo.collect(editor, anchorNode);\n };\n var getInitialData = function (info, defaultTarget) {\n var anchor = info.anchor;\n var url = anchor.url.getOr('');\n return {\n url: {\n value: url,\n meta: { original: { value: url } }\n },\n text: anchor.text.getOr(''),\n title: anchor.title.getOr(''),\n anchor: url,\n link: url,\n rel: anchor.rel.getOr(''),\n target: anchor.target.or(defaultTarget).getOr(''),\n linkClass: anchor.linkClass.getOr('')\n };\n };\n var makeDialog = function (settings, onSubmit, editor) {\n var urlInput = [{\n name: 'url',\n type: 'urlinput',\n filetype: 'file',\n label: 'URL',\n picker_text: 'Browse links'\n }];\n var displayText = settings.anchor.text.map(function () { return ({\n name: 'text',\n type: 'input',\n label: 'Text to display'\n }); }).toArray();\n var titleText = settings.flags.titleEnabled ? [{\n name: 'title',\n type: 'input',\n label: 'Title'\n }] : [];\n var defaultTarget = Optional.from(getDefaultLinkTarget(editor));\n var initialData = getInitialData(settings, defaultTarget);\n var catalogs = settings.catalogs;\n var dialogDelta = DialogChanges.init(initialData, catalogs);\n var body = {\n type: 'panel',\n items: flatten([\n urlInput,\n displayText,\n titleText,\n cat([\n catalogs.anchor.map(ListOptions.createUi('anchor', 'Anchors')),\n catalogs.rels.map(ListOptions.createUi('rel', 'Rel')),\n catalogs.targets.map(ListOptions.createUi('target', 'Open link in...')),\n catalogs.link.map(ListOptions.createUi('link', 'Link list')),\n catalogs.classes.map(ListOptions.createUi('linkClass', 'Class'))\n ])\n ])\n };\n return {\n title: 'Insert/Edit Link',\n size: 'normal',\n body: body,\n buttons: [\n {\n type: 'cancel',\n name: 'cancel',\n text: 'Cancel'\n },\n {\n type: 'submit',\n name: 'save',\n text: 'Save',\n primary: true\n }\n ],\n initialData: initialData,\n onChange: function (api, _c) {\n var name = _c.name;\n dialogDelta.onChange(api.getData, { name: name }).each(function (newData) {\n api.setData(newData);\n });\n },\n onSubmit: onSubmit\n };\n };\n var open$1 = function (editor) {\n var data = collectData(editor);\n data.then(function (info) {\n var onSubmit = handleSubmit(editor, info);\n return makeDialog(info, onSubmit, editor);\n }).then(function (spec) {\n editor.windowManager.open(spec);\n });\n };\n var register = function (editor) {\n editor.addCommand('mceLink', function (_ui, value) {\n if ((value === null || value === void 0 ? void 0 : value.dialog) === true || !useQuickLink(editor)) {\n open$1(editor);\n }\n else {\n editor.dispatch('contexttoolbar-show', { toolbarKey: 'quicklink' });\n }\n });\n };\n var global = tinymce.util.Tools.resolve('tinymce.util.VK');\n var appendClickRemove = function (link, evt) {\n document.body.appendChild(link);\n link.dispatchEvent(evt);\n document.body.removeChild(link);\n };\n var open = function (url) {\n var link = document.createElement('a');\n link.target = '_blank';\n link.href = url;\n link.rel = 'noreferrer noopener';\n var evt = document.createEvent('MouseEvents');\n evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n appendClickRemove(link, evt);\n };\n var getLink = function (editor, elm) { return editor.dom.getParent(elm, 'a[href]'); };\n var getSelectedLink = function (editor) { return getLink(editor, editor.selection.getStart()); };\n var hasOnlyAltModifier = function (e) {\n return e.altKey === true && e.shiftKey === false && e.ctrlKey === false && e.metaKey === false;\n };\n var gotoLink = function (editor, a) {\n if (a) {\n var href = getHref(a);\n if (/^#/.test(href)) {\n var targetEl = editor.dom.select(href);\n if (targetEl.length) {\n editor.selection.scrollIntoView(targetEl[0], true);\n }\n }\n else {\n open(a.href);\n }\n }\n };\n var openDialog = function (editor) { return function () {\n editor.execCommand('mceLink', false, { dialog: true });\n }; };\n var gotoSelectedLink = function (editor) { return function () {\n gotoLink(editor, getSelectedLink(editor));\n }; };\n var setupGotoLinks = function (editor) {\n editor.on('click', function (e) {\n var link = getLink(editor, e.target);\n if (link && global.metaKeyPressed(e)) {\n e.preventDefault();\n gotoLink(editor, link);\n }\n });\n editor.on('keydown', function (e) {\n if (!e.isDefaultPrevented() && e.keyCode === 13 && hasOnlyAltModifier(e)) {\n var link_1 = getSelectedLink(editor);\n if (link_1) {\n e.preventDefault();\n gotoLink(editor, link_1);\n }\n }\n });\n };\n var toggleState = function (editor, toggler) {\n editor.on('NodeChange', toggler);\n return function () { return editor.off('NodeChange', toggler); };\n };\n var toggleLinkState = function (editor) { return function (api) {\n var updateState = function () {\n api.setActive(!editor.mode.isReadOnly() && isInAnchor(editor, editor.selection.getNode()));\n api.setEnabled(editor.selection.isEditable());\n };\n updateState();\n return toggleState(editor, updateState);\n }; };\n var toggleLinkMenuState = function (editor) { return function (api) {\n var updateState = function () {\n api.setEnabled(editor.selection.isEditable());\n };\n updateState();\n return toggleState(editor, updateState);\n }; };\n var hasExactlyOneLinkInSelection = function (editor) {\n var links = editor.selection.isCollapsed() ? getLinks$1(editor.dom.getParents(editor.selection.getStart())) : getLinksInSelection(editor.selection.getRng());\n return links.length === 1;\n };\n var toggleGotoLinkState = function (editor) { return function (api) {\n var updateState = function () { return api.setEnabled(hasExactlyOneLinkInSelection(editor)); };\n updateState();\n return toggleState(editor, updateState);\n }; };\n var toggleUnlinkState = function (editor) { return function (api) {\n var hasLinks$1 = function (parents) { return hasLinks(parents) || hasLinksInSelection(editor.selection.getRng()); };\n var parents = editor.dom.getParents(editor.selection.getStart());\n var updateEnabled = function (parents) {\n api.setEnabled(hasLinks$1(parents) && editor.selection.isEditable());\n };\n updateEnabled(parents);\n return toggleState(editor, function (e) { return updateEnabled(e.parents); });\n }; };\n var setup = function (editor) {\n editor.addShortcut('Meta+K', '', function () {\n editor.execCommand('mceLink');\n });\n };\n var setupButtons = function (editor) {\n editor.ui.registry.addToggleButton('link', {\n icon: 'link',\n tooltip: 'Insert/edit link',\n onAction: openDialog(editor),\n onSetup: toggleLinkState(editor)\n });\n editor.ui.registry.addButton('openlink', {\n icon: 'new-tab',\n tooltip: 'Open link',\n onAction: gotoSelectedLink(editor),\n onSetup: toggleGotoLinkState(editor)\n });\n editor.ui.registry.addButton('unlink', {\n icon: 'unlink',\n tooltip: 'Remove link',\n onAction: function () { return unlink(editor); },\n onSetup: toggleUnlinkState(editor)\n });\n };\n var setupMenuItems = function (editor) {\n editor.ui.registry.addMenuItem('openlink', {\n text: 'Open link',\n icon: 'new-tab',\n onAction: gotoSelectedLink(editor),\n onSetup: toggleGotoLinkState(editor)\n });\n editor.ui.registry.addMenuItem('link', {\n icon: 'link',\n text: 'Link...',\n shortcut: 'Meta+K',\n onSetup: toggleLinkMenuState(editor),\n onAction: openDialog(editor)\n });\n editor.ui.registry.addMenuItem('unlink', {\n icon: 'unlink',\n text: 'Remove link',\n onAction: function () { return unlink(editor); },\n onSetup: toggleUnlinkState(editor)\n });\n };\n var setupContextMenu = function (editor) {\n var inLink = 'link unlink openlink';\n var noLink = 'link';\n editor.ui.registry.addContextMenu('link', {\n update: function (element) {\n var isEditable = editor.dom.isEditable(element);\n if (!isEditable) {\n return '';\n }\n return hasLinks(editor.dom.getParents(element, 'a')) ? inLink : noLink;\n }\n });\n };\n var setupContextToolbars = function (editor) {\n var collapseSelectionToEnd = function (editor) {\n editor.selection.collapse(false);\n };\n var onSetupLink = function (buttonApi) {\n var node = editor.selection.getNode();\n buttonApi.setEnabled(isInAnchor(editor, node));\n return noop;\n };\n var getLinkText = function (value) {\n var anchor = getAnchorElement(editor);\n var onlyText = isOnlyTextSelected(editor);\n if (anchor.isNone() && onlyText) {\n var text = getAnchorText(editor.selection, anchor);\n return someIf(text.length === 0, value);\n }\n else {\n return Optional.none();\n }\n };\n editor.ui.registry.addContextForm('quicklink', {\n launch: {\n type: 'contextformtogglebutton',\n icon: 'link',\n tooltip: 'Link',\n onSetup: toggleLinkState(editor)\n },\n label: 'Link',\n predicate: function (node) { return hasContextToolbar(editor) && isInAnchor(editor, node); },\n initValue: function () {\n var elm = getAnchorElement(editor);\n return elm.fold(constant(''), getHref);\n },\n commands: [\n {\n type: 'contextformtogglebutton',\n icon: 'link',\n tooltip: 'Link',\n primary: true,\n onSetup: function (buttonApi) {\n var node = editor.selection.getNode();\n buttonApi.setActive(isInAnchor(editor, node));\n return toggleLinkState(editor)(buttonApi);\n },\n onAction: function (formApi) {\n var value = formApi.getValue();\n var text = getLinkText(value);\n var attachState = {\n href: value,\n attach: noop\n };\n link(editor, attachState, {\n href: value,\n text: text,\n title: Optional.none(),\n rel: Optional.none(),\n target: Optional.none(),\n class: Optional.none()\n });\n collapseSelectionToEnd(editor);\n formApi.hide();\n }\n },\n {\n type: 'contextformbutton',\n icon: 'unlink',\n tooltip: 'Remove link',\n onSetup: onSetupLink,\n onAction: function (formApi) {\n unlink(editor);\n formApi.hide();\n }\n },\n {\n type: 'contextformbutton',\n icon: 'new-tab',\n tooltip: 'Open link',\n onSetup: onSetupLink,\n onAction: function (formApi) {\n gotoSelectedLink(editor)();\n formApi.hide();\n }\n }\n ]\n });\n };\n var Plugin = function () {\n global$5.add('link', function (editor) {\n register$1(editor);\n setupButtons(editor);\n setupMenuItems(editor);\n setupContextMenu(editor);\n setupContextToolbars(editor);\n setupGotoLinks(editor);\n register(editor);\n setup(editor);\n });\n };\n Plugin();\n})();\n"],"names":["__assign","this","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","global$5","tinymce","util","Tools","resolve","isType","type","value","x","Array","isArray","o","v","constructor","String","isPrototypeOf","_a","name","isSimpleType","isString","isObject","isNull","a","isBoolean","isNonNullable","isNullable","isFunction","isArrayOf","pred","len","noop","tripleEquals","b","Optional","tag","some","none","singletonNone","fold","onNone","onSome","isSome","isNone","map","mapper","bind","binder","exists","predicate","forall","filter","getOr","replacement","or","getOrThunk","thunk","orThunk","getOrDie","message","Error","from","getOrNull","getOrUndefined","each","worker","toArray","toString","concat","nativeIndexOf","indexOf","nativePush","push","contains","xs","ts","rawIndexOf","flatten","r","f","findMap","arr","is","lhs","rhs","comparator","left","cat","someIf","option","editor","options","get","assumeExternalTargets","hasContextToolbar","getLinkList","getDefaultLinkTarget","getDefaultLinkProtocol","getTargetList","getRelList","getLinkClassList","shouldShowLinkTitle","allowUnsafeLinkTarget","useQuickLink","global$4","getValue","item","sanitizeList","list","extractValue","out","text","title","getText","undefined","menu","items","sanitizeWith","extracter","ListOptions","sanitize","createUi","label","keys","internalFilter","obj","onTrue","onFalse","props","k","has","key","global$3","global$2","isAnchor","elm","nodeName","toLowerCase","isLink","getHref","collectNodesInRange","rng","collapsed","contents","cloneContents","firstChild","walker","elements","current","next","hasProtocol","url","test","_b","getAttribute","applyRelTargetRules","rel","isUnsafe","rules","rels","split","removeTargetRules","val","inArray","newRels","addTargetRules","trim","sort","join","getAnchorElement","selectedElm","getLinksInSelection","selection","getRng","getNode","isImageFigure","dom","select","getParent","isInAnchor","getAnchorText","anchorElm","replace","trimCaretContainers","getContent","format","innerText","textContent","getLinks$1","grep","hasLinks","isOnlyTextSelected","inlineTextElements","schema","getTextInlineElements","anchor","hasAttribute","nodeType","className","applyLinkOverrides","linkAttrs","newLinkAttrs","newRel","target","href","handleExternalTargets","linkDomMutation","attachState","data","acc","each$1","getLinkAttrs","undoManager","transact","attach","linkImageFigure","execCommand","insertContent","createHTML","encode","createLink","focus","setAttribs","updateLink","unwrapOptions","cls","class","_k","link","sanitizedData","getOption","uriOptions","allow_html_data_urls","allow_script_urls","allow_svg_data_urls","isDomSafe","sanitizeData","hasPlugin","unlink","node","unlinkImageFigure","bookmark","getBookmark","cloneRange","startAnchorElm","startContainer","getBody","endAnchorElm","endContainer","setStartBefore","setEndAfter","setRng","moveToBookmark","unlinkSelection","unlinkDomMutation","fig","img","getParents","parentNode","insertBefore","remove","attrs","create","appendChild","isListGroup","findTextByValue","catalog","getDelta","persistentText","fieldName","hasPersistentText","meta","DialogChanges","initialData","linkCatalog","persistentData","onUrlChange","getTitleFromUrlChange","onCatalogChange","change","catalogs","onChange","getData","global$1","tryEmailTransform","preprocess","oldData","tryProtocolTransform","defaultLinkProtocol","DialogConfirms","Promise","transform","callback","setEditorTimeout","windowManager","confirm","state","delayedConfirm","AnchorListOptions","anchorNodes","anchors","id","ClassListOptions","parseJson","JSON","parse","err","LinkListOptions","extractor","convertURL","linkList","fetch","then","res","ok","reject","output","optItems","RelOptions","initialTarget","isTargetBlank_1","fallbacks","TargetOptions","nonEmptyAttr","elem","getAttrib","DialogInfo","linkNode","links","linkClass","extractFromAnchor","targets","classes","optNode","flags","titleEnabled","open$1","anchorNode","collectData","info","onSubmit","api","close","getChangedValue","changedData","pData","handleSubmit","settings","displayText","titleText","defaultTarget","original","getInitialData","dialogDelta","size","body","filetype","picker_text","buttons","primary","_c","newData","setData","makeDialog","spec","open","global","document","createElement","evt","createEvent","initMouseEvent","window","dispatchEvent","removeChild","appendClickRemove","getLink","getSelectedLink","getStart","gotoLink","targetEl","scrollIntoView","openDialog","dialog","gotoSelectedLink","toggleState","toggler","on","off","toggleLinkState","updateState","setActive","mode","isReadOnly","setEnabled","isEditable","toggleLinkMenuState","toggleGotoLinkState","isCollapsed","hasExactlyOneLinkInSelection","toggleUnlinkState","hasLinks$1","parents","updateEnabled","e","setupContextToolbars","onSetupLink","buttonApi","ui","registry","addContextForm","launch","icon","tooltip","onSetup","initValue","commands","onAction","formApi","onlyText","getLinkText","collapse","collapseSelectionToEnd","hide","add","registerOption","register","processor","valid","default","register$1","addToggleButton","addButton","setupButtons","addMenuItem","shortcut","setupMenuItems","addContextMenu","update","element","setupContextMenu","metaKeyPressed","preventDefault","isDefaultPrevented","keyCode","altKey","shiftKey","ctrlKey","metaKey","hasOnlyAltModifier","link_1","setupGotoLinks","addCommand","_ui","dispatch","toolbarKey","addShortcut","setup"],"mappings":"iGAIA,IAAIA,EAAYC,GAAQA,EAAKD,UAAa,WAStC,OARAA,EAAWE,OAAOC,QAAU,SAASC,GACjC,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAII,KADTL,EAAIG,UAAUF,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MuX,SAAqBxR,EAAab,GAIvFA,EAAO4W,SAAS,sBAAuB,CAAEC,WAAY,cAHrDvH,GAAOtP,EAKvB,IA0PYgV,CAAShV,GAzJL,SAAUA,GAClBA,EAAO8W,YAAY,SAAU,IAAI,WAC7B9W,EAAO8H,YAAY,UAC/B,IAuJYiP,CAAM/W,EAClB,GAGC,CA9sCD"}
@@ -1,2 +1,2 @@
1
- import{__exports as r}from"../../../../_virtual/index10.mjs";import{__require as e}from"./plugin.mjs";var i;function o(){return i||(i=1,e()),r}export{o as __require};
1
+ import{__exports as r}from"../../../../_virtual/index6.mjs";import{__require as e}from"./plugin.mjs";var i;function o(){return i||(i=1,e()),r}export{o as __require};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../public/tinymce/plugins/table/index.js"],"sourcesContent":["\"use strict\";\n// Exports the \"table\" plugin for usage with module loaders\n// Usage:\n// CommonJS:\n// require('tinymce/plugins/table')\n// ES2015:\n// import 'tinymce/plugins/table'\nrequire('./plugin.js');\n"],"names":["require$$0"],"mappings":"wIAOsBA"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../public/tinymce/plugins/table/index.js"],"sourcesContent":["\"use strict\";\n// Exports the \"table\" plugin for usage with module loaders\n// Usage:\n// CommonJS:\n// require('tinymce/plugins/table')\n// ES2015:\n// import 'tinymce/plugins/table'\nrequire('./plugin.js');\n"],"names":["require$$0"],"mappings":"uIAOsBA"}
@@ -1,2 +1,2 @@
1
- import{__exports as e}from"../../../../_virtual/plugin5.mjs";var t;function n(){if(t)return e;t=1;var n=e&&e.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},o=e&&e.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var o,r=0,l=t.length;r<l;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};return function(){var e,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(e){return function(t){return u=typeof(n=t),(null===n?"null":"object"===u&&Array.isArray(n)?"array":"object"===u&&(a=o=n,(r=String).prototype.isPrototypeOf(a)||(null===(l=o.constructor)||void 0===l?void 0:l.name)===r.name)?"string":u)===e;var n,o,r,l,u,a}},l=function(e){return function(t){return typeof t===e}},u=r("string"),a=r("array"),i=l("boolean"),c=(e=void 0,function(t){return e===t}),s=function(e){return!function(e){return null==e}(e)},f=l("function"),m=l("number"),d=function(){},p=function(e){return function(){return e}},b=function(e){return e},g=function(e,t){return e===t};function h(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var r=t.concat(n);return e.apply(null,r)}}var v=function(e){e()},y=p(!1),w=p(!0),S=function(){function e(e,t){this.tag=e,this.value=t}return e.some=function(t){return new e(!0,t)},e.none=function(){return e.singletonNone},e.prototype.fold=function(e,t){return this.tag?t(this.value):e()},e.prototype.isSome=function(){return this.tag},e.prototype.isNone=function(){return!this.tag},e.prototype.map=function(t){return this.tag?e.some(t(this.value)):e.none()},e.prototype.bind=function(t){return this.tag?t(this.value):e.none()},e.prototype.exists=function(e){return this.tag&&e(this.value)},e.prototype.forall=function(e){return!this.tag||e(this.value)},e.prototype.filter=function(t){return!this.tag||t(this.value)?this:e.none()},e.prototype.getOr=function(e){return this.tag?this.value:e},e.prototype.or=function(e){return this.tag?this:e},e.prototype.getOrThunk=function(e){return this.tag?this.value:e()},e.prototype.orThunk=function(e){return this.tag?this:e()},e.prototype.getOrDie=function(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")},e.from=function(t){return s(t)?e.some(t):e.none()},e.prototype.getOrNull=function(){return this.tag?this.value:null},e.prototype.getOrUndefined=function(){return this.value},e.prototype.each=function(e){this.tag&&e(this.value)},e.prototype.toArray=function(){return this.tag?[this.value]:[]},e.prototype.toString=function(){return this.tag?"some(".concat(this.value,")"):"none()"},e}();S.singletonNone=new S(!1);var C=Object.keys,T=Object.hasOwnProperty,x=function(e,t){for(var n=C(e),o=0,r=n.length;o<r;o++){var l=n[o];t(e[l],l)}},A=function(e,t){var n,o={};return function(e,t,n,o){x(e,(function(e,r){(t(e,r)?n:o)(e,r)}))}(e,t,(n=o,function(e,t){n[t]=e}),d),o},R=function(e){return function(e,t){var n=[];return x(e,(function(e,o){n.push(t(e,o))})),n}(e,b)},_=function(e){return C(e).length},O=function(e,t){return D(e,t)?S.from(e[t]):S.none()},D=function(e,t){return T.call(e,t)},N=function(e,t){return D(e,t)&&void 0!==e[t]&&null!==e[t]},I=Array.prototype.indexOf,M=Array.prototype.push,P=function(e,t){return function(e,t){return I.call(e,t)}(e,t)>-1},k=function(e,t){for(var n=0,o=e.length;n<o;n++){if(t(e[n],n))return!0}return!1},E=function(e,t){for(var n=[],o=0;o<e;o++)n.push(t(o));return n},B=function(e,t){for(var n=e.length,o=new Array(n),r=0;r<n;r++){var l=e[r];o[r]=t(l,r)}return o},F=function(e,t){for(var n=0,o=e.length;n<o;n++){t(e[n],n)}},q=function(e,t){for(var n=[],o=0,r=e.length;o<r;o++){var l=e[o];t(l,o)&&n.push(l)}return n},j=function(e,t,n){return F(e,(function(e,o){n=t(n,e,o)})),n},L=function(e,t){return function(e,t,n){for(var o=0,r=e.length;o<r;o++){var l=e[o];if(t(l,o))return S.some(l);if(n(l,o))break}return S.none()}(e,t,y)},H=function(e,t){return function(e){for(var t=[],n=0,o=e.length;n<o;++n){if(!a(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);M.apply(t,e[n])}return t}(B(e,t))},V=function(e,t){for(var n=0,o=e.length;n<o;++n){if(!0!==t(e[n],n))return!1}return!0},W=function(e,t){return t>=0&&t<e.length?S.some(e[t]):S.none()},z=function(e,t){for(var n=0;n<e.length;n++){var o=t(e[n],n);if(o.isSome())return o}return S.none()},$=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},U={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1){var o="HTML does not have a single root node";throw console.error(o,e),new Error(o)}return $(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return $(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return $(n)},fromDom:$,fromPoint:function(e,t,n){return S.from(e.dom.elementFromPoint(t,n)).map($)}},G=function(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var o=n;if(void 0!==o.matches)return o.matches(t);if(void 0!==o.msMatchesSelector)return o.msMatchesSelector(t);if(void 0!==o.webkitMatchesSelector)return o.webkitMatchesSelector(t);if(void 0!==o.mozMatchesSelector)return o.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},K=function(e){return 1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount},J=function(e,t){return e.dom===t.dom},Q=G;"undefined"!=typeof window?window:Function("return this;")();var X,Y=function(e){return e.dom.nodeName.toLowerCase()},Z=function(e){return e.dom.nodeType},ee=function(e){return function(t){return Z(t)===e}},te=function(e){return 8===Z(e)||"#comment"===Y(e)},ne=ee(1),oe=ee(3),re=ee(9),le=ee(11),ue=function(e){return function(t){return ne(t)&&Y(t)===e}},ae=function(e){return re(e)?e:(t=e,U.fromDom(t.dom.ownerDocument));var t},ie=function(e){return S.from(e.dom.parentNode).map(U.fromDom)},ce=function(e,t){for(var n=f(t)?t:y,o=e.dom,r=[];null!==o.parentNode&&void 0!==o.parentNode;){var l=o.parentNode,u=U.fromDom(l);if(r.push(u),!0===n(u))break;o=l}return r},se=function(e){return S.from(e.dom.previousSibling).map(U.fromDom)},fe=function(e){return S.from(e.dom.nextSibling).map(U.fromDom)},me=function(e){return B(e.dom.childNodes,U.fromDom)},de=function(e){return function(e,t){var n=e.dom.childNodes;return S.from(n[t]).map(U.fromDom)}(e,0)},pe=f(Element.prototype.attachShadow)&&f(Node.prototype.getRootNode),be=pe?function(e){return U.fromDom(e.dom.getRootNode())}:ae,ge=function(e){var t,n=be(e);return le(t=n)&&s(t.dom.host)?S.some(n):S.none()},he=function(e){return U.fromDom(e.dom.host)},ve=function(e){var t=oe(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;var n,o,r=t.ownerDocument;return ge(U.fromDom(t)).fold((function(){return r.body.contains(t)}),(n=ve,o=he,function(e){return n(o(e))}))},ye=function(e,t,n,o,r){return e(n,o)?S.some(n):f(r)&&r(n)?S.none():t(n,o,r)},we=function(e,t,n){for(var o=e.dom,r=f(n)?n:y;o.parentNode;){o=o.parentNode;var l=U.fromDom(o);if(t(l))return S.some(l);if(r(l))break}return S.none()},Se=function(e,t,n){return we(e,(function(e){return G(e,t)}),n)},Ce=function(e,t){return function(e,t){return L(e.dom.childNodes,(function(e){return t(U.fromDom(e))})).map(U.fromDom)}(e,(function(e){return G(e,t)}))},Te=function(e,t){return function(e,t){var n=void 0===t?document:t.dom;return K(n)?S.none():S.from(n.querySelector(e)).map(U.fromDom)}(t,e)},xe=function(e,t,n){return ye((function(e,t){return G(e,t)}),Se,e,t,n)},Ae=function(e,t){return void 0===t&&(t=!1),ve(e)?e.dom.isContentEditable:(n=e,xe(n,"[contenteditable]")).fold(p(t),(function(e){return"true"===Re(e)}));var n},Re=function(e){return e.dom.contentEditable},_e=function(e){return function(t){return J(t,function(e){return U.fromDom(e.getBody())}(e))}},Oe=function(e){return/^\d+(\.\d+)?$/.test(e)?e+"px":e},De=function(e){return U.fromDom(e.selection.getStart())},Ne=function(e){return(t=e,n=ue("table"),ye((function(e,t){return t(e)}),we,t,n,o)).forall(Ae);var t,n,o},Ie=function(e,t){var n=[];return F(me(e),(function(e){t(e)&&(n=n.concat([e])),n=n.concat(Ie(e,t))})),n},Me=function(e,t){return function(e,t){return q(me(e),t)}(e,(function(e){return G(e,t)}))},Pe=function(e,t){return function(e,t){var n=void 0===t?document:t.dom;return K(n)?[]:B(n.querySelectorAll(e),U.fromDom)}(t,e)},ke=function(e,t,n){if(!(u(n)||i(n)||m(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+"")},Ee=function(e,t,n){ke(e.dom,t,n)},Be=function(e,t){var n=e.dom.getAttribute(t);return null===n?void 0:n},Fe=function(e,t){return S.from(Be(e,t))},qe=function(e,t){e.dom.removeAttribute(t)},je=function(e,t,n){return void 0===n&&(n=g),e.exists((function(e){return n(e,t)}))},Le=function(e,t,n){return e.isSome()&&t.isSome()?S.some(n(e.getOrDie(),t.getOrDie())):S.none()},He=function(e,t){return function(e,t,n){return""===t||e.length>=t.length&&e.substr(n,n+t.length)===t}(e,t,0)},Ve=(X=/^\s+|\s+$/g,function(e){return e.replace(X,"")}),We=function(e){return e.length>0},ze=function(e,t){void 0===t&&(t=10);var n=parseInt(e,t);return isNaN(n)?S.none():S.some(n)},$e=function(e){return void 0!==e.style&&f(e.style.getPropertyValue)},Ue=function(e,t,n){!function(e,t,n){if(!u(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);$e(e)&&e.style.setProperty(t,n)}(e.dom,t,n)},Ge=function(e,t){var n=e.dom,o=window.getComputedStyle(n).getPropertyValue(t);return""!==o||ve(e)?o:Ke(n,t)},Ke=function(e,t){return $e(e)?e.style.getPropertyValue(t):""},Je=function(e,t){var n=e.dom,o=Ke(n,t);return S.from(o).filter((function(e){return e.length>0}))},Qe=function(e,t){!function(e,t){$e(e)&&e.style.removeProperty(t)}(e.dom,t),je(Fe(e,"style").map(Ve),"")&&qe(e,"style")},Xe=function(e,t,n){return void 0===n&&(n=0),Fe(e,t).map((function(e){return parseInt(e,10)})).getOr(n)},Ye=function(e,t){return Ze(e,t,w)},Ze=function(e,t,n){return H(me(e),(function(e){return G(e,t)?n(e)?[e]:[]:Ze(e,t,n)}))},et=["tfoot","thead","tbody","colgroup"],tt=function(e,t,n){return{element:e,rowspan:t,colspan:n}},nt=function(e,t,n){return{element:e,cells:t,section:n}},ot=function(e,t){return function(e,t,n){return void 0===n&&(n=y),n(t)?S.none():P(e,Y(t))?S.some(t):Se(t,e.join(","),(function(e){return G(e,"table")||n(e)}))}(["td","th"],e,t)},rt=function(e,t){return xe(e,"table",t)},lt=function(e){return Ye(e,"tr")},ut=function(e){return rt(e).fold(p([]),(function(e){return Me(e,"colgroup")}))},at=function(e,t){return B(e,(function(e){if("colgroup"===Y(e)){var n=B(function(e){return G(e,"colgroup")?Me(e,"col"):H(ut(e),(function(e){return Me(e,"col")}))}(e),(function(e){var t=Xe(e,"span",1);return tt(e,1,t)}));return nt(e,n,"colgroup")}var o=B(function(e){return Ye(e,"th,td")}(e),(function(e){var t=Xe(e,"rowspan",1),n=Xe(e,"colspan",1);return tt(e,t,n)}));return nt(e,o,t(e))}))},it=function(e){return ie(e).map((function(e){var t=Y(e);return function(e){return P(et,e)}(t)?t:"tbody"})).getOr("tbody")},ct=function(e){return Fe(e,"data-snooker-locked-cols").bind((function(e){return S.from(e.match(/\d+/g))})).map((function(e){return function(e,t){for(var n={},o=0,r=e.length;o<r;o++){var l=e[o];n[String(l)]=t(l,o)}return n}(e,w)}))},st=function(e,t){return e+","+t},ft=function(e,t){var n=H(e.all,(function(e){return e.cells}));return q(n,t)},mt=function(e){var t,n={},o=[],r=(t=e,W(t,0)).map((function(e){return e.element})).bind(rt).bind(ct).getOr({}),l=0,u=0,a=0,i=function(e,t){for(var n=[],o=[],r=0,l=e.length;r<l;r++){var u=e[r];(t(u,r)?n:o).push(u)}return{pass:n,fail:o}}(e,(function(e){return"colgroup"===e.section})),c=i.pass,s=i.fail;F(s,(function(e){var t=[];F(e.cells,(function(e){for(var o=0;void 0!==n[st(a,o)];)o++;for(var l=N(r,o.toString()),i=function(e,t,n,o,r,l){return{element:e,rowspan:t,colspan:n,row:o,column:r,isLocked:l}}(e.element,e.rowspan,e.colspan,a,o,l),c=0;c<e.colspan;c++)for(var s=0;s<e.rowspan;s++){var f=o+c,m=st(a+s,f);n[m]=i,u=Math.max(u,f+1)}t.push(i)})),l++,o.push(nt(e.element,t,e.section)),a++}));var f=function(e){return W(e,e.length-1)}(c).map((function(e){var t=function(e){var t={},n=0;return F(e.cells,(function(e){var o=e.colspan;E(o,(function(r){var l=n+r;t[l]=function(e,t,n){return{element:e,colspan:t,column:n}}(e.element,o,l)})),n+=o})),t}(e),n=function(e,t){return{element:e,columns:t}}(e.element,R(t));return{colgroups:[n],columns:t}})).getOrThunk((function(){return{colgroups:[],columns:{}}})),m=f.columns,d=f.colgroups,p=function(e,t){return{rows:e,columns:t}}(l,u);return{grid:p,access:n,all:o,columns:m,colgroups:d}},dt=function(e){var t=function(e){var t=lt(e),n=ut(e),r=o(o([],n,!0),t,!0);return at(r,it)}(e);return mt(t)},pt=function(e,t,n){return S.from(e.access[st(t,n)])},bt=function(e,t,n){var o=ft(e,(function(e){return n(t,e.element)}));return o.length>0?S.some(o[0]):S.none()},gt=function(e){return H(e.all,(function(e){return e.cells}))},ht=function(e,t){return S.from(e.columns[t])},vt=tinymce.util.Tools.resolve("tinymce.util.Tools"),yt=function(e,t,n){for(var o,r=e.select("td,th",t),l=0;l<r.length;l++){var u=e.getStyle(r[l],n);if(c(o)&&(o=u),o!==u)return""}return o},wt=function(e,t,n){vt.each("left center right".split(" "),(function(o){o!==n&&e.formatter.remove("align"+o,{},t)})),n&&e.formatter.apply("align"+n,{},t)},St=function(e,t,o){e.dispatch("TableModified",n(n({},o),{table:t}))},Ct=function(e,t){return(n=e,o=parseFloat(n),isNaN(o)?S.none():S.some(o)).getOr(t);var n,o},Tt=function(e,t,n){return Ct(Ge(e,t),n)},xt=function(e,t){var n=e.dom,o=n.getBoundingClientRect().width||n.offsetWidth;return"border-box"===t?o:function(e,t,n,o){return t-Tt(e,"padding-".concat(n),0)-Tt(e,"padding-".concat(o),0)-Tt(e,"border-".concat(n,"-width"),0)-Tt(e,"border-".concat(o,"-width"),0)}(e,o,"left","right")},At=function(e){return xt(e,"content-box")},Rt=tinymce.util.Tools.resolve("tinymce.Env"),_t=E(5,(function(e){var t="".concat(e+1,"px");return{title:t,value:t}})),Ot=B(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],(function(e){return{title:e,value:e.toLowerCase()}})),Dt="100%",Nt=function(e){var t,n=e.dom,o=null!==(t=n.getParent(e.selection.getStart(),n.isBlock))&&void 0!==t?t:e.getBody();return At(U.fromDom(o))+"px"},It=function(e){return function(t){return t.options.get(e)}},Mt=It("table_sizing_mode"),Pt=It("table_border_widths"),kt=It("table_border_styles"),Et=It("table_cell_advtab"),Bt=It("table_row_advtab"),Ft=It("table_advtab"),qt=It("table_appearance_options"),jt=It("table_grid"),Lt=It("table_style_by_css"),Ht=It("table_cell_class_list"),Vt=It("table_row_class_list"),Wt=It("table_class_list"),zt=It("table_toolbar"),$t=It("table_background_color_map"),Ut=It("table_border_color_map"),Gt=function(e){return"fixed"===Mt(e)},Kt=function(e){return"responsive"===Mt(e)},Jt=function(e){var t=e.options,o=t.get("table_default_styles");return t.isSet("table_default_styles")?o:function(e,t){return Kt(e)||!Lt(e)?t:Gt(e)?n(n({},t),{width:Nt(e)}):n(n({},t),{width:Dt})}(e,o)},Qt=function(e){var t=e.options,o=t.get("table_default_attributes");return t.isSet("table_default_attributes")?o:function(e,t){return Kt(e)||Lt(e)?t:Gt(e)?n(n({},t),{width:Nt(e)}):n(n({},t),{width:Dt})}(e,o)},Xt=function(e,t){return t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow},Yt=function(e,t,n){var o=bt(e,t,J),r=bt(e,n,J);return o.bind((function(e){return r.map((function(t){return n=e,o=t,r=Math.min(n.row,o.row),l=Math.min(n.column,o.column),u=Math.max(n.row+n.rowspan-1,o.row+o.rowspan-1),a=Math.max(n.column+n.colspan-1,o.column+o.colspan-1),{startRow:r,startCol:l,finishRow:u,finishCol:a};var n,o,r,l,u,a}))}))},Zt=function(e,t,n){return Yt(e,t,n).bind((function(t){return function(e,t){for(var n=!0,o=h(Xt,t),r=t.startRow;r<=t.finishRow;r++)for(var l=t.startCol;l<=t.finishCol;l++)n=n&&pt(e,r,l).exists(o);return n?S.some(t):S.none()}(e,t)}))},en=dt,tn=function(e,t){ie(e).each((function(n){n.dom.insertBefore(t.dom,e.dom)}))},nn=function(e,t){fe(e).fold((function(){ie(e).each((function(e){rn(e,t)}))}),(function(e){tn(e,t)}))},on=function(e,t){de(e).fold((function(){rn(e,t)}),(function(n){e.dom.insertBefore(t.dom,n.dom)}))},rn=function(e,t){e.dom.appendChild(t.dom)},ln=function(e,t){tn(e,t),rn(t,e)},un=function(e,t){F(t,(function(n,o){var r=0===o?e:t[o-1];nn(r,n)}))},an=function(e,t){F(t,(function(t){rn(e,t)}))},cn=function(e){var t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},sn=function(e){var t=me(e);t.length>0&&un(e,t),cn(e)},fn=function(e,t){var n=function(t){return e(t)?S.from(t.dom.nodeValue):S.none()};return{get:function(o){if(!e(o))throw new Error("Can only get "+t+" value of a "+t+" node");return n(o).getOr("")},getOption:n,set:function(n,o){if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom.nodeValue=o}}}(oe,"text"),mn=function(e){return fn.get(e)},dn=function(e,t){return fn.set(e,t)},pn=["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"],bn=function(e,t,n,o){var r,l,u=t(e,n);return r=function(n,o){var r=t(e,o);return gn(e,n,r)},l=u,function(e,t){for(var n=e.length-1;n>=0;n--)t(e[n],n)}(o,(function(e,t){l=r(l,e,t)})),l},gn=function(e,t,n){return t.bind((function(t){return n.filter(h(e.eq,t))}))},hn=function(e,t,n){return n.length>0?function(e,t,n,o){return o(e,t,n[0],n.slice(1))}(e,t,n,bn):S.none()},vn={up:p({selector:Se,closest:xe,predicate:we,all:ce}),down:p({selector:Pe,predicate:Ie}),styles:p({get:Ge,getRaw:Je,set:Ue,remove:Qe}),attrs:p({get:Be,set:Ee,remove:qe,copyTo:function(e,t){!function(e,t){var n=e.dom;x(t,(function(e,t){ke(n,t,e)}))}(t,j(e.dom.attributes,(function(e,t){return e[t.name]=t.value,e}),{}))}}),insert:p({before:tn,after:nn,afterAll:un,append:rn,appendAll:an,prepend:on,wrap:ln}),remove:p({unwrap:sn,remove:cn}),create:p({nu:U.fromTag,clone:function(e){return U.fromDom(e.dom.cloneNode(!1))},text:U.fromText}),query:p({comparePosition:function(e,t){return e.dom.compareDocumentPosition(t.dom)},prevSibling:se,nextSibling:fe}),property:p({children:me,name:Y,parent:ie,document:function(e){return ae(e).dom},isText:oe,isComment:te,isElement:ne,isSpecial:function(e){var t=Y(e);return P(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},getLanguage:function(e){return ne(e)?Fe(e,"lang"):S.none()},getText:mn,setText:dn,isBoundary:function(e){return!!ne(e)&&("body"===Y(e)||P(pn,Y(e)))},isEmptyTag:function(e){return!!ne(e)&&P(["br","img","hr","input"],Y(e))},isNonEditable:function(e){return ne(e)&&"false"===Be(e,"contenteditable")}}),eq:J,is:Q},yn=function(e){return Se(e,"table")},wn=function(e,t,n){return Te(e,t).bind((function(t){return Te(e,n).bind((function(e){return(n=yn,o=[t,e],hn(vn,(function(e,t){return n(t)}),o)).map((function(n){return{first:t,last:e,table:n}}));var n,o}))}))},Sn=function(e,t){return function(e,t){var n=Pe(e,t);return n.length>0?S.some(n):S.none()}(e,t)},Cn=function(e,t,n){return wn(e,t,n).bind((function(t){var n=function(t){return J(e,t)},o="thead,tfoot,tbody,table",r=Se(t.first,o,n),l=Se(t.last,o,n);return r.bind((function(e){return l.bind((function(n){return J(e,n)?function(e,t,n){var o=en(e);return Zt(o,t,n)}(t.table,t.first,t.last):S.none()}))}))}))},Tn=function(e){return B(e,U.fromDom)},xn="data-mce-selected",An="data-mce-first-selected",Rn="data-mce-last-selected",_n={selected:xn,selectedSelector:"td["+xn+"],th["+xn+"]",firstSelected:An,firstSelectedSelector:"td["+An+"],th["+An+"]",lastSelected:Rn,lastSelectedSelector:"td["+Rn+"],th["+Rn+"]"},On=function(e){return function(t,n){var o,r=Y(t),l="col"===r||"colgroup"===r?rt(o=t).bind((function(e){return Sn(e,_n.firstSelectedSelector)})).fold(p(o),(function(e){return e[0]})):t;return xe(l,e,n)}},Dn=On("th,td,caption"),Nn=On("th,td"),In=function(e){return Tn(e.model.table.getSelectedCells())},Mn=function(e,t){var n=Nn(e),o=n.bind((function(e){return rt(e)})).map((function(e){return lt(e)}));return Le(n,o,(function(e,n){return q(n,(function(n){return k(Tn(n.dom.cells),(function(n){return"1"===Be(n,t)||J(n,e)}))}))})).getOr([])},Pn=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],kn=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,En=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Bn=function(e){return(t=e,n="#",He(t,n)?function(e,t){return e.substring(t)}(t,n.length):t).toUpperCase();var t,n},Fn=function(e){return function(e){return kn.test(e)||En.test(e)}(e)?S.some({value:Bn(e)}):S.none()},qn=function(e){var t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},jn=function(e){return function(e){return{value:Bn(e)}}(qn(e.red)+qn(e.green)+qn(e.blue))},Ln=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,Hn=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,Vn=function(e,t,n,o){return{red:e,green:t,blue:n,alpha:o}},Wn=function(e,t,n,o){var r=parseInt(e,10),l=parseInt(t,10),u=parseInt(n,10),a=parseFloat(o);return Vn(r,l,u,a)},zn=function(e){if("transparent"===e)return S.some(Vn(0,0,0,0));var t=Ln.exec(e);if(null!==t)return S.some(Wn(t[1],t[2],t[3],"1"));var n=Hn.exec(e);return null!==n?S.some(Wn(n[1],n[2],n[3],n[4])):S.none()},$n=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},Un=function(){return e=function(e){return e.unbind()},t=$n(S.none()),n=function(){return t.get().each(e)},{clear:function(){n(),t.set(S.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){n(),t.set(S.some(e))}};var e,t,n},Gn=function(e,t,n){return function(o){var r=Un(),l=!We(n),u=function(){var u=In(e),a=function(o){return e.formatter.match(t,{value:n},o.dom,l)};l?(o.setActive(!k(u,a)),r.set(e.formatter.formatChanged(t,(function(e){return o.setActive(!e)}),!0))):(o.setActive(V(u,a)),r.set(e.formatter.formatChanged(t,o.setActive,!1,{value:n})))};return e.initialized?u():e.on("init",u),r.clear}},Kn=function(e){return N(e,"menu")},Jn=function(e){return B(e,(function(e){var t=e.text||e.title||"";return Kn(e)?{text:t,items:Jn(e.menu)}:{text:t,value:e.value}}))},Qn=function(e,t,n,o){return B(t,(function(t){var r=t.text||t.title;return Kn(t)?{type:"nestedmenuitem",text:r,getSubmenuItems:function(){return Qn(e,t.menu,n,o)}}:{text:r,type:"togglemenuitem",onAction:function(){return o(t.value)},onSetup:Gn(e,n,t.value)}}))},Xn=function(e,t){return function(n){var o;e.execCommand("mceTableApplyCellStyle",!1,((o={})[t]=n,o))}},Yn=function(e){return H(e,(function(e){return Kn(e)?[n(n({},e),{menu:Yn(e.menu)})]:We(e.value)?[e]:[]}))},Zn=function(e,t,n,o){return function(r){return r(Qn(e,t,n,o))}},eo=function(e,t,n){var o=B(t,(function(e){return{text:e.title,value:"#"+(t=e.value,Fn(t).orThunk((function(){return zn(t).map(jn)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var o=n.getImageData(0,0,1,1).data,r=o[0],l=o[1],u=o[2],a=o[3];return jn(Vn(r,l,u,a))}))).value,type:"choiceitem"};var t}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:o.length>0?o:void 0,allowCustomColors:!1},onAction:function(t){var o,r="remove"===t.value?"":t.value;e.execCommand("mceTableApplyCellStyle",!1,((o={})[n]=r,o))}}]},to=function(e){return function(){var t="header"===e.queryCommandValue("mceTableRowType")?"body":"header";e.execCommand("mceTableRowType",!1,{type:t})}},no=function(e){return function(){var t="th"===e.queryCommandValue("mceTableColType")?"td":"th";e.execCommand("mceTableColType",!1,{type:t})}},oo=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",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:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:Pn}],ro=function(e){return oo.concat(function(e){var t=Jn(Ht(e));return t.length>0?S.some({name:"class",type:"listbox",label:"Class",items:t}):S.none()}(e).toArray())},lo=function(e,t){var n=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(Jn(kt(e)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:"cell"===t?[{name:"borderwidth",type:"input",label:"Border width"}].concat(n):n}},uo=function(e,t){var n=e.dom;return{setAttrib:function(e,o){n.setAttrib(t,e,o)},setStyle:function(e,o){n.setStyle(t,e,o)},setFormat:function(n,o){""===o?e.formatter.remove(n,{value:null},t,!0):e.formatter.apply(n,{value:o},t)}}},ao=ue("th"),io=function(e,t){return e&&t?"sectionCells":e?"section":"cells"},co=function(e){var t=q(e,(function(e){return ao(e.element)}));return 0===t.length?S.some("td"):t.length===e.length?S.some("th"):S.none()},so=function(e){var t=B(e,(function(e){return function(e){var t="thead"===e.section,n=je(co(e.cells),"th");return"tfoot"===e.section?{type:"footer"}:t||n?{type:"header",subType:io(t,n)}:{type:"body"}}(e).type})),n=P(t,"header"),o=P(t,"footer");if(n||o){var r=P(t,"body");return!n||r||o?n||r||!o?S.none():S.some("footer"):S.some("header")}return S.some("body")},fo=function(e,t){return z(e.all,(function(e){return L(e.cells,(function(e){return J(t,e.element)}))}))},mo=function(e,t,n){var o,r,l=function(e){for(var t=[],n=function(e){t.push(e)},o=0;o<e.length;o++)e[o].each(n);return t}(B(t.selection,(function(t){return ot(t).bind((function(t){return fo(e,t)})).filter(n)})));return o=l.length>0,r=l,o?S.some(r):S.none()},po=function(e,t){return mo(e,t,w)},bo=function(e,t){return V(t,(function(t){return function(e,t){return fo(e,t).exists((function(e){return!e.isLocked}))}(e,t)}))},go=function(e,t){return function(e,t){return t.mergable}(0,t).filter((function(t){return bo(e,t.cells)}))},ho=function(e,t){return function(e,t){return t.unmergable}(0,t).filter((function(t){return bo(e,t)}))},vo=function(e){if(!a(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var t=[],n={};return F(e,(function(o,r){var l=C(o);if(1!==l.length)throw new Error("one and only one name per case");var u=l[0],i=o[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!a(i))throw new Error("case arguments must be an array");t.push(u),n[u]=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var l=n.length;if(l!==i.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+i.length+" ("+i+"), got "+l);return{fold:function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,n)},match:function(e){var o=C(e);if(t.length!==o.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+o.join(","));if(!V(t,(function(e){return P(o,e)})))throw new Error("Not all branches were specified when using match. Specified: "+o.join(", ")+"\nRequired: "+t.join(", "));return e[u].apply(null,n)},log:function(e){console.log(e,{constructors:t,constructor:u,params:n})}}}})),n},yo=vo([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]);n({},yo);var wo=function(e,t){var n=dt(e);return po(n,t).bind((function(e){var t=e[e.length-1],o=e[0].row,r=t.row+t.rowspan,l=n.all.slice(o,r);return so(l)})).getOr("")},So=function(e){return He(e,"rgb")?zn(t=e).map(jn).map((function(e){return"#"+e.value})).getOr(t):e;var t},Co=function(e){var t=U.fromDom(e);return{borderwidth:Je(t,"border-width").getOr(""),borderstyle:Je(t,"border-style").getOr(""),bordercolor:Je(t,"border-color").map(So).getOr(""),backgroundcolor:Je(t,"background-color").map(So).getOr("")}},To=function(e){var t=e[0],n=e.slice(1);return F(n,(function(e){F(C(t),(function(n){x(e,(function(e,o){var r=t[n];""!==r&&n===o&&r!==e&&(t[n]="")}))}))})),t},xo=function(e,t,n,o){return L(e,(function(e){return!c(n.formatter.matchNode(o,t+e))})).getOr("")},Ao=h(xo,["left","center","right"],"align"),Ro=h(xo,["top","middle","bottom"],"valign"),_o=function(e){return rt(U.fromDom(e)).map((function(t){var n={selection:Tn(e.cells)};return wo(t,n)})).getOr("")},Oo=function(e,t){var n=dt(e),o=gt(n),r=q(o,(function(e){return k(t,(function(t){return J(e.element,t)}))}));return B(r,(function(e){return{element:e.element.dom,column:ht(n,e.column).map((function(e){return e.element.dom}))}}))},Do=function(e,t,n,o){var r=1===t.length;F(t,(function(t){var l=t.element,u=r?w:o,a=uo(e,l);!function(e,t,n,o){o("scope")&&e.setAttrib("scope",n.scope),o("class")&&e.setAttrib("class",n.class),o("height")&&e.setStyle("height",Oe(n.height)),o("width")&&t.setStyle("width",Oe(n.width))}(a,t.column.map((function(t){return uo(e,t)})).getOr(a),n,u),Et(e)&&function(e,t,n){n("backgroundcolor")&&e.setFormat("tablecellbackgroundcolor",t.backgroundcolor),n("bordercolor")&&e.setFormat("tablecellbordercolor",t.bordercolor),n("borderstyle")&&e.setFormat("tablecellborderstyle",t.borderstyle),n("borderwidth")&&e.setFormat("tablecellborderwidth",Oe(t.borderwidth))}(a,n,u),o("halign")&&wt(e,l,n.halign),o("valign")&&function(e,t,n){vt.each("top middle bottom".split(" "),(function(o){o!==n&&e.formatter.remove("valign"+o,{},t)})),n&&e.formatter.apply("valign"+n,{},t)}(e,l,n.valign)}))},No=function(e,t,n,o){var r=o.getData();o.close(),e.undoManager.transact((function(){!function(e,t,n,o){var r=A(o,(function(e,t){return n[t]!==e}));_(r)>0&&t.length>=1&&rt(t[0]).each((function(n){var l=Oo(n,t),u=_(A(r,(function(e,t){return"scope"!==t&&"celltype"!==t})))>0,a=D(r,"celltype");(u||D(r,"scope"))&&Do(e,l,o,h(D,r)),a&&function(e,t){e.execCommand("mceTableCellType",!1,{type:t.celltype,no_events:!0})}(e,o),St(e,n.dom,{structure:a,style:u})}))}(e,t,n,r),e.focus()}))},Io=function(e,t){var o=rt(t[0]).map((function(o){return B(Oo(o,t),(function(t){return function(e,t,o,r){var l,u=e.dom,a=r.getOr(t),i=function(e,t){return u.getStyle(e,t)||u.getAttrib(e,t)};return n({width:i(a,"width"),height:i(t,"height"),scope:u.getAttrib(t,"scope"),celltype:(l=t,l.nodeName.toLowerCase()),class:u.getAttrib(t,"class",""),halign:Ao(e,t),valign:Ro(e,t)},o?Co(t):{})}(e,t.element,Et(e),t.column)}))}));return To(o.getOrDie())},Mo=function(e){var t=In(e);if(0!==t.length){var n=Io(e,t),o={type:"tabpanel",tabs:[{title:"General",name:"general",items:ro(e)},lo(e,"cell")]},r={type:"panel",items:[{type:"grid",columns:2,items:ro(e)}]};e.windowManager.open({title:"Cell Properties",size:"normal",body:Et(e)?o:r,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:n,onSubmit:h(No,e,t,n)})}},Po=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",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"}],ko=function(e){return Po.concat(function(e){var t=Jn(Vt(e));return t.length>0?S.some({name:"class",type:"listbox",label:"Class",items:t}):S.none()}(e).toArray())},Eo=function(e,t,n,o){var r=1===t.length?w:o;F(t,(function(t){var l=uo(e,t);!function(e,t,n){n("class")&&e.setAttrib("class",t.class),n("height")&&e.setStyle("height",Oe(t.height))}(l,n,r),Bt(e)&&function(e,t,n){n("backgroundcolor")&&e.setStyle("background-color",t.backgroundcolor),n("bordercolor")&&e.setStyle("border-color",t.bordercolor),n("borderstyle")&&e.setStyle("border-style",t.borderstyle)}(l,n,r),o("align")&&wt(e,t,n.align)}))},Bo=function(e,t,n,o){var r=o.getData();o.close(),e.undoManager.transact((function(){!function(e,t,n,o){var r=A(o,(function(e,t){return n[t]!==e}));if(_(r)>0){var l=D(r,"type"),u=!l||_(r)>1;u&&Eo(e,t,o,h(D,r)),l&&function(e,t){e.execCommand("mceTableRowType",!1,{type:t.type,no_events:!0})}(e,o),rt(U.fromDom(t[0])).each((function(t){return St(e,t.dom,{structure:l,style:u})}))}}(e,t,n,r),e.focus()}))},Fo=function(e){var t=Mn(De(e),_n.selected);if(0!==t.length){var o=B(t,(function(t){return function(e,t,o){var r=e.dom;return n({height:r.getStyle(t,"height")||r.getAttrib(t,"height"),class:r.getAttrib(t,"class",""),type:_o(t),align:Ao(e,t)},o?Co(t):{})}(e,t.dom,Bt(e))})),r=To(o),l={type:"tabpanel",tabs:[{title:"General",name:"general",items:ko(e)},lo(e,"row")]},u={type:"panel",items:[{type:"grid",columns:2,items:ko(e)}]};e.windowManager.open({title:"Row Properties",size:"normal",body:Bt(e)?l:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onSubmit:h(Bo,e,B(t,(function(e){return e.dom})),r)})}},qo=function(e,t,n){var o=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],r=qt(e)?[{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"}]}]:[],l=t.length>0?[{type:"listbox",name:"class",label:"Class",items:t}]:[];return o.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(r).concat([{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(l)},jo=function(e,t,n,o){if("TD"===t.tagName||"TH"===t.tagName)u(n)&&s(o)?e.setStyle(t,n,o):e.setStyles(t,n);else if(t.children)for(var r=0;r<t.children.length;r++)jo(e,t.children[r],n,o)},Lo=function(e,t,o,r){var l=e.dom,u={},a={},i=Lt(e),s=Ft(e);if(c(o.class)||(u.class=o.class),a.height=Oe(o.height),i?a.width=Oe(o.width):l.getAttrib(t,"width")&&(u.width=function(e){return e?e.replace(/px$/,""):""}(o.width)),i?(a["border-width"]=Oe(o.border),a["border-spacing"]=Oe(o.cellspacing)):(u.border=o.border,u.cellpadding=o.cellpadding,u.cellspacing=o.cellspacing),i&&t.children){var f={};if(r.border&&(f["border-width"]=Oe(o.border)),r.cellpadding&&(f.padding=Oe(o.cellpadding)),s&&r.bordercolor&&(f["border-color"]=o.bordercolor),!function(e){for(var t in e)if(T.call(e,t))return!1;return!0}(f))for(var m=0;m<t.children.length;m++)jo(l,t.children[m],f)}if(s){var d=o;a["background-color"]=d.backgroundcolor,a["border-color"]=d.bordercolor,a["border-style"]=d.borderstyle}l.setStyles(t,n(n({},Jt(e)),a)),l.setAttribs(t,n(n({},Qt(e)),u))},Ho=function(e,t,n,o){var r=e.dom,l=o.getData(),u=A(l,(function(e,t){return n[t]!==e}));o.close(),""===l.class&&delete l.class,e.undoManager.transact((function(){if(!t){var n=ze(l.cols).getOr(1),o=ze(l.rows).getOr(1);e.execCommand("mceInsertTable",!1,{rows:o,columns:n}),t=Nn(De(e),_e(e)).bind((function(t){return rt(t,_e(e))})).map((function(e){return e.dom})).getOrDie()}if(_(u)>0){var a={border:D(u,"border"),bordercolor:D(u,"bordercolor"),cellpadding:D(u,"cellpadding")};Lo(e,t,l,a);var i=r.select("caption",t)[0];(i&&!l.caption||!i&&l.caption)&&e.execCommand("mceTableToggleCaption"),wt(e,t,l.align)}if(e.focus(),e.addVisual(),_(u)>0){var c=D(u,"caption"),s=!c||_(u)>1;St(e,t,{structure:c,style:s})}}))},Vo=function(e,t){var o,r=e.dom,l=function(e,t){var o,r,l,u=Jt(e),a=Qt(e),i=t?{borderstyle:O(u,"border-style").getOr(""),bordercolor:So(O(u,"border-color").getOr("")),backgroundcolor:So(O(u,"background-color").getOr(""))}:{};return n(n(n(n(n(n({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""}),u),a),i),(l=u["border-width"],Lt(e)&&l?{border:l}:O(a,"border").fold((function(){return{}}),(function(e){return{border:e}})))),(o=O(u,"border-spacing").or(O(a,"cellspacing")).fold((function(){return{}}),(function(e){return{cellspacing:e}})),r=O(u,"border-padding").or(O(a,"cellpadding")).fold((function(){return{}}),(function(e){return{cellpadding:e}})),n(n({},o),r)))}(e,Ft(e));t?(l.cols="1",l.rows="1",Ft(e)&&(l.borderstyle="",l.bordercolor="",l.backgroundcolor="")):(o=r.getParent(e.selection.getStart(),"table",e.getBody()))?l=function(e,t,o){var r=e.dom,l=Lt(e)?r.getStyle(t,"border-spacing")||r.getAttrib(t,"cellspacing"):r.getAttrib(t,"cellspacing")||r.getStyle(t,"border-spacing"),u=Lt(e)?yt(r,t,"padding")||r.getAttrib(t,"cellpadding"):r.getAttrib(t,"cellpadding")||yt(r,t,"padding");return n({width:r.getStyle(t,"width")||r.getAttrib(t,"width"),height:r.getStyle(t,"height")||r.getAttrib(t,"height"),cellspacing:null!=l?l:"",cellpadding:null!=u?u:"",border:function(t,n){var o=Je(U.fromDom(n),"border-width");return Lt(e)&&o.isSome()?o.getOr(""):t.getAttrib(n,"border")||yt(e.dom,n,"border-width")||yt(e.dom,n,"border")||""}(r,t),caption:!!r.select("caption",t)[0],class:r.getAttrib(t,"class",""),align:Ao(e,t)},o?Co(t):{})}(e,o,Ft(e)):Ft(e)&&(l.borderstyle="",l.bordercolor="",l.backgroundcolor="");var u=Jn(Wt(e));u.length>0&&l.class&&(l.class=l.class.replace(/\s*mce\-item\-table\s*/g,""));var a={type:"grid",columns:2,items:qo(e,u,t)},i=Ft(e)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[a]},lo(e,"table")]}:{type:"panel",items:[a]};e.windowManager.open({title:"Table Properties",size:"normal",body:i,onSubmit:h(Ho,e,o,l),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:l})},Wo=function(e){x({mceTableProps:h(Vo,e,!1),mceTableRowProps:h(Fo,e),mceTableCellProps:h(Mo,e),mceInsertTableDialog:h(Vo,e,!0)},(function(t,n){return e.addCommand(n,(function(){return n=t,void(Ne(De(e))&&n());var n}))}))},zo=b,$o=function(e){var t=function(e,t){return Fe(e,t).exists((function(e){return parseInt(e,10)>1}))};return e.length>0&&V(e,(function(e){return t(e,"rowspan")||t(e,"colspan")}))?S.some(e):S.none()},Uo=function(e,t,n){return t.length<=1?S.none():Cn(e,n.firstSelectedSelector,n.lastSelectedSelector).map((function(e){return{bounds:e,cells:t}}))},Go=function(e){var t=$n(S.none()),n=$n([]),o=S.none(),r=ue("caption"),l=function(e){return o.forall((function(t){return!t[e]}))},u=function(){return Dn(function(e){return U.fromDom(e.selection.getEnd())}(e),_e(e))},a=function(){return Dn(De(e),_e(e)).bind((function(t){return n=Le(rt(t),u().bind(rt),(function(n,o){return J(n,o)?r(t)?S.some(function(e){return{element:e,mergable:S.none(),unmergable:S.none(),selection:[e]}}(t)):S.some(function(e,t,n){return{element:n,mergable:Uo(t,e,_n),unmergable:$o(e),selection:zo(e)}}(In(e),n,t)):S.none()})),n.bind(b);var n}))},i=function(e){return rt(e.element).map((function(t){var n=dt(t),o=po(n,e).getOr([]),r=j(o,(function(e,t){return t.isLocked&&(e.onAny=!0,0===t.column?e.onFirst=!0:t.column+t.colspan>=n.grid.columns&&(e.onLast=!0)),e}),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:go(n,e).isSome(),unmergeable:ho(n,e).isSome(),locked:r}}))},c=function(){t.set(function(e){var t,n=!1;return function(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];return n||(n=!0,t=e.apply(null,o)),t}}(a)()),o=t.get().bind(i),F(n.get(),v)},s=function(e){return e(),n.set(n.get().concat([e])),function(){n.set(q(n.get(),(function(t){return t!==e})))}},f=function(n,o){return s((function(){return t.get().fold((function(){n.setEnabled(!1)}),(function(t){n.setEnabled(!o(t)&&e.selection.isEditable())}))}))},m=function(n,o,r){return s((function(){return t.get().fold((function(){n.setEnabled(!1),n.setActive(!1)}),(function(t){n.setEnabled(!o(t)&&e.selection.isEditable()),n.setActive(r(t))}))}))},d=function(e){return o.exists((function(t){return t.locked[e]}))},p=function(t,n){return function(o){return m(o,(function(e){return r(e.element)}),(function(){return e.queryCommandValue(t)===n}))}},g=p("mceTableRowType","header"),h=p("mceTableColType","th");return e.on("NodeChange ExecCommand TableSelectorChange",c),{onSetupTable:function(e){return f(e,(function(e){return!1}))},onSetupCellOrRow:function(e){return f(e,(function(e){return r(e.element)}))},onSetupColumn:function(e){return function(t){return f(t,(function(t){return r(t.element)||d(e)}))}},onSetupPasteable:function(e){return function(t){return f(t,(function(t){return r(t.element)||e().isNone()}))}},onSetupPasteableColumn:function(e,t){return function(n){return f(n,(function(n){return r(n.element)||e().isNone()||d(t)}))}},onSetupMergeable:function(e){return f(e,(function(e){return l("mergeable")}))},onSetupUnmergeable:function(e){return f(e,(function(e){return l("unmergeable")}))},resetTargets:c,onSetupTableWithCaption:function(t){return m(t,y,(function(t){return rt(t.element,_e(e)).exists((function(e){return Ce(e,"caption").isSome()}))}))},onSetupTableRowHeaders:g,onSetupTableColumnHeaders:h,targets:t.get}},Ko=tinymce.util.Tools.resolve("tinymce.FakeClipboard"),Jo="x-tinymce/dom-table-",Qo=Jo+"rows",Xo=Jo+"columns",Yo=function(e){var t,n=null!==(t=Ko.read())&&void 0!==t?t:[];return z(n,(function(t){return S.from(t.getType(e))}))},Zo=function(){return Yo(Qo)},er=function(){return Yo(Xo)},tr=function(e){return function(t){var n=function(){t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",n),n(),function(){e.off("NodeChange",n)}}},nr=function(e){return function(t){var n=function(){t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",n),n(),function(){e.off("NodeChange",n)}}},or=function(e){var t=Go(e);!function(e){var t=e.options.register;t("table_border_widths",{processor:"object[]",default:_t}),t("table_border_styles",{processor:"object[]",default:Ot}),t("table_cell_advtab",{processor:"boolean",default:!0}),t("table_row_advtab",{processor:"boolean",default:!0}),t("table_advtab",{processor:"boolean",default:!0}),t("table_appearance_options",{processor:"boolean",default:!0}),t("table_grid",{processor:"boolean",default:!Rt.deviceType.isTouch()}),t("table_cell_class_list",{processor:"object[]",default:[]}),t("table_row_class_list",{processor:"object[]",default:[]}),t("table_class_list",{processor:"object[]",default:[]}),t("table_toolbar",{processor:"string",default:"tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol"}),t("table_background_color_map",{processor:"object[]",default:[]}),t("table_border_color_map",{processor:"object[]",default:[]})}(e),Wo(e),function(e,t){var o=function(t){return function(){return e.execCommand(t)}},r=function(t,r){return!!e.queryCommandSupported(r.command)&&(e.ui.registry.addMenuItem(t,n(n({},r),{onAction:f(r.onAction)?r.onAction:o(r.command)})),!0)},l=function(t,r){e.queryCommandSupported(r.command)&&e.ui.registry.addToggleMenuItem(t,n(n({},r),{onAction:f(r.onAction)?r.onAction:o(r.command)}))},u=function(t){e.execCommand("mceInsertTable",!1,{rows:t.numRows,columns:t.numColumns})},a=[r("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:t.onSetupCellOrRow}),r("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:t.onSetupCellOrRow}),r("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:t.onSetupCellOrRow}),r("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:t.onSetupCellOrRow}),r("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:t.onSetupCellOrRow}),r("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:t.onSetupCellOrRow}),r("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:t.onSetupPasteable(Zo)}),r("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:t.onSetupPasteable(Zo)})],i=[r("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:t.onSetupColumn("onFirst")}),r("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:t.onSetupColumn("onLast")}),r("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:t.onSetupColumn("onAny")}),r("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:t.onSetupColumn("onAny")}),r("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:t.onSetupColumn("onAny")}),r("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:t.onSetupPasteableColumn(er,"onFirst")}),r("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:t.onSetupPasteableColumn(er,"onLast")})],c=[r("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:t.onSetupCellOrRow}),r("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:t.onSetupMergeable}),r("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:t.onSetupUnmergeable})];jt(e)?e.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:u}]},onSetup:nr(e)}):e.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTableDialog"),onSetup:nr(e)}),e.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTableDialog"),onSetup:nr(e)}),r("tableprops",{text:"Table properties",onSetup:t.onSetupTable,command:"mceTableProps"}),r("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:t.onSetupTable,command:"mceTableDelete"}),P(a,!0)&&e.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:p("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),P(i,!0)&&e.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:p("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),P(c,!0)&&e.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:p("tablecellprops tablemergecells tablesplitcells")}),e.ui.registry.addContextMenu("table",{update:function(){return t.resetTargets(),t.targets().fold(p(""),(function(e){return"caption"===Y(e.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"}))}});var s=Yn(Wt(e));0!==s.length&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:function(){return Qn(e,s,"tableclass",(function(t){return e.execCommand("mceTableToggleClass",!1,t)}))},onSetup:t.onSetupTable});var m=Yn(Ht(e));0!==m.length&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:function(){return Qn(e,m,"tablecellclass",(function(t){return e.execCommand("mceTableCellToggleClass",!1,t)}))},onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:function(){return Qn(e,Pn,"tablecellverticalalign",Xn(e,"vertical-align"))},onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:function(){return Qn(e,Pt(e),"tablecellborderwidth",Xn(e,"border-width"))},onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:function(){return Qn(e,kt(e),"tablecellborderstyle",Xn(e,"border-style"))},onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:function(){return eo(e,$t(e),"background-color")},onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:function(){return eo(e,Ut(e),"border-color")},onSetup:t.onSetupCellOrRow})),l("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),l("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:to(e),onSetup:t.onSetupTableRowHeaders}),l("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:no(e),onSetup:t.onSetupTableRowHeaders})}(e,t),function(e,t){e.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:tr(e),fetch:function(e){return e("inserttable | cell row column | advtablesort | tableprops deletetable")}});var o=function(t){return function(){return e.execCommand(t)}},r=function(t,r){e.queryCommandSupported(r.command)&&e.ui.registry.addButton(t,n(n({},r),{onAction:f(r.onAction)?r.onAction:o(r.command)}))},l=function(t,r){e.queryCommandSupported(r.command)&&e.ui.registry.addToggleButton(t,n(n({},r),{onAction:f(r.onAction)?r.onAction:o(r.command)}))};r("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:t.onSetupTable}),r("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:t.onSetupTable}),r("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:t.onSetupCellOrRow}),r("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:t.onSetupMergeable}),r("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:t.onSetupUnmergeable}),r("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:t.onSetupCellOrRow}),r("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:t.onSetupCellOrRow}),r("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:t.onSetupCellOrRow}),r("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:t.onSetupCellOrRow}),r("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:t.onSetupColumn("onFirst")}),r("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:t.onSetupColumn("onLast")}),r("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:t.onSetupColumn("onAny")}),r("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:t.onSetupCellOrRow}),r("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:t.onSetupCellOrRow}),r("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:t.onSetupPasteable(Zo)}),r("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:t.onSetupPasteable(Zo)}),r("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:t.onSetupColumn("onAny")}),r("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:t.onSetupColumn("onAny")}),r("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:t.onSetupPasteableColumn(er,"onFirst")}),r("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:t.onSetupPasteableColumn(er,"onLast")}),r("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:tr(e)});var u=Yn(Wt(e));0!==u.length&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Zn(e,u,"tableclass",(function(t){return e.execCommand("mceTableToggleClass",!1,t)})),onSetup:t.onSetupTable});var a=Yn(Ht(e));0!==a.length&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Zn(e,a,"tablecellclass",(function(t){return e.execCommand("mceTableCellToggleClass",!1,t)})),onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Zn(e,Pn,"tablecellverticalalign",Xn(e,"vertical-align")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Zn(e,Pt(e),"tablecellborderwidth",Xn(e,"border-width")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Zn(e,kt(e),"tablecellborderstyle",Xn(e,"border-style")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:function(t){return t(eo(e,$t(e),"background-color"))},onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:function(t){return t(eo(e,Ut(e),"border-color"))},onSetup:t.onSetupCellOrRow})),l("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),l("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:to(e),onSetup:t.onSetupTableRowHeaders}),l("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:no(e),onSetup:t.onSetupTableColumnHeaders})}(e,t),function(e){var t=zt(e);t.length>0&&e.ui.registry.addContextToolbar("table",{predicate:function(t){return e.dom.is(t,"table")&&e.getBody().contains(t)&&e.dom.isEditable(t.parentNode)},items:t,scope:"node",position:"node"})}(e)};t.add("table",or)}(),e}export{n as __require};
1
+ import{__exports as e}from"../../../../_virtual/plugin3.mjs";var t;function n(){if(t)return e;t=1;var n=e&&e.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},o=e&&e.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var o,r=0,l=t.length;r<l;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};return function(){var e,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(e){return function(t){return u=typeof(n=t),(null===n?"null":"object"===u&&Array.isArray(n)?"array":"object"===u&&(a=o=n,(r=String).prototype.isPrototypeOf(a)||(null===(l=o.constructor)||void 0===l?void 0:l.name)===r.name)?"string":u)===e;var n,o,r,l,u,a}},l=function(e){return function(t){return typeof t===e}},u=r("string"),a=r("array"),i=l("boolean"),c=(e=void 0,function(t){return e===t}),s=function(e){return!function(e){return null==e}(e)},f=l("function"),m=l("number"),d=function(){},p=function(e){return function(){return e}},b=function(e){return e},g=function(e,t){return e===t};function h(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var r=t.concat(n);return e.apply(null,r)}}var v=function(e){e()},y=p(!1),w=p(!0),S=function(){function e(e,t){this.tag=e,this.value=t}return e.some=function(t){return new e(!0,t)},e.none=function(){return e.singletonNone},e.prototype.fold=function(e,t){return this.tag?t(this.value):e()},e.prototype.isSome=function(){return this.tag},e.prototype.isNone=function(){return!this.tag},e.prototype.map=function(t){return this.tag?e.some(t(this.value)):e.none()},e.prototype.bind=function(t){return this.tag?t(this.value):e.none()},e.prototype.exists=function(e){return this.tag&&e(this.value)},e.prototype.forall=function(e){return!this.tag||e(this.value)},e.prototype.filter=function(t){return!this.tag||t(this.value)?this:e.none()},e.prototype.getOr=function(e){return this.tag?this.value:e},e.prototype.or=function(e){return this.tag?this:e},e.prototype.getOrThunk=function(e){return this.tag?this.value:e()},e.prototype.orThunk=function(e){return this.tag?this:e()},e.prototype.getOrDie=function(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")},e.from=function(t){return s(t)?e.some(t):e.none()},e.prototype.getOrNull=function(){return this.tag?this.value:null},e.prototype.getOrUndefined=function(){return this.value},e.prototype.each=function(e){this.tag&&e(this.value)},e.prototype.toArray=function(){return this.tag?[this.value]:[]},e.prototype.toString=function(){return this.tag?"some(".concat(this.value,")"):"none()"},e}();S.singletonNone=new S(!1);var C=Object.keys,T=Object.hasOwnProperty,x=function(e,t){for(var n=C(e),o=0,r=n.length;o<r;o++){var l=n[o];t(e[l],l)}},A=function(e,t){var n,o={};return function(e,t,n,o){x(e,(function(e,r){(t(e,r)?n:o)(e,r)}))}(e,t,(n=o,function(e,t){n[t]=e}),d),o},R=function(e){return function(e,t){var n=[];return x(e,(function(e,o){n.push(t(e,o))})),n}(e,b)},_=function(e){return C(e).length},O=function(e,t){return D(e,t)?S.from(e[t]):S.none()},D=function(e,t){return T.call(e,t)},N=function(e,t){return D(e,t)&&void 0!==e[t]&&null!==e[t]},I=Array.prototype.indexOf,M=Array.prototype.push,P=function(e,t){return function(e,t){return I.call(e,t)}(e,t)>-1},k=function(e,t){for(var n=0,o=e.length;n<o;n++){if(t(e[n],n))return!0}return!1},E=function(e,t){for(var n=[],o=0;o<e;o++)n.push(t(o));return n},B=function(e,t){for(var n=e.length,o=new Array(n),r=0;r<n;r++){var l=e[r];o[r]=t(l,r)}return o},F=function(e,t){for(var n=0,o=e.length;n<o;n++){t(e[n],n)}},q=function(e,t){for(var n=[],o=0,r=e.length;o<r;o++){var l=e[o];t(l,o)&&n.push(l)}return n},j=function(e,t,n){return F(e,(function(e,o){n=t(n,e,o)})),n},L=function(e,t){return function(e,t,n){for(var o=0,r=e.length;o<r;o++){var l=e[o];if(t(l,o))return S.some(l);if(n(l,o))break}return S.none()}(e,t,y)},H=function(e,t){return function(e){for(var t=[],n=0,o=e.length;n<o;++n){if(!a(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);M.apply(t,e[n])}return t}(B(e,t))},V=function(e,t){for(var n=0,o=e.length;n<o;++n){if(!0!==t(e[n],n))return!1}return!0},W=function(e,t){return t>=0&&t<e.length?S.some(e[t]):S.none()},z=function(e,t){for(var n=0;n<e.length;n++){var o=t(e[n],n);if(o.isSome())return o}return S.none()},$=function(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},U={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1){var o="HTML does not have a single root node";throw console.error(o,e),new Error(o)}return $(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return $(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return $(n)},fromDom:$,fromPoint:function(e,t,n){return S.from(e.dom.elementFromPoint(t,n)).map($)}},G=function(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var o=n;if(void 0!==o.matches)return o.matches(t);if(void 0!==o.msMatchesSelector)return o.msMatchesSelector(t);if(void 0!==o.webkitMatchesSelector)return o.webkitMatchesSelector(t);if(void 0!==o.mozMatchesSelector)return o.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},K=function(e){return 1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount},J=function(e,t){return e.dom===t.dom},Q=G;"undefined"!=typeof window?window:Function("return this;")();var X,Y=function(e){return e.dom.nodeName.toLowerCase()},Z=function(e){return e.dom.nodeType},ee=function(e){return function(t){return Z(t)===e}},te=function(e){return 8===Z(e)||"#comment"===Y(e)},ne=ee(1),oe=ee(3),re=ee(9),le=ee(11),ue=function(e){return function(t){return ne(t)&&Y(t)===e}},ae=function(e){return re(e)?e:(t=e,U.fromDom(t.dom.ownerDocument));var t},ie=function(e){return S.from(e.dom.parentNode).map(U.fromDom)},ce=function(e,t){for(var n=f(t)?t:y,o=e.dom,r=[];null!==o.parentNode&&void 0!==o.parentNode;){var l=o.parentNode,u=U.fromDom(l);if(r.push(u),!0===n(u))break;o=l}return r},se=function(e){return S.from(e.dom.previousSibling).map(U.fromDom)},fe=function(e){return S.from(e.dom.nextSibling).map(U.fromDom)},me=function(e){return B(e.dom.childNodes,U.fromDom)},de=function(e){return function(e,t){var n=e.dom.childNodes;return S.from(n[t]).map(U.fromDom)}(e,0)},pe=f(Element.prototype.attachShadow)&&f(Node.prototype.getRootNode),be=pe?function(e){return U.fromDom(e.dom.getRootNode())}:ae,ge=function(e){var t,n=be(e);return le(t=n)&&s(t.dom.host)?S.some(n):S.none()},he=function(e){return U.fromDom(e.dom.host)},ve=function(e){var t=oe(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;var n,o,r=t.ownerDocument;return ge(U.fromDom(t)).fold((function(){return r.body.contains(t)}),(n=ve,o=he,function(e){return n(o(e))}))},ye=function(e,t,n,o,r){return e(n,o)?S.some(n):f(r)&&r(n)?S.none():t(n,o,r)},we=function(e,t,n){for(var o=e.dom,r=f(n)?n:y;o.parentNode;){o=o.parentNode;var l=U.fromDom(o);if(t(l))return S.some(l);if(r(l))break}return S.none()},Se=function(e,t,n){return we(e,(function(e){return G(e,t)}),n)},Ce=function(e,t){return function(e,t){return L(e.dom.childNodes,(function(e){return t(U.fromDom(e))})).map(U.fromDom)}(e,(function(e){return G(e,t)}))},Te=function(e,t){return function(e,t){var n=void 0===t?document:t.dom;return K(n)?S.none():S.from(n.querySelector(e)).map(U.fromDom)}(t,e)},xe=function(e,t,n){return ye((function(e,t){return G(e,t)}),Se,e,t,n)},Ae=function(e,t){return void 0===t&&(t=!1),ve(e)?e.dom.isContentEditable:(n=e,xe(n,"[contenteditable]")).fold(p(t),(function(e){return"true"===Re(e)}));var n},Re=function(e){return e.dom.contentEditable},_e=function(e){return function(t){return J(t,function(e){return U.fromDom(e.getBody())}(e))}},Oe=function(e){return/^\d+(\.\d+)?$/.test(e)?e+"px":e},De=function(e){return U.fromDom(e.selection.getStart())},Ne=function(e){return(t=e,n=ue("table"),ye((function(e,t){return t(e)}),we,t,n,o)).forall(Ae);var t,n,o},Ie=function(e,t){var n=[];return F(me(e),(function(e){t(e)&&(n=n.concat([e])),n=n.concat(Ie(e,t))})),n},Me=function(e,t){return function(e,t){return q(me(e),t)}(e,(function(e){return G(e,t)}))},Pe=function(e,t){return function(e,t){var n=void 0===t?document:t.dom;return K(n)?[]:B(n.querySelectorAll(e),U.fromDom)}(t,e)},ke=function(e,t,n){if(!(u(n)||i(n)||m(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+"")},Ee=function(e,t,n){ke(e.dom,t,n)},Be=function(e,t){var n=e.dom.getAttribute(t);return null===n?void 0:n},Fe=function(e,t){return S.from(Be(e,t))},qe=function(e,t){e.dom.removeAttribute(t)},je=function(e,t,n){return void 0===n&&(n=g),e.exists((function(e){return n(e,t)}))},Le=function(e,t,n){return e.isSome()&&t.isSome()?S.some(n(e.getOrDie(),t.getOrDie())):S.none()},He=function(e,t){return function(e,t,n){return""===t||e.length>=t.length&&e.substr(n,n+t.length)===t}(e,t,0)},Ve=(X=/^\s+|\s+$/g,function(e){return e.replace(X,"")}),We=function(e){return e.length>0},ze=function(e,t){void 0===t&&(t=10);var n=parseInt(e,t);return isNaN(n)?S.none():S.some(n)},$e=function(e){return void 0!==e.style&&f(e.style.getPropertyValue)},Ue=function(e,t,n){!function(e,t,n){if(!u(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);$e(e)&&e.style.setProperty(t,n)}(e.dom,t,n)},Ge=function(e,t){var n=e.dom,o=window.getComputedStyle(n).getPropertyValue(t);return""!==o||ve(e)?o:Ke(n,t)},Ke=function(e,t){return $e(e)?e.style.getPropertyValue(t):""},Je=function(e,t){var n=e.dom,o=Ke(n,t);return S.from(o).filter((function(e){return e.length>0}))},Qe=function(e,t){!function(e,t){$e(e)&&e.style.removeProperty(t)}(e.dom,t),je(Fe(e,"style").map(Ve),"")&&qe(e,"style")},Xe=function(e,t,n){return void 0===n&&(n=0),Fe(e,t).map((function(e){return parseInt(e,10)})).getOr(n)},Ye=function(e,t){return Ze(e,t,w)},Ze=function(e,t,n){return H(me(e),(function(e){return G(e,t)?n(e)?[e]:[]:Ze(e,t,n)}))},et=["tfoot","thead","tbody","colgroup"],tt=function(e,t,n){return{element:e,rowspan:t,colspan:n}},nt=function(e,t,n){return{element:e,cells:t,section:n}},ot=function(e,t){return function(e,t,n){return void 0===n&&(n=y),n(t)?S.none():P(e,Y(t))?S.some(t):Se(t,e.join(","),(function(e){return G(e,"table")||n(e)}))}(["td","th"],e,t)},rt=function(e,t){return xe(e,"table",t)},lt=function(e){return Ye(e,"tr")},ut=function(e){return rt(e).fold(p([]),(function(e){return Me(e,"colgroup")}))},at=function(e,t){return B(e,(function(e){if("colgroup"===Y(e)){var n=B(function(e){return G(e,"colgroup")?Me(e,"col"):H(ut(e),(function(e){return Me(e,"col")}))}(e),(function(e){var t=Xe(e,"span",1);return tt(e,1,t)}));return nt(e,n,"colgroup")}var o=B(function(e){return Ye(e,"th,td")}(e),(function(e){var t=Xe(e,"rowspan",1),n=Xe(e,"colspan",1);return tt(e,t,n)}));return nt(e,o,t(e))}))},it=function(e){return ie(e).map((function(e){var t=Y(e);return function(e){return P(et,e)}(t)?t:"tbody"})).getOr("tbody")},ct=function(e){return Fe(e,"data-snooker-locked-cols").bind((function(e){return S.from(e.match(/\d+/g))})).map((function(e){return function(e,t){for(var n={},o=0,r=e.length;o<r;o++){var l=e[o];n[String(l)]=t(l,o)}return n}(e,w)}))},st=function(e,t){return e+","+t},ft=function(e,t){var n=H(e.all,(function(e){return e.cells}));return q(n,t)},mt=function(e){var t,n={},o=[],r=(t=e,W(t,0)).map((function(e){return e.element})).bind(rt).bind(ct).getOr({}),l=0,u=0,a=0,i=function(e,t){for(var n=[],o=[],r=0,l=e.length;r<l;r++){var u=e[r];(t(u,r)?n:o).push(u)}return{pass:n,fail:o}}(e,(function(e){return"colgroup"===e.section})),c=i.pass,s=i.fail;F(s,(function(e){var t=[];F(e.cells,(function(e){for(var o=0;void 0!==n[st(a,o)];)o++;for(var l=N(r,o.toString()),i=function(e,t,n,o,r,l){return{element:e,rowspan:t,colspan:n,row:o,column:r,isLocked:l}}(e.element,e.rowspan,e.colspan,a,o,l),c=0;c<e.colspan;c++)for(var s=0;s<e.rowspan;s++){var f=o+c,m=st(a+s,f);n[m]=i,u=Math.max(u,f+1)}t.push(i)})),l++,o.push(nt(e.element,t,e.section)),a++}));var f=function(e){return W(e,e.length-1)}(c).map((function(e){var t=function(e){var t={},n=0;return F(e.cells,(function(e){var o=e.colspan;E(o,(function(r){var l=n+r;t[l]=function(e,t,n){return{element:e,colspan:t,column:n}}(e.element,o,l)})),n+=o})),t}(e),n=function(e,t){return{element:e,columns:t}}(e.element,R(t));return{colgroups:[n],columns:t}})).getOrThunk((function(){return{colgroups:[],columns:{}}})),m=f.columns,d=f.colgroups,p=function(e,t){return{rows:e,columns:t}}(l,u);return{grid:p,access:n,all:o,columns:m,colgroups:d}},dt=function(e){var t=function(e){var t=lt(e),n=ut(e),r=o(o([],n,!0),t,!0);return at(r,it)}(e);return mt(t)},pt=function(e,t,n){return S.from(e.access[st(t,n)])},bt=function(e,t,n){var o=ft(e,(function(e){return n(t,e.element)}));return o.length>0?S.some(o[0]):S.none()},gt=function(e){return H(e.all,(function(e){return e.cells}))},ht=function(e,t){return S.from(e.columns[t])},vt=tinymce.util.Tools.resolve("tinymce.util.Tools"),yt=function(e,t,n){for(var o,r=e.select("td,th",t),l=0;l<r.length;l++){var u=e.getStyle(r[l],n);if(c(o)&&(o=u),o!==u)return""}return o},wt=function(e,t,n){vt.each("left center right".split(" "),(function(o){o!==n&&e.formatter.remove("align"+o,{},t)})),n&&e.formatter.apply("align"+n,{},t)},St=function(e,t,o){e.dispatch("TableModified",n(n({},o),{table:t}))},Ct=function(e,t){return(n=e,o=parseFloat(n),isNaN(o)?S.none():S.some(o)).getOr(t);var n,o},Tt=function(e,t,n){return Ct(Ge(e,t),n)},xt=function(e,t){var n=e.dom,o=n.getBoundingClientRect().width||n.offsetWidth;return"border-box"===t?o:function(e,t,n,o){return t-Tt(e,"padding-".concat(n),0)-Tt(e,"padding-".concat(o),0)-Tt(e,"border-".concat(n,"-width"),0)-Tt(e,"border-".concat(o,"-width"),0)}(e,o,"left","right")},At=function(e){return xt(e,"content-box")},Rt=tinymce.util.Tools.resolve("tinymce.Env"),_t=E(5,(function(e){var t="".concat(e+1,"px");return{title:t,value:t}})),Ot=B(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],(function(e){return{title:e,value:e.toLowerCase()}})),Dt="100%",Nt=function(e){var t,n=e.dom,o=null!==(t=n.getParent(e.selection.getStart(),n.isBlock))&&void 0!==t?t:e.getBody();return At(U.fromDom(o))+"px"},It=function(e){return function(t){return t.options.get(e)}},Mt=It("table_sizing_mode"),Pt=It("table_border_widths"),kt=It("table_border_styles"),Et=It("table_cell_advtab"),Bt=It("table_row_advtab"),Ft=It("table_advtab"),qt=It("table_appearance_options"),jt=It("table_grid"),Lt=It("table_style_by_css"),Ht=It("table_cell_class_list"),Vt=It("table_row_class_list"),Wt=It("table_class_list"),zt=It("table_toolbar"),$t=It("table_background_color_map"),Ut=It("table_border_color_map"),Gt=function(e){return"fixed"===Mt(e)},Kt=function(e){return"responsive"===Mt(e)},Jt=function(e){var t=e.options,o=t.get("table_default_styles");return t.isSet("table_default_styles")?o:function(e,t){return Kt(e)||!Lt(e)?t:Gt(e)?n(n({},t),{width:Nt(e)}):n(n({},t),{width:Dt})}(e,o)},Qt=function(e){var t=e.options,o=t.get("table_default_attributes");return t.isSet("table_default_attributes")?o:function(e,t){return Kt(e)||Lt(e)?t:Gt(e)?n(n({},t),{width:Nt(e)}):n(n({},t),{width:Dt})}(e,o)},Xt=function(e,t){return t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow},Yt=function(e,t,n){var o=bt(e,t,J),r=bt(e,n,J);return o.bind((function(e){return r.map((function(t){return n=e,o=t,r=Math.min(n.row,o.row),l=Math.min(n.column,o.column),u=Math.max(n.row+n.rowspan-1,o.row+o.rowspan-1),a=Math.max(n.column+n.colspan-1,o.column+o.colspan-1),{startRow:r,startCol:l,finishRow:u,finishCol:a};var n,o,r,l,u,a}))}))},Zt=function(e,t,n){return Yt(e,t,n).bind((function(t){return function(e,t){for(var n=!0,o=h(Xt,t),r=t.startRow;r<=t.finishRow;r++)for(var l=t.startCol;l<=t.finishCol;l++)n=n&&pt(e,r,l).exists(o);return n?S.some(t):S.none()}(e,t)}))},en=dt,tn=function(e,t){ie(e).each((function(n){n.dom.insertBefore(t.dom,e.dom)}))},nn=function(e,t){fe(e).fold((function(){ie(e).each((function(e){rn(e,t)}))}),(function(e){tn(e,t)}))},on=function(e,t){de(e).fold((function(){rn(e,t)}),(function(n){e.dom.insertBefore(t.dom,n.dom)}))},rn=function(e,t){e.dom.appendChild(t.dom)},ln=function(e,t){tn(e,t),rn(t,e)},un=function(e,t){F(t,(function(n,o){var r=0===o?e:t[o-1];nn(r,n)}))},an=function(e,t){F(t,(function(t){rn(e,t)}))},cn=function(e){var t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},sn=function(e){var t=me(e);t.length>0&&un(e,t),cn(e)},fn=function(e,t){var n=function(t){return e(t)?S.from(t.dom.nodeValue):S.none()};return{get:function(o){if(!e(o))throw new Error("Can only get "+t+" value of a "+t+" node");return n(o).getOr("")},getOption:n,set:function(n,o){if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom.nodeValue=o}}}(oe,"text"),mn=function(e){return fn.get(e)},dn=function(e,t){return fn.set(e,t)},pn=["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"],bn=function(e,t,n,o){var r,l,u=t(e,n);return r=function(n,o){var r=t(e,o);return gn(e,n,r)},l=u,function(e,t){for(var n=e.length-1;n>=0;n--)t(e[n],n)}(o,(function(e,t){l=r(l,e,t)})),l},gn=function(e,t,n){return t.bind((function(t){return n.filter(h(e.eq,t))}))},hn=function(e,t,n){return n.length>0?function(e,t,n,o){return o(e,t,n[0],n.slice(1))}(e,t,n,bn):S.none()},vn={up:p({selector:Se,closest:xe,predicate:we,all:ce}),down:p({selector:Pe,predicate:Ie}),styles:p({get:Ge,getRaw:Je,set:Ue,remove:Qe}),attrs:p({get:Be,set:Ee,remove:qe,copyTo:function(e,t){!function(e,t){var n=e.dom;x(t,(function(e,t){ke(n,t,e)}))}(t,j(e.dom.attributes,(function(e,t){return e[t.name]=t.value,e}),{}))}}),insert:p({before:tn,after:nn,afterAll:un,append:rn,appendAll:an,prepend:on,wrap:ln}),remove:p({unwrap:sn,remove:cn}),create:p({nu:U.fromTag,clone:function(e){return U.fromDom(e.dom.cloneNode(!1))},text:U.fromText}),query:p({comparePosition:function(e,t){return e.dom.compareDocumentPosition(t.dom)},prevSibling:se,nextSibling:fe}),property:p({children:me,name:Y,parent:ie,document:function(e){return ae(e).dom},isText:oe,isComment:te,isElement:ne,isSpecial:function(e){var t=Y(e);return P(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},getLanguage:function(e){return ne(e)?Fe(e,"lang"):S.none()},getText:mn,setText:dn,isBoundary:function(e){return!!ne(e)&&("body"===Y(e)||P(pn,Y(e)))},isEmptyTag:function(e){return!!ne(e)&&P(["br","img","hr","input"],Y(e))},isNonEditable:function(e){return ne(e)&&"false"===Be(e,"contenteditable")}}),eq:J,is:Q},yn=function(e){return Se(e,"table")},wn=function(e,t,n){return Te(e,t).bind((function(t){return Te(e,n).bind((function(e){return(n=yn,o=[t,e],hn(vn,(function(e,t){return n(t)}),o)).map((function(n){return{first:t,last:e,table:n}}));var n,o}))}))},Sn=function(e,t){return function(e,t){var n=Pe(e,t);return n.length>0?S.some(n):S.none()}(e,t)},Cn=function(e,t,n){return wn(e,t,n).bind((function(t){var n=function(t){return J(e,t)},o="thead,tfoot,tbody,table",r=Se(t.first,o,n),l=Se(t.last,o,n);return r.bind((function(e){return l.bind((function(n){return J(e,n)?function(e,t,n){var o=en(e);return Zt(o,t,n)}(t.table,t.first,t.last):S.none()}))}))}))},Tn=function(e){return B(e,U.fromDom)},xn="data-mce-selected",An="data-mce-first-selected",Rn="data-mce-last-selected",_n={selected:xn,selectedSelector:"td["+xn+"],th["+xn+"]",firstSelected:An,firstSelectedSelector:"td["+An+"],th["+An+"]",lastSelected:Rn,lastSelectedSelector:"td["+Rn+"],th["+Rn+"]"},On=function(e){return function(t,n){var o,r=Y(t),l="col"===r||"colgroup"===r?rt(o=t).bind((function(e){return Sn(e,_n.firstSelectedSelector)})).fold(p(o),(function(e){return e[0]})):t;return xe(l,e,n)}},Dn=On("th,td,caption"),Nn=On("th,td"),In=function(e){return Tn(e.model.table.getSelectedCells())},Mn=function(e,t){var n=Nn(e),o=n.bind((function(e){return rt(e)})).map((function(e){return lt(e)}));return Le(n,o,(function(e,n){return q(n,(function(n){return k(Tn(n.dom.cells),(function(n){return"1"===Be(n,t)||J(n,e)}))}))})).getOr([])},Pn=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],kn=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,En=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Bn=function(e){return(t=e,n="#",He(t,n)?function(e,t){return e.substring(t)}(t,n.length):t).toUpperCase();var t,n},Fn=function(e){return function(e){return kn.test(e)||En.test(e)}(e)?S.some({value:Bn(e)}):S.none()},qn=function(e){var t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},jn=function(e){return function(e){return{value:Bn(e)}}(qn(e.red)+qn(e.green)+qn(e.blue))},Ln=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,Hn=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,Vn=function(e,t,n,o){return{red:e,green:t,blue:n,alpha:o}},Wn=function(e,t,n,o){var r=parseInt(e,10),l=parseInt(t,10),u=parseInt(n,10),a=parseFloat(o);return Vn(r,l,u,a)},zn=function(e){if("transparent"===e)return S.some(Vn(0,0,0,0));var t=Ln.exec(e);if(null!==t)return S.some(Wn(t[1],t[2],t[3],"1"));var n=Hn.exec(e);return null!==n?S.some(Wn(n[1],n[2],n[3],n[4])):S.none()},$n=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},Un=function(){return e=function(e){return e.unbind()},t=$n(S.none()),n=function(){return t.get().each(e)},{clear:function(){n(),t.set(S.none())},isSet:function(){return t.get().isSome()},get:function(){return t.get()},set:function(e){n(),t.set(S.some(e))}};var e,t,n},Gn=function(e,t,n){return function(o){var r=Un(),l=!We(n),u=function(){var u=In(e),a=function(o){return e.formatter.match(t,{value:n},o.dom,l)};l?(o.setActive(!k(u,a)),r.set(e.formatter.formatChanged(t,(function(e){return o.setActive(!e)}),!0))):(o.setActive(V(u,a)),r.set(e.formatter.formatChanged(t,o.setActive,!1,{value:n})))};return e.initialized?u():e.on("init",u),r.clear}},Kn=function(e){return N(e,"menu")},Jn=function(e){return B(e,(function(e){var t=e.text||e.title||"";return Kn(e)?{text:t,items:Jn(e.menu)}:{text:t,value:e.value}}))},Qn=function(e,t,n,o){return B(t,(function(t){var r=t.text||t.title;return Kn(t)?{type:"nestedmenuitem",text:r,getSubmenuItems:function(){return Qn(e,t.menu,n,o)}}:{text:r,type:"togglemenuitem",onAction:function(){return o(t.value)},onSetup:Gn(e,n,t.value)}}))},Xn=function(e,t){return function(n){var o;e.execCommand("mceTableApplyCellStyle",!1,((o={})[t]=n,o))}},Yn=function(e){return H(e,(function(e){return Kn(e)?[n(n({},e),{menu:Yn(e.menu)})]:We(e.value)?[e]:[]}))},Zn=function(e,t,n,o){return function(r){return r(Qn(e,t,n,o))}},eo=function(e,t,n){var o=B(t,(function(e){return{text:e.title,value:"#"+(t=e.value,Fn(t).orThunk((function(){return zn(t).map(jn)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var o=n.getImageData(0,0,1,1).data,r=o[0],l=o[1],u=o[2],a=o[3];return jn(Vn(r,l,u,a))}))).value,type:"choiceitem"};var t}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:o.length>0?o:void 0,allowCustomColors:!1},onAction:function(t){var o,r="remove"===t.value?"":t.value;e.execCommand("mceTableApplyCellStyle",!1,((o={})[n]=r,o))}}]},to=function(e){return function(){var t="header"===e.queryCommandValue("mceTableRowType")?"body":"header";e.execCommand("mceTableRowType",!1,{type:t})}},no=function(e){return function(){var t="th"===e.queryCommandValue("mceTableColType")?"td":"th";e.execCommand("mceTableColType",!1,{type:t})}},oo=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",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:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:Pn}],ro=function(e){return oo.concat(function(e){var t=Jn(Ht(e));return t.length>0?S.some({name:"class",type:"listbox",label:"Class",items:t}):S.none()}(e).toArray())},lo=function(e,t){var n=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(Jn(kt(e)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:"cell"===t?[{name:"borderwidth",type:"input",label:"Border width"}].concat(n):n}},uo=function(e,t){var n=e.dom;return{setAttrib:function(e,o){n.setAttrib(t,e,o)},setStyle:function(e,o){n.setStyle(t,e,o)},setFormat:function(n,o){""===o?e.formatter.remove(n,{value:null},t,!0):e.formatter.apply(n,{value:o},t)}}},ao=ue("th"),io=function(e,t){return e&&t?"sectionCells":e?"section":"cells"},co=function(e){var t=q(e,(function(e){return ao(e.element)}));return 0===t.length?S.some("td"):t.length===e.length?S.some("th"):S.none()},so=function(e){var t=B(e,(function(e){return function(e){var t="thead"===e.section,n=je(co(e.cells),"th");return"tfoot"===e.section?{type:"footer"}:t||n?{type:"header",subType:io(t,n)}:{type:"body"}}(e).type})),n=P(t,"header"),o=P(t,"footer");if(n||o){var r=P(t,"body");return!n||r||o?n||r||!o?S.none():S.some("footer"):S.some("header")}return S.some("body")},fo=function(e,t){return z(e.all,(function(e){return L(e.cells,(function(e){return J(t,e.element)}))}))},mo=function(e,t,n){var o,r,l=function(e){for(var t=[],n=function(e){t.push(e)},o=0;o<e.length;o++)e[o].each(n);return t}(B(t.selection,(function(t){return ot(t).bind((function(t){return fo(e,t)})).filter(n)})));return o=l.length>0,r=l,o?S.some(r):S.none()},po=function(e,t){return mo(e,t,w)},bo=function(e,t){return V(t,(function(t){return function(e,t){return fo(e,t).exists((function(e){return!e.isLocked}))}(e,t)}))},go=function(e,t){return function(e,t){return t.mergable}(0,t).filter((function(t){return bo(e,t.cells)}))},ho=function(e,t){return function(e,t){return t.unmergable}(0,t).filter((function(t){return bo(e,t)}))},vo=function(e){if(!a(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var t=[],n={};return F(e,(function(o,r){var l=C(o);if(1!==l.length)throw new Error("one and only one name per case");var u=l[0],i=o[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!a(i))throw new Error("case arguments must be an array");t.push(u),n[u]=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var l=n.length;if(l!==i.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+i.length+" ("+i+"), got "+l);return{fold:function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,n)},match:function(e){var o=C(e);if(t.length!==o.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+o.join(","));if(!V(t,(function(e){return P(o,e)})))throw new Error("Not all branches were specified when using match. Specified: "+o.join(", ")+"\nRequired: "+t.join(", "));return e[u].apply(null,n)},log:function(e){console.log(e,{constructors:t,constructor:u,params:n})}}}})),n},yo=vo([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]);n({},yo);var wo=function(e,t){var n=dt(e);return po(n,t).bind((function(e){var t=e[e.length-1],o=e[0].row,r=t.row+t.rowspan,l=n.all.slice(o,r);return so(l)})).getOr("")},So=function(e){return He(e,"rgb")?zn(t=e).map(jn).map((function(e){return"#"+e.value})).getOr(t):e;var t},Co=function(e){var t=U.fromDom(e);return{borderwidth:Je(t,"border-width").getOr(""),borderstyle:Je(t,"border-style").getOr(""),bordercolor:Je(t,"border-color").map(So).getOr(""),backgroundcolor:Je(t,"background-color").map(So).getOr("")}},To=function(e){var t=e[0],n=e.slice(1);return F(n,(function(e){F(C(t),(function(n){x(e,(function(e,o){var r=t[n];""!==r&&n===o&&r!==e&&(t[n]="")}))}))})),t},xo=function(e,t,n,o){return L(e,(function(e){return!c(n.formatter.matchNode(o,t+e))})).getOr("")},Ao=h(xo,["left","center","right"],"align"),Ro=h(xo,["top","middle","bottom"],"valign"),_o=function(e){return rt(U.fromDom(e)).map((function(t){var n={selection:Tn(e.cells)};return wo(t,n)})).getOr("")},Oo=function(e,t){var n=dt(e),o=gt(n),r=q(o,(function(e){return k(t,(function(t){return J(e.element,t)}))}));return B(r,(function(e){return{element:e.element.dom,column:ht(n,e.column).map((function(e){return e.element.dom}))}}))},Do=function(e,t,n,o){var r=1===t.length;F(t,(function(t){var l=t.element,u=r?w:o,a=uo(e,l);!function(e,t,n,o){o("scope")&&e.setAttrib("scope",n.scope),o("class")&&e.setAttrib("class",n.class),o("height")&&e.setStyle("height",Oe(n.height)),o("width")&&t.setStyle("width",Oe(n.width))}(a,t.column.map((function(t){return uo(e,t)})).getOr(a),n,u),Et(e)&&function(e,t,n){n("backgroundcolor")&&e.setFormat("tablecellbackgroundcolor",t.backgroundcolor),n("bordercolor")&&e.setFormat("tablecellbordercolor",t.bordercolor),n("borderstyle")&&e.setFormat("tablecellborderstyle",t.borderstyle),n("borderwidth")&&e.setFormat("tablecellborderwidth",Oe(t.borderwidth))}(a,n,u),o("halign")&&wt(e,l,n.halign),o("valign")&&function(e,t,n){vt.each("top middle bottom".split(" "),(function(o){o!==n&&e.formatter.remove("valign"+o,{},t)})),n&&e.formatter.apply("valign"+n,{},t)}(e,l,n.valign)}))},No=function(e,t,n,o){var r=o.getData();o.close(),e.undoManager.transact((function(){!function(e,t,n,o){var r=A(o,(function(e,t){return n[t]!==e}));_(r)>0&&t.length>=1&&rt(t[0]).each((function(n){var l=Oo(n,t),u=_(A(r,(function(e,t){return"scope"!==t&&"celltype"!==t})))>0,a=D(r,"celltype");(u||D(r,"scope"))&&Do(e,l,o,h(D,r)),a&&function(e,t){e.execCommand("mceTableCellType",!1,{type:t.celltype,no_events:!0})}(e,o),St(e,n.dom,{structure:a,style:u})}))}(e,t,n,r),e.focus()}))},Io=function(e,t){var o=rt(t[0]).map((function(o){return B(Oo(o,t),(function(t){return function(e,t,o,r){var l,u=e.dom,a=r.getOr(t),i=function(e,t){return u.getStyle(e,t)||u.getAttrib(e,t)};return n({width:i(a,"width"),height:i(t,"height"),scope:u.getAttrib(t,"scope"),celltype:(l=t,l.nodeName.toLowerCase()),class:u.getAttrib(t,"class",""),halign:Ao(e,t),valign:Ro(e,t)},o?Co(t):{})}(e,t.element,Et(e),t.column)}))}));return To(o.getOrDie())},Mo=function(e){var t=In(e);if(0!==t.length){var n=Io(e,t),o={type:"tabpanel",tabs:[{title:"General",name:"general",items:ro(e)},lo(e,"cell")]},r={type:"panel",items:[{type:"grid",columns:2,items:ro(e)}]};e.windowManager.open({title:"Cell Properties",size:"normal",body:Et(e)?o:r,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:n,onSubmit:h(No,e,t,n)})}},Po=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",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"}],ko=function(e){return Po.concat(function(e){var t=Jn(Vt(e));return t.length>0?S.some({name:"class",type:"listbox",label:"Class",items:t}):S.none()}(e).toArray())},Eo=function(e,t,n,o){var r=1===t.length?w:o;F(t,(function(t){var l=uo(e,t);!function(e,t,n){n("class")&&e.setAttrib("class",t.class),n("height")&&e.setStyle("height",Oe(t.height))}(l,n,r),Bt(e)&&function(e,t,n){n("backgroundcolor")&&e.setStyle("background-color",t.backgroundcolor),n("bordercolor")&&e.setStyle("border-color",t.bordercolor),n("borderstyle")&&e.setStyle("border-style",t.borderstyle)}(l,n,r),o("align")&&wt(e,t,n.align)}))},Bo=function(e,t,n,o){var r=o.getData();o.close(),e.undoManager.transact((function(){!function(e,t,n,o){var r=A(o,(function(e,t){return n[t]!==e}));if(_(r)>0){var l=D(r,"type"),u=!l||_(r)>1;u&&Eo(e,t,o,h(D,r)),l&&function(e,t){e.execCommand("mceTableRowType",!1,{type:t.type,no_events:!0})}(e,o),rt(U.fromDom(t[0])).each((function(t){return St(e,t.dom,{structure:l,style:u})}))}}(e,t,n,r),e.focus()}))},Fo=function(e){var t=Mn(De(e),_n.selected);if(0!==t.length){var o=B(t,(function(t){return function(e,t,o){var r=e.dom;return n({height:r.getStyle(t,"height")||r.getAttrib(t,"height"),class:r.getAttrib(t,"class",""),type:_o(t),align:Ao(e,t)},o?Co(t):{})}(e,t.dom,Bt(e))})),r=To(o),l={type:"tabpanel",tabs:[{title:"General",name:"general",items:ko(e)},lo(e,"row")]},u={type:"panel",items:[{type:"grid",columns:2,items:ko(e)}]};e.windowManager.open({title:"Row Properties",size:"normal",body:Bt(e)?l:u,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onSubmit:h(Bo,e,B(t,(function(e){return e.dom})),r)})}},qo=function(e,t,n){var o=n?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],r=qt(e)?[{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"}]}]:[],l=t.length>0?[{type:"listbox",name:"class",label:"Class",items:t}]:[];return o.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(r).concat([{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(l)},jo=function(e,t,n,o){if("TD"===t.tagName||"TH"===t.tagName)u(n)&&s(o)?e.setStyle(t,n,o):e.setStyles(t,n);else if(t.children)for(var r=0;r<t.children.length;r++)jo(e,t.children[r],n,o)},Lo=function(e,t,o,r){var l=e.dom,u={},a={},i=Lt(e),s=Ft(e);if(c(o.class)||(u.class=o.class),a.height=Oe(o.height),i?a.width=Oe(o.width):l.getAttrib(t,"width")&&(u.width=function(e){return e?e.replace(/px$/,""):""}(o.width)),i?(a["border-width"]=Oe(o.border),a["border-spacing"]=Oe(o.cellspacing)):(u.border=o.border,u.cellpadding=o.cellpadding,u.cellspacing=o.cellspacing),i&&t.children){var f={};if(r.border&&(f["border-width"]=Oe(o.border)),r.cellpadding&&(f.padding=Oe(o.cellpadding)),s&&r.bordercolor&&(f["border-color"]=o.bordercolor),!function(e){for(var t in e)if(T.call(e,t))return!1;return!0}(f))for(var m=0;m<t.children.length;m++)jo(l,t.children[m],f)}if(s){var d=o;a["background-color"]=d.backgroundcolor,a["border-color"]=d.bordercolor,a["border-style"]=d.borderstyle}l.setStyles(t,n(n({},Jt(e)),a)),l.setAttribs(t,n(n({},Qt(e)),u))},Ho=function(e,t,n,o){var r=e.dom,l=o.getData(),u=A(l,(function(e,t){return n[t]!==e}));o.close(),""===l.class&&delete l.class,e.undoManager.transact((function(){if(!t){var n=ze(l.cols).getOr(1),o=ze(l.rows).getOr(1);e.execCommand("mceInsertTable",!1,{rows:o,columns:n}),t=Nn(De(e),_e(e)).bind((function(t){return rt(t,_e(e))})).map((function(e){return e.dom})).getOrDie()}if(_(u)>0){var a={border:D(u,"border"),bordercolor:D(u,"bordercolor"),cellpadding:D(u,"cellpadding")};Lo(e,t,l,a);var i=r.select("caption",t)[0];(i&&!l.caption||!i&&l.caption)&&e.execCommand("mceTableToggleCaption"),wt(e,t,l.align)}if(e.focus(),e.addVisual(),_(u)>0){var c=D(u,"caption"),s=!c||_(u)>1;St(e,t,{structure:c,style:s})}}))},Vo=function(e,t){var o,r=e.dom,l=function(e,t){var o,r,l,u=Jt(e),a=Qt(e),i=t?{borderstyle:O(u,"border-style").getOr(""),bordercolor:So(O(u,"border-color").getOr("")),backgroundcolor:So(O(u,"background-color").getOr(""))}:{};return n(n(n(n(n(n({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""}),u),a),i),(l=u["border-width"],Lt(e)&&l?{border:l}:O(a,"border").fold((function(){return{}}),(function(e){return{border:e}})))),(o=O(u,"border-spacing").or(O(a,"cellspacing")).fold((function(){return{}}),(function(e){return{cellspacing:e}})),r=O(u,"border-padding").or(O(a,"cellpadding")).fold((function(){return{}}),(function(e){return{cellpadding:e}})),n(n({},o),r)))}(e,Ft(e));t?(l.cols="1",l.rows="1",Ft(e)&&(l.borderstyle="",l.bordercolor="",l.backgroundcolor="")):(o=r.getParent(e.selection.getStart(),"table",e.getBody()))?l=function(e,t,o){var r=e.dom,l=Lt(e)?r.getStyle(t,"border-spacing")||r.getAttrib(t,"cellspacing"):r.getAttrib(t,"cellspacing")||r.getStyle(t,"border-spacing"),u=Lt(e)?yt(r,t,"padding")||r.getAttrib(t,"cellpadding"):r.getAttrib(t,"cellpadding")||yt(r,t,"padding");return n({width:r.getStyle(t,"width")||r.getAttrib(t,"width"),height:r.getStyle(t,"height")||r.getAttrib(t,"height"),cellspacing:null!=l?l:"",cellpadding:null!=u?u:"",border:function(t,n){var o=Je(U.fromDom(n),"border-width");return Lt(e)&&o.isSome()?o.getOr(""):t.getAttrib(n,"border")||yt(e.dom,n,"border-width")||yt(e.dom,n,"border")||""}(r,t),caption:!!r.select("caption",t)[0],class:r.getAttrib(t,"class",""),align:Ao(e,t)},o?Co(t):{})}(e,o,Ft(e)):Ft(e)&&(l.borderstyle="",l.bordercolor="",l.backgroundcolor="");var u=Jn(Wt(e));u.length>0&&l.class&&(l.class=l.class.replace(/\s*mce\-item\-table\s*/g,""));var a={type:"grid",columns:2,items:qo(e,u,t)},i=Ft(e)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[a]},lo(e,"table")]}:{type:"panel",items:[a]};e.windowManager.open({title:"Table Properties",size:"normal",body:i,onSubmit:h(Ho,e,o,l),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:l})},Wo=function(e){x({mceTableProps:h(Vo,e,!1),mceTableRowProps:h(Fo,e),mceTableCellProps:h(Mo,e),mceInsertTableDialog:h(Vo,e,!0)},(function(t,n){return e.addCommand(n,(function(){return n=t,void(Ne(De(e))&&n());var n}))}))},zo=b,$o=function(e){var t=function(e,t){return Fe(e,t).exists((function(e){return parseInt(e,10)>1}))};return e.length>0&&V(e,(function(e){return t(e,"rowspan")||t(e,"colspan")}))?S.some(e):S.none()},Uo=function(e,t,n){return t.length<=1?S.none():Cn(e,n.firstSelectedSelector,n.lastSelectedSelector).map((function(e){return{bounds:e,cells:t}}))},Go=function(e){var t=$n(S.none()),n=$n([]),o=S.none(),r=ue("caption"),l=function(e){return o.forall((function(t){return!t[e]}))},u=function(){return Dn(function(e){return U.fromDom(e.selection.getEnd())}(e),_e(e))},a=function(){return Dn(De(e),_e(e)).bind((function(t){return n=Le(rt(t),u().bind(rt),(function(n,o){return J(n,o)?r(t)?S.some(function(e){return{element:e,mergable:S.none(),unmergable:S.none(),selection:[e]}}(t)):S.some(function(e,t,n){return{element:n,mergable:Uo(t,e,_n),unmergable:$o(e),selection:zo(e)}}(In(e),n,t)):S.none()})),n.bind(b);var n}))},i=function(e){return rt(e.element).map((function(t){var n=dt(t),o=po(n,e).getOr([]),r=j(o,(function(e,t){return t.isLocked&&(e.onAny=!0,0===t.column?e.onFirst=!0:t.column+t.colspan>=n.grid.columns&&(e.onLast=!0)),e}),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:go(n,e).isSome(),unmergeable:ho(n,e).isSome(),locked:r}}))},c=function(){t.set(function(e){var t,n=!1;return function(){for(var o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];return n||(n=!0,t=e.apply(null,o)),t}}(a)()),o=t.get().bind(i),F(n.get(),v)},s=function(e){return e(),n.set(n.get().concat([e])),function(){n.set(q(n.get(),(function(t){return t!==e})))}},f=function(n,o){return s((function(){return t.get().fold((function(){n.setEnabled(!1)}),(function(t){n.setEnabled(!o(t)&&e.selection.isEditable())}))}))},m=function(n,o,r){return s((function(){return t.get().fold((function(){n.setEnabled(!1),n.setActive(!1)}),(function(t){n.setEnabled(!o(t)&&e.selection.isEditable()),n.setActive(r(t))}))}))},d=function(e){return o.exists((function(t){return t.locked[e]}))},p=function(t,n){return function(o){return m(o,(function(e){return r(e.element)}),(function(){return e.queryCommandValue(t)===n}))}},g=p("mceTableRowType","header"),h=p("mceTableColType","th");return e.on("NodeChange ExecCommand TableSelectorChange",c),{onSetupTable:function(e){return f(e,(function(e){return!1}))},onSetupCellOrRow:function(e){return f(e,(function(e){return r(e.element)}))},onSetupColumn:function(e){return function(t){return f(t,(function(t){return r(t.element)||d(e)}))}},onSetupPasteable:function(e){return function(t){return f(t,(function(t){return r(t.element)||e().isNone()}))}},onSetupPasteableColumn:function(e,t){return function(n){return f(n,(function(n){return r(n.element)||e().isNone()||d(t)}))}},onSetupMergeable:function(e){return f(e,(function(e){return l("mergeable")}))},onSetupUnmergeable:function(e){return f(e,(function(e){return l("unmergeable")}))},resetTargets:c,onSetupTableWithCaption:function(t){return m(t,y,(function(t){return rt(t.element,_e(e)).exists((function(e){return Ce(e,"caption").isSome()}))}))},onSetupTableRowHeaders:g,onSetupTableColumnHeaders:h,targets:t.get}},Ko=tinymce.util.Tools.resolve("tinymce.FakeClipboard"),Jo="x-tinymce/dom-table-",Qo=Jo+"rows",Xo=Jo+"columns",Yo=function(e){var t,n=null!==(t=Ko.read())&&void 0!==t?t:[];return z(n,(function(t){return S.from(t.getType(e))}))},Zo=function(){return Yo(Qo)},er=function(){return Yo(Xo)},tr=function(e){return function(t){var n=function(){t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",n),n(),function(){e.off("NodeChange",n)}}},nr=function(e){return function(t){var n=function(){t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",n),n(),function(){e.off("NodeChange",n)}}},or=function(e){var t=Go(e);!function(e){var t=e.options.register;t("table_border_widths",{processor:"object[]",default:_t}),t("table_border_styles",{processor:"object[]",default:Ot}),t("table_cell_advtab",{processor:"boolean",default:!0}),t("table_row_advtab",{processor:"boolean",default:!0}),t("table_advtab",{processor:"boolean",default:!0}),t("table_appearance_options",{processor:"boolean",default:!0}),t("table_grid",{processor:"boolean",default:!Rt.deviceType.isTouch()}),t("table_cell_class_list",{processor:"object[]",default:[]}),t("table_row_class_list",{processor:"object[]",default:[]}),t("table_class_list",{processor:"object[]",default:[]}),t("table_toolbar",{processor:"string",default:"tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol"}),t("table_background_color_map",{processor:"object[]",default:[]}),t("table_border_color_map",{processor:"object[]",default:[]})}(e),Wo(e),function(e,t){var o=function(t){return function(){return e.execCommand(t)}},r=function(t,r){return!!e.queryCommandSupported(r.command)&&(e.ui.registry.addMenuItem(t,n(n({},r),{onAction:f(r.onAction)?r.onAction:o(r.command)})),!0)},l=function(t,r){e.queryCommandSupported(r.command)&&e.ui.registry.addToggleMenuItem(t,n(n({},r),{onAction:f(r.onAction)?r.onAction:o(r.command)}))},u=function(t){e.execCommand("mceInsertTable",!1,{rows:t.numRows,columns:t.numColumns})},a=[r("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:t.onSetupCellOrRow}),r("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:t.onSetupCellOrRow}),r("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:t.onSetupCellOrRow}),r("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:t.onSetupCellOrRow}),r("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:t.onSetupCellOrRow}),r("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:t.onSetupCellOrRow}),r("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:t.onSetupPasteable(Zo)}),r("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:t.onSetupPasteable(Zo)})],i=[r("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:t.onSetupColumn("onFirst")}),r("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:t.onSetupColumn("onLast")}),r("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:t.onSetupColumn("onAny")}),r("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:t.onSetupColumn("onAny")}),r("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:t.onSetupColumn("onAny")}),r("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:t.onSetupPasteableColumn(er,"onFirst")}),r("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:t.onSetupPasteableColumn(er,"onLast")})],c=[r("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:t.onSetupCellOrRow}),r("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:t.onSetupMergeable}),r("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:t.onSetupUnmergeable})];jt(e)?e.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:u}]},onSetup:nr(e)}):e.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTableDialog"),onSetup:nr(e)}),e.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTableDialog"),onSetup:nr(e)}),r("tableprops",{text:"Table properties",onSetup:t.onSetupTable,command:"mceTableProps"}),r("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:t.onSetupTable,command:"mceTableDelete"}),P(a,!0)&&e.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:p("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),P(i,!0)&&e.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:p("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),P(c,!0)&&e.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:p("tablecellprops tablemergecells tablesplitcells")}),e.ui.registry.addContextMenu("table",{update:function(){return t.resetTargets(),t.targets().fold(p(""),(function(e){return"caption"===Y(e.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"}))}});var s=Yn(Wt(e));0!==s.length&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:function(){return Qn(e,s,"tableclass",(function(t){return e.execCommand("mceTableToggleClass",!1,t)}))},onSetup:t.onSetupTable});var m=Yn(Ht(e));0!==m.length&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:function(){return Qn(e,m,"tablecellclass",(function(t){return e.execCommand("mceTableCellToggleClass",!1,t)}))},onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:function(){return Qn(e,Pn,"tablecellverticalalign",Xn(e,"vertical-align"))},onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:function(){return Qn(e,Pt(e),"tablecellborderwidth",Xn(e,"border-width"))},onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:function(){return Qn(e,kt(e),"tablecellborderstyle",Xn(e,"border-style"))},onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:function(){return eo(e,$t(e),"background-color")},onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:function(){return eo(e,Ut(e),"border-color")},onSetup:t.onSetupCellOrRow})),l("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),l("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:to(e),onSetup:t.onSetupTableRowHeaders}),l("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:no(e),onSetup:t.onSetupTableRowHeaders})}(e,t),function(e,t){e.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:tr(e),fetch:function(e){return e("inserttable | cell row column | advtablesort | tableprops deletetable")}});var o=function(t){return function(){return e.execCommand(t)}},r=function(t,r){e.queryCommandSupported(r.command)&&e.ui.registry.addButton(t,n(n({},r),{onAction:f(r.onAction)?r.onAction:o(r.command)}))},l=function(t,r){e.queryCommandSupported(r.command)&&e.ui.registry.addToggleButton(t,n(n({},r),{onAction:f(r.onAction)?r.onAction:o(r.command)}))};r("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:t.onSetupTable}),r("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:t.onSetupTable}),r("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:t.onSetupCellOrRow}),r("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:t.onSetupMergeable}),r("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:t.onSetupUnmergeable}),r("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:t.onSetupCellOrRow}),r("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:t.onSetupCellOrRow}),r("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:t.onSetupCellOrRow}),r("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:t.onSetupCellOrRow}),r("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:t.onSetupColumn("onFirst")}),r("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:t.onSetupColumn("onLast")}),r("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:t.onSetupColumn("onAny")}),r("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:t.onSetupCellOrRow}),r("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:t.onSetupCellOrRow}),r("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:t.onSetupPasteable(Zo)}),r("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:t.onSetupPasteable(Zo)}),r("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:t.onSetupColumn("onAny")}),r("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:t.onSetupColumn("onAny")}),r("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:t.onSetupPasteableColumn(er,"onFirst")}),r("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:t.onSetupPasteableColumn(er,"onLast")}),r("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:tr(e)});var u=Yn(Wt(e));0!==u.length&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Zn(e,u,"tableclass",(function(t){return e.execCommand("mceTableToggleClass",!1,t)})),onSetup:t.onSetupTable});var a=Yn(Ht(e));0!==a.length&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Zn(e,a,"tablecellclass",(function(t){return e.execCommand("mceTableCellToggleClass",!1,t)})),onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Zn(e,Pn,"tablecellverticalalign",Xn(e,"vertical-align")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Zn(e,Pt(e),"tablecellborderwidth",Xn(e,"border-width")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Zn(e,kt(e),"tablecellborderstyle",Xn(e,"border-style")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:function(t){return t(eo(e,$t(e),"background-color"))},onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:function(t){return t(eo(e,Ut(e),"border-color"))},onSetup:t.onSetupCellOrRow})),l("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),l("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:to(e),onSetup:t.onSetupTableRowHeaders}),l("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:no(e),onSetup:t.onSetupTableColumnHeaders})}(e,t),function(e){var t=zt(e);t.length>0&&e.ui.registry.addContextToolbar("table",{predicate:function(t){return e.dom.is(t,"table")&&e.getBody().contains(t)&&e.dom.isEditable(t.parentNode)},items:t,scope:"node",position:"node"})}(e)};t.add("table",or)}(),e}export{n as __require};
2
2
  //# sourceMappingURL=plugin.mjs.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lotte-innovate/ui-component-test",
3
3
  "description": "Lotte UI Library",
4
- "version": "0.0.114",
4
+ "version": "0.0.115",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "files": [