@ckeditor/ckeditor5-footnotes 0.0.0-nightly-20251103.0 → 0.0.0-nightly-20251105.0

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.
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md.
4
- */(()=>{var t={14:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var o=n(453),i=n.n(o),s=n(374),r=n.n(s)()(i());r.push([t.id,":root{--ck-content-footnotes-list-background-color:none;--ck-content-footnotes-list-separator-color:#000;--ck-content-footnote-font-size:var(--ck-content-font-size-small);--ck-footnotes-widget-label-background-color:#757575}.ck-content .footnote{margin-inline-end:.2em}.ck-content .footnotes{background-color:var(--ck-content-footnotes-list-background-color);font-size:var(--ck-content-footnote-font-size);margin:.9em 0 1.5em;position:relative}.ck-content .footnotes-divider{background:none;border:none;border-top:1px solid var(--ck-content-footnotes-list-separator-color);height:1px;margin:0 0 1em;width:min(30%,350px)}[dir=rtl] .ck-content .footnotes-divider{margin-left:auto;margin-right:0}.ck-content .footnotes-list{margin:0;padding-inline-start:3em}.ck-content .footnote-backlink{display:inline-block;margin-inline-end:1ch;user-select:none;vertical-align:top;width:auto}.ck-content .footnote-content{display:inline-block;padding:0 4px;vertical-align:top;width:calc(100% - 2em)}.ck-content .footnote-content>p:first-of-type{margin-top:0}.ck-content .footnote-content>p:last-of-type{margin-bottom:0}.ck-content .footnote-content ol{list-style-type:decimal}.ck-content .footnote-content ol ol{list-style-type:lower-latin}.ck-content .footnote-content ol ol ol{list-style-type:lower-roman}.ck-content .footnote-content ol ol ol ol{list-style-type:upper-latin}.ck-content .footnote-content ol ol ol ol ol{list-style-type:upper-roman}.ck-content .footnote-content ul{list-style-type:disc}.ck-content .footnote-content ul ul{list-style-type:circle}.ck-content .footnote-content ul ul ul,.ck-content .footnote-content ul ul ul ul{list-style-type:square}.ck.ck-editor__editable .footnotes.ck-widget{display:flow-root;margin:.9em 0 .85em;position:relative}.ck.ck-editor__editable .footnotes.ck-widget:not(:hover):not(.ck-widget_selected){outline:1px solid var(--ck-color-base-border)}.ck.ck-editor__editable .footnotes.ck-widget[data-footnotes-list-label]:after{background-color:var(--ck-footnotes-widget-label-background-color);color:#fff;content:attr(data-footnotes-list-label);font-family:var(--ck-font-face);font-size:10px;line-height:16px;padding:var(--ck-spacing-tiny) var(--ck-spacing-medium);position:absolute;right:10px;top:-1px;white-space:nowrap}[dir=rtl] .ck.ck-editor__editable .footnotes.ck-widget[data-footnotes-list-label]:after{left:10px;right:auto}.ck.ck-editor__editable .footnotes-divider{margin-top:0}.ck.ck-editor__editable .footnotes-list{margin-bottom:.65em;margin-top:0}",""]);const a=r},237:t=>{"use strict";t.exports=CKEditor5.dll},238:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},265:t=>{"use strict";var e={};t.exports=function(t,n){var o=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(n)}},311:(t,e,n)=>{t.exports=n(237)("./src/ui.js")},331:(t,e,n)=>{t.exports=n(237)("./src/clipboard.js")},355:(t,e,n)=>{t.exports=n(237)("./src/icons.js")},374:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n="",o=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),o&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),o&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n}).join("")},e.i=function(t,n,o,i,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(o)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(r[c]=!0)}for(var l=0;l<t.length;l++){var u=[].concat(t[l]);o&&r[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),e.push(u))}},e}},410:t=>{"use strict";t.exports=function(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}},450:t=>{"use strict";var e=[];function n(t){for(var n=-1,o=0;o<e.length;o++)if(e[o].identifier===t){n=o;break}return n}function o(t,o){for(var s={},r=[],a=0;a<t.length;a++){var c=t[a],l=o.base?c[0]+o.base:c[0],u=s[l]||0,f="".concat(l," ").concat(u);s[l]=u+1;var d=n(f),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==d)e[d].references++,e[d].updater(p);else{var h=i(p,o);o.byIndex=a,e.splice(a,0,{identifier:f,updater:h,references:1})}r.push(f)}return r}function i(t,e){var n=e.domAPI(e);n.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,i){var s=o(t=t||[],i=i||{});return function(t){t=t||[];for(var r=0;r<s.length;r++){var a=n(s[r]);e[a].references--}for(var c=o(t,i),l=0;l<s.length;l++){var u=n(s[l]);0===e[u].references&&(e[u].updater(),e.splice(u,1))}s=c}}},453:t=>{"use strict";t.exports=function(t){return t[1]}},584:(t,e,n)=>{t.exports=n(237)("./src/utils.js")},774:t=>{"use strict";var e,n=(e=[],function(t,n){return e[t]=n,e.filter(Boolean).join("\n")});function o(t,e,o,i){var s;if(o)s="";else{s="",i.supports&&(s+="@supports (".concat(i.supports,") {")),i.media&&(s+="@media ".concat(i.media," {"));var r=void 0!==i.layer;r&&(s+="@layer".concat(i.layer.length>0?" ".concat(i.layer):""," {")),s+=i.css,r&&(s+="}"),i.media&&(s+="}"),i.supports&&(s+="}")}if(t.styleSheet)t.styleSheet.cssText=n(e,s);else{var a=document.createTextNode(s),c=t.childNodes;c[e]&&t.removeChild(c[e]),c.length?t.insertBefore(a,c[e]):t.appendChild(a)}}var i={singleton:null,singletonCounter:0};t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=i.singletonCounter++,n=i.singleton||(i.singleton=t.insertStyleElement(t));return{update:function(t){o(n,e,!1,t)},remove:function(t){o(n,e,!0,t)}}}},782:(t,e,n)=>{t.exports=n(237)("./src/core.js")},783:(t,e,n)=>{t.exports=n(237)("./src/engine.js")},901:(t,e,n)=>{t.exports=n(237)("./src/widget.js")},945:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var o=n(453),i=n.n(o),s=n(374),r=n.n(s)()(i());r.push([t.id,":root{--ck-footnotes-styles-list-style-button-size:44px}.ck.ck-footnotes-definitions-properties>.ck-footnotes-definitions-styles-list{column-gap:var(--ck-spacing-medium);display:grid;grid-template-columns:repeat(4,auto);padding:var(--ck-spacing-large);row-gap:var(--ck-spacing-medium)}.ck.ck-footnotes-definitions-properties>.ck-footnotes-definitions-styles-list .ck-button{box-sizing:content-box;margin:0;padding:0}.ck.ck-footnotes-definitions-properties>.ck-footnotes-definitions-styles-list .ck-button,.ck.ck-footnotes-definitions-properties>.ck-footnotes-definitions-styles-list .ck-button .ck-icon{height:var(--ck-footnotes-styles-list-style-button-size);width:var(--ck-footnotes-styles-list-style-button-size)}.ck.ck-footnotes-definitions-properties>.ck-collapsible{border-top:1px solid var(--ck-color-base-border)}.ck.ck-footnotes-definitions-properties>.ck-collapsible .ck-footnotes-definitions-properties__start-index .ck-input{min-width:100%}",""]);const a=r}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var s=e[o]={id:o,exports:{}};return t[o](s,s.exports,n),s.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{Footnotes:()=>Z,FootnotesClipboard:()=>D,FootnotesEditing:()=>v,FootnotesProperties:()=>Et,FootnotesPropertiesEditing:()=>pt,FootnotesPropertiesUI:()=>kt,FootnotesStartCommand:()=>ut,FootnotesStyleCommand:()=>st,FootnotesTracker:()=>f,FootnotesUI:()=>q,InsertFootnoteCommand:()=>b});var t=n(782),e=n(901),i=n(584),s=n(783);function r(){const t=["getElementKey","getChanges","692643WJCgnE","$graveyard","from","getItems","7154376HJnAZV","_model","3591087YPkyTt","add","elementName","rootName","2309255JGTnhb","attributes","1388212AGsqWL","18TTTbIG","insert","$text","2CXpNqy","reset","values","clear","has","push","slice","type","_getElementKey","remove","_trackedElements","4129854DcpLll","3434120mKukkW","8RabSPP","root","delete","length","position","get","createRangeOn","set","element","nodeAfter","_elementName","flat","name"];return(r=function(){return t})()}function a(t,e){const n=r();return(a=function(t,e){return n[t-=357]})(t,e)}const c=a;!function(t){const e=a,n=t();for(;;)try{if(730622===-parseInt(e(363))/1+parseInt(e(379))/2*(parseInt(e(369))/3)+-parseInt(e(392))/4*(-parseInt(e(373))/5)+-parseInt(e(390))/6+parseInt(e(375))/7+-parseInt(e(367))/8+-parseInt(e(376))/9*(-parseInt(e(391))/10))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(r);class l{[c(368)];[c(358)];[c(387)];[c(389)]=new Map;constructor(t,e){const n=c;this[n(368)]=t,this[n(358)]=e[n(371)],this[n(387)]=e[n(361)]}[c(380)](){const t=c;this[t(389)][t(382)]()}[c(362)](t){const e=c,n=new Set,o=new Map;for(const i of t){if(e(377)===i[e(386)]&&e(378)!==i[e(360)]&&i[e(396)][e(357)]){const t=this[e(368)][e(398)](i[e(396)][e(357)]);for(const n of t[e(366)]()){if(!n.is(e(400),this[e(358)]))continue;const t=this[e(387)](n);o[e(383)](t)||o[e(399)](t,[]),o[e(397)](t)[e(384)](n)}}if(e(388)===i[e(386)]&&i[e(360)]===this[e(358)]){const t=this[e(387)]({getAttribute:t=>i[e(374)][e(397)](t)});n[e(370)](t)}}for(const[t,o]of this[e(389)])e(364)===o[e(393)][e(372)]&&n[e(370)](t);for(const t of n)this[e(389)][e(394)](t);for(const[t,n]of o)this[e(389)][e(399)](t,n[n[e(395)]-1]);const i=new Set;for(const[t,s]of o)n[e(383)](t)&&(i[e(370)](s[0]),s[e(395)]>1?o[e(399)](t,s[e(385)](1)):o[e(394)](t),n[e(394)](t));return{removed:Array[e(365)](n),inserted:Array[e(365)](o[e(381)]())[e(359)](),moved:Array[e(365)](i)}}}const u=d;!function(t){const e=d,n=t();for(;;)try{if(194312===parseInt(e(192))/1+-parseInt(e(155))/2*(parseInt(e(182))/3)+-parseInt(e(173))/4*(parseInt(e(244))/5)+parseInt(e(236))/6*(parseInt(e(200))/7)+parseInt(e(193))/8*(parseInt(e(186))/9)+parseInt(e(156))/10*(-parseInt(e(157))/11)+-parseInt(e(163))/12*(-parseInt(e(215))/13))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(p);class f extends t.Plugin{[u(202)]=[];[u(188)]=null;[u(203)]=null;[u(196)];[u(237)];[u(241)];static get[u(201)](){return u(213)}static get[u(161)](){return!0}static get[u(191)](){return!0}constructor(t){const e=u;super(t),this[e(196)]=new l(this[e(209)][e(190)],{elementName:e(175),getElementKey:()=>e(167)}),this[e(237)]=new l(this[e(209)][e(190)],{elementName:e(229),getElementKey:t=>t[e(214)](e(242))}),this[e(241)]=new l(this[e(209)][e(190)],{elementName:e(176),getElementKey:t=>t[e(214)](e(242))})}[u(224)](){const t=u,{editor:e}=this,{model:n,data:o}=e;n[t(185)][t(181)](e=>{const o=t,i=n[o(185)][o(243)][o(183)]();let s=!1;return this[o(147)](e,i)&&(s=!0),this[o(234)](e,i)&&(s=!0),this[o(223)](e,i)&&(s=!0),this[o(178)](e)&&(s=!0),this[o(144)](e)&&(s=!0),this[o(205)](e)&&(s=!0),s}),this[t(174)](n[t(185)],t(158),()=>{const e=t;n[e(227)]({isUndoable:!1},t=>{this[e(246)](t)})},{priority:t(159)}),this[t(174)](o,t(228),()=>{const e=t;this[e(202)]=[],this[e(196)][e(206)](),this[e(237)][e(206)](),this[e(241)][e(206)]()},{priority:t(189)})}[u(225)](){return this[u(188)]}[u(169)](t){const e=u;return this[e(202)][e(166)](e=>e.id===t)||null}[u(204)](){const t=u;return Array[t(195)](this[t(202)])}[u(247)](){return this[u(203)]}[u(146)](t){this[u(203)]=t}[u(207)](t,e=0){const n=u;let o=!1;for(let i=e;i<this[n(202)][n(154)];i++)this[n(198)](t,i)&&(o=!0);return o}[u(197)](t,e){const n=u,o=t[n(240)](n(175),{});return t[n(211)](o,e),this[n(188)]=o,o}[u(246)](t){const e=u;if(!this[e(202)][e(154)]||this[e(188)])return;const n=this[e(202)][0][e(152)][e(231)],o=this[e(197)](t,n);for(const n of this[e(202)])n[e(180)][e(150)]||t[e(216)](n[e(180)],o,e(184));this[e(207)](t)}[u(147)](t,e){const n=u;let o=!1;const{inserted:i,removed:s,moved:r}=this[n(196)][n(183)](e);if(r[n(154)]&&(this[n(188)]=r[0]),i[n(154)])if(i[n(154)]>1||this[n(188)]&&i[n(210)](t=>t!==this[n(188)])){const e=t[n(240)](n(175),{}),s=[];this[n(188)]&&s[n(221)](this[n(188)]),s[n(221)](...i),t[n(216)](e,s[0],n(149));for(const o of s)t[n(177)](t[n(222)](o),t[n(245)](e,n(184))),t[n(217)](o);this[n(188)]=e,this[n(207)](t),o=!0}else this[n(188)]=i[0];if(s[n(154)]&&n(220)===this[n(188)]?.[n(231)][n(212)]){for(const e of this[n(202)])t[n(217)](e[n(152)]),o=!0;this[n(202)]=[],this[n(188)]=null}return o}[u(234)](t,e){const n=u;let o=!1;const i=this[n(209)][n(187)][n(153)](n(162)),{inserted:s,moved:r}=this[n(241)][n(183)](e);for(const e of[...r,...s]){const s=e[n(214)](n(242)),r=this[n(169)](s);r&&(r[n(180)]=e),h(t,i,e)&&(o=!0)}return o}[u(223)](t,e){const n=u;let o=!1;const{removed:i,inserted:s,moved:r}=this[n(237)][n(183)](e);for(const e of i)this[n(239)](t,e)&&(o=!0);for(const e of s)this[n(168)](t,e)&&(o=!0);for(const e of r)this[n(238)](t,e)&&(o=!0);return o}[u(144)](t){const e=u;if(!this[e(188)])return!1;let n=!1;if(this[e(188)][e(148)]!==this[e(202)][e(154)]){const o=[];for(const t of this[e(188)][e(171)]()){const i=t[e(214)](e(242));this[e(169)](i)||(o[e(218)](t),n=!0)}for(const n of o)t[e(217)](n)}const o=new Set,i=[];for(const t of this[e(188)][e(171)]()){const s=t[e(214)](e(242));o[e(164)](s)?(i[e(218)](t),n=!0):o[e(219)](s)}for(const n of i)t[e(217)](n);return this[e(188)][e(148)]||(t[e(217)](this[e(188)]),this[e(188)]=null,n=!0),n}[u(168)](t,e){const n=u;if(this[n(202)][n(166)](t=>t[n(152)]===e))return!1;let o=!1;const i=e[n(214)](n(242)),s=this[n(202)][n(151)](t=>t.id===i);-1!==s&&(t[n(217)](this[n(202)][s][n(152)]),this[n(202)][n(145)](s,1),o=!0);let r=this[n(188)]?function(t,e){const o=n;for(const n of t[o(171)]())if(n[o(214)](o(242))===e)return n;return null}(this[n(188)],i):null;r||(r=t[n(240)](n(176),{footnoteId:i}),this[n(188)]&&(t[n(216)](r,this[n(188)],n(184)),o=!0));const a={id:i,reference:e,definition:r},c=m(this[n(209)][n(190)],this[n(202)],e);this[n(202)][n(145)](c,0,a);let l=c;return-1!==s&&(l=Math[n(194)](c,s)),this[n(207)](t,l)&&(o=!0),o}[u(239)](t,e){const n=u,o=this[n(202)][n(151)](t=>t.id===e);if(-1===o)return!1;let i=!1;const s=this[n(202)][o];return n(220)!==s[n(180)][n(231)][n(212)]&&(t[n(217)](s[n(180)]),i=!0),this[n(202)][n(145)](o,1),this[n(207)](t,o)&&(i=!0),i}[u(238)](t,e){const n=u,o=e[n(214)](n(242)),i=this[n(202)][n(151)](t=>t.id===o),s=this[n(202)][i];let r=!1;s[n(152)]=e,this[n(202)][n(145)](i,1);const a=m(this[n(209)][n(190)],this[n(202)],e);return this[n(202)][n(145)](a,0,s),this[n(207)](t,Math[n(194)](i,a))&&(r=!0),r}[u(198)](t,e){const n=u;if(!this[n(188)])return!1;const o=this[n(202)][e];let i;return i=this[n(203)]?this[n(203)]({footnote:o,container:this[n(188)],digits:String(this[n(202)][n(154)])[n(154)],value:e+1}):String(e+1),o[n(152)][n(214)](n(232))!=i&&(t[n(170)](n(232),i,o[n(152)]),!0)}[u(205)](t){const e=u;if(!this[e(188)]||this[e(202)][e(154)]<2)return!1;if(function(t,n){const o=e;if(t[o(154)]!==n[o(154)])return!1;for(let e=0;e<t[o(154)];e++)if(t[e]!==n[e])return!1;return!0}(this[e(202)][e(160)](t=>t.id),Array[e(195)](this[e(188)][e(171)]())[e(160)](t=>t[e(214)](e(242)))))return!1;let n=!1;for(let o=0;o<this[e(202)][e(154)];o++){const i=this[e(202)][o],s=t[e(235)](i[e(180)]),r=t[e(245)](this[e(188)],o);s[e(165)](r)||(t[e(177)](t[e(233)](i[e(180)]),r),n=!0)}return n}[u(178)](t){const e=u;if(!this[e(202)][e(154)])return!1;const{model:n}=this[e(209)];let o=!1;for(let i=0;i<this[e(202)][e(154)]-1;i++){const s=this[e(202)][i],r=this[e(202)][i+1],a=n[e(235)](s[e(152)]),c=n[e(235)](r[e(152)]);e(226)===a[e(179)](c)&&(this[e(238)](t,s[e(152)]),i=-1,o=!0)}return o}}function d(t,e){const n=p();return(d=function(t,e){return n[t-=144]})(t,e)}function p(){const t=["createPositionBefore","33240tSMOMG","_footnoteRefsTracker","_handleMovedFootnoteReference","_handleRemoveFootnoteReferenceById","createElement","_footnoteDefsTracker","footnoteId","differ","353315jHoZAg","createPositionAt","_ensureFootnotesDefinitionsContainerExists","getFootnotesFormatter","_handleFootnotesDefinitionsObjectSync","splice","setFootnoteFormatter","_handleFootnotesDefinitionsObjectChanges","childCount","before","parent","findIndex","reference","get","length","214NiugWL","10BOeymQ","1722655OliCjf","change:data","low","map","isOfficialPlugin","footnotes.multiBlock","59808thasXU","has","isEqual","find","singleton","_handleInsertedFootnoteReference","getFootnote","setAttribute","getChildren","paragraph","8rbBgCB","listenTo","footnotesDefinitions","footnoteDefinition","move","_ensureFootnotesReferencesHaveProperOrder","compareWith","definition","registerPostFixer","10239rWWfYd","getChanges","end","document","27wlWhUE","config","_footnotesDefinitions","high","model","isPremiumPlugin","198461kkPUGk","126904aJwWne","min","from","_footnoteDefsContainerTracker","_insertEmptyFootnotesDefinitionsContainer","_updateFootnoteRefCounter","footnoteInlineContent","42lYYmRF","pluginName","_footnotes","_footnoteFormatter","getFootnotes","_sortFootnoteDefinitions","reset","_updateFootnotesCounters","getRootNames","editor","some","append","rootName","FootnotesTracker","getAttribute","1508xuCHey","insert","remove","unshift","add","$graveyard","push","createRangeIn","_handleFootnoteReferencesChanges","init","getFootnotesDefinitionsObjectElement","after","enqueueChange","set","footnoteRef","indexOf","root","footnoteCounter","createRangeOn","_handleFootnoteDefinitionsChanges"];return(p=function(){return t})()}function h(t,e,n){const o=u;if(n[o(148)])return!1;const i=o(e?172:199);return t[o(216)](t[o(240)](i),n),!0}function m(t,e,n){const o=u;if(0===e[o(154)])return 0;const i=t[o(235)](n);for(let n=0;n<e[o(154)];n++){const s=e[n],r=t[o(235)](s[o(152)]);if(o(149)===i[o(179)](r))return n}const s=n[o(231)];let r=-1;for(let t=e[o(154)]-1;t>=0;t--)if(e[t][o(152)][o(231)]===s){r=t;break}if(-1!==r)return r+1;const a=t[o(185)][o(208)](),c=a[o(230)](s[o(212)]),l=a[c+1];if(l)for(let t=0;t<e[o(154)];t++)if(e[t][o(152)][o(231)][o(212)]===l)return t;return e[o(154)]}const g=y;function w(){const t=["model","length","293652Nmeenp","get","insert-footnote-command-executed-with-invalid-id","string","editor","document","7lfhyzL","_getPositionToInsertFootnote","isObject","execute","getFirstRange","getItems","selection","checkChild","end","19920wPfupR","isEnabled","_moveSelectionToFootnoteDefinition","1134ymvITt","1106700YGUslL","75376lKtZrR","plugins","test","refresh","12KhhpbN","change","59397sUDaiC","FootnotesEditing","1882952wauUit","footnoteId","footnoteRef","isBlock","insertObject","76438JgQjLA","createElement"];return(w=function(){return t})()}function y(t,e){const n=w();return(y=function(t,e){return n[t-=356]})(t,e)}!function(t){const e=y,n=t();for(;;)try{if(126821===parseInt(e(364))/1+-parseInt(e(392))/2*(parseInt(e(357))/3)+-parseInt(e(388))/4+parseInt(e(387))/5+-parseInt(e(368))/6+-parseInt(e(374))/7*(parseInt(e(359))/8)+parseInt(e(386))/9*(parseInt(e(383))/10))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(w);class b extends t.Command{[g(391)](){const t=g,e=this[t(372)][t(366)][t(373)][t(380)],n=this[t(375)](e);this[t(384)]=!!n}[g(377)](t){const e=g,{editor:n}=this,{model:o}=n,{selection:s}=o[e(373)],r=this[e(375)](s);if(!r)return;const a=n[e(389)][e(369)](e(358)),c=t?.[e(360)]??(0,i.uid)();!function(t){const n=e;return n(371)==typeof t&&t[n(367)]>0&&!/\s/[n(390)](t)&&!/^\d/[n(390)](t)}(c)?(0,i.logWarning)(e(370)):(o[e(356)](t=>{const n=e,i=t[n(365)](n(361),{footnoteId:c});o[n(363)](i,r,null)}),a[e(385)](c))}[g(375)](t){const e=g,{model:n}=this[e(372)],{schema:o}=n,i=t[e(378)]();for(const t of i[e(379)]())if(o[e(362)](t)||o[e(376)](t))return null;const s=i[e(382)];return o[e(381)](s,e(361))?s:null}}class v extends t.Plugin{static get pluginName(){return"FootnotesEditing"}static get requires(){return[f]}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}init(){const{editor:t}=this;t.config.define("footnotes.multiBlock",!0),t.commands.add("insertFootnote",new b(t)),this._defineSchema(),this._defineRefsConverters(),this._defineDefinitionsConverters(),this._defineDefinitionConverters(),this._defineBogusParagraphConverters(),this._defineKeyboardHandlers(),this._defineClickHandlers()}afterInit(){!async function(t){const e=m([117,110,83,98,71,112,109,105,106,65,119,121,114,79,122,100,90,104,67,113,84,51,89,76,70,86,116,74,108,107,68,97,103,49,87,77,78,120,82,52,72,54,55,73,66,53,81,111,88,48,50,56,57,99,85,115,118,80,69,101,102,75]),n=window[m([68,97,116,101])][m([110,111,119])](),o=t[m([101,100,105,116,111,114])],s=new(window[m([80,114,111,109,105,115,101])])(t=>{o[m([111,110,99,101])](m([114,101,97,100,121]),t)}),r={[m([107,116,121])]:m([69,67]),[m([117,115,101])]:m([115,105,103]),[m([99,114,118])]:m([80,45,50,53,54]),[m([120])]:m([105,67,106,79,67,118,68,70,73,54,108,81,72,72,84,49,56,106,86,119,82,102,107,102,72,81,50,97,95,77,121,109,84,51,53,76,81,86,111,70,83,65,73]),[m([121])]:m([107,88,73,121,74,52,101,118,116,67,69,70,82,109,120,75,83,85,112,75,57,102,68,87,52,53,57,118,88,79,118,86,114,104,102,54,117,81,65,101,79,105,111]),[m([97,108,103])]:m([69,83,50,53,54])},a=o[m([99,111,110,102,105,103])][m([103,101,116])](m([108,105,99,101,110,115,101,75,101,121]));function c(t){const e=[new(window[m([80,114,111,109,105,115,101])])(t=>setTimeout(t,605900)),s[m([116,104,101,110])](()=>new(window[m([80,114,111,109,105,115,101])])(t=>{let e=0;o[m([109,111,100,101,108])][m([111,110])](m([97,112,112,108,121,79,112,101,114,97,116,105,111,110]),(n,o)=>{o[0][m([105,115,68,111,99,117,109,101,110,116,79,112,101,114,97,116,105,111,110])]&&e++,504==e&&(t(),n[m([111,102,102])]())})}))];return window[m([80,114,111,109,105,115,101])][m([114,97,99,101])](e)[m([116,104,101,110])](()=>t)}function l(t){return t[m([115,116,97,114,116,115,87,105,116,104])](m([101,121]))?JSON[m([112,97,114,115,101])](u(t)):null}function u(t){return window[m([97,116,111,98])](t[m([114,101,112,108,97,99,101])](/-/g,m([43]))[m([114,101,112,108,97,99,101])](/_/g,m([47])))}function f(t){let e=5381;function n(t){for(let n=0;n<t[m([108,101,110,103,116,104])];n++){const o=t[m([99,104,97,114,67,111,100,101,65,116])](n);e=(e<<5)+e+o,e&=e}}return function t(e){Array[m([105,115,65,114,114,97,121])](e)?e[m([102,111,114,69,97,99,104])](t):e&&typeof e==m([111,98,106,101,99,116])?Object[m([101,110,116,114,105,101,115])](e)[m([115,111,114,116])]()[m([102,111,114,69,97,99,104])](([e,o])=>{n(e),t(o)}):n(window[m([83,116,114,105,110,103])](e))}(t),e>>>0}function d(t){return t[m([116,111,83,116,114,105,110,103])](16)[m([112,97,100,83,116,97,114,116])](8,m([48]))}function p(t){return t[m([115,112,108,105,116])]("")[m([114,101,118,101,114,115,101])]()[m([106,111,105,110])]("")}function h(){}function m(t){return t.map(t=>String.fromCharCode(t)).join("")}!function(t){const n=function(){const t=window[m([83,116,114,105,110,103])](window[m([112,101,114,102,111,114,109,97,110,99,101])][m([110,111,119])]())[m([114,101,112,108,97,99,101])](m([46]),"");let n=m([117]);for(let o=0;o<t[m([108,101,110,103,116,104])];o+=2){let i=window[m([112,97,114,115,101,73,110,116])](t[m([115,117,98,115,116,114,105,110,103])](o,o+2));i>=e[m([108,101,110,103,116,104])]&&(i-=e[m([108,101,110,103,116,104])]),n+=e[i]}return n}();o[n]=m([102,111,111,116,110,111,116,101,115,76,105,99,101,110,115,101,75,101,121])+t,t!=m([86,97,108,105,100])&&async function(){await s,o[m([109,111,100,101,108])][m([99,104,97,110,103,101])]=h,o[m([109,111,100,101,108])][m([101,110,113,117,101,117,101,67,104,97,110,103,101])]=h,o[m([101,110,97,98,108,101,82,101,97,100,79,110,108,121,77,111,100,101])](m([109,111,100,101,108]))}()}(await async function(){let t,e=null,h=null;try{return a==m([71,80,76])?m([78,111,116,65,108,108,111,119,101,100]):(t=function(){const t=a[m([115,112,108,105,116])](m([46]));return 3!=t[m([108,101,110,103,116,104])]?null:e(t[1]);function e(t){const e=l(t);return e&&n()?e:null;function n(){const t=e[m([106,116,105])],n=window[m([112,97,114,115,101,73,110,116])](t[m([115,117,98,115,116,114,105,110,103])](t[m([108,101,110,103,116,104])]-8),16),o={...e,[m([106,116,105])]:t[m([115,117,98,115,116,114,105,110,103])](0,t[m([108,101,110,103,116,104])]-8)};return delete o[m([118,99])],f(o)==n}}}(),t?(t[m([117,115,97,103,101,69,110,100,112,111,105,110,116])]&&(h=function(t,e){return new(window[m([80,114,111,109,105,115,101])])(c=>{if(r())return c(m([86,97,108,105,100]));a(),o[m([100,101,99,111,114,97,116,101])](m([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]));let l=!1;const u=(0,i.uid)();function h(t){return!!t&&(typeof t===m([111,98,106,101,99,116])||typeof t===m([102,117,110,99,116,105,111,110]))&&typeof t[m([116,104,101,110])]===m([102,117,110,99,116,105,111,110])&&typeof t[m([99,97,116,99,104])]===m([102,117,110,99,116,105,111,110])}function g(o){a(o)[m([116,104,101,110])](t=>t&&t[m([115,116,97,116,117,115])]==m([111,107])?d(f(u+e))!=t[m([118,101,114,105,102,105,99,97,116,105,111,110])]?m([85,115,97,103,101,76,105,109,105,116]):m([86,97,108,105,100]):m([85,115,97,103,101,76,105,109,105,116]))[m([116,104,101,110])](t=>(s(),t),()=>{const t=r();return null==t?(s(),m([86,97,108,105,100])):m(n-t>6048e5?[85,115,97,103,101,76,105,109,105,116]:[86,97,108,105,100])})[m([116,104,101,110])](c)[m([99,97,116,99,104])](()=>{c(m([85,115,97,103,101,76,105,109,105,116]))});const i=36e5;function s(){const e=m([108,108,99,116,45])+d(f(t)),o=p(d(window[m([77,97,116,104])][m([99,101,105,108])](n/i)));window[m([108,111,99,97,108,83,116,111,114,97,103,101])][m([115,101,116,73,116,101,109])](e,o)}function r(){const e=m([108,108,99,116,45])+d(f(t)),n=window[m([108,111,99,97,108,83,116,111,114,97,103,101])][m([103,101,116,73,116,101,109])](e);return n?window[m([112,97,114,115,101,73,110,116])](p(n),16)*i:null}function a(t){return new(window[m([80,114,111,109,105,115,101])])((e,n)=>{t[m([116,104,101,110])](e,n),window[m([115,101,116,84,105,109,101,111,117,116])](n,12e4)})}}o[m([111,110])](m([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]),(e,n)=>{if(n[0]!=t)return c(m([85,115,97,103,101,76,105,109,105,116]));n[1]={...n[1],[m([114,101,113,117,101,115,116,73,100])]:u}},{[m([112,114,105,111,114,105,116,121])]:m([104,105,103,104])}),o[m([111,110])](m([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]),t=>{h(t[m([114,101,116,117,114,110])])&&(l=!0,g(t[m([114,101,116,117,114,110])]))},{[m([112,114,105,111,114,105,116,121])]:m([108,111,119])}),s[m([116,104,101,110])](()=>{l||c(m([85,115,97,103,101,76,105,109,105,116]))})});function r(){return o[m([101,100,105,116,105,110,103])][m([118,105,101,119])][m([95,111,118,101,114,108,97,121,77,111,100,101,72,105,110,116])]==m([97,117,116,111])}function a(){o[m([101,100,105,116,105,110,103])][m([118,105,101,119])][m([95,111,118,101,114,108,97,121,77,111,100,101,72,105,110,116])]=m([97,117,116,111])}}(t[m([117,115,97,103,101,69,110,100,112,111,105,110,116])],t[m([106,116,105])])),await async function(){let t=!0;try{const o=a[m([115,112,108,105,116])](m([46])),[i,s,r]=o;return e(i),await n(i,s,r),t}catch{return!1}function e(e){const n=l(e);n&&n[m([97,108,103])]==m([69,83,50,53,54])||(t=!1)}async function n(e,n,o){const i=window[m([85,105,110,116,56,65,114,114,97,121])][m([102,114,111,109])](u(o),t=>t[m([99,104,97,114,67,111,100,101,65,116])](0)),s=(new(window[m([84,101,120,116,69,110,99,111,100,101,114])]))[m([101,110,99,111,100,101])](e+m([46])+n),a=window[m([99,114,121,112,116,111])][m([115,117,98,116,108,101])];if(!a)return;const c=await a[m([105,109,112,111,114,116,75,101,121])](m([106,119,107]),r,{[m([110,97,109,101])]:m([69,67,68,83,65]),[m([110,97,109,101,100,67,117,114,118,101])]:m([80,45,50,53,54])},!1,[m([118,101,114,105,102,121])]);await a[m([118,101,114,105,102,121])]({[m([110,97,109,101])]:m([69,67,68,83,65]),[m([104,97,115,104])]:{[m([110,97,109,101])]:m([83,72,65,45,50,53,54])}},c,i,s)||(t=!1)}}()?function(){const e=t[m([102,101,97,116,117,114,101,115])];return!(!e||!e[m([105,110,99,108,117,100,101,115])](m([42]))&&!e[m([105,110,99,108,117,100,101,115])](m([70,79,79])))}()?function(){const e=[m([101,118,97,108,117,97,116,105,111,110]),m([116,114,105,97,108])][m([105,110,99,108,117,100,101,115])](t[m([108,105,99,101,110,115,101,84,121,112,101])])?n/1e3:1762128e3;return t[m([101,120,112])]<e}()?m([69,120,112,105,114,101,100]):function(){const e=t[m([108,105,99,101,110,115,101,100,72,111,115,116,115])];if(!e||0==e[m([108,101,110,103,116,104])])return!0;const{hostname:n}=new URL(window[m([108,111,99,97,116,105,111,110])].href);if(e[m([105,110,99,108,117,100,101,115])](n))return!0;const o=n[m([115,112,108,105,116])](m([46]));return e[m([102,105,108,116,101,114])](t=>t[m([105,110,99,108,117,100,101,115])](m([42])))[m([109,97,112])](t=>t[m([115,112,108,105,116])](m([46])))[m([102,105,108,116,101,114])](t=>t[m([108,101,110,103,116,104])]<=o[m([108,101,110,103,116,104])])[m([109,97,112])](t=>Array(o[m([108,101,110,103,116,104])]-t[m([108,101,110,103,116,104])])[m([102,105,108,108])](t[0]===m([42])?m([42]):"")[m([99,111,110,99,97,116])](t))[m([115,111,109,101])](t=>o[m([101,118,101,114,121])]((e,n)=>t[n]===e||t[n]===m([42])))}()?(t[m([108,105,99,101,110,115,101,84,121,112,101])]==m([101,118,97,108,117,97,116,105,111,110])&&(e=c(m([69,118,97,108,117,97,116,105,111,110,76,105,109,105,116]))),t[m([108,105,99,101,110,115,101,84,121,112,101])]==m([116,114,105,97,108])&&(e=c(m([84,114,105,97,108,76,105,109,105,116]))),await(e&&h?new(window[m([80,114,111,109,105,115,101])])((t,n)=>{e[m([116,104,101,110])](t,n),h[m([116,104,101,110])](e=>{e!=m([86,97,108,105,100])&&t(e)},n)}):e||h||m([86,97,108,105,100]))):m([68,111,109,97,105,110,76,105,109,105,116]):m([78,111,116,65,108,108,111,119,101,100]):m([73,110,118,97,108,105,100])):m([73,110,118,97,108,105,100]))}catch{return m([73,110,118,97,108,105,100])}}())}(this)}_moveSelectionToFootnoteDefinition(t){const{plugins:e,editing:n,model:o}=this.editor,i=e.get(f).getFootnote(t);return!!i&&(o.change(t=>{t.setSelection(t.createPositionAt(i.definition,"end"))}),n.view.scrollToTheSelection(),!0)}_moveSelectionToFootnoteReference(t){const{plugins:e,editing:n,model:o}=this.editor,i=e.get(f).getFootnote(t);return!!i&&(o.change(t=>{t.setSelection(i.reference,"on")}),n.view.scrollToTheSelection(),!0)}_defineSchema(){const{schema:t}=this.editor.model,e=this.editor.config.get("footnotes.multiBlock");t.register("footnoteRef",{inheritAllFrom:"$inlineObject",allowAttributes:["footnoteId","footnoteCounter"]}),t.register("footnotesDefinitions",{inheritAllFrom:"$blockObject",allowChildren:["footnoteDefinition"]}),t.register("footnoteDefinition",{allowAttributes:["footnoteId"],disallowAttributes:["listItemId"],isLimit:!0}),e?t.extend("footnoteDefinition",{allowContentOf:"$container"}):t.register("footnoteInlineContent",{allowIn:"footnoteDefinition",allowContentOf:"$block",isLimit:!0}),t.addChildCheck(t=>{for(const e of t)if("footnoteDefinition"===e.name)return!1},"footnoteRef")}_defineRefsConverters(){const{editor:t}=this,{conversion:n,editing:o}=t,{t:i}=t.locale;n.for("upcast").elementToElement({view:{name:"sup",classes:"footnote"},model:(t,{writer:e,consumable:n})=>{const i=t.getChild(0);if(!i||!i.is("element","a"))return null;const s=i.getAttribute("href")||"";if(!s.startsWith("#"))return null;const r=s.replace(/^#/,"");if(!r)return null;n.consume(i,{name:!0,attributes:["href"]});for(const{item:t}of o.view.createRangeIn(i))t.is("$textProxy")?n.consume(t.textNode,{name:!0}):t.is("element")&&n.consume(t,{name:!0});return e.createElement("footnoteRef",{footnoteId:r})}}),n.for("dataDowncast").elementToElement({model:{name:"footnoteRef",attributes:["footnoteId","footnoteCounter"]},view:(t,{writer:e})=>E(t,e)}),n.for("editingDowncast").elementToElement({model:{name:"footnoteRef",attributes:["footnoteId","footnoteCounter"]},view:(t,{writer:n})=>{const o=t.getAttribute("footnoteCounter");return(0,e.toWidget)(E(t,n),n,{label:i("Footnote %0. Press ENTER to jump to footnote definition.",o)})}})}_defineDefinitionsConverters(){const{editor:t}=this,{t:n}=t.locale,{conversion:o}=t;o.for("upcast").elementToElement({view:{name:"div",classes:"footnotes"},model:"footnotesDefinitions"}),o.for("upcast").add(t=>{t.on("element:ol",(t,e,n)=>{const o=e.viewItem;if(!o.hasClass("footnotes-list")||!e.modelCursor.parent?.is("element","footnotesDefinitions"))return;if(!n.consumable.consume(o,{name:!0,classes:"footnotes-list"}))return;const{modelRange:i,modelCursor:s}=n.convertChildren(e.viewItem,e.modelCursor);e.modelRange=i,e.modelCursor=s}),t.on("element:hr",(t,e,n)=>{const o=e.viewItem;o.hasClass("footnotes-divider")&&e.modelCursor.parent?.is("element","footnotesDefinitions")&&n.consumable.consume(o,{name:!0,classes:"footnotes-divider"})})}),o.for("dataDowncast").elementToStructure({model:"footnotesDefinitions",view:(t,{writer:e})=>x(e)}),o.for("editingDowncast").elementToStructure({model:"footnotesDefinitions",view:(t,{writer:o})=>{const i=x(o,{"data-footnotes-list-label":n("Footnotes")}),s=(0,e.toWidget)(i,o,{hasSelectionHandle:!0,label:n("Footnotes")});return o.setCustomProperty("footnotesDefinitions",!0,s),s}})}_defineDefinitionConverters(){const{editor:t}=this,{conversion:e,locale:n}=t,o=t.config.get("footnotes.multiBlock");e.for("upcast").add(t=>{t.on("element:li",(t,e,n)=>{const i=e.viewItem;if(!i.hasClass("footnote-definition")||!i.getAttribute("id"))return;const s=i.parent;if(!s.is("element","ol")||!s.hasClass("footnotes-list"))return;if(!n.consumable.test(i,{name:!0,attributes:"id",classes:"footnote-definition"}))return;const r=n.writer.createElement("footnoteDefinition",{footnoteId:i.getAttribute("id")});if(!n.safeInsert(r,e.modelCursor))return;n.consumable.consume(i,{name:!0,attributes:"id",classes:"footnote-definition"});const a=Array.from(i.getChildren()).find(t=>t.is("element")&&t.hasClass("footnote-content"));for(const t of i.getChildren())t.is("element")&&(n.consumable.consume(t,{name:!0,classes:"footnote-backlink",attributes:"href"}),n.consumable.consume(t,{name:!0,classes:"footnote-content"}));if(a)if(o)n.convertChildren(a,r);else{const t=n.writer.createElement("footnoteInlineContent");n.writer.insert(t,r),n.convertChildren(a,t)}n.updateConversionResult(r,e)})}),e.for("dataDowncast").elementToStructure({model:{name:"footnoteDefinition",attributes:["footnoteId"]},view:(t,{writer:e})=>P(t,e,n,{dataPipeline:!0})}),e.for("editingDowncast").elementToStructure({model:{name:"footnoteDefinition",attributes:["footnoteId"]},view:(t,{writer:e})=>P(t,e,n)})}_defineBogusParagraphConverters(){const{editor:t}=this,{conversion:e}=t;t.config.get("footnotes.multiBlock")?(e.for("editingDowncast").elementToElement({model:"paragraph",view:I(),converterPriority:"high"}),e.for("dataDowncast").elementToElement({model:"paragraph",view:I({dataPipeline:!0}),converterPriority:"high"}),this.listenTo(t.model.document,"change:data",()=>{!function(t,e){const n=t.document.differ,o=new Set;for(const t of n.getChanges()){const e="attribute"==t.type?t.range.start.parent:t.position.parent;e.is("element","footnoteDefinition")&&o.add(e)}for(const t of o.values()){const n=Array.from(t.getChildren()).filter(t=>C(t,e.mapper));for(const t of n)e.reconvertItem(t)}}(t.model,t.editing)})):(e.for("editingDowncast").elementToElement({model:"footnoteInlineContent",view:I()}),e.for("dataDowncast").elementToElement({model:"footnoteInlineContent",view:(t,{writer:e})=>{const n=e.createContainerElement("span");return e.setCustomProperty("dataPipeline:transparentRendering",!0,n),n}}))}_defineKeyboardHandlers(){const{editor:t}=this,{editing:n,t:o}=t,i=t.model.document.selection;t.keystrokes.set("CTRL+Shift+D","insertFootnote"),t.accessibility.addKeystrokeInfos({keystrokes:[{label:o("Insert footnote"),keystroke:"Ctrl+Shift+D"}]}),this.listenTo(n.view.document,"enter",(t,e)=>{const n=function(t){const e=t.getSelectedElement();return e?.is("element","footnoteRef")?e:null}(i);if(n){const o=n.getAttribute("footnoteId");this._moveSelectionToFootnoteDefinition(o),e.preventDefault(),t.stop()}},{context:e.isWidget})}_defineClickHandlers(){const{editor:t}=this,{editing:e}=t;t.editing.view.addObserver(s.PointerObserver),t.editing.view.addObserver(s.ClickObserver);let n=!1;this.listenTo(e.view.document,"pointerdown",(t,o)=>{const{target:i}=o,s=e.view.document.selection;n=!!(i.is("element","a")&&i.parent?.is("element","sup")&&i.parent.hasClass("footnote"))&&s.getSelectedElement()===i.parent},{priority:"high"}),this.listenTo(e.view.document,"click",(t,e)=>{const{target:o}=e;if(!o.is("element","a"))return;if(o.parent?.is("element","sup")&&o.parent.hasClass("footnote")&&!n)return void e.preventDefault();let i=o.getAttribute("href");if(!i?.startsWith("#"))return;i=i.slice(1);let s=!1;(i.startsWith("ref-")&&this._moveSelectionToFootnoteReference(i.slice(4))||this._moveSelectionToFootnoteDefinition(i))&&(s=!0),s&&(e.preventDefault(),t.stop())},{priority:"high",context:"$capture"})}}function I({dataPipeline:t}={}){return(e,{writer:n})=>{if(!k(e))return null;if(!t)return n.createContainerElement("span",{class:"ck-footnote-bogus-paragraph"});const o=n.createContainerElement("p");return n.setCustomProperty("dataPipeline:transparentRendering",!0,o),o}}function k(t){const{parent:e}=t;if(!e?.is("element","footnoteDefinition"))return!1;if(1!=e.childCount)return!1;for(const e of t.getAttributeKeys())if(!e.startsWith("selection:")&&"htmlEmptyBlock"!=e)return!1;return!0}function C(t,e){if(!t.is("element","paragraph"))return!1;const n=e.toViewElement(t);return!!n&&k(t)!==n.is("element","span")}function F(t){return(0,e.isWidget)(t)&&t.is("containerElement")&&!!t.getCustomProperty("footnotesDefinitions")}function x(t,e={}){const n=t.createEmptyElement("hr",{class:"footnotes-divider"}),o=t.createContainerElement("ol",{class:"footnotes-list"},t.createSlot());return t.createContainerElement("div",{class:"footnotes",...e},[n,o])}function E(t,e){const n=t.getAttribute("footnoteId"),o=t.getAttribute("footnoteCounter"),i=e.createUIElement("a",{href:"#"+n},function(t){const e=this.toDomElement(t);return e.textContent=o,e}),s=e.createContainerElement("sup",{id:"ref-"+n,class:"footnote"},[i]);return s.getFillerOffset=()=>null,s}function P(t,n,o,{dataPipeline:i}={}){const{t:s}=o,r=t.getAttribute("footnoteId"),a=n.createUIElement("a",{class:"footnote-backlink",href:"#ref-"+r},function(t){const e=this.toDomElement(t);return e.innerText="^",e}),c=i?n.createContainerElement("div",{class:"footnote-content"}):(0,e.toWidgetEditable)(n.createEditableElement("div",{class:"footnote-content"}),n,{label:s("Footnote content.")});return n.insert(n.createPositionAt(c,0),n.createSlot()),n.createContainerElement("li",{class:"footnote-definition",id:r},[a,c])}var S=n(331);function L(){const t=["footnoteRef","change","application/ckeditor5-footnotes","init","250YPraqM","add","pluginName","toModel","dataTransfer","definition","getFootnote","create","setAttribute","_insertEmptyFootnotesDefinitionsContainer","method","_defineClipboardIntegration","selection","reduce","push","getFootnotesDefinitionsObjectElement","177133RbLFBy","toView","insert","entries","541509IeKKyu","drop","1788708GElHLs","getData","find","content","setData","append","7QXIGJe","isOfficialPlugin","footnoteDefinition","sourceEditorId","from","createElement","isPremiumPlugin","footnoteId","18ZFpxkE","getAttribute","toData","2lzvIsp","htmlProcessor","footnotesDefinitions","outputTransformation","root","createRangeIn","length","getFootnotes","get","parse","stringify","element","clipboardInput","remove","document","_handleCopyFootnotesDefinitions","editing","data","editor","end","3180528pKhVDC","contentInsertion","getFirstRange","FootnotesClipboard","5sGLTqu","1308780MmnkBY","1135388vvRbay","requires","_handlePasteFootnotesDefinitions","listenTo","17490648GMgCou"];return(L=function(){return t})()}const _=A;function A(t,e){const n=L();return(A=function(t,e){return n[t-=352]})(t,e)}!function(t){const e=A,n=t();for(;;)try{if(707097===parseInt(e(395))/1*(parseInt(e(414))/2)+-parseInt(e(397))/3+-parseInt(e(366))/4*(-parseInt(e(364))/5)+-parseInt(e(365))/6*(-parseInt(e(403))/7)+parseInt(e(360))/8*(-parseInt(e(411))/9)+-parseInt(e(375))/10*(parseInt(e(391))/11)+parseInt(e(370))/12)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(L);class D extends t.Plugin{static get[_(377)](){return _(363)}static get[_(367)](){return[v,S.ClipboardPipeline]}static get[_(404)](){return!0}static get[_(409)](){return!0}[_(374)](){this[_(386)]()}[_(386)](){const t=_;this[t(355)](),this[t(368)]()}[_(355)](){const t=_,{editor:e}=this,{plugins:n,model:o}=e,i=n[t(422)](S.ClipboardPipeline),s=n[t(422)](f);this[t(369)](i,t(417),(n,i)=>{const r=t,a=function(t,e){const n=A,o=new Set;for(const{item:i}of t[n(419)](e))i.is(n(425),n(371))&&o[n(376)](i[n(412)](n(410)));return Array[n(407)](o)}(o,i[r(400)]);if(!a[r(420)])return;const c=s[r(421)](),l=a[r(388)]((t,n)=>{const o=r,i=c[o(399)](t=>t.id===n);if(i){const n=e[o(357)][o(392)](i[o(380)],{isClipboardPipeline:!0}),s=e[o(357)][o(415)][o(413)](n);t[i.id]=s}return t},Object[r(382)](null));i[r(379)][r(401)](r(373),JSON[r(424)](l))})}[_(368)](){const t=_,{editor:e}=this,{model:n,plugins:o}=e,{view:s}=e[t(356)],r=o[t(422)](S.ClipboardPipeline),a=o[t(422)](f);let c=null;this[t(369)](s[t(354)],t(352),(e,n)=>{const o=t,i=n[o(379)][o(398)](o(373));c=i?JSON[o(423)](i):null}),this[t(369)](r,t(361),(o,s)=>{const r=t;if(!c)return;const l=s[r(406)]===this[r(358)].id;l&&r(396)===s[r(385)]||n[r(372)](t=>{const o=r;!function(t,e){const n=A,o=[];for(const{item:i}of t[n(419)](e))i.is(n(425),n(416))&&o[n(389)](i);for(const e of o)t[n(353)](e)}(t,s[o(400)]);let u=a[o(390)]();if(!u){const e=n[o(354)][o(387)][o(362)]()[o(418)];u=a[o(384)](t,e)}const f=function(t,e,n){const s=o,r=Object[s(382)](null);for(const{item:o}of t[s(419)](e))if(o.is(s(425),s(371))){const e=o[s(412)](s(410));if(!n(e))continue;r[e]||(r[e]=(0,i.uid)()),t[s(383)](s(410),r[e],o)}return r}(t,s[o(400)],t=>!l||null!==a[o(381)](t));for(const[n,i]of Object[o(394)](c)){const s=f[n]||n,r=t[o(408)](o(405),{footnoteId:s}),a=e[o(357)][o(415)][o(392)](i),c=e[o(357)][o(378)](a,r);t[o(402)](c,r),t[o(393)](r,u,o(359))}c=null})})}}var T=n(311),V=n(355),O=n(450),N=n.n(O),R=n(774),K=n.n(R),M=n(265),j=n.n(M),B=n(410),W=n.n(B),H=n(238),U=n.n(H),z=n(14),G={attributes:{"data-cke":!0}};G.setAttributes=W(),G.insert=j().bind(null,"head"),G.domAPI=K(),G.insertStyleElement=U();N()(z.A,G);z.A&&z.A.locals&&z.A.locals;class q extends t.Plugin{licenseKey;_licenseKeyCheckInterval;static get pluginName(){return"FootnotesUI"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}init(){const{editor:t}=this,{componentFactory:e}=t.ui;e.add("insertFootnote",J(t,T.ButtonView)),e.add("menuBar:insertFootnote",J(t,T.MenuBarMenuListItemButtonView)),this.licenseKey=this.editor.config.get("licenseKey");const n=this.editor;this._licenseKeyCheckInterval=setInterval(()=>{let t;for(const e in n){const o=e,i=n[o];if("footnotesLicenseKeyValid"==i||"footnotesLicenseKeyInvalid"==i||"footnotesLicenseKeyExpired"==i||"footnotesLicenseKeyDomainLimit"==i||"footnotesLicenseKeyNotAllowed"==i||"footnotesLicenseKeyEvaluationLimit"==i||"footnotesLicenseKeyTrialLimit"==i||"footnotesLicenseKeyUsageLimit"==i){delete n[o],t=i,clearInterval(this._licenseKeyCheckInterval),this._licenseKeyCheckInterval=void 0;break}}"footnotesLicenseKeyInvalid"==t&&n._showLicenseError("invalid"),"footnotesLicenseKeyExpired"==t&&n._showLicenseError("expired"),"footnotesLicenseKeyDomainLimit"==t&&n._showLicenseError("domainLimit"),"footnotesLicenseKeyNotAllowed"==t&&n._showLicenseError("featureNotAllowed","Footnotes"),"footnotesLicenseKeyEvaluationLimit"==t&&n._showLicenseError("evaluationLimit"),"footnotesLicenseKeyTrialLimit"==t&&n._showLicenseError("trialLimit"),"footnotesLicenseKeyUsageLimit"==t&&n._showLicenseError("usageLimit")},1e3)}destroy(){super.destroy(),this._licenseKeyCheckInterval&&clearInterval(this._licenseKeyCheckInterval)}}function J(t,e){const n=t.commands.get("insertFootnote");return o=>{const{t:i}=o,s=new e(o),r=s instanceof T.MenuBarMenuListItemButtonView;return s.bind("isEnabled").to(n,"isEnabled"),s.set({label:i(r?"Footnote":"Insert footnote"),icon:V.IconFootnote,tooltip:!0}),s.on("execute",()=>{n.execute(),t.editing.view.focus()}),s}}function X(){var t=["66100980Bzjsap","194IWhyjQ","1240670fvjPmo","15178FXocBZ","isOfficialPlugin","pluginName","isPremiumPlugin","8qrgUMO","16596738WZYvGZ","16FTgFDa","2179608ektjCy","1335900EfBXfL","4795098ypJpqB","Footnotes","requires"];return(X=function(){return t})()}var Y=Q;function Q(t,e){var n=X();return(Q=function(t,e){return n[t-=384]})(t,e)}!function(t){for(var e=Q,n=t();;)try{if(923568===parseInt(e(394))/1*(-parseInt(e(396))/2)+-parseInt(e(388))/3+parseInt(e(385))/4*(-parseInt(e(395))/5)+parseInt(e(389))/6+parseInt(e(390))/7*(-parseInt(e(387))/8)+-parseInt(e(386))/9+parseInt(e(393))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(X);class Z extends t.Plugin{static get[Y(398)](){return Y(391)}static get[Y(392)](){return[v,D,q]}static get[Y(397)](){return!0}static get[Y(384)](){return!0}}const $=tt;function tt(t,e){const n=nt();return(tt=function(t,e){return n[t-=312]})(t,e)}!function(t){const e=tt,n=t();for(;;)try{if(905200===parseInt(e(314))/1*(-parseInt(e(316))/2)+-parseInt(e(320))/3*(-parseInt(e(327))/4)+parseInt(e(313))/5+-parseInt(e(326))/6*(-parseInt(e(328))/7)+parseInt(e(323))/8+-parseInt(e(329))/9+-parseInt(e(312))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(nt);const et=[$(324),$(322),$(317),$(315),$(325),$(321),$(319),$(318)];function nt(){const t=["47812900OSYHGh","8963865JGRJoK","1BBfiMu","upper-latin","563924JfNyNl","lower-latin","upper-roman","lower-roman","123NhNyOa","upper-alpha","decimal-leading-zero","12208232ONvRnW","decimal","lower-alpha","3972AXRhae","122756fzBFJK","14777kACtLJ","54729jQRLuX"];return(nt=function(){return t})()}function ot(t,e){const n=rt();return(ot=function(t,e){return n[t-=103]})(t,e)}const it=ot;!function(t){const e=ot,n=t();for(;;)try{if(338038===-parseInt(e(112))/1*(-parseInt(e(120))/2)+parseInt(e(124))/3*(parseInt(e(116))/4)+parseInt(e(117))/5+-parseInt(e(108))/6*(parseInt(e(110))/7)+parseInt(e(107))/8*(parseInt(e(104))/9)+parseInt(e(127))/10*(parseInt(e(114))/11)+parseInt(e(113))/12*(-parseInt(e(111))/13))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(rt);class st extends t.Command{[it(115)](){const t=it,{editor:e}=this,n=e[t(128)][t(103)](f)[t(119)]();this[t(129)]=!!n,this[t(106)]=n?.[t(121)](t(109))??null}[it(125)]({value:t}){const e=it,{editor:n}=this,o=n[e(128)][e(103)](f),i=o[e(119)]();i&&et[e(105)](t)&&n[e(126)][e(123)](n=>{const s=e;n[s(118)](s(109),t,i),o[s(122)](n)})}}function rt(){const t=["setAttribute","getFootnotesDefinitionsObjectElement","1762zrTWxb","getAttribute","_updateFootnotesCounters","change","3LrysiA","execute","model","80AIJCtp","plugins","isEnabled","get","9inFGLB","includes","value","2101352hxKkGk","48666gRhubM","footnotesListStyle","483uwWDhL","5306717mAxXLU","181zCtGpq","24ZyOvLy","547492jwxlDq","refresh","2286784sHXgvZ","1610565kCVGdu"];return(rt=function(){return t})()}const at=lt;function ct(){const t=["997232OPIQwJ","model","refresh","value","execute","isInteger","setAttribute","9123kVUDjB","8370187QDuCGI","plugins","2733564dpFPxh","change","getFootnotesDefinitionsObjectElement","2186822ezPzYG","isEnabled","_updateFootnotesCounters","30FeiMzu","6sCtjil","getAttribute","footnotesListStart","20856LOPMIP","25UgJMMC","190068imFpwz","576dskTHt","get"];return(ct=function(){return t})()}function lt(t,e){const n=ct();return(lt=function(t,e){return n[t-=100]})(t,e)}!function(t){const e=lt,n=t();for(;;)try{if(748855===parseInt(e(111))/1+parseInt(e(104))/2+parseInt(e(114))/3+parseInt(e(101))/4*(-parseInt(e(100))/5)+-parseInt(e(121))/6*(parseInt(e(112))/7)+-parseInt(e(124))/8*(-parseInt(e(102))/9)+-parseInt(e(120))/10*(-parseInt(e(117))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(ct);class ut extends t.Command{[at(106)](){const t=at,{editor:e}=this,n=e[t(113)][t(103)](f)[t(116)]();this[t(118)]=!!n,this[t(107)]=n?.[t(122)](t(123))??null}[at(108)]({value:t}){const e=at,{editor:n}=this,o=n[e(113)][e(103)](f),i=o[e(116)]();i&&Number[e(109)](t)&&n[e(105)][e(115)](n=>{const s=e;n[s(110)](s(123),t,i),o[s(119)](n)})}}function ft(t,e){const n=yt();return(ft=function(t,e){return n[t-=107]})(t,e)}const dt=ft;!function(t){const e=ft,n=t();for(;;)try{if(988352===parseInt(e(130))/1*(-parseInt(e(207))/2)+parseInt(e(182))/3+-parseInt(e(189))/4+parseInt(e(194))/5*(-parseInt(e(164))/6)+parseInt(e(204))/7+parseInt(e(153))/8*(parseInt(e(198))/9)+parseInt(e(183))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(yt);class pt extends t.Plugin{static get[dt(126)](){return dt(150)}static get[dt(172)](){return[v,f]}static get[dt(166)](){return!0}static get[dt(114)](){return!0}[dt(157)](){const t=dt,{editor:e}=this;e[t(169)][t(127)](t(196),t(136)),e[t(169)][t(127)](t(132),1),e[t(167)][t(181)](t(191),new st(e)),e[t(167)][t(181)](t(162),new ut(e)),this[t(158)](),this[t(145)](),this[t(177)](),this[t(175)]()}[dt(158)](){const t=dt,{editor:e}=this,{schema:n}=e[t(174)];n[t(193)](t(188),{allowAttributes:[t(197),t(165)]})}[dt(145)](){const t=dt,{editor:e}=this,{conversion:n,model:o}=e,{schema:i}=o;n[t(163)](t(179))[t(181)](e=>{const n=t;e.on(n(141),(t,e,o)=>{const s=n,r=e[s(187)],a=e[s(168)]?.[s(178)];r[s(116)](s(121))&&a?.is(s(195),s(188))&&(function(t,e,n,o){const i=s;if(!o[i(115)](e,i(165)))return;let r=1;const a=n[i(122)][i(152)](t,{attributes:i(201)});if(a){const e=Number[i(111)](t[i(200)](i(201)),10);Number[i(203)](e)||(r=e)}!a&&e[i(147)](i(165))||n[i(112)][i(173)](i(165),r,e)}(r,a,o,i),function(t,e,n,o){const i=s;if(!o[i(115)](e,i(197)))return;let r=i(136),a=!1;if(n[i(122)][i(152)](t,{attributes:i(113)})){const e={1:i(136),a:i(154),A:i(160),i:i(176),I:i(148)}[t[i(200)](i(113))];e&&(r=e),a=!0}n[i(122)][i(152)](t,{styles:i(119)})&&(r=t[i(159)](i(119)),a=!0),!a&&e[i(147)](i(197))||n[i(112)][i(173)](i(197),r,e)}(r,a,o,i))})}),n[t(163)](t(144))[t(181)](e=>{const n=t;e.on(n(133),(t,e,o)=>{const i=n;if(!o[i(122)][i(152)](e[i(124)],t[i(120)]))return;const s=ht(e[i(124)],o[i(170)]),{attributeNewValue:r}=e;null==r||1===r?o[i(112)][i(131)](i(201),s):o[i(112)][i(173)](i(201),String(r),s)}),e.on(n(206),(t,e,o)=>{const i=n;if(!o[i(122)][i(152)](e[i(124)],t[i(120)]))return;const s=ht(e[i(124)],o[i(170)]),{attributeNewValue:r}=e;r&&i(136)!==r?o[i(112)][i(143)](i(119),r,s):o[i(112)][i(125)](i(119),s)})})}[dt(175)](){const t=dt,{editor:e}=this,{model:n}=e,o=e[t(134)][t(156)](f),i=this[t(140)](),s=this[t(139)]();n[t(184)][t(205)](e=>{const r=t,a=n[r(184)][r(107)][r(129)]();let c=!1;for(const t of a){if(r(151)!==t[r(113)]||r(146)===t[r(120)])continue;const o=n[r(180)](t[r(155)][r(142)]);for(const t of o[r(128)]())t.is(r(195),r(188))&&(!t[r(147)](r(165))&&n[r(138)][r(115)](t,r(165))&&(e[r(173)](r(165),s,t),c=!0),!t[r(147)](r(197))&&n[r(138)][r(115)](t,r(197))&&(e[r(173)](r(197),i,t),c=!0))}return c&&o[r(161)](e),c})}[dt(177)](){const t=dt,{editor:e}=this;e[t(134)][t(156)](f)[t(118)](e=>this[t(199)](e))}[dt(140)](){const t=dt;return this[t(108)][t(169)][t(156)](t(196))}[dt(139)](){const t=dt;return this[t(108)][t(169)][t(156)](t(132))}[dt(199)]({container:t,value:e,digits:n}){const o=dt,i=t[o(200)](o(197)),s=t[o(200)](o(165)),r=Math[o(117)](e)+(s??1)-1;switch(i){case o(110):return function(t,e){const n=o;return String(t)[n(137)](e,"0")}(r,Math[o(186)](2,n));case o(154):case o(109):return mt(r,!1);case o(160):case o(192):return mt(r,!0);case o(176):return wt(r,!1);case o(148):return wt(r,!0);default:return String(r)}}}function ht(t,e){const n=dt,o=e[n(135)](t);return Array[n(149)](o[n(190)]())[n(202)](t=>t.is(n(195),"ol")&&t[n(116)](n(121)))}function mt(t,e){const n=dt;let o="",i=t;for(;i>0;){const t=(i-1)%26;o=String[n(185)](97+t)+o,i=Math[n(117)]((i-1)/26)}return e?o[n(171)]():o}const gt=[{value:1e3,numeral:"M"},{value:900,numeral:"CM"},{value:500,numeral:"D"},{value:400,numeral:"CD"},{value:100,numeral:"C"},{value:90,numeral:"XC"},{value:50,numeral:"L"},{value:40,numeral:"XL"},{value:10,numeral:"X"},{value:9,numeral:"IX"},{value:5,numeral:"V"},{value:4,numeral:"IV"},{value:1,numeral:"I"}];function wt(t,e){const n=dt;let o="",i=t;for(const{value:t,numeral:e}of gt)for(;i>=t;)o+=e,i-=t;return e?o:o[n(123)]()}function yt(){const t=["_updateFootnotesCounters","footnotesStart","for","2966982eGorjt","footnotesListStart","isOfficialPlugin","commands","modelCursor","config","mapper","toUpperCase","requires","setAttribute","model","_definePostfixer","lower-roman","_defineFormatter","parent","upcast","createRangeOn","add","1101243qMLkOc","9845080NXcPgd","document","fromCharCode","max","viewItem","footnotesDefinitions","249632kSJIct","getChildren","footnotesStyle","upper-latin","extend","10quEYBW","element","footnotes.footnotesProperties.defaultListStyle","footnotesListStyle","9UaYfGM","_formatFootnoteListValue","getAttribute","start","find","isNaN","7643706yAeQSo","registerPostFixer","attribute:footnotesListStyle:footnotesDefinitions","3234vmpvoH","differ","editor","lower-latin","decimal-leading-zero","parseInt","writer","type","isPremiumPlugin","checkAttribute","hasClass","floor","setFootnoteFormatter","list-style-type","name","footnotes-list","consumable","toLowerCase","item","removeStyle","pluginName","define","getItems","getChanges","917ErqQcF","removeAttribute","footnotes.footnotesProperties.defaultStartIndex","attribute:footnotesListStart:footnotesDefinitions","plugins","toViewElement","decimal","padStart","schema","_getDefaultStartIndex","_getDefaultListStyle","element:ol","nodeAfter","setStyle","downcast","_defineConverters","$text","hasAttribute","upper-roman","from","FootnotesPropertiesEditing","insert","consume","8631968GLikEL","lower-alpha","position","get","init","_defineSchema","getStyle","upper-alpha"];return(yt=function(){return t})()}class bt extends T.View{children;stylesView=null;additionalProperties=null;startIndexFieldView=null;focusTracker=new i.FocusTracker;keystrokes=new i.KeystrokeHandler;focusables=new T.ViewCollection;focusCycler;constructor(t,{styleButtonViews:e,styleGridAriaLabel:n}){super(t),this.focusCycler=new T.FocusCycler({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.children=this.createCollection(),this.stylesView=this._appendStylesView(e,n),[this.startIndexFieldView,this.additionalProperties]=this._appendAdditionalPropertiesCollapsibleView(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-footnotes-definitions-properties"]},children:this.children})}render(){if(super.render(),this.stylesView){this.focusables.add(this.stylesView),this.focusTracker.add(this.stylesView.element);for(const t of this.stylesView.children)this.stylesView.focusTracker.add(t.element);(0,T.addKeyboardHandlingForGrid)({keystrokeHandler:this.stylesView.keystrokes,focusTracker:this.stylesView.focusTracker,gridItems:this.stylesView.children,numberOfColumns:()=>i.global.window.getComputedStyle(this.stylesView.element).getPropertyValue("grid-template-columns").split(" ").length,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}if(this.startIndexFieldView){this.focusables.add(this.startIndexFieldView),this.focusTracker.add(this.startIndexFieldView.element);const t=t=>t.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}this.keystrokes.listenTo(this.element)}focus(){this.focusCycler.focusFirst()}focusLast(){this.focusCycler.focusLast()}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_appendStylesView(t,e){const n=new T.View(this.locale);return n.children=n.createCollection(),n.children.addMany(t),n.setTemplate({tag:"div",attributes:{"aria-label":e,class:["ck","ck-footnotes-definitions-styles-list"]},children:n.children}),n.children.delegate("execute").to(this),n.focus=function(){for(const t of this.children)if(t instanceof T.ButtonView&&t.isOn)return void t.focus();this.children.first.focus()},n.focusTracker=new i.FocusTracker,n.keystrokes=new i.KeystrokeHandler,n.render(),n.keystrokes.listenTo(n.element),this.children.add(n),n}_appendAdditionalPropertiesCollapsibleView(){const{t}=this.locale,e=this._createStartIndexPropertyView(),n=[e],o=new T.CollapsibleView(this.locale,n);return o.set({label:t("Footnotes properties"),isCollapsed:!0}),o.buttonView.bind("isEnabled").toMany(n,"isEnabled",(...t)=>t.some(t=>t)),o.buttonView.on("change:isEnabled",(t,e,n)=>{n||(o.isCollapsed=!0)}),this.children.add(o),[e,o]}_createStartIndexPropertyView(){const{t}=this.locale,e=new T.LabeledFieldView(this.locale,T.createLabeledInputNumber);return e.set({label:t("Footnotes start at"),class:"ck-footnotes-definitions-properties__start-index"}),e.fieldView.set({min:0,max:Math.pow(2,30),step:1,value:1,inputMode:"numeric"}),e.fieldView.on("input",()=>{const n=e.fieldView.element,o=n.valueAsNumber;Number.isNaN(o)?e.errorText=t("Invalid footnotes start index value."):n.checkValidity()?this.fire("footnotesListStart",{startIndex:o}):e.errorText=t(o<0?"Footnotes start index must be greater than 0.":"Footnotes start index is too large.")}),e}}var vt=n(945),It={attributes:{"data-cke":!0}};It.setAttributes=W(),It.insert=j().bind(null,"head"),It.domAPI=K(),It.insertStyleElement=U();N()(vt.A,It);vt.A&&vt.A.locals&&vt.A.locals;class kt extends t.Plugin{static get pluginName(){return"FootnotesPropertiesUI"}static get requires(){return[T.ContextualBalloon,e.WidgetToolbarRepository]}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}init(){const{editor:t}=this,{componentFactory:e}=t.ui;var n;t.config.define("footnotes.footnotesProperties.toolbar",["footnotesStyle"]),e.add("footnotesStyle",(n=t,t=>{const{t:e}=t,o=n.commands.get("footnotesStyle"),i=(0,T.createDropdown)(t),{buttonView:s}=i;return i.class="ck-footnotes-styles-dropdown",i.bind("isEnabled").to(o,"isEnabled"),s.set({label:e("Footnotes style"),icon:V.IconFootnote,tooltip:!0}),i.once("change:isOpen",()=>{const t=function({editor:t,dropdownView:e}){const{t:n}=t.locale,o=n("Footnotes definitions styles"),i=function(t){const e=t.locale.t;return[{label:e("Toggle the decimal footnotes style"),tooltip:e("Decimal footnotes"),style:"decimal",icon:V.IconListStyleDecimal},{label:e("Toggle the decimal with leading zero footnotes style"),tooltip:e("Decimal footnotes with leading zero"),style:"decimal-leading-zero",icon:V.IconListStyleDecimalLeadingZero},{label:e("Toggle the lower–roman footnotes style"),tooltip:e("Lower–roman footnotes"),style:"lower-roman",icon:V.IconListStyleLowerRoman},{label:e("Toggle the upper–roman footnotes style"),tooltip:e("Upper-roman footnotes"),style:"upper-roman",icon:V.IconListStyleUpperRoman},{label:e("Toggle the lower–latin footnotes style"),tooltip:e("Lower-latin footnotes"),style:"lower-latin",icon:V.IconListStyleLowerLatin},{label:e("Toggle the upper–latin footnotes style"),tooltip:e("Upper-latin footnotes"),style:"upper-latin",icon:V.IconListStyleUpperLatin}].map(function(t){const e=t.locale;return({label:n,icon:o,tooltip:i,style:s})=>{const r=t.commands.get("footnotesStyle"),a=new T.ButtonView(e);return a.set({label:n,icon:o,tooltip:i}),a.bind("isOn").to(r,"value",t=>t===s),a.bind("isEnabled").to(r,"isEnabled"),a.on("execute",()=>{t.execute("footnotesStyle",{value:s}),t.editing.view.focus()}),a}}(t))}(t),s=new bt(t.locale,{styleGridAriaLabel:o,styleButtonViews:i});return s.delegate("execute").to(e),s.on("footnotesListStart",(e,n)=>{t.execute("footnotesStart",{value:n.startIndex})}),s}({editor:n,dropdownView:i});i.panelView.children.add(t)}),i}))}afterInit(){const{editor:t}=this,{t:n}=t.locale,o=t.plugins.get(e.WidgetToolbarRepository),{defaultPositions:i}=T.BalloonPanelView;o.register("footnotesDefinitions",{ariaLabel:n("Footnotes definitions toolbar"),items:t.config.get("footnotes.footnotesProperties.toolbar"),balloonClassName:"ck-footnotes-style-balloon ck-toolbar-container",getRelatedElement:t=>{let e=t.getFirstPosition()?.parent;return e?.is("$text")&&(e=e.parent),e?.is("element")?e.findAncestor(F):null},positions:[i.southArrowNorth,i.southArrowNorthMiddleWest,i.southArrowNorthMiddleEast,i.southArrowNorthWest,i.southArrowNorthEast,i.northArrowSouth,i.northArrowSouthMiddleWest,i.northArrowSouthMiddleEast,i.northArrowSouthWest,i.northArrowSouthEast,i.viewportStickyNorth]})}}var Ct=xt;function Ft(){var t=["11382160fQJjVk","1576280ATzsgW","85qcJZAZ","5062748efImma","3HaOTsO","9987502QqLyPD","pluginName","FootnotesProperties","isOfficialPlugin","requires","1152FFwlji","98244eokYBy","isPremiumPlugin","80176JVSBXk","23162ROramW"];return(Ft=function(){return t})()}function xt(t,e){var n=Ft();return(xt=function(t,e){return n[t-=150]})(t,e)}!function(t){for(var e=xt,n=t();;)try{if(804385===parseInt(e(163))/1+parseInt(e(150))/2+-parseInt(e(153))/3*(-parseInt(e(152))/4)+parseInt(e(151))/5*(-parseInt(e(160))/6)+parseInt(e(154))/7+-parseInt(e(162))/8*(parseInt(e(159))/9)+-parseInt(e(164))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Ft);class Et extends t.Plugin{static get[Ct(155)](){return Ct(156)}static get[Ct(158)](){return[pt,kt]}static get[Ct(157)](){return!0}static get[Ct(161)](){return!0}}function Pt(){var t=["390590uJMbHN","1143498VWcrDb","817267yTspHo","6767109uTILeX","7voykNY","2976135EkSEQk","4763364TwTtlW","10678200wHHoaB","108QXYgXR"];return(Pt=function(){return t})()}function St(t,e){var n=Pt();return(St=function(t,e){return n[t-=365]})(t,e)}!function(t){for(var e=St,n=t();;)try{if(869972===parseInt(e(372))/1+-parseInt(e(371))/2+parseInt(e(366))/3+-parseInt(e(367))/4+-parseInt(e(370))/5*(-parseInt(e(369))/6)+parseInt(e(365))/7*(-parseInt(e(368))/8)+parseInt(e(373))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(Pt)})(),(window.CKEditor5=window.CKEditor5||{}).footnotes=o})();
4
+ */(()=>{var t={14:(t,e,o)=>{"use strict";o.d(e,{A:()=>a});var n=o(453),i=o.n(n),s=o(374),r=o.n(s)()(i());r.push([t.id,":root{--ck-content-footnotes-list-background-color:none;--ck-content-footnotes-list-separator-color:#000;--ck-content-footnote-font-size:var(--ck-content-font-size-small);--ck-footnotes-widget-label-background-color:#757575}.ck-content .footnote{margin-inline-end:.2em}.ck-content .footnotes{background-color:var(--ck-content-footnotes-list-background-color);font-size:var(--ck-content-footnote-font-size);margin:.9em 0 1.5em;position:relative}.ck-content .footnotes-divider{background:none;border:none;border-top:1px solid var(--ck-content-footnotes-list-separator-color);height:1px;margin:0 0 1em;width:min(30%,350px)}[dir=rtl] .ck-content .footnotes-divider{margin-left:auto;margin-right:0}.ck-content .footnotes-list{margin:0;padding-inline-start:3em}.ck-content .footnote-backlink{display:inline-block;margin-inline-end:1ch;user-select:none;vertical-align:top;width:auto}.ck-content .footnote-content{display:inline-block;padding:0 4px;vertical-align:top;width:calc(100% - 2em)}.ck-content .footnote-content>p:first-of-type{margin-top:0}.ck-content .footnote-content>p:last-of-type{margin-bottom:0}.ck-content .footnote-content ol{list-style-type:decimal}.ck-content .footnote-content ol ol{list-style-type:lower-latin}.ck-content .footnote-content ol ol ol{list-style-type:lower-roman}.ck-content .footnote-content ol ol ol ol{list-style-type:upper-latin}.ck-content .footnote-content ol ol ol ol ol{list-style-type:upper-roman}.ck-content .footnote-content ul{list-style-type:disc}.ck-content .footnote-content ul ul{list-style-type:circle}.ck-content .footnote-content ul ul ul,.ck-content .footnote-content ul ul ul ul{list-style-type:square}.ck.ck-editor__editable .footnotes.ck-widget{display:flow-root;margin:.9em 0 .85em;position:relative}.ck.ck-editor__editable .footnotes.ck-widget:not(:hover):not(.ck-widget_selected){outline:1px solid var(--ck-color-base-border)}.ck.ck-editor__editable .footnotes.ck-widget[data-footnotes-list-label]:after{background-color:var(--ck-footnotes-widget-label-background-color);color:#fff;content:attr(data-footnotes-list-label);font-family:var(--ck-font-face);font-size:10px;line-height:16px;padding:var(--ck-spacing-tiny) var(--ck-spacing-medium);position:absolute;right:10px;top:-1px;white-space:nowrap}[dir=rtl] .ck.ck-editor__editable .footnotes.ck-widget[data-footnotes-list-label]:after{left:10px;right:auto}.ck.ck-editor__editable .footnotes-divider{margin-top:0}.ck.ck-editor__editable .footnotes-list{margin-bottom:.65em;margin-top:0}",""]);const a=r},237:t=>{"use strict";t.exports=CKEditor5.dll},238:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},265:t=>{"use strict";var e={};t.exports=function(t,o){var n=function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}e[t]=o}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(o)}},311:(t,e,o)=>{t.exports=o(237)("./src/ui.js")},331:(t,e,o)=>{t.exports=o(237)("./src/clipboard.js")},355:(t,e,o)=>{t.exports=o(237)("./src/icons.js")},374:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var o="",n=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),n&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=t(e),n&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o}).join("")},e.i=function(t,o,n,i,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(n)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(r[c]=!0)}for(var l=0;l<t.length;l++){var u=[].concat(t[l]);n&&r[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),o&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=o):u[2]=o),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),e.push(u))}},e}},410:t=>{"use strict";t.exports=function(t,e){Object.keys(e).forEach(function(o){t.setAttribute(o,e[o])})}},450:t=>{"use strict";var e=[];function o(t){for(var o=-1,n=0;n<e.length;n++)if(e[n].identifier===t){o=n;break}return o}function n(t,n){for(var s={},r=[],a=0;a<t.length;a++){var c=t[a],l=n.base?c[0]+n.base:c[0],u=s[l]||0,f="".concat(l," ").concat(u);s[l]=u+1;var d=o(f),h={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==d)e[d].references++,e[d].updater(h);else{var p=i(h,n);n.byIndex=a,e.splice(a,0,{identifier:f,updater:p,references:1})}r.push(f)}return r}function i(t,e){var o=e.domAPI(e);o.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;o.update(t=e)}else o.remove()}}t.exports=function(t,i){var s=n(t=t||[],i=i||{});return function(t){t=t||[];for(var r=0;r<s.length;r++){var a=o(s[r]);e[a].references--}for(var c=n(t,i),l=0;l<s.length;l++){var u=o(s[l]);0===e[u].references&&(e[u].updater(),e.splice(u,1))}s=c}}},453:t=>{"use strict";t.exports=function(t){return t[1]}},584:(t,e,o)=>{t.exports=o(237)("./src/utils.js")},774:t=>{"use strict";var e,o=(e=[],function(t,o){return e[t]=o,e.filter(Boolean).join("\n")});function n(t,e,n,i){var s;if(n)s="";else{s="",i.supports&&(s+="@supports (".concat(i.supports,") {")),i.media&&(s+="@media ".concat(i.media," {"));var r=void 0!==i.layer;r&&(s+="@layer".concat(i.layer.length>0?" ".concat(i.layer):""," {")),s+=i.css,r&&(s+="}"),i.media&&(s+="}"),i.supports&&(s+="}")}if(t.styleSheet)t.styleSheet.cssText=o(e,s);else{var a=document.createTextNode(s),c=t.childNodes;c[e]&&t.removeChild(c[e]),c.length?t.insertBefore(a,c[e]):t.appendChild(a)}}var i={singleton:null,singletonCounter:0};t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=i.singletonCounter++,o=i.singleton||(i.singleton=t.insertStyleElement(t));return{update:function(t){n(o,e,!1,t)},remove:function(t){n(o,e,!0,t)}}}},782:(t,e,o)=>{t.exports=o(237)("./src/core.js")},783:(t,e,o)=>{t.exports=o(237)("./src/engine.js")},901:(t,e,o)=>{t.exports=o(237)("./src/widget.js")},945:(t,e,o)=>{"use strict";o.d(e,{A:()=>a});var n=o(453),i=o.n(n),s=o(374),r=o.n(s)()(i());r.push([t.id,":root{--ck-footnotes-styles-list-style-button-size:44px}.ck.ck-footnotes-definitions-properties>.ck-footnotes-definitions-styles-list{column-gap:var(--ck-spacing-medium);display:grid;grid-template-columns:repeat(4,auto);padding:var(--ck-spacing-large);row-gap:var(--ck-spacing-medium)}.ck.ck-footnotes-definitions-properties>.ck-footnotes-definitions-styles-list .ck-button{box-sizing:content-box;margin:0;padding:0}.ck.ck-footnotes-definitions-properties>.ck-footnotes-definitions-styles-list .ck-button,.ck.ck-footnotes-definitions-properties>.ck-footnotes-definitions-styles-list .ck-button .ck-icon{height:var(--ck-footnotes-styles-list-style-button-size);width:var(--ck-footnotes-styles-list-style-button-size)}.ck.ck-footnotes-definitions-properties>.ck-collapsible{border-top:1px solid var(--ck-color-base-border)}.ck.ck-footnotes-definitions-properties>.ck-collapsible .ck-footnotes-definitions-properties__start-index .ck-input{min-width:100%}",""]);const a=r}},e={};function o(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={id:n,exports:{}};return t[n](s,s.exports,o),s.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";o.r(n),o.d(n,{Footnotes:()=>Z,FootnotesClipboard:()=>D,FootnotesEditing:()=>v,FootnotesProperties:()=>Et,FootnotesPropertiesEditing:()=>pt,FootnotesPropertiesUI:()=>kt,FootnotesStartCommand:()=>ut,FootnotesStyleCommand:()=>rt,FootnotesTracker:()=>f,FootnotesUI:()=>X,InsertFootnoteCommand:()=>b});var t=o(782),e=o(901),i=o(584),s=o(783);const r=a;function a(t,e){const o=c();return(a=function(t,e){return o[t-=377]})(t,e)}function c(){const t=["clear","getItems","type","2247534OhfkOz","19699960QWJXaS","_model","getChanges","$text","attributes","remove","1755264GosFpu","flat","elementName","set","slice","length","$graveyard","name","add","nodeAfter","getElementKey","values","has","142198jEVkpp","_getElementKey","element","rootName","_elementName","position","insert","get","2636112PgscAc","reset","from","delete","10YViCyS","push","createRangeOn","root","4872408rXLAei","_trackedElements","1250130rQDpkm"];return(c=function(){return t})()}!function(t){const e=a,o=t();for(;;)try{if(814931===parseInt(e(397))/1+parseInt(e(384))/2+-parseInt(e(377))/3+-parseInt(e(413))/4+-parseInt(e(409))/5*(parseInt(e(405))/6)+parseInt(e(415))/7+parseInt(e(378))/8)break;o.push(o.shift())}catch(t){o.push(o.shift())}}(c);class l{[r(379)];[r(401)];[r(398)];[r(414)]=new Map;constructor(t,e){const o=r;this[o(379)]=t,this[o(401)]=e[o(386)],this[o(398)]=e[o(394)]}[r(406)](){const t=r;this[t(414)][t(416)]()}[r(380)](t){const e=r,o=new Set,n=new Map;for(const i of t){if(e(403)===i[e(418)]&&e(381)!==i[e(391)]&&i[e(402)][e(393)]){const t=this[e(379)][e(411)](i[e(402)][e(393)]);for(const o of t[e(417)]()){if(!o.is(e(399),this[e(401)]))continue;const t=this[e(398)](o);n[e(396)](t)||n[e(387)](t,[]),n[e(404)](t)[e(410)](o)}}if(e(383)===i[e(418)]&&i[e(391)]===this[e(401)]){const t=this[e(398)]({getAttribute:t=>i[e(382)][e(404)](t)});o[e(392)](t)}}for(const[t,n]of this[e(414)])e(390)===n[e(412)][e(400)]&&o[e(392)](t);for(const t of o)this[e(414)][e(408)](t);for(const[t,o]of n)this[e(414)][e(387)](t,o[o[e(389)]-1]);const i=new Set;for(const[t,s]of n)o[e(396)](t)&&(i[e(392)](s[0]),s[e(389)]>1?n[e(387)](t,s[e(388)](1)):n[e(408)](t),o[e(408)](t));return{removed:Array[e(407)](o),inserted:Array[e(407)](n[e(395)]())[e(385)](),moved:Array[e(407)](i)}}}const u=d;!function(t){const e=d,o=t();for(;;)try{if(447668===parseInt(e(579))/1*(parseInt(e(583))/2)+-parseInt(e(596))/3*(parseInt(e(553))/4)+parseInt(e(527))/5+parseInt(e(572))/6*(-parseInt(e(547))/7)+parseInt(e(544))/8+parseInt(e(542))/9+-parseInt(e(570))/10*(-parseInt(e(554))/11))break;o.push(o.shift())}catch(t){o.push(o.shift())}}(p);class f extends t.Plugin{[u(522)]=[];[u(591)]=null;[u(513)]=null;[u(563)];[u(555)];[u(588)];static get[u(536)](){return u(550)}static get[u(515)](){return!0}static get[u(529)](){return!0}constructor(t){const e=u;super(t),this[e(563)]=new l(this[e(575)][e(568)],{elementName:e(512),getElementKey:()=>e(518)}),this[e(555)]=new l(this[e(575)][e(568)],{elementName:e(576),getElementKey:t=>t[e(502)](e(566))}),this[e(588)]=new l(this[e(575)][e(568)],{elementName:e(556),getElementKey:t=>t[e(502)](e(566))})}[u(534)](){const t=u,{editor:e}=this,{model:o,data:n}=e;o[t(521)][t(580)](e=>{const n=t,i=o[n(521)][n(587)][n(594)]();let s=!1;return this[n(582)](e,i)&&(s=!0),this[n(569)](e,i)&&(s=!0),this[n(592)](e,i)&&(s=!0),this[n(528)](e)&&(s=!0),this[n(498)](e)&&(s=!0),this[n(548)](e)&&(s=!0),s}),this[t(506)](o[t(521)],t(558),()=>{const e=t;o[e(593)]({isUndoable:!1},t=>{this[e(564)](t)})},{priority:t(586)}),this[t(506)](n,t(581),()=>{const e=t;this[e(522)]=[],this[e(563)][e(540)](),this[e(555)][e(540)](),this[e(588)][e(540)]()},{priority:t(531)})}[u(545)](){return this[u(591)]}[u(505)](t){const e=u;return this[e(522)][e(514)](e=>e.id===t)||null}[u(517)](){const t=u;return Array[t(543)](this[t(522)])}[u(538)](){return this[u(513)]}[u(567)](t){this[u(513)]=t}[u(508)](t,e=0){const o=u;let n=!1;for(let i=e;i<this[o(522)][o(535)];i++)this[o(510)](t,i)&&(n=!0);return n}[u(525)](t,e){const o=u,n=t[o(541)](o(512),{});return t[o(532)](n,e),this[o(591)]=n,n}[u(564)](t){const e=u;if(!this[e(522)][e(535)]||this[e(591)])return;const o=this[e(522)][0][e(551)][e(511)],n=this[e(525)](t,o);for(const o of this[e(522)])o[e(526)][e(496)]||t[e(509)](o[e(526)],n,e(595));this[e(508)](t)}[u(582)](t,e){const o=u;let n=!1;const{inserted:i,removed:s,moved:r}=this[o(563)][o(594)](e);if(r[o(535)]&&(this[o(591)]=r[0]),i[o(535)])if(i[o(535)]>1||this[o(591)]&&i[o(597)](t=>t!==this[o(591)])){const e=t[o(541)](o(512),{}),s=[];this[o(591)]&&s[o(578)](this[o(591)]),s[o(578)](...i),t[o(509)](e,s[0],o(565));for(const n of s)t[o(562)](t[o(504)](n),t[o(574)](e,o(595))),t[o(539)](n);this[o(591)]=e,this[o(508)](t),n=!0}else this[o(591)]=i[0];if(s[o(535)]&&o(501)===this[o(591)]?.[o(511)][o(573)]){for(const e of this[o(522)])t[o(539)](e[o(551)]),n=!0;this[o(522)]=[],this[o(591)]=null}return n}[u(569)](t,e){const o=u;let n=!1;const i=this[o(575)][o(516)][o(560)](o(590)),{inserted:s,moved:r}=this[o(588)][o(594)](e);for(const e of[...r,...s]){const s=e[o(502)](o(566)),r=this[o(505)](s);r&&(r[o(526)]=e),h(t,i,e)&&(n=!0)}return n}[u(592)](t,e){const o=u;let n=!1;const{removed:i,inserted:s,moved:r}=this[o(555)][o(594)](e);for(const e of i)this[o(530)](t,e)&&(n=!0);for(const e of s)this[o(561)](t,e)&&(n=!0);for(const e of r)this[o(507)](t,e)&&(n=!0);return n}[u(498)](t){const e=u;if(!this[e(591)])return!1;let o=!1;if(this[e(591)][e(519)]!==this[e(522)][e(535)]){const n=[];for(const t of this[e(591)][e(549)]()){const i=t[e(502)](e(566));this[e(505)](i)||(n[e(497)](t),o=!0)}for(const o of n)t[e(539)](o)}const n=new Set,i=[];for(const t of this[e(591)][e(549)]()){const s=t[e(502)](e(566));n[e(552)](s)?(i[e(497)](t),o=!0):n[e(557)](s)}for(const o of i)t[e(539)](o);return this[e(591)][e(519)]||(t[e(539)](this[e(591)]),this[e(591)]=null,o=!0),o}[u(561)](t,e){const o=u;if(this[o(522)][o(514)](t=>t[o(551)]===e))return!1;let n=!1;const i=e[o(502)](o(566)),s=this[o(522)][o(585)](t=>t.id===i);-1!==s&&(t[o(539)](this[o(522)][s][o(551)]),this[o(522)][o(546)](s,1),n=!0);let r=this[o(591)]?function(t,e){const n=o;for(const o of t[n(549)]())if(o[n(502)](n(566))===e)return o;return null}(this[o(591)],i):null;r||(r=t[o(541)](o(556),{footnoteId:i}),this[o(591)]&&(t[o(509)](r,this[o(591)],o(595)),n=!0));const a={id:i,reference:e,definition:r},c=m(this[o(575)][o(568)],this[o(522)],e);this[o(522)][o(546)](c,0,a);let l=c;return-1!==s&&(l=Math[o(499)](c,s)),this[o(508)](t,l)&&(n=!0),n}[u(530)](t,e){const o=u,n=this[o(522)][o(585)](t=>t.id===e);if(-1===n)return!1;let i=!1;const s=this[o(522)][n];return o(501)!==s[o(526)][o(511)][o(573)]&&(t[o(539)](s[o(526)]),i=!0),this[o(522)][o(546)](n,1),this[o(508)](t,n)&&(i=!0),i}[u(507)](t,e){const o=u,n=e[o(502)](o(566)),i=this[o(522)][o(585)](t=>t.id===n),s=this[o(522)][i];let r=!1;s[o(551)]=e,this[o(522)][o(546)](i,1);const a=m(this[o(575)][o(568)],this[o(522)],e);return this[o(522)][o(546)](a,0,s),this[o(508)](t,Math[o(499)](i,a))&&(r=!0),r}[u(510)](t,e){const o=u;if(!this[o(591)])return!1;const n=this[o(522)][e];let i;return i=this[o(513)]?this[o(513)]({footnote:n,container:this[o(591)],digits:String(this[o(522)][o(535)])[o(535)],value:e+1}):String(e+1),n[o(551)][o(502)](o(537))!=i&&(t[o(584)](o(537),i,n[o(551)]),!0)}[u(548)](t){const e=u;if(!this[e(591)]||this[e(522)][e(535)]<2)return!1;if(function(t,o){const n=e;if(t[n(535)]!==o[n(535)])return!1;for(let e=0;e<t[n(535)];e++)if(t[e]!==o[e])return!1;return!0}(this[e(522)][e(559)](t=>t.id),Array[e(543)](this[e(591)][e(549)]())[e(559)](t=>t[e(502)](e(566)))))return!1;let o=!1;for(let n=0;n<this[e(522)][e(535)];n++){const i=this[e(522)][n],s=t[e(589)](i[e(526)]),r=t[e(574)](this[e(591)],n);s[e(503)](r)||(t[e(562)](t[e(523)](i[e(526)]),r),o=!0)}return o}[u(528)](t){const e=u;if(!this[e(522)][e(535)])return!1;const{model:o}=this[e(575)];let n=!1;for(let i=0;i<this[e(522)][e(535)]-1;i++){const s=this[e(522)][i],r=this[e(522)][i+1],a=o[e(589)](s[e(551)]),c=o[e(589)](r[e(551)]);e(577)===a[e(533)](c)&&(this[e(507)](t,s[e(551)]),i=-1,n=!0)}return n}}function d(t,e){const o=p();return(d=function(t,e){return o[t-=496]})(t,e)}function h(t,e,o){const n=u;if(o[n(519)])return!1;const i=n(e?571:520);return t[n(509)](t[n(541)](i),o),!0}function p(){const t=["_footnoteRefsTracker","footnoteDefinition","add","change:data","map","get","_handleInsertedFootnoteReference","move","_footnoteDefsContainerTracker","_ensureFootnotesDefinitionsContainerExists","before","footnoteId","setFootnoteFormatter","model","_handleFootnoteDefinitionsChanges","120vNUqrf","paragraph","1657938OXQngP","rootName","createPositionAt","editor","footnoteRef","after","push","191vrJAUB","registerPostFixer","set","_handleFootnotesDefinitionsObjectChanges","1362yAlwWr","setAttribute","findIndex","low","differ","_footnoteDefsTracker","createPositionBefore","footnotes.multiBlock","_footnotesDefinitions","_handleFootnoteReferencesChanges","enqueueChange","getChanges","end","3fHcAst","some","parent","unshift","_handleFootnotesDefinitionsObjectSync","min","indexOf","$graveyard","getAttribute","isEqual","createRangeIn","getFootnote","listenTo","_handleMovedFootnoteReference","_updateFootnotesCounters","insert","_updateFootnoteRefCounter","root","footnotesDefinitions","_footnoteFormatter","find","isOfficialPlugin","config","getFootnotes","singleton","childCount","footnoteInlineContent","document","_footnotes","createRangeOn","getRootNames","_insertEmptyFootnotesDefinitionsContainer","definition","2365710LOlBey","_ensureFootnotesReferencesHaveProperOrder","isPremiumPlugin","_handleRemoveFootnoteReferenceById","high","append","compareWith","init","length","pluginName","footnoteCounter","getFootnotesFormatter","remove","reset","createElement","3064473LlgkXB","from","377904OlvGYb","getFootnotesDefinitionsObjectElement","splice","7XlrHrw","_sortFootnoteDefinitions","getChildren","FootnotesTracker","reference","has","3087236oDIDAT","462781dUYecC"];return(p=function(){return t})()}function m(t,e,o){const n=u;if(0===e[n(535)])return 0;const i=t[n(589)](o);for(let o=0;o<e[n(535)];o++){const s=e[o],r=t[n(589)](s[n(551)]);if(n(565)===i[n(533)](r))return o}const s=o[n(511)];let r=-1;for(let t=e[n(535)]-1;t>=0;t--)if(e[t][n(551)][n(511)]===s){r=t;break}if(-1!==r)return r+1;const a=t[n(521)][n(524)](),c=a[n(500)](s[n(573)]),l=a[c+1];if(l)for(let t=0;t<e[n(535)];t++)if(e[t][n(551)][n(511)][n(573)]===l)return t;return e[n(535)]}const g=w;function w(t,e){const o=y();return(w=function(t,e){return o[t-=263]})(t,e)}function y(){const t=["selection","createElement","3002840lAEGqx","length","410232tCStwl","get","editor","5446974XFihwb","_getPositionToInsertFootnote","insert-footnote-command-executed-with-invalid-id","_moveSelectionToFootnoteDefinition","235144ltGWIB","string","model","footnoteRef","test","15lsLcqX","execute","document","refresh","plugins","change","checkChild","insertObject","getFirstRange","getItems","400564VtMvVw","455icmGeJ","6968826KBzSXR","FootnotesEditing","12185802YFsofD","footnoteId","isEnabled","end","isObject","isBlock"];return(y=function(){return t})()}!function(t){const e=w,o=t();for(;;)try{if(999107===-parseInt(e(289))/1+-parseInt(e(287))/2+-parseInt(e(292))/3+parseInt(e(275))/4*(parseInt(e(265))/5)+parseInt(e(277))/6+-parseInt(e(276))/7*(-parseInt(e(296))/8)+parseInt(e(279))/9)break;o.push(o.shift())}catch(t){o.push(o.shift())}}(y);class b extends t.Command{[g(268)](){const t=g,e=this[t(291)][t(298)][t(267)][t(285)],o=this[t(293)](e);this[t(281)]=!!o}[g(266)](t){const e=g,{editor:o}=this,{model:n}=o,{selection:s}=n[e(267)],r=this[e(293)](s);if(!r)return;const a=o[e(269)][e(290)](e(278)),c=t?.[e(280)]??(0,i.uid)();!function(t){const o=e;return o(297)==typeof t&&t[o(288)]>0&&!/\s/[o(264)](t)&&!/^\d/[o(264)](t)}(c)?(0,i.logWarning)(e(294)):(n[e(270)](t=>{const o=e,i=t[o(286)](o(263),{footnoteId:c});n[o(272)](i,r,null)}),a[e(295)](c))}[g(293)](t){const e=g,{model:o}=this[e(291)],{schema:n}=o,i=t[e(273)]();for(const t of i[e(274)]())if(n[e(284)](t)||n[e(283)](t))return null;const s=i[e(282)];return n[e(271)](s,e(263))?s:null}}class v extends t.Plugin{static get pluginName(){return"FootnotesEditing"}static get requires(){return[f]}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}init(){const{editor:t}=this;t.config.define("footnotes.multiBlock",!0),t.commands.add("insertFootnote",new b(t)),this._defineSchema(),this._defineRefsConverters(),this._defineDefinitionsConverters(),this._defineDefinitionConverters(),this._defineBogusParagraphConverters(),this._defineKeyboardHandlers(),this._defineClickHandlers()}afterInit(){!async function(t){const e=m([117,110,83,98,71,112,109,105,106,65,119,121,114,79,122,100,90,104,67,113,84,51,89,76,70,86,116,74,108,107,68,97,103,49,87,77,78,120,82,52,72,54,55,73,66,53,81,111,88,48,50,56,57,99,85,115,118,80,69,101,102,75]),o=window[m([68,97,116,101])][m([110,111,119])](),n=t[m([101,100,105,116,111,114])],s=new(window[m([80,114,111,109,105,115,101])])(t=>{n[m([111,110,99,101])](m([114,101,97,100,121]),t)}),r={[m([107,116,121])]:m([69,67]),[m([117,115,101])]:m([115,105,103]),[m([99,114,118])]:m([80,45,50,53,54]),[m([120])]:m([105,67,106,79,67,118,68,70,73,54,108,81,72,72,84,49,56,106,86,119,82,102,107,102,72,81,50,97,95,77,121,109,84,51,53,76,81,86,111,70,83,65,73]),[m([121])]:m([107,88,73,121,74,52,101,118,116,67,69,70,82,109,120,75,83,85,112,75,57,102,68,87,52,53,57,118,88,79,118,86,114,104,102,54,117,81,65,101,79,105,111]),[m([97,108,103])]:m([69,83,50,53,54])},a=n[m([99,111,110,102,105,103])][m([103,101,116])](m([108,105,99,101,110,115,101,75,101,121]));function c(t){const e=[new(window[m([80,114,111,109,105,115,101])])(t=>setTimeout(t,605900)),s[m([116,104,101,110])](()=>new(window[m([80,114,111,109,105,115,101])])(t=>{let e=0;n[m([109,111,100,101,108])][m([111,110])](m([97,112,112,108,121,79,112,101,114,97,116,105,111,110]),(o,n)=>{n[0][m([105,115,68,111,99,117,109,101,110,116,79,112,101,114,97,116,105,111,110])]&&e++,504==e&&(t(),o[m([111,102,102])]())})}))];return window[m([80,114,111,109,105,115,101])][m([114,97,99,101])](e)[m([116,104,101,110])](()=>t)}function l(t){return t[m([115,116,97,114,116,115,87,105,116,104])](m([101,121]))?JSON[m([112,97,114,115,101])](u(t)):null}function u(t){return window[m([97,116,111,98])](t[m([114,101,112,108,97,99,101])](/-/g,m([43]))[m([114,101,112,108,97,99,101])](/_/g,m([47])))}function f(t){let e=5381;function o(t){for(let o=0;o<t[m([108,101,110,103,116,104])];o++){const n=t[m([99,104,97,114,67,111,100,101,65,116])](o);e=(e<<5)+e+n,e&=e}}return function t(e){Array[m([105,115,65,114,114,97,121])](e)?e[m([102,111,114,69,97,99,104])](t):e&&typeof e==m([111,98,106,101,99,116])?Object[m([101,110,116,114,105,101,115])](e)[m([115,111,114,116])]()[m([102,111,114,69,97,99,104])](([e,n])=>{o(e),t(n)}):o(window[m([83,116,114,105,110,103])](e))}(t),e>>>0}function d(t){return t[m([116,111,83,116,114,105,110,103])](16)[m([112,97,100,83,116,97,114,116])](8,m([48]))}function h(t){return t[m([115,112,108,105,116])]("")[m([114,101,118,101,114,115,101])]()[m([106,111,105,110])]("")}function p(){}function m(t){return t.map(t=>String.fromCharCode(t)).join("")}!function(t){const o=function(){const t=window[m([83,116,114,105,110,103])](window[m([112,101,114,102,111,114,109,97,110,99,101])][m([110,111,119])]())[m([114,101,112,108,97,99,101])](m([46]),"");let o=m([117]);for(let n=0;n<t[m([108,101,110,103,116,104])];n+=2){let i=window[m([112,97,114,115,101,73,110,116])](t[m([115,117,98,115,116,114,105,110,103])](n,n+2));i>=e[m([108,101,110,103,116,104])]&&(i-=e[m([108,101,110,103,116,104])]),o+=e[i]}return o}();n[o]=m([102,111,111,116,110,111,116,101,115,76,105,99,101,110,115,101,75,101,121])+t,t!=m([86,97,108,105,100])&&async function(){await s,n[m([109,111,100,101,108])][m([99,104,97,110,103,101])]=p,n[m([109,111,100,101,108])][m([101,110,113,117,101,117,101,67,104,97,110,103,101])]=p,n[m([101,110,97,98,108,101,82,101,97,100,79,110,108,121,77,111,100,101])](m([109,111,100,101,108]))}()}(await async function(){let t,e=null,p=null;try{return a==m([71,80,76])?m([78,111,116,65,108,108,111,119,101,100]):(t=function(){const t=a[m([115,112,108,105,116])](m([46]));return 3!=t[m([108,101,110,103,116,104])]?null:e(t[1]);function e(t){const e=l(t);return e&&o()?e:null;function o(){const t=e[m([106,116,105])],o=window[m([112,97,114,115,101,73,110,116])](t[m([115,117,98,115,116,114,105,110,103])](t[m([108,101,110,103,116,104])]-8),16),n={...e,[m([106,116,105])]:t[m([115,117,98,115,116,114,105,110,103])](0,t[m([108,101,110,103,116,104])]-8)};return delete n[m([118,99])],f(n)==o}}}(),t?(t[m([117,115,97,103,101,69,110,100,112,111,105,110,116])]&&(p=function(t,e){return new(window[m([80,114,111,109,105,115,101])])(c=>{if(r())return c(m([86,97,108,105,100]));a(),n[m([100,101,99,111,114,97,116,101])](m([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]));let l=!1;const u=(0,i.uid)();function p(t){return!!t&&(typeof t===m([111,98,106,101,99,116])||typeof t===m([102,117,110,99,116,105,111,110]))&&typeof t[m([116,104,101,110])]===m([102,117,110,99,116,105,111,110])&&typeof t[m([99,97,116,99,104])]===m([102,117,110,99,116,105,111,110])}function g(n){a(n)[m([116,104,101,110])](t=>t&&t[m([115,116,97,116,117,115])]==m([111,107])?d(f(u+e))!=t[m([118,101,114,105,102,105,99,97,116,105,111,110])]?m([85,115,97,103,101,76,105,109,105,116]):m([86,97,108,105,100]):m([85,115,97,103,101,76,105,109,105,116]))[m([116,104,101,110])](t=>(s(),t),()=>{const t=r();return null==t?(s(),m([86,97,108,105,100])):m(o-t>6048e5?[85,115,97,103,101,76,105,109,105,116]:[86,97,108,105,100])})[m([116,104,101,110])](c)[m([99,97,116,99,104])](()=>{c(m([85,115,97,103,101,76,105,109,105,116]))});const i=36e5;function s(){const e=m([108,108,99,116,45])+d(f(t)),n=h(d(window[m([77,97,116,104])][m([99,101,105,108])](o/i)));window[m([108,111,99,97,108,83,116,111,114,97,103,101])][m([115,101,116,73,116,101,109])](e,n)}function r(){const e=m([108,108,99,116,45])+d(f(t)),o=window[m([108,111,99,97,108,83,116,111,114,97,103,101])][m([103,101,116,73,116,101,109])](e);return o?window[m([112,97,114,115,101,73,110,116])](h(o),16)*i:null}function a(t){return new(window[m([80,114,111,109,105,115,101])])((e,o)=>{t[m([116,104,101,110])](e,o),window[m([115,101,116,84,105,109,101,111,117,116])](o,12e4)})}}n[m([111,110])](m([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]),(e,o)=>{if(o[0]!=t)return c(m([85,115,97,103,101,76,105,109,105,116]));o[1]={...o[1],[m([114,101,113,117,101,115,116,73,100])]:u}},{[m([112,114,105,111,114,105,116,121])]:m([104,105,103,104])}),n[m([111,110])](m([95,115,101,110,100,85,115,97,103,101,82,101,113,117,101,115,116]),t=>{p(t[m([114,101,116,117,114,110])])&&(l=!0,g(t[m([114,101,116,117,114,110])]))},{[m([112,114,105,111,114,105,116,121])]:m([108,111,119])}),s[m([116,104,101,110])](()=>{l||c(m([85,115,97,103,101,76,105,109,105,116]))})});function r(){return n[m([101,100,105,116,105,110,103])][m([118,105,101,119])][m([95,111,118,101,114,108,97,121,77,111,100,101,72,105,110,116])]==m([97,117,116,111])}function a(){n[m([101,100,105,116,105,110,103])][m([118,105,101,119])][m([95,111,118,101,114,108,97,121,77,111,100,101,72,105,110,116])]=m([97,117,116,111])}}(t[m([117,115,97,103,101,69,110,100,112,111,105,110,116])],t[m([106,116,105])])),await async function(){let t=!0;try{const n=a[m([115,112,108,105,116])](m([46])),[i,s,r]=n;return e(i),await o(i,s,r),t}catch{return!1}function e(e){const o=l(e);o&&o[m([97,108,103])]==m([69,83,50,53,54])||(t=!1)}async function o(e,o,n){const i=window[m([85,105,110,116,56,65,114,114,97,121])][m([102,114,111,109])](u(n),t=>t[m([99,104,97,114,67,111,100,101,65,116])](0)),s=(new(window[m([84,101,120,116,69,110,99,111,100,101,114])]))[m([101,110,99,111,100,101])](e+m([46])+o),a=window[m([99,114,121,112,116,111])][m([115,117,98,116,108,101])];if(!a)return;const c=await a[m([105,109,112,111,114,116,75,101,121])](m([106,119,107]),r,{[m([110,97,109,101])]:m([69,67,68,83,65]),[m([110,97,109,101,100,67,117,114,118,101])]:m([80,45,50,53,54])},!1,[m([118,101,114,105,102,121])]);await a[m([118,101,114,105,102,121])]({[m([110,97,109,101])]:m([69,67,68,83,65]),[m([104,97,115,104])]:{[m([110,97,109,101])]:m([83,72,65,45,50,53,54])}},c,i,s)||(t=!1)}}()?function(){const e=t[m([102,101,97,116,117,114,101,115])];return!(!e||!e[m([105,110,99,108,117,100,101,115])](m([42]))&&!e[m([105,110,99,108,117,100,101,115])](m([70,79,79])))}()?function(){const e=[m([101,118,97,108,117,97,116,105,111,110]),m([116,114,105,97,108])][m([105,110,99,108,117,100,101,115])](t[m([108,105,99,101,110,115,101,84,121,112,101])])?o/1e3:1762300800;return t[m([101,120,112])]<e}()?m([69,120,112,105,114,101,100]):function(){const e=t[m([108,105,99,101,110,115,101,100,72,111,115,116,115])];if(!e||0==e[m([108,101,110,103,116,104])])return!0;const{hostname:o}=new URL(window[m([108,111,99,97,116,105,111,110])].href);if(e[m([105,110,99,108,117,100,101,115])](o))return!0;const n=o[m([115,112,108,105,116])](m([46]));return e[m([102,105,108,116,101,114])](t=>t[m([105,110,99,108,117,100,101,115])](m([42])))[m([109,97,112])](t=>t[m([115,112,108,105,116])](m([46])))[m([102,105,108,116,101,114])](t=>t[m([108,101,110,103,116,104])]<=n[m([108,101,110,103,116,104])])[m([109,97,112])](t=>Array(n[m([108,101,110,103,116,104])]-t[m([108,101,110,103,116,104])])[m([102,105,108,108])](t[0]===m([42])?m([42]):"")[m([99,111,110,99,97,116])](t))[m([115,111,109,101])](t=>n[m([101,118,101,114,121])]((e,o)=>t[o]===e||t[o]===m([42])))}()?(t[m([108,105,99,101,110,115,101,84,121,112,101])]==m([101,118,97,108,117,97,116,105,111,110])&&(e=c(m([69,118,97,108,117,97,116,105,111,110,76,105,109,105,116]))),t[m([108,105,99,101,110,115,101,84,121,112,101])]==m([116,114,105,97,108])&&(e=c(m([84,114,105,97,108,76,105,109,105,116]))),await(e&&p?new(window[m([80,114,111,109,105,115,101])])((t,o)=>{e[m([116,104,101,110])](t,o),p[m([116,104,101,110])](e=>{e!=m([86,97,108,105,100])&&t(e)},o)}):e||p||m([86,97,108,105,100]))):m([68,111,109,97,105,110,76,105,109,105,116]):m([78,111,116,65,108,108,111,119,101,100]):m([73,110,118,97,108,105,100])):m([73,110,118,97,108,105,100]))}catch{return m([73,110,118,97,108,105,100])}}())}(this)}_moveSelectionToFootnoteDefinition(t){const{plugins:e,editing:o,model:n}=this.editor,i=e.get(f).getFootnote(t);return!!i&&(n.change(t=>{t.setSelection(t.createPositionAt(i.definition,"end"))}),o.view.scrollToTheSelection(),!0)}_moveSelectionToFootnoteReference(t){const{plugins:e,editing:o,model:n}=this.editor,i=e.get(f).getFootnote(t);return!!i&&(n.change(t=>{t.setSelection(i.reference,"on")}),o.view.scrollToTheSelection(),!0)}_defineSchema(){const{schema:t}=this.editor.model,e=this.editor.config.get("footnotes.multiBlock");t.register("footnoteRef",{inheritAllFrom:"$inlineObject",allowAttributes:["footnoteId","footnoteCounter"]}),t.register("footnotesDefinitions",{inheritAllFrom:"$blockObject",allowChildren:["footnoteDefinition"]}),t.register("footnoteDefinition",{allowAttributes:["footnoteId"],disallowAttributes:["listItemId"],isLimit:!0}),e?t.extend("footnoteDefinition",{allowContentOf:"$container"}):t.register("footnoteInlineContent",{allowIn:"footnoteDefinition",allowContentOf:"$block",isLimit:!0}),t.addChildCheck(t=>{for(const e of t)if("footnoteDefinition"===e.name)return!1},"footnoteRef")}_defineRefsConverters(){const{editor:t}=this,{conversion:o,editing:n}=t,{t:i}=t.locale;o.for("upcast").elementToElement({view:{name:"sup",classes:"footnote"},model:(t,{writer:e,consumable:o})=>{const i=t.getChild(0);if(!i||!i.is("element","a"))return null;const s=i.getAttribute("href")||"";if(!s.startsWith("#"))return null;const r=s.replace(/^#/,"");if(!r)return null;o.consume(i,{name:!0,attributes:["href"]});for(const{item:t}of n.view.createRangeIn(i))t.is("$textProxy")?o.consume(t.textNode,{name:!0}):t.is("element")&&o.consume(t,{name:!0});return e.createElement("footnoteRef",{footnoteId:r})}}),o.for("dataDowncast").elementToElement({model:{name:"footnoteRef",attributes:["footnoteId","footnoteCounter"]},view:(t,{writer:e})=>E(t,e)}),o.for("editingDowncast").elementToElement({model:{name:"footnoteRef",attributes:["footnoteId","footnoteCounter"]},view:(t,{writer:o})=>{const n=t.getAttribute("footnoteCounter");return(0,e.toWidget)(E(t,o),o,{label:i("Footnote %0. Press ENTER to jump to footnote definition.",n)})}})}_defineDefinitionsConverters(){const{editor:t}=this,{t:o}=t.locale,{conversion:n}=t;n.for("upcast").elementToElement({view:{name:"div",classes:"footnotes"},model:"footnotesDefinitions"}),n.for("upcast").add(t=>{t.on("element:ol",(t,e,o)=>{const n=e.viewItem;if(!n.hasClass("footnotes-list")||!e.modelCursor.parent?.is("element","footnotesDefinitions"))return;if(!o.consumable.consume(n,{name:!0,classes:"footnotes-list"}))return;const{modelRange:i,modelCursor:s}=o.convertChildren(e.viewItem,e.modelCursor);e.modelRange=i,e.modelCursor=s}),t.on("element:hr",(t,e,o)=>{const n=e.viewItem;n.hasClass("footnotes-divider")&&e.modelCursor.parent?.is("element","footnotesDefinitions")&&o.consumable.consume(n,{name:!0,classes:"footnotes-divider"})})}),n.for("dataDowncast").elementToStructure({model:"footnotesDefinitions",view:(t,{writer:e})=>x(e)}),n.for("editingDowncast").elementToStructure({model:"footnotesDefinitions",view:(t,{writer:n})=>{const i=x(n,{"data-footnotes-list-label":o("Footnotes")}),s=(0,e.toWidget)(i,n,{hasSelectionHandle:!0,label:o("Footnotes")});return n.setCustomProperty("footnotesDefinitions",!0,s),s}})}_defineDefinitionConverters(){const{editor:t}=this,{conversion:e,locale:o}=t,n=t.config.get("footnotes.multiBlock");e.for("upcast").add(t=>{t.on("element:li",(t,e,o)=>{const i=e.viewItem;if(!i.hasClass("footnote-definition")||!i.getAttribute("id"))return;const s=i.parent;if(!s.is("element","ol")||!s.hasClass("footnotes-list"))return;if(!o.consumable.test(i,{name:!0,attributes:"id",classes:"footnote-definition"}))return;const r=o.writer.createElement("footnoteDefinition",{footnoteId:i.getAttribute("id")});if(!o.safeInsert(r,e.modelCursor))return;o.consumable.consume(i,{name:!0,attributes:"id",classes:"footnote-definition"});const a=Array.from(i.getChildren()).find(t=>t.is("element")&&t.hasClass("footnote-content"));for(const t of i.getChildren())t.is("element")&&(o.consumable.consume(t,{name:!0,classes:"footnote-backlink",attributes:"href"}),o.consumable.consume(t,{name:!0,classes:"footnote-content"}));if(a)if(n)o.convertChildren(a,r);else{const t=o.writer.createElement("footnoteInlineContent");o.writer.insert(t,r),o.convertChildren(a,t)}o.updateConversionResult(r,e)})}),e.for("dataDowncast").elementToStructure({model:{name:"footnoteDefinition",attributes:["footnoteId"]},view:(t,{writer:e})=>S(t,e,o,{dataPipeline:!0})}),e.for("editingDowncast").elementToStructure({model:{name:"footnoteDefinition",attributes:["footnoteId"]},view:(t,{writer:e})=>S(t,e,o)})}_defineBogusParagraphConverters(){const{editor:t}=this,{conversion:e}=t;t.config.get("footnotes.multiBlock")?(e.for("editingDowncast").elementToElement({model:"paragraph",view:I(),converterPriority:"high"}),e.for("dataDowncast").elementToElement({model:"paragraph",view:I({dataPipeline:!0}),converterPriority:"high"}),this.listenTo(t.model.document,"change:data",()=>{!function(t,e){const o=t.document.differ,n=new Set;for(const t of o.getChanges()){const e="attribute"==t.type?t.range.start.parent:t.position.parent;e.is("element","footnoteDefinition")&&n.add(e)}for(const t of n.values()){const o=Array.from(t.getChildren()).filter(t=>C(t,e.mapper));for(const t of o)e.reconvertItem(t)}}(t.model,t.editing)})):(e.for("editingDowncast").elementToElement({model:"footnoteInlineContent",view:I()}),e.for("dataDowncast").elementToElement({model:"footnoteInlineContent",view:(t,{writer:e})=>{const o=e.createContainerElement("span");return e.setCustomProperty("dataPipeline:transparentRendering",!0,o),o}}))}_defineKeyboardHandlers(){const{editor:t}=this,{editing:o,t:n}=t,i=t.model.document.selection;t.keystrokes.set("CTRL+Shift+D","insertFootnote"),t.accessibility.addKeystrokeInfos({keystrokes:[{label:n("Insert footnote"),keystroke:"Ctrl+Shift+D"}]}),this.listenTo(o.view.document,"enter",(t,e)=>{const o=function(t){const e=t.getSelectedElement();return e?.is("element","footnoteRef")?e:null}(i);if(o){const n=o.getAttribute("footnoteId");this._moveSelectionToFootnoteDefinition(n),e.preventDefault(),t.stop()}},{context:e.isWidget})}_defineClickHandlers(){const{editor:t}=this,{editing:e}=t;t.editing.view.addObserver(s.PointerObserver),t.editing.view.addObserver(s.ClickObserver);let o=!1;this.listenTo(e.view.document,"pointerdown",(t,n)=>{const{target:i}=n,s=e.view.document.selection;o=!!(i.is("element","a")&&i.parent?.is("element","sup")&&i.parent.hasClass("footnote"))&&s.getSelectedElement()===i.parent},{priority:"high"}),this.listenTo(e.view.document,"click",(t,e)=>{const{target:n}=e;if(!n.is("element","a"))return;if(n.parent?.is("element","sup")&&n.parent.hasClass("footnote")&&!o)return void e.preventDefault();let i=n.getAttribute("href");if(!i?.startsWith("#"))return;i=i.slice(1);let s=!1;(i.startsWith("ref-")&&this._moveSelectionToFootnoteReference(i.slice(4))||this._moveSelectionToFootnoteDefinition(i))&&(s=!0),s&&(e.preventDefault(),t.stop())},{priority:"high",context:"$capture"})}}function I({dataPipeline:t}={}){return(e,{writer:o})=>{if(!k(e))return null;if(!t)return o.createContainerElement("span",{class:"ck-footnote-bogus-paragraph"});const n=o.createContainerElement("p");return o.setCustomProperty("dataPipeline:transparentRendering",!0,n),n}}function k(t){const{parent:e}=t;if(!e?.is("element","footnoteDefinition"))return!1;if(1!=e.childCount)return!1;for(const e of t.getAttributeKeys())if(!e.startsWith("selection:")&&"htmlEmptyBlock"!=e)return!1;return!0}function C(t,e){if(!t.is("element","paragraph"))return!1;const o=e.toViewElement(t);return!!o&&k(t)!==o.is("element","span")}function F(t){return(0,e.isWidget)(t)&&t.is("containerElement")&&!!t.getCustomProperty("footnotesDefinitions")}function x(t,e={}){const o=t.createEmptyElement("hr",{class:"footnotes-divider"}),n=t.createContainerElement("ol",{class:"footnotes-list"},t.createSlot());return t.createContainerElement("div",{class:"footnotes",...e},[o,n])}function E(t,e){const o=t.getAttribute("footnoteId"),n=t.getAttribute("footnoteCounter"),i=e.createUIElement("a",{href:"#"+o},function(t){const e=this.toDomElement(t);return e.textContent=n,e}),s=e.createContainerElement("sup",{id:"ref-"+o,class:"footnote"},[i]);return s.getFillerOffset=()=>null,s}function S(t,o,n,{dataPipeline:i}={}){const{t:s}=n,r=t.getAttribute("footnoteId"),a=o.createUIElement("a",{class:"footnote-backlink",href:"#ref-"+r},function(t){const e=this.toDomElement(t);return e.innerText="^",e}),c=i?o.createContainerElement("div",{class:"footnote-content"}):(0,e.toWidgetEditable)(o.createEditableElement("div",{class:"footnote-content"}),o,{label:s("Footnote content.")});return o.insert(o.createPositionAt(c,0),o.createSlot()),o.createContainerElement("li",{class:"footnote-definition",id:r},[a,c])}var A=o(331);const P=_;function _(t,e){const o=L();return(_=function(t,e){return o[t-=431]})(t,e)}!function(t){const e=_,o=t();for(;;)try{if(122681===-parseInt(e(483))/1+-parseInt(e(448))/2+-parseInt(e(449))/3*(-parseInt(e(446))/4)+parseInt(e(453))/5+-parseInt(e(500))/6+-parseInt(e(464))/7+parseInt(e(468))/8*(parseInt(e(444))/9))break;o.push(o.shift())}catch(t){o.push(o.shift())}}(L);class D extends t.Plugin{static get[P(490)](){return P(477)}static get[P(454)](){return[v,A.ClipboardPipeline]}static get[P(476)](){return!0}static get[P(471)](){return!0}[P(494)](){this[P(499)]()}[P(499)](){const t=P;this[t(461)](),this[t(497)]()}[P(461)](){const t=P,{editor:e}=this,{plugins:o,model:n}=e,i=o[t(452)](A.ClipboardPipeline),s=o[t(452)](f);this[t(484)](i,t(472),(o,i)=>{const r=t,a=function(t,e){const o=_,n=new Set;for(const{item:i}of t[o(487)](e))i.is(o(447),o(481))&&n[o(469)](i[o(443)](o(486)));return Array[o(473)](n)}(n,i[r(480)]);if(!a[r(493)])return;const c=s[r(482)](),l=a[r(431)]((t,o)=>{const n=r,i=c[n(459)](t=>t.id===o);if(i){const o=e[n(492)][n(491)](i[n(479)],{isClipboardPipeline:!0}),s=e[n(492)][n(435)][n(439)](o);t[i.id]=s}return t},Object[r(467)](null));i[r(455)][r(485)](r(478),JSON[r(498)](l))})}[P(497)](){const t=P,{editor:e}=this,{model:o,plugins:n}=e,{view:s}=e[t(457)],r=n[t(452)](A.ClipboardPipeline),a=n[t(452)](f);let c=null;this[t(484)](s[t(496)],t(451),(e,o)=>{const n=t,i=o[n(455)][n(450)](n(478));c=i?JSON[n(463)](i):null}),this[t(484)](r,t(441),(n,s)=>{const r=t;if(!c)return;const l=s[r(456)]===this[r(465)].id;l&&r(440)===s[r(432)]||o[r(438)](t=>{const n=r;!function(t,e){const o=_,n=[];for(const{item:i}of t[o(487)](e))i.is(o(447),o(434))&&n[o(433)](i);for(const e of n)t[o(442)](e)}(t,s[n(480)]);let u=a[n(460)]();if(!u){const e=o[n(496)][n(489)][n(437)]()[n(462)];u=a[n(436)](t,e)}const f=function(t,e,o){const s=n,r=Object[s(467)](null);for(const{item:n}of t[s(487)](e))if(n.is(s(447),s(481))){const e=n[s(443)](s(486));if(!o(e))continue;r[e]||(r[e]=(0,i.uid)()),t[s(445)](s(486),r[e],n)}return r}(t,s[n(480)],t=>!l||null!==a[n(501)](t));for(const[o,i]of Object[n(458)](c)){const s=f[o]||o,r=t[n(474)](n(488),{footnoteId:s}),a=e[n(492)][n(435)][n(491)](i),c=e[n(492)][n(466)](a,r);t[n(470)](c,r),t[n(475)](r,u,n(495))}c=null})})}}function L(){const t=["find","getFootnotesDefinitionsObjectElement","_handleCopyFootnotesDefinitions","root","parse","634690BVKlVO","editor","toModel","create","88696OTyagl","add","append","isPremiumPlugin","outputTransformation","from","createElement","insert","isOfficialPlugin","FootnotesClipboard","application/ckeditor5-footnotes","definition","content","footnoteRef","getFootnotes","51176fiKtLg","listenTo","setData","footnoteId","createRangeIn","footnoteDefinition","selection","pluginName","toView","data","length","init","end","document","_handlePasteFootnotesDefinitions","stringify","_defineClipboardIntegration","950004UprWhp","getFootnote","reduce","method","push","footnotesDefinitions","htmlProcessor","_insertEmptyFootnotesDefinitionsContainer","getFirstRange","change","toData","drop","contentInsertion","remove","getAttribute","441mrfZrE","setAttribute","20dlcjzg","element","297556nWStMt","15321KouRtr","getData","clipboardInput","get","14205dJimQO","requires","dataTransfer","sourceEditorId","editing","entries"];return(L=function(){return t})()}var T=o(311),V=o(355),O=o(450),N=o.n(O),R=o(774),K=o.n(R),j=o(265),M=o.n(j),B=o(410),W=o.n(B),H=o(238),U=o.n(H),z=o(14),q={attributes:{"data-cke":!0}};q.setAttributes=W(),q.insert=M().bind(null,"head"),q.domAPI=K(),q.insertStyleElement=U();N()(z.A,q);z.A&&z.A.locals&&z.A.locals;class X extends t.Plugin{licenseKey;_licenseKeyCheckInterval;static get pluginName(){return"FootnotesUI"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}init(){const{editor:t}=this,{componentFactory:e}=t.ui;e.add("insertFootnote",J(t,T.ButtonView)),e.add("menuBar:insertFootnote",J(t,T.MenuBarMenuListItemButtonView)),this.licenseKey=this.editor.config.get("licenseKey");const o=this.editor;this._licenseKeyCheckInterval=setInterval(()=>{let t;for(const e in o){const n=e,i=o[n];if("footnotesLicenseKeyValid"==i||"footnotesLicenseKeyInvalid"==i||"footnotesLicenseKeyExpired"==i||"footnotesLicenseKeyDomainLimit"==i||"footnotesLicenseKeyNotAllowed"==i||"footnotesLicenseKeyEvaluationLimit"==i||"footnotesLicenseKeyTrialLimit"==i||"footnotesLicenseKeyUsageLimit"==i){delete o[n],t=i,clearInterval(this._licenseKeyCheckInterval),this._licenseKeyCheckInterval=void 0;break}}"footnotesLicenseKeyInvalid"==t&&o._showLicenseError("invalid"),"footnotesLicenseKeyExpired"==t&&o._showLicenseError("expired"),"footnotesLicenseKeyDomainLimit"==t&&o._showLicenseError("domainLimit"),"footnotesLicenseKeyNotAllowed"==t&&o._showLicenseError("featureNotAllowed","Footnotes"),"footnotesLicenseKeyEvaluationLimit"==t&&o._showLicenseError("evaluationLimit"),"footnotesLicenseKeyTrialLimit"==t&&o._showLicenseError("trialLimit"),"footnotesLicenseKeyUsageLimit"==t&&o._showLicenseError("usageLimit")},1e3)}destroy(){super.destroy(),this._licenseKeyCheckInterval&&clearInterval(this._licenseKeyCheckInterval)}}function J(t,e){const o=t.commands.get("insertFootnote");return n=>{const{t:i}=n,s=new e(n),r=s instanceof T.MenuBarMenuListItemButtonView;return s.bind("isEnabled").to(o,"isEnabled"),s.set({label:i(r?"Footnote":"Insert footnote"),icon:V.IconFootnote,tooltip:!0}),s.on("execute",()=>{o.execute(),t.editing.view.focus()}),s}}var Y=Q;function G(){var t=["pluginName","667236ITMcen","isOfficialPlugin","30bwNtPK","5279589xJWvCk","18424616hsRNxZ","658305UKnlSM","Footnotes","2746314byqJZr","isPremiumPlugin","705341ZpHbLN","209082bAEHtZ","requires"];return(G=function(){return t})()}function Q(t,e){var o=G();return(Q=function(t,e){return o[t-=134]})(t,e)}!function(t){for(var e=Q,o=t();;)try{if(554288===-parseInt(e(136))/1+-parseInt(e(142))/2*(parseInt(e(137))/3)+parseInt(e(140))/4+parseInt(e(145))/5+parseInt(e(134))/6+-parseInt(e(143))/7+parseInt(e(144))/8)break;o.push(o.shift())}catch(t){o.push(o.shift())}}(G);class Z extends t.Plugin{static get[Y(139)](){return Y(146)}static get[Y(138)](){return[v,D,X]}static get[Y(141)](){return!0}static get[Y(135)](){return!0}}const $=et;function tt(){const t=["921734IOIxhk","lower-roman","upper-latin","2634995iEFHcR","13636ACOutX","7256970wnKjWe","1782764VYojEc","498EiAuEB","decimal-leading-zero","12762gwVsHX","254063sahZaR","upper-alpha","3aCROsP","lower-latin","368podcyf","lower-alpha","upper-roman","decimal"];return(tt=function(){return t})()}function et(t,e){const o=tt();return(et=function(t,e){return o[t-=288]})(t,e)}!function(t){const e=et,o=t();for(;;)try{if(318987===-parseInt(e(293))/1+-parseInt(e(301))/2+parseInt(e(295))/3*(-parseInt(e(289))/4)+parseInt(e(304))/5+-parseInt(e(290))/6*(-parseInt(e(305))/7)+-parseInt(e(297))/8*(-parseInt(e(292))/9)+parseInt(e(288))/10)break;o.push(o.shift())}catch(t){o.push(o.shift())}}(tt);const ot=[$(300),$(291),$(296),$(303),$(298),$(294),$(302),$(299)];function nt(t,e){const o=st();return(nt=function(t,e){return o[t-=472]})(t,e)}const it=nt;function st(){const t=["refresh","947924YefJOg","isEnabled","plugins","getAttribute","20656264tPbBRy","1000OXufVN","model","change","value","1470447gVeJSH","includes","2744aqFrea","footnotesListStyle","_updateFootnotesCounters","execute","getFootnotesDefinitionsObjectElement","setAttribute","7692900ywAGCp","8602286pCwJIV","2428235JdjIpx","get"];return(st=function(){return t})()}!function(t){const e=nt,o=t();for(;;)try{if(924302===-parseInt(e(492))/1*(parseInt(e(486))/2)+parseInt(e(490))/3+-parseInt(e(481))/4+-parseInt(e(478))/5+-parseInt(e(476))/6+parseInt(e(477))/7+parseInt(e(485))/8)break;o.push(o.shift())}catch(t){o.push(o.shift())}}(st);class rt extends t.Command{[it(480)](){const t=it,{editor:e}=this,o=e[t(483)][t(479)](f)[t(474)]();this[t(482)]=!!o,this[t(489)]=o?.[t(484)](t(493))??null}[it(473)]({value:t}){const e=it,{editor:o}=this,n=o[e(483)][e(479)](f),i=n[e(474)]();i&&ot[e(491)](t)&&o[e(487)][e(488)](o=>{const s=e;o[s(475)](s(493),t,i),n[s(472)](o)})}}const at=ct;function ct(t,e){const o=lt();return(ct=function(t,e){return o[t-=137]})(t,e)}function lt(){const t=["764883wNNfYn","56oOFDqA","isInteger","218711astGDE","5lmjKAy","163356HdIeLC","change","397380HFWYIa","10407780niAcsH","setAttribute","getAttribute","execute","isEnabled","value","606051zAKwjm","model","_updateFootnotesCounters","footnotesListStart","324738zWGQrA","33tzpJtW","get","plugins","getFootnotesDefinitionsObjectElement","refresh"];return(lt=function(){return t})()}!function(t){const e=ct,o=t();for(;;)try{if(242079===parseInt(e(151))/1+parseInt(e(155))/2+-parseInt(e(143))/3*(-parseInt(e(153))/4)+parseInt(e(152))/5*(parseInt(e(142))/6)+-parseInt(e(148))/7+parseInt(e(149))/8*(parseInt(e(138))/9)+-parseInt(e(156))/10)break;o.push(o.shift())}catch(t){o.push(o.shift())}}(lt);class ut extends t.Command{[at(147)](){const t=at,{editor:e}=this,o=e[t(145)][t(144)](f)[t(146)]();this[t(160)]=!!o,this[t(137)]=o?.[t(158)](t(141))??null}[at(159)]({value:t}){const e=at,{editor:o}=this,n=o[e(145)][e(144)](f),i=n[e(146)]();i&&Number[e(150)](t)&&o[e(139)][e(154)](o=>{const s=e;o[s(157)](s(141),t,i),n[s(140)](o)})}}function ft(){const t=["writer","padStart","footnotes.footnotesProperties.defaultStartIndex","mapper","_defineConverters","8ZxYlgS","$text","upper-alpha","max","config","footnotesListStyle","292IkAHyr","setStyle","commands","_defineSchema","hasClass","55qrAatH","editor","parent","plugins","for","modelCursor","getItems","position","item","consume","_defineFormatter","setFootnoteFormatter","fromCharCode","element","consumable","getChildren","toLowerCase","toUpperCase","hasAttribute","requires","813355mPQoKx","530664opuDCU","_definePostfixer","getAttribute","get","footnotes.footnotesProperties.defaultListStyle","list-style-type","getChanges","checkAttribute","footnotesStyle","decimal","find","registerPostFixer","setAttribute","differ","parseInt","_updateFootnotesCounters","_getDefaultStartIndex","footnotesDefinitions","isPremiumPlugin","element:ol","4AOIWZF","pluginName","define","1042947sFCYgH","upper-roman","3992880uAACqn","getStyle","lower-roman","upcast","insert","name","FootnotesPropertiesEditing","lower-latin","removeStyle","removeAttribute","60Vhfcft","extend","isNaN","type","isOfficialPlugin","attribute:footnotesListStyle:footnotesDefinitions","_formatFootnoteListValue","footnotesStart","decimal-leading-zero","start","lower-alpha","132651MWiaac","footnotes-list","from","init","schema","footnotesListStart","1191hUPhpM","_getDefaultListStyle","attribute:footnotesListStart:footnotesDefinitions","document","floor","toViewElement","upper-latin","1111292CKzEUP","nodeAfter","createRangeOn","add","viewItem","model","downcast"];return(ft=function(){return t})()}const dt=ht;function ht(t,e){const o=ft();return(ht=function(t,e){return o[t-=389]})(t,e)}!function(t){const e=ht,o=t();for(;;)try{if(354252===-parseInt(e(407))/1*(parseInt(e(432))/2)+-parseInt(e(401))/3+-parseInt(e(478))/4*(-parseInt(e(457))/5)+-parseInt(e(483))/6+parseInt(e(414))/7*(parseInt(e(426))/8)+-parseInt(e(481))/9*(-parseInt(e(390))/10)+-parseInt(e(437))/11*(-parseInt(e(458))/12))break;o.push(o.shift())}catch(t){o.push(o.shift())}}(ft);class pt extends t.Plugin{static get[dt(479)](){return dt(489)}static get[dt(456)](){return[v,f]}static get[dt(394)](){return!0}static get[dt(476)](){return!0}[dt(404)](){const t=dt,{editor:e}=this;e[t(430)][t(480)](t(462),t(467)),e[t(430)][t(480)](t(423),1),e[t(434)][t(417)](t(466),new rt(e)),e[t(434)][t(417)](t(397),new ut(e)),this[t(435)](),this[t(425)](),this[t(447)](),this[t(459)]()}[dt(435)](){const t=dt,{editor:e}=this,{schema:o}=e[t(419)];o[t(391)](t(475),{allowAttributes:[t(431),t(406)]})}[dt(425)](){const t=dt,{editor:e}=this,{conversion:o,model:n}=e,{schema:i}=n;o[t(441)](t(486))[t(417)](e=>{const o=t;e.on(o(477),(t,e,n)=>{const s=o,r=e[s(418)],a=e[s(442)]?.[s(439)];r[s(436)](s(402))&&a?.is(s(450),s(475))&&(function(t,e,o,n){const i=s;if(!n[i(465)](e,i(406)))return;let r=1;const a=o[i(451)][i(446)](t,{attributes:i(399)});if(a){const e=Number[i(472)](t[i(460)](i(399)),10);Number[i(392)](e)||(r=e)}!a&&e[i(455)](i(406))||o[i(421)][i(470)](i(406),r,e)}(r,a,n,i),function(t,e,o,n){const i=s;if(!n[i(465)](e,i(431)))return;let r=i(467),a=!1;if(o[i(451)][i(446)](t,{attributes:i(393)})){const e={1:i(467),a:i(400),A:i(428),i:i(485),I:i(482)}[t[i(460)](i(393))];e&&(r=e),a=!0}o[i(451)][i(446)](t,{styles:i(463)})&&(r=t[i(484)](i(463)),a=!0),!a&&e[i(455)](i(431))||o[i(421)][i(470)](i(431),r,e)}(r,a,n,i))})}),o[t(441)](t(420))[t(417)](e=>{const o=t;e.on(o(409),(t,e,n)=>{const i=o;if(!n[i(451)][i(446)](e[i(445)],t[i(488)]))return;const s=mt(e[i(445)],n[i(424)]),{attributeNewValue:r}=e;null==r||1===r?n[i(421)][i(389)](i(399),s):n[i(421)][i(470)](i(399),String(r),s)}),e.on(o(395),(t,e,n)=>{const i=o;if(!n[i(451)][i(446)](e[i(445)],t[i(488)]))return;const s=mt(e[i(445)],n[i(424)]),{attributeNewValue:r}=e;r&&i(467)!==r?n[i(421)][i(433)](i(463),r,s):n[i(421)][i(491)](i(463),s)})})}[dt(459)](){const t=dt,{editor:e}=this,{model:o}=e,n=e[t(440)][t(461)](f),i=this[t(408)](),s=this[t(474)]();o[t(410)][t(469)](e=>{const r=t,a=o[r(410)][r(471)][r(464)]();let c=!1;for(const t of a){if(r(487)!==t[r(393)]||r(427)===t[r(488)])continue;const n=o[r(416)](t[r(444)][r(415)]);for(const t of n[r(443)]())t.is(r(450),r(475))&&(!t[r(455)](r(406))&&o[r(405)][r(465)](t,r(406))&&(e[r(470)](r(406),s,t),c=!0),!t[r(455)](r(431))&&o[r(405)][r(465)](t,r(431))&&(e[r(470)](r(431),i,t),c=!0))}return c&&n[r(473)](e),c})}[dt(447)](){const t=dt,{editor:e}=this;e[t(440)][t(461)](f)[t(448)](e=>this[t(396)](e))}[dt(408)](){const t=dt;return this[t(438)][t(430)][t(461)](t(462))}[dt(474)](){const t=dt;return this[t(438)][t(430)][t(461)](t(423))}[dt(396)]({container:t,value:e,digits:o}){const n=dt,i=t[n(460)](n(431)),s=t[n(460)](n(406)),r=Math[n(411)](e)+(s??1)-1;switch(i){case n(398):return function(t,e){const o=n;return String(t)[o(422)](e,"0")}(r,Math[n(429)](2,o));case n(400):case n(490):return gt(r,!1);case n(428):case n(413):return gt(r,!0);case n(485):return yt(r,!1);case n(482):return yt(r,!0);default:return String(r)}}}function mt(t,e){const o=dt,n=e[o(412)](t);return Array[o(403)](n[o(452)]())[o(468)](t=>t.is(o(450),"ol")&&t[o(436)](o(402)))}function gt(t,e){const o=dt;let n="",i=t;for(;i>0;){const t=(i-1)%26;n=String[o(449)](97+t)+n,i=Math[o(411)]((i-1)/26)}return e?n[o(454)]():n}const wt=[{value:1e3,numeral:"M"},{value:900,numeral:"CM"},{value:500,numeral:"D"},{value:400,numeral:"CD"},{value:100,numeral:"C"},{value:90,numeral:"XC"},{value:50,numeral:"L"},{value:40,numeral:"XL"},{value:10,numeral:"X"},{value:9,numeral:"IX"},{value:5,numeral:"V"},{value:4,numeral:"IV"},{value:1,numeral:"I"}];function yt(t,e){const o=dt;let n="",i=t;for(const{value:t,numeral:e}of wt)for(;i>=t;)n+=e,i-=t;return e?n:n[o(453)]()}class bt extends T.View{children;stylesView=null;additionalProperties=null;startIndexFieldView=null;focusTracker=new i.FocusTracker;keystrokes=new i.KeystrokeHandler;focusables=new T.ViewCollection;focusCycler;constructor(t,{styleButtonViews:e,styleGridAriaLabel:o}){super(t),this.focusCycler=new T.FocusCycler({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.children=this.createCollection(),this.stylesView=this._appendStylesView(e,o),[this.startIndexFieldView,this.additionalProperties]=this._appendAdditionalPropertiesCollapsibleView(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-footnotes-definitions-properties"]},children:this.children})}render(){if(super.render(),this.stylesView){this.focusables.add(this.stylesView),this.focusTracker.add(this.stylesView.element);for(const t of this.stylesView.children)this.stylesView.focusTracker.add(t.element);(0,T.addKeyboardHandlingForGrid)({keystrokeHandler:this.stylesView.keystrokes,focusTracker:this.stylesView.focusTracker,gridItems:this.stylesView.children,numberOfColumns:()=>i.global.window.getComputedStyle(this.stylesView.element).getPropertyValue("grid-template-columns").split(" ").length,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}if(this.startIndexFieldView){this.focusables.add(this.startIndexFieldView),this.focusTracker.add(this.startIndexFieldView.element);const t=t=>t.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}this.keystrokes.listenTo(this.element)}focus(){this.focusCycler.focusFirst()}focusLast(){this.focusCycler.focusLast()}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_appendStylesView(t,e){const o=new T.View(this.locale);return o.children=o.createCollection(),o.children.addMany(t),o.setTemplate({tag:"div",attributes:{"aria-label":e,class:["ck","ck-footnotes-definitions-styles-list"]},children:o.children}),o.children.delegate("execute").to(this),o.focus=function(){for(const t of this.children)if(t instanceof T.ButtonView&&t.isOn)return void t.focus();this.children.first.focus()},o.focusTracker=new i.FocusTracker,o.keystrokes=new i.KeystrokeHandler,o.render(),o.keystrokes.listenTo(o.element),this.children.add(o),o}_appendAdditionalPropertiesCollapsibleView(){const{t}=this.locale,e=this._createStartIndexPropertyView(),o=[e],n=new T.CollapsibleView(this.locale,o);return n.set({label:t("Footnotes properties"),isCollapsed:!0}),n.buttonView.bind("isEnabled").toMany(o,"isEnabled",(...t)=>t.some(t=>t)),n.buttonView.on("change:isEnabled",(t,e,o)=>{o||(n.isCollapsed=!0)}),this.children.add(n),[e,n]}_createStartIndexPropertyView(){const{t}=this.locale,e=new T.LabeledFieldView(this.locale,T.createLabeledInputNumber);return e.set({label:t("Footnotes start at"),class:"ck-footnotes-definitions-properties__start-index"}),e.fieldView.set({min:0,max:Math.pow(2,30),step:1,value:1,inputMode:"numeric"}),e.fieldView.on("input",()=>{const o=e.fieldView.element,n=o.valueAsNumber;Number.isNaN(n)?e.errorText=t("Invalid footnotes start index value."):o.checkValidity()?this.fire("footnotesListStart",{startIndex:n}):e.errorText=t(n<0?"Footnotes start index must be greater than 0.":"Footnotes start index is too large.")}),e}}var vt=o(945),It={attributes:{"data-cke":!0}};It.setAttributes=W(),It.insert=M().bind(null,"head"),It.domAPI=K(),It.insertStyleElement=U();N()(vt.A,It);vt.A&&vt.A.locals&&vt.A.locals;class kt extends t.Plugin{static get pluginName(){return"FootnotesPropertiesUI"}static get requires(){return[T.ContextualBalloon,e.WidgetToolbarRepository]}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}init(){const{editor:t}=this,{componentFactory:e}=t.ui;var o;t.config.define("footnotes.footnotesProperties.toolbar",["footnotesStyle"]),e.add("footnotesStyle",(o=t,t=>{const{t:e}=t,n=o.commands.get("footnotesStyle"),i=(0,T.createDropdown)(t),{buttonView:s}=i;return i.class="ck-footnotes-styles-dropdown",i.bind("isEnabled").to(n,"isEnabled"),s.set({label:e("Footnotes style"),icon:V.IconFootnote,tooltip:!0}),i.once("change:isOpen",()=>{const t=function({editor:t,dropdownView:e}){const{t:o}=t.locale,n=o("Footnotes definitions styles"),i=function(t){const e=t.locale.t;return[{label:e("Toggle the decimal footnotes style"),tooltip:e("Decimal footnotes"),style:"decimal",icon:V.IconListStyleDecimal},{label:e("Toggle the decimal with leading zero footnotes style"),tooltip:e("Decimal footnotes with leading zero"),style:"decimal-leading-zero",icon:V.IconListStyleDecimalLeadingZero},{label:e("Toggle the lower–roman footnotes style"),tooltip:e("Lower–roman footnotes"),style:"lower-roman",icon:V.IconListStyleLowerRoman},{label:e("Toggle the upper–roman footnotes style"),tooltip:e("Upper-roman footnotes"),style:"upper-roman",icon:V.IconListStyleUpperRoman},{label:e("Toggle the lower–latin footnotes style"),tooltip:e("Lower-latin footnotes"),style:"lower-latin",icon:V.IconListStyleLowerLatin},{label:e("Toggle the upper–latin footnotes style"),tooltip:e("Upper-latin footnotes"),style:"upper-latin",icon:V.IconListStyleUpperLatin}].map(function(t){const e=t.locale;return({label:o,icon:n,tooltip:i,style:s})=>{const r=t.commands.get("footnotesStyle"),a=new T.ButtonView(e);return a.set({label:o,icon:n,tooltip:i}),a.bind("isOn").to(r,"value",t=>t===s),a.bind("isEnabled").to(r,"isEnabled"),a.on("execute",()=>{t.execute("footnotesStyle",{value:s}),t.editing.view.focus()}),a}}(t))}(t),s=new bt(t.locale,{styleGridAriaLabel:n,styleButtonViews:i});return s.delegate("execute").to(e),s.on("footnotesListStart",(e,o)=>{t.execute("footnotesStart",{value:o.startIndex})}),s}({editor:o,dropdownView:i});i.panelView.children.add(t)}),i}))}afterInit(){const{editor:t}=this,{t:o}=t.locale,n=t.plugins.get(e.WidgetToolbarRepository),{defaultPositions:i}=T.BalloonPanelView;n.register("footnotesDefinitions",{ariaLabel:o("Footnotes definitions toolbar"),items:t.config.get("footnotes.footnotesProperties.toolbar"),balloonClassName:"ck-footnotes-style-balloon ck-toolbar-container",getRelatedElement:t=>{let e=t.getFirstPosition()?.parent;return e?.is("$text")&&(e=e.parent),e?.is("element")?e.findAncestor(F):null},positions:[i.southArrowNorth,i.southArrowNorthMiddleWest,i.southArrowNorthMiddleEast,i.southArrowNorthWest,i.southArrowNorthEast,i.northArrowSouth,i.northArrowSouthMiddleWest,i.northArrowSouthMiddleEast,i.northArrowSouthWest,i.northArrowSouthEast,i.viewportStickyNorth]})}}var Ct=xt;function Ft(){var t=["881067APZSbl","159129lijiVR","156261htppQE","requires","5RIhsSE","787398JsYARX","1531482dRkjvi","22233nqmHqa","isOfficialPlugin","56DfGNlG","isPremiumPlugin","4bjadKY","87392BsQSrE","20lZarnk","FootnotesProperties","pluginName"];return(Ft=function(){return t})()}function xt(t,e){var o=Ft();return(xt=function(t,e){return o[t-=133]})(t,e)}!function(t){for(var e=xt,o=t();;)try{if(259467===parseInt(e(142))/1+parseInt(e(145))/2+-parseInt(e(147))/3*(-parseInt(e(135))/4)+-parseInt(e(144))/5*(parseInt(e(146))/6)+parseInt(e(133))/7*(-parseInt(e(136))/8)+parseInt(e(141))/9*(-parseInt(e(137))/10)+parseInt(e(140))/11)break;o.push(o.shift())}catch(t){o.push(o.shift())}}(Ft);class Et extends t.Plugin{static get[Ct(139)](){return Ct(138)}static get[Ct(143)](){return[pt,kt]}static get[Ct(148)](){return!0}static get[Ct(134)](){return!0}}function St(t,e){var o=At();return(St=function(t,e){return o[t-=258]})(t,e)}function At(){var t=["31102850rovYjf","2012376ScaywD","2917715YUMTBI","1184433ximNTc","6616377kdbTxv","382AbvWst","581pIIsgt","4157SKQkfc","70024jQinIb","16fQtXza"];return(At=function(){return t})()}!function(t){for(var e=St,o=t();;)try{if(993855===parseInt(e(264))/1*(-parseInt(e(262))/2)+-parseInt(e(260))/3*(parseInt(e(266))/4)+parseInt(e(259))/5+-parseInt(e(258))/6+parseInt(e(263))/7*(-parseInt(e(265))/8)+parseInt(e(261))/9+parseInt(e(267))/10)break;o.push(o.shift())}catch(t){o.push(o.shift())}}(At)})(),(window.CKEditor5=window.CKEditor5||{}).footnotes=n})();