PageSourceSearch

https://mit.asia/_next/static/chunks/001fbdba.81bed5942c752804.js

js mit.asia collected 2026-10-01 13:00:40 UTC 148,947 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44822],{47551:function(e,t,i){i.d(t,{AH:function(){return t0},BM:function(){return ed},Bv:function(){return eS},DE:function(){return er},Dn:function(){return en},FH:function(){return e3},G7:function(){return M},GI:function(){return W},Gp:function(){return Z},I0:function(){return K},IJ:function(){return G},J0:function(){return eF},Jf:function(){return tY},KP:function(){return eC},MI:function(){return to},Mh:function(){return e1},Oz:function(){return ei},P_:function(){return tM},Pm:function(){return eJ},R:function(){return e2},RX:function(){return N},Rm:function(){return ej},S1:function(){return e_},S8:function(){return tB},SI:function(){return t_},VY:function(){return tS},Vq:function(){return J},WB:function(){return tW},Wb:function(){return eh},YS:function(){return _},_n:function(){return eP},a5:function(){return t5},dn:function(){return eL},eC:function(){return R},fF:function(){return tF},h:function(){return et},iw:function(){return eH},jB:function(){return e$},jx:function(){return eD},jz:function(){return tR},k6:function(){return eg},lp:function(){return tz},mO:function(){return U},no:function(){return eN},oU:function(){return t1},p2:function(){return eb},pq:function(){return eO},py:function(){return tL},r1:function(){return tA},r5:function(){return z},sh:function(){return e4},t9:function(){return eX},up:function(){return eY},vX:function(){return g}});var s,o=i(95808),r=i(78375),n=i(65114),l=i(40697),a=i(61460),c=i(36714),h=i(22701),u=i(82912),d=i(39441);i(98886);var p=i(88702),f=i(15070),m=i(89937),w=i(53426),b=i(68290);class g extends o.FE{_parentElement;constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(e,t,i)=>{this._renderViewIntoCollectionParent(t,i)}),this.on("remove",(e,t)=>{t.element&&this._parentElement&&t.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){for(let t of(this._parentElement=e,this))this._renderViewIntoCollectionParent(t)}delegate(...e){if(!e.length||!e.every(e=>"string"==typeof e))throw new o.Bb("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(let i of this)for(let s of e)i.delegate(s).to(t);this.on("add",(i,s)=>{for(let i of e)s.delegate(i).to(t)}),this.on("remove",(i,s)=>{for(let i of e)s.stopDelegating(i,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}remove(e){return super.remove(e)}}class _ extends(0,o.ln)(){ns;tag;text;attributes;children;eventListeners;_isRendered;_revertData;constructor(e){super(),Object.assign(this,x(C(e))),this._isRendered=!1,this._revertData=null}render(){let e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData=A(),this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new o.Bb("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function* e(t){if(t.children)for(let i of t.children)P(i)?yield i:F(i)&&(yield*e(i))}(this)}static bind(e,t){return{to:(i,s)=>new v({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:s}),if:(i,s,o)=>new T({observable:e,emitter:t,attribute:i,valueIfTrue:s,callback:o})}}static extend(e,t){if(e._isRendered)throw new o.Bb("template-extend-render",[this,e]);!function e(t,i){if(i.attributes&&(t.attributes||(t.attributes={}),I(t.attributes,i.attributes)),i.eventListeners&&(t.eventListeners||(t.eventListeners={}),I(t.eventListeners,i.eventListeners)),i.text&&t.text.push(...i.text),i.children&&i.children.length){if(t.children.length!=i.children.length)throw new o.Bb("ui-template-extend-children-mismatch",t);let s=0;for(let o of i.children)e(t.children[s++],o)}}(e,x(C(t)))}_renderNode(e){if(e.node?this.tag&&this.text:this.tag?this.text:!this.text)throw new o.Bb("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){var t;let i=e.node;
1return i?e.revertData.text=i.textContent:i=e.node=document.createTextNode(""),y(this.text)?this._bindToObservable({schema:this.text,updater:(t=i,{set(e){t.textContent=e},remove(){t.textContent=""}}),data:e}):i.textContent=this.text.join(""),i}_renderAttributes(e){if(!this.attributes)return;let t=e.node,i=e.revertData;for(let s in this.attributes){let o=t.getAttribute(s),r=this.attributes[s];i&&(i.attributes[s]=o);let n=D(r)?r[0].ns:null;if(y(r)){let l=D(r)?r[0].value:r;i&&S(s)&&l.unshift(o),this._bindToObservable({schema:l,updater:function(e,t,i){return{set(s){e.setAttributeNS(i,t,s)},remove(){e.removeAttributeNS(i,t)}}}(t,s,n),data:e})}else if("style"==s&&"string"!=typeof r[0])this._renderStyleAttribute(r[0],e);else{i&&o&&S(s)&&r.unshift(o);let e=r.map(e=>e&&e.value||e).reduce((e,t)=>e.concat(t),[]).reduce(O,"");B(e)||t.setAttributeNS(n,s,e)}}}_renderStyleAttribute(e,t){let i=t.node;for(let s in e){let o=e[s];y(o)?this._bindToObservable({schema:[o],updater:function(e,t){return{set(i){e.style[t]=i},remove(){e.style[t]=null}}}(i,s),data:t}):i.style[s]=o}}_renderElementChildren(e){let t=e.node,i=e.intoFragment?document.createDocumentFragment():t,s=e.isApplying,r=0;for(let n of this.children)if(L(n)){if(!s)for(let e of(n.setParent(t),n))i.appendChild(e.element)}else if(P(n))s||(n.isRendered||n.render(),i.appendChild(n.element));else if((0,o.UG)(n))i.appendChild(n);else if(s){let t=e.revertData,s=A();t.children.push(s),n._renderNode({intoFragment:!1,node:i.childNodes[r++],isApplying:!0,revertData:s})}else i.appendChild(n.render());e.intoFragment&&t.appendChild(i)}_setUpListeners(e){if(this.eventListeners)for(let t in this.eventListeners){let i=this.eventListeners[t].map(i=>{let[s,o]=t.split("@");return i.activateDomEventListener(s,o,e)});e.revertData&&e.revertData.bindings.push(i)}}_bindToObservable({schema:e,updater:t,data:i}){let s=i.revertData;V(e,t,i);let o=e.filter(e=>!B(e)).filter(e=>e.observable).map(s=>s.activateAttributeListener(e,t,i));s&&s.bindings.push(o)}_revertTemplateFromNode(e,t){for(let e of t.bindings)for(let t of e)t();if(t.text){e.textContent=t.text;return}for(let i in t.attributes){let s=t.attributes[i];null===s?e.removeAttribute(i):e.setAttribute(i,s)}for(let i=0;i<t.children.length;++i)this._revertTemplateFromNode(e.childNodes[i],t.children[i])}}class k{attribute;observable;emitter;callback;constructor(e){this.attribute=e.attribute,this.observable=e.observable,this.emitter=e.emitter,this.callback=e.callback}getValue(e){let t=this.observable[this.attribute];return this.callback?this.callback(t,e):t}activateAttributeListener(e,t,i){let s=()=>V(e,t,i);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,s),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,s)}}}class v extends k{eventNameOrFunction;constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,i){let s=(e,i)=>{(!t||i.target.matches(t))&&("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(i):this.observable.fire(this.eventNameOrFunction,i))};return this.emitter.listenTo(i.node,e,s),()=>{this.emitter.stopListening(i.node,e,s)}}}class T extends k{valueIfTrue;constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){return!B(super.getValue(e))&&(this.valueIfTrue||!0)}}function y(e){return!!e&&((e.value&&(e=e.value),Array.isArray(e))?e.some(y):e instanceof k)}function V(e,t,{node:i}){let s;let o=e.map(e=>e instanceof k?e.getValue(i):e);B(s=1==e.length&&e[0]instanceof T?o[0]:o.reduce(O,""))?t.remove():t.set(s)}function C(e){return(0,r.Z)(e,e=>{if(e&&(e instanceof k||F(e)||P(e)||L(e)))return e})}function x(e){var t;if("string"==typeof e?e={text:[e]}:e.text&&((t=e).text=(0,o.qo)(t.text)),e.on&&(e.eventListeners=function(e){for(let t in e)E(e,t);return e}(e.on),delete e.on),!e.text){e.attributes&&function(e){for(let t in e)e[t].value&&(e[t].value=(0,o.qo)(e[t].value)),E(e,t)}(e.attributes);let t=[];if(e.children){if(L(e.children))t.push(e.children);else for(let i of e.children)F(i)||P(i)||(0,o.UG)(i)?t.push(i):t.push(new _(i))}e.children=t}return e}function E(e,t){e[t]=(0,o.qo)(e[t])}function O(e,t){return B(t)?e:B(e)?t:`${e} ${t}`}
1function I(e,t){for(let i in t)e[i]?e[i].push(...t[i]):e[i]=t[i]}function B(e){return!e&&0!==e}function P(e){return e instanceof M}function F(e){return e instanceof _}function L(e){return e instanceof g}function D(e){return(0,n.Z)(e[0])&&e[0].ns}function A(){return{children:[],bindings:[],attributes:{}}}function S(e){return"class"==e||"style"==e}class M extends(0,o.Xu)((0,o.Re)()){element;isRendered;locale;t;template;_viewCollections;_unboundChildren;_bindTemplate;constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new o.FE,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,i)=>{i.locale=e,i.t=e&&e.t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=_.bind(this,this)}createCollection(e){let t=new g(e);return this._viewCollections.add(t),t}registerChild(e){for(let t of((0,o.TW)(e)||(e=[e]),e))this._unboundChildren.add(t)}deregisterChild(e){for(let t of((0,o.TW)(e)||(e=[e]),e))this._unboundChildren.remove(t)}setTemplate(e){this.template=new _(e)}extendTemplate(e){_.extend(this.template,e)}render(){if(this.isRendered)throw new o.Bb("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(e=>e.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}function R({emitter:e,activator:t,callback:i,contextElements:s,listenerOptions:o}){e.listenTo(document,"mousedown",(e,o)=>{if(!t())return;let r="function"==typeof o.composedPath?o.composedPath():[];for(let e of"function"==typeof s?s():s)if(e.contains(o.target)||r.includes(e))return;i()},o)}function N(e){class t extends e{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...e){super(...e),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}return t}function W({view:e}){e.listenTo(e.element,"submit",(t,i)=>{i.preventDefault(),e.fire("submit")},{useCapture:!0})}function G({keystrokeHandler:e,focusTracker:t,gridItems:i,numberOfColumns:s,uiLanguageDirection:o}){let r="number"==typeof s?()=>s:s;function n(e){return s=>{let o=i.find(e=>e.element===t.focusedElement),r=e(i.getIndex(o),i);i.get(r).focus(),s.stopPropagation(),s.preventDefault()}}e.set("arrowright",n((e,t)=>{var i;return"rtl"===o?(i=t.length,0===e?i-1:e-1):e===t.length-1?0:e+1})),e.set("arrowleft",n((e,t)=>{var i;return"rtl"===o?e===t.length-1?0:e+1:(i=t.length,0===e?i-1:e-1)})),e.set("arrowup",n((e,t)=>{let i=e-r();return i<0&&(i=e+r()*Math.floor(t.length/r()))>t.length-1&&(i-=r()),i})),e.set("arrowdown",n((e,t)=>{let i=e+r();return i>t.length-1&&(i=e%r()),i}))}class U extends M{static presentationalAttributeNames=["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"];constructor(){super();let e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.set("isVisible",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon",e.if("isVisible","ck-hidden",e=>!e),"ck-reset_all-excluded",e.if("isColorInherited","ck-icon_inherit-color")],viewBox:e.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){let e=new DOMParser().parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),t=e.getAttribute("viewBox");for(let{name:i,value:s}of(t&&(this.viewBox=t),Array.from(e.attributes)))U.presentationalAttributeNames.includes(i)&&this.element.setAttribute(i,s);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(e
1=>{e.style.fill=this.fillColor})}}class H extends M{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});let e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:e.to("style"),id:e.to("id")},children:[{text:e.to("text")}]})}}class z extends M{children;labelView;iconView;keystrokeView;_focusDelayed=null;constructor(e,t=new H){super(e);let i=this.bindTemplate,s=(0,o.hQ)();this.set("_ariaPressed",!1),this.set("_ariaChecked",!1),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${s}`),this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("role",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._setupLabelView(t),this.iconView=new U,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));let r={tag:"button",attributes:{class:["ck","ck-button",i.to("class"),i.if("isEnabled","ck-disabled",e=>!e),i.if("isVisible","ck-hidden",e=>!e),i.to("isOn",e=>e?"ck-on":"ck-off"),i.if("withText","ck-button_with-text"),i.if("withKeystroke","ck-button_with-keystroke")],role:i.to("role"),type:i.to("type",e=>e||"button"),tabindex:i.to("tabindex"),"aria-checked":i.to("_ariaChecked"),"aria-pressed":i.to("_ariaPressed"),"aria-label":i.to("ariaLabel"),"aria-labelledby":i.to("ariaLabelledBy"),"aria-disabled":i.if("isEnabled",!0,e=>!e),"data-cke-tooltip-text":i.to("_tooltipString"),"data-cke-tooltip-position":i.to("tooltipPosition")},children:this.children,on:{click:i.to(e=>{this.isEnabled?this.fire("execute"):e.preventDefault()})}};this.bind("_ariaPressed").to(this,"isOn",this,"isToggleable",this,"role",(e,t,i)=>!(!t||$(i))&&String(!!e)),this.bind("_ariaChecked").to(this,"isOn",this,"isToggleable",this,"role",(e,t,i)=>!!(t&&$(i))&&String(!!e)),o.OB.isSafari&&(this._focusDelayed||(this._focusDelayed=(0,o.gw)(()=>this.focus(),0)),r.on.mousedown=i.to(()=>{this._focusDelayed()}),r.on.mouseup=i.to(()=>{this._focusDelayed.cancel()})),this.setTemplate(r)}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_setupLabelView(e){return e.bind("text","style","id").to(this,"label","labelStyle","ariaLabelledBy"),e}_createKeystrokeView(){let e=new M;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",e=>(0,o.XU)(e))}]}),e}_getTooltipString(e,t,i){return e?"string"==typeof e?e:(i&&(i=(0,o.XU)(i)),e instanceof Function)?e(t,i):`${t}${i?` (${i})`:""}`:""}}function $(e){switch(e){case"radio":case"checkbox":case"option":case"switch":case"menuitemcheckbox":case"menuitemradio":return!0;default:return!1}}class Z extends M{children;iconView;constructor(e,t={}){super(e);let i=this.bindTemplate;this.set("label",t.label||""),this.set("class",t.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children}),t.icon&&(this.iconView=new U,this.iconView.content=t.icon,this.children.add(this.iconView));let s=new M(e);s.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:i.to("label")}]}),this.children.add(s)}}class K extends(0,o.ln)(){focusables;focusTracker;keystrokeHandler;actions;constructor(e){if(super(),this.focusables=e.focusables,this.focusTracker=e.focusTracker,this.keystrokeHandler=e.keystrokeHandler,this.actions=e.actions,e.actions&&e.keystrokeHandler)for(let t in e.actions){let i=e.actions[t];for(let s of("string"==typeof i&&(i=[i]),i))e.keystrokeHandler.set(s,(e,i)=>{this[t](),i()},e.keystrokeHandlerOptions)}this.on("forwardCycle",()=>this.focusFirst(),{priority:"low"}),this.on("backwardCycle",()=>this.focusLast(),{priority:"low"})}get first(){return this.focusables.find(q)||null}get last(){return this.focusables.filter(q).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let e=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((t,i)=>{let s=t.element===this.focusTracker.focusedElement;return s&&(e=i),s}),e)}focusFirst(){this._focus(this.first,1)}focusLast(){this._focus(this.last,-1)}focusNext(){let e=this.next;if(e&&this.focusables.getIndex(e)===this.current){this.fire("forwardCycle");return}e===this.first?this.fire("forwardCycle"):this._focus(e,1)}focusPrevious(){let e=this.previous;if(e&&this.focusables.getIndex(e)===this.current){this.fire("backwardCycle");return}e===this.last?this.fire("backwardCycle"):this._focus(e,-1)}chain(e){let t=()=>null===this.current?null:this.focusables.get(this.current);this.listenTo(e,"forwardCycle",e=>{let i=t();this.focusNext(),i!==t()&&e.stop()},{priority:"low"}),this.listenTo(e,"backwardCycle",e=>{let i=t();this.focusPrevious(),i!==t()&&e.stop()},{priority:"low"})}unchain(e){this.stopListening(e)}
1_focus(e,t){e&&this.focusTracker.focusedElement!==e.element&&e.focus(t)}_getDomFocusableItem(e){let t=this.focusables.length;if(!t)return null;let i=this.current;if(null===i)return this[1===e?"first":"last"];let s=this.focusables.get(i),o=(i+t+e)%t;do{let i=this.focusables.get(o);if(q(i)){s=i;break}o=(o+t+e)%t}while(o!==i);return s}}function q(e){return j(e)&&(0,o.pn)(e.element)}function j(e){return!!("focus"in e&&"function"==typeof e.focus)}function X(e){class t extends e{_onDragBound=this._onDrag.bind(this);_onDragEndBound=this._onDragEnd.bind(this);_lastDraggingCoordinates={x:0,y:0};constructor(...e){super(...e),this.on("render",()=>{this._attachListeners()}),this.set("isDragging",!1)}_attachListeners(){this.listenTo(this.element,"mousedown",this._onDragStart.bind(this)),this.listenTo(this.element,"touchstart",this._onDragStart.bind(this))}_attachDragListeners(){this.listenTo(o.global.document,"mouseup",this._onDragEndBound),this.listenTo(o.global.document,"touchend",this._onDragEndBound),this.listenTo(o.global.document,"mousemove",this._onDragBound),this.listenTo(o.global.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening(o.global.document,"mouseup",this._onDragEndBound),this.stopListening(o.global.document,"touchend",this._onDragEndBound),this.stopListening(o.global.document,"mousemove",this._onDragBound),this.stopListening(o.global.document,"touchmove",this._onDragBound)}_onDragStart(e,t){if(!this._isHandleElementPressed(t))return;this._attachDragListeners();let i=0,s=0;t instanceof MouseEvent?(i=t.clientX,s=t.clientY):(i=t.touches[0].clientX,s=t.touches[0].clientY),this._lastDraggingCoordinates={x:i,y:s},this.isDragging=!0}_onDrag(e,t){if(!this.isDragging){this._detachDragListeners();return}let i=0,s=0;t instanceof MouseEvent?(i=t.clientX,s=t.clientY):(i=t.touches[0].clientX,s=t.touches[0].clientY),t.preventDefault(),this.fire("drag",{deltaX:Math.round(i-this._lastDraggingCoordinates.x),deltaY:Math.round(s-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:i,y:s}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(e){return!!this.dragHandleElement&&(this.dragHandleElement===e.target||e.target instanceof HTMLElement&&this.dragHandleElement.contains(e.target))}}return t}class Y extends M{children;keystrokes;focusCycler;_focusTracker;_focusables;constructor(e){super(e),this.children=this.createCollection(),this.keystrokes=new o.VD,this._focusTracker=new o.Rh,this._focusables=new g,this.focusCycler=new K({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__actions"]},children:this.children})}render(){super.render(),this.keystrokes.listenTo(this.element)}setButtons(e){for(let t of e){let e;let i=new z(this.locale);for(e in i.on("execute",()=>t.onExecute()),t.onCreate&&t.onCreate(i),t)"onExecute"!=e&&"onCreate"!=e&&i.set(e,t[e]);this.children.add(i)}this._updateFocusCyclableItems()}focus(e){-1===e?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach(e=>{this._focusables.add(e),this._focusTracker.add(e.element)})}}class Q extends M{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__content"]},children:this.children})}reset(){for(;this.children.length;)this.children.remove(0)}}let J={SCREEN_CENTER:"screen-center",EDITOR_CENTER:"editor-center",EDITOR_TOP_SIDE:"editor-top-side",EDITOR_TOP_CENTER:"editor-top-center",EDITOR_BOTTOM_CENTER:"editor-bottom-center",EDITOR_ABOVE_CENTER:"editor-above-center",EDITOR_BELOW_CENTER:"editor-below-center"},ee=(0,o.nn)("px");class et extends X(M){parts;headerView;closeButtonView;actionsView;static defaultOffset=15;contentView;keystrokes;focusTracker;wasMoved=!1;_getCurrentDomRoot;_getViewportOffset;_focusables;_focusCycler;constructor(e,{getCurrentDomRoot:t,getViewportOffset:i}){super(e);let s=this.bindTemplate,r=e.t;this.set("className",""),this.set("ariaLabel",r("Editor dialog")),this.set("isModal",!1),this.set("position",J.SCREEN_CENTER),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getCurrentDomRoot=t,this._getViewportOffset=i,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new o.VD,this.focusTracker=new o.Rh,this._focusables=new g,this._focusCycler=new K({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog-overlay",s.if("isModal","ck-dialog-overlay__transparent",e=>!e),s.if("_isVisible","ck-hidden",e=>!e)],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",s.if("isModal","ck-dialog_modal"),s.to("className")],role:"dialog","aria-label":s.to("ariaLabel"),style:{to
1p:s.to("_top",e=>ee(e)),left:s.to("_left",e=>ee(e)),visibility:s.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",(e,t)=>{this.fire("close",{source:"escKeyPress"}),t()}),this.on("drag",(e,{deltaX:t,deltaY:i})=>{this.wasMoved=!0,this.moveBy(t,i)}),this.listenTo(o.global.window,"resize",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.listenTo(o.global.document,"scroll",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.on("change:_isVisible",(e,t,i)=>{i&&(this._isTransparent=!0,setTimeout(()=>{this.updatePosition(),this._isTransparent=!1,this.focus()},10))}),this.keystrokes.listenTo(this.element)}get dragHandleElement(){return this.headerView&&!this.isModal?this.headerView.element:null}setupParts({icon:e,title:t,hasCloseButton:i=!0,content:s,actionButtons:o}){t&&(this.headerView=new Z(this.locale,{icon:e}),i&&(this.closeButtonView=this._createCloseButton(),this.headerView.children.add(this.closeButtonView)),this.headerView.label=t,this.ariaLabel=t,this.parts.add(this.headerView,0)),s&&(s instanceof M&&(s=[s]),this.contentView=new Q(this.locale),this.contentView.children.addMany(s),this.parts.add(this.contentView)),o&&(this.actionsView=new Y(this.locale),this.actionsView.setButtons(o),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}moveTo(e,t){let i=this._getViewportRect(),s=this._getDialogRect();e+s.width>i.right&&(e=i.right-s.width),e<i.left&&(e=i.left),t<i.top&&(t=i.top),this._moveTo(e,t)}_moveTo(e,t){this._left=e,this._top=t}moveBy(e,t){this.moveTo(this._left+e,this._top+t)}_moveOffScreen(){this._moveTo(-9999,-9999)}updatePosition(){let e;if(!this.element||!this.element.parentNode)return;let t=this._getViewportRect(),i=this.position;this._getCurrentDomRoot()?e=this._getVisibleDomRootRect(t):i=J.SCREEN_CENTER;let s=et.defaultOffset,o=this._getDialogRect();switch(i){case J.EDITOR_TOP_SIDE:if(e){let t="ltr"===this.locale.contentLanguageDirection?e.right-o.width-s:e.left+s;this.moveTo(t,e.top+s)}else this._moveOffScreen();break;case J.EDITOR_CENTER:e?this.moveTo(Math.round(e.left+e.width/2-o.width/2),Math.round(e.top+e.height/2-o.height/2)):this._moveOffScreen();break;case J.SCREEN_CENTER:this.moveTo(Math.round((t.width-o.width)/2),Math.round((t.height-o.height)/2));break;case J.EDITOR_TOP_CENTER:e?this.moveTo(Math.round(e.left+e.width/2-o.width/2),e.top+s):this._moveOffScreen();break;case J.EDITOR_BOTTOM_CENTER:e?this.moveTo(Math.round(e.left+e.width/2-o.width/2),e.bottom-o.height-s):this._moveOffScreen();break;case J.EDITOR_ABOVE_CENTER:e?this.moveTo(Math.round(e.left+e.width/2-o.width/2),e.top-o.height-s):this._moveOffScreen();break;case J.EDITOR_BELOW_CENTER:e?this.moveTo(Math.round(e.left+e.width/2-o.width/2),e.bottom+s):this._moveOffScreen()}}_getVisibleDomRootRect(e){let t=new o.UL(this._getCurrentDomRoot()).getVisible();return t&&(t=e.getIntersection(t))?t:null}_getDialogRect(){return new o.UL(this.element.firstElementChild)}_getViewportRect(){let e=new o.UL(o.global.window);if(this.isModal)return e;let t={top:0,bottom:0,left:0,right:0,...this._getViewportOffset()};return e.top+=t.top,e.height-=t.top,e.bottom-=t.bottom,e.height-=t.bottom,e.left+=t.left,e.right-=t.right,e.width-=t.left+t.right,e}_updateFocusCyclableItems(){let e=[];
1if(this.contentView)for(let t of this.contentView.children)j(t)&&e.push(t);this.actionsView&&e.push(this.actionsView),this.closeButtonView&&e.push(this.closeButtonView),e.forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element),j(e)&&"focusCycler"in e&&e.focusCycler instanceof K&&this._focusCycler.chain(e.focusCycler)})}_createCloseButton(){let e=new z(this.locale),t=this.locale.t;return e.set({label:t("Close"),tooltip:!0,icon:p.ci.cancel}),e.on("execute",()=>this.fire("close",{source:"closeButton"})),e}}class ei extends p.Sy{view;static _visibleDialogPlugin;_onHide;static get pluginName(){return"Dialog"}static get isOfficialPlugin(){return!0}constructor(e){super(e);let t=e.t;this._initShowHideListeners(),this._initFocusToggler(),this._initMultiRootIntegration(),this.set({id:null,isOpen:!1}),e.accessibility.addKeystrokeInfos({categoryId:"navigation",keystrokes:[{label:t("Move focus in and out of an active dialog window"),keystroke:"Ctrl+F6",mayRequireFn:!0}]})}destroy(){super.destroy(),this._unlockBodyScroll()}_initShowHideListeners(){this.on("show",(e,t)=>{this._show(t)}),this.on("show",(e,t)=>{t.onShow&&t.onShow(this)},{priority:"low"}),this.on("hide",()=>{ei._visibleDialogPlugin&&ei._visibleDialogPlugin._hide()}),this.on("hide",()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)},{priority:"low"})}_initFocusToggler(){let e=this.editor;e.keystrokes.set("Ctrl+F6",(t,i)=>{this.isOpen&&!this.view.isModal&&(this.view.focusTracker.isFocused?e.editing.view.focus():this.view.focus(),i())})}_initMultiRootIntegration(){let e=this.editor.model;e.document.on("change:data",()=>{if(this.view)for(let t of e.document.differ.getChangedRoots())t.state&&this.view.updatePosition()})}show(e){this.hide(),this.fire(`show:${e.id}`,e)}_show({id:e,icon:t,title:i,hasCloseButton:s=!0,content:o,actionButtons:r,className:n,isModal:l,position:a,onHide:c}){let h=this.editor;this.view=new et(h.locale,{getCurrentDomRoot:()=>h.editing.view.getDomRoot(h.model.document.selection.anchor.root.rootName),getViewportOffset:()=>h.ui.viewportOffset});let u=this.view;u.on("close",()=>{this.hide()}),h.ui.view.body.add(u),h.keystrokes.listenTo(u.element),a||(a=l?J.SCREEN_CENTER:J.EDITOR_CENTER),l&&this._lockBodyScroll(),u.set({position:a,_isVisible:!0,className:n,isModal:l}),u.setupParts({icon:t,title:i,hasCloseButton:s,content:o,actionButtons:r}),this.id=e,c&&(this._onHide=c),this.isOpen=!0,ei._visibleDialogPlugin=this}hide(){ei._visibleDialogPlugin&&ei._visibleDialogPlugin.fire(`hide:${ei._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;let e=this.editor,t=this.view;t.isModal&&this._unlockBodyScroll(),t.contentView&&t.contentView.reset(),e.ui.view.body.remove(t),e.ui.focusTracker.remove(t.element),e.keystrokes.stopListening(t.element),t.destroy(),e.editing.view.focus(),this.id=null,this.isOpen=!1,ei._visibleDialogPlugin=null}_lockBodyScroll(){document.documentElement.classList.add("ck-dialog-scroll-locked")}_unlockBodyScroll(){document.documentElement.classList.remove("ck-dialog-scroll-locked")}}class es extends z{_checkIconHolderView=new eo;constructor(e,t=new H){super(e,t),this.set({hasCheckSpace:!1,_hasCheck:this.isToggleable});let i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-list-item-button",i.if("isToggleable","ck-list-item-button_toggleable")]}}),this.bind("_hasCheck").to(this,"hasCheckSpace",this,"isToggleable",(e,t)=>e||t)}render(){super.render(),this._hasCheck&&this.children.add(this._checkIconHolderView,0),this._watchCheckIconHolderMount()}_watchCheckIconHolderMount(){this._checkIconHolderView.bind("isOn").to(this,"isOn",e=>this.isToggleable&&e),this.on("change:_hasCheck",(e,t,i)=>{let{children:s,_checkIconHolderView:o}=this;i?s.add(o,0):s.remove(o)})}}class eo extends M{children;_checkIconView=this._createCheckIconView();constructor(){super();let e=this.bindTemplate;this.children=this.createCollection(),this.set("isOn",!1),this.setTemplate({tag:"span",children:this.children,attributes:{class:["ck","ck-list-item-button__check-holder",e.to("isOn",e=>e?"ck-on":"ck-off")]}})}render(){super.render(),this.isOn&&this.children.add(this._checkIconView,0),this._watchCheckIconMount()}_watchCheckIconMount(){this.on("change:isOn",(e,t,i)=>{let{children:s,_checkIconView:o}=this;i&&!s.has(o)?s.add(o):!i&&s.has(o)&&s.remove(o)})}_createCheckIconView(){let e=new U;return e.content=p.ci.check,e.extendTemplate({attributes:{class:"ck-list-item-button__check-icon"}}),e}}class er extends es{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}class en extends M{id;constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${(0,o.hQ
1)()}`;let t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}}class el extends M{constructor(e,t){super(e);let i=e.t,s=new en;s.text=i("Help Contents. To close this dialog press ESC."),this.setTemplate({tag:"div",attributes:{class:["ck","ck-accessibility-help-dialog__content"],"aria-labelledby":s.id,role:"document",tabindex:-1},children:[(0,o.az)(document,"p",{},i("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(t.values())),s]})}focus(){this.element.focus()}_createCategories(e){return e.map(e=>{let t=[(0,o.az)(document,"h3",{},e.label),...Array.from(e.groups.values()).map(e=>this._createGroup(e)).flat()];return e.description&&t.splice(1,0,(0,o.az)(document,"p",{},e.description)),(0,o.az)(document,"section",{},t)})}_createGroup(e){let t=e.keystrokes.sort((e,t)=>e.label.localeCompare(t.label)).map(e=>this._createGroupRow(e)).flat(),i=[(0,o.az)(document,"dl",{},t)];return e.label&&i.unshift((0,o.az)(document,"h4",{},e.label)),i}_createGroupRow(e){var t;let i=this.locale.t,s=(0,o.az)(document,"dt"),r=(0,o.az)(document,"dd"),n="string"==typeof(t=e.keystroke)?[[t]]:"string"==typeof t[0]?[t]:t,l=[];for(let e of n)l.push(e.map(ea).join(""));return s.innerHTML=e.label,r.innerHTML=l.join(", ")+(e.mayRequireFn&&o.OB.isMac?` ${i("(may require <kbd>Fn</kbd>)")}`:""),[s,r]}}function ea(e){return(0,o.XU)(e).split("+").map(e=>`<kbd>${e}</kbd>`).join("+")}var ec='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10 6.628a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"/><path d="M8.5 9.125a.3.3 0 0 0-.253-.296L5.11 8.327a.75.75 0 1 1 .388-1.449l4.04.716c.267.072.624.08.893.009l4.066-.724a.75.75 0 1 1 .388 1.45l-3.132.5a.3.3 0 0 0-.253.296v1.357a.3.3 0 0 0 .018.102l1.615 4.438a.75.75 0 0 1-1.41.513l-1.35-3.71a.3.3 0 0 0-.281-.197h-.209a.3.3 0 0 0-.282.198l-1.35 3.711a.75.75 0 0 1-1.41-.513l1.64-4.509a.3.3 0 0 0 .019-.103V9.125Z"/><path clip-rule="evenodd" d="M10 18.5a8.5 8.5 0 1 1 0-17 8.5 8.5 0 0 1 0 17Zm0 1.5c5.523 0 10-4.477 10-10S15.523 0 10 0 0 4.477 0 10s4.477 10 10 10Z"/></svg>';class eh extends p.Sy{contentView=null;static get requires(){return[ei]}static get pluginName(){return"AccessibilityHelp"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.locale.t;e.ui.componentFactory.add("accessibilityHelp",()=>{let e=this._createButton(z);return e.set({tooltip:!0,withText:!1,label:t("Accessibility help")}),e}),e.ui.componentFactory.add("menuBar:accessibilityHelp",()=>{let e=this._createButton(er);return e.label=t("Accessibility"),e}),e.keystrokes.set("Alt+0",(e,t)=>{this._toggleDialog(),t()}),this._setupRootLabels()}_createButton(e){let t=this.editor,i=t.plugins.get("Dialog"),s=new e(t.locale);return s.set({keystroke:"Alt+0",icon:ec,isToggleable:!0}),s.on("execute",()=>this._toggleDialog()),s.bind("isOn").to(i,"id",e=>"accessibilityHelp"===e),s}_setupRootLabels(){let e=this.editor,t=e.editing.view,i=e.t;function s(e,t){let s=[t.getAttribute("aria-label"),i("Press %0 for help.",[(0,o.XU)("Alt+0")])].filter(e=>e).join(". ");e.setAttribute("aria-label",s,t)}e.ui.on("ready",()=>{t.change(e=>{for(let i of t.document.roots)s(e,i)}),e.on("addRoot",(i,o)=>{let r=e.editing.view.document.getRoot(o.rootName);t.change(e=>s(e,r))},{priority:"low"})})}_toggleDialog(){let e=this.editor,t=e.plugins.get("Dialog"),i=e.locale.t;this.contentView||(this.contentView=new el(e.locale,e.accessibility.keystrokeInfos)),"accessibilityHelp"===t.id?t.hide():t.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:i("Accessibility help"),icon:ec,hasCloseButton:!0,content:this.contentView})}}class eu extends g{locale;_bodyCollectionContainer;constructor(e,t=[]){super(t),this.locale=e}get bodyCollectionContainer(){return this._bodyCollectionContainer}attachToDom(){this._bodyCollectionContainer=new _({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection,role:"application"},children:this}).render();let e=document.querySelector(".ck-body-wrapper");e||(e=(0,o.az)(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(e)),e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();let e=document.querySelector(".ck-body-wrapper");e&&0==e.childElementCount&&e.remove()}}class ed extends z{toggleSwitchView;constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){let e=new M;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}class ep extends ef(es){}function ef(e){class t extends e{buttonView;_fileInputView;constructor(...e){super(...e),this.buttonView=this,this._fileInputView=new em(this.locale),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",()=>{this._fileInputView.open()}),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}return t}class em extends M{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);let t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}var ew='<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z"/></svg>';class eb extends M{buttonView;children;constructor(e,t){super(e);let i=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid",void 0),t&&this.children.addMany(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",i.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:i.if("isCollapsed","hidden"),"aria-labelledby":i.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.i
1d}focus(){this.buttonView.focus()}_createButtonView(){let e=new z(this.locale),t=e.bindTemplate;return e.set({withText:!0,icon:ew}),e.extendTemplate({attributes:{"aria-expanded":t.to("isOn",e=>String(e))}}),e.bind("label").to(this),e.bind("isOn").to(this,"isCollapsed",e=>!e),e.on("execute",()=>{this.isCollapsed=!this.isCollapsed}),e}}function eg(e,t){let i=e.t,s={Black:i("Black"),"Dim grey":i("Dim grey"),Grey:i("Grey"),"Light grey":i("Light grey"),White:i("White"),Red:i("Red"),Orange:i("Orange"),Yellow:i("Yellow"),"Light green":i("Light green"),Green:i("Green"),Aquamarine:i("Aquamarine"),Turquoise:i("Turquoise"),"Light blue":i("Light blue"),Blue:i("Blue"),Purple:i("Purple")};return t.map(e=>{let t=s[e.label];return t&&t!=e.label&&(e.label=t),e})}function e_(e){return e.map(ek).filter(e=>!!e)}function ek(e){return"string"==typeof e?{model:e,label:e,hasBorder:!1,view:{name:"span",styles:{color:e}}}:{model:e.color,label:e.label||e.color,hasBorder:void 0!==e.hasBorder&&e.hasBorder,view:{name:"span",styles:{color:`${e.color}`}}}}class ev extends z{constructor(e){super(e);let t=this.bindTemplate;this.set("color",void 0),this.set("hasBorder",!1),this.icon='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path class="ck-icon__fill" d="M16.935 5.328a2 2 0 0 1 0 2.829l-7.778 7.778a2 2 0 0 1-2.829 0L3.5 13.107a1.999 1.999 0 1 1 2.828-2.829l.707.707a1 1 0 0 0 1.414 0l5.658-5.657a2 2 0 0 1 2.828 0z"/><path d="M14.814 6.035 8.448 12.4a1 1 0 0 1-1.414 0l-1.413-1.415A1 1 0 1 0 4.207 12.4l2.829 2.829a1 1 0 0 0 1.414 0l7.778-7.778a1 1 0 1 0-1.414-1.415z"/></svg>',this.extendTemplate({attributes:{style:{backgroundColor:t.to("color",e=>o.OB.isMediaForcedColors?null:e)},class:["ck","ck-color-grid__tile",t.if("hasBorder","ck-color-selector__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}class eT extends M{columns;items;focusTracker;keystrokes;constructor(e,t){super(e);let i=t&&t.colorDefinitions?t.colorDefinitions:[];this.columns=t&&t.columns?t.columns:5;let s={gridTemplateColumns:`repeat( ${this.columns}, 1fr)`};this.set("selectedColor",void 0),this.items=this.createCollection(),this.focusTracker=new o.Rh,this.keystrokes=new o.VD,this.items.on("add",(e,t)=>{t.isOn=t.color===this.selectedColor}),i.forEach(e=>{let t=new ev;t.set({color:e.color,label:e.label,tooltip:!0,hasBorder:e.options.hasBorder}),t.on("execute",()=>{this.fire("execute",{value:e.color,hasBorder:e.options.hasBorder,label:e.label})}),this.items.add(t)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:s}}),this.on("change:selectedColor",(e,t,i)=>{for(let e of this.items)e.isOn=e.color===i})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){for(let e of(super.render(),this.items))this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element),G({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:this.columns,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}}function ey(e,t){if(!e)return"";let o=eV(e);if(!o)return"";if(o.space===t)return e;if(!Object.keys(s||(s=i.t(m,2))).includes(o.space))return"";let r=(s||(s=i.t(m,2)))[o.space][t];return r?function(e,t){switch(t){case"hex":return`#${e}`;case"rgb":return`rgb( ${e[0]}, ${e[1]}, ${e[2]} )`;case"hsl":return`hsl( ${e[0]}, ${e[1]}%, ${e[2]}% )`;case"hwb":return`hwb( ${e[0]}, ${e[1]}, ${e[2]} )`;case"lab":return`lab( ${e[0]}% ${e[1]} ${e[2]} )`;case"lch":return`lch( ${e[0]}% ${e[1]} ${e[2]} )`;default:return""}}(r("hex"===o.space?o.hexValue:o.values),t):""}function eV(e){if(e.startsWith("#")){let t=(0,f.Z)(e);return{space:"hex",values:t.values,hexValue:e,alpha:t.alpha}}let t=(0,f.Z)(e);return t.space?t:null}class eC extends M{fieldView;labelView;statusView;fieldWrapperChildren;constructor(e,t){super(e);
1let i=`ck-labeled-field-view-${(0,o.hQ)()}`,s=`ck-labeled-field-view-status-${(0,o.hQ)()}`;this.fieldView=t(this,i,s),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(s),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",(e,t)=>e||t);let r=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",r.to("class"),r.if("isEnabled","ck-disabled",e=>!e),r.if("isEmpty","ck-labeled-field-view_empty"),r.if("isFocused","ck-labeled-field-view_focused"),r.if("placeholder","ck-labeled-field-view_placeholder"),r.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){let t=new en(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){let t=new M(this.locale),i=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",e=>!e)],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),t}focus(e){this.fieldView.focus(e)}}class ex extends M{focusTracker;constructor(e){super(e),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("tabIndex",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.set("ariaLabel",void 0),this.focusTracker=new o.Rh,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);let t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),tabindex:t.to("tabIndex"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById"),"aria-label":t.to("ariaLabel")},on:{input:t.to((...e)=>{this.fire("input",...e),this._updateIsEmpty()}),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(e,t,i)=>{this._setDomElementValue(i),this._updateIsEmpty()})}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}reset(){this.value=this.element.value="",this._updateIsEmpty()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(e){this.element.value=e||0===e?e:""}}class eE extends ex{constructor(e){super(e),this.set("inputMode","text");let t=this.bindTemplate;this.extendTemplate({attributes:{inputmode:t.to("inputMode")}})}}class eO extends eE{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}class eI extends eE{constructor(e,{min:t,max:i,step:s}={}){super(e);let o=this.bindTemplate;this.set("min",t),this.set("max",i),this.set("step",s),this.extendTemplate({attributes:{type:"number",class:["ck-input-number"],min:o.to("min"),max:o.to("max"),step:o.to("step")}})}}class eB extends M{children;constructor(e){super(e);let t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",t.to("position",e=>`ck-dropdown__panel_${e}`),t.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:t.to(e=>{"input"!==e.target.tagName.toLocaleLowerCase()&&e.preventDefault()})}})}focus(){if(this.children.length){let e=this.children.first;"function"==typeof e.focus?e.focus():(0,o.KE)("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){let e=this.children.last;"function"==typeof e.focusLast?e.focusLast():e.focus()}}}class eP extends M{buttonView;panelView;focusTracker;keystrokes;listView;toolbarView;menuView;constructor(e,t,i){super(e);let s=this.bindTemplate;this.buttonView=t,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new o.VD,this.focusTracker=new o.Rh,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",s.to("class"),s.if("isEnabled","ck-disabled",e=>!e)],id:s.to("id"),"aria-describedby":s.to("ariaDescribedById")},children:[t,i]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":s.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.on("change:isOpen",(e,t,i)=>{if(i){if("auto"===this.panelPosition){let e=eP._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=e?e.name:this._panelPositions[0].name}else this.panelView.position=this.panelPosition}}),this.keystrokes.listenTo(this.element);let e=(e,t)=>
1{this.isOpen&&(this.isOpen=!1,t())};this.keystrokes.set("arrowdown",(e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())}),this.keystrokes.set("arrowright",(e,t)=>{this.isOpen&&t()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){let{south:e,north:t,southEast:i,southWest:s,northEast:o,northWest:r,southMiddleEast:n,southMiddleWest:l,northMiddleEast:a,northMiddleWest:c}=eP.defaultPanelPositions;return"rtl"!==this.locale.uiLanguageDirection?[i,s,n,l,e,o,r,a,c,t]:[s,i,l,n,e,r,o,c,a,t]}static defaultPanelPositions={south:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/2,name:"s"}),southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),southMiddleEast:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/4,name:"sme"}),southMiddleWest:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)*3/4,name:"smw"}),north:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/2,name:"n"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),northMiddleEast:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/4,name:"nme"}),northMiddleWest:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)*3/4,name:"nmw"})};static _getOptimalPosition=o.xZ}class eF extends z{arrowView;constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",e=>String(e))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){let e=new U;return e.content=ew,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}class eL extends M{children;constructor(e){super(e);let t=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",t.if("isVisible","ck-hidden",e=>!e)],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}}class eD extends M{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}class eA extends M{labelView;items;children;constructor(e,t=new en){super(e);let i=this.bindTemplate,s=new eS(e);this.set({label:"",isVisible:!0}),this.labelView=t,this.labelView.bind("text").to(this,"label"),this.children=this.createCollection(),this.children.addMany([this.labelView,s]),s.set({role:"group",ariaLabelledBy:t.id}),s.focusTracker.destroy(),s.keystrokes.destroy(),this.items=s.items,this.setTemplate({tag:"li",attributes:{role:"presentation",class:["ck","ck-list__group",i.if("isVisible","ck-hidden",e=>!e)]},children:this.children})}focus(){if(this.items){let e=this.items.find(e=>!(e instanceof eD));e&&e.focus()}}}class eS extends M{focusables;items;focusTracker;keystrokes;_focusCycler;_listItemGroupToChangeListeners=new WeakMap;constructor(e){super(e);let t=this.bindTemplate;this.focusables=new g,this.items=this.createCollection(),this.focusTracker=new o.Rh,this.keystrokes=new o.VD,this._focusCycler=new K({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",void 0),this.set("role",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],role:t.to("role"),"aria-label":t.to("ariaLabel"),"aria-labelledby":t.to("ariaLabelledBy")},children:this.items})}render(){for(let e of(super.render(),this.items))e instanceof eA?this._registerFocusableItemsGroup(e):e instanceof eL&&this._registerFocusableListItem(e);this.items.on("change",(e,t)=>{for(let e of t.removed)e instanceof eA?this._deregisterFocusableItemsGroup(e):e instanceof eL&&this._deregisterFocusableListItem(e);for(let e of Array.from(t.added).reverse())e instanceof eA?this._registerFocusableItemsGroup(e,t.index):this._registerFocusableListItem(e,t.index)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_registerFocusableListItem(e,t){this.focusTracker.add(e.element),this.focusables.add(e,t)}_deregisterFocusableListItem(e){this.focusTracker.remove(e.element),this.focusables.remove(e)}_getOnGroupItemsChangeCallback(e){return(t,i)=>{for(let e of i.removed)this._deregisterFocusableListItem(e);for(let t of Array.from(i.added).reverse())this._registerFocusableListItem(t,this.items.getIndex(e)+i.index)}}
1_registerFocusableItemsGroup(e,t){Array.from(e.items).forEach((e,i)=>{this._registerFocusableListItem(e,void 0!==t?t+i:void 0)});let i=this._getOnGroupItemsChangeCallback(e);this._listItemGroupToChangeListeners.set(e,i),e.items.on("change",i)}_deregisterFocusableItemsGroup(e){for(let t of e.items)this._deregisterFocusableListItem(t);e.items.off("change",this._listItemGroupToChangeListeners.get(e)),this._listItemGroupToChangeListeners.delete(e)}}let eM=(0,o.nn)("px"),eR={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}};class eN extends M{content;_pinWhenIsVisibleCallback;_resizeObserver;constructor(e){super(e);let t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,this._resizeObserver=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",e=>`ck-balloon-panel_${e}`),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",eM),left:t.to("left",eM)}},children:this.content})}destroy(){this.hide(),super.destroy()}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){let t=eW(e.target);if(t&&!(0,o.pn)(t))return!1;this.show();let i=eN.defaultPositions,s=Object.assign({},{element:this.element,positions:[i.southArrowNorth,i.southArrowNorthMiddleWest,i.southArrowNorthMiddleEast,i.southArrowNorthWest,i.southArrowNorthEast,i.northArrowSouth,i.northArrowSouthMiddleWest,i.northArrowSouthMiddleEast,i.northArrowSouthWest,i.northArrowSouthEast,i.viewportStickyNorth],limiter:o.global.document.body,fitInViewport:!0},e),r=eN._getOptimalPosition(s)||eR,n=parseInt(r.left),l=parseInt(r.top),a=r.name,{withArrow:c=!0}=r.config||{};return this.top=l,this.left=n,this.position=a,this.withArrow=c,!0}pin(e){this.unpin(),this._startPinning(e)&&(this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback))}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){if(!this.attachTo(e))return!1;let t=eW(e.target),i=e.limiter?eW(e.limiter):o.global.document.body;return this.listenTo(o.global.document,"scroll",(s,o)=>{let r=o.target,n=t&&r.contains(t),l=i&&r.contains(i);(n||l||!t||!i)&&this.attachTo(e)},{useCapture:!0}),this.listenTo(o.global.window,"resize",()=>{this.attachTo(e)}),!this._resizeObserver&&(t&&(0,o.Gs)(t)&&(t=t.parentElement),t&&(this._resizeObserver=new o.do(t,()=>{(0,o.pn)(t)||this.unpin()}))),!0}_stopPinning(){this.stopListening(o.global.document,"scroll"),this.stopListening(o.global.window,"resize"),this._resizeObserver&&(this._resizeObserver.destroy(),this._resizeObserver=null)}static generatePositions(e={}){let{sideOffset:t=eN.arrowSideOffset,heightOffset:i=eN.arrowHeightOffset,stickyVerticalOffset:s=eN.stickyVerticalOffset,config:o}=e;return{northWestArrowSouthWest:(e,i)=>({top:r(e,i),left:e.left-t,name:"arrow_sw",...o&&{config:o}}),northWestArrowSouthMiddleWest:(e,i)=>({top:r(e,i),left:e.left-.25*i.width-t,name:"arrow_smw",...o&&{config:o}}),northWestArrowSouth:(e,t)=>({top:r(e,t),left:e.left-t.width/2,name:"arrow_s",...o&&{config:o}}),northWestArrowSouthMiddleEast:(e,i)=>({top:r(e,i),left:e.left-.75*i.width+t,name:"arrow_sme",...o&&{config:o}}),northWestArrowSouthEast:(e,i)=>({top:r(e,i),left:e.left-i.width+t,name:"arrow_se",...o&&{config:o}}),northArrowSouthWest:(e,i)=>({top:r(e,i),left:e.left+e.width/2-t,name:"arrow_sw",...o&&{config:o}}),northArrowSouthMiddleWest:(e,i)=>({top:r(e,i),left:e.left+e.width/2-.25*i.width-t,name:"arrow_smw",...o&&{config:o}}),northArrowSouth:(e,t)=>({top:r(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s",...o&&{config:o}}),northArrowSouthMiddleEast:(e,i)=>({top:r(e,i),left:e.left+e.width/2-.75*i.width+t,name:"arrow_sme",...o&&{config:o}}),northArrowSouthEast:(e,i)=>
1({top:r(e,i),left:e.left+e.width/2-i.width+t,name:"arrow_se",...o&&{config:o}}),northEastArrowSouthWest:(e,i)=>({top:r(e,i),left:e.right-t,name:"arrow_sw",...o&&{config:o}}),northEastArrowSouthMiddleWest:(e,i)=>({top:r(e,i),left:e.right-.25*i.width-t,name:"arrow_smw",...o&&{config:o}}),northEastArrowSouth:(e,t)=>({top:r(e,t),left:e.right-t.width/2,name:"arrow_s",...o&&{config:o}}),northEastArrowSouthMiddleEast:(e,i)=>({top:r(e,i),left:e.right-.75*i.width+t,name:"arrow_sme",...o&&{config:o}}),northEastArrowSouthEast:(e,i)=>({top:r(e,i),left:e.right-i.width+t,name:"arrow_se",...o&&{config:o}}),southWestArrowNorthWest:e=>({top:n(e),left:e.left-t,name:"arrow_nw",...o&&{config:o}}),southWestArrowNorthMiddleWest:(e,i)=>({top:n(e),left:e.left-.25*i.width-t,name:"arrow_nmw",...o&&{config:o}}),southWestArrowNorth:(e,t)=>({top:n(e),left:e.left-t.width/2,name:"arrow_n",...o&&{config:o}}),southWestArrowNorthMiddleEast:(e,i)=>({top:n(e),left:e.left-.75*i.width+t,name:"arrow_nme",...o&&{config:o}}),southWestArrowNorthEast:(e,i)=>({top:n(e),left:e.left-i.width+t,name:"arrow_ne",...o&&{config:o}}),southArrowNorthWest:e=>({top:n(e),left:e.left+e.width/2-t,name:"arrow_nw",...o&&{config:o}}),southArrowNorthMiddleWest:(e,i)=>({top:n(e),left:e.left+e.width/2-.25*i.width-t,name:"arrow_nmw",...o&&{config:o}}),southArrowNorth:(e,t)=>({top:n(e),left:e.left+e.width/2-t.width/2,name:"arrow_n",...o&&{config:o}}),southArrowNorthMiddleEast:(e,i)=>({top:n(e),left:e.left+e.width/2-.75*i.width+t,name:"arrow_nme",...o&&{config:o}}),southArrowNorthEast:(e,i)=>({top:n(e),left:e.left+e.width/2-i.width+t,name:"arrow_ne",...o&&{config:o}}),southEastArrowNorthWest:e=>({top:n(e),left:e.right-t,name:"arrow_nw",...o&&{config:o}}),southEastArrowNorthMiddleWest:(e,i)=>({top:n(e),left:e.right-.25*i.width-t,name:"arrow_nmw",...o&&{config:o}}),southEastArrowNorth:(e,t)=>({top:n(e),left:e.right-t.width/2,name:"arrow_n",...o&&{config:o}}),southEastArrowNorthMiddleEast:(e,i)=>({top:n(e),left:e.right-.75*i.width+t,name:"arrow_nme",...o&&{config:o}}),southEastArrowNorthEast:(e,i)=>({top:n(e),left:e.right-i.width+t,name:"arrow_ne",...o&&{config:o}}),westArrowEast:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.left-t.width-i,name:"arrow_e",...o&&{config:o}}),eastArrowWest:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.right+i,name:"arrow_w",...o&&{config:o}}),viewportStickyNorth:(e,t,i,r)=>{let n=r||i;return!e.getIntersection(n)||n.height-e.height>s?null:{top:n.top+s,left:e.left+e.width/2-t.width/2,name:"arrowless",config:{withArrow:!1,...o}}}};function r(e,t){return e.top-t.height-i}function n(e){return e.bottom+i}}static arrowSideOffset=25;static arrowHeightOffset=10;static stickyVerticalOffset=20;static _getOptimalPosition=o.xZ;static defaultPositions=eN.generatePositions()}function eW(e){return(0,l.Z)(e)?e:(0,o.bR)(e)?e.commonAncestorContainer:"function"==typeof e?eW(e()):null}class eG extends M{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class eU extends M{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function eH(e){if(Array.isArray(e))return{items:e,removeItems:[]};let t={items:[],removeItems:[]};return e?{...t,...e}:t}let ez={alignLeft:p.ci.alignLeft,bold:p.ci.bold,importExport:p.ci.importExport,paragraph:p.ci.paragraph,plus:p.ci.plus,text:p.ci.text,threeVerticalDots:p.ci.threeVerticalDots,pilcrow:p.ci.pilcrow,dragIndicator:p.ci.dragIndicator};class e$ extends M{options;items;focusTracker;keystrokes;itemsView;children;focusables;_focusCycler;_behavior;constructor(e,t){var i;super(e);let s=this.bindTemplate,r=this.t;this.options=t||{},this.set("ariaLabel",r("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new o.Rh,this.keystrokes=new o.VD,this.set("class",void 0),this.set("isCompact",!1),this.itemsView=new eZ(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();let n="rtl"===e.uiLanguageDirection;this._focusCycler=new K({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[n?"arrowright":"arrowleft","arrowup"],focusNext:[n?"arrowleft":"arrowright","arrowdown"]}});let l=["ck","ck-toolbar",s.to("class"),s.if("isCompact","ck-toolbar_compact")];this.options.shouldGroupWhenFull&&this.options.isFloating&&l.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:l,role:"toolbar","aria-label":s.to("ariaLabel"),style:{maxWidth:s.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:(i=this,i.bindTemplate.to(e=>{e.target===i.element&&e.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new eq(this):new eK(this)}render(){for(let e of(super.render(),this.focusTracker.add(this.element),this.items))this.focusTracker.add(e);this.items.on("add",(e,t)=>{this.focusTracker.add(t)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t,i){this.items.addMany(this._buildItemsFromConfig(e,t,i))}_buildItemsFromConfig(e,t,i){let s=eH(e),o=i||s.removeItems;return this._cleanItemsConfiguration(s.items,t,o).map(e=>(0,n.Z)(e)?this._createNestedToolbarDropdown(e,t,o):"|"===e?new eG:"-"===e?new eU:t.create(e)).filter(e=>!!e)}_cleanItemsConfiguration(e,t,i){let s=e.filter((e,s,r)=>"|"===e||-1===i.indexOf(e)&&("-"===e?!this.options.shouldGroupWhenFull||((0,o.KE)("toolbarview-line-break-ignored-when-grouping-items",r),!1):!!((0,n.Z)(e)||t.has(e))||((0,o.KE)("toolbarview-item-unavailable",{item:e}),!1)));return this._cleanSeparatorsAndLineBreaks(s)}_cleanSeparatorsAndLineBreaks(e){let t=e=>"-"!==e&&"|"!==e,i=e.length,s=e.findIndex(t);if(-1===s)return[];let o=i-e.slice().reverse().findIndex(t);return e.slice(s,o).filter((e,i,s)=>!!t(e)||!(i>0&&s[i-1]===e))}_createNestedToolbarDropdown(e,t,i){let{label:s,icon:r,items:n,tooltip:l=!0,withText:a=!1}=e;if(!(n=this._cleanItemsConfiguration(n,t,i)).length)return null;
1let c=eX(this.locale);return s||(0,o.KE)("toolbarview-nested-toolbar-dropdown-missing-label",e),c.class="ck-toolbar__nested-toolbar-dropdown",c.buttonView.set({label:s,tooltip:l,withText:!!a}),!1!==r?c.buttonView.icon=ez[r]||r||p.ci.threeVerticalDots:c.buttonView.withText=!0,eY(c,()=>c.toolbarView._buildItemsFromConfig(n,t,i)),c}}class eZ extends M{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class eK{constructor(e){let t=e.bindTemplate;e.set("isVertical",!1),e.itemsView.children.bindTo(e.items).using(e=>e),e.focusables.bindTo(e.items).using(e=>j(e)?e:null),e.extendTemplate({attributes:{class:[t.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class eq{view;viewChildren;viewFocusables;viewItemsView;viewFocusTracker;viewLocale;ungroupedItems;groupedItems;groupedItemsDropdown;resizeObserver=null;cachedPadding=null;shouldUpdateGroupingOnNextResize=!1;viewElement;constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),e.itemsView.children.bindTo(this.ungroupedItems).using(e=>e),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),e.children.on("change",this._updateFocusCyclableItems.bind(this)),e.items.on("change",(e,t)=>{let i=t.index,s=Array.from(t.added);for(let e of t.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(e):this.ungroupedItems.remove(e);for(let e=i;e<i+s.length;e++){let t=s[e-i];e>this.ungroupedItems.length?this.groupedItems.add(t,e-this.ungroupedItems.length):this.ungroupedItems.add(t,e)}this._updateGrouping()}),e.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){let e;if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!(0,o.pn)(this.viewElement)){this.shouldUpdateGroupingOnNextResize=!0;return}let t=this.groupedItems.length;for(;this._areItemsOverflowing;)this._groupLastItem(),e=!0;if(!e&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==t&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;let e=this.viewElement,t=this.viewLocale.uiLanguageDirection,i=new o.UL(e.lastChild),s=new o.UL(e);if(!this.cachedPadding){let i=o.global.window.getComputedStyle(e);this.cachedPadding=Number.parseInt(i["ltr"===t?"paddingRight":"paddingLeft"])}return"ltr"===t?i.right>s.right-this.cachedPadding:i.left<s.left+this.cachedPadding}_enableGroupingOnResize(){let e;this.resizeObserver=new o.do(this.viewElement,t=>{(!e||e!==t.contentRect.width||this.shouldUpdateGroupingOnNextResize)&&(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new eG),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){let e=this.viewLocale,t=e.t,i=eX(e);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",eY(i,this.groupedItems),i.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:"rtl"===e.uiLanguageDirection?"se":"sw",icon:p.ci.threeVerticalDots}),i}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{j(e)&&this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}class ej extends M{children;actionView;arrowView;keystrokes;focusTracker;constructor(e,t){super(e);let i=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(t),this.arrowView=this._createArrowView(),this.keystrokes=new o.VD,this.focusTracker=new o.Rh,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",i.to("class"),i.if("isVisible","ck-hidden",e=>!e),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",(e,t)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),t())}),this.keystrokes.set("arrowleft",(e,t)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),t())})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(e){let t=e||new z;return e||t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){let e=new z,t=e.bindTemplate;return e.icon=ew,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",e=>String(e))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}}function eX(e,t=eF){let i="function"==typeof t?new t(e):t,s=new eB(e),r=new eP(e,i,s);return i.bind("isEnabled").to(r),i instanceof ej?i.arrowView.bind("isOn").to(r,"isOpen"):i.bind("isOn").to(r,"isOpen"),R({emitter:r,activator:()=>r.isRendered&&r.isOpen,callback:()=>{r.isOpen=!1},contextElements:()=>[r.element,...(function e(t){return[...t.elements,...t.externalViews.flatMap(t=>e(t.focusTracker))]})(r.focusTracker).filter(e=>!r.element.contains(e))]}),function(e){e.on("execute",t=>{t.source instanceof ed||(e.isOpen=!1)})}(r),function(e){e.focusTracker.on("change:isFocused",(t,i,s)=>{!s&&e.isOpen&&(e.isOpen=!1)})}(r),r.keystrokes.set("arrowdown",(e,t)=>{r.isOpen&&(r.panelView.focus(),t())}
1),r.keystrokes.set("arrowup",(e,t)=>{r.isOpen&&(r.panelView.focusLast(),t())}),function(e){e.on("change:isOpen",(t,i,s)=>{!s&&e.focusTracker.elements.some(e=>e.contains(o.global.document.activeElement))&&e.buttonView.focus()})}(r),function(e){e.on("change:isOpen",(t,i,s)=>{s&&e.panelView.focus()},{priority:"low"})}(r),r}function eY(e,t,i={}){e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.isOpen?eQ(e,t,i):e.once("change:isOpen",()=>eQ(e,t,i),{priority:"highest"}),i.enableActiveItemFocusOnDropdownOpen&&e1(e,()=>e.toolbarView.items.find(e=>e.isOn))}function eQ(e,t,i){let s=e.locale,o=s.t,r=e.toolbarView=new e$(s),n="function"==typeof t?t():t;r.ariaLabel=i.ariaLabel||o("Dropdown toolbar"),i.maxWidth&&(r.maxWidth=i.maxWidth),i.class&&(r.class=i.class),i.isCompact&&(r.isCompact=i.isCompact),i.isVertical&&(r.isVertical=!0),n instanceof g?r.items.bindTo(n).using(e=>e):r.items.addMany(n),e.panelView.children.add(r),e.focusTracker.add(r),r.items.delegate("execute").to(e)}function eJ(e,t,i={}){e.isOpen?e0(e,t,i):e.once("change:isOpen",()=>e0(e,t,i),{priority:"highest"}),e1(e,()=>e.listView.items.find(e=>e instanceof eL&&e.children.first.isOn))}function e0(e,t,i){let s=e.locale,o=e.listView=new eS(s),r="function"==typeof t?t():t;o.ariaLabel=i.ariaLabel,o.role=i.role,function e(t,i,s,o){i.on("change",()=>{let e=[...i].reduce((e,t)=>(t instanceof eL&&t.children.first instanceof es&&e.push(t.children.first),e),[]),t=e.some(e=>e.isToggleable);e.forEach(e=>{e.hasCheckSpace=t})}),i.bindTo(s).using(i=>{if("separator"===i.type)return new eD(o);if("group"===i.type){let s=new eA(o);return s.set({label:i.label}),e(t,s.items,i.items,o),s.items.delegate("execute").to(t),s}if("button"===i.type||"switchbutton"===i.type){let e;let t="menuitemcheckbox"===i.model.role||"menuitemradio"===i.model.role,s=new eL(o);return"button"===i.type?(e=new es(o)).set({isToggleable:t}):e=new ed(o),e.bind(...Object.keys(i.model)).to(i.model),e.delegate("execute").to(s),s.children.add(e),s}return null})}(e,o.items,r,s),e.panelView.children.add(o),o.items.delegate("execute").to(e)}function e1(e,t){e.on("change:isOpen",()=>{if(!e.isOpen)return;let i=t();i&&("function"==typeof i.focus?i.focus():(0,o.KE)("ui-dropdown-focus-child-on-open-child-missing-focus",{view:i}))},{priority:o.tA.low-10})}let e2=(e,t,i)=>{let s=new eO(e.locale);return s.set({id:t,ariaDescribedById:i}),s.bind("isReadOnly").to(e,"isEnabled",e=>!e),s.bind("hasError").to(e,"errorText",e=>!!e),s.on("input",()=>{e.errorText=null}),e.bind("isEmpty","isFocused","placeholder").to(s),s},e4=(e,t,i)=>{let s=new eI(e.locale);return s.set({id:t,ariaDescribedById:i,inputMode:"numeric"}),s.bind("isReadOnly").to(e,"isEnabled",e=>!e),s.bind("hasError").to(e,"errorText",e=>!!e),s.on("input",()=>{e.errorText=null}),e.bind("isEmpty","isFocused","placeholder").to(s),s},e3=(e,t,i)=>{let s=eX(e.locale);return s.set({id:t,ariaDescribedById:i}),s.bind("isEnabled").to(e),s};class e5 extends M{hexInputRow;_debounceColorPickerEvent;_config;constructor(e,t={}){super(e),this.set({color:"",_hexColor:""}),this.hexInputRow=this._createInputRow();let i=this.createCollection();t.hideInput||i.add(this.hexInputRow),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker"],tabindex:-1},children:i}),this._config=t,this._debounceColorPickerEvent=(0,a.Z)(e=>{this.set("color",e),this.fire("colorSelected",{color:this.color})},150,{leading:!0}),this.on("set:color",(e,t,i)=>{e.return=ey(i,this._config.format||"hsl")}),this.on("change:color",()=>{this._hexColor=e7(this.color)}),this.on("change:_hexColor",()=>{document.activeElement!==this.picker&&this.picker.setAttribute("color",this._hexColor),e7(this.color)!=e7(this._hexColor)&&(this.color=this._hexColor)})}render(){var e,t;if(super.render(),e="hex-color-picker",t=w.M,void 0===customElements.get(e)&&customElements.define(e,t),this.picker=o.global.document.createElement("hex-color-picker"),this.picker.setAttribute("class","hex-color-picker"),this.picker.setAttribute("tabindex","-1"),this._createSlidersView(),this.element){this.hexInputRow.element?this.element.insertBefore(this.picker,this.hexInputRow.element):this.element.appendChild(this.picker);let e=document.createElement("style");e.textContent='[role="slider"]:focus [part$="pointer"] {border: 1px solid #fff;outline: 1px solid var(--ck-color-focus-border);box-shadow: 0 0 0 2px #fff;}',this.picker.shadowRoot.appendChild(e)}this.picker.addEventListener("color-changed",e=>{let t=e.detail.value;this._debounceColorPickerEvent(t)})}focus(){!this._config.hideInput&&(o.OB.isGecko||o.OB.isiOS||o.OB.isSafari)&&this.hexInputRow.children.get(1).focus(),this.slidersView.first.focus()}_createSlidersView(){let e=[...this.picker.shadowRoot.children].filter(e=>"slider"===e.getAttribute("role")).map(e=>new e8(e));
1this.slidersView=this.createCollection(),e.forEach(e=>{this.slidersView.add(e)})}_createInputRow(){let e=this._createColorInput();return new e9(this.locale,e)}_createColorInput(){let e=new eC(this.locale,e2),{t}=this.locale;return e.set({label:t("HEX"),class:"color-picker-hex-input"}),e.fieldView.bind("value").to(this,"_hexColor",t=>e.isFocused?e.fieldView.value:t.startsWith("#")?t.substring(1):t),e.fieldView.on("input",()=>{let t=e.fieldView.element.value;if(t){let e=te(t);e&&this._debounceColorPickerEvent(e)}}),e}isValid(){let{t:e}=this.locale;return!!this._config.hideInput||(this.resetValidationStatus(),!!this.hexInputRow.getParsedColor()||(this.hexInputRow.inputView.errorText=e('Please enter a valid color (e.g. "ff0000").'),!1))}resetValidationStatus(){this.hexInputRow.inputView.errorText=null}}function e7(e){let t=function(e){if(!e)return"";let t=eV(e);return t?"hex"===t.space?t.hexValue:ey(e,"hex"):"#000"}(e);return t||(t="#000"),4===t.length&&(t="#"+[t[1],t[1],t[2],t[2],t[3],t[3]].join("")),t.toLowerCase()}class e8 extends M{constructor(e){super(),this.element=e}focus(){this.element.focus()}}class e6 extends M{constructor(e){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__hash-view"]},children:"#"})}}class e9 extends M{children;inputView;constructor(e,t){super(e),this.inputView=t,this.children=this.createCollection([new e6,this.inputView]),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__row"]},children:this.children})}getParsedColor(){return te(this.inputView.fieldView.element.value)}}function te(e){if(!e)return null;let t=e.trim().replace(/^#/,"");return[3,4,6,8].includes(t.length)&&/^(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/.test(t)?`#${t}`:null}class tt extends(0,o.Re)(o.FE){constructor(e){super(e),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",0===this.length)})}add(e,t){return this.find(t=>t.color===e.color)?this:super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}}class ti extends M{items;colorDefinitions;focusTracker;columns;documentColors;documentColorsCount;staticColorsGrid;documentColorsGrid;colorPickerButtonView;removeColorButtonView;_focusables;_documentColorsLabel;_removeButtonLabel;_colorPickerLabel;constructor(e,{colors:t,columns:i,removeButtonLabel:s,documentColorsLabel:o,documentColorsCount:r,colorPickerLabel:n,focusTracker:l,focusables:a}){super(e);let c=this.bindTemplate;this.set("isVisible",!0),this.focusTracker=l,this.items=this.createCollection(),this.colorDefinitions=t,this.columns=i,this.documentColors=new tt,this.documentColorsCount=r,this._focusables=a,this._removeButtonLabel=s,this._colorPickerLabel=n,this._documentColorsLabel=o,this.setTemplate({tag:"div",attributes:{class:["ck-color-grids-fragment",c.if("isVisible","ck-hidden",e=>!e)]},children:this.items}),this.removeColorButtonView=this._createRemoveColorButton(),this.items.add(this.removeColorButtonView)}updateDocumentColors(e,t){let i=e.document,s=this.documentColorsCount;for(let o of(this.documentColors.clear(),i.getRoots()))for(let i of e.createRangeIn(o).getItems())if(i.is("$textProxy")&&i.hasAttribute(t)&&(this._addColorToDocumentColors(i.getAttribute(t)),this.documentColors.length>=s))return}updateSelectedColors(){let e=this.documentColorsGrid,t=this.staticColorsGrid,i=this.selectedColor;t.selectedColor=i,e&&(e.selectedColor=i)}render(){if(super.render(),this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount){let e=_.bind(this.documentColors,this.documentColors),t=new M(this.locale);t.setTemplate({tag:"span",attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]},children:[{text:this._documentColorsLabel}]}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}this._createColorPickerButton(),this._addColorSelectorElementsToFocusTracker()}focus(){this.removeColorButtonView.focus()}destroy(){super.destroy()}addColorPickerButton(){this.colorPickerButtonView&&(this.items.add(this.colorPickerButtonView),this.focusTracker.add(this.colorPickerButtonView.element),this._focusables.add(this.colorPickerButtonView))}_addColorSelectorElementsToFocusTracker(){this.focusTracker.add(this.removeColorButtonView.element),this._focusables.add(this.removeColorButtonView),this.staticColorsGrid&&(this.focusTracker.add(this.staticColorsGrid.element),this._focusables.add(this.staticColorsGrid)),this.documentColorsGrid&&(this.focusTracker.add(this.documentColorsGrid.element),this._focusables.add(this.documentColorsGrid))}_createColorPickerButton(){this.colorPickerButtonView=new z,this.colorPickerButtonView.set({label:this._colorPickerLabel,withText:!0,icon:p.ci.colorPalette,class:"ck-color-selector__color-picker"}),this.colorPickerButtonView.on("execute",()=>{this.fire("colorPicker:show")})}_createRemoveColorButton(){let e=new z;return e.set({withText:!0,icon:p.ci.eraser,label:this._removeButtonLabel}),e.class="ck-color-selector__remove-color",e.on("execute",()=>{this.fire("execute",{value:null,source:"removeColorButton"})}),e.render(),e}_createStaticColorsGrid(){let e=new eT(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.on("execute",(e,t)=>{this.fire("execute",{value:t.value,source:"staticColorsGrid"})}),e}_createDocumentColorsGrid(){let e=_.bind(this.documentColors,this.documentColors),t=new eT(this.locale,{columns:this.columns});return t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using(e=>{let t=new ev;return t.set({color:e.color,hasBorder:e.options&&e.options.hasBorder}),e.label&&t.set({label:e.label,tooltip:!0}),t.on("execute",()=>{this.fire("execute",{value:e.color,source:"documentColorsGrid"})}),t}),this.documentColors.on("change:isEmpty",(e,i,s)=>{s&&(t.selectedColor=null)}),t}_addColorToDocumentColors(e){let t=this.colorDefinitions.find(t=>t.color===e);t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}}class ts extends M{items;colorPickerView;saveButtonView;cancelButtonView;actionBarView;focusTracker;keystrokes;_focusables;_colorPickerViewConfig;constructor(e,{focusTracker:t,focusables:i,keystrokes:s,colorPickerViewConfig:o}){super(e),this.items=this.createCollection(),this.focusTracker=t,this.keystrokes=s,this.set("isVisible",!1),this.set("selectedColor",void 0),this._focusables=i,this._colorPickerViewConfig=o;let r=this.bindTemplate,{saveButtonView:n,cancelButtonView:l}=this._createActionButtons();this.saveButtonView=n,this.cancelButtonView=l,this.actionBarView=this._createActionBarView({saveButtonView:n,cancelButtonView:l}),this.setTemplate({tag:"div",attributes:{class:["ck-color-picker-fragment",r.if("isVisible","ck-hidden",e=>!e)]},children:this.items})}render(){super.render();let e=new e5(this.locale,{...this._colorPickerViewConfig});this.colorPickerView=e,this.colorPickerView.render(),this.selectedColor&&(e.color=this.selectedColor),this.listenTo(this,"change:selectedColor",(t,i,s)=>{e.color=s}),this.items.add(this.colorPickerView),this.items.add(this.actionBarView),this._addColorPickersElementsToFocusTracker(),this._stopPropagationOnArrowsKeys(),this._executeOnEnterPress(),this._executeUponColorChange()}destroy(){super.destroy()}focus(){this.colorPickerView.focus()}resetValidationStatus(){this.colorPickerView.resetValidationStatus()}_executeOnEnterPress(){this.keystrokes.set("enter",e=>{this.isVisible&&this.focusTracker.focusedElement!==this.cancelButtonView.element&&this.colorPickerView.isValid()&&(this.fire("execute",{value:this.selectedColor}),e.stopPropagation(),e.preventDefault())})}_stopPropagationOnArrowsKeys(){let e=e=>e.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}_addColorPickersElementsToFocusTracker(){for(let e of this.colorPickerView.slidersView)this.focusTracker.add(e.element),this._focusables.add(e);let e=this.colorPickerView.hexInputRow.children.get(1);e.element&&(this.focusTracker.add(e.element),this._focusables.add(e)),this.focusTracker.add(this.saveButtonView.element),this._focusables.add(this.saveButtonView),this.focusTracker.add(this.cancelButtonView.element),this._focusables.add(this.cancelButtonView)}_createActionBarView({saveButtonView:e,cancelButtonView:t}){let i=new M,s=this.createCollection();return s.add(e),s.add(t),i.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector_action-bar"]},children:s}),i}_createActionButtons(){let e=this.locale,t=e.t,i=new z(e),s=new z(e);return i.set({icon:p.ci.check,class:"ck-button-save",type:"button",withText:!1,label:t("Accept")}),s.set({icon:p.ci.cancel,class:"ck-button-cancel",type:"button",withText:!1,label:t("Cancel")}),i.on("execute",()=>{this.colorPickerView.isValid()&&this.fire("execute",{source:"colorPickerSaveButton",value:this.selectedColor})}),s.on("execute",()=>{this.fire("colorPicker:cancel")}),{saveButtonView:i,cancelButtonView:s}}_executeUponColorChange(){this.colorPickerView.on("colorSelected",(e,t)=>{this.fire("execute",{value:t.color,source:"colorPicker"}),this.set("selectedColor",t.color)})}}class to extends M{focusTracker;keystrokes;items;colorGridsFragmentView;colorPickerFragmentView;_focusCycler;_focusables;_colorPickerViewConfig;constructor(e,{colors:t,columns:i,removeButtonLabel:s,documentColorsLabel:r,documentColorsCount:n,colorPickerLabel:l,colorPickerViewConfig:a}){super(e),this.items=this.createCollection(),this.focusTracker=new o.Rh,this.keystrokes=new o.VD,this._focusables=new g,this._colorPickerViewConfig=a,this._focusCycler=new K({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}
1),this.colorGridsFragmentView=new ti(e,{colors:t,columns:i,removeButtonLabel:s,documentColorsLabel:r,documentColorsCount:n,colorPickerLabel:l,focusTracker:this.focusTracker,focusables:this._focusables}),this.colorPickerFragmentView=new ts(e,{focusables:this._focusables,focusTracker:this.focusTracker,keystrokes:this.keystrokes,colorPickerViewConfig:a}),this.set("_isColorGridsFragmentVisible",!0),this.set("_isColorPickerFragmentVisible",!1),this.set("selectedColor",void 0),this.colorGridsFragmentView.bind("isVisible").to(this,"_isColorGridsFragmentVisible"),this.colorPickerFragmentView.bind("isVisible").to(this,"_isColorPickerFragmentVisible"),this.on("change:selectedColor",(e,t,i)=>{this.colorGridsFragmentView.set("selectedColor",i),this.colorPickerFragmentView.set("selectedColor",i)}),this.colorGridsFragmentView.on("change:selectedColor",(e,t,i)=>{this.set("selectedColor",i)}),this.colorPickerFragmentView.on("change:selectedColor",(e,t,i)=>{this.set("selectedColor",i)}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector"]},children:this.items})}render(){super.render(),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}appendUI(){this._appendColorGridsFragment(),this._colorPickerViewConfig&&this._appendColorPickerFragment()}showColorPickerFragment(){this.colorPickerFragmentView.colorPickerView&&!this._isColorPickerFragmentVisible&&(this._isColorPickerFragmentVisible=!0,this.colorPickerFragmentView.focus(),this.colorPickerFragmentView.resetValidationStatus(),this._isColorGridsFragmentVisible=!1)}showColorGridsFragment(){this._isColorGridsFragmentVisible||(this._isColorGridsFragmentVisible=!0,this.colorGridsFragmentView.focus(),this._isColorPickerFragmentVisible=!1)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}updateDocumentColors(e,t){this.colorGridsFragmentView.updateDocumentColors(e,t)}updateSelectedColors(){this.colorGridsFragmentView.updateSelectedColors()}_appendColorGridsFragment(){this.items.length||(this.items.add(this.colorGridsFragmentView),this.colorGridsFragmentView.delegate("execute").to(this),this.colorGridsFragmentView.delegate("colorPicker:show").to(this))}_appendColorPickerFragment(){2!==this.items.length&&(this.items.add(this.colorPickerFragmentView),this.colorGridsFragmentView.colorPickerButtonView&&this.colorGridsFragmentView.colorPickerButtonView.on("execute",()=>{this.showColorPickerFragment()}),this.colorGridsFragmentView.addColorPickerButton(),this.colorPickerFragmentView.delegate("execute").to(this),this.colorPickerFragmentView.delegate("colorPicker:cancel").to(this))}}class tr{editor;_components=new Map;constructor(e){this.editor=e}*names(){for(let e of this._components.values())yield e.originalName}add(e,t){this._components.set(tn(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new o.Bb("componentfactory-item-missing",this,{name:e});return this._components.get(tn(e)).callback(this.editor.locale)}has(e){return this._components.has(tn(e))}}function tn(e){return String(e).toLowerCase()}let tl="ck-tooltip";class ta extends(0,o.Xu)(){tooltipTextView;balloonPanelView;static defaultBalloonPositions=eN.generatePositions({heightOffset:5,sideOffset:13});_currentElementWithTooltip=null;_currentTooltipPosition=null;_mutationObserver=null;_pinTooltipDebounced;_unpinTooltipDebounced;_watchdogExcluded;static _editors=new Set;static _instance=null;constructor(e){if(super(),ta._editors.add(e),ta._instance)return ta._instance;ta._instance=this,this.tooltipTextView=new M(e.locale),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new eN(e.locale),this.balloonPanelView.class=tl,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=function(e){let t=new MutationObserver(()=>{e()});return{attach(e){t.observe(e,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){t.disconnect()}}}(()=>{this._updateTooltipPosition()}),this._pinTooltipDebounced=(0,a.Z)(this._pinTooltip,600),this._unpinTooltipDebounced=(0,a.Z)(this._unpinTooltip,400),this.listenTo(o.global.document,"keydown",this._onKeyDown.bind(this),{useCapture:!0}),this.listenTo(o.global.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(o.global.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(o.global.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(o.global.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(o.global.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(e){let t=e.ui.view&&e.ui.view.body;ta._editors.delete(e),this.stopListening(e.ui),t&&t.has(this.balloonPanelView)&&t.remove(this.balloonPanelView),ta._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),ta._instance=null)}static getPositioningFunctions(e){let t=ta.defaultBalloonPositions;return({s:[t.southArrowNorth,t.southArrowNorthEast,t.southArrowNorthWest],n:[t.northArrowSouth],e:[t.eastArrowWest],w:[t.westArrowEast],sw:[t.southArrowNorthEast],se:[t.southArrowNorthWest]})[e]}_onKeyDown(e,t){"Escape"===t.key&&this._currentElementWithTooltip&&(this._unpinTooltip(),t.stopPropagation())}_onEnterOrFocus(e,{target:t}){let i=tc(t);if(!i){"focus"===e.name&&this._unpinTooltip();return}i!==this._currentElementWithTooltip&&(this._unpinTooltip(),"focus"!==e.name||i.matches(":hover")?this._pinTooltipDebounced(i,th(i)):this._pinTooltip(i,th(i)))}_onLeaveOrBlur(e,{target:t,relatedTarget:i}){if("mouseleave"===e.name){if(!(0,l.Z)(t))return;let e=this.balloonPanelView.element,s=e&&(e===i||e.contains(i)),o=!s&&t===e;if(s){this._unpinTooltipDebounced.cancel();return}if(!o&&this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;let r=tc(t),n=tc(i);(o||r&&r!==n)&&this._unpinTooltipDebounced()}else{if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;this._unpinTooltipDebounced()}}_onScroll(e,{target:t}){!this._currentElementWithTooltip||t.contains(this.balloonPanelView.element)&&t.contains(this._currentElementWithTooltip)||this._unpinTooltip()}_pinTooltip(e,{text:t,position:i,cssClass:s}){this._unpinTooltip();let r=(0,o.Ps)(ta._editors.values()).ui.view.body;for(let o of(r.has(this.balloonPanelView)||r.add(this.balloonPanelView),this.tooltipTextView.text=t,this.balloonPanelView.class=[tl,s].filter(e=>e).join(" "),this.balloonPanelView.pin({target:e,positions:ta.getPositioningFunctions(i)}),this._mutationObserver.attach(e),ta._editors))this.listenTo(o.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=e,this._currentTooltipPosition=i}_unpinTooltip(){for(let e of(this._unpinTooltipDebounced.cancel(),this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin(),ta._editors))this.stopListening(e.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this.tooltipTextView.text="",this._mutationObserver.detach()}_updateTooltipPosition(){if(!this._currentElementWithTooltip)return;let e=th(this._currentElementWithTooltip);if(!(0,o.pn)(this._currentElementWithTooltip)||!e.text){this._unpinTooltip();return}this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:ta.getPositioningFunctions(e.position)})}}function tc(e){return(0,l.Z)(e)?e.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function th(e){return{text:e.dataset.ckeTooltipText,position:e.dataset.ckeTooltipPosition||"s",cssClass:e.dataset.ckeTooltipClass||""}}class tu extends(0,o.Xu)(){editor;_balloonView;_showBalloonThrottled;_lastFocusedEditableElement;constructor(e){super(),this.editor=e,this._balloonView=null,this._lastFocusedEditableElement=null,this._showBalloonThrottled=(0,c.Z)(this._showBalloon.bind(this),50,{leading:!0}),e.on("ready",this._handleEditorReady.bind(this))}destroy(){let e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){let e=this.editor;(e.config.get("ui.poweredBy.forceVisible")||"VALID"!==(0,o.Tx)(e.config.get("licenseKey")))&&e.ui.view&&(e.ui.focusTracker.on("change:isFocused",(e,t,i)=>{this._updateLastFocusedEditableElement(),i?this._showBalloon():this._hideBalloon()}),e.ui.focusTracker.on("change:focusedElement",(e,t,i)=>{this._updateLastFocusedEditableElement(),i&&this._showBalloon()}),e.ui.on("update",()=>{this._showBalloonThrottled()}))}_createBalloonView(){let e=this.editor,t=this._balloonView=new eN,i=tf(e),s=new td(e.locale,i.label);t.content.add(s),t.set({class:"ck-powered-by-balloon"}),e.ui.view.body.add(t),this._balloonView=t}_showBalloon(){if(!this._lastFocusedEditableElement)return;let e=function(e,t){let i=tf(e),s="right"===i.side?tp(t,i,(e,t)=>e.left+e.width-t.width-i.horizontalOffset):tp(t,i,e=>e.left+i.horizontalOffset);return{target:t,positions:[s]}}(this.editor,this._lastFocusedEditableElement);e&&(this._balloonView||this._createBalloonView(),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_updateLastFocusedEditableElement(){let e=this.editor,t=e.ui.focusTracker.isFocused,i=e.ui.focusTracker.focusedElement;if(!t||!i){this._lastFocusedEditableElement=null;return}let s=Array.from(e.ui.getEditableElementsNames()).map(t=>e.ui.getEditableElement(t));s.includes(i)?this._lastFocusedEditableElement=i:this._lastFocusedEditableElement=s[0]}}class td extends M{constructor(e,t){super(e);let i=new U,s=this.bindTemplate;i
vendor: 6,002 bytes, line 1
1.set({content:'<svg xmlns="http://www.w3.org/2000/svg" width="53" height="10" viewBox="0 0 53 10"><path fill="#1C2331" d="M31.724 1.492a15.139 15.139 0 0 0 .045 1.16 2.434 2.434 0 0 0-.687-.34 3.68 3.68 0 0 0-1.103-.166 2.332 2.332 0 0 0-1.14.255 1.549 1.549 0 0 0-.686.87c-.15.41-.225.98-.225 1.712 0 .939.148 1.659.444 2.161.297.503.792.754 1.487.754.452.015.9-.094 1.294-.316.296-.174.557-.4.771-.669l.14.852h1.282V.007h-1.623v1.485ZM31 6.496a1.77 1.77 0 0 1-.494.061.964.964 0 0 1-.521-.127.758.758 0 0 1-.296-.466 3.984 3.984 0 0 1-.093-.992 4.208 4.208 0 0 1 .098-1.052.753.753 0 0 1 .307-.477 1.08 1.08 0 0 1 .55-.122c.233-.004.466.026.69.089l.483.144v2.553c-.11.076-.213.143-.307.2a1.73 1.73 0 0 1-.417.189ZM35.68 0l-.702.004c-.322.002-.482.168-.48.497l.004.581c.002.33.164.493.486.49l.702-.004c.322-.002.481-.167.48-.496L36.165.49c-.002-.33-.164-.493-.486-.491ZM36.145 2.313l-1.612.01.034 5.482 1.613-.01-.035-5.482ZM39.623.79 37.989.8 38 2.306l-.946.056.006 1.009.949-.006.024 2.983c.003.476.143.844.419 1.106.275.26.658.39 1.148.387.132 0 .293-.01.483-.03.19-.02.38-.046.57-.08.163-.028.324-.068.482-.119l-.183-1.095-.702.004a.664.664 0 0 1-.456-.123.553.553 0 0 1-.14-.422l-.016-2.621 1.513-.01-.006-1.064-1.514.01-.01-1.503ZM46.226 2.388c-.41-.184-.956-.274-1.636-.27-.673.004-1.215.101-1.627.29-.402.179-.72.505-.888.91-.18.419-.268.979-.264 1.68.004.688.1 1.24.285 1.655.172.404.495.724.9.894.414.18.957.268 1.63.264.68-.004 1.224-.099 1.632-.284.4-.176.714-.501.878-.905.176-.418.263-.971.258-1.658-.004-.702-.097-1.261-.28-1.677a1.696 1.696 0 0 0-.888-.9Zm-.613 3.607a.77.77 0 0 1-.337.501 1.649 1.649 0 0 1-1.317.009.776.776 0 0 1-.343-.497 4.066 4.066 0 0 1-.105-1.02 4.136 4.136 0 0 1 .092-1.03.786.786 0 0 1 .337-.507 1.59 1.59 0 0 1 1.316-.008.79.79 0 0 1 .344.502c.078.337.113.683.105 1.03.012.343-.019.685-.092 1.02ZM52.114 2.07a2.67 2.67 0 0 0-1.128.278c-.39.191-.752.437-1.072.73l-.157-.846-1.273.008.036 5.572 1.623-.01-.024-3.78c.35-.124.646-.22.887-.286.26-.075.53-.114.8-.118l.45-.003.144-1.546-.286.001ZM22.083 7.426l-1.576-2.532a2.137 2.137 0 0 0-.172-.253 1.95 1.95 0 0 0-.304-.29.138.138 0 0 1 .042-.04 1.7 1.7 0 0 0 .328-.374l1.75-2.71c.01-.015.025-.028.024-.048-.01-.01-.021-.007-.031-.007L20.49 1.17a.078.078 0 0 0-.075.045l-.868 1.384c-.23.366-.46.732-.688 1.099a.108.108 0 0 1-.112.06c-.098-.005-.196-.001-.294-.002-.018 0-.038.006-.055-.007.002-.02.002-.039.005-.058a4.6 4.6 0 0 0 .046-.701V1.203c0-.02-.009-.032-.03-.03h-.033L16.93 1.17c-.084 0-.073-.01-.073.076v6.491c-.001.018.006.028.025.027h1.494c.083 0 .072.007.072-.071v-2.19c0-.055-.003-.11-.004-.166a3.366 3.366 0 0 0-.05-.417h.06c.104 0 .209.002.313-.002a.082.082 0 0 1 .084.05c.535.913 1.07 1.824 1.607 2.736a.104.104 0 0 0 .103.062c.554-.003 1.107-.002 1.66-.002l.069-.003-.019-.032-.188-.304ZM27.112 6.555c-.005-.08-.004-.08-.082-.08h-2.414c-.053 0-.106-.003-.159-.011a.279.279 0 0 1-.246-.209.558.558 0 0 1-.022-.15c0-.382 0-.762-.002-1.143 0-.032.007-.049.042-.044h2.504c.029.003.037-.012.034-.038V3.814c0-.089.013-.078-.076-.078h-2.44c-.07 0-.062.003-.062-.06v-.837c0-.047.004-.093.013-.14a.283.283 0 0 1 .241-.246.717.717 0 0 1 .146-.011h2.484c.024.002.035-.009.036-.033l.003-.038.03-.496c.01-.183.024-.365.034-.548.005-.085.003-.087-.082-.094-.218-.018-.437-.038-.655-.05a17.845 17.845 0 0 0-.657-.026 72.994 72.994 0 0 0-1.756-.016 1.7 1.7 0 0 0-.471.064 1.286 1.286 0 0 0-.817.655c-.099.196-.149.413-.145.633v3.875c0 .072.003.144.011.216a1.27 1.27 0 0 0 .711 1.029c.228.113.48.167.734.158.757-.005 1.515.002 2.272-.042.274-.016.548-.034.82-.053.03-.002.043-.008.04-.041-.008-.104-.012-.208-.019-.312a69.964 69.964 0 0 1-.05-.768ZM16.14 7.415l-.127-1.075c-.004-.03-.014-.04-.044-.037a13.125 13.125 0 0 1-.998.073c-.336.01-.672.02-1.008.016-.116-.001-.233-.014-.347-.039a.746.746 0 0 1-.45-.262c-.075-.1-.132-.211-.167-.33a3.324 3.324 0 0 1-.126-.773 9.113 9.113 0 0 1-.015-.749c0-.285.022-.57.065-.852.023-.158.066-.312.127-.46a.728.728 0 0 1 .518-.443 1.64 1.64 0 0 1 .397-.048c.628-.001 1.255.003 1.882.05.022.001.033-.006.036-.026l.003-.031.06-.55c.019-.177.036-.355.057-.532.004-.034-.005-.046-.04-.056a5.595 5.595 0 0 0-1.213-.21 10.783 10.783 0 0 0-.708-.02c-.24-.003-.48.01-.719.041a3.477 3.477 0 0 0-.625.14 1.912 1.912 0 0 0-.807.497c-.185.2-.33.433-.424.688a4.311 4.311 0 0 0-.24 1.096c-.031.286-.045.572-.042.86-.006.43.024.86.091 1.286.04.25.104.497.193.734.098.279.26.53.473.734.214.205.473.358.756.446.344.11.702.17 1.063.177a8.505 8.505 0 0 0 1.578-.083 6.11 6.11 0 0 0 .766-.18c.03-.008.047-.023.037-.057a.157.157 0 0 1-.003-.025Z"/><path fill="#AFE229" d="M6.016 6.69a1.592 1.592 0 0 0-.614.21c-.23.132-.422.32-.56.546-.044.072-.287.539-.287.539l-.836 1.528.009.006c.038.025.08.046.123.063.127.046.26.07.395.073.505.023 1.011-.007 1.517-.003.29.009.58.002.869-.022a.886.886 0 0 0 .395-.116.962.962 0 0 0 .312-.286c.056-.083.114-.163.164-.249.24-.408.48-.816.718-1.226.075-.128.148-.257.222-.386l.112-.192a1.07 1.07 0 0 0 .153-.518l-1.304.023s-1.258-.005-1.388.01Z"/><path fill="#771BFF" d="m2.848 9.044.76-1.39.184-.352c-.124-.067-.245-.14-.367-.21-.346-.204-.706-.384-1.045-.6a.984.984 0 0 1-.244-.207c-.108-.134-.136-.294-.144-.46-.021-.409-.002-.818-.009-1.227-.003-.195 0-.39.003-.585.004-.322.153-.553.427-.713l.833-.488c.22-.13.44-.257.662-.385.05-.029.105-.052.158-.077.272-.128.519-.047.76.085l.044.028c.123.06.242.125.358.196.318.178.635.357.952.537.095.056.187.117.275.184.194.144.254.35.266.578.016.284.007.569.006.853-.001.28.004.558 0 .838.592-.003 1.259 0 1.259 0l.723-.013c-.003-.292-.007-.584-.007-.876 0-.524.015-1.048-.016-1.571-.024-.42-.135-.8-.492-1.067a5.02 5.02 0 0 0-.506-.339A400.52 400.52 0 0 0 5.94.787C5.722.664 5.513.524 5.282.423 5.255.406 5.228.388 5.2.373 4.758.126 4.305-.026 3.807.21c-.097.046-.197.087-.29.14A699.896 699.896 0 0 0 .783 1.948c-.501.294-.773.717-.778 1.31-.004.36-.009.718-.001 1.077.016.754-.017 1.508.024 2.261.016.304.07.6.269.848.127.15.279.28.448.382.622.4 1.283.734 1.92 1.11l.183.109Z"/></svg>\n',isColorInherited:!1}),
1i.extendTemplate({attributes:{style:{width:"53px",height:"10px"}}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/powered-by-ckeditor/?utm_source=ckeditor&utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo",target:"_blank",tabindex:"-1"},children:[...t?[{tag:"span",attributes:{class:["ck","ck-powered-by__label"]},children:[t]}]:[],i],on:{dragstart:s.to(e=>e.preventDefault())}}]})}}function tp(e,t,i){return(s,r)=>{let n;let l=new o.UL(e);if(l.width<350||l.height<50)return null;n=("inside"===t.position?l.bottom-r.height:l.bottom-r.height/2)-t.verticalOffset;let a=i(l,r),c=s.clone().moveTo(a,n).getIntersection(r.clone().moveTo(a,n)).getVisible();return!c||c.getArea()<r.getArea()?null:{top:n,left:a,name:`position_${t.position}-side_${t.side}`,config:{withArrow:!1}}}}function tf(e){let t=e.config.get("ui.poweredBy"),i=t&&t.position||"border";return{position:i,label:"Powered by",verticalOffset:"inside"===i?5:0,horizontalOffset:5,side:"ltr"===e.locale.contentLanguageDirection?"right":"left",...t}}let tm={POLITE:"polite",ASSERTIVE:"assertive"};class tw{editor;view;constructor(e){this.editor=e,e.once("ready",()=>{for(let e of Object.values(tm))this.announce("",e)})}announce(e,t=tm.POLITE){let i=this.editor;if(!i.ui.view)return;this.view||(this.view=new tb(i.locale),i.ui.view.body.add(this.view));let{politeness:s,isUnsafeHTML:o}="string"==typeof t?{politeness:t}:t,r=this.view.regionViews.find(e=>e.politeness===s);r||(r=new tg(i,s),this.view.regionViews.add(r)),r.announce({announcement:e,isUnsafeHTML:o})}}class tb extends M{regionViews;constructor(e){super(e),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}}class tg extends M{politeness;_domConverter;_pruneAnnouncementsInterval;constructor(e,t){super(e.locale),this.setTemplate({tag:"div",attributes:{"aria-live":t,"aria-relevant":"additions"},children:[{tag:"ul",attributes:{class:["ck","ck-aria-live-region-list"]}}]}),e.on("destroy",()=>{null!==this._pruneAnnouncementsInterval&&(clearInterval(this._pruneAnnouncementsInterval),this._pruneAnnouncementsInterval=null)}),this.politeness=t,this._domConverter=e.data.htmlProcessor.domConverter,this._pruneAnnouncementsInterval=setInterval(()=>{this.element&&this._listElement.firstChild&&this._listElement.firstChild.remove()},5e3)}announce({announcement:e,isUnsafeHTML:t}){if(!e.trim().length)return;let i=document.createElement("li");t?this._domConverter.setContentOf(i,e):i.innerText=e,this._listElement.appendChild(i)}get _listElement(){return this.element.querySelector("ul")}}class t_ extends eL{constructor(e,t){super(e);let i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item"]},on:{mouseenter:i.to("mouseenter")}}),this.delegate("mouseenter").to(t)}}let tk={toggleMenusAndFocusItemsOnHover(e){e.on("menu:mouseenter",t=>{if(e.isFocusBorderEnabled||e.isOpen){if(e.isOpen)for(let i of e.menus){let e=t.path[0],s=e instanceof t_&&e.children.first===i;i.isOpen=(t.path.includes(i)||s)&&i.isEnabled}
1t.source.focus()}})},focusCycleMenusOnArrows(e){let t="rtl"===e.locale.uiLanguageDirection;function i(t,i){let s=e.children.getIndex(t),o=t.isOpen,r=e.children.length,n=e.children.get((s+r+i)%r);t.isOpen=!1,o&&(n.isOpen=!0),n.buttonView.focus()}e.on("menu:arrowright",e=>{i(e.source,t?-1:1)}),e.on("menu:arrowleft",e=>{i(e.source,t?1:-1)})},closeMenusWhenTheBarCloses(e){e.on("change:isOpen",()=>{e.isOpen||e.menus.forEach(e=>{e.isOpen=!1})})},closeMenuWhenAnotherOnTheSameLevelOpens(e){e.on("menu:change:isOpen",(t,i,s)=>{s&&e.menus.filter(e=>t.source.parentMenuView===e.parentMenuView&&t.source!==e&&e.isOpen).forEach(e=>{e.isOpen=!1})})},closeOnClickOutside(e){R({emitter:e,activator:()=>e.isOpen,callback:()=>e.close(),contextElements:()=>e.children.map(e=>e.element)})},enableFocusHighlightOnInteraction(e){let t=!1;e.on("change:isOpen",(i,s,o)=>{o||(t||(e.isFocusBorderEnabled=!1),t=!1)}),e.listenTo(e.element,"keydown",()=>{t=!0},{useCapture:!0}),e.listenTo(e.element,"keyup",()=>{t=!1},{useCapture:!0}),e.listenTo(e.element,"focus",()=>{t&&(e.isFocusBorderEnabled=!0)},{useCapture:!0})}},tv={openAndFocusPanelOnArrowDownKey(e){e.keystrokes.set("arrowdown",(t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())})},openOnArrowRightKey(e){let t="rtl"===e.locale.uiLanguageDirection?"arrowleft":"arrowright";e.keystrokes.set(t,(t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&e.isEnabled&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())})},openOnButtonClick(e){e.buttonView.on("execute",()=>{e.isOpen=!0})},toggleOnButtonClick(e){e.buttonView.on("execute",()=>{e.isOpen=!e.isOpen})},openAndFocusOnEnterKeyPress(e){e.keystrokes.set("enter",(t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen=!0,e.panelView.focus(),i())})},closeOnArrowLeftKey(e){let t="rtl"===e.locale.uiLanguageDirection?"arrowright":"arrowleft";e.keystrokes.set(t,(t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())})},closeOnEscKey(e){e.keystrokes.set("esc",(t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())})},closeOnParentClose(e){e.parentMenuView.on("change:isOpen",(t,i,s)=>{s||t.source!==e.parentMenuView||(e.isOpen=!1)})}},tT={southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),eastSouth:e=>({top:e.top,left:e.right-5,name:"es"}),eastNorth:(e,t)=>({top:e.top-t.height,left:e.right-5,name:"en"}),westSouth:(e,t)=>({top:e.top,left:e.left-t.width+5,name:"ws"}),westNorth:(e,t)=>({top:e.top-t.height,left:e.left-t.width+5,name:"wn"})},ty=[{menuId:"file",label:"File",groups:[{groupId:"export",items:["menuBar:exportPdf","menuBar:exportWord"]},{groupId:"import",items:["menuBar:importWord"]},{groupId:"revisionHistory",items:["menuBar:revisionHistory"]}]},{menuId:"edit",label:"Edit",groups:[{groupId:"undo",items:["menuBar:undo","menuBar:redo"]},{groupId:"selectAll",items:["menuBar:selectAll"]},{groupId:"findAndReplace",items:["menuBar:findAndReplace"]}]},{menuId:"view",label:"View",groups:[{groupId:"sourceEditing",items:["menuBar:sourceEditing"]},{groupId:"showBlocks",items:["menuBar:showBlocks"]},{groupId:"previewMergeFields",items:["menuBar:previewMergeFields"]},{groupId:"restrictedEditing",items:["menuBar:restrictedEditing"]}]},{menuId:"insert",label:"Insert",groups:[{groupId:"insertMainWidgets",items:["menuBar:insertImage","menuBar:ckbox","menuBar:ckfinder","menuBar:insertTable"]},{groupId:"insertInline",items:["menuBar:link","menuBar:comment","menuBar:insertMergeField"]},{groupId:"insertMinorWidgets",items:["menuBar:mediaEmbed","menuBar:insertTemplate","menuBar:specialCharacters","menuBar:blockQuote","menuBar:codeBlock","menuBar:htmlEmbed"]},{groupId:"insertStructureWidgets",items:["menuBar:horizontalLine","menuBar:pageBreak","menuBar:tableOfContents"]},{groupId:"restrictedEditingException",items:["menuBar:restrictedEditingException"]}]},{menuId:"format",label:"Format",groups:[{groupId:"textAndFont",items:[{menuId:"text",label:"Text",groups:[{groupId:"basicStyles",items:["menuBar:bold","menuBar:italic","menuBar:underline","menuBar:strikethrough","menuBar:superscript","menuBar:subscript","menuBar:code"]},{groupId:"textPartLanguage",items:["menuBar:textPartLanguage"]}]},{menuId:"font",label:"Font",groups:[{groupId:"fontProperties",items:["menuBar:fontSize","menuBar:fontFamily"]}
1,{groupId:"fontColors",items:["menuBar:fontColor","menuBar:fontBackgroundColor"]},{groupId:"highlight",items:["menuBar:highlight"]}]},"menuBar:heading"]},{groupId:"list",items:["menuBar:bulletedList","menuBar:numberedList","menuBar:multiLevelList","menuBar:todoList"]},{groupId:"indent",items:["menuBar:alignment","menuBar:indent","menuBar:outdent"]},{groupId:"caseChange",items:["menuBar:caseChange"]},{groupId:"removeFormat",items:["menuBar:removeFormat"]}]},{menuId:"tools",label:"Tools",groups:[{groupId:"aiTools",items:["menuBar:aiAssistant","menuBar:aiCommands"]},{groupId:"tools",items:["menuBar:trackChanges","menuBar:commentsArchive"]}]},{menuId:"help",label:"Help",groups:[{groupId:"help",items:["menuBar:accessibilityHelp"]}]}];function tV(e,t,i){let s=[];if(0!=i.length){for(let e of i){var r;let i=(r=e.position).startsWith("start")?"start":r.startsWith("end")?"end":r.startsWith("after")?"after":"before",o=function(e){let t=e.match(/^[^:]+:(.+)/);return t?t[1]:null}(e.position);if("object"==typeof e&&"menu"in e){if(o){let r=t.items.findIndex(e=>e.menuId===o);-1!=r?"before"===i?(t.items.splice(r,0,e.menu),s.push(e)):"after"===i&&(t.items.splice(r+1,0,e.menu),s.push(e)):tC(t,e.menu,o,i)&&s.push(e)}else"start"===i?(t.items.unshift(e.menu),s.push(e)):"end"===i&&(t.items.push(e.menu),s.push(e))}else"object"==typeof e&&"group"in e?tE(t.items,t=>{if(t.menuId===o)"start"===i?(t.groups.unshift(e.group),s.push(e)):"end"===i&&(t.groups.push(e.group),s.push(e));else{let r=t.groups.findIndex(e=>e.groupId===o);-1!==r&&("before"===i?(t.groups.splice(r,0,e.group),s.push(e)):"after"===i&&(t.groups.splice(r+1,0,e.group),s.push(e)))}}):tC(t,e.item,o,i)&&s.push(e)}for(let t of i)s.includes(t)||(0,o.KE)("menu-bar-item-could-not-be-added",{menuBarConfig:e,addedItemConfig:t})}}function tC(e,t,i,s){let o=!1;return tE(e.items,e=>{for(let{groupId:r,items:n}of e.groups){if(o)return;if(r===i)"start"===s?(n.unshift(t),o=!0):"end"===s&&(n.push(t),o=!0);else{let e=n.findIndex(e=>tO(e)===i);-1!==e&&("before"===s?(n.splice(e,0,t),o=!0):"after"===s&&(n.splice(e+1,0,t),o=!0))}}}),o}function tx(e,t,i){i||(0,o.KE)("menu-bar-menu-empty",{menuBarConfig:e,emptyMenuConfig:t})}function tE(e,t){if(Array.isArray(e))for(let i of e)!function e(i){for(let s of(t(i),i.groups))for(let t of s.items)tI(t)&&e(t)}(i)}function tO(e){return"string"==typeof e?e:e.menuId}function tI(e){return"object"==typeof e&&"menuId"in e}class tB extends(0,o.Re)(){editor;componentFactory;focusTracker;tooltipManager;poweredBy;ariaLiveAnnouncer;isReady=!1;_editableElementsMap=new Map;_focusableToolbarDefinitions=[];_extraMenuBarElements=[];_lastFocusedForeignElement=null;constructor(e){super();let t=e.editing.view;this.editor=e,this.componentFactory=new tr(e),this.focusTracker=new o.Rh,this.tooltipManager=new ta(e),this.poweredBy=new tu(e),this.ariaLiveAnnouncer=new tw(e),this.set("viewportOffset",this._readViewportOffsetFromConfig()),this.once("ready",()=>{this._bindBodyCollectionWithFocusTracker(),this.isReady=!0}),this.listenTo(t.document,"layoutChanged",this.update.bind(this)),this.listenTo(t,"scrollToTheSelection",this._handleScrollToTheSelection.bind(this)),this._initFocusTracking()}get element(){return null}update(){this.fire("update")}destroy(){for(let e of(this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor),this.poweredBy.destroy(),this._editableElementsMap.values()))e.ckeditorInstance=null,this.editor.keystrokes.stopListening(e);this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[]}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor),this.focusTracker.add(t);let i=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?i():this.once("ready",i)}removeEditableElement(e){let t=this._editableElementsMap.get(e);t&&(this._editableElementsMap.delete(e),this.editor.keystrokes.stopListening(t),this.focusTracker.remove(t),t.ckeditorInstance=null)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,t={}){e.isRendered?(this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)):e.once("render",()=>{this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)}),this._focusableToolbarDefinitions.push({toolbarView:e,options:t})}extendMenuBar(e){this._extraMenuBarElements.push(e)}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}_initMenuBar(e){var t;let i=e.element;this.focusTracker.add(i),this.editor.keystrokes.listenTo(i);let s="items"in(t=this.editor.config.get("menuBar")||{})&&t.items?{items:t.items,removeItems:[],addItems:[],isVisible:!0,isUsingDefaultConfig:!1,...t}:{items:(0,h.Z)(ty),addItems:[],removeItems:[],isVisible:!0,isUsingDefaultConfig:!0,...t};e.fillFromConfig(s,this.componentFactory,this._extraMenuBarElements),this.editor.keystrokes.set("Esc",(e,t)=>{i.contains(this.editor.ui.focusTracker.focusedElement)&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):this.editor.editing.view.focus(),t())}),this.editor.keystrokes.set("Alt+F9",(t,s)=>{i.contains(this.editor.ui.focusTracker.focusedElement)||(this._saveLastFocusedForeignElement(),e.isFocusBorderEnabled=!0,e.focus(),s())})}_readViewportOffsetFromConfig(){let e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;let i=e.config.get("toolbar.viewportTopOffset");return i?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:i}):{top:0}}_initFocusTracking(){let e;let t=this.editor;t.keystrokes.set("Alt+F10",(t,i)=>{this._saveLastFocusedForeignElement();let s=this._getCurrentFocusedToolbarDefinition();s&&e||(e=this._getFocusableCandidateToolbarDefinitions());for(let t=0;t<e.length;t++){let t=e.shift();if(e.push(t),t!==s&&this._focusFocusableCandidateToolbar(t)){s&&s.options.afterBlur&&s.options.afterBlur();break}}i()}),t.keystrokes.set("Esc",(e,i)=>{let s=this._getCurrentFocusedToolbarDefinition();s&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):t.editing.view.focus(),s.options.afterBlur&&s.options.afterBlur(),i())})}_saveLastFocusedForeignElement(){let e=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(e)&&!Array.from(this.editor.editing.view.domRoots.values()).includes(e)&&(this._lastFocusedForeignElement=e)}_getFocusableCandidateToolbarDefinitions(){let e=[];for(let t of this._focusableToolbarDefinitions){let{toolbarView:i,options:s}=t;((0,o.pn)(i.element)||s.beforeFocus)&&e.push(t)}return e.sort((e,t)=>
1tP(e)-tP(t)),e}_getCurrentFocusedToolbarDefinition(){for(let e of this._focusableToolbarDefinitions)if(e.toolbarView.element&&e.toolbarView.element.contains(this.focusTracker.focusedElement))return e;return null}_focusFocusableCandidateToolbar(e){let{toolbarView:t,options:{beforeFocus:i}}=e;return i&&i(),!!(0,o.pn)(t.element)&&(t.focus(),!0)}_handleScrollToTheSelection(e,t){let i={top:0,bottom:0,left:0,right:0,...this.viewportOffset};t.viewportOffset.top+=i.top,t.viewportOffset.bottom+=i.bottom,t.viewportOffset.left+=i.left,t.viewportOffset.right+=i.right}_bindBodyCollectionWithFocusTracker(){let e=this.view.body;for(let t of e)this.focusTracker.add(t.element);e.on("add",(e,t)=>{this.focusTracker.add(t.element)}),e.on("remove",(e,t)=>{this.focusTracker.remove(t.element)})}}function tP(e){let{toolbarView:t,options:i}=e,s=10;return(0,o.pn)(t.element)&&s--,i.isContextual&&s--,s}class tF extends M{body;menuBarView;constructor(e){super(e),this.body=new eu(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class tL extends tF{top;main;_voiceLabelView;constructor(e){super(e),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:e.uiLanguageDirection,lang:e.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){let e=this.t,t=new en;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class tD extends M{name=null;_editingView;_editableElement;_hasExternalElement;constructor(e,t,i){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){let e=this._editingView;function t(t){e.change(i=>{let s=e.document.getRoot(t.name);i.addClass(t.isFocused?"ck-focused":"ck-blurred",s),i.removeClass(t.isFocused?"ck-blurred":"ck-focused",s)})}e.isRenderingInProgress?function i(s){e.once("change:isRenderingInProgress",(e,o,r)=>{r?i(s):t(s)})}(this):t(this)}}class tA extends tD{_options;constructor(e,t,i,s={}){super(e,t,i),this._options=s,this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();let e=this._editingView;e.change(t=>{let i=e.document.getRoot(this.name);t.setAttribute("aria-label",this.getEditableAriaLabel(),i)})}getEditableAriaLabel(){let e=this.locale.t,t=this._options.label,i=this._editableElement,s=this.name;if("string"==typeof t)return t;if("object"==typeof t)return t[s];if("function"==typeof t)return t(this);if(i){let e=i.getAttribute("aria-label");if(e)return e}return e("Rich Text Editor. Editing area: %0",s)}}class tS extends M{constructor(e){super(e);let t=this.bindTemplate;this.setTemplate({tag:"iframe",attributes:{class:["ck","ck-reset_all"],sandbox:"allow-same-origin allow-scripts"},on:{load:t.to("loaded")}})}render(){return new Promise(e=>(this.on("loaded",e),super.render()))}}class tM extends p.eO{static get pluginName(){return"Notification"}static get isOfficialPlugin(){return!0}init(){this.on("show:warning",(e,t)=>{window.alert(t.message)},{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){let t=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class tR extends(0,o.Re)(){constructor(e,t){super(),t&&(0,u.Z)(this,t),e&&this.set(e)}}let tN=(0,o.nn)("px");class tW extends p.Sy{positionLimiter;visibleStack;_viewToStack=new Map;_idToStack=new Map;_view=null;_rotatorView=null;_fakePanelsView=null;static get pluginName(){return"ContextualBalloon"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.positionLimiter=()=>{let e=this.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},this.decorate("getPositionOptions"),this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}destroy(){super.destroy(),this._view&&this._view.destroy(),this._rotatorView&&this._rotatorView.destroy(),this._fakePanelsView&&this._fakePanelsView.destroy()}get view(){return this._view||this._createPanelView(),this._view}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this._view||this._createPanelView(),this.hasView(e.view))throw new o.Bb("contextualballoon-add-view-exist",[this,e]);let t=e.stackId||"main";if(!this._idToStack.has(t)){this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,(!this._visibleStack||e.singleViewMode)&&this.showStack(t);return}let i=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),i.set(e.view,e),this._viewToStack.set(e.view,i),i===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new o.Bb("contextualballoon-remove-view-not-exist",[this,e]);let t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(1===t.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),1===t.size?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition()}getPositionOptions(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:this.editor.ui.viewportOffset})),e}showStack(e){this.visibleStack=e;let t=this._idToStack.get(e);if(!t)throw new o.Bb("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new eN(this.editor.locale),this.editor.ui.view.body.add(this._view),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(t=>t[1]===e)[0]}_showNextStack(){let e=Array.from(this._idToStack.values()),t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){let e=Array.from(this._idToStack.values()),t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){let e=new tG(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>!t&&e>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(e,i)=>i<2?"":t("%0 of %1",[Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1,i])
1),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){let e=new tU(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>!t&&e>=2?Math.min(e-1,2):0),e.listenTo(this.view,"change:top",()=>e.updatePosition()),e.listenTo(this.view,"change:left",()=>e.updatePosition()),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:i=!0,singleViewMode:s=!1}){this.view.class=t,this.view.withArrow=i,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition(),s&&(this._singleViewMode=!0)}}class tG extends M{focusTracker;buttonPrevView;buttonNextView;content;constructor(e){super(e);let t=e.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new o.Rh,this.buttonPrevView=this._createButtonView(t("Previous"),p.ci.previousArrow),this.buttonNextView=this._createButtonView(t("Next"),p.ci.nextArrow),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",e=>e?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){let i=new z(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i}}class tU extends M{content;_balloonPanelView;constructor(e,t){super(e);let i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",e=>e?"":"ck-hidden")],style:{top:i.to("top",tN),left:i.to("left",tN),width:i.to("width",tN),height:i.to("height",tN)}},children:this.content}),this.on("change:numberOfPanels",(e,t,i,s)=>{i>s?this._addPanels(i-s):this._removePanels(s-i),this.updatePosition()})}_addPanels(e){for(;e--;){let e=new M;e.setTemplate({tag:"div"}),this.content.add(e),this.registerChild(e)}}_removePanels(e){for(;e--;){let e=this.content.last;this.content.remove(e),this.deregisterChild(e),e.destroy()}}updatePosition(){if(this.numberOfPanels){let{top:e,left:t}=this._balloonPanelView,{width:i,height:s}=new o.UL(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:s})}}}let tH=(0,o.nn)("px");class tz extends M{content;contentPanelElement;_contentPanelPlaceholder;constructor(e){super(e);let t=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheBottomOfLimiter",!1),this.set("_stickyTopOffset",null),this.set("_stickyBottomOffset",null),this.content=this.createCollection(),this._contentPanelPlaceholder=new _({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",e=>e?"block":"none"),height:t.to("isSticky",e=>e?tH(this._contentPanelRect.height):null)}}}).render(),this.contentPanelElement=new _({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",t.if("isSticky","ck-sticky-panel__content_sticky"),t.if("_isStickyToTheBottomOfLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:t.to("isSticky",e=>e?tH(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_stickyTopOffset",e=>e?tH(e):e),bottom:t.to("_stickyBottomOffset",e=>e?tH(e):e),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this.contentPanelElement]}
1)}render(){super.render(),this.checkIfShouldBeSticky(),this.listenTo(o.global.document,"scroll",()=>{this.checkIfShouldBeSticky()},{useCapture:!0}),this.listenTo(this,"change:isActive",()=>{this.checkIfShouldBeSticky()})}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive){this._unstick();return}let e=new o.UL(this.limiterElement),t=e.getVisible();if(t){let e=new o.UL(o.global.window);e.top+=this.viewportTopOffset,e.height-=this.viewportTopOffset,t=t.getIntersection(e)}if(t&&e.top<t.top){let i=t.top;if(i+this._contentPanelRect.height+this.limiterBottomOffset>t.bottom){let i=Math.max(e.bottom-t.bottom,0)+this.limiterBottomOffset;e.bottom-i>e.top+this._contentPanelRect.height?this._stickToBottomOfLimiter(i):this._unstick()}else this._contentPanelRect.height+this.limiterBottomOffset<e.height?this._stickToTopOfAncestors(i):this._unstick()}else this._unstick()}_stickToTopOfAncestors(e){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=e,this._stickyBottomOffset=null,this._marginLeft=tH(-o.global.window.scrollX)}_stickToBottomOfLimiter(e){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!0,this._stickyTopOffset=null,this._stickyBottomOffset=e,this._marginLeft=tH(-o.global.window.scrollX)}_unstick(){this.isSticky=!1,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=null,this._stickyBottomOffset=null,this._marginLeft=null}get _contentPanelRect(){return new o.UL(this.contentPanelElement)}}class t$ extends eC{iconView;resetButtonView;_viewConfig;constructor(e,t){let i=e.t,s=Object.assign({},{showResetButton:!0,showIcon:!0,creator:e2},t);super(e,s.creator),this.label=t.label,this._viewConfig=s,this._viewConfig.showIcon&&(this.iconView=new U,this.iconView.content=p.ci.loupe,this.fieldWrapperChildren.add(this.iconView,0),this.extendTemplate({attributes:{class:"ck-search__query_with-icon"}})),this._viewConfig.showResetButton&&(this.resetButtonView=new z(e),this.resetButtonView.set({label:i("Clear"),icon:p.ci.cancel,class:"ck-search__reset",isVisible:!1,tooltip:!0}),this.resetButtonView.on("execute",()=>{this.reset(),this.focus(),this.fire("reset")}),this.resetButtonView.bind("isVisible").to(this.fieldView,"isEmpty",e=>!e),this.fieldWrapperChildren.add(this.resetButtonView),this.extendTemplate({attributes:{class:"ck-search__query_with-reset"}}))}reset(){this.fieldView.reset(),this._viewConfig.showResetButton&&(this.resetButtonView.isVisible=!1)}}class tZ extends M{constructor(){super();let e=this.bindTemplate;this.set({isVisible:!1,primaryText:"",secondaryText:""}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-search__info",e.if("isVisible","ck-hidden",e=>!e)],tabindex:-1},children:[{tag:"span",children:[{text:[e.to("primaryText")]}]},{tag:"span",children:[{text:[e.to("secondaryText")]}]}]})}focus(){this.element.focus()}}class tK extends M{focusTracker;children;_focusCycler;constructor(e){super(e),this.children=this.createCollection(),this.focusTracker=new o.Rh,this.setTemplate({tag:"div",attributes:{class:["ck","ck-search__results"],tabindex:-1},children:this.children}),this._focusCycler=new K({focusables:this.children,focusTracker:this.focusTracker})}render(){for(let e of(super.render(),this.children))this.focusTracker.add(e.element)}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class tq extends M{focusTracker;keystrokes;resultsView;filteredView;infoView;queryView;focusCycler;_config;constructor(e,t){super(e),this._config=t,this.filteredView=t.filteredView,this.queryView=this._createSearchTextQueryView(),this.focusTracker=new o.Rh,this.keystrokes=new o.VD,this.resultsView=new tK(e),this.children=this.createCollection(),this.focusableChildren=this.createCollection([this.queryView,this.resultsView]),this.set("isEnabled",!0),this.set("resultsCount",0),this.set("totalItemsCount",0),t.infoView&&t.infoView.instance?this.infoView=t.infoView.instance:(this.infoView=new tZ,this._enableDefaultInfoViewBehavior(),this.on("render",()=>{this.search("")})),this.resultsView.children.addMany([this.infoView,this.filteredView]),this.focusCycler=new K({focusables:this.focusableChildren,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.on("search",(e,{resultsCount:t,totalItemsCount:i})=>{this.resultsCount=t,this.totalItemsCount=i}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-search",t.class||null],tabindex:"-1"},children:this.children})}render(){super.render(),this.children.addMany([this.queryView,this.resultsView]);let e=e=>e.stopPropagation();for(let e of this.focusableChildren)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}focus(){this.queryView.focus()}reset(){this.queryView.reset(),this.search(""),this.filteredView.element.scrollTo(0,0)}search(e){let t=e?RegExp((0,d.Z)(e),"ig"):null,i=this.filteredView.filter(t);this.fire("search",{query:e,...i})}_createSearchTextQueryView(){let e=new t$(this.locale,this._config.queryView);return this.listenTo(e.fieldView,"input",()=>{this.search(e.fieldView.element.value)}),e.on("reset",()=>this.reset()),e.bind("isEnabled").to(this),e}_enableDefaultInfoViewBehavior(){let e=this.locale.t,t=this.infoView;function i(e,{query:t,resultsCount:i,totalItemsCount:s}){return"function"==typeof e?e(t,i,s):e}this.on("search",(s,o)=>
1{if(o.resultsCount)t.set({isVisible:!1});else{let s,r;let n=this._config.infoView&&this._config.infoView.text;o.totalItemsCount?n&&n.notFound?(s=n.notFound.primary,r=n.notFound.secondary):(s=e("No results found"),r=""):n&&n.noSearchableItems?(s=n.noSearchableItems.primary,r=n.noSearchableItems.secondary):(s=e("No searchable items"),r=""),t.set({primaryText:i(s,o),secondaryText:i(r,o),isVisible:!0})}})}}class tj extends tq{_config;constructor(e,t){super(e,t),this._config=t;let i=(0,o.nn)("px");this.extendTemplate({attributes:{class:["ck-autocomplete"]}});let s=this.resultsView.bindTemplate;this.resultsView.set("isVisible",!1),this.resultsView.set("_position","s"),this.resultsView.set("_width",0),this.resultsView.extendTemplate({attributes:{class:[s.if("isVisible","ck-hidden",e=>!e),s.to("_position",e=>`ck-search__results_${e}`)],style:{width:s.to("_width",i)}}}),this.focusTracker.on("change:isFocused",(e,i,s)=>{this._updateResultsVisibility(),s?this.resultsView.element.scrollTop=0:t.resetOnBlur&&this.queryView.reset()}),this.on("search",()=>{this._updateResultsVisibility(),this._updateResultsViewWidthAndPosition()}),this.keystrokes.set("esc",(e,t)=>{this.resultsView.isVisible&&(this.queryView.focus(),this.resultsView.isVisible=!1,t())}),this.listenTo(o.global.document,"scroll",()=>{this._updateResultsViewWidthAndPosition()}),this.on("change:isEnabled",()=>{this._updateResultsVisibility()}),this.filteredView.on("execute",(e,{value:t})=>{this.focus(),this.reset(),this.queryView.fieldView.value=this.queryView.fieldView.element.value=t,this.resultsView.isVisible=!1}),this.resultsView.on("change:isVisible",()=>{this._updateResultsViewWidthAndPosition()})}_updateResultsViewWidthAndPosition(){if(!this.resultsView.isVisible)return;this.resultsView._width=new o.UL(this.queryView.fieldView.element).width;let e=tj._getOptimalPosition({element:this.resultsView.element,target:this.queryView.element,fitInViewport:!0,positions:tj.defaultResultsPositions});this.resultsView._position=e?e.name:"s"}_updateResultsVisibility(){let e=void 0===this._config.queryMinChars?0:this._config.queryMinChars,t=this.queryView.fieldView.element.value.length;this.resultsView.isVisible=this.focusTracker.isFocused&&this.isEnabled&&t>=e}static defaultResultsPositions=[e=>({top:e.bottom,left:e.left,name:"s"}),(e,t)=>({top:e.top-t.height,left:e.left,name:"n"})];static _getOptimalPosition=o.xZ}let tX=(0,o.nn)("px");class tY extends p.Sy{toolbarView;focusTracker;_balloonConfig;_resizeObserver=null;_balloon;_fireSelectionChangeDebounced;static get pluginName(){return"BalloonToolbar"}static get isOfficialPlugin(){return!0}static get requires(){return[tW]}constructor(e){super(e),this._balloonConfig=eH(e.config.get("balloonToolbar")),this.toolbarView=this._createToolbarView(),this.focusTracker=new o.Rh,this._trackFocusableEditableElements(),this.focusTracker.add(this.toolbarView),e.ui.addToolbar(this.toolbarView,{beforeFocus:()=>this.show(!0),afterBlur:()=>this.hide(),isContextual:!0}),this._balloon=e.plugins.get(tW),this._fireSelectionChangeDebounced=(0,a.Z)(()=>this.fire("_selectionChangeDebounced"),200),this.decorate("show")}init(){let e=this.editor,t=e.model.document.selection;this.listenTo(this.focusTracker,"change:isFocused",(e,t,i)=>{let s=this._balloon.visibleView===this.toolbarView;!i&&s?this.hide():i&&this.show()}),this.listenTo(t,"change:range",(e,i)=>{(i.directChange||t.isCollapsed)&&this.hide(),this._fireSelectionChangeDebounced()}),this.listenTo(this,"_selectionChangeDebounced",()=>{this.editor.editing.view.document.isFocused&&this.show()}),this._balloonConfig.shouldNotGroupWhenFull||this.listenTo(e,"ready",()=>{let t=e.ui.view.editable.element;this._resizeObserver=new o.do(t,e=>{this.toolbarView.maxWidth=tX(.9*e.contentRect.width)})}),this.listenTo(this.toolbarView,"groupedItemsUpdate",()=>{this._updatePosition()}),e.ui.once("ready",()=>{this.toolbarView.fillFromConfig(this._balloonConfig,this.editor.ui.componentFactory)})}_createToolbarView(){let e=this.editor.locale.t,t=!this._balloonConfig.shouldNotGroupWhenFull,i=new e$(this.editor.locale,{shouldGroupWhenFull:t,isFloating:!0});return i.ariaLabel=e("Editor contextual toolbar"),i.render(),i}show(e=!1){let t=this.editor,i=t.model.document.selection,s=t.model.schema;!(this._balloon.hasView(this.toolbarView)||i.isCollapsed&&!e||1!==i.rangeCount&&[...i.getRanges()].every(e=>{let t=e.getContainedElement();return t&&s.isSelectable(t)})||Array.from(this.toolbarView.items).every(e=>void 0!==e.isEnabled&&!e.isEnabled))&&(this.listenTo(this.editor.ui,"update",()=>{this._updatePosition()}),this._balloon.add({view:this.toolbarView,position:this._getBalloonPositionData(),balloonClassName:"ck-toolbar-container"}))}hide(){this._balloon.hasView(this.toolbarView)&&(this.stopListening(this.editor.ui,"update"),this._balloon.remove(this.toolbarView))}_trackFocusableEditableElements(){let{editor:e,focusTracker:t}=this,{editing:i}=e;i.view.addObserver(class extends b.Qj{observe(e){t.add(e)}stopObserving(e){t.remove(e)}})}_getBalloonPositionData(){let e=this.editor.editing.view,t=e.document,i=t.selection,s=t.selection.isBackward;return{target:()=>{let t=s?i.getFirstRange():i.getLastRange(),r=o.UL.getDomRangeRects(e.domConverter.viewRangeToDom(t));return s?r[0]:(r.length>1&&0===r[r.length-1].width&&r.pop(),r[r.length-1])},positions:this._getBalloonPositions(s)}}_updatePosition(){this._balloon.updatePosition(this._getBalloonPositionData())}destroy(){super.destroy(),this.stopListening(),this._fireSelectionChangeDebounced.cancel(),this.toolbarView.destroy(),this.focusTracker.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}_getBalloonPositions(e){let t=o.OB.isSafari&&o.OB.isiOS?eN.generatePositions({heightOffset:Math.max(eN.arrowHeightOffset,Math.round(20/o.global.window.visualVie
1wport.scale))}):eN.defaultPositions;return e?[t.northWestArrowSouth,t.northWestArrowSouthWest,t.northWestArrowSouthEast,t.northWestArrowSouthMiddleEast,t.northWestArrowSouthMiddleWest,t.southWestArrowNorth,t.southWestArrowNorthWest,t.southWestArrowNorthEast,t.southWestArrowNorthMiddleWest,t.southWestArrowNorthMiddleEast]:[t.southEastArrowNorth,t.southEastArrowNorthEast,t.southEastArrowNorthWest,t.southEastArrowNorthMiddleEast,t.southEastArrowNorthMiddleWest,t.northEastArrowSouth,t.northEastArrowSouthEast,t.northEastArrowSouthWest,t.northEastArrowSouthMiddleEast,t.northEastArrowSouthMiddleWest]}}class tQ extends es{arrowView;constructor(e){super(e);let t=this.bindTemplate;this.set({withText:!0,role:"menuitem"}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__button"],"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",e=>String(e)),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){let e=new U;return e.content=ew,e.extendTemplate({attributes:{class:"ck-menu-bar__menu__button__arrow"}}),e}}class tJ extends M{children;constructor(e){super(e);let t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-menu-bar__menu__panel",t.to("position",e=>`ck-menu-bar__menu__panel_position_${e}`),t.if("isVisible","ck-hidden",e=>!e)],tabindex:"-1"},children:this.children,on:{selectstart:t.to(e=>{"input"!==e.target.tagName.toLocaleLowerCase()&&e.preventDefault()})}})}focus(e=1){this.children.length&&(1===e?this.children.first.focus():this.children.last.focus())}}class t0 extends M{buttonView;panelView;focusTracker;keystrokes;constructor(e){super(e);let t=this.bindTemplate;this.buttonView=new tQ(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.panelView=new tJ(e),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new o.VD,this.focusTracker=new o.Rh,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("panelPosition","w"),this.set("class",void 0),this.set("parentMenuView",null),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar__menu",t.to("class"),t.if("isEnabled","ck-disabled",e=>!e),t.if("parentMenuView","ck-menu-bar__menu_top-level",e=>!e)]},children:[this.buttonView,this.panelView]})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.keystrokes.listenTo(this.element),tv.closeOnEscKey(this),this._repositionPanelOnOpen()}_attachBehaviors(){this.parentMenuView?(tv.openOnButtonClick(this),tv.openOnArrowRightKey(this),tv.closeOnArrowLeftKey(this),tv.openAndFocusOnEnterKeyPress(this),tv.closeOnParentClose(this)):(this._propagateArrowKeystrokeEvents(),tv.openAndFocusPanelOnArrowDownKey(this),tv.toggleOnButtonClick(this))}_propagateArrowKeystrokeEvents(){this.keystrokes.set("arrowright",(e,t)=>{this.fire("arrowright"),t()}),this.keystrokes.set("arrowleft",(e,t)=>{this.fire("arrowleft"),t()})}_repositionPanelOnOpen(){this.on("change:isOpen",(e,t,i)=>{if(!i)return;let s=t0._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=s?s.name:this._panelPositions[0].name})}focus(){this.buttonView.focus()}get _panelPositions(){let{southEast:e,southWest:t,northEast:i,northWest:s,westSouth:o,eastSouth:r,westNorth:n,eastNorth:l}=tT;return"ltr"===this.locale.uiLanguageDirection?this.parentMenuView?[r,l,o,n]:[e,t,i,s]:this.parentMenuView?[o,n,r,l]:[t,e,s,i]}static _getOptimalPosition=o.xZ}class t1 extends eS{constructor(e){super(e),this.role="menu",this.items.on("change",this._setItemsCheckSpace.bind(this))}_setItemsCheckSpace(){let e=Array.from(this.items).some(e=>{let t=t2(e);return t&&t.isToggleable});this.items.forEach(t=>{let i=t2(t);i&&(i.hasCheckSpace=e)})}}function t2(e){return e instanceof eL?e.children.map(e=>"object"==typeof e&&"buttonView"in e&&e.buttonView instanceof z?e.buttonView:e).find(e=>e instanceof es):null}class t4 extends ep{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}let t3=["mouseenter","arrowleft","arrowright","change:isOpen"];class t5 extends M{children;menus=[];constructor(e){super(e);let t=e.t,i=this.bindTemplate;this.set({isOpen:!1,isFocusBorderEnabled:!1}),this._setupIsOpenUpdater(),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar",i.if("isFocusBorderEnabled","ck-menu-bar_focus-border-enabled")],"aria-label":t("Editor menu bar"),role:"menubar"},children:this.children})}fillFromConfig(e,t,i=[]){let s=(function({normalizedConfig:e,locale:t,componentFactory:i,extraItems:s}){let r=(0,h.Z)(e);return tV(e,r,s),function(e,t){let i=t.removeItems,s=[];for(let r of(t.items=t.items.filter(({menuId:e})=>!i.includes(e)||(s.push(e),!1)),tE(t.items,e=>{for(let t of(e.groups=e.groups.filter(({groupId:e})=>!i.includes(e)||(s.push(e),!1)),e.groups))t.items=t.items.filter(e=>{let t=tO(e);return!i.includes(t)||(s.push(t),!1)})}),i))s.includes(r)||(0,o.KE)("menu-bar-item-could-not-be-removed",{menuBarConfig:e,itemName:r})}(e,r),tV(e,r,r.addItems),tE(r.items,t=>{for(let s of t.groups)s.items=s.items.filter(s=>{let n="string"==typeof s&&!i.has(s);return n&&!r.isUsingDefaultConfig&&(0,o.KE)("menu-bar-item-unavailable",{menuBarConfig:e,parentMenuConfig:(0,h.Z)(t),componentName:s}),!n})}),function e(t,i){let s=i.isUsingDefaultConfig,o=!1;if(i.items=i.items.filter(e=>!!e.groups.length||(tx(t,e,s),!1)),!i.items.length){tx(t,t,s);return}tE(i.items,e=>{for(let i of(e.groups=e.groups.filter(e=>!!e.items.length||(o=!0,!1)),e.groups))i.items=i.items.filter(e=>!tI(e)||!!e.groups.length||(tx(t,e,s),o=!0,!1))}),o&&e(t,i)}(e,r),function(e,t){let i=t.t,s={File:i({string:"File",id:"MENU_BAR_MENU_FILE"}),Edit:i({string:"Edit",id:"MENU_BAR_MENU_EDIT"}),View:i({string:"View",id:"MENU_BAR_MENU_VIEW"}),Insert:i({string:"Insert",id:"MENU_BAR_MENU_INSERT"}),Format:i({string:"Format",id:"MENU_BAR_MENU_FORMAT"}),Tools:i({string:"Tools",id:"MENU_BAR_MENU_TOOLS"}),Help:i({string:"Help",id:"MENU_BAR_MENU_HELP"}),Text:i({string:"Text",id:"MENU_BAR_MENU_TEXT"}),Font:i({string:"Font",id:"MENU_BAR_MENU_FONT"})};tE(e.items,e=>
1{e.label in s&&(e.label=s[e.label])})}(r,t),r})({normalizedConfig:e,locale:this.locale,componentFactory:t,extraItems:i}).items.map(e=>this._createMenu({componentFactory:t,menuDefinition:e}));this.children.addMany(s)}render(){super.render(),tk.toggleMenusAndFocusItemsOnHover(this),tk.closeMenusWhenTheBarCloses(this),tk.closeMenuWhenAnotherOnTheSameLevelOpens(this),tk.focusCycleMenusOnArrows(this),tk.closeOnClickOutside(this),tk.enableFocusHighlightOnInteraction(this)}focus(){this.children.first&&this.children.first.focus()}close(){for(let e of this.children)e.isOpen=!1}registerMenu(e,t=null){t?(e.delegate(...t3).to(t),e.parentMenuView=t):e.delegate(...t3).to(this,e=>"menu:"+e),e._attachBehaviors(),this.menus.push(e)}_createMenu({componentFactory:e,menuDefinition:t,parentMenuView:i}){let s=this.locale,o=new t0(s);return this.registerMenu(o,i),o.buttonView.set({label:t.label}),o.once("change:isOpen",()=>{let i=new t1(s);i.ariaLabel=t.label,o.panelView.children.add(i),i.items.addMany(this._createMenuItems({menuDefinition:t,parentMenuView:o,componentFactory:e}))}),o}_createMenuItems({menuDefinition:e,parentMenuView:t,componentFactory:i}){let s=this.locale,o=[];for(let r of e.groups){for(let e of r.items){let r=new t_(s,t);if((0,n.Z)(e))r.children.add(this._createMenu({componentFactory:i,menuDefinition:e,parentMenuView:t}));else{let s=this._createMenuItemContentFromFactory({componentName:e,componentFactory:i,parentMenuView:t});if(!s)continue;r.children.add(s)}o.push(r)}r!==e.groups[e.groups.length-1]&&o.push(new eD(s))}return o}_createMenuItemContentFromFactory({componentName:e,parentMenuView:t,componentFactory:i}){let s=i.create(e);return s instanceof t0||s instanceof er||s instanceof t4?(this._registerMenuTree(s,t),s.on("execute",()=>{this.close()}),s):((0,o.KE)("menu-bar-component-unsupported",{componentName:e,componentView:s}),null)}_registerMenuTree(e,t){if(!(e instanceof t0)){e.delegate("mouseenter").to(t);return}this.registerMenu(e,t);let i=e.panelView.children.filter(e=>e instanceof t1)[0];if(!i){e.delegate("mouseenter").to(t);return}for(let t of i.items.filter(e=>e instanceof eL))this._registerMenuTree(t.children.get(0),e)}_setupIsOpenUpdater(){let e;this.on("menu:change:isOpen",(t,i,s)=>{clearTimeout(e),s?this.isOpen=!0:e=setTimeout(()=>{this.isOpen=Array.from(this.children).some(e=>e.isOpen)},0)})}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.