opentiny 6.9.11 → 6.9.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opentiny",
3
- "version": "6.9.11",
3
+ "version": "6.9.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mild-blue/opentiny"
@@ -98,12 +98,18 @@
98
98
  size: 'normal',
99
99
  body: {
100
100
  type: 'panel',
101
- items: [{
101
+ items: [
102
+ {
103
+ type: 'htmlpanel',
104
+ html: '<p style="font-size: 14px; margin-bottom: 10px;">The anchor tool is used to create a link that allows the user to jump to a specific part of the document marked by the anchor. For example, you can link to an image or a specific section of text (e.g., a heading or a paragraph)<br><br>Enter an anchor identifier in the "ID" field (e.g., "anchor1") > click Save > Insert > Link > select the anchor in the "Anchors" field > the "Link URL" and "Link Text" fields will auto-fill > adjust the "Link Title" as needed.</p>'
105
+ },
106
+ {
102
107
  name: 'id',
103
108
  type: 'input',
104
109
  label: 'ID',
105
110
  placeholder: 'example'
106
- }]
111
+ }
112
+ ]
107
113
  },
108
114
  buttons: [
109
115
  {
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * TinyMCE version 7.0.0 (TBD)
3
3
  */
4
- !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=e=>e.options.get("allow_html_in_named_anchor");const a="a:not([href])",r=e=>!e,i=e=>e.getAttribute("id")||e.getAttribute("name")||"",l=e=>(e=>"a"===e.nodeName.toLowerCase())(e)&&!e.getAttribute("href")&&""!==i(e),s=e=>e.dom.getParent(e.selection.getStart(),a),d=(e,a)=>{const r=s(e);r?((e,t,o)=>{o.removeAttribute("name"),o.id=t,e.addVisual(),e.undoManager.add()})(e,a,r):((e,a)=>{e.undoManager.transact((()=>{n(e)||e.selection.collapse(!0),e.selection.isCollapsed()?e.insertContent(e.dom.createHTML("a",{id:a})):((e=>{const n=e.dom;t(n).walk(e.selection.getRng(),(e=>{o.each(e,(e=>{var t;l(t=e)&&!t.firstChild&&n.remove(e,!1)}))}))})(e),e.formatter.remove("namedAnchor",void 0,void 0,!0),e.formatter.apply("namedAnchor",{value:a}),e.addVisual())}))})(e,a),e.focus()},c=e=>(e=>r(e.attr("href"))&&!r(e.attr("id")||e.attr("name")))(e)&&!e.firstChild,m=e=>t=>{for(let o=0;o<t.length;o++){const n=t[o];c(n)&&n.attr("contenteditable",e)}},u=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}};e.add("anchor",(e=>{(e=>{(0,e.options.register)("allow_html_in_named_anchor",{processor:"boolean",default:!1})})(e),(e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("a",m("false")),e.serializer.addNodeFilter("a",m(null))}))})(e),(e=>{e.addCommand("mceAnchor",(()=>{(e=>{const t=(e=>{const t=s(e);return t?i(t):""})(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:t=>{((e,t)=>/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)?(d(e,t),!0):(e.windowManager.alert("ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1))(e,t.getData().id)&&t.close()}})})(e)}))})(e),(e=>{const t=()=>e.execCommand("mceAnchor");e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:t,onSetup:t=>{const o=e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind,n=u(e)(t);return()=>{o(),n()}}}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:t,onSetup:u(e)})})(e),e.on("PreInit",(()=>{(e=>{e.formatter.register("namedAnchor",{inline:"a",selector:a,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:(e,t,o)=>l(e)})})(e)}))}))}();
4
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),n=tinymce.util.Tools.resolve("tinymce.util.Tools");const o=e=>e.options.get("allow_html_in_named_anchor");const a="a:not([href])",r=e=>!e,i=e=>e.getAttribute("id")||e.getAttribute("name")||"",l=e=>(e=>"a"===e.nodeName.toLowerCase())(e)&&!e.getAttribute("href")&&""!==i(e),s=e=>e.dom.getParent(e.selection.getStart(),a),c=(e,a)=>{const r=s(e);r?((e,t,n)=>{n.removeAttribute("name"),n.id=t,e.addVisual(),e.undoManager.add()})(e,a,r):((e,a)=>{e.undoManager.transact((()=>{o(e)||e.selection.collapse(!0),e.selection.isCollapsed()?e.insertContent(e.dom.createHTML("a",{id:a})):((e=>{const o=e.dom;t(o).walk(e.selection.getRng(),(e=>{n.each(e,(e=>{var t;l(t=e)&&!t.firstChild&&o.remove(e,!1)}))}))})(e),e.formatter.remove("namedAnchor",void 0,void 0,!0),e.formatter.apply("namedAnchor",{value:a}),e.addVisual())}))})(e,a),e.focus()},d=e=>(e=>r(e.attr("href"))&&!r(e.attr("id")||e.attr("name")))(e)&&!e.firstChild,m=e=>t=>{for(let n=0;n<t.length;n++){const o=t[n];d(o)&&o.attr("contenteditable",e)}},h=e=>t=>{const n=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",n),n(),()=>{e.off("NodeChange",n)}};e.add("anchor",(e=>{(e=>{(0,e.options.register)("allow_html_in_named_anchor",{processor:"boolean",default:!1})})(e),(e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("a",m("false")),e.serializer.addNodeFilter("a",m(null))}))})(e),(e=>{e.addCommand("mceAnchor",(()=>{(e=>{const t=(e=>{const t=s(e);return t?i(t):""})(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{type:"htmlpanel",html:'<p style="font-size: 14px; margin-bottom: 10px;">The anchor tool is used to create a link that allows the user to jump to a specific part of the document marked by the anchor. For example, you can link to an image or a specific section of text (e.g., a heading or a paragraph)<br><br>Enter an anchor identifier in the "ID" field (e.g., "anchor1") > click Save > Insert > Link > select the anchor in the "Anchors" field > the "Link URL" and "Link Text" fields will auto-fill > adjust the "Link Title" as needed.</p>'},{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:t=>{((e,t)=>/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)?(c(e,t),!0):(e.windowManager.alert("ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1))(e,t.getData().id)&&t.close()}})})(e)}))})(e),(e=>{const t=()=>e.execCommand("mceAnchor");e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:t,onSetup:t=>{const n=e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind,o=h(e)(t);return()=>{n(),o()}}}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:t,onSetup:h(e)})})(e),e.on("PreInit",(()=>{(e=>{e.formatter.register("namedAnchor",{inline:"a",selector:a,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:(e,t,n)=>l(e)})})(e)}))}))}();
@@ -2768,12 +2768,40 @@
2768
2768
  [
2769
2769
  8703,
2770
2770
  'left right open-headed arrow'
2771
+ ],
2772
+ [
2773
+ 10146,
2774
+ 'black small arrowhead'
2771
2775
  ]
2772
2776
  ]
2773
2777
  },
2774
2778
  {
2775
2779
  name: 'Other',
2776
2780
  characters: [
2781
+ [
2782
+ 9633,
2783
+ 'white square'
2784
+ ],
2785
+ [
2786
+ 9642,
2787
+ 'black small square'
2788
+ ],
2789
+ [
2790
+ 9643,
2791
+ 'white medium square'
2792
+ ],
2793
+ [
2794
+ 9745,
2795
+ 'ballot box with check'
2796
+ ],
2797
+ [
2798
+ 9786,
2799
+ 'white smiling face'
2800
+ ],
2801
+ [
2802
+ 9826,
2803
+ 'black diamond suit'
2804
+ ],
2777
2805
  [
2778
2806
  9984,
2779
2807
  'black safety scissors'
@@ -2793,6 +2821,18 @@
2793
2821
  [
2794
2822
  9988,
2795
2823
  'white scissors'
2824
+ ],
2825
+ [
2826
+ 9998,
2827
+ 'lower right pencil'
2828
+ ],
2829
+ [
2830
+ 10022,
2831
+ 'black diamond'
2832
+ ],
2833
+ [
2834
+ 10004,
2835
+ 'heavy check mark'
2796
2836
  ]
2797
2837
  ]
2798
2838
  }
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * TinyMCE version 7.0.0 (TBD)
3
3
  */
4
- !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const r=(e,r)=>{const t=((e,r)=>e.dispatch("insertCustomChar",{chr:r}))(e,r).chr;e.execCommand("mceInsertContent",!1,t)},t=e=>r=>e===r,a=e=>"array"===(e=>{const r=typeof e;return null===e?"null":"object"===r&&Array.isArray(e)?"array":"object"===r&&(t=a=e,(o=String).prototype.isPrototypeOf(t)||(null===(i=a.constructor)||void 0===i?void 0:i.name)===o.name)?"string":r;var t,a,o,i})(e);const o=t(null),i=t(void 0),s=e=>"function"==typeof e,n=()=>false;class l{constructor(e,r){this.tag=e,this.value=r}static some(e){return new l(!0,e)}static none(){return l.singletonNone}fold(e,r){return this.tag?r(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?l.some(e(this.value)):l.none()}bind(e){return this.tag?e(this.value):l.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:l.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return null==e?l.none():l.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}l.singletonNone=new l(!1);const u=Array.prototype.push,c=(e,r)=>{const t=e.length,a=new Array(t);for(let o=0;o<t;o++){const t=e[o];a[o]=r(t,o)}return a};var h=tinymce.util.Tools.resolve("tinymce.util.Tools");const d=e=>r=>r.options.get(e),w=d("charmap"),g=d("charmap_append"),p=h.isArray,m="User Defined",f=e=>{return p(e)?(r=e,h.grep(r,(e=>p(e)&&2===e.length))):"function"==typeof e?e():[];var r},b=e=>{const r=((e,r)=>{const t=w(e);t&&(r=[{name:m,characters:f(t)}]);const a=g(e);if(a){const e=h.grep(r,(e=>e.name===m));return e.length?(e[0].characters=[...e[0].characters,...f(a)],r):r.concat({name:m,characters:f(a)})}return r})(e,[{name:"Currency",characters:[[36,"dollar sign"],[162,"cent sign"],[8364,"euro sign"],[163,"pound sign"],[165,"yen sign"],[164,"currency sign"],[8352,"euro-currency sign"],[8353,"colon sign"],[8354,"cruzeiro sign"],[8355,"french franc sign"],[8356,"lira sign"],[8357,"mill sign"],[8358,"naira sign"],[8359,"peseta sign"],[8360,"rupee sign"],[8361,"won sign"],[8362,"new sheqel sign"],[8363,"dong sign"],[8365,"kip sign"],[8366,"tugrik sign"],[8367,"drachma sign"],[8368,"german penny symbol"],[8369,"peso sign"],[8370,"guarani sign"],[8371,"austral sign"],[8372,"hryvnia sign"],[8373,"cedi sign"],[8374,"livre tournois sign"],[8375,"spesmilo sign"],[8376,"tenge sign"],[8377,"indian rupee sign"],[8378,"turkish lira sign"],[8379,"nordic mark sign"],[8380,"manat sign"],[8381,"ruble sign"],[20870,"yen character"],[20803,"yuan character"],[22291,"yuan character, in hong kong and taiwan"],[22278,"yen/yuan character variant one"]]},{name:"Text",characters:[[169,"copyright sign"],[174,"registered sign"],[8482,"trade mark sign"],[8240,"per mille sign"],[181,"micro sign"],[183,"middle dot"],[8226,"bullet"],[8230,"three dot leader"],[8242,"minutes / feet"],[8243,"seconds / inches"],[167,"section sign"],[182,"paragraph sign"],[223,"sharp s / ess-zed"]]},{name:"Quotations",characters:[[8249,"single left-pointing angle quotation mark"],[8250,"single right-pointing angle quotation mark"],[171,"left pointing guillemet"],[187,"right pointing guillemet"],[8216,"left single quotation mark"],[8217,"right single quotation mark"],[8220,"left double quotation mark"],[8221,"right double quotation mark"],[8218,"single low-9 quotation mark"],[8222,"double low-9 quotation mark"],[60,"less-than sign"],[62,"greater-than sign"],[8804,"less-than or equal to"],[8805,"greater-than or equal to"],[8211,"en dash"],[8212,"em dash"],[175,"macron"],[8254,"overline"],[164,"currency sign"],[166,"broken bar"],[168,"diaeresis"],[161,"inverted exclamation mark"],[191,"turned question mark"],[710,"circumflex accent"],[732,"small tilde"],[176,"degree sign"],[8722,"minus sign"],[177,"plus-minus sign"],[247,"division sign"],[8260,"fraction slash"],[215,"multiplication sign"],[185,"superscript one"],[178,"superscript two"],[179,"superscript three"],[188,"fraction one quarter"],[189,"fraction one half"],[190,"fraction three quarters"]]},{name:"Mathematical",characters:[[8704,"for all"],[8705,"complement"],[8706,"partial differential"],[8707,"there exist"],[8708,"there does not exist"],[8709,"empty set"],[8710,"increment"],[8711,"nabla"],[8712,"element of"],[8713,"not an element of"],[8714,"small element of"],[8715,"contains as member"],[8716,"does not contain as member"],[8717,"small contains as member"],[8718,"end of proof"],[8719,"n-ary product"],[8720,"n-ary coproduct"],[8721,"n-ary summation"],[8722,"minus sign"],[8723,"minus-or-plus sign"],[8724,"dot plus"],[8725,"division slash"],[8726,"set minus"],[8727,"asterisk operator"],[8728,"ring operator"],[8729,"bullet operator"],[8730,"square root"],[8731,"cube root"],[8732,"fourth root"],[8733,"proportional to"],[8734,"infinity"],[8735,"right angle"],[8736,"angle"],[8737,"measured angle"],[8738,"spherical angle"],[8739,"divides"],[8740,"does not divide"],[8741,"parallel to"],[8742,"not parallel to"],[8743,"logical and"],[8744,"logical or"],[8745,"intersection"],[8746,"union"],[8747,"integral"],[8748,"double integral"],[8749,"triple integral"],[8750,"contour integral"],[8751,"surface integral"],[8752,"volume integral"],[8753,"clockwise integral"],[8754,"clockwise contour integral"],[8755,"anticlockwise contour integral"],[8756,"therefore"],[8757,"because"],[8758,"ratio"],[8759,"proportion"],[8760,"dot minus"],[8761,"excess"],[8762,"geometric proportion"],[8763,"homothetic"],[8764,"tilde operator"],[8765,"reversed tilde"],[8766,"inverted lazy s"],[8767,"sine wave"],[8768,"wreath product"],[8769,"not tilde"],[8770,"minus tilde"],[8771,"asymptotically equal to"],[8772,"not asymptotically equal to"],[8773,"approximately equal to"],[8774,"approximately but not actually equal to"],[8775,"neither approximately nor actually equal to"],[8776,"almost equal to"],[8777,"not almost equal to"],[8778,"almost equal or equal to"],[8779,"triple tilde"],[8780,"all equal to"],[8781,"equivalent to"],[8782,"geometrically equivalent to"],[8783,"difference between"],[8784,"approaches the limit"],[8785,"geometrically equal to"],[8786,"approximately equal to or the image of"],[8787,"image of or aproximately equal to"],[8788,"colon equals"],[8789,"equals colon"],[8790,"ring in equal to"],[8791,"ring equal to"],[8792,"corresponds to"],[8793,"estimates"],[8794,"equiangular to"],[8795,"star equals"],[8796,"delta equal to"],[8797,"equal to by definition"],[8798,"measured by"],[8799,"questioned equal to"],[8800,"not equal to"],[8801,"identical to"],[8802,"not identical to"],[8803,"strictly equivalent to"],[8804,"less-than or equal to"],[8805,"greater-than or equal to"],[8806,"less-than over equal to"],[8807,"greater-than over equal to"],[8808,"less-than but not equal to"],[8809,"greater-than but not equal to"],[8810,"much less-than"],[8811,"much greater-than"],[8812,"between"],[8813,"not equivalent to"],[8814,"not less-than"],[8815,"not greater-than"],[8816,"neither less-than nor equal to"],[8817,"neither greater-than nor equal to"],[8818,"less-than or equivalent to"],[8819,"greater-than or equivalent to"],[8820,"neither less-than nor equivalent to"],[8821,"neither greater-than nor equivalent to"],[8822,"less-than or greater-than"],[8823,"greater-than or less-than"],[8824,"neither less-than nor greater-than"],[8825,"neither greater-than nor less-than"],[8826,"precedes"],[8827,"succeeds"],[8828,"precedes or equal to"],[8829,"succeeds or equal to"],[8830,"precedes or equivalent to"],[8831,"succeeds or equivalent to"],[8832,"does not precede"],[8833,"does not succeed"],[8834,"subset of"],[8835,"superset of"],[8836,"not a subset of"],[8837,"not a superset of"],[8838,"subset of or equal to"],[8839,"superset of or equal to"],[8840,"neither a subset of nor equal to"],[8841,"neither a superset of nor equal to"],[8842,"subset of with not equal to"],[8843,"superset of with not equal to"],[8844,"multiset"],[8845,"multiset multiplication"],[8846,"multiset union"],[8847,"square image of"],[8848,"square original of"],[8849,"square image of or equal to"],[8850,"square original of or equal to"],[8851,"square cap"],[8852,"square cup"],[8853,"circled plus"],[8854,"circled minus"],[8855,"circled times"],[8856,"circled division slash"],[8857,"circled dot operator"],[8858,"circled ring operator"],[8859,"circled asterisk operator"],[8860,"circled equals"],[8861,"circled dash"],[8862,"squared plus"],[8863,"squared minus"],[8864,"squared times"],[8865,"squared dot operator"],[8866,"right tack"],[8867,"left tack"],[8868,"down tack"],[8869,"up tack"],[8870,"assertion"],[8871,"models"],[8872,"true"],[8873,"forces"],[8874,"triple vertical bar right turnstile"],[8875,"double vertical bar double right turnstile"],[8876,"does not prove"],[8877,"not true"],[8878,"does not force"],[8879,"negated double vertical bar double right turnstile"],[8880,"precedes under relation"],[8881,"succeeds under relation"],[8882,"normal subgroup of"],[8883,"contains as normal subgroup"],[8884,"normal subgroup of or equal to"],[8885,"contains as normal subgroup or equal to"],[8886,"original of"],[8887,"image of"],[8888,"multimap"],[8889,"hermittan conjugate matrix"],[8890,"intercalate"],[8891,"xor"],[8892,"nand"],[8893,"nor"],[8894,"right angle with arc"],[8895,"right triangle"],[8896,"n-ary logical and"],[8897,"n-ary logical or"],[8898,"n-ary intersection"],[8899,"n-ary union"],[8900,"diamond operator"],[8901,"dot operator"],[8902,"star operator"],[8903,"division times"],[8904,"bowtie"],[8905,"left normal factor semidirect product"],[8906,"right normal factor semidirect product"],[8907,"left semidirect product"],[8908,"right semidirect product"],[8909,"reversed tilde equals"],[8910,"curly logical or"],[8911,"curly logical and"],[8912,"double subset"],[8913,"double superset"],[8914,"double intersection"],[8915,"double union"],[8916,"pitchfork"],[8917,"equal and parallel to"],[8918,"less-than with dot"],[8919,"greater-than with dot"],[8920,"very much less-than"],[8921,"very much greater-than"],[8922,"less-than equal to or greater-than"],[8923,"greater-than equal to or less-than"],[8924,"equal to or less-than"],[8925,"equal to or greater-than"],[8926,"equal to or precedes"],[8927,"equal to or succeeds"],[8928,"does not precede or equal"],[8929,"does not succeed or equal"],[8930,"not square image of or equal to"],[8931,"not square original of or equal to"],[8932,"square image of or not equal to"],[8933,"square original of or not equal to"],[8934,"less-than but not equivalent to"],[8935,"greater-than but not equivalent to"],[8936,"precedes but not equivalent to"],[8937,"succeeds but not equivalent to"],[8938,"not normal subgroup of"],[8939,"does not contain as normal subgroup"],[8940,"not normal subgroup of or equal to"],[8941,"does not contain as normal subgroup or equal"],[8942,"vertival ellipsis"],[8943,"midline horizontal ellipsis"],[8944,"up right diagonal ellipsis"],[8945,"down right diagonal ellipsis"],[8946,"element of with long horizontal stroke"],[8947,"element of with vertical bar at end of horizontal stroke"],[8948,"small element of with vertical bar at end of horizontal stroke"],[8949,"element of with dot above"],[8950,"element of with overbar"],[8951,"small element of with overbar"],[8952,"element of with underbar"],[8953,"element of with two horizontal strokes"],[8954,"contains with long horizontal stroke"],[8955,"contains with vertical bar at end of horizontal stroke"],[8956,"small contains with vertical bar at end of horizontal stroke"],[8957,"contains with overbar"],[8958,"small contains with overbar"],[8959,"z notation bag membership"]]},{name:"Extended Latin",characters:[[192,"A - grave"],[193,"A - acute"],[194,"A - circumflex"],[195,"A - tilde"],[196,"A - diaeresis"],[197,"A - ring above"],[256,"A - macron"],[198,"ligature AE"],[199,"C - cedilla"],[200,"E - grave"],[201,"E - acute"],[202,"E - circumflex"],[203,"E - diaeresis"],[274,"E - macron"],[204,"I - grave"],[205,"I - acute"],[206,"I - circumflex"],[207,"I - diaeresis"],[298,"I - macron"],[208,"ETH"],[209,"N - tilde"],[210,"O - grave"],[211,"O - acute"],[212,"O - circumflex"],[213,"O - tilde"],[214,"O - diaeresis"],[216,"O - slash"],[332,"O - macron"],[338,"ligature OE"],[352,"S - caron"],[217,"U - grave"],[218,"U - acute"],[219,"U - circumflex"],[220,"U - diaeresis"],[362,"U - macron"],[221,"Y - acute"],[376,"Y - diaeresis"],[562,"Y - macron"],[222,"THORN"],[224,"a - grave"],[225,"a - acute"],[226,"a - circumflex"],[227,"a - tilde"],[228,"a - diaeresis"],[229,"a - ring above"],[257,"a - macron"],[230,"ligature ae"],[231,"c - cedilla"],[232,"e - grave"],[233,"e - acute"],[234,"e - circumflex"],[235,"e - diaeresis"],[275,"e - macron"],[236,"i - grave"],[237,"i - acute"],[238,"i - circumflex"],[239,"i - diaeresis"],[299,"i - macron"],[240,"eth"],[241,"n - tilde"],[242,"o - grave"],[243,"o - acute"],[244,"o - circumflex"],[245,"o - tilde"],[246,"o - diaeresis"],[248,"o slash"],[333,"o macron"],[339,"ligature oe"],[353,"s - caron"],[249,"u - grave"],[250,"u - acute"],[251,"u - circumflex"],[252,"u - diaeresis"],[363,"u - macron"],[253,"y - acute"],[254,"thorn"],[255,"y - diaeresis"],[563,"y - macron"],[913,"Alpha"],[914,"Beta"],[915,"Gamma"],[916,"Delta"],[917,"Epsilon"],[918,"Zeta"],[919,"Eta"],[920,"Theta"],[921,"Iota"],[922,"Kappa"],[923,"Lambda"],[924,"Mu"],[925,"Nu"],[926,"Xi"],[927,"Omicron"],[928,"Pi"],[929,"Rho"],[931,"Sigma"],[932,"Tau"],[933,"Upsilon"],[934,"Phi"],[935,"Chi"],[936,"Psi"],[937,"Omega"],[945,"alpha"],[946,"beta"],[947,"gamma"],[948,"delta"],[949,"epsilon"],[950,"zeta"],[951,"eta"],[952,"theta"],[953,"iota"],[954,"kappa"],[955,"lambda"],[956,"mu"],[957,"nu"],[958,"xi"],[959,"omicron"],[960,"pi"],[961,"rho"],[962,"final sigma"],[963,"sigma"],[964,"tau"],[965,"upsilon"],[966,"phi"],[967,"chi"],[968,"psi"],[969,"omega"]]},{name:"Greek Letters",characters:[[945,"small letter alpha"],[946,"small letter beta"],[947,"small letter gamma"],[948,"small letter delta"],[949,"small letter epsilon"],[950,"small letter zeta"],[951,"small letter eta"],[952,"small letter theta"],[953,"small letter iota"],[954,"small letter kappa"],[955,"small letter lambda"],[956,"small letter mu"],[957,"small letter nu"],[958,"small letter xi"],[959,"small letter omicron"],[960,"small letter pi"],[961,"small letter rho"],[962,"small letter final sigma"],[963,"small letter sigma"],[964,"small letter tau"],[965,"small letter upsilon"],[966,"small letter phi"],[967,"small letter chi"],[968,"small letter psi"],[969,"small letter omega"],[913,"capital letter alpha"],[914,"capital letter beta"],[915,"capital letter gamma"],[916,"capital letter delta"],[917,"capital letter epsilon"],[918,"capital letter zeta"],[919,"capital letter eta"],[920,"capital letter theta"],[921,"capital letter iota"],[922,"capital letter kappa"],[923,"capital letter lambda"],[924,"capital letter mu"],[925,"capital letter nu"],[926,"capital letter xi"],[927,"capital letter omicron"],[928,"capital letter pi"],[929,"capital letter rho"],[931,"capital letter sigma"],[932,"capital letter tau"],[933,"capital letter upsilon"],[934,"capital letter phi"],[935,"capital letter chi"],[936,"capital letter psi"],[937,"capital letter omega"]]},{name:"Arrows",characters:[[8592,"leftwards arrow"],[8593,"upwards arrow"],[8594,"rightwards arrow"],[8595,"downwards arrow"],[8596,"left right arrow"],[8597,"up down arrow"],[8598,"north west arrow"],[8599,"north east arrow"],[8600,"south east arrow"],[8601,"south west arrow"],[8602,"leftwards arrow with stroke"],[8603,"rightwards arrow with stroke"],[8604,"leftwards wave arrow"],[8605,"rightwards wave arrow"],[8606,"leftwards two headed arrow"],[8607,"upwards two headed arrow"],[8608,"rightwards two headed arrow"],[8609,"downwards two headed arrow"],[8610,"leftwards arrow with tail"],[8611,"rightwards arrow with tail"],[8612,"leftwards arrow from bar"],[8613,"upwards arrow from bar"],[8614,"rightwards arrow from bar"],[8615,"downwards arrow from bar"],[8616,"up down arrow with base"],[8617,"leftwards arrow with hook"],[8618,"rightwards arrow with hook"],[8619,"leftwards arrow with loop"],[8620,"rightwards arrow with loop"],[8621,"left right wave arrow"],[8622,"left right arrow with stroke"],[8623,"downwards zigzag arrow"],[8624,"upwards arrow with tip leftwards"],[8625,"upwards arrow with tip rightwards"],[8626,"downwards arrow with tip leftwards"],[8627,"downwards arrow with tip rightwards"],[8628,"rightwards arrow with corner downwards"],[8629,"downwards arrow with corner leftwards"],[8630,"anticlockwise top semicircle arrow"],[8631,"clockwise top semicircle arrow"],[8632,"north west arrow to long bar"],[8633,"leftwards arrow to bar over rightwards arrow to bar"],[8634,"anticlockwise open circle arrow"],[8635,"clockwise open circle arrow"],[8636,"leftwards harpoon with barb upwards"],[8637,"leftwards harpoon with barb downwards"],[8638,"upwards harpoon with barb rightwards"],[8639,"upwards harpoon with barb leftwards"],[8640,"rightwards harpoon with barb upwards"],[8641,"rightwards harpoon with barb downwards"],[8642,"downwards harpoon with barb rightwards"],[8643,"downwards harpoon with barb leftwards"],[8644,"rightwards arrow over leftwards arrow"],[8645,"upwards arrow leftwards of downwards arrow"],[8646,"leftwards arrow over rightwards arrow"],[8647,"leftwards paired arrows"],[8648,"upwards paired arrows"],[8649,"rightwards paired arrows"],[8650,"downwards paired arrows"],[8651,"leftwards harpoon over rightwards harpoon"],[8652,"rightwards harpoon over leftwards harpoon"],[8653,"leftwards double arrow with stroke"],[8654,"left right double arrow with stroke"],[8655,"rightwards double arrow with stroke"],[8656,"leftwards double arrow"],[8657,"upwards double arrow"],[8658,"rightwards double arrow"],[8659,"downwards double arrow"],[8660,"left right double arrow"],[8661,"up down double arrow"],[8662,"north west double arrow"],[8663,"north east double arrow"],[8664,"south east double arrow"],[8665,"south west double arrow"],[8666,"leftwards triple arrow"],[8667,"rightwards triple arrow"],[8668,"leftwards squiggle arrow"],[8669,"rightwards squiggle arrow"],[8670,"upwards arrow with double stroke"],[8671,"downwards arrow with double stroke"],[8672,"leftwards dashed arrow"],[8673,"upwards dashed arrow"],[8674,"rightwards dashed arrow"],[8675,"downwards dashed arrow"],[8676,"leftwards arrow to bar"],[8677,"rightwards arrow to bar"],[8678,"leftwards thick arrow"],[8679,"upwards thick arrow"],[8680,"rightwards thick arrow"],[8681,"downwards thick arrow"],[8682,"upwards thick arrow from bar"],[8683,"upwards thick arrow on pedestal"],[8684,"upwards thick arrow on pedestal with horizontal bar"],[8685,"upwards thick arrow on pedestal with vertical bar"],[8686,"upwards thick double arrow"],[8687,"upwards thick double arrow on pedestal"],[8688,"rightwards thick arrow from wal"],[8689,"north west arrow to corner"],[8690,"south east arrow to corner"],[8691,"up down thick arrow"],[8692,"right arrow with smal circle"],[8693,"downwards arrow leftwards of upwards arrow"],[8694,"Three rightwards arrows"],[8695,"leftwards arrow with vertical stroke"],[8696,"rightwards arrow with vertical stroke"],[8697,"left right arrow with vertical stroke"],[8698,"leftwards arrow with double vertical stroke"],[8699,"rightwards arrow with double vertical stroke"],[8700,"left right arrow with double vertical stroke"],[8701,"leftwards open-headed arrow"],[8702,"rightwards open-headed arrow"],[8703,"left right open-headed arrow"]]},{name:"Other",characters:[[9984,"black safety scissors"],[9985,"upper blade scissors"],[9986,"black scissors"],[9987,"lower blade scissors"],[9988,"white scissors"]]}]);return r.length>1?[{name:"All",characters:(t=r,o=e=>e.characters,(e=>{const r=[];for(let t=0,o=e.length;t<o;++t){if(!a(e[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+e);u.apply(r,e[t])}return r})(c(t,o)))}].concat(r):r;var t,o},q=e=>{let r=e;return{get:()=>r,set:e=>{r=e}}},v=(e,r,t=0,a)=>{const o=e.indexOf(r,t);return-1!==o&&(!!i(a)||o+r.length<=a)},y=String.fromCodePoint,k=(e,r)=>{const t=[],a=r.toLowerCase();return(e=>{for(let o=0,i=e.length;o<i;o++)((e,r,t)=>!!v(y(e).toLowerCase(),t)||v(r.toLowerCase(),t)||v(r.toLowerCase().replace(/\s+/g,""),t))((r=e[o])[0],r[1],a)&&t.push(r);var r})(e.characters),c(t,(e=>({text:e[1],value:y(e[0]),icon:y(e[0])})))},x="pattern",C=(e,t)=>{const a=()=>[{label:"Search",type:"input",name:x},{type:"collection",name:"results"}],i=1===t.length?q(m):q("All"),s=(e=>{let r=null;const t=()=>{o(r)||(clearTimeout(r),r=null)};return{cancel:t,throttle:(...a)=>{t(),r=setTimeout((()=>{r=null,e.apply(null,a)}),40)}}})((e=>{const r=e.getData().pattern;((e,r)=>{var a,o;(a=t,o=e=>e.name===i.get(),((e,r,t)=>{for(let a=0,o=e.length;a<o;a++){const o=e[a];if(r(o,a))return l.some(o);if(t(o,a))break}return l.none()})(a,o,n)).each((t=>{const a=k(t,r);e.setData({results:a})}))})(e,r)})),u={title:"Special Character",size:"normal",body:1===t.length?{type:"panel",items:a()}:{type:"tabpanel",tabs:c(t,(e=>({title:e.name,name:e.name,items:a()})))},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{pattern:"",results:k(t[0],"")},onAction:(t,a)=>{"results"===a.name&&(r(e,a.value),t.close())},onTabChange:(e,r)=>{i.set(r.newTabName),s.throttle(e)},onChange:(e,r)=>{r.name===x&&s.throttle(e)}};e.windowManager.open(u).focus(x)},A=e=>r=>{const t=()=>{r.setEnabled(e.selection.isEditable())};return e.on("NodeChange",t),t(),()=>{e.off("NodeChange",t)}};e.add("charmap",(e=>{(e=>{const r=e.options.register,t=e=>s(e)||a(e);r("charmap",{processor:t}),r("charmap_append",{processor:t})})(e);const t=b(e);return((e,r)=>{e.addCommand("mceShowCharmap",(()=>{C(e,r)}))})(e,t),(e=>{const r=()=>e.execCommand("mceShowCharmap");e.ui.registry.addButton("charmap",{icon:"insert-character",tooltip:"Special character",onAction:r,onSetup:A(e)}),e.ui.registry.addMenuItem("charmap",{icon:"insert-character",text:"Special character...",onAction:r,onSetup:A(e)})})(e),((e,r)=>{e.ui.registry.addAutocompleter("charmap",{trigger:":",columns:"auto",minChars:2,fetch:(e,t)=>new Promise(((t,a)=>{t(k(r,e))})),onAction:(r,t,a)=>{e.selection.setRng(t),e.insertContent(a),r.hide()}})})(e,t[0]),(e=>({getCharMap:()=>b(e),insertChar:t=>{r(e,t)}}))(e)}))}();
4
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const r=(e,r)=>{const t=((e,r)=>e.dispatch("insertCustomChar",{chr:r}))(e,r).chr;e.execCommand("mceInsertContent",!1,t)},t=e=>r=>e===r,a=e=>"array"===(e=>{const r=typeof e;return null===e?"null":"object"===r&&Array.isArray(e)?"array":"object"===r&&(t=a=e,(o=String).prototype.isPrototypeOf(t)||(null===(i=a.constructor)||void 0===i?void 0:i.name)===o.name)?"string":r;var t,a,o,i})(e);const o=t(null),i=t(void 0),s=e=>"function"==typeof e,n=()=>false;class l{constructor(e,r){this.tag=e,this.value=r}static some(e){return new l(!0,e)}static none(){return l.singletonNone}fold(e,r){return this.tag?r(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?l.some(e(this.value)):l.none()}bind(e){return this.tag?e(this.value):l.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:l.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return null==e?l.none():l.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}l.singletonNone=new l(!1);const u=Array.prototype.push,c=(e,r)=>{const t=e.length,a=new Array(t);for(let o=0;o<t;o++){const t=e[o];a[o]=r(t,o)}return a};var h=tinymce.util.Tools.resolve("tinymce.util.Tools");const d=e=>r=>r.options.get(e),w=d("charmap"),g=d("charmap_append"),m=h.isArray,p="User Defined",f=e=>{return m(e)?(r=e,h.grep(r,(e=>m(e)&&2===e.length))):"function"==typeof e?e():[];var r},b=e=>{const r=((e,r)=>{const t=w(e);t&&(r=[{name:p,characters:f(t)}]);const a=g(e);if(a){const e=h.grep(r,(e=>e.name===p));return e.length?(e[0].characters=[...e[0].characters,...f(a)],r):r.concat({name:p,characters:f(a)})}return r})(e,[{name:"Currency",characters:[[36,"dollar sign"],[162,"cent sign"],[8364,"euro sign"],[163,"pound sign"],[165,"yen sign"],[164,"currency sign"],[8352,"euro-currency sign"],[8353,"colon sign"],[8354,"cruzeiro sign"],[8355,"french franc sign"],[8356,"lira sign"],[8357,"mill sign"],[8358,"naira sign"],[8359,"peseta sign"],[8360,"rupee sign"],[8361,"won sign"],[8362,"new sheqel sign"],[8363,"dong sign"],[8365,"kip sign"],[8366,"tugrik sign"],[8367,"drachma sign"],[8368,"german penny symbol"],[8369,"peso sign"],[8370,"guarani sign"],[8371,"austral sign"],[8372,"hryvnia sign"],[8373,"cedi sign"],[8374,"livre tournois sign"],[8375,"spesmilo sign"],[8376,"tenge sign"],[8377,"indian rupee sign"],[8378,"turkish lira sign"],[8379,"nordic mark sign"],[8380,"manat sign"],[8381,"ruble sign"],[20870,"yen character"],[20803,"yuan character"],[22291,"yuan character, in hong kong and taiwan"],[22278,"yen/yuan character variant one"]]},{name:"Text",characters:[[169,"copyright sign"],[174,"registered sign"],[8482,"trade mark sign"],[8240,"per mille sign"],[181,"micro sign"],[183,"middle dot"],[8226,"bullet"],[8230,"three dot leader"],[8242,"minutes / feet"],[8243,"seconds / inches"],[167,"section sign"],[182,"paragraph sign"],[223,"sharp s / ess-zed"]]},{name:"Quotations",characters:[[8249,"single left-pointing angle quotation mark"],[8250,"single right-pointing angle quotation mark"],[171,"left pointing guillemet"],[187,"right pointing guillemet"],[8216,"left single quotation mark"],[8217,"right single quotation mark"],[8220,"left double quotation mark"],[8221,"right double quotation mark"],[8218,"single low-9 quotation mark"],[8222,"double low-9 quotation mark"],[60,"less-than sign"],[62,"greater-than sign"],[8804,"less-than or equal to"],[8805,"greater-than or equal to"],[8211,"en dash"],[8212,"em dash"],[175,"macron"],[8254,"overline"],[164,"currency sign"],[166,"broken bar"],[168,"diaeresis"],[161,"inverted exclamation mark"],[191,"turned question mark"],[710,"circumflex accent"],[732,"small tilde"],[176,"degree sign"],[8722,"minus sign"],[177,"plus-minus sign"],[247,"division sign"],[8260,"fraction slash"],[215,"multiplication sign"],[185,"superscript one"],[178,"superscript two"],[179,"superscript three"],[188,"fraction one quarter"],[189,"fraction one half"],[190,"fraction three quarters"]]},{name:"Mathematical",characters:[[8704,"for all"],[8705,"complement"],[8706,"partial differential"],[8707,"there exist"],[8708,"there does not exist"],[8709,"empty set"],[8710,"increment"],[8711,"nabla"],[8712,"element of"],[8713,"not an element of"],[8714,"small element of"],[8715,"contains as member"],[8716,"does not contain as member"],[8717,"small contains as member"],[8718,"end of proof"],[8719,"n-ary product"],[8720,"n-ary coproduct"],[8721,"n-ary summation"],[8722,"minus sign"],[8723,"minus-or-plus sign"],[8724,"dot plus"],[8725,"division slash"],[8726,"set minus"],[8727,"asterisk operator"],[8728,"ring operator"],[8729,"bullet operator"],[8730,"square root"],[8731,"cube root"],[8732,"fourth root"],[8733,"proportional to"],[8734,"infinity"],[8735,"right angle"],[8736,"angle"],[8737,"measured angle"],[8738,"spherical angle"],[8739,"divides"],[8740,"does not divide"],[8741,"parallel to"],[8742,"not parallel to"],[8743,"logical and"],[8744,"logical or"],[8745,"intersection"],[8746,"union"],[8747,"integral"],[8748,"double integral"],[8749,"triple integral"],[8750,"contour integral"],[8751,"surface integral"],[8752,"volume integral"],[8753,"clockwise integral"],[8754,"clockwise contour integral"],[8755,"anticlockwise contour integral"],[8756,"therefore"],[8757,"because"],[8758,"ratio"],[8759,"proportion"],[8760,"dot minus"],[8761,"excess"],[8762,"geometric proportion"],[8763,"homothetic"],[8764,"tilde operator"],[8765,"reversed tilde"],[8766,"inverted lazy s"],[8767,"sine wave"],[8768,"wreath product"],[8769,"not tilde"],[8770,"minus tilde"],[8771,"asymptotically equal to"],[8772,"not asymptotically equal to"],[8773,"approximately equal to"],[8774,"approximately but not actually equal to"],[8775,"neither approximately nor actually equal to"],[8776,"almost equal to"],[8777,"not almost equal to"],[8778,"almost equal or equal to"],[8779,"triple tilde"],[8780,"all equal to"],[8781,"equivalent to"],[8782,"geometrically equivalent to"],[8783,"difference between"],[8784,"approaches the limit"],[8785,"geometrically equal to"],[8786,"approximately equal to or the image of"],[8787,"image of or aproximately equal to"],[8788,"colon equals"],[8789,"equals colon"],[8790,"ring in equal to"],[8791,"ring equal to"],[8792,"corresponds to"],[8793,"estimates"],[8794,"equiangular to"],[8795,"star equals"],[8796,"delta equal to"],[8797,"equal to by definition"],[8798,"measured by"],[8799,"questioned equal to"],[8800,"not equal to"],[8801,"identical to"],[8802,"not identical to"],[8803,"strictly equivalent to"],[8804,"less-than or equal to"],[8805,"greater-than or equal to"],[8806,"less-than over equal to"],[8807,"greater-than over equal to"],[8808,"less-than but not equal to"],[8809,"greater-than but not equal to"],[8810,"much less-than"],[8811,"much greater-than"],[8812,"between"],[8813,"not equivalent to"],[8814,"not less-than"],[8815,"not greater-than"],[8816,"neither less-than nor equal to"],[8817,"neither greater-than nor equal to"],[8818,"less-than or equivalent to"],[8819,"greater-than or equivalent to"],[8820,"neither less-than nor equivalent to"],[8821,"neither greater-than nor equivalent to"],[8822,"less-than or greater-than"],[8823,"greater-than or less-than"],[8824,"neither less-than nor greater-than"],[8825,"neither greater-than nor less-than"],[8826,"precedes"],[8827,"succeeds"],[8828,"precedes or equal to"],[8829,"succeeds or equal to"],[8830,"precedes or equivalent to"],[8831,"succeeds or equivalent to"],[8832,"does not precede"],[8833,"does not succeed"],[8834,"subset of"],[8835,"superset of"],[8836,"not a subset of"],[8837,"not a superset of"],[8838,"subset of or equal to"],[8839,"superset of or equal to"],[8840,"neither a subset of nor equal to"],[8841,"neither a superset of nor equal to"],[8842,"subset of with not equal to"],[8843,"superset of with not equal to"],[8844,"multiset"],[8845,"multiset multiplication"],[8846,"multiset union"],[8847,"square image of"],[8848,"square original of"],[8849,"square image of or equal to"],[8850,"square original of or equal to"],[8851,"square cap"],[8852,"square cup"],[8853,"circled plus"],[8854,"circled minus"],[8855,"circled times"],[8856,"circled division slash"],[8857,"circled dot operator"],[8858,"circled ring operator"],[8859,"circled asterisk operator"],[8860,"circled equals"],[8861,"circled dash"],[8862,"squared plus"],[8863,"squared minus"],[8864,"squared times"],[8865,"squared dot operator"],[8866,"right tack"],[8867,"left tack"],[8868,"down tack"],[8869,"up tack"],[8870,"assertion"],[8871,"models"],[8872,"true"],[8873,"forces"],[8874,"triple vertical bar right turnstile"],[8875,"double vertical bar double right turnstile"],[8876,"does not prove"],[8877,"not true"],[8878,"does not force"],[8879,"negated double vertical bar double right turnstile"],[8880,"precedes under relation"],[8881,"succeeds under relation"],[8882,"normal subgroup of"],[8883,"contains as normal subgroup"],[8884,"normal subgroup of or equal to"],[8885,"contains as normal subgroup or equal to"],[8886,"original of"],[8887,"image of"],[8888,"multimap"],[8889,"hermittan conjugate matrix"],[8890,"intercalate"],[8891,"xor"],[8892,"nand"],[8893,"nor"],[8894,"right angle with arc"],[8895,"right triangle"],[8896,"n-ary logical and"],[8897,"n-ary logical or"],[8898,"n-ary intersection"],[8899,"n-ary union"],[8900,"diamond operator"],[8901,"dot operator"],[8902,"star operator"],[8903,"division times"],[8904,"bowtie"],[8905,"left normal factor semidirect product"],[8906,"right normal factor semidirect product"],[8907,"left semidirect product"],[8908,"right semidirect product"],[8909,"reversed tilde equals"],[8910,"curly logical or"],[8911,"curly logical and"],[8912,"double subset"],[8913,"double superset"],[8914,"double intersection"],[8915,"double union"],[8916,"pitchfork"],[8917,"equal and parallel to"],[8918,"less-than with dot"],[8919,"greater-than with dot"],[8920,"very much less-than"],[8921,"very much greater-than"],[8922,"less-than equal to or greater-than"],[8923,"greater-than equal to or less-than"],[8924,"equal to or less-than"],[8925,"equal to or greater-than"],[8926,"equal to or precedes"],[8927,"equal to or succeeds"],[8928,"does not precede or equal"],[8929,"does not succeed or equal"],[8930,"not square image of or equal to"],[8931,"not square original of or equal to"],[8932,"square image of or not equal to"],[8933,"square original of or not equal to"],[8934,"less-than but not equivalent to"],[8935,"greater-than but not equivalent to"],[8936,"precedes but not equivalent to"],[8937,"succeeds but not equivalent to"],[8938,"not normal subgroup of"],[8939,"does not contain as normal subgroup"],[8940,"not normal subgroup of or equal to"],[8941,"does not contain as normal subgroup or equal"],[8942,"vertival ellipsis"],[8943,"midline horizontal ellipsis"],[8944,"up right diagonal ellipsis"],[8945,"down right diagonal ellipsis"],[8946,"element of with long horizontal stroke"],[8947,"element of with vertical bar at end of horizontal stroke"],[8948,"small element of with vertical bar at end of horizontal stroke"],[8949,"element of with dot above"],[8950,"element of with overbar"],[8951,"small element of with overbar"],[8952,"element of with underbar"],[8953,"element of with two horizontal strokes"],[8954,"contains with long horizontal stroke"],[8955,"contains with vertical bar at end of horizontal stroke"],[8956,"small contains with vertical bar at end of horizontal stroke"],[8957,"contains with overbar"],[8958,"small contains with overbar"],[8959,"z notation bag membership"]]},{name:"Extended Latin",characters:[[192,"A - grave"],[193,"A - acute"],[194,"A - circumflex"],[195,"A - tilde"],[196,"A - diaeresis"],[197,"A - ring above"],[256,"A - macron"],[198,"ligature AE"],[199,"C - cedilla"],[200,"E - grave"],[201,"E - acute"],[202,"E - circumflex"],[203,"E - diaeresis"],[274,"E - macron"],[204,"I - grave"],[205,"I - acute"],[206,"I - circumflex"],[207,"I - diaeresis"],[298,"I - macron"],[208,"ETH"],[209,"N - tilde"],[210,"O - grave"],[211,"O - acute"],[212,"O - circumflex"],[213,"O - tilde"],[214,"O - diaeresis"],[216,"O - slash"],[332,"O - macron"],[338,"ligature OE"],[352,"S - caron"],[217,"U - grave"],[218,"U - acute"],[219,"U - circumflex"],[220,"U - diaeresis"],[362,"U - macron"],[221,"Y - acute"],[376,"Y - diaeresis"],[562,"Y - macron"],[222,"THORN"],[224,"a - grave"],[225,"a - acute"],[226,"a - circumflex"],[227,"a - tilde"],[228,"a - diaeresis"],[229,"a - ring above"],[257,"a - macron"],[230,"ligature ae"],[231,"c - cedilla"],[232,"e - grave"],[233,"e - acute"],[234,"e - circumflex"],[235,"e - diaeresis"],[275,"e - macron"],[236,"i - grave"],[237,"i - acute"],[238,"i - circumflex"],[239,"i - diaeresis"],[299,"i - macron"],[240,"eth"],[241,"n - tilde"],[242,"o - grave"],[243,"o - acute"],[244,"o - circumflex"],[245,"o - tilde"],[246,"o - diaeresis"],[248,"o slash"],[333,"o macron"],[339,"ligature oe"],[353,"s - caron"],[249,"u - grave"],[250,"u - acute"],[251,"u - circumflex"],[252,"u - diaeresis"],[363,"u - macron"],[253,"y - acute"],[254,"thorn"],[255,"y - diaeresis"],[563,"y - macron"],[913,"Alpha"],[914,"Beta"],[915,"Gamma"],[916,"Delta"],[917,"Epsilon"],[918,"Zeta"],[919,"Eta"],[920,"Theta"],[921,"Iota"],[922,"Kappa"],[923,"Lambda"],[924,"Mu"],[925,"Nu"],[926,"Xi"],[927,"Omicron"],[928,"Pi"],[929,"Rho"],[931,"Sigma"],[932,"Tau"],[933,"Upsilon"],[934,"Phi"],[935,"Chi"],[936,"Psi"],[937,"Omega"],[945,"alpha"],[946,"beta"],[947,"gamma"],[948,"delta"],[949,"epsilon"],[950,"zeta"],[951,"eta"],[952,"theta"],[953,"iota"],[954,"kappa"],[955,"lambda"],[956,"mu"],[957,"nu"],[958,"xi"],[959,"omicron"],[960,"pi"],[961,"rho"],[962,"final sigma"],[963,"sigma"],[964,"tau"],[965,"upsilon"],[966,"phi"],[967,"chi"],[968,"psi"],[969,"omega"]]},{name:"Greek Letters",characters:[[945,"small letter alpha"],[946,"small letter beta"],[947,"small letter gamma"],[948,"small letter delta"],[949,"small letter epsilon"],[950,"small letter zeta"],[951,"small letter eta"],[952,"small letter theta"],[953,"small letter iota"],[954,"small letter kappa"],[955,"small letter lambda"],[956,"small letter mu"],[957,"small letter nu"],[958,"small letter xi"],[959,"small letter omicron"],[960,"small letter pi"],[961,"small letter rho"],[962,"small letter final sigma"],[963,"small letter sigma"],[964,"small letter tau"],[965,"small letter upsilon"],[966,"small letter phi"],[967,"small letter chi"],[968,"small letter psi"],[969,"small letter omega"],[913,"capital letter alpha"],[914,"capital letter beta"],[915,"capital letter gamma"],[916,"capital letter delta"],[917,"capital letter epsilon"],[918,"capital letter zeta"],[919,"capital letter eta"],[920,"capital letter theta"],[921,"capital letter iota"],[922,"capital letter kappa"],[923,"capital letter lambda"],[924,"capital letter mu"],[925,"capital letter nu"],[926,"capital letter xi"],[927,"capital letter omicron"],[928,"capital letter pi"],[929,"capital letter rho"],[931,"capital letter sigma"],[932,"capital letter tau"],[933,"capital letter upsilon"],[934,"capital letter phi"],[935,"capital letter chi"],[936,"capital letter psi"],[937,"capital letter omega"]]},{name:"Arrows",characters:[[8592,"leftwards arrow"],[8593,"upwards arrow"],[8594,"rightwards arrow"],[8595,"downwards arrow"],[8596,"left right arrow"],[8597,"up down arrow"],[8598,"north west arrow"],[8599,"north east arrow"],[8600,"south east arrow"],[8601,"south west arrow"],[8602,"leftwards arrow with stroke"],[8603,"rightwards arrow with stroke"],[8604,"leftwards wave arrow"],[8605,"rightwards wave arrow"],[8606,"leftwards two headed arrow"],[8607,"upwards two headed arrow"],[8608,"rightwards two headed arrow"],[8609,"downwards two headed arrow"],[8610,"leftwards arrow with tail"],[8611,"rightwards arrow with tail"],[8612,"leftwards arrow from bar"],[8613,"upwards arrow from bar"],[8614,"rightwards arrow from bar"],[8615,"downwards arrow from bar"],[8616,"up down arrow with base"],[8617,"leftwards arrow with hook"],[8618,"rightwards arrow with hook"],[8619,"leftwards arrow with loop"],[8620,"rightwards arrow with loop"],[8621,"left right wave arrow"],[8622,"left right arrow with stroke"],[8623,"downwards zigzag arrow"],[8624,"upwards arrow with tip leftwards"],[8625,"upwards arrow with tip rightwards"],[8626,"downwards arrow with tip leftwards"],[8627,"downwards arrow with tip rightwards"],[8628,"rightwards arrow with corner downwards"],[8629,"downwards arrow with corner leftwards"],[8630,"anticlockwise top semicircle arrow"],[8631,"clockwise top semicircle arrow"],[8632,"north west arrow to long bar"],[8633,"leftwards arrow to bar over rightwards arrow to bar"],[8634,"anticlockwise open circle arrow"],[8635,"clockwise open circle arrow"],[8636,"leftwards harpoon with barb upwards"],[8637,"leftwards harpoon with barb downwards"],[8638,"upwards harpoon with barb rightwards"],[8639,"upwards harpoon with barb leftwards"],[8640,"rightwards harpoon with barb upwards"],[8641,"rightwards harpoon with barb downwards"],[8642,"downwards harpoon with barb rightwards"],[8643,"downwards harpoon with barb leftwards"],[8644,"rightwards arrow over leftwards arrow"],[8645,"upwards arrow leftwards of downwards arrow"],[8646,"leftwards arrow over rightwards arrow"],[8647,"leftwards paired arrows"],[8648,"upwards paired arrows"],[8649,"rightwards paired arrows"],[8650,"downwards paired arrows"],[8651,"leftwards harpoon over rightwards harpoon"],[8652,"rightwards harpoon over leftwards harpoon"],[8653,"leftwards double arrow with stroke"],[8654,"left right double arrow with stroke"],[8655,"rightwards double arrow with stroke"],[8656,"leftwards double arrow"],[8657,"upwards double arrow"],[8658,"rightwards double arrow"],[8659,"downwards double arrow"],[8660,"left right double arrow"],[8661,"up down double arrow"],[8662,"north west double arrow"],[8663,"north east double arrow"],[8664,"south east double arrow"],[8665,"south west double arrow"],[8666,"leftwards triple arrow"],[8667,"rightwards triple arrow"],[8668,"leftwards squiggle arrow"],[8669,"rightwards squiggle arrow"],[8670,"upwards arrow with double stroke"],[8671,"downwards arrow with double stroke"],[8672,"leftwards dashed arrow"],[8673,"upwards dashed arrow"],[8674,"rightwards dashed arrow"],[8675,"downwards dashed arrow"],[8676,"leftwards arrow to bar"],[8677,"rightwards arrow to bar"],[8678,"leftwards thick arrow"],[8679,"upwards thick arrow"],[8680,"rightwards thick arrow"],[8681,"downwards thick arrow"],[8682,"upwards thick arrow from bar"],[8683,"upwards thick arrow on pedestal"],[8684,"upwards thick arrow on pedestal with horizontal bar"],[8685,"upwards thick arrow on pedestal with vertical bar"],[8686,"upwards thick double arrow"],[8687,"upwards thick double arrow on pedestal"],[8688,"rightwards thick arrow from wal"],[8689,"north west arrow to corner"],[8690,"south east arrow to corner"],[8691,"up down thick arrow"],[8692,"right arrow with smal circle"],[8693,"downwards arrow leftwards of upwards arrow"],[8694,"Three rightwards arrows"],[8695,"leftwards arrow with vertical stroke"],[8696,"rightwards arrow with vertical stroke"],[8697,"left right arrow with vertical stroke"],[8698,"leftwards arrow with double vertical stroke"],[8699,"rightwards arrow with double vertical stroke"],[8700,"left right arrow with double vertical stroke"],[8701,"leftwards open-headed arrow"],[8702,"rightwards open-headed arrow"],[8703,"left right open-headed arrow"],[10146,"black small arrowhead"]]},{name:"Other",characters:[[9633,"white square"],[9642,"black small square"],[9643,"white medium square"],[9745,"ballot box with check"],[9786,"white smiling face"],[9826,"black diamond suit"],[9984,"black safety scissors"],[9985,"upper blade scissors"],[9986,"black scissors"],[9987,"lower blade scissors"],[9988,"white scissors"],[9998,"lower right pencil"],[10022,"black diamond"],[10004,"heavy check mark"]]}]);return r.length>1?[{name:"All",characters:(t=r,o=e=>e.characters,(e=>{const r=[];for(let t=0,o=e.length;t<o;++t){if(!a(e[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+e);u.apply(r,e[t])}return r})(c(t,o)))}].concat(r):r;var t,o},q=e=>{let r=e;return{get:()=>r,set:e=>{r=e}}},v=(e,r,t=0,a)=>{const o=e.indexOf(r,t);return-1!==o&&(!!i(a)||o+r.length<=a)},k=String.fromCodePoint,y=(e,r)=>{const t=[],a=r.toLowerCase();return(e=>{for(let o=0,i=e.length;o<i;o++)((e,r,t)=>!!v(k(e).toLowerCase(),t)||v(r.toLowerCase(),t)||v(r.toLowerCase().replace(/\s+/g,""),t))((r=e[o])[0],r[1],a)&&t.push(r);var r})(e.characters),c(t,(e=>({text:e[1],value:k(e[0]),icon:k(e[0])})))},x="pattern",C=(e,t)=>{const a=()=>[{label:"Search",type:"input",name:x},{type:"collection",name:"results"}],i=1===t.length?q(p):q("All"),s=(e=>{let r=null;const t=()=>{o(r)||(clearTimeout(r),r=null)};return{cancel:t,throttle:(...a)=>{t(),r=setTimeout((()=>{r=null,e.apply(null,a)}),40)}}})((e=>{const r=e.getData().pattern;((e,r)=>{var a,o;(a=t,o=e=>e.name===i.get(),((e,r,t)=>{for(let a=0,o=e.length;a<o;a++){const o=e[a];if(r(o,a))return l.some(o);if(t(o,a))break}return l.none()})(a,o,n)).each((t=>{const a=y(t,r);e.setData({results:a})}))})(e,r)})),u={title:"Special Character",size:"normal",body:1===t.length?{type:"panel",items:a()}:{type:"tabpanel",tabs:c(t,(e=>({title:e.name,name:e.name,items:a()})))},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{pattern:"",results:y(t[0],"")},onAction:(t,a)=>{"results"===a.name&&(r(e,a.value),t.close())},onTabChange:(e,r)=>{i.set(r.newTabName),s.throttle(e)},onChange:(e,r)=>{r.name===x&&s.throttle(e)}};e.windowManager.open(u).focus(x)},A=e=>r=>{const t=()=>{r.setEnabled(e.selection.isEditable())};return e.on("NodeChange",t),t(),()=>{e.off("NodeChange",t)}};e.add("charmap",(e=>{(e=>{const r=e.options.register,t=e=>s(e)||a(e);r("charmap",{processor:t}),r("charmap_append",{processor:t})})(e);const t=b(e);return((e,r)=>{e.addCommand("mceShowCharmap",(()=>{C(e,r)}))})(e,t),(e=>{const r=()=>e.execCommand("mceShowCharmap");e.ui.registry.addButton("charmap",{icon:"insert-character",tooltip:"Special character",onAction:r,onSetup:A(e)}),e.ui.registry.addMenuItem("charmap",{icon:"insert-character",text:"Special character...",onAction:r,onSetup:A(e)})})(e),((e,r)=>{e.ui.registry.addAutocompleter("charmap",{trigger:":",columns:"auto",minChars:2,fetch:(e,t)=>new Promise(((t,a)=>{t(y(r,e))})),onAction:(r,t,a)=>{e.selection.setRng(t),e.insertContent(a),r.hide()}})})(e,t[0]),(e=>({getCharMap:()=>b(e),insertChar:t=>{r(e,t)}}))(e)}))}();
@@ -959,6 +959,7 @@
959
959
  };
960
960
  });
961
961
  const defaultCellBorderStyles = map([
962
+ 'None',
962
963
  'Solid',
963
964
  'Dotted',
964
965
  'Dashed',
@@ -967,7 +968,6 @@
967
968
  'Ridge',
968
969
  'Inset',
969
970
  'Outset',
970
- 'None',
971
971
  'Hidden'
972
972
  ], type => {
973
973
  return {
@@ -1838,16 +1838,18 @@
1838
1838
  };
1839
1839
  const getAdvancedTab = (editor, dialogName) => {
1840
1840
  const emptyBorderStyle = [{
1841
- text: 'Select...',
1842
- value: ''
1841
+ text: 'None',
1842
+ value: 'none'
1843
1843
  }];
1844
+ const isDefinedDefaultBorderStyle = getDefaultStyles(editor)['border-style'];
1845
+ const optionsContainNone = getTableBorderStyles(editor).some(item => item.value === 'none');
1844
1846
  const advTabItems = [
1845
1847
  {
1846
1848
  name: 'borderstyle',
1847
1849
  type: 'listbox',
1848
1850
  label: 'Border style',
1849
1851
  tooltip: getBorderStyleTooltip(dialogName),
1850
- items: emptyBorderStyle.concat(buildListItems(getTableBorderStyles(editor)))
1852
+ items: (!isDefinedDefaultBorderStyle && !optionsContainNone ? emptyBorderStyle : []).concat(buildListItems(getTableBorderStyles(editor)))
1851
1853
  },
1852
1854
  {
1853
1855
  name: 'bordercolor',
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * TinyMCE version 7.0.0 (TBD)
3
3
  */
4
- !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=l=e,(n=String).prototype.isPrototypeOf(o)||(null===(r=l.constructor)||void 0===r?void 0:r.name)===n.name)?"string":t;var o,l,n,r})(t)===e,o=e=>t=>typeof t===e,l=t("string"),n=t("array"),r=o("boolean"),a=e=>undefined===e;const s=e=>!(e=>null==e)(e),c=o("function"),i=o("number"),d=()=>{},m=e=>()=>e,u=e=>e,p=(e,t)=>e===t;function b(e,...t){return(...o)=>{const l=t.concat(o);return e.apply(null,l)}}const g=e=>{e()},h=m(!1),f=m(!0);class y{constructor(e,t){this.tag=e,this.value=t}static some(e){return new y(!0,e)}static none(){return y.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?y.some(e(this.value)):y.none()}bind(e){return this.tag?e(this.value):y.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:y.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return s(e)?y.some(e):y.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}y.singletonNone=new y(!1);const w=Object.keys,S=Object.hasOwnProperty,C=(e,t)=>{const o=w(e);for(let l=0,n=o.length;l<n;l++){const n=o[l];t(e[n],n)}},v=(e,t)=>{const o={};var l;return((e,t,o,l)=>{C(e,((e,n)=>{(t(e,n)?o:l)(e,n)}))})(e,t,(l=o,(e,t)=>{l[t]=e}),d),o},x=e=>w(e).length,T=(e,t)=>A(e,t)?y.from(e[t]):y.none(),A=(e,t)=>S.call(e,t),R=(e,t)=>A(e,t)&&void 0!==e[t]&&null!==e[t],O=Array.prototype.indexOf,_=Array.prototype.push,D=(e,t)=>((e,t)=>O.call(e,t))(e,t)>-1,I=(e,t)=>{for(let o=0,l=e.length;o<l;o++)if(t(e[o],o))return!0;return!1},N=(e,t)=>{const o=[];for(let l=0;l<e;l++)o.push(t(l));return o},M=(e,t)=>{const o=e.length,l=new Array(o);for(let n=0;n<o;n++){const o=e[n];l[n]=t(o,n)}return l},P=(e,t)=>{for(let o=0,l=e.length;o<l;o++)t(e[o],o)},k=(e,t)=>{const o=[];for(let l=0,n=e.length;l<n;l++){const n=e[l];t(n,l)&&o.push(n)}return o},E=(e,t,o)=>(P(e,((e,l)=>{o=t(o,e,l)})),o),B=(e,t)=>((e,t,o)=>{for(let l=0,n=e.length;l<n;l++){const n=e[l];if(t(n,l))return y.some(n);if(o(n,l))break}return y.none()})(e,t,h),F=(e,t)=>(e=>{const t=[];for(let o=0,l=e.length;o<l;++o){if(!n(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);_.apply(t,e[o])}return t})(M(e,t)),q=(e,t)=>{for(let o=0,l=e.length;o<l;++o)if(!0!==t(e[o],o))return!1;return!0},L=(e,t)=>t>=0&&t<e.length?y.some(e[t]):y.none(),H=(e,t)=>{for(let o=0;o<e.length;o++){const l=t(e[o],o);if(l.isSome())return l}return y.none()},j=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},V={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return j(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return j(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return j(o)},fromDom:j,fromPoint:(e,t,o)=>y.from(e.dom.elementFromPoint(t,o)).map(j)},$=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},W=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,z=(e,t)=>e.dom===t.dom,U=$;"undefined"!=typeof window?window:Function("return this;")();const G=e=>e.dom.nodeName.toLowerCase(),K=e=>e.dom.nodeType,J=e=>t=>K(t)===e,Q=J(1),X=J(3),Y=J(9),Z=J(11),ee=e=>t=>Q(t)&&G(t)===e,te=e=>Y(e)?e:V.fromDom(e.dom.ownerDocument),oe=e=>y.from(e.dom.parentNode).map(V.fromDom),le=e=>y.from(e.dom.nextSibling).map(V.fromDom),ne=e=>M(e.dom.childNodes,V.fromDom),re=c(Element.prototype.attachShadow)&&c(Node.prototype.getRootNode)?e=>V.fromDom(e.dom.getRootNode()):te,ae=e=>V.fromDom(e.dom.host),se=e=>{const t=X(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return(e=>{const t=re(e);return Z(o=t)&&s(o.dom.host)?y.some(t):y.none();var o})(V.fromDom(t)).fold((()=>o.body.contains(t)),(l=se,n=ae,e=>l(n(e))));var l,n};var ce=(e,t,o,l,n)=>e(o,l)?y.some(o):c(n)&&n(o)?y.none():t(o,l,n);const ie=(e,t,o)=>{let l=e.dom;const n=c(o)?o:h;for(;l.parentNode;){l=l.parentNode;const e=V.fromDom(l);if(t(e))return y.some(e);if(n(e))break}return y.none()},de=(e,t,o)=>ie(e,(e=>$(e,t)),o),me=(e,t)=>(e=>B(e.dom.childNodes,(e=>{return o=V.fromDom(e),$(o,t);var o})).map(V.fromDom))(e),ue=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return W(o)?y.none():y.from(o.querySelector(e)).map(V.fromDom)})(t,e),pe=(e,t,o)=>ce(((e,t)=>$(e,t)),de,e,t,o),be=(e,t=!1)=>{return se(e)?e.dom.isContentEditable:(o=e,pe(o,"[contenteditable]")).fold(m(t),(e=>"true"===ge(e)));var o},ge=e=>e.dom.contentEditable,he=e=>t=>z(t,(e=>V.fromDom(e.getBody()))(e)),fe=e=>/^\d+(\.\d+)?$/.test(e)?e+"px":e,ye=e=>V.fromDom(e.selection.getStart()),we=(e,t)=>{let o=[];return P(ne(e),(e=>{t(e)&&(o=o.concat([e])),o=o.concat(we(e,t))})),o},Se=(e,t)=>(e=>k(ne(e),(e=>$(e,t))))(e),Ce=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return W(o)?[]:M(o.querySelectorAll(e),V.fromDom)})(t,e),ve=(e,t,o)=>{if(!(l(o)||r(o)||i(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},xe=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},Te=(e,t)=>y.from(xe(e,t)),Ae=(e,t)=>{e.dom.removeAttribute(t)},Re=(e,t,o=p)=>e.exists((e=>o(e,t))),Oe=(e,t,o)=>e.isSome()&&t.isSome()?y.some(o(e.getOrDie(),t.getOrDie())):y.none(),_e=(e,t)=>((e,t)=>""===t||e.length>=t.length&&e.substr(0,0+t.length)===t)(e,t),De=(Ie=/^\s+|\s+$/g,e=>e.replace(Ie,""));var Ie;const Ne=e=>e.length>0,Me=(e,t=10)=>{const o=parseInt(e,t);return isNaN(o)?y.none():y.some(o)},Pe=e=>void 0!==e.style&&c(e.style.getPropertyValue),ke=(e,t)=>{const o=e.dom,l=window.getComputedStyle(o).getPropertyValue(t);return""!==l||se(e)?l:Ee(o,t)},Ee=(e,t)=>Pe(e)?e.style.getPropertyValue(t):"",Be=(e,t)=>{const o=e.dom,l=Ee(o,t);return y.from(l).filter((e=>e.length>0))},Fe=(e,t,o=0)=>Te(e,t).map((e=>parseInt(e,10))).getOr(o),qe=(e,t)=>Le(e,t,f),Le=(e,t,o)=>F(ne(e),(e=>$(e,t)?o(e)?[e]:[]:Le(e,t,o))),He=["tfoot","thead","tbody","colgroup"],je=(e,t,o)=>({element:e,rowspan:t,colspan:o}),Ve=(e,t,o)=>({element:e,cells:t,section:o}),$e=(e,t)=>pe(e,"table",t),We=e=>qe(e,"tr"),ze=e=>$e(e).fold(m([]),(e=>Se(e,"colgroup"))),Ue=e=>oe(e).map((e=>{const t=G(e);return(e=>D(He,e))(t)?t:"tbody"})).getOr("tbody"),Ge=e=>Te(e,"data-snooker-locked-cols").bind((e=>y.from(e.match(/\d+/g)))).map((e=>((e,t)=>{const o={};for(let l=0,n=e.length;l<n;l++){const n=e[l];o[String(n)]=t(n,l)}return o})(e,f))),Ke=(e,t)=>e+","+t,Je=e=>{const t={},o=[];var l;const n=(l=e,L(l,0)).map((e=>e.element)).bind($e).bind(Ge).getOr({});let r=0,a=0,s=0;const{pass:c,fail:i}=(e=>{const t=[],o=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];(l=r,"colgroup"===l.section?t:o).push(r)}var l;return{pass:t,fail:o}})(e);P(i,(e=>{const l=[];P(e.cells,(e=>{let o=0;for(;void 0!==t[Ke(s,o)];)o++;const r=R(n,o.toString()),c=((e,t,o,l,n,r)=>({element:e,rowspan:t,colspan:o,row:l,column:n,isLocked:r}))(e.element,e.rowspan,e.colspan,s,o,r);for(let l=0;l<e.colspan;l++)for(let n=0;n<e.rowspan;n++){const e=o+l,r=Ke(s+n,e);t[r]=c,a=Math.max(a,e+1)}l.push(c)})),r++,o.push(Ve(e.element,l,e.section)),s++}));const{columns:d,colgroups:m}=(e=>L(e,e.length-1))(c).map((e=>{const t=(e=>{const t={};let o=0;return P(e.cells,(e=>{const l=e.colspan;N(l,(n=>{const r=o+n;t[r]=((e,t,o)=>({element:e,colspan:t,column:o}))(e.element,l,r)})),o+=l})),t})(e),o=((e,t)=>({element:e,columns:t}))(e.element,((e,t)=>{const o=[];return C(e,((e,l)=>{o.push(t(e,l))})),o})(t,u));return{colgroups:[o],columns:t}})).getOrThunk((()=>({colgroups:[],columns:{}}))),p=((e,t)=>({rows:e,columns:t}))(r,a);return{grid:p,access:t,all:o,columns:d,colgroups:m}},Qe=e=>{const t=(e=>{const t=We(e);return((e,t)=>M(e,(e=>{if("colgroup"===G(e)){const t=M((e=>$(e,"colgroup")?Se(e,"col"):F(ze(e),(e=>Se(e,"col"))))(e),(e=>{const t=Fe(e,"span",1);return je(e,1,t)}));return Ve(e,t,"colgroup")}{const o=M((e=>qe(e,"th,td"))(e),(e=>{const t=Fe(e,"rowspan",1),o=Fe(e,"colspan",1);return je(e,t,o)}));return Ve(e,o,t(e))}})))([...ze(e),...t],Ue)})(e);return Je(t)},Xe=(e,t,o)=>y.from(e.access[Ke(t,o)]),Ye=(e,t,o)=>{const l=((e,t)=>{const o=F(e.all,(e=>e.cells));return k(o,t)})(e,(e=>o(t,e.element)));return l.length>0?y.some(l[0]):y.none()},Ze=(e,t)=>y.from(e.columns[t]);var et=tinymce.util.Tools.resolve("tinymce.util.Tools");const tt=(e,t,o)=>{const l=e.select("td,th",t);let n;for(let t=0;t<l.length;t++){const r=e.getStyle(l[t],o);if(a(n)&&(n=r),n!==r)return""}return n},ot=(e,t,o)=>{et.each("left center right".split(" "),(l=>{l!==o&&e.formatter.remove("align"+l,{},t)})),o&&e.formatter.apply("align"+o,{},t)},lt=(e,t,o)=>{e.dispatch("TableModified",{...o,table:t})},nt=(e,t,o)=>((e,t)=>(e=>{const t=parseFloat(e);return isNaN(t)?y.none():y.some(t)})(e).getOr(t))(ke(e,t),o),rt=e=>((e,t)=>{const o=e.dom,l=o.getBoundingClientRect().width||o.offsetWidth;return"border-box"===t?l:((e,t,o,l)=>t-nt(e,`padding-${o}`,0)-nt(e,`padding-${l}`,0)-nt(e,`border-${o}-width`,0)-nt(e,`border-${l}-width`,0))(e,l,"left","right")})(e,"content-box");var at=tinymce.util.Tools.resolve("tinymce.Env");const st=N(5,(e=>{const t=`${e+1}px`;return{title:t,value:t}})),ct=M(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],(e=>({title:e,value:e.toLowerCase()}))),it="100%",dt=e=>{var t;const o=e.dom,l=null!==(t=o.getParent(e.selection.getStart(),o.isBlock))&&void 0!==t?t:e.getBody();return rt(V.fromDom(l))+"px"},mt=e=>t=>t.options.get(e),ut=mt("table_sizing_mode"),pt=mt("table_border_widths"),bt=mt("table_border_styles"),gt=mt("table_cell_advtab"),ht=mt("table_row_advtab"),ft=mt("table_advtab"),yt=mt("table_cell_inputs"),wt=mt("table_row_inputs"),St=mt("table_inputs"),Ct=mt("table_grid"),vt=mt("table_style_by_css"),xt=mt("table_cell_class_list"),Tt=mt("table_row_class_list"),At=mt("table_class_list"),Rt=mt("table_toolbar"),Ot=mt("table_background_color_map"),_t=mt("table_border_color_map"),Dt=e=>"fixed"===ut(e),It=e=>"responsive"===ut(e),Nt=e=>{const t=e.options,o=t.get("table_default_styles");return t.isSet("table_default_styles")?o:((e,t)=>It(e)||!vt(e)?t:Dt(e)?{...t,width:dt(e)}:{...t,width:it})(e,o)},Mt=e=>{const t=e.options,o=t.get("table_default_attributes");return t.isSet("table_default_attributes")?o:((e,t)=>It(e)||vt(e)?t:Dt(e)?{...t,width:dt(e)}:{...t,width:it})(e,o)},Pt=(e,t)=>t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow,kt=(e,t,o)=>((e,t,o)=>{const l=Ye(e,t,z),n=Ye(e,o,z);return l.bind((e=>n.map((t=>{return o=e,l=t,{startRow:Math.min(o.row,l.row),startCol:Math.min(o.column,l.column),finishRow:Math.max(o.row+o.rowspan-1,l.row+l.rowspan-1),finishCol:Math.max(o.column+o.colspan-1,l.column+l.colspan-1)};var o,l}))))})(e,t,o).bind((t=>((e,t)=>{let o=!0;const l=b(Pt,t);for(let n=t.startRow;n<=t.finishRow;n++)for(let r=t.startCol;r<=t.finishCol;r++)o=o&&Xe(e,n,r).exists(l);return o?y.some(t):y.none()})(e,t))),Et=Qe,Bt=(e,t)=>{oe(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},Ft=(e,t)=>{le(e).fold((()=>{oe(e).each((e=>{qt(e,t)}))}),(e=>{Bt(e,t)}))},qt=(e,t)=>{e.dom.appendChild(t.dom)},Lt=(e,t)=>{P(t,((o,l)=>{const n=0===l?e:t[l-1];Ft(n,o)}))},Ht=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},jt=(e=>{const t=t=>e(t)?y.from(t.dom.nodeValue):y.none();return{get:o=>{if(!e(o))throw new Error("Can only get text value of a text node");return t(o).getOr("")},getOption:t,set:(t,o)=>{if(!e(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=o}}})(X);var Vt=["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"];const $t=(e,t,o,l)=>{const n=t(e,o);return r=(o,l)=>{const n=t(e,l);return Wt(e,o,n)},a=n,((e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o],o)})(l,((e,t)=>{a=r(a,e)})),a;var r,a},Wt=(e,t,o)=>t.bind((t=>o.filter(b(e.eq,t)))),zt={up:m({selector:de,closest:pe,predicate:ie,all:(e,t)=>{const o=c(t)?t:h;let l=e.dom;const n=[];for(;null!==l.parentNode&&void 0!==l.parentNode;){const e=l.parentNode,t=V.fromDom(e);if(n.push(t),!0===o(t))break;l=e}return n}}),down:m({selector:Ce,predicate:we}),styles:m({get:ke,getRaw:Be,set:(e,t,o)=>{((e,t,o)=>{if(!l(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);Pe(e)&&e.style.setProperty(t,o)})(e.dom,t,o)},remove:(e,t)=>{((e,t)=>{Pe(e)&&e.style.removeProperty(t)})(e.dom,t),Re(Te(e,"style").map(De),"")&&Ae(e,"style")}}),attrs:m({get:xe,set:(e,t,o)=>{ve(e.dom,t,o)},remove:Ae,copyTo:(e,t)=>{((e,t)=>{const o=e.dom;C(t,((e,t)=>{ve(o,t,e)}))})(t,E(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}))}}),insert:m({before:Bt,after:Ft,afterAll:Lt,append:qt,appendAll:(e,t)=>{P(t,(t=>{qt(e,t)}))},prepend:(e,t)=>{(e=>(e=>{const t=e.dom.childNodes;return y.from(t[0]).map(V.fromDom)})(e))(e).fold((()=>{qt(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},wrap:(e,t)=>{Bt(e,t),qt(t,e)}}),remove:m({unwrap:e=>{const t=ne(e);t.length>0&&Lt(e,t),Ht(e)},remove:Ht}),create:m({nu:V.fromTag,clone:e=>V.fromDom(e.dom.cloneNode(!1)),text:V.fromText}),query:m({comparePosition:(e,t)=>e.dom.compareDocumentPosition(t.dom),prevSibling:e=>y.from(e.dom.previousSibling).map(V.fromDom),nextSibling:le}),property:m({children:ne,name:G,parent:oe,document:e=>te(e).dom,isText:X,isComment:e=>8===K(e)||"#comment"===G(e),isElement:Q,isSpecial:e=>{const t=G(e);return D(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},getLanguage:e=>Q(e)?Te(e,"lang"):y.none(),getText:e=>jt.get(e),setText:(e,t)=>jt.set(e,t),isBoundary:e=>!!Q(e)&&("body"===G(e)||D(Vt,G(e))),isEmptyTag:e=>!!Q(e)&&D(["br","img","hr","input"],G(e)),isNonEditable:e=>Q(e)&&"false"===xe(e,"contenteditable")}),eq:z,is:U},Ut=e=>de(e,"table"),Gt=(e,t,o)=>ue(e,t).bind((t=>ue(e,o).bind((e=>{return(o=Ut,l=[t,e],((e,t,o)=>o.length>0?((e,t,o,l)=>l(e,t,o[0],o.slice(1)))(e,t,o,$t):y.none())(zt,((e,t)=>o(t)),l)).map((o=>({first:t,last:e,table:o})));var o,l})))),Kt=e=>M(e,V.fromDom),Jt="data-mce-selected",Qt="data-mce-first-selected",Xt="data-mce-last-selected",Yt={selected:Jt,selectedSelector:"td["+Jt+"],th["+Jt+"]",firstSelected:Qt,firstSelectedSelector:"td["+Qt+"],th["+Qt+"]",lastSelected:Xt,lastSelectedSelector:"td["+Xt+"],th["+Xt+"]"},Zt=e=>(t,o)=>{const l=G(t),n="col"===l||"colgroup"===l?$e(r=t).bind((e=>((e,t)=>((e,t)=>{const o=Ce(e,t);return o.length>0?y.some(o):y.none()})(e,t))(e,Yt.firstSelectedSelector))).fold(m(r),(e=>e[0])):t;var r;return pe(n,e,o)},eo=Zt("th,td,caption"),to=Zt("th,td"),oo=e=>Kt(e.model.table.getSelectedCells()),lo=(e,t)=>{const o=to(e),l=o.bind((e=>$e(e))).map((e=>We(e)));return Oe(o,l,((e,o)=>k(o,(o=>I(Kt(o.dom.cells),(o=>"1"===xe(o,t)||z(o,e))))))).getOr([])},no=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],ro=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,ao=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,so=e=>{return(t=e,_e(t,"#")?(e=>e.substring(1))(t):t).toUpperCase();var t},co=e=>{const t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},io=e=>{return t=co(e.red)+co(e.green)+co(e.blue),{value:so(t)};var t},mo=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,uo=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,po=(e,t,o,l)=>({red:e,green:t,blue:o,alpha:l}),bo=(e,t,o,l)=>{const n=parseInt(e,10),r=parseInt(t,10),a=parseInt(o,10),s=parseFloat(l);return po(n,r,a,s)},go=e=>{if("transparent"===e)return y.some(po(0,0,0,0));const t=mo.exec(e);if(null!==t)return y.some(bo(t[1],t[2],t[3],"1"));const o=uo.exec(e);return null!==o?y.some(bo(o[1],o[2],o[3],o[4])):y.none()},ho=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},fo=(e,t,o)=>l=>{const n=(e=>{const t=ho(y.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(y.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(y.some(e))}}})((e=>e.unbind())),r=!Ne(o),a=()=>{const a=oo(e),s=l=>e.formatter.match(t,{value:o},l.dom,r);r?(l.setActive(!I(a,s)),n.set(e.formatter.formatChanged(t,(e=>l.setActive(!e)),!0))):(l.setActive(q(a,s)),n.set(e.formatter.formatChanged(t,l.setActive,!1,{value:o})))};return e.initialized?a():e.on("init",a),n.clear},yo=e=>R(e,"menu"),wo=e=>M(e,(e=>{const t=e.text||e.title||"";return yo(e)?{text:t,items:wo(e.menu)}:{text:t,value:e.value}})),So=e=>e.length?y.some(wo([{text:"Select...",value:"mce-no-match"},...e])):y.none(),Co=(e,t,o,l)=>M(t,(t=>{const n=t.text||t.title;return yo(t)?{type:"nestedmenuitem",text:n,getSubmenuItems:()=>Co(e,t.menu,o,l)}:{text:n,type:"togglemenuitem",onAction:()=>l(t.value),onSetup:fo(e,o,t.value)}})),vo=(e,t)=>o=>{e.execCommand("mceTableApplyCellStyle",!1,{[t]:o})},xo=e=>F(e,(e=>yo(e)?[{...e,menu:xo(e.menu)}]:Ne(e.value)?[e]:[])),To=(e,t,o,l)=>n=>n(Co(e,t,o,l)),Ao=(e,t,o)=>{const l=M(t,(e=>{return{text:e.title,value:"#"+(o=e.value,(t=o,(e=>ro.test(e)||ao.test(e))(t)?y.some({value:so(t)}):y.none()).orThunk((()=>go(o).map(io))).getOrThunk((()=>{const e=document.createElement("canvas");e.height=1,e.width=1;const t=e.getContext("2d");t.clearRect(0,0,e.width,e.height),t.fillStyle="#FFFFFF",t.fillStyle=o,t.fillRect(0,0,1,1);const l=t.getImageData(0,0,1,1).data,n=l[0],r=l[1],a=l[2],s=l[3];return io(po(n,r,a,s))}))).value,type:"choiceitem"};var t,o}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:l.length>0?l:void 0,allowCustomColors:!1},onAction:t=>{const l="remove"===t.value?"":t.value;e.execCommand("mceTableApplyCellStyle",!1,{[o]:l})}}]},Ro=e=>()=>{const t="header"===e.queryCommandValue("mceTableRowType")?"body":"header";e.execCommand("mceTableRowType",!1,{type:t})},Oo=e=>()=>{const t="th"===e.queryCommandValue("mceTableColType")?"td":"th";e.execCommand("mceTableColType",!1,{type:t})},_o=[{name:"width",type:"input",label:"Width",tooltip:"Cell width in pixels or percentage (e.g., 50px or 10%)."},{name:"celltype",type:"listbox",label:"Cell type",tooltip:"Select the type of cell to apply formatting or styling to.",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",tooltip:"Defines the scope of the header cell to specify its relationship to rows or columns.",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",tooltip:"Horizontal alignment of the cell content.",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",tooltip:"Vertical alignment of the cell content.",items:no}],Do=e=>{const t=yt(e).split(" "),o=_o.concat((e=>So(xt(e)).map((e=>({name:"class",type:"listbox",label:"Class",items:e}))))(e).toArray());return o.filter((e=>"name"in e&&t.includes(e.name))).sort(((e,o)=>{const l="name"in e?e.name:"",n="name"in o?o.name:"";return t.indexOf(l)-t.indexOf(n)}))},Io=e=>`Style of the outer border of the ${e}.`,No=e=>{switch(e){case"table":return"Color of the border for the entire table and individual cells.";case"row":case"cell":return`Color of the outer border of the ${e}.`}},Mo=e=>{switch(e){case"table":return"Changes the background color of all cells in the table, except for those set individually through Cell Properties or Row Properties.";case"row":return"Changes the background color of all cells in the row, except for those set individually through Cell Properties.";case"cell":return"Background color of the cell."}},Po=e=>{switch(e){case"table":case"row":return;case"cell":return"Width of the outer border of the cell."}},ko=(e,t)=>{const o=[{name:"borderstyle",type:"listbox",label:"Border style",tooltip:Io(t),items:[{text:"Select...",value:""}].concat(wo(bt(e)))},{name:"bordercolor",type:"colorinput",label:"Border color",tooltip:No(t)},{name:"backgroundcolor",type:"colorinput",label:"Background color",tooltip:Mo(t)}],l={name:"borderwidth",type:"input",label:"Border width",tooltip:Po(t)};return{title:"Advanced",name:"advanced",items:"cell"===t?[l].concat(o):o}},Eo=(e,t)=>{const o=e.dom;return{setAttrib:(e,l)=>{o.setAttrib(t,e,l)},setStyle:(e,l)=>{o.setStyle(t,e,l)},setFormat:(o,l)=>{""===l?e.formatter.remove(o,{value:null},t,!0):e.formatter.apply(o,{value:l},t)}}},Bo=ee("th"),Fo=(e,t)=>e&&t?"sectionCells":e?"section":"cells",qo=e=>{const t=M(e,(e=>(e=>{const t="thead"===e.section,o=Re((e=>{const t=k(e,(e=>Bo(e.element)));return 0===t.length?y.some("td"):t.length===e.length?y.some("th"):y.none()})(e.cells),"th");return"tfoot"===e.section?{type:"footer"}:t||o?{type:"header",subType:Fo(t,o)}:{type:"body"}})(e).type)),o=D(t,"header"),l=D(t,"footer");if(o||l){const e=D(t,"body");return!o||e||l?o||e||!l?y.none():y.some("footer"):y.some("header")}return y.some("body")},Lo=(e,t)=>H(e.all,(e=>B(e.cells,(e=>z(t,e.element))))),Ho=(e,t,o)=>{const l=(e=>{const t=[],o=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(o);return t})(M(t.selection,(t=>{return(l=t,((e,t,o=h)=>o(t)?y.none():D(e,G(t))?y.some(t):de(t,e.join(","),(e=>$(e,"table")||o(e))))(["td","th"],l,n)).bind((t=>Lo(e,t))).filter(o);var l,n})));return n=l,l.length>0?y.some(n):y.none();var n},jo=(e,t)=>Ho(e,t,f),Vo=(e,t)=>q(t,(t=>((e,t)=>Lo(e,t).exists((e=>!e.isLocked)))(e,t))),$o=(e,t)=>((e,t)=>t.mergable)(0,t).filter((t=>Vo(e,t.cells))),Wo=(e,t)=>((e,t)=>t.unmergable)(0,t).filter((t=>Vo(e,t))),zo=((e=>{if(!n(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};P(e,((l,r)=>{const a=w(l);if(1!==a.length)throw new Error("one and only one name per case");const s=a[0],c=l[s];if(void 0!==o[s])throw new Error("duplicate key detected:"+s);if("cata"===s)throw new Error("cannot have a case named cata (sorry)");if(!n(c))throw new Error("case arguments must be an array");t.push(s),o[s]=(...o)=>{const l=o.length;if(l!==c.length)throw new Error("Wrong number of arguments to case "+s+". Expected "+c.length+" ("+c+"), got "+l);return{fold:(...t)=>{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,o)},match:e=>{const l=w(e);if(t.length!==l.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+l.join(","));if(!q(t,(e=>D(l,e))))throw new Error("Not all branches were specified when using match. Specified: "+l.join(", ")+"\nRequired: "+t.join(", "));return e[s].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:s,params:o})}}}}))})([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),(e,t)=>{const o=Qe(e);return jo(o,t).bind((e=>{const t=e[e.length-1],l=e[0].row,n=t.row+t.rowspan,r=o.all.slice(l,n);return qo(r)})).getOr("")}),Uo=e=>{return _e(e,"rgb")?go(t=e).map(io).map((e=>"#"+e.value)).getOr(t):e;var t},Go=e=>{const t=V.fromDom(e);return{borderwidth:Be(t,"border-width").getOr(""),borderstyle:Be(t,"border-style").getOr(""),bordercolor:Be(t,"border-color").map(Uo).getOr(""),backgroundcolor:Be(t,"background-color").map(Uo).getOr("")}},Ko=e=>{const t=e[0],o=e.slice(1);return P(o,(e=>{P(w(t),(o=>{C(e,((e,l)=>{const n=t[o];""!==n&&o===l&&n!==e&&(t[o]="class"===o?"mce-no-match":"")}))}))})),t},Jo=(e,t,o,l)=>B(e,(e=>!a(o.formatter.matchNode(l,t+e)))).getOr(""),Qo=b(Jo,["left","center","right"],"align"),Xo=b(Jo,["top","middle","bottom"],"valign"),Yo=e=>$e(V.fromDom(e)).map((t=>{const o={selection:Kt(e.cells)};return zo(t,o)})).getOr(""),Zo=(e,t)=>{if(!t||"double"!==t)return e;const o=parseFloat(e);return void 0!==o&&(0===o||o>=3)?e:"3px"},el=(e,t)=>{const o=Qe(e),l=(e=>F(e.all,(e=>e.cells)))(o),n=k(l,(e=>I(t,(t=>z(e.element,t)))));return M(n,(e=>({element:e.element.dom,column:Ze(o,e.column).map((e=>e.element.dom))})))},tl=(e,t,o,l)=>{const n=l.getData();l.close(),e.undoManager.transact((()=>{((e,t,o,l)=>{const n=v(l,((e,t)=>o[t]!==e));x(n)>0&&t.length>=1&&$e(t[0]).each((o=>{const r=el(o,t),a=x(v(n,((e,t)=>"scope"!==t&&"celltype"!==t)))>0,s=A(n,"celltype");(a||A(n,"scope"))&&((e,t,o,l)=>{const n=1===t.length;P(t,(t=>{const r=t.element,a=n?f:l,s=Eo(e,r);((e,t,o,l)=>{l("scope")&&e.setAttrib("scope",o.scope),l("class")&&"mce-no-match"!==o.class&&e.setAttrib("class",o.class),l("width")&&t.setStyle("width",fe(o.width))})(s,t.column.map((t=>Eo(e,t))).getOr(s),o,a),gt(e)&&((e,t,o)=>{if(o("backgroundcolor")&&e.setFormat("tablecellbackgroundcolor",t.backgroundcolor),o("bordercolor")&&e.setFormat("tablecellbordercolor",t.bordercolor),o("borderstyle")&&e.setFormat("tablecellborderstyle",t.borderstyle),o("borderwidth")||"double"===t.borderstyle){const o=Zo(t.borderwidth,t.borderstyle);e.setFormat("tablecellborderwidth",fe(o))}})(s,o,a),l("halign")&&ot(e,r,o.halign),l("valign")&&((e,t,o)=>{et.each("top middle bottom".split(" "),(l=>{l!==o&&e.formatter.remove("valign"+l,{},t)})),o&&e.formatter.apply("valign"+o,{},t)})(e,r,o.valign)}))})(e,r,l,b(A,n)),s&&((e,t)=>{e.execCommand("mceTableCellType",!1,{type:t.celltype,no_events:!0})})(e,l),lt(e,o.dom,{structure:s,style:a})}))})(e,t,o,n),e.focus()}))},ol=e=>{const t=oo(e);if(0===t.length)return;const o=((e,t)=>{const o=$e(t[0]).map((o=>M(el(o,t),(t=>((e,t,o,l)=>{const n=e.dom;return{width:(a=l.getOr(t),s="width",n.getStyle(a,s)||n.getAttrib(a,s)),scope:n.getAttrib(t,"scope"),celltype:(r=t,r.nodeName.toLowerCase()),class:n.getAttrib(t,"class",""),halign:Qo(e,t),valign:Xo(e,t),...o?Go(t):{}};var r,a,s})(e,t.element,gt(e),t.column)))));return Ko(o.getOrDie())})(e,t),l={type:"tabpanel",tabs:[{title:"General",name:"general",items:Do(e)},ko(e,"cell")]},n={type:"panel",items:[{type:"grid",columns:2,items:Do(e)}]};e.windowManager.open({title:"Cell Properties",size:"normal",body:gt(e)?l:n,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:b(tl,e,t,o)})},ll=[{type:"listbox",name:"type",label:"Row type",tooltip:"Select the type of row to apply formatting or styling to.",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",tooltip:"Alignment of the content within the cells in the row.",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input",tooltip:"Row height in pixels (e.g., 20px)."}],nl=e=>{const t=wt(e).split(" "),o=ll.concat((e=>So(Tt(e)).map((e=>({name:"class",type:"listbox",label:"Class",items:e}))))(e).toArray());return o.filter((e=>"name"in e&&t.includes(e.name))).sort(((e,o)=>{const l="name"in e?e.name:"",n="name"in o?o.name:"";return t.indexOf(l)-t.indexOf(n)}))},rl=(e,t,o,l)=>{const n=l.getData();l.close(),e.undoManager.transact((()=>{((e,t,o,l)=>{const n=v(l,((e,t)=>o[t]!==e));if(x(n)>0){const o=A(n,"type"),r=!o||x(n)>1;r&&((e,t,o,l)=>{const n=1===t.length?f:l;P(t,(t=>{const r=Se(V.fromDom(t),"td,th"),a=Eo(e,t);((e,t,o)=>{o("class")&&"mce-no-match"!==t.class&&e.setAttrib("class",t.class),o("height")&&e.setStyle("height",fe(t.height))})(a,o,n),ht(e)&&((e,t,o)=>{o("backgroundcolor")&&e.setStyle("background-color",t.backgroundcolor),o("bordercolor")&&e.setStyle("border-color",t.bordercolor),o("borderstyle")&&e.setStyle("border-style",t.borderstyle)})(a,o,n),l("height")&&P(r,(t=>{e.dom.setStyle(t.dom,"height",null)})),l("align")&&ot(e,t,o.align)}))})(e,t,l,b(A,n)),o&&((e,t)=>{e.execCommand("mceTableRowType",!1,{type:t.type,no_events:!0})})(e,l),$e(V.fromDom(t[0])).each((t=>lt(e,t.dom,{structure:o,style:r})))}})(e,t,o,n),e.focus()}))},al=e=>{const t=lo(ye(e),Yt.selected);if(0===t.length)return;const o=M(t,(t=>((e,t,o)=>{const l=e.dom;return{height:l.getStyle(t,"height")||l.getAttrib(t,"height"),class:l.getAttrib(t,"class",""),type:Yo(t),align:Qo(e,t),...o?Go(t):{}}})(e,t.dom,ht(e)))),l=Ko(o),n={type:"tabpanel",tabs:[{title:"General",name:"general",items:nl(e)},ko(e,"row")]},r={type:"panel",items:[{type:"grid",columns:2,items:nl(e)}]};e.windowManager.open({title:"Row Properties",size:"normal",body:ht(e)?n:r,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:l,onSubmit:b(rl,e,M(t,(e=>e.dom)),l)})},sl=(e,t,o)=>{const l=o?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],n=[{type:"input",name:"width",label:"Width",tooltip:"Total width of the table in pixels or percentage (e.g., 500px or 100%)."},{type:"input",name:"height",label:"Height",tooltip:"Total height of the table in pixels (e.g., 500px)."},{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric",tooltip:"The space between individual table cells, measured in pixels (e.g., 5px)."},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric",tooltip:"Inner text padding in cells, e.g., 0px 5px (where 0px is vertical padding, and 5px is horizontal padding)."},{type:"input",name:"border",label:"Border width",tooltip:"Width of the border for the entire table and individual cells."},{type:"label",label:"Caption",name:"caption",tooltip:"Adds a caption above the table, which can be edited.",items:[{type:"checkbox",name:"caption",label:"Show caption"}]},{type:"listbox",name:"align",label:"Alignment",tooltip:"Alignment of the entire table (not the content within the table).",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}];t.length>0&&n.push({name:"class",type:"listbox",label:"Class",items:t});const r=St(e).split(" "),a=n.filter((e=>"name"in e&&r.includes(e.name))).sort(((e,t)=>{const o="name"in e?e.name:"",l="name"in t?t.name:"";return r.indexOf(o)-r.indexOf(l)}));return l.concat(a)},cl=(e,t,o,n)=>{if("TD"===t.tagName||"TH"===t.tagName)l(o)&&s(n)?e.setStyle(t,o,n):e.setStyles(t,o);else if(t.children)for(let l=0;l<t.children.length;l++)cl(e,t.children[l],o,n)},il=(e,t,o,l)=>{const n=e.dom,r=l.getData(),s=v(r,((e,t)=>o[t]!==e));l.close(),e.undoManager.transact((()=>{if(!t){const o=Me(r.cols).getOr(1),l=Me(r.rows).getOr(1);e.execCommand("mceInsertTable",!1,{rows:l,columns:o}),t=to(ye(e),he(e)).bind((t=>$e(t,he(e)))).map((e=>e.dom)).getOrDie()}if(x(s)>0){const o={border:A(s,"border"),bordercolor:A(s,"bordercolor"),cellpadding:A(s,"cellpadding")};((e,t,o,l)=>{const n=e.dom,r={},s={},c=vt(e),i=ft(e),d=0===parseFloat(o.border),m=Zo(o.border,o.borderstyle);if(a(o.class)||"mce-no-match"===o.class||(r.class=o.class),s.height=fe(o.height),c?s.width=fe(o.width):n.getAttrib(t,"width")&&(r.width=(e=>e?e.replace(/px$/,""):"")(o.width)),c?(d?(r.border=0,s["border-width"]=""):(s["border-width"]=fe(m),r.border=1),s["border-spacing"]=fe(o.cellspacing)):(r.border=d?0:m,r.cellpadding=o.cellpadding,r.cellspacing=o.cellspacing),c&&t.children){const e={};if(d?e["border-width"]="":l.border&&(e["border-width"]=fe(m)),l.cellpadding&&(e.padding=fe(o.cellpadding)),i&&l.bordercolor&&(e["border-color"]=o.bordercolor),!(e=>{for(const t in e)if(S.call(e,t))return!1;return!0})(e))for(let o=0;o<t.children.length;o++)cl(n,t.children[o],e)}if(i){const e=o;s["background-color"]=e.backgroundcolor,s["border-color"]=e.bordercolor,s["border-style"]=e.borderstyle}n.setStyles(t,{...Nt(e),...s}),n.setAttribs(t,{...Mt(e),...r})})(e,t,r,o);const l=n.select("caption",t)[0];(l&&!r.caption||!l&&r.caption)&&e.execCommand("mceTableToggleCaption"),ot(e,t,r.align)}if(e.focus(),e.addVisual(),x(s)>0){const o=A(s,"caption"),l=!o||x(s)>1;lt(e,t,{structure:o,style:l})}}))},dl=(e,t)=>{const o=e.dom;let l,n=((e,t)=>{const o=Nt(e),l=Mt(e),n=t?{borderstyle:T(o,"border-style").getOr(""),bordercolor:Uo(T(o,"border-color").getOr("")),backgroundcolor:Uo(T(o,"background-color").getOr(""))}:{};return{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:"",...o,...l,...n,...(()=>{const t=o["border-width"];return vt(e)&&t?{border:t}:T(l,"border").fold((()=>({})),(e=>({border:e})))})(),...{...T(o,"border-spacing").or(T(l,"cellspacing")).fold((()=>({})),(e=>({cellspacing:e}))),...T(o,"border-padding").or(T(l,"cellpadding")).fold((()=>({})),(e=>({cellpadding:e})))}}})(e,ft(e));t?(n.cols="1",n.rows="1",ft(e)&&(n.borderstyle="",n.bordercolor="",n.backgroundcolor="")):(l=o.getParent(e.selection.getStart(),"table",e.getBody()),l?n=((e,t,o)=>{const l=e.dom,n=vt(e)?l.getStyle(t,"border-spacing")||l.getAttrib(t,"cellspacing"):l.getAttrib(t,"cellspacing")||l.getStyle(t,"border-spacing"),r=vt(e)?tt(l,t,"padding")||l.getAttrib(t,"cellpadding"):l.getAttrib(t,"cellpadding")||tt(l,t,"padding");return{width:l.getStyle(t,"width")||l.getAttrib(t,"width"),height:l.getStyle(t,"height")||l.getAttrib(t,"height"),cellspacing:null!=n?n:"",cellpadding:null!=r?r:"",border:((t,o)=>{const l=Be(V.fromDom(o),"border-width");return vt(e)&&l.isSome()?l.getOr(""):t.getAttrib(o,"border")||tt(e.dom,o,"border-width")||tt(e.dom,o,"border")||""})(l,t),caption:!!l.select("caption",t)[0],class:l.getAttrib(t,"class",""),align:Qo(e,t),...o?Go(t):{}}})(e,l,ft(e)):ft(e)&&(n.borderstyle="",n.bordercolor="",n.backgroundcolor=""));const r=So(At(e));r.isSome()&&n.class&&(n.class=n.class.replace(/\s*mce\-item\-table\s*/g,""));const a={type:"grid",columns:2,items:sl(e,r.getOr([]),t)},s=ft(e)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[a]},ko(e,"table")]}:{type:"panel",items:[a]};e.windowManager.open({title:"Table Properties",size:"normal",body:s,onSubmit:b(il,e,l,n),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:n})},ml=e=>{C({mceTableProps:b(dl,e,!1),mceTableRowProps:b(al,e),mceTableCellProps:b(ol,e),mceInsertTableDialog:b(dl,e,!0)},((t,o)=>e.addCommand(o,(()=>{return o=t,void((e=>{return(t=e,o=ee("table"),ce(((e,t)=>t(e)),ie,t,o,void 0)).forall(be);var t,o})(ye(e))&&o());var o}))))},ul=u,pl=e=>{const t=(e,t)=>Te(e,t).exists((e=>parseInt(e,10)>1));return e.length>0&&q(e,(e=>t(e,"rowspan")||t(e,"colspan")))?y.some(e):y.none()},bl=(e,t,o)=>{return t.length<=1?y.none():(l=e,n=o.firstSelectedSelector,r=o.lastSelectedSelector,Gt(l,n,r).bind((e=>{const t=e=>z(l,e),o="thead,tfoot,tbody,table",n=de(e.first,o,t),r=de(e.last,o,t);return n.bind((t=>r.bind((o=>z(t,o)?((e,t,o)=>{const l=Et(e);return kt(l,t,o)})(e.table,e.first,e.last):y.none()))))}))).map((e=>({bounds:e,cells:t})));var l,n,r},gl=e=>{const t=ho(y.none()),o=ho([]);let l=y.none();const n=ee("caption"),r=e=>l.forall((t=>!t[e])),a=()=>eo(ye(e),he(e)).bind((t=>{return o=Oe($e(t),eo((e=>V.fromDom(e.selection.getEnd()))(e),he(e)).bind($e),((o,l)=>z(o,l)?n(t)?y.some((e=>({element:e,mergable:y.none(),unmergable:y.none(),selection:[e]}))(t)):y.some(((e,t,o)=>({element:o,mergable:bl(t,e,Yt),unmergable:pl(e),selection:ul(e)}))(oo(e),o,t)):y.none())),o.bind(u);var o})),s=e=>$e(e.element).map((t=>{const o=Qe(t),l=jo(o,e).getOr([]),n=E(l,((e,t)=>(t.isLocked&&(e.onAny=!0,0===t.column?e.onFirst=!0:t.column+t.colspan>=o.grid.columns&&(e.onLast=!0)),e)),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:$o(o,e).isSome(),unmergeable:Wo(o,e).isSome(),locked:n}})),c=()=>{t.set((e=>{let t,o=!1;return(...l)=>(o||(o=!0,t=e.apply(null,l)),t)})(a)()),l=t.get().bind(s),P(o.get(),g)},i=e=>(e(),o.set(o.get().concat([e])),()=>{o.set(k(o.get(),(t=>t!==e)))}),d=(o,l)=>i((()=>t.get().fold((()=>{o.setEnabled(!1)}),(t=>{o.setEnabled(!l(t)&&e.selection.isEditable())})))),m=(o,l,n)=>i((()=>t.get().fold((()=>{o.setEnabled(!1),o.setActive(!1)}),(t=>{o.setEnabled(!l(t)&&e.selection.isEditable()),o.setActive(n(t))})))),p=e=>l.exists((t=>t.locked[e])),b=(t,o)=>l=>m(l,(e=>n(e.element)),(()=>e.queryCommandValue(t)===o)),f=b("mceTableRowType","header"),w=b("mceTableColType","th");return e.on("NodeChange ExecCommand TableSelectorChange",c),{onSetupTable:e=>d(e,(e=>!1)),onSetupCellOrRow:e=>d(e,(e=>n(e.element))),onSetupColumn:e=>t=>d(t,(t=>n(t.element)||p(e))),onSetupPasteable:e=>t=>d(t,(t=>n(t.element)||e().isNone())),onSetupPasteableColumn:(e,t)=>o=>d(o,(o=>n(o.element)||e().isNone()||p(t))),onSetupMergeable:e=>d(e,(e=>r("mergeable"))),onSetupUnmergeable:e=>d(e,(e=>r("unmergeable"))),resetTargets:c,onSetupTableWithCaption:t=>m(t,h,(t=>$e(t.element,he(e)).exists((e=>me(e,"caption").isSome())))),onSetupTableRowHeaders:f,onSetupTableColumnHeaders:w,targets:t.get}};var hl=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const fl="x-tinymce/dom-table-",yl=fl+"rows",wl=fl+"columns",Sl=e=>{var t;const o=null!==(t=hl.read())&&void 0!==t?t:[];return H(o,(t=>y.from(t.getType(e))))},Cl=()=>Sl(yl),vl=()=>Sl(wl),xl=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}},Tl=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}};e.add("table",(e=>{const t=gl(e);(e=>{const t=e.options.register;t("table_border_widths",{processor:"object[]",default:st}),t("table_border_styles",{processor:"object[]",default:ct}),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_cell_inputs",{processor:"string",default:"width celltype scope halign valign class"}),t("table_row_inputs",{processor:"string",default:"type align height class"}),t("table_inputs",{processor:"string",default:"width height cellspacing cellpadding border caption align class"}),t("table_grid",{processor:"boolean",default:!at.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),ml(e),((e,t)=>{const o=t=>()=>e.execCommand(t),l=(t,l)=>!!e.queryCommandSupported(l.command)&&(e.ui.registry.addMenuItem(t,{...l,onAction:c(l.onAction)?l.onAction:o(l.command)}),!0),n=(t,l)=>{e.queryCommandSupported(l.command)&&e.ui.registry.addToggleMenuItem(t,{...l,onAction:c(l.onAction)?l.onAction:o(l.command)})},r=t=>{e.execCommand("mceInsertTable",!1,{rows:t.numRows,columns:t.numColumns})},a=[l("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:t.onSetupCellOrRow}),l("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:t.onSetupCellOrRow}),l("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:t.onSetupCellOrRow}),l("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:t.onSetupCellOrRow}),l("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:t.onSetupCellOrRow}),l("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:t.onSetupCellOrRow}),l("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:t.onSetupPasteable(Cl)}),l("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:t.onSetupPasteable(Cl)})],s=[l("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:t.onSetupColumn("onFirst")}),l("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:t.onSetupColumn("onLast")}),l("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:t.onSetupColumn("onAny")}),l("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:t.onSetupColumn("onAny")}),l("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:t.onSetupColumn("onAny")}),l("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:t.onSetupPasteableColumn(vl,"onFirst")}),l("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:t.onSetupPasteableColumn(vl,"onLast")})],i=[l("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:t.onSetupCellOrRow}),l("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:t.onSetupMergeable}),l("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:t.onSetupUnmergeable})];Ct(e)?e.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"inserttable",onAction:r}],onSetup:Tl(e)}):e.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTableDialog"),onSetup:Tl(e)}),e.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTableDialog"),onSetup:Tl(e)}),l("tableprops",{text:"Table properties",onSetup:t.onSetupTable,command:"mceTableProps"}),l("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:t.onSetupTable,command:"mceTableDelete"}),D(a,!0)&&e.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:m("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),D(s,!0)&&e.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:m("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),D(i,!0)&&e.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:m("tablecellprops tablemergecells tablesplitcells")}),e.ui.registry.addContextMenu("table",{update:()=>(t.resetTargets(),t.targets().fold(m(""),(e=>"caption"===G(e.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable")))});const d=xo(At(e));0!==d.length&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:()=>Co(e,d,"tableclass",(t=>e.execCommand("mceTableToggleClass",!1,t))),onSetup:t.onSetupTable});const u=xo(xt(e));0!==u.length&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:()=>Co(e,u,"tablecellclass",(t=>e.execCommand("mceTableCellToggleClass",!1,t))),onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:()=>Co(e,no,"tablecellverticalalign",vo(e,"vertical-align")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:()=>Co(e,pt(e),"tablecellborderwidth",vo(e,"border-width")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:()=>Co(e,bt(e),"tablecellborderstyle",vo(e,"border-style")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:()=>Ao(e,Ot(e),"background-color"),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:()=>Ao(e,_t(e),"border-color"),onSetup:t.onSetupCellOrRow})),n("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),n("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Ro(e),onSetup:t.onSetupTableRowHeaders}),n("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:Oo(e),onSetup:t.onSetupTableRowHeaders})})(e,t),((e,t)=>{e.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:xl(e),fetch:e=>e("inserttable | cell row column | advtablesort | tableprops deletetable")});const o=t=>()=>e.execCommand(t),l=(t,l)=>{e.queryCommandSupported(l.command)&&e.ui.registry.addButton(t,{...l,onAction:c(l.onAction)?l.onAction:o(l.command)})},n=(t,l)=>{e.queryCommandSupported(l.command)&&e.ui.registry.addToggleButton(t,{...l,onAction:c(l.onAction)?l.onAction:o(l.command)})};l("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:t.onSetupTable}),l("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:t.onSetupTable}),l("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:t.onSetupCellOrRow}),l("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:t.onSetupMergeable}),l("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:t.onSetupUnmergeable}),l("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:t.onSetupCellOrRow}),l("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:t.onSetupCellOrRow}),l("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:t.onSetupCellOrRow}),l("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:t.onSetupCellOrRow}),l("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:t.onSetupColumn("onFirst")}),l("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:t.onSetupColumn("onLast")}),l("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:t.onSetupColumn("onAny")}),l("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:t.onSetupCellOrRow}),l("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:t.onSetupCellOrRow}),l("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:t.onSetupPasteable(Cl)}),l("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:t.onSetupPasteable(Cl)}),l("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:t.onSetupColumn("onAny")}),l("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:t.onSetupColumn("onAny")}),l("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:t.onSetupPasteableColumn(vl,"onFirst")}),l("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:t.onSetupPasteableColumn(vl,"onLast")}),l("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:xl(e)});const r=xo(At(e));0!==r.length&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:To(e,r,"tableclass",(t=>e.execCommand("mceTableToggleClass",!1,t))),onSetup:t.onSetupTable});const a=xo(xt(e));0!==a.length&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:To(e,a,"tablecellclass",(t=>e.execCommand("mceTableCellToggleClass",!1,t))),onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:To(e,no,"tablecellverticalalign",vo(e,"vertical-align")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:To(e,pt(e),"tablecellborderwidth",vo(e,"border-width")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:To(e,bt(e),"tablecellborderstyle",vo(e,"border-style")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:t=>t(Ao(e,Ot(e),"background-color")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:t=>t(Ao(e,_t(e),"border-color")),onSetup:t.onSetupCellOrRow})),n("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),n("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Ro(e),onSetup:t.onSetupTableRowHeaders}),n("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:Oo(e),onSetup:t.onSetupTableColumnHeaders})})(e,t),(e=>{const t=Rt(e);t.length>0&&e.ui.registry.addContextToolbar("table",{predicate:t=>e.dom.is(t,"table")&&e.getBody().contains(t)&&e.dom.isEditable(t.parentNode),items:t,scope:"node",position:"node"})})(e)}))}();
4
+ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=l=e,(n=String).prototype.isPrototypeOf(o)||(null===(r=l.constructor)||void 0===r?void 0:r.name)===n.name)?"string":t;var o,l,n,r})(t)===e,o=e=>t=>typeof t===e,l=t("string"),n=t("array"),r=o("boolean"),a=e=>undefined===e;const s=e=>!(e=>null==e)(e),c=o("function"),i=o("number"),d=()=>{},m=e=>()=>e,u=e=>e,p=(e,t)=>e===t;function b(e,...t){return(...o)=>{const l=t.concat(o);return e.apply(null,l)}}const g=e=>{e()},h=m(!1),f=m(!0);class y{constructor(e,t){this.tag=e,this.value=t}static some(e){return new y(!0,e)}static none(){return y.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?y.some(e(this.value)):y.none()}bind(e){return this.tag?e(this.value):y.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:y.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return s(e)?y.some(e):y.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}y.singletonNone=new y(!1);const w=Object.keys,S=Object.hasOwnProperty,C=(e,t)=>{const o=w(e);for(let l=0,n=o.length;l<n;l++){const n=o[l];t(e[n],n)}},v=(e,t)=>{const o={};var l;return((e,t,o,l)=>{C(e,((e,n)=>{(t(e,n)?o:l)(e,n)}))})(e,t,(l=o,(e,t)=>{l[t]=e}),d),o},x=e=>w(e).length,T=(e,t)=>A(e,t)?y.from(e[t]):y.none(),A=(e,t)=>S.call(e,t),R=(e,t)=>A(e,t)&&void 0!==e[t]&&null!==e[t],O=Array.prototype.indexOf,_=Array.prototype.push,D=(e,t)=>((e,t)=>O.call(e,t))(e,t)>-1,N=(e,t)=>{for(let o=0,l=e.length;o<l;o++)if(t(e[o],o))return!0;return!1},I=(e,t)=>{const o=[];for(let l=0;l<e;l++)o.push(t(l));return o},M=(e,t)=>{const o=e.length,l=new Array(o);for(let n=0;n<o;n++){const o=e[n];l[n]=t(o,n)}return l},P=(e,t)=>{for(let o=0,l=e.length;o<l;o++)t(e[o],o)},k=(e,t)=>{const o=[];for(let l=0,n=e.length;l<n;l++){const n=e[l];t(n,l)&&o.push(n)}return o},E=(e,t,o)=>(P(e,((e,l)=>{o=t(o,e,l)})),o),B=(e,t)=>((e,t,o)=>{for(let l=0,n=e.length;l<n;l++){const n=e[l];if(t(n,l))return y.some(n);if(o(n,l))break}return y.none()})(e,t,h),F=(e,t)=>(e=>{const t=[];for(let o=0,l=e.length;o<l;++o){if(!n(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);_.apply(t,e[o])}return t})(M(e,t)),q=(e,t)=>{for(let o=0,l=e.length;o<l;++o)if(!0!==t(e[o],o))return!1;return!0},L=(e,t)=>t>=0&&t<e.length?y.some(e[t]):y.none(),H=(e,t)=>{for(let o=0;o<e.length;o++){const l=t(e[o],o);if(l.isSome())return l}return y.none()},j=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},V={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return j(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return j(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return j(o)},fromDom:j,fromPoint:(e,t,o)=>y.from(e.dom.elementFromPoint(t,o)).map(j)},$=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},W=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,z=(e,t)=>e.dom===t.dom,U=$;"undefined"!=typeof window?window:Function("return this;")();const G=e=>e.dom.nodeName.toLowerCase(),K=e=>e.dom.nodeType,J=e=>t=>K(t)===e,Q=J(1),X=J(3),Y=J(9),Z=J(11),ee=e=>t=>Q(t)&&G(t)===e,te=e=>Y(e)?e:V.fromDom(e.dom.ownerDocument),oe=e=>y.from(e.dom.parentNode).map(V.fromDom),le=e=>y.from(e.dom.nextSibling).map(V.fromDom),ne=e=>M(e.dom.childNodes,V.fromDom),re=c(Element.prototype.attachShadow)&&c(Node.prototype.getRootNode)?e=>V.fromDom(e.dom.getRootNode()):te,ae=e=>V.fromDom(e.dom.host),se=e=>{const t=X(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return(e=>{const t=re(e);return Z(o=t)&&s(o.dom.host)?y.some(t):y.none();var o})(V.fromDom(t)).fold((()=>o.body.contains(t)),(l=se,n=ae,e=>l(n(e))));var l,n};var ce=(e,t,o,l,n)=>e(o,l)?y.some(o):c(n)&&n(o)?y.none():t(o,l,n);const ie=(e,t,o)=>{let l=e.dom;const n=c(o)?o:h;for(;l.parentNode;){l=l.parentNode;const e=V.fromDom(l);if(t(e))return y.some(e);if(n(e))break}return y.none()},de=(e,t,o)=>ie(e,(e=>$(e,t)),o),me=(e,t)=>(e=>B(e.dom.childNodes,(e=>{return o=V.fromDom(e),$(o,t);var o})).map(V.fromDom))(e),ue=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return W(o)?y.none():y.from(o.querySelector(e)).map(V.fromDom)})(t,e),pe=(e,t,o)=>ce(((e,t)=>$(e,t)),de,e,t,o),be=(e,t=!1)=>{return se(e)?e.dom.isContentEditable:(o=e,pe(o,"[contenteditable]")).fold(m(t),(e=>"true"===ge(e)));var o},ge=e=>e.dom.contentEditable,he=e=>t=>z(t,(e=>V.fromDom(e.getBody()))(e)),fe=e=>/^\d+(\.\d+)?$/.test(e)?e+"px":e,ye=e=>V.fromDom(e.selection.getStart()),we=(e,t)=>{let o=[];return P(ne(e),(e=>{t(e)&&(o=o.concat([e])),o=o.concat(we(e,t))})),o},Se=(e,t)=>(e=>k(ne(e),(e=>$(e,t))))(e),Ce=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return W(o)?[]:M(o.querySelectorAll(e),V.fromDom)})(t,e),ve=(e,t,o)=>{if(!(l(o)||r(o)||i(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},xe=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},Te=(e,t)=>y.from(xe(e,t)),Ae=(e,t)=>{e.dom.removeAttribute(t)},Re=(e,t,o=p)=>e.exists((e=>o(e,t))),Oe=(e,t,o)=>e.isSome()&&t.isSome()?y.some(o(e.getOrDie(),t.getOrDie())):y.none(),_e=(e,t)=>((e,t)=>""===t||e.length>=t.length&&e.substr(0,0+t.length)===t)(e,t),De=(Ne=/^\s+|\s+$/g,e=>e.replace(Ne,""));var Ne;const Ie=e=>e.length>0,Me=(e,t=10)=>{const o=parseInt(e,t);return isNaN(o)?y.none():y.some(o)},Pe=e=>void 0!==e.style&&c(e.style.getPropertyValue),ke=(e,t)=>{const o=e.dom,l=window.getComputedStyle(o).getPropertyValue(t);return""!==l||se(e)?l:Ee(o,t)},Ee=(e,t)=>Pe(e)?e.style.getPropertyValue(t):"",Be=(e,t)=>{const o=e.dom,l=Ee(o,t);return y.from(l).filter((e=>e.length>0))},Fe=(e,t,o=0)=>Te(e,t).map((e=>parseInt(e,10))).getOr(o),qe=(e,t)=>Le(e,t,f),Le=(e,t,o)=>F(ne(e),(e=>$(e,t)?o(e)?[e]:[]:Le(e,t,o))),He=["tfoot","thead","tbody","colgroup"],je=(e,t,o)=>({element:e,rowspan:t,colspan:o}),Ve=(e,t,o)=>({element:e,cells:t,section:o}),$e=(e,t)=>pe(e,"table",t),We=e=>qe(e,"tr"),ze=e=>$e(e).fold(m([]),(e=>Se(e,"colgroup"))),Ue=e=>oe(e).map((e=>{const t=G(e);return(e=>D(He,e))(t)?t:"tbody"})).getOr("tbody"),Ge=e=>Te(e,"data-snooker-locked-cols").bind((e=>y.from(e.match(/\d+/g)))).map((e=>((e,t)=>{const o={};for(let l=0,n=e.length;l<n;l++){const n=e[l];o[String(n)]=t(n,l)}return o})(e,f))),Ke=(e,t)=>e+","+t,Je=e=>{const t={},o=[];var l;const n=(l=e,L(l,0)).map((e=>e.element)).bind($e).bind(Ge).getOr({});let r=0,a=0,s=0;const{pass:c,fail:i}=(e=>{const t=[],o=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];(l=r,"colgroup"===l.section?t:o).push(r)}var l;return{pass:t,fail:o}})(e);P(i,(e=>{const l=[];P(e.cells,(e=>{let o=0;for(;void 0!==t[Ke(s,o)];)o++;const r=R(n,o.toString()),c=((e,t,o,l,n,r)=>({element:e,rowspan:t,colspan:o,row:l,column:n,isLocked:r}))(e.element,e.rowspan,e.colspan,s,o,r);for(let l=0;l<e.colspan;l++)for(let n=0;n<e.rowspan;n++){const e=o+l,r=Ke(s+n,e);t[r]=c,a=Math.max(a,e+1)}l.push(c)})),r++,o.push(Ve(e.element,l,e.section)),s++}));const{columns:d,colgroups:m}=(e=>L(e,e.length-1))(c).map((e=>{const t=(e=>{const t={};let o=0;return P(e.cells,(e=>{const l=e.colspan;I(l,(n=>{const r=o+n;t[r]=((e,t,o)=>({element:e,colspan:t,column:o}))(e.element,l,r)})),o+=l})),t})(e),o=((e,t)=>({element:e,columns:t}))(e.element,((e,t)=>{const o=[];return C(e,((e,l)=>{o.push(t(e,l))})),o})(t,u));return{colgroups:[o],columns:t}})).getOrThunk((()=>({colgroups:[],columns:{}}))),p=((e,t)=>({rows:e,columns:t}))(r,a);return{grid:p,access:t,all:o,columns:d,colgroups:m}},Qe=e=>{const t=(e=>{const t=We(e);return((e,t)=>M(e,(e=>{if("colgroup"===G(e)){const t=M((e=>$(e,"colgroup")?Se(e,"col"):F(ze(e),(e=>Se(e,"col"))))(e),(e=>{const t=Fe(e,"span",1);return je(e,1,t)}));return Ve(e,t,"colgroup")}{const o=M((e=>qe(e,"th,td"))(e),(e=>{const t=Fe(e,"rowspan",1),o=Fe(e,"colspan",1);return je(e,t,o)}));return Ve(e,o,t(e))}})))([...ze(e),...t],Ue)})(e);return Je(t)},Xe=(e,t,o)=>y.from(e.access[Ke(t,o)]),Ye=(e,t,o)=>{const l=((e,t)=>{const o=F(e.all,(e=>e.cells));return k(o,t)})(e,(e=>o(t,e.element)));return l.length>0?y.some(l[0]):y.none()},Ze=(e,t)=>y.from(e.columns[t]);var et=tinymce.util.Tools.resolve("tinymce.util.Tools");const tt=(e,t,o)=>{const l=e.select("td,th",t);let n;for(let t=0;t<l.length;t++){const r=e.getStyle(l[t],o);if(a(n)&&(n=r),n!==r)return""}return n},ot=(e,t,o)=>{et.each("left center right".split(" "),(l=>{l!==o&&e.formatter.remove("align"+l,{},t)})),o&&e.formatter.apply("align"+o,{},t)},lt=(e,t,o)=>{e.dispatch("TableModified",{...o,table:t})},nt=(e,t,o)=>((e,t)=>(e=>{const t=parseFloat(e);return isNaN(t)?y.none():y.some(t)})(e).getOr(t))(ke(e,t),o),rt=e=>((e,t)=>{const o=e.dom,l=o.getBoundingClientRect().width||o.offsetWidth;return"border-box"===t?l:((e,t,o,l)=>t-nt(e,`padding-${o}`,0)-nt(e,`padding-${l}`,0)-nt(e,`border-${o}-width`,0)-nt(e,`border-${l}-width`,0))(e,l,"left","right")})(e,"content-box");var at=tinymce.util.Tools.resolve("tinymce.Env");const st=I(5,(e=>{const t=`${e+1}px`;return{title:t,value:t}})),ct=M(["None","Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","Hidden"],(e=>({title:e,value:e.toLowerCase()}))),it="100%",dt=e=>{var t;const o=e.dom,l=null!==(t=o.getParent(e.selection.getStart(),o.isBlock))&&void 0!==t?t:e.getBody();return rt(V.fromDom(l))+"px"},mt=e=>t=>t.options.get(e),ut=mt("table_sizing_mode"),pt=mt("table_border_widths"),bt=mt("table_border_styles"),gt=mt("table_cell_advtab"),ht=mt("table_row_advtab"),ft=mt("table_advtab"),yt=mt("table_cell_inputs"),wt=mt("table_row_inputs"),St=mt("table_inputs"),Ct=mt("table_grid"),vt=mt("table_style_by_css"),xt=mt("table_cell_class_list"),Tt=mt("table_row_class_list"),At=mt("table_class_list"),Rt=mt("table_toolbar"),Ot=mt("table_background_color_map"),_t=mt("table_border_color_map"),Dt=e=>"fixed"===ut(e),Nt=e=>"responsive"===ut(e),It=e=>{const t=e.options,o=t.get("table_default_styles");return t.isSet("table_default_styles")?o:((e,t)=>Nt(e)||!vt(e)?t:Dt(e)?{...t,width:dt(e)}:{...t,width:it})(e,o)},Mt=e=>{const t=e.options,o=t.get("table_default_attributes");return t.isSet("table_default_attributes")?o:((e,t)=>Nt(e)||vt(e)?t:Dt(e)?{...t,width:dt(e)}:{...t,width:it})(e,o)},Pt=(e,t)=>t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow,kt=(e,t,o)=>((e,t,o)=>{const l=Ye(e,t,z),n=Ye(e,o,z);return l.bind((e=>n.map((t=>{return o=e,l=t,{startRow:Math.min(o.row,l.row),startCol:Math.min(o.column,l.column),finishRow:Math.max(o.row+o.rowspan-1,l.row+l.rowspan-1),finishCol:Math.max(o.column+o.colspan-1,l.column+l.colspan-1)};var o,l}))))})(e,t,o).bind((t=>((e,t)=>{let o=!0;const l=b(Pt,t);for(let n=t.startRow;n<=t.finishRow;n++)for(let r=t.startCol;r<=t.finishCol;r++)o=o&&Xe(e,n,r).exists(l);return o?y.some(t):y.none()})(e,t))),Et=Qe,Bt=(e,t)=>{oe(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},Ft=(e,t)=>{le(e).fold((()=>{oe(e).each((e=>{qt(e,t)}))}),(e=>{Bt(e,t)}))},qt=(e,t)=>{e.dom.appendChild(t.dom)},Lt=(e,t)=>{P(t,((o,l)=>{const n=0===l?e:t[l-1];Ft(n,o)}))},Ht=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},jt=(e=>{const t=t=>e(t)?y.from(t.dom.nodeValue):y.none();return{get:o=>{if(!e(o))throw new Error("Can only get text value of a text node");return t(o).getOr("")},getOption:t,set:(t,o)=>{if(!e(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=o}}})(X);var Vt=["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"];const $t=(e,t,o,l)=>{const n=t(e,o);return r=(o,l)=>{const n=t(e,l);return Wt(e,o,n)},a=n,((e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o],o)})(l,((e,t)=>{a=r(a,e)})),a;var r,a},Wt=(e,t,o)=>t.bind((t=>o.filter(b(e.eq,t)))),zt={up:m({selector:de,closest:pe,predicate:ie,all:(e,t)=>{const o=c(t)?t:h;let l=e.dom;const n=[];for(;null!==l.parentNode&&void 0!==l.parentNode;){const e=l.parentNode,t=V.fromDom(e);if(n.push(t),!0===o(t))break;l=e}return n}}),down:m({selector:Ce,predicate:we}),styles:m({get:ke,getRaw:Be,set:(e,t,o)=>{((e,t,o)=>{if(!l(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);Pe(e)&&e.style.setProperty(t,o)})(e.dom,t,o)},remove:(e,t)=>{((e,t)=>{Pe(e)&&e.style.removeProperty(t)})(e.dom,t),Re(Te(e,"style").map(De),"")&&Ae(e,"style")}}),attrs:m({get:xe,set:(e,t,o)=>{ve(e.dom,t,o)},remove:Ae,copyTo:(e,t)=>{((e,t)=>{const o=e.dom;C(t,((e,t)=>{ve(o,t,e)}))})(t,E(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}))}}),insert:m({before:Bt,after:Ft,afterAll:Lt,append:qt,appendAll:(e,t)=>{P(t,(t=>{qt(e,t)}))},prepend:(e,t)=>{(e=>(e=>{const t=e.dom.childNodes;return y.from(t[0]).map(V.fromDom)})(e))(e).fold((()=>{qt(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},wrap:(e,t)=>{Bt(e,t),qt(t,e)}}),remove:m({unwrap:e=>{const t=ne(e);t.length>0&&Lt(e,t),Ht(e)},remove:Ht}),create:m({nu:V.fromTag,clone:e=>V.fromDom(e.dom.cloneNode(!1)),text:V.fromText}),query:m({comparePosition:(e,t)=>e.dom.compareDocumentPosition(t.dom),prevSibling:e=>y.from(e.dom.previousSibling).map(V.fromDom),nextSibling:le}),property:m({children:ne,name:G,parent:oe,document:e=>te(e).dom,isText:X,isComment:e=>8===K(e)||"#comment"===G(e),isElement:Q,isSpecial:e=>{const t=G(e);return D(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},getLanguage:e=>Q(e)?Te(e,"lang"):y.none(),getText:e=>jt.get(e),setText:(e,t)=>jt.set(e,t),isBoundary:e=>!!Q(e)&&("body"===G(e)||D(Vt,G(e))),isEmptyTag:e=>!!Q(e)&&D(["br","img","hr","input"],G(e)),isNonEditable:e=>Q(e)&&"false"===xe(e,"contenteditable")}),eq:z,is:U},Ut=e=>de(e,"table"),Gt=(e,t,o)=>ue(e,t).bind((t=>ue(e,o).bind((e=>{return(o=Ut,l=[t,e],((e,t,o)=>o.length>0?((e,t,o,l)=>l(e,t,o[0],o.slice(1)))(e,t,o,$t):y.none())(zt,((e,t)=>o(t)),l)).map((o=>({first:t,last:e,table:o})));var o,l})))),Kt=e=>M(e,V.fromDom),Jt="data-mce-selected",Qt="data-mce-first-selected",Xt="data-mce-last-selected",Yt={selected:Jt,selectedSelector:"td["+Jt+"],th["+Jt+"]",firstSelected:Qt,firstSelectedSelector:"td["+Qt+"],th["+Qt+"]",lastSelected:Xt,lastSelectedSelector:"td["+Xt+"],th["+Xt+"]"},Zt=e=>(t,o)=>{const l=G(t),n="col"===l||"colgroup"===l?$e(r=t).bind((e=>((e,t)=>((e,t)=>{const o=Ce(e,t);return o.length>0?y.some(o):y.none()})(e,t))(e,Yt.firstSelectedSelector))).fold(m(r),(e=>e[0])):t;var r;return pe(n,e,o)},eo=Zt("th,td,caption"),to=Zt("th,td"),oo=e=>Kt(e.model.table.getSelectedCells()),lo=(e,t)=>{const o=to(e),l=o.bind((e=>$e(e))).map((e=>We(e)));return Oe(o,l,((e,o)=>k(o,(o=>N(Kt(o.dom.cells),(o=>"1"===xe(o,t)||z(o,e))))))).getOr([])},no=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],ro=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,ao=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,so=e=>{return(t=e,_e(t,"#")?(e=>e.substring(1))(t):t).toUpperCase();var t},co=e=>{const t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},io=e=>{return t=co(e.red)+co(e.green)+co(e.blue),{value:so(t)};var t},mo=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,uo=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,po=(e,t,o,l)=>({red:e,green:t,blue:o,alpha:l}),bo=(e,t,o,l)=>{const n=parseInt(e,10),r=parseInt(t,10),a=parseInt(o,10),s=parseFloat(l);return po(n,r,a,s)},go=e=>{if("transparent"===e)return y.some(po(0,0,0,0));const t=mo.exec(e);if(null!==t)return y.some(bo(t[1],t[2],t[3],"1"));const o=uo.exec(e);return null!==o?y.some(bo(o[1],o[2],o[3],o[4])):y.none()},ho=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},fo=(e,t,o)=>l=>{const n=(e=>{const t=ho(y.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(y.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(y.some(e))}}})((e=>e.unbind())),r=!Ie(o),a=()=>{const a=oo(e),s=l=>e.formatter.match(t,{value:o},l.dom,r);r?(l.setActive(!N(a,s)),n.set(e.formatter.formatChanged(t,(e=>l.setActive(!e)),!0))):(l.setActive(q(a,s)),n.set(e.formatter.formatChanged(t,l.setActive,!1,{value:o})))};return e.initialized?a():e.on("init",a),n.clear},yo=e=>R(e,"menu"),wo=e=>M(e,(e=>{const t=e.text||e.title||"";return yo(e)?{text:t,items:wo(e.menu)}:{text:t,value:e.value}})),So=e=>e.length?y.some(wo([{text:"Select...",value:"mce-no-match"},...e])):y.none(),Co=(e,t,o,l)=>M(t,(t=>{const n=t.text||t.title;return yo(t)?{type:"nestedmenuitem",text:n,getSubmenuItems:()=>Co(e,t.menu,o,l)}:{text:n,type:"togglemenuitem",onAction:()=>l(t.value),onSetup:fo(e,o,t.value)}})),vo=(e,t)=>o=>{e.execCommand("mceTableApplyCellStyle",!1,{[t]:o})},xo=e=>F(e,(e=>yo(e)?[{...e,menu:xo(e.menu)}]:Ie(e.value)?[e]:[])),To=(e,t,o,l)=>n=>n(Co(e,t,o,l)),Ao=(e,t,o)=>{const l=M(t,(e=>{return{text:e.title,value:"#"+(o=e.value,(t=o,(e=>ro.test(e)||ao.test(e))(t)?y.some({value:so(t)}):y.none()).orThunk((()=>go(o).map(io))).getOrThunk((()=>{const e=document.createElement("canvas");e.height=1,e.width=1;const t=e.getContext("2d");t.clearRect(0,0,e.width,e.height),t.fillStyle="#FFFFFF",t.fillStyle=o,t.fillRect(0,0,1,1);const l=t.getImageData(0,0,1,1).data,n=l[0],r=l[1],a=l[2],s=l[3];return io(po(n,r,a,s))}))).value,type:"choiceitem"};var t,o}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:l.length>0?l:void 0,allowCustomColors:!1},onAction:t=>{const l="remove"===t.value?"":t.value;e.execCommand("mceTableApplyCellStyle",!1,{[o]:l})}}]},Ro=e=>()=>{const t="header"===e.queryCommandValue("mceTableRowType")?"body":"header";e.execCommand("mceTableRowType",!1,{type:t})},Oo=e=>()=>{const t="th"===e.queryCommandValue("mceTableColType")?"td":"th";e.execCommand("mceTableColType",!1,{type:t})},_o=[{name:"width",type:"input",label:"Width",tooltip:"Cell width in pixels or percentage (e.g., 50px or 10%)."},{name:"celltype",type:"listbox",label:"Cell type",tooltip:"Select the type of cell to apply formatting or styling to.",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",tooltip:"Defines the scope of the header cell to specify its relationship to rows or columns.",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",tooltip:"Horizontal alignment of the cell content.",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",tooltip:"Vertical alignment of the cell content.",items:no}],Do=e=>{const t=yt(e).split(" "),o=_o.concat((e=>So(xt(e)).map((e=>({name:"class",type:"listbox",label:"Class",items:e}))))(e).toArray());return o.filter((e=>"name"in e&&t.includes(e.name))).sort(((e,o)=>{const l="name"in e?e.name:"",n="name"in o?o.name:"";return t.indexOf(l)-t.indexOf(n)}))},No=e=>`Style of the outer border of the ${e}.`,Io=e=>{switch(e){case"table":return"Color of the border for the entire table and individual cells.";case"row":case"cell":return`Color of the outer border of the ${e}.`}},Mo=e=>{switch(e){case"table":return"Changes the background color of all cells in the table, except for those set individually through Cell Properties or Row Properties.";case"row":return"Changes the background color of all cells in the row, except for those set individually through Cell Properties.";case"cell":return"Background color of the cell."}},Po=e=>{switch(e){case"table":case"row":return;case"cell":return"Width of the outer border of the cell."}},ko=(e,t)=>{const o=It(e)["border-style"],l=bt(e).some((e=>"none"===e.value)),n=[{name:"borderstyle",type:"listbox",label:"Border style",tooltip:No(t),items:(o||l?[]:[{text:"None",value:"none"}]).concat(wo(bt(e)))},{name:"bordercolor",type:"colorinput",label:"Border color",tooltip:Io(t)},{name:"backgroundcolor",type:"colorinput",label:"Background color",tooltip:Mo(t)}],r={name:"borderwidth",type:"input",label:"Border width",tooltip:Po(t)};return{title:"Advanced",name:"advanced",items:"cell"===t?[r].concat(n):n}},Eo=(e,t)=>{const o=e.dom;return{setAttrib:(e,l)=>{o.setAttrib(t,e,l)},setStyle:(e,l)=>{o.setStyle(t,e,l)},setFormat:(o,l)=>{""===l?e.formatter.remove(o,{value:null},t,!0):e.formatter.apply(o,{value:l},t)}}},Bo=ee("th"),Fo=(e,t)=>e&&t?"sectionCells":e?"section":"cells",qo=e=>{const t=M(e,(e=>(e=>{const t="thead"===e.section,o=Re((e=>{const t=k(e,(e=>Bo(e.element)));return 0===t.length?y.some("td"):t.length===e.length?y.some("th"):y.none()})(e.cells),"th");return"tfoot"===e.section?{type:"footer"}:t||o?{type:"header",subType:Fo(t,o)}:{type:"body"}})(e).type)),o=D(t,"header"),l=D(t,"footer");if(o||l){const e=D(t,"body");return!o||e||l?o||e||!l?y.none():y.some("footer"):y.some("header")}return y.some("body")},Lo=(e,t)=>H(e.all,(e=>B(e.cells,(e=>z(t,e.element))))),Ho=(e,t,o)=>{const l=(e=>{const t=[],o=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(o);return t})(M(t.selection,(t=>{return(l=t,((e,t,o=h)=>o(t)?y.none():D(e,G(t))?y.some(t):de(t,e.join(","),(e=>$(e,"table")||o(e))))(["td","th"],l,n)).bind((t=>Lo(e,t))).filter(o);var l,n})));return n=l,l.length>0?y.some(n):y.none();var n},jo=(e,t)=>Ho(e,t,f),Vo=(e,t)=>q(t,(t=>((e,t)=>Lo(e,t).exists((e=>!e.isLocked)))(e,t))),$o=(e,t)=>((e,t)=>t.mergable)(0,t).filter((t=>Vo(e,t.cells))),Wo=(e,t)=>((e,t)=>t.unmergable)(0,t).filter((t=>Vo(e,t))),zo=((e=>{if(!n(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};P(e,((l,r)=>{const a=w(l);if(1!==a.length)throw new Error("one and only one name per case");const s=a[0],c=l[s];if(void 0!==o[s])throw new Error("duplicate key detected:"+s);if("cata"===s)throw new Error("cannot have a case named cata (sorry)");if(!n(c))throw new Error("case arguments must be an array");t.push(s),o[s]=(...o)=>{const l=o.length;if(l!==c.length)throw new Error("Wrong number of arguments to case "+s+". Expected "+c.length+" ("+c+"), got "+l);return{fold:(...t)=>{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,o)},match:e=>{const l=w(e);if(t.length!==l.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+l.join(","));if(!q(t,(e=>D(l,e))))throw new Error("Not all branches were specified when using match. Specified: "+l.join(", ")+"\nRequired: "+t.join(", "));return e[s].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:s,params:o})}}}}))})([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),(e,t)=>{const o=Qe(e);return jo(o,t).bind((e=>{const t=e[e.length-1],l=e[0].row,n=t.row+t.rowspan,r=o.all.slice(l,n);return qo(r)})).getOr("")}),Uo=e=>{return _e(e,"rgb")?go(t=e).map(io).map((e=>"#"+e.value)).getOr(t):e;var t},Go=e=>{const t=V.fromDom(e);return{borderwidth:Be(t,"border-width").getOr(""),borderstyle:Be(t,"border-style").getOr(""),bordercolor:Be(t,"border-color").map(Uo).getOr(""),backgroundcolor:Be(t,"background-color").map(Uo).getOr("")}},Ko=e=>{const t=e[0],o=e.slice(1);return P(o,(e=>{P(w(t),(o=>{C(e,((e,l)=>{const n=t[o];""!==n&&o===l&&n!==e&&(t[o]="class"===o?"mce-no-match":"")}))}))})),t},Jo=(e,t,o,l)=>B(e,(e=>!a(o.formatter.matchNode(l,t+e)))).getOr(""),Qo=b(Jo,["left","center","right"],"align"),Xo=b(Jo,["top","middle","bottom"],"valign"),Yo=e=>$e(V.fromDom(e)).map((t=>{const o={selection:Kt(e.cells)};return zo(t,o)})).getOr(""),Zo=(e,t)=>{if(!t||"double"!==t)return e;const o=parseFloat(e);return void 0!==o&&(0===o||o>=3)?e:"3px"},el=(e,t)=>{const o=Qe(e),l=(e=>F(e.all,(e=>e.cells)))(o),n=k(l,(e=>N(t,(t=>z(e.element,t)))));return M(n,(e=>({element:e.element.dom,column:Ze(o,e.column).map((e=>e.element.dom))})))},tl=(e,t,o,l)=>{const n=l.getData();l.close(),e.undoManager.transact((()=>{((e,t,o,l)=>{const n=v(l,((e,t)=>o[t]!==e));x(n)>0&&t.length>=1&&$e(t[0]).each((o=>{const r=el(o,t),a=x(v(n,((e,t)=>"scope"!==t&&"celltype"!==t)))>0,s=A(n,"celltype");(a||A(n,"scope"))&&((e,t,o,l)=>{const n=1===t.length;P(t,(t=>{const r=t.element,a=n?f:l,s=Eo(e,r);((e,t,o,l)=>{l("scope")&&e.setAttrib("scope",o.scope),l("class")&&"mce-no-match"!==o.class&&e.setAttrib("class",o.class),l("width")&&t.setStyle("width",fe(o.width))})(s,t.column.map((t=>Eo(e,t))).getOr(s),o,a),gt(e)&&((e,t,o)=>{if(o("backgroundcolor")&&e.setFormat("tablecellbackgroundcolor",t.backgroundcolor),o("bordercolor")&&e.setFormat("tablecellbordercolor",t.bordercolor),o("borderstyle")&&e.setFormat("tablecellborderstyle",t.borderstyle),o("borderwidth")||"double"===t.borderstyle){const o=Zo(t.borderwidth,t.borderstyle);e.setFormat("tablecellborderwidth",fe(o))}})(s,o,a),l("halign")&&ot(e,r,o.halign),l("valign")&&((e,t,o)=>{et.each("top middle bottom".split(" "),(l=>{l!==o&&e.formatter.remove("valign"+l,{},t)})),o&&e.formatter.apply("valign"+o,{},t)})(e,r,o.valign)}))})(e,r,l,b(A,n)),s&&((e,t)=>{e.execCommand("mceTableCellType",!1,{type:t.celltype,no_events:!0})})(e,l),lt(e,o.dom,{structure:s,style:a})}))})(e,t,o,n),e.focus()}))},ol=e=>{const t=oo(e);if(0===t.length)return;const o=((e,t)=>{const o=$e(t[0]).map((o=>M(el(o,t),(t=>((e,t,o,l)=>{const n=e.dom;return{width:(a=l.getOr(t),s="width",n.getStyle(a,s)||n.getAttrib(a,s)),scope:n.getAttrib(t,"scope"),celltype:(r=t,r.nodeName.toLowerCase()),class:n.getAttrib(t,"class",""),halign:Qo(e,t),valign:Xo(e,t),...o?Go(t):{}};var r,a,s})(e,t.element,gt(e),t.column)))));return Ko(o.getOrDie())})(e,t),l={type:"tabpanel",tabs:[{title:"General",name:"general",items:Do(e)},ko(e,"cell")]},n={type:"panel",items:[{type:"grid",columns:2,items:Do(e)}]};e.windowManager.open({title:"Cell Properties",size:"normal",body:gt(e)?l:n,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onSubmit:b(tl,e,t,o)})},ll=[{type:"listbox",name:"type",label:"Row type",tooltip:"Select the type of row to apply formatting or styling to.",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",tooltip:"Alignment of the content within the cells in the row.",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input",tooltip:"Row height in pixels (e.g., 20px)."}],nl=e=>{const t=wt(e).split(" "),o=ll.concat((e=>So(Tt(e)).map((e=>({name:"class",type:"listbox",label:"Class",items:e}))))(e).toArray());return o.filter((e=>"name"in e&&t.includes(e.name))).sort(((e,o)=>{const l="name"in e?e.name:"",n="name"in o?o.name:"";return t.indexOf(l)-t.indexOf(n)}))},rl=(e,t,o,l)=>{const n=l.getData();l.close(),e.undoManager.transact((()=>{((e,t,o,l)=>{const n=v(l,((e,t)=>o[t]!==e));if(x(n)>0){const o=A(n,"type"),r=!o||x(n)>1;r&&((e,t,o,l)=>{const n=1===t.length?f:l;P(t,(t=>{const r=Se(V.fromDom(t),"td,th"),a=Eo(e,t);((e,t,o)=>{o("class")&&"mce-no-match"!==t.class&&e.setAttrib("class",t.class),o("height")&&e.setStyle("height",fe(t.height))})(a,o,n),ht(e)&&((e,t,o)=>{o("backgroundcolor")&&e.setStyle("background-color",t.backgroundcolor),o("bordercolor")&&e.setStyle("border-color",t.bordercolor),o("borderstyle")&&e.setStyle("border-style",t.borderstyle)})(a,o,n),l("height")&&P(r,(t=>{e.dom.setStyle(t.dom,"height",null)})),l("align")&&ot(e,t,o.align)}))})(e,t,l,b(A,n)),o&&((e,t)=>{e.execCommand("mceTableRowType",!1,{type:t.type,no_events:!0})})(e,l),$e(V.fromDom(t[0])).each((t=>lt(e,t.dom,{structure:o,style:r})))}})(e,t,o,n),e.focus()}))},al=e=>{const t=lo(ye(e),Yt.selected);if(0===t.length)return;const o=M(t,(t=>((e,t,o)=>{const l=e.dom;return{height:l.getStyle(t,"height")||l.getAttrib(t,"height"),class:l.getAttrib(t,"class",""),type:Yo(t),align:Qo(e,t),...o?Go(t):{}}})(e,t.dom,ht(e)))),l=Ko(o),n={type:"tabpanel",tabs:[{title:"General",name:"general",items:nl(e)},ko(e,"row")]},r={type:"panel",items:[{type:"grid",columns:2,items:nl(e)}]};e.windowManager.open({title:"Row Properties",size:"normal",body:ht(e)?n:r,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:l,onSubmit:b(rl,e,M(t,(e=>e.dom)),l)})},sl=(e,t,o)=>{const l=o?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],n=[{type:"input",name:"width",label:"Width",tooltip:"Total width of the table in pixels or percentage (e.g., 500px or 100%)."},{type:"input",name:"height",label:"Height",tooltip:"Total height of the table in pixels (e.g., 500px)."},{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric",tooltip:"The space between individual table cells, measured in pixels (e.g., 5px)."},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric",tooltip:"Inner text padding in cells, e.g., 0px 5px (where 0px is vertical padding, and 5px is horizontal padding)."},{type:"input",name:"border",label:"Border width",tooltip:"Width of the border for the entire table and individual cells."},{type:"label",label:"Caption",name:"caption",tooltip:"Adds a caption above the table, which can be edited.",items:[{type:"checkbox",name:"caption",label:"Show caption"}]},{type:"listbox",name:"align",label:"Alignment",tooltip:"Alignment of the entire table (not the content within the table).",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}];t.length>0&&n.push({name:"class",type:"listbox",label:"Class",items:t});const r=St(e).split(" "),a=n.filter((e=>"name"in e&&r.includes(e.name))).sort(((e,t)=>{const o="name"in e?e.name:"",l="name"in t?t.name:"";return r.indexOf(o)-r.indexOf(l)}));return l.concat(a)},cl=(e,t,o,n)=>{if("TD"===t.tagName||"TH"===t.tagName)l(o)&&s(n)?e.setStyle(t,o,n):e.setStyles(t,o);else if(t.children)for(let l=0;l<t.children.length;l++)cl(e,t.children[l],o,n)},il=(e,t,o,l)=>{const n=e.dom,r=l.getData(),s=v(r,((e,t)=>o[t]!==e));l.close(),e.undoManager.transact((()=>{if(!t){const o=Me(r.cols).getOr(1),l=Me(r.rows).getOr(1);e.execCommand("mceInsertTable",!1,{rows:l,columns:o}),t=to(ye(e),he(e)).bind((t=>$e(t,he(e)))).map((e=>e.dom)).getOrDie()}if(x(s)>0){const o={border:A(s,"border"),bordercolor:A(s,"bordercolor"),cellpadding:A(s,"cellpadding")};((e,t,o,l)=>{const n=e.dom,r={},s={},c=vt(e),i=ft(e),d=0===parseFloat(o.border),m=Zo(o.border,o.borderstyle);if(a(o.class)||"mce-no-match"===o.class||(r.class=o.class),s.height=fe(o.height),c?s.width=fe(o.width):n.getAttrib(t,"width")&&(r.width=(e=>e?e.replace(/px$/,""):"")(o.width)),c?(d?(r.border=0,s["border-width"]=""):(s["border-width"]=fe(m),r.border=1),s["border-spacing"]=fe(o.cellspacing)):(r.border=d?0:m,r.cellpadding=o.cellpadding,r.cellspacing=o.cellspacing),c&&t.children){const e={};if(d?e["border-width"]="":l.border&&(e["border-width"]=fe(m)),l.cellpadding&&(e.padding=fe(o.cellpadding)),i&&l.bordercolor&&(e["border-color"]=o.bordercolor),!(e=>{for(const t in e)if(S.call(e,t))return!1;return!0})(e))for(let o=0;o<t.children.length;o++)cl(n,t.children[o],e)}if(i){const e=o;s["background-color"]=e.backgroundcolor,s["border-color"]=e.bordercolor,s["border-style"]=e.borderstyle}n.setStyles(t,{...It(e),...s}),n.setAttribs(t,{...Mt(e),...r})})(e,t,r,o);const l=n.select("caption",t)[0];(l&&!r.caption||!l&&r.caption)&&e.execCommand("mceTableToggleCaption"),ot(e,t,r.align)}if(e.focus(),e.addVisual(),x(s)>0){const o=A(s,"caption"),l=!o||x(s)>1;lt(e,t,{structure:o,style:l})}}))},dl=(e,t)=>{const o=e.dom;let l,n=((e,t)=>{const o=It(e),l=Mt(e),n=t?{borderstyle:T(o,"border-style").getOr(""),bordercolor:Uo(T(o,"border-color").getOr("")),backgroundcolor:Uo(T(o,"background-color").getOr(""))}:{};return{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:"",...o,...l,...n,...(()=>{const t=o["border-width"];return vt(e)&&t?{border:t}:T(l,"border").fold((()=>({})),(e=>({border:e})))})(),...{...T(o,"border-spacing").or(T(l,"cellspacing")).fold((()=>({})),(e=>({cellspacing:e}))),...T(o,"border-padding").or(T(l,"cellpadding")).fold((()=>({})),(e=>({cellpadding:e})))}}})(e,ft(e));t?(n.cols="1",n.rows="1",ft(e)&&(n.borderstyle="",n.bordercolor="",n.backgroundcolor="")):(l=o.getParent(e.selection.getStart(),"table",e.getBody()),l?n=((e,t,o)=>{const l=e.dom,n=vt(e)?l.getStyle(t,"border-spacing")||l.getAttrib(t,"cellspacing"):l.getAttrib(t,"cellspacing")||l.getStyle(t,"border-spacing"),r=vt(e)?tt(l,t,"padding")||l.getAttrib(t,"cellpadding"):l.getAttrib(t,"cellpadding")||tt(l,t,"padding");return{width:l.getStyle(t,"width")||l.getAttrib(t,"width"),height:l.getStyle(t,"height")||l.getAttrib(t,"height"),cellspacing:null!=n?n:"",cellpadding:null!=r?r:"",border:((t,o)=>{const l=Be(V.fromDom(o),"border-width");return vt(e)&&l.isSome()?l.getOr(""):t.getAttrib(o,"border")||tt(e.dom,o,"border-width")||tt(e.dom,o,"border")||""})(l,t),caption:!!l.select("caption",t)[0],class:l.getAttrib(t,"class",""),align:Qo(e,t),...o?Go(t):{}}})(e,l,ft(e)):ft(e)&&(n.borderstyle="",n.bordercolor="",n.backgroundcolor=""));const r=So(At(e));r.isSome()&&n.class&&(n.class=n.class.replace(/\s*mce\-item\-table\s*/g,""));const a={type:"grid",columns:2,items:sl(e,r.getOr([]),t)},s=ft(e)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[a]},ko(e,"table")]}:{type:"panel",items:[a]};e.windowManager.open({title:"Table Properties",size:"normal",body:s,onSubmit:b(il,e,l,n),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:n})},ml=e=>{C({mceTableProps:b(dl,e,!1),mceTableRowProps:b(al,e),mceTableCellProps:b(ol,e),mceInsertTableDialog:b(dl,e,!0)},((t,o)=>e.addCommand(o,(()=>{return o=t,void((e=>{return(t=e,o=ee("table"),ce(((e,t)=>t(e)),ie,t,o,void 0)).forall(be);var t,o})(ye(e))&&o());var o}))))},ul=u,pl=e=>{const t=(e,t)=>Te(e,t).exists((e=>parseInt(e,10)>1));return e.length>0&&q(e,(e=>t(e,"rowspan")||t(e,"colspan")))?y.some(e):y.none()},bl=(e,t,o)=>{return t.length<=1?y.none():(l=e,n=o.firstSelectedSelector,r=o.lastSelectedSelector,Gt(l,n,r).bind((e=>{const t=e=>z(l,e),o="thead,tfoot,tbody,table",n=de(e.first,o,t),r=de(e.last,o,t);return n.bind((t=>r.bind((o=>z(t,o)?((e,t,o)=>{const l=Et(e);return kt(l,t,o)})(e.table,e.first,e.last):y.none()))))}))).map((e=>({bounds:e,cells:t})));var l,n,r},gl=e=>{const t=ho(y.none()),o=ho([]);let l=y.none();const n=ee("caption"),r=e=>l.forall((t=>!t[e])),a=()=>eo(ye(e),he(e)).bind((t=>{return o=Oe($e(t),eo((e=>V.fromDom(e.selection.getEnd()))(e),he(e)).bind($e),((o,l)=>z(o,l)?n(t)?y.some((e=>({element:e,mergable:y.none(),unmergable:y.none(),selection:[e]}))(t)):y.some(((e,t,o)=>({element:o,mergable:bl(t,e,Yt),unmergable:pl(e),selection:ul(e)}))(oo(e),o,t)):y.none())),o.bind(u);var o})),s=e=>$e(e.element).map((t=>{const o=Qe(t),l=jo(o,e).getOr([]),n=E(l,((e,t)=>(t.isLocked&&(e.onAny=!0,0===t.column?e.onFirst=!0:t.column+t.colspan>=o.grid.columns&&(e.onLast=!0)),e)),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:$o(o,e).isSome(),unmergeable:Wo(o,e).isSome(),locked:n}})),c=()=>{t.set((e=>{let t,o=!1;return(...l)=>(o||(o=!0,t=e.apply(null,l)),t)})(a)()),l=t.get().bind(s),P(o.get(),g)},i=e=>(e(),o.set(o.get().concat([e])),()=>{o.set(k(o.get(),(t=>t!==e)))}),d=(o,l)=>i((()=>t.get().fold((()=>{o.setEnabled(!1)}),(t=>{o.setEnabled(!l(t)&&e.selection.isEditable())})))),m=(o,l,n)=>i((()=>t.get().fold((()=>{o.setEnabled(!1),o.setActive(!1)}),(t=>{o.setEnabled(!l(t)&&e.selection.isEditable()),o.setActive(n(t))})))),p=e=>l.exists((t=>t.locked[e])),b=(t,o)=>l=>m(l,(e=>n(e.element)),(()=>e.queryCommandValue(t)===o)),f=b("mceTableRowType","header"),w=b("mceTableColType","th");return e.on("NodeChange ExecCommand TableSelectorChange",c),{onSetupTable:e=>d(e,(e=>!1)),onSetupCellOrRow:e=>d(e,(e=>n(e.element))),onSetupColumn:e=>t=>d(t,(t=>n(t.element)||p(e))),onSetupPasteable:e=>t=>d(t,(t=>n(t.element)||e().isNone())),onSetupPasteableColumn:(e,t)=>o=>d(o,(o=>n(o.element)||e().isNone()||p(t))),onSetupMergeable:e=>d(e,(e=>r("mergeable"))),onSetupUnmergeable:e=>d(e,(e=>r("unmergeable"))),resetTargets:c,onSetupTableWithCaption:t=>m(t,h,(t=>$e(t.element,he(e)).exists((e=>me(e,"caption").isSome())))),onSetupTableRowHeaders:f,onSetupTableColumnHeaders:w,targets:t.get}};var hl=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const fl="x-tinymce/dom-table-",yl=fl+"rows",wl=fl+"columns",Sl=e=>{var t;const o=null!==(t=hl.read())&&void 0!==t?t:[];return H(o,(t=>y.from(t.getType(e))))},Cl=()=>Sl(yl),vl=()=>Sl(wl),xl=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}},Tl=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}};e.add("table",(e=>{const t=gl(e);(e=>{const t=e.options.register;t("table_border_widths",{processor:"object[]",default:st}),t("table_border_styles",{processor:"object[]",default:ct}),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_cell_inputs",{processor:"string",default:"width celltype scope halign valign class"}),t("table_row_inputs",{processor:"string",default:"type align height class"}),t("table_inputs",{processor:"string",default:"width height cellspacing cellpadding border caption align class"}),t("table_grid",{processor:"boolean",default:!at.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),ml(e),((e,t)=>{const o=t=>()=>e.execCommand(t),l=(t,l)=>!!e.queryCommandSupported(l.command)&&(e.ui.registry.addMenuItem(t,{...l,onAction:c(l.onAction)?l.onAction:o(l.command)}),!0),n=(t,l)=>{e.queryCommandSupported(l.command)&&e.ui.registry.addToggleMenuItem(t,{...l,onAction:c(l.onAction)?l.onAction:o(l.command)})},r=t=>{e.execCommand("mceInsertTable",!1,{rows:t.numRows,columns:t.numColumns})},a=[l("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:t.onSetupCellOrRow}),l("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:t.onSetupCellOrRow}),l("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:t.onSetupCellOrRow}),l("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:t.onSetupCellOrRow}),l("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:t.onSetupCellOrRow}),l("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:t.onSetupCellOrRow}),l("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:t.onSetupPasteable(Cl)}),l("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:t.onSetupPasteable(Cl)})],s=[l("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:t.onSetupColumn("onFirst")}),l("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:t.onSetupColumn("onLast")}),l("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:t.onSetupColumn("onAny")}),l("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:t.onSetupColumn("onAny")}),l("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:t.onSetupColumn("onAny")}),l("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:t.onSetupPasteableColumn(vl,"onFirst")}),l("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:t.onSetupPasteableColumn(vl,"onLast")})],i=[l("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:t.onSetupCellOrRow}),l("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:t.onSetupMergeable}),l("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:t.onSetupUnmergeable})];Ct(e)?e.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"inserttable",onAction:r}],onSetup:Tl(e)}):e.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTableDialog"),onSetup:Tl(e)}),e.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTableDialog"),onSetup:Tl(e)}),l("tableprops",{text:"Table properties",onSetup:t.onSetupTable,command:"mceTableProps"}),l("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:t.onSetupTable,command:"mceTableDelete"}),D(a,!0)&&e.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:m("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),D(s,!0)&&e.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:m("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),D(i,!0)&&e.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:m("tablecellprops tablemergecells tablesplitcells")}),e.ui.registry.addContextMenu("table",{update:()=>(t.resetTargets(),t.targets().fold(m(""),(e=>"caption"===G(e.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable")))});const d=xo(At(e));0!==d.length&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:()=>Co(e,d,"tableclass",(t=>e.execCommand("mceTableToggleClass",!1,t))),onSetup:t.onSetupTable});const u=xo(xt(e));0!==u.length&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:()=>Co(e,u,"tablecellclass",(t=>e.execCommand("mceTableCellToggleClass",!1,t))),onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:()=>Co(e,no,"tablecellverticalalign",vo(e,"vertical-align")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:()=>Co(e,pt(e),"tablecellborderwidth",vo(e,"border-width")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:()=>Co(e,bt(e),"tablecellborderstyle",vo(e,"border-style")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:()=>Ao(e,Ot(e),"background-color"),onSetup:t.onSetupCellOrRow}),e.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:()=>Ao(e,_t(e),"border-color"),onSetup:t.onSetupCellOrRow})),n("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),n("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Ro(e),onSetup:t.onSetupTableRowHeaders}),n("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:Oo(e),onSetup:t.onSetupTableRowHeaders})})(e,t),((e,t)=>{e.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:xl(e),fetch:e=>e("inserttable | cell row column | advtablesort | tableprops deletetable")});const o=t=>()=>e.execCommand(t),l=(t,l)=>{e.queryCommandSupported(l.command)&&e.ui.registry.addButton(t,{...l,onAction:c(l.onAction)?l.onAction:o(l.command)})},n=(t,l)=>{e.queryCommandSupported(l.command)&&e.ui.registry.addToggleButton(t,{...l,onAction:c(l.onAction)?l.onAction:o(l.command)})};l("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:t.onSetupTable}),l("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:t.onSetupTable}),l("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:t.onSetupCellOrRow}),l("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:t.onSetupMergeable}),l("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:t.onSetupUnmergeable}),l("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:t.onSetupCellOrRow}),l("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:t.onSetupCellOrRow}),l("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:t.onSetupCellOrRow}),l("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:t.onSetupCellOrRow}),l("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:t.onSetupColumn("onFirst")}),l("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:t.onSetupColumn("onLast")}),l("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:t.onSetupColumn("onAny")}),l("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:t.onSetupCellOrRow}),l("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:t.onSetupCellOrRow}),l("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:t.onSetupPasteable(Cl)}),l("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:t.onSetupPasteable(Cl)}),l("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:t.onSetupColumn("onAny")}),l("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:t.onSetupColumn("onAny")}),l("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:t.onSetupPasteableColumn(vl,"onFirst")}),l("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:t.onSetupPasteableColumn(vl,"onLast")}),l("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:xl(e)});const r=xo(At(e));0!==r.length&&e.queryCommandSupported("mceTableToggleClass")&&e.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:To(e,r,"tableclass",(t=>e.execCommand("mceTableToggleClass",!1,t))),onSetup:t.onSetupTable});const a=xo(xt(e));0!==a.length&&e.queryCommandSupported("mceTableCellToggleClass")&&e.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:To(e,a,"tablecellclass",(t=>e.execCommand("mceTableCellToggleClass",!1,t))),onSetup:t.onSetupCellOrRow}),e.queryCommandSupported("mceTableApplyCellStyle")&&(e.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:To(e,no,"tablecellverticalalign",vo(e,"vertical-align")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:To(e,pt(e),"tablecellborderwidth",vo(e,"border-width")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:To(e,bt(e),"tablecellborderstyle",vo(e,"border-style")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:t=>t(Ao(e,Ot(e),"background-color")),onSetup:t.onSetupCellOrRow}),e.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:t=>t(Ao(e,_t(e),"border-color")),onSetup:t.onSetupCellOrRow})),n("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption}),n("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Ro(e),onSetup:t.onSetupTableRowHeaders}),n("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:Oo(e),onSetup:t.onSetupTableColumnHeaders})})(e,t),(e=>{const t=Rt(e);t.length>0&&e.ui.registry.addContextToolbar("table",{predicate:t=>e.dom.is(t,"table")&&e.getBody().contains(t)&&e.dom.isEditable(t.parentNode),items:t,scope:"node",position:"node"})})(e)}))}();
@@ -12041,6 +12041,17 @@
12041
12041
  const onActionToggleFormat$1 = editor => rawItem => () => {
12042
12042
  editor.undoManager.transact(() => {
12043
12043
  editor.focus();
12044
+ if ([
12045
+ 'p',
12046
+ 'h1',
12047
+ 'h2',
12048
+ 'h3',
12049
+ 'h4',
12050
+ 'h5',
12051
+ 'h6'
12052
+ ].includes(rawItem.format)) {
12053
+ editor.execCommand('RemoveFormat');
12054
+ }
12044
12055
  editor.execCommand('mceToggleFormat', false, rawItem.format);
12045
12056
  });
12046
12057
  };