????
Current Path : C:/inetpub/vhost/quypctt.nextform.vn/www/assets/ |
Current File : C:/inetpub/vhost/quypctt.nextform.vn/www/assets/DropdownList-92e339e1.js |
var ux=Object.defineProperty;var hx=(p,_,l)=>_ in p?ux(p,_,{enumerable:!0,configurable:!0,writable:!0,value:l}):p[_]=l;var ng=(p,_,l)=>(hx(p,typeof _!="symbol"?_+"":_,l),l);import{P as le,R as dr,j as A,r as X,K as vh,G as vg,N as nn,X as Ag,ad as fx,a8 as px,M as gx,T as Bt,p as f_,h as zn,l as _g,x as mx,m as _h,C as wh,ae as b0,af as v0}from"./index-3ac6b886.js";import{S as p_,m as bx,d as vx,h as _x,B as wx,e as kx,c as Sg,D as yx,f as xx}from"./DataSelect-21292454.js";import{B as Bn}from"./Button-d32d698a.js";import{F as Fn}from"./FontAwesome4-4d1c8e97.js";import{M as kl}from"./Modal-834c96f4.js";import{s as _0,c as w0,t as rk,a as fg,b as ok,d as k0,e as Cx,f as y0,g as Wv,h as sk,i as Tx,m as ak,j as Ax,k as xv,l as Sx}from"./function-c7c2f09a.js";import{C as wg,T as Ex}from"./TextArea-5c5d2643.js";import{I as aa,b as Px,c as Ix,F as Mx}from"./InputNumber-e0e8281b.js";import{R as Ox}from"./Required-a585e744.js";import{g as Nx,a as Rx,w as kh,I as Dx,b as jx,P as Lx}from"./InputTime-6c25e67a.js";import{N as zx,M as lk,a as ck,S as Bx,b as dk}from"./SelectCustom-a3812854.js";import{I as qv}from"./Input-a404c875.js";import{a as g_,i as Fx}from"./useTheme-cc71593c.js";import{_ as Vx}from"./classCallCheck-22a738c0.js";import{a as $x,c as x0}from"./withStyles-be05542d.js";import{b as Hx,_ as uk,a as Ux}from"./possibleConstructorReturn-b2959138.js";import{t as C0,m as T0,_ as Br}from"./utils-1da25c48.js";import{D as Wx,I as qx}from"./Dropdown-fd6014de.js";import"./Button-9ef33eb6.js";import"./SelectPanelMulti-30b66e05.js";import{R as Kx}from"./Row-ef702d16.js";import{w as A0}from"./capitalize-2c2e3657.js";import{D as Gx}from"./DataTable-4f7de56a.js";var Qx=["className","cssModule","tag"];function Kv(){return Kv=Object.assign?Object.assign.bind():function(p){for(var _=1;_<arguments.length;_++){var l=arguments[_];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(p[f]=l[f])}return p},Kv.apply(this,arguments)}function Yx(p,_){if(p==null)return{};var l=Xx(p,_),f,v;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(p);for(v=0;v<w.length;v++)f=w[v],!(_.indexOf(f)>=0)&&Object.prototype.propertyIsEnumerable.call(p,f)&&(l[f]=p[f])}return l}function Xx(p,_){if(p==null)return{};var l={},f=Object.keys(p),v,w;for(w=0;w<f.length;w++)v=f[w],!(_.indexOf(v)>=0)&&(l[v]=p[v]);return l}var Jx={className:le.string,cssModule:le.object,tag:C0};function Ch(p){var _=p.className,l=p.cssModule,f=p.tag,v=f===void 0?"div":f,w=Yx(p,Qx),b=T0(Br(_,"modal-footer"),l);return dr.createElement(v,Kv({},w,{className:b}))}Ch.propTypes=Jx;var Zx=["className","cssModule","tag","type","size"];function kg(){return kg=Object.assign?Object.assign.bind():function(p){for(var _=1;_<arguments.length;_++){var l=arguments[_];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(p[f]=l[f])}return p},kg.apply(this,arguments)}function eC(p,_){if(p==null)return{};var l=tC(p,_),f,v;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(p);for(v=0;v<w.length;v++)f=w[v],!(_.indexOf(f)>=0)&&Object.prototype.propertyIsEnumerable.call(p,f)&&(l[f]=p[f])}return l}function tC(p,_){if(p==null)return{};var l={},f=Object.keys(p),v,w;for(w=0;w<f.length;w++)v=f[w],!(_.indexOf(v)>=0)&&(l[v]=p[v]);return l}var nC={className:le.string,cssModule:le.object,size:le.string,tag:C0,type:le.string};function S0(p){var _=p.className,l=p.cssModule,f=p.tag,v=f===void 0?"div":f;p.type;var w=p.size,b=eC(p,Zx),T=T0(Br(_,"input-group",w?"input-group-".concat(w):null),l);return p.type==="dropdown"?dr.createElement(Wx,kg({},b,{className:T})):dr.createElement(qx.Provider,{value:{insideInputGroup:!0}},dr.createElement(v,kg({},b,{className:T})))}S0.propTypes=nC;const Eg=p=>{const{disabled:_,name:l,label:f,checked:v,type:w,children:b,hidden_label:T,...P}=p;return A.jsxs("label",{className:"radio me-0",children:[A.jsx("input",{...P,type:"radio",name:l,checked:v,disabled:_,className:"me-0",children:b}),!T&&A.jsx("span",{className:_?"disabled":"",children:f})]})};Eg.propTypes={};Eg.defaultProps={};class iC extends X.Component{constructor(_){super(_),this.state={value:null}}componentDidUpdate(_,l){this.props.value!==this.state.value&&this.setState({value:this.props.value})}render(){const{name:_,disabled:l,data:f}=this.props;return f&&f.map((v,w)=>A.jsx(Eg,{name:_,disabled:l||v.disabled,value:v.value,label:v.label,checked:this.state.value===v.value&&!v.disabled,onChange:b=>{this.state.value!==b.target.value&&(this.setState({value:b.target.value}),this.props.onChange(b.target.value))}},w))}}class E0 extends X.Component{constructor(_){super(_),this.state={checked:!1}}componentDidMount(){this.setState({checked:this.props.checked})}componentDidUpdate(_){this.props.checked!==this.state.checked&&this.setState({checked:this.props.checked})}render(){return A.jsxs("label",{className:"checkbox",children:[A.jsx("input",{type:"checkbox",disabled:this.props.disabled,checked:this.state.checked,onChange:_=>{this.setState({checked:_.target.checked}),this.props.onChange(_.target.checked)}}),A.jsx("span",{children:this.props.label})]})}}class rC extends X.Component{constructor(l){super(l);ng(this,"handleChange",(l,f)=>{let{selected:v}=this.state;var w=v.indexOf(l);w<0?v.push(l):v.splice(w,1),this.setState({selected:v}),this.props.onChange(v)});this.state={selected:[]}}componentDidUpdate(l,f){this.props.value!==this.state.selected&&this.setState({selected:this.props.value})}render(){const{name:l,disabled:f,data:v}=this.props;return v&&v.map((w,b)=>A.jsx(E0,{name:l,disabled:f||w.disabled,value:w.value,label:w.label,checked:this.state.selected&&this.state.selected.indexOf(w.value)>=0&&!w.disabled,onChange:T=>this.handleChange(w.value,T)},b))}}class m_ extends X.Component{render(){const{isDetail:_,value:l,invalid:f,onValueChange:v,onKeyDown:w,bsSize:b="sm",style:T,onBlur:P,onFocus:B,decimalScale:y,thousandSeparator:L,decimalSeparator:O,customInput:V,...F}=this.props;return _?A.jsx("div",{style:{textAlign:"right"},children:l===0||l===null?"":vh(l)}):A.jsx(zx,{...F,style:{textAlign:"right",...T},value:l,onValueChange:Z=>{v(Z)},onBlur:Z=>P&&P(Z),onKeyDown:w,onFocus:B,customInput:V||qv,bsSize:b,decimalScale:y||2,invalid:f})}}m_.defaultProps={placeholder:"Nhâp..."};m_.propTypes={placeholder:le.string};const oC=()=>{const p=new Date().getFullYear();let _=[];for(var l=p-5;l<=p+2;l++)_.push({value:l,label:`Năm ${l}`});return _},sC=p=>{let _=[],l=new Date().getFullYear(),f=l-2,v=l+5;p.minYear&&p.maxYear&&(f=p.minYear,v=p.maxYear);for(let w=f;w<=v;w++)_.push({value:w,label:w});return _};class b_ extends X.Component{render(){const{value:_,onChange:l,isDetail:f,disabled:v,options:w,generateOptions:b}=this.props,T=b?sC(b):oC(),P=_||"";return f?A.jsx("div",{style:{textAlign:"center"},children:P?"Năm "+P:""}):A.jsx(p_,{disabled:v,value:P,onChange:l,options:w||T,valueRef:"value",labelRef:"label",placeholder:"Chọn năm"})}}b_.propTypes={};b_.defaultProps={placeholder:"Chọn..."};class v_ extends X.Component{render(){const{value:_,onChange:l,disabled:f}=this.props,v=()=>{let w=[];for(var b=1;b<=12;b++)w.push({value:b,label:`Tháng ${b}`});return w};return A.jsx(p_,{disabled:f,value:_||"",onChange:l,options:v(),valueRef:"value",labelRef:"label",placeholder:"Chọn tháng"})}}v_.propTypes={};v_.defaultProps={placeholder:"Chọn..."};function aC(p){var _=lC();return function(){var f=uk(p),v;if(_){var w=uk(this).constructor;v=Reflect.construct(f,arguments,w)}else v=f.apply(this,arguments);return Ux(this,v)}}function lC(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}var cC={cacheOptions:!1,defaultOptions:!1,filterOption:null,isLoading:!1},dC=function(_){var l,f;return f=l=function(v){Hx(b,v);var w=aC(b);function b(T){var P;return Vx(this,b),P=w.call(this),P.select=void 0,P.lastRequest=void 0,P.mounted=!1,P.optionsCache={},P.handleInputChange=function(B,y){var L=P.props,O=L.cacheOptions,V=L.onInputChange,F=_x(B,y,V);if(!F){delete P.lastRequest,P.setState({inputValue:"",loadedInputValue:"",loadedOptions:[],isLoading:!1,passEmptyOptions:!1});return}if(O&&P.optionsCache[F])P.setState({inputValue:F,loadedInputValue:F,loadedOptions:P.optionsCache[F],isLoading:!1,passEmptyOptions:!1});else{var Z=P.lastRequest={};P.setState({inputValue:F,isLoading:!0,passEmptyOptions:!P.state.loadedInputValue},function(){P.loadOptions(F,function(G){P.mounted&&(G&&(P.optionsCache[F]=G),Z===P.lastRequest&&(delete P.lastRequest,P.setState({isLoading:!1,loadedInputValue:F,loadedOptions:G||[],passEmptyOptions:!1})))})})}return F},P.state={defaultOptions:Array.isArray(T.defaultOptions)?T.defaultOptions:void 0,inputValue:typeof T.inputValue<"u"?T.inputValue:"",isLoading:T.defaultOptions===!0,loadedOptions:[],passEmptyOptions:!1},P}return $x(b,[{key:"componentDidMount",value:function(){var P=this;this.mounted=!0;var B=this.props.defaultOptions,y=this.state.inputValue;B===!0&&this.loadOptions(y,function(L){if(P.mounted){var O=!!P.lastRequest;P.setState({defaultOptions:L||[],isLoading:O})}})}},{key:"UNSAFE_componentWillReceiveProps",value:function(P){P.cacheOptions!==this.props.cacheOptions&&(this.optionsCache={}),P.defaultOptions!==this.props.defaultOptions&&this.setState({defaultOptions:Array.isArray(P.defaultOptions)?P.defaultOptions:void 0})}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"loadOptions",value:function(P,B){var y=this.props.loadOptions;if(!y)return B();var L=y(P,B);L&&typeof L.then=="function"&&L.then(B,function(){return B()})}},{key:"render",value:function(){var P=this,B=this.props;B.loadOptions;var y=B.isLoading,L=g_(B,["loadOptions","isLoading"]),O=this.state,V=O.defaultOptions,F=O.inputValue,Z=O.isLoading,G=O.loadedInputValue,Q=O.loadedOptions,ne=O.passEmptyOptions,ee=ne?[]:F&&G?Q:V||[];return dr.createElement(_,vg({},L,{ref:function(re){P.select=re},options:ee,isLoading:Z||y,onInputChange:this.handleInputChange}))}}]),b}(X.Component),l.defaultProps=cC,f},uC=bx(vx),hC=dC(uC);const fC=hC;var yg={exports:{}};/*! * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. */yg.exports;(function(p,_){(function(l,f){p.exports=f(X)})(self,l=>(()=>{var f={703:(T,P,B)=>{var y=B(414);function L(){}function O(){}O.resetWarningCache=L,T.exports=function(){function V(G,Q,ne,ee,oe,re){if(re!==y){var be=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw be.name="Invariant Violation",be}}function F(){return V}V.isRequired=V;var Z={array:V,bigint:V,bool:V,func:V,number:V,object:V,string:V,symbol:V,any:V,arrayOf:F,element:V,elementType:V,instanceOf:F,node:V,objectOf:F,oneOf:F,oneOfType:F,shape:F,exact:F,checkPropTypes:O,resetWarningCache:L};return Z.PropTypes=Z,Z}},697:(T,P,B)=>{T.exports=B(703)()},414:T=>{T.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},787:T=>{T.exports=l}},v={};function w(T){var P=v[T];if(P!==void 0)return P.exports;var B=v[T]={exports:{}};return f[T](B,B.exports,w),B.exports}w.n=T=>{var P=T&&T.__esModule?()=>T.default:()=>T;return w.d(P,{a:P}),P},w.d=(T,P)=>{for(var B in P)w.o(P,B)&&!w.o(T,B)&&Object.defineProperty(T,B,{enumerable:!0,get:P[B]})},w.o=(T,P)=>Object.prototype.hasOwnProperty.call(T,P),w.r=T=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(T,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(T,"__esModule",{value:!0})};var b={};return(()=>{w.r(b),w.d(b,{CKEditor:()=>kr,CKEditorContext:()=>Ls});var T=w(787),P=w.n(T),B=w(697),y=w.n(B);const L=function(I){var M=typeof I;return I!=null&&(M=="object"||M=="function")},O=typeof nn=="object"&&nn&&nn.Object===Object&&nn;var V=typeof self=="object"&&self&&self.Object===Object&&self;const F=O||V||Function("return this")(),Z=function(){return F.Date.now()};var G=/\s/;const Q=function(I){for(var M=I.length;M--&&G.test(I.charAt(M)););return M};var ne=/^\s+/;const ee=function(I){return I&&I.slice(0,Q(I)+1).replace(ne,"")},oe=F.Symbol;var re=Object.prototype,be=re.hasOwnProperty,we=re.toString,Ae=oe?oe.toStringTag:void 0;const Ee=function(I){var M=be.call(I,Ae),$=I[Ae];try{I[Ae]=void 0;var te=!0}catch{}var Ce=we.call(I);return te&&(M?I[Ae]=$:delete I[Ae]),Ce};var Ne=Object.prototype.toString;const ie=function(I){return Ne.call(I)};var fe="[object Null]",_e="[object Undefined]",ve=oe?oe.toStringTag:void 0;const ke=function(I){return I==null?I===void 0?_e:fe:ve&&ve in Object(I)?Ee(I):ie(I)},Se=function(I){return I!=null&&typeof I=="object"};var Pe="[object Symbol]";const Oe=function(I){return typeof I=="symbol"||Se(I)&&ke(I)==Pe};var nt=NaN,$e=/^[-+]0x[0-9a-f]+$/i,De=/^0b[01]+$/i,et=/^0o[0-7]+$/i,Ie=parseInt;const He=function(I){if(typeof I=="number")return I;if(Oe(I))return nt;if(L(I)){var M=typeof I.valueOf=="function"?I.valueOf():I;I=L(M)?M+"":M}if(typeof I!="string")return I===0?I:+I;I=ee(I);var $=De.test(I);return $||et.test(I)?Ie(I.slice(2),$?2:8):$e.test(I)?nt:+I};var Ve="Expected a function",Re=Math.max,gt=Math.min;const rt=function(I,M,$){var te,Ce,Ge,Qe,tt,jt,Vt=0,Po=!1,Zn=!1,ge=!0;if(typeof I!="function")throw new TypeError(Ve);function Be(Cn){var di=te,Yr=Ce;return te=Ce=void 0,Vt=Cn,Qe=I.apply(Yr,di)}function yr(Cn){var di=Cn-jt;return jt===void 0||di>=M||di<0||Zn&&Cn-Vt>=Ge}function Lt(){var Cn=Z();if(yr(Cn))return ft(Cn);tt=setTimeout(Lt,function(di){var Yr=M-(di-jt);return Zn?gt(Yr,Ge-(di-Vt)):Yr}(Cn))}function ft(Cn){return tt=void 0,ge&&te?Be(Cn):(te=Ce=void 0,Qe)}function ci(){var Cn=Z(),di=yr(Cn);if(te=arguments,Ce=this,jt=Cn,di){if(tt===void 0)return function(Yr){return Vt=Yr,tt=setTimeout(Lt,M),Po?Be(Yr):Qe}(jt);if(Zn)return clearTimeout(tt),tt=setTimeout(Lt,M),Be(jt)}return tt===void 0&&(tt=setTimeout(Lt,M)),Qe}return M=He(M)||0,L($)&&(Po=!!$.leading,Ge=(Zn="maxWait"in $)?Re(He($.maxWait)||0,M):Ge,ge="trailing"in $?!!$.trailing:ge),ci.cancel=function(){tt!==void 0&&clearTimeout(tt),Vt=0,te=jt=Ce=tt=void 0},ci.flush=function(){return tt===void 0?Qe:ft(Z())},ci};var qe="Expected a function";const lt=function(I,M,$){var te=!0,Ce=!0;if(typeof I!="function")throw new TypeError(qe);return L($)&&(te="leading"in $?!!$.leading:te,Ce="trailing"in $?!!$.trailing:Ce),rt(I,M,{leading:te,maxWait:M,trailing:Ce})},Ye=function(){this.__data__=[],this.size=0},en=function(I,M){return I===M||I!=I&&M!=M},Vn=function(I,M){for(var $=I.length;$--;)if(en(I[$][0],M))return $;return-1};var xe=Array.prototype.splice;const Fe=function(I){var M=this.__data__,$=Vn(M,I);return!($<0)&&($==M.length-1?M.pop():xe.call(M,$,1),--this.size,!0)},St=function(I){var M=this.__data__,$=Vn(M,I);return $<0?void 0:M[$][1]},Et=function(I){return Vn(this.__data__,I)>-1},hn=function(I,M){var $=this.__data__,te=Vn($,I);return te<0?(++this.size,$.push([I,M])):$[te][1]=M,this};function Yn(I){var M=-1,$=I==null?0:I.length;for(this.clear();++M<$;){var te=I[M];this.set(te[0],te[1])}}Yn.prototype.clear=Ye,Yn.prototype.delete=Fe,Yn.prototype.get=St,Yn.prototype.has=Et,Yn.prototype.set=hn;const Sn=Yn,rn=function(){this.__data__=new Sn,this.size=0},Bi=function(I){var M=this.__data__,$=M.delete(I);return this.size=M.size,$},uo=function(I){return this.__data__.get(I)},ua=function(I){return this.__data__.has(I)};var $n="[object AsyncFunction]",bs="[object Function]",ur="[object GeneratorFunction]",wi="[object Proxy]";const ho=function(I){if(!L(I))return!1;var M=ke(I);return M==bs||M==ur||M==$n||M==wi},Gi=F["__core-js_shared__"];var fo=function(){var I=/[^.]+$/.exec(Gi&&Gi.keys&&Gi.keys.IE_PROTO||"");return I?"Symbol(src)_1."+I:""}();const po=function(I){return!!fo&&fo in I};var go=Function.prototype.toString;const Yt=function(I){if(I!=null){try{return go.call(I)}catch{}try{return I+""}catch{}}return""};var Gt=/^\[object .+?Constructor\]$/,an=Function.prototype,ln=Object.prototype,kn=an.toString,bn=ln.hasOwnProperty,Pt=RegExp("^"+kn.call(bn).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const ki=function(I){return!(!L(I)||po(I))&&(ho(I)?Pt:Gt).test(Yt(I))},It=function(I,M){return I==null?void 0:I[M]},yi=function(I,M){var $=It(I,M);return ki($)?$:void 0},oi=yi(F,"Map"),si=yi(Object,"create"),Tl=function(){this.__data__=si?si(null):{},this.size=0},vs=function(I){var M=this.has(I)&&delete this.__data__[I];return this.size-=M?1:0,M};var md="__lodash_hash_undefined__",Al=Object.prototype.hasOwnProperty;const bd=function(I){var M=this.__data__;if(si){var $=M[I];return $===md?void 0:$}return Al.call(M,I)?M[I]:void 0};var Fo=Object.prototype.hasOwnProperty;const vd=function(I){var M=this.__data__;return si?M[I]!==void 0:Fo.call(M,I)};var ha="__lodash_hash_undefined__";const _d=function(I,M){var $=this.__data__;return this.size+=this.has(I)?0:1,$[I]=si&&M===void 0?ha:M,this};function xi(I){var M=-1,$=I==null?0:I.length;for(this.clear();++M<$;){var te=I[M];this.set(te[0],te[1])}}xi.prototype.clear=Tl,xi.prototype.delete=vs,xi.prototype.get=bd,xi.prototype.has=vd,xi.prototype.set=_d;const mo=xi,_s=function(){this.size=0,this.__data__={hash:new mo,map:new(oi||Sn),string:new mo}},ws=function(I){var M=typeof I;return M=="string"||M=="number"||M=="symbol"||M=="boolean"?I!=="__proto__":I===null},Vr=function(I,M){var $=I.__data__;return ws(M)?$[typeof M=="string"?"string":"hash"]:$.map},bo=function(I){var M=Vr(this,I).delete(I);return this.size-=M?1:0,M},Sl=function(I){return Vr(this,I).get(I)},ks=function(I){return Vr(this,I).has(I)},Wt=function(I,M){var $=Vr(this,I),te=$.size;return $.set(I,M),this.size+=$.size==te?0:1,this};function $r(I){var M=-1,$=I==null?0:I.length;for(this.clear();++M<$;){var te=I[M];this.set(te[0],te[1])}}$r.prototype.clear=_s,$r.prototype.delete=bo,$r.prototype.get=Sl,$r.prototype.has=ks,$r.prototype.set=Wt;const wd=$r;var kd=200;const El=function(I,M){var $=this.__data__;if($ instanceof Sn){var te=$.__data__;if(!oi||te.length<kd-1)return te.push([I,M]),this.size=++$.size,this;$=this.__data__=new wd(te)}return $.set(I,M),this.size=$.size,this};function Hr(I){var M=this.__data__=new Sn(I);this.size=M.size}Hr.prototype.clear=rn,Hr.prototype.delete=Bi,Hr.prototype.get=uo,Hr.prototype.has=ua,Hr.prototype.set=El;const Le=Hr,me=function(I,M){for(var $=-1,te=I==null?0:I.length;++$<te&&M(I[$],$,I)!==!1;);return I},vo=function(){try{var I=yi(Object,"defineProperty");return I({},"",{}),I}catch{}}(),ct=function(I,M,$){M=="__proto__"&&vo?vo(I,M,{configurable:!0,enumerable:!0,value:$,writable:!0}):I[M]=$};var Pl=Object.prototype.hasOwnProperty;const fa=function(I,M,$){var te=I[M];Pl.call(I,M)&&en(te,$)&&($!==void 0||M in I)||ct(I,M,$)},_o=function(I,M,$,te){var Ce=!$;$||($={});for(var Ge=-1,Qe=M.length;++Ge<Qe;){var tt=M[Ge],jt=te?te($[tt],I[tt],tt,$,I):void 0;jt===void 0&&(jt=I[tt]),Ce?ct($,tt,jt):fa($,tt,jt)}return $},ys=function(I,M){for(var $=-1,te=Array(I);++$<I;)te[$]=M($);return te};var Il="[object Arguments]";const Ml=function(I){return Se(I)&&ke(I)==Il};var pa=Object.prototype,yd=pa.hasOwnProperty,xd=pa.propertyIsEnumerable;const Xn=Ml(function(){return arguments}())?Ml:function(I){return Se(I)&&yd.call(I,"callee")&&!xd.call(I,"callee")},xs=Array.isArray,Vo=function(){return!1};var Cs=_&&!_.nodeType&&_,Ol=Cs&&!0&&p&&!p.nodeType&&p,ga=Ol&&Ol.exports===Cs?F.Buffer:void 0;const $o=(ga?ga.isBuffer:void 0)||Vo;var Nl=9007199254740991,wo=/^(?:0|[1-9]\d*)$/;const Ho=function(I,M){var $=typeof I;return!!(M=M??Nl)&&($=="number"||$!="symbol"&&wo.test(I))&&I>-1&&I%1==0&&I<M};var Rl=9007199254740991;const Ts=function(I){return typeof I=="number"&&I>-1&&I%1==0&&I<=Rl};var qt={};qt["[object Float32Array]"]=qt["[object Float64Array]"]=qt["[object Int8Array]"]=qt["[object Int16Array]"]=qt["[object Int32Array]"]=qt["[object Uint8Array]"]=qt["[object Uint8ClampedArray]"]=qt["[object Uint16Array]"]=qt["[object Uint32Array]"]=!0,qt["[object Arguments]"]=qt["[object Array]"]=qt["[object ArrayBuffer]"]=qt["[object Boolean]"]=qt["[object DataView]"]=qt["[object Date]"]=qt["[object Error]"]=qt["[object Function]"]=qt["[object Map]"]=qt["[object Number]"]=qt["[object Object]"]=qt["[object RegExp]"]=qt["[object Set]"]=qt["[object String]"]=qt["[object WeakMap]"]=!1;const Dl=function(I){return Se(I)&&Ts(I.length)&&!!qt[ke(I)]},Qi=function(I){return function(M){return I(M)}};var hr=_&&!_.nodeType&&_,Fi=hr&&!0&&p&&!p.nodeType&&p,As=Fi&&Fi.exports===hr&&O.process;const Ur=function(){try{var I=Fi&&Fi.require&&Fi.require("util").types;return I||As&&As.binding&&As.binding("util")}catch{}}();var jl=Ur&&Ur.isTypedArray;const Ll=jl?Qi(jl):Dl;var zl=Object.prototype.hasOwnProperty;const ma=function(I,M){var $=xs(I),te=!$&&Xn(I),Ce=!$&&!te&&$o(I),Ge=!$&&!te&&!Ce&&Ll(I),Qe=$||te||Ce||Ge,tt=Qe?ys(I.length,String):[],jt=tt.length;for(var Vt in I)!M&&!zl.call(I,Vt)||Qe&&(Vt=="length"||Ce&&(Vt=="offset"||Vt=="parent")||Ge&&(Vt=="buffer"||Vt=="byteLength"||Vt=="byteOffset")||Ho(Vt,jt))||tt.push(Vt);return tt};var Wr=Object.prototype;const Ss=function(I){var M=I&&I.constructor;return I===(typeof M=="function"&&M.prototype||Wr)},Bl=function(I,M){return function($){return I(M($))}},Cd=Bl(Object.keys,Object);var Uo=Object.prototype.hasOwnProperty;const Td=function(I){if(!Ss(I))return Cd(I);var M=[];for(var $ in Object(I))Uo.call(I,$)&&$!="constructor"&&M.push($);return M},Fl=function(I){return I!=null&&Ts(I.length)&&!ho(I)},ba=function(I){return Fl(I)?ma(I):Td(I)},Ad=function(I,M){return I&&_o(M,ba(M),I)},fr=function(I){var M=[];if(I!=null)for(var $ in Object(I))M.push($);return M};var Es=Object.prototype.hasOwnProperty;const Sd=function(I){if(!L(I))return fr(I);var M=Ss(I),$=[];for(var te in I)(te!="constructor"||!M&&Es.call(I,te))&&$.push(te);return $},pr=function(I){return Fl(I)?ma(I,!0):Sd(I)},Wo=function(I,M){return I&&_o(M,pr(M),I)};var Vl=_&&!_.nodeType&&_,Ft=Vl&&!0&&p&&!p.nodeType&&p,Dt=Ft&&Ft.exports===Vl?F.Buffer:void 0,$l=Dt?Dt.allocUnsafe:void 0;const va=function(I,M){if(M)return I.slice();var $=I.length,te=$l?$l($):new I.constructor($);return I.copy(te),te},Ed=function(I,M){var $=-1,te=I.length;for(M||(M=Array(te));++$<te;)M[$]=I[$];return M},Pd=function(I,M){for(var $=-1,te=I==null?0:I.length,Ce=0,Ge=[];++$<te;){var Qe=I[$];M(Qe,$,I)&&(Ge[Ce++]=Qe)}return Ge},_a=function(){return[]};var Hl=Object.prototype.propertyIsEnumerable,wa=Object.getOwnPropertySymbols;const Ps=wa?function(I){return I==null?[]:(I=Object(I),Pd(wa(I),function(M){return Hl.call(I,M)}))}:_a,vn=function(I,M){return _o(I,Ps(I),M)},qo=function(I,M){for(var $=-1,te=M.length,Ce=I.length;++$<te;)I[Ce+$]=M[$];return I},Ci=Bl(Object.getPrototypeOf,Object),ka=Object.getOwnPropertySymbols?function(I){for(var M=[];I;)qo(M,Ps(I)),I=Ci(I);return M}:_a,Is=function(I,M){return _o(I,ka(I),M)},Hn=function(I,M,$){var te=M(I);return xs(I)?te:qo(te,$(I))},Ul=function(I){return Hn(I,ba,Ps)},ya=function(I){return Hn(I,pr,ka)},ko=yi(F,"DataView"),Ms=yi(F,"Promise"),yo=yi(F,"Set"),xo=yi(F,"WeakMap");var yn="[object Map]",Os="[object Promise]",Jn="[object Set]",Wl="[object WeakMap]",xa="[object DataView]",gr=Yt(ko),Ns=Yt(oi),Yi=Yt(Ms),Mt=Yt(yo),mr=Yt(xo),Xi=ke;(ko&&Xi(new ko(new ArrayBuffer(1)))!=xa||oi&&Xi(new oi)!=yn||Ms&&Xi(Ms.resolve())!=Os||yo&&Xi(new yo)!=Jn||xo&&Xi(new xo)!=Wl)&&(Xi=function(I){var M=ke(I),$=M=="[object Object]"?I.constructor:void 0,te=$?Yt($):"";if(te)switch(te){case gr:return xa;case Ns:return yn;case Yi:return Os;case Mt:return Jn;case mr:return Wl}return M});const Co=Xi;var Ko=Object.prototype.hasOwnProperty;const Id=function(I){var M=I.length,$=new I.constructor(M);return M&&typeof I[0]=="string"&&Ko.call(I,"index")&&($.index=I.index,$.input=I.input),$},ql=F.Uint8Array,Ca=function(I){var M=new I.constructor(I.byteLength);return new ql(M).set(new ql(I)),M},Ta=function(I,M){var $=M?Ca(I.buffer):I.buffer;return new I.constructor($,I.byteOffset,I.byteLength)};var Go=/\w*$/;const To=function(I){var M=new I.constructor(I.source,Go.exec(I));return M.lastIndex=I.lastIndex,M};var Aa=oe?oe.prototype:void 0,Sa=Aa?Aa.valueOf:void 0;const Ea=function(I){return Sa?Object(Sa.call(I)):{}},Pa=function(I,M){var $=M?Ca(I.buffer):I.buffer;return new I.constructor($,I.byteOffset,I.length)};var Rs="[object Boolean]",Kl="[object Date]",Gl="[object Map]",Ia="[object Number]",Ma="[object RegExp]",Ql="[object Set]",Yl="[object String]",dt="[object Symbol]",Qo="[object ArrayBuffer]",Ao="[object DataView]",Ji="[object Float32Array]",Oa="[object Float64Array]",Xl="[object Int8Array]",Md="[object Int16Array]",ai="[object Int32Array]",li="[object Uint8Array]",Na="[object Uint8ClampedArray]",xt="[object Uint16Array]",Od="[object Uint32Array]";const Nd=function(I,M,$){var te=I.constructor;switch(M){case Qo:return Ca(I);case Rs:case Kl:return new te(+I);case Ao:return Ta(I,$);case Ji:case Oa:case Xl:case Md:case ai:case li:case Na:case xt:case Od:return Pa(I,$);case Gl:return new te;case Ia:case Yl:return new te(I);case Ma:return To(I);case Ql:return new te;case dt:return Ea(I)}};var Yo=Object.create;const Jl=function(){function I(){}return function(M){if(!L(M))return{};if(Yo)return Yo(M);I.prototype=M;var $=new I;return I.prototype=void 0,$}}(),br=function(I){return typeof I.constructor!="function"||Ss(I)?{}:Jl(Ci(I))};var vr="[object Map]";const xn=function(I){return Se(I)&&Co(I)==vr};var Ra=Ur&&Ur.isMap;const qr=Ra?Qi(Ra):xn;var _t="[object Set]";const cn=function(I){return Se(I)&&Co(I)==_t};var Ti=Ur&&Ur.isSet;const Vi=Ti?Qi(Ti):cn;var Zl=1,Da=2,Ds=4,ec="[object Arguments]",Kr="[object Function]",q="[object GeneratorFunction]",ae="[object Object]",Y={};Y[ec]=Y["[object Array]"]=Y["[object ArrayBuffer]"]=Y["[object DataView]"]=Y["[object Boolean]"]=Y["[object Date]"]=Y["[object Float32Array]"]=Y["[object Float64Array]"]=Y["[object Int8Array]"]=Y["[object Int16Array]"]=Y["[object Int32Array]"]=Y["[object Map]"]=Y["[object Number]"]=Y[ae]=Y["[object RegExp]"]=Y["[object Set]"]=Y["[object String]"]=Y["[object Symbol]"]=Y["[object Uint8Array]"]=Y["[object Uint8ClampedArray]"]=Y["[object Uint16Array]"]=Y["[object Uint32Array]"]=!0,Y["[object Error]"]=Y[Kr]=Y["[object WeakMap]"]=!1;const Me=function I(M,$,te,Ce,Ge,Qe){var tt,jt=$&Zl,Vt=$&Da,Po=$&Ds;if(te&&(tt=Ge?te(M,Ce,Ge,Qe):te(M)),tt!==void 0)return tt;if(!L(M))return M;var Zn=xs(M);if(Zn){if(tt=Id(M),!jt)return Ed(M,tt)}else{var ge=Co(M),Be=ge==Kr||ge==q;if($o(M))return va(M,jt);if(ge==ae||ge==ec||Be&&!Ge){if(tt=Vt||Be?{}:br(M),!jt)return Vt?Is(M,Wo(tt,M)):vn(M,Ad(tt,M))}else{if(!Y[ge])return Ge?M:{};tt=Nd(M,ge,jt)}}Qe||(Qe=new Le);var yr=Qe.get(M);if(yr)return yr;Qe.set(M,tt),Vi(M)?M.forEach(function(ft){tt.add(I(ft,$,te,ft,M,Qe))}):qr(M)&&M.forEach(function(ft,ci){tt.set(ci,I(ft,$,te,ci,M,Qe))});var Lt=Zn?void 0:(Po?Vt?ya:Ul:Vt?pr:ba)(M);return me(Lt||M,function(ft,ci){Lt&&(ft=M[ci=ft]),fa(tt,ci,I(ft,$,te,ci,M,Qe))}),tt};var Xe=1,kt=4;const dn=function(I,M){return Me(I,Xe|kt,M=typeof M=="function"?M:void 0)};var Ot="[object Object]",js=Function.prototype,Rd=Object.prototype,En=js.toString,So=Rd.hasOwnProperty,Dd=En.call(Object);const _r=function(I){if(!Se(I)||ke(I)!=Ot)return!1;var M=Ci(I);if(M===null)return!0;var $=So.call(M,"constructor")&&M.constructor;return typeof $=="function"&&$ instanceof $&&En.call($)==Dd},Xo=function(I){return Se(I)&&I.nodeType===1&&!_r(I)};function Gr(I,M=new Set){const $=[I],te=new Set;let Ce=0;for(;$.length>Ce;){const Ge=$[Ce++];if(!(te.has(Ge)||Ct(Ge)||M.has(Ge)))if(te.add(Ge),Ge[Symbol.iterator])try{for(const Qe of Ge)$.push(Qe)}catch{}else for(const Qe in Ge)Qe!=="defaultValue"&&$.push(Ge[Qe])}return te}function Ct(I){const M=Object.prototype.toString.call(I),$=typeof I;return $==="number"||$==="boolean"||$==="string"||$==="symbol"||$==="function"||M==="[object Date]"||M==="[object RegExp]"||M==="[object Module]"||I==null||I._watchdogExcluded===!0||I instanceof EventTarget||I instanceof Event}function tc(I,M,$=new Set){if(I===M&&typeof(te=I)=="object"&&te!==null)return!0;var te;const Ce=Gr(I,$),Ge=Gr(M,$);for(const Qe of Ce)if(Ge.has(Qe))return!0;return!1}class ja{constructor(M){if(this.crashes=[],this.state="initializing",this._crashNumberLimit=typeof M.crashNumberLimit=="number"?M.crashNumberLimit:3,this._now=Date.now,this._minimumNonErrorTimePeriod=typeof M.minimumNonErrorTimePeriod=="number"?M.minimumNonErrorTimePeriod:5e3,this._boundErrorHandler=$=>{const te=$.error||$.reason;te instanceof Error&&this._handleError(te,$)},this._listeners={},!this._restart)throw new Error("The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.")}setCreator(M){this._creator=M}setDestructor(M){this._destructor=M}destroy(){this._stopErrorHandling(),this._listeners={}}on(M,$){this._listeners[M]||(this._listeners[M]=[]),this._listeners[M].push($)}off(M,$){this._listeners[M]=this._listeners[M].filter(te=>te!==$)}_fire(M,...$){const te=this._listeners[M]||[];for(const Ce of te)Ce.apply(this,[null,...$])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(M,$){if(this._shouldReactToError(M)){this.crashes.push({message:M.message,stack:M.stack,filename:$.filename,lineno:$.lineno,colno:$.colno,date:this._now()});const te=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:M,causesRestart:te}),te?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(M){return M.is&&M.is("CKEditorError")&&M.context!==void 0&&M.context!==null&&this.state==="ready"&&this._isErrorComingFromThisItem(M)}_shouldRestart(){return this.crashes.length<=this._crashNumberLimit?!0:(this.crashes[this.crashes.length-1].date-this.crashes[this.crashes.length-1-this._crashNumberLimit].date)/this._crashNumberLimit>this._minimumNonErrorTimePeriod}}class wr extends ja{constructor(M,$={}){super($),this._editor=null,this._throttledSave=lt(this._save.bind(this),typeof $.saveInterval=="number"?$.saveInterval:5e3),this._creator=(te,Ce)=>M.create(te,Ce),this._destructor=te=>te.destroy()}get editor(){return this._editor}get _item(){return this._editor}_restart(){return Promise.resolve().then(()=>(this.state="initializing",this._fire("stateChange"),this._destroy())).catch(M=>{console.error("An error happened during the editor destroying.",M)}).then(()=>{if(typeof this._elementOrData=="string")return this.create(this._data,this._config,this._config.context);{const M=Object.assign({},this._config,{initialData:this._data});return this.create(this._elementOrData,M,M.context)}}).then(()=>{this._fire("restart")})}create(M=this._elementOrData,$=this._config,te){return Promise.resolve().then(()=>(super._startErrorHandling(),this._elementOrData=M,this._config=this._cloneEditorConfiguration($)||{},this._config.context=te,this._creator(M,this._config))).then(Ce=>{this._editor=Ce,Ce.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=Ce.model.document.version,this._data=this._getData(),this.state="ready",this._fire("stateChange")})}destroy(){return Promise.resolve().then(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling(),this._throttledSave.flush();const M=this._editor;return this._editor=null,M.model.document.off("change:data",this._throttledSave),this._destructor(M)})}_save(){const M=this._editor.model.document.version;try{this._data=this._getData(),this._lastDocumentVersion=M}catch($){console.error($,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(M){this._excludedProps=M}_getData(){const M={};for(const $ of this._editor.model.document.getRootNames())M[$]=this._editor.data.get({rootName:$});return M}_isErrorComingFromThisItem(M){return tc(this._editor,M.context,this._excludedProps)}_cloneEditorConfiguration(M){return dn(M,($,te)=>Xo($)||te==="context"?$:void 0)}}const fn=new Array(256).fill("").map((I,M)=>("0"+M.toString(16)).slice(-2)),Jo=Symbol("MainQueueId");class nc extends ja{constructor(M,$={}){super($),this._watchdogs=new Map,this._watchdogConfig=$,this._context=null,this._contextProps=new Set,this._actionQueues=new Eo,this._creator=te=>M.create(te),this._destructor=te=>te.destroy(),this._actionQueues.onEmpty(()=>{this.state==="initializing"&&(this.state="ready",this._fire("stateChange"))})}get context(){return this._context}create(M={}){return this._actionQueues.enqueue(Jo,()=>(this._contextConfig=M,this._create()))}getItem(M){return this._getWatchdog(M)._item}getItemState(M){return this._getWatchdog(M).state}add(M){const $=Zi(M);return Promise.all($.map(te=>this._actionQueues.enqueue(te.id,()=>{if(this.state==="destroyed")throw new Error("Cannot add items to destroyed watchdog.");if(!this._context)throw new Error("Context was not created yet. You should call the `ContextWatchdog#create()` method first.");let Ce;if(this._watchdogs.has(te.id))throw new Error(`Item with the given id is already added: '${te.id}'.`);if(te.type==="editor")return Ce=new wr(this._watchdogConfig),Ce.setCreator(te.creator),Ce._setExcludedProperties(this._contextProps),te.destructor&&Ce.setDestructor(te.destructor),this._watchdogs.set(te.id,Ce),Ce.on("error",(Ge,{error:Qe,causesRestart:tt})=>{this._fire("itemError",{itemId:te.id,error:Qe}),tt&&this._actionQueues.enqueue(te.id,()=>new Promise(jt=>{Ce.on("restart",(function Vt(){Ce.off("restart",Vt),this._fire("itemRestart",{itemId:te.id}),jt()}).bind(this))}))}),Ce.create(te.sourceElementOrData,te.config,this._context);throw new Error(`Not supported item type: '${te.type}'.`)})))}remove(M){const $=Zi(M);return Promise.all($.map(te=>this._actionQueues.enqueue(te,()=>{const Ce=this._getWatchdog(te);return this._watchdogs.delete(te),Ce.destroy()})))}destroy(){return this._actionQueues.enqueue(Jo,()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_restart(){return this._actionQueues.enqueue(Jo,()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch(M=>{console.error("An error happened during destroying the context or items.",M)}).then(()=>this._create()).then(()=>this._fire("restart"))))}_create(){return Promise.resolve().then(()=>(this._startErrorHandling(),this._creator(this._contextConfig))).then(M=>(this._context=M,this._contextProps=Gr(this._context),Promise.all(Array.from(this._watchdogs.values()).map($=>($._setExcludedProperties(this._contextProps),$.create(void 0,void 0,this._context))))))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling();const M=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map($=>$.destroy())).then(()=>this._destructor(M))})}_getWatchdog(M){const $=this._watchdogs.get(M);if(!$)throw new Error(`Item with the given id was not registered: ${M}.`);return $}_isErrorComingFromThisItem(M){for(const $ of this._watchdogs.values())if($._isErrorComingFromThisItem(M))return!1;return tc(this._context,M.context)}}class Eo{constructor(){this._onEmptyCallbacks=[],this._queues=new Map,this._actions=new WeakMap,this._lastActionId=0,this._activeActions=0}onEmpty(M){this._onEmptyCallbacks.push(M)}enqueue(M,$){const te=M===Jo;this._activeActions++,this._queues.get(M)||this._queues.set(M,Promise.resolve());const Ce=(te?Promise.all(this._queues.values()):Promise.all([this._queues.get(Jo),this._queues.get(M)])).then($),Ge=Ce.catch(()=>{});return this._queues.set(M,Ge),Ce.finally(()=>{this._activeActions--,this._queues.get(M)===Ge&&this._activeActions===0&&this._onEmptyCallbacks.forEach(Qe=>Qe())})}}function Zi(I){return Array.isArray(I)?I:[I]}const Zo=P().createContext("contextWatchdog");class Ls extends P().Component{constructor(M,$){super(M,$),this.contextWatchdog=null,this.props.isLayoutReady&&this._initializeContextWatchdog(this.props.config)}async shouldComponentUpdate(M){return M.id!==this.props.id&&(this.contextWatchdog&&await this.contextWatchdog.destroy(),await this._initializeContextWatchdog(M.config)),M.isLayoutReady&&!this.contextWatchdog?(await this._initializeContextWatchdog(M.config),!0):this.props.children!==M.children}render(){return P().createElement(Zo.Provider,{value:this.contextWatchdog},this.props.children)}async componentWillUnmount(){await this._destroyContext()}async _initializeContextWatchdog(M){this.contextWatchdog=new nc(this.props.context,this.props.watchdogConfig),this.contextWatchdog.on("error",($,te)=>{this.props.onError(te.error,{phase:"runtime",willContextRestart:te.causesRestart})}),this.contextWatchdog.on("stateChange",()=>{this.contextWatchdog.state==="ready"&&this.props.onReady&&this.props.onReady(this.contextWatchdog.context)}),await this.contextWatchdog.create(M).catch($=>{this.props.onError($,{phase:"initialization",willContextRestart:!1})})}async _destroyContext(){this.contextWatchdog&&(await this.contextWatchdog.destroy(),this.contextWatchdog=null)}}Ls.defaultProps={isLayoutReady:!0,onError:(I,M)=>console.error(I,M)},Ls.propTypes={id:y().string,isLayoutReady:y().bool,context:y().func,watchdogConfig:y().object,config:y().object,onReady:y().func,onError:y().func};const Qr="Lock from React integration (@ckeditor/ckeditor5-react)";class kr extends P().Component{constructor(M){super(M),this.editorDestructionInProgress=null,this.domContainer=P().createRef(),this.watchdog=null;const{CKEDITOR_VERSION:$}=window;if($){const[te]=$.split(".").map(Number);te<34&&console.warn("The <CKEditor> component requires using CKEditor 5 in version 34 or higher.")}else console.warn('Cannot find the "CKEDITOR_VERSION" in the "window" scope.')}get editor(){return this.watchdog?this.watchdog.editor:null}shouldComponentUpdate(M){return!!this.editor&&(M.id!==this.props.id||(this._shouldUpdateEditor(M)&&this.editor.setData(M.data),"disabled"in M&&(M.disabled?this.editor.enableReadOnlyMode(Qr):this.editor.disableReadOnlyMode(Qr)),!1))}async componentDidMount(){await this._initializeEditor()}async componentDidUpdate(){await this._destroyEditor(),await this._initializeEditor()}async componentWillUnmount(){await this._destroyEditor()}render(){return P().createElement("div",{ref:this.domContainer})}async _initializeEditor(){await this.editorDestructionInProgress,this.watchdog||(this.context instanceof nc?this.watchdog=new ic(this.context):this.watchdog=new kr._EditorWatchdog(this.props.editor,this.props.watchdogConfig),this.watchdog.setCreator((M,$)=>this._createEditor(M,$)),this.watchdog.on("error",(M,{error:$,causesRestart:te})=>{this.props.onError($,{phase:"runtime",willEditorRestart:te})}),await this.watchdog.create(this.domContainer.current,this._getConfig()).catch(M=>this.props.onError(M,{phase:"initialization",willEditorRestart:!1})))}_createEditor(M,$){return this.props.editor.create(M,$).then(te=>{"disabled"in this.props&&this.props.disabled&&te.enableReadOnlyMode(Qr);const Ce=te.model.document,Ge=te.editing.view.document;return Ce.on("change:data",Qe=>{this.props.onChange&&this.props.onChange(Qe,te)}),Ge.on("focus",Qe=>{this.props.onFocus&&this.props.onFocus(Qe,te)}),Ge.on("blur",Qe=>{this.props.onBlur&&this.props.onBlur(Qe,te)}),setTimeout(()=>{this.props.onReady&&this.props.onReady(te)}),te})}async _destroyEditor(){this.editorDestructionInProgress=new Promise(M=>{setTimeout(()=>{this.watchdog?this.watchdog.destroy().then(()=>{this.watchdog=null,M()}):M()})})}_shouldUpdateEditor(M){return this.props.data!==M.data&&this.editor.getData()!==M.data}_getConfig(){return this.props.data&&this.props.config.initialData&&console.warn("Editor data should be provided either using `config.initialData` or `data` properties. The config property is over the data value and the first one will be used when specified both."),{...this.props.config,initialData:this.props.config.initialData||this.props.data||""}}}class ic{constructor(M){this._contextWatchdog=M,this._id=function(){const $=4294967296*Math.random()>>>0,te=4294967296*Math.random()>>>0,Ce=4294967296*Math.random()>>>0,Ge=4294967296*Math.random()>>>0;return"e"+fn[$>>0&255]+fn[$>>8&255]+fn[$>>16&255]+fn[$>>24&255]+fn[te>>0&255]+fn[te>>8&255]+fn[te>>16&255]+fn[te>>24&255]+fn[Ce>>0&255]+fn[Ce>>8&255]+fn[Ce>>16&255]+fn[Ce>>24&255]+fn[Ge>>0&255]+fn[Ge>>8&255]+fn[Ge>>16&255]+fn[Ge>>24&255]}()}setCreator(M){this._creator=M}create(M,$){return this._contextWatchdog.add({sourceElementOrData:M,config:$,creator:this._creator,id:this._id,type:"editor"})}on(M,$){this._contextWatchdog.on("itemError",(te,{itemId:Ce,causesRestart:Ge,error:Qe})=>{Ce===this._id&&$(null,{error:Qe,causesRestart:Ge})})}destroy(){return this._contextWatchdog.state==="ready"?this._contextWatchdog.remove(this._id):Promise.resolve()}get editor(){return this._contextWatchdog.getItem(this._id)}}kr.contextType=Zo,kr.propTypes={editor:y().func.isRequired,data:y().string,config:y().object,watchdogConfig:y().object,onChange:y().func,onReady:y().func,onFocus:y().func,onBlur:y().func,onError:y().func,disabled:y().bool,onInit:(I,M)=>{if(I[M])return new Error('The "onInit" property is not supported anymore by the CKEditor component. Use the "onReady" property instead.')}},kr.defaultProps={config:{},onError:(I,M)=>console.error(I,M)},kr._EditorWatchdog=wr})(),b})())})(yg,yg.exports);var pC=yg.exports,Gv={exports:{}};/*! * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */(function(p,_){(function(l){const f=l.en=l.en||{};f.dictionary=Object.assign(f.dictionary||{},{"%0 of %1":"%0 of %1",Aquamarine:"Aquamarine",Black:"Black","Block quote":"Block quote",Blue:"Blue",Bold:"Bold","Break text":"Break text","Bulleted List":"Bulleted List",Cancel:"Cancel","Cannot upload file:":"Cannot upload file:","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading",Column:"Column","Could not insert image at the current position.":"Could not insert image at the current position.","Could not obtain resized image URL.":"Could not obtain resized image URL.","Decrease indent":"Decrease indent","Delete column":"Delete column","Delete row":"Delete row","Dim grey":"Dim grey",Downloadable:"Downloadable","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Edit link":"Edit link","Editor toolbar":"Editor toolbar","Enter image caption":"Enter image caption","Full size image":"Full size image",Green:"Green",Grey:"Grey","Header column":"Header column","Header row":"Header row",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6","Image toolbar":"Image toolbar","image widget":"image widget","In line":"In line","Increase indent":"Increase indent","Insert column left":"Insert column left","Insert column right":"Insert column right","Insert image":"Insert image","Insert image or file":"Insert image or file","Insert media":"Insert media","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block","Insert row above":"Insert row above","Insert row below":"Insert row below","Insert table":"Insert table","Inserting image failed":"Inserting image failed",Italic:"Italic","Left aligned image":"Left aligned image","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link URL":"Link URL","Media URL":"Media URL","media widget":"media widget","Merge cell down":"Merge cell down","Merge cell left":"Merge cell left","Merge cell right":"Merge cell right","Merge cell up":"Merge cell up","Merge cells":"Merge cells",Next:"Next","Numbered List":"Numbered List","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Orange:"Orange",Paragraph:"Paragraph","Paste the media URL in the input.":"Paste the media URL in the input.",Previous:"Previous",Purple:"Purple",Red:"Red",Redo:"Redo","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0","Right aligned image":"Right aligned image",Row:"Row",Save:"Save","Select all":"Select all","Select column":"Select column","Select row":"Select row","Selecting resized image failed":"Selecting resized image failed","Show more items":"Show more items","Side image":"Side image","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically","Table toolbar":"Table toolbar","Text alternative":"Text alternative","The URL must not be empty.":"The URL must not be empty.","This link has no URL":"This link has no URL","This media URL is not supported.":"This media URL is not supported.","Tip: Paste the URL into the content to embed faster.":"Tip: Paste the URL into the content to embed faster.","Toggle caption off":"Toggle caption off","Toggle caption on":"Toggle caption on",Turquoise:"Turquoise",Undo:"Undo",Unlink:"Unlink","Upload failed":"Upload failed","Upload in progress":"Upload in progress",White:"White","Widget toolbar":"Widget toolbar","Wrap text":"Wrap text",Yellow:"Yellow"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(l,f){p.exports=f()}(window,function(){return function(l){var f={};function v(w){if(f[w])return f[w].exports;var b=f[w]={i:w,l:!1,exports:{}};return l[w].call(b.exports,b,b.exports,v),b.l=!0,b.exports}return v.m=l,v.c=f,v.d=function(w,b,T){v.o(w,b)||Object.defineProperty(w,b,{enumerable:!0,get:T})},v.r=function(w){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(w,"__esModule",{value:!0})},v.t=function(w,b){if(1&b&&(w=v(w)),8&b||4&b&&typeof w=="object"&&w&&w.__esModule)return w;var T=Object.create(null);if(v.r(T),Object.defineProperty(T,"default",{enumerable:!0,value:w}),2&b&&typeof w!="string")for(var P in w)v.d(T,P,(function(B){return w[B]}).bind(null,P));return T},v.n=function(w){var b=w&&w.__esModule?function(){return w.default}:function(){return w};return v.d(b,"a",b),b},v.o=function(w,b){return Object.prototype.hasOwnProperty.call(w,b)},v.p="",v(v.s=108)}([function(l,f,v){v.d(f,"a",function(){return w}),v.d(f,"b",function(){return b});class w extends Error{constructor(y,L,O){super(`${y}${O?" "+JSON.stringify(O):""}${T(y)}`),this.name="CKEditorError",this.context=L,this.data=O}is(y){return y==="CKEditorError"}static rethrowUnexpectedError(y,L){if(y.is&&y.is("CKEditorError"))throw y;const O=new w(y.message,L);throw O.stack=y.stack,O}}function b(B,y){console.warn(...P(B,y))}function T(B){return` Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-`+B}function P(B,y){const L=T(B);return y?[B,y,L]:[B,L]}},function(l,f,v){var w,b=function(){return w===void 0&&(w=!!(window&&document&&document.all&&!window.atob)),w},T=function(){var ee={};return function(oe){if(ee[oe]===void 0){var re=document.querySelector(oe);if(window.HTMLIFrameElement&&re instanceof window.HTMLIFrameElement)try{re=re.contentDocument.head}catch{re=null}ee[oe]=re}return ee[oe]}}(),P=[];function B(ee){for(var oe=-1,re=0;re<P.length;re++)if(P[re].identifier===ee){oe=re;break}return oe}function y(ee,oe){for(var re={},be=[],we=0;we<ee.length;we++){var Ae=ee[we],Ee=oe.base?Ae[0]+oe.base:Ae[0],Ne=re[Ee]||0,ie="".concat(Ee," ").concat(Ne);re[Ee]=Ne+1;var fe=B(ie),_e={css:Ae[1],media:Ae[2],sourceMap:Ae[3]};fe!==-1?(P[fe].references++,P[fe].updater(_e)):P.push({identifier:ie,updater:ne(_e,oe),references:1}),be.push(ie)}return be}function L(ee){var oe=document.createElement("style"),re=ee.attributes||{};if(re.nonce===void 0){var be=v.nc;be&&(re.nonce=be)}if(Object.keys(re).forEach(function(Ae){oe.setAttribute(Ae,re[Ae])}),typeof ee.insert=="function")ee.insert(oe);else{var we=T(ee.insert||"head");if(!we)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");we.appendChild(oe)}return oe}var O,V=(O=[],function(ee,oe){return O[ee]=oe,O.filter(Boolean).join(` `)});function F(ee,oe,re,be){var we=re?"":be.media?"@media ".concat(be.media," {").concat(be.css,"}"):be.css;if(ee.styleSheet)ee.styleSheet.cssText=V(oe,we);else{var Ae=document.createTextNode(we),Ee=ee.childNodes;Ee[oe]&&ee.removeChild(Ee[oe]),Ee.length?ee.insertBefore(Ae,Ee[oe]):ee.appendChild(Ae)}}function Z(ee,oe,re){var be=re.css,we=re.media,Ae=re.sourceMap;if(we?ee.setAttribute("media",we):ee.removeAttribute("media"),Ae&&typeof btoa<"u"&&(be+=` /*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(Ae))))," */")),ee.styleSheet)ee.styleSheet.cssText=be;else{for(;ee.firstChild;)ee.removeChild(ee.firstChild);ee.appendChild(document.createTextNode(be))}}var G=null,Q=0;function ne(ee,oe){var re,be,we;if(oe.singleton){var Ae=Q++;re=G||(G=L(oe)),be=F.bind(null,re,Ae,!1),we=F.bind(null,re,Ae,!0)}else re=L(oe),be=Z.bind(null,re,oe),we=function(){(function(Ee){if(Ee.parentNode===null)return!1;Ee.parentNode.removeChild(Ee)})(re)};return be(ee),function(Ee){if(Ee){if(Ee.css===ee.css&&Ee.media===ee.media&&Ee.sourceMap===ee.sourceMap)return;be(ee=Ee)}else we()}}l.exports=function(ee,oe){(oe=oe||{}).singleton||typeof oe.singleton=="boolean"||(oe.singleton=b());var re=y(ee=ee||[],oe);return function(be){if(be=be||[],Object.prototype.toString.call(be)==="[object Array]"){for(var we=0;we<re.length;we++){var Ae=B(re[we]);P[Ae].references--}for(var Ee=y(be,oe),Ne=0;Ne<re.length;Ne++){var ie=B(re[Ne]);P[ie].references===0&&(P[ie].updater(),P.splice(ie,1))}re=Ee}}}},,function(l,f,v){var w=v(8),b=typeof self=="object"&&self&&self.Object===Object&&self,T=w.a||b||Function("return this")();f.a=T},function(l,f,v){(function(w){var b=v(3),T=v(14),P=_&&!_.nodeType&&_,B=P&&typeof w=="object"&&w&&!w.nodeType&&w,y=B&&B.exports===P?b.a.Buffer:void 0,L=(y?y.isBuffer:void 0)||T.a;f.a=L}).call(this,v(10)(l))},function(l,f,v){(function(w){var b=v(8),T=_&&!_.nodeType&&_,P=T&&typeof w=="object"&&w&&!w.nodeType&&w,B=P&&P.exports===T&&b.a.process,y=function(){try{var L=P&&P.require&&P.require("util").types;return L||B&&B.binding&&B.binding("util")}catch{}}();f.a=y}).call(this,v(10)(l))},function(l,f,v){(function(w){var b=v(0);const T=typeof window=="object"?window:w;if(T.CKEDITOR_VERSION)throw new b.a("ckeditor-duplicated-modules",null);T.CKEDITOR_VERSION="29.2.0"}).call(this,v(12))},function(l,f,v){var w=v(1),b=v(76);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f,v){(function(w){var b=typeof w=="object"&&w&&w.Object===Object&&w;f.a=b}).call(this,v(12))},function(l,f,v){(function(w){var b=v(3),T=_&&!_.nodeType&&_,P=T&&typeof w=="object"&&w&&!w.nodeType&&w,B=P&&P.exports===T?b.a.Buffer:void 0,y=B?B.allocUnsafe:void 0;f.a=function(L,O){if(O)return L.slice();var V=L.length,F=y?y(V):new L.constructor(V);return L.copy(F),F}}).call(this,v(10)(l))},function(l,f){l.exports=function(v){if(!v.webpackPolyfill){var w=Object.create(v);w.children||(w.children=[]),Object.defineProperty(w,"loaded",{enumerable:!0,get:function(){return w.l}}),Object.defineProperty(w,"id",{enumerable:!0,get:function(){return w.i}}),Object.defineProperty(w,"exports",{enumerable:!0}),w.webpackPolyfill=1}return w}},function(l,f,v){var w=v(1),b=v(77);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){var v;v=function(){return this}();try{v=v||new Function("return this")()}catch{typeof window=="object"&&(v=window)}l.exports=v},function(l,f,v){var w=v(1),b=v(71);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f,v){f.a=function(){return!1}},function(l,f,v){var w=v(1),b=v(16);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck-hidden{display:none!important}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{box-sizing:border-box;width:auto;height:auto;position:static}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999)}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:208,79%,51%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#bcdefb;--ck-color-focus-disabled-shadow:rgba(119,186,248,0.3);--ck-color-focus-error-shadow:rgba(255,64,31,0.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,0.15);--ck-color-shadow-drop-active:rgba(0,0,0,0.2);--ck-color-shadow-inner:rgba(0,0,0,0.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#e6e6e6;--ck-color-button-default-active-background:#d9d9d9;--ck-color-button-default-active-shadow:#bfbfbf;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#dedede;--ck-color-button-on-hover-background:#c4c4c4;--ck-color-button-on-active-background:#bababa;--ck-color-button-on-active-shadow:#a1a1a1;--ck-color-button-on-disabled-background:#dedede;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#579e3d;--ck-color-button-action-active-background:#53973b;--ck-color-button-action-active-shadow:#498433;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#b0b0b0;--ck-color-switch-button-off-hover-background:#a3a3a3;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#579e3d;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,0.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:#c7c7c7;--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:#c7c7c7;--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-base-active);--ck-color-list-button-on-background-focus:var(--ck-color-base-active-focus);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,177,255,0.1);--ck-color-link-fake-selection:rgba(31,177,255,0.3);--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{margin:0;padding:0;border:0;background:transparent;text-decoration:none;vertical-align:middle;transition:none;word-wrap:break-word}.ck.ck-reset_all,.ck.ck-reset_all *{border-collapse:collapse;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);color:var(--ck-color-text);text-align:left;white-space:nowrap;cursor:auto;float:none}.ck.ck-reset_all .ck-rtl *{text-align:right}.ck.ck-reset_all iframe{vertical-align:inherit}.ck.ck-reset_all textarea{white-space:pre-wrap}.ck.ck-reset_all input[type=password],.ck.ck-reset_all input[type=text],.ck.ck-reset_all textarea{cursor:text}.ck.ck-reset_all input[type=password][disabled],.ck.ck-reset_all input[type=text][disabled],.ck.ck-reset_all textarea[disabled]{cursor:default}.ck.ck-reset_all fieldset{padding:10px;border:2px groove #dfdee3}.ck.ck-reset_all button::-moz-focus-inner{padding:0;border:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}"},function(l,f,v){var w=v(1),b=v(18);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}"},function(l,f,v){var w=v(1),b=v(20);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck.ck-tooltip .ck-tooltip__text{display:inline-block}.ck.ck-tooltip .ck-tooltip__text:after{content:"";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s;border-style:solid;left:50%}.ck.ck-tooltip.ck-tooltip_s,.ck.ck-tooltip.ck-tooltip_se,.ck.ck-tooltip.ck-tooltip_sw{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{top:calc(var(--ck-tooltip-arrow-size)*-1 + 1px);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_sw{right:50%;left:auto}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text{left:auto;right:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{left:auto;right:0}.ck.ck-tooltip.ck-tooltip_se{left:50%;right:auto}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text{right:auto;left:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after{right:auto;left:0;transform:translateX(50%)}.ck.ck-tooltip.ck-tooltip_n{top:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_e{left:calc(100% + var(--ck-tooltip-arrow-size));top:50%}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text:after{left:calc(var(--ck-tooltip-arrow-size)*-1);top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:transparent;border-bottom-color:transparent;border-right-color:var(--ck-color-tooltip-background);border-top-color:transparent;border-left-width:0;border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_w{right:calc(100% + var(--ck-tooltip-arrow-size));left:auto;top:50%}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text:after{left:100%;top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:var(--ck-color-tooltip-background);border-bottom-color:transparent;border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:0;border-top-width:var(--ck-tooltip-arrow-size)}'},function(l,f,v){var w=v(1),b=v(22);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{visibility:visible;opacity:1}.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{white-space:nowrap;cursor:default;vertical-align:middle;padding:var(--ck-spacing-tiny);text-align:center;min-width:var(--ck-ui-component-min-height);min-height:var(--ck-ui-component-min-height);line-height:1;font-size:inherit;border:1px solid transparent;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;-webkit-appearance:none}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{font-size:inherit;font-weight:inherit;color:inherit;cursor:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-right:calc(var(--ck-spacing-small)*-1);margin-left:var(--ck-spacing-small)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}"},function(l,f,v){var w=v(1),b=v(24);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - var(--ck-switch-button-toggle-spacing)*2)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{transition:background .4s ease;width:var(--ck-switch-button-toggle-width);background:var(--ck-color-switch-button-off-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(var(--ck-border-radius)*0.5)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{margin:var(--ck-switch-button-toggle-spacing);width:var(--ck-switch-button-toggle-inner-size);height:var(--ck-switch-button-toggle-inner-size);background:var(--ck-color-switch-button-inner-background);transition:all .3s ease}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var(--ck-switch-button-translation))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(var(--ck-switch-button-translation)*-1))}"},function(l,f,v){var w=v(1),b=v(26);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#000}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{width:var(--ck-color-grid-tile-size);height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{display:none;color:var(--ck-color-color-grid-check-icon)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}"},function(l,f,v){var w=v(1),b=v(28);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports='.ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button .ck-tooltip{display:none}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-top-right-radius:unset;border-bottom-right-radius:unset}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-top-left-radius:unset;border-bottom-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-top-left-radius:unset;border-bottom-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-top-right-radius:unset;border-bottom-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{content:"";position:absolute;width:1px;height:100%;background-color:var(--ck-color-split-button-hover-border)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{left:-1px}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{right:-1px}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}'},function(l,f,v){var w=v(1),b=v(30);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=":root{--ck-dropdown-max-width:75vw}.ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);max-width:var(--ck-dropdown-max-width);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{top:100%;bottom:auto}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-modal) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-dropdown__panel{border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0;background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}"},function(l,f,v){var w=v(1),b=v(32);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row nowrap;align-items:center}.ck.ck-toolbar>.ck-toolbar__items{display:flex;flex-flow:row wrap;align-items:center;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;width:1px;min-width:1px;background:var(--ck-color-toolbar-border);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-right:var(--ck-spacing-small)}"},function(l,f,v){var w=v(1),b=v(34);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;padding:calc(var(--ck-line-height-base)*0.2*var(--ck-font-size-base)) calc(var(--ck-line-height-base)*0.4*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(var(--ck-line-height-base)*1.2*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{height:1px;width:100%;background:var(--ck-color-base-border)}"},function(l,f,v){var w=v(1),b=v(36);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{width:max-content;max-width:var(--ck-toolbar-dropdown-max-width)}.ck.ck-toolbar-dropdown>.ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}"},function(l,f,v){var w=v(1),b=v(38);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}"},function(l,f,v){var w=v(1),b=v(40);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=":root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-focused{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0}.ck.ck-editor__editable_inline{overflow:auto;padding:0 var(--ck-spacing-standard);border:1px solid transparent}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}"},function(l,f,v){var w=v(1),b=v(42);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(l,f,v){var w=v(1),b=v(44);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-form__header{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{padding:var(--ck-spacing-small) var(--ck-spacing-large);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-form__header .ck-form__header__label{font-weight:700}"},function(l,f,v){var w=v(1),b=v(46);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"},function(l,f,v){var w=v(1),b=v(48);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{pointer-events:none;transform-origin:0 0;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);background:var(--ck-color-labeled-field-label-background);padding:0 calc(var(--ck-font-size-tiny)*0.5);line-height:normal;font-weight:400;text-overflow:ellipsis;overflow:hidden;max-width:100%;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-spacing-medium),calc(var(--ck-font-size-base)*0.6)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-spacing-medium)*-1),calc(var(--ck-font-size-base)*0.6)) scale(1)}.ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));background:transparent;padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}"},function(l,f,v){var w=v(1),b=v(50);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=':root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border);filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}'},function(l,f,v){var w=v(1),b=v(52);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck .ck-balloon-rotator__navigation{display:flex;align-items:center;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}"},function(l,f,v){var w=v(1),b=v(54);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);width:100%;height:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}"},function(l,f,v){var w=v(1),b=v(56);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}"},function(l,f,v){var w=v(1),b=v(58);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}"},function(l,f,v){var w=v(1),b=v(60);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-placeholder,.ck .ck-placeholder{position:relative}.ck.ck-placeholder:before,.ck .ck-placeholder:before{position:absolute;left:0;right:0;content:attr(data-placeholder);pointer-events:none}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-placeholder:before,.ck .ck-placeholder:before{cursor:text;color:var(--ck-color-engine-placeholder-text)}"},function(l,f,v){var w=v(1),b=v(62);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}"},function(l,f,v){var w=v(1),b=v(64);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports='.ck .ck-widget .ck-widget__type-around__button{display:block;position:absolute;overflow:hidden;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{position:absolute;top:50%;left:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{top:calc(var(--ck-widget-outline-thickness)*-0.5);left:min(10%,30px);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-0.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:"";display:block;position:absolute;top:1px;left:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;position:absolute;left:0;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{width:var(--ck-widget-type-around-button-size);height:var(--ck-widget-type-around-button-size);background:var(--ck-color-widget-type-around-button);border-radius:100px;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);opacity:0;pointer-events:none}.ck .ck-widget .ck-widget__type-around__button svg{width:10px;height:8px;transform:translate(-50%,-50%);transition:transform .5s ease;margin-top:1px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{width:calc(var(--ck-widget-type-around-button-size) - 2px);height:calc(var(--ck-widget-type-around-button-size) - 2px);border-radius:100px;background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3))}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{pointer-events:none;height:1px;animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;outline:1px solid hsla(0,0%,100%,.5);background:var(--ck-color-base-text)}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}'},function(l,f,v){var w=v(1),b=v(66);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px;--ck-resizer-tooltip-height:calc(var(--ck-spacing-small)*2 + 10px)}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);color:var(--ck-color-resizer-tooltip-text);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);font-size:var(--ck-font-size-tiny);display:block;padding:0 var(--ck-spacing-small);height:var(--ck-resizer-tooltip-height);line-height:var(--ck-resizer-tooltip-height)}.ck .ck-size-view.ck-orientation-above-center,.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{top:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{top:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-above-center{top:calc(var(--ck-resizer-tooltip-height)*-1);left:50%;transform:translate(-50%)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-width:var(--ck-widget-outline-thickness);outline-style:solid;outline-color:transparent;transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;background-color:var(--ck-color-widget-editable-focus-background)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{padding:4px;box-sizing:border-box;background-color:transparent;opacity:0;transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;transform:translateY(-100%);left:calc(0px - var(--ck-widget-outline-thickness));top:0}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{width:var(--ck-widget-handler-icon-size);height:var(--ck-widget-handler-icon-size);color:var(--ck-color-widget-drag-handler-icon-color)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}"},function(l,f,v){var w=v(1),b=v(68);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports='.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;position:relative;pointer-events:none}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);border:1px solid var(--ck-clipboard-drop-target-color);background:var(--ck-clipboard-drop-target-color);margin-left:-1px}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{content:"";width:0;height:0;display:block;position:absolute;left:50%;top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);transform:translateX(-50%);border-left:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-bottom:0 solid transparent;border-right:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-top:calc(var(--ck-clipboard-drop-target-dot-height)) solid var(--ck-clipboard-drop-target-color)}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}'},function(l,f,v){var w=v(1),b=v(70);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}"},function(l,f){l.exports=".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}"},function(l,f,v){var w=v(1),b=v(73);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;position:absolute;pointer-events:none;left:0;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{position:absolute;pointer-events:all}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{width:var(--ck-resizer-size);height:var(--ck-resizer-size);background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{top:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{top:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}"},function(l,f,v){var w=v(1),b=v(75);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}"},function(l,f){l.exports='.ck-vertical-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-text-width)*0.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-large);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after,[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}'},function(l,f){l.exports=".ck-content .image{display:table;clear:both;text-align:center;margin:.9em auto;min-width:50px}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:100%}.ck-content .image-inline{display:inline-flex;max-width:100%;align-items:flex-start}.ck-content .image-inline picture{display:flex}.ck-content .image-inline img,.ck-content .image-inline picture{flex-grow:1;flex-shrink:1;max-width:100%}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{padding-left:inherit;padding-right:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ck.ck-editor__editable .image-inline.ck-widget_selected,.ck.ck-editor__editable .image.ck-widget_selected{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{display:none}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}"},function(l,f,v){var w=v(1),b=v(79);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=":root{--ck-color-image-caption-background:#f7f7f7;--ck-color-image-caption-text:#333;--ck-color-image-caption-highligted-background:#fd0}.ck-content .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:var(--ck-color-image-caption-text);background-color:var(--ck-color-image-caption-background);padding:.6em;font-size:.75em;outline-offset:-1px}.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:ck-image-caption-highlight .6s ease-out}@keyframes ck-image-caption-highlight{0%{background-color:var(--ck-color-image-caption-highligted-background)}to{background-color:var(--ck-color-image-caption-background)}}"},function(l,f,v){var w=v(1),b=v(81);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=":root{--ck-image-style-spacing:1.5em;--ck-inline-image-style-spacing:calc(var(--ck-image-style-spacing)/2)}.ck-content .image-style-block-align-left,.ck-content .image-style-block-align-right{max-width:calc(100% - var(--ck-image-style-spacing))}.ck-content .image-style-align-left,.ck-content .image-style-align-right{clear:none}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content .image-style-block-align-right{margin-right:0;margin-left:auto}.ck-content .image-style-block-align-left{margin-left:0;margin-right:auto}.ck-content p+.image-style-align-left,.ck-content p+.image-style-align-right,.ck-content p+.image-style-side{margin-top:0}.ck-content .image-inline.image-style-align-left,.ck-content .image-inline.image-style-align-right{margin-top:var(--ck-inline-image-style-spacing);margin-bottom:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-left{margin-right:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-right{margin-left:var(--ck-inline-image-style-spacing)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-background)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after{display:none}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-hover-background)}"},function(l,f,v){var w=v(1),b=v(83);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-editor__editable .image,.ck.ck-editor__editable .image-inline{position:relative}.ck.ck-editor__editable .image-inline .ck-progress-bar,.ck.ck-editor__editable .image .ck-progress-bar{position:absolute;top:0;left:0}.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image-inline .ck-progress-bar,.ck.ck-editor__editable .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}"},function(l,f,v){var w=v(1),b=v(85);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports='.ck-image-upload-complete-icon{display:block;position:absolute;top:min(var(--ck-spacing-medium),6%);right:min(var(--ck-spacing-medium),6%);border-radius:50%;z-index:1}.ck-image-upload-complete-icon:after{content:"";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20;--ck-image-upload-icon-width:2px;--ck-image-upload-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck-image-upload-complete-icon{opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:calc(1px*var(--ck-image-upload-icon-size));animation-delay:0ms,3s;overflow:hidden;width:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size));height:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size))}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}'},function(l,f,v){var w=v(1),b=v(87);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports='.ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}'},function(l,f,v){var w=v(1),b=v(89);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-link_selected span.image-inline{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{height:100%;border-right:1px solid var(--ck-color-base-text);margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}"},function(l,f,v){var w=v(1),b=v(91);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}"},function(l,f,v){var w=v(1),b=v(93);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}"},function(l,f,v){var w=v(1),b=v(95);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports='.ck-media__wrapper .ck-media__placeholder{display:flex;flex-direction:column;align-items:center}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:block}@media (hover:none){.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:none}}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url{max-width:100%;position:relative}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url:hover .ck-tooltip{visibility:visible;opacity:1}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-media__placeholder__url__text{overflow:hidden;display:block}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck-media__placeholder__icon *{display:none}.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper>:not(.ck-media__placeholder),.ck-editor__editable:not(.ck-read-only) .ck-widget:not(.ck-widget_selected) .ck-media__placeholder{pointer-events:none}:root{--ck-media-embed-placeholder-icon-size:3em;--ck-color-media-embed-placeholder-url-text:#757575;--ck-color-media-embed-placeholder-url-text-hover:var(--ck-color-base-text)}.ck-media__wrapper{margin:0 auto}.ck-media__wrapper .ck-media__placeholder{padding:calc(var(--ck-spacing-standard)*3);background:var(--ck-color-base-foreground)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon{min-width:var(--ck-media-embed-placeholder-icon-size);height:var(--ck-media-embed-placeholder-icon-size);margin-bottom:var(--ck-spacing-large);background-position:50%;background-size:cover}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon .ck-icon{width:100%;height:100%}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text{color:var(--ck-color-media-embed-placeholder-url-text);white-space:nowrap;text-align:center;font-style:italic;text-overflow:ellipsis}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:var(--ck-color-media-embed-placeholder-url-text-hover);cursor:pointer;text-decoration:underline}.ck-media__wrapper[data-oembed-url*="open.spotify.com"]{max-width:300px;max-height:380px}.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSkgc2NhbGUoLjk4MDEyKSI+PHJlY3Qgcnk9IjUuMjM4IiByeD0iNS4yMzgiIHk9IjIzMS4zOTkiIHg9IjE3Ni4wMzEiIGhlaWdodD0iNjAuMDk5IiB3aWR0aD0iNjAuMDk5IiBmaWxsPSIjMzRhNjY4IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0yMDYuNDc3IDI2MC45bC0yOC45ODcgMjguOTg3YTUuMjE4IDUuMjE4IDAgMDAzLjc4IDEuNjFoNDkuNjIxYzEuNjk0IDAgMy4xOS0uNzk4IDQuMTQ2LTIuMDM3eiIgZmlsbD0iIzVjODhjNSIvPjxwYXRoIGQ9Ik0yMjYuNzQyIDIyMi45ODhjLTkuMjY2IDAtMTYuNzc3IDcuMTctMTYuNzc3IDE2LjAxNC4wMDcgMi43NjIuNjYzIDUuNDc0IDIuMDkzIDcuODc1LjQzLjcwMy44MyAxLjQwOCAxLjE5IDIuMTA3LjMzMy41MDIuNjUgMS4wMDUuOTUgMS41MDguMzQzLjQ3Ny42NzMuOTU3Ljk4OCAxLjQ0IDEuMzEgMS43NjkgMi41IDMuNTAyIDMuNjM3IDUuMTY4Ljc5MyAxLjI3NSAxLjY4MyAyLjY0IDIuNDY2IDMuOTkgMi4zNjMgNC4wOTQgNC4wMDcgOC4wOTIgNC42IDEzLjkxNHYuMDEyYy4xODIuNDEyLjUxNi42NjYuODc5LjY2Ny40MDMtLjAwMS43NjgtLjMxNC45My0uNzk5LjYwMy01Ljc1NiAyLjIzOC05LjcyOSA0LjU4NS0xMy43OTQuNzgyLTEuMzUgMS42NzMtMi43MTUgMi40NjUtMy45OSAxLjEzNy0xLjY2NiAyLjMyOC0zLjQgMy42MzgtNS4xNjkuMzE1LS40ODIuNjQ1LS45NjIuOTg4LTEuNDM5LjMtLjUwMy42MTctMS4wMDYuOTUtMS41MDguMzU5LS43Ljc2LTEuNDA0IDEuMTktMi4xMDcgMS40MjYtMi40MDIgMi01LjExNCAyLjAwNC03Ljg3NSAwLTguODQ0LTcuNTExLTE2LjAxNC0xNi43NzYtMTYuMDE0eiIgZmlsbD0iI2RkNGIzZSIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48ZWxsaXBzZSByeT0iNS41NjQiIHJ4PSI1LjgyOCIgY3k9IjIzOS4wMDIiIGN4PSIyMjYuNzQyIiBmaWxsPSIjODAyZDI3IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0xOTAuMzAxIDIzNy4yODNjLTQuNjcgMC04LjQ1NyAzLjg1My04LjQ1NyA4LjYwNnMzLjc4NiA4LjYwNyA4LjQ1NyA4LjYwN2MzLjA0MyAwIDQuODA2LS45NTggNi4zMzctMi41MTYgMS41My0xLjU1NyAyLjA4Ny0zLjkxMyAyLjA4Ny02LjI5IDAtLjM2Mi0uMDIzLS43MjItLjA2NC0xLjA3OWgtOC4yNTd2My4wNDNoNC44NWMtLjE5Ny43NTktLjUzMSAxLjQ1LTEuMDU4IDEuOTg2LS45NDIuOTU4LTIuMDI4IDEuNTQ4LTMuOTAxIDEuNTQ4LTIuODc2IDAtNS4yMDgtMi4zNzItNS4yMDgtNS4yOTkgMC0yLjkyNiAyLjMzMi01LjI5OSA1LjIwOC01LjI5OSAxLjM5OSAwIDIuNjE4LjQwNyAzLjU4NCAxLjI5M2wyLjM4MS0yLjM4YzAtLjAwMi0uMDAzLS4wMDQtLjAwNC0uMDA1LTEuNTg4LTEuNTI0LTMuNjItMi4yMTUtNS45NTUtMi4yMTV6bTQuNDMgNS42NmwuMDAzLjAwNnYtLjAwM3oiIGZpbGw9IiNmZmYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTIxNS4xODQgMjUxLjkyOWwtNy45OCA3Ljk3OSAyOC40NzcgMjguNDc1YTUuMjMzIDUuMjMzIDAgMDAuNDQ5LTIuMTIzdi0zMS4xNjVjLS40NjkuNjc1LS45MzQgMS4zNDktMS4zODIgMi4wMDUtLjc5MiAxLjI3NS0xLjY4MiAyLjY0LTIuNDY1IDMuOTktMi4zNDcgNC4wNjUtMy45ODIgOC4wMzgtNC41ODUgMTMuNzk0LS4xNjIuNDg1LS41MjcuNzk4LS45My43OTktLjM2My0uMDAxLS42OTctLjI1NS0uODc5LS42Njd2LS4wMTJjLS41OTMtNS44MjItMi4yMzctOS44Mi00LjYtMTMuOTE0LS43ODMtMS4zNS0xLjY3My0yLjcxNS0yLjQ2Ni0zLjk5LTEuMTM3LTEuNjY2LTIuMzI3LTMuNC0zLjYzNy01LjE2OWwtLjAwMi0uMDAzeiIgZmlsbD0iI2MzYzNjMyIvPjxwYXRoIGQ9Ik0yMTIuOTgzIDI0OC40OTVsLTM2Ljk1MiAzNi45NTN2LjgxMmE1LjIyNyA1LjIyNyAwIDAwNS4yMzggNS4yMzhoMS4wMTVsMzUuNjY2LTM1LjY2NmExMzYuMjc1IDEzNi4yNzUgMCAwMC0yLjc2NC0zLjkgMzcuNTc1IDM3LjU3NSAwIDAwLS45ODktMS40NCAzNS4xMjcgMzUuMTI3IDAgMDAtLjk1LTEuNTA4Yy0uMDgzLS4xNjItLjE3Ni0uMzI2LS4yNjQtLjQ4OXoiIGZpbGw9IiNmZGRjNGYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTIxMS45OTggMjYxLjA4M2wtNi4xNTIgNi4xNTEgMjQuMjY0IDI0LjI2NGguNzgxYTUuMjI3IDUuMjI3IDAgMDA1LjIzOS01LjIzOHYtMS4wNDV6IiBmaWxsPSIjZmZmIiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjwvZz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder{background:#4268b3}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik05NjcuNDg0IDBINTYuNTE3QzI1LjMwNCAwIDAgMjUuMzA0IDAgNTYuNTE3djkxMC45NjZDMCA5OTguNjk0IDI1LjI5NyAxMDI0IDU2LjUyMiAxMDI0SDU0N1Y2MjhINDE0VjQ3M2gxMzNWMzU5LjAyOWMwLTEzMi4yNjIgODAuNzczLTIwNC4yODIgMTk4Ljc1Ni0yMDQuMjgyIDU2LjUxMyAwIDEwNS4wODYgNC4yMDggMTE5LjI0NCA2LjA4OVYyOTlsLTgxLjYxNi4wMzdjLTYzLjk5MyAwLTc2LjM4NCAzMC40OTItNzYuMzg0IDc1LjIzNlY0NzNoMTUzLjQ4N2wtMTkuOTg2IDE1NUg3MDd2Mzk2aDI2MC40ODRjMzEuMjEzIDAgNTYuNTE2LTI1LjMwMyA1Ni41MTYtNTYuNTE2VjU2LjUxNUMxMDI0IDI1LjMwMyA5OTguNjk3IDAgOTY3LjQ4NCAwIiBmaWxsPSIjRkZGRkZFIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#cdf}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder{background:linear-gradient(-135deg,#1400c7,#b800b1,#f50000)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTA0IiBoZWlnaHQ9IjUwNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIC4xNTloNTAzLjg0MVY1MDMuOTRIMHoiLz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48bWFzayBpZD0iYiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48cGF0aCBkPSJNMjUxLjkyMS4xNTljLTY4LjQxOCAwLTc2Ljk5Ny4yOS0xMDMuODY3IDEuNTE2LTI2LjgxNCAxLjIyMy00NS4xMjcgNS40ODItNjEuMTUxIDExLjcxLTE2LjU2NiA2LjQzNy0zMC42MTUgMTUuMDUxLTQ0LjYyMSAyOS4wNTYtMTQuMDA1IDE0LjAwNi0yMi42MTkgMjguMDU1LTI5LjA1NiA0NC42MjEtNi4yMjggMTYuMDI0LTEwLjQ4NyAzNC4zMzctMTEuNzEgNjEuMTUxQy4yOSAxNzUuMDgzIDAgMTgzLjY2MiAwIDI1Mi4wOGMwIDY4LjQxNy4yOSA3Ni45OTYgMS41MTYgMTAzLjg2NiAxLjIyMyAyNi44MTQgNS40ODIgNDUuMTI3IDExLjcxIDYxLjE1MSA2LjQzNyAxNi41NjYgMTUuMDUxIDMwLjYxNSAyOS4wNTYgNDQuNjIxIDE0LjAwNiAxNC4wMDUgMjguMDU1IDIyLjYxOSA0NC42MjEgMjkuMDU3IDE2LjAyNCA2LjIyNyAzNC4zMzcgMTAuNDg2IDYxLjE1MSAxMS43MDkgMjYuODcgMS4yMjYgMzUuNDQ5IDEuNTE2IDEwMy44NjcgMS41MTYgNjguNDE3IDAgNzYuOTk2LS4yOSAxMDMuODY2LTEuNTE2IDI2LjgxNC0xLjIyMyA0NS4xMjctNS40ODIgNjEuMTUxLTExLjcwOSAxNi41NjYtNi40MzggMzAuNjE1LTE1LjA1MiA0NC42MjEtMjkuMDU3IDE0LjAwNS0xNC4wMDYgMjIuNjE5LTI4LjA1NSAyOS4wNTctNDQuNjIxIDYuMjI3LTE2LjAyNCAxMC40ODYtMzQuMzM3IDExLjcwOS02MS4xNTEgMS4yMjYtMjYuODcgMS41MTYtMzUuNDQ5IDEuNTE2LTEwMy44NjYgMC02OC40MTgtLjI5LTc2Ljk5Ny0xLjUxNi0xMDMuODY3LTEuMjIzLTI2LjgxNC01LjQ4Mi00NS4xMjctMTEuNzA5LTYxLjE1MS02LjQzOC0xNi41NjYtMTUuMDUyLTMwLjYxNS0yOS4wNTctNDQuNjIxLTE0LjAwNi0xNC4wMDUtMjguMDU1LTIyLjYxOS00NC42MjEtMjkuMDU2LTE2LjAyNC02LjIyOC0zNC4zMzctMTAuNDg3LTYxLjE1MS0xMS43MUMzMjguOTE3LjQ0OSAzMjAuMzM4LjE1OSAyNTEuOTIxLjE1OXptMCA0NS4zOTFjNjcuMjY1IDAgNzUuMjMzLjI1NyAxMDEuNzk3IDEuNDY5IDI0LjU2MiAxLjEyIDM3LjkwMSA1LjIyNCA0Ni43NzggOC42NzQgMTEuNzU5IDQuNTcgMjAuMTUxIDEwLjAyOSAyOC45NjYgMTguODQ1IDguODE2IDguODE1IDE0LjI3NSAxNy4yMDcgMTguODQ1IDI4Ljk2NiAzLjQ1IDguODc3IDcuNTU0IDIyLjIxNiA4LjY3NCA0Ni43NzggMS4yMTIgMjYuNTY0IDEuNDY5IDM0LjUzMiAxLjQ2OSAxMDEuNzk4IDAgNjcuMjY1LS4yNTcgNzUuMjMzLTEuNDY5IDEwMS43OTctMS4xMiAyNC41NjItNS4yMjQgMzcuOTAxLTguNjc0IDQ2Ljc3OC00LjU3IDExLjc1OS0xMC4wMjkgMjAuMTUxLTE4Ljg0NSAyOC45NjYtOC44MTUgOC44MTYtMTcuMjA3IDE0LjI3NS0yOC45NjYgMTguODQ1LTguODc3IDMuNDUtMjIuMjE2IDcuNTU0LTQ2Ljc3OCA4LjY3NC0yNi41NiAxLjIxMi0zNC41MjcgMS40NjktMTAxLjc5NyAxLjQ2OS02Ny4yNzEgMC03NS4yMzctLjI1Ny0xMDEuNzk4LTEuNDY5LTI0LjU2Mi0xLjEyLTM3LjkwMS01LjIyNC00Ni43NzgtOC42NzQtMTEuNzU5LTQuNTctMjAuMTUxLTEwLjAyOS0yOC45NjYtMTguODQ1LTguODE1LTguODE1LTE0LjI3NS0xNy4yMDctMTguODQ1LTI4Ljk2Ni0zLjQ1LTguODc3LTcuNTU0LTIyLjIxNi04LjY3NC00Ni43NzgtMS4yMTItMjYuNTY0LTEuNDY5LTM0LjUzMi0xLjQ2OS0xMDEuNzk3IDAtNjcuMjY2LjI1Ny03NS4yMzQgMS40NjktMTAxLjc5OCAxLjEyLTI0LjU2MiA1LjIyNC0zNy45MDEgOC42NzQtNDYuNzc4IDQuNTctMTEuNzU5IDEwLjAyOS0yMC4xNTEgMTguODQ1LTI4Ljk2NiA4LjgxNS04LjgxNiAxNy4yMDctMTQuMjc1IDI4Ljk2Ni0xOC44NDUgOC44NzctMy40NSAyMi4yMTYtNy41NTQgNDYuNzc4LTguNjc0IDI2LjU2NC0xLjIxMiAzNC41MzItMS40NjkgMTAxLjc5OC0xLjQ2OXoiIGZpbGw9IiNGRkYiIG1hc2s9InVybCgjYikiLz48cGF0aCBkPSJNMjUxLjkyMSAzMzYuMDUzYy00Ni4zNzggMC04My45NzQtMzcuNTk2LTgzLjk3NC04My45NzMgMC00Ni4zNzggMzcuNTk2LTgzLjk3NCA4My45NzQtODMuOTc0IDQ2LjM3NyAwIDgzLjk3MyAzNy41OTYgODMuOTczIDgzLjk3NCAwIDQ2LjM3Ny0zNy41OTYgODMuOTczLTgzLjk3MyA4My45NzN6bTAtMjEzLjMzOGMtNzEuNDQ3IDAtMTI5LjM2NSA1Ny45MTgtMTI5LjM2NSAxMjkuMzY1IDAgNzEuNDQ2IDU3LjkxOCAxMjkuMzY0IDEyOS4zNjUgMTI5LjM2NCA3MS40NDYgMCAxMjkuMzY0LTU3LjkxOCAxMjkuMzY0LTEyOS4zNjQgMC03MS40NDctNTcuOTE4LTEyOS4zNjUtMTI5LjM2NC0xMjkuMzY1ek00MTYuNjI3IDExNy42MDRjMCAxNi42OTYtMTMuNTM1IDMwLjIzLTMwLjIzMSAzMC4yMy0xNi42OTUgMC0zMC4yMy0xMy41MzQtMzAuMjMtMzAuMjMgMC0xNi42OTYgMTMuNTM1LTMwLjIzMSAzMC4yMy0zMC4yMzEgMTYuNjk2IDAgMzAuMjMxIDEzLjUzNSAzMC4yMzEgMzAuMjMxIiBmaWxsPSIjRkZGIi8+PC9nPjwvc3ZnPg==)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#ffe0fe}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder{background:linear-gradient(90deg,#71c6f4,#0d70a5)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBkPSJNNDAwIDIwMGMwIDExMC41LTg5LjUgMjAwLTIwMCAyMDBTMCAzMTAuNSAwIDIwMCA4OS41IDAgMjAwIDBzMjAwIDg5LjUgMjAwIDIwMHpNMTYzLjQgMzA1LjVjODguNyAwIDEzNy4yLTczLjUgMTM3LjItMTM3LjIgMC0yLjEgMC00LjItLjEtNi4yIDkuNC02LjggMTcuNi0xNS4zIDI0LjEtMjUtOC42IDMuOC0xNy45IDYuNC0yNy43IDcuNiAxMC02IDE3LjYtMTUuNCAyMS4yLTI2LjctOS4zIDUuNS0xOS42IDkuNS0zMC42IDExLjctOC44LTkuNC0yMS4zLTE1LjItMzUuMi0xNS4yLTI2LjYgMC00OC4yIDIxLjYtNDguMiA0OC4yIDAgMy44LjQgNy41IDEuMyAxMS00MC4xLTItNzUuNi0yMS4yLTk5LjQtNTAuNC00LjEgNy4xLTYuNSAxNS40LTYuNSAyNC4yIDAgMTYuNyA4LjUgMzEuNSAyMS41IDQwLjEtNy45LS4yLTE1LjMtMi40LTIxLjgtNnYuNmMwIDIzLjQgMTYuNiA0Mi44IDM4LjcgNDcuMy00IDEuMS04LjMgMS43LTEyLjcgMS43LTMuMSAwLTYuMS0uMy05LjEtLjkgNi4xIDE5LjIgMjMuOSAzMy4xIDQ1IDMzLjUtMTYuNSAxMi45LTM3LjMgMjAuNi01OS45IDIwLjYtMy45IDAtNy43LS4yLTExLjUtLjcgMjEuMSAxMy44IDQ2LjUgMjEuOCA3My43IDIxLjgiIGZpbGw9IiNmZmYiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text{color:#b8e6ff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}'},function(l,f,v){var w=v(1),b=v(97);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck.ck-media-form{display:flex;align-items:flex-start;flex-direction:row;flex-wrap:nowrap}.ck.ck-media-form .ck-labeled-field-view{display:inline-block}.ck.ck-media-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-media-form{flex-wrap:wrap}.ck.ck-media-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-media-form .ck-button{flex-basis:50%}}"},function(l,f,v){var w=v(1),b=v(99);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck-content .media{clear:both;margin:.9em 0;display:block;min-width:15em}"},function(l,f,v){var w=v(1),b=v(101);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=":root{--ck-color-table-focused-cell-background:rgba(158,207,250,0.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}"},function(l,f,v){var w=v(1),b=v(103);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-color-base-border);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-color-focus-border);background:var(--ck-color-focus-outer-shadow)}"},function(l,f,v){var w=v(1),b=v(105);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=':root{--ck-table-selected-cell-background:rgba(158,207,250,0.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{position:relative;caret-color:transparent;outline:unset;box-shadow:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{content:"";pointer-events:none;background-color:var(--ck-table-selected-cell-background);position:absolute;top:0;left:0;right:0;bottom:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget_selected{outline:unset}'},function(l,f,v){var w=v(1),b=v(107);typeof(b=b.__esModule?b.default:b)=="string"&&(b=[[l.i,b,""]]);var T={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(b,T),l.exports=b.locals||{}},function(l,f){l.exports=".ck-content .table{margin:.9em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;width:100%;height:100%;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border:1px solid #bfbfbf}.ck-content .table table th{font-weight:700;background:hsla(0,0%,0%,5%)}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}.ck-editor__editable .ck-table-bogus-paragraph{display:inline-block;width:100%}"},function(l,f,v){v.r(f),v.d(f,"default",function(){return yv});var w=function(){return function r(){r.called=!0}};class b{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=w(),this.off=w()}}const T=new Array(256).fill().map((r,e)=>("0"+e.toString(16)).slice(-2));function P(){const r=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0;return"e"+T[r>>0&255]+T[r>>8&255]+T[r>>16&255]+T[r>>24&255]+T[e>>0&255]+T[e>>8&255]+T[e>>16&255]+T[e>>24&255]+T[t>>0&255]+T[t>>8&255]+T[t>>16&255]+T[t>>24&255]+T[n>>0&255]+T[n>>8&255]+T[n>>16&255]+T[n>>24&255]}var B={get(r){return typeof r!="number"?this[r]||this.normal:r},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5},y=(v(6),v(0));const L=Symbol("listeningTo"),O=Symbol("emitterId");var V={on(r,e,t={}){this.listenTo(this,r,e,t)},once(r,e,t){let n=!1;this.listenTo(this,r,function(i,...o){n||(n=!0,i.off(),e.call(this,i,...o))},t)},off(r,e){this.stopListening(this,r,e)},listenTo(r,e,t,n={}){let i,o;this[L]||(this[L]={});const a=this[L];Z(r)||F(r);const c=Z(r);(i=a[c])||(i=a[c]={emitter:r,callbacks:{}}),(o=i.callbacks[e])||(o=i.callbacks[e]=[]),o.push(t),function(u,h,m,k,C){h._addEventListener?h._addEventListener(m,k,C):u._addEventListener.call(h,m,k,C)}(this,r,e,t,n)},stopListening(r,e,t){const n=this[L];let i=r&&Z(r);const o=n&&i&&n[i],a=o&&e&&o.callbacks[e];if(!(!n||r&&!o||e&&!a))if(t)ee(this,r,e,t),a.indexOf(t)!==-1&&(a.length===1?delete o.callbacks[e]:ee(this,r,e,t));else if(a){for(;t=a.pop();)ee(this,r,e,t);delete o.callbacks[e]}else if(o){for(e in o.callbacks)this.stopListening(r,e);delete n[i]}else{for(i in n)this.stopListening(n[i].emitter);delete this[L]}},fire(r,...e){try{const t=r instanceof b?r:new b(this,r),n=t.name;let i=function o(a,c){let u;return!a._events||!(u=a._events[c])||!u.callbacks.length?c.indexOf(":")>-1?o(a,c.substr(0,c.lastIndexOf(":"))):null:u.callbacks}(this,n);if(t.path.push(this),i){const o=[t,...e];i=Array.from(i);for(let a=0;a<i.length&&(i[a].callback.apply(this,o),t.off.called&&(delete t.off.called,this._removeEventListener(n,i[a].callback)),!t.stop.called);a++);}if(this._delegations){const o=this._delegations.get(n),a=this._delegations.get("*");o&&ne(o,t,e),a&&ne(a,t,e)}return t.return}catch(t){y.a.rethrowUnexpectedError(t,this)}},delegate(...r){return{to:(e,t)=>{this._delegations||(this._delegations=new Map),r.forEach(n=>{const i=this._delegations.get(n);i?i.set(e,t):this._delegations.set(n,new Map([[e,t]]))})}}},stopDelegating(r,e){if(this._delegations)if(r)if(e){const t=this._delegations.get(r);t&&t.delete(e)}else this._delegations.delete(r);else this._delegations.clear()},_addEventListener(r,e,t){(function(a,c){const u=G(a);if(u[c])return;let h=c,m=null;const k=[];for(;h!==""&&!u[h];)u[h]={callbacks:[],childEvents:[]},k.push(u[h]),m&&u[h].childEvents.push(m),m=h,h=h.substr(0,h.lastIndexOf(":"));if(h!==""){for(const C of k)C.callbacks=u[h].callbacks.slice();u[h].childEvents.push(m)}})(this,r);const n=Q(this,r),i=B.get(t.priority),o={callback:e,priority:i};for(const a of n){let c=!1;for(let u=0;u<a.length;u++)if(a[u].priority<i){a.splice(u,0,o),c=!0;break}c||a.push(o)}},_removeEventListener(r,e){const t=Q(this,r);for(const n of t)for(let i=0;i<n.length;i++)n[i].callback==e&&(n.splice(i,1),i--)}};function F(r,e){r[O]||(r[O]=e||P())}function Z(r){return r[O]}function G(r){return r._events||Object.defineProperty(r,"_events",{value:{}}),r._events}function Q(r,e){const t=G(r)[e];if(!t)return[];let n=[t.callbacks];for(let i=0;i<t.childEvents.length;i++){const o=Q(r,t.childEvents[i]);n=n.concat(o)}return n}function ne(r,e,t){for(let[n,i]of r){i?typeof i=="function"&&(i=i(e.name)):i=e.name;const o=new b(e.source,i);o.path=[...e.path],n.fire(o,...t)}}function ee(r,e,t,n){e._removeEventListener?e._removeEventListener(t,n):r._removeEventListener.call(e,t,n)}var oe=function(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")},re=v(3),be=re.a.Symbol,we=Object.prototype,Ae=we.hasOwnProperty,Ee=we.toString,Ne=be?be.toStringTag:void 0,ie=function(r){var e=Ae.call(r,Ne),t=r[Ne];try{r[Ne]=void 0;var n=!0}catch{}var i=Ee.call(r);return n&&(e?r[Ne]=t:delete r[Ne]),i},fe=Object.prototype.toString,_e=function(r){return fe.call(r)},ve=be?be.toStringTag:void 0,ke=function(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":ve&&ve in Object(r)?ie(r):_e(r)},Se,Pe=function(r){if(!oe(r))return!1;var e=ke(r);return e=="[object Function]"||e=="[object GeneratorFunction]"||e=="[object AsyncFunction]"||e=="[object Proxy]"},Oe=re.a["__core-js_shared__"],nt=(Se=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+Se:"",$e=function(r){return!!nt&&nt in r},De=Function.prototype.toString,et=function(r){if(r!=null){try{return De.call(r)}catch{}try{return r+""}catch{}}return""},Ie=/^\[object .+?Constructor\]$/,He=Function.prototype,Ve=Object.prototype,Re=He.toString,gt=Ve.hasOwnProperty,rt=RegExp("^"+Re.call(gt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qe=function(r){return!(!oe(r)||$e(r))&&(Pe(r)?rt:Ie).test(et(r))},lt=function(r,e){return r==null?void 0:r[e]},Ye=function(r,e){var t=lt(r,e);return qe(t)?t:void 0},en=function(){try{var r=Ye(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Vn=function(r,e,t){e=="__proto__"&&en?en(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t},xe=function(r,e){return r===e||r!=r&&e!=e},Fe=Object.prototype.hasOwnProperty,St=function(r,e,t){var n=r[e];Fe.call(r,e)&&xe(n,t)&&(t!==void 0||e in r)||Vn(r,e,t)},Et=function(r,e,t,n){var i=!t;t||(t={});for(var o=-1,a=e.length;++o<a;){var c=e[o],u=n?n(t[c],r[c],c,t,r):void 0;u===void 0&&(u=r[c]),i?Vn(t,c,u):St(t,c,u)}return t},hn=function(r){return r},Yn=function(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)},Sn=Math.max,rn=function(r,e,t){return e=Sn(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,o=Sn(n.length-e,0),a=Array(o);++i<o;)a[i]=n[e+i];i=-1;for(var c=Array(e+1);++i<e;)c[i]=n[i];return c[e]=t(a),Yn(r,this,c)}},Bi=function(r){return function(){return r}},uo=en?function(r,e){return en(r,"toString",{configurable:!0,enumerable:!1,value:Bi(e),writable:!0})}:hn,ua=Date.now,$n=function(r){var e=0,t=0;return function(){var n=ua(),i=16-(n-t);if(t=n,i>0){if(++e>=800)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}(uo),bs=function(r,e){return $n(rn(r,e,hn),r+"")},ur=function(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=9007199254740991},wi=function(r){return r!=null&&ur(r.length)&&!Pe(r)},ho=/^(?:0|[1-9]\d*)$/,Gi=function(r,e){var t=typeof r;return!!(e=e??9007199254740991)&&(t=="number"||t!="symbol"&&ho.test(r))&&r>-1&&r%1==0&&r<e},fo=function(r,e,t){if(!oe(t))return!1;var n=typeof e;return!!(n=="number"?wi(t)&&Gi(e,t.length):n=="string"&&e in t)&&xe(t[e],r)},po=function(r){return bs(function(e,t){var n=-1,i=t.length,o=i>1?t[i-1]:void 0,a=i>2?t[2]:void 0;for(o=r.length>3&&typeof o=="function"?(i--,o):void 0,a&&fo(t[0],t[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var c=t[n];c&&r(e,c,n,o)}return e})},go=function(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n},Yt=function(r){return r!=null&&typeof r=="object"},Gt=function(r){return Yt(r)&&ke(r)=="[object Arguments]"},an=Object.prototype,ln=an.hasOwnProperty,kn=an.propertyIsEnumerable,bn=Gt(function(){return arguments}())?Gt:function(r){return Yt(r)&&ln.call(r,"callee")&&!kn.call(r,"callee")},Pt=Array.isArray,ki=v(4),It={};It["[object Float32Array]"]=It["[object Float64Array]"]=It["[object Int8Array]"]=It["[object Int16Array]"]=It["[object Int32Array]"]=It["[object Uint8Array]"]=It["[object Uint8ClampedArray]"]=It["[object Uint16Array]"]=It["[object Uint32Array]"]=!0,It["[object Arguments]"]=It["[object Array]"]=It["[object ArrayBuffer]"]=It["[object Boolean]"]=It["[object DataView]"]=It["[object Date]"]=It["[object Error]"]=It["[object Function]"]=It["[object Map]"]=It["[object Number]"]=It["[object Object]"]=It["[object RegExp]"]=It["[object Set]"]=It["[object String]"]=It["[object WeakMap]"]=!1;var yi=function(r){return Yt(r)&&ur(r.length)&&!!It[ke(r)]},oi=function(r){return function(e){return r(e)}},si=v(5),Tl=si.a&&si.a.isTypedArray,vs=Tl?oi(Tl):yi,md=Object.prototype.hasOwnProperty,Al=function(r,e){var t=Pt(r),n=!t&&bn(r),i=!t&&!n&&Object(ki.a)(r),o=!t&&!n&&!i&&vs(r),a=t||n||i||o,c=a?go(r.length,String):[],u=c.length;for(var h in r)!e&&!md.call(r,h)||a&&(h=="length"||i&&(h=="offset"||h=="parent")||o&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Gi(h,u))||c.push(h);return c},bd=Object.prototype,Fo=function(r){var e=r&&r.constructor;return r===(typeof e=="function"&&e.prototype||bd)},vd=function(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e},ha=Object.prototype.hasOwnProperty,_d=function(r){if(!oe(r))return vd(r);var e=Fo(r),t=[];for(var n in r)(n!="constructor"||!e&&ha.call(r,n))&&t.push(n);return t},xi=function(r){return wi(r)?Al(r,!0):_d(r)},mo=po(function(r,e){Et(e,xi(e),r)});const _s=Symbol("observableProperties"),ws=Symbol("boundObservables"),Vr=Symbol("boundProperties"),bo=Symbol("decoratedMethods"),Sl=Symbol("decoratedOriginal"),ks={set(r,e){if(oe(r))return void Object.keys(r).forEach(n=>{this.set(n,r[n])},this);$r(this);const t=this[_s];if(r in this&&!t.has(r))throw new y.a("observable-set-cannot-override",this);Object.defineProperty(this,r,{enumerable:!0,configurable:!0,get:()=>t.get(r),set(n){const i=t.get(r);let o=this.fire("set:"+r,r,n,i);o===void 0&&(o=n),i===o&&t.has(r)||(t.set(r,o),this.fire("change:"+r,r,o,i))}}),this[r]=e},bind(...r){if(!r.length||!El(r))throw new y.a("observable-bind-wrong-properties",this);if(new Set(r).size!==r.length)throw new y.a("observable-bind-duplicate-properties",this);$r(this);const e=this[Vr];r.forEach(n=>{if(e.has(n))throw new y.a("observable-bind-rebind",this)});const t=new Map;return r.forEach(n=>{const i={property:n,to:[]};e.set(n,i),t.set(n,i)}),{to:wd,toMany:kd,_observable:this,_bindProperties:r,_to:[],_bindings:t}},unbind(...r){if(!this[_s])return;const e=this[Vr],t=this[ws];if(r.length){if(!El(r))throw new y.a("observable-unbind-wrong-properties",this);r.forEach(n=>{const i=e.get(n);if(!i)return;let o,a,c,u;i.to.forEach(h=>{o=h[0],a=h[1],c=t.get(o),u=c[a],u.delete(i),u.size||delete c[a],Object.keys(c).length||(t.delete(o),this.stopListening(o,"change"))}),e.delete(n)})}else t.forEach((n,i)=>{this.stopListening(i,"change")}),t.clear(),e.clear()},decorate(r){const e=this[r];if(!e)throw new y.a("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:r});this.on(r,(t,n)=>{t.return=e.apply(this,n)}),this[r]=function(...t){return this.fire(r,t)},this[r][Sl]=e,this[bo]||(this[bo]=[]),this[bo].push(r)}};mo(ks,V),ks.stopListening=function(r,e,t){if(!r&&this[bo]){for(const n of this[bo])this[n]=this[n][Sl];delete this[bo]}V.stopListening.call(this,r,e,t)};var Wt=ks;function $r(r){r[_s]||(Object.defineProperty(r,_s,{value:new Map}),Object.defineProperty(r,ws,{value:new Map}),Object.defineProperty(r,Vr,{value:new Map}))}function wd(...r){const e=function(...o){if(!o.length)throw new y.a("observable-bind-to-parse-error",null);const a={to:[]};let c;return typeof o[o.length-1]=="function"&&(a.callback=o.pop()),o.forEach(u=>{if(typeof u=="string")c.properties.push(u);else{if(typeof u!="object")throw new y.a("observable-bind-to-parse-error",null);c={observable:u,properties:[]},a.to.push(c)}}),a}(...r),t=Array.from(this._bindings.keys()),n=t.length;if(!e.callback&&e.to.length>1)throw new y.a("observable-bind-to-no-callback",this);if(n>1&&e.callback)throw new y.a("observable-bind-to-extra-callback",this);var i;e.to.forEach(o=>{if(o.properties.length&&o.properties.length!==n)throw new y.a("observable-bind-to-properties-length",this);o.properties.length||(o.properties=this._bindProperties)}),this._to=e.to,e.callback&&(this._bindings.get(t[0]).callback=e.callback),i=this._observable,this._to.forEach(o=>{const a=i[ws];let c;a.get(o.observable)||i.listenTo(o.observable,"change",(u,h)=>{c=a.get(o.observable)[h],c&&c.forEach(m=>{Hr(i,m.property)})})}),function(o){let a;o._bindings.forEach((c,u)=>{o._to.forEach(h=>{a=h.properties[c.callback?0:o._bindProperties.indexOf(u)],c.to.push([h.observable,a]),function(m,k,C,S){const N=m[ws],D=N.get(C),z=D||{};z[S]||(z[S]=new Set),z[S].add(k),D||N.set(C,z)}(o._observable,c,h.observable,a)})})}(this),this._bindProperties.forEach(o=>{Hr(this._observable,o)})}function kd(r,e,t){if(this._bindings.size>1)throw new y.a("observable-bind-to-many-not-one-binding",this);this.to(...function(n,i){const o=n.map(a=>[a,i]);return Array.prototype.concat.apply([],o)}(r,e),t)}function El(r){return r.every(e=>typeof e=="string")}function Hr(r,e){const t=r[Vr].get(e);let n;t.callback?n=t.callback.apply(r,t.to.map(i=>i[0][i[1]])):(n=t.to[0],n=n[0][n[1]]),Object.prototype.hasOwnProperty.call(r,e)?r[e]=n:r.set(e,n)}function Le(r,...e){e.forEach(t=>{Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)).forEach(n=>{if(n in r.prototype)return;const i=Object.getOwnPropertyDescriptor(t,n);i.enumerable=!1,Object.defineProperty(r.prototype,n,i)})})}class me{constructor(e){this.editor=e,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",vo,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",vo),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function vo(r){r.return=!1,r.stop()}Le(me,Wt);class ct{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",t=>{this.isEnabled||t.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(t,n,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",Pl,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",Pl),this.refresh())}execute(){}destroy(){this.stopListening()}}function Pl(r){r.return=!1,r.stop()}Le(ct,Wt);class fa extends ct{constructor(e){super(e),this._childCommands=[]}refresh(){}execute(...e){const t=this._getFirstEnabledCommand();return t!=null&&t.execute(e)}registerChildCommand(e){this._childCommands.push(e),e.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){return this._childCommands.find(e=>e.isEnabled)}}var _o=function(r,e){return function(t){return r(e(t))}},ys=_o(Object.getPrototypeOf,Object),Il=Function.prototype,Ml=Object.prototype,pa=Il.toString,yd=Ml.hasOwnProperty,xd=pa.call(Object),Xn=function(r){if(!Yt(r)||ke(r)!="[object Object]")return!1;var e=ys(r);if(e===null)return!0;var t=yd.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&pa.call(t)==xd},xs=function(){this.__data__=[],this.size=0},Vo=function(r,e){for(var t=r.length;t--;)if(xe(r[t][0],e))return t;return-1},Cs=Array.prototype.splice,Ol=function(r){var e=this.__data__,t=Vo(e,r);return!(t<0)&&(t==e.length-1?e.pop():Cs.call(e,t,1),--this.size,!0)},ga=function(r){var e=this.__data__,t=Vo(e,r);return t<0?void 0:e[t][1]},$o=function(r){return Vo(this.__data__,r)>-1},Nl=function(r,e){var t=this.__data__,n=Vo(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this};function wo(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}wo.prototype.clear=xs,wo.prototype.delete=Ol,wo.prototype.get=ga,wo.prototype.has=$o,wo.prototype.set=Nl;var Ho=wo,Rl=function(){this.__data__=new Ho,this.size=0},Ts=function(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t},qt=function(r){return this.__data__.get(r)},Dl=function(r){return this.__data__.has(r)},Qi=Ye(re.a,"Map"),hr=Ye(Object,"create"),Fi=function(){this.__data__=hr?hr(null):{},this.size=0},As=function(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e},Ur=Object.prototype.hasOwnProperty,jl=function(r){var e=this.__data__;if(hr){var t=e[r];return t==="__lodash_hash_undefined__"?void 0:t}return Ur.call(e,r)?e[r]:void 0},Ll=Object.prototype.hasOwnProperty,zl=function(r){var e=this.__data__;return hr?e[r]!==void 0:Ll.call(e,r)},ma=function(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=hr&&e===void 0?"__lodash_hash_undefined__":e,this};function Wr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}Wr.prototype.clear=Fi,Wr.prototype.delete=As,Wr.prototype.get=jl,Wr.prototype.has=zl,Wr.prototype.set=ma;var Ss=Wr,Bl=function(){this.size=0,this.__data__={hash:new Ss,map:new(Qi||Ho),string:new Ss}},Cd=function(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null},Uo=function(r,e){var t=r.__data__;return Cd(e)?t[typeof e=="string"?"string":"hash"]:t.map},Td=function(r){var e=Uo(this,r).delete(r);return this.size-=e?1:0,e},Fl=function(r){return Uo(this,r).get(r)},ba=function(r){return Uo(this,r).has(r)},Ad=function(r,e){var t=Uo(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this};function fr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}fr.prototype.clear=Bl,fr.prototype.delete=Td,fr.prototype.get=Fl,fr.prototype.has=ba,fr.prototype.set=Ad;var Es=fr,Sd=function(r,e){var t=this.__data__;if(t instanceof Ho){var n=t.__data__;if(!Qi||n.length<199)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Es(n)}return t.set(r,e),this.size=t.size,this};function pr(r){var e=this.__data__=new Ho(r);this.size=e.size}pr.prototype.clear=Rl,pr.prototype.delete=Ts,pr.prototype.get=qt,pr.prototype.has=Dl,pr.prototype.set=Sd;var Wo=pr,Vl=function(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r},Ft=_o(Object.keys,Object),Dt=Object.prototype.hasOwnProperty,$l=function(r){if(!Fo(r))return Ft(r);var e=[];for(var t in Object(r))Dt.call(r,t)&&t!="constructor"&&e.push(t);return e},va=function(r){return wi(r)?Al(r):$l(r)},Ed=function(r,e){return r&&Et(e,va(e),r)},Pd=function(r,e){return r&&Et(e,xi(e),r)},_a=v(9),Hl=function(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e},wa=function(r,e){for(var t=-1,n=r==null?0:r.length,i=0,o=[];++t<n;){var a=r[t];e(a,t,r)&&(o[i++]=a)}return o},Ps=function(){return[]},vn=Object.prototype.propertyIsEnumerable,qo=Object.getOwnPropertySymbols,Ci=qo?function(r){return r==null?[]:(r=Object(r),wa(qo(r),function(e){return vn.call(r,e)}))}:Ps,ka=function(r,e){return Et(r,Ci(r),e)},Is=function(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r},Hn=Object.getOwnPropertySymbols?function(r){for(var e=[];r;)Is(e,Ci(r)),r=ys(r);return e}:Ps,Ul=function(r,e){return Et(r,Hn(r),e)},ya=function(r,e,t){var n=e(r);return Pt(r)?n:Is(n,t(r))},ko=function(r){return ya(r,va,Ci)},Ms=function(r){return ya(r,xi,Hn)},yo=Ye(re.a,"DataView"),xo=Ye(re.a,"Promise"),yn=Ye(re.a,"Set"),Os=Ye(re.a,"WeakMap"),Jn=et(yo),Wl=et(Qi),xa=et(xo),gr=et(yn),Ns=et(Os),Yi=ke;(yo&&Yi(new yo(new ArrayBuffer(1)))!="[object DataView]"||Qi&&Yi(new Qi)!="[object Map]"||xo&&Yi(xo.resolve())!="[object Promise]"||yn&&Yi(new yn)!="[object Set]"||Os&&Yi(new Os)!="[object WeakMap]")&&(Yi=function(r){var e=ke(r),t=e=="[object Object]"?r.constructor:void 0,n=t?et(t):"";if(n)switch(n){case Jn:return"[object DataView]";case Wl:return"[object Map]";case xa:return"[object Promise]";case gr:return"[object Set]";case Ns:return"[object WeakMap]"}return e});var Mt=Yi,mr=Object.prototype.hasOwnProperty,Xi=function(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&mr.call(r,"index")&&(t.index=r.index,t.input=r.input),t},Co=re.a.Uint8Array,Ko=function(r){var e=new r.constructor(r.byteLength);return new Co(e).set(new Co(r)),e},Id=function(r,e){var t=e?Ko(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)},ql=/\w*$/,Ca=function(r){var e=new r.constructor(r.source,ql.exec(r));return e.lastIndex=r.lastIndex,e},Ta=be?be.prototype:void 0,Go=Ta?Ta.valueOf:void 0,To=function(r){return Go?Object(Go.call(r)):{}},Aa=function(r,e){var t=e?Ko(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)},Sa=function(r,e,t){var n=r.constructor;switch(e){case"[object ArrayBuffer]":return Ko(r);case"[object Boolean]":case"[object Date]":return new n(+r);case"[object DataView]":return Id(r,t);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Aa(r,t);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(r);case"[object RegExp]":return Ca(r);case"[object Set]":return new n;case"[object Symbol]":return To(r)}},Ea=Object.create,Pa=function(){function r(){}return function(e){if(!oe(e))return{};if(Ea)return Ea(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}(),Rs=function(r){return typeof r.constructor!="function"||Fo(r)?{}:Pa(ys(r))},Kl=function(r){return Yt(r)&&Mt(r)=="[object Map]"},Gl=si.a&&si.a.isMap,Ia=Gl?oi(Gl):Kl,Ma=function(r){return Yt(r)&&Mt(r)=="[object Set]"},Ql=si.a&&si.a.isSet,Yl=Ql?oi(Ql):Ma,dt={};dt["[object Arguments]"]=dt["[object Array]"]=dt["[object ArrayBuffer]"]=dt["[object DataView]"]=dt["[object Boolean]"]=dt["[object Date]"]=dt["[object Float32Array]"]=dt["[object Float64Array]"]=dt["[object Int8Array]"]=dt["[object Int16Array]"]=dt["[object Int32Array]"]=dt["[object Map]"]=dt["[object Number]"]=dt["[object Object]"]=dt["[object RegExp]"]=dt["[object Set]"]=dt["[object String]"]=dt["[object Symbol]"]=dt["[object Uint8Array]"]=dt["[object Uint8ClampedArray]"]=dt["[object Uint16Array]"]=dt["[object Uint32Array]"]=!0,dt["[object Error]"]=dt["[object Function]"]=dt["[object WeakMap]"]=!1;var Qo=function r(e,t,n,i,o,a){var c,u=1&t,h=2&t,m=4&t;if(n&&(c=o?n(e,i,o,a):n(e)),c!==void 0)return c;if(!oe(e))return e;var k=Pt(e);if(k){if(c=Xi(e),!u)return Hl(e,c)}else{var C=Mt(e),S=C=="[object Function]"||C=="[object GeneratorFunction]";if(Object(ki.a)(e))return Object(_a.a)(e,u);if(C=="[object Object]"||C=="[object Arguments]"||S&&!o){if(c=h||S?{}:Rs(e),!u)return h?Ul(e,Pd(c,e)):ka(e,Ed(c,e))}else{if(!dt[C])return o?e:{};c=Sa(e,C,u)}}a||(a=new Wo);var N=a.get(e);if(N)return N;a.set(e,c),Yl(e)?e.forEach(function(z){c.add(r(z,t,n,z,e,a))}):Ia(e)&&e.forEach(function(z,U){c.set(U,r(z,t,n,U,e,a))});var D=k?void 0:(m?h?Ms:ko:h?xi:va)(e);return Vl(D||e,function(z,U){D&&(z=e[U=z]),St(c,U,r(z,t,n,U,e,a))}),c},Ao=function(r,e){return Qo(r,5,e=typeof e=="function"?e:void 0)},Ji=function(r){return Yt(r)&&r.nodeType===1&&!Xn(r)};class Oa{constructor(e,t){this._config={},t&&this.define(Xl(t)),e&&this._setObjectToTarget(this._config,e)}set(e,t){this._setToTarget(this._config,e,t)}define(e,t){this._setToTarget(this._config,e,t,!0)}get(e){return this._getFromSource(this._config,e)}*names(){for(const e of Object.keys(this._config))yield e}_setToTarget(e,t,n,i=!1){if(Xn(t))return void this._setObjectToTarget(e,t,i);const o=t.split(".");t=o.pop();for(const a of o)Xn(e[a])||(e[a]={}),e=e[a];if(Xn(n))return Xn(e[t])||(e[t]={}),e=e[t],void this._setObjectToTarget(e,n,i);i&&e[t]!==void 0||(e[t]=n)}_getFromSource(e,t){const n=t.split(".");t=n.pop();for(const i of n){if(!Xn(e[i])){e=null;break}e=e[i]}return e?Xl(e[t]):void 0}_setObjectToTarget(e,t,n){Object.keys(t).forEach(i=>{this._setToTarget(e,i,t[i],n)})}}function Xl(r){return Ao(r,Md)}function Md(r){return Ji(r)?r:void 0}function ai(r){return!(!r||!r[Symbol.iterator])}class li{constructor(e={},t={}){const n=ai(e);if(n||(t=e),this._items=[],this._itemMap=new Map,this._idProperty=t.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],n)for(const i of e)this._items.push(i),this._itemMap.set(this._getItemIdBeforeAdding(i),i)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,t){return this.addMany([e],t)}addMany(e,t){if(t===void 0)t=this._items.length;else if(t>this._items.length||t<0)throw new y.a("collection-add-item-invalid-index",this);for(let n=0;n<e.length;n++){const i=e[n],o=this._getItemIdBeforeAdding(i),a=t+n;this._items.splice(a,0,i),this._itemMap.set(o,i),this.fire("add",i,a)}return this.fire("change",{added:e,removed:[],index:t}),this}get(e){let t;if(typeof e=="string")t=this._itemMap.get(e);else{if(typeof e!="number")throw new y.a("collection-get-invalid-arg",this);t=this._items[e]}return t||null}has(e){if(typeof e=="string")return this._itemMap.has(e);{const t=e[this._idProperty];return this._itemMap.has(t)}}getIndex(e){let t;return t=typeof e=="string"?this._itemMap.get(e):e,this._items.indexOf(t)}remove(e){const[t,n]=this._remove(e);return this.fire("change",{added:[],removed:[t],index:n}),t}map(e,t){return this._items.map(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const e=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:e,index:0})}bindTo(e){if(this._bindToCollection)throw new y.a("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:t=>{this._setUpBindToBinding(n=>new t(n))},using:t=>{typeof t=="function"?this._setUpBindToBinding(n=>t(n)):this._setUpBindToBinding(n=>n[t])}}}_setUpBindToBinding(e){const t=this._bindToCollection,n=(i,o,a)=>{const c=t._bindToCollection==this,u=t._bindToInternalToExternalMap.get(o);if(c&&u)this._bindToExternalToInternalMap.set(o,u),this._bindToInternalToExternalMap.set(u,o);else{const h=e(o);if(!h)return void this._skippedIndexesFromExternal.push(a);let m=a;for(const k of this._skippedIndexesFromExternal)a>k&&m--;for(const k of t._skippedIndexesFromExternal)m>=k&&m++;this._bindToExternalToInternalMap.set(o,h),this._bindToInternalToExternalMap.set(h,o),this.add(h,m);for(let k=0;k<t._skippedIndexesFromExternal.length;k++)m<=t._skippedIndexesFromExternal[k]&&t._skippedIndexesFromExternal[k]++}};for(const i of t)n(0,i,t.getIndex(i));this.listenTo(t,"add",n),this.listenTo(t,"remove",(i,o,a)=>{const c=this._bindToExternalToInternalMap.get(o);c&&this.remove(c),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((u,h)=>(a<h&&u.push(h-1),a>h&&u.push(h),u),[])})}_getItemIdBeforeAdding(e){const t=this._idProperty;let n;if(t in e){if(n=e[t],typeof n!="string")throw new y.a("collection-add-invalid-id",this);if(this.get(n))throw new y.a("collection-add-item-already-exists",this)}else e[t]=n=P();return n}_remove(e){let t,n,i,o=!1;const a=this._idProperty;if(typeof e=="string"?(n=e,i=this._itemMap.get(n),o=!i,i&&(t=this._items.indexOf(i))):typeof e=="number"?(t=e,i=this._items[t],o=!i,i&&(n=i[a])):(i=e,n=i[a],t=this._items.indexOf(i),o=t==-1||!this._itemMap.get(n)),o)throw new y.a("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(n);const c=this._bindToInternalToExternalMap.get(i);return this._bindToInternalToExternalMap.delete(i),this._bindToExternalToInternalMap.delete(c),this.fire("remove",i,t),[i,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}Le(li,V);class Na{constructor(e,t=[],n=[]){this._context=e,this._plugins=new Map,this._availablePlugins=new Map;for(const i of t)i.pluginName&&this._availablePlugins.set(i.pluginName,i);this._contextPlugins=new Map;for(const[i,o]of n)this._contextPlugins.set(i,o),this._contextPlugins.set(o,i),i.pluginName&&this._availablePlugins.set(i.pluginName,i)}*[Symbol.iterator](){for(const e of this._plugins)typeof e[0]=="function"&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let n=e;throw typeof e=="function"&&(n=e.pluginName||e.name),new y.a("plugincollection-plugin-not-loaded",this._context,{plugin:n})}return t}has(e){return this._plugins.has(e)}init(e,t=[],n=[]){const i=this,o=this._context;(function N(D,z=new Set){D.forEach(U=>{u(U)&&(z.has(U)||(z.add(U),U.pluginName&&!i._availablePlugins.has(U.pluginName)&&i._availablePlugins.set(U.pluginName,U),U.requires&&N(U.requires,z)))})})(e),C(e);const a=[...function N(D,z=new Set){return D.map(U=>u(U)?U:i._availablePlugins.get(U)).reduce((U,J)=>z.has(J)?U:(z.add(J),J.requires&&(C(J.requires,J),N(J.requires,z).forEach(ce=>U.add(ce))),U.add(J)),new Set)}(e.filter(N=>!m(N,t)))];(function(N,D){for(const z of D){if(typeof z!="function")throw new y.a("plugincollection-replace-plugin-invalid-type",null,{pluginItem:z});const U=z.pluginName;if(!U)throw new y.a("plugincollection-replace-plugin-missing-name",null,{pluginItem:z});if(z.requires&&z.requires.length)throw new y.a("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:U});const J=i._availablePlugins.get(U);if(!J)throw new y.a("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:U});const ce=N.indexOf(J);if(ce===-1){if(i._contextPlugins.has(J))return;throw new y.a("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:U})}if(J.requires&&J.requires.length)throw new y.a("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:U});N.splice(ce,1,z),i._availablePlugins.set(U,z)}})(a,n);const c=function(N){return N.map(D=>{const z=i._contextPlugins.get(D)||new D(o);return i._add(D,z),z})}(a);return S(c,"init").then(()=>S(c,"afterInit")).then(()=>c);function u(N){return typeof N=="function"}function h(N){return u(N)&&N.isContextPlugin}function m(N,D){return D.some(z=>z===N||k(N)===z||k(z)===N)}function k(N){return u(N)?N.pluginName||N.name:N}function C(N,D=null){N.map(z=>u(z)?z:i._availablePlugins.get(z)||z).forEach(z=>{(function(U,J){if(!u(U))throw J?new y.a("plugincollection-soft-required",o,{missingPlugin:U,requiredBy:k(J)}):new y.a("plugincollection-plugin-not-found",o,{plugin:U})})(z,D),function(U,J){if(h(J)&&!h(U))throw new y.a("plugincollection-context-required",o,{plugin:k(U),requiredBy:k(J)})}(z,D),function(U,J){if(J&&m(U,t))throw new y.a("plugincollection-required",o,{plugin:k(U),requiredBy:k(J)})}(z,D)})}function S(N,D){return N.reduce((z,U)=>U[D]?i._contextPlugins.has(U)?z:z.then(U[D].bind(U)):z,Promise.resolve())}}destroy(){const e=[];for(const[,t]of this)typeof t.destroy!="function"||this._contextPlugins.has(t)||e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const n=e.pluginName;if(n){if(this._plugins.has(n))throw new y.a("plugincollection-plugin-name-conflict",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:e});this._plugins.set(n,t)}}}function xt(r){return Array.isArray(r)?r:[r]}function Od(r,e,t=1){if(typeof t!="number")throw new y.a("translation-service-quantity-not-a-number",null,{quantity:t});const n=Object.keys(window.CKEDITOR_TRANSLATIONS).length;n===1&&(r=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]);const i=e.id||e.string;if(n===0||!function(u,h){return!!window.CKEDITOR_TRANSLATIONS[u]&&!!window.CKEDITOR_TRANSLATIONS[u].dictionary[h]}(r,i))return t!==1?e.plural:e.string;const o=window.CKEDITOR_TRANSLATIONS[r].dictionary,a=window.CKEDITOR_TRANSLATIONS[r].getPluralForm||(u=>u===1?0:1);if(typeof o[i]=="string")return o[i];const c=Number(a(t));return o[i][c]}Le(Na,V),window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});const Nd=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];function Yo(r){return Nd.includes(r)?"rtl":"ltr"}class Jl{constructor(e={}){this.uiLanguage=e.uiLanguage||"en",this.contentLanguage=e.contentLanguage||this.uiLanguage,this.uiLanguageDirection=Yo(this.uiLanguage),this.contentLanguageDirection=Yo(this.contentLanguage),this.t=(t,n)=>this._t(t,n)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(e,t=[]){t=xt(t),typeof e=="string"&&(e={string:e});const n=e.plural?t[0]:1;return function(i,o){return i.replace(/%(\d+)/g,(a,c)=>c<o.length?o[c]:a)}(Od(this.uiLanguage,e,n),t)}}class br{constructor(e){this.config=new Oa(e,this.constructor.defaultConfig);const t=this.constructor.builtinPlugins;this.config.define("plugins",t),this.plugins=new Na(this,t);const n=this.config.get("language")||{};this.locale=new Jl({uiLanguage:typeof n=="string"?n:n.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.editors=new li,this._contextOwner=null}initPlugins(){const e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(const n of e.concat(t)){if(typeof n!="function")throw new y.a("context-initplugins-constructor-only",null,{Plugin:n});if(n.isContextPlugin!==!0)throw new y.a("context-initplugins-invalid-plugin",null,{Plugin:n})}return this.plugins.init(e,[],t)}destroy(){return Promise.all(Array.from(this.editors,e=>e.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner)throw new y.a("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise(t=>{const n=new this(e);t(n.initPlugins().then(()=>n))})}}class vr{constructor(e){this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}function xn(r,e){const t=Math.min(r.length,e.length);for(let n=0;n<t;n++)if(r[n]!=e[n])return n;return r.length==e.length?"same":r.length<e.length?"prefix":"extension"}Le(vr,Wt);var Ra=function(r){return Qo(r,4)};class qr{constructor(e){this.document=e,this.parent=null}get index(){let e;if(!this.parent)return null;if((e=this.parent.getChildIndex(this))==-1)throw new y.a("view-node-not-found-in-parent",this);return e}get nextSibling(){const e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.index),t=t.parent;return e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),i=e.getAncestors(t);let o=0;for(;n[o]==i[o]&&n[o];)o++;return o===0?null:n[o-1]}isBefore(e){if(this==e||this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),i=xn(t,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return t[i]<n[i]}}isAfter(e){return this!=e&&this.root===e.root&&!this.isBefore(e)}_remove(){this.parent._removeChildren(this.index)}_fireChange(e,t){this.fire("change:"+e,t),this.parent&&this.parent._fireChange(e,t)}toJSON(){const e=Ra(this);return delete e.parent,e}is(e){return e==="node"||e==="view:node"}}Le(qr,V);class _t extends qr{constructor(e,t){super(e),this._textData=t}is(e){return e==="$text"||e==="view:$text"||e==="text"||e==="view:text"||e==="node"||e==="view:node"}get data(){return this._textData}get _data(){return this.data}set _data(e){this._fireChange("text",this),this._textData=e}isSimilar(e){return e instanceof _t&&(this===e||this.data===e.data)}_clone(){return new _t(this.document,this.data)}}class cn{constructor(e,t,n){if(this.textNode=e,t<0||t>e.data.length)throw new y.a("view-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.data.length)throw new y.a("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+n),this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(e){return e==="$textProxy"||e==="view:$textProxy"||e==="textProxy"||e==="view:textProxy"}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this.textNode:this.parent;for(;n!==null;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}}function Ti(r){return ai(r)?new Map(r):function(e){const t=new Map;for(const n in e)t.set(n,e[n]);return t}(r)}class Vi{constructor(...e){this._patterns=[],this.add(...e)}add(...e){for(let t of e)(typeof t=="string"||t instanceof RegExp)&&(t={name:t}),this._patterns.push(t)}match(...e){for(const t of e)for(const n of this._patterns){const i=Zl(t,n);if(i)return{element:t,pattern:n,match:i}}return null}matchAll(...e){const t=[];for(const n of e)for(const i of this._patterns){const o=Zl(n,i);o&&t.push({element:n,pattern:i,match:o})}return t.length>0?t:null}getElementName(){if(this._patterns.length!==1)return null;const e=this._patterns[0],t=e.name;return typeof e=="function"||!t||t instanceof RegExp?null:t}}function Zl(r,e){if(typeof e=="function")return e(r);const t={};return e.name&&(t.name=function(n,i){return n instanceof RegExp?n.test(i):n===i}(e.name,r.name),!t.name)||e.attributes&&(t.attributes=function(n,i){const o=new Set(i.getAttributeKeys());return Xn(n)?(n.style!==void 0&&Object(y.b)("matcher-pattern-deprecated-attributes-style-key",n),n.class!==void 0&&Object(y.b)("matcher-pattern-deprecated-attributes-class-key",n)):(o.delete("style"),o.delete("class")),Da(n,o,a=>i.getAttribute(a))}(e.attributes,r),!t.attributes)?null:!(e.classes&&(t.classes=function(n,i){return Da(n,i.getClassNames())}(e.classes,r),!t.classes))&&!(e.styles&&(t.styles=function(n,i){return Da(n,i.getStyleNames(!0),o=>i.getStyle(o))}(e.styles,r),!t.styles))&&t}function Da(r,e,t){const n=function(a){return Array.isArray(a)?a.map(c=>Xn(c)?(c.key!==void 0&&c.value!==void 0||Object(y.b)("matcher-pattern-missing-key-or-value",c),[c.key,c.value]):[c,!0]):Xn(a)?Object.entries(a):[[a,!0]]}(r),i=Array.from(e),o=[];return n.forEach(([a,c])=>{i.forEach(u=>{(function(h,m){return h===!0||h===m||h instanceof RegExp&&h.test(m)})(a,u)&&function(h,m,k){if(h===!0)return!0;const C=k(m);return h===C||h instanceof RegExp&&h.test(C)}(c,u,t)&&o.push(u)})}),!n.length||o.length<n.length?null:o}var Ds=function(r){return typeof r=="symbol"||Yt(r)&&ke(r)=="[object Symbol]"},ec=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kr=/^\w*$/,q=function(r,e){if(Pt(r))return!1;var t=typeof r;return!(t!="number"&&t!="symbol"&&t!="boolean"&&r!=null&&!Ds(r))||Kr.test(r)||!ec.test(r)||e!=null&&r in Object(e)};function ae(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var t=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=t.cache;if(o.has(i))return o.get(i);var a=r.apply(this,n);return t.cache=o.set(i,a)||o,a};return t.cache=new(ae.Cache||Es),t}ae.Cache=Es;var Y=ae,Me=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xe=/\\(\\)?/g,kt=function(r){var e=Y(r,function(n){return t.size===500&&t.clear(),n}),t=e.cache;return e}(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(Me,function(t,n,i,o){e.push(i?o.replace(Xe,"$1"):n||t)}),e}),dn=function(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i},Ot=be?be.prototype:void 0,js=Ot?Ot.toString:void 0,Rd=function r(e){if(typeof e=="string")return e;if(Pt(e))return dn(e,r)+"";if(Ds(e))return js?js.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t},En=function(r){return r==null?"":Rd(r)},So=function(r,e){return Pt(r)?r:q(r,e)?[r]:kt(En(r))},Dd=function(r){var e=r==null?0:r.length;return e?r[e-1]:void 0},_r=function(r){if(typeof r=="string"||Ds(r))return r;var e=r+"";return e=="0"&&1/r==-1/0?"-0":e},Xo=function(r,e){for(var t=0,n=(e=So(e,r)).length;r!=null&&t<n;)r=r[_r(e[t++])];return t&&t==n?r:void 0},Gr=function(r,e,t){var n=-1,i=r.length;e<0&&(e=-e>i?0:i+e),(t=t>i?i:t)<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=r[n+e];return o},Ct=function(r,e){return e.length<2?r:Xo(r,Gr(e,0,-1))},tc=function(r,e){return e=So(e,r),(r=Ct(r,e))==null||delete r[_r(Dd(e))]},ja=function(r,e){return r==null||tc(r,e)},wr=function(r,e,t){var n=r==null?void 0:Xo(r,e);return n===void 0?t:n},fn=function(r,e,t){(t!==void 0&&!xe(r[e],t)||t===void 0&&!(e in r))&&Vn(r,e,t)},Jo=function(r){return function(e,t,n){for(var i=-1,o=Object(e),a=n(e),c=a.length;c--;){var u=a[r?c:++i];if(t(o[u],u,o)===!1)break}return e}}(),nc=function(r){return Yt(r)&&wi(r)},Eo=function(r,e){if((e!=="constructor"||typeof r[e]!="function")&&e!="__proto__")return r[e]},Zi=function(r){return Et(r,xi(r))},Zo=function(r,e,t,n,i,o,a){var c=Eo(r,t),u=Eo(e,t),h=a.get(u);if(h)fn(r,t,h);else{var m=o?o(c,u,t+"",r,e,a):void 0,k=m===void 0;if(k){var C=Pt(u),S=!C&&Object(ki.a)(u),N=!C&&!S&&vs(u);m=u,C||S||N?Pt(c)?m=c:nc(c)?m=Hl(c):S?(k=!1,m=Object(_a.a)(u,!0)):N?(k=!1,m=Aa(u,!0)):m=[]:Xn(u)||bn(u)?(m=c,bn(c)?m=Zi(c):oe(c)&&!Pe(c)||(m=Rs(u))):k=!1}k&&(a.set(u,m),i(m,u,n,o,a),a.delete(u)),fn(r,t,m)}},Ls=function r(e,t,n,i,o){e!==t&&Jo(t,function(a,c){if(o||(o=new Wo),oe(a))Zo(e,t,c,n,r,i,o);else{var u=i?i(Eo(e,c),a,c+"",e,t,o):void 0;u===void 0&&(u=a),fn(e,c,u)}},xi)},Qr=po(function(r,e,t){Ls(r,e,t)}),kr=function(r,e,t,n){if(!oe(r))return r;for(var i=-1,o=(e=So(e,r)).length,a=o-1,c=r;c!=null&&++i<o;){var u=_r(e[i]),h=t;if(u==="__proto__"||u==="constructor"||u==="prototype")return r;if(i!=a){var m=c[u];(h=n?n(m,u,c):void 0)===void 0&&(h=oe(m)?m:Gi(e[i+1])?[]:{})}St(c,u,h),c=c[u]}return r},ic=function(r,e,t){return r==null?r:kr(r,e,t)};class I{constructor(e){this._styles={},this._styleProcessor=e}get isEmpty(){const e=Object.entries(this._styles);return!Array.from(e).length}get size(){return this.isEmpty?0:this.getStyleNames().length}setTo(e){this.clear();const t=Array.from(function(n){let i=null,o=0,a=0,c=null;const u=new Map;if(n==="")return u;n.charAt(n.length-1)!=";"&&(n+=";");for(let h=0;h<n.length;h++){const m=n.charAt(h);if(i===null)switch(m){case":":c||(c=n.substr(o,h-o),a=h+1);break;case'"':case"'":i=m;break;case";":{const k=n.substr(a,h-a);c&&u.set(c.trim(),k.trim()),c=null,o=h+1;break}}else m===i&&(i=null)}return u}(e).entries());for(const[n,i]of t)this._styleProcessor.toNormalizedForm(n,i,this._styles)}has(e){if(this.isEmpty)return!1;const t=this._styleProcessor.getReducedForm(e,this._styles).find(([n])=>n===e);return Array.isArray(t)}set(e,t){if(oe(e))for(const[n,i]of Object.entries(e))this._styleProcessor.toNormalizedForm(n,i,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){const t=$(e);ja(this._styles,t),delete this._styles[e],this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map(e=>e.join(":")).sort().join(";")+";"}getAsString(e){if(this.isEmpty)return;if(this._styles[e]&&!oe(this._styles[e]))return this._styles[e];const t=this._styleProcessor.getReducedForm(e,this._styles).find(([n])=>n===e);return Array.isArray(t)?t[1]:void 0}getStyleNames(e=!1){return this.isEmpty?[]:e?this._styleProcessor.getStyleNames(this._styles):this._getStylesEntries().map(([t])=>t)}clear(){this._styles={}}_getStylesEntries(){const e=[],t=Object.keys(this._styles);for(const n of t)e.push(...this._styleProcessor.getReducedForm(n,this._styles));return e}_cleanEmptyObjectsOnPath(e){const t=e.split(".");if(!(t.length>1))return;const n=t.splice(0,t.length-1).join("."),i=wr(this._styles,n);i&&!Array.from(Object.keys(i)).length&&this.remove(n)}}class M{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,n){if(oe(t))te(n,$(e),t);else if(this._normalizers.has(e)){const i=this._normalizers.get(e),{path:o,value:a}=i(t);te(n,o,a)}else te(n,e,t)}getNormalized(e,t){if(!e)return Qr({},t);if(t[e]!==void 0)return t[e];if(this._extractors.has(e)){const n=this._extractors.get(e);if(typeof n=="string")return wr(t,n);const i=n(e,t);if(i)return i}return wr(t,$(e))}getReducedForm(e,t){const n=this.getNormalized(e,t);return n===void 0?[]:this._reducers.has(e)?this._reducers.get(e)(n):[[e,n]]}getStyleNames(e){const t=Array.from(this._consumables.keys()).filter(i=>{const o=this.getNormalized(i,e);return o&&typeof o=="object"?Object.keys(o).length:o}),n=new Set([...t,...Object.keys(e)]);return Array.from(n.values())}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(const n of t)this._mapStyleNames(n,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function $(r){return r.replace("-",".")}function te(r,e,t){let n=t;oe(t)&&(n=Qr({},wr(r,e),t)),ic(r,e,n)}class Ce extends qr{constructor(e,t,n,i){if(super(e),this.name=t,this._attrs=function(o){o=Ti(o);for(const[a,c]of o)c===null?o.delete(a):typeof c!="string"&&o.set(a,String(c));return o}(n),this._children=[],i&&this._insertChild(0,i),this._classes=new Set,this._attrs.has("class")){const o=this._attrs.get("class");Ge(this._classes,o),this._attrs.delete("class")}this._styles=new I(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style")),this._customProperties=new Map,this._isAllowedInsideAttributeElement=!1}get childCount(){return this._children.length}get isEmpty(){return this._children.length===0}get isAllowedInsideAttributeElement(){return this._isAllowedInsideAttributeElement}is(e,t=null){return t?t===this.name&&(e==="element"||e==="view:element"):e==="element"||e==="view:element"||e==="node"||e==="view:node"}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(e){if(e=="class")return this._classes.size>0?[...this._classes].join(" "):void 0;if(e=="style"){const t=this._styles.toString();return t==""?void 0:t}return this._attrs.get(e)}hasAttribute(e){return e=="class"?this._classes.size>0:e=="style"?!this._styles.isEmpty:this._attrs.has(e)}isSimilar(e){if(!(e instanceof Ce))return!1;if(this===e)return!0;if(this.name!=e.name||this.isAllowedInsideAttributeElement!=e.isAllowedInsideAttributeElement||this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size)return!1;for(const[t,n]of this._attrs)if(!e._attrs.has(t)||e._attrs.get(t)!==n)return!1;for(const t of this._classes)if(!e._classes.has(t))return!1;for(const t of this._styles.getStyleNames())if(!e._styles.has(t)||e._styles.getAsString(t)!==this._styles.getAsString(t))return!1;return!0}hasClass(...e){for(const t of e)if(!this._classes.has(t))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles.getNormalized(e)}getStyleNames(e=!1){return this._styles.getStyleNames(e)}hasStyle(...e){for(const t of e)if(!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new Vi(...e);let n=this.parent;for(;n;){if(t.match(n))return n;n=n.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(","),t=this._styles.toString(),n=Array.from(this._attrs).map(i=>`${i[0]}="${i[1]}"`).sort().join(" ");return this.name+(e==""?"":` class="${e}"`)+(t?` style="${t}"`:"")+(n==""?"":" "+n)}_clone(e=!1){const t=[];if(e)for(const i of this.getChildren())t.push(i._clone(e));const n=new this.constructor(this.document,this.name,this._attrs,t);return n._classes=new Set(this._classes),n._styles.set(this._styles.getNormalized()),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n._isAllowedInsideAttributeElement=this.isAllowedInsideAttributeElement,n}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let n=0;const i=function(o,a){return typeof a=="string"?[new _t(o,a)]:(ai(a)||(a=[a]),Array.from(a).map(c=>typeof c=="string"?new _t(o,c):c instanceof cn?new _t(o,c.data):c))}(this.document,t);for(const o of i)o.parent!==null&&o._remove(),o.parent=this,o.document=this.document,this._children.splice(e,0,o),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n<e+t;n++)this._children[n].parent=null;return this._children.splice(e,t)}_setAttribute(e,t){t=String(t),this._fireChange("attributes",this),e=="class"?Ge(this._classes,t):e=="style"?this._styles.setTo(t):this._attrs.set(e,t)}_removeAttribute(e){return this._fireChange("attributes",this),e=="class"?this._classes.size>0&&(this._classes.clear(),!0):e=="style"?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(e)}_addClass(e){this._fireChange("attributes",this);for(const t of xt(e))this._classes.add(t)}_removeClass(e){this._fireChange("attributes",this);for(const t of xt(e))this._classes.delete(t)}_setStyle(e,t){this._fireChange("attributes",this),this._styles.set(e,t)}_removeStyle(e){this._fireChange("attributes",this);for(const t of xt(e))this._styles.remove(t)}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function Ge(r,e){const t=e.split(/\s+/);r.clear(),t.forEach(n=>r.add(n))}class Qe extends Ce{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=tt}is(e,t=null){return t?t===this.name&&(e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"):e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}}function tt(){const r=[...this.getChildren()],e=r[this.childCount-1];if(e&&e.is("element","br"))return this.childCount;for(const t of r)if(!t.is("uiElement"))return null;return this.childCount}class jt extends Qe{constructor(e,t,n,i){super(e,t,n,i),this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(e),this.bind("isFocused").to(e,"isFocused",o=>o&&e.selection.editableElement==this),this.listenTo(e.selection,"change",()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}is(e,t=null){return t?t===this.name&&(e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"):e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}destroy(){this.stopListening()}}Le(jt,Wt);const Vt=Symbol("rootName");class Po extends jt{constructor(e,t){super(e,t),this.rootName="main"}is(e,t=null){return t?t===this.name&&(e==="rootElement"||e==="view:rootElement"||e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"):e==="rootElement"||e==="view:rootElement"||e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}get rootName(){return this.getCustomProperty(Vt)}set rootName(e){this._setCustomProperty(Vt,e)}set _name(e){this.name=e}}class Zn{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new y.a("view-tree-walker-no-start-position",null);if(e.direction&&e.direction!="forward"&&e.direction!="backward")throw new y.a("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this.position=ge._createAt(e.startPosition):this.position=ge._createAt(e.boundaries[e.direction=="backward"?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(e){let t,n,i;do i=this.position,{done:t,value:n}=this.next();while(!t&&e(n));t||(this.position=i)}next(){return this.direction=="forward"?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,n=e.parent;if(n.parent===null&&e.offset===n.childCount)return{done:!0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};let i;if(n instanceof _t){if(e.isAtEnd)return this.position=ge._createAfter(n),this._next();i=n.data[e.offset]}else i=n.getChild(e.offset);if(i instanceof Ce)return this.shallow?e.offset++:e=new ge(i,0),this.position=e,this._formatReturnValue("elementStart",i,t,e,1);if(i instanceof _t){if(this.singleCharacters)return e=new ge(i,0),this.position=e,this._next();{let o,a=i.data.length;return i==this._boundaryEndParent?(a=this.boundaries.end.offset,o=new cn(i,0,a),e=ge._createAfter(o)):(o=new cn(i,0,i.data.length),e.offset++),this.position=e,this._formatReturnValue("text",o,t,e,a)}}if(typeof i=="string"){let o;this.singleCharacters?o=1:o=(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-e.offset;const a=new cn(n,e.offset,o);return e.offset+=o,this.position=e,this._formatReturnValue("text",a,t,e,o)}return e=ge._createAfter(n),this.position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",n,t,e)}_previous(){let e=this.position.clone();const t=this.position,n=e.parent;if(n.parent===null&&e.offset===0)return{done:!0};if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0};let i;if(n instanceof _t){if(e.isAtStart)return this.position=ge._createBefore(n),this._previous();i=n.data[e.offset-1]}else i=n.getChild(e.offset-1);if(i instanceof Ce)return this.shallow?(e.offset--,this.position=e,this._formatReturnValue("elementStart",i,t,e,1)):(e=new ge(i,i.childCount),this.position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",i,t,e));if(i instanceof _t){if(this.singleCharacters)return e=new ge(i,i.data.length),this.position=e,this._previous();{let o,a=i.data.length;if(i==this._boundaryStartParent){const c=this.boundaries.start.offset;o=new cn(i,c,i.data.length-c),a=o.data.length,e=ge._createBefore(o)}else o=new cn(i,0,i.data.length),e.offset--;return this.position=e,this._formatReturnValue("text",o,t,e,a)}}if(typeof i=="string"){let o;if(this.singleCharacters)o=1;else{const c=n===this._boundaryStartParent?this.boundaries.start.offset:0;o=e.offset-c}e.offset-=o;const a=new cn(n,e.offset,o);return this.position=e,this._formatReturnValue("text",a,t,e,o)}return e=ge._createBefore(n),this.position=e,this._formatReturnValue("elementStart",n,t,e,1)}_formatReturnValue(e,t,n,i,o){return t instanceof cn&&(t.offsetInText+t.data.length==t.textNode.data.length&&(this.direction!="forward"||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=ge._createAfter(t.textNode):(i=ge._createAfter(t.textNode),this.position=i)),t.offsetInText===0&&(this.direction!="backward"||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=ge._createBefore(t.textNode):(i=ge._createBefore(t.textNode),this.position=i))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:i,length:o}}}}class ge{constructor(e,t){this.parent=e,this.offset=t}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return this.offset===0}get isAtEnd(){const e=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof jt);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=ge._createAt(this),n=t.offset+e;return t.offset=n<0?0:n,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new Zn(t);return n.skip(e),n.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),n=e.getAncestors();let i=0;for(;t[i]==n[i]&&t[i];)i++;return i===0?null:t[i-1]}is(e){return e==="position"||e==="view:position"}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return this.compareWith(e)=="before"}isAfter(e){return this.compareWith(e)=="after"}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],n=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),n.push(e.offset);const i=xn(t,n);switch(i){case"prefix":return"before";case"extension":return"after";default:return t[i]<n[i]?"before":"after"}}getWalker(e={}){return e.startPosition=this,new Zn(e)}clone(){return new ge(this.parent,this.offset)}static _createAt(e,t){if(e instanceof ge)return new this(e.parent,e.offset);{const n=e;if(t=="end")t=n.is("$text")?n.data.length:n.childCount;else{if(t=="before")return this._createBefore(n);if(t=="after")return this._createAfter(n);if(t!==0&&!t)throw new y.a("view-createpositionat-offset-required",n)}return new ge(n,t)}}static _createAfter(e){if(e.is("$textProxy"))return new ge(e.textNode,e.offsetInText+e.data.length);if(!e.parent)throw new y.a("view-position-after-root",e,{root:e});return new ge(e.parent,e.index+1)}static _createBefore(e){if(e.is("$textProxy"))return new ge(e.textNode,e.offsetInText);if(!e.parent)throw new y.a("view-position-before-root",e,{root:e});return new ge(e.parent,e.index)}}class Be{constructor(e,t=null){this.start=e.clone(),this.end=t?t.clone():e.clone()}*[Symbol.iterator](){yield*new Zn({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return this.start.parent===this.end.parent}get root(){return this.start.root}getEnlarged(){let e=this.start.getLastMatchingPosition(yr,{direction:"backward"}),t=this.end.getLastMatchingPosition(yr);return e.parent.is("$text")&&e.isAtStart&&(e=ge._createBefore(e.parent)),t.parent.is("$text")&&t.isAtEnd&&(t=ge._createAfter(t.parent)),new Be(e,t)}getTrimmed(){let e=this.start.getLastMatchingPosition(yr);if(e.isAfter(this.end)||e.isEqual(this.end))return new Be(e,e);let t=this.end.getLastMatchingPosition(yr,{direction:"backward"});const n=e.nodeAfter,i=t.nodeBefore;return n&&n.is("$text")&&(e=new ge(n,0)),i&&i.is("$text")&&(t=new ge(i,i.data.length)),new Be(e,t)}isEqual(e){return this==e||this.start.isEqual(e.start)&&this.end.isEqual(e.end)}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,t=!1){e.isCollapsed&&(t=!1);const n=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),i=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&i}getDifference(e){const t=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&t.push(new Be(this.start,e.start)),this.containsPosition(e.end)&&t.push(new Be(e.end,this.end))):t.push(this.clone()),t}getIntersection(e){if(this.isIntersecting(e)){let t=this.start,n=this.end;return this.containsPosition(e.start)&&(t=e.start),this.containsPosition(e.end)&&(n=e.end),new Be(t,n)}return null}getWalker(e={}){return e.boundaries=this,new Zn(e)}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;let e=this.start.nodeAfter,t=this.end.nodeBefore;return this.start.parent.is("$text")&&this.start.isAtEnd&&this.start.parent.nextSibling&&(e=this.start.parent.nextSibling),this.end.parent.is("$text")&&this.end.isAtStart&&this.end.parent.previousSibling&&(t=this.end.parent.previousSibling),e&&e.is("element")&&e===t?e:null}clone(){return new Be(this.start,this.end)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new Zn(e);for(const n of t)yield n.item}*getPositions(e={}){e.boundaries=this;const t=new Zn(e);yield t.position;for(const n of t)yield n.nextPosition}is(e){return e==="range"||e==="view:range"}isIntersecting(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}static _createFromParentsAndOffsets(e,t,n,i){return new this(new ge(e,t),new ge(n,i))}static _createFromPositionAndShift(e,t){const n=e,i=e.getShiftedBy(t);return t>0?new this(n,i):new this(i,n)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(ge._createBefore(e),t)}}function yr(r){return!(!r.item.is("attributeElement")&&!r.item.is("uiElement"))}function Lt(r){let e=0;for(const t of r)e++;return e}class ft{constructor(e=null,t,n){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(e,t,n)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}get isCollapsed(){return this.rangeCount===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake||this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel||this.rangeCount!=e.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const i of e._ranges)if(t.isEqual(i)){n=!0;break}if(!n)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=Lt(this.getRanges());if(t!=Lt(e.getRanges()))return!1;if(t==0)return!0;for(let n of this.getRanges()){n=n.getTrimmed();let i=!1;for(let o of e.getRanges())if(o=o.getTrimmed(),n.start.isEqual(o.start)&&n.end.isEqual(o.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}setTo(e,t,n){if(e===null)this._setRanges([]),this._setFakeOptions(t);else if(e instanceof ft||e instanceof ci)this._setRanges(e.getRanges(),e.isBackward),this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel});else if(e instanceof Be)this._setRanges([e],t&&t.backward),this._setFakeOptions(t);else if(e instanceof ge)this._setRanges([new Be(e)]),this._setFakeOptions(t);else if(e instanceof qr){const i=!!n&&!!n.backward;let o;if(t===void 0)throw new y.a("view-selection-setto-required-second-parameter",this);o=t=="in"?Be._createIn(e):t=="on"?Be._createOn(e):new Be(ge._createAt(e,t)),this._setRanges([o],i),this._setFakeOptions(n)}else{if(!ai(e))throw new y.a("view-selection-setto-not-selectable",this);this._setRanges(e,t&&t.backward),this._setFakeOptions(t)}this.fire("change")}setFocus(e,t){if(this.anchor===null)throw new y.a("view-selection-setfocus-no-ranges",this);const n=ge._createAt(e,t);if(n.compareWith(this.focus)=="same")return;const i=this.anchor;this._ranges.pop(),n.compareWith(i)=="before"?this._addRange(new Be(n,i),!0):this._addRange(new Be(i,n)),this.fire("change")}is(e){return e==="selection"||e==="view:selection"}_setRanges(e,t=!1){e=Array.from(e),this._ranges=[];for(const n of e)this._addRange(n);this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,t=!1){if(!(e instanceof Be))throw new y.a("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges)if(e.isIntersecting(t))throw new y.a("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new Be(e.start,e.end))}}Le(ft,V);class ci{constructor(e=null,t,n){this._selection=new ft,this._selection.delegate("change").to(this),this._selection.setTo(e,t,n)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}is(e){return e==="selection"||e=="documentSelection"||e=="view:selection"||e=="view:documentSelection"}_setTo(e,t,n){this._selection.setTo(e,t,n)}_setFocus(e,t){this._selection.setFocus(e,t)}}Le(ci,V);class Cn extends b{constructor(e,t,n){super(e,t),this.startRange=n,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const di=Symbol("bubbling contexts");var Yr={fire(r,...e){try{const t=r instanceof b?r:new b(this,r),n=Io(this);if(!n.size)return;if(es(t,"capturing",this),xr(n,"$capture",t,...e))return t.return;const i=t.startRange||this.selection.getFirstRange(),o=i?i.getContainedElement():null,a=!!o&&!!rc(n,o);let c=o||function(u){if(!u)return null;const h=u.start.parent,m=u.end.parent,k=h.getPath(),C=m.getPath();return k.length>C.length?h:m}(i);if(es(t,"atTarget",c),!a){if(xr(n,"$text",t,...e))return t.return;es(t,"bubbling",c)}for(;c;){if(c.is("rootElement")){if(xr(n,"$root",t,...e))return t.return}else if(c.is("element")&&xr(n,c.name,t,...e))return t.return;if(xr(n,c,t,...e))return t.return;c=c.parent,es(t,"bubbling",c)}return es(t,"bubbling",this),xr(n,"$document",t,...e),t.return}catch(t){y.a.rethrowUnexpectedError(t,this)}},_addEventListener(r,e,t){const n=xt(t.context||"$document"),i=Io(this);for(const o of n){let a=i.get(o);a||(a=Object.create(V),i.set(o,a)),this.listenTo(a,r,e,t)}},_removeEventListener(r,e){const t=Io(this);for(const n of t.values())this.stopListening(n,r,e)}};function es(r,e,t){r instanceof Cn&&(r._eventPhase=e,r._currentTarget=t)}function xr(r,e,t,...n){const i=typeof e=="string"?r.get(e):rc(r,e);return!!i&&(i.fire(t,...n),t.stop.called)}function rc(r,e){for(const[t,n]of r)if(typeof t=="function"&&t(e))return n;return null}function Io(r){return r[di]||(r[di]=new Map),r[di]}class Xr{constructor(e){this.selection=new ci,this.roots=new li({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.map(e=>e.destroy()),this.stopListening()}_callPostFixers(e){let t=!1;do for(const n of this._postFixers)if(t=n(e),t)break;while(t)}}Le(Xr,Yr),Le(Xr,Wt);class Cr extends Ce{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=oc,this._priority=10,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(this.id===null)throw new y.a("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}is(e,t=null){return t?t===this.name&&(e==="attributeElement"||e==="view:attributeElement"||e==="element"||e==="view:element"):e==="attributeElement"||e==="view:attributeElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}isSimilar(e){return this.id!==null||e.id!==null?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}_clone(e){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}}function oc(){if(Mo(this))return null;let r=this.parent;for(;r&&r.is("attributeElement");){if(Mo(r)>1)return null;r=r.parent}return!r||Mo(r)>1?null:this.childCount}function Mo(r){return Array.from(r.getChildren()).filter(e=>!e.is("uiElement")).length}Cr.DEFAULT_PRIORITY=10;class Ih extends Ce{constructor(e,t,n,i){super(e,t,n,i),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=Ug}is(e,t=null){return t?t===this.name&&(e==="emptyElement"||e==="view:emptyElement"||e==="element"||e==="view:element"):e==="emptyElement"||e==="view:emptyElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}_insertChild(e,t){if(t&&(t instanceof qr||Array.from(t).length>0))throw new y.a("view-emptyelement-cannot-add",[this,t])}}function Ug(){return null}const La=navigator.userAgent.toLowerCase();var _n={isMac:function(r){return r.indexOf("macintosh")>-1}(La),isGecko:function(r){return!!r.match(/gecko\/\d+/)}(La),isSafari:function(r){return r.indexOf(" applewebkit/")>-1&&r.indexOf("chrome")===-1}(La),isAndroid:function(r){return r.indexOf("android")>-1}(La),isBlink:function(r){return r.indexOf("chrome/")>-1&&r.indexOf("edge/")<0}(La),features:{isRegExpUnicodePropertySupported:function(){let r=!1;try{r="ć".search(new RegExp("[\\p{L}]","u"))===0}catch{}return r}()}};const Wg={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},sc={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},ot=function(){const r={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let e=65;e<=90;e++){const t=String.fromCharCode(e);r[t.toLowerCase()]=e}for(let e=48;e<=57;e++)r[e-48]=e;for(let e=112;e<=123;e++)r["f"+(e-111)]=e;return r}(),Mh=Object.fromEntries(Object.entries(ot).map(([r,e])=>[e,r.charAt(0).toUpperCase()+r.slice(1)]));function R(r){let e;if(typeof r=="string"){if(e=ot[r.toLowerCase()],!e)throw new y.a("keyboard-unknown-key",null,{key:r})}else e=r.keyCode+(r.altKey?ot.alt:0)+(r.ctrlKey?ot.ctrl:0)+(r.shiftKey?ot.shift:0)+(r.metaKey?ot.cmd:0);return e}function Oo(r){return typeof r=="string"&&(r=function(e){return e.split("+").map(t=>t.trim())}(r)),r.map(e=>typeof e=="string"?function(t){if(t.endsWith("!"))return R(t.slice(0,-1));const n=R(t);return _n.isMac&&n==ot.ctrl?ot.cmd:n}(e):e).reduce((e,t)=>t+e,0)}function za(r){let e=Oo(r);return Object.entries(_n.isMac?Wg:sc).reduce((t,[n,i])=>(e&ot[n]&&(e&=~ot[n],t+=i),t),"")+(e?Mh[e]:"")}function Ai(r,e){const t=e==="ltr";switch(r){case ot.arrowleft:return t?"left":"right";case ot.arrowright:return t?"right":"left";case ot.arrowup:return"up";case ot.arrowdown:return"down"}}function mt(r,e){const t=Ai(r,e);return t==="down"||t==="right"}class jd extends Ce{constructor(e,t,n,i){super(e,t,n,i),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=Kg}is(e,t=null){return t?t===this.name&&(e==="uiElement"||e==="view:uiElement"||e==="element"||e==="view:element"):e==="uiElement"||e==="view:uiElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"}_insertChild(e,t){if(t&&(t instanceof qr||Array.from(t).length>0))throw new y.a("view-uielement-cannot-add",this)}render(e){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const n of this.getAttributeKeys())t.setAttribute(n,this.getAttribute(n));return t}}function qg(r){r.document.on("arrowKey",(e,t)=>function(n,i,o){if(i.keyCode==ot.arrowright){const a=i.domTarget.ownerDocument.defaultView.getSelection(),c=a.rangeCount==1&&a.getRangeAt(0).collapsed;if(c||i.shiftKey){const u=a.focusNode,h=a.focusOffset,m=o.domPositionToView(u,h);if(m===null)return;let k=!1;const C=m.getLastMatchingPosition(S=>(S.item.is("uiElement")&&(k=!0),!(!S.item.is("uiElement")&&!S.item.is("attributeElement"))));if(k){const S=o.viewPositionToDom(C);c?a.collapse(S.parent,S.offset):a.extend(S.parent,S.offset)}}}}(0,t,r.domConverter),{priority:"low"})}function Kg(){return null}class No extends Ce{constructor(e,t,n,i){super(e,t,n,i),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=Gg}is(e,t=null){return t?t===this.name&&(e==="rawElement"||e==="view:rawElement"||e==="element"||e==="view:element"):e==="rawElement"||e==="view:rawElement"||e===this.name||e==="view:"+this.name||e==="element"||e==="view:element"||e==="node"||e==="view:node"}_insertChild(e,t){if(t&&(t instanceof qr||Array.from(t).length>0))throw new y.a("view-rawelement-cannot-add",[this,t])}}function Gg(){return null}class ts{constructor(e,t){this.document=e,this._children=[],t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}is(e){return e==="documentFragment"||e==="view:documentFragment"}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this);let n=0;const i=function(o,a){return typeof a=="string"?[new _t(o,a)]:(ai(a)||(a=[a]),Array.from(a).map(c=>typeof c=="string"?new _t(o,c):c instanceof cn?new _t(o,c.data):c))}(this.document,t);for(const o of i)o.parent!==null&&o._remove(),o.parent=this,this._children.splice(e,0,o),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n<e+t;n++)this._children[n].parent=null;return this._children.splice(e,t)}_fireChange(e,t){this.fire("change:"+e,t)}}Le(ts,V);class Oh{constructor(e){this.document=e,this._cloneGroups=new Map}setSelection(e,t,n){this.document.selection._setTo(e,t,n)}setSelectionFocus(e,t){this.document.selection._setFocus(e,t)}createDocumentFragment(e){return new ts(this.document,e)}createText(e){return new _t(this.document,e)}createAttributeElement(e,t,n={}){const i=new Cr(this.document,e,t);return typeof n.priority=="number"&&(i._priority=n.priority),n.id&&(i._id=n.id),i}createContainerElement(e,t,n={}){const i=new Qe(this.document,e,t);return n.isAllowedInsideAttributeElement!==void 0&&(i._isAllowedInsideAttributeElement=n.isAllowedInsideAttributeElement),i}createEditableElement(e,t){const n=new jt(this.document,e,t);return n._document=this.document,n}createEmptyElement(e,t,n={}){const i=new Ih(this.document,e,t);return n.isAllowedInsideAttributeElement!==void 0&&(i._isAllowedInsideAttributeElement=n.isAllowedInsideAttributeElement),i}createUIElement(e,t,n,i={}){const o=new jd(this.document,e,t);return n&&(o.render=n),i.isAllowedInsideAttributeElement!==void 0&&(o._isAllowedInsideAttributeElement=i.isAllowedInsideAttributeElement),o}createRawElement(e,t,n,i={}){const o=new No(this.document,e,t);return o.render=n||(()=>{}),i.isAllowedInsideAttributeElement!==void 0&&(o._isAllowedInsideAttributeElement=i.isAllowedInsideAttributeElement),o}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){Xn(e)&&n===void 0&&(n=t),n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){return e instanceof ge?this._breakAttributes(e):this._breakAttributesRange(e)}breakContainer(e){const t=e.parent;if(!t.is("containerElement"))throw new y.a("view-writer-break-non-container-element",this.document);if(!t.parent)throw new y.a("view-writer-break-root",this.document);if(e.isAtStart)return ge._createBefore(t);if(!e.isAtEnd){const n=t._clone(!1);this.insert(ge._createAfter(t),n);const i=new Be(e,ge._createAt(t,"end")),o=new ge(n,0);this.move(i,o)}return ge._createAfter(t)}mergeAttributes(e){const t=e.offset,n=e.parent;if(n.is("$text"))return e;if(n.is("attributeElement")&&n.childCount===0){const a=n.parent,c=n.index;return n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new ge(a,c))}const i=n.getChild(t-1),o=n.getChild(t);if(!i||!o)return e;if(i.is("$text")&&o.is("$text"))return Nh(i,o);if(i.is("attributeElement")&&o.is("attributeElement")&&i.isSimilar(o)){const a=i.childCount;return i._appendChild(o.getChildren()),o._remove(),this._removeFromClonedElementsGroup(o),this.mergeAttributes(new ge(i,a))}return e}mergeContainers(e){const t=e.nodeBefore,n=e.nodeAfter;if(!(t&&n&&t.is("containerElement")&&n.is("containerElement")))throw new y.a("view-writer-merge-containers-invalid-position",this.document);const i=t.getChild(t.childCount-1),o=i instanceof _t?ge._createAt(i,"end"):ge._createAt(t,"end");return this.move(Be._createIn(n),ge._createAt(t,"end")),this.remove(Be._createOn(n)),o}insert(e,t){(function a(c,u){for(const h of c){if(!Yg.some(m=>h instanceof m))throw new y.a("view-writer-insert-invalid-node-type",u);h.is("$text")||a(h.getChildren(),u)}})(t=ai(t)?[...t]:[t],this.document);const n=t.reduce((a,c)=>{const u=a[a.length-1],h=!(c.is("uiElement")&&c.isAllowedInsideAttributeElement);return u&&u.breakAttributes==h?u.nodes.push(c):a.push({breakAttributes:h,nodes:[c]}),a},[]);let i=null,o=e;for(const{nodes:a,breakAttributes:c}of n){const u=this._insertNodes(o,a,c);i||(i=u.start),o=u.end}return i?new Be(i,o):new Be(e)}remove(e){const t=e instanceof Be?e:Be._createOn(e);if(Ba(t,this.document),t.isCollapsed)return new ts(this.document);const{start:n,end:i}=this._breakAttributesRange(t,!0),o=n.parent,a=i.offset-n.offset,c=o._removeChildren(n.offset,a);for(const h of c)this._removeFromClonedElementsGroup(h);const u=this.mergeAttributes(n);return t.start=u,t.end=u.clone(),new ts(this.document,c)}clear(e,t){Ba(e,this.document);const n=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const i of n){const o=i.item;let a;if(o.is("element")&&t.isSimilar(o))a=Be._createOn(o);else if(!i.nextPosition.isAfter(e.start)&&o.is("$textProxy")){const c=o.getAncestors().find(u=>u.is("element")&&t.isSimilar(u));c&&(a=Be._createIn(c))}a&&(a.end.isAfter(e.end)&&(a.end=e.end),a.start.isBefore(e.start)&&(a.start=e.start),this.remove(a))}}move(e,t){let n;if(t.isAfter(e.end)){const i=(t=this._breakAttributes(t,!0)).parent,o=i.childCount;e=this._breakAttributesRange(e,!0),n=this.remove(e),t.offset+=i.childCount-o}else n=this.remove(e);return this.insert(t,n)}wrap(e,t){if(!(t instanceof Cr))throw new y.a("view-writer-wrap-invalid-attribute",this.document);if(Ba(e,this.document),e.isCollapsed){let i=e.start;i.parent.is("element")&&(n=i.parent,!Array.from(n.getChildren()).some(a=>!a.is("uiElement")))&&(i=i.getLastMatchingPosition(a=>a.item.is("uiElement"))),i=this._wrapPosition(i,t);const o=this.document.selection;return o.isCollapsed&&o.getFirstPosition().isEqual(e.start)&&this.setSelection(i),new Be(i)}return this._wrapRange(e,t);var n}unwrap(e,t){if(!(t instanceof Cr))throw new y.a("view-writer-unwrap-invalid-attribute",this.document);if(Ba(e,this.document),e.isCollapsed)return e;const{start:n,end:i}=this._breakAttributesRange(e,!0),o=n.parent,a=this._unwrapChildren(o,n.offset,i.offset,t),c=this.mergeAttributes(a.start);c.isEqual(a.start)||a.end.offset--;const u=this.mergeAttributes(a.end);return new Be(c,u)}rename(e,t){const n=new Qe(this.document,e,t.getAttributes());return this.insert(ge._createAfter(t),n),this.move(Be._createIn(t),ge._createAt(n,0)),this.remove(Be._createOn(t)),n}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return ge._createAt(e,t)}createPositionAfter(e){return ge._createAfter(e)}createPositionBefore(e){return ge._createBefore(e)}createRange(e,t){return new Be(e,t)}createRangeOn(e){return Be._createOn(e)}createRangeIn(e){return Be._createIn(e)}createSelection(e,t,n){return new ft(e,t,n)}_insertNodes(e,t,n){let i,o;if(i=n?Ld(e):e.parent.is("$text")?e.parent.parent:e.parent,!i)throw new y.a("view-writer-invalid-position-container",this.document);o=n?this._breakAttributes(e,!0):e.parent.is("$text")?zd(e):e;const a=i._insertChild(o.offset,t);for(const m of t)this._addToClonedElementsGroup(m);const c=o.getShiftedBy(a),u=this.mergeAttributes(o);u.isEqual(o)||c.offset--;const h=this.mergeAttributes(c);return new Be(u,h)}_wrapChildren(e,t,n,i){let o=t;const a=[];for(;o<n;){const u=e.getChild(o),h=u.is("$text"),m=u.is("attributeElement"),k=u.isAllowedInsideAttributeElement;if(m&&this._wrapAttributeElement(i,u))a.push(new ge(e,o));else if(h||k||m&&Qg(i,u)){const C=i._clone();u._remove(),C._appendChild(u),e._insertChild(o,C),this._addToClonedElementsGroup(C),a.push(new ge(e,o))}else m&&this._wrapChildren(u,0,u.childCount,i);o++}let c=0;for(const u of a)u.offset-=c,u.offset!=t&&(this.mergeAttributes(u).isEqual(u)||(c++,n--));return Be._createFromParentsAndOffsets(e,t,e,n)}_unwrapChildren(e,t,n,i){let o=t;const a=[];for(;o<n;){const u=e.getChild(o);if(u.is("attributeElement"))if(u.isSimilar(i)){const h=u.getChildren(),m=u.childCount;u._remove(),e._insertChild(o,h),this._removeFromClonedElementsGroup(u),a.push(new ge(e,o),new ge(e,o+m)),o+=m,n+=m-1}else this._unwrapAttributeElement(i,u)?(a.push(new ge(e,o),new ge(e,o+1)),o++):(this._unwrapChildren(u,0,u.childCount,i),o++);else o++}let c=0;for(const u of a)u.offset-=c,!(u.offset==t||u.offset==n)&&(this.mergeAttributes(u).isEqual(u)||(c++,n--));return Be._createFromParentsAndOffsets(e,t,e,n)}_wrapRange(e,t){const{start:n,end:i}=this._breakAttributesRange(e,!0),o=n.parent,a=this._wrapChildren(o,n.offset,i.offset,t),c=this.mergeAttributes(a.start);c.isEqual(a.start)||a.end.offset--;const u=this.mergeAttributes(a.end);return new Be(c,u)}_wrapPosition(e,t){if(t.isSimilar(e.parent))return Tr(e.clone());e.parent.is("$text")&&(e=zd(e));const n=this.createAttributeElement();n._priority=Number.POSITIVE_INFINITY,n.isSimilar=()=>!1,e.parent._insertChild(e.offset,n);const i=new Be(e,e.getShiftedBy(1));this.wrap(i,t);const o=new ge(n.parent,n.index);n._remove();const a=o.nodeBefore,c=o.nodeAfter;return a instanceof _t&&c instanceof _t?Nh(a,c):Tr(o)}_wrapAttributeElement(e,t){if(!Ar(e,t)||e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if(n!=="class"&&n!=="style"&&t.hasAttribute(n)&&t.getAttribute(n)!==e.getAttribute(n))return!1;for(const n of e.getStyleNames())if(t.hasStyle(n)&&t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())n!=="class"&&n!=="style"&&(t.hasAttribute(n)||this.setAttribute(n,e.getAttribute(n),t));for(const n of e.getStyleNames())t.hasStyle(n)||this.setStyle(n,e.getStyle(n),t);for(const n of e.getClassNames())t.hasClass(n)||this.addClass(n,t);return!0}_unwrapAttributeElement(e,t){if(!Ar(e,t)||e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if(n!=="class"&&n!=="style"&&(!t.hasAttribute(n)||t.getAttribute(n)!==e.getAttribute(n)))return!1;if(!t.hasClass(...e.getClassNames()))return!1;for(const n of e.getStyleNames())if(!t.hasStyle(n)||t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())n!=="class"&&n!=="style"&&this.removeAttribute(n,t);return this.removeClass(Array.from(e.getClassNames()),t),this.removeStyle(Array.from(e.getStyleNames()),t),!0}_breakAttributesRange(e,t=!1){const n=e.start,i=e.end;if(Ba(e,this.document),e.isCollapsed){const u=this._breakAttributes(e.start,t);return new Be(u,u)}const o=this._breakAttributes(i,t),a=o.parent.childCount,c=this._breakAttributes(n,t);return o.offset+=o.parent.childCount-a,new Be(c,o)}_breakAttributes(e,t=!1){const n=e.offset,i=e.parent;if(e.parent.is("emptyElement"))throw new y.a("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new y.a("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new y.a("view-writer-cannot-break-raw-element",this.document);if(!t&&i.is("$text")&&Bd(i.parent)||Bd(i))return e.clone();if(i.is("$text"))return this._breakAttributes(zd(e),t);if(n==i.childCount){const o=new ge(i.parent,i.index+1);return this._breakAttributes(o,t)}if(n===0){const o=new ge(i.parent,i.index);return this._breakAttributes(o,t)}{const o=i.index+1,a=i._clone();i.parent._insertChild(o,a),this._addToClonedElementsGroup(a);const c=i.childCount-n,u=i._removeChildren(n,c);a._appendChild(u);const h=new ge(i.parent,o);return this._breakAttributes(h,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const i of e.getChildren())this._addToClonedElementsGroup(i);const t=e.id;if(!t)return;let n=this._cloneGroups.get(t);n||(n=new Set,this._cloneGroups.set(t,n)),n.add(e),e._clonesGroup=n}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const i of e.getChildren())this._removeFromClonedElementsGroup(i);const t=e.id;if(!t)return;const n=this._cloneGroups.get(t);n&&n.delete(e)}}function Ld(r){let e=r.parent;for(;!Bd(e);){if(!e)return;e=e.parent}return e}function Qg(r,e){return r.priority<e.priority||!(r.priority>e.priority)&&r.getIdentity()<e.getIdentity()}function Tr(r){const e=r.nodeBefore;if(e&&e.is("$text"))return new ge(e,e.data.length);const t=r.nodeAfter;return t&&t.is("$text")?new ge(t,0):r}function zd(r){if(r.offset==r.parent.data.length)return new ge(r.parent.parent,r.parent.index+1);if(r.offset===0)return new ge(r.parent.parent,r.parent.index);const e=r.parent.data.slice(r.offset);return r.parent._data=r.parent.data.slice(0,r.offset),r.parent.parent._insertChild(r.parent.index+1,new _t(r.root.document,e)),new ge(r.parent.parent,r.parent.index+1)}function Nh(r,e){const t=r.data.length;return r._data+=e.data,e._remove(),new ge(r,t)}const Yg=[_t,Cr,Qe,Ih,No,jd];function Bd(r){return r&&(r.is("containerElement")||r.is("documentFragment"))}function Ba(r,e){const t=Ld(r.start),n=Ld(r.end);if(!t||!n||t!==n)throw new y.a("view-writer-invalid-range-container",e)}function Ar(r,e){return r.id===null&&e.id===null}function Pn(r){return Object.prototype.toString.call(r)=="[object Text]"}const Rh=r=>r.createTextNode(" "),Dh=r=>{const e=r.createElement("span");return e.dataset.ckeFiller=!0,e.innerHTML=" ",e},jh=r=>{const e=r.createElement("br");return e.dataset.ckeFiller=!0,e},ac="".repeat(7);function wn(r){return Pn(r)&&r.data.substr(0,7)===ac}function lc(r){return r.data.length==7&&wn(r)}function Fd(r){return wn(r)?r.data.slice(7):r.data}function er(r,e){if(e.keyCode==ot.arrowleft){const t=e.domTarget.ownerDocument.defaultView.getSelection();if(t.rangeCount==1&&t.getRangeAt(0).collapsed){const n=t.getRangeAt(0).startContainer,i=t.getRangeAt(0).startOffset;wn(n)&&i<=7&&t.collapse(n,0)}}}function Lh(r,e,t,n=!1){t=t||function(o,a){return o===a},Array.isArray(r)||(r=Array.prototype.slice.call(r)),Array.isArray(e)||(e=Array.prototype.slice.call(e));const i=function(o,a,c){const u=zh(o,a,c);if(u===-1)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const h=Bh(o,u),m=Bh(a,u),k=zh(h,m,c),C=o.length-k,S=a.length-k;return{firstIndex:u,lastIndexOld:C,lastIndexNew:S}}(r,e,t);return n?function(o,a){const{firstIndex:c,lastIndexOld:u,lastIndexNew:h}=o;if(c===-1)return Array(a).fill("equal");let m=[];return c>0&&(m=m.concat(Array(c).fill("equal"))),h-c>0&&(m=m.concat(Array(h-c).fill("insert"))),u-c>0&&(m=m.concat(Array(u-c).fill("delete"))),h<a&&(m=m.concat(Array(a-h).fill("equal"))),m}(i,e.length):function(o,a){const c=[],{firstIndex:u,lastIndexOld:h,lastIndexNew:m}=a;return m-u>0&&c.push({index:u,type:"insert",values:o.slice(u,m)}),h-u>0&&c.push({index:u+(m-u),type:"delete",howMany:h-u}),c}(e,i)}function zh(r,e,t){for(let n=0;n<Math.max(r.length,e.length);n++)if(r[n]===void 0||e[n]===void 0||!t(r[n],e[n]))return n;return-1}function Bh(r,e){return r.slice(e).reverse()}function Ro(r,e,t){t=t||function(D,z){return D===z};const n=r.length,i=e.length;if(n>200||i>200||n+i>300)return Ro.fastDiff(r,e,t,!0);let o,a;if(i<n){const D=r;r=e,e=D,o="delete",a="insert"}else o="insert",a="delete";const c=r.length,u=e.length,h=u-c,m={},k={};function C(D){const z=(k[D-1]!==void 0?k[D-1]:-1)+1,U=k[D+1]!==void 0?k[D+1]:-1,J=z>U?-1:1;m[D+J]&&(m[D]=m[D+J].slice(0)),m[D]||(m[D]=[]),m[D].push(z>U?o:a);let ce=Math.max(z,U),ye=ce-D;for(;ye<c&&ce<u&&t(r[ye],e[ce]);)ye++,ce++,m[D].push("equal");return ce}let S,N=0;do{for(S=-N;S<h;S++)k[S]=C(S);for(S=h+N;S>h;S--)k[S]=C(S);k[h]=C(h),N++}while(k[h]!==u);return m[h].slice(1)}function Fh(r,e,t){r.insertBefore(t,r.childNodes[e]||null)}function Vd(r){const e=r.parentNode;e&&e.removeChild(r)}function ns(r){if(r){if(r.defaultView)return r instanceof r.defaultView.Document;if(r.ownerDocument&&r.ownerDocument.defaultView)return r instanceof r.ownerDocument.defaultView.Node}return!1}Ro.fastDiff=Lh;class Vh{constructor(e,t){this.domDocuments=new Set,this.domConverter=e,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=t,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(e,t){if(e==="text")this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if(e==="attributes")this.markedAttributes.add(t);else{if(e!=="children")throw new y.a("view-renderer-unknown-type",this);this.markedChildren.add(t)}}}render(){let e;for(const t of this.markedChildren)this._updateChildrenMappings(t);this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent));for(const t of this.markedAttributes)this._updateAttrs(t);for(const t of this.markedChildren)this._updateChildren(t,{inlineFillerPosition:e});for(const t of this.markedTexts)!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)&&this._updateText(t,{inlineFillerPosition:e});if(e){const t=this.domConverter.viewPositionToDom(e),n=t.parent.ownerDocument;wn(t.parent)?this._inlineFiller=t.parent:this._inlineFiller=$h(n,t.parent,t.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=Array.from(this.domConverter.mapViewToDom(e).childNodes),i=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,{withChildren:!1})),o=this._diffNodeLists(n,i),a=this._findReplaceActions(o,n,i);if(a.indexOf("replace")!==-1){const c={equal:0,insert:0,delete:0};for(const u of a)if(u==="replace"){const h=c.equal+c.insert,m=c.equal+c.delete,k=e.getChild(h);!k||k.is("uiElement")||k.is("rawElement")||this._updateElementMappings(k,n[m]),Vd(i[h]),c.equal++}else c[u]++}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();return e.parent.is("$text")?ge._createBefore(this.selection.getFirstPosition().parent):e}_isSelectionInInlineFiller(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&Pn(t.parent)&&wn(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!wn(e))throw new y.a("view-renderer-filler-was-lost",this);lc(e)?e.parentNode.removeChild(e):e.data=e.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=e.parent,n=e.offset;if(!this.domConverter.mapViewToDom(t.root)||!t.is("element")||!function(a){if(a.getAttribute("contenteditable")=="false")return!1;const c=a.findAncestor(u=>u.hasAttribute("contenteditable"));return!c||c.getAttribute("contenteditable")=="true"}(t)||n===t.getFillerOffset())return!1;const i=e.nodeBefore,o=e.nodeAfter;return!(i instanceof _t||o instanceof _t)}_updateText(e,t){const n=this.domConverter.findCorrespondingDomText(e),i=this.domConverter.viewToDom(e,n.ownerDocument),o=n.data;let a=i.data;const c=t.inlineFillerPosition;if(c&&c.parent==e.parent&&c.offset==e.index&&(a=ac+a),o!=a){const u=Lh(o,a);for(const h of u)h.type==="insert"?n.insertData(h.index,h.values.join("")):n.deleteData(h.index,h.howMany)}}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=Array.from(t.attributes).map(o=>o.name),i=e.getAttributeKeys();for(const o of i)t.setAttribute(o,e.getAttribute(o));for(const o of n)e.hasAttribute(o)||t.removeAttribute(o)}_updateChildren(e,t){const n=this.domConverter.mapViewToDom(e);if(!n)return;const i=t.inlineFillerPosition,o=this.domConverter.mapViewToDom(e).childNodes,a=Array.from(this.domConverter.viewChildrenToDom(e,n.ownerDocument,{bind:!0,inlineFillerPosition:i}));i&&i.parent===e&&$h(n.ownerDocument,a,i.offset);const c=this._diffNodeLists(o,a);let u=0;const h=new Set;for(const m of c)m==="delete"?(h.add(o[u]),Vd(o[u])):m==="equal"&&u++;u=0;for(const m of c)m==="insert"?(Fh(n,u,a[u]),u++):m==="equal"&&(this._markDescendantTextToSync(this.domConverter.domToView(a[u])),u++);for(const m of h)m.parentNode||this.domConverter.unbindDomElement(m)}_diffNodeLists(e,t){return Ro(e=function(n,i){const o=Array.from(n);return o.length==0||!i||o[o.length-1]==i&&o.pop(),o}(e,this._fakeSelectionContainer),t,Fa.bind(null,this.domConverter))}_findReplaceActions(e,t,n){if(e.indexOf("insert")===-1||e.indexOf("delete")===-1)return e;let i=[],o=[],a=[];const c={equal:0,insert:0,delete:0};for(const u of e)u==="insert"?a.push(n[c.equal+c.insert]):u==="delete"?o.push(t[c.equal+c.delete]):(i=i.concat(Ro(o,a,cc).map(h=>h==="equal"?"replace":h)),i.push("equal"),o=[],a=[]),c[u]++;return i.concat(Ro(o,a,cc).map(u=>u==="equal"?"replace":u))}_markDescendantTextToSync(e){if(e){if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const t of e.getChildren())this._markDescendantTextToSync(t)}}_updateSelection(){if(this.selection.rangeCount===0)return this._removeDomSelection(),void this._removeFakeSelection();const e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e&&(this.selection.isFake?this._updateFakeSelection(e):(this._removeFakeSelection(),this._updateDomSelection(e)))}_updateFakeSelection(e){const t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(a){const c=a.createElement("div");return c.className="ck-fake-selection-container",Object.assign(c.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),c.textContent=" ",c}(t));const n=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(n,this.selection),!this._fakeSelectionNeedsUpdate(e))return;n.parentElement&&n.parentElement==e||e.appendChild(n),n.textContent=this.selection.fakeSelectionLabel||" ";const i=t.getSelection(),o=t.createRange();i.removeAllRanges(),o.selectNodeContents(n),i.addRange(o)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),i=this.domConverter.viewPositionToDom(this.selection.focus);t.collapse(n.parent,n.offset),t.extend(i.parent,i.offset),_n.isGecko&&function(o,a){const c=o.parent;if(c.nodeType!=Node.ELEMENT_NODE||o.offset!=c.childNodes.length-1)return;const u=c.childNodes[o.offset];u&&u.tagName=="BR"&&a.addRange(a.getRangeAt(0))}(i,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return(!t||!this.selection.isEqual(t))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer,n=e.ownerDocument.getSelection();return!t||t.parentElement!==e||n.anchorNode!==t&&!t.contains(n.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const e of this.domDocuments)if(e.getSelection().rangeCount){const t=e.activeElement,n=this.domConverter.mapDomToView(t);t&&n&&e.getSelection().removeAllRanges()}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function $h(r,e,t){const n=e instanceof Array?e:e.childNodes,i=n[t];if(Pn(i))return i.data=ac+i.data,i;{const o=r.createTextNode(ac);return Array.isArray(e)?n.splice(t,0,o):Fh(e,t,o),o}}function cc(r,e){return ns(r)&&ns(e)&&!Pn(r)&&!Pn(e)&&r.nodeType!==Node.COMMENT_NODE&&e.nodeType!==Node.COMMENT_NODE&&r.tagName.toLowerCase()===e.tagName.toLowerCase()}function Fa(r,e,t){return e===t||(Pn(e)&&Pn(t)?e.data===t.data:!(!r.isBlockFiller(e)||!r.isBlockFiller(t)))}Le(Vh,Wt);var $t={window,document};function $d(r){let e=0;for(;r.previousSibling;)r=r.previousSibling,e++;return e}function Hd(r){const e=[];for(;r&&r.nodeType!=Node.DOCUMENT_NODE;)e.unshift(r),r=r.parentNode;return e}const Xg=jh(document),Jr=Rh(document),Ud=Dh(document);class Sr{constructor(e,t={}){this.document=e,this.blockFillerMode=t.blockFillerMode||"br",this.preElements=["pre"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new Vi,this._encounteredRawContentDomNodes=new WeakSet}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new ft(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const n of e.childNodes)this.unbindDomElement(n)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}viewToDom(e,t,n={}){if(e.is("$text")){const i=this._processDataFromViewText(e);return t.createTextNode(i)}{if(this.mapViewToDom(e))return this.mapViewToDom(e);let i;if(e.is("documentFragment"))i=t.createDocumentFragment(),n.bind&&this.bindDocumentFragments(i,e);else{if(e.is("uiElement"))return i=e.name==="$comment"?t.createComment(e.getCustomProperty("$rawContent")):e.render(t),n.bind&&this.bindElements(i,e),i;i=e.hasAttribute("xmlns")?t.createElementNS(e.getAttribute("xmlns"),e.name):t.createElement(e.name),e.is("rawElement")&&e.render(i),n.bind&&this.bindElements(i,e);for(const o of e.getAttributeKeys())i.setAttribute(o,e.getAttribute(o))}if(n.withChildren!==!1)for(const o of this.viewChildrenToDom(e,t,n))i.appendChild(o);return i}}*viewChildrenToDom(e,t,n={}){const i=e.getFillerOffset&&e.getFillerOffset();let o=0;for(const a of e.getChildren())i===o&&(yield this._getBlockFiller(t)),yield this.viewToDom(a,t,n),o++;i===o&&(yield this._getBlockFiller(t))}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),n=this.viewPositionToDom(e.end),i=document.createRange();return i.setStart(t.parent,t.offset),i.setEnd(n.parent,n.offset),i}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const n=this.findCorrespondingDomText(t);if(!n)return null;let i=e.offset;return wn(n)&&(i+=7),{parent:n,offset:i}}{let n,i,o;if(e.offset===0){if(n=this.mapViewToDom(t),!n)return null;o=n.childNodes[0]}else{const a=e.nodeBefore;if(i=a.is("$text")?this.findCorrespondingDomText(a):this.mapViewToDom(e.nodeBefore),!i)return null;n=i.parentNode,o=i.nextSibling}return Pn(o)&&wn(o)?{parent:o,offset:7}:{parent:n,offset:i?$d(i)+1:0}}}domToView(e,t={}){if(this.isBlockFiller(e))return null;const n=this.getHostViewElement(e);if(n)return n;if(this.isComment(e)&&t.skipComments)return null;if(Pn(e)){if(lc(e))return null;{const i=this._processDataFromDomText(e);return i===""?null:new _t(this.document,i)}}{if(this.mapDomToView(e))return this.mapDomToView(e);let i;if(this.isDocumentFragment(e))i=new ts(this.document),t.bind&&this.bindDocumentFragments(e,i);else{i=this._createViewElement(e,t),t.bind&&this.bindElements(e,i);const o=e.attributes;if(o)for(let a=o.length-1;a>=0;a--)i._setAttribute(o[a].name,o[a].value);if(this._isViewElementWithRawContent(i,t)||this.isComment(e)){const a=this.isComment(e)?e.data:e.innerHTML;return i._setCustomProperty("$rawContent",a),this._encounteredRawContentDomNodes.add(e),i}}if(t.withChildren!==!1)for(const o of this.domChildrenToView(e,t))i._appendChild(o);return i}}*domChildrenToView(e,t={}){for(let n=0;n<e.childNodes.length;n++){const i=e.childNodes[n],o=this.domToView(i,t);o!==null&&(yield o)}}domSelectionToView(e){if(e.rangeCount===1){let i=e.getRangeAt(0).startContainer;Pn(i)&&(i=i.parentNode);const o=this.fakeSelectionToView(i);if(o)return o}const t=this.isDomSelectionBackward(e),n=[];for(let i=0;i<e.rangeCount;i++){const o=e.getRangeAt(i),a=this.domRangeToView(o);a&&n.push(a)}return new ft(n,{backward:t})}domRangeToView(e){const t=this.domPositionToView(e.startContainer,e.startOffset),n=this.domPositionToView(e.endContainer,e.endOffset);return t&&n?new Be(t,n):null}domPositionToView(e,t){if(this.isBlockFiller(e))return this.domPositionToView(e.parentNode,$d(e));const n=this.mapDomToView(e);if(n&&(n.is("uiElement")||n.is("rawElement")))return ge._createBefore(n);if(Pn(e)){if(lc(e))return this.domPositionToView(e.parentNode,$d(e));const i=this.findCorrespondingViewText(e);let o=t;return i?(wn(e)&&(o-=7,o=o<0?0:o),new ge(i,o)):null}if(t===0){const i=this.mapDomToView(e);if(i)return new ge(i,0)}else{const i=e.childNodes[t-1],o=Pn(i)?this.findCorrespondingViewText(i):this.mapDomToView(i);if(o&&o.parent)return new ge(o.parent,o.index+1)}return null}mapDomToView(e){return this.getHostViewElement(e)||this._domToViewMapping.get(e)}findCorrespondingViewText(e){if(lc(e))return null;const t=this.getHostViewElement(e);if(t)return t;const n=e.previousSibling;if(n){if(!this.isElement(n))return null;const i=this.mapDomToView(n);if(i)return i.nextSibling instanceof _t?i.nextSibling:null}else{const i=this.mapDomToView(e.parentNode);if(i){const o=i.getChild(0);return o instanceof _t?o:null}}return null}mapViewToDom(e){return this._viewToDomMapping.get(e)}findCorrespondingDomText(e){const t=e.previousSibling;return t&&this.mapViewToDom(t)?this.mapViewToDom(t).nextSibling:!t&&e.parent&&this.mapViewToDom(e.parent)?this.mapViewToDom(e.parent).childNodes[0]:null}focus(e){const t=this.mapViewToDom(e);if(t&&t.ownerDocument.activeElement!==t){const{scrollX:n,scrollY:i}=$t.window,o=[];Si(t,a=>{const{scrollLeft:c,scrollTop:u}=a;o.push([c,u])}),t.focus(),Si(t,a=>{const[c,u]=o.shift();a.scrollLeft=c,a.scrollTop=u}),$t.window.scrollTo(n,i)}}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(e){return e&&e.nodeType==Node.COMMENT_NODE}isBlockFiller(e){return this.blockFillerMode=="br"?e.isEqualNode(Xg):!(e.tagName!=="BR"||!Hh(e,this.blockElements)||e.parentNode.childNodes.length!==1)||e.isEqualNode(Ud)||function(t,n){return t.isEqualNode(Jr)&&Hh(t,n)&&t.parentNode.childNodes.length===1}(e,this.blockElements)}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=document.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset);const n=t.collapsed;return t.detach(),n}getHostViewElement(e){const t=Hd(e);for(t.pop();t.length;){const n=t.pop(),i=this._domToViewMapping.get(n);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}_getBlockFiller(e){switch(this.blockFillerMode){case"nbsp":return Rh(e);case"markedNbsp":return Dh(e);case"br":return jh(e)}}_isDomSelectionPositionCorrect(e,t){if(Pn(e)&&wn(e)&&t<7||this.isElement(e)&&wn(e.childNodes[t]))return!1;const n=this.mapDomToView(e);return!n||!n.is("uiElement")&&!n.is("rawElement")}_processDataFromViewText(e){let t=e.data;if(e.getAncestors().some(n=>this.preElements.includes(n.name)))return t;if(t.charAt(0)==" "){const n=this._getTouchingInlineViewNode(e,!1);!(n&&n.is("$textProxy")&&this._nodeEndsWithSpace(n))&&n||(t=" "+t.substr(1))}if(t.charAt(t.length-1)==" "){const n=this._getTouchingInlineViewNode(e,!0),i=n&&n.is("$textProxy")&&n.data.charAt(0)==" ";t.charAt(t.length-2)!=" "&&n&&!i||(t=t.substr(0,t.length-1)+" ")}return t.replace(/ {2}/g," ")}_nodeEndsWithSpace(e){if(e.getAncestors().some(n=>this.preElements.includes(n.name)))return!1;const t=this._processDataFromViewText(e);return t.charAt(t.length-1)==" "}_processDataFromDomText(e){let t=e.data;if(function(h,m){return Hd(h).some(k=>k.tagName&&m.includes(k.tagName.toLowerCase()))}(e,this.preElements))return Fd(e);t=t.replace(/[ \n\t\r]{1,}/g," ");const n=this._getTouchingInlineDomNode(e,!1),i=this._getTouchingInlineDomNode(e,!0),o=this._checkShouldLeftTrimDomText(e,n),a=this._checkShouldRightTrimDomText(e,i);o&&(t=t.replace(/^ /,"")),a&&(t=t.replace(/ $/,"")),t=Fd(new Text(t)),t=t.replace(/ \u00A0/g," ");const c=i&&this.isElement(i)&&i.tagName!="BR",u=i&&Pn(i)&&i.data.charAt(0)==" ";return(/( |\u00A0)\u00A0$/.test(t)||!i||c||u)&&(t=t.replace(/\u00A0$/," ")),(o||n&&this.isElement(n)&&n.tagName!="BR")&&(t=t.replace(/^\u00A0/," ")),t}_checkShouldLeftTrimDomText(e,t){return!t||(this.isElement(t)?t.tagName==="BR":!this._encounteredRawContentDomNodes.has(e.previousSibling)&&/[^\S\u00A0]/.test(t.data.charAt(t.data.length-1)))}_checkShouldRightTrimDomText(e,t){return!t&&!wn(e)}_getTouchingInlineViewNode(e,t){const n=new Zn({startPosition:t?ge._createAfter(e):ge._createBefore(e),direction:t?"forward":"backward"});for(const i of n){if(i.item.is("element")&&this.inlineObjectElements.includes(i.item.name))return i.item;if(i.item.is("containerElement")||i.item.is("element","br"))return null;if(i.item.is("$textProxy"))return i.item}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode)return null;const n=t?"firstChild":"lastChild",i=t?"nextSibling":"previousSibling";let o=!0;do if(!o&&e[n]?e=e[n]:e[i]?(e=e[i],o=!1):(e=e.parentNode,o=!0),!e||this._isBlockElement(e))return null;while(!Pn(e)&&e.tagName!="BR"&&!this._isInlineObjectElement(e));return e}_isBlockElement(e){return this.isElement(e)&&this.blockElements.includes(e.tagName.toLowerCase())}_isInlineObjectElement(e){return this.isElement(e)&&this.inlineObjectElements.includes(e.tagName.toLowerCase())}_createViewElement(e,t){if(this.isComment(e))return new jd(this.document,"$comment");const n=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();return new Ce(this.document,n)}_isViewElementWithRawContent(e,t){return t.withChildren!==!1&&this._rawContentElementMatcher.match(e)}}function Si(r,e){for(;r&&r!=$t.document;)e(r),r=r.parentNode}function Hh(r,e){const t=r.parentNode;return t&&t.tagName&&e.includes(t.tagName.toLowerCase())}function Va(r){const e=Object.prototype.toString.apply(r);return e=="[object Window]"||e=="[object global]"}var is=mo({},V,{listenTo(r,...e){if(ns(r)||Va(r)){const t=this._getProxyEmitter(r)||new rs(r);t.attach(...e),r=t}V.listenTo.call(this,r,...e)},stopListening(r,e,t){if(ns(r)||Va(r)){const n=this._getProxyEmitter(r);if(!n)return;r=n}V.stopListening.call(this,r,e,t),r instanceof rs&&r.detach(e)},_getProxyEmitter(r){return e=this,t=Zr(r),e[L]&&e[L][t]?e[L][t].emitter:null;var e,t}});class rs{constructor(e){F(this,Zr(e)),this._domNode=e}}function Zr(r){return r["data-ck-expando"]||(r["data-ck-expando"]=P())}mo(rs.prototype,V,{attach(r,e,t={}){if(this._domListeners&&this._domListeners[r])return;const n={capture:!!t.useCapture,passive:!!t.usePassive},i=this._createDomListener(r,n);this._domNode.addEventListener(r,i,n),this._domListeners||(this._domListeners={}),this._domListeners[r]=i},detach(r){let e;!this._domListeners[r]||(e=this._events[r])&&e.callbacks.length||this._domListeners[r].removeListener()},_createDomListener(r,e){const t=n=>{this.fire(r,n)};return t.removeListener=()=>{this._domNode.removeEventListener(r,t,e),delete this._domListeners[r]},t}});class Er{constructor(e){this.view=e,this.document=e.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return e&&e.nodeType===3&&(e=e.parentNode),!(!e||e.nodeType!==1)&&e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}Le(Er,is);var Jg=function(r){return this.__data__.set(r,"__lodash_hash_undefined__"),this},dc=function(r){return this.__data__.has(r)};function uc(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new Es;++e<t;)this.add(r[e])}uc.prototype.add=uc.prototype.push=Jg,uc.prototype.has=dc;var Uh=uc,In=function(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(e(r[t],t,r))return!0;return!1},Wd=function(r,e){return r.has(e)},qd=function(r,e,t,n,i,o){var a=1&t,c=r.length,u=e.length;if(c!=u&&!(a&&u>c))return!1;var h=o.get(r),m=o.get(e);if(h&&m)return h==e&&m==r;var k=-1,C=!0,S=2&t?new Uh:void 0;for(o.set(r,e),o.set(e,r);++k<c;){var N=r[k],D=e[k];if(n)var z=a?n(D,N,k,e,r,o):n(N,D,k,r,e,o);if(z!==void 0){if(z)continue;C=!1;break}if(S){if(!In(e,function(U,J){if(!Wd(S,J)&&(N===U||i(N,U,t,n,o)))return S.push(J)})){C=!1;break}}else if(N!==D&&!i(N,D,t,n,o)){C=!1;break}}return o.delete(r),o.delete(e),C},Pr=function(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t},Kd=function(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t},$a=be?be.prototype:void 0,eo=$a?$a.valueOf:void 0,Wh=function(r,e,t,n,i,o,a){switch(t){case"[object DataView]":if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(r.byteLength!=e.byteLength||!o(new Co(r),new Co(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return xe(+r,+e);case"[object Error]":return r.name==e.name&&r.message==e.message;case"[object RegExp]":case"[object String]":return r==e+"";case"[object Map]":var c=Pr;case"[object Set]":var u=1&n;if(c||(c=Kd),r.size!=e.size&&!u)return!1;var h=a.get(r);if(h)return h==e;n|=2,a.set(r,e);var m=qd(c(r),c(e),n,i,o,a);return a.delete(r),m;case"[object Symbol]":if(eo)return eo.call(r)==eo.call(e)}return!1},ei=Object.prototype.hasOwnProperty,Gd=function(r,e,t,n,i,o){var a=1&t,c=ko(r),u=c.length;if(u!=ko(e).length&&!a)return!1;for(var h=u;h--;){var m=c[h];if(!(a?m in e:ei.call(e,m)))return!1}var k=o.get(r),C=o.get(e);if(k&&C)return k==e&&C==r;var S=!0;o.set(r,e),o.set(e,r);for(var N=a;++h<u;){var D=r[m=c[h]],z=e[m];if(n)var U=a?n(z,D,m,e,r,o):n(D,z,m,r,e,o);if(!(U===void 0?D===z||i(D,z,t,n,o):U)){S=!1;break}N||(N=m=="constructor")}if(S&&!N){var J=r.constructor,ce=e.constructor;J==ce||!("constructor"in r)||!("constructor"in e)||typeof J=="function"&&J instanceof J&&typeof ce=="function"&&ce instanceof ce||(S=!1)}return o.delete(r),o.delete(e),S},qh=Object.prototype.hasOwnProperty,Zg=function(r,e,t,n,i,o){var a=Pt(r),c=Pt(e),u=a?"[object Array]":Mt(r),h=c?"[object Array]":Mt(e),m=(u=u=="[object Arguments]"?"[object Object]":u)=="[object Object]",k=(h=h=="[object Arguments]"?"[object Object]":h)=="[object Object]",C=u==h;if(C&&Object(ki.a)(r)){if(!Object(ki.a)(e))return!1;a=!0,m=!1}if(C&&!m)return o||(o=new Wo),a||vs(r)?qd(r,e,t,n,i,o):Wh(r,e,u,t,n,i,o);if(!(1&t)){var S=m&&qh.call(r,"__wrapped__"),N=k&&qh.call(e,"__wrapped__");if(S||N){var D=S?r.value():r,z=N?e.value():e;return o||(o=new Wo),i(D,z,t,n,o)}}return!!C&&(o||(o=new Wo),Gd(r,e,t,n,i,o))},Kh=function r(e,t,n,i,o){return e===t||(e==null||t==null||!Yt(e)&&!Yt(t)?e!=e&&t!=t:Zg(e,t,n,i,r,o))},Qd=function(r,e,t){var n=(t=typeof t=="function"?t:void 0)?t(r,e):void 0;return n===void 0?Kh(r,e,void 0,t):!!n};class Gh extends Er{constructor(e){super(e),this._config={childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},this.domConverter=e.domConverter,this.renderer=e._renderer,this._domElements=[],this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(e){this._domElements.push(e),this.isEnabled&&this._mutationObserver.observe(e,this._config)}enable(){super.enable();for(const e of this._domElements)this._mutationObserver.observe(e,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(e){if(e.length===0)return;const t=this.domConverter,n=new Map,i=new Set;for(const h of e)if(h.type==="childList"){const m=t.mapDomToView(h.target);if(m&&(m.is("uiElement")||m.is("rawElement")))continue;m&&!this._isBogusBrMutation(h)&&i.add(m)}for(const h of e){const m=t.mapDomToView(h.target);if((!m||!m.is("uiElement")&&!m.is("rawElement"))&&h.type==="characterData"){const k=t.findCorrespondingViewText(h.target);k&&!i.has(k.parent)?n.set(k,{type:"text",oldText:k.data,newText:Fd(h.target),node:k}):!k&&wn(h.target)&&i.add(t.mapDomToView(h.target.parentNode))}}const o=[];for(const h of n.values())this.renderer.markToSync("text",h.node),o.push(h);for(const h of i){const m=t.mapViewToDom(h),k=Array.from(h.getChildren()),C=Array.from(t.domChildrenToView(m,{withChildren:!1}));Qd(k,C,u)||(this.renderer.markToSync("children",h),o.push({type:"children",oldChildren:k,newChildren:C,node:h}))}const a=e[0].target.ownerDocument.getSelection();let c=null;if(a&&a.anchorNode){const h=t.domPositionToView(a.anchorNode,a.anchorOffset),m=t.domPositionToView(a.focusNode,a.focusOffset);h&&m&&(c=new ft(h),c.setFocus(m))}function u(h,m){if(!Array.isArray(h))return h===m||!(!h.is("$text")||!m.is("$text"))&&h.data===m.data}o.length&&(this.document.fire("mutations",o,c),this.view.forceRender())}_isBogusBrMutation(e){let t=null;return e.nextSibling===null&&e.removedNodes.length===0&&e.addedNodes.length==1&&(t=this.domConverter.domToView(e.addedNodes[0],{withChildren:!1})),t&&t.is("element","br")}}class os{constructor(e,t,n){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,mo(this,n)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class to extends Er{constructor(e){super(e),this.useCapture=!1}observe(e){(typeof this.domEventType=="string"?[this.domEventType]:this.domEventType).forEach(t=>{this.listenTo(e,t,(n,i)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(i.target)&&this.onDomEvent(i)},{useCapture:this.useCapture})})}fire(e,t,n){this.isEnabled&&this.document.fire(e,new os(this.view,t,n))}}class em extends to{constructor(e){super(e),this.domEventType=["keydown","keyup"]}onDomEvent(e){this.fire(e.type,e,{keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return R(this)}})}}var Yd=function(){return re.a.Date.now()},Ha=/\s/,tm=function(r){for(var e=r.length;e--&&Ha.test(r.charAt(e)););return e},nm=/^\s+/,Xd=function(r){return r&&r.slice(0,tm(r)+1).replace(nm,"")},Qh=/^[-+]0x[0-9a-f]+$/i,im=/^0b[01]+$/i,rm=/^0o[0-7]+$/i,om=parseInt,Jd=function(r){if(typeof r=="number")return r;if(Ds(r))return NaN;if(oe(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=oe(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=Xd(r);var t=im.test(r);return t||rm.test(r)?om(r.slice(2),t?2:8):Qh.test(r)?NaN:+r},Zd=Math.max,sm=Math.min,Ua=function(r,e,t){var n,i,o,a,c,u,h=0,m=!1,k=!1,C=!0;if(typeof r!="function")throw new TypeError("Expected a function");function S(ce){var ye=n,ze=i;return n=i=void 0,h=ce,a=r.apply(ze,ye)}function N(ce){return h=ce,c=setTimeout(z,e),m?S(ce):a}function D(ce){var ye=ce-u;return u===void 0||ye>=e||ye<0||k&&ce-h>=o}function z(){var ce=Yd();if(D(ce))return U(ce);c=setTimeout(z,function(ye){var ze=e-(ye-u);return k?sm(ze,o-(ye-h)):ze}(ce))}function U(ce){return c=void 0,C&&n?S(ce):(n=i=void 0,a)}function J(){var ce=Yd(),ye=D(ce);if(n=arguments,i=this,u=ce,ye){if(c===void 0)return N(u);if(k)return clearTimeout(c),c=setTimeout(z,e),S(u)}return c===void 0&&(c=setTimeout(z,e)),a}return e=Jd(e)||0,oe(t)&&(m=!!t.leading,o=(k="maxWait"in t)?Zd(Jd(t.maxWait)||0,e):o,C="trailing"in t?!!t.trailing:C),J.cancel=function(){c!==void 0&&clearTimeout(c),h=0,n=u=i=c=void 0},J.flush=function(){return c===void 0?a:U(Yd())},J};class Yh extends Er{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=Ua(t=>this.document.fire("selectionChangeDone",t),200)}observe(){const e=this.document;e.on("arrowKey",(t,n)=>{e.selection.isFake&&this.isEnabled&&n.preventDefault()},{context:"$capture"}),e.on("arrowKey",(t,n)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(n.keyCode)},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,n=new ft(t.getRanges(),{backward:t.isBackward,fake:!1});e!=ot.arrowleft&&e!=ot.arrowup||n.setTo(n.getFirstPosition()),e!=ot.arrowright&&e!=ot.arrowdown||n.setTo(n.getLastPosition());const i={oldSelection:t,newSelection:n,domSelection:null};this.document.fire("selectionChange",i),this._fireSelectionChangeDoneDebounced(i)}}class Xh extends Er{constructor(e){super(e),this.mutationObserver=e.getObserver(Gh),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Ua(t=>this.document.fire("selectionChangeDone",t),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(e){const t=e.ownerDocument;this._documents.has(t)||(this.listenTo(t,"selectionchange",(n,i)=>{this._handleSelectionChange(i,t)}),this._documents.add(t))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(e,t){if(!this.isEnabled)return;const n=t.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(n.anchorNode))return;this.mutationObserver.flush();const i=this.domConverter.domSelectionToView(n);if(i.rangeCount!=0){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(i)&&this.domConverter.isDomSelectionCorrect(n)||++this._loopbackCounter>60))if(this.selection.isSimilar(i))this.view.forceRender();else{const o={oldSelection:this.selection,newSelection:i,domSelection:n};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class Jh extends to{constructor(e){super(e),this.domEventType=["focus","blur"],this.useCapture=!0;const t=this.document;t.on("focus",()=>{t.isFocused=!0,this._renderTimeoutId=setTimeout(()=>e.change(()=>{}),50)}),t.on("blur",(n,i)=>{const o=t.selection.editableElement;o!==null&&o!==i.target||(t.isFocused=!1,e.change(()=>{}))})}onDomEvent(e){this.fire(e.type,e)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class hc extends to{constructor(e){super(e),this.domEventType=["compositionstart","compositionupdate","compositionend"];const t=this.document;t.on("compositionstart",()=>{t.isComposing=!0}),t.on("compositionend",()=>{t.isComposing=!1})}onDomEvent(e){this.fire(e.type,e)}}class am extends to{constructor(e){super(e),this.domEventType=["beforeinput"]}onDomEvent(e){this.fire(e.type,e)}}class Zh{constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t}),e.style.display="none",t&&e.parentNode.insertBefore(t,e.nextSibling)}restore(){this._replacedElements.forEach(({element:e,newElement:t})=>{e.style.display="",t&&t.remove()}),this._replacedElements=[]}}var eu=function(r){return typeof r=="string"||!Pt(r)&&Yt(r)&&ke(r)=="[object String]"};function fc(r){return Object.prototype.toString.apply(r)=="[object Range]"}function tu(r){const e=r.ownerDocument.defaultView.getComputedStyle(r);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}const ef=["top","right","bottom","left","width","height"];class yt{constructor(e){const t=fc(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),Ji(e)||t)if(t){const n=yt.getDomRangeRects(e);Wa(this,yt.getBoundingRect(n))}else Wa(this,e.getBoundingClientRect());else if(Va(e)){const{innerWidth:n,innerHeight:i}=e;Wa(this,{top:0,right:n,bottom:i,left:0,width:n,height:i})}else Wa(this,e)}clone(){return new yt(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left)};return t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0?null:new yt(t)}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(!pc(e)){let n=e.parentNode||e.commonAncestorContainer;for(;n&&!pc(n);){const i=new yt(n),o=t.getIntersection(i);if(!o)return null;o.getArea()<t.getArea()&&(t=o),n=n.parentNode}}return t}isEqual(e){for(const t of ef)if(this[t]!==e[t])return!1;return!0}contains(e){const t=this.getIntersection(e);return!(!t||!t.isEqual(e))}excludeScrollbarsAndBorders(){const e=this._source;let t,n,i;if(Va(e))t=e.innerWidth-e.document.documentElement.clientWidth,n=e.innerHeight-e.document.documentElement.clientHeight,i=e.getComputedStyle(e.document.documentElement).direction;else{const o=tu(this._source);t=e.offsetWidth-e.clientWidth-o.left-o.right,n=e.offsetHeight-e.clientHeight-o.top-o.bottom,i=e.ownerDocument.defaultView.getComputedStyle(e).direction,this.left+=o.left,this.top+=o.top,this.right-=o.right,this.bottom-=o.bottom,this.width=this.right-this.left,this.height=this.bottom-this.top}return this.width-=t,i==="ltr"?this.right-=t:this.left+=t,this.height-=n,this.bottom-=n,this}static getDomRangeRects(e){const t=[],n=Array.from(e.getClientRects());if(n.length)for(const i of n)t.push(new yt(i));else{let i=e.startContainer;Pn(i)&&(i=i.parentNode);const o=new yt(i.getBoundingClientRect());o.right=o.left,o.width=0,t.push(o)}return t}static getBoundingRect(e){const t={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY};let n=0;for(const i of e)n++,t.left=Math.min(t.left,i.left),t.top=Math.min(t.top,i.top),t.right=Math.max(t.right,i.right),t.bottom=Math.max(t.bottom,i.bottom);return n==0?null:(t.width=t.right-t.left,t.height=t.bottom-t.top,new yt(t))}}function Wa(r,e){for(const t of ef)r[t]=e[t]}function pc(r){return!!Ji(r)&&r===r.ownerDocument.body}class Xt{constructor(e,t){Xt._observerInstance||Xt._createObserver(),this._element=e,this._callback=t,Xt._addElementCallback(e,t),Xt._observerInstance.observe(e)}destroy(){Xt._deleteElementCallback(this._element,this._callback)}static _addElementCallback(e,t){Xt._elementCallbacks||(Xt._elementCallbacks=new Map);let n=Xt._elementCallbacks.get(e);n||(n=new Set,Xt._elementCallbacks.set(e,n)),n.add(t)}static _deleteElementCallback(e,t){const n=Xt._getElementCallbacks(e);n&&(n.delete(t),n.size||(Xt._elementCallbacks.delete(e),Xt._observerInstance.unobserve(e))),Xt._elementCallbacks&&!Xt._elementCallbacks.size&&(Xt._observerInstance=null,Xt._elementCallbacks=null)}static _getElementCallbacks(e){return Xt._elementCallbacks?Xt._elementCallbacks.get(e):null}static _createObserver(){let e;e=typeof $t.window.ResizeObserver=="function"?$t.window.ResizeObserver:gc,Xt._observerInstance=new e(t=>{for(const n of t){const i=Xt._getElementCallbacks(n.target);if(i)for(const o of i)o(n)}})}}Xt._observerInstance=null,Xt._elementCallbacks=null;class gc{constructor(e){this._callback=e,this._elements=new Set,this._previousRects=new Map,this._periodicCheckTimeout=null}observe(e){this._elements.add(e),this._checkElementRectsAndExecuteCallback(),this._elements.size===1&&this._startPeriodicCheck()}unobserve(e){this._elements.delete(e),this._previousRects.delete(e),this._elements.size||this._stopPeriodicCheck()}_startPeriodicCheck(){const e=()=>{this._checkElementRectsAndExecuteCallback(),this._periodicCheckTimeout=setTimeout(e,100)};this.listenTo($t.window,"resize",()=>{this._checkElementRectsAndExecuteCallback()}),this._periodicCheckTimeout=setTimeout(e,100)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout),this.stopListening(),this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const e=[];for(const t of this._elements)this._hasRectChanged(t)&&e.push({target:t,contentRect:this._previousRects.get(t)});e.length&&this._callback(e)}_hasRectChanged(e){if(!e.ownerDocument.body.contains(e))return!1;const t=new yt(e),n=this._previousRects.get(e),i=!n||!n.isEqual(t);return this._previousRects.set(e,t),i}}function st(r){return e=>e+r}function ui(r){const e=r.next();return e.done?null:e.value}Le(gc,is);class $i{constructor(){this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}add(e){if(this._elements.has(e))throw new y.a("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",()=>this._focus(e),{useCapture:!0}),this.listenTo(e,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(e)}remove(e){e===this.focusedElement&&this._blur(e),this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e))}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=e,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}Le($i,is),Le($i,Wt);class Ei{constructor(){this._listener=Object.create(is)}listenTo(e){this._listener.listenTo(e,"keydown",(t,n)=>{this._listener.fire("_keydown:"+R(n),n)})}set(e,t,n={}){const i=Oo(e),o=n.priority;this._listener.listenTo(this._listener,"_keydown:"+i,(a,c)=>{t(c,()=>{c.preventDefault(),c.stopPropagation(),a.stop()}),a.return=!0},{priority:o})}press(e){return!!this._listener.fire("_keydown:"+R(e),e)}destroy(){this._listener.stopListening()}}class tf extends Er{constructor(e){super(e),this.document.on("keydown",(t,n)=>{if(this.isEnabled&&((i=n.keyCode)==ot.arrowright||i==ot.arrowleft||i==ot.arrowup||i==ot.arrowdown)){const o=new Cn(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(o,n),o.stop.called&&t.stop()}var i})}observe(){}}function nf({target:r,viewportOffset:e=0}){const t=bc(r);let n=t,i=null;for(;n;){let o;o=hi(n==t?r:i),Pi(o,()=>no(r,n));const a=no(r,n);if(lm(n,a,e),n.parent!=n){if(i=n.frameElement,n=n.parent,!i)return}else n=null}}function lm(r,e,t){const n=e.clone().moveBy(0,t),i=e.clone().moveBy(0,-t),o=new yt(r).excludeScrollbarsAndBorders();if(![i,n].every(a=>o.contains(a))){let{scrollX:a,scrollY:c}=r;qa(i,o)?c-=o.top-e.top+t:rf(n,o)&&(c+=e.bottom-o.bottom+t),mc(e,o)?a-=o.left-e.left+t:nu(e,o)&&(a+=e.right-o.right+t),r.scrollTo(a,c)}}function Pi(r,e){const t=bc(r);let n,i;for(;r!=t.document.body;)i=e(),n=new yt(r).excludeScrollbarsAndBorders(),n.contains(i)||(qa(i,n)?r.scrollTop-=n.top-i.top:rf(i,n)&&(r.scrollTop+=i.bottom-n.bottom),mc(i,n)?r.scrollLeft-=n.left-i.left:nu(i,n)&&(r.scrollLeft+=i.right-n.right)),r=r.parentNode}function rf(r,e){return r.bottom>e.bottom}function qa(r,e){return r.top<e.top}function mc(r,e){return r.left<e.left}function nu(r,e){return r.right>e.right}function bc(r){return fc(r)?r.startContainer.ownerDocument.defaultView:r.ownerDocument.defaultView}function hi(r){if(fc(r)){let e=r.commonAncestorContainer;return Pn(e)&&(e=e.parentNode),e}return r.parentNode}function no(r,e){const t=bc(r),n=new yt(r);if(t===e)return n;{let i=t;for(;i!=e;){const o=i.frameElement,a=new yt(o).excludeScrollbarsAndBorders();n.moveBy(a.left,a.top),i=i.parent}}return n}Object.assign({},{scrollViewportToShowTarget:nf,scrollAncestorsToShowTarget:function(r){Pi(hi(r),()=>new yt(r))}});class vc{constructor(e){this.document=new Xr(e),this.domConverter=new Sr(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Vh(this.domConverter,this.document.selection),this._renderer.bind("isFocused").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new Oh(this.document),this.addObserver(Gh),this.addObserver(Xh),this.addObserver(Jh),this.addObserver(em),this.addObserver(Yh),this.addObserver(hc),this.addObserver(tf),_n.isAndroid&&this.addObserver(am),this.document.on("arrowKey",er,{priority:"low"}),qg(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0}),this.listenTo(this.document,"change:isFocused",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(e,t="main"){const n=this.document.getRoot(t);n._name=e.tagName.toLowerCase();const i={};for(const{name:a,value:c}of Array.from(e.attributes))i[a]=c,a==="class"?this._writer.addClass(c.split(" "),n):this._writer.setAttribute(a,c,n);this._initialDomRootAttributes.set(e,i);const o=()=>{this._writer.setAttribute("contenteditable",!n.isReadOnly,n),n.isReadOnly?this._writer.addClass("ck-read-only",n):this._writer.removeClass("ck-read-only",n)};o(),this.domRoots.set(t,e),this.domConverter.bindElements(e,n),this._renderer.markToSync("children",n),this._renderer.markToSync("attributes",n),this._renderer.domDocuments.add(e.ownerDocument),n.on("change:children",(a,c)=>this._renderer.markToSync("children",c)),n.on("change:attributes",(a,c)=>this._renderer.markToSync("attributes",c)),n.on("change:text",(a,c)=>this._renderer.markToSync("text",c)),n.on("change:isReadOnly",()=>this.change(o)),n.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const a of this._observers.values())a.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:i})=>t.removeAttribute(i));const n=this._initialDomRootAttributes.get(t);for(const i in n)t.setAttribute(i,n[i]);this.domRoots.delete(e),this.domConverter.unbindDomElement(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(const[n,i]of this.domRoots)t.observe(i,n);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection(){const e=this.document.selection.getFirstRange();e&&nf({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new y.a("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(t){y.a.rethrowUnexpectedError(t,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change(()=>{})}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return ge._createAt(e,t)}createPositionAfter(e){return ge._createAfter(e)}createPositionBefore(e){return ge._createBefore(e)}createRange(e,t){return new Be(e,t)}createRangeOn(e){return Be._createOn(e)}createRangeIn(e){return Be._createIn(e)}createSelection(e,t,n){return new ft(e,t,n)}_disableRendering(e){this._renderingDisabled=e,e==0&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}Le(vc,Wt);class Do{constructor(e){this.parent=null,this._attrs=Ti(e)}get index(){let e;if(!this.parent)return null;if((e=this.parent.getChildIndex(this))===null)throw new y.a("model-node-not-found-in-parent",this);return e}get startOffset(){let e;if(!this.parent)return null;if((e=this.parent.getChildStartOffset(this))===null)throw new y.a("model-node-not-found-in-parent",this);return e}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),i=e.getAncestors(t);let o=0;for(;n[o]==i[o]&&n[o];)o++;return o===0?null:n[o-1]}isBefore(e){if(this==e||this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),i=xn(t,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return t[i]<n[i]}}isAfter(e){return this!=e&&this.root===e.root&&!this.isBefore(e)}hasAttribute(e){return this._attrs.has(e)}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}toJSON(){const e={};return this._attrs.size&&(e.attributes=Array.from(this._attrs).reduce((t,n)=>(t[n[0]]=n[1],t),{})),e}is(e){return e==="node"||e==="model:node"}_clone(){return new Do(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=Ti(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}class Nt extends Do{constructor(e,t){super(t),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}is(e){return e==="$text"||e==="model:$text"||e==="text"||e==="model:text"||e==="node"||e==="model:node"}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new Nt(this.data,this.getAttributes())}static fromJSON(e){return new Nt(e.data,e.attributes)}}class tr{constructor(e,t,n){if(this.textNode=e,t<0||t>e.offsetSize)throw new y.a("model-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.offsetSize)throw new y.a("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+n),this.offsetInText=t}get startOffset(){return this.textNode.startOffset!==null?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return this.startOffset!==null?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}is(e){return e==="$textProxy"||e==="model:$textProxy"||e==="textProxy"||e==="model:textProxy"}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class jo{constructor(e){this._nodes=[],e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((e,t)=>e+t.offsetSize,0)}getNode(e){return this._nodes[e]||null}getNodeIndex(e){const t=this._nodes.indexOf(e);return t==-1?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return t===null?null:this._nodes.slice(0,t).reduce((n,i)=>n+i.offsetSize,0)}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const t=this._nodes[e];if(!t)throw new y.a("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const n of this._nodes){if(e>=t&&e<t+n.offsetSize)return this.getNodeIndex(n);t+=n.offsetSize}if(t!=e)throw new y.a("model-nodelist-offset-out-of-bounds",this,{offset:e,nodeList:this});return this.length}_insertNodes(e,t){for(const n of t)if(!(n instanceof Do))throw new y.a("model-nodelist-insertnodes-not-node",this);this._nodes.splice(e,0,...t)}_removeNodes(e,t=1){return this._nodes.splice(e,t)}toJSON(){return this._nodes.map(e=>e.toJSON())}}class Rt extends Do{constructor(e,t,n){super(t),this.name=e,this._children=new jo,n&&this._insertChild(0,n)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}is(e,t=null){return t?t===this.name&&(e==="element"||e==="model:element"):e==="element"||e==="model:element"||e==="node"||e==="model:node"}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}findAncestor(e,t={includeSelf:!1}){let n=t.includeSelf?this:this.parent;for(;n;){if(n.name===e)return n;n=n.parent}return null}toJSON(){const e=super.toJSON();if(e.name=this.name,this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=e?Array.from(this._children).map(n=>n._clone(!0)):null;return new Rt(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(i){return typeof i=="string"?[new Nt(i)]:(ai(i)||(i=[i]),Array.from(i).map(o=>typeof o=="string"?new Nt(o):o instanceof tr?new Nt(o.data,o.getAttributes()):o))}(t);for(const i of n)i.parent!==null&&i._remove(),i.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const i of n)i.parent=null;return n}static fromJSON(e){let t=null;if(e.children){t=[];for(const n of e.children)n.name?t.push(Rt.fromJSON(n)):t.push(Nt.fromJSON(n))}return new Rt(e.name,e.attributes,t)}}class nr{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new y.a("model-tree-walker-no-start-position",null);const t=e.direction||"forward";if(t!="forward"&&t!="backward")throw new y.a("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this.position=e.startPosition.clone():this.position=he._createAt(this.boundaries[this.direction=="backward"?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(e){let t,n,i,o;do i=this.position,o=this._visitedParent,{done:t,value:n}=this.next();while(!t&&e(n));t||(this.position=i,this._visitedParent=o)}next(){return this.direction=="forward"?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),n=this._visitedParent;if(n.parent===null&&t.offset===n.maxOffset)return{done:!0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};const i=t.parent,o=zs(t,i),a=o||Ir(t,i,o);if(a instanceof Rt)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=a),this.position=t,io("elementStart",a,e,t,1);if(a instanceof Nt){let c;if(this.singleCharacters)c=1;else{let m=a.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offset<m&&(m=this.boundaries.end.offset),c=m-t.offset}const u=t.offset-a.startOffset,h=new tr(a,u,c);return t.offset+=c,this.position=t,io("text",h,e,t,c)}return t.path.pop(),t.offset++,this.position=t,this._visitedParent=n.parent,this.ignoreElementEnd?this._next():io("elementEnd",n,e,t)}_previous(){const e=this.position,t=this.position.clone(),n=this._visitedParent;if(n.parent===null&&t.offset===0)return{done:!0};if(n==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};const i=t.parent,o=zs(t,i),a=o||iu(t,i,o);if(a instanceof Rt)return t.offset--,this.shallow?(this.position=t,io("elementStart",a,e,t,1)):(t.path.push(a.maxOffset),this.position=t,this._visitedParent=a,this.ignoreElementEnd?this._previous():io("elementEnd",a,e,t));if(a instanceof Nt){let c;if(this.singleCharacters)c=1;else{let m=a.startOffset;this._boundaryStartParent==n&&this.boundaries.start.offset>m&&(m=this.boundaries.start.offset),c=t.offset-m}const u=t.offset-a.startOffset,h=new tr(a,u-c,c);return t.offset-=c,this.position=t,io("text",h,e,t,c)}return t.path.pop(),this.position=t,this._visitedParent=n.parent,io("elementStart",n,e,t,1)}}function io(r,e,t,n,i){return{done:!1,value:{type:r,item:e,previousPosition:t,nextPosition:n,length:i}}}class he{constructor(e,t,n="toNone"){if(!e.is("element")&&!e.is("documentFragment"))throw new y.a("model-position-root-invalid",e);if(!(t instanceof Array)||t.length===0)throw new y.a("model-position-path-incorrect-format",e,{path:t});e.is("rootElement")?t=t.slice():(t=[...e.getPath(),...t],e=e.root),this.root=e,this.path=t,this.stickiness=n}get offset(){return this.path[this.path.length-1]}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;t<this.path.length-1;t++)if(e=e.getChild(e.offsetToIndex(this.path[t])),!e)throw new y.a("model-position-path-incorrect",this,{position:this});if(e.is("$text"))throw new y.a("model-position-path-incorrect",this,{position:this});return e}get index(){return this.parent.offsetToIndex(this.offset)}get textNode(){return zs(this,this.parent)}get nodeAfter(){const e=this.parent;return Ir(this,e,zs(this,e))}get nodeBefore(){const e=this.parent;return iu(this,e,zs(this,e))}get isAtStart(){return this.offset===0}get isAtEnd(){return this.offset==this.parent.maxOffset}compareWith(e){if(this.root!=e.root)return"different";const t=xn(this.path,e.path);switch(t){case"same":return"same";case"prefix":return"before";case"extension":return"after";default:return this.path[t]<e.path[t]?"before":"after"}}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new nr(t);return n.skip(e),n.position}getParentPath(){return this.path.slice(0,-1)}getAncestors(){const e=this.parent;return e.is("documentFragment")?[e]:e.getAncestors({includeSelf:!0})}findAncestor(e){const t=this.parent;return t.is("element")?t.findAncestor(e,{includeSelf:!0}):null}getCommonPath(e){if(this.root!=e.root)return[];const t=xn(this.path,e.path),n=typeof t=="string"?Math.min(this.path.length,e.path.length):t;return this.path.slice(0,n)}getCommonAncestor(e){const t=this.getAncestors(),n=e.getAncestors();let i=0;for(;t[i]==n[i]&&t[i];)i++;return i===0?null:t[i-1]}getShiftedBy(e){const t=this.clone(),n=t.offset+e;return t.offset=n<0?0:n,t}isAfter(e){return this.compareWith(e)=="after"}isBefore(e){return this.compareWith(e)=="before"}isEqual(e){return this.compareWith(e)=="same"}isTouching(e){let t=null,n=null;switch(this.compareWith(e)){case"same":return!0;case"before":t=he._createAt(this),n=he._createAt(e);break;case"after":t=he._createAt(e),n=he._createAt(this);break;default:return!1}let i=t.parent;for(;t.path.length+n.path.length;){if(t.isEqual(n))return!0;if(t.path.length>n.path.length){if(t.offset!==i.maxOffset)return!1;t.path=t.path.slice(0,-1),i=i.parent,t.offset++}else{if(n.offset!==0)return!1;n.path=n.path.slice(0,-1)}}}is(e){return e==="position"||e==="model:position"}hasSameParentAs(e){return this.root!==e.root?!1:xn(this.getParentPath(),e.getParentPath())=="same"}getTransformedByOperation(e){let t;switch(e.type){case"insert":t=this._getTransformedByInsertOperation(e);break;case"move":case"remove":case"reinsert":t=this._getTransformedByMoveOperation(e);break;case"split":t=this._getTransformedBySplitOperation(e);break;case"merge":t=this._getTransformedByMergeOperation(e);break;default:t=he._createAt(this)}return t}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&this.stickiness=="toNext"?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const t=e.movedRange;let n;return t.containsPosition(this)||t.start.isEqual(this)?(n=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(n=n._getTransformedByDeletion(e.deletionPosition,1))):n=this.isEqual(e.deletionPosition)?he._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),n}_getTransformedByDeletion(e,t){const n=he._createAt(this);if(this.root!=e.root)return n;if(xn(e.getParentPath(),this.getParentPath())=="same"){if(e.offset<this.offset){if(e.offset+t>this.offset)return null;n.offset-=t}}else if(xn(e.getParentPath(),this.getParentPath())=="prefix"){const i=e.path.length-1;if(e.offset<=this.path[i]){if(e.offset+t>this.path[i])return null;n.path[i]-=t}}return n}_getTransformedByInsertion(e,t){const n=he._createAt(this);if(this.root!=e.root)return n;if(xn(e.getParentPath(),this.getParentPath())=="same")(e.offset<this.offset||e.offset==this.offset&&this.stickiness!="toPrevious")&&(n.offset+=t);else if(xn(e.getParentPath(),this.getParentPath())=="prefix"){const i=e.path.length-1;e.offset<=this.path[i]&&(n.path[i]+=t)}return n}_getTransformedByMove(e,t,n){if(t=t._getTransformedByDeletion(e,n),e.isEqual(t))return he._createAt(this);const i=this._getTransformedByDeletion(e,n);return i===null||e.isEqual(this)&&this.stickiness=="toNext"||e.getShiftedBy(n).isEqual(this)&&this.stickiness=="toPrevious"?this._getCombined(e,t):i._getTransformedByInsertion(t,n)}_getCombined(e,t){const n=e.path.length-1,i=he._createAt(t);return i.stickiness=this.stickiness,i.offset=i.offset+this.path[n]-e.offset,i.path=[...i.path,...this.path.slice(n+1)],i}toJSON(){return{root:this.root.toJSON(),path:Array.from(this.path),stickiness:this.stickiness}}clone(){return new this.constructor(this.root,this.path,this.stickiness)}static _createAt(e,t,n="toNone"){if(e instanceof he)return new he(e.root,e.path,e.stickiness);{const i=e;if(t=="end")t=i.maxOffset;else{if(t=="before")return this._createBefore(i,n);if(t=="after")return this._createAfter(i,n);if(t!==0&&!t)throw new y.a("model-createpositionat-offset-required",[this,e])}if(!i.is("element")&&!i.is("documentFragment"))throw new y.a("model-position-parent-incorrect",[this,e]);const o=i.getPath();return o.push(t),new this(i.root,o,n)}}static _createAfter(e,t){if(!e.parent)throw new y.a("model-position-after-root",[this,e],{root:e});return this._createAt(e.parent,e.endOffset,t)}static _createBefore(e,t){if(!e.parent)throw new y.a("model-position-before-root",e,{root:e});return this._createAt(e.parent,e.startOffset,t)}static fromJSON(e,t){if(e.root==="$graveyard"){const n=new he(t.graveyard,e.path);return n.stickiness=e.stickiness,n}if(!t.getRoot(e.root))throw new y.a("model-position-fromjson-no-root",t,{rootName:e.root});return new he(t.getRoot(e.root),e.path,e.stickiness)}}function zs(r,e){const t=e.getChild(e.offsetToIndex(r.offset));return t&&t.is("$text")&&t.startOffset<r.offset?t:null}function Ir(r,e,t){return t!==null?null:e.getChild(e.offsetToIndex(r.offset))}function iu(r,e,t){return t!==null?null:e.getChild(e.offsetToIndex(r.offset)-1)}class se{constructor(e,t=null){this.start=he._createAt(e),this.end=t?he._createAt(t):he._createAt(e),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}*[Symbol.iterator](){yield*new nr({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return xn(this.start.getParentPath(),this.end.getParentPath())=="same"}get root(){return this.start.root}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,t=!1){e.isCollapsed&&(t=!1);const n=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),i=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&i}containsItem(e){const t=he._createBefore(e);return this.containsPosition(t)||this.start.isEqual(t)}is(e){return e==="range"||e==="model:range"}isEqual(e){return this.start.isEqual(e.start)&&this.end.isEqual(e.end)}isIntersecting(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}getDifference(e){const t=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&t.push(new se(this.start,e.start)),this.containsPosition(e.end)&&t.push(new se(e.end,this.end))):t.push(new se(this.start,this.end)),t}getIntersection(e){if(this.isIntersecting(e)){let t=this.start,n=this.end;return this.containsPosition(e.start)&&(t=e.start),this.containsPosition(e.end)&&(n=e.end),new se(t,n)}return null}getJoined(e,t=!1){let n=this.isIntersecting(e);if(n||(n=this.start.isBefore(e.start)?t?this.end.isTouching(e.start):this.end.isEqual(e.start):t?e.end.isTouching(this.start):e.end.isEqual(this.start)),!n)return null;let i=this.start,o=this.end;return e.start.isBefore(i)&&(i=e.start),e.end.isAfter(o)&&(o=e.end),new se(i,o)}getMinimalFlatRanges(){const e=[],t=this.start.getCommonPath(this.end).length,n=he._createAt(this.start);let i=n.parent;for(;n.path.length>t+1;){const o=i.maxOffset-n.offset;o!==0&&e.push(new se(n,n.getShiftedBy(o))),n.path=n.path.slice(0,-1),n.offset++,i=i.parent}for(;n.path.length<=this.end.path.length;){const o=this.end.path[n.path.length-1],a=o-n.offset;a!==0&&e.push(new se(n,n.getShiftedBy(a))),n.offset=o,n.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new nr(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new nr(e);for(const n of t)yield n.item}*getPositions(e={}){e.boundaries=this;const t=new nr(e);yield t.position;for(const n of t)yield n.nextPosition}getTransformedByOperation(e){switch(e.type){case"insert":return this._getTransformedByInsertOperation(e);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(e);case"split":return[this._getTransformedBySplitOperation(e)];case"merge":return[this._getTransformedByMergeOperation(e)]}return[new se(this.start,this.end)]}getTransformedByOperations(e){const t=[new se(this.start,this.end)];for(const n of e)for(let i=0;i<t.length;i++){const o=t[i].getTransformedByOperation(n);t.splice(i,1,...o),i+=o.length-1}for(let n=0;n<t.length;n++){const i=t[n];for(let o=n+1;o<t.length;o++){const a=t[o];(i.containsRange(a)||a.containsRange(i)||i.isEqual(a))&&t.splice(o,1)}}return t}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;const e=this.start.nodeAfter,t=this.end.nodeBefore;return e&&e.is("element")&&e===t?e:null}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}clone(){return new this.constructor(this.start,this.end)}_getTransformedByInsertOperation(e,t=!1){return this._getTransformedByInsertion(e.position,e.howMany,t)}_getTransformedByMoveOperation(e,t=!1){const n=e.sourcePosition,i=e.howMany,o=e.targetPosition;return this._getTransformedByMove(n,o,i,t)}_getTransformedBySplitOperation(e){const t=this.start._getTransformedBySplitOperation(e);let n=this.end._getTransformedBySplitOperation(e);return this.end.isEqual(e.insertionPosition)&&(n=this.end.getShiftedBy(1)),t.root!=n.root&&(n=this.end.getShiftedBy(-1)),new se(t,n)}_getTransformedByMergeOperation(e){if(this.start.isEqual(e.targetPosition)&&this.end.isEqual(e.deletionPosition))return new se(this.start);let t=this.start._getTransformedByMergeOperation(e),n=this.end._getTransformedByMergeOperation(e);return t.root!=n.root&&(n=this.end.getShiftedBy(-1)),t.isAfter(n)?(e.sourcePosition.isBefore(e.targetPosition)?(t=he._createAt(n),t.offset=0):(e.deletionPosition.isEqual(t)||(n=e.deletionPosition),t=e.targetPosition),new se(t,n)):new se(t,n)}_getTransformedByInsertion(e,t,n=!1){if(n&&this.containsPosition(e))return[new se(this.start,e),new se(e.getShiftedBy(t),this.end._getTransformedByInsertion(e,t))];{const i=new se(this.start,this.end);return i.start=i.start._getTransformedByInsertion(e,t),i.end=i.end._getTransformedByInsertion(e,t),[i]}}_getTransformedByMove(e,t,n,i=!1){if(this.isCollapsed){const k=this.start._getTransformedByMove(e,t,n);return[new se(k)]}const o=se._createFromPositionAndShift(e,n),a=t._getTransformedByDeletion(e,n);if(this.containsPosition(t)&&!i&&(o.containsPosition(this.start)||o.containsPosition(this.end))){const k=this.start._getTransformedByMove(e,t,n),C=this.end._getTransformedByMove(e,t,n);return[new se(k,C)]}let c;const u=this.getDifference(o);let h=null;const m=this.getIntersection(o);if(u.length==1?h=new se(u[0].start._getTransformedByDeletion(e,n),u[0].end._getTransformedByDeletion(e,n)):u.length==2&&(h=new se(this.start,this.end._getTransformedByDeletion(e,n))),c=h?h._getTransformedByInsertion(a,n,m!==null||i):[],m){const k=new se(m.start._getCombined(o.start,a),m.end._getCombined(o.start,a));c.length==2?c.splice(1,0,k):c.push(k)}return c}_getTransformedByDeletion(e,t){let n=this.start._getTransformedByDeletion(e,t),i=this.end._getTransformedByDeletion(e,t);return n==null&&i==null?null:(n==null&&(n=e),i==null&&(i=e),new se(n,i))}static _createFromPositionAndShift(e,t){const n=e,i=e.getShiftedBy(t);return t>0?new this(n,i):new this(i,n)}static _createIn(e){return new this(he._createAt(e,0),he._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(he._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(e.length===0)throw new y.a("range-create-from-ranges-empty-array",null);if(e.length==1)return e[0].clone();const t=e[0];e.sort((o,a)=>o.start.isAfter(a.start)?1:-1);const n=e.indexOf(t),i=new this(t.start,t.end);if(n>0)for(let o=n-1;e[o].end.isEqual(i.start);o++)i.start=he._createAt(e[o].start);for(let o=n+1;o<e.length&&e[o].start.isEqual(i.end);o++)i.end=he._createAt(e[o].end);return i}static fromJSON(e,t){return new this(he.fromJSON(e.start,t),he.fromJSON(e.end,t))}}class Ka{constructor(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._viewToModelLengthCallbacks=new Map,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this.on("modelToViewPosition",(e,t)=>{if(t.viewPosition)return;const n=this._modelToViewMapping.get(t.modelPosition.parent);t.viewPosition=this.findPositionIn(n,t.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(e,t)=>{if(t.modelPosition)return;const n=this.findMappedViewAncestor(t.viewPosition),i=this._viewToModelMapping.get(n),o=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,n);t.modelPosition=he._createAt(i,o)},{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e){const t=this.toModelElement(e);if(this._viewToModelMapping.delete(e),this._elementToMarkerNames.has(e))for(const n of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(n);this._modelToViewMapping.get(t)==e&&this._modelToViewMapping.delete(t)}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e&&this._viewToModelMapping.delete(t)}bindElementToMarker(e,t){const n=this._markerNameToElements.get(t)||new Set;n.add(e);const i=this._elementToMarkerNames.get(e)||new Set;i.add(t),this._markerNameToElements.set(t,n),this._elementToMarkerNames.set(e,i)}unbindElementFromMarkerName(e,t){const n=this._markerNameToElements.get(t);n&&(n.delete(e),n.size==0&&this._markerNameToElements.delete(t));const i=this._elementToMarkerNames.get(e);i&&(i.delete(t),i.size==0&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new se(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new Be(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={isPhantom:!1}){const n={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const n=new Set;for(const i of t)if(i.is("attributeElement"))for(const o of i.getElementsWithSameId())n.add(o);else n.add(i);return n}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,n){if(n!=e)return this._toModelOffset(e.parent,e.index,n)+this._toModelOffset(e,t,e);if(e.is("$text"))return t;let i=0;for(let o=0;o<t;o++)i+=this.getModelLength(e.getChild(o));return i}getModelLength(e){if(this._viewToModelLengthCallbacks.get(e.name))return this._viewToModelLengthCallbacks.get(e.name)(e);if(this._viewToModelMapping.has(e))return 1;if(e.is("$text"))return e.data.length;if(e.is("uiElement"))return 0;{let t=0;for(const n of e.getChildren())t+=this.getModelLength(n);return t}}findPositionIn(e,t){let n,i=0,o=0,a=0;if(e.is("$text"))return new ge(e,t);for(;o<t;)n=e.getChild(a),i=this.getModelLength(n),o+=i,a++;return o==t?this._moveViewPositionToTextNode(new ge(e,a)):this.findPositionIn(n,t-(o-i))}_moveViewPositionToTextNode(e){const t=e.nodeBefore,n=e.nodeAfter;return t instanceof _t?new ge(t,t.data.length):n instanceof _t?new ge(n,0):e}}Le(Ka,V);class _c{constructor(){this._consumable=new Map,this._textProxyRegistry=new Map}add(e,t){t=wc(t),e instanceof tr&&(e=this._getSymbolForTextProxy(e)),this._consumable.has(e)||this._consumable.set(e,new Map),this._consumable.get(e).set(t,!0)}consume(e,t){return t=wc(t),e instanceof tr&&(e=this._getSymbolForTextProxy(e)),!!this.test(e,t)&&(this._consumable.get(e).set(t,!1),!0)}test(e,t){t=wc(t),e instanceof tr&&(e=this._getSymbolForTextProxy(e));const n=this._consumable.get(e);if(n===void 0)return null;const i=n.get(t);return i===void 0?null:i}revert(e,t){t=wc(t),e instanceof tr&&(e=this._getSymbolForTextProxy(e));const n=this.test(e,t);return n===!1?(this._consumable.get(e).set(t,!0),!0):n!==!0&&null}_getSymbolForTextProxy(e){let t=null;const n=this._textProxyRegistry.get(e.startOffset);if(n){const i=n.get(e.endOffset);i&&(t=i.get(e.parent))}return t||(t=this._addSymbolForTextProxy(e.startOffset,e.endOffset,e.parent)),t}_addSymbolForTextProxy(e,t,n){const i=Symbol("textProxySymbol");let o,a;return o=this._textProxyRegistry.get(e),o||(o=new Map,this._textProxyRegistry.set(e,o)),a=o.get(t),a||(a=new Map,o.set(t,a)),a.set(n,i),i}}function wc(r){const e=r.split(":");return e[0]=="addMarker"||e[0]=="removeMarker"?r:e.length>1?e[0]+":"+e[1]:e[0]}class ru{constructor(e){this.conversionApi=Object.assign({dispatcher:this},e),this._reconversionEventsMapping=new Map}convertChanges(e,t,n){for(const o of e.getMarkersToRemove())this.convertMarkerRemove(o.name,o.range,n);const i=this._mapChangesWithAutomaticReconversion(e);for(const o of i)o.type==="insert"?this.convertInsert(se._createFromPositionAndShift(o.position,o.length),n):o.type==="remove"?this.convertRemove(o.position,o.length,o.name,n):o.type==="reconvert"?this.reconvertElement(o.element,n):this.convertAttribute(o.range,o.attributeKey,o.attributeOldValue,o.attributeNewValue,n);for(const o of this.conversionApi.mapper.flushUnboundMarkerNames()){const a=t.get(o).getRange();this.convertMarkerRemove(o,a,n),this.convertMarkerAdd(o,a,n)}for(const o of e.getMarkersToAdd())this.convertMarkerAdd(o.name,o.range,n)}convertInsert(e,t){this.conversionApi.writer=t,this.conversionApi.consumable=this._createInsertConsumable(e);for(const n of Array.from(e).map(ou))this._convertInsertWithAttributes(n);this._clearConversionApi()}convertRemove(e,t,n,i){this.conversionApi.writer=i,this.fire("remove:"+n,{position:e,length:t},this.conversionApi),this._clearConversionApi()}convertAttribute(e,t,n,i,o){this.conversionApi.writer=o,this.conversionApi.consumable=this._createConsumableForRange(e,"attribute:"+t);for(const a of e){const c={item:a.item,range:se._createFromPositionAndShift(a.previousPosition,a.length),attributeKey:t,attributeOldValue:n,attributeNewValue:i};this._testAndFire("attribute:"+t,c)}this._clearConversionApi()}reconvertElement(e,t){const n=se._createOn(e);this.conversionApi.writer=t,this.conversionApi.consumable=this._createInsertConsumable(n);const i=this.conversionApi.mapper,o=i.toViewElement(e);t.remove(o),this._convertInsertWithAttributes({item:e,range:n});const a=i.toViewElement(e);for(const c of se._createIn(e)){const{item:u}=c,h=cm(u,i);h?h.root!==a.root&&t.move(t.createRangeOn(h),i.toViewPosition(he._createBefore(u))):this._convertInsertWithAttributes(ou(c))}i.unbindViewElement(o),this._clearConversionApi()}convertSelection(e,t,n){const i=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));if(this.conversionApi.writer=n,this.conversionApi.consumable=this._createSelectionConsumable(e,i),this.fire("selection",{selection:e},this.conversionApi),e.isCollapsed){for(const o of i){const a=o.getRange();if(!of(e.getFirstPosition(),o,this.conversionApi.mapper))continue;const c={item:e,markerName:o.name,markerRange:a};this.conversionApi.consumable.test(e,"addMarker:"+o.name)&&this.fire("addMarker:"+o.name,c,this.conversionApi)}for(const o of e.getAttributeKeys()){const a={item:e,range:e.getFirstRange(),attributeKey:o,attributeOldValue:null,attributeNewValue:e.getAttribute(o)};this.conversionApi.consumable.test(e,"attribute:"+a.attributeKey)&&this.fire("attribute:"+a.attributeKey+":$text",a,this.conversionApi)}this._clearConversionApi()}else this._clearConversionApi()}convertMarkerAdd(e,t,n){if(t.root.rootName=="$graveyard")return;this.conversionApi.writer=n;const i="addMarker:"+e,o=new _c;if(o.add(t,i),this.conversionApi.consumable=o,this.fire(i,{markerName:e,markerRange:t},this.conversionApi),o.test(t,i)){this.conversionApi.consumable=this._createConsumableForRange(t,i);for(const a of t.getItems()){if(!this.conversionApi.consumable.test(a,i))continue;const c={item:a,range:se._createOn(a),markerName:e,markerRange:t};this.fire(i,c,this.conversionApi)}this._clearConversionApi()}else this._clearConversionApi()}convertMarkerRemove(e,t,n){t.root.rootName!="$graveyard"&&(this.conversionApi.writer=n,this.fire("removeMarker:"+e,{markerName:e,markerRange:t},this.conversionApi),this._clearConversionApi())}_mapReconversionTriggerEvent(e,t){this._reconversionEventsMapping.set(t,e)}_createInsertConsumable(e){const t=new _c;for(const n of e){const i=n.item;t.add(i,"insert");for(const o of i.getAttributeKeys())t.add(i,"attribute:"+o)}return t}_createConsumableForRange(e,t){const n=new _c;for(const i of e.getItems())n.add(i,t);return n}_createSelectionConsumable(e,t){const n=new _c;n.add(e,"selection");for(const i of t)n.add(e,"addMarker:"+i.name);for(const i of e.getAttributeKeys())n.add(e,"attribute:"+i);return n}_testAndFire(e,t){this.conversionApi.consumable.test(t.item,e)&&this.fire(function(n,i){const o=i.item.name||"$text";return`${n}:${o}`}(e,t),t,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}_convertInsertWithAttributes(e){this._testAndFire("insert",e);for(const t of e.item.getAttributeKeys())e.attributeKey=t,e.attributeOldValue=null,e.attributeNewValue=e.item.getAttribute(t),this._testAndFire("attribute:"+t,e)}_mapChangesWithAutomaticReconversion(e){const t=new Set,n=[];for(const i of e.getChanges()){const o=i.position||i.range.start,a=o.parent;if(zs(o,a)){n.push(i);continue}const c=i.type==="attribute"?Ir(o,a,null):a;if(c.is("$text")){n.push(i);continue}let u;if(u=i.type==="attribute"?`attribute:${i.attributeKey}:${c.name}`:`${i.type}:${i.name}`,this._isReconvertTriggerEvent(u,c.name)){if(t.has(c))continue;t.add(c),n.push({type:"reconvert",element:c})}else n.push(i)}return n}_isReconvertTriggerEvent(e,t){return this._reconversionEventsMapping.get(e)===t}}function of(r,e,t){const n=e.getRange(),i=Array.from(r.getAncestors());return i.shift(),i.reverse(),!i.some(o=>{if(n.containsItem(o))return!!t.toViewElement(o).getCustomProperty("addHighlight")})}function ou(r){return{item:r.item,range:se._createFromPositionAndShift(r.previousPosition,r.length)}}function cm(r,e){if(r.is("textProxy")){const t=e.toViewPosition(he._createBefore(r)).parent;return t.is("$text")?t:null}return e.toViewElement(r)}Le(ru,V);class Mr{constructor(e,t,n){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,e&&this.setTo(e,t,n)}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){return this._ranges.length===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const i of e._ranges)if(t.isEqual(i)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new se(e.start,e.end)}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?new se(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?new se(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(e,t,n){if(e===null)this._setRanges([]);else if(e instanceof Mr)this._setRanges(e.getRanges(),e.isBackward);else if(e&&typeof e.getRanges=="function")this._setRanges(e.getRanges(),e.isBackward);else if(e instanceof se)this._setRanges([e],!!t&&!!t.backward);else if(e instanceof he)this._setRanges([new se(e)]);else if(e instanceof Do){const i=!!n&&!!n.backward;let o;if(t=="in")o=se._createIn(e);else if(t=="on")o=se._createOn(e);else{if(t===void 0)throw new y.a("model-selection-setto-required-second-parameter",[this,e]);o=new se(he._createAt(e,t))}this._setRanges([o],i)}else{if(!ai(e))throw new y.a("model-selection-setto-not-selectable",[this,e]);this._setRanges(e,t&&!!t.backward)}}_setRanges(e,t=!1){const n=(e=Array.from(e)).some(i=>{if(!(i instanceof se))throw new y.a("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every(o=>!o.isEqual(i))});if(e.length!==this._ranges.length||n){this._removeAllRanges();for(const i of e)this._pushRange(i);this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0})}}setFocus(e,t){if(this.anchor===null)throw new y.a("model-selection-setfocus-no-ranges",[this,e]);const n=he._createAt(e,t);if(n.compareWith(this.focus)=="same")return;const i=this.anchor;this._ranges.length&&this._popRange(),n.compareWith(i)=="before"?(this._pushRange(new se(n,i)),this._lastRangeBackward=!0):(this._pushRange(new se(i,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}is(e){return e==="selection"||e==="model:selection"}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const n=ir(t.start,e);n&&au(n,t)&&(yield n);for(const o of t.getWalker()){const a=o.item;o.type=="elementEnd"&&fi(a,e,t)&&(yield a)}const i=ir(t.end,e);i&&!t.end.isTouching(he._createAt(i,0))&&au(i,t)&&(yield i)}}containsEntireContent(e=this.anchor.root){const t=he._createAt(e,0),n=he._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(new se(e.start,e.end))}_checkRange(e){for(let t=0;t<this._ranges.length;t++)if(e.isIntersecting(this._ranges[t]))throw new y.a("model-selection-range-intersects",[this,e],{addedRange:e,intersectingRange:this._ranges[t]})}_removeAllRanges(){for(;this._ranges.length>0;)this._popRange()}_popRange(){this._ranges.pop()}}function su(r,e){return!e.has(r)&&(e.add(r),r.root.document.model.schema.isBlock(r)&&r.parent)}function fi(r,e,t){return su(r,e)&&au(r,t)}function ir(r,e){const t=r.parent.root.document.model.schema,n=r.parent.getAncestors({parentFirst:!0,includeSelf:!0});let i=!1;const o=n.find(a=>!i&&(i=t.isLimit(a),!i&&su(a,e)));return n.forEach(a=>e.add(a)),o}function au(r,e){const t=function(n){const i=n.root.document.model.schema;let o=n.parent;for(;o;){if(i.isBlock(o))return o;o=o.parent}}(r);return t?!e.containsRange(se._createOn(t),!0):!0}Le(Mr,V);class Or extends se{constructor(e,t){super(e,t),kc.call(this)}detach(){this.stopListening()}is(e){return e==="liveRange"||e==="model:liveRange"||e=="range"||e==="model:range"}toRange(){return new se(this.start,this.end)}static fromRange(e){return new Or(e.start,e.end)}}function kc(){this.listenTo(this.root.document.model,"applyOperation",(r,e)=>{const t=e[0];t.isDocumentOperation&&Bs.call(this,t)},{priority:"low"})}function Bs(r){const e=this.getTransformedByOperation(r),t=se._createFromRanges(e),n=!t.isEqual(this),i=function(a,c){switch(c.type){case"insert":return a.containsPosition(c.position);case"move":case"remove":case"reinsert":case"merge":return a.containsPosition(c.sourcePosition)||a.start.isEqual(c.sourcePosition)||a.containsPosition(c.targetPosition);case"split":return a.containsPosition(c.splitPosition)||a.containsPosition(c.insertionPosition)}return!1}(this,r);let o=null;if(n){t.root.rootName=="$graveyard"&&(o=r.type=="remove"?r.sourcePosition:r.deletionPosition);const a=this.toRange();this.start=t.start,this.end=t.end,this.fire("change:range",a,{deletionPosition:o})}else i&&this.fire("change:content",this.toRange(),{deletionPosition:o})}Le(Or,V);class Hi{constructor(e){this._selection=new sf(e),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection._updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(e){this._selection.observeMarkers(e)}is(e){return e==="selection"||e=="model:selection"||e=="documentSelection"||e=="model:documentSelection"}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(e,t,n){this._selection.setTo(e,t,n)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return"selection:"+e}static _isStoreAttributeKey(e){return e.startsWith("selection:")}}Le(Hi,V);class sf extends Mr{constructor(e){super(),this.markers=new li({idProperty:"name"}),this._model=e.model,this._document=e,this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this.listenTo(this._model,"applyOperation",(t,n)=>{const i=n[0];i.isDocumentOperation&&i.type!="marker"&&i.type!="rename"&&i.type!="noop"&&(this._ranges.length==0&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{for(const t of this.getRanges())if(!this._document._validateSelectionRange(t))throw new y.a("document-selection-wrong-position",this,{range:t})}),this.listenTo(this._model.markers,"update",(t,n,i,o)=>{this._updateMarker(n,o)}),this.listenTo(this._document,"change",(t,n)=>{(function(i,o){const a=i.document.differ;for(const c of a.getChanges()){if(c.type!="insert")continue;const u=c.position.parent;c.length===u.maxOffset&&i.enqueueChange(o,h=>{const m=Array.from(u.getAttributeKeys()).filter(k=>k.startsWith("selection:"));for(const k of m)h.removeAttribute(k,u)})}})(this._model,n)})}get isCollapsed(){return this._ranges.length===0?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;e<this._ranges.length;e++)this._ranges[e].detach();this.stopListening()}*getRanges(){this._ranges.length?yield*super.getRanges():yield this._document._getDefaultRange()}getFirstRange(){return super.getFirstRange()||this._document._getDefaultRange()}getLastRange(){return super.getLastRange()||this._document._getDefaultRange()}setTo(e,t,n){super.setTo(e,t,n),this._updateAttributes(!0),this._updateMarkers()}setFocus(e,t){super.setFocus(e,t),this._updateAttributes(!0),this._updateMarkers()}setAttribute(e,t){if(this._setAttribute(e,t)){const n=[e];this.fire("change:attribute",{attributeKeys:n,directChange:!0})}}removeAttribute(e){if(this._removeAttribute(e)){const t=[e];this.fire("change:attribute",{attributeKeys:t,directChange:!0})}}overrideGravity(){const e=P();return this._overriddenGravityRegister.add(e),this._overriddenGravityRegister.size===1&&this._updateAttributes(!0),e}restoreGravity(e){if(!this._overriddenGravityRegister.has(e))throw new y.a("document-selection-gravity-wrong-restore",this,{uid:e});this._overriddenGravityRegister.delete(e),this.isGravityOverridden||this._updateAttributes(!0)}observeMarkers(e){this._observedMarkers.add(e),this._updateMarkers()}_popRange(){this._ranges.pop().detach()}_pushRange(e){const t=this._prepareRange(e);t&&this._ranges.push(t)}_prepareRange(e){if(this._checkRange(e),e.root==this._document.graveyard)return;const t=Or.fromRange(e);return t.on("change:range",(n,i,o)=>{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=o.deletionPosition;const a=this._ranges.indexOf(t);this._ranges.splice(a,1),t.detach()}}),t}_updateMarkers(){if(!this._observedMarkers.size)return;const e=[];let t=!1;for(const i of this._model.markers){const o=i.name.split(":",1)[0];if(!this._observedMarkers.has(o))continue;const a=i.getRange();for(const c of this.getRanges())a.containsRange(c,!c.isCollapsed)&&e.push(i)}const n=Array.from(this.markers);for(const i of e)this.markers.has(i)||(this.markers.add(i),t=!0);for(const i of Array.from(this.markers))e.includes(i)||(this.markers.remove(i),t=!0);t&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateMarker(e,t){const n=e.name.split(":",1)[0];if(!this._observedMarkers.has(n))return;let i=!1;const o=Array.from(this.markers),a=this.markers.has(e);if(t){let c=!1;for(const u of this.getRanges())if(t.containsRange(u,!u.isCollapsed)){c=!0;break}c&&!a?(this.markers.add(e),i=!0):!c&&a&&(this.markers.remove(e),i=!0)}else a&&(this.markers.remove(e),i=!0);i&&this.fire("change:marker",{oldMarkers:o,directChange:!1})}_updateAttributes(e){const t=Ti(this._getSurroundingAttributes()),n=Ti(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[o,a]of this._attributePriority)a=="low"&&(this._attrs.delete(o),this._attributePriority.delete(o));this._setAttributesTo(t);const i=[];for(const[o,a]of this.getAttributes())n.has(o)&&n.get(o)===a||i.push(o);for(const[o]of n)this.hasAttribute(o)||i.push(o);i.length>0&&this.fire("change:attribute",{attributeKeys:i,directChange:!1})}_setAttribute(e,t,n=!0){const i=n?"normal":"low";return i=="low"&&this._attributePriority.get(e)=="normal"?!1:super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,i),!0)}_removeAttribute(e,t=!0){const n=t?"normal":"low";return(n!="low"||this._attributePriority.get(e)!="normal")&&(this._attributePriority.set(e,n),!!super.hasAttribute(e)&&(this._attrs.delete(e),!0))}_setAttributesTo(e){const t=new Set;for(const[n,i]of this.getAttributes())e.get(n)!==i&&this._removeAttribute(n,!1);for(const[n,i]of e)this._setAttribute(n,i,!1)&&t.add(n);return t}*_getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())t.startsWith("selection:")&&(yield[t.substr(10),e.getAttribute(t)])}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;let n=null;if(this.isCollapsed){const i=e.textNode?e.textNode:e.nodeBefore,o=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(n=yc(i)),n||(n=yc(o)),!this.isGravityOverridden&&!n){let a=i;for(;a&&!t.isInline(a)&&!n;)a=a.previousSibling,n=yc(a)}if(!n){let a=o;for(;a&&!t.isInline(a)&&!n;)a=a.nextSibling,n=yc(a)}n||(n=this._getStoredAttributes())}else{const i=this.getFirstRange();for(const o of i){if(o.item.is("element")&&t.isObject(o.item))break;if(o.type=="text"){n=o.item.getAttributes();break}}}return n}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}}function yc(r){return r instanceof tr||r instanceof Nt?r.getAttributes():null}class lu{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}var ti=function(r){return Qo(r,5)};class Ga extends lu{elementToElement(e){return this.add(function(t){return(t=ti(t)).view=Qa(t.view,"container"),n=>{var i;if(n.on("insert:"+t.model,(i=t.view,(o,a,c)=>{const u=i(a.item,c);if(!u||!c.consumable.consume(a.item,"insert"))return;const h=c.mapper.toViewPosition(a.range.start);c.mapper.bindElements(a.item,u),c.writer.insert(h,u)}),{priority:t.converterPriority||"normal"}),t.triggerBy){if(t.triggerBy.attributes)for(const o of t.triggerBy.attributes)n._mapReconversionTriggerEvent(t.model,`attribute:${o}:${t.model}`);if(t.triggerBy.children)for(const o of t.triggerBy.children)n._mapReconversionTriggerEvent(t.model,"insert:"+o),n._mapReconversionTriggerEvent(t.model,"remove:"+o)}}}(e))}attributeToElement(e){return this.add(function(t){t=ti(t);let n="attribute:"+(t.model.key?t.model.key:t.model);if(t.model.name&&(n+=":"+t.model.name),t.model.values)for(const o of t.model.values)t.view[o]=Qa(t.view[o],"attribute");else t.view=Qa(t.view,"attribute");const i=Ya(t);return o=>{o.on(n,function(a){return(c,u,h)=>{const m=a(u.attributeOldValue,h),k=a(u.attributeNewValue,h);if(!m&&!k||!h.consumable.consume(u.item,c.name))return;const C=h.writer,S=C.document.selection;if(u.item instanceof Mr||u.item instanceof Hi)C.wrap(S.getFirstRange(),k);else{let N=h.mapper.toViewRange(u.range);u.attributeOldValue!==null&&m&&(N=C.unwrap(N,m)),u.attributeNewValue!==null&&k&&C.wrap(N,k)}}}(i),{priority:t.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(t){t=ti(t);let n="attribute:"+(t.model.key?t.model.key:t.model);if(t.model.name&&(n+=":"+t.model.name),t.model.values)for(const o of t.model.values)t.view[o]=du(t.view[o]);else t.view=du(t.view);const i=Ya(t);return o=>{var a;o.on(n,(a=i,(c,u,h)=>{const m=a(u.attributeOldValue,h),k=a(u.attributeNewValue,h);if(!m&&!k||!h.consumable.consume(u.item,c.name))return;const C=h.mapper.toViewElement(u.item),S=h.writer;if(!C)throw new y.a("conversion-attribute-to-attribute-on-text",[u,h]);if(u.attributeOldValue!==null&&m)if(m.key=="class"){const N=xt(m.value);for(const D of N)S.removeClass(D,C)}else if(m.key=="style"){const N=Object.keys(m.value);for(const D of N)S.removeStyle(D,C)}else S.removeAttribute(m.key,C);if(u.attributeNewValue!==null&&k)if(k.key=="class"){const N=xt(k.value);for(const D of N)S.addClass(D,C)}else if(k.key=="style"){const N=Object.keys(k.value);for(const D of N)S.setStyle(D,k.value[D],C)}else S.setAttribute(k.key,k.value,C)}),{priority:t.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(t){return(t=ti(t)).view=Qa(t.view,"ui"),n=>{var i;n.on("addMarker:"+t.model,(i=t.view,(o,a,c)=>{a.isOpening=!0;const u=i(a,c);a.isOpening=!1;const h=i(a,c);if(!u||!h)return;const m=a.markerRange;if(m.isCollapsed&&!c.consumable.consume(m,o.name))return;for(const S of m)if(!c.consumable.consume(S.item,o.name))return;const k=c.mapper,C=c.writer;C.insert(k.toViewPosition(m.start),u),c.mapper.bindElementToMarker(u,a.markerName),m.isCollapsed||(C.insert(k.toViewPosition(m.end),h),c.mapper.bindElementToMarker(h,a.markerName)),o.stop()}),{priority:t.converterPriority||"normal"}),n.on("removeMarker:"+t.model,(t.view,(o,a,c)=>{const u=c.mapper.markerNameToElements(a.markerName);if(u){for(const h of u)c.mapper.unbindElementFromMarkerName(h,a.markerName),c.writer.clear(c.writer.createRangeOn(h),h);c.writer.clearClonedElementsGroup(a.markerName),o.stop()}}),{priority:t.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(t){return n=>{var i;n.on("addMarker:"+t.model,(i=t.view,(o,a,c)=>{if(!a.item||!(a.item instanceof Mr||a.item instanceof Hi||a.item.is("$textProxy")))return;const u=Fs(i,a,c);if(!u||!c.consumable.consume(a.item,o.name))return;const h=c.writer,m=af(h,u),k=h.document.selection;if(a.item instanceof Mr||a.item instanceof Hi)h.wrap(k.getFirstRange(),m,k);else{const C=c.mapper.toViewRange(a.range),S=h.wrap(C,m);for(const N of S.getItems())if(N.is("attributeElement")&&N.isSimilar(m)){c.mapper.bindElementToMarker(N,a.markerName);break}}}),{priority:t.converterPriority||"normal"}),n.on("addMarker:"+t.model,function(o){return(a,c,u)=>{if(!c.item||!(c.item instanceof Rt))return;const h=Fs(o,c,u);if(!h||!u.consumable.test(c.item,a.name))return;const m=u.mapper.toViewElement(c.item);if(m&&m.getCustomProperty("addHighlight")){u.consumable.consume(c.item,a.name);for(const k of se._createIn(c.item))u.consumable.consume(k.item,a.name);m.getCustomProperty("addHighlight")(m,h,u.writer),u.mapper.bindElementToMarker(m,c.markerName)}}}(t.view),{priority:t.converterPriority||"normal"}),n.on("removeMarker:"+t.model,function(o){return(a,c,u)=>{if(c.markerRange.isCollapsed)return;const h=Fs(o,c,u);if(!h)return;const m=af(u.writer,h),k=u.mapper.markerNameToElements(c.markerName);if(k){for(const C of k)u.mapper.unbindElementFromMarkerName(C,c.markerName),C.is("attributeElement")?u.writer.unwrap(u.writer.createRangeOn(C),m):C.getCustomProperty("removeHighlight")(C,h.id,u.writer);u.writer.clearClonedElementsGroup(c.markerName),a.stop()}}}(t.view),{priority:t.converterPriority||"normal"})}}(e))}markerToData(e){return this.add(function(t){const n=(t=ti(t)).model;return t.view||(t.view=i=>({group:n,name:i.substr(t.model.length+1)})),i=>{var o;i.on("addMarker:"+n,(o=t.view,(a,c,u)=>{const h=o(c.markerName,u);if(!h)return;const m=c.markerRange;u.consumable.consume(m,a.name)&&(cu(m,!1,u,c,h),cu(m,!0,u,c,h),a.stop())}),{priority:t.converterPriority||"normal"}),i.on("removeMarker:"+n,function(a){return(c,u,h)=>{const m=a(u.markerName,h);if(!m)return;const k=h.mapper.markerNameToElements(u.markerName);if(k){for(const S of k)h.mapper.unbindElementFromMarkerName(S,u.markerName),S.is("containerElement")?(C(`data-${m.group}-start-before`,S),C(`data-${m.group}-start-after`,S),C(`data-${m.group}-end-before`,S),C(`data-${m.group}-end-after`,S)):h.writer.clear(h.writer.createRangeOn(S),S);h.writer.clearClonedElementsGroup(u.markerName),c.stop()}function C(S,N){if(N.hasAttribute(S)){const D=new Set(N.getAttribute(S).split(","));D.delete(m.name),D.size==0?h.writer.removeAttribute(S,N):h.writer.setAttribute(S,Array.from(D).join(","),N)}}}}(t.view),{priority:t.converterPriority||"normal"})}}(e))}}function af(r,e){const t=r.createAttributeElement("span",e.attributes);return e.classes&&t._addClass(e.classes),typeof e.priority=="number"&&(t._priority=e.priority),t._id=e.id,t}function cu(r,e,t,n,i){const o=e?r.start:r.end,a=o.nodeAfter&&o.nodeAfter.is("element")?o.nodeAfter:null,c=o.nodeBefore&&o.nodeBefore.is("element")?o.nodeBefore:null;if(a||c){let u,h;e&&a||!e&&!c?(u=a,h=!0):(u=c,h=!1);const m=t.mapper.toViewElement(u);if(m)return void function(k,C,S,N,D,z){const U=`data-${z.group}-${C?"start":"end"}-${S?"before":"after"}`,J=k.hasAttribute(U)?k.getAttribute(U).split(","):[];J.unshift(z.name),N.writer.setAttribute(U,J.join(","),k),N.mapper.bindElementToMarker(k,D.markerName)}(m,e,h,t,n,i)}(function(u,h,m,k,C){const S=`${C.group}-${h?"start":"end"}`,N=C.name?{name:C.name}:null,D=m.writer.createUIElement(S,N);m.writer.insert(u,D),m.mapper.bindElementToMarker(D,k.markerName)})(t.mapper.toViewPosition(o),e,t,n,i)}function Qa(r,e){return typeof r=="function"?r:(t,n)=>function(i,o,a){typeof i=="string"&&(i={name:i});let c;const u=o.writer,h=Object.assign({},i.attributes);if(a=="container")c=u.createContainerElement(i.name,h);else if(a=="attribute"){const m={priority:i.priority||Cr.DEFAULT_PRIORITY};c=u.createAttributeElement(i.name,h,m)}else c=u.createUIElement(i.name,h);if(i.styles){const m=Object.keys(i.styles);for(const k of m)u.setStyle(k,i.styles[k],c)}if(i.classes){const m=i.classes;if(typeof m=="string")u.addClass(m,c);else for(const k of m)u.addClass(k,c)}return c}(r,n,e)}function Ya(r){return r.model.values?(e,t)=>{const n=r.view[e];return n?n(e,t):null}:r.view}function du(r){return typeof r=="string"?e=>({key:r,value:e}):typeof r=="object"?r.value?()=>r:e=>({key:r.key,value:e}):r}function Fs(r,e,t){const n=typeof r=="function"?r(e,t):r;return n?(n.priority||(n.priority=10),n.id||(n.id=e.markerName),n):null}function xc(r){const{schema:e,document:t}=r.model;for(const n of t.getRootNames()){const i=t.getRoot(n);if(i.isEmpty&&!e.checkChild(i,"$text")&&e.checkChild(i,"paragraph"))return r.insertElement("paragraph",i),!0}return!1}function Xa(r,e,t){const n=t.createContext(r);return!!t.checkChild(n,"paragraph")&&!!t.checkChild(n.push("paragraph"),e)}function lf(r,e){const t=e.createElement("paragraph");return e.insert(t,r),e.createPositionAt(t,0)}class cf extends lu{elementToElement(e){return this.add(Ja(e))}elementToAttribute(e){return this.add(function(t){df(t=ti(t));const n=uu(t,!1),i=Cc(t.view),o=i?"element:"+i:"element";return a=>{a.on(o,n,{priority:t.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(t){t=ti(t);let n=null;(typeof t.view=="string"||t.view.key)&&(n=function(o){typeof o.view=="string"&&(o.view={key:o.view});const a=o.view.key;let c;if(a=="class"||a=="style")c={[a=="class"?"classes":"styles"]:o.view.value};else{const u=o.view.value===void 0?/[\s\S]*/:o.view.value;c={attributes:{[a]:u}}}return o.view.name&&(c.name=o.view.name),o.view=c,a}(t)),df(t,n);const i=uu(t,!0);return o=>{o.on("element",i,{priority:t.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add(function(t){return function(n){const i=n.model;n.model=(o,a)=>{const c=typeof i=="string"?i:i(o,a);return a.writer.createElement("$marker",{"data-name":c})}}(t=ti(t)),Ja(t)}(e))}dataToMarker(e){return this.add(function(t){(t=ti(t)).model||(t.model=o=>o?t.view+":"+o:t.view);const n=Za(Nr(t,"start")),i=Za(Nr(t,"end"));return o=>{o.on("element:"+t.view+"-start",n,{priority:t.converterPriority||"normal"}),o.on("element:"+t.view+"-end",i,{priority:t.converterPriority||"normal"});const a=B.get("low"),c=B.get("highest"),u=B.get(t.converterPriority)/c;o.on("element",function(h){return(m,k,C)=>{const S="data-"+h.view;function N(D,z){for(const U of z){const J=h.model(U,C),ce=C.writer.createElement("$marker",{"data-name":J});C.writer.insert(ce,D),k.modelCursor.isEqual(D)?k.modelCursor=k.modelCursor.getShiftedBy(1):k.modelCursor=k.modelCursor._getTransformedByInsertion(D,1),k.modelRange=k.modelRange._getTransformedByInsertion(D,1)[0]}}(C.consumable.test(k.viewItem,{attributes:S+"-end-after"})||C.consumable.test(k.viewItem,{attributes:S+"-start-after"})||C.consumable.test(k.viewItem,{attributes:S+"-end-before"})||C.consumable.test(k.viewItem,{attributes:S+"-start-before"}))&&(k.modelRange||Object.assign(k,C.convertChildren(k.viewItem,k.modelCursor)),C.consumable.consume(k.viewItem,{attributes:S+"-end-after"})&&N(k.modelRange.end,k.viewItem.getAttribute(S+"-end-after").split(",")),C.consumable.consume(k.viewItem,{attributes:S+"-start-after"})&&N(k.modelRange.end,k.viewItem.getAttribute(S+"-start-after").split(",")),C.consumable.consume(k.viewItem,{attributes:S+"-end-before"})&&N(k.modelRange.start,k.viewItem.getAttribute(S+"-end-before").split(",")),C.consumable.consume(k.viewItem,{attributes:S+"-start-before"})&&N(k.modelRange.start,k.viewItem.getAttribute(S+"-start-before").split(",")))}}(t),{priority:a+u})}}(e))}}function Ja(r){const e=Za(r=ti(r)),t=Cc(r.view),n=t?"element:"+t:"element";return i=>{i.on(n,e,{priority:r.converterPriority||"normal"})}}function Cc(r){return typeof r=="string"?r:typeof r=="object"&&typeof r.name=="string"?r.name:null}function Za(r){const e=new Vi(r.view);return(t,n,i)=>{const o=e.match(n.viewItem);if(!o)return;const a=o.match;if(a.name=!0,!i.consumable.test(n.viewItem,a))return;const c=function(u,h,m){return u instanceof Function?u(h,m):m.writer.createElement(u)}(r.model,n.viewItem,i);c&&i.safeInsert(c,n.modelCursor)&&(i.consumable.consume(n.viewItem,a),i.convertChildren(n.viewItem,c),i.updateConversionResult(c,n))}}function df(r,e=null){const t=e===null||(o=>o.getAttribute(e)),n=typeof r.model!="object"?r.model:r.model.key,i=typeof r.model!="object"||r.model.value===void 0?t:r.model.value;r.model={key:n,value:i}}function uu(r,e){const t=new Vi(r.view);return(n,i,o)=>{const a=t.match(i.viewItem);if(!a||(function(h,m){const k=typeof h=="function"?h(m):h;return typeof k=="object"&&!Cc(k)?!1:!k.classes&&!k.attributes&&!k.styles}(r.view,i.viewItem)?a.match.name=!0:delete a.match.name,!o.consumable.test(i.viewItem,a.match)))return;const c=r.model.key,u=typeof r.model.value=="function"?r.model.value(i.viewItem,o):r.model.value;u!==null&&(i.modelRange||Object.assign(i,o.convertChildren(i.viewItem,i.modelCursor)),function(h,m,k,C){let S=!1;for(const N of Array.from(h.getItems({shallow:k})))C.schema.checkAttribute(N,m.key)&&(S=!0,N.hasAttribute(m.key)||C.writer.setAttribute(m.key,m.value,N));return S}(i.modelRange,{key:c,value:u},e,o)&&o.consumable.consume(i.viewItem,a.match))}}function Nr(r,e){const t={};return t.view=r.view+"-"+e,t.model=(n,i)=>{const o=n.getAttribute("name"),a=r.model(o,i);return i.writer.createElement("$marker",{"data-name":a})},t}class hu{constructor(e,t){this.model=e,this.view=new vc(t),this.mapper=new Ka,this.downcastDispatcher=new ru({mapper:this.mapper,schema:e.schema});const n=this.model.document,i=n.selection,o=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(n,"change",()=>{this.view.change(a=>{this.downcastDispatcher.convertChanges(n.differ,o,a),this.downcastDispatcher.convertSelection(i,o,a)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(a,c){return(u,h)=>{const m=h.newSelection,k=[];for(const S of m.getRanges())k.push(c.toModelRange(S));const C=a.createSelection(k,{backward:m.isBackward});C.isEqual(a.document.selection)||a.change(S=>{S.setSelection(C)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(a,c,u)=>{if(!u.consumable.consume(c.item,"insert"))return;const h=u.writer,m=u.mapper.toViewPosition(c.range.start),k=h.createText(c.item.data);h.insert(m,k)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(a,c,u)=>{const h=u.mapper.toViewPosition(c.position),m=c.position.getShiftedBy(c.length),k=u.mapper.toViewPosition(m,{isPhantom:!0}),C=u.writer.createRange(h,k),S=u.writer.remove(C.getTrimmed());for(const N of u.writer.createRangeIn(S).getItems())u.mapper.unbindViewElement(N)},{priority:"low"}),this.downcastDispatcher.on("selection",(a,c,u)=>{const h=u.writer,m=h.document.selection;for(const k of m.getRanges())k.isCollapsed&&k.end.parent.isAttached()&&u.writer.mergeAttributes(k.start);h.setSelection(null)},{priority:"high"}),this.downcastDispatcher.on("selection",(a,c,u)=>{const h=c.selection;if(h.isCollapsed||!u.consumable.consume(h,"selection"))return;const m=[];for(const k of h.getRanges()){const C=u.mapper.toViewRange(k);m.push(C)}u.writer.setSelection(m,{backward:h.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(a,c,u)=>{const h=c.selection;if(!h.isCollapsed||!u.consumable.consume(h,"selection"))return;const m=u.writer,k=h.getFirstPosition(),C=u.mapper.toViewPosition(k),S=m.breakAttributes(C);m.setSelection(S)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(a=>{if(a.rootName=="$graveyard")return null;const c=new Po(this.view.document,a.name);return c.rootName=a.rootName,this.mapper.bindElements(a,c),c})}destroy(){this.view.destroy(),this.stopListening()}}Le(hu,Wt);class uf{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const n=this.get(e);if(!n)throw new y.a("commandcollection-command-not-found",this,{commandName:e});return n.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}class el{constructor(){this._consumables=new Map}add(e,t){let n;e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?n=this._consumables.get(e):(n=new hf(e),this._consumables.set(e,n)),n.add(t))}test(e,t){const n=this._consumables.get(e);return n===void 0?null:e.is("$text")||e.is("documentFragment")?n:n.test(t)}consume(e,t){return!!this.test(e,t)&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!1):this._consumables.get(e).consume(t),!0)}revert(e,t){const n=this._consumables.get(e);n!==void 0&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):n.revert(t))}static consumablesFromElement(e){const t={element:e,name:!0,attributes:[],classes:[],styles:[]},n=e.getAttributeKeys();for(const a of n)a!="style"&&a!="class"&&t.attributes.push(a);const i=e.getClassNames();for(const a of i)t.classes.push(a);const o=e.getStyleNames();for(const a of o)t.styles.push(a);return t}static createFrom(e,t){if(t||(t=new el(e)),e.is("$text"))return t.add(e),t;e.is("element")&&t.add(e,el.consumablesFromElement(e)),e.is("documentFragment")&&t.add(e);for(const n of e.getChildren())t=el.createFrom(n,t);return t}}class hf{constructor(e){this.element=e,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){e.name&&(this._canConsumeName=!0);for(const t in this._consumables)t in e&&this._add(t,e[t])}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const t in this._consumables)if(t in e){const n=this._test(t,e[t]);if(n!==!0)return n}return!0}consume(e){e.name&&(this._canConsumeName=!1);for(const t in this._consumables)t in e&&this._consume(t,e[t])}revert(e){e.name&&(this._canConsumeName=!0);for(const t in this._consumables)t in e&&this._revert(t,e[t])}_add(e,t){const n=Pt(t)?t:[t],i=this._consumables[e];for(const o of n){if(e==="attributes"&&(o==="class"||o==="style"))throw new y.a("viewconsumable-invalid-attribute",this);if(i.set(o,!0),e==="styles")for(const a of this.element.document.stylesProcessor.getRelatedStyles(o))i.set(a,!0)}}_test(e,t){const n=Pt(t)?t:[t],i=this._consumables[e];for(const o of n)if(e!=="attributes"||o!=="class"&&o!=="style"){const a=i.get(o);if(a===void 0)return null;if(!a)return!1}else{const a=o=="class"?"classes":"styles",c=this._test(a,[...this._consumables[a].keys()]);if(c!==!0)return c}return!0}_consume(e,t){const n=Pt(t)?t:[t],i=this._consumables[e];for(const o of n)if(e!=="attributes"||o!=="class"&&o!=="style"){if(i.set(o,!1),e=="styles")for(const a of this.element.document.stylesProcessor.getRelatedStyles(o))i.set(a,!1)}else{const a=o=="class"?"classes":"styles";this._consume(a,[...this._consumables[a].keys()])}}_revert(e,t){const n=Pt(t)?t:[t],i=this._consumables[e];for(const o of n)if(e!=="attributes"||o!=="class"&&o!=="style")i.get(o)===!1&&i.set(o,!0);else{const a=o=="class"?"classes":"styles";this._revert(a,[...this._consumables[a].keys()])}}}class ff{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(e,t)=>{t[0]=new ss(t[0])},{priority:"highest"}),this.on("checkChild",(e,t)=>{t[0]=new ss(t[0]),t[1]=this.getDefinition(t[1])},{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new y.a("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new y.a("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t=typeof e=="string"?e:e.is&&(e.is("$text")||e.is("$textProxy"))?"$text":e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!(!t||!t.isBlock)}isLimit(e){const t=this.getDefinition(e);return!!t&&!(!t.isLimit&&!t.isObject)}isObject(e){const t=this.getDefinition(e);return!!t&&!!(t.isObject||t.isLimit&&t.isSelectable&&t.isContent)}isInline(e){const t=this.getDefinition(e);return!(!t||!t.isInline)}isSelectable(e){const t=this.getDefinition(e);return!!t&&!(!t.isSelectable&&!t.isObject)}isContent(e){const t=this.getDefinition(e);return!!t&&!(!t.isContent&&!t.isObject)}checkChild(e,t){return!!t&&this._checkContextMatch(t,e)}checkAttribute(e,t){const n=this.getDefinition(e.last);return!!n&&n.allowAttributes.includes(t)}checkMerge(e,t=null){if(e instanceof he){const n=e.nodeBefore,i=e.nodeAfter;if(!(n instanceof Rt))throw new y.a("schema-check-merge-no-element-before",this);if(!(i instanceof Rt))throw new y.a("schema-check-merge-no-element-after",this);return this.checkMerge(n,i)}for(const n of t.getChildren())if(!this.checkChild(e,n))return!1;return!0}addChildCheck(e){this.on("checkChild",(t,[n,i])=>{if(!i)return;const o=e(n,i);typeof o=="boolean"&&(t.stop(),t.return=o)},{priority:"high"})}addAttributeCheck(e){this.on("checkAttribute",(t,[n,i])=>{const o=e(n,i);typeof o=="boolean"&&(t.stop(),t.return=o)},{priority:"high"})}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||{}}getLimitElement(e){let t;for(e instanceof he?t=e.parent:t=(e instanceof se?[e]:Array.from(e.getRanges())).reduce((n,i)=>{const o=i.getCommonAncestor();return n?n.getCommonAncestor(o,{includeSelf:!0}):o},null);!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const n=[...e.getFirstPosition().getAncestors(),new Nt("",e.getAttributes())];return this.checkAttribute(n,t)}{const n=e.getRanges();for(const i of n)for(const o of i)if(this.checkAttribute(o.item,t))return!0}return!1}*getValidRanges(e,t){e=function*(n){for(const i of n)yield*i.getMinimalFlatRanges()}(e);for(const n of e)yield*this._getValidRangesForRange(n,t)}getNearestSelectionRange(e,t="both"){if(this.checkChild(e,"$text"))return new se(e);let n,i;const o=e.getAncestors().reverse().find(a=>this.isLimit(a))||e.root;t!="both"&&t!="backward"||(n=new nr({boundaries:se._createIn(o),startPosition:e,direction:"backward"})),t!="both"&&t!="forward"||(i=new nr({boundaries:se._createIn(o),startPosition:e}));for(const a of function*(c,u){let h=!1;for(;!h;){if(h=!0,c){const m=c.next();m.done||(h=!1,yield{walker:c,value:m.value})}if(u){const m=u.next();m.done||(h=!1,yield{walker:u,value:m.value})}}}(n,i)){const c=a.walker==n?"elementEnd":"elementStart",u=a.value;if(u.type==c&&this.isObject(u.item))return se._createOn(u.item);if(this.checkChild(u.nextPosition,"$text"))return new se(u.nextPosition)}return null}findAllowedParent(e,t){let n=e.parent;for(;n;){if(this.checkChild(n,t))return n;if(this.isLimit(n))return null;n=n.parent}return null}removeDisallowedAttributes(e,t){for(const n of e)if(n.is("$text"))vu(this,n,t);else{const i=se._createIn(n).getPositions();for(const o of i)vu(this,o.nodeBefore||o.parent,t)}}createContext(e){return new ss(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,n=Object.keys(t);for(const i of n)e[i]=ro(t[i],i);for(const i of n)fu(e,i);for(const i of n)pu(e,i);for(const i of n)gu(e,i);for(const i of n)Tc(e,i),Vs(e,i);for(const i of n)Ue(e,i),Ac(e,i),mu(e,i);this._compiledDefinitions=e}_checkContextMatch(e,t,n=t.length-1){const i=t.getItem(n);if(e.allowIn.includes(i.name)){if(n==0)return!0;{const o=this.getDefinition(i);return this._checkContextMatch(o,t,n-1)}}return!1}*_getValidRangesForRange(e,t){let n=e.start,i=e.start;for(const o of e.getItems({shallow:!0}))o.is("element")&&(yield*this._getValidRangesForRange(se._createIn(o),t)),this.checkAttribute(o,t)||(n.isEqual(i)||(yield new se(n,i)),n=he._createAfter(o)),i=he._createAfter(o);n.isEqual(i)||(yield new se(n,i))}}Le(ff,Wt);class ss{constructor(e){if(e instanceof ss)return e;typeof e=="string"?e=[e]:Array.isArray(e)||(e=e.getAncestors({includeSelf:!0})),this._items=e.map(bu)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new ss([e]);return t._items=[...this._items,...t._items],t}getItem(e){return this._items[e]}*getNames(){yield*this._items.map(e=>e.name)}endsWith(e){return Array.from(this.getNames()).join(" ").endsWith(e)}startsWith(e){return Array.from(this.getNames()).join(" ").startsWith(e)}}function ro(r,e){const t={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(n,i){for(const o of n){const a=Object.keys(o).filter(c=>c.startsWith("is"));for(const c of a)i[c]=o[c]}}(r,t),Ii(r,t,"allowIn"),Ii(r,t,"allowContentOf"),Ii(r,t,"allowWhere"),Ii(r,t,"allowAttributes"),Ii(r,t,"allowAttributesOf"),Ii(r,t,"allowChildren"),Ii(r,t,"inheritTypesFrom"),function(n,i){for(const o of n){const a=o.inheritAllFrom;a&&(i.allowContentOf.push(a),i.allowWhere.push(a),i.allowAttributesOf.push(a),i.inheritTypesFrom.push(a))}}(r,t),t}function fu(r,e){const t=r[e];for(const n of t.allowChildren){const i=r[n];i&&i.allowIn.push(e)}t.allowChildren.length=0}function pu(r,e){for(const t of r[e].allowContentOf)r[t]&&dm(r,t).forEach(n=>{n.allowIn.push(e)});delete r[e].allowContentOf}function gu(r,e){for(const t of r[e].allowWhere){const n=r[t];if(n){const i=n.allowIn;r[e].allowIn.push(...i)}}delete r[e].allowWhere}function Tc(r,e){for(const t of r[e].allowAttributesOf){const n=r[t];if(n){const i=n.allowAttributes;r[e].allowAttributes.push(...i)}}delete r[e].allowAttributesOf}function Vs(r,e){const t=r[e];for(const n of t.inheritTypesFrom){const i=r[n];if(i){const o=Object.keys(i).filter(a=>a.startsWith("is"));for(const a of o)a in t||(t[a]=i[a])}}delete t.inheritTypesFrom}function Ue(r,e){const t=r[e],n=t.allowIn.filter(i=>r[i]);t.allowIn=Array.from(new Set(n))}function Ac(r,e){const t=r[e];for(const n of t.allowIn)r[n].allowChildren.push(e)}function mu(r,e){const t=r[e];t.allowAttributes=Array.from(new Set(t.allowAttributes))}function Ii(r,e,t){for(const n of r)typeof n[t]=="string"?e[t].push(n[t]):Array.isArray(n[t])&&e[t].push(...n[t])}function dm(r,e){const t=r[e];return(n=r,Object.keys(n).map(i=>n[i])).filter(i=>i.allowIn.includes(t.name));var n}function bu(r){return typeof r=="string"||r.is("documentFragment")?{name:typeof r=="string"?r:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:r.is("element")?r.name:"$text",*getAttributeKeys(){yield*r.getAttributeKeys()},getAttribute:e=>r.getAttribute(e)}}function vu(r,e,t){for(const n of e.getAttributeKeys())r.checkAttribute(e,n)||t.removeAttribute(n,e)}class Mn{constructor(e={}){this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},e),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.safeInsert=this._safeInsert.bind(this),this.conversionApi.updateConversionResult=this._updateConversionResult.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this),this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}convert(e,t,n=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(a,c){let u;for(const h of new ss(a)){const m={};for(const C of h.getAttributeKeys())m[C]=h.getAttribute(C);const k=c.createElement(h.name,m);u&&c.append(k,u),u=he._createAt(k,0)}return u}(n,t),this.conversionApi.writer=t,this.conversionApi.consumable=el.createFrom(e),this.conversionApi.store={};const{modelRange:i}=this._convertItem(e,this._modelCursor),o=t.createDocumentFragment();if(i){this._removeEmptyElements();for(const a of Array.from(this._modelCursor.parent.getChildren()))t.append(a,o);o.markers=function(a,c){const u=new Set,h=new Map,m=se._createIn(a).getItems();for(const k of m)k.name=="$marker"&&u.add(k);for(const k of u){const C=k.getAttribute("data-name"),S=c.createPositionBefore(k);h.has(C)?h.get(C).end=S.clone():h.set(C,new se(S.clone())),c.remove(k)}return h}(o,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,o}_convertItem(e,t){const n=Object.assign({viewItem:e,modelCursor:t,modelRange:null});if(e.is("element")?this.fire("element:"+e.name,n,this.conversionApi):e.is("$text")?this.fire("text",n,this.conversionApi):this.fire("documentFragment",n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof se))throw new y.a("view-conversion-dispatcher-incorrect-result",this);return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(e,t){let n=t.is("position")?t:he._createAt(t,0);const i=new se(n);for(const o of Array.from(e.getChildren())){const a=this._convertItem(o,n);a.modelRange instanceof se&&(i.end=a.modelRange.end,n=a.modelCursor)}return{modelRange:i,modelCursor:n}}_safeInsert(e,t){const n=this._splitToAllowedParent(e,t);return!!n&&(this.conversionApi.writer.insert(e,n.position),!0)}_updateConversionResult(e,t){const n=this._getSplitParts(e),i=this.conversionApi.writer;t.modelRange||(t.modelRange=i.createRange(i.createPositionBefore(e),i.createPositionAfter(n[n.length-1])));const o=this._cursorParents.get(e);t.modelCursor=o?i.createPositionAt(o,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:n,writer:i}=this.conversionApi;let o=n.findAllowedParent(t,e);if(o){if(o===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(o)&&(o=null)}if(!o)return Xa(t,e,n)?{position:lf(t,i)}:null;const a=this.conversionApi.writer.split(t,o),c=[];for(const h of a.range.getWalker())if(h.type=="elementEnd")c.push(h.item);else{const m=c.pop(),k=h.item;this._registerSplitPair(m,k)}const u=a.range.end.parent;return this._cursorParents.set(e,u),{position:a.position,cursorParent:u}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const n=this._splitParts.get(e);this._splitParts.set(t,n),n.push(t)}_getSplitParts(e){let t;return t=this._splitParts.has(e)?this._splitParts.get(e):[e],t}_removeEmptyElements(){let e=!1;for(const t of this._splitParts.keys())t.isEmpty&&(this.conversionApi.writer.remove(t),this._splitParts.delete(t),e=!0);e&&this._removeEmptyElements()}}Le(Mn,V);class um{getHtml(e){const t=document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}}class hm{constructor(e){this._domParser=new DOMParser,this._domConverter=new Sr(e,{blockFillerMode:"nbsp"}),this._htmlWriter=new um}toData(e){const t=this._domConverter.viewToDom(e,document);return this._htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this._domConverter.domToView(t)}registerRawContentMatcher(e){this._domConverter.registerRawContentMatcher(e)}useFillerType(e){this._domConverter.blockFillerMode=e=="marked"?"markedNbsp":"nbsp"}_toDom(e){const t=this._domParser.parseFromString(e,"text/html"),n=t.createDocumentFragment();let i=t.firstChild;for(;!i.isSameNode(t.documentElement);){const a=i;i=i.nextSibling,a.nodeType==Node.COMMENT_NODE&&n.appendChild(a)}const o=t.body.childNodes;for(;o.length>0;)n.appendChild(o[0]);return n}}class _u{constructor(e,t){this.model=e,this.mapper=new Ka,this.downcastDispatcher=new ru({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",(n,i,o)=>{if(!o.consumable.consume(i.item,"insert"))return;const a=o.writer,c=o.mapper.toViewPosition(i.range.start),u=a.createText(i.item.data);a.insert(c,u)},{priority:"lowest"}),this.upcastDispatcher=new Mn({schema:e.schema}),this.viewDocument=new Xr(t),this.stylesProcessor=t,this.htmlProcessor=new hm(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new Oh(this.viewDocument),this.upcastDispatcher.on("text",(n,i,{schema:o,consumable:a,writer:c})=>{let u=i.modelCursor;if(!a.test(i.viewItem))return;if(!o.checkChild(u,"$text")){if(!Xa(u,"$text",o))return;u=lf(u,c)}a.consume(i.viewItem);const h=c.createText(i.viewItem.data);c.insert(h,u),i.modelRange=c.createRange(u,u.getShiftedBy(h.offsetSize)),i.modelCursor=i.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(n,i,o)=>{if(!i.modelRange&&o.consumable.consume(i.viewItem,{name:!0})){const{modelRange:a,modelCursor:c}=o.convertChildren(i.viewItem,i.modelCursor);i.modelRange=a,i.modelCursor=c}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(n,i,o)=>{if(!i.modelRange&&o.consumable.consume(i.viewItem,{name:!0})){const{modelRange:a,modelCursor:c}=o.convertChildren(i.viewItem,i.modelCursor);i.modelRange=a,i.modelCursor=c}},{priority:"lowest"}),this.decorate("init"),this.decorate("set"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange("transparent",xc)},{priority:"lowest"})}get(e={}){const{rootName:t="main",trim:n="empty"}=e;if(!this._checkIfRootsExists([t]))throw new y.a("datacontroller-get-non-existent-root",this);const i=this.model.document.getRoot(t);return n!=="empty"||this.model.hasContent(i,{ignoreWhitespaces:!0})?this.stringify(i,e):""}stringify(e,t={}){const n=this.toView(e,t);return this.processor.toData(n)}toView(e,t={}){const n=this.viewDocument,i=this._viewWriter;this.mapper.clearBindings();const o=se._createIn(e),a=new ts(n);this.mapper.bindElements(e,a),this.downcastDispatcher.conversionApi.options=t,this.downcastDispatcher.convertInsert(o,i);const c=e.is("documentFragment")?Array.from(e.markers):function(u){const h=[],m=u.root.document;if(!m)return[];const k=se._createIn(u);for(const C of m.model.markers){const S=C.getRange(),N=S.isCollapsed,D=S.start.isEqual(k.start)||S.end.isEqual(k.end);if(N&&D)h.push([C.name,S]);else{const z=k.getIntersection(S);z&&h.push([C.name,z])}}return h}(e);for(const[u,h]of c)this.downcastDispatcher.convertMarkerAdd(u,h,i);return delete this.downcastDispatcher.conversionApi.options,a}init(e){if(this.model.document.version)throw new y.a("datacontroller-init-document-not-empty",this);let t={};if(typeof e=="string"?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new y.a("datacontroller-init-non-existent-root",this);return this.model.enqueueChange("transparent",n=>{for(const i of Object.keys(t)){const o=this.model.document.getRoot(i);n.insert(this.parse(t[i],o),o,0)}}),Promise.resolve()}set(e,t={}){let n={};if(typeof e=="string"?n.main=e:n=e,!this._checkIfRootsExists(Object.keys(n)))throw new y.a("datacontroller-set-non-existent-root",this);const i=t.batchType||"default";this.model.enqueueChange(i,o=>{o.setSelection(null),o.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const a of Object.keys(n)){const c=this.model.document.getRoot(a);o.remove(o.createRangeIn(c)),o.insert(this.parse(n[a],c),c,0)}})}parse(e,t="$root"){const n=this.processor.toView(e);return this.toModel(n,t)}toModel(e,t="$root"){return this.model.change(n=>this.upcastDispatcher.convert(e,n,t))}addStyleProcessorRules(e){e(this.stylesProcessor)}registerRawContentMatcher(e){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(e),this.htmlProcessor.registerRawContentMatcher(e)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e)if(!this.model.document.getRootNames().includes(t))return!1;return!0}}Le(_u,Wt);class fm{constructor(e,t){this._helpers=new Map,this._downcast=xt(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=xt(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){const n=this._downcast.includes(t);if(!this._upcast.includes(t)&&!n)throw new y.a("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:n})}for(e){if(!this._helpers.has(e))throw new y.a("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:n}of Sc(e))this.for("upcast").elementToElement({model:t,view:n,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:n}of Sc(e))this.for("upcast").elementToAttribute({view:n,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:n}of Sc(e))this.for("upcast").attributeToAttribute({view:n,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:n}){if(this._helpers.has(e))throw new y.a("conversion-group-exists",this);const i=n?new Ga(t):new cf(t);this._helpers.set(e,i)}}function*Sc(r){if(r.model.values)for(const e of r.model.values){const t={key:r.model.key,value:e},n=r.view[e],i=r.upcastAlso?r.upcastAlso[e]:void 0;yield*pf(t,n,i)}else yield*pf(r.model,r.view,r.upcastAlso)}function*pf(r,e,t){if(yield{model:r,view:e},t)for(const n of xt(t))yield{model:r,view:n}}class Ec{constructor(e="default"){this.operations=[],this.type=e}get baseVersion(){for(const e of this.operations)if(e.baseVersion!==null)return e.baseVersion;return null}addOperation(e){return e.batch=this,this.operations.push(e),e}}class Ui{constructor(e){this.baseVersion=e,this.isDocumentOperation=this.baseVersion!==null,this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e){return new this(e.baseVersion)}}class On{constructor(e){this.markers=new Map,this._children=new jo,e&&this._insertChild(0,e)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}is(e){return e==="documentFragment"||e==="model:documentFragment"}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}static fromJSON(e){const t=[];for(const n of e)n.name?t.push(Rt.fromJSON(n)):t.push(Nt.fromJSON(n));return new On(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(i){return typeof i=="string"?[new Nt(i)]:(ai(i)||(i=[i]),Array.from(i).map(o=>typeof o=="string"?new Nt(o):o instanceof tr?new Nt(o.data,o.getAttributes()):o))}(t);for(const i of n)i.parent!==null&&i._remove(),i.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const i of n)i.parent=null;return n}}function Nn(r,e){const t=(e=Ic(e)).reduce((o,a)=>o+a.offsetSize,0),n=r.parent;il(r);const i=r.index;return n._insertChild(i,e),nl(n,i+e.length),nl(n,i),new se(r,r.getShiftedBy(t))}function Pc(r){if(!r.isFlat)throw new y.a("operation-utils-remove-range-not-flat",this);const e=r.start.parent;il(r.start),il(r.end);const t=e._removeChildren(r.start.index,r.end.index-r.start.index);return nl(e,r.start.index),t}function tl(r,e){if(!r.isFlat)throw new y.a("operation-utils-move-range-not-flat",this);const t=Pc(r);return Nn(e=e._getTransformedByDeletion(r.start,r.end.offset-r.start.offset),t)}function Ic(r){const e=[];r instanceof Array||(r=[r]);for(let t=0;t<r.length;t++)if(typeof r[t]=="string")e.push(new Nt(r[t]));else if(r[t]instanceof tr)e.push(new Nt(r[t].data,r[t].getAttributes()));else if(r[t]instanceof On||r[t]instanceof jo)for(const n of r[t])e.push(n);else r[t]instanceof Do&&e.push(r[t]);for(let t=1;t<e.length;t++){const n=e[t],i=e[t-1];n instanceof Nt&&i instanceof Nt&&$s(n,i)&&(e.splice(t-1,2,new Nt(i.data+n.data,i.getAttributes())),t--)}return e}function nl(r,e){const t=r.getChild(e-1),n=r.getChild(e);if(t&&n&&t.is("$text")&&n.is("$text")&&$s(t,n)){const i=new Nt(t.data+n.data,t.getAttributes());r._removeChildren(e-1,2),r._insertChild(e-1,i)}}function il(r){const e=r.textNode,t=r.parent;if(e){const n=r.offset-e.startOffset,i=e.index;t._removeChildren(i,1);const o=new Nt(e.data.substr(0,n),e.getAttributes()),a=new Nt(e.data.substr(n),e.getAttributes());t._insertChild(i,[o,a])}}function $s(r,e){const t=r.getAttributes(),n=e.getAttributes();for(const i of t){if(i[1]!==e.getAttribute(i[0]))return!1;n.next()}return n.next().done}var wu=function(r,e){return Kh(r,e)};class on extends Ui{constructor(e,t,n,i,o){super(o),this.range=e.clone(),this.key=t,this.oldValue=n===void 0?null:n,this.newValue=i===void 0?null:i}get type(){return this.oldValue===null?"addAttribute":this.newValue===null?"removeAttribute":"changeAttribute"}clone(){return new on(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new on(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}toJSON(){const e=super.toJSON();return e.range=this.range.toJSON(),e}_validate(){if(!this.range.isFlat)throw new y.a("attribute-operation-range-not-flat",this);for(const e of this.range.getItems({shallow:!0})){if(this.oldValue!==null&&!wu(e.getAttribute(this.key),this.oldValue))throw new y.a("attribute-operation-wrong-old-value",this,{item:e,key:this.key,value:this.oldValue});if(this.oldValue===null&&this.newValue!==null&&e.hasAttribute(this.key))throw new y.a("attribute-operation-attribute-exists",this,{node:e,key:this.key})}}_execute(){wu(this.oldValue,this.newValue)||function(e,t,n){il(e.start),il(e.end);for(const i of e.getItems({shallow:!0})){const o=i.is("$textProxy")?i.textNode:i;n!==null?o._setAttribute(t,n):o._removeAttribute(t),nl(o.parent,o.index)}nl(e.end.parent,e.end.index)}(this.range,this.key,this.newValue)}static get className(){return"AttributeOperation"}static fromJSON(e,t){return new on(se.fromJSON(e.range,t),e.key,e.oldValue,e.newValue,e.baseVersion)}}class pm extends Ui{constructor(e,t){super(null),this.sourcePosition=e.clone(),this.howMany=t}get type(){return"detach"}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new y.a("detach-operation-on-document-node",this)}_execute(){Pc(se._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class zt extends Ui{constructor(e,t,n,i){super(i),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toNext",this.howMany=t,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNone"}get type(){return this.targetPosition.root.rootName=="$graveyard"?"remove":this.sourcePosition.root.rootName=="$graveyard"?"reinsert":"move"}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.baseVersion)}getMovedRangeStart(){return this.targetPosition._getTransformedByDeletion(this.sourcePosition,this.howMany)}getReversed(){const e=this.sourcePosition._getTransformedByInsertion(this.targetPosition,this.howMany);return new this.constructor(this.getMovedRangeStart(),this.howMany,e,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent,n=this.sourcePosition.offset,i=this.targetPosition.offset;if(n+this.howMany>e.maxOffset)throw new y.a("move-operation-nodes-do-not-exist",this);if(e===t&&n<i&&i<n+this.howMany)throw new y.a("move-operation-range-into-itself",this);if(this.sourcePosition.root==this.targetPosition.root&&xn(this.sourcePosition.getParentPath(),this.targetPosition.getParentPath())=="prefix"){const o=this.sourcePosition.path.length-1;if(this.targetPosition.path[o]>=n&&this.targetPosition.path[o]<n+this.howMany)throw new y.a("move-operation-node-into-itself",this)}}_execute(){tl(se._createFromPositionAndShift(this.sourcePosition,this.howMany),this.targetPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e.targetPosition=this.targetPosition.toJSON(),e}static get className(){return"MoveOperation"}static fromJSON(e,t){const n=he.fromJSON(e.sourcePosition,t),i=he.fromJSON(e.targetPosition,t);return new this(n,e.howMany,i,e.baseVersion)}}class Tn extends Ui{constructor(e,t,n){super(n),this.position=e.clone(),this.position.stickiness="toNone",this.nodes=new jo(Ic(t)),this.shouldReceiveAttributes=!1}get type(){return"insert"}get howMany(){return this.nodes.maxOffset}clone(){const e=new jo([...this.nodes].map(n=>n._clone(!0))),t=new Tn(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new he(e,[0]);return new zt(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffset<this.position.offset)throw new y.a("insert-operation-position-invalid",this)}_execute(){const e=this.nodes;this.nodes=new jo([...e].map(t=>t._clone(!0))),Nn(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,t){const n=[];for(const o of e.nodes)o.name?n.push(Rt.fromJSON(o)):n.push(Nt.fromJSON(o));const i=new Tn(he.fromJSON(e.position,t),n,e.baseVersion);return i.shouldReceiveAttributes=e.shouldReceiveAttributes,i}}class pi extends Ui{constructor(e,t,n,i,o,a){super(a),this.name=e,this.oldRange=t?t.clone():null,this.newRange=n?n.clone():null,this.affectsData=o,this._markers=i}get type(){return"marker"}clone(){return new pi(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new pi(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){const e=this.newRange?"_set":"_remove";this._markers[e](this.name,this.newRange,!0,this.affectsData)}toJSON(){const e=super.toJSON();return this.oldRange&&(e.oldRange=this.oldRange.toJSON()),this.newRange&&(e.newRange=this.newRange.toJSON()),delete e._markers,e}static get className(){return"MarkerOperation"}static fromJSON(e,t){return new pi(e.name,e.oldRange?se.fromJSON(e.oldRange,t):null,e.newRange?se.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}class ni extends Ui{constructor(e,t,n,i){super(i),this.position=e,this.position.stickiness="toNext",this.oldName=t,this.newName=n}get type(){return"rename"}clone(){return new ni(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new ni(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof Rt))throw new y.a("rename-operation-wrong-position",this);if(e.name!==this.oldName)throw new y.a("rename-operation-wrong-name",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e}static get className(){return"RenameOperation"}static fromJSON(e,t){return new ni(he.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class Rr extends Ui{constructor(e,t,n,i,o){super(o),this.root=e,this.key=t,this.oldValue=n,this.newValue=i}get type(){return this.oldValue===null?"addRootAttribute":this.newValue===null?"removeRootAttribute":"changeRootAttribute"}clone(){return new Rr(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Rr(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new y.a("rootattribute-operation-not-a-root",this,{root:this.root,key:this.key});if(this.oldValue!==null&&this.root.getAttribute(this.key)!==this.oldValue)throw new y.a("rootattribute-operation-wrong-old-value",this,{root:this.root,key:this.key});if(this.oldValue===null&&this.newValue!==null&&this.root.hasAttribute(this.key))throw new y.a("rootattribute-operation-attribute-exists",this,{root:this.root,key:this.key})}_execute(){this.newValue!==null?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const e=super.toJSON();return e.root=this.root.toJSON(),e}static get className(){return"RootAttributeOperation"}static fromJSON(e,t){if(!t.getRoot(e.root))throw new y.a("rootattribute-operation-fromjson-no-root",this,{rootName:e.root});return new Rr(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class pn extends Ui{constructor(e,t,n,i,o){super(o),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=t,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=i.clone()}get type(){return"merge"}get deletionPosition(){return new he(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new se(this.sourcePosition,e)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.targetPosition._getTransformedByMergeOperation(this),t=this.sourcePosition.path.slice(0,-1),n=new he(this.sourcePosition.root,t)._getTransformedByMergeOperation(this);return new Ht(e,this.howMany,n,this.graveyardPosition,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent;if(!e.parent)throw new y.a("merge-operation-source-position-invalid",this);if(!t.parent)throw new y.a("merge-operation-target-position-invalid",this);if(this.howMany!=e.maxOffset)throw new y.a("merge-operation-how-many-invalid",this)}_execute(){const e=this.sourcePosition.parent;tl(se._createIn(e),this.targetPosition),tl(se._createOn(e),this.graveyardPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=e.sourcePosition.toJSON(),e.targetPosition=e.targetPosition.toJSON(),e.graveyardPosition=e.graveyardPosition.toJSON(),e}static get className(){return"MergeOperation"}static fromJSON(e,t){const n=he.fromJSON(e.sourcePosition,t),i=he.fromJSON(e.targetPosition,t),o=he.fromJSON(e.graveyardPosition,t);return new this(n,e.howMany,i,o,e.baseVersion)}}class Ht extends Ui{constructor(e,t,n,i,o){super(o),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=n,this.graveyardPosition=i?i.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new he(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new se(this.splitPosition,e)}clone(){return new this.constructor(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.splitPosition.root.document.graveyard,t=new he(e,[0]);return new pn(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,t=this.splitPosition.offset;if(!e||e.maxOffset<t)throw new y.a("split-operation-position-invalid",this);if(!e.parent)throw new y.a("split-operation-split-in-root",this);if(this.howMany!=e.maxOffset-this.splitPosition.offset)throw new y.a("split-operation-how-many-invalid",this);if(this.graveyardPosition&&!this.graveyardPosition.nodeAfter)throw new y.a("split-operation-graveyard-position-invalid",this)}_execute(){const e=this.splitPosition.parent;if(this.graveyardPosition)tl(se._createFromPositionAndShift(this.graveyardPosition,1),this.insertionPosition);else{const t=e._clone();Nn(this.insertionPosition,t)}tl(new se(he._createAt(e,this.splitPosition.offset),he._createAt(e,e.maxOffset)),this.moveTargetPosition)}toJSON(){const e=super.toJSON();return e.splitPosition=this.splitPosition.toJSON(),e.insertionPosition=this.insertionPosition.toJSON(),this.graveyardPosition&&(e.graveyardPosition=this.graveyardPosition.toJSON()),e}static get className(){return"SplitOperation"}static getInsertionPosition(e){const t=e.path.slice(0,-1);return t[t.length-1]++,new he(e.root,t,"toPrevious")}static fromJSON(e,t){const n=he.fromJSON(e.splitPosition,t),i=he.fromJSON(e.insertionPosition,t),o=e.graveyardPosition?he.fromJSON(e.graveyardPosition,t):null;return new this(n,e.howMany,i,o,e.baseVersion)}}class Mc extends Rt{constructor(e,t,n="main"){super(t),this._document=e,this.rootName=n}get document(){return this._document}is(e,t){return t?t===this.name&&(e==="rootElement"||e==="model:rootElement"||e==="element"||e==="model:element"):e==="rootElement"||e==="model:rootElement"||e==="element"||e==="model:element"||e==="node"||e==="model:node"}toJSON(){return this.rootName}}class rl{constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new Nt(e,t)}createElement(e,t){return new Rt(e,t)}createDocumentFragment(){return new On}cloneElement(e,t=!0){return e._clone(t)}insert(e,t,n=0){if(this._assertWriterUsedCorrectly(),e instanceof Nt&&e.data=="")return;const i=he._createAt(t,n);if(e.parent){if(yu(e.root,i.root))return void this.move(se._createOn(e),i);if(e.root.document)throw new y.a("model-writer-insert-forbidden-move",this);this.remove(e)}const o=i.root.document?i.root.document.version:null,a=new Tn(i,e,o);if(e instanceof Nt&&(a.shouldReceiveAttributes=!0),this.batch.addOperation(a),this.model.applyOperation(a),e instanceof On)for(const[c,u]of e.markers){const h=he._createAt(u.root,0),m={range:new se(u.start._getCombined(h,i),u.end._getCombined(h,i)),usingOperation:!0,affectsData:!0};this.model.markers.has(c)?this.updateMarker(c,m):this.addMarker(c,m)}}insertText(e,t,n,i){t instanceof On||t instanceof Rt||t instanceof he?this.insert(this.createText(e),t,n):this.insert(this.createText(e,t),n,i)}insertElement(e,t,n,i){t instanceof On||t instanceof Rt||t instanceof he?this.insert(this.createElement(e),t,n):this.insert(this.createElement(e,t),n,i)}append(e,t){this.insert(e,t,"end")}appendText(e,t,n){t instanceof On||t instanceof Rt?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),n,"end")}appendElement(e,t,n){t instanceof On||t instanceof Rt?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),n,"end")}setAttribute(e,t,n){if(this._assertWriterUsedCorrectly(),n instanceof se){const i=n.getMinimalFlatRanges();for(const o of i)Oc(this,e,t,o)}else ku(this,e,t,n)}setAttributes(e,t){for(const[n,i]of Ti(e))this.setAttribute(n,i,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof se){const n=t.getMinimalFlatRanges();for(const i of n)Oc(this,e,null,i)}else ku(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=n=>{for(const i of n.getAttributeKeys())this.removeAttribute(i,n)};if(e instanceof se)for(const n of e.getItems())t(n);else t(e)}move(e,t,n){if(this._assertWriterUsedCorrectly(),!(e instanceof se))throw new y.a("writer-move-invalid-range",this);if(!e.isFlat)throw new y.a("writer-move-range-not-flat",this);const i=he._createAt(t,n);if(i.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!yu(e.root,i.root))throw new y.a("writer-move-different-document",this);const o=e.root.document?e.root.document.version:null,a=new zt(e.start,e.end.offset-e.start.offset,i,o);this.batch.addOperation(a),this.model.applyOperation(a)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof se?e:se._createOn(e)).getMinimalFlatRanges().reverse();for(const n of t)this._addOperationForAffectedMarkers("move",n),Nc(n.start,n.end.offset-n.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore,n=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof Rt))throw new y.a("writer-merge-no-element-before",this);if(!(n instanceof Rt))throw new y.a("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,n){return this.model.createPositionFromPath(e,t,n)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(e,t,n){return this.model.createSelection(e,t,n)}_mergeDetached(e){const t=e.nodeBefore,n=e.nodeAfter;this.move(se._createIn(n),he._createAt(t,"end")),this.remove(n)}_merge(e){const t=he._createAt(e.nodeBefore,"end"),n=he._createAt(e.nodeAfter,0),i=e.root.document.graveyard,o=new he(i,[0]),a=e.root.document.version,c=new pn(n,e.nodeAfter.maxOffset,t,o,a);this.batch.addOperation(c),this.model.applyOperation(c)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof Rt))throw new y.a("writer-rename-not-element-instance",this);const n=e.root.document?e.root.document.version:null,i=new ni(he._createBefore(e),e.name,t,n);this.batch.addOperation(i),this.model.applyOperation(i)}split(e,t){this._assertWriterUsedCorrectly();let n,i,o=e.parent;if(!o.parent)throw new y.a("writer-split-element-no-parent",this);if(t||(t=o.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new y.a("writer-split-invalid-limit-element",this);do{const a=o.root.document?o.root.document.version:null,c=o.maxOffset-e.offset,u=Ht.getInsertionPosition(e),h=new Ht(e,c,u,null,a);this.batch.addOperation(h),this.model.applyOperation(h),n||i||(n=o,i=e.parent.nextSibling),o=(e=this.createPositionAfter(e.parent)).parent}while(o!==t);return{position:e,range:new se(he._createAt(n,"end"),he._createAt(i,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new y.a("writer-wrap-range-not-flat",this);const n=t instanceof Rt?t:new Rt(t);if(n.childCount>0)throw new y.a("writer-wrap-element-not-empty",this);if(n.parent!==null)throw new y.a("writer-wrap-element-attached",this);this.insert(n,e.start);const i=new se(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(i,he._createAt(n,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),e.parent===null)throw new y.a("writer-unwrap-element-no-parent",this);this.move(se._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||typeof t.usingOperation!="boolean")throw new y.a("writer-addmarker-no-usingoperation",this);const n=t.usingOperation,i=t.range,o=t.affectsData!==void 0&&t.affectsData;if(this.model.markers.has(e))throw new y.a("writer-addmarker-marker-exists",this);if(!i)throw new y.a("writer-addmarker-no-range",this);return n?(Hs(this,e,null,i,o),this.model.markers.get(e)):this.model.markers._set(e,i,n,o)}updateMarker(e,t){this._assertWriterUsedCorrectly();const n=typeof e=="string"?e:e.name,i=this.model.markers.get(n);if(!i)throw new y.a("writer-updatemarker-marker-not-exists",this);if(!t)return void this.model.markers._refresh(i);const o=typeof t.usingOperation=="boolean",a=typeof t.affectsData=="boolean",c=a?t.affectsData:i.affectsData;if(!o&&!t.range&&!a)throw new y.a("writer-updatemarker-wrong-options",this);const u=i.getRange(),h=t.range?t.range:u;o&&t.usingOperation!==i.managedUsingOperations?t.usingOperation?Hs(this,n,null,h,c):(Hs(this,n,u,null,c),this.model.markers._set(n,h,void 0,c)):i.managedUsingOperations?Hs(this,n,u,h,c):this.model.markers._set(n,h,void 0,c)}removeMarker(e){this._assertWriterUsedCorrectly();const t=typeof e=="string"?e:e.name;if(!this.model.markers.has(t))throw new y.a("writer-removemarker-no-marker",this);const n=this.model.markers.get(t);if(!n.managedUsingOperations)return void this.model.markers._remove(t);Hs(this,t,n.getRange(),null,n.affectsData)}setSelection(e,t,n){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(e,t,n)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),typeof e=="string")this._setSelectionAttribute(e,t);else for(const[n,i]of Ti(e))this._setSelectionAttribute(n,i)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),typeof e=="string")this._removeSelectionAttribute(e);else for(const t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const i=Hi._getStoreAttributeKey(e);this.setAttribute(i,t,n.anchor.parent)}n._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const n=Hi._getStoreAttributeKey(e);this.removeAttribute(n,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new y.a("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(const n of this.model.markers){if(!n.managedUsingOperations)continue;const i=n.getRange();let o=!1;if(e==="move")o=t.containsPosition(i.start)||t.start.isEqual(i.start)||t.containsPosition(i.end)||t.end.isEqual(i.end);else{const a=t.nodeBefore,c=t.nodeAfter,u=i.start.parent==a&&i.start.isAtEnd,h=i.end.parent==c&&i.end.offset==0,m=i.end.nodeAfter==c,k=i.start.nodeAfter==c;o=u||h||m||k}o&&this.updateMarker(n.name,{range:i})}}}function Oc(r,e,t,n){const i=r.model,o=i.document;let a,c,u,h=n.start;for(const k of n.getWalker({shallow:!0}))u=k.item.getAttribute(e),a&&c!=u&&(c!=t&&m(),h=a),a=k.nextPosition,c=u;function m(){const k=new se(h,a),C=k.root.document?o.version:null,S=new on(k,e,c,t,C);r.batch.addOperation(S),i.applyOperation(S)}a instanceof he&&a!=h&&c!=t&&m()}function ku(r,e,t,n){const i=r.model,o=i.document,a=n.getAttribute(e);let c,u;if(a!=t){if(n.root===n){const h=n.document?o.version:null;u=new Rr(n,e,a,t,h)}else{c=new se(he._createBefore(n),r.createPositionAfter(n));const h=c.root.document?o.version:null;u=new on(c,e,a,t,h)}r.batch.addOperation(u),i.applyOperation(u)}}function Hs(r,e,t,n,i){const o=r.model,a=o.document,c=new pi(e,t,n,o.markers,i,a.version);r.batch.addOperation(c),o.applyOperation(c)}function Nc(r,e,t,n){let i;if(r.root.document){const o=n.document,a=new he(o.graveyard,[0]);i=new zt(r,e,a,o.version)}else i=new pm(r,e);t.addOperation(i),n.applyOperation(i)}function yu(r,e){return r===e||r instanceof Mc&&e instanceof Mc}class Dr{constructor(e){this._markerCollection=e,this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null}get isEmpty(){return this._changesInElement.size==0&&this._changedMarkers.size==0}refreshItem(e){if(this._isInInsertedElement(e.parent))return;this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize);const t=se._createOn(e);for(const n of this._markerCollection.getMarkersIntersectingRange(t)){const i=n.getRange();this.bufferMarkerChange(n.name,i,i,n.affectsData)}this._cachedChanges=null}bufferOperation(e){switch(e.type){case"insert":if(this._isInInsertedElement(e.position.parent))return;this._markInsert(e.position.parent,e.position.offset,e.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const t of e.range.getItems({shallow:!0}))this._isInInsertedElement(t.parent)||this._markAttribute(t);break;case"remove":case"move":case"reinsert":{if(e.sourcePosition.isEqual(e.targetPosition)||e.sourcePosition.getShiftedBy(e.howMany).isEqual(e.targetPosition))return;const t=this._isInInsertedElement(e.sourcePosition.parent),n=this._isInInsertedElement(e.targetPosition.parent);t||this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany),n||this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany);break}case"rename":{if(this._isInInsertedElement(e.position.parent))return;this._markRemove(e.position.parent,e.position.offset,1),this._markInsert(e.position.parent,e.position.offset,1);const t=se._createFromPositionAndShift(e.position,1);for(const n of this._markerCollection.getMarkersIntersectingRange(t)){const i=n.getRange();this.bufferMarkerChange(n.name,i,i,n.affectsData)}break}case"split":{const t=e.splitPosition.parent;this._isInInsertedElement(t)||this._markRemove(t,e.splitPosition.offset,e.howMany),this._isInInsertedElement(e.insertionPosition.parent)||this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1),e.graveyardPosition&&this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1);break}case"merge":{const t=e.sourcePosition.parent;this._isInInsertedElement(t.parent)||this._markRemove(t.parent,t.startOffset,1);const n=e.graveyardPosition.parent;this._markInsert(n,e.graveyardPosition.offset,1);const i=e.targetPosition.parent;this._isInInsertedElement(i)||this._markInsert(i,e.targetPosition.offset,t.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(e,t,n,i){const o=this._changedMarkers.get(e);o?(o.newRange=n,o.affectsData=i,o.oldRange==null&&o.newRange==null&&this._changedMarkers.delete(e)):this._changedMarkers.set(e,{oldRange:t,newRange:n,affectsData:i})}getMarkersToRemove(){const e=[];for(const[t,n]of this._changedMarkers)n.oldRange!=null&&e.push({name:t,range:n.oldRange});return e}getMarkersToAdd(){const e=[];for(const[t,n]of this._changedMarkers)n.newRange!=null&&e.push({name:t,range:n.newRange});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map(e=>({name:e[0],data:{oldRange:e[1].oldRange,newRange:e[1].newRange}}))}hasDataChanges(){for(const[,e]of this._changedMarkers)if(e.affectsData)return!0;return this._changesInElement.size>0}getChanges(e={includeChangesInGraveyard:!1}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let t=[];for(const n of this._changesInElement.keys()){const i=this._changesInElement.get(n).sort((m,k)=>m.offset===k.offset?m.type!=k.type?m.type=="remove"?-1:1:0:m.offset<k.offset?-1:1),o=this._elementSnapshots.get(n),a=Lo(n.getChildren()),c=gm(o.length,i);let u=0,h=0;for(const m of c)if(m==="i")t.push(this._getInsertDiff(n,u,a[u].name)),u++;else if(m==="r")t.push(this._getRemoveDiff(n,u,o[h].name)),h++;else if(m==="a"){const k=a[u].attributes,C=o[h].attributes;let S;if(a[u].name=="$text")S=new se(he._createAt(n,u),he._createAt(n,u+1));else{const N=n.offsetToIndex(u);S=new se(he._createAt(n,u),he._createAt(n.getChild(N),0))}t.push(...this._getAttributesDiff(S,C,k)),u++,h++}else u++,h++}t.sort((n,i)=>n.position.root!=i.position.root?n.position.root.rootName<i.position.root.rootName?-1:1:n.position.isEqual(i.position)?n.changeCount-i.changeCount:n.position.isBefore(i.position)?-1:1);for(let n=1,i=0;n<t.length;n++){const o=t[i],a=t[n],c=o.type=="remove"&&a.type=="remove"&&o.name=="$text"&&a.name=="$text"&&o.position.isEqual(a.position),u=o.type=="insert"&&a.type=="insert"&&o.name=="$text"&&a.name=="$text"&&o.position.parent==a.position.parent&&o.position.offset+o.length==a.position.offset,h=o.type=="attribute"&&a.type=="attribute"&&o.position.parent==a.position.parent&&o.range.isFlat&&a.range.isFlat&&o.position.offset+o.length==a.position.offset&&o.attributeKey==a.attributeKey&&o.attributeOldValue==a.attributeOldValue&&o.attributeNewValue==a.attributeNewValue;c||u||h?(o.length++,h&&(o.range.end=o.range.end.getShiftedBy(1)),t[n]=null):i=n}t=t.filter(n=>n);for(const n of t)delete n.changeCount,n.type=="attribute"&&(delete n.position,delete n.length);return this._changeCount=0,this._cachedChangesWithGraveyard=t.slice(),this._cachedChanges=t.filter(gf),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard:this._cachedChanges}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._cachedChanges=null}_markInsert(e,t,n){const i={type:"insert",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,i)}_markRemove(e,t,n){const i={type:"remove",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,i),this._removeAllNestedChanges(e,t,n)}_markAttribute(e){const t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshot(e);const n=this._getChangesForElement(e);this._handleChange(t,n),n.push(t);for(let i=0;i<n.length;i++)n[i].howMany<1&&(n.splice(i,1),i--)}_getChangesForElement(e){let t;return this._changesInElement.has(e)?t=this._changesInElement.get(e):(t=[],this._changesInElement.set(e,t)),t}_makeSnapshot(e){this._elementSnapshots.has(e)||this._elementSnapshots.set(e,Lo(e.getChildren()))}_handleChange(e,t){e.nodesToHandle=e.howMany;for(const n of t){const i=e.offset+e.howMany,o=n.offset+n.howMany;if(e.type=="insert"&&(n.type=="insert"&&(e.offset<=n.offset?n.offset+=e.howMany:e.offset<o&&(n.howMany+=e.nodesToHandle,e.nodesToHandle=0)),n.type=="remove"&&e.offset<n.offset&&(n.offset+=e.howMany),n.type=="attribute")){if(e.offset<=n.offset)n.offset+=e.howMany;else if(e.offset<o){const a=n.howMany;n.howMany=e.offset-n.offset,t.unshift({type:"attribute",offset:i,howMany:a-n.howMany,count:this._changeCount++})}}if(e.type=="remove"){if(n.type=="insert"){if(i<=n.offset)n.offset-=e.howMany;else if(i<=o)if(e.offset<n.offset){const a=i-n.offset;n.offset=e.offset,n.howMany-=a,e.nodesToHandle-=a}else n.howMany-=e.nodesToHandle,e.nodesToHandle=0;else if(e.offset<=n.offset)e.nodesToHandle-=n.howMany,n.howMany=0;else if(e.offset<o){const a=o-e.offset;n.howMany-=a,e.nodesToHandle-=a}}if(n.type=="remove"&&(i<=n.offset?n.offset-=e.howMany:e.offset<n.offset&&(e.nodesToHandle+=n.howMany,n.howMany=0)),n.type=="attribute"){if(i<=n.offset)n.offset-=e.howMany;else if(e.offset<n.offset){const a=i-n.offset;n.offset=e.offset,n.howMany-=a}else if(e.offset<o)if(i<=o){const a=n.howMany;n.howMany=e.offset-n.offset;const c=a-n.howMany-e.nodesToHandle;t.unshift({type:"attribute",offset:e.offset,howMany:c,count:this._changeCount++})}else n.howMany-=o-e.offset}}if(e.type=="attribute"){if(n.type=="insert")if(e.offset<n.offset&&i>n.offset){if(i>o){const a={type:"attribute",offset:o,howMany:i-o,count:this._changeCount++};this._handleChange(a,t),t.push(a)}e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=n.offset&&e.offset<o&&(i>o?(e.nodesToHandle=i-o,e.offset=o):e.nodesToHandle=0);if(n.type=="remove"&&e.offset<n.offset&&i>n.offset){const a={type:"attribute",offset:n.offset,howMany:i-n.offset,count:this._changeCount++};this._handleChange(a,t),t.push(a),e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}n.type=="attribute"&&(e.offset>=n.offset&&i<=o?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=n.offset&&i>=o&&(n.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,n){return{type:"insert",position:he._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,n){return{type:"remove",position:he._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,n){const i=[];n=new Map(n);for(const[o,a]of t){const c=n.has(o)?n.get(o):null;c!==a&&i.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:o,attributeOldValue:a,attributeNewValue:c,changeCount:this._changeCount++}),n.delete(o)}for(const[o,a]of n)i.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:o,attributeOldValue:null,attributeNewValue:a,changeCount:this._changeCount++});return i}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const n=this._changesInElement.get(t),i=e.startOffset;if(n){for(const o of n)if(o.type=="insert"&&i>=o.offset&&i<o.offset+o.howMany)return!0}return this._isInInsertedElement(t)}_removeAllNestedChanges(e,t,n){const i=new se(he._createAt(e,t),he._createAt(e,t+n));for(const o of i.getItems({shallow:!0}))o.is("element")&&(this._elementSnapshots.delete(o),this._changesInElement.delete(o),this._removeAllNestedChanges(o,0,o.maxOffset))}}function Lo(r){const e=[];for(const t of r)if(t.is("$text"))for(let n=0;n<t.data.length;n++)e.push({name:"$text",attributes:new Map(t.getAttributes())});else e.push({name:t.name,attributes:new Map(t.getAttributes())});return e}function gm(r,e){const t=[];let n=0,i=0;for(const o of e){if(o.offset>n){for(let a=0;a<o.offset-n;a++)t.push("e");i+=o.offset-n}if(o.type=="insert"){for(let a=0;a<o.howMany;a++)t.push("i");n=o.offset+o.howMany}else if(o.type=="remove"){for(let a=0;a<o.howMany;a++)t.push("r");n=o.offset,i+=o.howMany}else t.push(..."a".repeat(o.howMany).split("")),n=o.offset+o.howMany,i+=o.howMany}if(i<r)for(let o=0;o<r-i-n;o++)t.push("e");return t}function gf(r){const e=r.position&&r.position.root.rootName=="$graveyard",t=r.range&&r.range.root.rootName=="$graveyard";return!e&&!t}class mm{constructor(){this._operations=[],this._undoPairs=new Map,this._undoneOperations=new Set}addOperation(e){this._operations.includes(e)||this._operations.push(e)}getOperations(e=Number.NEGATIVE_INFINITY,t=Number.POSITIVE_INFINITY){const n=[];for(const i of this._operations)i.baseVersion>=e&&i.baseVersion<t&&n.push(i);return n}getOperation(e){for(const t of this._operations)if(t.baseVersion==e)return t}setOperationAsUndone(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}isUndoingOperation(e){return this._undoPairs.has(e)}isUndoneOperation(e){return this._undoneOperations.has(e)}getUndoneOperation(e){return this._undoPairs.get(e)}}function mf(r,e){return!!(t=r.charAt(e-1))&&t.length==1&&/[\ud800-\udbff]/.test(t)&&function(n){return!!n&&n.length==1&&/[\udc00-\udfff]/.test(n)}(r.charAt(e));var t}function bf(r,e){return!!(t=r.charAt(e))&&t.length==1&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(t);var t}class vf{constructor(e){this.model=e,this.version=0,this.history=new mm(this),this.selection=new Hi(this),this.roots=new li({idProperty:"rootName"}),this.differ=new Dr(e.markers),this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root","$graveyard"),this.listenTo(e,"applyOperation",(t,n)=>{const i=n[0];if(i.isDocumentOperation&&i.baseVersion!==this.version)throw new y.a("model-document-applyoperation-wrong-version",this,{operation:i})},{priority:"highest"}),this.listenTo(e,"applyOperation",(t,n)=>{const i=n[0];i.isDocumentOperation&&this.differ.bufferOperation(i)},{priority:"high"}),this.listenTo(e,"applyOperation",(t,n)=>{const i=n[0];i.isDocumentOperation&&(this.version++,this.history.addOperation(i))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(e.markers,"update",(t,n,i,o)=>{this.differ.bufferMarkerChange(n.name,i,o,n.affectsData),i===null&&n.on("change",(a,c)=>{this.differ.bufferMarkerChange(n.name,c,n.getRange(),n.affectsData)})})}get graveyard(){return this.getRoot("$graveyard")}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new y.a("model-document-createroot-name-exists",this,{name:t});const n=new Mc(this,e,t);return this.roots.add(n),n}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(){return Array.from(this.roots,e=>e.rootName).filter(e=>e!="$graveyard")}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=Ra(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const e of this.roots)if(e!==this.graveyard)return e;return this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),t=this.model,n=t.schema,i=t.createPositionFromPath(e,[0]);return n.getNearestSelectionRange(i)||t.createRange(i)}_validateSelectionRange(e){return _f(e.start)&&_f(e.end)}_callPostFixers(e){let t=!1;do for(const n of this._postFixers)if(this.selection.refresh(),t=n(e),t)break;while(t)}}function _f(r){const e=r.textNode;if(e){const t=e.data,n=r.offset-e.startOffset;return!mf(t,n)&&!bf(t,n)}return!0}Le(vf,V);class wf{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){return this._markers.has(e)}get(e){return this._markers.get(e)||null}_set(e,t,n=!1,i=!1){const o=e instanceof ol?e.name:e;if(o.includes(","))throw new y.a("markercollection-incorrect-marker-name",this);const a=this._markers.get(o);if(a){const h=a.getRange();let m=!1;return h.isEqual(t)||(a._attachLiveRange(Or.fromRange(t)),m=!0),n!=a.managedUsingOperations&&(a._managedUsingOperations=n,m=!0),typeof i=="boolean"&&i!=a.affectsData&&(a._affectsData=i,m=!0),m&&this.fire("update:"+o,a,h,t),a}const c=Or.fromRange(t),u=new ol(o,c,n,i);return this._markers.set(o,u),this.fire("update:"+o,u,null,t),u}_remove(e){const t=e instanceof ol?e.name:e,n=this._markers.get(t);return!!n&&(this._markers.delete(t),this.fire("update:"+t,n,n.getRange(),null),this._destroyMarker(n),!0)}_refresh(e){const t=e instanceof ol?e.name:e,n=this._markers.get(t);if(!n)throw new y.a("markercollection-refresh-marker-not-exists",this);const i=n.getRange();this.fire("update:"+t,n,i,i,n.managedUsingOperations,n.affectsData)}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)t.getRange().getIntersection(e)!==null&&(yield t)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}Le(wf,V);class ol{constructor(e,t,n,i){this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=n,this._affectsData=i}get managedUsingOperations(){if(!this._liveRange)throw new y.a("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new y.a("marker-destroyed",this);return this._affectsData}getStart(){if(!this._liveRange)throw new y.a("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new y.a("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new y.a("marker-destroyed",this);return this._liveRange.toRange()}is(e){return e==="marker"||e==="model:marker"}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}Le(ol,V);class An extends Ui{get type(){return"noop"}clone(){return new An(this.baseVersion)}getReversed(){return new An(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const rr={};rr[on.className]=on,rr[Tn.className]=Tn,rr[pi.className]=pi,rr[zt.className]=zt,rr[An.className]=An,rr[Ui.className]=Ui,rr[ni.className]=ni,rr[Rr.className]=Rr,rr[Ht.className]=Ht,rr[pn.className]=pn;class Rn extends he{constructor(e,t,n="toNone"){if(super(e,t,n),!this.root.is("rootElement"))throw new y.a("model-liveposition-root-not-rootelement",e);bm.call(this)}detach(){this.stopListening()}is(e){return e==="livePosition"||e==="model:livePosition"||e=="position"||e==="model:position"}toPosition(){return new he(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t||e.stickiness)}}function bm(){this.listenTo(this.root.document.model,"applyOperation",(r,e)=>{const t=e[0];t.isDocumentOperation&&kf.call(this,t)},{priority:"low"})}function kf(r){const e=this.getTransformedByOperation(r);if(!this.isEqual(e)){const t=this.toPosition();this.path=e.path,this.root=e.root,this.fire("change",t)}}Le(Rn,V);class yf{constructor(e,t,n){this.model=e,this.writer=t,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._documentFragment=t.createDocumentFragment(),this._documentFragmentPosition=t.createPositionAt(this._documentFragment,0),this._firstNode=null,this._lastNode=null,this._lastAutoParagraph=null,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(e){for(const t of Array.from(e))this._handleNode(t);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(e){const t=this.writer.createPositionAfter(this._lastNode),n=this.writer.createPositionAfter(e);if(n.isAfter(t)){if(this._lastNode=e,this.position.parent!=e||!this.position.isAtEnd)throw new y.a("insertcontent-invalid-insertion-position",this);this.position=n,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this.nodeToSelect?se._createOn(this.nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new se(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){if(this.schema.isObject(e))return void this._handleObject(e);let t=this._checkAndAutoParagraphToAllowedPosition(e);t||(t=this._checkAndSplitToAllowedPosition(e),t)?(this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e):this._handleDisallowedNode(e)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const e=Rn.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=e.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=e.toPosition(),e.detach()}_handleObject(e){this._checkAndSplitToAllowedPosition(e)?this._appendToFragment(e):this._tryAutoparagraphing(e)}_handleDisallowedNode(e){e.is("element")?this.handleNodes(e.getChildren()):this._tryAutoparagraphing(e)}_appendToFragment(e){if(!this.schema.checkChild(this.position,e))throw new y.a("insertcontent-wrong-position",this,{node:e,position:this.position});this.writer.insert(e,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(e.offsetSize),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this.nodeToSelect=e:this.nodeToSelect=null,this._filterAttributesOf.push(e)}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=Rn.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=Rn.fromPosition(e,"toNext"))}_mergeOnLeft(){const e=this._firstNode;if(!(e instanceof Rt)||!this._canMergeLeft(e))return;const t=Rn._createBefore(e);t.stickiness="toNext";const n=Rn.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=Rn._createAt(t.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=Rn._createAt(t.nodeBefore,"end","toNext")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_mergeOnRight(){const e=this._lastNode;if(!(e instanceof Rt)||!this._canMergeRight(e))return;const t=Rn._createAfter(e);if(t.stickiness="toNext",!this.position.isEqual(t))throw new y.a("insertcontent-invalid-insertion-position",this);this.position=he._createAt(t.nodeBefore,"end");const n=Rn.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=Rn._createAt(t.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=Rn._createAt(t.nodeBefore,0,"toPrevious")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_canMergeLeft(e){const t=e.previousSibling;return t instanceof Rt&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){const t=e.nextSibling;return t instanceof Rt&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(e,t)}_tryAutoparagraphing(e){const t=this.writer.createElement("paragraph");this._getAllowedIn(this.position.parent,t)&&this.schema.checkChild(t,e)&&(t._appendChild(e),this._handleNode(t))}_checkAndAutoParagraphToAllowedPosition(e){if(this.schema.checkChild(this.position.parent,e))return!0;if(!this.schema.checkChild(this.position.parent,"paragraph")||!this.schema.checkChild("paragraph",e))return!1;this._insertPartialFragment();const t=this.writer.createElement("paragraph");return this.writer.insert(t,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=t,this.position=this.writer.createPositionAt(t,0),!0}_checkAndSplitToAllowedPosition(e){const t=this._getAllowedIn(this.position.parent,e);if(!t)return!1;for(t!=this.position.parent&&this._insertPartialFragment();t!=this.position.parent;)if(this.position.isAtStart){const n=this.position.parent;this.position=this.writer.createPositionBefore(n),n.isEmpty&&n.parent===t&&this.writer.remove(n)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const n=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=n,this.canMergeWith.add(this.position.nodeAfter)}return!0}_getAllowedIn(e,t){return this.schema.checkChild(e,t)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,t)}}function xf(r,e,t={}){if(e.isCollapsed)return;const n=e.getFirstRange();if(n.root.rootName=="$graveyard")return;const i=r.schema;r.change(o=>{if(!t.doNotResetEntireContent&&function(u,h){const m=u.getLimitElement(h);if(!h.containsEntireContent(m))return!1;const k=h.getFirstRange();return k.start.parent==k.end.parent?!1:u.checkChild(m,"paragraph")}(i,e))return void function(u,h){const m=u.model.schema.getLimitElement(h);u.remove(u.createRangeIn(m)),Cf(u,u.createPositionAt(m,0),h)}(o,e);const[a,c]=function(u){const h=u.root.document.model,m=u.start;let k=u.end;if(h.hasContent(u,{ignoreMarkers:!0})){const C=function(S){const N=S.parent,D=N.root.document.model.schema,z=N.getAncestors({parentFirst:!0,includeSelf:!0});for(const U of z){if(D.isLimit(U))return null;if(D.isBlock(U))return U}}(k);if(C&&k.isTouching(h.createPositionAt(C,0))){const S=h.createSelection(u);h.modifySelection(S,{direction:"backward"});const N=S.getLastPosition(),D=h.createRange(N,k);h.hasContent(D,{ignoreMarkers:!0})||(k=N)}}return[Rn.fromPosition(m,"toPrevious"),Rn.fromPosition(k,"toNext")]}(n);a.isTouching(c)||o.remove(o.createRange(a,c)),t.leaveUnmerged||(function(u,h,m){const k=u.model;if(!xu(u.model.schema,h,m))return;const[C,S]=function(N,D){const z=N.getAncestors(),U=D.getAncestors();let J=0;for(;z[J]&&z[J]==U[J];)J++;return[z[J],U[J]]}(h,m);!C||!S||(!k.hasContent(C,{ignoreMarkers:!0})&&k.hasContent(S,{ignoreMarkers:!0})?function N(D,z,U,J){const ce=z.parent,ye=U.parent;if(!(ce==J||ye==J)){for(z=D.createPositionAfter(ce),(U=D.createPositionBefore(ye)).isEqual(z)||D.insert(ce,U);z.parent.isEmpty;){const ze=z.parent;z=D.createPositionBefore(ze),D.remove(ze)}U=D.createPositionBefore(ye),function(ze,Kt){const vt=Kt.nodeBefore,Kn=Kt.nodeAfter;vt.name!=Kn.name&&ze.rename(vt,Kn.name),ze.clearAttributes(vt),ze.setAttributes(Object.fromEntries(Kn.getAttributes()),vt),ze.merge(Kt)}(D,U),xu(D.model.schema,z,U)&&N(D,z,U,J)}}(u,h,m,C.parent):function N(D,z,U,J){const ce=z.parent,ye=U.parent;if(!(ce==J||ye==J)){for(z=D.createPositionAfter(ce),(U=D.createPositionBefore(ye)).isEqual(z)||D.insert(ye,z),D.merge(z);U.parent.isEmpty;){const ze=U.parent;U=D.createPositionBefore(ze),D.remove(ze)}xu(D.model.schema,z,U)&&N(D,z,U,J)}}(u,h,m,C.parent))}(o,a,c),i.removeDisallowedAttributes(a.parent.getChildren(),o)),Tf(o,e,a),!t.doNotAutoparagraph&&function(u,h){const m=u.checkChild(h,"$text"),k=u.checkChild(h,"paragraph");return!m&&k}(i,a)&&Cf(o,a,e),a.detach(),c.detach()})}function xu(r,e,t){const n=e.parent,i=t.parent;return n!=i&&!r.isLimit(n)&&!r.isLimit(i)&&function(o,a,c){const u=new se(o,a);for(const h of u.getWalker())if(c.isLimit(h.item))return!1;return!0}(e,t,r)}function Cf(r,e,t){const n=r.createElement("paragraph");r.insert(n,e),Tf(r,t,r.createPositionAt(n,0))}function Tf(r,e,t){e instanceof Hi?r.setSelection(t):e.setTo(t)}function Af(r,e){const{isForward:t,walker:n,unit:i,schema:o}=r,{type:a,item:c,nextPosition:u}=e;if(a=="text")return r.unit==="word"?function(h,m){let k=h.position.textNode;if(k){let C=h.position.offset-k.startOffset;for(;!_m(k.data,C,m)&&!wm(k,C,m);){h.next();const S=m?h.position.nodeAfter:h.position.nodeBefore;if(S&&S.is("$text")){const N=S.data.charAt(m?0:S.data.length-1);' ,.?!:;"-()'.includes(N)||(h.next(),k=h.position.textNode)}C=h.position.offset-k.startOffset}}return h.position}(n,t):function(h,m){const k=h.position.textNode;if(k){const C=k.data;let S=h.position.offset-k.startOffset;for(;mf(C,S)||m=="character"&&bf(C,S);)h.next(),S=h.position.offset-k.startOffset}return h.position}(n,i);if(a==(t?"elementStart":"elementEnd")){if(o.isSelectable(c))return he._createAt(c,t?"after":"before");if(o.checkChild(u,"$text"))return u}else{if(o.isLimit(c))return void n.skip(()=>!0);if(o.checkChild(u,"$text"))return u}}function vm(r,e){const t=r.root,n=he._createAt(t,e?"end":0);return e?new se(r,n):new se(n,r)}function _m(r,e,t){const n=e+(t?0:-1);return' ,.?!:;"-()'.includes(r.charAt(n))}function wm(r,e,t){return e===(t?r.endOffset:0)}function Sf(r,e){const t=[];Array.from(r.getItems({direction:"backward"})).map(n=>e.createRangeOn(n)).filter(n=>(n.start.isAfter(r.start)||n.start.isEqual(r.start))&&(n.end.isBefore(r.end)||n.end.isEqual(r.end))).forEach(n=>{t.push(n.start.parent),e.remove(n)}),t.forEach(n=>{let i=n;for(;i.parent&&i.isEmpty;){const o=e.createRangeOn(i);i=i.parent,e.remove(o)}})}function km(r){r.document.registerPostFixer(e=>function(t,n){const i=n.document.selection,o=n.schema,a=[];let c=!1;for(const u of i.getRanges()){const h=ym(u,o);h&&!h.isEqual(u)?(a.push(h),c=!0):a.push(u)}c&&t.setSelection(function(u){const h=[];h.push(u.shift());for(const m of u){const k=h.pop();if(m.isEqual(k))h.push(k);else if(m.isIntersecting(k)){const C=k.start.isAfter(m.start)?m.start:k.start,S=k.end.isAfter(m.end)?k.end:m.end,N=new se(C,S);h.push(N)}else h.push(k),h.push(m)}return h}(a),{backward:i.isBackward})}(e,r))}function ym(r,e){return r.isCollapsed?function(t,n){const i=t.start,o=n.getNearestSelectionRange(i);if(!o)return null;if(!o.isCollapsed)return o;const a=o.start;return i.isEqual(a)?null:new se(a)}(r,e):function(t,n){const{start:i,end:o}=t,a=n.checkChild(i,"$text"),c=n.checkChild(o,"$text"),u=n.getLimitElement(i),h=n.getLimitElement(o);if(u===h){if(a&&c)return null;if(function(C,S,N){const D=C.nodeAfter&&!N.isLimit(C.nodeAfter)||N.checkChild(C,"$text"),z=S.nodeBefore&&!N.isLimit(S.nodeBefore)||N.checkChild(S,"$text");return D||z}(i,o,n)){const C=i.nodeAfter&&n.isSelectable(i.nodeAfter)?null:n.getNearestSelectionRange(i,"forward"),S=o.nodeBefore&&n.isSelectable(o.nodeBefore)?null:n.getNearestSelectionRange(o,"backward"),N=C?C.start:i,D=S?S.end:o;return new se(N,D)}}const m=u&&!u.is("rootElement"),k=h&&!h.is("rootElement");if(m||k){const C=i.nodeAfter&&o.nodeBefore&&i.nodeAfter.parent===o.nodeBefore.parent,S=m&&(!C||!Ef(i.nodeAfter,n)),N=k&&(!C||!Ef(o.nodeBefore,n));let D=i,z=o;return S&&(D=he._createBefore(Mi(u,n))),N&&(z=he._createAfter(Mi(h,n))),new se(D,z)}return null}(r,e)}function Mi(r,e){let t=r,n=t;for(;e.isLimit(n)&&n.parent;)t=n,n=n.parent;return t}function Ef(r,e){return r&&e.isSelectable(r)}class Pf{constructor(){this.markers=new wf,this.document=new vf(this),this.schema=new ff,this._pendingChanges=[],this._currentWriter=null,["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(e=>this.decorate(e)),this.on("applyOperation",(e,t)=>{t[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$block",{allowIn:"$root",isBlock:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck((e,t)=>{if(t.name==="$marker")return!0}),km(this),this.document.registerPostFixer(xc)}change(e){try{return this._pendingChanges.length===0?(this._pendingChanges.push({batch:new Ec,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(t){y.a.rethrowUnexpectedError(t,this)}}enqueueChange(e,t){try{typeof e=="string"?e=new Ec(e):typeof e=="function"&&(t=e,e=new Ec),this._pendingChanges.push({batch:e,callback:t}),this._pendingChanges.length==1&&this._runPendingChanges()}catch(n){y.a.rethrowUnexpectedError(n,this)}}applyOperation(e){e._execute()}insertContent(e,t,n){return function(i,o,a,c){return i.change(u=>{let h;h=a?a instanceof Mr||a instanceof Hi?a:u.createSelection(a,c):i.document.selection,h.isCollapsed||i.deleteContent(h,{doNotAutoparagraph:!0});const m=new yf(i,u,h.anchor);let k;k=o.is("documentFragment")?o.getChildren():[o],m.handleNodes(k);const C=m.getSelectionRange();C&&(h instanceof Hi?u.setSelection(C):h.setTo(C));const S=m.getAffectedRange()||i.createRange(h.anchor);return m.destroy(),S})}(this,e,t,n)}deleteContent(e,t){xf(this,e,t)}modifySelection(e,t){(function(n,i,o={}){const a=n.schema,c=o.direction!="backward",u=o.unit?o.unit:"character",h=i.focus,m=new nr({boundaries:vm(h,c),singleCharacters:!0,direction:c?"forward":"backward"}),k={walker:m,schema:a,isForward:c,unit:u};let C;for(;C=m.next();){if(C.done)return;const S=Af(k,C.value);if(S)return void(i instanceof Hi?n.change(N=>{N.setSelectionFocus(S)}):i.setFocus(S))}})(this,e,t)}getSelectedContent(e){return function(t,n){return t.change(i=>{const o=i.createDocumentFragment(),a=n.getFirstRange();if(!a||a.isCollapsed)return o;const c=a.start.root,u=a.start.getCommonPath(a.end),h=c.getNodeByPath(u);let m;m=a.start.parent==a.end.parent?a:i.createRange(i.createPositionAt(h,a.start.path[u.length]),i.createPositionAt(h,a.end.path[u.length]+1));const k=m.end.offset-m.start.offset;for(const C of m.getItems({shallow:!0}))C.is("$textProxy")?i.appendText(C.data,C.getAttributes(),o):i.append(i.cloneElement(C,!0),o);if(m!=a){const C=a._getTransformedByMove(m.start,i.createPositionAt(o,0),k)[0],S=i.createRange(i.createPositionAt(o,0),C.start);Sf(i.createRange(C.end,i.createPositionAt(o,"end")),i),Sf(S,i)}return o})}(this,e)}hasContent(e,t={}){const n=e instanceof Rt?se._createIn(e):e;if(n.isCollapsed)return!1;const{ignoreWhitespaces:i=!1,ignoreMarkers:o=!1}=t;if(!o){for(const a of this.markers.getMarkersIntersectingRange(n))if(a.affectsData)return!0}for(const a of n.getItems())if(this.schema.isContent(a)&&(!a.is("$textProxy")||!i||a.data.search(/\S/)!==-1))return!0;return!1}createPositionFromPath(e,t,n){return new he(e,t,n)}createPositionAt(e,t){return he._createAt(e,t)}createPositionAfter(e){return he._createAfter(e)}createPositionBefore(e){return he._createBefore(e)}createRange(e,t){return new se(e,t)}createRangeIn(e){return se._createIn(e)}createRangeOn(e){return se._createOn(e)}createSelection(e,t,n){return new Mr(e,t,n)}createBatch(e){return new Ec(e)}createOperationFromJSON(e){return(class{static fromJSON(t,n){return rr[t.__className].fromJSON(t,n)}}).fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){const t=this._pendingChanges[0].batch;this._currentWriter=new rl(this,t);const n=this._pendingChanges[0].callback(this._currentWriter);e.push(n),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),e}}Le(Pf,Wt);class xm extends Ei{constructor(e){super(),this.editor=e}set(e,t,n={}){if(typeof t=="string"){const i=t;t=(o,a)=>{this.editor.execute(i),a()}}super.set(e,t,n)}}class Cu{constructor(e={}){this._context=e.context||new br({language:e.language}),this._context._addEditor(this,!e.context);const t=Array.from(this.constructor.builtinPlugins||[]);this.config=new Oa(e,this.constructor.defaultConfig),this.config.define("plugins",t),this.config.define(this._context._getEditorConfig()),this.plugins=new Na(this,t,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this.commands=new uf,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.set("isReadOnly",!1),this.model=new Pf;const n=new M;this.data=new _u(this.model,n),this.editing=new hu(this.model,n),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new fm([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new xm(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const e=this.config,t=e.get("plugins"),n=e.get("removePlugins")||[],i=e.get("extraPlugins")||[],o=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(i),n,o)}destroy(){let e=Promise.resolve();return this.state=="initializing"&&(e=new Promise(t=>this.once("ready",t))),e.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(...e){try{return this.commands.execute(...e)}catch(t){y.a.rethrowUnexpectedError(t,this)}}focus(){this.editing.view.focus()}}Le(Cu,Wt);class Cm{constructor(e){this.editor=e,this._components=new Map}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(Tu(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new y.a("componentfactory-item-missing",this,{name:e});return this._components.get(Tu(e)).callback(this.editor.locale)}has(e){return this._components.has(Tu(e))}}function Tu(r){return String(r).toLowerCase()}class If{constructor(e){this.editor=e,this.componentFactory=new Cm(e),this.focusTracker=new $i,this._editableElementsMap=new Map,this.listenTo(e.editing.view.document,"layoutChanged",()=>this.update())}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null;this._editableElementsMap=new Map}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}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}}Le(If,V);var Tm={setData(r){this.data.set(r)},getData(r){return this.data.get(r)}},Au={updateSourceElement(){if(!this.sourceElement)throw new y.a("editor-missing-sourceelement",this);var r,e;r=this.sourceElement,e=this.data.get(),r instanceof HTMLTextAreaElement&&(r.value=e),r.innerHTML=e}};class Mf extends vr{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new li({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if(typeof e!="string")throw new y.a("pendingactions-add-invalid-message",this);const t=Object.create(Wt);return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}const Oi={cancel:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.591 10.177 4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z"/></svg>',caption:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 16h9a1 1 0 0 1 0 2H2a1 1 0 0 1 0-2z"/><path d="M17 1a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14zm0 1.5H3a.5.5 0 0 0-.492.41L2.5 3v9a.5.5 0 0 0 .41.492L3 12.5h14a.5.5 0 0 0 .492-.41L17.5 12V3a.5.5 0 0 0-.41-.492L17 2.5z" fill-opacity=".6"/></svg>',check:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z"/></svg>',cog:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.333 2 .19 2.263a5.899 5.899 0 0 1 1.458.604L14.714 3.4 16.6 5.286l-1.467 1.733c.263.452.468.942.605 1.46L18 8.666v2.666l-2.263.19a5.899 5.899 0 0 1-.604 1.458l1.467 1.733-1.886 1.886-1.733-1.467a5.899 5.899 0 0 1-1.46.605L11.334 18H8.667l-.19-2.263a5.899 5.899 0 0 1-1.458-.604L5.286 16.6 3.4 14.714l1.467-1.733a5.899 5.899 0 0 1-.604-1.458L2 11.333V8.667l2.262-.189a5.899 5.899 0 0 1 .605-1.459L3.4 5.286 5.286 3.4l1.733 1.467a5.899 5.899 0 0 1 1.46-.605L8.666 2h2.666zM10 6.267a3.733 3.733 0 1 0 0 7.466 3.733 3.733 0 0 0 0-7.466z"/></svg>',eraser:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m8.636 9.531-2.758 3.94a.5.5 0 0 0 .122.696l3.224 2.284h1.314l2.636-3.736L8.636 9.53zm.288 8.451L5.14 15.396a2 2 0 0 1-.491-2.786l6.673-9.53a2 2 0 0 1 2.785-.49l3.742 2.62a2 2 0 0 1 .491 2.785l-7.269 10.053-2.147-.066z"/><path d="M4 18h5.523v-1H4zm-2 0h1v-1H2z"/></svg>',lowVision:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.085 6.22 2.943 4.078a.75.75 0 1 1 1.06-1.06l2.592 2.59A11.094 11.094 0 0 1 10 5.068c4.738 0 8.578 3.101 8.578 5.083 0 1.197-1.401 2.803-3.555 3.887l1.714 1.713a.75.75 0 0 1-.09 1.138.488.488 0 0 1-.15.084.75.75 0 0 1-.821-.16L6.17 7.304c-.258.11-.51.233-.757.365l6.239 6.24-.006.005.78.78c-.388.094-.78.166-1.174.215l-1.11-1.11h.011L4.55 8.197a7.2 7.2 0 0 0-.665.514l-.112.098 4.897 4.897-.005.006 1.276 1.276a10.164 10.164 0 0 1-1.477-.117l-.479-.479-.009.009-4.863-4.863-.022.031a2.563 2.563 0 0 0-.124.2c-.043.077-.08.158-.108.241a.534.534 0 0 0-.028.133.29.29 0 0 0 .008.072.927.927 0 0 0 .082.226c.067.133.145.26.234.379l3.242 3.365.025.01.59.623c-3.265-.918-5.59-3.155-5.59-4.668 0-1.194 1.448-2.838 3.663-3.93zm7.07.531a4.632 4.632 0 0 1 1.108 5.992l.345.344.046-.018a9.313 9.313 0 0 0 2-1.112c.256-.187.5-.392.727-.613.137-.134.27-.277.392-.431.072-.091.141-.185.203-.286.057-.093.107-.19.148-.292a.72.72 0 0 0 .036-.12.29.29 0 0 0 .008-.072.492.492 0 0 0-.028-.133.999.999 0 0 0-.036-.096 2.165 2.165 0 0 0-.071-.145 2.917 2.917 0 0 0-.125-.2 3.592 3.592 0 0 0-.263-.335 5.444 5.444 0 0 0-.53-.523 7.955 7.955 0 0 0-1.054-.768 9.766 9.766 0 0 0-1.879-.891c-.337-.118-.68-.219-1.027-.301zm-2.85.21-.069.002a.508.508 0 0 0-.254.097.496.496 0 0 0-.104.679.498.498 0 0 0 .326.199l.045.005c.091.003.181.003.272.012a2.45 2.45 0 0 1 2.017 1.513c.024.061.043.125.069.185a.494.494 0 0 0 .45.287h.008a.496.496 0 0 0 .35-.158.482.482 0 0 0 .13-.335.638.638 0 0 0-.048-.219 3.379 3.379 0 0 0-.36-.723 3.438 3.438 0 0 0-2.791-1.543l-.028-.001h-.013z"/></svg>',image:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.91 10.54c.26-.23.64-.21.88.03l3.36 3.14 2.23-2.06a.64.64 0 0 1 .87 0l2.52 2.97V4.5H3.2v10.12l3.71-4.08zm10.27-7.51c.6 0 1.09.47 1.09 1.05v11.84c0 .59-.49 1.06-1.09 1.06H2.79c-.6 0-1.09-.47-1.09-1.06V4.08c0-.58.49-1.05 1.1-1.05h14.38zm-5.22 5.56a1.96 1.96 0 1 1 3.4-1.96 1.96 1.96 0 0 1-3.4 1.96z"/></svg>',alignBottom:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m9.239 13.938-2.88-1.663a.75.75 0 0 1 .75-1.3L9 12.067V4.75a.75.75 0 1 1 1.5 0v7.318l1.89-1.093a.75.75 0 0 1 .75 1.3l-2.879 1.663a.752.752 0 0 1-.511.187.752.752 0 0 1-.511-.187zM4.25 17a.75.75 0 1 1 0-1.5h10.5a.75.75 0 0 1 0 1.5H4.25z"/></svg>',alignMiddle:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.75 11.875a.752.752 0 0 1 .508.184l2.883 1.666a.75.75 0 0 1-.659 1.344l-.091-.044-1.892-1.093.001 4.318a.75.75 0 1 1-1.5 0v-4.317l-1.89 1.092a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .51-.187zM15.25 9a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM9.75.375a.75.75 0 0 1 .75.75v4.318l1.89-1.093.092-.045a.75.75 0 0 1 .659 1.344l-2.883 1.667a.752.752 0 0 1-.508.184.752.752 0 0 1-.511-.187L6.359 5.65a.75.75 0 0 1 .75-1.299L9 5.442V1.125a.75.75 0 0 1 .75-.75z"/></svg>',alignTop:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m10.261 7.062 2.88 1.663a.75.75 0 0 1-.75 1.3L10.5 8.933v7.317a.75.75 0 1 1-1.5 0V8.932l-1.89 1.093a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .511-.187.752.752 0 0 1 .511.187zM15.25 4a.75.75 0 1 1 0 1.5H4.75a.75.75 0 0 1 0-1.5h10.5z"/></svg>',alignLeft:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>',alignCenter:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm2.286 4c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75z"/></svg>',alignRight:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M18 3.75a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 8a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 4a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75zm0-8a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75z"/></svg>',alignJustify:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>',objectLeft:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zm0-3H18v1.5h-4.5zm0-3H18v1.5h-4.5zM2 15h16v1.5H2z"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z"/></svg>',objectCenter:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M15.003 7v5.5a1 1 0 0 1-1 1H5.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H6.5V12h6.997V7.5z"/></svg>',objectRight:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2zm0-9h5v1.5H2zm0 3h5v1.5H2zm0 3h5v1.5H2z"/><path d="M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H9.5V12h6.997V7.5z"/></svg>',objectFullWidth:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M18 7v5.5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1zm-1.505.5H3.504V12h12.991V7.5z"/></svg>',objectInline:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zM2 15h16v1.5H2z"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z"/></svg>',objectBlockLeft:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z"/></svg>',objectBlockRight:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path opacity=".5" d="M2 3h16v1.5H2zm0 12h16v1.5H2z"/><path d="M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H9.5V12h6.997V7.5z"/></svg>',objectSizeFull:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M18.095 2H1.905C.853 2 0 2.895 0 4v12c0 1.105.853 2 1.905 2h16.19C19.147 18 20 17.105 20 16V4c0-1.105-.853-2-1.905-2zm0 1.5c.263 0 .476.224.476.5v12c0 .276-.213.5-.476.5H1.905a.489.489 0 0 1-.476-.5V4c0-.276.213-.5.476-.5h16.19z"/></svg>',objectSizeLarge:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M13 6H2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5V8a.5.5 0 0 1 .5-.5h11z"/></svg>',objectSizeSmall:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M7 10H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5h5z"/></svg>',objectSizeMedium:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M10 8H2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-6a.5.5 0 0 1 .5-.5h8z"/></svg>',pencil:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m7.3 17.37-.061.088a1.518 1.518 0 0 1-.934.535l-4.178.663-.806-4.153a1.495 1.495 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055L7.3 17.37zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346L9.14 4.728zM6.07 16.512l-3.276-2.295.53 2.73 2.746-.435zM9.994 3.506 13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5 9.375 17H19v1.5H8z"/></svg>',pilcrow:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.999 2H15a1 1 0 0 1 0 2h-1.004v13a1 1 0 1 1-2 0V4H8.999v13a1 1 0 1 1-2 0v-7A4 4 0 0 1 3 6a4 4 0 0 1 3.999-4z"/></svg>',quote:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574z"/></svg>',threeVerticalDots:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="9.5" cy="4.5" r="1.5"/><circle cx="9.5" cy="10.5" r="1.5"/><circle cx="9.5" cy="16.5" r="1.5"/></svg>'};function Su({emitter:r,activator:e,callback:t,contextElements:n}){r.listenTo(document,"mousedown",(i,o)=>{if(!e())return;const a=typeof o.composedPath=="function"?o.composedPath():[];for(const c of n)if(c.contains(o.target)||a.includes(c))return;t()})}function Eu(r){r.set("_isCssTransitionsDisabled",!1),r.disableCssTransitions=()=>{r._isCssTransitionsDisabled=!0},r.enableCssTransitions=()=>{r._isCssTransitionsDisabled=!1},r.extendTemplate({attributes:{class:[r.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}function Pu({view:r}){r.listenTo(r.element,"submit",(e,t)=>{t.preventDefault(),r.fire("submit")},{useCapture:!0})}class as extends li{constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(t,n,i)=>{this._renderViewIntoCollectionParent(n,i)}),this.on("remove",(t,n)=>{n.element&&this._parentElement&&n.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(const t of this)this._renderViewIntoCollectionParent(t)}delegate(...e){if(!e.length||!e.every(t=>typeof t=="string"))throw new y.a("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const n of this)for(const i of e)n.delegate(i).to(t);this.on("add",(n,i)=>{for(const o of e)i.delegate(o).to(t)}),this.on("remove",(n,i)=>{for(const o of e)i.stopDelegating(o,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}}v(15);class ut{constructor(e){this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new li,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,n)=>{n.locale=e}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=Ni.bind(this,this)}createCollection(e){const t=new as(e);return this._viewCollections.add(t),t}registerChild(e){ai(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){ai(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new Ni(e)}extendTemplate(e){Ni.extend(this.template,e)}render(){if(this.isRendered)throw new y.a("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)}}Le(ut,is),Le(ut,Wt);class Ni{constructor(e){Object.assign(this,Df(Rf(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:e,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new y.a("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const n of t.children)jc(n)?yield n:Iu(n)&&(yield*e(n))}(this)}static bind(e,t){return{to:(n,i)=>new Am({eventNameOrFunction:n,attribute:n,observable:e,emitter:t,callback:i}),if:(n,i,o)=>new Of({observable:e,emitter:t,attribute:n,valueIfTrue:i,callback:o})}}static extend(e,t){if(e._isRendered)throw new y.a("template-extend-render",[this,e]);(function n(i,o){if(o.attributes&&(i.attributes||(i.attributes={}),Dc(i.attributes,o.attributes)),o.eventListeners&&(i.eventListeners||(i.eventListeners={}),Dc(i.eventListeners,o.eventListeners)),o.text&&i.text.push(...o.text),o.children&&o.children.length){if(i.children.length!=o.children.length)throw new y.a("ui-template-extend-children-mismatch",i);let a=0;for(const c of o.children)n(i.children[a++],c)}})(e,Df(Rf(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new y.a("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){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),Rc(this.text)?this._bindToObservable({schema:this.text,updater:Sm(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){let t,n,i,o;if(!this.attributes)return;const a=e.node,c=e.revertData;for(t in this.attributes)if(i=a.getAttribute(t),n=this.attributes[t],c&&(c.attributes[t]=i),o=oe(n[0])&&n[0].ns?n[0].ns:null,Rc(n)){const u=o?n[0].value:n;c&&zf(t)&&u.unshift(i),this._bindToObservable({schema:u,updater:Em(a,t,o),data:e})}else t=="style"&&typeof n[0]!="string"?this._renderStyleAttribute(n[0],e):(c&&i&&zf(t)&&n.unshift(i),n=n.map(u=>u&&u.value||u).reduce((u,h)=>u.concat(h),[]).reduce(Lf,""),ls(n)||a.setAttributeNS(o,t,n))}_renderStyleAttribute(e,t){const n=t.node;for(const i in e){const o=e[i];Rc(o)?this._bindToObservable({schema:[o],updater:Pm(n,i),data:t}):n.style[i]=o}}_renderElementChildren(e){const t=e.node,n=e.intoFragment?document.createDocumentFragment():t,i=e.isApplying;let o=0;for(const a of this.children)if(Mu(a)){if(!i){a.setParent(t);for(const c of a)n.appendChild(c.element)}}else if(jc(a))i||(a.isRendered||a.render(),n.appendChild(a.element));else if(ns(a))n.appendChild(a);else if(i){const c={children:[],bindings:[],attributes:{}};e.revertData.children.push(c),a._renderNode({node:n.childNodes[o++],isApplying:!0,revertData:c})}else n.appendChild(a.render());e.intoFragment&&t.appendChild(n)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const n=this.eventListeners[t].map(i=>{const[o,a]=t.split("@");return i.activateDomEventListener(o,a,e)});e.revertData&&e.revertData.bindings.push(n)}}_bindToObservable({schema:e,updater:t,data:n}){const i=n.revertData;Nf(e,t,n);const o=e.filter(a=>!ls(a)).filter(a=>a.observable).map(a=>a.activateAttributeListener(e,t,n));i&&i.bindings.push(o)}_revertTemplateFromNode(e,t){for(const n of t.bindings)for(const i of n)i();if(t.text)e.textContent=t.text;else{for(const n in t.attributes){const i=t.attributes[n];i===null?e.removeAttribute(n):e.setAttribute(n,i)}for(let n=0;n<t.children.length;++n)this._revertTemplateFromNode(e.childNodes[n],t.children[n])}}}Le(Ni,V);class sl{constructor(e){Object.assign(this,e)}getValue(e){const t=this.observable[this.attribute];return this.callback?this.callback(t,e):t}activateAttributeListener(e,t,n){const i=()=>Nf(e,t,n);return this.emitter.listenTo(this.observable,"change:"+this.attribute,i),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,i)}}}class Am extends sl{activateDomEventListener(e,t,n){const i=(o,a)=>{t&&!a.target.matches(t)||(typeof this.eventNameOrFunction=="function"?this.eventNameOrFunction(a):this.observable.fire(this.eventNameOrFunction,a))};return this.emitter.listenTo(n.node,e,i),()=>{this.emitter.stopListening(n.node,e,i)}}}class Of extends sl{getValue(e){return!ls(super.getValue(e))&&(this.valueIfTrue||!0)}}function Rc(r){return!!r&&(r.value&&(r=r.value),Array.isArray(r)?r.some(Rc):r instanceof sl)}function Nf(r,e,{node:t}){let n=function(i,o){return i.map(a=>a instanceof sl?a.getValue(o):a)}(r,t);n=r.length==1&&r[0]instanceof Of?n[0]:n.reduce(Lf,""),ls(n)?e.remove():e.set(n)}function Sm(r){return{set(e){r.textContent=e},remove(){r.textContent=""}}}function Em(r,e,t){return{set(n){r.setAttributeNS(t,e,n)},remove(){r.removeAttributeNS(t,e)}}}function Pm(r,e){return{set(t){r.style[e]=t},remove(){r.style[e]=null}}}function Rf(r){return Ao(r,e=>{if(e&&(e instanceof sl||Iu(e)||jc(e)||Mu(e)))return e})}function Df(r){if(typeof r=="string"?r=function(e){return{text:[e]}}(r):r.text&&function(e){e.text=xt(e.text)}(r),r.on&&(r.eventListeners=function(e){for(const t in e)jf(e,t);return e}(r.on),delete r.on),!r.text){r.attributes&&function(t){for(const n in t)t[n].value&&(t[n].value=xt(t[n].value)),jf(t,n)}(r.attributes);const e=[];if(r.children)if(Mu(r.children))e.push(r.children);else for(const t of r.children)Iu(t)||jc(t)||ns(t)?e.push(t):e.push(new Ni(t));r.children=e}return r}function jf(r,e){r[e]=xt(r[e])}function Lf(r,e){return ls(e)?r:ls(r)?e:`${r} ${e}`}function Dc(r,e){for(const t in e)r[t]?r[t].push(...e[t]):r[t]=e[t]}function ls(r){return!r&&r!==0}function jc(r){return r instanceof ut}function Iu(r){return r instanceof Ni}function Mu(r){return r instanceof as}function zf(r){return r=="class"||r=="style"}class Im extends as{constructor(e,t=[]){super(t),this.locale=e}attachToDom(){this._bodyCollectionContainer=new Ni({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let e=document.querySelector(".ck-body-wrapper");e||(e=function(t,n,i={},o=[]){const a=i&&i.xmlns,c=a?t.createElementNS(a,n):t.createElement(n);for(const u in i)c.setAttribute(u,i[u]);!eu(o)&&ai(o)||(o=[o]);for(let u of o)eu(u)&&(u=t.createTextNode(u)),c.appendChild(u);return c}(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(e)),e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const e=document.querySelector(".ck-body-wrapper");e&&e.childElementCount==0&&e.remove()}}v(17);class Lc extends ut{constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],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){const e=new DOMParser().parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),t=e.getAttribute("viewBox");for(t&&(this.viewBox=t),this.element.innerHTML="";e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(e=>{e.style.fill=this.fillColor})}}v(19);class Bf extends ut{constructor(e){super(e),this.set("text",""),this.set("position","s");const t=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",t.to("position",n=>"ck-tooltip_"+n),t.if("text","ck-hidden",n=>!n.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:t.to("text")}]}]})}}v(21);class Jt extends ut{constructor(e){super(e);const t=this.bindTemplate,n=P();this.set("class"),this.set("labelStyle"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(n),this.iconView=new Lc,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)),this.setTemplate({tag:"button",attributes:{class:["ck","ck-button",t.to("class"),t.if("isEnabled","ck-disabled",i=>!i),t.if("isVisible","ck-hidden",i=>!i),t.to("isOn",i=>i?"ck-on":"ck-off"),t.if("withText","ck-button_with-text"),t.if("withKeystroke","ck-button_with-keystroke")],type:t.to("type",i=>i||"button"),tabindex:t.to("tabindex"),"aria-labelledby":"ck-editor__aria-label_"+n,"aria-disabled":t.if("isEnabled",!0,i=>!i),"aria-pressed":t.to("isOn",i=>!!this.isToggleable&&String(i))},children:this.children,on:{mousedown:t.to(i=>{i.preventDefault()}),click:t.to(i=>{this.isEnabled?this.fire("execute"):i.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView),this.withKeystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createTooltipView(){const e=new Bf;return e.bind("text").to(this,"_tooltipString"),e.bind("position").to(this,"tooltipPosition"),e}_createLabelView(e){const t=new ut,n=this.bindTemplate;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:n.to("labelStyle"),id:"ck-editor__aria-label_"+e},children:[{text:this.bindTemplate.to("label")}]}),t}_createKeystrokeView(){const e=new ut;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>za(t))}]}),e}_getTooltipString(e,t,n){return e?typeof e=="string"?e:(n&&(n=za(n)),e instanceof Function?e(t,n):`${t}${n?` (${n})`:""}`):""}}v(23);class zc extends Jt{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(){const e=new ut;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}class Us{constructor(e){if(Object.assign(this,e),e.actions&&e.keystrokeHandler)for(const t in e.actions){let n=e.actions[t];typeof n=="string"&&(n=[n]);for(const i of n)e.keystrokeHandler.set(i,(o,a)=>{this[t](),a()})}}get first(){return this.focusables.find(Ws)||null}get last(){return this.focusables.filter(Ws).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;return this.focusTracker.focusedElement===null?null:(this.focusables.find((t,n)=>{const i=t.element===this.focusTracker.focusedElement;return i&&(e=n),i}),e)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){e&&e.focus()}_getFocusableItem(e){const t=this.current,n=this.focusables.length;if(!n)return null;if(t===null)return this[e===1?"first":"last"];let i=(t+n+e)%n;do{const o=this.focusables.get(i);if(Ws(o))return o;i=(i+n+e)%n}while(i!==t);return null}}function Ws(r){return!(!r.focus||$t.window.getComputedStyle(r.element).display=="none")}v(25);var Ff='<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 Vf extends Jt{constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new Lc;return e.content=Ff,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}v(27);class $f extends ut{constructor(e){super(e);const t=this.bindTemplate;this.set("class"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(),this.arrowView=this._createArrowView(),this.keystrokes=new Ei,this.focusTracker=new $i,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",t.to("class"),t.if("isVisible","ck-hidden",n=>!n),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())})}focus(){this.actionView.focus()}_createActionView(){const e=new Jt;return e.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),e.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),e.delegate("execute").to(this),e}_createArrowView(){const e=new Jt,t=e.bindTemplate;return e.icon=Ff,e.extendTemplate({attributes:{class:"ck-splitbutton__arrow","aria-haspopup":!0,"aria-expanded":t.to("isOn",n=>String(n))}}),e.bind("isEnabled").to(this),e.delegate("execute").to(this,"open"),e}}class Mm extends ut{constructor(e){super(e);const 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",n=>"ck-dropdown__panel_"+n),t.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:t.to(n=>n.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const e=this.children.last;typeof e.focusLast=="function"?e.focusLast():e.focus()}}}v(29);function Hf({element:r,target:e,positions:t,limiter:n,fitInViewport:i}){Pe(e)&&(e=e()),Pe(n)&&(n=n());const o=function(k){return k&&k.parentNode?k.offsetParent===$t.document.body?null:k.offsetParent:null}(r),a=new yt(r),c=new yt(e);let u,h;n||i?[h,u]=function(C,S){const{elementRect:N,viewportRect:D}=S,z=N.getArea(),U=function(J,{targetRect:ce,elementRect:ye,limiterRect:ze,viewportRect:Kt}){const vt=[],Kn=ye.getArea();for(const ri of J){const Gn=Ou(ri,ce,ye);if(!Gn)continue;const[Wi,mi]=Gn;let Li=0,ps=0;if(ze)if(Kt){const ch=ze.getIntersection(Kt);ch&&(Li=ch.getIntersectionArea(mi))}else Li=ze.getIntersectionArea(mi);Kt&&(ps=Kt.getIntersectionArea(mi));const lh={positionName:Wi,positionRect:mi,limiterIntersectArea:Li,viewportIntersectArea:ps};if(Li===Kn)return[lh];vt.push(lh)}return vt}(C,S);if(D){const J=Uf(U.filter(({viewportIntersectArea:ce})=>ce===z),z);if(J)return J}return Uf(U,z)}(t,{targetRect:c,elementRect:a,limiterRect:n&&new yt(n).getVisible(),viewportRect:i&&new yt($t.window)})||Ou(t[0],c,a):[h,u]=Ou(t[0],c,a);let m=Wf(u);return o&&(m=function({left:k,top:C},S){const N=Wf(new yt(S)),D=tu(S);return k-=N.left,C-=N.top,k+=S.scrollLeft,C+=S.scrollTop,k-=D.left,C-=D.top,{left:k,top:C}}(m,o)),{left:m.left,top:m.top,name:h}}function Ou(r,e,t){const n=r(e,t);if(!n)return null;const{left:i,top:o,name:a}=n;return[a,t.clone().moveTo(i,o)]}function Uf(r,e){let t,n,i=0;for(const{positionName:o,positionRect:a,limiterIntersectArea:c,viewportIntersectArea:u}of r){if(c===e)return[o,a];const h=u**2+c**2;h>i&&(i=h,t=a,n=o)}return t?[n,t]:null}function Wf({left:r,top:e}){const{scrollX:t,scrollY:n}=$t.window;return{left:r+t,top:e+n}}class qs extends ut{constructor(e,t,n){super(e);const i=this.bindTemplate;this.buttonView=t,this.panelView=n,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class"),this.set("id"),this.set("panelPosition","auto"),this.keystrokes=new Ei,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",i.to("class"),i.if("isEnabled","ck-disabled",o=>!o)],id:i.to("id"),"aria-describedby":i.to("ariaDescribedById")},children:[t,n]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",()=>{this.isOpen&&(this.panelPosition==="auto"?this.panelView.position=qs._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)}),this.keystrokes.listenTo(this.element);const e=(t,n)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,n())};this.keystrokes.set("arrowdown",(t,n)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,n())}),this.keystrokes.set("arrowright",(t,n)=>{this.isOpen&&n()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:e,north:t,southEast:n,southWest:i,northEast:o,northWest:a,southMiddleEast:c,southMiddleWest:u,northMiddleEast:h,northMiddleWest:m}=qs.defaultPanelPositions;return this.locale.uiLanguageDirection!=="rtl"?[n,i,c,u,e,o,a,h,m,t]:[i,n,u,c,e,a,o,m,h,t]}}qs.defaultPanelPositions={south:(r,e)=>({top:r.bottom,left:r.left-(e.width-r.width)/2,name:"s"}),southEast:r=>({top:r.bottom,left:r.left,name:"se"}),southWest:(r,e)=>({top:r.bottom,left:r.left-e.width+r.width,name:"sw"}),southMiddleEast:(r,e)=>({top:r.bottom,left:r.left-(e.width-r.width)/4,name:"sme"}),southMiddleWest:(r,e)=>({top:r.bottom,left:r.left-3*(e.width-r.width)/4,name:"smw"}),north:(r,e)=>({top:r.top-e.height,left:r.left-(e.width-r.width)/2,name:"n"}),northEast:(r,e)=>({top:r.top-e.height,left:r.left,name:"ne"}),northWest:(r,e)=>({top:r.top-e.height,left:r.left-e.width+r.width,name:"nw"}),northMiddleEast:(r,e)=>({top:r.top-e.height,left:r.left-(e.width-r.width)/4,name:"nme"}),northMiddleWest:(r,e)=>({top:r.top-e.height,left:r.left-3*(e.width-r.width)/4,name:"nmw"})},qs._getOptimalPosition=Hf;class qf extends ut{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class Om extends ut{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function Kf(r){return Array.isArray(r)?{items:r,removeItems:[]}:r?Object.assign({items:[],removeItems:[]},r):{items:[],removeItems:[]}}v(31);class Nu extends ut{constructor(e,t){super(e);const n=this.bindTemplate,i=this.t;this.options=t||{},this.set("ariaLabel",i("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new $i,this.keystrokes=new Ei,this.set("class"),this.set("isCompact",!1),this.itemsView=new Nm(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const o=e.uiLanguageDirection==="rtl";this._focusCycler=new Us({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[o?"arrowright":"arrowleft","arrowup"],focusNext:[o?"arrowleft":"arrowright","arrowdown"]}});const a=["ck","ck-toolbar",n.to("class"),n.if("isCompact","ck-toolbar_compact")];var c;this.options.shouldGroupWhenFull&&this.options.isFloating&&a.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:a,role:"toolbar","aria-label":n.to("ariaLabel"),style:{maxWidth:n.to("maxWidth")}},children:this.children,on:{mousedown:(c=this,c.bindTemplate.to(u=>{u.target===c.element&&u.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new Dm(this):new Rm(this)}render(){super.render();for(const e of 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),this._behavior.render(this)}destroy(){return this._behavior.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t){const n=Kf(e),i=n.items.filter((a,c,u)=>a==="|"||n.removeItems.indexOf(a)===-1&&(a==="-"?!this.options.shouldGroupWhenFull||(Object(y.b)("toolbarview-line-break-ignored-when-grouping-items",u),!1):!!t.has(a)||(Object(y.b)("toolbarview-item-unavailable",{name:a}),!1))),o=this._cleanSeparators(i).map(a=>a==="|"?new qf:a==="-"?new Om:t.create(a));this.items.addMany(o)}_cleanSeparators(e){const t=a=>a!=="-"&&a!=="|",n=e.length,i=e.findIndex(t),o=n-e.slice().reverse().findIndex(t);return e.slice(i,o).filter((a,c,u)=>t(a)?!0:!(c>0&&u[c-1]===a))}}class Nm extends ut{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Rm{constructor(e){const t=e.bindTemplate;e.set("isVertical",!1),e.itemsView.children.bindTo(e.items).using(n=>n),e.focusables.bindTo(e.items).using(n=>n),e.extendTemplate({attributes:{class:[t.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class Dm{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(),this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,e.itemsView.children.bindTo(this.ungroupedItems).using(t=>t),this.ungroupedItems.on("add",this._updateFocusCycleableItems.bind(this)),this.ungroupedItems.on("remove",this._updateFocusCycleableItems.bind(this)),e.children.on("add",this._updateFocusCycleableItems.bind(this)),e.children.on("remove",this._updateFocusCycleableItems.bind(this)),e.items.on("change",(t,n)=>{const i=n.index;for(const o of n.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(o):this.ungroupedItems.remove(o);for(let o=i;o<i+n.added.length;o++){const a=n.added[o-i];o>this.ungroupedItems.length?this.groupedItems.add(a,o-this.ungroupedItems.length):this.ungroupedItems.add(a,o)}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(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!this.viewElement.offsetParent)return void(this.shouldUpdateGroupingOnNextResize=!0);const e=this.groupedItems.length;let t;for(;this._areItemsOverflowing;)this._groupLastItem(),t=!0;if(!t&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==e&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const e=this.viewElement,t=this.viewLocale.uiLanguageDirection,n=new yt(e.lastChild),i=new yt(e);if(!this.cachedPadding){const o=$t.window.getComputedStyle(e),a=t==="ltr"?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(o[a])}return t==="ltr"?n.right>i.right-this.cachedPadding:n.left<i.left+this.cachedPadding}_enableGroupingOnResize(){let e;this.resizeObserver=new Xt(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 qf),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(){const e=this.viewLocale,t=e.t,n=cs(e);return n.class="ck-toolbar__grouped-dropdown",n.panelPosition=e.uiLanguageDirection==="ltr"?"sw":"se",Yf(n,[]),n.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:e.uiLanguageDirection==="rtl"?"se":"sw",icon:Oi.threeVerticalDots}),n.toolbarView.items.bindTo(this.groupedItems).using(i=>i),n}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}v(33);class Gf extends ut{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new $i,this.keystrokes=new Ei,this._focusCycler=new Us({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"]},children:this.items})}render(){super.render();for(const e of 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)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class Qf extends ut{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}}class jm extends ut{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}v(35),v(37);function cs(r,e=Vf){const t=new e(r),n=new Mm(r),i=new qs(r,t,n);return t.bind("isEnabled").to(i),t instanceof Vf?t.bind("isOn").to(i,"isOpen"):t.arrowView.bind("isOn").to(i,"isOpen"),function(o){(function(a){a.on("render",()=>{Su({emitter:a,activator:()=>a.isOpen,callback:()=>{a.isOpen=!1},contextElements:[a.element]})})})(o),function(a){a.on("execute",c=>{c.source instanceof zc||(a.isOpen=!1)})}(o),function(a){a.keystrokes.set("arrowdown",(c,u)=>{a.isOpen&&(a.panelView.focus(),u())}),a.keystrokes.set("arrowup",(c,u)=>{a.isOpen&&(a.panelView.focusLast(),u())})}(o)}(i),i}function Yf(r,e){const t=r.locale,n=t.t,i=r.toolbarView=new Nu(t);i.set("ariaLabel",n("Dropdown toolbar")),r.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.map(o=>i.items.add(o)),r.panelView.children.add(i),i.items.delegate("execute").to(r)}function Xf(r,e){const t=r.locale,n=r.listView=new Gf(t);n.items.bindTo(e).using(({type:i,model:o})=>{if(i==="separator")return new jm(t);if(i==="button"||i==="switchbutton"){const a=new Qf(t);let c;return c=i==="button"?new Jt(t):new zc(t),c.bind(...Object.keys(o)).to(o),c.delegate("execute").to(a),a.children.add(c),a}}),r.panelView.children.add(n),n.items.delegate("execute").to(r)}v(39);class Bc extends ut{constructor(e){super(e),this.body=new Im(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}v(41);class Jf extends ut{constructor(e){super(e),this.set("text"),this.set("for"),this.id="ck-editor__label_"+P();const 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 Lm extends Bc{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(){const e=this.t,t=new Jf;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class zm extends ut{constructor(e,t,n){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=n,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()}_updateIsFocusedClasses(){const e=this._editingView;function t(n){e.change(i=>{const o=e.document.getRoot(n.name);i.addClass(n.isFocused?"ck-focused":"ck-blurred",o),i.removeClass(n.isFocused?"ck-blurred":"ck-focused",o)})}e.isRenderingInProgress?function n(i){e.once("change:isRenderingInProgress",(o,a,c)=>{c?n(i):t(i)})}(this):t(this)}}class Bm extends zm{constructor(e,t,n){super(e,t,n),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView,t=this.t;e.change(n=>{const i=e.document.getRoot(this.name);n.setAttribute("aria-label",t("Rich Text Editor, %0",this.name),i)})}}v(43),v(45);class Fm extends ut{constructor(e){super(e),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById"),this.focusTracker=new $i,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{type:"text",class:["ck","ck-input","ck-input-text",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"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById")},on:{input:t.to("input"),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,n)=>{this._setDomElementValue(n),this._updateIsEmpty()})}select(){this.element.select()}focus(){this.element.focus()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(e){this.element.value=e||e===0?e:""}}v(47);class Ru extends ut{constructor(e,t){super(e);const n="ck-labeled-field-view-"+P(),i="ck-labeled-field-view-status-"+P();this.fieldView=t(this,n,i),this.set("label"),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class"),this.set("placeholder"),this.labelView=this._createLabelView(n),this.statusView=this._createStatusView(i),this.bind("_statusText").to(this,"errorText",this,"infoText",(a,c)=>a||c);const o=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",o.to("class"),o.if("isEnabled","ck-disabled",a=>!a),o.if("isEmpty","ck-labeled-field-view_empty"),o.if("isFocused","ck-labeled-field-view_focused"),o.if("placeholder","ck-labeled-field-view_placeholder"),o.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:[this.fieldView,this.labelView]},this.statusView]})}_createLabelView(e){const t=new Jf(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new ut(this.locale),n=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",n.if("errorText","ck-labeled-field-view__status_error"),n.if("_statusText","ck-hidden",i=>!i)],id:e,role:n.if("errorText","alert")},children:[{text:n.to("_statusText")}]}),t}focus(){this.fieldView.focus()}}function Du(r,e,t){const n=new Fm(r.locale);return n.set({id:e,ariaDescribedById:t}),n.bind("isReadOnly").to(r,"isEnabled",i=>!i),n.bind("hasError").to(r,"errorText",i=>!!i),n.on("input",()=>{r.errorText=null}),r.bind("isEmpty","isFocused","placeholder").to(n),n}class ju extends vr{static get pluginName(){return"Notification"}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){const t="show:"+e.type+(e.namespace?":"+e.namespace:"");this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class Lu{constructor(e,t){t&&mo(this,t),e&&this.set(e)}}Le(Lu,Wt),v(49);const Zf=st("px"),ep=$t.document.body;class at extends ut{constructor(e){super(e);const 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"),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",n=>"ck-balloon-panel_"+n),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",Zf),left:t.to("left",Zf)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){this.show();const t=at.defaultPositions,n=Object.assign({},{element:this.element,positions:[t.southArrowNorth,t.southArrowNorthMiddleWest,t.southArrowNorthMiddleEast,t.southArrowNorthWest,t.southArrowNorthEast,t.northArrowSouth,t.northArrowSouthMiddleWest,t.northArrowSouthMiddleEast,t.northArrowSouthWest,t.northArrowSouthEast],limiter:ep,fitInViewport:!0},e),i=at._getOptimalPosition(n),o=parseInt(i.left),a=parseInt(i.top),c=i.name;Object.assign(this,{top:a,left:o,position:c})}pin(e){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this._startPinning(e),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){this.attachTo(e);const t=zu(e.target),n=e.limiter?zu(e.limiter):ep;this.listenTo($t.document,"scroll",(i,o)=>{const a=o.target,c=t&&a.contains(t),u=n&&a.contains(n);!c&&!u&&t&&n||this.attachTo(e)},{useCapture:!0}),this.listenTo($t.window,"resize",()=>{this.attachTo(e)})}_stopPinning(){this.stopListening($t.document,"scroll"),this.stopListening($t.window,"resize")}}function zu(r){return Ji(r)?r:fc(r)?r.commonAncestorContainer:typeof r=="function"?zu(r()):null}function Un(r,e){return r.top-e.height-at.arrowVerticalOffset}function Wn(r){return r.bottom+at.arrowVerticalOffset}at.arrowHorizontalOffset=25,at.arrowVerticalOffset=10,at._getOptimalPosition=Hf,at.defaultPositions={northWestArrowSouthWest:(r,e)=>({top:Un(r,e),left:r.left-at.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthMiddleWest:(r,e)=>({top:Un(r,e),left:r.left-.25*e.width-at.arrowHorizontalOffset,name:"arrow_smw"}),northWestArrowSouth:(r,e)=>({top:Un(r,e),left:r.left-e.width/2,name:"arrow_s"}),northWestArrowSouthMiddleEast:(r,e)=>({top:Un(r,e),left:r.left-.75*e.width+at.arrowHorizontalOffset,name:"arrow_sme"}),northWestArrowSouthEast:(r,e)=>({top:Un(r,e),left:r.left-e.width+at.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(r,e)=>({top:Un(r,e),left:r.left+r.width/2-at.arrowHorizontalOffset,name:"arrow_sw"}),northArrowSouthMiddleWest:(r,e)=>({top:Un(r,e),left:r.left+r.width/2-.25*e.width-at.arrowHorizontalOffset,name:"arrow_smw"}),northArrowSouth:(r,e)=>({top:Un(r,e),left:r.left+r.width/2-e.width/2,name:"arrow_s"}),northArrowSouthMiddleEast:(r,e)=>({top:Un(r,e),left:r.left+r.width/2-.75*e.width+at.arrowHorizontalOffset,name:"arrow_sme"}),northArrowSouthEast:(r,e)=>({top:Un(r,e),left:r.left+r.width/2-e.width+at.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(r,e)=>({top:Un(r,e),left:r.right-at.arrowHorizontalOffset,name:"arrow_sw"}),northEastArrowSouthMiddleWest:(r,e)=>({top:Un(r,e),left:r.right-.25*e.width-at.arrowHorizontalOffset,name:"arrow_smw"}),northEastArrowSouth:(r,e)=>({top:Un(r,e),left:r.right-e.width/2,name:"arrow_s"}),northEastArrowSouthMiddleEast:(r,e)=>({top:Un(r,e),left:r.right-.75*e.width+at.arrowHorizontalOffset,name:"arrow_sme"}),northEastArrowSouthEast:(r,e)=>({top:Un(r,e),left:r.right-e.width+at.arrowHorizontalOffset,name:"arrow_se"}),southWestArrowNorthWest:(r,e)=>({top:Wn(r),left:r.left-at.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthMiddleWest:(r,e)=>({top:Wn(r),left:r.left-.25*e.width-at.arrowHorizontalOffset,name:"arrow_nmw"}),southWestArrowNorth:(r,e)=>({top:Wn(r),left:r.left-e.width/2,name:"arrow_n"}),southWestArrowNorthMiddleEast:(r,e)=>({top:Wn(r),left:r.left-.75*e.width+at.arrowHorizontalOffset,name:"arrow_nme"}),southWestArrowNorthEast:(r,e)=>({top:Wn(r),left:r.left-e.width+at.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(r,e)=>({top:Wn(r),left:r.left+r.width/2-at.arrowHorizontalOffset,name:"arrow_nw"}),southArrowNorthMiddleWest:(r,e)=>({top:Wn(r),left:r.left+r.width/2-.25*e.width-at.arrowHorizontalOffset,name:"arrow_nmw"}),southArrowNorth:(r,e)=>({top:Wn(r),left:r.left+r.width/2-e.width/2,name:"arrow_n"}),southArrowNorthMiddleEast:(r,e)=>({top:Wn(r),left:r.left+r.width/2-.75*e.width+at.arrowHorizontalOffset,name:"arrow_nme"}),southArrowNorthEast:(r,e)=>({top:Wn(r),left:r.left+r.width/2-e.width+at.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(r,e)=>({top:Wn(r),left:r.right-at.arrowHorizontalOffset,name:"arrow_nw"}),southEastArrowNorthMiddleWest:(r,e)=>({top:Wn(r),left:r.right-.25*e.width-at.arrowHorizontalOffset,name:"arrow_nmw"}),southEastArrowNorth:(r,e)=>({top:Wn(r),left:r.right-e.width/2,name:"arrow_n"}),southEastArrowNorthMiddleEast:(r,e)=>({top:Wn(r),left:r.right-.75*e.width+at.arrowHorizontalOffset,name:"arrow_nme"}),southEastArrowNorthEast:(r,e)=>({top:Wn(r),left:r.right-e.width+at.arrowHorizontalOffset,name:"arrow_ne"})},v(51),v(53);const Ks=st("px");class al extends me{static get pluginName(){return"ContextualBalloon"}constructor(e){super(e),this.positionLimiter=()=>{const t=this.editor.editing.view,n=t.document.selection.editableElement;return n?t.domConverter.mapViewToDom(n.root):null},this.set("visibleView",null),this.view=new at(e.locale),e.ui.view.body.add(this.view),e.ui.focusTracker.add(this.view.element),this._viewToStack=new Map,this._idToStack=new Map,this.set("_numberOfStacks",0),this.set("_singleViewMode",!1),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this.hasView(e.view))throw new y.a("contextualballoon-add-view-exist",[this,e]);const t=e.stackId||"main";if(!this._idToStack.has(t))return this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!e.singleViewMode||this.showStack(t));const n=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),n.set(e.view,e),this._viewToStack.set(e.view,n),n===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new y.a("contextualballoon-remove-view-not-exist",[this,e]);const t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(t.size===1?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),t.size===1?(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._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t)throw new y.a("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(t=>t[1]===e)[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new tp(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(n,i)=>!i&&n>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(n,i)=>{if(i<2)return"";const o=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[o,i])}),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(){const e=new np(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,n)=>!n&&t>=2?Math.min(t-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:n=!0,singleViewMode:i=!1}){this.view.class=t,this.view.withArrow=n,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),i&&(this._singleViewMode=!0)}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&!e.limiter&&(e=Object.assign({},e,{limiter:this.positionLimiter})),e}}class tp extends ut{constructor(e){super(e);const t=e.t,n=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new $i,this.buttonPrevView=this._createButtonView(t("Previous"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z"/></svg>'),this.buttonNextView=this._createButtonView(t("Next"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.537 14.813a.888.888 0 1 1-1.254-1.255L10.84 10 7.283 6.442a.888.888 0 1 1 1.254-1.255L12.74 9.39a.888.888 0 0 1-.16 1.382l-4.043 4.042z"/></svg>'),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",n.to("isNavigationVisible",i=>i?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:n.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const n=new Jt(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n}}class np extends ut{constructor(e,t){super(e);const n=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",n.to("numberOfPanels",i=>i?"":"ck-hidden")],style:{top:n.to("top",Ks),left:n.to("left",Ks),width:n.to("width",Ks),height:n.to("height",Ks)}},children:this.content}),this.on("change:numberOfPanels",(i,o,a,c)=>{a>c?this._addPanels(a-c):this._removePanels(c-a),this.updatePosition()})}_addPanels(e){for(;e--;){const t=new ut;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(e){for(;e--;){const t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView,{width:n,height:i}=new yt(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:n,height:i})}}}v(55);const Gs=st("px");class Vm extends ut{constructor(e){super(e);const 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("_isStickyToTheLimiter",!1),this.set("_hasViewportTopOffset",!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new Ni({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",n=>n?"block":"none"),height:t.to("isSticky",n=>n?Gs(this._panelRect.height):null)}}}).render(),this._contentPanel=new Ni({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",t.if("isSticky","ck-sticky-panel__content_sticky"),t.if("_isStickyToTheLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:t.to("isSticky",n=>n?Gs(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_hasViewportTopOffset",n=>n?Gs(this.viewportTopOffset):null),bottom:t.to("_isStickyToTheLimiter",n=>n?Gs(this.limiterBottomOffset):null),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this._contentPanel]})}render(){super.render(),this._checkIfShouldBeSticky(),this.listenTo($t.window,"scroll",()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const e=this._panelRect=this._contentPanel.getBoundingClientRect();let t;this.limiterElement?(t=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&t.top<this.viewportTopOffset&&this._panelRect.height+this.limiterBottomOffset<t.height):this.isSticky=!1,this.isSticky?(this._isStickyToTheLimiter=t.bottom<e.height+this.limiterBottomOffset+this.viewportTopOffset,this._hasViewportTopOffset=!this._isStickyToTheLimiter&&!!this.viewportTopOffset,this._marginLeft=this._isStickyToTheLimiter?null:Gs(-$t.window.scrollX)):(this._isStickyToTheLimiter=!1,this._hasViewportTopOffset=!1,this._marginLeft=null)}}v(57),v(59);const Fc=new WeakMap;function ip(r){const{view:e,element:t,text:n,isDirectHost:i=!0,keepOnFocus:o=!1}=r,a=e.document;Fc.has(a)||(Fc.set(a,new Map),a.registerPostFixer(c=>ll(a,c))),Fc.get(a).set(t,{text:n,isDirectHost:i,keepOnFocus:o,hostElement:i?t:null}),e.change(c=>ll(a,c))}function Vc(r,e){return!!e.hasClass("ck-placeholder")&&(r.removeClass("ck-placeholder",e),!0)}function ll(r,e){const t=Fc.get(r),n=[];let i=!1;for(const[o,a]of t)a.isDirectHost&&(n.push(o),rp(e,o,a)&&(i=!0));for(const[o,a]of t){if(a.isDirectHost)continue;const c=$m(o);c&&(n.includes(c)||(a.hostElement=c,rp(e,o,a)&&(i=!0)))}return i}function rp(r,e,t){const{text:n,isDirectHost:i,hostElement:o}=t;let a=!1;return o.getAttribute("data-placeholder")!==n&&(r.setAttribute("data-placeholder",n,o),a=!0),(i||e.childCount==1)&&function(c,u){if(!c.isAttached()||Array.from(c.getChildren()).some(k=>!k.is("uiElement")))return!1;if(u)return!0;const h=c.document;if(!h.isFocused)return!0;const m=h.selection.anchor;return m&&m.parent!==c}(o,t.keepOnFocus)?function(c,u){return!u.hasClass("ck-placeholder")&&(c.addClass("ck-placeholder",u),!0)}(r,o)&&(a=!0):Vc(r,o)&&(a=!0),a}function $m(r){if(r.childCount){const e=r.getChild(0);if(e.is("element")&&!e.is("uiElement"))return e}return null}const cl=new Map;function wt(r,e,t){let n=cl.get(r);n||(n=new Map,cl.set(r,n)),n.set(e,t)}function Hm(r){return[r]}function op(r,e,t={}){const n=function(i,o){const a=cl.get(i);return a&&a.has(o)?a.get(o):Hm}(r.constructor,e.constructor);try{return n(r=r.clone(),e,t)}catch(i){throw i}}function Um(r,e,t){r=r.slice(),e=e.slice();const n=new Wm(t.document,t.useRelations,t.forceWeakRemove);n.setOriginalOperations(r),n.setOriginalOperations(e);const i=n.originalOperations;if(r.length==0||e.length==0)return{operationsA:r,operationsB:e,originalOperations:i};const o=new WeakMap;for(const u of r)o.set(u,0);const a={nextBaseVersionA:r[r.length-1].baseVersion+1,nextBaseVersionB:e[e.length-1].baseVersion+1,originalOperationsACount:r.length,originalOperationsBCount:e.length};let c=0;for(;c<r.length;){const u=r[c],h=o.get(u);if(h==e.length){c++;continue}const m=e[h],k=op(u,m,n.getContext(u,m,!0)),C=op(m,u,n.getContext(m,u,!1));n.updateRelation(u,m),n.setOriginalOperations(k,u),n.setOriginalOperations(C,m);for(const S of k)o.set(S,h+C.length);r.splice(c,1,...k),e.splice(h,1,...C)}if(t.padWithNoOps){const u=r.length-a.originalOperationsACount,h=e.length-a.originalOperationsBCount;ap(r,h-u),ap(e,u-h)}return sp(r,a.nextBaseVersionB),sp(e,a.nextBaseVersionA),{operationsA:r,operationsB:e,originalOperations:i}}class Wm{constructor(e,t,n=!1){this.originalOperations=new Map,this._history=e.history,this._useRelations=t,this._forceWeakRemove=!!n,this._relations=new Map}setOriginalOperations(e,t=null){const n=t?this.originalOperations.get(t):null;for(const i of e)this.originalOperations.set(i,n||i)}updateRelation(e,t){switch(e.constructor){case zt:switch(t.constructor){case pn:e.targetPosition.isEqual(t.sourcePosition)||t.movedRange.containsPosition(e.targetPosition)?this._setRelation(e,t,"insertAtSource"):e.targetPosition.isEqual(t.deletionPosition)?this._setRelation(e,t,"insertBetween"):e.targetPosition.isAfter(t.sourcePosition)&&this._setRelation(e,t,"moveTargetAfter");break;case zt:e.targetPosition.isEqual(t.sourcePosition)||e.targetPosition.isBefore(t.sourcePosition)?this._setRelation(e,t,"insertBefore"):this._setRelation(e,t,"insertAfter")}break;case Ht:switch(t.constructor){case pn:e.splitPosition.isBefore(t.sourcePosition)&&this._setRelation(e,t,"splitBefore");break;case zt:if(e.splitPosition.isEqual(t.sourcePosition)||e.splitPosition.isBefore(t.sourcePosition))this._setRelation(e,t,"splitBefore");else{const n=se._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.splitPosition)){const i=n.end.offset-e.splitPosition.offset,o=e.splitPosition.offset-n.start.offset;this._setRelation(e,t,{howMany:i,offset:o})}}}break;case pn:switch(t.constructor){case pn:e.targetPosition.isEqual(t.sourcePosition)||this._setRelation(e,t,"mergeTargetNotMoved"),e.sourcePosition.isEqual(t.targetPosition)&&this._setRelation(e,t,"mergeSourceNotMoved"),e.sourcePosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeSameElement");break;case Ht:e.sourcePosition.isEqual(t.splitPosition)&&this._setRelation(e,t,"splitAtSource")}break;case pi:{const n=e.newRange;if(!n)return;switch(t.constructor){case zt:{const i=se._createFromPositionAndShift(t.sourcePosition,t.howMany),o=i.containsPosition(n.start)||i.start.isEqual(n.start),a=i.containsPosition(n.end)||i.end.isEqual(n.end);!o&&!a||i.containsRange(n)||this._setRelation(e,t,{side:o?"left":"right",path:o?n.start.path.slice():n.end.path.slice()});break}case pn:{const i=n.start.isEqual(t.targetPosition),o=n.start.isEqual(t.deletionPosition),a=n.end.isEqual(t.deletionPosition),c=n.end.isEqual(t.sourcePosition);(i||o||a||c)&&this._setRelation(e,t,{wasInLeftElement:i,wasStartBeforeMergedElement:o,wasEndBeforeMergedElement:a,wasInRightElement:c});break}}break}}}getContext(e,t,n){return{aIsStrong:n,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(t),abRelation:this._useRelations?this._getRelation(e,t):null,baRelation:this._useRelations?this._getRelation(t,e):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(e){const t=this.originalOperations.get(e);return t.wasUndone||this._history.isUndoneOperation(t)}_getRelation(e,t){const n=this.originalOperations.get(t),i=this._history.getUndoneOperation(n);if(!i)return null;const o=this.originalOperations.get(e),a=this._relations.get(o);return a&&a.get(i)||null}_setRelation(e,t,n){const i=this.originalOperations.get(e),o=this.originalOperations.get(t);let a=this._relations.get(i);a||(a=new Map,this._relations.set(i,a)),a.set(o,n)}}function sp(r,e){for(const t of r)t.baseVersion=e++}function ap(r,e){for(let t=0;t<e;t++)r.push(new An(0))}function lp(r,e,t){const n=r.nodes.getNode(0).getAttribute(e);if(n==t)return null;const i=new se(r.position,r.position.getShiftedBy(r.howMany));return new on(i,e,n,t,0)}function cp(r,e){return r.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany)===null}function Qs(r,e){const t=[];for(let n=0;n<r.length;n++){const i=r[n],o=new zt(i.start,i.end.offset-i.start.offset,e,0);t.push(o);for(let a=n+1;a<r.length;a++)r[a]=r[a]._getTransformedByMove(o.sourcePosition,o.targetPosition,o.howMany)[0];e=e._getTransformedByMove(o.sourcePosition,o.targetPosition,o.howMany)}return t}wt(on,on,(r,e,t)=>{if(r.key===e.key&&r.range.start.hasSameParentAs(e.range.start)){const n=r.range.getDifference(e.range).map(o=>new on(o,r.key,r.oldValue,r.newValue,0)),i=r.range.getIntersection(e.range);return i&&t.aIsStrong&&n.push(new on(i,e.key,e.newValue,r.newValue,0)),n.length==0?[new An(0)]:n}return[r]}),wt(on,Tn,(r,e)=>{if(r.range.start.hasSameParentAs(e.position)&&r.range.containsPosition(e.position)){const t=r.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes).map(n=>new on(n,r.key,r.oldValue,r.newValue,r.baseVersion));if(e.shouldReceiveAttributes){const n=lp(e,r.key,r.oldValue);n&&t.unshift(n)}return t}return r.range=r.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[r]}),wt(on,pn,(r,e)=>{const t=[];r.range.start.hasSameParentAs(e.deletionPosition)&&(r.range.containsPosition(e.deletionPosition)||r.range.start.isEqual(e.deletionPosition))&&t.push(se._createFromPositionAndShift(e.graveyardPosition,1));const n=r.range._getTransformedByMergeOperation(e);return n.isCollapsed||t.push(n),t.map(i=>new on(i,r.key,r.oldValue,r.newValue,r.baseVersion))}),wt(on,zt,(r,e)=>function(t,n){const i=se._createFromPositionAndShift(n.sourcePosition,n.howMany);let o=null,a=[];i.containsRange(t,!0)?o=t:t.start.hasSameParentAs(i.start)?(a=t.getDifference(i),o=t.getIntersection(i)):a=[t];const c=[];for(let u of a){u=u._getTransformedByDeletion(n.sourcePosition,n.howMany);const h=n.getMovedRangeStart(),m=u.start.hasSameParentAs(h);u=u._getTransformedByInsertion(h,n.howMany,m),c.push(...u)}return o&&c.push(o._getTransformedByMove(n.sourcePosition,n.targetPosition,n.howMany,!1)[0]),c}(r.range,e).map(t=>new on(t,r.key,r.oldValue,r.newValue,r.baseVersion))),wt(on,Ht,(r,e)=>{if(r.range.end.isEqual(e.insertionPosition))return e.graveyardPosition||r.range.end.offset++,[r];if(r.range.start.hasSameParentAs(e.splitPosition)&&r.range.containsPosition(e.splitPosition)){const t=r.clone();return t.range=new se(e.moveTargetPosition.clone(),r.range.end._getCombined(e.splitPosition,e.moveTargetPosition)),r.range.end=e.splitPosition.clone(),r.range.end.stickiness="toPrevious",[r,t]}return r.range=r.range._getTransformedBySplitOperation(e),[r]}),wt(Tn,on,(r,e)=>{const t=[r];if(r.shouldReceiveAttributes&&r.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(r.position)){const n=lp(r,e.key,e.newValue);n&&t.push(n)}return t}),wt(Tn,Tn,(r,e,t)=>(r.position.isEqual(e.position)&&t.aIsStrong||(r.position=r.position._getTransformedByInsertOperation(e)),[r])),wt(Tn,zt,(r,e)=>(r.position=r.position._getTransformedByMoveOperation(e),[r])),wt(Tn,Ht,(r,e)=>(r.position=r.position._getTransformedBySplitOperation(e),[r])),wt(Tn,pn,(r,e)=>(r.position=r.position._getTransformedByMergeOperation(e),[r])),wt(pi,Tn,(r,e)=>(r.oldRange&&(r.oldRange=r.oldRange._getTransformedByInsertOperation(e)[0]),r.newRange&&(r.newRange=r.newRange._getTransformedByInsertOperation(e)[0]),[r])),wt(pi,pi,(r,e,t)=>{if(r.name==e.name){if(!t.aIsStrong)return[new An(0)];r.oldRange=e.newRange?e.newRange.clone():null}return[r]}),wt(pi,pn,(r,e)=>(r.oldRange&&(r.oldRange=r.oldRange._getTransformedByMergeOperation(e)),r.newRange&&(r.newRange=r.newRange._getTransformedByMergeOperation(e)),[r])),wt(pi,zt,(r,e,t)=>{if(r.oldRange&&(r.oldRange=se._createFromRanges(r.oldRange._getTransformedByMoveOperation(e))),r.newRange){if(t.abRelation){const n=se._createFromRanges(r.newRange._getTransformedByMoveOperation(e));if(t.abRelation.side=="left"&&e.targetPosition.isEqual(r.newRange.start))return r.newRange.start.path=t.abRelation.path,r.newRange.end=n.end,[r];if(t.abRelation.side=="right"&&e.targetPosition.isEqual(r.newRange.end))return r.newRange.start=n.start,r.newRange.end.path=t.abRelation.path,[r]}r.newRange=se._createFromRanges(r.newRange._getTransformedByMoveOperation(e))}return[r]}),wt(pi,Ht,(r,e,t)=>{if(r.oldRange&&(r.oldRange=r.oldRange._getTransformedBySplitOperation(e)),r.newRange){if(t.abRelation){const n=r.newRange._getTransformedBySplitOperation(e);return r.newRange.start.isEqual(e.splitPosition)&&t.abRelation.wasStartBeforeMergedElement?r.newRange.start=he._createAt(e.insertionPosition):r.newRange.start.isEqual(e.splitPosition)&&!t.abRelation.wasInLeftElement&&(r.newRange.start=he._createAt(e.moveTargetPosition)),r.newRange.end.isEqual(e.splitPosition)&&t.abRelation.wasInRightElement?r.newRange.end=he._createAt(e.moveTargetPosition):r.newRange.end.isEqual(e.splitPosition)&&t.abRelation.wasEndBeforeMergedElement?r.newRange.end=he._createAt(e.insertionPosition):r.newRange.end=n.end,[r]}r.newRange=r.newRange._getTransformedBySplitOperation(e)}return[r]}),wt(pn,Tn,(r,e)=>(r.sourcePosition.hasSameParentAs(e.position)&&(r.howMany+=e.howMany),r.sourcePosition=r.sourcePosition._getTransformedByInsertOperation(e),r.targetPosition=r.targetPosition._getTransformedByInsertOperation(e),[r])),wt(pn,pn,(r,e,t)=>{if(r.sourcePosition.isEqual(e.sourcePosition)&&r.targetPosition.isEqual(e.targetPosition)){if(t.bWasUndone){const n=e.graveyardPosition.path.slice();return n.push(0),r.sourcePosition=new he(e.graveyardPosition.root,n),r.howMany=0,[r]}return[new An(0)]}if(r.sourcePosition.isEqual(e.sourcePosition)&&!r.targetPosition.isEqual(e.targetPosition)&&!t.bWasUndone&&t.abRelation!="splitAtSource"){const n=r.targetPosition.root.rootName=="$graveyard",i=e.targetPosition.root.rootName=="$graveyard";if(i&&!n||!(n&&!i)&&t.aIsStrong){const a=e.targetPosition._getTransformedByMergeOperation(e),c=r.targetPosition._getTransformedByMergeOperation(e);return[new zt(a,r.howMany,c,0)]}return[new An(0)]}return r.sourcePosition.hasSameParentAs(e.targetPosition)&&(r.howMany+=e.howMany),r.sourcePosition=r.sourcePosition._getTransformedByMergeOperation(e),r.targetPosition=r.targetPosition._getTransformedByMergeOperation(e),r.graveyardPosition.isEqual(e.graveyardPosition)&&t.aIsStrong||(r.graveyardPosition=r.graveyardPosition._getTransformedByMergeOperation(e)),[r]}),wt(pn,zt,(r,e,t)=>{const n=se._createFromPositionAndShift(e.sourcePosition,e.howMany);return e.type=="remove"&&!t.bWasUndone&&!t.forceWeakRemove&&r.deletionPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(r.sourcePosition)?[new An(0)]:(r.sourcePosition.hasSameParentAs(e.targetPosition)&&(r.howMany+=e.howMany),r.sourcePosition.hasSameParentAs(e.sourcePosition)&&(r.howMany-=e.howMany),r.sourcePosition=r.sourcePosition._getTransformedByMoveOperation(e),r.targetPosition=r.targetPosition._getTransformedByMoveOperation(e),r.graveyardPosition.isEqual(e.targetPosition)||(r.graveyardPosition=r.graveyardPosition._getTransformedByMoveOperation(e)),[r])}),wt(pn,Ht,(r,e,t)=>{if(e.graveyardPosition&&(r.graveyardPosition=r.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1),r.deletionPosition.isEqual(e.graveyardPosition)&&(r.howMany=e.howMany)),r.targetPosition.isEqual(e.splitPosition)){const n=e.howMany!=0,i=e.graveyardPosition&&r.deletionPosition.isEqual(e.graveyardPosition);if(n||i||t.abRelation=="mergeTargetNotMoved")return r.sourcePosition=r.sourcePosition._getTransformedBySplitOperation(e),[r]}if(r.sourcePosition.isEqual(e.splitPosition)){if(t.abRelation=="mergeSourceNotMoved")return r.howMany=0,r.targetPosition=r.targetPosition._getTransformedBySplitOperation(e),[r];if(t.abRelation=="mergeSameElement"||r.sourcePosition.offset>0)return r.sourcePosition=e.moveTargetPosition.clone(),r.targetPosition=r.targetPosition._getTransformedBySplitOperation(e),[r]}return r.sourcePosition.hasSameParentAs(e.splitPosition)&&(r.howMany=e.splitPosition.offset),r.sourcePosition=r.sourcePosition._getTransformedBySplitOperation(e),r.targetPosition=r.targetPosition._getTransformedBySplitOperation(e),[r]}),wt(zt,Tn,(r,e)=>{const t=se._createFromPositionAndShift(r.sourcePosition,r.howMany)._getTransformedByInsertOperation(e,!1)[0];return r.sourcePosition=t.start,r.howMany=t.end.offset-t.start.offset,r.targetPosition.isEqual(e.position)||(r.targetPosition=r.targetPosition._getTransformedByInsertOperation(e)),[r]}),wt(zt,zt,(r,e,t)=>{const n=se._createFromPositionAndShift(r.sourcePosition,r.howMany),i=se._createFromPositionAndShift(e.sourcePosition,e.howMany);let o,a=t.aIsStrong,c=!t.aIsStrong;if(t.abRelation=="insertBefore"||t.baRelation=="insertAfter"?c=!0:t.abRelation!="insertAfter"&&t.baRelation!="insertBefore"||(c=!1),o=r.targetPosition.isEqual(e.targetPosition)&&c?r.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):r.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),cp(r,e)&&cp(e,r))return[e.getReversed()];if(n.containsPosition(e.targetPosition)&&n.containsRange(i,!0))return n.start=n.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),n.end=n.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Qs([n],o);if(i.containsPosition(r.targetPosition)&&i.containsRange(n,!0))return n.start=n.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),n.end=n.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),Qs([n],o);const u=xn(r.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if(u=="prefix"||u=="extension")return n.start=n.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),n.end=n.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Qs([n],o);r.type!="remove"||e.type=="remove"||t.aWasUndone||t.forceWeakRemove?r.type=="remove"||e.type!="remove"||t.bWasUndone||t.forceWeakRemove||(a=!1):a=!0;const h=[],m=n.getDifference(i);for(const C of m){C.start=C.start._getTransformedByDeletion(e.sourcePosition,e.howMany),C.end=C.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const S=xn(C.start.getParentPath(),e.getMovedRangeStart().getParentPath())=="same",N=C._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,S);h.push(...N)}const k=n.getIntersection(i);return k!==null&&a&&(k.start=k.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),k.end=k.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),h.length===0?h.push(k):h.length==1?i.start.isBefore(n.start)||i.start.isEqual(n.start)?h.unshift(k):h.push(k):h.splice(1,0,k)),h.length===0?[new An(r.baseVersion)]:Qs(h,o)}),wt(zt,Ht,(r,e,t)=>{let n=r.targetPosition.clone();r.targetPosition.isEqual(e.insertionPosition)&&e.graveyardPosition&&t.abRelation!="moveTargetAfter"||(n=r.targetPosition._getTransformedBySplitOperation(e));const i=se._createFromPositionAndShift(r.sourcePosition,r.howMany);if(i.end.isEqual(e.insertionPosition))return e.graveyardPosition||r.howMany++,r.targetPosition=n,[r];if(i.start.hasSameParentAs(e.splitPosition)&&i.containsPosition(e.splitPosition)){let a=new se(e.splitPosition,i.end);return a=a._getTransformedBySplitOperation(e),Qs([new se(i.start,e.splitPosition),a],n)}r.targetPosition.isEqual(e.splitPosition)&&t.abRelation=="insertAtSource"&&(n=e.moveTargetPosition),r.targetPosition.isEqual(e.insertionPosition)&&t.abRelation=="insertBetween"&&(n=r.targetPosition);const o=[i._getTransformedBySplitOperation(e)];if(e.graveyardPosition){const a=i.start.isEqual(e.graveyardPosition)||i.containsPosition(e.graveyardPosition);r.howMany>1&&a&&!t.aWasUndone&&o.push(se._createFromPositionAndShift(e.insertionPosition,1))}return Qs(o,n)}),wt(zt,pn,(r,e,t)=>{const n=se._createFromPositionAndShift(r.sourcePosition,r.howMany);if(e.deletionPosition.hasSameParentAs(r.sourcePosition)&&n.containsPosition(e.sourcePosition)){if(r.type!="remove"||t.forceWeakRemove){if(r.howMany==1)return t.bWasUndone?(r.sourcePosition=e.graveyardPosition.clone(),r.targetPosition=r.targetPosition._getTransformedByMergeOperation(e),[r]):[new An(0)]}else if(!t.aWasUndone){const o=[];let a=e.graveyardPosition.clone(),c=e.targetPosition._getTransformedByMergeOperation(e);r.howMany>1&&(o.push(new zt(r.sourcePosition,r.howMany-1,r.targetPosition,0)),a=a._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany-1),c=c._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany-1));const u=e.deletionPosition._getCombined(r.sourcePosition,r.targetPosition),h=new zt(a,1,u,0),m=h.getMovedRangeStart().path.slice();m.push(0);const k=new he(h.targetPosition.root,m);c=c._getTransformedByMove(a,u,1);const C=new zt(c,e.howMany,k,0);return o.push(h),o.push(C),o}}const i=se._createFromPositionAndShift(r.sourcePosition,r.howMany)._getTransformedByMergeOperation(e);return r.sourcePosition=i.start,r.howMany=i.end.offset-i.start.offset,r.targetPosition=r.targetPosition._getTransformedByMergeOperation(e),[r]}),wt(ni,Tn,(r,e)=>(r.position=r.position._getTransformedByInsertOperation(e),[r])),wt(ni,pn,(r,e)=>r.position.isEqual(e.deletionPosition)?(r.position=e.graveyardPosition.clone(),r.position.stickiness="toNext",[r]):(r.position=r.position._getTransformedByMergeOperation(e),[r])),wt(ni,zt,(r,e)=>(r.position=r.position._getTransformedByMoveOperation(e),[r])),wt(ni,ni,(r,e,t)=>{if(r.position.isEqual(e.position)){if(!t.aIsStrong)return[new An(0)];r.oldName=e.newName}return[r]}),wt(ni,Ht,(r,e)=>{if(xn(r.position.path,e.splitPosition.getParentPath())=="same"&&!e.graveyardPosition){const t=new ni(r.position.getShiftedBy(1),r.oldName,r.newName,0);return[r,t]}return r.position=r.position._getTransformedBySplitOperation(e),[r]}),wt(Rr,Rr,(r,e,t)=>{if(r.root===e.root&&r.key===e.key){if(!t.aIsStrong||r.newValue===e.newValue)return[new An(0)];r.oldValue=e.newValue}return[r]}),wt(Ht,Tn,(r,e)=>(r.splitPosition.hasSameParentAs(e.position)&&r.splitPosition.offset<e.position.offset&&(r.howMany+=e.howMany),r.splitPosition=r.splitPosition._getTransformedByInsertOperation(e),r.insertionPosition=r.insertionPosition._getTransformedByInsertOperation(e),[r])),wt(Ht,pn,(r,e,t)=>{if(!r.graveyardPosition&&!t.bWasUndone&&r.splitPosition.hasSameParentAs(e.sourcePosition)){const n=e.graveyardPosition.path.slice();n.push(0);const i=new he(e.graveyardPosition.root,n),o=Ht.getInsertionPosition(new he(e.graveyardPosition.root,n)),a=new Ht(i,0,o,null,0);return r.splitPosition=r.splitPosition._getTransformedByMergeOperation(e),r.insertionPosition=Ht.getInsertionPosition(r.splitPosition),r.graveyardPosition=a.insertionPosition.clone(),r.graveyardPosition.stickiness="toNext",[a,r]}return r.splitPosition.hasSameParentAs(e.deletionPosition)&&!r.splitPosition.isAfter(e.deletionPosition)&&r.howMany--,r.splitPosition.hasSameParentAs(e.targetPosition)&&(r.howMany+=e.howMany),r.splitPosition=r.splitPosition._getTransformedByMergeOperation(e),r.insertionPosition=Ht.getInsertionPosition(r.splitPosition),r.graveyardPosition&&(r.graveyardPosition=r.graveyardPosition._getTransformedByMergeOperation(e)),[r]}),wt(Ht,zt,(r,e,t)=>{const n=se._createFromPositionAndShift(e.sourcePosition,e.howMany);if(r.graveyardPosition){const o=n.start.isEqual(r.graveyardPosition)||n.containsPosition(r.graveyardPosition);if(!t.bWasUndone&&o){const a=r.splitPosition._getTransformedByMoveOperation(e),c=r.graveyardPosition._getTransformedByMoveOperation(e),u=c.path.slice();u.push(0);const h=new he(c.root,u);return[new zt(a,r.howMany,h,0)]}r.graveyardPosition=r.graveyardPosition._getTransformedByMoveOperation(e)}const i=r.splitPosition.isEqual(e.targetPosition);if(i&&(t.baRelation=="insertAtSource"||t.abRelation=="splitBefore"))return r.howMany+=e.howMany,r.splitPosition=r.splitPosition._getTransformedByDeletion(e.sourcePosition,e.howMany),r.insertionPosition=Ht.getInsertionPosition(r.splitPosition),[r];if(i&&t.abRelation&&t.abRelation.howMany){const{howMany:o,offset:a}=t.abRelation;return r.howMany+=o,r.splitPosition=r.splitPosition.getShiftedBy(a),[r]}if(r.splitPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(r.splitPosition)){const o=e.howMany-(r.splitPosition.offset-e.sourcePosition.offset);return r.howMany-=o,r.splitPosition.hasSameParentAs(e.targetPosition)&&r.splitPosition.offset<e.targetPosition.offset&&(r.howMany+=e.howMany),r.splitPosition=e.sourcePosition.clone(),r.insertionPosition=Ht.getInsertionPosition(r.splitPosition),[r]}return e.sourcePosition.isEqual(e.targetPosition)||(r.splitPosition.hasSameParentAs(e.sourcePosition)&&r.splitPosition.offset<=e.sourcePosition.offset&&(r.howMany-=e.howMany),r.splitPosition.hasSameParentAs(e.targetPosition)&&r.splitPosition.offset<e.targetPosition.offset&&(r.howMany+=e.howMany)),r.splitPosition.stickiness="toNone",r.splitPosition=r.splitPosition._getTransformedByMoveOperation(e),r.splitPosition.stickiness="toNext",r.graveyardPosition?r.insertionPosition=r.insertionPosition._getTransformedByMoveOperation(e):r.insertionPosition=Ht.getInsertionPosition(r.splitPosition),[r]}),wt(Ht,Ht,(r,e,t)=>{if(r.splitPosition.isEqual(e.splitPosition)){if(!r.graveyardPosition&&!e.graveyardPosition)return[new An(0)];if(r.graveyardPosition&&e.graveyardPosition&&r.graveyardPosition.isEqual(e.graveyardPosition))return[new An(0)];if(t.abRelation=="splitBefore")return r.howMany=0,r.graveyardPosition=r.graveyardPosition._getTransformedBySplitOperation(e),[r]}if(r.graveyardPosition&&e.graveyardPosition&&r.graveyardPosition.isEqual(e.graveyardPosition)){const n=r.splitPosition.root.rootName=="$graveyard",i=e.splitPosition.root.rootName=="$graveyard";if(i&&!n||!(n&&!i)&&t.aIsStrong){const a=[];return e.howMany&&a.push(new zt(e.moveTargetPosition,e.howMany,e.splitPosition,0)),r.howMany&&a.push(new zt(r.splitPosition,r.howMany,r.moveTargetPosition,0)),a}return[new An(0)]}if(r.graveyardPosition&&(r.graveyardPosition=r.graveyardPosition._getTransformedBySplitOperation(e)),r.splitPosition.isEqual(e.insertionPosition)&&t.abRelation=="splitBefore")return r.howMany++,[r];if(e.splitPosition.isEqual(r.insertionPosition)&&t.baRelation=="splitBefore"){const n=e.insertionPosition.path.slice();n.push(0);const i=new he(e.insertionPosition.root,n);return[r,new zt(r.insertionPosition,1,i,0)]}return r.splitPosition.hasSameParentAs(e.splitPosition)&&r.splitPosition.offset<e.splitPosition.offset&&(r.howMany-=e.howMany),r.splitPosition=r.splitPosition._getTransformedBySplitOperation(e),r.insertionPosition=Ht.getInsertionPosition(r.splitPosition),[r]});class qm extends to{constructor(e){super(e),this.domEventType="click"}onDomEvent(e){this.fire(e.type,e)}}class $c extends to{constructor(e){super(e),this.domEventType=["mousedown","mouseup","mouseover","mouseout"]}onDomEvent(e){this.fire(e.type,e)}}class Ys{constructor(e){this.document=e}createDocumentFragment(e){return new ts(this.document,e)}createElement(e,t,n){return new Ce(this.document,e,t,n)}createText(e){return new _t(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,n){return n._insertChild(e,t)}removeChildren(e,t,n){return n._removeChildren(e,t)}remove(e){const t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){const n=e.parent;if(n){const i=n.getChildIndex(e);return this.removeChildren(i,1,n),this.insertChild(i,t,n),!0}return!1}unwrapElement(e){const t=e.parent;if(t){const n=t.getChildIndex(e);this.remove(e),this.insertChild(n,e.getChildren(),t)}}rename(e,t){const n=new Ce(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,n)?n:null}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){Xn(e)&&n===void 0&&(n=t),n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return ge._createAt(e,t)}createPositionAfter(e){return ge._createAfter(e)}createPositionBefore(e){return ge._createBefore(e)}createRange(e,t){return new Be(e,t)}createRangeOn(e){return Be._createOn(e)}createRangeIn(e){return Be._createIn(e)}createSelection(e,t,n){return new ft(e,t,n)}}class or extends If{constructor(e,t){super(e),this.view=t,this._toolbarConfig=Kf(e.config.get("toolbar")),this._elementReplacer=new Zh}get element(){return this.view.element}init(e){const t=this.editor,n=this.view,i=t.editing.view,o=n.editable,a=i.document.getRoot();o.name=a.rootName,n.render();const c=o.element;this.setEditableElement(o.name,c),this.focusTracker.add(c),n.editable.bind("isFocused").to(this.focusTracker),i.attachDomRoot(c),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const e=this.view,t=this.editor.editing.view;this._elementReplacer.restore(),t.detachDomRoot(e.editable.name),e.destroy(),super.destroy()}_initToolbar(){const e=this.editor,t=this.view,n=e.editing.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,this._toolbarConfig.viewportTopOffset&&(t.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset),t.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),function({origin:i,originKeystrokeHandler:o,originFocusTracker:a,toolbar:c,beforeFocus:u,afterBlur:h}){a.add(c.element),o.set("Alt+F10",(m,k)=>{a.isFocused&&!c.focusTracker.isFocused&&(u&&u(),c.focus(),k())}),c.keystrokes.set("Esc",(m,k)=>{c.focusTracker.isFocused&&(i.focus(),h&&h(),k())})}({origin:n,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:t.toolbar})}_initPlaceholder(){const e=this.editor,t=e.editing.view,n=t.document.getRoot(),i=e.sourceElement,o=e.config.get("placeholder")||i&&i.tagName.toLowerCase()==="textarea"&&i.getAttribute("placeholder");o&&ip({view:t,element:n,text:o,isDirectHost:!1,keepOnFocus:!0})}}v(61);class Km extends Lm{constructor(e,t,n={}){super(e),this.stickyPanel=new Vm(e),this.toolbar=new Nu(e,{shouldGroupWhenFull:n.shouldToolbarGroupWhenFull}),this.editable=new Bm(e,t)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class Bu extends Cu{constructor(e,t){super(t),Ji(e)&&(this.sourceElement=e),this.model.document.createRoot();const n=!this.config.get("toolbar.shouldNotGroupWhenFull"),i=new Km(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:n});this.ui=new or(this,i),function(o){if(!Pe(o.updateSourceElement))throw new y.a("attachtoform-missing-elementapi-interface",o);const a=o.sourceElement;if(a&&a.tagName.toLowerCase()==="textarea"&&a.form){let c;const u=a.form,h=()=>o.updateSourceElement();Pe(u.submit)&&(c=u.submit,u.submit=()=>{h(),c.apply(u)}),u.addEventListener("submit",h),o.on("destroy",()=>{u.removeEventListener("submit",h),c&&(u.submit=c)})}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(e,t={}){return new Promise(n=>{const i=new this(e,t);n(i.initPlugins().then(()=>i.ui.init(Ji(e)?e:null)).then(()=>{if(!Ji(e)&&t.initialData)throw new y.a("editor-create-initial-data",null);const o=t.initialData!==void 0?t.initialData:function(a){return Ji(a)?(c=a,c instanceof HTMLTextAreaElement?c.value:c.innerHTML):a;var c}(e);return i.data.init(o)}).then(()=>i.fire("ready")).then(()=>i))})}}Le(Bu,Tm),Le(Bu,Au);class ds{constructor(e){this.files=function(t){const n=Array.from(t.files||[]),i=Array.from(t.items||[]);return n.length?n:i.filter(o=>o.kind==="file").map(o=>o.getAsFile())}(e),this._native=e}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}set effectAllowed(e){this._native.effectAllowed=e}get effectAllowed(){return this._native.effectAllowed}set dropEffect(e){this._native.dropEffect=e}get dropEffect(){return this._native.dropEffect}get isCanceled(){return this._native.dropEffect=="none"||!!this._native.mozUserCancelled}}class Je extends to{constructor(e){super(e);const t=this.document;function n(i){return(o,a)=>{a.preventDefault();const c=a.dropRange?[a.dropRange]:null,u=new b(t,i);t.fire(u,{dataTransfer:a.dataTransfer,method:o.name,targetRanges:c,target:a.target}),u.stop.called&&a.stopPropagation()}}this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"],this.listenTo(t,"paste",n("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",n("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",n("dragging"),{priority:"low"})}onDomEvent(e){const t={dataTransfer:new ds(e.clipboardData?e.clipboardData:e.dataTransfer)};e.type!="drop"&&e.type!="dragover"||(t.dropRange=function(n,i){const o=i.target.ownerDocument,a=i.clientX,c=i.clientY;let u;return o.caretRangeFromPoint&&o.caretRangeFromPoint(a,c)?u=o.caretRangeFromPoint(a,c):i.rangeParent&&(u=o.createRange(),u.setStart(i.rangeParent,i.rangeOffset),u.collapse(!0)),u?n.domConverter.domRangeToView(u):null}(this.view,e)),this.fire(e.type,e,t)}}const dp=["figcaption","li"];class tn extends me{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(Je),this._setupPasteDrop(),this._setupCopyCut()}_setupPasteDrop(){const e=this.editor,t=e.model,n=e.editing.view,i=n.document;this.listenTo(i,"clipboardInput",o=>{e.isReadOnly&&o.stop()},{priority:"highest"}),this.listenTo(i,"clipboardInput",(o,a)=>{const c=a.dataTransfer;let u=a.content||"";var h;u||(c.getData("text/html")?u=function(k){return k.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(C,S)=>S.length==1?" ":S).replace(/<!--[\s\S]*?-->/g,"")}(c.getData("text/html")):c.getData("text/plain")&&(((h=(h=c.getData("text/plain")).replace(/</g,"<").replace(/>/g,">").replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br>").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," ")).includes("</p><p>")||h.includes("<br>"))&&(h=`<p>${h}</p>`),u=h),u=this.editor.data.htmlProcessor.toView(u));const m=new b(this,"inputTransformation");this.fire(m,{content:u,dataTransfer:c,targetRanges:a.targetRanges,method:a.method}),m.stop.called&&o.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(o,a)=>{if(a.content.isEmpty)return;const c=this.editor.data.toModel(a.content,"$clipboardHolder");c.childCount!=0&&(o.stop(),t.change(()=>{this.fire("contentInsertion",{content:c,method:a.method,dataTransfer:a.dataTransfer,targetRanges:a.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(o,a)=>{a.resultRange=t.insertContent(a.content)},{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,n=e.editing.view.document;function i(o,a){const c=a.dataTransfer;a.preventDefault();const u=e.data.toView(e.model.getSelectedContent(t.selection));n.fire("clipboardOutput",{dataTransfer:c,content:u,method:o.name})}this.listenTo(n,"copy",i,{priority:"low"}),this.listenTo(n,"cut",(o,a)=>{e.isReadOnly?a.preventDefault():i(o,a)},{priority:"low"}),this.listenTo(n,"clipboardOutput",(o,a)=>{a.content.isEmpty||(a.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(a.content)),a.dataTransfer.setData("text/plain",function c(u){let h="";if(u.is("$text")||u.is("$textProxy"))h=u.data;else if(u.is("element","img")&&u.hasAttribute("alt"))h=u.getAttribute("alt");else if(u.is("element","br"))h=` `;else{let m=null;for(const k of u.getChildren()){const C=c(k);m&&(m.is("containerElement")||k.is("containerElement"))&&(dp.includes(m.name)||dp.includes(k.name)?h+=` `:h+=` `),h+=C,m=k}}return h}(a.content))),a.method=="cut"&&e.model.deleteContent(t.selection)},{priority:"low"})}}function*sn(r,e){for(const t of e)t&&r.getAttributeProperties(t[0]).copyOnEnter&&(yield t)}class Gm extends ct{execute(){const e=this.editor.model,t=e.document;e.change(n=>{(function(i,o,a,c){const u=a.isCollapsed,h=a.getFirstRange(),m=h.start.parent,k=h.end.parent;if(c.isLimit(m)||c.isLimit(k))return void(u||m!=k||i.deleteContent(a));if(u){const C=sn(o.model.schema,a.getAttributes());oo(o,h.start),o.setSelectionAttribute(C)}else{const C=!(h.start.isAtStart&&h.end.isAtEnd),S=m==k;i.deleteContent(a,{leaveUnmerged:C}),C&&(S?oo(o,a.focus):o.setSelection(k,0))}})(this.editor.model,n,t.selection,e.schema),this.fire("afterExecute",{writer:n})})}}function oo(r,e){r.split(e),r.setSelection(e.parent.nextSibling,0)}class up extends Er{constructor(e){super(e);const t=this.document;t.on("keydown",(n,i)=>{if(this.isEnabled&&i.keyCode==ot.enter){const o=new Cn(t,"enter",t.selection.getFirstRange());t.fire(o,new os(t,i.domEvent,{isSoft:i.shiftKey})),o.stop.called&&n.stop()}})}observe(){}}class Hc extends me{static get pluginName(){return"Enter"}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(up),e.commands.add("enter",new Gm(e)),this.listenTo(n,"enter",(i,o)=>{o.preventDefault(),o.isSoft||(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"})}}class hp{constructor(e,t=20){this.model=e,this.size=0,this.limit=t,this.isLocked=!1,this._changeCallback=(n,i)=>{i.type!="transparent"&&i!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch()),this._batch}input(e){this.size+=e,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e){this.isLocked&&!e||(this._batch=null,this.size=0)}}class fp extends ct{constructor(e,t){super(e),this.direction=t,this._buffer=new hp(e.model,e.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,n=t.document;t.enqueueChange(this._buffer.batch,i=>{this._buffer.lock();const o=i.createSelection(e.selection||n.selection),a=e.sequence||1,c=o.isCollapsed;if(o.isCollapsed&&t.modifySelection(o,{direction:this.direction,unit:e.unit}),this._shouldEntireContentBeReplacedWithParagraph(a))return void this._replaceEntireContentWithParagraph(i);if(this._shouldReplaceFirstBlockWithParagraph(o,a))return void this.editor.execute("paragraph",{selection:o});if(o.isCollapsed)return;let u=0;o.getFirstRange().getMinimalFlatRanges().forEach(h=>{u+=Lt(h.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(o,{doNotResetEntireContent:c,direction:this.direction}),this._buffer.input(u),i.setSelection(o),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,n=t.document.selection,i=t.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(i))||!t.schema.checkChild(i,"paragraph"))return!1;const o=i.getChild(0);return!o||o.name!=="paragraph"}_replaceEntireContentWithParagraph(e){const t=this.editor.model,n=t.document.selection,i=t.schema.getLimitElement(n),o=e.createElement("paragraph");e.remove(e.createRangeIn(i)),e.insert(o,i),e.setSelection(o,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const n=this.editor.model;if(t>1||this.direction!="backward"||!e.isCollapsed)return!1;const i=e.getFirstPosition(),o=n.schema.getLimitElement(i),a=o.getChild(0);return i.parent==a&&!!e.containsEntireContent(a)&&!!n.schema.checkChild(o,"paragraph")&&a.name!="paragraph"}}class Qm extends Er{constructor(e){super(e);const t=e.document;let n=0;function i(o,a,c){const u=new Cn(t,"delete",t.selection.getFirstRange());t.fire(u,new os(t,a,c)),u.stop.called&&o.stop()}t.on("keyup",(o,a)=>{a.keyCode!=ot.delete&&a.keyCode!=ot.backspace||(n=0)}),t.on("keydown",(o,a)=>{const c={};if(a.keyCode==ot.delete)c.direction="forward",c.unit="character";else{if(a.keyCode!=ot.backspace)return;c.direction="backward",c.unit="codePoint"}const u=_n.isMac?a.altKey:a.ctrlKey;c.unit=u?"word":c.unit,c.sequence=++n,i(o,a.domEvent,c)}),_n.isAndroid&&t.on("beforeinput",(o,a)=>{if(a.domEvent.inputType!="deleteContentBackward")return;const c={unit:"codepoint",direction:"backward",sequence:1},u=a.domTarget.ownerDocument.defaultView.getSelection();u.anchorNode==u.focusNode&&u.anchorOffset+1!=u.focusOffset&&(c.selectionToRemove=e.domConverter.domSelectionToView(u)),i(o,a.domEvent,c)})}observe(){}}class us extends me{static get pluginName(){return"Delete"}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(Qm);const i=new fp(e,"forward");if(e.commands.add("deleteForward",i),e.commands.add("forwardDelete",i),e.commands.add("delete",new fp(e,"backward")),this.listenTo(n,"delete",(o,a)=>{const c={unit:a.unit,sequence:a.sequence};if(a.selectionToRemove){const u=e.model.createSelection(),h=[];for(const m of a.selectionToRemove.getRanges())h.push(e.editing.mapper.toModelRange(m));u.setTo(h),c.selection=u}e.execute(a.direction=="forward"?"deleteForward":"delete",c),a.preventDefault(),t.scrollToTheSelection()},{priority:"low"}),_n.isAndroid){let o=null;this.listenTo(n,"delete",(a,c)=>{const u=c.domTarget.ownerDocument.defaultView.getSelection();o={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}},{priority:"lowest"}),this.listenTo(n,"keyup",(a,c)=>{if(o){const u=c.domTarget.ownerDocument.defaultView.getSelection();u.collapse(o.anchorNode,o.anchorOffset),u.extend(o.focusNode,o.focusOffset),o=null}})}}}class pp{constructor(){this._stack=[]}add(e,t){const n=this._stack,i=n[0];this._insertDescriptor(e);const o=n[0];i===o||sr(i,o)||this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:t})}remove(e,t){const n=this._stack,i=n[0];this._removeDescriptor(e);const o=n[0];i===o||sr(i,o)||this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:t})}_insertDescriptor(e){const t=this._stack,n=t.findIndex(o=>o.id===e.id);if(sr(e,t[n]))return;n>-1&&t.splice(n,1);let i=0;for(;t[i]&&gp(t[i],e);)i++;t.splice(i,0,e)}_removeDescriptor(e){const t=this._stack,n=t.findIndex(i=>i.id===e);n>-1&&t.splice(n,1)}}function sr(r,e){return r&&e&&r.priority==e.priority&&hs(r.classes)==hs(e.classes)}function gp(r,e){return r.priority>e.priority||!(r.priority<e.priority)&&hs(r.classes)>hs(e.classes)}function hs(r){return Array.isArray(r)?r.sort().join(","):r}Le(pp,V);function Ze(r){return!!r.is("element")&&!!r.getCustomProperty("widget")}function Zt(r,e,t={}){if(!r.is("containerElement"))throw new y.a("widget-to-widget-wrong-element-type",null,{element:r});return e.setAttribute("contenteditable","false",r),e.addClass("ck-widget",r),e.setCustomProperty("widget",!0,r),r.getFillerOffset=bp,t.label&&function(n,i,o){o.setCustomProperty("widgetLabel",i,n)}(r,t.label,e),t.hasSelectionHandle&&function(n,i){const o=i.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(a){const c=this.toDomElement(a),u=new Lc;return u.set("content",'<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0H4zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3V0zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3v1zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5H12z"/><path fill-opacity=".256" d="M1 1h14v14H1z"/><g class="ck-icon__selected-indicator"><path d="M7 0h2v1H7V0zM0 7h1v2H0V7zm15 0h1v2h-1V7zm-8 8h2v1H7v-1z"/><path fill-opacity=".254" d="M1 1h14v14H1z"/></g></svg>'),u.render(),c.appendChild(u.element),c});i.insert(i.createPositionAt(n,0),o),i.addClass(["ck-widget_with-selection-handle"],n)}(r,e),Uc(r,e,mp,Ym),r}function mp(r,e,t){if(e.classes&&t.addClass(xt(e.classes),r),e.attributes)for(const n in e.attributes)t.setAttribute(n,e.attributes[n],r)}function Ym(r,e,t){if(e.classes&&t.removeClass(xt(e.classes),r),e.attributes)for(const n in e.attributes)t.removeAttribute(n,r)}function Uc(r,e,t,n){const i=new pp;i.on("change:top",(o,a)=>{a.oldDescriptor&&n(r,a.oldDescriptor,a.writer),a.newDescriptor&&t(r,a.newDescriptor,a.writer)}),e.setCustomProperty("addHighlight",(o,a,c)=>i.add(a,c),r),e.setCustomProperty("removeHighlight",(o,a,c)=>i.remove(a,c),r)}function Xm(r){const e=r.getCustomProperty("widgetLabel");return e?typeof e=="function"?e():e:""}function Fu(r,e){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],r),e.setAttribute("contenteditable",r.isReadOnly?"false":"true",r),r.on("change:isReadOnly",(t,n,i)=>{e.setAttribute("contenteditable",i?"false":"true",r)}),r.on("change:isFocused",(t,n,i)=>{i?e.addClass("ck-editor__nested-editable_focused",r):e.removeClass("ck-editor__nested-editable_focused",r)}),r}function dl(r,e){const t=r.getSelectedElement();if(t){const i=so(r);if(i)return e.createRange(e.createPositionAt(t,i));if(e.schema.isObject(t)&&!e.schema.isInline(t))return e.createRangeOn(t)}const n=r.getSelectedBlocks().next().value;if(n){if(n.isEmpty)return e.createRange(e.createPositionAt(n,0));const i=e.createPositionAfter(n);return r.focus.isTouching(i)?e.createRange(i):e.createRange(e.createPositionBefore(n))}return e.createRange(r.focus)}function Jm(r,e){const t=new yt($t.window),n=t.getIntersection(r),i=e.height+at.arrowVerticalOffset;if(r.top-i>t.top||r.bottom+i<t.bottom)return null;const o=n||r,a=o.left+o.width/2-e.width/2;return{top:Math.max(r.top,0)+at.arrowVerticalOffset,left:a,name:"arrow_n"}}function bp(){return null}function jr(r,e,t){return r&&Ze(r)&&!t.isInline(e)}function so(r){return r.getAttribute("widget-type-around")}const vp=[R("arrowUp"),R("arrowRight"),R("arrowDown"),R("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let r=112;r<=135;r++)vp.push(r);function Vu(r){return!(!r.ctrlKey&&!r.metaKey)||vp.includes(r.keyCode)}v(63);const ul=["before","after"],Ri=new DOMParser().parseFromString('<svg viewBox="0 0 10 8" xmlns="http://www.w3.org/2000/svg"><path d="M9.055.263v3.972h-6.77M1 4.216l2-2.038m-2 2 2 2.038"/></svg>',"image/svg+xml").firstChild;class Xs extends me{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[Hc,us]}constructor(e){super(e),this._currentFakeCaretModelElement=null}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",(n,i,o)=>{t.change(a=>{for(const c of t.document.roots)o?a.removeClass("ck-widget__type-around_disabled",c):a.addClass("ck-widget__type-around_disabled",c)}),o||e.model.change(a=>{a.removeSelectionAttribute("widget-type-around")})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableDeleteContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const n=this.editor,i=n.editing.view;n.execute("insertParagraph",{position:n.model.createPositionAt(e,t)}),i.focus(),i.scrollToTheSelection()}_listenToIfEnabled(e,t,n,i){this.listenTo(e,t,(...o)=>{this.isEnabled&&n(...o)},i)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=so(e);if(!t)return!1;const n=e.getSelectedElement();return this._insertParagraph(n,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,n=e.locale.t,i={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(o,a,c)=>{const u=c.mapper.toViewElement(a.item);jr(u,a.item,t)&&function(h,m,k){const C=h.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(S){const N=this.toDomElement(S);return function(D,z){for(const U of ul){const J=new Ni({tag:"div",attributes:{class:["ck","ck-widget__type-around__button","ck-widget__type-around__button_"+U],title:z[U]},children:[D.ownerDocument.importNode(Ri,!0)]});D.appendChild(J.render())}}(N,m),function(D){const z=new Ni({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});D.appendChild(z.render())}(N),N});h.insert(h.createPositionAt(k,"end"),C)}(c.writer,i,u)},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,n=t.document.selection,i=t.schema,o=e.editing.view;function a(c){return"ck-widget_type-around_show-fake-caret_"+c}this._listenToIfEnabled(o.document,"arrowKey",(c,u)=>{this._handleArrowKeyPress(c,u)},{context:[Ze,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",(c,u)=>{u.directChange&&e.model.change(h=>{h.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(t.document,"change:data",()=>{const c=n.getSelectedElement();c&&jr(e.editing.mapper.toViewElement(c),c,i)||e.model.change(u=>{u.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(c,u,h)=>{const m=h.writer;if(this._currentFakeCaretModelElement){const N=h.mapper.toViewElement(this._currentFakeCaretModelElement);N&&(m.removeClass(ul.map(a),N),this._currentFakeCaretModelElement=null)}const k=u.selection.getSelectedElement();if(!k)return;const C=h.mapper.toViewElement(k);if(!jr(C,k,i))return;const S=so(u.selection);S&&(m.addClass(a(S),C),this._currentFakeCaretModelElement=k)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(c,u,h)=>{h||e.model.change(m=>{m.removeSelectionAttribute("widget-type-around")})})}_handleArrowKeyPress(e,t){const n=this.editor,i=n.model,o=i.document.selection,a=i.schema,c=n.editing.view,u=mt(t.keyCode,n.locale.contentLanguageDirection),h=c.document.selection.getSelectedElement();let m;jr(h,n.editing.mapper.toModelElement(h),a)?m=this._handleArrowKeyPressOnSelectedWidget(u):o.isCollapsed&&(m=this._handleArrowKeyPressWhenSelectionNextToAWidget(u)),m&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,n=so(t.document.selection);return t.change(i=>n?n!==(e?"after":"before")?(i.removeSelectionAttribute("widget-type-around"),!0):!1:(i.setSelectionAttribute("widget-type-around",e?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,n=t.model,i=n.schema,o=t.plugins.get("Widget"),a=o._getObjectElementNextToSelection(e);return!!jr(t.editing.mapper.toViewElement(a),a,i)&&(n.change(c=>{o._setSelectionOverElement(a),c.setSelectionAttribute("widget-type-around",e?"before":"after")}),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(n,i)=>{const o=i.domTarget.closest(".ck-widget__type-around__button");if(!o)return;const a=function(h){return h.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(o),c=function(h,m){const k=h.closest(".ck-widget");return m.mapDomToView(k)}(o,t.domConverter),u=e.editing.mapper.toModelElement(c);this._insertParagraph(u,a),i.preventDefault(),n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,n=e.editing.view;this._listenToIfEnabled(n.document,"enter",(i,o)=>{if(i.eventPhase!="atTarget")return;const a=t.getSelectedElement(),c=e.editing.mapper.toViewElement(a),u=e.model.schema;let h;this._insertParagraphAccordingToFakeCaretPosition()?h=!0:jr(c,a,u)&&(this._insertParagraph(a,o.isSoft?"before":"after"),h=!0),h&&(o.preventDefault(),i.stop())},{context:Ze})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view,t=[ot.enter,ot.delete,ot.backspace];this._listenToIfEnabled(e.document,"keydown",(n,i)=>{t.includes(i.keyCode)||Vu(i)||this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,n=e.model,i=n.schema;this._listenToIfEnabled(t.document,"delete",(o,a)=>{if(o.eventPhase!="atTarget")return;const c=so(n.document.selection);if(!c)return;const u=a.direction,h=n.document.selection.getSelectedElement(),m=u=="forward";if(c==="before"===m)e.execute("delete",{selection:n.createSelection(h,"on")});else{const k=i.getNearestSelectionRange(n.createPositionAt(h,c),u);if(k)if(k.isCollapsed){const C=n.createSelection(k.start);if(n.modifySelection(C,{direction:u}),C.focus.isEqual(k.start)){const S=function(N,D){let z=D;for(const U of D.getAncestors({parentFirst:!0})){if(U.childCount>1||N.isLimit(U))break;z=U}return z}(i,k.start.parent);n.deleteContent(n.createSelection(S,"on"),{doNotAutoparagraph:!0})}else n.change(S=>{S.setSelection(k),e.execute(m?"deleteForward":"delete")})}else n.change(C=>{C.setSelection(k),e.execute(m?"deleteForward":"delete")})}a.preventDefault(),o.stop()},{context:Ze})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,n=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(i,[o,a])=>{if(a&&!a.is("documentSelection"))return;const c=so(n);return c?(i.stop(),t.change(u=>{const h=n.getSelectedElement(),m=t.createPositionAt(h,c),k=u.createSelection(m),C=t.insertContent(o,k);return u.setSelection(k),C})):void 0},{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(n,[i])=>{i&&!i.is("documentSelection")||so(t)&&n.stop()},{priority:"high"})}}v(65);function Zm(r){const e=r.model;return(t,n)=>{const i=n.keyCode==ot.arrowup,o=n.keyCode==ot.arrowdown,a=n.shiftKey,c=e.document.selection;if(!i&&!o)return;const u=o;if(a&&function(m,k){return!m.isCollapsed&&m.isBackward==k}(c,u))return;const h=function(m,k,C){const S=m.model;if(C){const N=k.isCollapsed?k.focus:k.getLastPosition(),D=_p(S,N,"forward");if(!D)return null;const z=S.createRange(N,D),U=wp(S.schema,z,"backward");return U&&N.isBefore(U)?S.createRange(N,U):null}{const N=k.isCollapsed?k.focus:k.getFirstPosition(),D=_p(S,N,"backward");if(!D)return null;const z=S.createRange(D,N),U=wp(S.schema,z,"forward");return U&&N.isAfter(U)?S.createRange(U,N):null}}(r,c,u);h&&!h.isCollapsed&&function(m,k,C){const S=m.model,N=m.view.domConverter;if(C){const ce=S.createSelection(k.start);S.modifySelection(ce),ce.focus.isAtEnd||k.start.isEqual(ce.focus)||(k=S.createRange(ce.focus,k.end))}const D=m.mapper.toViewRange(k),z=N.viewRangeToDom(D),U=yt.getDomRangeRects(z);let J;for(const ce of U)if(J!==void 0){if(Math.round(ce.top)>=J)return!1;J=Math.max(J,Math.round(ce.bottom))}else J=Math.round(ce.bottom);return!0}(r,h,u)&&(e.change(m=>{const k=u?h.end:h.start;if(a){const C=e.createSelection(c.anchor);C.setFocus(k),m.setSelection(C)}else m.setSelection(k)}),t.stop(),n.preventDefault(),n.stopPropagation())}}function _p(r,e,t){const n=r.schema,i=r.createRangeIn(e.root),o=t=="forward"?"elementStart":"elementEnd";for(const{previousPosition:a,item:c,type:u}of i.getWalker({startPosition:e,direction:t})){if(n.isLimit(c)&&!n.isInline(c))return a;if(u==o&&n.isBlock(c))return null}return null}function wp(r,e,t){const n=t=="backward"?e.end:e.start;if(r.checkChild(n,"$text"))return n;for(const{nextPosition:i}of e.getWalker({direction:t}))if(r.checkChild(i,"$text"))return i}class hl extends me{static get pluginName(){return"Widget"}static get requires(){return[Xs,us]}init(){const e=this.editor,t=e.editing.view,n=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(i,o,a)=>{const c=a.writer,u=o.selection;if(u.isCollapsed)return;const h=u.getSelectedElement();if(!h)return;const m=e.editing.mapper.toViewElement(h);Ze(m)&&a.consumable.consume(u,"selection")&&c.setSelection(c.createRangeOn(m),{fake:!0,label:Xm(m)})}),this.editor.editing.downcastDispatcher.on("selection",(i,o,a)=>{this._clearPreviouslySelectedWidgets(a.writer);const c=a.writer,u=c.document.selection;let h=null;for(const m of u.getRanges())for(const k of m){const C=k.item;Ze(C)&&!eb(C,h)&&(c.addClass("ck-widget_selected",C),this._previouslySelected.add(C),h=C)}},{priority:"low"}),t.addObserver($c),this.listenTo(n,"mousedown",(...i)=>this._onMousedown(...i)),this.listenTo(n,"arrowKey",(...i)=>{this._handleSelectionChangeOnArrowKeyPress(...i)},{context:[Ze,"$text"]}),this.listenTo(n,"arrowKey",(...i)=>{this._preventDefaultOnArrowKeyPress(...i)},{context:"$root"}),this.listenTo(n,"arrowKey",Zm(this.editor.editing),{context:"$text"}),this.listenTo(n,"delete",(i,o)=>{this._handleDelete(o.direction=="forward")&&(o.preventDefault(),i.stop())},{context:"$root"})}_onMousedown(e,t){const n=this.editor,i=n.editing.view,o=i.document;let a=t.target;if(function(u){for(;u;){if(u.is("editableElement")&&!u.is("rootElement"))return!0;if(Ze(u))return!1;u=u.parent}return!1}(a)){if((_n.isSafari||_n.isGecko)&&t.domEvent.detail>=3){const u=n.editing.mapper,h=a.is("attributeElement")?a.findAncestor(k=>!k.is("attributeElement")):a,m=u.toModelElement(h);t.preventDefault(),this.editor.model.change(k=>{k.setSelection(m,"in")})}return}if(!Ze(a)&&(a=a.findAncestor(Ze),!a))return;_n.isAndroid&&t.preventDefault(),o.isFocused||i.focus();const c=n.editing.mapper.toModelElement(a);this._setSelectionOverElement(c)}_handleSelectionChangeOnArrowKeyPress(e,t){const n=t.keyCode,i=this.editor.model,o=i.schema,a=i.document.selection,c=a.getSelectedElement(),u=mt(n,this.editor.locale.contentLanguageDirection);if(c&&o.isObject(c)){const m=u?a.getLastPosition():a.getFirstPosition(),k=o.getNearestSelectionRange(m,u?"forward":"backward");return void(k&&(i.change(C=>{C.setSelection(k)}),t.preventDefault(),e.stop()))}if(!a.isCollapsed)return;const h=this._getObjectElementNextToSelection(u);h&&o.isObject(h)&&(this._setSelectionOverElement(h),t.preventDefault(),e.stop())}_preventDefaultOnArrowKeyPress(e,t){const n=this.editor.model,i=n.schema,o=n.document.selection.getSelectedElement();o&&i.isObject(o)&&(t.preventDefault(),e.stop())}_handleDelete(e){if(this.editor.isReadOnly)return;const t=this.editor.model.document.selection;if(!t.isCollapsed)return;const n=this._getObjectElementNextToSelection(e);return n?(this.editor.model.change(i=>{let o=t.anchor.parent;for(;o.isEmpty;){const a=o;o=a.parent,i.remove(a)}this._setSelectionOverElement(n)}),!0):void 0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,n=t.schema,i=t.document.selection,o=t.createSelection(i);t.modifySelection(o,{direction:e?"forward":"backward"});const a=e?o.focus.nodeBefore:o.focus.nodeAfter;return a&&n.isObject(a)?a:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass("ck-widget_selected",t);this._previouslySelected.clear()}}function eb(r,e){return!!e&&Array.from(r.getAncestors()).includes(e)}var $u=function(r,e,t){var n=!0,i=!0;if(typeof r!="function")throw new TypeError("Expected a function");return oe(t)&&(n="leading"in t?!!t.leading:n,i="trailing"in t?!!t.trailing:i),Ua(r,e,{leading:n,maxWait:e,trailing:i})};v(67);class ao extends me{static get pluginName(){return"DragDrop"}static get requires(){return[tn,hl]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=$u(n=>this._updateDropMarker(n),40),this._removeDropMarkerDelayed=Di(()=>this._removeDropMarker(),40),this._clearDraggableAttributesDelayed=Di(()=>this._clearDraggableAttributes(),40),t.addObserver(Je),t.addObserver($c),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(n,i,o)=>{o?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(n,i,o)=>{o||this._finalizeDragging(!1)}),_n.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._updateDropMarkerThrottled.cancel(),this._removeDropMarkerDelayed.cancel(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,t=e.model,n=t.document,i=e.editing.view,o=i.document;this.listenTo(o,"dragstart",(a,c)=>{const u=n.selection;if(c.target&&c.target.is("editableElement"))return void c.preventDefault();const h=c.target?Uu(c.target):null;if(h){const C=e.editing.mapper.toModelElement(h);this._draggedRange=Or.fromRange(t.createRangeOn(C)),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}else if(!o.selection.isCollapsed){const C=o.selection.getSelectedElement();C&&Ze(C)||(this._draggedRange=Or.fromRange(u.getFirstRange()))}if(!this._draggedRange)return void c.preventDefault();this._draggingUid=P(),c.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",c.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const m=t.createSelection(this._draggedRange.toRange()),k=e.data.toView(t.getSelectedContent(m));o.fire("clipboardOutput",{dataTransfer:c.dataTransfer,content:k,method:a.name}),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(o,"dragend",(a,c)=>{this._finalizeDragging(!c.dataTransfer.isCanceled&&c.dataTransfer.dropEffect=="move")},{priority:"low"}),this.listenTo(o,"dragenter",()=>{this.isEnabled&&i.focus()}),this.listenTo(o,"dragleave",()=>{this._removeDropMarkerDelayed()}),this.listenTo(o,"dragging",(a,c)=>{if(!this.isEnabled)return void(c.dataTransfer.dropEffect="none");this._removeDropMarkerDelayed.cancel();const u=it(e,c.targetRanges,c.target);this._draggedRange||(c.dataTransfer.dropEffect="copy"),_n.isGecko||(c.dataTransfer.effectAllowed=="copy"?c.dataTransfer.dropEffect="copy":["all","copyMove"].includes(c.dataTransfer.effectAllowed)&&(c.dataTransfer.dropEffect="move")),u&&this._updateDropMarkerThrottled(u)},{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"clipboardInput",(n,i)=>{if(i.method!="drop")return;const o=it(e,i.targetRanges,i.target);if(this._removeDropMarker(),!o)return this._finalizeDragging(!1),void n.stop();if(this._draggedRange&&this._draggingUid!=i.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),Hu(i.dataTransfer)=="move"&&this._draggedRange&&this._draggedRange.containsRange(o,!0))return this._finalizeDragging(!1),void n.stop();i.targetRanges=[e.editing.mapper.toViewRange(o)]},{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(tn);e.on("contentInsertion",(t,n)=>{if(!this.isEnabled||n.method!=="drop")return;const i=n.targetRanges.map(o=>this.editor.editing.mapper.toModelRange(o));this.editor.model.change(o=>o.setSelection(i))},{priority:"high"}),e.on("contentInsertion",(t,n)=>{if(!this.isEnabled||n.method!=="drop")return;const i=Hu(n.dataTransfer)=="move",o=!n.resultRange||!n.resultRange.isCollapsed;this._finalizeDragging(o&&i)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,n=t.document;this.listenTo(n,"mousedown",(i,o)=>{if(_n.isAndroid||!o)return;this._clearDraggableAttributesDelayed.cancel();let a=Uu(o.target);if(_n.isBlink&&!e.isReadOnly&&!a&&!n.selection.isCollapsed){const c=n.selection.getSelectedElement();c&&Ze(c)||(a=n.selection.editableElement)}a&&(t.change(c=>{c.setAttribute("draggable","true",a)}),this._draggableElement=e.editing.mapper.toModelElement(a))}),this.listenTo(n,"mouseup",()=>{_n.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change(t=>{this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_setupDropMarker(){const e=this.editor;e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:n})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return n.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(i){const o=this.toDomElement(i);return o.innerHTML="⁠<span></span>⁠",o})}})}_updateDropMarker(e){const t=this.editor,n=t.model.markers;t.model.change(i=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(e)||i.updateMarker("drop-target",{range:e}):i.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})})}_removeDropMarker(){const e=this.editor.model;this._removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),e.markers.has("drop-target")&&e.change(t=>{t.removeMarker("drop-target")})}_finalizeDragging(e){const t=this.editor,n=t.model;this._removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._draggedRange&&(e&&this.isEnabled&&n.deleteContent(n.createSelection(this._draggedRange),{doNotAutoparagraph:!0}),this._draggedRange.detach(),this._draggedRange=null)}}function it(r,e,t){const n=r.model,i=r.editing.mapper;let o=null;const a=e?e[0].start:null;if(t.is("uiElement")&&(t=t.parent),o=function(h,m){const k=h.model,C=h.editing.mapper;if(Ze(m))return k.createRangeOn(C.toModelElement(m));if(!m.is("editableElement")){const S=m.findAncestor(N=>Ze(N)||N.is("editableElement"));if(Ze(S))return k.createRangeOn(C.toModelElement(S))}return null}(r,t),o)return o;const c=function(h,m){const k=h.editing.mapper,C=h.editing.view,S=k.toModelElement(m);if(S)return S;const N=C.createPositionBefore(m),D=k.findMappedViewAncestor(N);return k.toModelElement(D)}(r,t),u=a?i.toModelPosition(a):null;return u?(o=function(h,m,k){const C=h.model;if(!C.schema.checkChild(k,"$block"))return null;const S=C.createPositionAt(k,0),N=m.path.slice(0,S.path.length),D=C.createPositionFromPath(m.root,N).nodeAfter;return D&&C.schema.isObject(D)?C.createRangeOn(D):null}(r,u,c),o||(o=n.schema.getNearestSelectionRange(u,_n.isGecko?"forward":"backward"),o||function(h,m){const k=h.model;for(;m;){if(k.schema.isObject(m))return k.createRangeOn(m);m=m.parent}}(r,u.parent))):function(h,m){const k=h.model,C=k.schema,S=k.createPositionAt(m,0);return C.getNearestSelectionRange(S,"forward")}(r,c)}function Hu(r){return _n.isGecko?r.dropEffect:["all","copyMove"].includes(r.effectAllowed)?"move":"copy"}function Di(r,e){let t;function n(...i){n.cancel(),t=setTimeout(()=>r(...i),e)}return n.cancel=()=>{clearTimeout(t)},n}function Uu(r){if(r.is("editableElement"))return null;if(r.hasClass("ck-widget__selection-handle"))return r.findAncestor(Ze);if(Ze(r))return r;const e=r.findAncestor(t=>Ze(t)||t.is("editableElement"));return Ze(e)?e:null}class tb extends me{static get pluginName(){return"PastePlainText"}static get requires(){return[tn]}init(){const e=this.editor,t=e.model,n=e.editing.view,i=n.document,o=t.document.selection;let a=!1;n.addObserver(Je),this.listenTo(i,"keydown",(c,u)=>{a=u.shiftKey}),e.plugins.get(tn).on("contentInsertion",(c,u)=>{(a||function(h,m){if(h.childCount>1)return!1;const k=h.getChild(0);return m.isObject(k)?!1:[...k.getAttributeKeys()].length==0}(u.content,t.schema))&&t.change(h=>{const m=Array.from(o.getAttributes()).filter(([C])=>t.schema.getAttributeProperties(C).isFormatting);o.isCollapsed||t.deleteContent(o,{doNotAutoparagraph:!0}),m.push(...o.getAttributes());const k=h.createRangeIn(u.content);for(const C of k.getItems())C.is("$textProxy")&&h.setAttributes(m,C)})})}}class Tt extends me{static get pluginName(){return"Clipboard"}static get requires(){return[tn,ao,tb]}}class nb extends ct{execute(){const e=this.editor.model,t=e.document;e.change(n=>{(function(i,o,a){const c=a.isCollapsed,u=a.getFirstRange(),h=u.start.parent,m=u.end.parent,k=h==m;if(c){const C=sn(i.schema,a.getAttributes());Wu(i,o,u.end),o.removeSelectionAttribute(a.getAttributeKeys()),o.setSelectionAttribute(C)}else{const C=!(u.start.isAtStart&&u.end.isAtEnd);i.deleteContent(a,{leaveUnmerged:C}),k?Wu(i,o,a.focus):C&&o.setSelection(m,0)}})(e,n,t.selection),this.fire("afterExecute",{writer:n})})}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(n,i){if(i.rangeCount>1)return!1;const o=i.anchor;if(!o||!n.checkChild(o,"softBreak"))return!1;const a=i.getFirstRange(),c=a.start.parent,u=a.end.parent;return!((Js(c,n)||Js(u,n))&&c!==u)}(e.schema,t.selection)}}function Wu(r,e,t){const n=e.createElement("softBreak");r.insertContent(n,t),e.setSelection(n,"after")}function Js(r,e){return!r.is("rootElement")&&(e.isLimit(r)||Js(r.parent,e))}class ib extends me{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor,t=e.model.schema,n=e.conversion,i=e.editing.view,o=i.document;t.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(a,{writer:c})=>c.createEmptyElement("br")}),i.addObserver(up),e.commands.add("shiftEnter",new nb(e)),this.listenTo(o,"enter",(a,c)=>{c.preventDefault(),c.isSoft&&(e.execute("shiftEnter"),i.scrollToTheSelection())},{priority:"low"})}}class rb extends ct{execute(){const e=this.editor.model,t=e.document.selection;let n=e.schema.getLimitElement(t);if(t.containsEntireContent(n)||!kp(e.schema,n))do if(n=n.parent,!n)return;while(!kp(e.schema,n));e.change(i=>{i.setSelection(n,"in")})}}function kp(r,e){return r.isLimit(e)&&(r.checkChild(e,"$text")||r.checkChild(e,"paragraph"))}const ob=Oo("Ctrl+A");class sb extends me{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor,t=e.editing.view.document;e.commands.add("selectAll",new rb(e)),this.listenTo(t,"keydown",(n,i)=>{R(i)===ob&&(e.execute("selectAll"),i.preventDefault())})}}class ab extends me{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",t=>{const n=e.commands.get("selectAll"),i=new Jt(t),o=t.t;return i.set({label:o("Select all"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M.75 15.5a.75.75 0 0 1 .75.75V18l.008.09A.5.5 0 0 0 2 18.5h1.75a.75.75 0 1 1 0 1.5H1.5l-.144-.007a1.5 1.5 0 0 1-1.35-1.349L0 18.5v-2.25a.75.75 0 0 1 .75-.75zm18.5 0a.75.75 0 0 1 .75.75v2.25l-.007.144a1.5 1.5 0 0 1-1.349 1.35L18.5 20h-2.25a.75.75 0 1 1 0-1.5H18a.5.5 0 0 0 .492-.41L18.5 18v-1.75a.75.75 0 0 1 .75-.75zm-10.45 3c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm.45-5.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5h8.5zM1.3 11c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM1.3 7c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5h-2.5a.75.75 0 1 1 0-1.5h2.5zm-5 0a.75.75 0 1 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5h5.5zm-6.5-5a.75.75 0 0 1 0 1.5H2a.5.5 0 0 0-.492.41L1.5 2v1.75a.75.75 0 0 1-1.5 0V1.5l.007-.144A1.5 1.5 0 0 1 1.356.006L1.5 0h2.25zM18.5 0l.144.007a1.5 1.5 0 0 1 1.35 1.349L20 1.5v2.25a.75.75 0 1 1-1.5 0V2l-.008-.09A.5.5 0 0 0 18 1.5h-1.75a.75.75 0 1 1 0-1.5h2.25zM8.8 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6z"/></svg>',keystroke:"Ctrl+A",tooltip:!0}),i.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(i,"execute",()=>{e.execute("selectAll"),e.editing.view.focus()}),i})}}class lb extends me{static get requires(){return[sb,ab]}static get pluginName(){return"SelectAll"}}class cb extends ct{constructor(e,t){super(e),this._buffer=new hp(e.model,t),this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,n=t.document,i=e.text||"",o=i.length,a=e.range?t.createSelection(e.range):n.selection,c=e.resultRange;t.enqueueChange(this._buffer.batch,u=>{this._buffer.lock(),this._batches.add(this._buffer.batch),t.deleteContent(a),i&&t.insertContent(u.createText(i,n.selection.getAttributes()),a),c?u.setSelection(c):a.is("documentSelection")||u.setSelection(a),this._buffer.unlock(),this._buffer.input(o)})}}function yp(r){if(r.newChildren.length-r.oldChildren.length!=1)return;const e=function(n,i){const o=[];let a,c=0;return n.forEach(m=>{m=="equal"?(u(),c++):m=="insert"?(h("insert")?a.values.push(i[c]):(u(),a={type:"insert",index:c,values:[i[c]]}),c++):h("delete")?a.howMany++:(u(),a={type:"delete",index:c,howMany:1})}),u(),o;function u(){a&&(o.push(a),a=null)}function h(m){return a&&a.type==m}}(Ro(r.oldChildren,r.newChildren,db),r.newChildren);if(e.length>1)return;const t=e[0];return t.values[0]&&t.values[0].is("$text")?t:void 0}function db(r,e){return r&&r.is("$text")&&e&&e.is("$text")?r.data===e.data:r===e}class ub{constructor(e){this.editor=e,this.editing=this.editor.editing}handle(e,t){if(function(n){if(n.length==0)return!1;for(const i of n)if(i.type==="children"&&!yp(i))return!0;return!1}(e))this._handleContainerChildrenMutations(e,t);else for(const n of e)this._handleTextMutation(n,t),this._handleTextNodeInsertion(n)}_handleContainerChildrenMutations(e,t){const n=function(Kn){const ri=Kn.map(Gn=>Gn.node).reduce((Gn,Wi)=>Gn.getCommonAncestor(Wi,{includeSelf:!0}));if(ri)return ri.getAncestors({includeSelf:!0,parentFirst:!0}).find(Gn=>Gn.is("containerElement")||Gn.is("rootElement"))}(e);if(!n)return;const i=this.editor.editing.view.domConverter.mapViewToDom(n),o=new Sr(this.editor.editing.view.document),a=this.editor.data.toModel(o.domToView(i)).getChild(0),c=this.editor.editing.mapper.toModelElement(n);if(!c)return;const u=Array.from(a.getChildren()),h=Array.from(c.getChildren()),m=u[u.length-1],k=h[h.length-1],C=m&&m.is("element","softBreak"),S=k&&!k.is("element","softBreak");C&&S&&u.pop();const N=this.editor.model.schema;if(!xp(u,N)||!xp(h,N))return;const D=u.map(Kn=>Kn.is("$text")?Kn.data:"@").join("").replace(/\u00A0/g," "),z=h.map(Kn=>Kn.is("$text")?Kn.data:"@").join("").replace(/\u00A0/g," ");if(z===D)return;const U=Ro(z,D),{firstChangeAt:J,insertions:ce,deletions:ye}=Cp(U);let ze=null;t&&(ze=this.editing.mapper.toModelRange(t.getFirstRange()));const Kt=D.substr(J,ce),vt=this.editor.model.createRange(this.editor.model.createPositionAt(c,J),this.editor.model.createPositionAt(c,J+ye));this.editor.execute("input",{text:Kt,range:vt,resultRange:ze})}_handleTextMutation(e,t){if(e.type!="text")return;const n=e.newText.replace(/\u00A0/g," "),i=e.oldText.replace(/\u00A0/g," ");if(i===n)return;const o=Ro(i,n),{firstChangeAt:a,insertions:c,deletions:u}=Cp(o);let h=null;t&&(h=this.editing.mapper.toModelRange(t.getFirstRange()));const m=this.editing.view.createPositionAt(e.node,a),k=this.editing.mapper.toModelPosition(m),C=this.editor.model.createRange(k,k.getShiftedBy(u)),S=n.substr(a,c);this.editor.execute("input",{text:S,range:C,resultRange:h})}_handleTextNodeInsertion(e){if(e.type!="children")return;const t=yp(e),n=this.editing.view.createPositionAt(e.node,t.index),i=this.editing.mapper.toModelPosition(n),o=t.values[0].data;this.editor.execute("input",{text:o.replace(/\u00A0/g," "),range:this.editor.model.createRange(i)})}}function xp(r,e){return r.every(t=>e.isInline(t))}function Cp(r){let e=null,t=null;for(let o=0;o<r.length;o++)r[o]!="equal"&&(e=e===null?o:e,t=o);let n=0,i=0;for(let o=e;o<=t;o++)r[o]!="insert"&&n++,r[o]!="delete"&&i++;return{insertions:i,deletions:n,firstChangeAt:e}}class Wc extends me{static get pluginName(){return"Input"}init(){const e=this.editor,t=new cb(e,e.config.get("typing.undoStep")||20);e.commands.add("input",t),function(n){let i=null;const o=n.model,a=n.editing.view,c=n.commands.get("input");function u(m){const k=o.document,C=a.document.isComposing,S=i&&i.isEqual(k.selection);i=null,c.isEnabled&&(Vu(m)||k.selection.isCollapsed||C&&m.keyCode===229||!C&&m.keyCode===229&&S||h())}function h(){const m=c.buffer;m.lock();const k=m.batch;c._batches.add(k),o.enqueueChange(k,()=>{o.deleteContent(o.document.selection)}),m.unlock()}_n.isAndroid?a.document.on("beforeinput",(m,k)=>u(k),{priority:"lowest"}):a.document.on("keydown",(m,k)=>u(k),{priority:"lowest"}),a.document.on("compositionstart",function(){const m=o.document,k=m.selection.rangeCount!==1||m.selection.getFirstRange().isFlat;m.selection.isCollapsed||k||h()},{priority:"lowest"}),a.document.on("compositionend",()=>{i=o.createSelection(o.document.selection)},{priority:"lowest"})}(e),function(n){n.editing.view.document.on("mutations",(i,o,a)=>{new ub(n).handle(o,a)})}(e)}isInput(e){return this.editor.commands.get("input")._batches.has(e)}}class hb extends me{static get requires(){return[Wc,us]}static get pluginName(){return"Typing"}}function qc(r,e){let t=r.start;return{text:Array.from(r.getItems()).reduce((n,i)=>i.is("$text")||i.is("$textProxy")?n+i.data:(t=e.createPositionAfter(i),""),""),range:e.createRange(t,r.end)}}class qu{constructor(e,t){this.model=e,this.testCallback=t,this.hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",(t,{directChange:n})=>{n&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this.hasMatch=!1))}),this.listenTo(e,"change:data",(t,n)=>{n.type!="transparent"&&this._evaluateTextBeforeSelection("data",{batch:n})})}_evaluateTextBeforeSelection(e,t={}){const n=this.model,i=n.document.selection,o=n.createRange(n.createPositionAt(i.focus.parent,0),i.focus),{text:a,range:c}=qc(o,n),u=this.testCallback(a);if(!u&&this.hasMatch&&this.fire("unmatched"),this.hasMatch=!!u,u){const h=Object.assign(t,{text:a,range:c});typeof u=="object"&&Object.assign(h,u),this.fire("matched:"+e,h)}}}Le(qu,Wt);class Tp extends me{static get pluginName(){return"TwoStepCaretMovement"}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){const e=this.editor,t=e.model,n=e.editing.view,i=e.locale,o=t.document.selection;this.listenTo(n.document,"arrowKey",(a,c)=>{if(!o.isCollapsed||c.shiftKey||c.altKey||c.ctrlKey)return;const u=c.keyCode==ot.arrowright,h=c.keyCode==ot.arrowleft;if(!u&&!h)return;const m=i.contentLanguageDirection;let k=!1;k=m==="ltr"&&u||m==="rtl"&&h?this._handleForwardMovement(c):this._handleBackwardMovement(c),k===!0&&a.stop()},{context:"$text",priority:"highest"}),this._isNextGravityRestorationSkipped=!1,this.listenTo(o,"change:range",(a,c)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!c.directChange&&Kc(o.getFirstPosition(),this.attributes)||this._restoreGravity())})}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,n=this.editor.model.document.selection,i=n.getFirstPosition();return!this._isGravityOverridden&&(!i.isAtStart||!Ku(n,t))&&(Kc(i,t)?(Dn(e),this._overrideGravity(),!0):void 0)}_handleBackwardMovement(e){const t=this.attributes,n=this.editor.model,i=n.document.selection,o=i.getFirstPosition();return this._isGravityOverridden?(Dn(e),this._restoreGravity(),gn(n,t,o),!0):o.isAtStart?!!Ku(i,t)&&(Dn(e),gn(n,t,o),!0):function(a,c){return Kc(a.getShiftedBy(-1),c)}(o,t)?o.isAtEnd&&!Ku(i,t)&&Kc(o,t)?(Dn(e),gn(n,t,o),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):void 0}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function Ku(r,e){for(const t of e)if(r.hasAttribute(t))return!0;return!1}function gn(r,e,t){const n=t.nodeBefore;r.change(i=>{n?i.setSelectionAttribute(n.getAttributes()):i.removeSelectionAttribute(e)})}function Dn(r){r.preventDefault()}function Kc(r,e){const{nodeBefore:t,nodeAfter:n}=r;for(const i of e){const o=t?t.getAttribute(i):void 0;if((n?n.getAttribute(i):void 0)!==o)return!0}return!1}var Ap=/[\\^$.*+?()[\]{}|]/g,fb=RegExp(Ap.source),Sp=function(r){return(r=En(r))&&fb.test(r)?r.replace(Ap,"\\$&"):r};const pb={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:"1/2",to:"½"},oneThird:{from:"1/3",to:"⅓"},twoThirds:{from:"2/3",to:"⅔"},oneForth:{from:"1/4",to:"¼"},threeQuarters:{from:"3/4",to:"¾"},lessThanOrEqual:{from:"<=",to:"≤"},greaterThanOrEqual:{from:">=",to:"≥"},notEqual:{from:"!=",to:"≠"},arrowLeft:{from:"<-",to:"←"},arrowRight:{from:"->",to:"→"},horizontalEllipsis:{from:"...",to:"…"},enDash:{from:/(^| )(--)( )$/,to:[null,"–",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"—",null]},quotesPrimary:{from:Zs('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:Zs("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:Zs("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:Zs('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:Zs('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:Zs("'"),to:[null,"‚",null,"’"]}},Ep={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},gb=["symbols","mathematical","typography","quotes"];function Pp(r){return typeof r=="string"?new RegExp(`(${Sp(r)})$`):r}function mb(r){return typeof r=="string"?()=>[r]:r instanceof Array?()=>r:r}function bb(r){return(r.textNode?r.textNode:r.nodeAfter).getAttributes()}function Zs(r){return new RegExp(`(^|\\s)(${r})([^${r}]*)(${r})$`)}function fs(r,e,t,n){return n.createRange(Gu(r,e,t,!0,n),Gu(r,e,t,!1,n))}function Gu(r,e,t,n,i){let o=r.textNode||(n?r.nodeBefore:r.nodeAfter),a=null;for(;o&&o.getAttribute(e)==t;)a=o,o=n?o.previousSibling:o.nextSibling;return a?i.createPositionAt(a,n?"before":"after"):r}class Ip extends ct{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this.listenTo(e.data,"set",(t,n)=>{n[1]={...n[1]};const i=n[1];i.batchType||(i.batchType="transparent")},{priority:"high"}),this.listenTo(e.data,"set",(t,n)=>{n[1].batchType==="transparent"&&this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}addBatch(e){const t=this.editor.model.document.selection,n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,n){const i=this.editor.model,o=i.document,a=[],c=e.map(h=>h.getTransformedByOperations(n)),u=c.flat();for(const h of c){const m=h.filter(k=>k.root!=o.graveyard).filter(k=>!_b(k,u));m.length&&(vb(m),a.push(m[0]))}a.length&&i.change(h=>{h.setSelection(a,{backward:t})})}_undo(e,t){const n=this.editor.model,i=n.document;this._createdBatches.add(t);const o=e.operations.slice().filter(a=>a.isDocumentOperation);o.reverse();for(const a of o){const c=a.baseVersion+1,u=Array.from(i.history.getOperations(c)),h=Um([a.getReversed()],u,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const m of h)t.addOperation(m),n.applyOperation(m),i.history.setOperationAsUndone(a,m)}}}function vb(r){r.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let e=1;e<r.length;e++){const t=r[e-1].getJoined(r[e],!0);t&&(e--,r.splice(e,2,t))}}function _b(r,e){return e.some(t=>t!==r&&t.containsRange(r,!0))}class wb extends Ip{execute(e=null){const t=e?this._stack.findIndex(o=>o.batch==e):this._stack.length-1,n=this._stack.splice(t,1)[0],i=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(i,()=>{this._undo(n.batch,i);const o=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,o),this.fire("revert",n.batch,i)}),this.refresh()}}class ea extends Ip{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(t,()=>{const n=e.batch.operations[e.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,i),this._undo(e.batch,t)}),this.refresh()}}class kb extends me{static get pluginName(){return"UndoEditing"}constructor(e){super(e),this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new wb(e),this._redoCommand=new ea(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(t,n)=>{const i=n[0];if(!i.isDocumentOperation)return;const o=i.batch,a=this._redoCommand._createdBatches.has(o),c=this._undoCommand._createdBatches.has(o);this._batchRegistry.has(o)||o.type=="transparent"&&!a&&!c||(a?this._undoCommand.addBatch(o):c||(this._undoCommand.addBatch(o),this._redoCommand.clearStack()),this._batchRegistry.add(o))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(t,n,i)=>{this._redoCommand.addBatch(i)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo")}}var Mp='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m5.042 9.367 2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.747.747 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.75.75 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032H5.042z"/></svg>',Op='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m14.958 9.367-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.747.747 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.75.75 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032h8.927z"/></svg>';class yb extends me{static get pluginName(){return"UndoUI"}init(){const e=this.editor,t=e.locale,n=e.t,i=t.uiLanguageDirection=="ltr"?Mp:Op,o=t.uiLanguageDirection=="ltr"?Op:Mp;this._addButton("undo",n("Undo"),"CTRL+Z",i),this._addButton("redo",n("Redo"),"CTRL+Y",o)}_addButton(e,t,n,i){const o=this.editor;o.ui.componentFactory.add(e,a=>{const c=o.commands.get(e),u=new Jt(a);return u.set({label:t,icon:i,keystroke:n,tooltip:!0}),u.bind("isEnabled").to(c,"isEnabled"),this.listenTo(u,"execute",()=>{o.execute(e),o.editing.view.focus()}),u})}}class Np extends me{static get requires(){return[kb,yb]}static get pluginName(){return"Undo"}}class Qu{constructor(){const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((n,i)=>{t.onload=()=>{const o=t.result;this._data=o,n(o)},t.onerror=()=>{i("error")},t.onabort=()=>{i("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}Le(Qu,Wt);class ar extends me{static get pluginName(){return"FileRepository"}static get requires(){return[Mf]}init(){this.loaders=new li,this.loaders.on("add",()=>this._updatePendingAction()),this.loaders.on("remove",()=>this._updatePendingAction()),this._loadersMap=new Map,this._pendingAction=null,this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return Object(y.b)("filerepository-no-upload-adapter"),null;const t=new Yu(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(n=>{this._loadersMap.set(n,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let n=0;for(const i of this.loaders)n+=i.uploaded;this.uploaded=n}),t.on("change:uploadTotal",()=>{let n=0;for(const i of this.loaders)i.uploadTotal&&(n+=i.uploadTotal);this.uploadTotal=n}),t}destroyLoader(e){const t=e instanceof Yu?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((n,i)=>{n===t&&this._loadersMap.delete(i)})}_updatePendingAction(){const e=this.editor.plugins.get(Mf);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,n=i=>`${t("Upload in progress")} ${parseInt(i)}%.`;this._pendingAction=e.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else e.remove(this._pendingAction),this._pendingAction=null}}Le(ar,Wt);class Yu{constructor(e,t){this.id=P(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new Qu,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(n,i)=>i?n/i*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new y.a("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!=="reading")throw this.status;return this.status="idle",e}).catch(e=>{throw e==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:e)})}upload(){if(this.status!="idle")throw new y.a("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{throw this.status==="aborted"?"aborted":(this.status="error",e)})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?e=="reading"?this._reader.abort():e=="uploading"&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise((n,i)=>{t.rejecter=i,t.isFulfilled=!1,e.then(o=>{t.isFulfilled=!0,n(o)}).catch(o=>{t.isFulfilled=!0,i(o)})}),t}}Le(Yu,Wt);class xb extends ut{constructor(e){super(e),this.buttonView=new Jt(e),this._fileInputView=new Cb(e),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[this.buttonView,this._fileInputView]}),this.buttonView.on("execute",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class Cb extends ut{constructor(e){super(e),this.set("acceptedType"),this.set("allowMultipleFiles",!1);const 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()}}function Tb(){let r=function(n){n=n.toLowerCase();const i=document.cookie.split(";");for(const o of i){const a=o.split("=");if(decodeURIComponent(a[0].trim().toLowerCase())===n)return decodeURIComponent(a[1])}return null}("ckCsrfToken");var e,t;return r&&r.length==40||(r=function(n){let i="";const o=new Uint8Array(n);window.crypto.getRandomValues(o);for(let a=0;a<o.length;a++){const c="abcdefghijklmnopqrstuvwxyz0123456789".charAt(o[a]%36);i+=Math.random()>.5?c.toUpperCase():c}return i}(40),e="ckCsrfToken",t=r,document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/"),r}class Ab{constructor(e,t,n){this.loader=e,this.url=t,this.t=n}upload(){return this.loader.file.then(e=>new Promise((t,n)=>{this._initRequest(),this._initListeners(t,n,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,n){const i=this.xhr,o=this.loader,a=(0,this.t)("Cannot upload file:")+` ${n.name}.`;i.addEventListener("error",()=>t(a)),i.addEventListener("abort",()=>t()),i.addEventListener("load",()=>{const c=i.response;if(!c||!c.uploaded)return t(c&&c.error&&c.error.message?c.error.message:a);e({default:c.url})}),i.upload&&i.upload.addEventListener("progress",c=>{c.lengthComputable&&(o.uploadTotal=c.total,o.uploaded=c.loaded)})}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",Tb()),this.xhr.send(t)}}function zo(r,e,t,n){let i,o=null;typeof n=="function"?i=n:(o=r.commands.get(n),i=()=>{r.execute(n)}),r.model.document.on("change:data",(a,c)=>{if(o&&!o.isEnabled||!e.isEnabled)return;const u=ui(r.model.document.selection.getRanges());if(!u.isCollapsed||c.type=="transparent")return;const h=Array.from(r.model.document.differ.getChanges()),m=h[0];if(h.length!=1||m.type!=="insert"||m.name!="$text"||m.length!=1)return;const k=m.position.parent;if(k.is("element","codeBlock")||k.is("element","listItem")&&typeof n!="function"&&!["numberedList","bulletedList","todoList"].includes(n)||o&&o.value===!0)return;const C=k.getChild(0),S=r.model.createRangeOn(C);if(!S.containsRange(u)&&!u.end.isEqual(S.end))return;const N=t.exec(C.data.substr(0,u.end.offset));N&&r.model.enqueueChange(D=>{const z=D.createPositionAt(k,0),U=D.createPositionAt(k,N[0].length),J=new Or(z,U);if(i({match:N})!==!1){D.remove(J);const ce=r.model.document.selection.getFirstRange(),ye=D.createRangeIn(k);!k.isEmpty||ye.isEqual(ce)||ye.containsRange(ce,!0)||D.remove(k)}J.detach()})})}function ta(r,e,t,n){let i,o;t instanceof RegExp?i=t:o=t,o=o||(a=>{let c;const u=[],h=[];for(;(c=i.exec(a))!==null&&!(c&&c.length<4);){let{index:m,1:k,2:C,3:S}=c;const N=k+C+S;m+=c[0].length-N.length;const D=[m,m+k.length],z=[m+k.length+C.length,m+k.length+C.length+S.length];u.push(D),u.push(z),h.push([m+k.length,m+k.length+C.length])}return{remove:u,format:h}}),r.model.document.on("change:data",(a,c)=>{if(c.type=="transparent"||!e.isEnabled)return;const u=r.model,h=u.document.selection;if(!h.isCollapsed)return;const m=Array.from(u.document.differ.getChanges()),k=m[0];if(m.length!=1||k.type!=="insert"||k.name!="$text"||k.length!=1)return;const C=h.focus,S=C.parent,{text:N,range:D}=function(ce,ye){let ze=ce.start;return{text:Array.from(ce.getItems()).reduce((Kt,vt)=>!vt.is("$text")&&!vt.is("$textProxy")||vt.getAttribute("code")?(ze=ye.createPositionAfter(vt),""):Kt+vt.data,""),range:ye.createRange(ze,ce.end)}}(u.createRange(u.createPositionAt(S,0),C),u),z=o(N),U=Rp(D.start,z.format,u),J=Rp(D.start,z.remove,u);U.length&&J.length&&u.enqueueChange(ce=>{if(n(ce,U)!==!1)for(const ye of J.reverse())ce.remove(ye)})})}function Rp(r,e,t){return e.filter(n=>n[0]!==void 0&&n[1]!==void 0).map(n=>t.createRange(r.getShiftedBy(n[0]),r.getShiftedBy(n[1])))}function Gc(r,e){return(t,n)=>{if(!r.commands.get(e).isEnabled)return!1;const i=r.model.schema.getValidRanges(n,e);for(const o of i)t.setAttribute(e,!0,o);t.removeSelectionAttribute(e)}}class Dp extends ct{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,i=e.forceValue===void 0?!this.value:e.forceValue;t.change(o=>{if(n.isCollapsed)i?o.setSelectionAttribute(this.attributeKey,!0):o.removeSelectionAttribute(this.attributeKey);else{const a=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const c of a)i?o.setAttribute(this.attributeKey,i,c):o.removeAttribute(this.attributeKey,c)}})}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,n=e.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const i of n.getRanges())for(const o of i.getItems())if(t.checkAttribute(o,this.attributeKey))return o.hasAttribute(this.attributeKey);return!1}}class Sb extends me{static get pluginName(){return"BoldEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"bold"}),e.model.schema.setAttributeProperties("bold",{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:"bold",view:"strong",upcastAlso:["b",t=>{const n=t.getStyle("font-weight");return n?n=="bold"||Number(n)>=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),e.commands.add("bold",new Dp(e,"bold")),e.keystrokes.set("CTRL+B","bold")}}class Eb extends me{static get pluginName(){return"BoldUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("bold",n=>{const i=e.commands.get("bold"),o=new Jt(n);return o.set({label:t("Bold"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.187 17H5.773c-.637 0-1.092-.138-1.364-.415-.273-.277-.409-.718-.409-1.323V4.738c0-.617.14-1.062.419-1.332.279-.27.73-.406 1.354-.406h4.68c.69 0 1.288.041 1.793.124.506.083.96.242 1.36.478.341.197.644.447.906.75a3.262 3.262 0 0 1 .808 2.162c0 1.401-.722 2.426-2.167 3.075C15.05 10.175 16 11.315 16 13.01a3.756 3.756 0 0 1-2.296 3.504 6.1 6.1 0 0 1-1.517.377c-.571.073-1.238.11-2 .11zm-.217-6.217H7v4.087h3.069c1.977 0 2.965-.69 2.965-2.072 0-.707-.256-1.22-.768-1.537-.512-.319-1.277-.478-2.296-.478zM7 5.13v3.619h2.606c.729 0 1.292-.067 1.69-.2a1.6 1.6 0 0 0 .91-.765c.165-.267.247-.566.247-.897 0-.707-.26-1.176-.778-1.409-.519-.232-1.31-.348-2.375-.348H7z"/></svg>',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{e.execute("bold"),e.editing.view.focus()}),o})}}class Pb extends me{static get pluginName(){return"ItalicEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"italic"}),e.model.schema.setAttributeProperties("italic",{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:"italic",view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add("italic",new Dp(e,"italic")),e.keystrokes.set("CTRL+I","italic")}}class Ib extends me{static get pluginName(){return"ItalicUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("italic",n=>{const i=e.commands.get("italic"),o=new Jt(n);return o.set({label:t("Italic"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m9.586 14.633.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z"/></svg>',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{e.execute("italic"),e.editing.view.focus()}),o})}}class Mb extends ct{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.schema,i=t.document.selection,o=Array.from(i.getSelectedBlocks()),a=e.forceValue===void 0?!this.value:e.forceValue;t.change(c=>{if(a){const u=o.filter(h=>Qc(h)||Lp(n,h));this._applyQuote(c,u)}else this._removeQuote(c,o.filter(Qc))})}_getValue(){const e=ui(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!Qc(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=ui(e.getSelectedBlocks());return!!n&&Lp(t,n)}_removeQuote(e,t){jp(e,t).reverse().forEach(n=>{if(n.start.isAtStart&&n.end.isAtEnd)return void e.unwrap(n.start.parent);if(n.start.isAtStart){const o=e.createPositionBefore(n.start.parent);return void e.move(n,o)}n.end.isAtEnd||e.split(n.end);const i=e.createPositionAfter(n.end.parent);e.move(n,i)})}_applyQuote(e,t){const n=[];jp(e,t).reverse().forEach(i=>{let o=Qc(i.start);o||(o=e.createElement("blockQuote"),e.wrap(i,o)),n.push(o)}),n.reverse().reduce((i,o)=>i.nextSibling==o?(e.merge(e.createPositionAfter(i)),i):o)}}function Qc(r){return r.parent.name=="blockQuote"?r.parent:null}function jp(r,e){let t,n=0;const i=[];for(;n<e.length;){const o=e[n],a=e[n+1];t||(t=r.createPositionBefore(o)),a&&o.nextSibling==a||(i.push(r.createRange(t,r.createPositionAfter(o))),t=null),n++}return i}function Lp(r,e){const t=r.checkChild(e.parent,"blockQuote"),n=r.checkChild(["$root","blockQuote"],e);return t&&n}class Ob extends me{static get pluginName(){return"BlockQuoteEditing"}static get requires(){return[Hc,us]}init(){const e=this.editor,t=e.model.schema;e.commands.add("blockQuote",new Mb(e)),t.register("blockQuote",{allowWhere:"$block",allowContentOf:"$root"}),e.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),e.model.document.registerPostFixer(a=>{const c=e.model.document.differ.getChanges();for(const u of c)if(u.type=="insert"){const h=u.position.nodeAfter;if(!h)continue;if(h.is("element","blockQuote")&&h.isEmpty)return a.remove(h),!0;if(h.is("element","blockQuote")&&!t.checkChild(u.position,h))return a.unwrap(h),!0;if(h.is("element")){const m=a.createRangeIn(h);for(const k of m.getItems())if(k.is("element","blockQuote")&&!t.checkChild(a.createPositionBefore(k),k))return a.unwrap(k),!0}}else if(u.type=="remove"){const h=u.position.parent;if(h.is("element","blockQuote")&&h.isEmpty)return a.remove(h),!0}return!1});const n=this.editor.editing.view.document,i=e.model.document.selection,o=e.commands.get("blockQuote");this.listenTo(n,"enter",(a,c)=>{!i.isCollapsed||!o.value||i.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),c.preventDefault(),a.stop())},{context:"blockquote"}),this.listenTo(n,"delete",(a,c)=>{if(c.direction!="backward"||!i.isCollapsed||!o.value)return;const u=i.getLastPosition().parent;u.isEmpty&&!u.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),c.preventDefault(),a.stop())},{context:"blockquote"})}}v(69);class Nb extends me{static get pluginName(){return"BlockQuoteUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("blockQuote",n=>{const i=e.commands.get("blockQuote"),o=new Jt(n);return o.set({label:t("Block quote"),icon:Oi.quote,tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(o,"execute",()=>{e.execute("blockQuote"),e.editing.view.focus()}),o})}}class Rb extends me{static get pluginName(){return"CKFinderUI"}init(){const e=this.editor,t=e.ui.componentFactory,n=e.t;t.add("ckfinder",i=>{const o=e.commands.get("ckfinder"),a=new Jt(i);return a.set({label:n("Insert image or file"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.627 16.5zm5.873-.196zm0-7.001V8h-13v8.5h4.341c.191.54.457 1.044.785 1.5H2a1.5 1.5 0 0 1-1.5-1.5v-13A1.5 1.5 0 0 1 2 2h4.5a1.5 1.5 0 0 1 1.06.44L9.122 4H16a1.5 1.5 0 0 1 1.5 1.5v1A1.5 1.5 0 0 1 19 8v2.531a6.027 6.027 0 0 0-1.5-1.228zM16 6.5v-1H8.5l-2-2H2v13h1V8a1.5 1.5 0 0 1 1.5-1.5H16z"/><path d="M14.5 19.5a5 5 0 1 1 0-10 5 5 0 0 1 0 10zM15 14v-2h-1v2h-2v1h2v2h1v-2h2v-1h-2z"/></svg>',tooltip:!0}),a.bind("isEnabled").to(o),a.on("execute",()=>{e.execute("ckfinder"),e.editing.view.focus()}),a})}}class Db extends ct{constructor(e){super(e),this.stopListening(this.editor.model.document,"change"),this.listenTo(this.editor.model.document,"change",()=>this.refresh(),{priority:"low"})}refresh(){const e=this.editor.commands.get("insertImage"),t=this.editor.commands.get("link");this.isEnabled=e.isEnabled||t.isEnabled}execute(){const e=this.editor,t=this.editor.config.get("ckfinder.openerMethod")||"modal";if(t!="popup"&&t!="modal")throw new y.a("ckfinder-unknown-openermethod",e);const n=this.editor.config.get("ckfinder.options")||{};n.chooseFiles=!0;const i=n.onInit;n.language||(n.language=e.locale.uiLanguage),n.onInit=o=>{i&&i(o),o.on("files:choose",a=>{const c=a.data.files.toArray(),u=c.filter(k=>!k.isImage()),h=c.filter(k=>k.isImage());for(const k of u)e.execute("link",k.getUrl());const m=[];for(const k of h){const C=k.getUrl();m.push(C||o.request("file:getProxyUrl",{file:k}))}m.length&&zp(e,m)}),o.on("file:choose:resizedImage",a=>{const c=a.data.resizedUrl;if(c)zp(e,[c]);else{const u=e.plugins.get("Notification"),h=e.locale.t;u.showWarning(h("Could not obtain resized image URL."),{title:h("Selecting resized image failed"),namespace:"ckfinder"})}})},window.CKFinder[t](n)}}function zp(r,e){if(r.commands.get("insertImage").isEnabled)r.execute("insertImage",{source:e});else{const t=r.plugins.get("Notification"),n=r.locale.t;t.showWarning(n("Could not insert image at the current position."),{title:n("Inserting image failed"),namespace:"ckfinder"})}}class jb extends me{static get pluginName(){return"CKFinderEditing"}static get requires(){return[ju,"LinkEditing"]}init(){const e=this.editor;if(!e.plugins.has("ImageBlockEditing")&&!e.plugins.has("ImageInlineEditing"))throw new y.a("ckfinder-missing-image-plugin",e);e.commands.add("ckfinder",new Db(e))}}class Lb extends me{static get pluginName(){return"CloudServicesUploadAdapter"}static get requires(){return["CloudServices",ar]}init(){const e=this.editor,t=e.plugins.get("CloudServices"),n=t.token,i=t.uploadUrl;n&&(this._uploadGateway=e.plugins.get("CloudServicesCore").createUploadGateway(n,i),e.plugins.get(ar).createUploadAdapter=o=>new Xu(this._uploadGateway,o))}}class Xu{constructor(e,t){this.uploadGateway=e,this.loader=t}upload(){return this.loader.file.then(e=>(this.fileUploader=this.uploadGateway.upload(e),this.fileUploader.on("progress",(t,n)=>{this.loader.uploadTotal=n.total,this.loader.uploaded=n.uploaded}),this.fileUploader.send()))}abort(){this.fileUploader.abort()}}class Bp extends ct{refresh(){const e=this.editor.model,t=ui(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&Ju(t,e.schema)}execute(e={}){const t=this.editor.model,n=t.document;t.change(i=>{const o=(e.selection||n.selection).getSelectedBlocks();for(const a of o)!a.is("element","paragraph")&&Ju(a,t.schema)&&i.rename(a,"paragraph")})}}function Ju(r,e){return e.checkChild(r.parent,"paragraph")&&!e.isObject(r)}class zb extends ct{execute(e){const t=this.editor.model;let n=e.position;t.change(i=>{const o=i.createElement("paragraph");if(!t.schema.checkChild(n.parent,o)){const a=t.schema.findAllowedParent(n,o);if(!a)return;n=i.split(n,a).position}t.insertContent(o,n),i.setSelection(o,"in")})}}class fl extends me{static get pluginName(){return"Paragraph"}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new Bp(e)),e.commands.add("insertParagraph",new zb(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(n,{writer:i})=>fl.paragraphLikeElements.has(n.name)?n.isEmpty?null:i.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}fl.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class Bb extends ct{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=ui(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>Yc(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,n=t.document,i=e.value;t.change(o=>{const a=Array.from(n.selection.getSelectedBlocks()).filter(c=>Yc(c,i,t.schema));for(const c of a)c.is("element",i)||o.rename(c,i)})}}function Yc(r,e,t){return t.checkChild(r.parent,e)&&!t.isObject(r)}class Fb extends me{static get pluginName(){return"HeadingEditing"}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[fl]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const i of t)i.model!=="paragraph"&&(e.model.schema.register(i.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new Bb(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(i,o)=>{const a=e.model.document.selection.getFirstPosition().parent;n.some(c=>a.is("element",c.model))&&!a.is("element","paragraph")&&a.childCount===0&&o.writer.rename(a,"paragraph")})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:B.get("low")+1})}}v(13);class Vb extends me{static get pluginName(){return"HeadingUI"}init(){const e=this.editor,t=e.t,n=function(a){const c=a.t,u={Paragraph:c("Paragraph"),"Heading 1":c("Heading 1"),"Heading 2":c("Heading 2"),"Heading 3":c("Heading 3"),"Heading 4":c("Heading 4"),"Heading 5":c("Heading 5"),"Heading 6":c("Heading 6")};return a.config.get("heading.options").map(h=>{const m=u[h.title];return m&&m!=h.title&&(h.title=m),h})}(e),i=t("Choose heading"),o=t("Heading");e.ui.componentFactory.add("heading",a=>{const c={},u=new li,h=e.commands.get("heading"),m=e.commands.get("paragraph"),k=[h];for(const S of n){const N={type:"button",model:new Lu({label:S.title,class:S.class,withText:!0})};S.model==="paragraph"?(N.model.bind("isOn").to(m,"value"),N.model.set("commandName","paragraph"),k.push(m)):(N.model.bind("isOn").to(h,"value",D=>D===S.model),N.model.set({commandName:"heading",commandValue:S.model})),u.add(N),c[S.model]=S.title}const C=cs(a);return Xf(C,u),C.buttonView.set({isOn:!1,withText:!0,tooltip:o}),C.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),C.bind("isEnabled").toMany(k,"isEnabled",(...S)=>S.some(N=>N)),C.buttonView.bind("label").to(h,"value",m,"value",(S,N)=>{const D=S||N&&"paragraph";return c[D]?c[D]:i}),this.listenTo(C,"execute",S=>{e.execute(S.source.commandName,S.source.commandValue?{value:S.source.commandValue}:void 0),e.editing.view.focus()}),C})}}class Xc extends me{static get requires(){return[al]}static get pluginName(){return"WidgetToolbarRepository"}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",n=>{(function(i){const o=i.getSelectedElement();return!(!o||!Ze(o))})(e.editing.view.document.selection)&&n.stop()},{priority:"high"})}this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:n,getRelatedElement:i,balloonClassName:o="ck-toolbar-container"}){if(!n.length)return void Object(y.b)("widget-toolbar-no-items",{toolbarId:e});const a=this.editor,c=a.t,u=new Nu(a.locale);if(u.ariaLabel=t||c("Widget toolbar"),this._toolbarDefinitions.has(e))throw new y.a("widget-toolbar-duplicated",this,{toolbarId:e});u.fillFromConfig(n,a.ui.componentFactory),this._toolbarDefinitions.set(e,{view:u,getRelatedElement:i,balloonClassName:o})}_updateToolbarsVisibility(){let e=0,t=null,n=null;for(const i of this._toolbarDefinitions.values()){const o=i.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&o)if(this.editor.ui.focusTracker.isFocused){const a=o.getAncestors().length;a>e&&(e=a,t=o,n=i)}else this._isToolbarVisible(i)&&this._hideToolbar(i);else this._isToolbarInBalloon(i)&&this._hideToolbar(i)}n&&this._showToolbar(n,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?ii(this.editor,t):this._isToolbarInBalloon(e)||(this._balloon.add({view:e.view,position:Jc(this.editor,t),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const n of this._toolbarDefinitions.values())if(this._isToolbarVisible(n)){const i=n.getRelatedElement(this.editor.editing.view.document.selection);ii(this.editor,i)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function ii(r,e){const t=r.plugins.get("ContextualBalloon"),n=Jc(r,e);t.updatePosition(n)}function Jc(r,e){const t=r.editing.view,n=at.defaultPositions;return{target:t.domConverter.mapViewToDom(e),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,Jm]}}class Fp{constructor(e){this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=e,this._referenceCoordinates=null}begin(e,t,n){const i=new yt(t);this.activeHandlePosition=function(a){const c=["top-left","top-right","bottom-right","bottom-left"];for(const u of c)if(a.classList.contains("ck-widget__resizer__handle-"+u))return u}(e),this._referenceCoordinates=function(a,c){const u=new yt(a),h=c.split("-"),m={x:h[1]=="right"?u.right:u.left,y:h[0]=="bottom"?u.bottom:u.top};return m.x+=a.ownerDocument.defaultView.scrollX,m.y+=a.ownerDocument.defaultView.scrollY,m}(t,function(a){const c=a.split("-"),u={top:"bottom",bottom:"top",left:"right",right:"left"};return`${u[c[0]]}-${u[c[1]]}`}(this.activeHandlePosition)),this.originalWidth=i.width,this.originalHeight=i.height,this.aspectRatio=i.width/i.height;const o=n.style.width;o&&o.match(/^\d+(\.\d*)?%$/)?this.originalWidthPercents=parseFloat(o):this.originalWidthPercents=function(a,c){const u=a.parentElement,h=parseFloat(u.ownerDocument.defaultView.getComputedStyle(u).width);return c.width/h*100}(n,i)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}Le(Fp,Wt);class $b extends ut{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",t=>t?"ck-orientation-"+t:"")],style:{display:e.if("_isVisible","none",t=>!t)}},children:[{text:e.to("_label")}]})}_bindToState(e,t){this.bind("_isVisible").to(t,"proposedWidth",t,"proposedHeight",(n,i)=>n!==null&&i!==null),this.bind("_label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",(n,i,o)=>e.unit==="px"?`${n}×${i}`:o+"%"),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",(n,i,o)=>i<50||o<50?"above-center":n)}_dismiss(){this.unbind(),this._isVisible=!1}}class Zu{constructor(e){this._options=e,this._viewResizerWrapper=null,this.set("isEnabled",!0),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",t=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),t.stop())},{priority:"high"}),this.on("change:isEnabled",()=>{this.isEnabled&&this.redraw()})}attach(){const e=this,t=this._options.viewElement;this._options.editor.editing.view.change(n=>{const i=n.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},function(o){const a=this.toDomElement(o);return e._appendHandles(a),e._appendSizeUI(a),e.on("change:isEnabled",(c,u,h)=>{a.style.display=h?"":"none"}),a.style.display=e.isEnabled?"":"none",a});n.insert(n.createPositionAt(t,"end"),i),n.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=i})}begin(e){this.state=new Fp(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){const t=this._proposeNewSize(e);this._options.editor.editing.view.change(a=>{const c=this._options.unit||"%",u=(c==="%"?t.widthPercents:t.width)+c;a.setStyle("width",u,this._options.viewElement)});const n=this._getHandleHost(),i=new yt(n);t.handleHostWidth=Math.round(i.width),t.handleHostHeight=Math.round(i.height);const o=new yt(n);t.width=Math.round(o.width),t.height=Math.round(o.height),this.redraw(i),this.state.update(t)}commit(){const e=this._options.unit||"%",t=(e==="%"?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(t)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const t=this._domResizerWrapper;if(!((n=t)&&n.ownerDocument&&n.ownerDocument.contains(n)))return;var n;const i=t.parentElement,o=this._getHandleHost(),a=this._viewResizerWrapper,c=[a.getStyle("width"),a.getStyle("height"),a.getStyle("left"),a.getStyle("top")];let u;if(i.isSameNode(o)){const h=e||new yt(o);u=[h.width+"px",h.height+"px",void 0,void 0]}else u=[o.offsetWidth+"px",o.offsetHeight+"px",o.offsetLeft+"px",o.offsetTop+"px"];xn(c,u)!=="same"&&this._options.editor.editing.view.change(h=>{h.setStyle({width:u[0],height:u[1],left:u[2],top:u[3]},a)})}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss(),this._options.editor.editing.view.change(e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){const t=this.state,n={x:(i=e).pageX,y:i.pageY};var i;const o=!this._options.isCentered||this._options.isCentered(this),a={x:t._referenceCoordinates.x-(n.x+t.originalWidth),y:n.y-t.originalHeight-t._referenceCoordinates.y};o&&t.activeHandlePosition.endsWith("-right")&&(a.x=n.x-(t._referenceCoordinates.x+t.originalWidth)),o&&(a.x*=2);const c={width:Math.abs(t.originalWidth+a.x),height:Math.abs(t.originalHeight+a.y)};c.dominant=c.width/t.aspectRatio>c.height?"width":"height",c.max=c[c.dominant];const u={width:c.width,height:c.height};return c.dominant=="width"?u.height=u.width/t.aspectRatio:u.width=u.height*t.aspectRatio,{width:Math.round(u.width),height:Math.round(u.height),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*u.width*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const i of t)e.appendChild(new Ni({tag:"div",attributes:{class:"ck-widget__resizer__handle "+(n=i,"ck-widget__resizer__handle-"+n)}}).render());var n}_appendSizeUI(e){this._sizeView=new $b,this._sizeView.render(),e.appendChild(this._sizeView.element)}}Le(Zu,Wt),v(72),Le(class extends me{static get pluginName(){return"WidgetResize"}init(){const r=this.editor.editing,e=$t.window.document;this.set("visibleResizer",null),this.set("_activeResizer",null),this._resizers=new Map,r.view.addObserver($c),this._observer=Object.create(is),this.listenTo(r.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(e,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(e,"mouseup",this._mouseUpListener.bind(this));const t=()=>{this.visibleResizer&&this.visibleResizer.redraw()};this._redrawFocusedResizerThrottled=$u(t,200),this.on("change:visibleResizer",t),this.editor.ui.on("update",this._redrawFocusedResizerThrottled),this.editor.model.document.on("change",()=>{for(const[i,o]of this._resizers)i.isAttached()||(this._resizers.delete(i),o.destroy())},{priority:"lowest"}),this._observer.listenTo($t.window,"resize",this._redrawFocusedResizerThrottled);const n=this.editor.editing.view.document.selection;n.on("change",()=>{const i=n.getSelectedElement();this.visibleResizer=this.getResizerByViewElement(i)||null})}destroy(){this._observer.stopListening();for(const r of this._resizers.values())r.destroy();this._redrawFocusedResizerThrottled.cancel()}attachTo(r){const e=new Zu(r),t=this.editor.plugins;if(e.attach(),t.has("WidgetToolbarRepository")){const i=t.get("WidgetToolbarRepository");e.on("begin",()=>{i.forceDisabled("resize")},{priority:"lowest"}),e.on("cancel",()=>{i.clearForceDisabled("resize")},{priority:"highest"}),e.on("commit",()=>{i.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(r.viewElement,e);const n=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(n)==e&&(this.visibleResizer=e),e}getResizerByViewElement(r){return this._resizers.get(r)}_getResizerByHandle(r){for(const e of this._resizers.values())if(e.containsHandle(r))return e}_mouseDownListener(r,e){const t=e.domTarget;Zu.isResizeHandle(t)&&(this._activeResizer=this._getResizerByHandle(t),this._activeResizer&&(this._activeResizer.begin(t),r.stop(),e.preventDefault()))}_mouseMoveListener(r,e){this._activeResizer&&this._activeResizer.updateSize(e)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}},Wt);class Hb extends ct{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,n=t.plugins.get("ImageUtils"),i=t.model,o=n.getClosestSelectedImageElement(i.document.selection);i.change(a=>{a.setAttribute("alt",e.newValue,o)})}}function pl(r,e){const t=r.createEmptyElement("img"),n=e==="imageBlock"?r.createContainerElement("figure",{class:"image"}):r.createContainerElement("span",{class:"image-inline"},{isAllowedInsideAttributeElement:!0});return r.insert(r.createPositionAt(n,0),t),n}function Vp(r,e){if(r.plugins.has("ImageInlineEditing")!==r.plugins.has("ImageBlockEditing"))return{name:"img",attributes:{src:!0}};const t=r.plugins.get("ImageUtils");return n=>!t.isInlineImageView(n)||!n.hasAttribute("src")||(n.findAncestor(t.isBlockImageView)?"imageBlock":"imageInline")!==e?null:{name:!0,attributes:["src"]}}function gl(r,e){const t=ui(e.getSelectedBlocks());return!t||r.isObject(t)||t.isEmpty&&t.name!="listItem"?"imageBlock":"imageInline"}class Lr extends me{static get pluginName(){return"ImageUtils"}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,n=null){const i=this.editor,o=i.model,a=o.document.selection;n=$p(i,t||a,n),e={...Object.fromEntries(a.getAttributes()),...e};for(const c in e)o.schema.checkAttribute(n,c)||delete e[c];return o.change(c=>{const u=c.createElement(n,e);return t||n=="imageInline"||(t=dl(a,o)),o.insertContent(u,t),u.parent?(c.setSelection(u,"on"),u):null})}getClosestSelectedImageWidget(e){const t=e.getSelectedElement();if(t&&this.isImageWidget(t))return t;let n=e.getFirstPosition().parent;for(;n;){if(n.is("element")&&this.isImageWidget(n))return n;n=n.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}isImageAllowed(){const e=this.editor.model.document.selection;return function(t,n){if($p(t,n)=="imageBlock"){const i=function(o,a){const c=dl(o,a).start.parent;return c.isEmpty&&!c.is("element","$root")?c.parent:c}(n,t.model);if(t.model.schema.checkChild(i,"imageBlock"))return!0}else if(t.model.schema.checkChild(n.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(t){return[...t.focus.getAncestors()].every(n=>!n.is("element","imageBlock"))}(e)}toImageWidget(e,t,n){return t.setCustomProperty("image",!0,e),Zt(e,t,{label:()=>{const i=this.findViewImgElement(e).getAttribute("alt");return i?`${i} ${n}`:n}})}isImageWidget(e){return!!e.getCustomProperty("image")&&Ze(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:n}of t.createRangeIn(e))if(this.isInlineImageView(n))return n}}function $p(r,e,t){const n=r.model.schema,i=r.config.get("image.insert.type");return r.plugins.has("ImageBlockEditing")?r.plugins.has("ImageInlineEditing")?t||(i==="inline"?"imageInline":i==="block"?"imageBlock":e.is("selection")?gl(n,e):n.checkChild(e,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class Ub extends me{static get requires(){return[Lr]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new Hb(this.editor))}}v(74),v(7);class Wb extends ut{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new $i,this.keystrokes=new Ei,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),Oi.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),Oi.cancel,"ck-button-cancel","cancel"),this._focusables=new as,this._focusCycler=new Us({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]}),Eu(this)}render(){super.render(),this.keystrokes.listenTo(this.element),Pu({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}_createButton(e,t,n,i){const o=new Jt(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),i&&o.delegate("execute").to(this,i),o}_createLabeledInputView(){const e=this.locale.t,t=new Ru(this.locale,Du);return t.label=e("Text alternative"),t}}function eh(r){const e=r.editing.view,t=at.defaultPositions,n=r.plugins.get("ImageUtils");return{target:e.domConverter.viewToDom(n.getClosestSelectedImageWidget(e.document.selection)),positions:[t.northArrowSouth,t.northArrowSouthWest,t.northArrowSouthEast,t.southArrowNorth,t.southArrowNorthWest,t.southArrowNorthEast]}}class qb extends me{static get requires(){return[al]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",n=>{const i=e.commands.get("imageTextAlternative"),o=new Jt(n);return o.set({label:t("Change image text alternative"),icon:Oi.lowVision,tooltip:!0}),o.bind("isEnabled").to(i,"isEnabled"),this.listenTo(o,"execute",()=>{this._showForm()}),o})}_createForm(){const e=this.editor,t=e.editing.view.document,n=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new Wb(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(i,o)=>{this._hideForm(!0),o()}),this.listenTo(e.ui,"update",()=>{n.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(i){const o=i.plugins.get("ContextualBalloon");if(i.plugins.get("ImageUtils").getClosestSelectedImageWidget(i.editing.view.document.selection)){const a=eh(i);o.updatePosition(a)}}(e):this._hideForm(!0)}),Su({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const e=this.editor,t=e.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:eh(e)}),n.fieldView.value=n.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class Hp extends me{static get requires(){return[Ub,qb]}static get pluginName(){return"ImageTextAlternative"}}function Up(r,e){return n=>{n.on("attribute:srcset:"+e,t)};function t(n,i,o){if(!o.consumable.consume(i.item,n.name))return;const a=o.writer,c=o.mapper.toViewElement(i.item),u=r.findViewImgElement(c);if(i.attributeNewValue===null){const h=i.attributeOldValue;h.data&&(a.removeAttribute("srcset",u),a.removeAttribute("sizes",u),h.width&&a.removeAttribute("width",u))}else{const h=i.attributeNewValue;h.data&&(a.setAttribute("srcset",h.data,u),a.setAttribute("sizes","100vw",u),h.width&&a.setAttribute("width",h.width,u))}}}function na(r,e,t){return i=>{i.on(`attribute:${t}:${e}`,n)};function n(i,o,a){if(!a.consumable.consume(o.item,i.name))return;const c=a.writer,u=a.mapper.toViewElement(o.item),h=r.findViewImgElement(u);c.setAttribute(o.attributeKey,o.attributeNewValue||"",h)}}class th extends Er{observe(e){this.listenTo(e,"load",(t,n)=>{const i=n.target;this.checkShouldIgnoreEventFromTarget(i)||i.tagName=="IMG"&&this._fireEvents(n)},{useCapture:!0})}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class Kb extends ct{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||t==="block"&&Object(y.b)("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||t==="inline"&&Object(y.b)("image-inline-plugin-required")}refresh(){this.isEnabled=this.editor.plugins.get("ImageUtils").isImageAllowed()}execute(e){const t=xt(e.source),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),o=Object.fromEntries(n.getAttributes());t.forEach((a,c)=>{const u=n.getSelectedElement();if(typeof a=="string"&&(a={src:a}),c&&u&&i.isImage(u)){const h=this.editor.model.createPositionAfter(u);i.insertImage({...a,...o},h)}else i.insertImage({...a,...o})})}}class Wp extends me{static get requires(){return[Lr]}static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(th),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:i=>{const o={data:i.getAttribute("srcset")};return i.hasAttribute("width")&&(o.width=i.getAttribute("width")),o}}});const n=new Kb(e);e.commands.add("insertImage",n),e.commands.add("imageInsert",n)}}class qp extends ct{constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);this._modelElementName==="imageBlock"?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(){const e=this.editor,t=this.editor.model,n=e.plugins.get("ImageUtils"),i=n.getClosestSelectedImageElement(t.document.selection),o=Object.fromEntries(i.getAttributes());return o.src||o.uploadId?t.change(a=>{const c=Array.from(t.markers).filter(m=>m.getRange().containsItem(i)),u=n.insertImage(o,t.createSelection(i,"on"),this._modelElementName);if(!u)return null;const h=a.createRangeOn(u);for(const m of c){const k=m.getRange(),C=k.root.rootName!="$graveyard"?k.getJoined(h,!0):h;a.updateMarker(m,{range:C})}return{oldElement:i,newElement:u}}):null}}class Kp extends me{static get requires(){return[Wp,Lr,tn]}static get pluginName(){return"ImageBlockEditing"}init(){const e=this.editor;e.model.schema.register("imageBlock",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new qp(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageBlock",view:(o,{writer:a})=>pl(a,"imageBlock")}),n.for("editingDowncast").elementToElement({model:"imageBlock",view:(o,{writer:a})=>i.toImageWidget(pl(a,"imageBlock"),a,t("image widget"))}),n.for("downcast").add(na(i,"imageBlock","src")).add(na(i,"imageBlock","alt")).add(Up(i,"imageBlock")),n.for("upcast").elementToElement({view:Vp(e,"imageBlock"),model:(o,{writer:a})=>a.createElement("imageBlock",{src:o.getAttribute("src")})}).add(function(o){return c=>{c.on("element:figure",a)};function a(c,u,h){if(!h.consumable.test(u.viewItem,{name:!0,classes:"image"}))return;const m=o.findViewImgElement(u.viewItem);if(!m||!m.hasAttribute("src")||!h.consumable.test(m,{name:!0}))return;const k=ui(h.convertItem(m,u.modelCursor).modelRange.getItems());k&&(h.convertChildren(u.viewItem,k),h.updateConversionResult(k,u))}}(i))}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,i=e.plugins.get("ImageUtils");this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(o,a)=>{const c=Array.from(a.content.getChildren());let u;if(!c.every(i.isInlineImageView))return;u=a.targetRanges?e.editing.mapper.toModelRange(a.targetRanges[0]):t.document.selection.getFirstRange();const h=t.createSelection(u);if(gl(t.schema,h)==="imageBlock"){const m=new Ys(n.document),k=c.map(C=>m.createElement("figure",{class:"image"},C));a.content=m.createDocumentFragment(k)}})}}v(11);class Gb extends me{static get requires(){return[Kp,hl,Hp]}static get pluginName(){return"ImageBlock"}}class Qb extends me{static get requires(){return[Wp,Lr,tn]}static get pluginName(){return"ImageInlineEditing"}init(){const e=this.editor,t=e.model.schema;t.register("imageInline",{isObject:!0,isInline:!0,allowWhere:"$text",allowAttributes:["alt","src","srcset"]}),t.addChildCheck((n,i)=>{if(n.endsWith("caption")&&i.name==="imageInline")return!1}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new qp(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageInline",view:(o,{writer:a})=>a.createEmptyElement("img")}),n.for("editingDowncast").elementToElement({model:"imageInline",view:(o,{writer:a})=>i.toImageWidget(pl(a,"imageInline"),a,t("image widget"))}),n.for("downcast").add(na(i,"imageInline","src")).add(na(i,"imageInline","alt")).add(Up(i,"imageInline")),n.for("upcast").elementToElement({view:Vp(e,"imageInline"),model:(o,{writer:a})=>a.createElement("imageInline",{src:o.getAttribute("src")})})}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,i=e.plugins.get("ImageUtils");this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(o,a)=>{const c=Array.from(a.content.getChildren());let u;if(!c.every(i.isBlockImageView))return;u=a.targetRanges?e.editing.mapper.toModelRange(a.targetRanges[0]):t.document.selection.getFirstRange();const h=t.createSelection(u);if(gl(t.schema,h)==="imageInline"){const m=new Ys(n.document),k=c.map(C=>C.childCount===1?(Array.from(C.getAttributes()).forEach(S=>m.setAttribute(...S,i.findViewImgElement(C))),C.getChild(0)):C);a.content=m.createDocumentFragment(k)}})}}class Yb extends me{static get requires(){return[Qb,hl,Hp]}static get pluginName(){return"ImageInline"}}function nh(r){for(const e of r.getChildren())if(e&&e.is("element","caption"))return e;return null}function ih(r,e){const t=e.getFirstPosition().findAncestor("caption");return t&&r.isBlockImage(t.parent)?t:null}class Xb extends ct{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils");if(!e.plugins.has(Kp))return this.isEnabled=!1,void(this.value=!1);const n=e.model.document.selection,i=n.getSelectedElement();if(!i){const o=ih(t,n);return this.isEnabled=!!o,void(this.value=!!o)}this.isEnabled=this.editor.plugins.get("ImageUtils").isImage(i),this.isEnabled?this.value=!!nh(i):this.value=!1}execute(e={}){const{focusCaptionOnShow:t}=e;this.editor.model.change(n=>{this.value?this._hideImageCaption(n):this._showImageCaption(n,t)})}_showImageCaption(e,t){const n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageCaptionEditing");let o=n.getSelectedElement();const a=i._getSavedCaption(o);this.editor.plugins.get("ImageUtils").isInlineImage(o)&&(this.editor.execute("imageTypeBlock"),o=n.getSelectedElement());const c=a||e.createElement("caption");e.append(c,o),t&&e.setSelection(c,"in")}_hideImageCaption(e){const t=this.editor,n=t.model.document.selection,i=t.plugins.get("ImageCaptionEditing"),o=t.plugins.get("ImageUtils");let a,c=n.getSelectedElement();c?a=nh(c):(a=ih(o,n),c=a.parent),i._saveCaption(c,a),e.setSelection(c,"on"),e.remove(a)}}class Jb extends me{static get requires(){return[Lr]}static get pluginName(){return"ImageCaptionEditing"}constructor(e){super(e),this._savedCaptionsMap=new WeakMap}init(){const e=this.editor,t=e.model.schema;t.isRegistered("caption")?t.extend("caption",{allowIn:"imageBlock"}):t.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new Xb(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration()}_setupConversion(){const e=this.editor,t=e.editing.view,n=e.plugins.get("ImageUtils"),i=e.t;e.conversion.for("upcast").elementToElement({view:o=>function(a,c){return c.name=="figcaption"&&a.isBlockImageView(c.parent)?{name:!0}:null}(n,o),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(o,{writer:a})=>n.isBlockImage(o.parent)?a.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(o,{writer:a})=>{if(!n.isBlockImage(o.parent))return null;const c=a.createEditableElement("figcaption");a.setCustomProperty("imageCaption",!0,c),ip({view:t,element:c,text:i("Enter image caption"),keepOnFocus:!0});const u=Fu(c,a);return Uc(u,a,(h,m,k)=>k.addClass(xt(m.classes),h),(h,m,k)=>k.removeClass(xt(m.classes),h)),u}}),e.editing.mapper.on("modelToViewPosition",Gp(t)),e.data.mapper.on("modelToViewPosition",Gp(t))}_setupImageTypeCommandsIntegration(){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.commands.get("imageTypeInline"),i=e.commands.get("imageTypeBlock"),o=a=>{if(!a.return)return;const{oldElement:c,newElement:u}=a.return;if(!c)return;if(t.isBlockImage(c)){const m=nh(c);if(m)return void this._saveCaption(u,m)}const h=this._getSavedCaption(c);h&&this._saveCaption(u,h)};n&&this.listenTo(n,"execute",o,{priority:"low"}),i&&this.listenTo(i,"execute",o,{priority:"low"})}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?Rt.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}}function Gp(r){return(e,t)=>{const n=t.modelPosition,i=n.parent;if(!i.is("element","imageBlock"))return;const o=t.mapper.toViewElement(i);t.viewPosition=r.createPositionAt(o,n.offset+1)}}class Zb extends me{static get requires(){return[Lr]}static get pluginName(){return"ImageCaptionUI"}init(){const e=this.editor,t=e.editing.view,n=e.plugins.get("ImageUtils"),i=e.t;e.ui.componentFactory.add("toggleImageCaption",o=>{const a=e.commands.get("toggleImageCaption"),c=new Jt(o);return c.set({icon:Oi.caption,tooltip:!0,isToggleable:!0}),c.bind("isOn","isEnabled").to(a,"value","isEnabled"),c.bind("label").to(a,"value",u=>i(u?"Toggle caption off":"Toggle caption on")),this.listenTo(c,"execute",()=>{e.execute("toggleImageCaption",{focusCaptionOnShow:!0});const u=ih(n,e.model.document.selection);if(u){const h=e.editing.mapper.toViewElement(u);t.scrollToTheSelection(),t.change(m=>{m.addClass("image__caption_highlighted",h)})}}),c})}}v(78);class ev extends ct{constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map(n=>{if(n.isDefault)for(const i of n.modelElements)this._defaultStyles[i]=n.name;return[n.name,n]}))}refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?e.hasAttribute("imageStyle")?this.value=e.getAttribute("imageStyle"):this.value=this._defaultStyles[e.name]:this.value=!1}execute(e={}){const t=this.editor,n=t.model,i=t.plugins.get("ImageUtils");n.change(o=>{const a=e.value;let c=i.getClosestSelectedImageElement(n.document.selection);a&&this.shouldConvertImageType(a,c)&&(this.editor.execute(i.isBlockImage(c)?"imageTypeInline":"imageTypeBlock"),c=i.getClosestSelectedImageElement(n.document.selection)),!a||this._styles.get(a).isDefault?o.removeAttribute("imageStyle",c):o.setAttribute("imageStyle",a,c)})}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}const{objectFullWidth:tv,objectInline:Qp,objectLeft:Yp,objectRight:rh,objectCenter:oh,objectBlockLeft:Xp,objectBlockRight:Jp}=Oi,s={inline:{name:"inline",title:"In line",icon:Qp,modelElements:["imageInline"],isDefault:!0},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:Yp,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"},alignBlockLeft:{name:"alignBlockLeft",title:"Left aligned image",icon:Xp,modelElements:["imageBlock"],className:"image-style-block-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:oh,modelElements:["imageBlock"],className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:rh,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"},alignBlockRight:{name:"alignBlockRight",title:"Right aligned image",icon:Jp,modelElements:["imageBlock"],className:"image-style-block-align-right"},block:{name:"block",title:"Centered image",icon:oh,modelElements:["imageBlock"],isDefault:!0},side:{name:"side",title:"Side image",icon:rh,modelElements:["imageBlock"],className:"image-style-side"}},d={full:tv,left:Xp,right:Jp,center:oh,inlineLeft:Yp,inlineRight:rh,inline:Qp},g=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function x(r){Object(y.b)("image-style-configuration-definition-invalid",r)}var E={normalizeStyles:function(r){return(r.configuredStyles.options||[]).map(e=>function(t){return t=typeof t=="string"?s[t]?{...s[t]}:{name:t}:function(n,i){const o={...i};for(const a in n)Object.prototype.hasOwnProperty.call(i,a)||(o[a]=n[a]);return o}(s[t.name],t),typeof t.icon=="string"&&(t.icon=d[t.icon]||t.icon),t}(e)).filter(e=>function(t,{isBlockPluginLoaded:n,isInlinePluginLoaded:i}){const{modelElements:o,name:a}=t;if(!(o&&o.length&&a))return x({style:t}),!1;{const c=[n?"imageBlock":null,i?"imageInline":null];if(!o.some(u=>c.includes(u)))return Object(y.b)("image-style-missing-dependency",{style:t,missingPlugins:o.map(u=>u==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}(e,r))},getDefaultStylesConfiguration:function(r,e){return r&&e?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:r?{options:["block","side"]}:e?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(r){return r.has("ImageBlockEditing")&&r.has("ImageInlineEditing")?[...g]:[]},warnInvalidStyle:x,DEFAULT_OPTIONS:s,DEFAULT_ICONS:d,DEFAULT_DROPDOWN_DEFINITIONS:g};function j(r,e){for(const t of e)if(t.name===r)return t}class H extends me{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[Lr]}init(){const{normalizeStyles:e,getDefaultStylesConfiguration:t}=E,n=this.editor,i=n.plugins.has("ImageBlockEditing"),o=n.plugins.has("ImageInlineEditing");n.config.define("image.styles",t(i,o)),this.normalizedStyles=e({configuredStyles:n.config.get("image.styles"),isBlockPluginLoaded:i,isInlinePluginLoaded:o}),this._setupConversion(i,o),this._setupPostFixer(),n.commands.add("imageStyle",new ev(n,this.normalizedStyles))}_setupConversion(e,t){const n=this.editor,i=n.model.schema,o=(a=this.normalizedStyles,(u,h,m)=>{if(!m.consumable.consume(h.item,u.name))return;const k=j(h.attributeNewValue,a),C=j(h.attributeOldValue,a),S=m.mapper.toViewElement(h.item),N=m.writer;C&&N.removeClass(C.className,S),k&&N.addClass(k.className,S)});var a;const c=function(u){const h={imageInline:u.filter(m=>!m.isDefault&&m.modelElements.includes("imageInline")),imageBlock:u.filter(m=>!m.isDefault&&m.modelElements.includes("imageBlock"))};return(m,k,C)=>{if(!k.modelRange)return;const S=k.viewItem,N=ui(k.modelRange.getItems());if(N&&C.schema.checkAttribute(N,"imageStyle"))for(const D of h[N.name])C.consumable.consume(S,{classes:D.className})&&C.writer.setAttribute("imageStyle",D.name,N)}}(this.normalizedStyles);n.editing.downcastDispatcher.on("attribute:imageStyle",o),n.data.downcastDispatcher.on("attribute:imageStyle",o),e&&(i.extend("imageBlock",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:figure",c,{priority:"low"})),t&&(i.extend("imageInline",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:img",c,{priority:"low"}))}_setupPostFixer(){const e=this.editor,t=e.model.document,n=e.plugins.get(Lr),i=new Map(this.normalizedStyles.map(o=>[o.name,o]));t.registerPostFixer(o=>{let a=!1;for(const c of t.differ.getChanges())if(c.type=="insert"||c.type=="attribute"&&c.attributeKey=="imageStyle"){let u=c.type=="insert"?c.position.nodeAfter:c.range.start.nodeAfter;if(u&&u.is("element","paragraph")&&u.childCount>0&&(u=u.getChild(0)),!n.isImage(u))continue;const h=u.getAttribute("imageStyle");if(!h)continue;const m=i.get(h);m&&m.modelElements.includes(u.name)||(o.removeAttribute("imageStyle",u),a=!0)}return a})}}v(80);class W extends me{static get requires(){return[H]}static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Wrap text":e("Wrap text"),"Break text":e("Break text"),"In line":e("In line"),"Full size image":e("Full size image"),"Side image":e("Side image"),"Left aligned image":e("Left aligned image"),"Centered image":e("Centered image"),"Right aligned image":e("Right aligned image")}}init(){const e=this.editor.plugins,t=this.editor.config.get("image.toolbar")||[],n=K(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const o of n)this._createButton(o);const i=K([...t.filter(oe),...E.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(const o of i)this._createDropdown(o,n)}_createDropdown(e,t){const n=this.editor.ui.componentFactory;n.add(e.name,i=>{let o;const{defaultItem:a,items:c,title:u}=e,h=c.filter(C=>t.find(({name:S})=>de(S)===C)).map(C=>{const S=n.create(C);return C===a&&(o=S),S});c.length!==h.length&&E.warnInvalidStyle({dropdown:e});const m=cs(i,$f),k=m.buttonView;return Yf(m,h),k.set({label:ue(u,o.label),class:null,tooltip:!0}),k.bind("icon").toMany(h,"isOn",(...C)=>{const S=C.findIndex(hn);return S<0?o.icon:h[S].icon}),k.bind("label").toMany(h,"isOn",(...C)=>{const S=C.findIndex(hn);return ue(u,S<0?o.label:h[S].label)}),k.bind("isOn").toMany(h,"isOn",(...C)=>C.some(hn)),k.bind("class").toMany(h,"isOn",(...C)=>C.some(hn)?"ck-splitbutton_flatten":null),k.on("execute",()=>{h.some(({isOn:C})=>C)?m.isOpen=!m.isOpen:o.fire("execute")}),m.bind("isEnabled").toMany(h,"isEnabled",(...C)=>C.some(hn)),m})}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(de(t),n=>{const i=this.editor.commands.get("imageStyle"),o=new Jt(n);return o.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(i,"isEnabled"),o.bind("isOn").to(i,"value",a=>a===t),o.on("execute",this._executeCommand.bind(this,t)),o})}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function K(r,e){for(const t of r)e[t.title]&&(t.title=e[t.title]);return r}function de(r){return"imageStyle:"+r}function ue(r,e){return(r?r+": ":"")+e}function pe(r){const e=r.map(t=>t.replace("+","\\+"));return new RegExp(`^image\\/(${e.join("|")})$`)}function Te(r){return new Promise((e,t)=>{const n=r.getAttribute("src");fetch(n).then(i=>i.blob()).then(i=>{const o=je(i,n),a=o.replace("image/",""),c=new File([i],"image."+a,{type:o});e(c)}).catch(i=>i&&i.name==="TypeError"?function(o){return function(a){return new Promise((c,u)=>{const h=$t.document.createElement("img");h.addEventListener("load",()=>{const m=$t.document.createElement("canvas");m.width=h.width,m.height=h.height,m.getContext("2d").drawImage(h,0,0),m.toBlob(k=>k?c(k):u())}),h.addEventListener("error",()=>u()),h.src=a})}(o).then(a=>{const c=je(a,o),u=c.replace("image/","");return new File([a],"image."+u,{type:c})})}(n).then(e).catch(t):t(i))})}function je(r,e){return r.type?r.type:e.match(/data:(image\/\w+);base64/)?e.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class Ke extends me{static get pluginName(){return"ImageUploadUI"}init(){const e=this.editor,t=e.t,n=i=>{const o=new xb(i),a=e.commands.get("uploadImage"),c=e.config.get("image.upload.types"),u=pe(c);return o.set({acceptedType:c.map(h=>"image/"+h).join(","),allowMultipleFiles:!0}),o.buttonView.set({label:t("Insert image"),icon:Oi.image,tooltip:!0}),o.buttonView.bind("isEnabled").to(a),o.on("done",(h,m)=>{const k=Array.from(m).filter(C=>u.test(C.type));k.length&&e.execute("uploadImage",{file:k})}),o};e.ui.componentFactory.add("uploadImage",n),e.ui.componentFactory.add("imageUpload",n)}}v(82),v(84),v(86);class ht extends me{static get pluginName(){return"ImageUploadProgress"}constructor(e){super(e),this.placeholder="data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 250"><rect rx="4"/></svg>')}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",(...t)=>this.uploadStatusChange(...t)),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",(...t)=>this.uploadStatusChange(...t))}uploadStatusChange(e,t,n){const i=this.editor,o=t.item,a=o.getAttribute("uploadId");if(!n.consumable.consume(t.item,e.name))return;const c=i.plugins.get("ImageUtils"),u=i.plugins.get(ar),h=a?t.attributeNewValue:null,m=this.placeholder,k=i.editing.mapper.toViewElement(o),C=n.writer;if(h=="reading")return We(k,C),void pt(c,m,k,C);if(h=="uploading"){const S=u.loaders.get(a);return We(k,C),void(S?(bt(k,C),function(N,D,z,U){const J=function(ce){const ye=ce.createUIElement("div",{class:"ck-progress-bar"});return ce.setCustomProperty("progressBar",!0,ye),ye}(D);D.insert(D.createPositionAt(N,"end"),J),z.on("change:uploadedPercent",(ce,ye,ze)=>{U.change(Kt=>{Kt.setStyle("width",ze+"%",J)})})}(k,C,S,i.editing.view),function(N,D,z,U){if(U.data){const J=N.findViewImgElement(D);z.setAttribute("src",U.data,J)}}(c,k,C,S)):pt(c,m,k,C))}h=="complete"&&u.loaders.get(a)&&function(S,N,D){const z=N.createUIElement("div",{class:"ck-image-upload-complete-icon"});N.insert(N.createPositionAt(S,"end"),z),setTimeout(()=>{D.change(U=>U.remove(U.createRangeOn(z)))},3e3)}(k,C,i.editing.view),function(S,N){qn(S,N,"progressBar")}(k,C),bt(k,C),function(S,N){N.removeClass("ck-appear",S)}(k,C)}}function We(r,e){r.hasClass("ck-appear")||e.addClass("ck-appear",r)}function pt(r,e,t,n){t.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",t);const i=r.findViewImgElement(t);i.getAttribute("src")!==e&&n.setAttribute("src",e,i),gi(t,"placeholder")||n.insert(n.createPositionAfter(i),function(o){const a=o.createUIElement("div",{class:"ck-upload-placeholder-loader"});return o.setCustomProperty("placeholder",!0,a),a}(n))}function bt(r,e){r.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",r),qn(r,e,"placeholder")}function gi(r,e){for(const t of r.getChildren())if(t.getCustomProperty(e))return t}function qn(r,e,t){const n=gi(r,t);n&&e.remove(e.createRangeOn(n))}class ji extends ct{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(n)}execute(e){const t=xt(e.file),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),o=Object.fromEntries(n.getAttributes());t.forEach((a,c)=>{const u=n.getSelectedElement();if(c&&u&&i.isImage(u)){const h=this.editor.model.createPositionAfter(u);this._uploadImage(a,o,h)}else this._uploadImage(a,o)})}_uploadImage(e,t,n){const i=this.editor,o=i.plugins.get(ar).createLoader(e),a=i.plugins.get("ImageUtils");o&&a.insertImage({...t,uploadId:o.id},n)}}class un extends me{static get requires(){return[ar,ju,tn,Lr]}static get pluginName(){return"ImageUploadEditing"}constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){const e=this.editor,t=e.model.document,n=e.conversion,i=e.plugins.get(ar),o=e.plugins.get("ImageUtils"),a=pe(e.config.get("image.upload.types")),c=new ji(e);e.commands.add("uploadImage",c),e.commands.add("imageUpload",c),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",(u,h)=>{if(m=h.dataTransfer,Array.from(m.types).includes("text/html")&&m.getData("text/html")!=="")return;var m;const k=Array.from(h.dataTransfer.files).filter(C=>!!C&&a.test(C.type));k.length&&(u.stop(),e.model.change(C=>{h.targetRanges&&C.setSelection(h.targetRanges.map(S=>e.editing.mapper.toModelRange(S))),e.model.enqueueChange("default",()=>{e.execute("uploadImage",{file:k})})}))}),this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(u,h)=>{const m=Array.from(e.editing.view.createRangeIn(h.content)).filter(C=>function(S,N){return!(!S.isInlineImageView(N)||!N.getAttribute("src"))&&(N.getAttribute("src").match(/^data:image\/\w+;base64,/g)||N.getAttribute("src").match(/^blob:/g))}(o,C.item)&&!C.item.getAttribute("uploadProcessed")).map(C=>({promise:Te(C.item),imageElement:C.item}));if(!m.length)return;const k=new Ys(e.editing.view.document);for(const C of m){k.setAttribute("uploadProcessed",!0,C.imageElement);const S=i.createLoader(C.promise);S&&(k.setAttribute("src","",C.imageElement),k.setAttribute("uploadId",S.id,C.imageElement))}}),e.editing.view.document.on("dragover",(u,h)=>{h.preventDefault()}),t.on("change",()=>{const u=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),h=new Set;for(const m of u)if(m.type=="insert"&&m.name!="$text"){const k=m.position.nodeAfter,C=m.position.root.rootName=="$graveyard";for(const S of lr(e,k)){const N=S.getAttribute("uploadId");if(!N)continue;const D=i.loaders.get(N);D&&(C?h.has(N)||D.abort():(h.add(N),this._uploadImageElements.set(N,S),D.status=="idle"&&this._readAndUpload(D)))}}}),this.on("uploadComplete",(u,{imageElement:h,data:m})=>{const k=m.urls?m.urls:m;this.editor.model.change(C=>{C.setAttribute("src",k.default,h),this._parseAndSetSrcsetAttributeOnImage(k,h,C)})},{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(e){const t=this.editor,n=t.model,i=t.locale.t,o=t.plugins.get(ar),a=t.plugins.get(ju),c=t.plugins.get("ImageUtils"),u=this._uploadImageElements;return n.enqueueChange("transparent",m=>{m.setAttribute("uploadStatus","reading",u.get(e.id))}),e.read().then(()=>{const m=e.upload(),k=u.get(e.id);if(_n.isSafari){const C=t.editing.mapper.toViewElement(k),S=c.findViewImgElement(C);t.editing.view.once("render",()=>{if(!S.parent)return;const N=t.editing.view.domConverter.mapViewToDom(S.parent);if(!N)return;const D=N.style.display;N.style.display="none",N._ckHack=N.offsetHeight,N.style.display=D})}return n.enqueueChange("transparent",C=>{C.setAttribute("uploadStatus","uploading",k)}),m}).then(m=>{n.enqueueChange("transparent",k=>{const C=u.get(e.id);k.setAttribute("uploadStatus","complete",C),this.fire("uploadComplete",{data:m,imageElement:C})}),h()}).catch(m=>{if(e.status!=="error"&&e.status!=="aborted")throw m;e.status=="error"&&m&&a.showWarning(m,{title:i("Upload failed"),namespace:"upload"}),n.enqueueChange("transparent",k=>{k.remove(u.get(e.id))}),h()});function h(){n.enqueueChange("transparent",m=>{const k=u.get(e.id);m.removeAttribute("uploadId",k),m.removeAttribute("uploadStatus",k),u.delete(e.id)}),o.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let i=0;const o=Object.keys(e).filter(a=>{const c=parseInt(a,10);if(!isNaN(c))return i=Math.max(i,c),!0}).map(a=>`${e[a]} ${a}w`).join(", ");o!=""&&n.setAttribute("srcset",{data:o,width:i},t)}}function lr(r,e){const t=r.plugins.get("ImageUtils");return Array.from(r.model.createRangeOn(e)).filter(n=>t.isImage(n.item)).map(n=>n.item)}class lo extends me{static get pluginName(){return"IndentEditing"}init(){const e=this.editor;e.commands.add("indent",new fa(e)),e.commands.add("outdent",new fa(e))}}var sh='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zM1.632 6.95 5.02 9.358a.4.4 0 0 1-.013.661l-3.39 2.207A.4.4 0 0 1 1 11.892V7.275a.4.4 0 0 1 .632-.326z"/></svg>',G_='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zm1.618-9.55L.98 9.358a.4.4 0 0 0 .013.661l3.39 2.207A.4.4 0 0 0 5 11.892V7.275a.4.4 0 0 0-.632-.326z"/></svg>';class Ey extends me{static get pluginName(){return"IndentUI"}init(){const e=this.editor,t=e.locale,n=e.t,i=t.uiLanguageDirection=="ltr"?sh:G_,o=t.uiLanguageDirection=="ltr"?G_:sh;this._defineButton("indent",n("Increase indent"),i),this._defineButton("outdent",n("Decrease indent"),o)}_defineButton(e,t,n){const i=this.editor;i.ui.componentFactory.add(e,o=>{const a=i.commands.get(e),c=new Jt(o);return c.set({label:t,icon:n,tooltip:!0}),c.bind("isOn","isEnabled").to(a,"value","isEnabled"),this.listenTo(c,"execute",()=>{i.execute(e),i.editing.view.focus()}),c})}}class Py{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach(t=>this._definitions.add(t)):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",(t,n,i)=>{if(!i.consumable.test(n.item,"attribute:linkHref"))return;const o=i.writer,a=o.document.selection;for(const c of this._definitions){const u=o.createAttributeElement("a",c.attributes,{priority:5});c.classes&&o.addClass(c.classes,u);for(const h in c.styles)o.setStyle(h,c.styles[h],u);o.setCustomProperty("link",!0,u),c.callback(n.attributeNewValue)?n.item.is("selection")?o.wrap(a.getFirstRange(),u):o.wrap(i.mapper.toViewRange(n.range),u):o.unwrap(i.mapper.toViewRange(n.range),u)}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",(t,n,{writer:i,mapper:o})=>{const a=o.toViewElement(n.item),c=Array.from(a.getChildren()).find(u=>u.name==="a");for(const u of this._definitions){const h=Ti(u.attributes);if(u.callback(n.attributeNewValue)){for(const[m,k]of h)m==="class"?i.addClass(k,c):i.setAttribute(m,k,c);u.classes&&i.addClass(u.classes,c);for(const m in u.styles)i.setStyle(m,u.styles[m],c)}else{for(const[m,k]of h)m==="class"?i.removeClass(k,c):i.removeAttribute(m,c);u.classes&&i.removeClass(u.classes,c);for(const m in u.styles)i.removeStyle(m,c)}}})}}}var Iy=function(r,e,t){var n=r.length;return t=t===void 0?n:t,!e&&t>=n?r:Gr(r,e,t)},My=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),Q_=function(r){return My.test(r)},Oy=function(r){return r.split("")},Ny="[\\ud800-\\udfff]",nv="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",iv="\\ud83c[\\udffb-\\udfff]",Y_="[^\\ud800-\\udfff]",X_="(?:\\ud83c[\\udde6-\\uddff]){2}",J_="[\\ud800-\\udbff][\\udc00-\\udfff]",Z_="(?:"+nv+"|"+iv+")?",Ry="[\\ufe0e\\ufe0f]?"+Z_+("(?:\\u200d(?:"+[Y_,X_,J_].join("|")+")[\\ufe0e\\ufe0f]?"+Z_+")*"),Dy="(?:"+[Y_+nv+"?",nv,X_,J_,Ny].join("|")+")",jy=RegExp(iv+"(?="+iv+")|"+Dy+Ry,"g"),Ly=function(r){return r.match(jy)||[]},zy=function(r){return Q_(r)?Ly(r):Oy(r)},By=function(r){return function(e){e=En(e);var t=Q_(e)?zy(e):void 0,n=t?t[0]:e.charAt(0),i=t?Iy(t,1).join(""):e.slice(1);return n[r]()+i}}("toUpperCase");const Fy=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Vy=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,$y=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,Hy=/^((\w+:(\/{2,})?)|(\W))/i;function ew(r,{writer:e}){const t=e.createAttributeElement("a",{href:r},{priority:5});return e.setCustomProperty("link",!0,t),t}function tw(r){return function(e){return e.replace(Fy,"").match(Vy)}(r=String(r))?r:"#"}function rv(r,e){return!!r&&e.checkAttribute(r.name,"linkHref")}function nw(r,e){const t=(n=r,$y.test(n)?"mailto:":e);var n;const i=!!t&&!Hy.test(r);return r&&i?t+r:r}class Uy extends ct{constructor(e){super(e),this.manualDecorators=new li,this.automaticDecorators=new Py}restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement()||ui(t.getSelectedBlocks());rv(n,e.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(n,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const i of this.manualDecorators)i.value=this._getDecoratorStateFromModel(i.id)}execute(e,t={}){const n=this.editor.model,i=n.document.selection,o=[],a=[];for(const c in t)t[c]?o.push(c):a.push(c);n.change(c=>{if(i.isCollapsed){const u=i.getFirstPosition();if(i.hasAttribute("linkHref")){const h=fs(u,"linkHref",i.getAttribute("linkHref"),n);c.setAttribute("linkHref",e,h),o.forEach(m=>{c.setAttribute(m,!0,h)}),a.forEach(m=>{c.removeAttribute(m,h)}),c.setSelection(c.createPositionAfter(h.end.nodeBefore))}else if(e!==""){const h=Ti(i.getAttributes());h.set("linkHref",e),o.forEach(k=>{h.set(k,!0)});const{end:m}=n.insertContent(c.createText(e,h),u);c.setSelection(m)}["linkHref",...o,...a].forEach(h=>{c.removeSelectionAttribute(h)})}else{const u=n.schema.getValidRanges(i.getRanges(),"linkHref"),h=[];for(const k of i.getSelectedBlocks())n.schema.checkAttribute(k,"linkHref")&&h.push(c.createRangeOn(k));const m=h.slice();for(const k of u)this._isRangeToUpdate(k,h)&&m.push(k);for(const k of m)c.setAttribute("linkHref",e,k),o.forEach(C=>{c.setAttribute(C,!0,k)}),a.forEach(C=>{c.removeAttribute(C,k)})}})}_getDecoratorStateFromModel(e){const t=this.editor.model,n=t.document.selection,i=n.getSelectedElement();return rv(i,t.schema)?i.getAttribute(e):n.getAttribute(e)}_isRangeToUpdate(e,t){for(const n of t)if(n.containsRange(e))return!1;return!0}}class Wy extends ct{refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement();rv(n,e.schema)?this.isEnabled=e.schema.checkAttribute(n,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,n=t.document.selection,i=e.commands.get("link");t.change(o=>{const a=n.isCollapsed?[fs(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),t)]:t.schema.getValidRanges(n.getRanges(),"linkHref");for(const c of a)if(o.removeAttribute("linkHref",c),i)for(const u of i.manualDecorators)o.removeAttribute(u.id,c)})}}class iw{constructor({id:e,label:t,attributes:n,classes:i,styles:o,defaultValue:a}){this.id=e,this.set("value"),this.defaultValue=a,this.label=t,this.attributes=n,this.classes=i,this.styles=o}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}Le(iw,Wt),v(88);const qy=/^(https?:)?\/\//;class Ky extends me{static get pluginName(){return"LinkEditing"}static get requires(){return[Tp,Wc,tn]}constructor(e){super(e),e.config.define("link",{addTargetToExternalLinks:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:ew}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(n,i)=>ew(tw(n),i)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:n=>n.getAttribute("href")}}),e.commands.add("link",new Uy(e)),e.commands.add("unlink",new Wy(e));const t=function(n,i){const o={"Open in a new tab":n("Open in a new tab"),Downloadable:n("Downloadable")};return i.forEach(a=>(a.label&&o[a.label]&&(a.label=o[a.label]),a)),i}(e.t,function(n){const i=[];if(n)for(const[o,a]of Object.entries(n)){const c=Object.assign({},a,{id:"link"+By(o)});i.push(c)}return i}(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter(n=>n.mode==="automatic")),this._enableManualDecorators(t.filter(n=>n.mode==="manual")),e.plugins.get(Tp).registerAttribute("linkHref"),function(n,i,o,a){const c=n.editing.view,u=new Set;c.document.registerPostFixer(h=>{const m=n.model.document.selection;let k=!1;if(m.hasAttribute(i)){const C=fs(m.getFirstPosition(),i,m.getAttribute(i),n.model),S=n.editing.mapper.toViewRange(C);for(const N of S.getItems())N.is("element",o)&&!N.hasClass(a)&&(h.addClass(a,N),u.add(N),k=!0)}return k}),n.conversion.for("editingDowncast").add(h=>{function m(){c.change(k=>{for(const C of u.values())k.removeClass(a,C),u.delete(C)})}h.on("insert",m,{priority:"highest"}),h.on("remove",m,{priority:"highest"}),h.on("attribute",m,{priority:"highest"}),h.on("selection",m,{priority:"highest"})})}(e,"linkHref","a","ck-link_selected"),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(e){const t=this.editor,n=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:"automatic",callback:i=>qy.test(i),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(e),n.length&&t.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,n=t.commands.get("link").manualDecorators;e.forEach(i=>{t.model.schema.extend("$text",{allowAttributes:i.id}),i=new iw(i),n.add(i),t.conversion.for("downcast").attributeToElement({model:i.id,view:(o,{writer:a})=>{if(o){const c=a.createAttributeElement("a",i.attributes,{priority:5});i.classes&&a.addClass(i.classes,c);for(const u in i.styles)a.setStyle(u,i.styles[u],c);return a.setCustomProperty("link",!0,c),c}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...i._createPattern()},model:{key:i.id}})})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(e,"insertContent",()=>{const n=t.anchor.nodeBefore,i=t.anchor.nodeAfter;t.hasAttribute("linkHref")&&n&&n.hasAttribute("linkHref")&&(i&&i.hasAttribute("linkHref")||e.change(o=>{ov(o,sv(e.schema))}))},{priority:"low"})}_enableClickingAfterLink(){const e=this.editor,t=e.model;e.editing.view.addObserver($c);let n=!1;this.listenTo(e.editing.view.document,"mousedown",()=>{n=!0}),this.listenTo(e.editing.view.document,"selectionChange",()=>{if(!n)return;n=!1;const i=t.document.selection;if(!i.isCollapsed||!i.hasAttribute("linkHref"))return;const o=i.getFirstPosition(),a=fs(o,"linkHref",i.getAttribute("linkHref"),t);(o.isTouching(a.start)||o.isTouching(a.end))&&t.change(c=>{ov(c,sv(t.schema))})})}_enableTypingOverLink(){const e=this.editor,t=e.editing.view;let n,i;this.listenTo(t.document,"delete",()=>{i=!0},{priority:"high"}),this.listenTo(e.model,"deleteContent",()=>{const o=e.model.document.selection;o.isCollapsed||(i?i=!1:rw(e)&&function(a){const c=a.document.selection,u=c.getFirstPosition(),h=c.getLastPosition(),m=u.nodeAfter;if(!m||!m.is("$text")||!m.hasAttribute("linkHref"))return!1;const k=h.textNode||h.nodeBefore;return m===k?!0:fs(u,"linkHref",m.getAttribute("linkHref"),a).containsRange(a.createRange(u,h),!0)}(e.model)&&(n=o.getAttributes()))},{priority:"high"}),this.listenTo(e.model,"insertContent",(o,[a])=>{i=!1,rw(e)&&n&&(e.model.change(c=>{for(const[u,h]of n)c.setAttribute(u,h,a)}),n=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const e=this.editor,t=e.model,n=t.document.selection,i=e.editing.view;let o=!1,a=!1;this.listenTo(i.document,"delete",(c,u)=>{a=u.domEvent.keyCode===ot.backspace},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{o=!1;const c=n.getFirstPosition(),u=n.getAttribute("linkHref");if(!u)return;const h=fs(c,"linkHref",u,t);o=h.containsPosition(c)||h.end.isEqual(c)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{a&&(a=!1,o||e.model.enqueueChange(c=>{ov(c,sv(t.schema))}))},{priority:"low"})}}function ov(r,e){r.removeSelectionAttribute("linkHref");for(const t of e)r.removeSelectionAttribute(t)}function rw(r){return r.plugins.get("Input").isInput(r.model.change(e=>e.batch))}function sv(r){return r.getDefinition("$text").allowAttributes.filter(e=>e.startsWith("link"))}v(90);class Gy extends ut{constructor(e,t){super(e);const n=e.t;this.focusTracker=new $i,this.keystrokes=new Ei,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),Oi.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),Oi.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusables=new as,this._focusCycler=new Us({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&i.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children}),Eu(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>(e[t.name]=t.isOn,e),{})}render(){super.render(),Pu({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const e=this.locale.t,t=new Ru(this.locale,Du);return t.label=e("Link URL"),t}_createButton(e,t,n,i){const o=new Jt(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),i&&o.delegate("execute").to(this,i),o}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const n of e.manualDecorators){const i=new zc(this.locale);i.set({name:n.id,label:n.label,withText:!0}),i.bind("isOn").toMany([n,e],"value",(o,a)=>a===void 0&&o===void 0?n.defaultValue:o),i.on("execute",()=>{n.set("value",!i.isOn)}),t.add(i)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const n=new ut;n.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(i=>({tag:"li",children:[i],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(n)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}}v(92);class Qy extends ut{constructor(e){super(e);const t=e.t;this.focusTracker=new $i,this.keystrokes=new Ei,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(t("Unlink"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184zm4.919 10.562-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414z"/></svg>',"unlink"),this.editButtonView=this._createButton(t("Edit link"),Oi.pencil,"edit"),this.set("href"),this._focusables=new as,this._focusCycler=new Us({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(e,t,n){const i=new Jt(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.delegate("execute").to(this,n),i}_createPreviewButton(){const e=new Jt(this.locale),t=this.bindTemplate,n=this.t;return e.set({withText:!0,tooltip:n("Open link in new tab")}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",i=>i&&tw(i)),target:"_blank",rel:"noopener noreferrer"}}),e.bind("label").to(this,"href",i=>i||n("This link has no URL")),e.bind("isEnabled").to(this,"href",i=>!!i),e.template.tag="a",e.template.eventListeners={},e}}class Yy extends me{static get requires(){return[al]}static get pluginName(){return"LinkUI"}init(){const e=this.editor;e.editing.view.addObserver(qm),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=e.plugins.get(al),this._createToolbarLinkButton(),this._enableUserBalloonInteractions(),e.conversion.for("editingDowncast").markerToHighlight({model:"link-ui",view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:"link-ui",view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const e=this.editor,t=new Qy(e.locale),n=e.commands.get("link"),i=e.commands.get("unlink");return t.bind("href").to(n,"value"),t.editButtonView.bind("isEnabled").to(n),t.unlinkButtonView.bind("isEnabled").to(i),this.listenTo(t,"edit",()=>{this._addFormView()}),this.listenTo(t,"unlink",()=>{e.execute("unlink"),this._hideUI()}),t.keystrokes.set("Esc",(o,a)=>{this._hideUI(),a()}),t.keystrokes.set("Ctrl+K",(o,a)=>{this._addFormView(),a()}),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),n=e.config.get("link.defaultProtocol"),i=new Gy(e.locale,t);return i.urlInputView.fieldView.bind("value").to(t,"value"),i.urlInputView.bind("isReadOnly").to(t,"isEnabled",o=>!o),i.saveButtonView.bind("isEnabled").to(t),this.listenTo(i,"submit",()=>{const{value:o}=i.urlInputView.fieldView.element,a=nw(o,n);e.execute("link",a,i.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(i,"cancel",()=>{this._closeFormView()}),i.keystrokes.set("Esc",(o,a)=>{this._closeFormView(),a()}),i}_createToolbarLinkButton(){const e=this.editor,t=e.commands.get("link"),n=e.t;e.keystrokes.set("Ctrl+K",(i,o)=>{o(),t.isEnabled&&this._showUI(!0)}),e.ui.componentFactory.add("link",i=>{const o=new Jt(i);return o.isEnabled=!0,o.label=n("Link"),o.icon='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184z"/></svg>',o.keystroke="Ctrl+K",o.tooltip=!0,o.isToggleable=!0,o.bind("isEnabled").to(t,"isEnabled"),o.bind("isOn").to(t,"value",a=>!!a),this.listenTo(o,"execute",()=>this._showUI(!0)),o})}_enableUserBalloonInteractions(){const e=this.editor.editing.view.document;this.listenTo(e,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),this.editor.keystrokes.set("Tab",(t,n)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),n())},{priority:"high"}),this.editor.keystrokes.set("Esc",(t,n)=>{this._isUIVisible&&(this._hideUI(),n())}),Su({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=e.value||""}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),e.value!==void 0?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const e=this.editor;this.stopListening(e.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let n=this._getSelectedLinkElement(),i=a();const o=()=>{const c=this._getSelectedLinkElement(),u=a();n&&!c||!n&&u!==i?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=c,i=u};function a(){return t.selection.focus.getAncestors().reverse().find(c=>c.is("element"))}this.listenTo(e.ui,"update",o),this.listenTo(this._balloon,"change:visibleView",o)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,n=e.document;let i=null;if(t.markers.has("link-ui")){const o=Array.from(this.editor.editing.mapper.markerNameToElements("link-ui")),a=e.createRange(e.createPositionBefore(o[0]),e.createPositionAfter(o[o.length-1]));i=e.domConverter.viewRangeToDom(a)}else i=()=>{const o=this._getSelectedLinkElement();return o?e.domConverter.mapViewToDom(o):e.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:i}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,n=t.getSelectedElement();if(t.isCollapsed||n&&Ze(n))return av(t.getFirstPosition());{const i=t.getFirstRange().getTrimmed(),o=av(i.start),a=av(i.end);return o&&o==a&&e.createRangeIn(o).getTrimmed().isEqual(i)?o:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{const n=e.document.selection.getFirstRange();if(e.markers.has("link-ui"))t.updateMarker("link-ui",{range:n});else if(n.start.isAtEnd){const i=n.start.getLastMatchingPosition(({item:o})=>!e.schema.isContent(o),{boundaries:n});t.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:t.createRange(i,n.end)})}else t.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:n})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has("link-ui")&&e.change(t=>{t.removeMarker("link-ui")})}}function av(r){return r.getAncestors().find(e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t})}const Xy=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class Jy extends me{static get pluginName(){return"AutoLink"}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const e=this.editor,t=new qu(e.model,i=>{if(!function(a){return a.length>4&&a[a.length-1]===" "&&a[a.length-2]!==" "}(i))return;const o=ow(i.substr(0,i.length-1));return o?{url:o}:void 0}),n=e.plugins.get("Input");t.on("matched:data",(i,o)=>{const{batch:a,range:c,url:u}=o;if(!n.isInput(a))return;const h=c.end.getShiftedBy(-1),m=h.getShiftedBy(-u.length),k=e.model.createRange(m,h);this._applyAutoLink(u,k)}),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("enter");n&&n.on("execute",()=>{const i=t.document.selection.getFirstPosition();if(!i.parent.previousSibling)return;const o=t.createRangeIn(i.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(o)})}_enableShiftEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("shiftEnter");n&&n.on("execute",()=>{const i=t.document.selection.getFirstPosition(),o=t.createRange(t.createPositionAt(i.parent,0),i.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(o)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:n,range:i}=qc(e,t),o=ow(n);if(o){const a=t.createRange(i.end.getShiftedBy(-o.length),i.end);this._applyAutoLink(o,a)}}_applyAutoLink(e,t){const n=this.editor.model;this.isEnabled&&function(i,o){return o.schema.checkAttributeInSelection(o.createSelection(i),"linkHref")}(t,n)&&n.enqueueChange(i=>{const o=this.editor.config.get("link.defaultProtocol"),a=nw(e,o);i.setAttribute("linkHref",a,t)})}}function ow(r){const e=Xy.exec(r);return e?e[2]:null}class sw extends ct{constructor(e,t){super(e),this.type=t}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.document,i=Array.from(n.selection.getSelectedBlocks()).filter(a=>lw(a,t.schema)),o=e.forceValue!==void 0?!e.forceValue:this.value;t.change(a=>{if(o){let c=i[i.length-1].nextSibling,u=Number.POSITIVE_INFINITY,h=[];for(;c&&c.name=="listItem"&&c.getAttribute("listIndent")!==0;){const m=c.getAttribute("listIndent");m<u&&(u=m);const k=m-u;h.push({element:c,listIndent:k}),c=c.nextSibling}h=h.reverse();for(const m of h)a.setAttribute("listIndent",m.listIndent,m.element)}if(!o){let c=Number.POSITIVE_INFINITY;for(const u of i)u.is("element","listItem")&&u.getAttribute("listIndent")<c&&(c=u.getAttribute("listIndent"));c=c===0?1:c,aw(i,!0,c),aw(i,!1,c)}for(const c of i.reverse())o&&c.name=="listItem"?a.rename(c,"paragraph"):o||c.name=="listItem"?o||c.name!="listItem"||c.getAttribute("listType")==this.type||a.setAttribute("listType",this.type,c):(a.setAttributes({listType:this.type,listIndent:0},c),a.rename(c,"listItem"));this.fire("_executeCleanup",i)})}_getValue(){const e=ui(this.editor.model.document.selection.getSelectedBlocks());return!!e&&e.is("element","listItem")&&e.getAttribute("listType")==this.type}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=ui(e.getSelectedBlocks());return!!n&&lw(n,t)}}function aw(r,e,t){const n=e?r[0]:r[r.length-1];if(n.is("element","listItem")){let i=n[e?"previousSibling":"nextSibling"],o=n.getAttribute("listIndent");for(;i&&i.is("element","listItem")&&i.getAttribute("listIndent")>=t;)o>i.getAttribute("listIndent")&&(o=i.getAttribute("listIndent")),i.getAttribute("listIndent")==o&&r[e?"unshift":"push"](i),i=i[e?"previousSibling":"nextSibling"]}}function lw(r,e){return e.checkChild(r.parent,"listItem")&&!e.isObject(r)}class cw extends ct{constructor(e,t){super(e),this._indentBy=t=="forward"?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=e.document;let n=Array.from(t.selection.getSelectedBlocks());e.change(i=>{const o=n[n.length-1];let a=o.nextSibling;for(;a&&a.name=="listItem"&&a.getAttribute("listIndent")>o.getAttribute("listIndent");)n.push(a),a=a.nextSibling;this._indentBy<0&&(n=n.reverse());for(const c of n){const u=c.getAttribute("listIndent")+this._indentBy;u<0?i.rename(c,"paragraph"):i.setAttribute("listIndent",u,c)}this.fire("_executeCleanup",n)})}_checkEnabled(){const e=ui(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is("element","listItem"))return!1;if(this._indentBy>0){const t=e.getAttribute("listIndent"),n=e.getAttribute("listType");let i=e.previousSibling;for(;i&&i.is("element","listItem")&&i.getAttribute("listIndent")>=t;){if(i.getAttribute("listIndent")==t)return i.getAttribute("listType")==n;i=i.previousSibling}return!1}return!0}}function Zy(r,e){const t=e.mapper,n=e.writer,i=r.getAttribute("listType")=="numbered"?"ol":"ul",o=function(c){const u=c.createContainerElement("li");return u.getFillerOffset=e1,u}(n),a=n.createContainerElement(i,null);return n.insert(n.createPositionAt(a,0),o),t.bindElements(r,o),o}function dw(r,e,t,n){const i=e.parent,o=t.mapper,a=t.writer;let c=o.toViewPosition(n.createPositionBefore(r));const u=hw(r.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:r.getAttribute("listIndent")}),h=r.previousSibling;if(u&&u.getAttribute("listIndent")==r.getAttribute("listIndent")){const m=o.toViewElement(u);c=a.breakContainer(a.createPositionAfter(m))}else if(h&&h.name=="listItem"){c=o.toViewPosition(n.createPositionAt(h,"end"));const m=o.findMappedViewAncestor(c),k=function(C){for(const S of C.getChildren())if(S.name=="ul"||S.name=="ol")return S;return null}(m);c=k?a.createPositionBefore(k):a.createPositionAt(m,"end")}else c=o.toViewPosition(n.createPositionBefore(r));if(c=uw(c),a.insert(c,i),h&&h.name=="listItem"){const m=o.toViewElement(h),k=a.createRange(a.createPositionAt(m,0),c).getWalker({ignoreElementEnd:!0});for(const C of k)if(C.item.is("element","li")){const S=a.breakContainer(a.createPositionBefore(C.item)),N=C.item.parent,D=a.createPositionAt(e,"end");zr(a,D.nodeBefore,D.nodeAfter),a.move(a.createRangeOn(N),D),k.position=S}}else{const m=i.nextSibling;if(m&&(m.is("element","ul")||m.is("element","ol"))){let k=null;for(const C of m.getChildren()){const S=o.toModelElement(C);if(!(S&&S.getAttribute("listIndent")>r.getAttribute("listIndent")))break;k=C}k&&(a.breakContainer(a.createPositionAfter(k)),a.move(a.createRangeOn(k.parent),a.createPositionAt(e,"end")))}}zr(a,i,i.nextSibling),zr(a,i.previousSibling,i)}function zr(r,e,t){return!e||!t||e.name!="ul"&&e.name!="ol"||e.name!=t.name||e.getAttribute("class")!==t.getAttribute("class")?null:r.mergeContainers(r.createPositionAfter(e))}function uw(r){return r.getLastMatchingPosition(e=>e.item.is("uiElement"))}function hw(r,e){const t=!!e.sameIndent,n=!!e.smallerIndent,i=e.listIndent;let o=r;for(;o&&o.name=="listItem";){const a=o.getAttribute("listIndent");if(t&&i==a||n&&i>a)return o;o=e.direction==="forward"?o.nextSibling:o.previousSibling}return null}function fw(r,e,t,n){r.ui.componentFactory.add(e,i=>{const o=r.commands.get(e),a=new Jt(i);return a.set({label:t,icon:n,tooltip:!0,isToggleable:!0}),a.bind("isOn","isEnabled").to(o,"value","isEnabled"),a.on("execute",()=>{r.execute(e),r.editing.view.focus()}),a})}function e1(){const r=!this.isEmpty&&(this.getChild(0).name=="ul"||this.getChild(0).name=="ol");return this.isEmpty||r?0:tt.call(this)}function pw(r){return(e,t,n)=>{const i=n.consumable;if(!i.test(t.item,"insert")||!i.test(t.item,"attribute:listType")||!i.test(t.item,"attribute:listIndent"))return;i.consume(t.item,"insert"),i.consume(t.item,"attribute:listType"),i.consume(t.item,"attribute:listIndent");const o=t.item;dw(o,Zy(o,n),n,r)}}function t1(r,e,t){if(!t.consumable.consume(e.item,"attribute:listType"))return;const n=t.mapper.toViewElement(e.item),i=t.writer;i.breakContainer(i.createPositionBefore(n)),i.breakContainer(i.createPositionAfter(n));const o=n.parent,a=e.attributeNewValue=="numbered"?"ol":"ul";i.rename(a,o)}function n1(r,e,t){const n=t.mapper.toViewElement(e.item).parent,i=t.writer;zr(i,n,n.nextSibling),zr(i,n.previousSibling,n);for(const o of e.item.getChildren())t.consumable.consume(o,"insert")}function gw(r,e,t){if(e.item.name!="listItem"){let n=t.mapper.toViewPosition(e.range.start);const i=t.writer,o=[];for(;(n.parent.name=="ul"||n.parent.name=="ol")&&(n=i.breakContainer(n),n.parent.name=="li");){const a=n,c=i.createPositionAt(n.parent,"end");if(!a.isEqual(c)){const u=i.remove(i.createRange(a,c));o.push(u)}n=i.createPositionAfter(n.parent)}if(o.length>0){for(let a=0;a<o.length;a++){const c=n.nodeBefore;if(n=i.insert(n,o[a]).end,a>0){const u=zr(i,c,c.nextSibling);u&&u.parent==c&&n.offset--}}zr(i,n.nodeBefore,n.nodeAfter)}}}function i1(r,e,t){const n=t.mapper.toViewPosition(e.position),i=n.nodeBefore,o=n.nodeAfter;zr(t.writer,i,o)}function r1(r,e,t){if(t.consumable.consume(e.viewItem,{name:!0})){const n=t.writer,i=n.createElement("listItem"),o=function(u){let h=0,m=u.parent;for(;m;){if(m.is("element","li"))h++;else{const k=m.previousSibling;k&&k.is("element","li")&&h++}m=m.parent}return h}(e.viewItem);n.setAttribute("listIndent",o,i);const a=e.viewItem.parent&&e.viewItem.parent.name=="ol"?"numbered":"bulleted";if(n.setAttribute("listType",a,i),!t.safeInsert(i,e.modelCursor))return;const c=function(u,h,m){const{writer:k,schema:C}=m;let S=k.createPositionAfter(u);for(const N of h)if(N.name=="ul"||N.name=="ol")S=m.convertItem(N,S).modelCursor;else{const D=m.convertItem(N,k.createPositionAt(u,"end")),z=D.modelRange.start.nodeAfter;z&&z.is("element")&&!C.checkChild(u,z.name)&&(u=D.modelCursor.parent.is("element","listItem")?D.modelCursor.parent:a1(D.modelCursor),S=k.createPositionAfter(u))}return S}(i,e.viewItem.getChildren(),t);e.modelRange=n.createRange(e.modelCursor,c),t.updateConversionResult(i,e)}}function mw(r,e,t){if(t.consumable.test(e.viewItem,{name:!0})){const n=Array.from(e.viewItem.getChildren());for(const i of n)!(i.is("element","li")||ml(i))&&i._remove()}}function o1(r,e,t){if(t.consumable.test(e.viewItem,{name:!0})){if(e.viewItem.childCount===0)return;const n=[...e.viewItem.getChildren()];let i=!1,o=!0;for(const a of n)i&&!ml(a)&&a._remove(),a.is("$text")?(o&&(a._data=a.data.trimStart()),a.nextSibling&&!ml(a.nextSibling)||(a._data=a.data.trimEnd())):ml(a)&&(i=!0),o=!1}}function bw(r){return(e,t)=>{if(t.isPhantom)return;const n=t.modelPosition.nodeBefore;if(n&&n.is("element","listItem")){const i=t.mapper.toViewElement(n),o=i.getAncestors().find(ml),a=r.createPositionAt(i,0).getWalker();for(const c of a){if(c.type=="elementStart"&&c.item.is("element","li")){t.viewPosition=c.previousPosition;break}if(c.type=="elementEnd"&&c.item==o){t.viewPosition=c.nextPosition;break}}}}}function s1(r,[e,t]){let n,i=e.is("documentFragment")?e.getChild(0):e;if(n=t?this.createSelection(t):this.document.selection,i&&i.is("element","listItem")){const o=n.getFirstPosition();let a=null;if(o.parent.is("element","listItem")?a=o.parent:o.nodeBefore&&o.nodeBefore.is("element","listItem")&&(a=o.nodeBefore),a){const c=a.getAttribute("listIndent");if(c>0)for(;i&&i.is("element","listItem");)i._setAttribute("listIndent",i.getAttribute("listIndent")+c),i=i.nextSibling}}}function a1(r){const e=new nr({startPosition:r});let t;do t=e.next();while(!t.value.item.is("element","listItem"));return t.value.item}function vw(r,e,t,n,i,o){const a=hw(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:r,foo:"b"}),c=i.mapper,u=i.writer,h=a?a.getAttribute("listIndent"):null;let m;if(a)if(h==r){const k=c.toViewElement(a).parent;m=u.createPositionAfter(k)}else{const k=o.createPositionAt(a,"end");m=c.toViewPosition(k)}else m=t;m=uw(m);for(const k of[...n.getChildren()])ml(k)&&(m=u.move(u.createRangeOn(k),m).end,zr(u,k,k.nextSibling),zr(u,k.previousSibling,k))}function ml(r){return r.is("element","ol")||r.is("element","ul")}class l1 extends me{static get pluginName(){return"ListEditing"}static get requires(){return[Hc,us]}init(){const e=this.editor;e.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const t=e.data,n=e.editing;var i;e.model.document.registerPostFixer(c=>function(u,h){const m=u.document.differ.getChanges(),k=new Map;let C=!1;for(const z of m)if(z.type=="insert"&&z.name=="listItem")S(z.position);else if(z.type=="insert"&&z.name!="listItem"){if(z.name!="$text"){const U=z.position.nodeAfter;U.hasAttribute("listIndent")&&(h.removeAttribute("listIndent",U),C=!0),U.hasAttribute("listType")&&(h.removeAttribute("listType",U),C=!0),U.hasAttribute("listStyle")&&(h.removeAttribute("listStyle",U),C=!0);for(const J of Array.from(u.createRangeIn(U)).filter(ce=>ce.item.is("element","listItem")))S(J.previousPosition)}S(z.position.getShiftedBy(z.length))}else z.type=="remove"&&z.name=="listItem"?S(z.position):(z.type=="attribute"&&z.attributeKey=="listIndent"||z.type=="attribute"&&z.attributeKey=="listType")&&S(z.range.start);for(const z of k.values())N(z),D(z);return C;function S(z){const U=z.nodeBefore;if(U&&U.is("element","listItem")){let J=U;if(k.has(J))return;for(let ce=J.previousSibling;ce&&ce.is("element","listItem");ce=J.previousSibling)if(J=ce,k.has(J))return;k.set(U,J)}else{const J=z.nodeAfter;J&&J.is("element","listItem")&&k.set(J,J)}}function N(z){let U=0,J=null;for(;z&&z.is("element","listItem");){const ce=z.getAttribute("listIndent");if(ce>U){let ye;J===null?(J=ce-U,ye=U):(J>ce&&(J=ce),ye=ce-J),h.setAttribute("listIndent",ye,z),C=!0}else J=null,U=z.getAttribute("listIndent")+1;z=z.nextSibling}}function D(z){let U=[],J=null;for(;z&&z.is("element","listItem");){const ce=z.getAttribute("listIndent");if(J&&J.getAttribute("listIndent")>ce&&(U=U.slice(0,ce+1)),ce!=0)if(U[ce]){const ye=U[ce];z.getAttribute("listType")!=ye&&(h.setAttribute("listType",ye,z),C=!0)}else U[ce]=z.getAttribute("listType");J=z,z=z.nextSibling}}}(e.model,c)),n.mapper.registerViewToModelLength("li",lv),t.mapper.registerViewToModelLength("li",lv),n.mapper.on("modelToViewPosition",bw(n.view)),n.mapper.on("viewToModelPosition",(i=e.model,(c,u)=>{const h=u.viewPosition,m=h.parent,k=u.mapper;if(m.name=="ul"||m.name=="ol"){if(h.isAtEnd){const C=k.toModelElement(h.nodeBefore),S=k.getModelLength(h.nodeBefore);u.modelPosition=i.createPositionBefore(C).getShiftedBy(S)}else{const C=k.toModelElement(h.nodeAfter);u.modelPosition=i.createPositionBefore(C)}c.stop()}else if(m.name=="li"&&h.nodeBefore&&(h.nodeBefore.name=="ul"||h.nodeBefore.name=="ol")){const C=k.toModelElement(m);let S=1,N=h.nodeBefore;for(;N&&ml(N);)S+=k.getModelLength(N),N=N.previousSibling;u.modelPosition=i.createPositionBefore(C).getShiftedBy(S),c.stop()}})),t.mapper.on("modelToViewPosition",bw(n.view)),e.conversion.for("editingDowncast").add(c=>{c.on("insert",gw,{priority:"high"}),c.on("insert:listItem",pw(e.model)),c.on("attribute:listType:listItem",t1,{priority:"high"}),c.on("attribute:listType:listItem",n1,{priority:"low"}),c.on("attribute:listIndent:listItem",function(u){return(h,m,k)=>{if(!k.consumable.consume(m.item,"attribute:listIndent"))return;const C=k.mapper.toViewElement(m.item),S=k.writer;S.breakContainer(S.createPositionBefore(C)),S.breakContainer(S.createPositionAfter(C));const N=C.parent,D=N.previousSibling,z=S.createRangeOn(N);S.remove(z),D&&D.nextSibling&&zr(S,D,D.nextSibling),vw(m.attributeOldValue+1,m.range.start,z.start,C,k,u),dw(m.item,C,k,u);for(const U of m.item.getChildren())k.consumable.consume(U,"insert")}}(e.model)),c.on("remove:listItem",function(u){return(h,m,k)=>{const C=k.mapper.toViewPosition(m.position).getLastMatchingPosition(J=>!J.item.is("element","li")).nodeAfter,S=k.writer;S.breakContainer(S.createPositionBefore(C)),S.breakContainer(S.createPositionAfter(C));const N=C.parent,D=N.previousSibling,z=S.createRangeOn(N),U=S.remove(z);D&&D.nextSibling&&zr(S,D,D.nextSibling),vw(k.mapper.toModelElement(C).getAttribute("listIndent")+1,m.position,z.start,C,k,u);for(const J of S.createRangeIn(U).getItems())k.mapper.unbindViewElement(J);h.stop()}}(e.model)),c.on("remove",i1,{priority:"low"})}),e.conversion.for("dataDowncast").add(c=>{c.on("insert",gw,{priority:"high"}),c.on("insert:listItem",pw(e.model))}),e.conversion.for("upcast").add(c=>{c.on("element:ul",mw,{priority:"high"}),c.on("element:ol",mw,{priority:"high"}),c.on("element:li",o1,{priority:"high"}),c.on("element:li",r1)}),e.model.on("insertContent",s1,{priority:"high"}),e.commands.add("numberedList",new sw(e,"numbered")),e.commands.add("bulletedList",new sw(e,"bulleted")),e.commands.add("indentList",new cw(e,"forward")),e.commands.add("outdentList",new cw(e,"backward"));const o=n.view.document;this.listenTo(o,"enter",(c,u)=>{const h=this.editor.model.document,m=h.selection.getLastPosition().parent;h.selection.isCollapsed&&m.name=="listItem"&&m.isEmpty&&(this.editor.execute("outdentList"),u.preventDefault(),c.stop())},{context:"li"}),this.listenTo(o,"delete",(c,u)=>{if(u.direction!=="backward")return;const h=this.editor.model.document.selection;if(!h.isCollapsed)return;const m=h.getFirstPosition();if(!m.isAtStart)return;const k=m.parent;k.name==="listItem"&&(k.previousSibling&&k.previousSibling.name==="listItem"||(this.editor.execute("outdentList"),u.preventDefault(),c.stop()))},{context:"li"});const a=c=>(u,h)=>{this.editor.commands.get(c).isEnabled&&(this.editor.execute(c),h())};e.keystrokes.set("Tab",a("indentList")),e.keystrokes.set("Shift+Tab",a("outdentList"))}afterInit(){const e=this.editor.commands,t=e.get("indent"),n=e.get("outdent");t&&t.registerChildCommand(e.get("indentList")),n&&n.registerChildCommand(e.get("outdentList"))}}function lv(r){let e=1;for(const t of r.getChildren())if(t.name=="ul"||t.name=="ol")for(const n of t.getChildren())e+=lv(n);return e}class c1 extends me{static get pluginName(){return"ListUI"}init(){const e=this.editor.t;fw(this.editor,"numberedList",e("Numbered List"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM3.5 3v5H2V3.7H1v-1h2.5V3zM.343 17.857l2.59-3.257H2.92a.6.6 0 1 0-1.04 0H.302a2 2 0 1 1 3.995 0h-.001c-.048.405-.16.734-.333.988-.175.254-.59.692-1.244 1.312H4.3v1h-4l.043-.043zM7 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75z"/></svg>'),fw(this.editor,"bulletedList",e("Bulleted List"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0C1 4.784 1.777 4 2.75 4c.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75C1.784 7.5 1 6.723 1 5.75zm6 9c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0c0-.966.777-1.75 1.75-1.75.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75-.966 0-1.75-.777-1.75-1.75z"/></svg>')}}function _w(r,e){return n=>{n.on("attribute:url:media",t)};function t(n,i,o){if(!o.consumable.consume(i.item,n.name))return;const a=i.attributeNewValue,c=o.writer,u=o.mapper.toViewElement(i.item),h=[...u.getChildren()].find(k=>k.getCustomProperty("media-content"));c.remove(h);const m=r.getMediaViewElement(c,a,e);c.insert(c.createPositionAt(u,0),m)}}function ww(r,e,t,n){const i=r.createContainerElement("figure",{class:"media"});return r.insert(r.createPositionAt(i,0),e.getMediaViewElement(r,t,n)),i}function kw(r){const e=r.getSelectedElement();return e&&e.is("element","media")?e:null}function yw(r,e,t){r.change(n=>{const i=n.createElement("media",{url:e});r.insertContent(i,t),n.setSelection(i,"on")})}class d1 extends ct{refresh(){const e=this.editor.model,t=e.document.selection,n=kw(t);this.value=n?n.getAttribute("url"):null,this.isEnabled=function(i){const o=i.getSelectedElement();return!!o&&o.name==="media"}(t)||function(i,o){let a=dl(i,o).start.parent;return a.isEmpty&&!o.schema.isLimit(a)&&(a=a.parent),o.schema.checkChild(a,"media")}(t,e)}execute(e){const t=this.editor.model,n=t.document.selection,i=kw(n);i?t.change(o=>{o.setAttribute("url",e,i)}):yw(t,e,dl(n,t))}}class u1{constructor(e,t){const n=t.providers,i=t.extraProviders||[],o=new Set(t.removeProviders),a=n.concat(i).filter(c=>{const u=c.name;return u?!o.has(u):(Object(y.b)("media-embed-no-provider-name",{provider:c}),!1)});this.locale=e,this.providerDefinitions=a}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,n){return this._getMedia(t).getViewElement(e,n)}_getMedia(e){if(!e)return new xw(this.locale);e=e.trim();for(const t of this.providerDefinitions){const n=t.html,i=xt(t.url);for(const o of i){const a=this._getUrlMatches(e,o);if(a)return new xw(this.locale,e,a,n)}}return null}_getUrlMatches(e,t){let n=e.match(t);if(n)return n;let i=e.replace(/^https?:\/\//,"");return n=i.match(t),n||(i=i.replace(/^www\./,""),n=i.match(t),n||null)}}class xw{constructor(e,t,n,i){this.url=this._getValidUrl(t),this._t=e.t,this._match=n,this._previewRenderer=i}getViewElement(e,t){const n={};let i;if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(n["data-oembed-url"]=this.url),t.renderForEditingView&&(n.class="ck-media__wrapper");const o=this._getPreviewHtml(t);i=e.createRawElement("div",n,function(a){a.innerHTML=o})}else this.url&&(n.url=this.url),i=e.createEmptyElement(t.elementName,n);return e.setCustomProperty("media-content",!0,i),i}_getPreviewHtml(e){return this._previewRenderer?this._previewRenderer(this._match):this.url&&e.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const e=new Bf,t=new Lc;return e.text=this._t("Open media in new tab"),t.content='<svg viewBox="0 0 64 42" xmlns="http://www.w3.org/2000/svg"><path d="M47.426 17V3.713L63.102 0v19.389h-.001l.001.272c0 1.595-2.032 3.43-4.538 4.098-2.506.668-4.538-.083-4.538-1.678 0-1.594 2.032-3.43 4.538-4.098.914-.244 2.032-.565 2.888-.603V4.516L49.076 7.447v9.556A1.014 1.014 0 0 0 49 17h-1.574zM29.5 17h-8.343a7.073 7.073 0 1 0-4.657 4.06v3.781H3.3a2.803 2.803 0 0 1-2.8-2.804V8.63a2.803 2.803 0 0 1 2.8-2.805h4.082L8.58 2.768A1.994 1.994 0 0 1 10.435 1.5h8.985c.773 0 1.477.448 1.805 1.149l1.488 3.177H26.7c1.546 0 2.8 1.256 2.8 2.805V17zm-11.637 0H17.5a1 1 0 0 0-1 1v.05A4.244 4.244 0 1 1 17.863 17zm29.684 2c.97 0 .953-.048.953.889v20.743c0 .953.016.905-.953.905H19.453c-.97 0-.953.048-.953-.905V19.89c0-.937-.016-.889.97-.889h28.077zm-4.701 19.338V22.183H24.154v16.155h18.692zM20.6 21.375v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616V37.53H20.6zm24.233-16.155v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615V37.53h-1.615zM29.485 25.283a.4.4 0 0 1 .593-.35l9.05 4.977a.4.4 0 0 1 0 .701l-9.05 4.978a.4.4 0 0 1-.593-.35v-9.956z"/></svg>',t.viewBox="0 0 64 42",new Ni({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[t]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]},e]}]}).render().outerHTML}_getValidUrl(e){return e?e.match(/^https?/)?e:"https://"+e:null}}v(94);class Zp extends me{static get pluginName(){return"MediaEmbedEditing"}constructor(e){super(e),e.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:/^dailymotion\.com\/video\/(\w+)/,html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; "><iframe src="https://www.dailymotion.com/embed/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" width="480" height="270" allowfullscreen allow="autoplay"></iframe></div>`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 126%;"><iframe src="https://open.spotify.com/embed/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe></div>`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)/,/^youtube\.com\/embed\/([\w-]+)/,/^youtu\.be\/([\w-]+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://www.youtube.com/embed/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>`},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://player.vimeo.com/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>`},{name:"instagram",url:/^instagram\.com\/p\/(\w+)/},{name:"twitter",url:/^twitter\.com/},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new u1(e.locale,e.config.get("mediaEmbed"))}init(){const e=this.editor,t=e.model.schema,n=e.t,i=e.conversion,o=e.config.get("mediaEmbed.previewsInData"),a=e.config.get("mediaEmbed.elementName"),c=this.registry;e.commands.add("mediaEmbed",new d1(e)),t.register("media",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["url"]}),i.for("dataDowncast").elementToElement({model:"media",view:(u,{writer:h})=>{const m=u.getAttribute("url");return ww(h,c,m,{elementName:a,renderMediaPreview:m&&o})}}),i.for("dataDowncast").add(_w(c,{elementName:a,renderMediaPreview:o})),i.for("editingDowncast").elementToElement({model:"media",view:(u,{writer:h})=>{const m=u.getAttribute("url");return function(k,C,S){return C.setCustomProperty("media",!0,k),Zt(k,C,{label:S})}(ww(h,c,m,{elementName:a,renderForEditingView:!0}),h,n("media widget"))}}),i.for("editingDowncast").add(_w(c,{elementName:a,renderForEditingView:!0})),i.for("upcast").elementToElement({view:u=>["oembed",a].includes(u.name)&&u.getAttribute("url")?{name:!0}:null,model:(u,{writer:h})=>{const m=u.getAttribute("url");if(c.hasMedia(m))return h.createElement("media",{url:m})}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(u,{writer:h})=>{const m=u.getAttribute("data-oembed-url");if(c.hasMedia(m))return h.createElement("media",{url:m})}})}}const h1=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class f1 extends me{static get requires(){return[Tt,Np]}static get pluginName(){return"AutoMediaEmbed"}constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}init(){const e=this.editor,t=e.model.document;this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",()=>{const n=t.selection.getFirstRange(),i=Rn.fromPosition(n.start);i.stickiness="toPrevious";const o=Rn.fromPosition(n.end);o.stickiness="toNext",t.once("change:data",()=>{this._embedMediaBetweenPositions(i,o),i.detach(),o.detach()},{priority:"high"})}),e.commands.get("undo").on("execute",()=>{this._timeoutId&&($t.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(e,t){const n=this.editor,i=n.plugins.get(Zp).registry,o=new Or(e,t),a=o.getWalker({ignoreElementEnd:!0});let c="";for(const u of a)u.item.is("$textProxy")&&(c+=u.item.data);if(c=c.trim(),!c.match(h1)||!i.hasMedia(c))return void o.detach();n.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=Rn.fromPosition(e),this._timeoutId=$t.window.setTimeout(()=>{n.model.change(u=>{let h;this._timeoutId=null,u.remove(o),o.detach(),this._positionToInsert.root.rootName!=="$graveyard"&&(h=this._positionToInsert),yw(n.model,c,h),this._positionToInsert.detach(),this._positionToInsert=null})},100)):o.detach()}}v(96);class p1 extends ut{constructor(e,t){super(t);const n=t.t;this.focusTracker=new $i,this.keystrokes=new Ei,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),Oi.check,"ck-button-save"),this.saveButtonView.type="submit",this.saveButtonView.bind("isEnabled").to(this,"mediaURLInputValue",i=>!!i),this.cancelButtonView=this._createButton(n("Cancel"),Oi.cancel,"ck-button-cancel","cancel"),this._focusables=new as,this._focusCycler=new Us({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=e,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]}),Eu(this)}render(){super.render(),Pu({view:this}),[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element);const e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e),this.listenTo(this.urlInputView.element,"selectstart",(t,n)=>{n.stopPropagation()},{priority:"high"})}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(e){this.urlInputView.fieldView.element.value=e.trim()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t,t=new Ru(this.locale,Du),n=t.fieldView;return this._urlInputViewInfoDefault=e("Paste the media URL in the input."),this._urlInputViewInfoTip=e("Tip: Paste the URL into the content to embed faster."),t.label=e("Media URL"),t.infoText=this._urlInputViewInfoDefault,n.on("input",()=>{t.infoText=n.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=n.element.value.trim()}),t}_createButton(e,t,n,i){const o=new Jt(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),i&&o.delegate("execute").to(this,i),o}}class g1 extends me{static get requires(){return[Zp]}static get pluginName(){return"MediaEmbedUI"}init(){const e=this.editor,t=e.commands.get("mediaEmbed"),n=e.plugins.get(Zp).registry;e.ui.componentFactory.add("mediaEmbed",i=>{const o=cs(i),a=new p1(function(c,u){return[h=>{if(!h.url.length)return c("The URL must not be empty.")},h=>{if(!u.hasMedia(h.url))return c("This media URL is not supported.")}]}(e.t,n),e.locale);return this._setUpDropdown(o,a,t,e),this._setUpForm(o,a,t),o})}_setUpDropdown(e,t,n){const i=this.editor,o=i.t,a=e.buttonView;function c(){i.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),a.set({label:o("Insert media"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M18.68 3.03c.6 0 .59-.03.59.55v12.84c0 .59.01.56-.59.56H1.29c-.6 0-.59.03-.59-.56V3.58c0-.58-.01-.55.6-.55h17.38zM15.77 15V5H4.2v10h11.57zM2 4v1h1V4H2zm0 2v1h1V6H2zm0 2v1h1V8H2zm0 2v1h1v-1H2zm0 2v1h1v-1H2zm0 2v1h1v-1H2zM17 4v1h1V4h-1zm0 2v1h1V6h-1zm0 2v1h1V8h-1zm0 2v1h1v-1h-1zm0 2v1h1v-1h-1zm0 2v1h1v-1h-1zM7.5 7.177a.4.4 0 0 1 .593-.351l5.133 2.824a.4.4 0 0 1 0 .7l-5.133 2.824a.4.4 0 0 1-.593-.35V7.176v.001z"/></svg>',tooltip:!0}),a.on("open",()=>{t.disableCssTransitions(),t.url=n.value||"",t.urlInputView.fieldView.select(),t.focus(),t.enableCssTransitions()},{priority:"low"}),e.on("submit",()=>{t.isValid()&&(i.execute("mediaEmbed",t.url),c())}),e.on("change:isOpen",()=>t.resetFormStatus()),e.on("cancel",()=>c())}_setUpForm(e,t,n){t.delegate("submit","cancel").to(e),t.urlInputView.bind("value").to(n,"value"),t.urlInputView.bind("isReadOnly").to(n,"isEnabled",i=>!i)}}v(98);function m1(r,e){if(!r.childCount)return;const t=new Ys(r.document),n=function(a,c){const u=c.createRangeIn(a),h=new Vi({name:/^p|h\d+$/,styles:{"mso-list":/.*/}}),m=[];for(const k of u)if(k.type==="elementStart"&&h.match(k.item)){const C=v1(k.item);m.push({element:k.item,id:C.id,order:C.order,indent:C.indent})}return m}(r,t);if(!n.length)return;let i=null,o=1;n.forEach((a,c)=>{const u=function(N,D){if(!N)return!0;if(N.id!==D.id)return D.indent-N.indent!=1;const z=D.element.previousSibling;if(!z)return!0;return U=z,!(U.is("element","ol")||U.is("element","ul"));var U}(n[c-1],a),h=u?null:n[c-1],m=(C=a,(k=h)?C.indent-k.indent:C.indent-1);var k,C;if(u&&(i=null,o=1),!i||m!==0){const N=function(D,z){const U=new RegExp(`@list l${D.id}:level${D.indent}\\s*({[^}]*)`,"gi"),J=/mso-level-number-format:([^;]{0,100});/gi,ce=U.exec(z);let ye="decimal",ze="ol";if(ce&&ce[1]){const Kt=J.exec(ce[1]);if(Kt&&Kt[1]&&(ye=Kt[1].trim(),ze=ye!=="bullet"&&ye!=="image"?"ol":"ul"),ye==="bullet"){const vt=function(Kn){const ri=function(Wi){if(Wi.getChild(0).is("$text"))return null;for(const mi of Wi.getChildren()){if(!mi.is("element","span"))continue;const Li=mi.getChild(0);return Li.is("$text")?Li:Li.getChild(0)}}(Kn);if(!ri)return null;const Gn=ri._data;return Gn==="o"?"circle":Gn==="·"?"disc":Gn==="§"?"square":null}(D.element);vt&&(ye=vt)}}return{type:ze,style:b1(ye)}}(a,e);if(i){if(a.indent>o){const D=i.getChild(i.childCount-1),z=D.getChild(D.childCount-1);i=Cw(N,z,t),o+=1}else if(a.indent<o){const D=o-a.indent;i=function(z,U){const J=z.getAncestors({parentFirst:!0});let ce=null,ye=0;for(const ze of J)if(ze.name!=="ul"&&ze.name!=="ol"||ye++,ye===U){ce=ze;break}return ce}(i,D),o=parseInt(a.indent)}}else i=Cw(N,a.element,t);a.indent<=o&&(i.is("element",N.type)||(i=t.rename(N.type,i)))}const S=function(N,D){return function(z,U){const J=new Vi({name:"span",styles:{"mso-list":"Ignore"}}),ce=U.createRangeIn(z);for(const ye of ce)ye.type==="elementStart"&&J.match(ye.item)&&U.remove(ye.item)}(N,D),D.rename("li",N)}(a.element,t);t.appendChild(S,i)})}function b1(r){switch(r){case"arabic-leading-zero":return"decimal-leading-zero";case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return r;default:return null}}function Cw(r,e,t){const n=e.parent,i=t.createElement(r.type),o=n.getChildIndex(e)+1;return t.insertChild(o,i,n),r.style&&t.setStyle("list-style-type",r.style,i),i}function v1(r){const e={},t=r.getStyle("mso-list");if(t){const n=t.match(/(^|\s{1,100})l(\d+)/i),i=t.match(/\s{0,100}lfo(\d+)/i),o=t.match(/\s{0,100}level(\d+)/i);n&&i&&o&&(e.id=n[2],e.order=i[1],e.indent=o[1])}return e}const _1=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class w1{constructor(e){this.document=e}isActive(e){return _1.test(e)}execute(e){const t=new Ys(this.document),{body:n}=e._parsedData;(function(i,o){for(const a of i.getChildren())if(a.is("element","b")&&a.getStyle("font-weight")==="normal"){const c=i.getChildIndex(a);o.remove(a),o.insertChild(c,a.getChildren(),i)}})(n,t),function(i,o){for(const a of o.createRangeIn(i)){const c=a.item;if(c.is("element","li")){const u=c.getChild(0);u&&u.is("element","p")&&o.unwrapElement(u)}}}(n,t),e.content=n}}function k1(r,e){if(!r.childCount)return;const t=new Ys;(function(i,o,a){const c=a.createRangeIn(o),u=new Vi({name:"img"}),h=[];for(const m of c)if(u.match(m.item)){const k=m.item,C=k.getAttribute("v:shapes")?k.getAttribute("v:shapes").split(" "):[];C.length&&C.every(S=>i.indexOf(S)>-1)?h.push(k):k.getAttribute("src")||h.push(k)}for(const m of h)a.remove(m)})(function(i,o){const a=o.createRangeIn(i),c=new Vi({name:/v:(.+)/}),u=[];for(const h of a){const m=h.item,k=m.previousSibling&&m.previousSibling.name||null;c.match(m)&&m.getAttribute("o:gfxdata")&&k!=="v:shapetype"&&u.push(h.item.getAttribute("id"))}return u}(r,t),r,t),function(i,o){const a=o.createRangeIn(i),c=new Vi({name:/v:(.+)/}),u=[];for(const h of a)c.match(h.item)&&u.push(h.item);for(const h of u)o.remove(h)}(r,t);const n=function(i,o){const a=o.createRangeIn(i),c=new Vi({name:"img"}),u=[];for(const h of a)c.match(h.item)&&h.item.getAttribute("src").startsWith("file://")&&u.push(h.item);return u}(r,t);n.length&&function(i,o,a){if(i.length===o.length)for(let u=0;u<i.length;u++){const h=`data:${o[u].type};base64,${c=o[u].hex,btoa(c.match(/\w{2}/g).map(m=>String.fromCharCode(parseInt(m,16))).join(""))}`;a.setAttribute("src",h,i[u])}var c}(n,function(i){if(!i)return[];const o=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,a=new RegExp("(?:("+o.source+"))([\\da-fA-F\\s]+)\\}","g"),c=i.match(a),u=[];if(c)for(const h of c){let m=!1;h.includes("\\pngblip")?m="image/png":h.includes("\\jpegblip")&&(m="image/jpeg"),m&&u.push({hex:h.replace(o,"").replace(/[^\da-fA-F]/g,""),type:m})}return u}(e),t)}const y1=/<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i,x1=/xmlns:o="urn:schemas-microsoft-com/i;class C1{constructor(e){this.document=e}isActive(e){return y1.test(e)||x1.test(e)}execute(e){const{body:t,stylesString:n}=e._parsedData;m1(t,n),k1(t,e.dataTransfer.getData("text/rtf")),e.content=t}}function Tw(r){return r.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(e,t)=>t.length===1?" ":Array(t.length+1).join(" ").substr(0,t.length))}function T1(r,e){const t=new DOMParser,n=function(u){return Tw(Tw(u)).replace(/(<span\s+style=['"]mso-spacerun:yes['"]>[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<span\s+style=['"]mso-spacerun:yes['"]><\/span>/g,"").replace(/ <\//g," </").replace(/ <o:p><\/o:p>/g," <o:p></o:p>").replace(/<o:p>( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)</g,"><")}(function(u){const h=u.indexOf("</body>");if(h<0)return u;const m=u.indexOf("</html>",h+7);return u.substring(0,h+7)+(m>=0?u.substring(m):"")}(r=r.replace(/<!--\[if gte vml 1]>/g,""))),i=t.parseFromString(n,"text/html");(function(u){u.querySelectorAll("span[style*=spacerun]").forEach(h=>{const m=h.innerText.length||0;h.innerHTML=Array(m+1).join(" ").substr(0,m)})})(i);const o=i.body.innerHTML,a=function(u,h){const m=new Xr(h),k=new Sr(m,{blockFillerMode:"nbsp"}),C=u.createDocumentFragment(),S=u.body.childNodes;for(;S.length>0;)C.appendChild(S[0]);return k.domToView(C,{skipComments:!0})}(i,e),c=function(u){const h=[],m=[],k=Array.from(u.getElementsByTagName("style"));for(const C of k)C.sheet&&C.sheet.cssRules&&C.sheet.cssRules.length&&(h.push(C.sheet),m.push(C.innerHTML));return{styles:h,stylesString:m.join(" ")}}(i);return{body:a,bodyString:o,styles:c.styles,stylesString:c.stylesString}}function mn(r,e,t,n,i=1){e>i?n.setAttribute(r,e,t):n.removeAttribute(r,t)}function bl(r,e,t={}){const n=r.createElement("tableCell",t);return r.insertElement("paragraph",n),r.insert(n,e),n}function cv(r,e){const t=e.parent.parent,n=parseInt(t.getAttribute("headingColumns")||0),{column:i}=r.getCellLocation(e);return!!n&&i<n}function A1(){return r=>{r.on("element:table",(e,t,n)=>{const i=t.viewItem;if(!n.consumable.test(i,{name:!0}))return;const{rows:o,headingRows:a,headingColumns:c}=function(m){const k={headingRows:0,headingColumns:0},C=[],S=[];let N;for(const D of Array.from(m.getChildren()))if(D.name==="tbody"||D.name==="thead"||D.name==="tfoot"){D.name!=="thead"||N||(N=D);const z=Array.from(D.getChildren()).filter(U=>U.is("element","tr"));for(const U of z)if(U.parent.name==="thead"&&U.parent===N)k.headingRows++,C.push(U);else{S.push(U);const J=S1(U);J>k.headingColumns&&(k.headingColumns=J)}}return k.rows=[...C,...S],k}(i),u={};c&&(u.headingColumns=c),a&&(u.headingRows=a);const h=n.writer.createElement("table",u);if(n.safeInsert(h,t.modelCursor)){if(n.consumable.consume(i,{name:!0}),o.forEach(m=>n.convertItem(m,n.writer.createPositionAt(h,"end"))),n.convertChildren(i,n.writer.createPositionAt(h,"end")),h.isEmpty){const m=n.writer.createElement("tableRow");n.writer.insert(m,n.writer.createPositionAt(h,"end")),bl(n.writer,n.writer.createPositionAt(m,"end"))}n.updateConversionResult(h,t)}})}}function Aw(r){return e=>{e.on("element:"+r,(t,n,i)=>{if(n.modelRange&&n.viewItem.isEmpty){const o=n.modelRange.start.nodeAfter,a=i.writer.createPositionAt(o,0);i.writer.insertElement("paragraph",a)}},{priority:"low"})}}function S1(r){let e=0,t=0;const n=Array.from(r.getChildren()).filter(i=>i.name==="th"||i.name==="td");for(;t<n.length&&n[t].name==="th";){const i=n[t];e+=parseInt(i.getAttribute("colspan")||1),t++}return e}class Ut{constructor(e,t={}){this._table=e,this._startRow=t.row!==void 0?t.row:t.startRow||0,this._endRow=t.row!==void 0?t.row:t.endRow,this._startColumn=t.column!==void 0?t.column:t.startColumn||0,this._endColumn=t.column!==void 0?t.column:t.endColumn,this._includeAllSlots=!!t.includeAllSlots,this._skipRows=new Set,this._row=0,this._rowIndex=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}[Symbol.iterator](){return this}next(){const e=this._table.getChild(this._rowIndex);if(!e||this._isOverEndRow())return{done:!0};if(!e.is("element","tableRow"))return this._rowIndex++,this.next();if(this._isOverEndColumn())return this._advanceToNextRow();let t=null;const n=this._getSpanned();if(n)this._includeAllSlots&&!this._shouldSkipSlot()&&(t=this._formatOutValue(n.cell,n.row,n.column));else{const i=e.getChild(this._cellIndex);if(!i)return this._advanceToNextRow();const o=parseInt(i.getAttribute("colspan")||1),a=parseInt(i.getAttribute("rowspan")||1);(o>1||a>1)&&this._recordSpans(i,a,o),this._shouldSkipSlot()||(t=this._formatOutValue(i)),this._nextCellAtColumn=this._column+o}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}skipRow(e){this._skipRows.add(e)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return this._endRow!==void 0&&this._row>this._endRow}_isOverEndColumn(){return this._endColumn!==void 0&&this._column>this._endColumn}_formatOutValue(e,t=this._row,n=this._column){return{done:!1,value:new E1(this,e,t,n)}}_shouldSkipSlot(){const e=this._skipRows.has(this._row),t=this._row<this._startRow,n=this._column<this._startColumn,i=this._endColumn!==void 0&&this._column>this._endColumn;return e||t||n||i}_getSpanned(){const e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,n){const i={cell:e,row:this._row,column:this._column};for(let o=this._row;o<this._row+t;o++)for(let a=this._column;a<this._column+n;a++)o==this._row&&a==this._column||this._markSpannedCell(o,a,i)}_markSpannedCell(e,t,n){this._spannedCells.has(e)||this._spannedCells.set(e,new Map),this._spannedCells.get(e).set(t,n)}}class E1{constructor(e,t,n,i){this.cell=t,this.row=e._row,this.column=e._column,this.cellAnchorRow=n,this.cellAnchorColumn=i,this._cellIndex=e._cellIndex,this._rowIndex=e._rowIndex,this._table=e._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||1)}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||1)}get rowIndex(){return this._rowIndex}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}}function Sw(r={}){return e=>e.on("insert:table",(t,n,i)=>{const o=n.item;if(!i.consumable.consume(o,"insert"))return;i.consumable.consume(o,"attribute:headingRows:table"),i.consumable.consume(o,"attribute:headingColumns:table");const a=r&&r.asWidget,c=i.writer.createContainerElement("figure",{class:"table"}),u=i.writer.createContainerElement("table");let h;var m,k;i.writer.insert(i.writer.createPositionAt(c,0),u),a&&(m=c,(k=i.writer).setCustomProperty("table",!0,m),h=Zt(m,k,{hasSelectionHandle:!0}));const C=new Ut(o),S={headingRows:o.getAttribute("headingRows")||0,headingColumns:o.getAttribute("headingColumns")||0},N=new Map;for(const z of C){const{row:U,cell:J}=z,ce=o.getChild(U),ye=N.get(U)||uv(u,ce,U,S,i);N.set(U,ye),i.consumable.consume(J,"insert"),dv(z,S,i.writer.createPositionAt(ye,"end"),i,r)}for(const z of o.getChildren()){const U=z.index;z.is("element","tableRow")&&!N.has(U)&&N.set(U,uv(u,z,U,S,i))}const D=i.mapper.toViewPosition(n.range.start);i.mapper.bindElements(o,a?h:c),i.writer.insert(D,a?h:c)})}function P1(r,e){const{writer:t}=e;if(r.parent.is("element","tableCell"))return Ew(r)?t.createContainerElement("span",{class:"ck-table-bogus-paragraph"}):t.createContainerElement("p")}function Ew(r){return r.parent.childCount===1&&!Ow(r)}function I1(r,e,t){const{cell:n}=r,i=Pw(r,e),o=t.mapper.toViewElement(n);o&&o.name!==i&&function(a,c,u){const h=u.writer,m=u.mapper.toViewElement(a),k=Fu(h.createEditableElement(c,m.getAttributes()),h);Uc(k,h,(C,S,N)=>N.addClass(xt(S.classes),C),(C,S,N)=>N.removeClass(xt(S.classes),C)),h.insert(h.createPositionAfter(m),k),h.move(h.createRangeIn(m),h.createPositionAt(k,0)),h.remove(h.createRangeOn(m)),u.mapper.unbindViewElement(m),u.mapper.bindElements(a,k)}(n,i,t)}function dv(r,e,t,n,i){const o=i&&i.asWidget,a=Pw(r,e),c=o?Fu(n.writer.createEditableElement(a),n.writer):n.writer.createContainerElement(a);o&&Uc(c,n.writer,(k,C,S)=>S.addClass(xt(C.classes),k),(k,C,S)=>S.removeClass(xt(C.classes),k));const u=r.cell,h=u.getChild(0),m=u.childCount===1&&h.name==="paragraph";if(n.writer.insert(t,c),n.mapper.bindElements(u,c),!o&&m&&!Ow(h)){const k=u.getChild(0);n.consumable.consume(k,"insert"),n.mapper.bindElements(k,c)}}function uv(r,e,t,n,i){i.consumable.consume(e,"insert");const o=e.isEmpty?i.writer.createEmptyElement("tr"):i.writer.createContainerElement("tr");i.mapper.bindElements(e,o);const a=n.headingRows,c=function(m,k,C){return Iw(m,k)||function(N,D,z){const U=z.writer.createContainerElement(N),J=z.writer.createPositionAt(D,N=="tbody"?"end":0);return z.writer.insert(J,U),U}(m,k,C)}(function(m,k){return m<k.headingRows?"thead":"tbody"}(t,n),r,i),u=a>0&&t>=a?t-a:t,h=i.writer.createPositionAt(c,u);return i.writer.insert(h,o),o}function Pw(r,e){const{row:t,column:n}=r,{headingColumns:i,headingRows:o}=e;return o&&o>t||i&&i>n?"th":"td"}function Iw(r,e){for(const t of e.getChildren())if(t.name==r)return t}function Mw(r,e,t){const n=Iw(r,e);n&&n.childCount===0&&t.writer.remove(t.writer.createRangeOn(n))}function Ow(r){return!![...r.getAttributeKeys()].length}class M1 extends ct{refresh(){const e=this.editor.model,t=e.document.selection,n=e.schema;this.isEnabled=function(i,o){const a=i.getFirstPosition().parent,c=a===a.root?a:a.parent;return o.checkChild(c,"table")}(t,n)}execute(e={}){const t=this.editor.model,n=t.document.selection,i=this.editor.plugins.get("TableUtils"),o=this.editor.config.get("table"),a=dl(n,t),c=o.defaultHeadings.rows,u=o.defaultHeadings.columns;e.headingRows===void 0&&c&&(e.headingRows=c),e.headingColumns===void 0&&u&&(e.headingColumns=u),t.change(h=>{const m=i.createTable(h,e);t.insertContent(m,a),h.setSelection(h.createPositionAt(m.getNodeByPath([0,0,0]),0))})}}function Zc(r){const e=[];for(const t of Nw(r.getRanges())){const n=t.getContainedElement();n&&n.is("element","tableCell")&&e.push(n)}return e}function ah(r){const e=[];for(const t of r.getRanges()){const n=t.start.findAncestor("tableCell");n&&e.push(n)}return e}function jn(r){const e=Zc(r);return e.length?e:ah(r)}function ia(r){return Rw(r.map(e=>e.parent.index))}function ed(r){const e=r[0].findAncestor("table");return Rw([...new Ut(e)].filter(t=>r.includes(t.cell)).map(t=>t.column))}function hv(r,e){if(r.length<2||!function(o){const a=o[0].findAncestor("table"),c=ia(o),u=parseInt(a.getAttribute("headingRows")||0);if(!Dw(c,u))return!1;const h=parseInt(a.getAttribute("headingColumns")||0);return Dw(ed(o),h)}(r))return!1;const t=new Set,n=new Set;let i=0;for(const o of r){const{row:a,column:c}=e.getCellLocation(o),u=parseInt(o.getAttribute("rowspan")||1),h=parseInt(o.getAttribute("colspan")||1);t.add(a),n.add(c),u>1&&t.add(a+u-1),h>1&&n.add(c+h-1),i+=u*h}return function(o,a){const c=Array.from(o.values()),u=Array.from(a.values()),h=Math.max(...c),m=Math.min(...c),k=Math.max(...u),C=Math.min(...u);return(h-m+1)*(k-C+1)}(t,n)==i}function Nw(r){return Array.from(r).sort(O1)}function Rw(r){const e=r.sort((t,n)=>t-n);return{first:e[0],last:e[e.length-1]}}function O1(r,e){const t=r.start,n=e.start;return t.isBefore(n)?-1:1}function Dw({first:r,last:e},t){return r<t==e<t}class jw extends ct{constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){const e=!!jn(this.editor.model.document.selection).length;this.isEnabled=e}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),i=this.order==="above",o=jn(t),a=ia(o),c=i?a.first:a.last,u=o[0].findAncestor("table");n.insertRows(u,{at:i?c:c+1,copyStructureFromAbove:!i})}}class Lw extends ct{constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){const e=!!jn(this.editor.model.document.selection).length;this.isEnabled=e}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),i=this.order==="left",o=jn(t),a=ed(o),c=i?a.first:a.last,u=o[0].findAncestor("table");n.insertColumns(u,{columns:1,at:i?c:c+1})}}class zw extends ct{constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){const e=jn(this.editor.model.document.selection);this.isEnabled=e.length===1}execute(){const e=jn(this.editor.model.document.selection)[0],t=this.direction==="horizontally",n=this.editor.plugins.get("TableUtils");t?n.splitCellHorizontally(e,2):n.splitCellVertically(e,2)}}function Bw(r,e,t){const{startRow:n,startColumn:i,endRow:o,endColumn:a}=e,c=t.createElement("table"),u=o-n+1;for(let m=0;m<u;m++)t.insertElement("tableRow",c,"end");const h=[...new Ut(r,{startRow:n,endRow:o,startColumn:i,endColumn:a,includeAllSlots:!0})];for(const{row:m,column:k,cell:C,isAnchor:S,cellAnchorRow:N,cellAnchorColumn:D}of h){const z=m-n,U=c.getChild(z);if(S){const J=t.cloneElement(C);t.append(J,U),Uw(J,m,k,o,a,t)}else(N<n||D<i)&&bl(t,t.createPositionAt(U,"end"))}return function(m,k,C,S,N){const D=parseInt(k.getAttribute("headingRows")||0);D>0&&mn("headingRows",D-C,m,N,0);const z=parseInt(k.getAttribute("headingColumns")||0);z>0&&mn("headingColumns",z-S,m,N,0)}(c,r,n,i,t),c}function Fw(r,e,t=0){const n=[],i=new Ut(r,{startRow:t,endRow:e-1});for(const o of i){const{row:a,cellHeight:c}=o,u=a+c-1;a<e&&e<=u&&n.push(o)}return n}function Vw(r,e,t){const n=r.parent,i=n.parent,o=n.index,a=e-o,c={},u=parseInt(r.getAttribute("rowspan"))-a;u>1&&(c.rowspan=u);const h=parseInt(r.getAttribute("colspan")||1);h>1&&(c.colspan=h);const m=o+a,k=[...new Ut(i,{startRow:o,endRow:m,includeAllSlots:!0})];let C,S=null;for(const N of k){const{row:D,column:z,cell:U}=N;U===r&&C===void 0&&(C=z),C!==void 0&&C===z&&D===m&&(S=bl(t,N.getPositionBefore(),c))}return mn("rowspan",a,r,t),S}function $w(r,e){const t=[],n=new Ut(r);for(const i of n){const{column:o,cellWidth:a}=i,c=o+a-1;o<e&&e<=c&&t.push(i)}return t}function Hw(r,e,t,n){const i=t-e,o={},a=parseInt(r.getAttribute("colspan"))-i;a>1&&(o.colspan=a);const c=parseInt(r.getAttribute("rowspan")||1);c>1&&(o.rowspan=c);const u=bl(n,n.createPositionAfter(r),o);return mn("colspan",i,r,n),u}function Uw(r,e,t,n,i,o){const a=parseInt(r.getAttribute("colspan")||1),c=parseInt(r.getAttribute("rowspan")||1);t+a-1>i&&mn("colspan",i-t+1,r,o,1),e+c-1>n&&mn("rowspan",n-e+1,r,o,1)}function fv(r,e){const t=e.getColumns(r),n=new Array(t).fill(0);for(const{column:o}of new Ut(r))n[o]++;const i=n.reduce((o,a,c)=>a?o:[...o,c],[]);if(i.length>0){const o=i[i.length-1];return e.removeColumns(r,{at:o}),!0}return!1}function pv(r,e){const t=[],n=e.getRows(r);for(let i=0;i<n;i++)r.getChild(i).isEmpty&&t.push(i);if(t.length>0){const i=t[t.length-1];return e.removeRows(r,{at:i}),!0}return!1}function gv(r,e){fv(r,e)||pv(r,e)}function Ww(r,e){const t=Array.from(new Ut(r,{startColumn:e.firstColumn,endColumn:e.lastColumn,row:e.lastRow}));if(t.every(({cellHeight:i})=>i===1))return e.lastRow;const n=t[0].cellHeight-1;return e.lastRow+n}function qw(r,e){const t=Array.from(new Ut(r,{startRow:e.firstRow,endRow:e.lastRow,column:e.lastColumn}));if(t.every(({cellWidth:i})=>i===1))return e.lastColumn;const n=t[0].cellWidth-1;return e.lastColumn+n}class eg extends ct{constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal=this.direction=="right"||this.direction=="left"}refresh(){const e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){const e=this.editor.model,t=ah(e.document.selection)[0],n=this.value,i=this.direction;e.change(o=>{const a=i=="right"||i=="down",c=a?t:n,u=a?n:t,h=u.parent;(function(N,D,z){Kw(N)||(Kw(D)&&z.remove(z.createRangeIn(D)),z.move(z.createRangeIn(N),z.createPositionAt(D,"end"))),z.remove(N)})(u,c,o);const m=this.isHorizontal?"colspan":"rowspan",k=parseInt(t.getAttribute(m)||1),C=parseInt(n.getAttribute(m)||1);o.setAttribute(m,k+C,c),o.setSelection(o.createRangeIn(c));const S=this.editor.plugins.get("TableUtils");gv(h.findAncestor("table"),S)})}_getMergeableCell(){const e=ah(this.editor.model.document.selection)[0];if(!e)return;const t=this.editor.plugins.get("TableUtils"),n=this.isHorizontal?function(a,c,u){const h=a.parent.parent,m=c=="right"?a.nextSibling:a.previousSibling,k=(h.getAttribute("headingColumns")||0)>0;if(!m)return;const C=c=="right"?a:m,S=c=="right"?m:a,{column:N}=u.getCellLocation(C),{column:D}=u.getCellLocation(S),z=parseInt(C.getAttribute("colspan")||1),U=cv(u,C),J=cv(u,S);if(!(k&&U!=J))return N+z===D?m:void 0}(e,this.direction,t):function(a,c,u){const h=a.parent,m=h.parent,k=m.getChildIndex(h);if(c=="down"&&k===u.getRows(m)-1||c=="up"&&k===0)return;const C=parseInt(a.getAttribute("rowspan")||1),S=m.getAttribute("headingRows")||0,N=c=="down"&&k+C===S,D=c=="up"&&k===S;if(S&&(N||D))return;const z=parseInt(a.getAttribute("rowspan")||1),U=c=="down"?k+z:k,J=[...new Ut(m,{endRow:U})],ce=J.find(ze=>ze.cell===a).column,ye=J.find(({row:ze,cellHeight:Kt,column:vt})=>vt===ce&&(c=="down"?ze===U:U===ze+Kt));return ye&&ye.cell}(e,this.direction,t);if(!n)return;const i=this.isHorizontal?"rowspan":"colspan",o=parseInt(e.getAttribute(i)||1);return parseInt(n.getAttribute(i)||1)===o?n:void 0}}function Kw(r){return r.childCount==1&&r.getChild(0).is("element","paragraph")&&r.getChild(0).isEmpty}class N1 extends ct{refresh(){const e=jn(this.editor.model.document.selection),t=e[0];if(t){const n=t.findAncestor("table"),i=this.editor.plugins.get("TableUtils").getRows(n)-1,o=ia(e),a=o.first===0&&o.last===i;this.isEnabled=!a}else this.isEnabled=!1}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),n=jn(e.document.selection),i=ia(n),o=n[0],a=o.findAncestor("table"),c=t.getCellLocation(o).column;e.change(u=>{const h=i.last-i.first+1;t.removeRows(a,{at:i.first,rows:h});const m=function(k,C,S,N){const D=k.getChild(Math.min(C,N-1));let z=D.getChild(0),U=0;for(const J of D.getChildren()){if(U>S)return z;z=J,U+=parseInt(J.getAttribute("colspan")||1)}return z}(a,i.first,c,t.getRows(a));u.setSelection(u.createPositionAt(m,0))})}}class R1 extends ct{refresh(){const e=jn(this.editor.model.document.selection),t=e[0];if(t){const n=t.findAncestor("table"),i=this.editor.plugins.get("TableUtils").getColumns(n),{first:o,last:a}=ed(e);this.isEnabled=a-o<i-1}else this.isEnabled=!1}execute(){const[e,t]=function(c){const u=jn(c),h=u[0],m=u.pop(),k=[h,m];return h.isBefore(m)?k:k.reverse()}(this.editor.model.document.selection),n=e.parent.parent,i=[...new Ut(n)],o={first:i.find(c=>c.cell===e).column,last:i.find(c=>c.cell===t).column},a=function(c,u,h,m){return parseInt(h.getAttribute("colspan")||1)>1?h:u.previousSibling||h.nextSibling?h.nextSibling||u.previousSibling:m.first?c.reverse().find(({column:k})=>k<m.first).cell:c.reverse().find(({column:k})=>k>m.last).cell}(i,e,t,o);this.editor.model.change(c=>{const u=o.last-o.first+1;this.editor.plugins.get("TableUtils").removeColumns(n,{at:o.first,columns:u}),c.setSelection(c.createPositionAt(a,0))})}}class D1 extends ct{refresh(){const e=jn(this.editor.model.document.selection),t=e.length>0;this.isEnabled=t,this.value=t&&e.every(n=>this._isInHeading(n,n.parent.parent))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.model,n=jn(t.document.selection),i=n[0].findAncestor("table"),{first:o,last:a}=ia(n),c=this.value?o:a+1,u=i.getAttribute("headingRows")||0;t.change(h=>{if(c){const m=Fw(i,c,c>u?u:0);for(const{cell:k}of m)Vw(k,c,h)}mn("headingRows",c,i,h,0)})}_isInHeading(e,t){const n=parseInt(t.getAttribute("headingRows")||0);return!!n&&e.parent.index<n}}class j1 extends ct{refresh(){const e=jn(this.editor.model.document.selection),t=this.editor.plugins.get("TableUtils"),n=e.length>0;this.isEnabled=n,this.value=n&&e.every(i=>cv(t,i))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.model,n=jn(t.document.selection),i=n[0].findAncestor("table"),{first:o,last:a}=ed(n),c=this.value?o:a+1;t.change(u=>{if(c){const h=$w(i,c);for(const{cell:m,column:k}of h)Hw(m,k,c,u)}mn("headingColumns",c,i,u,0)})}}class td extends me{static get pluginName(){return"TableUtils"}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(e){const t=e.parent,n=t.parent,i=n.getChildIndex(t),o=new Ut(n,{row:i});for(const{cell:a,row:c,column:u}of o)if(a===e)return{row:c,column:u}}createTable(e,t){const n=e.createElement("table"),i=parseInt(t.rows)||2,o=parseInt(t.columns)||2;return mv(e,n,0,i,o),t.headingRows&&mn("headingRows",Math.min(t.headingRows,i),n,e,0),t.headingColumns&&mn("headingColumns",Math.min(t.headingColumns,o),n,e,0),n}insertRows(e,t={}){const n=this.editor.model,i=t.at||0,o=t.rows||1,a=t.copyStructureFromAbove!==void 0,c=t.copyStructureFromAbove?i-1:i,u=this.getRows(e),h=this.getColumns(e);if(i>u)throw new y.a("tableutils-insertrows-insert-out-of-range",this,{options:t});n.change(m=>{const k=e.getAttribute("headingRows")||0;if(k>i&&mn("headingRows",k+o,e,m,0),!a&&(i===0||i===u))return void mv(m,e,i,o,h);const C=a?Math.max(i,c):i,S=new Ut(e,{endRow:C}),N=new Array(h).fill(1);for(const{row:D,column:z,cellHeight:U,cellWidth:J,cell:ce}of S){const ye=D+U-1,ze=D<=c&&c<=ye;D<i&&i<=ye?(m.setAttribute("rowspan",U+o,ce),N[z]=-J):a&&ze&&(N[z]=J)}for(let D=0;D<o;D++){const z=m.createElement("tableRow");m.insert(z,e,i);for(let U=0;U<N.length;U++){const J=N[U],ce=m.createPositionAt(z,"end");J>0&&bl(m,ce,J>1?{colspan:J}:null),U+=Math.abs(J)-1}}})}insertColumns(e,t={}){const n=this.editor.model,i=t.at||0,o=t.columns||1;n.change(a=>{const c=e.getAttribute("headingColumns");i<c&&a.setAttribute("headingColumns",c+o,e);const u=this.getColumns(e);if(i===0||u===i){for(const m of e.getChildren())m.is("element","tableRow")&&nd(o,a,a.createPositionAt(m,i?"end":0));return}const h=new Ut(e,{column:i,includeAllSlots:!0});for(const m of h){const{row:k,cell:C,cellAnchorColumn:S,cellAnchorRow:N,cellWidth:D,cellHeight:z}=m;if(S<i){a.setAttribute("colspan",D+o,C);const U=N+z-1;for(let J=k;J<=U;J++)h.skipRow(J)}else nd(o,a,m.getPositionBefore())}})}removeRows(e,t){const n=this.editor.model,i=t.rows||1,o=this.getRows(e),a=t.at,c=a+i-1;if(c>o-1)throw new y.a("tableutils-removerows-row-index-out-of-range",this,{table:e,options:t});n.change(u=>{const{cellsToMove:h,cellsToTrim:m}=function(k,C,S){const N=new Map,D=[];for(const{row:z,column:U,cellHeight:J,cell:ce}of new Ut(k,{endRow:S})){const ye=z+J-1;if(z>=C&&z<=S&&ye>S){const ze=J-(S-z+1);N.set(U,{cell:ce,rowspan:ze})}if(z<C&&ye>=C){let ze;ze=ye>=S?S-C+1:ye-C+1,D.push({cell:ce,rowspan:J-ze})}}return{cellsToMove:N,cellsToTrim:D}}(e,a,c);h.size&&function(k,C,S,N){const D=[...new Ut(k,{includeAllSlots:!0,row:C})],z=k.getChild(C);let U;for(const{column:J,cell:ce,isAnchor:ye}of D)if(S.has(J)){const{cell:ze,rowspan:Kt}=S.get(J),vt=U?N.createPositionAfter(U):N.createPositionAt(z,0);N.move(N.createRangeOn(ze),vt),mn("rowspan",Kt,ze,N),U=ze}else ye&&(U=ce)}(e,c+1,h,u);for(let k=c;k>=a;k--)u.remove(e.getChild(k));for(const{rowspan:k,cell:C}of m)mn("rowspan",k,C,u);(function(k,C,S,N){const D=k.getAttribute("headingRows")||0;C<D&&mn("headingRows",S<D?D-(S-C+1):C,k,N,0)})(e,a,c,u),fv(e,this)||pv(e,this)})}removeColumns(e,t){const n=this.editor.model,i=t.at,o=t.columns||1,a=t.at+o-1;n.change(c=>{(function(u,h,m){const k=u.getAttribute("headingColumns")||0;if(k&&h.first<k){const C=Math.min(k-1,h.last)-h.first+1;m.setAttribute("headingColumns",k-C,u)}})(e,{first:i,last:a},c);for(let u=a;u>=i;u--)for(const{cell:h,column:m,cellWidth:k}of[...new Ut(e)])m<=u&&k>1&&m+k>u?mn("colspan",k-1,h,c):m===u&&c.remove(h);pv(e,this)||fv(e,this)})}splitCellVertically(e,t=2){const n=this.editor.model,i=e.parent.parent,o=parseInt(e.getAttribute("rowspan")||1),a=parseInt(e.getAttribute("colspan")||1);n.change(c=>{if(a>1){const{newCellsSpan:u,updatedSpan:h}=Gw(a,t);mn("colspan",h,e,c);const m={};u>1&&(m.colspan=u),o>1&&(m.rowspan=o),nd(a>t?t-1:a-1,c,c.createPositionAfter(e),m)}if(a<t){const u=t-a,h=[...new Ut(i)],{column:m}=h.find(({cell:N})=>N===e),k=h.filter(({cell:N,cellWidth:D,column:z})=>N!==e&&z===m||z<m&&z+D>m);for(const{cell:N,cellWidth:D}of k)c.setAttribute("colspan",D+u,N);const C={};o>1&&(C.rowspan=o),nd(u,c,c.createPositionAfter(e),C);const S=i.getAttribute("headingColumns")||0;S>m&&mn("headingColumns",S+u,i,c)}})}splitCellHorizontally(e,t=2){const n=this.editor.model,i=e.parent,o=i.parent,a=o.getChildIndex(i),c=parseInt(e.getAttribute("rowspan")||1),u=parseInt(e.getAttribute("colspan")||1);n.change(h=>{if(c>1){const m=[...new Ut(o,{startRow:a,endRow:a+c-1,includeAllSlots:!0})],{newCellsSpan:k,updatedSpan:C}=Gw(c,t);mn("rowspan",C,e,h);const{column:S}=m.find(({cell:D})=>D===e),N={};k>1&&(N.rowspan=k),u>1&&(N.colspan=u);for(const D of m){const{column:z,row:U}=D,J=z===S,ce=(U+a+C)%k==0;U>=a+C&&J&&ce&&nd(1,h,D.getPositionBefore(),N)}}if(c<t){const m=t-c,k=[...new Ut(o,{startRow:0,endRow:a})];for(const{cell:N,cellHeight:D,row:z}of k)if(N!==e&&z+D>a){const U=D+m;h.setAttribute("rowspan",U,N)}const C={};u>1&&(C.colspan=u),mv(h,o,a+1,m,1,C);const S=o.getAttribute("headingRows")||0;S>a&&mn("headingRows",S+m,o,h)}})}getColumns(e){return[...e.getChild(0).getChildren()].reduce((t,n)=>t+parseInt(n.getAttribute("colspan")||1),0)}getRows(e){return Array.from(e.getChildren()).reduce((t,n)=>n.is("element","tableRow")?t+1:t,0)}}function mv(r,e,t,n,i,o={}){for(let a=0;a<n;a++){const c=r.createElement("tableRow");r.insert(c,e,t),nd(i,r,r.createPositionAt(c,"end"),o)}}function nd(r,e,t,n={}){for(let i=0;i<r;i++)bl(e,t,n)}function Gw(r,e){if(r<e)return{newCellsSpan:1,updatedSpan:1};const t=Math.floor(r/e);return{newCellsSpan:t,updatedSpan:r-t*e+t}}class L1 extends ct{refresh(){const e=Zc(this.editor.model.document.selection);this.isEnabled=hv(e,this.editor.plugins.get(td))}execute(){const e=this.editor.model,t=this.editor.plugins.get(td);e.change(n=>{const i=Zc(e.document.selection),o=i.shift(),{mergeWidth:a,mergeHeight:c}=function(u,h,m){let k=0,C=0;for(const D of h){const{row:z,column:U}=m.getCellLocation(D);k=Yw(D,U,k,"colspan"),C=Yw(D,z,C,"rowspan")}const{row:S,column:N}=m.getCellLocation(u);return{mergeWidth:k-N,mergeHeight:C-S}}(o,i,t);mn("colspan",a,o,n),mn("rowspan",c,o,n);for(const u of i)z1(u,o,n);gv(o.findAncestor("table"),t),n.setSelection(o,"in")})}}function z1(r,e,t){Qw(r)||(Qw(e)&&t.remove(t.createRangeIn(e)),t.move(t.createRangeIn(r),t.createPositionAt(e,"end"))),t.remove(r)}function Qw(r){return r.childCount==1&&r.getChild(0).is("element","paragraph")&&r.getChild(0).isEmpty}function Yw(r,e,t,n){const i=parseInt(r.getAttribute(n)||1);return Math.max(t,e+i)}class B1 extends ct{refresh(){const e=jn(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=jn(e.document.selection),n=ia(t),i=t[0].findAncestor("table"),o=[];for(let a=n.first;a<=n.last;a++)for(const c of i.getChild(a).getChildren())o.push(e.createRangeOn(c));e.change(a=>{a.setSelection(o)})}}class F1 extends ct{refresh(){const e=jn(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=jn(e.document.selection),n=t[0],i=t.pop(),o=n.findAncestor("table"),a=this.editor.plugins.get("TableUtils"),c=a.getCellLocation(n),u=a.getCellLocation(i),h=Math.min(c.column,u.column),m=Math.max(c.column,u.column),k=[];for(const C of new Ut(o,{startColumn:h,endColumn:m}))k.push(e.createRangeOn(C.cell));e.change(C=>{C.setSelection(k)})}}function V1(r){r.document.registerPostFixer(e=>function(t,n){const i=n.document.differ.getChanges();let o=!1;const a=new Set;for(const c of i){let u;c.name=="table"&&c.type=="insert"&&(u=c.position.nodeAfter),c.name!="tableRow"&&c.name!="tableCell"||(u=c.position.findAncestor("table")),U1(c)&&(u=c.range.start.findAncestor("table")),u&&!a.has(u)&&(o=$1(u,t)||o,o=H1(u,t)||o,a.add(u))}return o}(e,r))}function $1(r,e){let t=!1;const n=function(i){const o=parseInt(i.getAttribute("headingRows")||0),a=Array.from(i.getChildren()).reduce((u,h)=>h.is("element","tableRow")?u+1:u,0),c=[];for(const{row:u,cell:h,cellHeight:m}of new Ut(i)){if(m<2)continue;const k=u<o?o:a;if(u+m>k){const C=k-u;c.push({cell:h,rowspan:C})}}return c}(r);if(n.length){t=!0;for(const i of n)mn("rowspan",i.rowspan,i.cell,e,1)}return t}function H1(r,e){let t=!1;const n=function(c){const u=new Array(c.childCount).fill(0);for(const{rowIndex:h}of new Ut(c,{includeAllSlots:!0}))u[h]++;return u}(r),i=[];for(const[c,u]of n.entries())!u&&r.getChild(c).is("element","tableRow")&&i.push(c);if(i.length){t=!0;for(const c of i.reverse())e.remove(r.getChild(c)),n.splice(c,1)}const o=n.filter((c,u)=>r.getChild(u).is("element","tableRow")),a=o[0];if(!o.every(c=>c===a)){const c=o.reduce((u,h)=>h>u?h:u,0);for(const[u,h]of o.entries()){const m=c-h;if(m){for(let k=0;k<m;k++)bl(e,e.createPositionAt(r.getChild(u),"end"));t=!0}}}return t}function U1(r){const e=r.type==="attribute",t=r.attributeKey;return e&&(t==="headingRows"||t==="colspan"||t==="rowspan")}function W1(r){r.document.registerPostFixer(e=>function(t,n){const i=n.document.differ.getChanges();let o=!1;for(const a of i)a.type=="insert"&&a.name=="table"&&(o=q1(a.position.nodeAfter,t)||o),a.type=="insert"&&a.name=="tableRow"&&(o=Xw(a.position.nodeAfter,t)||o),a.type=="insert"&&a.name=="tableCell"&&(o=bv(a.position.nodeAfter,t)||o),K1(a)&&(o=bv(a.position.parent,t)||o);return o}(e,r))}function q1(r,e){let t=!1;for(const n of r.getChildren())n.is("element","tableRow")&&(t=Xw(n,e)||t);return t}function Xw(r,e){let t=!1;for(const n of r.getChildren())t=bv(n,e)||t;return t}function bv(r,e){if(r.childCount==0)return e.insertElement("paragraph",r),!0;const t=Array.from(r.getChildren()).filter(n=>n.is("$text"));for(const n of t)e.wrap(e.createRangeOn(n),"paragraph");return!!t.length}function K1(r){return!(!r.position||!r.position.parent.is("element","tableCell"))&&(r.type=="insert"&&r.name=="$text"||r.type=="remove")}function G1(r,e){r.document.registerPostFixer(()=>function(t,n){const i=new Set;for(const o of t.getChanges()){const a=o.type=="attribute"?o.range.start.parent:o.position.parent;a.is("element","tableCell")&&i.add(a)}for(const o of i.values())for(const a of[...o.getChildren()].filter(c=>Q1(c,n)))t.refreshItem(a);return!1}(r.document.differ,e))}function Q1(r,e){if(!r.is("element","paragraph"))return!1;const t=e.toViewElement(r);return!!t&&Ew(r)!==t.is("element","span")}function Y1(r){r.document.registerPostFixer(()=>function(e){const t=e.document.differ,n=new Set;for(const i of t.getChanges()){if(i.type!="attribute")continue;const o=i.range.start.nodeAfter;o&&o.is("element","table")&&i.attributeKey=="headingRows"&&n.add(o)}if(n.size){for(const i of n.values())t.refreshItem(i);return!0}return!1}(r))}v(100);class X1 extends me{static get pluginName(){return"TableEditing"}init(){const e=this.editor,t=e.model,n=t.schema,i=e.conversion;n.register("table",{allowWhere:"$block",allowAttributes:["headingRows","headingColumns"],isObject:!0,isBlock:!0}),n.register("tableRow",{allowIn:"table",isLimit:!0}),n.register("tableCell",{allowIn:"tableRow",allowChildren:"$block",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),i.for("upcast").add(o=>{o.on("element:figure",(a,c,u)=>{if(!u.consumable.test(c.viewItem,{name:!0,classes:"table"}))return;const h=function(k){for(const C of k.getChildren())if(C.is("element","table"))return C}(c.viewItem);if(!h||!u.consumable.test(h,{name:!0}))return;const m=ui(u.convertItem(h,c.modelCursor).modelRange.getItems());m&&(u.convertChildren(c.viewItem,u.writer.createPositionAt(m,"end")),u.updateConversionResult(m,c))})}),i.for("upcast").add(A1()),i.for("editingDowncast").add(Sw({asWidget:!0})),i.for("dataDowncast").add(Sw()),i.for("upcast").elementToElement({model:"tableRow",view:"tr"}),i.for("upcast").add(o=>{o.on("element:tr",(a,c)=>{c.viewItem.isEmpty&&c.modelCursor.index==0&&a.stop()},{priority:"high"})}),i.for("editingDowncast").add(o=>o.on("insert:tableRow",(a,c,u)=>{const h=c.item;if(!u.consumable.consume(h,"insert"))return;const m=h.parent,k=function(z){for(const U of z.getChildren())if(U.name==="table")return U}(u.mapper.toViewElement(m)),C=m.getChildIndex(h),S=new Ut(m,{row:C}),N={headingRows:m.getAttribute("headingRows")||0,headingColumns:m.getAttribute("headingColumns")||0},D=new Map;for(const z of S){const U=D.get(C)||uv(k,h,C,N,u);D.set(C,U),u.consumable.consume(z.cell,"insert"),dv(z,N,u.writer.createPositionAt(U,"end"),u,{asWidget:!0})}})),i.for("editingDowncast").add(o=>o.on("remove:tableRow",(a,c,u)=>{a.stop();const h=u.writer,m=u.mapper,k=m.toViewPosition(c.position).getLastMatchingPosition(D=>!D.item.is("element","tr")).nodeAfter,C=k.parent.parent,S=h.createRangeOn(k),N=h.remove(S);for(const D of h.createRangeIn(N).getItems())m.unbindViewElement(D);Mw("thead",C,u),Mw("tbody",C,u)},{priority:"higher"})),i.for("upcast").elementToElement({model:"tableCell",view:"td"}),i.for("upcast").elementToElement({model:"tableCell",view:"th"}),i.for("upcast").add(Aw("td")),i.for("upcast").add(Aw("th")),i.for("editingDowncast").add(o=>o.on("insert:tableCell",(a,c,u)=>{const h=c.item;if(!u.consumable.consume(h,"insert"))return;const m=h.parent,k=m.parent,C=k.getChildIndex(m),S=new Ut(k,{row:C}),N={headingRows:k.getAttribute("headingRows")||0,headingColumns:k.getAttribute("headingColumns")||0};for(const D of S)if(D.cell===h){const z=u.mapper.toViewElement(m);return void dv(D,N,u.writer.createPositionAt(z,m.getChildIndex(h)),u,{asWidget:!0})}})),i.for("editingDowncast").elementToElement({model:"paragraph",view:P1,converterPriority:"high"}),i.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),i.for("upcast").attributeToAttribute({model:{key:"colspan",value:Jw("colspan")},view:"colspan"}),i.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),i.for("upcast").attributeToAttribute({model:{key:"rowspan",value:Jw("rowspan")},view:"rowspan"}),i.for("editingDowncast").add(o=>o.on("attribute:headingColumns:table",(a,c,u)=>{const h=c.item;if(!u.consumable.consume(c.item,a.name))return;const m={headingRows:h.getAttribute("headingRows")||0,headingColumns:h.getAttribute("headingColumns")||0},k=c.attributeOldValue,C=c.attributeNewValue,S=(k>C?k:C)-1;for(const N of new Ut(h,{endColumn:S}))I1(N,m,u)})),e.data.mapper.on("modelToViewPosition",(o,a)=>{const c=a.modelPosition.parent,u=a.modelPosition.nodeBefore;if(!c.is("element","tableCell")||!u||!u.is("element","paragraph"))return;const h=a.mapper.toViewElement(u),m=a.mapper.toViewElement(c);h===m&&(a.viewPosition=a.mapper.findPositionIn(m,u.maxOffset))}),e.config.define("table.defaultHeadings.rows",0),e.config.define("table.defaultHeadings.columns",0),e.commands.add("insertTable",new M1(e)),e.commands.add("insertTableRowAbove",new jw(e,{order:"above"})),e.commands.add("insertTableRowBelow",new jw(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new Lw(e,{order:"left"})),e.commands.add("insertTableColumnRight",new Lw(e,{order:"right"})),e.commands.add("removeTableRow",new N1(e)),e.commands.add("removeTableColumn",new R1(e)),e.commands.add("splitTableCellVertically",new zw(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new zw(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new L1(e)),e.commands.add("mergeTableCellRight",new eg(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new eg(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new eg(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new eg(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new j1(e)),e.commands.add("setTableRowHeader",new D1(e)),e.commands.add("selectTableRow",new B1(e)),e.commands.add("selectTableColumn",new F1(e)),Y1(t),V1(t),G1(t,e.editing.mapper),W1(t)}static get requires(){return[td]}}function Jw(r){return e=>{const t=parseInt(e.getAttribute(r));return Number.isNaN(t)||t<=0?null:t}}v(102);class J1 extends ut{constructor(e){super(e);const t=this.bindTemplate;this.items=this._createGridCollection(),this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",(n,i)=>`${i} × ${n}`),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":t.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck-insert-table-dropdown__label"]},children:[{text:t.to("label")}]}],on:{mousedown:t.to(n=>{n.preventDefault()}),click:t.to(()=>{this.fire("execute")})}}),this.on("boxover",(n,i)=>{const{row:o,column:a}=i.target.dataset;this.set({rows:parseInt(o),columns:parseInt(a)})}),this.on("change:columns",()=>{this._highlightGridBoxes()}),this.on("change:rows",()=>{this._highlightGridBoxes()})}focus(){}focusLast(){}_highlightGridBoxes(){const e=this.rows,t=this.columns;this.items.map((n,i)=>{const o=Math.floor(i/10)<e&&i%10<t;n.set("isOn",o)})}_createGridCollection(){const e=[];for(let t=0;t<100;t++){const n=Math.floor(t/10),i=t%10;e.push(new Z1(this.locale,n+1,i+1))}return this.createCollection(e)}}class Z1 extends ut{constructor(e,t,n){super(e);const i=this.bindTemplate;this.set("isOn",!1),this.setTemplate({tag:"div",attributes:{class:["ck-insert-table-dropdown-grid-box",i.if("isOn","ck-on")],"data-row":t,"data-column":n}})}}class ex extends me{static get pluginName(){return"TableUI"}init(){const e=this.editor,t=this.editor.t,n=e.locale.contentLanguageDirection==="ltr";e.ui.componentFactory.add("insertTable",i=>{const o=e.commands.get("insertTable"),a=cs(i);let c;return a.bind("isEnabled").to(o),a.buttonView.set({icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 6v3h4V6H3zm0 4v3h4v-3H3zm0 4v3h4v-3H3zm5 3h4v-3H8v3zm5 0h4v-3h-4v3zm4-4v-3h-4v3h4zm0-4V6h-4v3h4zm1.5 8a1.5 1.5 0 0 1-1.5 1.5H3A1.5 1.5 0 0 1 1.5 17V4c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5v13zM12 13v-3H8v3h4zm0-4V6H8v3h4z"/></svg>',label:t("Insert table"),tooltip:!0}),a.on("change:isOpen",()=>{c||(c=new J1(i),a.panelView.children.add(c),c.delegate("execute").to(a),a.buttonView.on("open",()=>{c.rows=0,c.columns=0}),a.on("execute",()=>{e.execute("insertTable",{rows:c.rows,columns:c.columns}),e.editing.view.focus()}))}),a}),e.ui.componentFactory.add("tableColumn",i=>{const o=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:t("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:n?"insertTableColumnLeft":"insertTableColumnRight",label:t("Insert column left")}},{type:"button",model:{commandName:n?"insertTableColumnRight":"insertTableColumnLeft",label:t("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:t("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:t("Select column")}}];return this._prepareDropdown(t("Column"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M18 7v1H2V7h16zm0 5v1H2v-1h16z" opacity=".6"/><path d="M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z"/></svg>',o,i)}),e.ui.componentFactory.add("tableRow",i=>{const o=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:t("Header row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:t("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:t("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:t("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:t("Select row")}}];return this._prepareDropdown(t("Row"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v16h-1V2z" opacity=".6"/><path d="M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z"/></svg>',o,i)}),e.ui.componentFactory.add("mergeTableCells",i=>{const o=[{type:"button",model:{commandName:"mergeTableCellUp",label:t("Merge cell up")}},{type:"button",model:{commandName:n?"mergeTableCellRight":"mergeTableCellLeft",label:t("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:t("Merge cell down")}},{type:"button",model:{commandName:n?"mergeTableCellLeft":"mergeTableCellRight",label:t("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:t("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:t("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(t("Merge cells"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z" opacity=".6"/><path d="M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z"/></svg>',o,i)})}_prepareDropdown(e,t,n,i){const o=this.editor,a=cs(i),c=this._fillDropdownWithListOptions(a,n);return a.buttonView.set({label:e,icon:t,tooltip:!0}),a.bind("isEnabled").toMany(c,"isEnabled",(...u)=>u.some(h=>h)),this.listenTo(a,"execute",u=>{o.execute(u.source.commandName),o.editing.view.focus()}),a}_prepareMergeSplitButtonDropdown(e,t,n,i){const o=this.editor,a=cs(i,$f),c=o.commands.get("mergeTableCells"),u=this._fillDropdownWithListOptions(a,n);return a.buttonView.set({label:e,icon:t,tooltip:!0,isEnabled:!0}),a.bind("isEnabled").toMany([c,...u],"isEnabled",(...h)=>h.some(m=>m)),this.listenTo(a.buttonView,"execute",()=>{o.execute("mergeTableCells"),o.editing.view.focus()}),this.listenTo(a,"execute",h=>{o.execute(h.source.commandName),o.editing.view.focus()}),a}_fillDropdownWithListOptions(e,t){const n=this.editor,i=[],o=new li;for(const a of t)tx(a,n,i,o);return Xf(e,o,n.ui.componentFactory),i}}function tx(r,e,t,n){const i=r.model=new Lu(r.model),{commandName:o,bindIsOn:a}=r.model;if(r.type==="button"||r.type==="switchbutton"){const c=e.commands.get(o);t.push(c),i.set({commandName:o}),i.bind("isEnabled").to(c),a&&i.bind("isOn").to(c,"value")}i.set({withText:!0}),n.add(r)}v(104);class vl extends me{static get pluginName(){return"TableSelection"}static get requires(){return[td]}init(){const e=this.editor.model;this.listenTo(e,"deleteContent",(t,n)=>this._handleDeleteContent(t,n),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){const e=Zc(this.editor.model.document.selection);return e.length==0?null:e}getSelectionAsFragment(){const e=this.getSelectedTableCells();return e?this.editor.model.change(t=>{const n=t.createDocumentFragment(),i=this.editor.plugins.get("TableUtils"),{first:o,last:a}=ed(e),{first:c,last:u}=ia(e),h=e[0].findAncestor("table");let m=u,k=a;if(hv(e,i)){const S={firstColumn:o,lastColumn:a,firstRow:c,lastRow:u};m=Ww(h,S),k=qw(h,S)}const C=Bw(h,{startRow:c,startColumn:o,endRow:m,endColumn:k},t);return t.insert(C,n,0),n}):null}setCellSelection(e,t){const n=this._getCellsToSelect(e,t);this.editor.model.change(i=>{i.setSelection(n.cells.map(o=>i.createRangeOn(o)),{backward:n.backward})})}getFocusCell(){const e=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return e&&e.is("element","tableCell")?e:null}getAnchorCell(){const e=ui(this.editor.model.document.selection.getRanges()).getContainedElement();return e&&e.is("element","tableCell")?e:null}_defineSelectionConverter(){const e=this.editor,t=new Set;e.conversion.for("editingDowncast").add(n=>n.on("selection",(i,o,a)=>{const c=a.writer;(function(m){for(const k of t)m.removeClass("ck-editor__editable_selected",k);t.clear()})(c);const u=this.getSelectedTableCells();if(!u)return;for(const m of u){const k=a.mapper.toViewElement(m);c.addClass("ck-editor__editable_selected",k),t.add(k)}const h=a.mapper.toViewElement(u[u.length-1]);c.setSelection(h,0)},{priority:"lowest"}))}_enablePluginDisabling(){const e=this.editor;this.on("change:isEnabled",()=>{if(!this.isEnabled){const t=this.getSelectedTableCells();if(!t)return;e.model.change(n=>{const i=n.createPositionAt(t[0],0),o=e.model.schema.getNearestSelectionRange(i);n.setSelection(o)})}})}_handleDeleteContent(e,t){const[n,i]=t,o=this.editor.model,a=!i||i.direction=="backward",c=Zc(n);c.length&&(e.stop(),o.change(u=>{const h=c[a?c.length-1:0];o.change(k=>{for(const C of c)o.deleteContent(k.createSelection(C,"in"))});const m=o.schema.getNearestSelectionRange(u.createPositionAt(h,0));n.is("documentSelection")?u.setSelection(m):n.setTo(m)}))}_getCellsToSelect(e,t){const n=this.editor.plugins.get("TableUtils"),i=n.getCellLocation(e),o=n.getCellLocation(t),a=Math.min(i.row,o.row),c=Math.max(i.row,o.row),u=Math.min(i.column,o.column),h=Math.max(i.column,o.column),m=new Array(c-a+1).fill(null).map(()=>[]),k={startRow:a,endRow:c,startColumn:u,endColumn:h};for(const{row:N,cell:D}of new Ut(e.findAncestor("table"),k))m[N-a].push(D);const C=o.row<i.row,S=o.column<i.column;return C&&m.reverse(),S&&m.forEach(N=>N.reverse()),{cells:m.flat(),backward:C||S}}}class nx extends me{static get pluginName(){return"TableClipboard"}static get requires(){return[vl,td]}init(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"copy",(n,i)=>this._onCopyCut(n,i)),this.listenTo(t,"cut",(n,i)=>this._onCopyCut(n,i)),this.listenTo(e.model,"insertContent",(n,i)=>this._onInsertContent(n,...i),{priority:"high"}),this.decorate("_replaceTableSlotCell")}_onCopyCut(e,t){const n=this.editor.plugins.get(vl);if(!n.getSelectedTableCells()||e.name=="cut"&&this.editor.isReadOnly)return;t.preventDefault(),e.stop();const i=this.editor.data,o=this.editor.editing.view.document,a=i.toView(n.getSelectionAsFragment());o.fire("clipboardOutput",{dataTransfer:t.dataTransfer,content:a,method:e.name})}_onInsertContent(e,t,n){if(n&&!n.is("documentSelection"))return;const i=this.editor.model,o=this.editor.plugins.get(td);let a=function(u,h){if(!u.is("documentFragment")&&!u.is("element"))return null;if(u.is("element","table"))return u;if(u.childCount==1&&u.getChild(0).is("element","table"))return u.getChild(0);const m=h.createRangeIn(u);for(const k of m.getItems())if(k.is("element","table")){const C=h.createRange(m.start,h.createPositionBefore(k));if(h.hasContent(C,{ignoreWhitespaces:!0}))return null;const S=h.createRange(h.createPositionAfter(k),m.end);return h.hasContent(S,{ignoreWhitespaces:!0})?null:k}return null}(t,i);if(!a)return;const c=jn(i.document.selection);c.length?(e.stop(),i.change(u=>{const h={width:o.getColumns(a),height:o.getRows(a)},m=function(z,U,J,ce){const ye=z[0].findAncestor("table"),ze=ed(z),Kt=ia(z),vt={firstColumn:ze.first,lastColumn:ze.last,firstRow:Kt.first,lastRow:Kt.last},Kn=z.length===1;return Kn&&(vt.lastRow+=U.height-1,vt.lastColumn+=U.width-1,function(ri,Gn,Wi,mi){const Li=mi.getColumns(ri),ps=mi.getRows(ri);Wi>Li&&mi.insertColumns(ri,{at:Li,columns:Wi-Li}),Gn>ps&&mi.insertRows(ri,{at:ps,rows:Gn-ps})}(ye,vt.lastRow+1,vt.lastColumn+1,ce)),Kn||!hv(z,ce)?function(ri,Gn,Wi){const{firstRow:mi,lastRow:Li,firstColumn:ps,lastColumn:lh}=Gn,ch={first:mi,last:Li},ik={first:ps,last:lh};_v(ri,ps,ch,Wi),_v(ri,lh+1,ch,Wi),vv(ri,mi,ik,Wi),vv(ri,Li+1,ik,Wi,mi)}(ye,vt,J):(vt.lastRow=Ww(ye,vt),vt.lastColumn=qw(ye,vt)),vt}(c,h,u,o),k=m.lastRow-m.firstRow+1,C=m.lastColumn-m.firstColumn+1,S={startRow:0,startColumn:0,endRow:Math.min(k,h.height)-1,endColumn:Math.min(C,h.width)-1};a=Bw(a,S,u);const N=c[0].findAncestor("table"),D=this._replaceSelectedCellsWithPasted(a,h,N,m,u);if(this.editor.plugins.get("TableSelection").isEnabled){const z=Nw(D.map(U=>u.createRangeOn(U)));u.setSelection(z)}else u.setSelection(D[0],0)})):gv(a,o)}_replaceSelectedCellsWithPasted(e,t,n,i,o){const{width:a,height:c}=t,u=function(z,U,J){const ce=new Array(J).fill(null).map(()=>new Array(U).fill(null));for(const{column:ye,row:ze,cell:Kt}of new Ut(z))ce[ze][ye]=Kt;return ce}(e,a,c),h=[...new Ut(n,{startRow:i.firstRow,endRow:i.lastRow,startColumn:i.firstColumn,endColumn:i.lastColumn,includeAllSlots:!0})],m=[];let k;for(const z of h){const{row:U,column:J}=z;J===i.firstColumn&&(k=z.getPositionBefore());const ce=U-i.firstRow,ye=J-i.firstColumn,ze=u[ce%c][ye%a],Kt=ze?o.cloneElement(ze):null,vt=this._replaceTableSlotCell(z,Kt,k,o);vt&&(Uw(vt,U,J,i.lastRow,i.lastColumn,o),m.push(vt),k=o.createPositionAfter(vt))}const C=parseInt(n.getAttribute("headingRows")||0),S=parseInt(n.getAttribute("headingColumns")||0),N=i.firstRow<C&&C<=i.lastRow,D=i.firstColumn<S&&S<=i.lastColumn;if(N){const z=vv(n,C,{first:i.firstColumn,last:i.lastColumn},o,i.firstRow);m.push(...z)}if(D){const z=_v(n,S,{first:i.firstRow,last:i.lastRow},o);m.push(...z)}return m}_replaceTableSlotCell(e,t,n,i){const{cell:o,isAnchor:a}=e;return a&&i.remove(o),t?(i.insert(t,n),t):null}}function vv(r,e,t,n,i=0){if(!(e<1))return Fw(r,e,i).filter(({column:o,cellWidth:a})=>Zw(o,a,t)).map(({cell:o})=>Vw(o,e,n))}function _v(r,e,t,n){if(!(e<1))return $w(r,e).filter(({row:i,cellHeight:o})=>Zw(i,o,t)).map(({cell:i,column:o})=>Hw(i,o,e,n))}function Zw(r,e,t){const n=r+e-1,{first:i,last:o}=t;return r>=i&&r<=o||r<i&&n>=i}class ix extends me{static get pluginName(){return"TableKeyboard"}static get requires(){return[vl]}init(){const e=this.editor.editing.view.document;this.editor.keystrokes.set("Tab",(...t)=>this._handleTabOnSelectedTable(...t),{priority:"low"}),this.editor.keystrokes.set("Tab",this._getTabHandler(!0),{priority:"low"}),this.editor.keystrokes.set("Shift+Tab",this._getTabHandler(!1),{priority:"low"}),this.listenTo(e,"arrowKey",(...t)=>this._onArrowKey(...t),{context:"table"})}_handleTabOnSelectedTable(e,t){const n=this.editor,i=n.model.document.selection.getSelectedElement();i&&i.is("element","table")&&(t(),n.model.change(o=>{o.setSelection(o.createRangeIn(i.getChild(0).getChild(0)))}))}_getTabHandler(e){const t=this.editor;return(n,i)=>{let o=ah(t.model.document.selection)[0];if(o||(o=this.editor.plugins.get("TableSelection").getFocusCell()),!o)return;i();const a=o.parent,c=a.parent,u=c.getChildIndex(a),h=a.getChildIndex(o),m=h===0;if(!e&&m&&u===0)return void t.model.change(D=>{D.setSelection(D.createRangeOn(c))});const k=this.editor.plugins.get("TableUtils"),C=h===a.childCount-1,S=u===k.getRows(c)-1;if(e&&S&&C&&(t.execute("insertTableRowBelow"),u===k.getRows(c)-1))return void t.model.change(D=>{D.setSelection(D.createRangeOn(c))});let N;if(e&&C)N=c.getChild(u+1).getChild(0);else if(!e&&m){const D=c.getChild(u-1);N=D.getChild(D.childCount-1)}else N=a.getChild(h+(e?1:-1));t.model.change(D=>{D.setSelection(D.createRangeIn(N))})}}_onArrowKey(e,t){const n=this.editor,i=Ai(t.keyCode,n.locale.contentLanguageDirection);this._handleArrowKeys(i,t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),e.stop())}_handleArrowKeys(e,t){const n=this.editor.model.document.selection,i=["right","down"].includes(e),o=Zc(n);if(o.length){let c;return c=t?this.editor.plugins.get("TableSelection").getFocusCell():i?o[o.length-1]:o[0],this._navigateFromCellInDirection(c,e,t),!0}const a=n.focus.findAncestor("tableCell");return!!a&&!(t&&!n.isCollapsed&&n.isBackward==i)&&!!this._isSelectionAtCellEdge(n,a,i)&&(this._navigateFromCellInDirection(a,e,t),!0)}_isSelectionAtCellEdge(e,t,n){const i=this.editor.model,o=this.editor.model.schema,a=n?e.getLastPosition():e.getFirstPosition();if(!o.getLimitElement(a).is("element","tableCell"))return i.createPositionAt(t,n?"end":0).isTouching(a);const c=i.createSelection(a);return i.modifySelection(c,{direction:n?"forward":"backward"}),a.isEqual(c.focus)}_navigateFromCellInDirection(e,t,n=!1){const i=this.editor.model,o=e.findAncestor("table"),a=[...new Ut(o,{includeAllSlots:!0})],{row:c,column:u}=a[a.length-1],h=a.find(({cell:D})=>D==e);let{row:m,column:k}=h;switch(t){case"left":k--;break;case"up":m--;break;case"right":k+=h.cellWidth;break;case"down":m+=h.cellHeight}if(m<0||m>c||k<0&&m<=0||k>u&&m>=c)return void i.change(D=>{D.setSelection(D.createRangeOn(o))});k<0?(k=n?0:u,m--):k>u&&(k=n?u:0,m++);const C=a.find(D=>D.row==m&&D.column==k).cell,S=["right","down"].includes(t),N=this.editor.plugins.get("TableSelection");if(n&&N.isEnabled){const D=N.getAnchorCell()||e;N.setCellSelection(D,C)}else{const D=i.createPositionAt(C,S?0:"end");i.change(z=>{z.setSelection(D)})}}}class rx extends to{constructor(e){super(e),this.domEventType=["mousemove","mouseleave"]}onDomEvent(e){this.fire(e.type,e)}}class ox extends me{static get pluginName(){return"TableMouse"}static get requires(){return[vl]}init(){this.editor.editing.view.addObserver(rx),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const e=this.editor;let t=!1;const n=e.plugins.get(vl);this.listenTo(e.editing.view.document,"mousedown",(i,o)=>{if(!this.isEnabled||!n.isEnabled||!o.domEvent.shiftKey)return;const a=n.getAnchorCell()||ah(e.model.document.selection)[0];if(!a)return;const c=this._getModelTableCellFromDomEvent(o);c&&ek(a,c)&&(t=!0,n.setCellSelection(a,c),o.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{t=!1}),this.listenTo(e.editing.view.document,"selectionChange",i=>{t&&i.stop()},{priority:"highest"})}_enableMouseDragSelection(){const e=this.editor;let t,n,i=!1,o=!1;const a=e.plugins.get(vl);this.listenTo(e.editing.view.document,"mousedown",(c,u)=>{this.isEnabled&&a.isEnabled&&(u.domEvent.shiftKey||u.domEvent.ctrlKey||u.domEvent.altKey||(t=this._getModelTableCellFromDomEvent(u)))}),this.listenTo(e.editing.view.document,"mousemove",(c,u)=>{if(!u.domEvent.buttons||!t)return;const h=this._getModelTableCellFromDomEvent(u);h&&ek(t,h)&&(n=h,i||n==t||(i=!0)),i&&(o=!0,a.setCellSelection(t,n),u.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{i=!1,o=!1,t=null,n=null}),this.listenTo(e.editing.view.document,"selectionChange",c=>{o&&c.stop()},{priority:"highest"})}_getModelTableCellFromDomEvent(e){const t=e.target,n=this.editor.editing.view.createPositionAt(t,0);return this.editor.editing.mapper.toModelPosition(n).parent.findAncestor("tableCell",{includeSelf:!0})}}function ek(r,e){return r.parent.parent==e.parent.parent}v(106);function sx(r){const e=r.getSelectedElement();return e&&tk(e)?e:null}function ax(r){let e=r.getFirstPosition().parent;for(;e;){if(e.is("element")&&tk(e))return e;e=e.parent}return null}function tk(r){return!!r.getCustomProperty("table")&&Ze(r)}const wv={autoRefresh:!0};class tg{constructor(e,t=wv){if(!e)throw new y.a("token-missing-token-url",this);t.initValue&&this._validateTokenValue(t.initValue),this.set("value",t.initValue),this._refresh=typeof e=="function"?e:()=>{return n=e,new Promise((i,o)=>{const a=new XMLHttpRequest;a.open("GET",n),a.addEventListener("load",()=>{const c=a.status,u=a.response;return c<200||c>299?o(new y.a("token-cannot-download-new-token",null)):i(u)}),a.addEventListener("error",()=>o(new Error("Network Error"))),a.addEventListener("abort",()=>o(new Error("Abort"))),a.send()});var n},this._options=Object.assign({},wv,t)}init(){return new Promise((e,t)=>{this.value?(this._options.autoRefresh&&this._registerRefreshTokenTimeout(),e(this)):this.refreshToken().then(e).catch(t)})}refreshToken(){return this._refresh().then(e=>{this._validateTokenValue(e),this.set("value",e),this._options.autoRefresh&&this._registerRefreshTokenTimeout()}).then(()=>this)}destroy(){clearTimeout(this._tokenRefreshTimeout)}_validateTokenValue(e){const t=typeof e=="string",n=!/^".*"$/.test(e),i=t&&e.split(".").length===3;if(!n||!i)throw new y.a("token-not-in-jwt-format",this)}_registerRefreshTokenTimeout(){const e=this._getTokenRefreshTimeoutTime();clearTimeout(this._tokenRefreshTimeout),this._tokenRefreshTimeout=setTimeout(()=>{this.refreshToken()},e)}_getTokenRefreshTimeoutTime(){try{const[,e]=this.value.split("."),{exp:t}=JSON.parse(atob(e));return t?Math.floor((1e3*t-Date.now())/2):36e5}catch{return 36e5}}static create(e,t=wv){return new tg(e,t).init()}}Le(tg,Wt);var lx=tg;const kv=/^data:(\S*?);base64,/;class nk{constructor(e,t,n){if(!e)throw new y.a("fileuploader-missing-file",null);if(!t)throw new y.a("fileuploader-missing-token",null);if(!n)throw new y.a("fileuploader-missing-api-address",null);this.file=function(i){if(typeof i!="string")return!1;const o=i.match(kv);return!(!o||!o.length)}(e)?function(i,o=512){try{const a=i.match(kv)[1],c=atob(i.replace(kv,"")),u=[];for(let h=0;h<c.length;h+=o){const m=c.slice(h,h+o),k=new Array(m.length);for(let C=0;C<m.length;C++)k[C]=m.charCodeAt(C);u.push(new Uint8Array(k))}return new Blob(u,{type:a})}catch{throw new y.a("fileuploader-decoding-image-data-error",null)}}(e):e,this._token=t,this._apiAddress=n}onProgress(e){return this.on("progress",(t,n)=>e(n)),this}onError(e){return this.once("error",(t,n)=>e(n)),this}abort(){this.xhr.abort()}send(){return this._prepareRequest(),this._attachXHRListeners(),this._sendRequest()}_prepareRequest(){const e=new XMLHttpRequest;e.open("POST",this._apiAddress),e.setRequestHeader("Authorization",this._token.value),e.responseType="json",this.xhr=e}_attachXHRListeners(){const e=this,t=this.xhr;function n(i){return()=>e.fire("error",i)}t.addEventListener("error",n("Network Error")),t.addEventListener("abort",n("Abort")),t.upload&&t.upload.addEventListener("progress",i=>{i.lengthComputable&&this.fire("progress",{total:i.total,uploaded:i.loaded})}),t.addEventListener("load",()=>{const i=t.status,o=t.response;if(i<200||i>299)return this.fire("error",o.message||o.error)})}_sendRequest(){const e=new FormData,t=this.xhr;return e.append("file",this.file),new Promise((n,i)=>{t.addEventListener("load",()=>{const o=t.status,a=t.response;return o<200||o>299?a.message?i(new y.a("fileuploader-uploading-data-failed",this,{message:a.message})):i(a.error):n(a)}),t.addEventListener("error",()=>i(new Error("Network Error"))),t.addEventListener("abort",()=>i(new Error("Abort"))),t.send(e)})}}Le(nk,V);class cx{constructor(e,t){if(!e)throw new y.a("uploadgateway-missing-token",null);if(!t)throw new y.a("uploadgateway-missing-api-address",null);this._token=e,this._apiAddress=t}upload(e){return new nk(e,this._token,this._apiAddress)}}class dx extends vr{static get pluginName(){return"CloudServicesCore"}createToken(e,t){return new lx(e,t)}createUploadGateway(e,t){return new cx(e,t)}}class yv extends Bu{}yv.builtinPlugins=[class extends me{static get requires(){return[Tt,Hc,lb,ib,hb,Np]}static get pluginName(){return"Essentials"}},class extends me{static get requires(){return[ar]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const r=this.editor.config.get("ckfinder.uploadUrl");r&&(this.editor.plugins.get(ar).createUploadAdapter=e=>new Ab(e,r,this.editor.t))}},class extends me{static get pluginName(){return"Autoformat"}afterInit(){this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats()}_addListAutoformats(){const r=this.editor.commands;r.get("bulletedList")&&zo(this.editor,this,/^[*-]\s$/,"bulletedList"),r.get("numberedList")&&zo(this.editor,this,/^1[.|)]\s$/,"numberedList"),r.get("todoList")&&zo(this.editor,this,/^\[\s?\]\s$/,"todoList"),r.get("checkTodoList")&&zo(this.editor,this,/^\[\s?x\s?\]\s$/,()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")})}_addBasicStylesAutoformats(){const r=this.editor.commands;if(r.get("bold")){const e=Gc(this.editor,"bold");ta(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,e),ta(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,e)}if(r.get("italic")){const e=Gc(this.editor,"italic");ta(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,e),ta(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,e)}if(r.get("code")){const e=Gc(this.editor,"code");ta(this.editor,this,/(`)([^`]+)(`)$/g,e)}if(r.get("strikethrough")){const e=Gc(this.editor,"strikethrough");ta(this.editor,this,/(~~)([^~]+)(~~)$/g,e)}}_addHeadingAutoformats(){const r=this.editor.commands.get("heading");r&&r.modelElements.filter(e=>e.match(/^heading[1-6]$/)).forEach(e=>{const t=e[7],n=new RegExp(`^(#{${t}})\\s$`);zo(this.editor,this,n,()=>{if(!r.isEnabled||r.value===e)return!1;this.editor.execute("heading",{value:e})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&zo(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){const r=this.editor,e=r.model.document.selection;r.commands.get("codeBlock")&&zo(r,this,/^```$/,()=>{if(e.getFirstPosition().parent.is("element","listItem"))return!1;this.editor.execute("codeBlock",{usePreviousLanguageChoice:!0})})}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&zo(this.editor,this,/^---$/,"horizontalLine")}},class extends me{static get requires(){return[Sb,Eb]}static get pluginName(){return"Bold"}},class extends me{static get requires(){return[Pb,Ib]}static get pluginName(){return"Italic"}},class extends me{static get requires(){return[Ob,Nb]}static get pluginName(){return"BlockQuote"}},class extends me{static get pluginName(){return"CKFinder"}static get requires(){return["Link","CKFinderUploadAdapter",jb,Rb]}},class extends vr{static get pluginName(){return"CloudServices"}static get requires(){return[dx]}init(){const r=this.context.config.get("cloudServices")||{};for(const e in r)this[e]=r[e];if(this._tokens=new Map,this.tokenUrl)return this.token=this.context.plugins.get("CloudServicesCore").createToken(this.tokenUrl),this._tokens.set(this.tokenUrl,this.token),this.token.init();this.token=null}registerTokenUrl(r){if(this._tokens.has(r))return Promise.resolve(this.getTokenFor(r));const e=this.context.plugins.get("CloudServicesCore").createToken(r);return this._tokens.set(r,e),e.init()}getTokenFor(r){const e=this._tokens.get(r);if(!e)throw new y.a("cloudservices-token-not-registered",this);return e}destroy(){super.destroy();for(const r of this._tokens.values())r.destroy()}},class extends me{static get requires(){return[Lb,"ImageUpload"]}init(){const r=this.editor;r.plugins.has("ImageBlockEditing")||r.plugins.has("ImageInlineEditing")||Object(y.b)("easy-image-image-feature-missing",r)}static get pluginName(){return"EasyImage"}},class extends me{static get requires(){return[Fb,Vb]}static get pluginName(){return"Heading"}},class extends me{static get requires(){return[Gb,Yb]}static get pluginName(){return"Image"}},class extends me{static get requires(){return[Jb,Zb]}static get pluginName(){return"ImageCaption"}},class extends me{static get requires(){return[H,W]}static get pluginName(){return"ImageStyle"}},class extends me{static get requires(){return[Xc,Lr]}static get pluginName(){return"ImageToolbar"}afterInit(){const r=this.editor,e=r.t,t=r.plugins.get(Xc),n=r.plugins.get("ImageUtils");var i;t.register("image",{ariaLabel:e("Image toolbar"),items:(i=r.config.get("image.toolbar")||[],i.map(o=>oe(o)?o.name:o)),getRelatedElement:o=>n.getClosestSelectedImageWidget(o)})}},class extends me{static get pluginName(){return"ImageUpload"}static get requires(){return[un,Ke,ht]}},class extends me{static get pluginName(){return"Indent"}static get requires(){return[lo,Ey]}},class extends me{static get requires(){return[Ky,Yy,Jy]}static get pluginName(){return"Link"}},class extends me{static get requires(){return[l1,c1]}static get pluginName(){return"List"}},class extends me{static get requires(){return[Zp,g1,f1,hl]}static get pluginName(){return"MediaEmbed"}},fl,class extends me{static get pluginName(){return"PasteFromOffice"}static get requires(){return[tn]}init(){const r=this.editor,e=r.editing.view.document,t=[];t.push(new C1(e)),t.push(new w1(e)),r.plugins.get("ClipboardPipeline").on("inputTransformation",(n,i)=>{if(i._isTransformedWithPasteFromOffice)return;const o=i.dataTransfer.getData("text/html"),a=t.find(c=>c.isActive(o));a&&(i._parsedData=T1(o,e.stylesProcessor),a.execute(i),i._isTransformedWithPasteFromOffice=!0)},{priority:"high"})}},class extends me{static get requires(){return[X1,ex,vl,ox,ix,nx,hl]}static get pluginName(){return"Table"}},class extends me{static get requires(){return[Xc]}static get pluginName(){return"TableToolbar"}afterInit(){const r=this.editor,e=r.t,t=r.plugins.get(Xc),n=r.config.get("table.contentToolbar"),i=r.config.get("table.tableToolbar");n&&t.register("tableContent",{ariaLabel:e("Table toolbar"),items:n,getRelatedElement:ax}),i&&t.register("table",{ariaLabel:e("Table toolbar"),items:i,getRelatedElement:sx})}},class extends me{static get pluginName(){return"TextTransformation"}constructor(r){super(r),r.config.define("typing",{transformations:{include:gb}})}init(){const r=this.editor.model.document.selection;r.on("change:range",()=>{this.isEnabled=!r.anchor.parent.is("element","codeBlock")}),this._enableTransformationWatchers()}_enableTransformationWatchers(){const r=this.editor,e=r.model,t=r.plugins.get("Input"),n=function(o){const a=o.extra||[],c=o.remove||[],u=h=>!c.includes(h);return function(h){const m=new Set;for(const k of h)if(Ep[k])for(const C of Ep[k])m.add(C);else m.add(k);return Array.from(m)}(o.include.concat(a).filter(u)).filter(u).map(h=>pb[h]||h).map(h=>({from:Pp(h.from),to:mb(h.to)}))}(r.config.get("typing.transformations")),i=new qu(r.model,o=>{for(const a of n)if(a.from.test(o))return{normalizedTransformation:a}});i.on("matched:data",(o,a)=>{if(!t.isInput(a.batch))return;const{from:c,to:u}=a.normalizedTransformation,h=c.exec(a.text),m=u(h.slice(1)),k=a.range;let C=h.index;e.enqueueChange(S=>{for(let N=1;N<h.length;N++){const D=h[N],z=m[N-1];if(z==null){C+=D.length;continue}const U=k.start.getShiftedBy(C),J=e.createRange(U,U.getShiftedBy(D.length)),ce=bb(U);e.insertContent(S.createText(z,ce),J),C+=z.length}})}),i.bind("isEnabled").to(this)}}],yv.defaultConfig={toolbar:{items:["heading","|","bold","italic","link","bulletedList","numberedList","|","outdent","indent","|","uploadImage","blockQuote","insertTable","mediaEmbed","undo","redo"]},image:{toolbar:["imageStyle:inline","imageStyle:block","imageStyle:side","|","toggleImageCaption","imageTextAlternative"]},table:{contentToolbar:["tableColumn","tableRow","mergeTableCells"]},language:"en"}}]).default})})(Gv,Gv.exports);var gC=Gv.exports;const mC=Ag(gC);function ld(p){var _=[];return dr.Children.forEach(p,function(l){l!=null&&(Array.isArray(l)?_=_.concat(ld(l)):fx.isFragment(l)&&l.props?_=_.concat(ld(l.props.children)):_.push(l))}),_}function P0(){var p=this.constructor.getDerivedStateFromProps(this.props,this.state);p!=null&&this.setState(p)}function I0(p){function _(l){var f=this.constructor.getDerivedStateFromProps(p,l);return f??null}this.setState(_.bind(this))}function M0(p,_){try{var l=this.props,f=this.state;this.props=p,this.state=_,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(l,f)}finally{this.props=l,this.state=f}}P0.__suppressDeprecationWarning=!0;I0.__suppressDeprecationWarning=!0;M0.__suppressDeprecationWarning=!0;function __(p){var _=p.prototype;if(!_||!_.isReactComponent)throw new Error("Can only polyfill class components");if(typeof p.getDerivedStateFromProps!="function"&&typeof _.getSnapshotBeforeUpdate!="function")return p;var l=null,f=null,v=null;if(typeof _.componentWillMount=="function"?l="componentWillMount":typeof _.UNSAFE_componentWillMount=="function"&&(l="UNSAFE_componentWillMount"),typeof _.componentWillReceiveProps=="function"?f="componentWillReceiveProps":typeof _.UNSAFE_componentWillReceiveProps=="function"&&(f="UNSAFE_componentWillReceiveProps"),typeof _.componentWillUpdate=="function"?v="componentWillUpdate":typeof _.UNSAFE_componentWillUpdate=="function"&&(v="UNSAFE_componentWillUpdate"),l!==null||f!==null||v!==null){var w=p.displayName||p.name,b=typeof p.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. `+w+" uses "+b+" but also contains the following legacy lifecycles:"+(l!==null?` `+l:"")+(f!==null?` `+f:"")+(v!==null?` `+v:"")+` The above lifecycles should be removed. Learn more about this warning here: https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof p.getDerivedStateFromProps=="function"&&(_.componentWillMount=P0,_.componentWillReceiveProps=I0),typeof _.getSnapshotBeforeUpdate=="function"){if(typeof _.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");_.componentWillUpdate=M0;var T=_.componentDidUpdate;_.componentDidUpdate=function(B,y,L){var O=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:L;T.call(this,B,y,O)}}return p}var Qv={exports:{}},Yv={exports:{}};(function(p,_){_.__esModule=!0;var l=X;P(l);var f=px,v=P(f),w=Nx,b=P(w),T=Rx;P(T);function P(Q){return Q&&Q.__esModule?Q:{default:Q}}function B(Q,ne){if(!(Q instanceof ne))throw new TypeError("Cannot call a class as a function")}function y(Q,ne){if(!Q)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ne&&(typeof ne=="object"||typeof ne=="function")?ne:Q}function L(Q,ne){if(typeof ne!="function"&&ne!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ne);Q.prototype=Object.create(ne&&ne.prototype,{constructor:{value:Q,enumerable:!1,writable:!0,configurable:!0}}),ne&&(Object.setPrototypeOf?Object.setPrototypeOf(Q,ne):Q.__proto__=ne)}var O=1073741823;function V(Q,ne){return Q===ne?Q!==0||1/Q===1/ne:Q!==Q&&ne!==ne}function F(Q){var ne=[];return{on:function(oe){ne.push(oe)},off:function(oe){ne=ne.filter(function(re){return re!==oe})},get:function(){return Q},set:function(oe,re){Q=oe,ne.forEach(function(be){return be(Q,re)})}}}function Z(Q){return Array.isArray(Q)?Q[0]:Q}function G(Q,ne){var ee,oe,re="__create-react-context-"+(0,b.default)()+"__",be=function(Ae){L(Ee,Ae);function Ee(){var Ne,ie,fe;B(this,Ee);for(var _e=arguments.length,ve=Array(_e),ke=0;ke<_e;ke++)ve[ke]=arguments[ke];return fe=(Ne=(ie=y(this,Ae.call.apply(Ae,[this].concat(ve))),ie),ie.emitter=F(ie.props.value),Ne),y(ie,fe)}return Ee.prototype.getChildContext=function(){var ie;return ie={},ie[re]=this.emitter,ie},Ee.prototype.componentWillReceiveProps=function(ie){if(this.props.value!==ie.value){var fe=this.props.value,_e=ie.value,ve=void 0;V(fe,_e)?ve=0:(ve=typeof ne=="function"?ne(fe,_e):O,ve|=0,ve!==0&&this.emitter.set(ie.value,ve))}},Ee.prototype.render=function(){return this.props.children},Ee}(l.Component);be.childContextTypes=(ee={},ee[re]=v.default.object.isRequired,ee);var we=function(Ae){L(Ee,Ae);function Ee(){var Ne,ie,fe;B(this,Ee);for(var _e=arguments.length,ve=Array(_e),ke=0;ke<_e;ke++)ve[ke]=arguments[ke];return fe=(Ne=(ie=y(this,Ae.call.apply(Ae,[this].concat(ve))),ie),ie.state={value:ie.getValue()},ie.onUpdate=function(Se,Pe){var Oe=ie.observedBits|0;Oe&Pe&&ie.setState({value:ie.getValue()})},Ne),y(ie,fe)}return Ee.prototype.componentWillReceiveProps=function(ie){var fe=ie.observedBits;this.observedBits=fe??O},Ee.prototype.componentDidMount=function(){this.context[re]&&this.context[re].on(this.onUpdate);var ie=this.props.observedBits;this.observedBits=ie??O},Ee.prototype.componentWillUnmount=function(){this.context[re]&&this.context[re].off(this.onUpdate)},Ee.prototype.getValue=function(){return this.context[re]?this.context[re].get():Q},Ee.prototype.render=function(){return Z(this.props.children)(this.state.value)},Ee}(l.Component);return we.contextTypes=(oe={},oe[re]=v.default.object,oe),{Provider:be,Consumer:we}}_.default=G,p.exports=_.default})(Yv,Yv.exports);var bC=Yv.exports;(function(p,_){_.__esModule=!0;var l=X,f=b(l),v=bC,w=b(v);function b(T){return T&&T.__esModule?T:{default:T}}_.default=f.default.createContext||w.default,p.exports=_.default})(Qv,Qv.exports);var vC=Qv.exports;const _C=Ag(vC);var O0=_C(null),N0={exports:{}},wC=N0.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=wC);var xl=N0.exports,R0={exports:{}},kC=R0.exports={version:"2.6.12"};typeof __e=="number"&&(__e=kC);var la=R0.exports,yC=function(p){if(typeof p!="function")throw TypeError(p+" is not a function!");return p},xC=yC,D0=function(p,_,l){if(xC(p),_===void 0)return p;switch(l){case 1:return function(f){return p.call(_,f)};case 2:return function(f,v){return p.call(_,f,v)};case 3:return function(f,v,w){return p.call(_,f,v,w)}}return function(){return p.apply(_,arguments)}},ca={},dd=function(p){return typeof p=="object"?p!==null:typeof p=="function"},CC=dd,Th=function(p){if(!CC(p))throw TypeError(p+" is not an object!");return p},Ah=function(p){try{return!!p()}catch{return!0}},da=!Ah(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),Cv,hk;function j0(){if(hk)return Cv;hk=1;var p=dd,_=xl.document,l=p(_)&&p(_.createElement);return Cv=function(f){return l?_.createElement(f):{}},Cv}var L0=!da&&!Ah(function(){return Object.defineProperty(j0()("div"),"a",{get:function(){return 7}}).a!=7}),ig=dd,w_=function(p,_){if(!ig(p))return p;var l,f;if(_&&typeof(l=p.toString)=="function"&&!ig(f=l.call(p))||typeof(l=p.valueOf)=="function"&&!ig(f=l.call(p))||!_&&typeof(l=p.toString)=="function"&&!ig(f=l.call(p)))return f;throw TypeError("Can't convert object to primitive value")},fk=Th,TC=L0,AC=w_,SC=Object.defineProperty;ca.f=da?Object.defineProperty:function(_,l,f){if(fk(_),l=AC(l,!0),fk(f),TC)try{return SC(_,l,f)}catch{}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(_[l]=f.value),_};var Pg=function(p,_){return{enumerable:!(p&1),configurable:!(p&2),writable:!(p&4),value:_}},EC=ca,PC=Pg,ud=da?function(p,_,l){return EC.f(p,_,PC(1,l))}:function(p,_,l){return p[_]=l,p},IC={}.hasOwnProperty,Cl=function(p,_){return IC.call(p,_)},rg=xl,Tv=la,pk=D0,MC=ud,OC=Cl,og="prototype",vi=function(p,_,l){var f=p&vi.F,v=p&vi.G,w=p&vi.S,b=p&vi.P,T=p&vi.B,P=p&vi.W,B=v?Tv:Tv[_]||(Tv[_]={}),y=B[og],L=v?rg:w?rg[_]:(rg[_]||{})[og],O,V,F;v&&(l=_);for(O in l)V=!f&&L&&L[O]!==void 0,!(V&&OC(B,O))&&(F=V?L[O]:l[O],B[O]=v&&typeof L[O]!="function"?l[O]:T&&V?pk(F,rg):P&&L[O]==F?function(Z){var G=function(Q,ne,ee){if(this instanceof Z){switch(arguments.length){case 0:return new Z;case 1:return new Z(Q);case 2:return new Z(Q,ne)}return new Z(Q,ne,ee)}return Z.apply(this,arguments)};return G[og]=Z[og],G}(F):b&&typeof F=="function"?pk(Function.call,F):F,b&&((B.virtual||(B.virtual={}))[O]=F,p&vi.R&&y&&!y[O]&&MC(y,O,F)))};vi.F=1;vi.G=2;vi.S=4;vi.P=8;vi.B=16;vi.W=32;vi.U=64;vi.R=128;var hd=vi,Av=hd;Av(Av.S+Av.F*!da,"Object",{defineProperty:ca.f});var NC=la.Object,RC=function(_,l,f){return NC.defineProperty(_,l,f)},z0={default:RC,__esModule:!0},DC=z0,jC=LC(DC);function LC(p){return p&&p.__esModule?p:{default:p}}var Sv=function(p,_,l){return _ in p?(0,jC.default)(p,_,{value:l,enumerable:!0,configurable:!0,writable:!0}):p[_]=l,p},zC={}.toString,B0=function(p){return zC.call(p).slice(8,-1)},BC=B0,F0=Object("z").propertyIsEnumerable(0)?Object:function(p){return BC(p)=="String"?p.split(""):Object(p)},k_=function(p){if(p==null)throw TypeError("Can't call method on "+p);return p},FC=F0,VC=k_,fd=function(p){return FC(VC(p))},$C=Math.ceil,HC=Math.floor,y_=function(p){return isNaN(p=+p)?0:(p>0?HC:$C)(p)},UC=y_,WC=Math.min,qC=function(p){return p>0?WC(UC(p),9007199254740991):0},KC=y_,GC=Math.max,QC=Math.min,YC=function(p,_){return p=KC(p),p<0?GC(p+_,0):QC(p,_)},XC=fd,JC=qC,ZC=YC,eT=function(p){return function(_,l,f){var v=XC(_),w=JC(v.length),b=ZC(f,w),T;if(p&&l!=l){for(;w>b;)if(T=v[b++],T!=T)return!0}else for(;w>b;b++)if((p||b in v)&&v[b]===l)return p||b||0;return!p&&-1}},V0={exports:{}},tT=!0,nT=la,gk=xl,mk="__core-js_shared__",bk=gk[mk]||(gk[mk]={});(V0.exports=function(p,_){return bk[p]||(bk[p]=_!==void 0?_:{})})("versions",[]).push({version:nT.version,mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});var x_=V0.exports,iT=0,rT=Math.random(),Ig=function(p){return"Symbol(".concat(p===void 0?"":p,")_",(++iT+rT).toString(36))},vk=x_("keys"),oT=Ig,C_=function(p){return vk[p]||(vk[p]=oT(p))},_k=Cl,sT=fd,aT=eT(!1),lT=C_("IE_PROTO"),$0=function(p,_){var l=sT(p),f=0,v=[],w;for(w in l)w!=lT&&_k(l,w)&&v.push(w);for(;_.length>f;)_k(l,w=_[f++])&&(~aT(v,w)||v.push(w));return v},T_="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),cT=$0,dT=T_,Mg=Object.keys||function(_){return cT(_,dT)},Og={};Og.f=Object.getOwnPropertySymbols;var Sh={};Sh.f={}.propertyIsEnumerable;var uT=k_,A_=function(p){return Object(uT(p))},Ev,wk;function hT(){if(wk)return Ev;wk=1;var p=da,_=Mg,l=Og,f=Sh,v=A_,w=F0,b=Object.assign;return Ev=!b||Ah(function(){var T={},P={},B=Symbol(),y="abcdefghijklmnopqrst";return T[B]=7,y.split("").forEach(function(L){P[L]=L}),b({},T)[B]!=7||Object.keys(b({},P)).join("")!=y})?function(P,B){for(var y=v(P),L=arguments.length,O=1,V=l.f,F=f.f;L>O;)for(var Z=w(arguments[O++]),G=V?_(Z).concat(V(Z)):_(Z),Q=G.length,ne=0,ee;Q>ne;)ee=G[ne++],(!p||F.call(Z,ee))&&(y[ee]=Z[ee]);return y}:b,Ev}var Pv=hd;Pv(Pv.S+Pv.F,"Object",{assign:hT()});var fT=la.Object.assign,pT={default:fT,__esModule:!0},gT=pT,mT=bT(gT);function bT(p){return p&&p.__esModule?p:{default:p}}var id=mT.default||function(p){for(var _=1;_<arguments.length;_++){var l=arguments[_];for(var f in l)Object.prototype.hasOwnProperty.call(l,f)&&(p[f]=l[f])}return p},vT=function(p,_){if(!(p instanceof _))throw new TypeError("Cannot call a class as a function")},_T=z0,wT=kT(_T);function kT(p){return p&&p.__esModule?p:{default:p}}var yT=function(){function p(_,l){for(var f=0;f<l.length;f++){var v=l[f];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),(0,wT.default)(_,v.key,v)}}return function(_,l,f){return l&&p(_.prototype,l),f&&p(_,f),_}}(),Ng={},xT=y_,CT=k_,TT=function(p){return function(_,l){var f=String(CT(_)),v=xT(l),w=f.length,b,T;return v<0||v>=w?p?"":void 0:(b=f.charCodeAt(v),b<55296||b>56319||v+1===w||(T=f.charCodeAt(v+1))<56320||T>57343?p?f.charAt(v):b:p?f.slice(v,v+2):(b-55296<<10)+(T-56320)+65536)}},H0=ud,S_={},AT=ca,ST=Th,ET=Mg,PT=da?Object.defineProperties:function(_,l){ST(_);for(var f=ET(l),v=f.length,w=0,b;v>w;)AT.f(_,b=f[w++],l[b]);return _},Iv,kk;function IT(){if(kk)return Iv;kk=1;var p=xl.document;return Iv=p&&p.documentElement,Iv}var MT=Th,OT=PT,yk=T_,NT=C_("IE_PROTO"),Mv=function(){},Xv="prototype",pg=function(){var p=j0()("iframe"),_=yk.length,l="<",f=">",v;for(p.style.display="none",IT().appendChild(p),p.src="javascript:",v=p.contentWindow.document,v.open(),v.write(l+"script"+f+"document.F=Object"+l+"/script"+f),v.close(),pg=v.F;_--;)delete pg[Xv][yk[_]];return pg()},E_=Object.create||function(_,l){var f;return _!==null?(Mv[Xv]=MT(_),f=new Mv,Mv[Xv]=null,f[NT]=_):f=pg(),l===void 0?f:OT(f,l)},U0={exports:{}},Jv=x_("wks"),RT=Ig,Zv=xl.Symbol,xk=typeof Zv=="function",DT=U0.exports=function(p){return Jv[p]||(Jv[p]=xk&&Zv[p]||(xk?Zv:RT)("Symbol."+p))};DT.store=Jv;var pd=U0.exports,jT=ca.f,LT=Cl,Ck=pd("toStringTag"),P_=function(p,_,l){p&&!LT(p=l?p:p.prototype,Ck)&&jT(p,Ck,{configurable:!0,value:_})},zT=E_,BT=Pg,FT=P_,W0={};ud(W0,pd("iterator"),function(){return this});var VT=function(p,_,l){p.prototype=zT(W0,{next:BT(1,l)}),FT(p,_+" Iterator")},$T=Cl,HT=A_,Tk=C_("IE_PROTO"),UT=Object.prototype,WT=Object.getPrototypeOf||function(p){return p=HT(p),$T(p,Tk)?p[Tk]:typeof p.constructor=="function"&&p instanceof p.constructor?p.constructor.prototype:p instanceof Object?UT:null},Ov=hd,qT=H0,KT=ud,Ak=S_,GT=VT,QT=P_,YT=WT,Nv=pd("iterator"),Rv=!([].keys&&"next"in[].keys()),XT="@@iterator",Sk="keys",sg="values",JT=function(){return this},q0=function(p,_,l,f,v,w,b){GT(l,_,f);var T=function(ee){if(!Rv&&ee in L)return L[ee];switch(ee){case Sk:return function(){return new l(this,ee)};case sg:return function(){return new l(this,ee)}}return function(){return new l(this,ee)}},P=_+" Iterator",B=v==sg,y=!1,L=p.prototype,O=L[Nv]||L[XT]||v&&L[v],V=O||T(v),F=v?B?T("entries"):V:void 0,Z=_=="Array"&&L.entries||O,G,Q,ne;if(Z&&(ne=YT(Z.call(new p)),ne!==Object.prototype&&ne.next&&QT(ne,P,!0)),B&&O&&O.name!==sg&&(y=!0,V=function(){return O.call(this)}),b&&(Rv||y||!L[Nv])&&KT(L,Nv,V),Ak[_]=V,Ak[P]=JT,v)if(G={values:B?V:T(sg),keys:w?V:T(Sk),entries:F},b)for(Q in G)Q in L||qT(L,Q,G[Q]);else Ov(Ov.P+Ov.F*(Rv||y),_,G);return G},ZT=TT(!0);q0(String,"String",function(p){this._t=String(p),this._i=0},function(){var p=this._t,_=this._i,l;return _>=p.length?{value:void 0,done:!0}:(l=ZT(p,_),this._i+=l.length,{value:l,done:!1})});var eA=function(p,_){return{value:_,done:!!p}},ag=eA,Ek=S_,tA=fd;q0(Array,"Array",function(p,_){this._t=tA(p),this._i=0,this._k=_},function(){var p=this._t,_=this._k,l=this._i++;return!p||l>=p.length?(this._t=void 0,ag(1)):_=="keys"?ag(0,l):_=="values"?ag(0,p[l]):ag(0,[l,p[l]])},"values");Ek.Arguments=Ek.Array;var nA=xl,iA=ud,Pk=S_,Ik=pd("toStringTag"),Mk="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(",");for(var Dv=0;Dv<Mk.length;Dv++){var jv=Mk[Dv],Ok=nA[jv],Lv=Ok&&Ok.prototype;Lv&&!Lv[Ik]&&iA(Lv,Ik,jv),Pk[jv]=Pk.Array}var Rg={};Rg.f=pd;var rA=Rg.f("iterator"),oA={default:rA,__esModule:!0},K0={exports:{}},yl=Ig("meta"),sA=dd,I_=Cl,aA=ca.f,lA=0,Dg=Object.isExtensible||function(){return!0},cA=!Ah(function(){return Dg(Object.preventExtensions({}))}),M_=function(p){aA(p,yl,{value:{i:"O"+ ++lA,w:{}}})},dA=function(p,_){if(!sA(p))return typeof p=="symbol"?p:(typeof p=="string"?"S":"P")+p;if(!I_(p,yl)){if(!Dg(p))return"F";if(!_)return"E";M_(p)}return p[yl].i},uA=function(p,_){if(!I_(p,yl)){if(!Dg(p))return!0;if(!_)return!1;M_(p)}return p[yl].w},hA=function(p){return cA&&fA.NEED&&Dg(p)&&!I_(p,yl)&&M_(p),p},fA=K0.exports={KEY:yl,NEED:!1,fastKey:dA,getWeak:uA,onFreeze:hA},pA=K0.exports,Nk=la,gA=Rg,mA=ca.f,O_=function(p){var _=Nk.Symbol||(Nk.Symbol={});p.charAt(0)!="_"&&!(p in _)&&mA(_,p,{value:gA.f(p)})},bA=Mg,vA=Og,_A=Sh,wA=function(p){var _=bA(p),l=vA.f;if(l)for(var f=l(p),v=_A.f,w=0,b;f.length>w;)v.call(p,b=f[w++])&&_.push(b);return _},kA=B0,yA=Array.isArray||function(_){return kA(_)=="Array"},G0={},N_={},xA=$0,CA=T_.concat("length","prototype");N_.f=Object.getOwnPropertyNames||function(_){return xA(_,CA)};var TA=fd,Q0=N_.f,AA={}.toString,Y0=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],SA=function(p){try{return Q0(p)}catch{return Y0.slice()}};G0.f=function(_){return Y0&&AA.call(_)=="[object Window]"?SA(_):Q0(TA(_))};var R_={},EA=Sh,PA=Pg,IA=fd,MA=w_,OA=Cl,NA=L0,Rk=Object.getOwnPropertyDescriptor;R_.f=da?Rk:function(_,l){if(_=IA(_),l=MA(l,!0),NA)try{return Rk(_,l)}catch{}if(OA(_,l))return PA(!EA.f.call(_,l),_[l])};var jg=xl,Qn=Cl,e_=da,_i=hd,Dk=H0,RA=pA.KEY,D_=Ah,j_=x_,L_=P_,DA=Ig,Eh=pd,jA=Rg,LA=O_,zA=wA,BA=yA,t_=Th,FA=dd,VA=A_,Lg=fd,z_=w_,n_=Pg,yh=E_,X0=G0,J0=R_,zg=Og,Z0=ca,$A=Mg,ey=J0.f,wl=Z0.f,ty=X0.f,Ki=jg.Symbol,xg=jg.JSON,lg=xg&&xg.stringify,sa="prototype",qi=Eh("_hidden"),jk=Eh("toPrimitive"),HA={}.propertyIsEnumerable,dh=j_("symbol-registry"),ms=j_("symbols"),Ph=j_("op-symbols"),Fr=Object[sa],gd=typeof Ki=="function"&&!!zg.f,zv=jg.QObject,i_=!zv||!zv[sa]||!zv[sa].findChild,r_=e_&&D_(function(){return yh(wl({},"a",{get:function(){return wl(this,"a",{value:7}).a}})).a!=7})?function(p,_,l){var f=ey(Fr,_);f&&delete Fr[_],wl(p,_,l),f&&p!==Fr&&wl(Fr,_,f)}:wl,Lk=function(p){var _=ms[p]=yh(Ki[sa]);return _._k=p,_},o_=gd&&typeof Ki.iterator=="symbol"?function(p){return typeof p=="symbol"}:function(p){return p instanceof Ki},Bg=function(_,l,f){return _===Fr&&Bg(Ph,l,f),t_(_),l=z_(l,!0),t_(f),Qn(ms,l)?(f.enumerable?(Qn(_,qi)&&_[qi][l]&&(_[qi][l]=!1),f=yh(f,{enumerable:n_(0,!1)})):(Qn(_,qi)||wl(_,qi,n_(1,{})),_[qi][l]=!0),r_(_,l,f)):wl(_,l,f)},ny=function(_,l){t_(_);for(var f=zA(l=Lg(l)),v=0,w=f.length,b;w>v;)Bg(_,b=f[v++],l[b]);return _},UA=function(_,l){return l===void 0?yh(_):ny(yh(_),l)},zk=function(_){var l=HA.call(this,_=z_(_,!0));return this===Fr&&Qn(ms,_)&&!Qn(Ph,_)?!1:l||!Qn(this,_)||!Qn(ms,_)||Qn(this,qi)&&this[qi][_]?l:!0},iy=function(_,l){if(_=Lg(_),l=z_(l,!0),!(_===Fr&&Qn(ms,l)&&!Qn(Ph,l))){var f=ey(_,l);return f&&Qn(ms,l)&&!(Qn(_,qi)&&_[qi][l])&&(f.enumerable=!0),f}},ry=function(_){for(var l=ty(Lg(_)),f=[],v=0,w;l.length>v;)!Qn(ms,w=l[v++])&&w!=qi&&w!=RA&&f.push(w);return f},oy=function(_){for(var l=_===Fr,f=ty(l?Ph:Lg(_)),v=[],w=0,b;f.length>w;)Qn(ms,b=f[w++])&&(!l||Qn(Fr,b))&&v.push(ms[b]);return v};gd||(Ki=function(){if(this instanceof Ki)throw TypeError("Symbol is not a constructor!");var _=DA(arguments.length>0?arguments[0]:void 0),l=function(f){this===Fr&&l.call(Ph,f),Qn(this,qi)&&Qn(this[qi],_)&&(this[qi][_]=!1),r_(this,_,n_(1,f))};return e_&&i_&&r_(Fr,_,{configurable:!0,set:l}),Lk(_)},Dk(Ki[sa],"toString",function(){return this._k}),J0.f=iy,Z0.f=Bg,N_.f=X0.f=ry,Sh.f=zk,zg.f=oy,e_&&!tT&&Dk(Fr,"propertyIsEnumerable",zk),jA.f=function(p){return Lk(Eh(p))});_i(_i.G+_i.W+_i.F*!gd,{Symbol:Ki});for(var Bk="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Fk=0;Bk.length>Fk;)Eh(Bk[Fk++]);for(var Vk=$A(Eh.store),$k=0;Vk.length>$k;)LA(Vk[$k++]);_i(_i.S+_i.F*!gd,"Symbol",{for:function(p){return Qn(dh,p+="")?dh[p]:dh[p]=Ki(p)},keyFor:function(_){if(!o_(_))throw TypeError(_+" is not a symbol!");for(var l in dh)if(dh[l]===_)return l},useSetter:function(){i_=!0},useSimple:function(){i_=!1}});_i(_i.S+_i.F*!gd,"Object",{create:UA,defineProperty:Bg,defineProperties:ny,getOwnPropertyDescriptor:iy,getOwnPropertyNames:ry,getOwnPropertySymbols:oy});var WA=D_(function(){zg.f(1)});_i(_i.S+_i.F*WA,"Object",{getOwnPropertySymbols:function(_){return zg.f(VA(_))}});xg&&_i(_i.S+_i.F*(!gd||D_(function(){var p=Ki();return lg([p])!="[null]"||lg({a:p})!="{}"||lg(Object(p))!="{}"})),"JSON",{stringify:function(_){for(var l=[_],f=1,v,w;arguments.length>f;)l.push(arguments[f++]);if(w=v=l[1],!(!FA(v)&&_===void 0||o_(_)))return BA(v)||(v=function(b,T){if(typeof w=="function"&&(T=w.call(this,b,T)),!o_(T))return T}),l[1]=v,lg.apply(xg,l)}});Ki[sa][jk]||ud(Ki[sa],jk,Ki[sa].valueOf);L_(Ki,"Symbol");L_(Math,"Math",!0);L_(jg.JSON,"JSON",!0);O_("asyncIterator");O_("observable");var qA=la.Symbol,KA={default:qA,__esModule:!0};Ng.__esModule=!0;var GA=oA,sy=ay(GA),QA=KA,oa=ay(QA),Bv=typeof oa.default=="function"&&typeof sy.default=="symbol"?function(p){return typeof p}:function(p){return p&&typeof oa.default=="function"&&p.constructor===oa.default&&p!==oa.default.prototype?"symbol":typeof p};function ay(p){return p&&p.__esModule?p:{default:p}}Ng.default=typeof oa.default=="function"&&Bv(sy.default)==="symbol"?function(p){return typeof p>"u"?"undefined":Bv(p)}:function(p){return p&&typeof oa.default=="function"&&p.constructor===oa.default&&p!==oa.default.prototype?"symbol":typeof p>"u"?"undefined":Bv(p)};var YA=Ng,XA=JA(YA);function JA(p){return p&&p.__esModule?p:{default:p}}var ZA=function(p,_){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&((typeof _>"u"?"undefined":(0,XA.default)(_))==="object"||typeof _=="function")?_:p},Fv,Hk;function eS(){if(Hk)return Fv;Hk=1;var p=dd,_=Th,l=function(f,v){if(_(f),!p(v)&&v!==null)throw TypeError(v+": can't set as prototype!")};return Fv={set:Object.setPrototypeOf||("__proto__"in{}?function(f,v,w){try{w=D0(Function.call,R_.f(Object.prototype,"__proto__").set,2),w(f,[]),v=!(f instanceof Array)}catch{v=!0}return function(T,P){return l(T,P),v?T.__proto__=P:w(T,P),T}}({},!1):void 0),check:l},Fv}var Uk=hd;Uk(Uk.S,"Object",{setPrototypeOf:eS().set});var tS=la.Object.setPrototypeOf,nS={default:tS,__esModule:!0},Wk=hd;Wk(Wk.S,"Object",{create:E_});var iS=la.Object,rS=function(_,l){return iS.create(_,l)},oS={default:rS,__esModule:!0},sS=nS,qk=B_(sS),aS=oS,lS=B_(aS),cS=Ng,dS=B_(cS);function B_(p){return p&&p.__esModule?p:{default:p}}var uS=function(p,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+(typeof _>"u"?"undefined":(0,dS.default)(_)));p.prototype=(0,lS.default)(_&&_.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),_&&(qk.default?(0,qk.default)(p,_):p.__proto__=_)};function hS(p){return p instanceof HTMLElement?p:gx.findDOMNode(p)}var Fg={exports:{}},bh={exports:{}};(function(){var p,_,l,f,v,w;typeof performance<"u"&&performance!==null&&performance.now?bh.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(bh.exports=function(){return(p()-v)/1e6},_=process.hrtime,p=function(){var b;return b=_(),b[0]*1e9+b[1]},f=p(),w=process.uptime()*1e9,v=f-w):Date.now?(bh.exports=function(){return Date.now()-l},l=Date.now()):(bh.exports=function(){return new Date().getTime()-l},l=new Date().getTime())}).call(nn);var fS=bh.exports,pS=fS,gs=typeof window>"u"?nn:window,cg=["moz","webkit"],sd="AnimationFrame",cd=gs["request"+sd],xh=gs["cancel"+sd]||gs["cancelRequest"+sd];for(var uh=0;!cd&&uh<cg.length;uh++)cd=gs[cg[uh]+"Request"+sd],xh=gs[cg[uh]+"Cancel"+sd]||gs[cg[uh]+"CancelRequest"+sd];if(!cd||!xh){var Vv=0,Kk=0,_l=[],gS=1e3/60;cd=function(p){if(_l.length===0){var _=pS(),l=Math.max(0,gS-(_-Vv));Vv=l+_,setTimeout(function(){var f=_l.slice(0);_l.length=0;for(var v=0;v<f.length;v++)if(!f[v].cancelled)try{f[v].callback(Vv)}catch(w){setTimeout(function(){throw w},0)}},Math.round(l))}return _l.push({handle:++Kk,callback:p,cancelled:!1}),Kk},xh=function(p){for(var _=0;_<_l.length;_++)_l[_].handle===p&&(_l[_].cancelled=!0)}}Fg.exports=function(p){return cd.call(gs,p)};Fg.exports.cancel=function(){xh.apply(gs,arguments)};Fg.exports.polyfill=function(p){p||(p=gs),p.requestAnimationFrame=cd,p.cancelAnimationFrame=xh};var mS=Fg.exports;const Gk=Ag(mS);var ly=!!(typeof window<"u"&&window.document&&window.document.createElement);function Qk(p,_){var l={};return l[p.toLowerCase()]=_.toLowerCase(),l["Webkit"+p]="webkit"+_,l["Moz"+p]="moz"+_,l["ms"+p]="MS"+_,l["O"+p]="o"+_.toLowerCase(),l}function bS(p,_){var l={animationend:Qk("Animation","AnimationEnd"),transitionend:Qk("Transition","TransitionEnd")};return p&&("AnimationEvent"in _||delete l.animationend.animation,"TransitionEvent"in _||delete l.transitionend.transition),l}var vS=bS(ly,typeof window<"u"?window:{}),cy={};ly&&(cy=document.createElement("div").style);var dg={};function dy(p){if(dg[p])return dg[p];var _=vS[p];if(_)for(var l=Object.keys(_),f=l.length,v=0;v<f;v+=1){var w=l[v];if(Object.prototype.hasOwnProperty.call(_,w)&&w in cy)return dg[p]=_[w],dg[p]}return""}var s_=dy("animationend"),a_=dy("transitionend"),_S=!!(s_&&a_);function Yk(p,_){if(!p)return null;if(typeof p=="object"){var l=_.replace(/-\w/g,function(f){return f[1].toUpperCase()});return p[l]}return p+"-"+_}var ra="none",hh="appear",fh="enter",ph="leave",wS={eventProps:le.object,visible:le.bool,children:le.func,motionName:le.oneOfType([le.string,le.object]),motionAppear:le.bool,motionEnter:le.bool,motionLeave:le.bool,motionLeaveImmediately:le.bool,motionDeadline:le.number,removeOnLeave:le.bool,leavedClassName:le.string,onAppearStart:le.func,onAppearActive:le.func,onAppearEnd:le.func,onEnterStart:le.func,onEnterActive:le.func,onEnterEnd:le.func,onLeaveStart:le.func,onLeaveActive:le.func,onLeaveEnd:le.func};function kS(p){var _=p,l=!!dr.forwardRef;typeof p=="object"&&(_=p.transitionSupport,l="forwardRef"in p?p.forwardRef:l);function f(w){return!!(w.motionName&&_)}var v=function(w){uS(b,w);function b(){vT(this,b);var T=ZA(this,(b.__proto__||Object.getPrototypeOf(b)).call(this));return T.onDomUpdate=function(){var P=T.state,B=P.status,y=P.newStatus,L=T.props,O=L.onAppearStart,V=L.onEnterStart,F=L.onLeaveStart,Z=L.onAppearActive,G=L.onEnterActive,Q=L.onLeaveActive,ne=L.motionAppear,ee=L.motionEnter,oe=L.motionLeave;if(f(T.props)){var re=T.getElement();T.$cacheEle!==re&&(T.removeEventListener(T.$cacheEle),T.addEventListener(re),T.$cacheEle=re),y&&B===hh&&ne?T.updateStatus(O,null,null,function(){T.updateActiveStatus(Z,hh)}):y&&B===fh&&ee?T.updateStatus(V,null,null,function(){T.updateActiveStatus(G,fh)}):y&&B===ph&&oe&&T.updateStatus(F,null,null,function(){T.updateActiveStatus(Q,ph)})}},T.onMotionEnd=function(P){var B=T.state,y=B.status,L=B.statusActive,O=T.props,V=O.onAppearEnd,F=O.onEnterEnd,Z=O.onLeaveEnd;y===hh&&L?T.updateStatus(V,{status:ra},P):y===fh&&L?T.updateStatus(F,{status:ra},P):y===ph&&L&&T.updateStatus(Z,{status:ra},P)},T.setNodeRef=function(P){var B=T.props.internalRef;T.node=P,typeof B=="function"?B(P):B&&"current"in B&&(B.current=P)},T.getElement=function(){try{return hS(T.node||T)}catch{return T.$cacheEle}},T.addEventListener=function(P){P&&(P.addEventListener(a_,T.onMotionEnd),P.addEventListener(s_,T.onMotionEnd))},T.removeEventListener=function(P){P&&(P.removeEventListener(a_,T.onMotionEnd),P.removeEventListener(s_,T.onMotionEnd))},T.updateStatus=function(P,B,y,L){var O=P?P(T.getElement(),y):null;if(!(O===!1||T._destroyed)){var V=void 0;L&&(V=function(){T.nextFrame(L)}),T.setState(id({statusStyle:typeof O=="object"?O:null,newStatus:!1},B),V)}},T.updateActiveStatus=function(P,B){T.nextFrame(function(){var y=T.state.status;if(y===B){var L=T.props.motionDeadline;T.updateStatus(P,{statusActive:!0}),L>0&&setTimeout(function(){T.onMotionEnd({deadline:!0})},L)}})},T.nextFrame=function(P){T.cancelNextFrame(),T.raf=Gk(P)},T.cancelNextFrame=function(){T.raf&&(Gk.cancel(T.raf),T.raf=null)},T.state={status:ra,statusActive:!1,newStatus:!1,statusStyle:null},T.$cacheEle=null,T.node=null,T.raf=null,T}return yT(b,[{key:"componentDidMount",value:function(){this.onDomUpdate()}},{key:"componentDidUpdate",value:function(){this.onDomUpdate()}},{key:"componentWillUnmount",value:function(){this._destroyed=!0,this.removeEventListener(this.$cacheEle),this.cancelNextFrame()}},{key:"render",value:function(){var P,B=this.state,y=B.status,L=B.statusActive,O=B.statusStyle,V=this.props,F=V.children,Z=V.motionName,G=V.visible,Q=V.removeOnLeave,ne=V.leavedClassName,ee=V.eventProps;return F?y===ra||!f(this.props)?G?F(id({},ee),this.setNodeRef):Q?null:F(id({},ee,{className:ne}),this.setNodeRef):F(id({},ee,{className:Br((P={},Sv(P,Yk(Z,y),y!==ra),Sv(P,Yk(Z,y+"-active"),y!==ra&&L),Sv(P,Z,typeof Z=="string"),P)),style:O}),this.setNodeRef):null}}],[{key:"getDerivedStateFromProps",value:function(P,B){var y=B.prevProps,L=B.status;if(!f(P))return{};var O=P.visible,V=P.motionAppear,F=P.motionEnter,Z=P.motionLeave,G=P.motionLeaveImmediately,Q={prevProps:P};return(L===hh&&!V||L===fh&&!F||L===ph&&!Z)&&(Q.status=ra,Q.statusActive=!1,Q.newStatus=!1),!y&&O&&V&&(Q.status=hh,Q.statusActive=!1,Q.newStatus=!0),y&&!y.visible&&O&&F&&(Q.status=fh,Q.statusActive=!1,Q.newStatus=!0),(y&&y.visible&&!O&&Z||!y&&G&&!O&&Z)&&(Q.status=ph,Q.statusActive=!1,Q.newStatus=!0),Q}}]),b}(dr.Component);return v.propTypes=id({},wS,{internalRef:le.oneOfType([le.object,le.func])}),v.defaultProps={visible:!0,motionEnter:!0,motionAppear:!0,motionLeave:!0,removeOnLeave:!0},__(v),l?dr.forwardRef(function(w,b){return dr.createElement(v,id({internalRef:b},w))}):v}const yS=kS(_S);function gg(p){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?gg=function(l){return typeof l}:gg=function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},gg(p)}function xS(p,_){if(p==null)return{};var l=CS(p,_),f,v;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(p);for(v=0;v<w.length;v++)f=w[v],!(_.indexOf(f)>=0)&&Object.prototype.propertyIsEnumerable.call(p,f)&&(l[f]=p[f])}return l}function CS(p,_){if(p==null)return{};var l={},f=Object.keys(p),v,w;for(w=0;w<f.length;w++)v=f[w],!(_.indexOf(v)>=0)&&(l[v]=p[v]);return l}function Xk(p,_){var l=Object.keys(p);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(p);_&&(f=f.filter(function(v){return Object.getOwnPropertyDescriptor(p,v).enumerable})),l.push.apply(l,f)}return l}function Jk(p){for(var _=1;_<arguments.length;_++){var l=arguments[_]!=null?arguments[_]:{};_%2?Xk(l,!0).forEach(function(f){co(p,f,l[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(l)):Xk(l).forEach(function(f){Object.defineProperty(p,f,Object.getOwnPropertyDescriptor(l,f))})}return p}function co(p,_,l){return _ in p?Object.defineProperty(p,_,{value:l,enumerable:!0,configurable:!0,writable:!0}):p[_]=l,p}function TS(p,_){if(!(p instanceof _))throw new TypeError("Cannot call a class as a function")}function Zk(p,_){for(var l=0;l<_.length;l++){var f=_[l];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(p,f.key,f)}}function AS(p,_,l){return _&&Zk(p.prototype,_),l&&Zk(p,l),p}function SS(p,_){return _&&(gg(_)==="object"||typeof _=="function")?_:bi(p)}function l_(p){return l_=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},l_(p)}function bi(p){if(p===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p}function ES(p,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(_&&_.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),_&&c_(p,_)}function c_(p,_){return c_=Object.setPrototypeOf||function(f,v){return f.__proto__=v,f},c_(p,_)}var e0="open",t0="close",PS="---",F_=function(p){ES(_,p);function _(){var l;return TS(this,_),l=SS(this,l_(_).apply(this,arguments)),l.state={dragNodeHighlight:!1},l.onSelectorClick=function(f){var v=l.props.context.onNodeClick;v(f,bi(l)),l.isSelectable()?l.onSelect(f):l.onCheck(f)},l.onSelectorDoubleClick=function(f){var v=l.props.context.onNodeDoubleClick;v(f,bi(l))},l.onSelect=function(f){if(!l.isDisabled()){var v=l.props.context.onNodeSelect;f.preventDefault(),v(f,bi(l))}},l.onCheck=function(f){if(!l.isDisabled()){var v=l.props,w=v.disableCheckbox,b=v.checked,T=l.props.context.onNodeCheck;if(!(!l.isCheckable()||w)){f.preventDefault();var P=!b;T(f,bi(l),P)}}},l.onMouseEnter=function(f){var v=l.props.context.onNodeMouseEnter;v(f,bi(l))},l.onMouseLeave=function(f){var v=l.props.context.onNodeMouseLeave;v(f,bi(l))},l.onContextMenu=function(f){var v=l.props.context.onNodeContextMenu;v(f,bi(l))},l.onDragStart=function(f){var v=l.props.context.onNodeDragStart;f.stopPropagation(),l.setState({dragNodeHighlight:!0}),v(f,bi(l));try{f.dataTransfer.setData("text/plain","")}catch{}},l.onDragEnter=function(f){var v=l.props.context.onNodeDragEnter;f.preventDefault(),f.stopPropagation(),v(f,bi(l))},l.onDragOver=function(f){var v=l.props.context.onNodeDragOver;f.preventDefault(),f.stopPropagation(),v(f,bi(l))},l.onDragLeave=function(f){var v=l.props.context.onNodeDragLeave;f.stopPropagation(),v(f,bi(l))},l.onDragEnd=function(f){var v=l.props.context.onNodeDragEnd;f.stopPropagation(),l.setState({dragNodeHighlight:!1}),v(f,bi(l))},l.onDrop=function(f){var v=l.props.context.onNodeDrop;f.preventDefault(),f.stopPropagation(),l.setState({dragNodeHighlight:!1}),v(f,bi(l))},l.onExpand=function(f){var v=l.props.context.onNodeExpand;v(f,bi(l))},l.setSelectHandle=function(f){l.selectHandle=f},l.getNodeChildren=function(){var f=l.props.children,v=ld(f).filter(function(b){return b}),w=fy(v);return v.length!==w.length&&uy(),w},l.getNodeState=function(){var f=l.props.expanded;return l.isLeaf()?null:f?e0:t0},l.isLeaf=function(){var f=l.props,v=f.isLeaf,w=f.loaded,b=l.props.context.loadData,T=l.getNodeChildren().length!==0;return v===!1?!1:v||!b&&!T||b&&w&&!T},l.isDisabled=function(){var f=l.props.disabled,v=l.props.context.disabled;return f===!1?!1:!!(v||f)},l.isCheckable=function(){var f=l.props.checkable,v=l.props.context.checkable;return!v||f===!1?!1:v},l.syncLoadData=function(f){var v=f.expanded,w=f.loading,b=f.loaded,T=l.props.context,P=T.loadData,B=T.onNodeLoad;if(!w&&P&&v&&!l.isLeaf()){var y=l.getNodeChildren().length!==0;!y&&!b&&B(bi(l))}},l.renderSwitcher=function(){var f=l.props,v=f.expanded,w=f.switcherIcon,b=l.props.context,T=b.prefixCls,P=b.switcherIcon,B=w||P;if(l.isLeaf())return X.createElement("span",{className:Br("".concat(T,"-switcher"),"".concat(T,"-switcher-noop"))},typeof B=="function"?B(Jk({},l.props,{isLeaf:!0})):B);var y=Br("".concat(T,"-switcher"),"".concat(T,"-switcher_").concat(v?e0:t0));return X.createElement("span",{onClick:l.onExpand,className:y},typeof B=="function"?B(Jk({},l.props,{isLeaf:!1})):B)},l.renderCheckbox=function(){var f=l.props,v=f.checked,w=f.halfChecked,b=f.disableCheckbox,T=l.props.context.prefixCls,P=l.isDisabled(),B=l.isCheckable();if(!B)return null;var y=typeof B!="boolean"?B:null;return X.createElement("span",{className:Br("".concat(T,"-checkbox"),v&&"".concat(T,"-checkbox-checked"),!v&&w&&"".concat(T,"-checkbox-indeterminate"),(P||b)&&"".concat(T,"-checkbox-disabled")),onClick:l.onCheck},y)},l.renderIcon=function(){var f=l.props.loading,v=l.props.context.prefixCls;return X.createElement("span",{className:Br("".concat(v,"-iconEle"),"".concat(v,"-icon__").concat(l.getNodeState()||"docu"),f&&"".concat(v,"-icon_loading"))})},l.renderSelector=function(){var f=l.state.dragNodeHighlight,v=l.props,w=v.title,b=v.selected,T=v.icon,P=v.loading,B=l.props.context,y=B.prefixCls,L=B.showIcon,O=B.icon,V=B.draggable,F=B.loadData,Z=l.isDisabled(),G="".concat(y,"-node-content-wrapper"),Q;if(L){var ne=T||O;Q=ne?X.createElement("span",{className:Br("".concat(y,"-iconEle"),"".concat(y,"-icon__customize"))},typeof ne=="function"?ne(l.props):ne):l.renderIcon()}else F&&P&&(Q=l.renderIcon());var ee=X.createElement("span",{className:"".concat(y,"-title")},w);return X.createElement("span",{ref:l.setSelectHandle,title:typeof w=="string"?w:"",className:Br("".concat(G),"".concat(G,"-").concat(l.getNodeState()||"normal"),!Z&&(b||f)&&"".concat(y,"-node-selected"),!Z&&V&&"draggable"),draggable:!Z&&V||void 0,"aria-grabbed":!Z&&V||void 0,onMouseEnter:l.onMouseEnter,onMouseLeave:l.onMouseLeave,onContextMenu:l.onContextMenu,onClick:l.onSelectorClick,onDoubleClick:l.onSelectorDoubleClick,onDragStart:V?l.onDragStart:void 0},Q,ee)},l.renderChildren=function(){var f=l.props,v=f.expanded,w=f.pos,b=l.props.context,T=b.prefixCls,P=b.motion,B=b.renderTreeNode,y=l.getNodeChildren();return y.length===0?null:X.createElement(yS,Object.assign({visible:v},P),function(L){var O=L.style,V=L.className;return X.createElement("ul",{className:Br(V,"".concat(T,"-child-tree"),v&&"".concat(T,"-child-tree-open")),style:O,"data-expanded":v,role:"group"},gy(y,function(F,Z){return B(F,Z,w)}))})},l}return AS(_,[{key:"componentDidMount",value:function(){var f=this.props,v=f.eventKey,w=f.context.registerTreeNode;this.syncLoadData(this.props),w(v,this)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"componentWillUnmount",value:function(){var f=this.props,v=f.eventKey,w=f.context.registerTreeNode;w(v,null)}},{key:"isSelectable",value:function(){var f=this.props.selectable,v=this.props.context.selectable;return typeof f=="boolean"?f:v}},{key:"render",value:function(){var f,v=this.props.loading,w=this.props,b=w.className,T=w.style,P=w.dragOver,B=w.dragOverGapTop,y=w.dragOverGapBottom,L=w.isLeaf,O=w.expanded,V=w.selected,F=w.checked,Z=w.halfChecked,G=xS(w,["className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","expanded","selected","checked","halfChecked"]),Q=this.props.context,ne=Q.prefixCls,ee=Q.filterTreeNode,oe=Q.draggable,re=this.isDisabled(),be=by(G);return X.createElement("li",Object.assign({className:Br(b,(f={},co(f,"".concat(ne,"-treenode-disabled"),re),co(f,"".concat(ne,"-treenode-switcher-").concat(O?"open":"close"),!L),co(f,"".concat(ne,"-treenode-checkbox-checked"),F),co(f,"".concat(ne,"-treenode-checkbox-indeterminate"),Z),co(f,"".concat(ne,"-treenode-selected"),V),co(f,"".concat(ne,"-treenode-loading"),v),co(f,"drag-over",!re&&P),co(f,"drag-over-gap-top",!re&&B),co(f,"drag-over-gap-bottom",!re&&y),co(f,"filter-node",ee&&ee(this)),f)),style:T,role:"treeitem",onDragEnter:oe?this.onDragEnter:void 0,onDragOver:oe?this.onDragOver:void 0,onDragLeave:oe?this.onDragLeave:void 0,onDrop:oe?this.onDrop:void 0,onDragEnd:oe?this.onDragEnd:void 0},be),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector(),this.renderChildren())}}]),_}(X.Component);F_.propTypes={eventKey:le.string,prefixCls:le.string,className:le.string,style:le.object,onSelect:le.func,expanded:le.bool,selected:le.bool,checked:le.bool,loaded:le.bool,loading:le.bool,halfChecked:le.bool,children:le.node,title:le.node,pos:le.string,dragOver:le.bool,dragOverGapTop:le.bool,dragOverGapBottom:le.bool,isLeaf:le.bool,checkable:le.bool,selectable:le.bool,disabled:le.bool,disableCheckbox:le.bool,icon:le.oneOfType([le.node,le.func]),switcherIcon:le.oneOfType([le.node,le.func])};__(F_);var V_=function(_){return X.createElement(O0.Consumer,null,function(l){return X.createElement(F_,Object.assign({},_,{context:l}))})};V_.defaultProps={title:PS};V_.isTreeNode=1;const Vg=V_;function mg(p){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?mg=function(l){return typeof l}:mg=function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},mg(p)}function IS(p,_){if(p==null)return{};var l=MS(p,_),f,v;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(p);for(v=0;v<w.length;v++)f=w[v],!(_.indexOf(f)>=0)&&Object.prototype.propertyIsEnumerable.call(p,f)&&(l[f]=p[f])}return l}function MS(p,_){if(p==null)return{};var l={},f=Object.keys(p),v,w;for(w=0;w<f.length;w++)v=f[w],!(_.indexOf(v)>=0)&&(l[v]=p[v]);return l}var OS=.25,NS=2,n0=!1;function uy(){n0||(n0=!0,kh(!1,"Tree only accept TreeNode as children."))}function rd(p,_){var l=p.slice(),f=l.indexOf(_);return f>=0&&l.splice(f,1),l}function od(p,_){var l=p.slice();return l.indexOf(_)===-1&&l.push(_),l}function RS(p){return p.split("-")}function hy(p,_){return"".concat(p,"-").concat(_)}function DS(p){return p&&p.type&&p.type.isTreeNode}function fy(p){return ld(p).filter(DS)}function gh(p){var _=p.props||{},l=_.disabled,f=_.disableCheckbox,v=_.checkable;return!!(l||f)||v===!1}function py(p,_){function l(f,v,w){var b=f?f.props.children:p,T=f?hy(w.pos,v):0,P=fy(b);if(f){var B={node:f,index:v,pos:T,key:f.key||T,parentPos:w.node?w.pos:null};_(B)}X.Children.forEach(P,function(y,L){l(y,L,{node:f,pos:T})})}l(null)}function gy(p,_){var l=ld(p).map(_);return l.length===1?l[0]:l}function jS(p,_){var l=_.props,f=l.eventKey,v=l.pos,w=[];return py(p,function(b){var T=b.key;w.push(T)}),w.push(f||v),w}function i0(p,_){var l=p.clientY,f=_.selectHandle.getBoundingClientRect(),v=f.top,w=f.bottom,b=f.height,T=Math.max(b*OS,NS);return l<=v+T?-1:l>=w-T?1:0}function r0(p,_){if(p){var l=_.multiple;return l?p.slice():p.length?[p[0]]:p}}function o0(p){return p&&p.map(function(_){return String(_)})}var LS=function(_){return _};function my(p,_){if(!p)return[];var l=_||{},f=l.processProps,v=f===void 0?LS:f,w=Array.isArray(p)?p:[p];return w.map(function(b){var T=b.children,P=IS(b,["children"]),B=my(T,_);return dr.createElement(Vg,Object.assign({},v(P)),B)})}function zS(p){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=_.initWrapper,f=_.processEntity,v=_.onProcessFinished,w={},b={},T={posEntities:w,keyEntities:b};return l&&(T=l(T)||T),py(p,function(P){var B=P.node,y=P.index,L=P.pos,O=P.key,V=P.parentPos,F={node:B,index:y,key:O,pos:L};w[L]=F,b[O]=F,F.parent=w[V],F.parent&&(F.parent.children=F.parent.children||[],F.parent.children.push(F)),f&&f(F,T)}),v&&v(T),T}function $v(p){if(!p)return null;var _;if(Array.isArray(p))_={checkedKeys:p,halfCheckedKeys:void 0};else if(mg(p)==="object")_={checkedKeys:p.checked||void 0,halfCheckedKeys:p.halfChecked||void 0};else return kh(!1,"`checkedKeys` is not an array or an object"),null;return _.checkedKeys=o0(_.checkedKeys),_.halfCheckedKeys=o0(_.halfCheckedKeys),_}function s0(p,_,l){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},v={},w={};(f.checkedKeys||[]).forEach(function(L){v[L]=!0}),(f.halfCheckedKeys||[]).forEach(function(L){w[L]=!0});function b(L){if(v[L]!==_){var O=l[L];if(O){var V=O.children,F=O.parent,Z=O.node;if(!gh(Z)){var G=!0,Q=!1;(V||[]).filter(function(ne){return!gh(ne.node)}).forEach(function(ne){var ee=ne.key,oe=v[ee],re=w[ee];(oe||re)&&(Q=!0),oe||(G=!1)}),_?v[L]=G:v[L]=!1,w[L]=Q,F&&b(F.key)}}}}function T(L){if(v[L]!==_){var O=l[L];if(O){var V=O.children,F=O.node;gh(F)||(v[L]=_,(V||[]).forEach(function(Z){T(Z.key)}))}}}function P(L){var O=l[L];if(!O){kh(!1,"'".concat(L,"' does not exist in the tree."));return}var V=O.children,F=O.parent,Z=O.node;v[L]=_,!gh(Z)&&((V||[]).filter(function(G){return!gh(G.node)}).forEach(function(G){T(G.key)}),F&&b(F.key))}(p||[]).forEach(function(L){P(L)});var B=[],y=[];return Object.keys(v).forEach(function(L){v[L]&&B.push(L)}),Object.keys(w).forEach(function(L){!v[L]&&w[L]&&y.push(L)}),{checkedKeys:B,halfCheckedKeys:y}}function a0(p,_){var l={};function f(v){if(!l[v]){var w=_[v];if(w){l[v]=!0;var b=w.parent,T=w.node;T.props&&T.props.disabled||b&&f(b.key)}}}return(p||[]).forEach(function(v){f(v)}),Object.keys(l)}function by(p){return Object.keys(p).reduce(function(_,l){return(l.substr(0,5)==="data-"||l.substr(0,5)==="aria-")&&(_[l]=p[l]),_},{})}function bg(p){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?bg=function(l){return typeof l}:bg=function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},bg(p)}function BS(p,_,l){return _ in p?Object.defineProperty(p,_,{value:l,enumerable:!0,configurable:!0,writable:!0}):p[_]=l,p}function FS(p,_){if(!(p instanceof _))throw new TypeError("Cannot call a class as a function")}function l0(p,_){for(var l=0;l<_.length;l++){var f=_[l];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(p,f.key,f)}}function VS(p,_,l){return _&&l0(p.prototype,_),l&&l0(p,l),p}function $S(p,_){return _&&(bg(_)==="object"||typeof _=="function")?_:HS(p)}function HS(p){if(p===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p}function d_(p){return d_=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},d_(p)}function US(p,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(_&&_.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),_&&u_(p,_)}function u_(p,_){return u_=Object.setPrototypeOf||function(f,v){return f.__proto__=v,f},u_(p,_)}var $g=function(p){US(_,p);function _(){var l;return FS(this,_),l=$S(this,d_(_).apply(this,arguments)),l.domTreeNodes={},l.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeNode:[],prevProps:null},l.onNodeDragStart=function(f,v){var w=l.state.expandedKeys,b=l.props.onDragStart,T=v.props,P=T.eventKey,B=T.children;l.dragNode=v,l.setState({dragNodesKeys:jS(B,v),expandedKeys:rd(w,P)}),b&&b({event:f,node:v})},l.onNodeDragEnter=function(f,v){var w=l.state.expandedKeys,b=l.props.onDragEnter,T=v.props,P=T.pos,B=T.eventKey;if(l.dragNode){var y=i0(f,v);if(l.dragNode.props.eventKey===B&&y===0){l.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){l.setState({dragOverNodeKey:B,dropPosition:y}),l.delayedDragEnterLogic||(l.delayedDragEnterLogic={}),Object.keys(l.delayedDragEnterLogic).forEach(function(L){clearTimeout(l.delayedDragEnterLogic[L])}),l.delayedDragEnterLogic[P]=window.setTimeout(function(){var L=od(w,B);"expandedKeys"in l.props||l.setState({expandedKeys:L}),b&&b({event:f,node:v,expandedKeys:L})},400)},0)}},l.onNodeDragOver=function(f,v){var w=l.props.onDragOver,b=v.props.eventKey;if(l.dragNode&&b===l.state.dragOverNodeKey){var T=i0(f,v);if(T===l.state.dropPosition)return;l.setState({dropPosition:T})}w&&w({event:f,node:v})},l.onNodeDragLeave=function(f,v){var w=l.props.onDragLeave;l.setState({dragOverNodeKey:""}),w&&w({event:f,node:v})},l.onNodeDragEnd=function(f,v){var w=l.props.onDragEnd;l.setState({dragOverNodeKey:""}),w&&w({event:f,node:v}),l.dragNode=null},l.onNodeDrop=function(f,v){var w=l.state,b=w.dragNodesKeys,T=b===void 0?[]:b,P=w.dropPosition,B=l.props.onDrop,y=v.props,L=y.eventKey,O=y.pos;if(l.setState({dragOverNodeKey:""}),T.indexOf(L)!==-1){kh(!1,"Can not drop to dragNode(include it's children node)");return}var V=RS(O),F={event:f,node:v,dragNode:l.dragNode,dragNodesKeys:T.slice(),dropPosition:P+Number(V[V.length-1]),dropToGap:!1};P!==0&&(F.dropToGap=!0),B&&B(F),l.dragNode=null},l.onNodeClick=function(f,v){var w=l.props.onClick;w&&w(f,v)},l.onNodeDoubleClick=function(f,v){var w=l.props.onDoubleClick;w&&w(f,v)},l.onNodeSelect=function(f,v){var w=l.state.selectedKeys,b=l.state.keyEntities,T=l.props,P=T.onSelect,B=T.multiple,y=v.props,L=y.selected,O=y.eventKey,V=!L;V?B?w=od(w,O):w=[O]:w=rd(w,O);var F=w.map(function(Z){var G=b[Z];return G?G.node:null}).filter(function(Z){return Z});l.setUncontrolledState({selectedKeys:w}),P&&P(w,{event:"select",selected:V,node:v,selectedNodes:F,nativeEvent:f.nativeEvent})},l.onNodeCheck=function(f,v,w){var b=l.state,T=b.keyEntities,P=b.checkedKeys,B=b.halfCheckedKeys,y=l.props,L=y.checkStrictly,O=y.onCheck,V=v.props.eventKey,F,Z={event:"check",node:v,checked:w,nativeEvent:f.nativeEvent};if(L){var G=w?od(P,V):rd(P,V),Q=rd(B,V);F={checked:G,halfChecked:Q},Z.checkedNodes=G.map(function(re){return T[re]}).filter(function(re){return re}).map(function(re){return re.node}),l.setUncontrolledState({checkedKeys:G})}else{var ne=s0([V],w,T,{checkedKeys:P,halfCheckedKeys:B}),ee=ne.checkedKeys,oe=ne.halfCheckedKeys;F=ee,Z.checkedNodes=[],Z.checkedNodesPositions=[],Z.halfCheckedKeys=oe,ee.forEach(function(re){var be=T[re];if(be){var we=be.node,Ae=be.pos;Z.checkedNodes.push(we),Z.checkedNodesPositions.push({node:we,pos:Ae})}}),l.setUncontrolledState({checkedKeys:ee,halfCheckedKeys:oe})}O&&O(F,Z)},l.onNodeLoad=function(f){return new Promise(function(v){l.setState(function(w){var b=w.loadedKeys,T=b===void 0?[]:b,P=w.loadingKeys,B=P===void 0?[]:P,y=l.props,L=y.loadData,O=y.onLoad,V=f.props.eventKey;if(!L||T.indexOf(V)!==-1||B.indexOf(V)!==-1)return{};var F=L(f);return F.then(function(){var Z=l.state,G=Z.loadedKeys,Q=Z.loadingKeys,ne=od(G,V),ee=rd(Q,V);O&&O(ne,{event:"load",node:f}),l.setUncontrolledState({loadedKeys:ne}),l.setState({loadingKeys:ee}),v()}),{loadingKeys:od(B,V)}})})},l.onNodeExpand=function(f,v){var w=l.state.expandedKeys,b=l.props,T=b.onExpand,P=b.loadData,B=v.props,y=B.eventKey,L=B.expanded,O=w.indexOf(y),V=!L;if(kh(L&&O!==-1||!L&&O===-1,"Expand state not sync with index check"),V?w=od(w,y):w=rd(w,y),l.setUncontrolledState({expandedKeys:w}),T&&T(w,{node:v,expanded:V,nativeEvent:f.nativeEvent}),V&&P){var F=l.onNodeLoad(v);return F?F.then(function(){l.setUncontrolledState({expandedKeys:w})}):null}return null},l.onNodeMouseEnter=function(f,v){var w=l.props.onMouseEnter;w&&w({event:f,node:v})},l.onNodeMouseLeave=function(f,v){var w=l.props.onMouseLeave;w&&w({event:f,node:v})},l.onNodeContextMenu=function(f,v){var w=l.props.onRightClick;w&&(f.preventDefault(),w({event:f,node:v}))},l.setUncontrolledState=function(f){var v=!1,w={};Object.keys(f).forEach(function(b){b in l.props||(v=!0,w[b]=f[b])}),v&&l.setState(w)},l.registerTreeNode=function(f,v){v?l.domTreeNodes[f]=v:delete l.domTreeNodes[f]},l.isKeyChecked=function(f){var v=l.state.checkedKeys,w=v===void 0?[]:v;return w.indexOf(f)!==-1},l.renderTreeNode=function(f,v){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,b=l.state,T=b.keyEntities,P=b.expandedKeys,B=P===void 0?[]:P,y=b.selectedKeys,L=y===void 0?[]:y,O=b.halfCheckedKeys,V=O===void 0?[]:O,F=b.loadedKeys,Z=F===void 0?[]:F,G=b.loadingKeys,Q=G===void 0?[]:G,ne=b.dragOverNodeKey,ee=b.dropPosition,oe=hy(w,v),re=f.key||oe;return T[re]?X.cloneElement(f,{key:re,eventKey:re,expanded:B.indexOf(re)!==-1,selected:L.indexOf(re)!==-1,loaded:Z.indexOf(re)!==-1,loading:Q.indexOf(re)!==-1,checked:l.isKeyChecked(re),halfChecked:V.indexOf(re)!==-1,pos:oe,dragOver:ne===re&&ee===0,dragOverGapTop:ne===re&&ee===-1,dragOverGapBottom:ne===re&&ee===1}):(uy(),null)},l}return VS(_,[{key:"render",value:function(){var f=this,v=this.state.treeNode,w=this.props,b=w.prefixCls,T=w.className,P=w.focusable,B=w.style,y=w.showLine,L=w.tabIndex,O=L===void 0?0:L,V=w.selectable,F=w.showIcon,Z=w.icon,G=w.switcherIcon,Q=w.draggable,ne=w.checkable,ee=w.checkStrictly,oe=w.disabled,re=w.motion,be=w.loadData,we=w.filterTreeNode,Ae=by(this.props);return P&&(Ae.tabIndex=O),X.createElement(O0.Provider,{value:{prefixCls:b,selectable:V,showIcon:F,icon:Z,switcherIcon:G,draggable:Q,checkable:ne,checkStrictly:ee,disabled:oe,motion:re,loadData:be,filterTreeNode:we,renderTreeNode:this.renderTreeNode,isKeyChecked:this.isKeyChecked,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop,registerTreeNode:this.registerTreeNode}},X.createElement("ul",Object.assign({},Ae,{className:Br(b,T,BS({},"".concat(b,"-show-line"),y)),style:B,role:"tree",unselectable:"on"}),gy(v,function(Ee,Ne){return f.renderTreeNode(Ee,Ne)})))}}],[{key:"getDerivedStateFromProps",value:function(f,v){var w=v.prevProps,b={prevProps:f};function T(ne){return!w&&ne in f||w&&w[ne]!==f[ne]}var P=null;if(T("treeData")?P=my(f.treeData):T("children")&&(P=ld(f.children)),P){b.treeNode=P;var B=zS(P);b.keyEntities=B.keyEntities}var y=b.keyEntities||v.keyEntities;if(T("expandedKeys")||w&&T("autoExpandParent")?b.expandedKeys=f.autoExpandParent||!w&&f.defaultExpandParent?a0(f.expandedKeys,y):f.expandedKeys:!w&&f.defaultExpandAll?b.expandedKeys=Object.keys(y):!w&&f.defaultExpandedKeys&&(b.expandedKeys=f.autoExpandParent||f.defaultExpandParent?a0(f.defaultExpandedKeys,y):f.defaultExpandedKeys),f.selectable&&(T("selectedKeys")?b.selectedKeys=r0(f.selectedKeys,f):!w&&f.defaultSelectedKeys&&(b.selectedKeys=r0(f.defaultSelectedKeys,f))),f.checkable){var L;if(T("checkedKeys")?L=$v(f.checkedKeys)||{}:!w&&f.defaultCheckedKeys?L=$v(f.defaultCheckedKeys)||{}:P&&(L=$v(f.checkedKeys)||{checkedKeys:v.checkedKeys,halfCheckedKeys:v.halfCheckedKeys}),L){var O=L,V=O.checkedKeys,F=V===void 0?[]:V,Z=O.halfCheckedKeys,G=Z===void 0?[]:Z;if(!f.checkStrictly){var Q=s0(F,!0,y);F=Q.checkedKeys,G=Q.halfCheckedKeys}b.checkedKeys=F,b.halfCheckedKeys=G}}return T("loadedKeys")&&(b.loadedKeys=f.loadedKeys),b}}]),_}(X.Component);$g.propTypes={prefixCls:le.string,className:le.string,style:le.object,tabIndex:le.oneOfType([le.string,le.number]),children:le.any,treeData:le.array,showLine:le.bool,showIcon:le.bool,icon:le.oneOfType([le.node,le.func]),focusable:le.bool,selectable:le.bool,disabled:le.bool,multiple:le.bool,checkable:le.oneOfType([le.bool,le.node]),checkStrictly:le.bool,draggable:le.bool,defaultExpandParent:le.bool,autoExpandParent:le.bool,defaultExpandAll:le.bool,defaultExpandedKeys:le.arrayOf(le.string),expandedKeys:le.arrayOf(le.string),defaultCheckedKeys:le.arrayOf(le.string),checkedKeys:le.oneOfType([le.arrayOf(le.oneOfType([le.string,le.number])),le.object]),defaultSelectedKeys:le.arrayOf(le.string),selectedKeys:le.arrayOf(le.string),onClick:le.func,onDoubleClick:le.func,onExpand:le.func,onCheck:le.func,onSelect:le.func,onLoad:le.func,loadData:le.func,loadedKeys:le.arrayOf(le.string),onMouseEnter:le.func,onMouseLeave:le.func,onRightClick:le.func,onDragStart:le.func,onDragEnter:le.func,onDragOver:le.func,onDragLeave:le.func,onDragEnd:le.func,onDrop:le.func,filterTreeNode:le.func,motion:le.object,switcherIcon:le.oneOfType([le.node,le.func])};$g.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]};__($g);var vy=$g;vy.TreeNode=Vg;const WS=vy;const TP=Bt.MaLoaiDonVi==="SoLaoDong",qS=Bt.MaLoaiDonVi==="UBMT",_y=Bt.MaLoaiDonVi==="PhuongXa",KS=Bt.MaLoaiDonVi==="QuanHuyen",GS=Bt.MaLoaiDonVi==="UBNDHuyen";Bt.MaLoaiDonVi;Bt.MaLoaiDonVi;Bt.MaQuanHuyen;Bt.MaLoaiDonVi;Bt.CoSoGDNN_Id;Bt.MaLoaiDonVi;Bt.TaiKhoanQuanTri;Bt.IDDonVi;Bt.CoSoGDNN_Id;const Hv=f_.span` cursor: pointer; &#add { color: #28a745; } &#update { color: #20a8d8; } &#delete { color: #dc3545; } &:hover { &#add { color: #1d8234; text-decoration: underline; } &#update { color: #1a7696; text-decoration: underline; } &#delete { color: #a22020; text-decoration: underline; } } `,c0={Name:{field_name:"Name",title:"Tên",type:"textbox",required:!0},MaKiHieu:{field_name:"MaKiHieu",title:"Mã kí hiệu",type:"textbox"}},QS=f_(Vg)` .rc-tree-node-content-wrapper { white-space: nowrap; width: 780px; overflow: hidden; text-overflow: ellipsis; } `;function YS(p){const{dataSelect:_,valueDisplay:l,onClickButton:f,onCallback:v,Id:w,EndPoint_Tree:b,EndPoint_Odata:T,isDieu18:P}=p,{placeholder:B}=_,[y,L]=X.useState(!1),[O,V]=X.useState([]),[F,Z]=X.useState({value:null,label:""}),[G,Q]=X.useState(!1),[ne,ee]=X.useState(!1),[oe,re]=X.useState(!0),[be,we]=X.useState(!0),[Ae,Ee]=X.useState(!0),[Ne,ie]=X.useState(!0),[fe,_e]=X.useState([]),[ve,ke]=X.useState({}),[Se,Pe]=X.useState({valueFake:null,labelFake:"",isFake:!0}),[Oe,nt]=X.useState({});X.useEffect(()=>nt({label:l}),[l]),X.useEffect(()=>{w&&Z(xe=>({...xe,value:[`${w}`]}))},[w]);const $e=X.useCallback(()=>{zn(b,"GET",null,{odata:!1}).then(Fe=>V(Fe)).catch(Fe=>_g("Không thể tải dữ liệu danh mục nội dung","Thông báo"))},[b]);X.useEffect(()=>{$e()},[$e]);const De=X.useCallback(xe=>{f&&f(),y?!w&&!xe.isValue&&(Z({}),re(!0),we(!0),Ee(!0)):(V(O),_e([])),L(!y)},[w,O,y,f]),et=X.useMemo(()=>{const{label:xe}=Oe;return A.jsxs(S0,{children:[A.jsx(qv,{readOnly:!0,placeholder:B,value:xe||""}),A.jsx(Bn,{color:"primary",onClick:De,children:"Chọn"})]})},[De,Oe,B]),Ie=X.useCallback((xe,Fe)=>{const{node:{props:{title:St,isChildren:Et}}}=Fe;xe.length!==0&&(ee(Fe.selected),re(!Fe.selected),we(!Fe.selected),Ee(!Fe.selected),Z({value:xe,label:xe.length?St:""}),Pe({isFake:!1}),ie(Et))},[]),He=X.useCallback(()=>{nt({value:F.value[0],label:F.label}),v({value:F.value[0],label:F.label}),De({isValue:F.value[0]})},[De,v,F]),Ve=X.useCallback(xe=>{xe&&zn(`${T}(${xe})`).then(Fe=>ke(Fe))},[T]),Re=X.useCallback(()=>{Q(!1),ke({}),Pe({})},[]),gt=X.useCallback(xe=>{mx("Bạn có muốn xóa nguồn vốn này không").then(Fe=>{Fe&&Fe.isConfirmed&&zn(`${T}(${xe})`,"DELETE",null).then(()=>{$e(),_h("Xóa thành công","Thông báo"),Re(),v({})})})},[T,$e,Re,v]);X.useCallback(xe=>{const Fe=Bt.IDDonVi==="bccb8adf-7788-4ddc-9376-640a7f90cd29";return A.jsxs(X.Fragment,{children:[A.jsx("span",{children:xe.title}),A.jsx("span",{children:Fe&&GS&&A.jsxs(A.Fragment,{children:[A.jsxs(Hv,{id:"add",onClick:()=>{Q("addChildren"),Pe(St=>({...St,valueFake:xe.key,labelFake:xe.title,isFake:!0}))},className:"ms-3",children:[A.jsx(Fn,{fa:"plus-circle"}),A.jsx("span",{className:"ms-1",children:"Thêm danh mục con"})]}),A.jsxs(Hv,{id:"update",onClick:()=>{Q("update"),Pe(St=>({...St,valueFake:xe.key,labelFake:xe.title,isFake:!0})),Ve(xe.key)},className:"ms-3",children:[A.jsx(Fn,{fa:"pencil-square-o"}),A.jsx("span",{className:"ms-1",children:"Cập nhật"})]}),xe.children.length===0&&A.jsxs(Hv,{id:"delete",onClick:()=>{gt(xe.key)},className:"ms-2",children:[A.jsx(Fn,{fa:"times"}),A.jsx("span",{className:"ms-1",children:"Xóa"})]})]})})]})},[Ve,gt]);const rt=X.useCallback(xe=>xe.map(Fe=>Fe.children&&Fe.children.length?A.jsx(Vg,{className:"parent",isChildren:!0,title:Fe.title,children:rt(Fe.children)},Fe.key):A.jsx(QS,{className:"children",isChildren:!1,title:Fe.title},Fe.key)),[]),qe=X.useCallback(xe=>{let Fe=document.getElementById("value").value;xe.type==="click"&&zn(`Dieu18Ext/GetTree_NguonVon?search=${Fe}`,"GET",null,{odata:!1}).then(St=>{_e(St)}),xe.key==="Enter"||xe.type==="click"?xe.target.value?zn(`Dieu18Ext/GetTree_NguonVon?search=${xe.target.value}`,"GET",null,{odata:!1}).then(St=>{_e(St)}):_e(O):xe.target.value||_e(O)},[O]),lt=X.useMemo(()=>{const{value:xe}=F;Bt.IDDonVi;let Fe=fe.length===0?O:fe;return A.jsxs(kl,{size:"xl",isOpen:y,toggle:De,zIndex:1301,children:[A.jsx(lk,{className:"align-items-center pb-0",style:{borderBottom:"none"},children:A.jsx("span",{children:"Thêm mới"})}),A.jsx(ck,{children:A.jsxs("div",{className:"module-tree h-100",children:[A.jsx("div",{className:"module-tree-header",style:{border:"1px solid #ccc"},children:A.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[A.jsx(A.Fragment,{children:A.jsxs("div",{children:[A.jsx(Bn,{disabled:oe,onClick:()=>Q("addChildren"),children:"Thêm danh mục con"}),A.jsx(Bn,{disabled:be,onClick:()=>{Q("update"),Ve(xe[0])},children:"Cập nhật"}),A.jsx(Bn,{disabled:Ae,onClick:()=>gt(xe[0]),style:{color:"red"},children:"Xóa"})]})}),A.jsx("div",{className:"me-1",children:A.jsxs(Bn,{onClick:He,disabled:!xe||!xe.length||Ne,size:"sm",color:"primary",children:[A.jsx(Fn,{fa:"save"}),A.jsx("span",{className:"ms-1",children:"Chọn"})]})})]})}),A.jsxs("div",{className:"module-tree-body pt-2 pb-2",style:{overflow:"auto",border:"1px solid #ccc",borderTop:0,height:"calc(100vh - 170px)"},children:[A.jsxs("div",{className:"pl-2 pr-2 d-flex align-items-center",children:[A.jsx(qv,{onKeyPress:qe,onChange:qe,placeholder:"Tìm tên nguồn vốn...",id:"value"}),A.jsx(XS,{onClick:St=>qe(St),className:"w-25",children:"Tìm kiếm"})]}),A.jsx(WS,{className:"myCls",showLine:!0,selectedKeys:xe,onSelect:Ie,defaultExpandAll:!!w,defaultExpandedKeys:P&&["A","B"],children:rt(Fe)})]})]})})]})},[F,fe,O,y,De,oe,be,Ae,He,Ne,qe,Ie,w,P,rt,Ve,gt]),Ye=X.useCallback((xe,Fe)=>{ke(St=>({...St,[xe]:Fe}))},[]),en=X.useCallback((xe,Fe)=>{const{Name:St,MaKiHieu:Et}=ve;if(St&&Et){let hn=Fe&&xe==="update"?`${T}(${Fe})`:T,Yn=Fe&&xe==="update"?"PATCH":"POST",Sn=Fe&&xe==="update"?"Cập nhật":"Thêm mới",rn={...ve,IsDM:!0};Fe&&xe==="addChildren"&&(rn={...rn,Parent_Id:Fe,Created_By:Bt.MaTaiKhoan}),!Fe&&xe==="add"&&(rn={...rn,IsFixed:!0}),Fe&&xe==="update"&&(rn={Name:ve.Name,MaKiHieu:ve.MaKiHieu}),zn(hn,Yn,JSON.stringify(rn),!0).then(Bi=>{$e(),_h(`${Sn} thành công`,"Thông báo"),Re()}).catch(Bi=>_g(`${Sn} không thành công`,"Thông báo"))}else wh("Vui lòng nhập đầy đủ vào thông tin có dấu sao đỏ")},[T,ve,$e,Re]),Vn=X.useMemo(()=>{const{valueFake:xe,labelFake:Fe,isFake:St}=Se,Et=G,hn=St?xe:F&&F.value&&F.value.length?F.value[0]:null,Yn=St?Fe:F?F.label:"";return A.jsxs(kl,{isOpen:!!G,toggle:()=>Re(),size:"lg",zIndex:"1302",children:[A.jsx(lk,{children:A.jsx("b",{children:hn?"Cập nhật danh mục":"Thêm mới danh mục"})}),A.jsxs(ck,{children:[hn&&Et==="addChildren"&&A.jsxs("h5",{children:['Thuộc danh mục "',Yn,'"']}),A.jsx(zi,{data:c0.Name,value:ve.Name,onChange:Ye}),A.jsx(zi,{data:c0.MaKiHieu,value:ve.MaKiHieu,onChange:Ye})]}),A.jsxs(Ch,{children:[A.jsx(wx,{onClick:()=>en(Et,hn),children:"Lưu"})," ",A.jsx(Bn,{onClick:Re,children:"Hủy"})]})]})},[G,F,ve,Ye,Re,en,Se]);return A.jsxs(X.Fragment,{children:[et,lt,Vn]})}const XS=f_.span` text-align: center; border: 1px solid #ccc; height: 35px; line-height: 32px; background: #ccc; border-radius: 3px; margin-left: 10px; font-weight: bold; cursor: pointer; `;var Qt=function(){return Qt=Object.assign||function(_){for(var l,f=1,v=arguments.length;f<v;f++){l=arguments[f];for(var w in l)Object.prototype.hasOwnProperty.call(l,w)&&(_[w]=l[w])}return _},Qt.apply(this,arguments)};function JS(p,_){var l={};for(var f in p)Object.prototype.hasOwnProperty.call(p,f)&&_.indexOf(f)<0&&(l[f]=p[f]);if(p!=null&&typeof Object.getOwnPropertySymbols=="function")for(var v=0,f=Object.getOwnPropertySymbols(p);v<f.length;v++)_.indexOf(f[v])<0&&Object.prototype.propertyIsEnumerable.call(p,f[v])&&(l[f[v]]=p[f[v]]);return l}function cr(p,_,l){if(l||arguments.length===2)for(var f=0,v=_.length,w;f<v;f++)(w||!(f in _))&&(w||(w=Array.prototype.slice.call(_,0,f)),w[f]=_[f]);return p.concat(w||Array.prototype.slice.call(_))}var Bo=function(p){return p.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},ZS={k:1e3,m:1e6,b:1e9},eE=function(p,_){_===void 0&&(_=".");var l=new RegExp("(\\d+(".concat(Bo(_),"\\d*)?)([kmb])$"),"i"),f=p.match(l);if(f){var v=f[1],w=f[3],b=ZS[w.toLowerCase()];return Number(v.replace(_,"."))*b}},tE=function(p,_){_===void 0&&(_=",");var l=new RegExp(Bo(_),"g");return p.replace(l,"")},nE=function(p,_){var l=Bo(_.join("")),f=new RegExp("[^\\d".concat(l,"]"),"gi");return p.replace(f,"")},Uv=function(p){var _=p.value,l=p.groupSeparator,f=l===void 0?",":l,v=p.decimalSeparator,w=v===void 0?".":v,b=p.allowDecimals,T=b===void 0?!0:b,P=p.decimalsLimit,B=P===void 0?2:P,y=p.allowNegativeValue,L=y===void 0?!0:y,O=p.disableAbbreviations,V=O===void 0?!1:O,F=p.prefix,Z=F===void 0?"":F,G=p.transformRawValue,Q=G===void 0?function($e){return $e}:G,ne=Q(_);if(ne==="-")return ne;var ee=V?[]:["k","m","b"],oe=new RegExp("((^|\\D)-\\d)|(-".concat(Bo(Z),")")),re=oe.test(ne),be=RegExp("(\\d+)-?".concat(Bo(Z))).exec(_)||[],we=be[0],Ae=be[1],Ee=Z?we?ne.replace(we,"").concat(Ae):ne.replace(Z,""):ne,Ne=tE(Ee,f),ie=nE(Ne,cr([f,w],ee,!0)),fe=ie;if(!V){if(ee.some(function($e){return $e===ie.toLowerCase().replace(w,"")}))return"";var _e=eE(ie,w);_e&&(fe=String(_e))}var ve=re&&L?"-":"";if(w&&fe.includes(w)){var ke=ie.split(w),Se=ke[0],Pe=ke[1],Oe=B&&Pe?Pe.slice(0,B):Pe,nt=T?"".concat(w).concat(Oe):"";return"".concat(ve).concat(Se).concat(nt)}return"".concat(ve).concat(fe)},iE=function(p,_,l){if(l!==void 0&&p.length>1){if(l===0)return p.replace(_,"");if(p.includes(_)){var f=p.split(_),v=f[0],w=f[1];if(w.length===l)return p;if(w.length>l)return"".concat(v).concat(_).concat(w.slice(0,l))}var b=p.length>l?new RegExp("(\\d+)(\\d{".concat(l,"})")):new RegExp("(\\d)(\\d+)"),T=p.match(b);if(T){var v=T[1],w=T[2];return"".concat(v).concat(_).concat(w)}}return p},wy=function(p,_){var l=_.groupSeparator,f=l===void 0?",":l,v=_.decimalSeparator,w=v===void 0?".":v,b=new RegExp("\\d([^".concat(Bo(f)).concat(Bo(w),"0-9]+)")),T=p.match(b);return T?T[1]:void 0},mh=function(p){var _=p.value,l=p.decimalSeparator,f=p.intlConfig,v=p.decimalScale,w=p.prefix,b=w===void 0?"":w,T=p.suffix,P=T===void 0?"":T;if(_===""||_===void 0)return"";if(_==="-")return"-";var B=new RegExp("^\\d?-".concat(b?"".concat(Bo(b),"?"):"","\\d")).test(_),y=l!=="."?rE(_,l,B):_;l&&l!=="-"&&y.startsWith(l)&&(y="0"+y);var L={minimumFractionDigits:v||0,maximumFractionDigits:20},O=f?new Intl.NumberFormat(f.locale,f.currency?Qt(Qt({},L),{style:"currency",currency:f.currency}):L):new Intl.NumberFormat(void 0,L),V=O.formatToParts(Number(y)),F=oE(V,p),Z=wy(F,Qt({},p)),G=_.slice(-1)===l?l:"",Q=y.match(RegExp("\\d+\\.(\\d+)"))||[],ne=Q[1];return v===void 0&&ne&&l&&(F.includes(l)?F=F.replace(RegExp("(\\d+)(".concat(Bo(l),")(\\d+)"),"g"),"$1$2".concat(ne)):Z&&!P?F=F.replace(Z,"".concat(l).concat(ne).concat(Z)):F="".concat(F).concat(l).concat(ne)),P&&G?"".concat(F).concat(G).concat(P):Z&&G?F.replace(Z,"".concat(G).concat(Z)):Z&&P?F.replace(Z,"".concat(G).concat(P)):[F,G,P].join("")},rE=function(p,_,l){var f=p;return _&&_!=="."&&(f=f.replace(RegExp(Bo(_),"g"),"."),l&&_==="-"&&(f="-".concat(f.slice(1)))),f},oE=function(p,_){var l=_.prefix,f=_.groupSeparator,v=_.decimalSeparator,w=_.decimalScale,b=_.disableGroupSeparators,T=b===void 0?!1:b;return p.reduce(function(P,B,y){var L=B.type,O=B.value;return y===0&&l?L==="minusSign"?[O,l]:L==="currency"?cr(cr([],P,!0),[l],!1):[l,O]:L==="currency"?l?P:cr(cr([],P,!0),[O],!1):L==="group"?T?P:cr(cr([],P,!0),[f!==void 0?f:O],!1):L==="decimal"?w!==void 0&&w===0?P:cr(cr([],P,!0),[v!==void 0?v:O],!1):L==="fraction"?cr(cr([],P,!0),[w!==void 0?O.slice(0,w):O],!1):cr(cr([],P,!0),[O],!1)},[""]).join("")},sE={currencySymbol:"",groupSeparator:"",decimalSeparator:"",prefix:"",suffix:""},aE=function(p){var _=p||{},l=_.locale,f=_.currency,v=l?new Intl.NumberFormat(l,f?{currency:f,style:"currency"}:void 0):new Intl.NumberFormat;return v.formatToParts(1000.1).reduce(function(w,b,T){return b.type==="currency"?T===0?Qt(Qt({},w),{currencySymbol:b.value,prefix:b.value}):Qt(Qt({},w),{currencySymbol:b.value,suffix:b.value}):b.type==="group"?Qt(Qt({},w),{groupSeparator:b.value}):b.type==="decimal"?Qt(Qt({},w),{decimalSeparator:b.value}):w},sE)},d0=function(p){return RegExp(/\d/,"gi").test(p)},lE=function(p,_,l){if(_===void 0&&(_="."),l===void 0||p===""||p===void 0)return p;if(!p.match(/\d/g))return"";var f=p.split(_),v=f[0],w=f[1];if(l===0)return v;var b=w||"";if(b.length<l)for(;b.length<l;)b+="0";else b=b.slice(0,l);return"".concat(v).concat(_).concat(b)},cE=function(p){var _=p.selectionStart,l=p.value,f=p.lastKeyStroke,v=p.stateValue,w=p.groupSeparator,b=_,T=l;if(v&&b){var P=l.split("");return f==="Backspace"&&v[b]===w&&(P.splice(b-1,1),b-=1),f==="Delete"&&v[b]===w&&(P.splice(b,1),b+=1),T=P.join(""),{modifiedValue:T,cursorPosition:b}}return{modifiedValue:T,cursorPosition:_}},ky=X.forwardRef(function(p,_){var l=p.allowDecimals,f=l===void 0?!0:l,v=p.allowNegativeValue,w=v===void 0?!0:v,b=p.id,T=p.name,P=p.className,B=p.customInput,y=p.decimalsLimit,L=p.defaultValue,O=p.disabled,V=O===void 0?!1:O,F=p.maxLength,Z=p.value,G=p.onValueChange,Q=p.fixedDecimalLength,ne=p.placeholder,ee=p.decimalScale,oe=p.prefix,re=p.suffix,be=p.intlConfig,we=p.step,Ae=p.min,Ee=p.max,Ne=p.disableGroupSeparators,ie=Ne===void 0?!1:Ne,fe=p.disableAbbreviations,_e=fe===void 0?!1:fe,ve=p.decimalSeparator,ke=p.groupSeparator,Se=p.onChange,Pe=p.onFocus,Oe=p.onBlur,nt=p.onKeyDown,$e=p.onKeyUp,De=p.transformRawValue,et=p.formatValueOnBlur,Ie=et===void 0?!0:et,He=JS(p,["allowDecimals","allowNegativeValue","id","name","className","customInput","decimalsLimit","defaultValue","disabled","maxLength","value","onValueChange","fixedDecimalLength","placeholder","decimalScale","prefix","suffix","intlConfig","step","min","max","disableGroupSeparators","disableAbbreviations","decimalSeparator","groupSeparator","onChange","onFocus","onBlur","onKeyDown","onKeyUp","transformRawValue","formatValueOnBlur"]);if(ve&&d0(ve))throw new Error("decimalSeparator cannot be a number");if(ke&&d0(ke))throw new Error("groupSeparator cannot be a number");var Ve=X.useMemo(function(){return aE(be)},[be]),Re=ve||Ve.decimalSeparator||"",gt=ke||Ve.groupSeparator||"";if(Re&>&&Re===gt&&ie===!1)throw new Error("decimalSeparator cannot be the same as groupSeparator");var rt={decimalSeparator:Re,groupSeparator:gt,disableGroupSeparators:ie,intlConfig:be,prefix:oe||Ve.prefix,suffix:re},qe={decimalSeparator:Re,groupSeparator:gt,allowDecimals:f,decimalsLimit:y||Q||2,allowNegativeValue:w,disableAbbreviations:_e,prefix:oe||Ve.prefix,transformRawValue:De},lt=X.useState(function(){return L!=null?mh(Qt(Qt({},rt),{decimalScale:ee,value:String(L)})):Z!=null?mh(Qt(Qt({},rt),{decimalScale:ee,value:String(Z)})):""}),Ye=lt[0],en=lt[1],Vn=X.useState(!1),xe=Vn[0],Fe=Vn[1],St=X.useState(0),Et=St[0],hn=St[1],Yn=X.useState(0),Sn=Yn[0],rn=Yn[1],Bi=X.useState(null),uo=Bi[0],ua=Bi[1],$n=X.useRef(null);X.useImperativeHandle(_,function(){return $n.current});var bs=function(Gt,an){Fe(!0);var ln=cE({selectionStart:an,value:Gt,lastKeyStroke:uo,stateValue:Ye,groupSeparator:gt}),kn=ln.modifiedValue,bn=ln.cursorPosition,Pt=Uv(Qt({value:kn},qe));if(!(F&&Pt.replace(/-/g,"").length>F)){if(Pt===""||Pt==="-"||Pt===Re){G&&G(void 0,T,{float:null,formatted:"",value:""}),en(Pt),hn(1);return}var ki=Re?Pt.replace(Re,"."):Pt,It=parseFloat(ki),yi=mh(Qt({value:Pt},rt));if(bn!=null){var oi=bn+(yi.length-Gt.length);oi=oi<=0?oe?oe.length:0:oi,hn(oi),rn(Sn+1)}if(en(yi),G){var si={float:It,formatted:yi,value:Pt};G(Pt,T,si)}}},ur=function(Gt){var an=Gt.target,ln=an.value,kn=an.selectionStart;bs(ln,kn),Se&&Se(Gt)},wi=function(Gt){return Pe&&Pe(Gt),Ye?Ye.length:0},ho=function(Gt){var an=Gt.target.value,ln=Uv(Qt({value:an},qe));if(ln==="-"||ln===Re||!ln){en(""),Oe&&Oe(Gt);return}var kn=iE(ln,Re,Q),bn=lE(kn,Re,ee!==void 0?ee:Q),Pt=parseFloat(bn.replace(Re,".")),ki=mh(Qt(Qt({},rt),{value:bn}));G&&Ie&&G(bn,T,{float:Pt,formatted:ki,value:bn}),en(ki),Oe&&Oe(Gt)},Gi=function(Gt){var an=Gt.key;if(ua(an),we&&(an==="ArrowUp"||an==="ArrowDown")){Gt.preventDefault(),hn(Ye.length);var ln=parseFloat(Z!=null?String(Z).replace(Re,"."):Uv(Qt({value:Ye},qe)))||0,kn=an==="ArrowUp"?ln+we:ln-we;if(Ae!==void 0&&kn<Number(Ae)||Ee!==void 0&&kn>Number(Ee))return;var bn=String(we).includes(".")?Number(String(we).split(".")[1].length):void 0;bs(String(bn?kn.toFixed(bn):kn).replace(".",Re))}nt&&nt(Gt)},fo=function(Gt){var an=Gt.key,ln=Gt.currentTarget.selectionStart;if(an!=="ArrowUp"&&an!=="ArrowDown"&&Ye!=="-"){var kn=wy(Ye,{groupSeparator:gt,decimalSeparator:Re});if(kn&&ln&&ln>Ye.length-kn.length&&$n.current){var bn=Ye.length-kn.length;$n.current.setSelectionRange(bn,bn)}}$e&&$e(Gt)};X.useEffect(function(){Z==null&&L==null&&en("")},[L,Z]),X.useEffect(function(){xe&&Ye!=="-"&&$n.current&&document.activeElement===$n.current&&$n.current.setSelectionRange(Et,Et)},[Ye,Et,$n,xe,Sn]);var po=function(){return Z!=null&&Ye!=="-"&&(!Re||Ye!==Re)?mh(Qt(Qt({},rt),{decimalScale:xe?void 0:ee,value:String(Z)})):Ye},go=Qt({type:"text",inputMode:"decimal",id:b,name:T,className:P,onChange:ur,onBlur:ho,onFocus:wi,onKeyDown:Gi,onKeyUp:fo,placeholder:ne,disabled:V,value:po(),ref:$n},He);if(B){var Yt=B;return dr.createElement(Yt,Qt({},go))}return dr.createElement("input",Qt({},go))});ky.displayName="CurrencyInput";var yy={},$_={},H_={},Hg={};(function(p){Object.defineProperty(p,"__esModule",{value:!0}),p.Direction=void 0,function(_){_.Right="to right",_.Left="to left",_.Down="to bottom",_.Up="to top"}(p.Direction||(p.Direction={}))})(Hg);(function(p){var _=nn&&nn.__spreadArray||function(ie,fe,_e){if(_e||arguments.length===2)for(var ve=0,ke=fe.length,Se;ve<ke;ve++)(Se||!(ve in fe))&&(Se||(Se=Array.prototype.slice.call(fe,0,ve)),Se[ve]=fe[ve]);return ie.concat(Se||Array.prototype.slice.call(fe))};Object.defineProperty(p,"__esModule",{value:!0}),p.useThumbOverlap=p.assertUnreachable=p.voidFn=p.getTrackBackground=p.replaceAt=p.schd=p.translate=p.getClosestThumbIndex=p.translateThumbs=p.getPaddingAndBorder=p.getMargin=p.checkInitialOverlap=p.checkValuesAgainstBoundaries=p.checkBoundaries=p.isVertical=p.relativeValue=p.normalizeValue=p.isStepDivisible=p.isTouchEvent=p.getStepDecimals=void 0;var l=X,f=Hg,v=function(ie){var fe=ie.toString().split(".")[1];return fe?fe.length:0};p.getStepDecimals=v;function w(ie){return ie.touches&&ie.touches.length||ie.changedTouches&&ie.changedTouches.length}p.isTouchEvent=w;function b(ie,fe,_e){var ve=(fe-ie)/_e,ke=8,Se=Number(ve.toFixed(ke));return parseInt(Se.toString(),10)===Se}p.isStepDivisible=b;function T(ie,fe,_e,ve,ke,Se,Pe){var Oe=1e11;if(ie=Math.round(ie*Oe)/Oe,!Se){var nt=Pe[fe-1],$e=Pe[fe+1];if(nt&&nt>ie)return nt;if($e&&$e<ie)return $e}if(ie>ve)return ve;if(ie<_e)return _e;var De=Math.floor(ie*Oe-_e*Oe)%Math.floor(ke*Oe),et=Math.floor(ie*Oe-Math.abs(De)),Ie=De===0?ie:et/Oe,He=Math.abs(De/Oe)<ke/2?Ie:Ie+ke,Ve=(0,p.getStepDecimals)(ke);return parseFloat(He.toFixed(Ve))}p.normalizeValue=T;function P(ie,fe,_e){return(ie-fe)/(_e-fe)}p.relativeValue=P;function B(ie){return ie===f.Direction.Up||ie===f.Direction.Down}p.isVertical=B;function y(ie,fe,_e){if(fe>=_e)throw new RangeError("min (".concat(fe,") is equal/bigger than max (").concat(_e,")"));if(ie<fe)throw new RangeError("value (".concat(ie,") is smaller than min (").concat(fe,")"));if(ie>_e)throw new RangeError("value (".concat(ie,") is bigger than max (").concat(_e,")"))}p.checkBoundaries=y;function L(ie,fe,_e){return ie<fe?fe:ie>_e?_e:ie}p.checkValuesAgainstBoundaries=L;function O(ie){if(!(ie.length<2)&&!ie.slice(1).every(function(fe,_e){return ie[_e]<=fe}))throw new RangeError("values={[".concat(ie,"]} needs to be sorted when allowOverlap={false}"))}p.checkInitialOverlap=O;function V(ie){var fe=window.getComputedStyle(ie);return{top:parseInt(fe["margin-top"],10),bottom:parseInt(fe["margin-bottom"],10),left:parseInt(fe["margin-left"],10),right:parseInt(fe["margin-right"],10)}}p.getMargin=V;function F(ie){var fe=window.getComputedStyle(ie);return{top:parseInt(fe["padding-top"],10)+parseInt(fe["border-top-width"],10),bottom:parseInt(fe["padding-bottom"],10)+parseInt(fe["border-bottom-width"],10),left:parseInt(fe["padding-left"],10)+parseInt(fe["border-left-width"],10),right:parseInt(fe["padding-right"],10)+parseInt(fe["border-right-width"],10)}}p.getPaddingAndBorder=F;function Z(ie,fe,_e){var ve=_e?-1:1;ie.forEach(function(ke,Se){return Q(ke,ve*fe[Se].x,fe[Se].y)})}p.translateThumbs=Z;function G(ie,fe,_e,ve){for(var ke=0,Se=Ne(ie[0],fe,_e,ve),Pe=1;Pe<ie.length;Pe++){var Oe=Ne(ie[Pe],fe,_e,ve);Oe<Se&&(Se=Oe,ke=Pe)}return ke}p.getClosestThumbIndex=G;function Q(ie,fe,_e){ie.style.transform="translate(".concat(fe,"px, ").concat(_e,"px)")}p.translate=Q;var ne=function(ie){var fe=[],_e=null,ve=function(){for(var ke=[],Se=0;Se<arguments.length;Se++)ke[Se]=arguments[Se];fe=ke,!_e&&(_e=requestAnimationFrame(function(){_e=null,ie.apply(void 0,fe)}))};return ve};p.schd=ne;function ee(ie,fe,_e){var ve=ie.slice(0);return ve[fe]=_e,ve}p.replaceAt=ee;function oe(ie){var fe=ie.values,_e=ie.colors,ve=ie.min,ke=ie.max,Se=ie.direction,Pe=Se===void 0?f.Direction.Right:Se,Oe=ie.rtl,nt=Oe===void 0?!1:Oe;nt&&Pe===f.Direction.Right?Pe=f.Direction.Left:nt&&f.Direction.Left&&(Pe=f.Direction.Right);var $e=fe.slice(0).sort(function(et,Ie){return et-Ie}).map(function(et){return(et-ve)/(ke-ve)*100}),De=$e.reduce(function(et,Ie,He){return"".concat(et,", ").concat(_e[He]," ").concat(Ie,"%, ").concat(_e[He+1]," ").concat(Ie,"%")},"");return"linear-gradient(".concat(Pe,", ").concat(_e[0]," 0%").concat(De,", ").concat(_e[_e.length-1]," 100%)")}p.getTrackBackground=oe;function re(){}p.voidFn=re;function be(ie){throw new Error("Didn't expect to get here")}p.assertUnreachable=be;var we=function(ie,fe,_e,ve,ke){ke===void 0&&(ke=function(Pe){return Pe});var Se=Math.ceil(_([ie],Array.from(ie.children),!0).reduce(function(Pe,Oe){var nt=Math.ceil(Oe.getBoundingClientRect().width);if(Oe.innerText&&Oe.innerText.includes(_e)&&Oe.childElementCount===0){var $e=Oe.cloneNode(!0);$e.innerHTML=ke(fe.toFixed(ve)),$e.style.visibility="hidden",document.body.appendChild($e),nt=Math.ceil($e.getBoundingClientRect().width),document.body.removeChild($e)}return nt>Pe?nt:Pe},ie.getBoundingClientRect().width));return Se},Ae=function(ie,fe,_e,ve,ke,Se,Pe){Pe===void 0&&(Pe=function($e){return $e});var Oe=[],nt=function($e){var De=we(_e[$e],ve[$e],ke,Se,Pe),et=fe[$e].x;fe.forEach(function(Ie,He){var Ve=Ie.x,Re=we(_e[He],ve[He],ke,Se,Pe);$e!==He&&(et>=Ve&&et<=Ve+Re||et+De>=Ve&&et+De<=Ve+Re)&&(Oe.includes(He)||(Oe.push($e),Oe.push(He),Oe=_(_([],Oe,!0),[$e,He],!1),nt(He)))})};return nt(ie),Array.from(new Set(Oe.sort()))},Ee=function(ie,fe,_e,ve,ke,Se){ve===void 0&&(ve=.1),ke===void 0&&(ke=" - "),Se===void 0&&(Se=function(He){return He});var Pe=(0,p.getStepDecimals)(ve),Oe=(0,l.useState)({}),nt=Oe[0],$e=Oe[1],De=(0,l.useState)(Se(fe[_e].toFixed(Pe))),et=De[0],Ie=De[1];return(0,l.useEffect)(function(){if(ie){var He=ie.getThumbs();if(He.length<1)return;var Ve={},Re=ie.getOffsets(),gt=Ae(_e,Re,He,fe,ke,Pe,Se),rt=Se(fe[_e].toFixed(Pe));if(gt.length){var qe=gt.reduce(function(xe,Fe,St,Et){return xe.length?_(_([],xe,!0),[Re[Et[St]].x],!1):[Re[Et[St]].x]},[]);if(Math.min.apply(Math,qe)===Re[_e].x){var lt=[];gt.forEach(function(xe){lt.push(fe[xe].toFixed(Pe))}),rt=Array.from(new Set(lt.sort(function(xe,Fe){return parseFloat(xe)-parseFloat(Fe)}))).map(Se).join(ke);var Ye=Math.min.apply(Math,qe),en=Math.max.apply(Math,qe),Vn=He[gt[qe.indexOf(en)]].getBoundingClientRect().width;Ve.left="".concat(Math.abs(Ye-(en+Vn))/2,"px"),Ve.transform="translate(-50%, 0)"}else Ve.visibility="hidden"}Ie(rt),$e(Ve)}},[ie,fe]),[et,nt]};p.useThumbOverlap=Ee;function Ne(ie,fe,_e,ve){var ke=ie.getBoundingClientRect(),Se=ke.left,Pe=ke.top,Oe=ke.width,nt=ke.height;return B(ve)?Math.abs(_e-(Pe+nt/2)):Math.abs(fe-(Se+Oe/2))}})(H_);var dE=nn&&nn.__extends||function(){var p=function(_,l){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var w in v)Object.prototype.hasOwnProperty.call(v,w)&&(f[w]=v[w])},p(_,l)};return function(_,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");p(_,l);function f(){this.constructor=_}_.prototype=l===null?Object.create(l):(f.prototype=l.prototype,new f)}}(),uE=nn&&nn.__createBinding||(Object.create?function(p,_,l,f){f===void 0&&(f=l);var v=Object.getOwnPropertyDescriptor(_,l);(!v||("get"in v?!_.__esModule:v.writable||v.configurable))&&(v={enumerable:!0,get:function(){return _[l]}}),Object.defineProperty(p,f,v)}:function(p,_,l,f){f===void 0&&(f=l),p[f]=_[l]}),hE=nn&&nn.__setModuleDefault||(Object.create?function(p,_){Object.defineProperty(p,"default",{enumerable:!0,value:_})}:function(p,_){p.default=_}),fE=nn&&nn.__importStar||function(p){if(p&&p.__esModule)return p;var _={};if(p!=null)for(var l in p)l!=="default"&&Object.prototype.hasOwnProperty.call(p,l)&&uE(_,p,l);return hE(_,p),_},u0=nn&&nn.__spreadArray||function(p,_,l){if(l||arguments.length===2)for(var f=0,v=_.length,w;f<v;f++)(w||!(f in _))&&(w||(w=Array.prototype.slice.call(_,0,f)),w[f]=_[f]);return p.concat(w||Array.prototype.slice.call(_))};Object.defineProperty($_,"__esModule",{value:!0});var ug=fE(X),At=H_,Ln=Hg,pE=["ArrowRight","ArrowUp","k","PageUp"],gE=["ArrowLeft","ArrowDown","j","PageDown"],mE=function(p){dE(_,p);function _(l){var f=p.call(this,l)||this;if(f.trackRef=ug.createRef(),f.thumbRefs=[],f.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(f.props.values.length).fill(0).map(function(v,w){return w}),isChanged:!1,markOffsets:[]},f.getOffsets=function(){var v=f.props,w=v.direction,b=v.values,T=v.min,P=v.max,B=f.trackRef.current,y=B.getBoundingClientRect(),L=(0,At.getPaddingAndBorder)(B);return f.getThumbs().map(function(O,V){var F={x:0,y:0},Z=O.getBoundingClientRect(),G=(0,At.getMargin)(O);switch(w){case Ln.Direction.Right:return F.x=(G.left+L.left)*-1,F.y=((Z.height-y.height)/2+L.top)*-1,F.x+=y.width*(0,At.relativeValue)(b[V],T,P)-Z.width/2,F;case Ln.Direction.Left:return F.x=(G.right+L.right)*-1,F.y=((Z.height-y.height)/2+L.top)*-1,F.x+=y.width-y.width*(0,At.relativeValue)(b[V],T,P)-Z.width/2,F;case Ln.Direction.Up:return F.x=((Z.width-y.width)/2+G.left+L.left)*-1,F.y=-L.left,F.y+=y.height-y.height*(0,At.relativeValue)(b[V],T,P)-Z.height/2,F;case Ln.Direction.Down:return F.x=((Z.width-y.width)/2+G.left+L.left)*-1,F.y=-L.left,F.y+=y.height*(0,At.relativeValue)(b[V],T,P)-Z.height/2,F;default:return(0,At.assertUnreachable)(w)}})},f.getThumbs=function(){return f.trackRef&&f.trackRef.current?Array.from(f.trackRef.current.children).filter(function(v){return v.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},f.getTargetIndex=function(v){return f.getThumbs().findIndex(function(w){return w===v.target||w.contains(v.target)})},f.addTouchEvents=function(v){document.addEventListener("touchmove",f.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",f.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",f.schdOnEnd,{passive:!1})},f.addMouseEvents=function(v){document.addEventListener("mousemove",f.schdOnMouseMove),document.addEventListener("mouseup",f.schdOnEnd)},f.onMouseDownTrack=function(v){var w;if(v.button===0)if(v.persist(),v.preventDefault(),f.addMouseEvents(v.nativeEvent),f.props.values.length>1&&f.props.draggableTrack){if(f.thumbRefs.some(function(T){var P;return(P=T.current)===null||P===void 0?void 0:P.contains(v.target)}))return;f.setState({draggedTrackPos:[v.clientX,v.clientY]},function(){return f.onMove(v.clientX,v.clientY)})}else{var b=(0,At.getClosestThumbIndex)(f.thumbRefs.map(function(T){return T.current}),v.clientX,v.clientY,f.props.direction);(w=f.thumbRefs[b].current)===null||w===void 0||w.focus(),f.setState({draggedThumbIndex:b},function(){return f.onMove(v.clientX,v.clientY)})}},f.onResize=function(){(0,At.translateThumbs)(f.getThumbs(),f.getOffsets(),f.props.rtl),f.calculateMarkOffsets()},f.onTouchStartTrack=function(v){var w;if(v.persist(),f.addTouchEvents(v.nativeEvent),f.props.values.length>1&&f.props.draggableTrack){if(f.thumbRefs.some(function(T){var P;return(P=T.current)===null||P===void 0?void 0:P.contains(v.target)}))return;f.setState({draggedTrackPos:[v.touches[0].clientX,v.touches[0].clientY]},function(){return f.onMove(v.touches[0].clientX,v.touches[0].clientY)})}else{var b=(0,At.getClosestThumbIndex)(f.thumbRefs.map(function(T){return T.current}),v.touches[0].clientX,v.touches[0].clientY,f.props.direction);(w=f.thumbRefs[b].current)===null||w===void 0||w.focus(),f.setState({draggedThumbIndex:b},function(){return f.onMove(v.touches[0].clientX,v.touches[0].clientY)})}},f.onMouseOrTouchStart=function(v){if(!f.props.disabled){var w=(0,At.isTouchEvent)(v);if(!(!w&&v.button!==0)){var b=f.getTargetIndex(v);b!==-1&&(w?f.addTouchEvents(v):f.addMouseEvents(v),f.setState({draggedThumbIndex:b,thumbZIndexes:f.state.thumbZIndexes.map(function(T,P){return P===b?Math.max.apply(Math,f.state.thumbZIndexes):T<=f.state.thumbZIndexes[b]?T:T-1})}))}}},f.onMouseMove=function(v){v.preventDefault(),f.onMove(v.clientX,v.clientY)},f.onTouchMove=function(v){v.preventDefault(),f.onMove(v.touches[0].clientX,v.touches[0].clientY)},f.onKeyDown=function(v){var w=f.props,b=w.values,T=w.onChange,P=w.step,B=w.rtl,y=w.direction,L=f.state.isChanged,O=f.getTargetIndex(v.nativeEvent),V=B||y===Ln.Direction.Left||y===Ln.Direction.Down?-1:1;O!==-1&&(pE.includes(v.key)?(v.preventDefault(),f.setState({draggedThumbIndex:O,isChanged:!0}),T((0,At.replaceAt)(b,O,f.normalizeValue(b[O]+V*(v.key==="PageUp"?P*10:P),O)))):gE.includes(v.key)?(v.preventDefault(),f.setState({draggedThumbIndex:O,isChanged:!0}),T((0,At.replaceAt)(b,O,f.normalizeValue(b[O]-V*(v.key==="PageDown"?P*10:P),O)))):v.key==="Tab"?f.setState({draggedThumbIndex:-1},function(){L&&f.fireOnFinalChange()}):L&&f.fireOnFinalChange())},f.onKeyUp=function(v){var w=f.state.isChanged;f.setState({draggedThumbIndex:-1},function(){w&&f.fireOnFinalChange()})},f.onMove=function(v,w){var b=f.state,T=b.draggedThumbIndex,P=b.draggedTrackPos,B=f.props,y=B.direction,L=B.min,O=B.max,V=B.onChange,F=B.values,Z=B.step,G=B.rtl;if(T===-1&&P[0]===-1&&P[1]===-1)return null;var Q=f.trackRef.current;if(!Q)return null;var ne=Q.getBoundingClientRect(),ee=(0,At.isVertical)(y)?ne.height:ne.width;if(P[0]!==-1&&P[1]!==-1){var oe=v-P[0],re=w-P[1],be=0;switch(y){case Ln.Direction.Right:case Ln.Direction.Left:be=oe/ee*(O-L);break;case Ln.Direction.Down:case Ln.Direction.Up:be=re/ee*(O-L);break;default:(0,At.assertUnreachable)(y)}if(G&&(be*=-1),Math.abs(be)>=Z/2){for(var we=0;we<f.thumbRefs.length;we++){if(F[we]===O&&Math.sign(be)===1||F[we]===L&&Math.sign(be)===-1)return;var Ae=F[we]+be;Ae>O?be=O-F[we]:Ae<L&&(be=L-F[we])}for(var Ee=F.slice(0),we=0;we<f.thumbRefs.length;we++)Ee=(0,At.replaceAt)(Ee,we,f.normalizeValue(F[we]+be,we));f.setState({draggedTrackPos:[v,w]}),V(Ee)}}else{var Ne=0;switch(y){case Ln.Direction.Right:Ne=(v-ne.left)/ee*(O-L)+L;break;case Ln.Direction.Left:Ne=(ee-(v-ne.left))/ee*(O-L)+L;break;case Ln.Direction.Down:Ne=(w-ne.top)/ee*(O-L)+L;break;case Ln.Direction.Up:Ne=(ee-(w-ne.top))/ee*(O-L)+L;break;default:(0,At.assertUnreachable)(y)}G&&(Ne=O+L-Ne),Math.abs(F[T]-Ne)>=Z/2&&V((0,At.replaceAt)(F,T,f.normalizeValue(Ne,T)))}},f.normalizeValue=function(v,w){var b=f.props,T=b.min,P=b.max,B=b.step,y=b.allowOverlap,L=b.values;return(0,At.normalizeValue)(v,w,T,P,B,y,L)},f.onEnd=function(v){if(v.preventDefault(),document.removeEventListener("mousemove",f.schdOnMouseMove),document.removeEventListener("touchmove",f.schdOnTouchMove),document.removeEventListener("mouseup",f.schdOnEnd),document.removeEventListener("touchend",f.schdOnEnd),document.removeEventListener("touchcancel",f.schdOnEnd),f.state.draggedThumbIndex===-1&&f.state.draggedTrackPos[0]===-1&&f.state.draggedTrackPos[1]===-1)return null;f.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){f.fireOnFinalChange()})},f.fireOnFinalChange=function(){f.setState({isChanged:!1});var v=f.props,w=v.onFinalChange,b=v.values;w&&w(b)},f.updateMarkRefs=function(v){if(!v.renderMark){f.numOfMarks=void 0,f.markRefs=void 0;return}f.numOfMarks=(v.max-v.min)/f.props.step,f.markRefs=[];for(var w=0;w<f.numOfMarks+1;w++)f.markRefs[w]=ug.createRef()},f.calculateMarkOffsets=function(){if(!(!f.props.renderMark||!f.trackRef||!f.numOfMarks||!f.markRefs||f.trackRef.current===null)){for(var v=window.getComputedStyle(f.trackRef.current),w=parseInt(v.width,10),b=parseInt(v.height,10),T=parseInt(v.paddingLeft,10),P=parseInt(v.paddingTop,10),B=[],y=0;y<f.numOfMarks+1;y++){var L=9999,O=9999;if(f.markRefs[y].current){var V=f.markRefs[y].current.getBoundingClientRect();L=V.height,O=V.width}f.props.direction===Ln.Direction.Left||f.props.direction===Ln.Direction.Right?B.push([Math.round(w/f.numOfMarks*y+T-O/2),-Math.round((L-b)/2)]):B.push([Math.round(b/f.numOfMarks*y+P-L/2),-Math.round((O-w)/2)])}f.setState({markOffsets:B})}},l.step===0)throw new Error('"step" property should be a positive number');return f.schdOnMouseMove=(0,At.schd)(f.onMouseMove),f.schdOnTouchMove=(0,At.schd)(f.onTouchMove),f.schdOnEnd=(0,At.schd)(f.onEnd),f.thumbRefs=l.values.map(function(){return ug.createRef()}),f.updateMarkRefs(l),f}return _.prototype.componentDidMount=function(){var l=this,f=this.props,v=f.values,w=f.min,b=f.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",l.onResize)},unobserve:function(){return window.removeEventListener("resize",l.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,At.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(T){return(0,At.checkBoundaries)(T,l.props.min,l.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,At.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),v.forEach(function(T){(0,At.isStepDivisible)(w,T,b)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},_.prototype.componentDidUpdate=function(l,f){var v=this.props,w=v.max,b=v.min,T=v.step,P=v.values,B=v.rtl;(l.max!==w||l.min!==b||l.step!==T)&&this.updateMarkRefs(this.props),(0,At.translateThumbs)(this.getThumbs(),this.getOffsets(),B),(l.max!==w||l.min!==b||l.step!==T||f.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),P.forEach(function(y){(0,At.isStepDivisible)(b,y,T)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},_.prototype.componentWillUnmount=function(){var l={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,l),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},_.prototype.render=function(){var l=this,f=this.props,v=f.renderTrack,w=f.renderThumb,b=f.renderMark,T=b===void 0?function(){return null}:b,P=f.values,B=f.min,y=f.max,L=f.allowOverlap,O=f.disabled,V=this.state,F=V.draggedThumbIndex,Z=V.thumbZIndexes,G=V.markOffsets;return v({props:{style:{transform:"scale(1)",cursor:F>-1?"grabbing":this.props.draggableTrack?(0,At.isVertical)(this.props.direction)?"ns-resize":"ew-resize":P.length===1&&!O?"pointer":"inherit"},onMouseDown:O?At.voidFn:this.onMouseDownTrack,onTouchStart:O?At.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:O,children:u0(u0([],G.map(function(Q,ne,ee){return T({props:{style:l.props.direction===Ln.Direction.Left||l.props.direction===Ln.Direction.Right?{position:"absolute",left:"".concat(Q[0],"px"),marginTop:"".concat(Q[1],"px")}:{position:"absolute",top:"".concat(Q[0],"px"),marginLeft:"".concat(Q[1],"px")},key:"mark".concat(ne),ref:l.markRefs[ne]},index:ne})}),!0),P.map(function(Q,ne){var ee=l.state.draggedThumbIndex===ne;return w({index:ne,value:Q,isDragged:ee,props:{style:{position:"absolute",zIndex:Z[ne],cursor:O?"inherit":ee?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:ne,tabIndex:O?void 0:0,"aria-valuemax":L?y:P[ne+1]||y,"aria-valuemin":L?B:P[ne-1]||B,"aria-valuenow":Q,draggable:!1,ref:l.thumbRefs[ne],role:"slider",onKeyDown:O?At.voidFn:l.onKeyDown,onKeyUp:O?At.voidFn:l.onKeyUp}})}),!0)})},_.defaultProps={step:1,direction:Ln.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},_}(ug.Component);$_.default=mE;(function(p){var _=nn&&nn.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(p,"__esModule",{value:!0}),p.checkValuesAgainstBoundaries=p.relativeValue=p.useThumbOverlap=p.Direction=p.getTrackBackground=p.Range=void 0;var l=_($_);p.Range=l.default;var f=H_;Object.defineProperty(p,"getTrackBackground",{enumerable:!0,get:function(){return f.getTrackBackground}}),Object.defineProperty(p,"useThumbOverlap",{enumerable:!0,get:function(){return f.useThumbOverlap}}),Object.defineProperty(p,"relativeValue",{enumerable:!0,get:function(){return f.relativeValue}}),Object.defineProperty(p,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return f.checkValuesAgainstBoundaries}});var v=Hg;Object.defineProperty(p,"Direction",{enumerable:!0,get:function(){return v.Direction}})})(yy);const bE=1,h0=15,f0=100;function vE({values:p,colors:_,min:l,max:f,direction:v="to right",rtl:w=!1}){w&&v==="to right"?v="to left":w&&(v="to right");const T=p.slice(0).sort((P,B)=>P-B).map(P=>(P-l)/(f-l)*100).reduce((P,B,y)=>`${P}, ${_[y]} ${B}%, ${_[y+1]} ${B}%`,"");return`linear-gradient(${v}, ${_[0]} 0%${T}, ${_[_.length-1]} 100%)`}const _E=({rtl:p,value:_,onChange:l})=>{const[f,v]=X.useState([15,15]);return X.useEffect(()=>{_&&v(_)},[_]),A.jsx("div",{style:{display:"flex",justifyContent:"center",flexWrap:"wrap"},children:A.jsx(yy.Range,{values:f,step:bE,min:h0,max:f0,rtl:p,onChange:w=>l(w),renderTrack:({props:w,children:b})=>A.jsx("div",{onMouseDown:w.onMouseDown,onTouchStart:w.onTouchStart,style:{...w.style,height:"36px",display:"flex",width:"100%"},children:A.jsx("div",{ref:w.ref,style:{height:"5px",width:"100%",borderRadius:"4px",background:vE({values:f,colors:["#ccc","#548BF4","#ccc"],min:h0,max:f0,rtl:p}),alignSelf:"center"},children:b})}),renderThumb:({index:w,props:b,isDragged:T})=>A.jsxs("div",{...b,style:{...b.style,height:"1.5rem",width:"1.5rem",borderRadius:"4px",backgroundColor:"#FFF",display:"flex",justifyContent:"center",alignItems:"center",boxShadow:"0px 2px 6px #AAA"},children:[A.jsx("div",{style:{position:"absolute",top:"-20px",color:"#fff",fontWeight:"bold",fontSize:"12px",fontFamily:"Arial,Helvetica Neue,Helvetica,sans-serif",padding:"2px",borderRadius:"4px",backgroundColor:"#548BF4"},children:f[w]}),A.jsx("div",{style:{height:"16px",width:"5px",backgroundColor:T?"#548BF4":"#CCC"}})]})})})};var wE={root:{display:"flex",flexDirection:"column",flexWrap:"wrap"},row:{flexDirection:"row"}},kE=X.forwardRef(function(_,l){var f=_.classes,v=_.className,w=_.row,b=w===void 0?!1:w,T=g_(_,["classes","className","row"]);return X.createElement("div",vg({className:x0(f.root,v,b&&f.row),ref:l},T))});const yE=A0(wE,{name:"MuiFormGroup"})(kE);var Cg={exports:{}};/** * @license * Lodash <https://lodash.com/> * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */Cg.exports;(function(p,_){(function(){var l,f="4.17.21",v=200,w="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",b="Expected a function",T="Invalid `variable` option passed into `_.template`",P="__lodash_hash_undefined__",B=500,y="__lodash_placeholder__",L=1,O=2,V=4,F=1,Z=2,G=1,Q=2,ne=4,ee=8,oe=16,re=32,be=64,we=128,Ae=256,Ee=512,Ne=30,ie="...",fe=800,_e=16,ve=1,ke=2,Se=3,Pe=1/0,Oe=9007199254740991,nt=17976931348623157e292,$e=0/0,De=4294967295,et=De-1,Ie=De>>>1,He=[["ary",we],["bind",G],["bindKey",Q],["curry",ee],["curryRight",oe],["flip",Ee],["partial",re],["partialRight",be],["rearg",Ae]],Ve="[object Arguments]",Re="[object Array]",gt="[object AsyncFunction]",rt="[object Boolean]",qe="[object Date]",lt="[object DOMException]",Ye="[object Error]",en="[object Function]",Vn="[object GeneratorFunction]",xe="[object Map]",Fe="[object Number]",St="[object Null]",Et="[object Object]",hn="[object Promise]",Yn="[object Proxy]",Sn="[object RegExp]",rn="[object Set]",Bi="[object String]",uo="[object Symbol]",ua="[object Undefined]",$n="[object WeakMap]",bs="[object WeakSet]",ur="[object ArrayBuffer]",wi="[object DataView]",ho="[object Float32Array]",Gi="[object Float64Array]",fo="[object Int8Array]",po="[object Int16Array]",go="[object Int32Array]",Yt="[object Uint8Array]",Gt="[object Uint8ClampedArray]",an="[object Uint16Array]",ln="[object Uint32Array]",kn=/\b__p \+= '';/g,bn=/\b(__p \+=) '' \+/g,Pt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ki=/&(?:amp|lt|gt|quot|#39);/g,It=/[&<>"']/g,yi=RegExp(ki.source),oi=RegExp(It.source),si=/<%-([\s\S]+?)%>/g,Tl=/<%([\s\S]+?)%>/g,vs=/<%=([\s\S]+?)%>/g,md=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Al=/^\w*$/,bd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Fo=/[\\^$.*+?()[\]{}|]/g,vd=RegExp(Fo.source),ha=/^\s+/,_d=/\s/,xi=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,mo=/\{\n\/\* \[wrapped with (.+)\] \*/,_s=/,? & /,ws=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vr=/[()=,{}\[\]\/\s]/,bo=/\\(\\)?/g,Sl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ks=/\w*$/,Wt=/^[-+]0x[0-9a-f]+$/i,$r=/^0b[01]+$/i,wd=/^\[object .+?Constructor\]$/,kd=/^0o[0-7]+$/i,El=/^(?:0|[1-9]\d*)$/,Hr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Le=/($^)/,me=/['\n\r\u2028\u2029\\]/g,vo="\\ud800-\\udfff",ct="\\u0300-\\u036f",Pl="\\ufe20-\\ufe2f",fa="\\u20d0-\\u20ff",_o=ct+Pl+fa,ys="\\u2700-\\u27bf",Il="a-z\\xdf-\\xf6\\xf8-\\xff",Ml="\\xac\\xb1\\xd7\\xf7",pa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",yd="\\u2000-\\u206f",xd=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Xn="A-Z\\xc0-\\xd6\\xd8-\\xde",xs="\\ufe0e\\ufe0f",Vo=Ml+pa+yd+xd,Cs="['’]",Ol="["+vo+"]",ga="["+Vo+"]",$o="["+_o+"]",Nl="\\d+",wo="["+ys+"]",Ho="["+Il+"]",Rl="[^"+vo+Vo+Nl+ys+Il+Xn+"]",Ts="\\ud83c[\\udffb-\\udfff]",qt="(?:"+$o+"|"+Ts+")",Dl="[^"+vo+"]",Qi="(?:\\ud83c[\\udde6-\\uddff]){2}",hr="[\\ud800-\\udbff][\\udc00-\\udfff]",Fi="["+Xn+"]",As="\\u200d",Ur="(?:"+Ho+"|"+Rl+")",jl="(?:"+Fi+"|"+Rl+")",Ll="(?:"+Cs+"(?:d|ll|m|re|s|t|ve))?",zl="(?:"+Cs+"(?:D|LL|M|RE|S|T|VE))?",ma=qt+"?",Wr="["+xs+"]?",Ss="(?:"+As+"(?:"+[Dl,Qi,hr].join("|")+")"+Wr+ma+")*",Bl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Cd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Uo=Wr+ma+Ss,Td="(?:"+[wo,Qi,hr].join("|")+")"+Uo,Fl="(?:"+[Dl+$o+"?",$o,Qi,hr,Ol].join("|")+")",ba=RegExp(Cs,"g"),Ad=RegExp($o,"g"),fr=RegExp(Ts+"(?="+Ts+")|"+Fl+Uo,"g"),Es=RegExp([Fi+"?"+Ho+"+"+Ll+"(?="+[ga,Fi,"$"].join("|")+")",jl+"+"+zl+"(?="+[ga,Fi+Ur,"$"].join("|")+")",Fi+"?"+Ur+"+"+Ll,Fi+"+"+zl,Cd,Bl,Nl,Td].join("|"),"g"),Sd=RegExp("["+As+vo+_o+xs+"]"),pr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wo=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Vl=-1,Ft={};Ft[ho]=Ft[Gi]=Ft[fo]=Ft[po]=Ft[go]=Ft[Yt]=Ft[Gt]=Ft[an]=Ft[ln]=!0,Ft[Ve]=Ft[Re]=Ft[ur]=Ft[rt]=Ft[wi]=Ft[qe]=Ft[Ye]=Ft[en]=Ft[xe]=Ft[Fe]=Ft[Et]=Ft[Sn]=Ft[rn]=Ft[Bi]=Ft[$n]=!1;var Dt={};Dt[Ve]=Dt[Re]=Dt[ur]=Dt[wi]=Dt[rt]=Dt[qe]=Dt[ho]=Dt[Gi]=Dt[fo]=Dt[po]=Dt[go]=Dt[xe]=Dt[Fe]=Dt[Et]=Dt[Sn]=Dt[rn]=Dt[Bi]=Dt[uo]=Dt[Yt]=Dt[Gt]=Dt[an]=Dt[ln]=!0,Dt[Ye]=Dt[en]=Dt[$n]=!1;var $l={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},va={"&":"&","<":"<",">":">",'"':""","'":"'"},Ed={"&":"&","<":"<",">":">",""":'"',"'":"'"},Pd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},_a=parseFloat,Hl=parseInt,wa=typeof nn=="object"&&nn&&nn.Object===Object&&nn,Ps=typeof self=="object"&&self&&self.Object===Object&&self,vn=wa||Ps||Function("return this")(),qo=_&&!_.nodeType&&_,Ci=qo&&!0&&p&&!p.nodeType&&p,ka=Ci&&Ci.exports===qo,Is=ka&&wa.process,Hn=function(){try{var q=Ci&&Ci.require&&Ci.require("util").types;return q||Is&&Is.binding&&Is.binding("util")}catch{}}(),Ul=Hn&&Hn.isArrayBuffer,ya=Hn&&Hn.isDate,ko=Hn&&Hn.isMap,Ms=Hn&&Hn.isRegExp,yo=Hn&&Hn.isSet,xo=Hn&&Hn.isTypedArray;function yn(q,ae,Y){switch(Y.length){case 0:return q.call(ae);case 1:return q.call(ae,Y[0]);case 2:return q.call(ae,Y[0],Y[1]);case 3:return q.call(ae,Y[0],Y[1],Y[2])}return q.apply(ae,Y)}function Os(q,ae,Y,Me){for(var Xe=-1,kt=q==null?0:q.length;++Xe<kt;){var dn=q[Xe];ae(Me,dn,Y(dn),q)}return Me}function Jn(q,ae){for(var Y=-1,Me=q==null?0:q.length;++Y<Me&&ae(q[Y],Y,q)!==!1;);return q}function Wl(q,ae){for(var Y=q==null?0:q.length;Y--&&ae(q[Y],Y,q)!==!1;);return q}function xa(q,ae){for(var Y=-1,Me=q==null?0:q.length;++Y<Me;)if(!ae(q[Y],Y,q))return!1;return!0}function gr(q,ae){for(var Y=-1,Me=q==null?0:q.length,Xe=0,kt=[];++Y<Me;){var dn=q[Y];ae(dn,Y,q)&&(kt[Xe++]=dn)}return kt}function Ns(q,ae){var Y=q==null?0:q.length;return!!Y&&To(q,ae,0)>-1}function Yi(q,ae,Y){for(var Me=-1,Xe=q==null?0:q.length;++Me<Xe;)if(Y(ae,q[Me]))return!0;return!1}function Mt(q,ae){for(var Y=-1,Me=q==null?0:q.length,Xe=Array(Me);++Y<Me;)Xe[Y]=ae(q[Y],Y,q);return Xe}function mr(q,ae){for(var Y=-1,Me=ae.length,Xe=q.length;++Y<Me;)q[Xe+Y]=ae[Y];return q}function Xi(q,ae,Y,Me){var Xe=-1,kt=q==null?0:q.length;for(Me&&kt&&(Y=q[++Xe]);++Xe<kt;)Y=ae(Y,q[Xe],Xe,q);return Y}function Co(q,ae,Y,Me){var Xe=q==null?0:q.length;for(Me&&Xe&&(Y=q[--Xe]);Xe--;)Y=ae(Y,q[Xe],Xe,q);return Y}function Ko(q,ae){for(var Y=-1,Me=q==null?0:q.length;++Y<Me;)if(ae(q[Y],Y,q))return!0;return!1}var Id=Pa("length");function ql(q){return q.split("")}function Ca(q){return q.match(ws)||[]}function Ta(q,ae,Y){var Me;return Y(q,function(Xe,kt,dn){if(ae(Xe,kt,dn))return Me=kt,!1}),Me}function Go(q,ae,Y,Me){for(var Xe=q.length,kt=Y+(Me?1:-1);Me?kt--:++kt<Xe;)if(ae(q[kt],kt,q))return kt;return-1}function To(q,ae,Y){return ae===ae?Ra(q,ae,Y):Go(q,Sa,Y)}function Aa(q,ae,Y,Me){for(var Xe=Y-1,kt=q.length;++Xe<kt;)if(Me(q[Xe],ae))return Xe;return-1}function Sa(q){return q!==q}function Ea(q,ae){var Y=q==null?0:q.length;return Y?Ia(q,ae)/Y:$e}function Pa(q){return function(ae){return ae==null?l:ae[q]}}function Rs(q){return function(ae){return q==null?l:q[ae]}}function Kl(q,ae,Y,Me,Xe){return Xe(q,function(kt,dn,Ot){Y=Me?(Me=!1,kt):ae(Y,kt,dn,Ot)}),Y}function Gl(q,ae){var Y=q.length;for(q.sort(ae);Y--;)q[Y]=q[Y].value;return q}function Ia(q,ae){for(var Y,Me=-1,Xe=q.length;++Me<Xe;){var kt=ae(q[Me]);kt!==l&&(Y=Y===l?kt:Y+kt)}return Y}function Ma(q,ae){for(var Y=-1,Me=Array(q);++Y<q;)Me[Y]=ae(Y);return Me}function Ql(q,ae){return Mt(ae,function(Y){return[Y,q[Y]]})}function Yl(q){return q&&q.slice(0,Ti(q)+1).replace(ha,"")}function dt(q){return function(ae){return q(ae)}}function Qo(q,ae){return Mt(ae,function(Y){return q[Y]})}function Ao(q,ae){return q.has(ae)}function Ji(q,ae){for(var Y=-1,Me=q.length;++Y<Me&&To(ae,q[Y],0)>-1;);return Y}function Oa(q,ae){for(var Y=q.length;Y--&&To(ae,q[Y],0)>-1;);return Y}function Xl(q,ae){for(var Y=q.length,Me=0;Y--;)q[Y]===ae&&++Me;return Me}var Md=Rs($l),ai=Rs(va);function li(q){return"\\"+Pd[q]}function Na(q,ae){return q==null?l:q[ae]}function xt(q){return Sd.test(q)}function Od(q){return pr.test(q)}function Nd(q){for(var ae,Y=[];!(ae=q.next()).done;)Y.push(ae.value);return Y}function Yo(q){var ae=-1,Y=Array(q.size);return q.forEach(function(Me,Xe){Y[++ae]=[Xe,Me]}),Y}function Jl(q,ae){return function(Y){return q(ae(Y))}}function br(q,ae){for(var Y=-1,Me=q.length,Xe=0,kt=[];++Y<Me;){var dn=q[Y];(dn===ae||dn===y)&&(q[Y]=y,kt[Xe++]=Y)}return kt}function vr(q){var ae=-1,Y=Array(q.size);return q.forEach(function(Me){Y[++ae]=Me}),Y}function xn(q){var ae=-1,Y=Array(q.size);return q.forEach(function(Me){Y[++ae]=[Me,Me]}),Y}function Ra(q,ae,Y){for(var Me=Y-1,Xe=q.length;++Me<Xe;)if(q[Me]===ae)return Me;return-1}function qr(q,ae,Y){for(var Me=Y+1;Me--;)if(q[Me]===ae)return Me;return Me}function _t(q){return xt(q)?Zl(q):Id(q)}function cn(q){return xt(q)?Da(q):ql(q)}function Ti(q){for(var ae=q.length;ae--&&_d.test(q.charAt(ae)););return ae}var Vi=Rs(Ed);function Zl(q){for(var ae=fr.lastIndex=0;fr.test(q);)++ae;return ae}function Da(q){return q.match(fr)||[]}function Ds(q){return q.match(Es)||[]}var ec=function q(ae){ae=ae==null?vn:Kr.defaults(vn.Object(),ae,Kr.pick(vn,Wo));var Y=ae.Array,Me=ae.Date,Xe=ae.Error,kt=ae.Function,dn=ae.Math,Ot=ae.Object,js=ae.RegExp,Rd=ae.String,En=ae.TypeError,So=Y.prototype,Dd=kt.prototype,_r=Ot.prototype,Xo=ae["__core-js_shared__"],Gr=Dd.toString,Ct=_r.hasOwnProperty,tc=0,ja=function(){var s=/[^.]+$/.exec(Xo&&Xo.keys&&Xo.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),wr=_r.toString,fn=Gr.call(Ot),Jo=vn._,nc=js("^"+Gr.call(Ct).replace(Fo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Eo=ka?ae.Buffer:l,Zi=ae.Symbol,Zo=ae.Uint8Array,Ls=Eo?Eo.allocUnsafe:l,Qr=Jl(Ot.getPrototypeOf,Ot),kr=Ot.create,ic=_r.propertyIsEnumerable,I=So.splice,M=Zi?Zi.isConcatSpreadable:l,$=Zi?Zi.iterator:l,te=Zi?Zi.toStringTag:l,Ce=function(){try{var s=Ii(Ot,"defineProperty");return s({},"",{}),s}catch{}}(),Ge=ae.clearTimeout!==vn.clearTimeout&&ae.clearTimeout,Qe=Me&&Me.now!==vn.Date.now&&Me.now,tt=ae.setTimeout!==vn.setTimeout&&ae.setTimeout,jt=dn.ceil,Vt=dn.floor,Po=Ot.getOwnPropertySymbols,Zn=Eo?Eo.isBuffer:l,ge=ae.isFinite,Be=So.join,yr=Jl(Ot.keys,Ot),Lt=dn.max,ft=dn.min,ci=Me.now,Cn=ae.parseInt,di=dn.random,Yr=So.reverse,es=Ii(ae,"DataView"),xr=Ii(ae,"Map"),rc=Ii(ae,"Promise"),Io=Ii(ae,"Set"),Xr=Ii(ae,"WeakMap"),Cr=Ii(Ot,"create"),oc=Xr&&new Xr,Mo={},Ih=Lo(es),Ug=Lo(xr),La=Lo(rc),_n=Lo(Io),Wg=Lo(Xr),sc=Zi?Zi.prototype:l,ot=sc?sc.valueOf:l,Mh=sc?sc.toString:l;function R(s){if(Zt(s)&&!Je(s)&&!(s instanceof mt)){if(s instanceof Ai)return s;if(Ct.call(s,"__wrapped__"))return gf(s)}return new Ai(s)}var Oo=function(){function s(){}return function(d){if(!Ze(d))return{};if(kr)return kr(d);s.prototype=d;var g=new s;return s.prototype=l,g}}();function za(){}function Ai(s,d){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!d,this.__index__=0,this.__values__=l}R.templateSettings={escape:si,evaluate:Tl,interpolate:vs,variable:"",imports:{_:R}},R.prototype=za.prototype,R.prototype.constructor=R,Ai.prototype=Oo(za.prototype),Ai.prototype.constructor=Ai;function mt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=De,this.__views__=[]}function jd(){var s=new mt(this.__wrapped__);return s.__actions__=fi(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=fi(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=fi(this.__views__),s}function qg(){if(this.__filtered__){var s=new mt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function Kg(){var s=this.__wrapped__.value(),d=this.__dir__,g=Je(s),x=d<0,E=g?s.length:0,j=um(0,E,this.__views__),H=j.start,W=j.end,K=W-H,de=x?W:H-1,ue=this.__iteratees__,pe=ue.length,Te=0,je=ft(K,this.__takeCount__);if(!g||!x&&E==K&&je==K)return tr(s,this.__actions__);var Ke=[];e:for(;K--&&Te<je;){de+=d;for(var ht=-1,We=s[de];++ht<pe;){var pt=ue[ht],bt=pt.iteratee,gi=pt.type,qn=bt(We);if(gi==ke)We=qn;else if(!qn){if(gi==ve)continue e;break e}}Ke[Te++]=We}return Ke}mt.prototype=Oo(za.prototype),mt.prototype.constructor=mt;function No(s){var d=-1,g=s==null?0:s.length;for(this.clear();++d<g;){var x=s[d];this.set(x[0],x[1])}}function Gg(){this.__data__=Cr?Cr(null):{},this.size=0}function ts(s){var d=this.has(s)&&delete this.__data__[s];return this.size-=d?1:0,d}function Oh(s){var d=this.__data__;if(Cr){var g=d[s];return g===P?l:g}return Ct.call(d,s)?d[s]:l}function Ld(s){var d=this.__data__;return Cr?d[s]!==l:Ct.call(d,s)}function Qg(s,d){var g=this.__data__;return this.size+=this.has(s)?0:1,g[s]=Cr&&d===l?P:d,this}No.prototype.clear=Gg,No.prototype.delete=ts,No.prototype.get=Oh,No.prototype.has=Ld,No.prototype.set=Qg;function Tr(s){var d=-1,g=s==null?0:s.length;for(this.clear();++d<g;){var x=s[d];this.set(x[0],x[1])}}function zd(){this.__data__=[],this.size=0}function Nh(s){var d=this.__data__,g=$t(d,s);if(g<0)return!1;var x=d.length-1;return g==x?d.pop():I.call(d,g,1),--this.size,!0}function Yg(s){var d=this.__data__,g=$t(d,s);return g<0?l:d[g][1]}function Bd(s){return $t(this.__data__,s)>-1}function Ba(s,d){var g=this.__data__,x=$t(g,s);return x<0?(++this.size,g.push([s,d])):g[x][1]=d,this}Tr.prototype.clear=zd,Tr.prototype.delete=Nh,Tr.prototype.get=Yg,Tr.prototype.has=Bd,Tr.prototype.set=Ba;function Ar(s){var d=-1,g=s==null?0:s.length;for(this.clear();++d<g;){var x=s[d];this.set(x[0],x[1])}}function Pn(){this.size=0,this.__data__={hash:new No,map:new(xr||Tr),string:new No}}function Rh(s){var d=Ac(this,s).delete(s);return this.size-=d?1:0,d}function Dh(s){return Ac(this,s).get(s)}function jh(s){return Ac(this,s).has(s)}function ac(s,d){var g=Ac(this,s),x=g.size;return g.set(s,d),this.size+=g.size==x?0:1,this}Ar.prototype.clear=Pn,Ar.prototype.delete=Rh,Ar.prototype.get=Dh,Ar.prototype.has=jh,Ar.prototype.set=ac;function wn(s){var d=-1,g=s==null?0:s.length;for(this.__data__=new Ar;++d<g;)this.add(s[d])}function lc(s){return this.__data__.set(s,P),this}function Fd(s){return this.__data__.has(s)}wn.prototype.add=wn.prototype.push=lc,wn.prototype.has=Fd;function er(s){var d=this.__data__=new Tr(s);this.size=d.size}function Lh(){this.__data__=new Tr,this.size=0}function zh(s){var d=this.__data__,g=d.delete(s);return this.size=d.size,g}function Bh(s){return this.__data__.get(s)}function Ro(s){return this.__data__.has(s)}function Fh(s,d){var g=this.__data__;if(g instanceof Tr){var x=g.__data__;if(!xr||x.length<v-1)return x.push([s,d]),this.size=++g.size,this;g=this.__data__=new Ar(x)}return g.set(s,d),this.size=g.size,this}er.prototype.clear=Lh,er.prototype.delete=zh,er.prototype.get=Bh,er.prototype.has=Ro,er.prototype.set=Fh;function Vd(s,d){var g=Je(s),x=!g&&ds(s),E=!g&&!x&&oo(s),j=!g&&!x&&!E&&Xs(s),H=g||x||E||j,W=H?Ma(s.length,Rd):[],K=W.length;for(var de in s)(d||Ct.call(s,de))&&!(H&&(de=="length"||E&&(de=="offset"||de=="parent")||j&&(de=="buffer"||de=="byteLength"||de=="byteOffset")||On(de,K)))&&W.push(de);return W}function ns(s){var d=s.length;return d?s[pc(0,d-1)]:l}function Vh(s,d){return Nc(fi(s),Sr(d,0,s.length))}function $h(s){return Nc(fi(s))}function cc(s,d,g){(g!==l&&!or(s[d],g)||g===l&&!(d in s))&&Jr(s,d,g)}function Fa(s,d,g){var x=s[d];(!(Ct.call(s,d)&&or(x,g))||g===l&&!(d in s))&&Jr(s,d,g)}function $t(s,d){for(var g=s.length;g--;)if(or(s[g][0],d))return g;return-1}function $d(s,d,g,x){return Zr(s,function(E,j,H){d(x,E,g(E),H)}),x}function Hd(s,d){return s&&ir(d,gn(d),s)}function Xg(s,d){return s&&ir(d,Dn(d),s)}function Jr(s,d,g){d=="__proto__"&&Ce?Ce(s,d,{configurable:!0,enumerable:!0,value:g,writable:!0}):s[d]=g}function Ud(s,d){for(var g=-1,x=d.length,E=Y(x),j=s==null;++g<x;)E[g]=j?l:Wc(s,d[g]);return E}function Sr(s,d,g){return s===s&&(g!==l&&(s=s<=g?s:g),d!==l&&(s=s>=d?s:d)),s}function Si(s,d,g,x,E,j){var H,W=d&L,K=d&O,de=d&V;if(g&&(H=E?g(s,x,E,j):g(s)),H!==l)return H;if(!Ze(s))return s;var ue=Je(s);if(ue){if(H=fm(s),!W)return fi(s,H)}else{var pe=Mn(s),Te=pe==en||pe==Vn;if(oo(s))return se(s,W);if(pe==Et||pe==Ve||Te&&!E){if(H=K||Te?{}:Sc(s),!W)return K?Or(s,Xg(H,s)):au(s,Hd(H,s))}else{if(!Dt[pe])return E?s:{};H=pf(s,pe,W)}}j||(j=new er);var je=j.get(s);if(je)return je;j.set(s,H),Vu(s)?s.forEach(function(We){H.add(Si(We,d,g,We,s,j))}):mp(s)&&s.forEach(function(We,pt){H.set(pt,Si(We,d,g,pt,s,j))});var Ke=de?K?pu:fu:K?Dn:gn,ht=ue?l:Ke(s);return Jn(ht||s,function(We,pt){ht&&(pt=We,We=s[pt]),Fa(H,pt,Si(We,d,g,pt,s,j))}),H}function Hh(s){var d=gn(s);return function(g){return Va(g,s,d)}}function Va(s,d,g){var x=g.length;if(s==null)return!x;for(s=Ot(s);x--;){var E=g[x],j=d[E],H=s[E];if(H===l&&!(E in s)||!j(H))return!1}return!0}function is(s,d,g){if(typeof s!="function")throw new En(b);return rl(function(){s.apply(l,g)},d)}function rs(s,d,g,x){var E=-1,j=Ns,H=!0,W=s.length,K=[],de=d.length;if(!W)return K;g&&(d=Mt(d,dt(g))),x?(j=Yi,H=!1):d.length>=v&&(j=Ao,H=!1,d=new wn(d));e:for(;++E<W;){var ue=s[E],pe=g==null?ue:g(ue);if(ue=x||ue!==0?ue:0,H&&pe===pe){for(var Te=de;Te--;)if(d[Te]===pe)continue e;K.push(ue)}else j(d,pe,x)||K.push(ue)}return K}var Zr=Hi(Pr),Er=Hi(Kd,!0);function Jg(s,d){var g=!0;return Zr(s,function(x,E,j){return g=!!d(x,E,j),g}),g}function dc(s,d,g){for(var x=-1,E=s.length;++x<E;){var j=s[x],H=d(j);if(H!=null&&(W===l?H===H&&!Ri(H):g(H,W)))var W=H,K=j}return K}function uc(s,d,g,x){var E=s.length;for(g=it(g),g<0&&(g=-g>E?0:E+g),x=x===l||x>E?E:it(x),x<0&&(x+=E),x=g>x?0:Hu(x);g<x;)s[g++]=d;return s}function Uh(s,d){var g=[];return Zr(s,function(x,E,j){d(x,E,j)&&g.push(x)}),g}function In(s,d,g,x,E){var j=-1,H=s.length;for(g||(g=Ui),E||(E=[]);++j<H;){var W=s[j];d>0&&g(W)?d>1?In(W,d-1,g,x,E):mr(E,W):x||(E[E.length]=W)}return E}var Wd=sf(),qd=sf(!0);function Pr(s,d){return s&&Wd(s,d,gn)}function Kd(s,d){return s&&qd(s,d,gn)}function $a(s,d){return gr(d,function(g){return sr(s[g])})}function eo(s,d){d=he(d,s);for(var g=0,x=d.length;s!=null&&g<x;)s=s[Dr(d[g++])];return g&&g==x?s:l}function Wh(s,d,g){var x=d(s);return Je(s)?x:mr(x,g(s))}function ei(s){return s==null?s===l?ua:St:te&&te in Ot(s)?dm(s):pi(s)}function Gd(s,d){return s>d}function qh(s,d){return s!=null&&Ct.call(s,d)}function Zg(s,d){return s!=null&&d in Ot(s)}function Kh(s,d,g){return s>=ft(d,g)&&s<Lt(d,g)}function Qd(s,d,g){for(var x=g?Yi:Ns,E=s[0].length,j=s.length,H=j,W=Y(j),K=1/0,de=[];H--;){var ue=s[H];H&&d&&(ue=Mt(ue,dt(d))),K=ft(ue.length,K),W[H]=!g&&(d||E>=120&&ue.length>=120)?new wn(H&&ue):l}ue=s[0];var pe=-1,Te=W[0];e:for(;++pe<E&&de.length<K;){var je=ue[pe],Ke=d?d(je):je;if(je=g||je!==0?je:0,!(Te?Ao(Te,Ke):x(de,Ke,g))){for(H=j;--H;){var ht=W[H];if(!(ht?Ao(ht,Ke):x(s[H],Ke,g)))continue e}Te&&Te.push(Ke),de.push(je)}}return de}function Gh(s,d,g,x){return Pr(s,function(E,j,H){d(x,g(E),j,H)}),x}function os(s,d,g){d=he(d,s),s=Rr(s,d);var x=s==null?s:s[Dr(Mi(d))];return x==null?l:yn(x,s,g)}function to(s){return Zt(s)&&ei(s)==Ve}function em(s){return Zt(s)&&ei(s)==ur}function Yd(s){return Zt(s)&&ei(s)==qe}function Ha(s,d,g,x,E){return s===d?!0:s==null||d==null||!Zt(s)&&!Zt(d)?s!==s&&d!==d:tm(s,d,g,x,Ha,E)}function tm(s,d,g,x,E,j){var H=Je(s),W=Je(d),K=H?Re:Mn(s),de=W?Re:Mn(d);K=K==Ve?Et:K,de=de==Ve?Et:de;var ue=K==Et,pe=de==Et,Te=K==de;if(Te&&oo(s)){if(!oo(d))return!1;H=!0,ue=!1}if(Te&&!ue)return j||(j=new er),H||Xs(s)?hf(s,d,g,x,E,j):ff(s,d,K,g,x,E,j);if(!(g&F)){var je=ue&&Ct.call(s,"__wrapped__"),Ke=pe&&Ct.call(d,"__wrapped__");if(je||Ke){var ht=je?s.value():s,We=Ke?d.value():d;return j||(j=new er),E(ht,We,g,x,j)}}return Te?(j||(j=new er),ss(s,d,g,x,E,j)):!1}function nm(s){return Zt(s)&&Mn(s)==xe}function Xd(s,d,g,x){var E=g.length,j=E,H=!x;if(s==null)return!j;for(s=Ot(s);E--;){var W=g[E];if(H&&W[2]?W[1]!==s[W[0]]:!(W[0]in s))return!1}for(;++E<j;){W=g[E];var K=W[0],de=s[K],ue=W[1];if(H&&W[2]){if(de===l&&!(K in s))return!1}else{var pe=new er;if(x)var Te=x(de,ue,K,s,d,pe);if(!(Te===l?Ha(ue,de,F|Z,x,pe):Te))return!1}}return!0}function Qh(s){if(!Ze(s)||nl(s))return!1;var d=sr(s)?nc:wd;return d.test(Lo(s))}function im(s){return Zt(s)&&ei(s)==Sn}function rm(s){return Zt(s)&&Mn(s)==rn}function om(s){return Zt(s)&&hs(s.length)&&!!Ft[ei(s)]}function Jd(s){return typeof s=="function"?s:s==null?ii:typeof s=="object"?Je(s)?Jh(s[0],s[1]):Xh(s):eh(s)}function Zd(s){if(!$s(s))return yr(s);var d=[];for(var g in Ot(s))Ct.call(s,g)&&g!="constructor"&&d.push(g);return d}function sm(s){if(!Ze(s))return Tn(s);var d=$s(s),g=[];for(var x in s)x=="constructor"&&(d||!Ct.call(s,x))||g.push(x);return g}function Ua(s,d){return s<d}function Yh(s,d){var g=-1,x=tn(s)?Y(s.length):[];return Zr(s,function(E,j,H){x[++g]=d(E,j,H)}),x}function Xh(s){var d=mu(s);return d.length==1&&d[0][2]?on(d[0][0],d[0][1]):function(g){return g===s||Xd(g,s,d)}}function Jh(s,d){return Pc(s)&&wu(d)?on(Dr(s),d):function(g){var x=Wc(g,s);return x===l&&x===d?qc(g,s):Ha(d,x,F|Z)}}function hc(s,d,g,x,E){s!==d&&Wd(d,function(j,H){if(E||(E=new er),Ze(j))am(s,d,H,g,hc,x,E);else{var W=x?x(Ht(s,H),j,H+"",s,d,E):l;W===l&&(W=j),cc(s,H,W)}},Dn)}function am(s,d,g,x,E,j,H){var W=Ht(s,g),K=Ht(d,g),de=H.get(K);if(de){cc(s,g,de);return}var ue=j?j(W,K,g+"",s,d,H):l,pe=ue===l;if(pe){var Te=Je(K),je=!Te&&oo(K),Ke=!Te&&!je&&Xs(K);ue=K,Te||je||Ke?Je(W)?ue=W:sn(W)?ue=fi(W):je?(pe=!1,ue=se(K,!0)):Ke?(pe=!1,ue=of(K,!0)):ue=[]:jr(K)||ds(K)?(ue=W,ds(W)?ue=Uu(W):(!Ze(W)||sr(W))&&(ue=Sc(K))):pe=!1}pe&&(H.set(K,ue),E(ue,K,x,j,H),H.delete(K)),cc(s,g,ue)}function Zh(s,d){var g=s.length;if(g)return d+=d<0?g:0,On(d,g)?s[d]:l}function eu(s,d,g){d.length?d=Mt(d,function(j){return Je(j)?function(H){return eo(H,j.length===1?j[0]:j)}:j}):d=[ii];var x=-1;d=Mt(d,dt(Ue()));var E=Yh(s,function(j,H,W){var K=Mt(d,function(de){return de(j)});return{criteria:K,index:++x,value:j}});return Gl(E,function(j,H){return cm(j,H,g)})}function fc(s,d){return tu(s,d,function(g,x){return qc(s,x)})}function tu(s,d,g){for(var x=-1,E=d.length,j={};++x<E;){var H=d[x],W=eo(s,H);g(W,H)&&Ei(j,he(H,s),W)}return j}function ef(s){return function(d){return eo(d,s)}}function yt(s,d,g,x){var E=x?Aa:To,j=-1,H=d.length,W=s;for(s===d&&(d=fi(d)),g&&(W=Mt(s,dt(g)));++j<H;)for(var K=0,de=d[j],ue=g?g(de):de;(K=E(W,ue,K,x))>-1;)W!==s&&I.call(W,K,1),I.call(s,K,1);return s}function Wa(s,d){for(var g=s?d.length:0,x=g-1;g--;){var E=d[g];if(g==x||E!==j){var j=E;On(E)?I.call(s,E,1):vc(s,E)}}return s}function pc(s,d){return s+Vt(di()*(d-s+1))}function Xt(s,d,g,x){for(var E=-1,j=Lt(jt((d-s)/(g||1)),0),H=Y(j);j--;)H[x?j:++E]=s,s+=g;return H}function gc(s,d){var g="";if(!s||d<1||d>Oe)return g;do d%2&&(g+=s),d=Vt(d/2),d&&(s+=s);while(d);return g}function st(s,d){return Oc(ni(s,d,ii),s+"")}function ui(s){return ns(ea(s))}function $i(s,d){var g=ea(s);return Nc(g,Sr(d,0,g.length))}function Ei(s,d,g,x){if(!Ze(s))return s;d=he(d,s);for(var E=-1,j=d.length,H=j-1,W=s;W!=null&&++E<j;){var K=Dr(d[E]),de=g;if(K==="__proto__"||K==="constructor"||K==="prototype")return s;if(E!=H){var ue=W[K];de=x?x(ue,K,W):l,de===l&&(de=Ze(ue)?ue:On(d[E+1])?[]:{})}Fa(W,K,de),W=W[K]}return s}var tf=oc?function(s,d){return oc.set(s,d),s}:ii,nf=Ce?function(s,d){return Ce(s,"toString",{configurable:!0,enumerable:!1,value:Yc(d),writable:!0})}:ii;function lm(s){return Nc(ea(s))}function Pi(s,d,g){var x=-1,E=s.length;d<0&&(d=-d>E?0:E+d),g=g>E?E:g,g<0&&(g+=E),E=d>g?0:g-d>>>0,d>>>=0;for(var j=Y(E);++x<E;)j[x]=s[x+d];return j}function rf(s,d){var g;return Zr(s,function(x,E,j){return g=d(x,E,j),!g}),!!g}function qa(s,d,g){var x=0,E=s==null?x:s.length;if(typeof d=="number"&&d===d&&E<=Ie){for(;x<E;){var j=x+E>>>1,H=s[j];H!==null&&!Ri(H)&&(g?H<=d:H<d)?x=j+1:E=j}return E}return mc(s,d,ii,g)}function mc(s,d,g,x){var E=0,j=s==null?0:s.length;if(j===0)return 0;d=g(d);for(var H=d!==d,W=d===null,K=Ri(d),de=d===l;E<j;){var ue=Vt((E+j)/2),pe=g(s[ue]),Te=pe!==l,je=pe===null,Ke=pe===pe,ht=Ri(pe);if(H)var We=x||Ke;else de?We=Ke&&(x||Te):W?We=Ke&&Te&&(x||!je):K?We=Ke&&Te&&!je&&(x||!ht):je||ht?We=!1:We=x?pe<=d:pe<d;We?E=ue+1:j=ue}return ft(j,et)}function nu(s,d){for(var g=-1,x=s.length,E=0,j=[];++g<x;){var H=s[g],W=d?d(H):H;if(!g||!or(W,K)){var K=W;j[E++]=H===0?0:H}}return j}function bc(s){return typeof s=="number"?s:Ri(s)?$e:+s}function hi(s){if(typeof s=="string")return s;if(Je(s))return Mt(s,hi)+"";if(Ri(s))return Mh?Mh.call(s):"";var d=s+"";return d=="0"&&1/s==-Pe?"-0":d}function no(s,d,g){var x=-1,E=Ns,j=s.length,H=!0,W=[],K=W;if(g)H=!1,E=Yi;else if(j>=v){var de=d?null:df(s);if(de)return vr(de);H=!1,E=Ao,K=new wn}else K=d?[]:W;e:for(;++x<j;){var ue=s[x],pe=d?d(ue):ue;if(ue=g||ue!==0?ue:0,H&&pe===pe){for(var Te=K.length;Te--;)if(K[Te]===pe)continue e;d&&K.push(pe),W.push(ue)}else E(K,pe,g)||(K!==W&&K.push(pe),W.push(ue))}return W}function vc(s,d){return d=he(d,s),s=Rr(s,d),s==null||delete s[Dr(Mi(d))]}function Do(s,d,g,x){return Ei(s,d,g(eo(s,d)),x)}function Nt(s,d,g,x){for(var E=s.length,j=x?E:-1;(x?j--:++j<E)&&d(s[j],j,s););return g?Pi(s,x?0:j,x?j+1:E):Pi(s,x?j+1:0,x?E:j)}function tr(s,d){var g=s;return g instanceof mt&&(g=g.value()),Xi(d,function(x,E){return E.func.apply(E.thisArg,mr([x],E.args))},g)}function jo(s,d,g){var x=s.length;if(x<2)return x?no(s[0]):[];for(var E=-1,j=Y(x);++E<x;)for(var H=s[E],W=-1;++W<x;)W!=E&&(j[E]=rs(j[E]||H,s[W],d,g));return no(In(j,1),d,g)}function Rt(s,d,g){for(var x=-1,E=s.length,j=d.length,H={};++x<E;){var W=x<j?d[x]:l;g(H,s[x],W)}return H}function nr(s){return sn(s)?s:[]}function io(s){return typeof s=="function"?s:ii}function he(s,d){return Je(s)?s:Pc(s,d)?[s]:yu(Tt(s))}var zs=st;function Ir(s,d,g){var x=s.length;return g=g===l?x:g,!d&&g>=x?s:Pi(s,d,g)}var iu=Ge||function(s){return vn.clearTimeout(s)};function se(s,d){if(d)return s.slice();var g=s.length,x=Ls?Ls(g):new s.constructor(g);return s.copy(x),x}function Ka(s){var d=new s.constructor(s.byteLength);return new Zo(d).set(new Zo(s)),d}function _c(s,d){var g=d?Ka(s.buffer):s.buffer;return new s.constructor(g,s.byteOffset,s.byteLength)}function wc(s){var d=new s.constructor(s.source,ks.exec(s));return d.lastIndex=s.lastIndex,d}function ru(s){return ot?Ot(ot.call(s)):{}}function of(s,d){var g=d?Ka(s.buffer):s.buffer;return new s.constructor(g,s.byteOffset,s.length)}function ou(s,d){if(s!==d){var g=s!==l,x=s===null,E=s===s,j=Ri(s),H=d!==l,W=d===null,K=d===d,de=Ri(d);if(!W&&!de&&!j&&s>d||j&&H&&K&&!W&&!de||x&&H&&K||!g&&K||!E)return 1;if(!x&&!j&&!de&&s<d||de&&g&&E&&!x&&!j||W&&g&&E||!H&&E||!K)return-1}return 0}function cm(s,d,g){for(var x=-1,E=s.criteria,j=d.criteria,H=E.length,W=g.length;++x<H;){var K=ou(E[x],j[x]);if(K){if(x>=W)return K;var de=g[x];return K*(de=="desc"?-1:1)}}return s.index-d.index}function Mr(s,d,g,x){for(var E=-1,j=s.length,H=g.length,W=-1,K=d.length,de=Lt(j-H,0),ue=Y(K+de),pe=!x;++W<K;)ue[W]=d[W];for(;++E<H;)(pe||E<j)&&(ue[g[E]]=s[E]);for(;de--;)ue[W++]=s[E++];return ue}function su(s,d,g,x){for(var E=-1,j=s.length,H=-1,W=g.length,K=-1,de=d.length,ue=Lt(j-W,0),pe=Y(ue+de),Te=!x;++E<ue;)pe[E]=s[E];for(var je=E;++K<de;)pe[je+K]=d[K];for(;++H<W;)(Te||E<j)&&(pe[je+g[H]]=s[E++]);return pe}function fi(s,d){var g=-1,x=s.length;for(d||(d=Y(x));++g<x;)d[g]=s[g];return d}function ir(s,d,g,x){var E=!g;g||(g={});for(var j=-1,H=d.length;++j<H;){var W=d[j],K=x?x(g[W],s[W],W,g,s):l;K===l&&(K=s[W]),E?Jr(g,W,K):Fa(g,W,K)}return g}function au(s,d){return ir(s,bu(s),d)}function Or(s,d){return ir(s,vu(s),d)}function kc(s,d){return function(g,x){var E=Je(g)?Os:$d,j=d?d():{};return E(g,s,Ue(x,2),j)}}function Bs(s){return st(function(d,g){var x=-1,E=g.length,j=E>1?g[E-1]:l,H=E>2?g[2]:l;for(j=s.length>3&&typeof j=="function"?(E--,j):l,H&&Nn(g[0],g[1],H)&&(j=E<3?l:j,E=1),d=Ot(d);++x<E;){var W=g[x];W&&s(d,W,x,j)}return d})}function Hi(s,d){return function(g,x){if(g==null)return g;if(!tn(g))return s(g,x);for(var E=g.length,j=d?E:-1,H=Ot(g);(d?j--:++j<E)&&x(H[j],j,H)!==!1;);return g}}function sf(s){return function(d,g,x){for(var E=-1,j=Ot(d),H=x(d),W=H.length;W--;){var K=H[s?W:++E];if(g(j[K],K,j)===!1)break}return d}}function yc(s,d,g){var x=d&G,E=Ga(s);function j(){var H=this&&this!==vn&&this instanceof j?E:s;return H.apply(x?g:this,arguments)}return j}function lu(s){return function(d){d=Tt(d);var g=xt(d)?cn(d):l,x=g?g[0]:d.charAt(0),E=g?Ir(g,1).join(""):d.slice(1);return x[s]()+E}}function ti(s){return function(d){return Xi(Bp(ar(d).replace(ba,"")),s,"")}}function Ga(s){return function(){var d=arguments;switch(d.length){case 0:return new s;case 1:return new s(d[0]);case 2:return new s(d[0],d[1]);case 3:return new s(d[0],d[1],d[2]);case 4:return new s(d[0],d[1],d[2],d[3]);case 5:return new s(d[0],d[1],d[2],d[3],d[4]);case 6:return new s(d[0],d[1],d[2],d[3],d[4],d[5]);case 7:return new s(d[0],d[1],d[2],d[3],d[4],d[5],d[6])}var g=Oo(s.prototype),x=s.apply(g,d);return Ze(x)?x:g}}function af(s,d,g){var x=Ga(s);function E(){for(var j=arguments.length,H=Y(j),W=j,K=Vs(E);W--;)H[W]=arguments[W];var de=j<3&&H[0]!==K&&H[j-1]!==K?[]:br(H,K);if(j-=de.length,j<g)return Cc(s,d,Ya,E.placeholder,l,H,de,l,l,g-j);var ue=this&&this!==vn&&this instanceof E?x:s;return yn(ue,this,H)}return E}function cu(s){return function(d,g,x){var E=Ot(d);if(!tn(d)){var j=Ue(g,3);d=gn(d),g=function(W){return j(E[W],W,E)}}var H=s(d,g,x);return H>-1?E[j?d[H]:H]:l}}function Qa(s){return ro(function(d){var g=d.length,x=g,E=Ai.prototype.thru;for(s&&d.reverse();x--;){var j=d[x];if(typeof j!="function")throw new En(b);if(E&&!H&&Tc(j)=="wrapper")var H=new Ai([],!0)}for(x=H?x:g;++x<g;){j=d[x];var W=Tc(j),K=W=="wrapper"?gu(j):l;K&&Ic(K[0])&&K[1]==(we|ee|re|Ae)&&!K[4].length&&K[9]==1?H=H[Tc(K[0])].apply(H,K[3]):H=j.length==1&&Ic(j)?H[W]():H.thru(j)}return function(){var de=arguments,ue=de[0];if(H&&de.length==1&&Je(ue))return H.plant(ue).value();for(var pe=0,Te=g?d[pe].apply(this,de):ue;++pe<g;)Te=d[pe].call(this,Te);return Te}})}function Ya(s,d,g,x,E,j,H,W,K,de){var ue=d&we,pe=d&G,Te=d&Q,je=d&(ee|oe),Ke=d&Ee,ht=Te?l:Ga(s);function We(){for(var pt=arguments.length,bt=Y(pt),gi=pt;gi--;)bt[gi]=arguments[gi];if(je)var qn=Vs(We),ji=Xl(bt,qn);if(x&&(bt=Mr(bt,x,E,je)),j&&(bt=su(bt,j,H,je)),pt-=ji,je&&pt<de){var un=br(bt,qn);return Cc(s,d,Ya,We.placeholder,g,bt,un,W,K,de-pt)}var lr=pe?g:this,lo=Te?lr[s]:s;return pt=bt.length,W?bt=pn(bt,W):Ke&&pt>1&&bt.reverse(),ue&&K<pt&&(bt.length=K),this&&this!==vn&&this instanceof We&&(lo=ht||Ga(lo)),lo.apply(lr,bt)}return We}function du(s,d){return function(g,x){return Gh(g,s,d(x),{})}}function Fs(s,d){return function(g,x){var E;if(g===l&&x===l)return d;if(g!==l&&(E=g),x!==l){if(E===l)return x;typeof g=="string"||typeof x=="string"?(g=hi(g),x=hi(x)):(g=bc(g),x=bc(x)),E=s(g,x)}return E}}function xc(s){return ro(function(d){return d=Mt(d,dt(Ue())),st(function(g){var x=this;return s(d,function(E){return yn(E,x,g)})})})}function Xa(s,d){d=d===l?" ":hi(d);var g=d.length;if(g<2)return g?gc(d,s):d;var x=gc(d,jt(s/_t(d)));return xt(d)?Ir(cn(x),0,s).join(""):x.slice(0,s)}function lf(s,d,g,x){var E=d&G,j=Ga(s);function H(){for(var W=-1,K=arguments.length,de=-1,ue=x.length,pe=Y(ue+K),Te=this&&this!==vn&&this instanceof H?j:s;++de<ue;)pe[de]=x[de];for(;K--;)pe[de++]=arguments[++W];return yn(Te,E?g:this,pe)}return H}function cf(s){return function(d,g,x){return x&&typeof x!="number"&&Nn(d,g,x)&&(g=x=l),d=ao(d),g===l?(g=d,d=0):g=ao(g),x=x===l?d<g?1:-1:ao(x),Xt(d,g,x,s)}}function Ja(s){return function(d,g){return typeof d=="string"&&typeof g=="string"||(d=Di(d),g=Di(g)),s(d,g)}}function Cc(s,d,g,x,E,j,H,W,K,de){var ue=d&ee,pe=ue?H:l,Te=ue?l:H,je=ue?j:l,Ke=ue?l:j;d|=ue?re:be,d&=~(ue?be:re),d&ne||(d&=~(G|Q));var ht=[s,d,E,je,pe,Ke,Te,W,K,de],We=g.apply(l,ht);return Ic(s)&&Mc(We,ht),We.placeholder=x,ku(We,s,d)}function Za(s){var d=dn[s];return function(g,x){if(g=Di(g),x=x==null?0:ft(it(x),292),x&&ge(g)){var E=(Tt(g)+"e").split("e"),j=d(E[0]+"e"+(+E[1]+x));return E=(Tt(j)+"e").split("e"),+(E[0]+"e"+(+E[1]-x))}return d(g)}}var df=Io&&1/vr(new Io([,-0]))[1]==Pe?function(s){return new Io(s)}:gl;function uu(s){return function(d){var g=Mn(d);return g==xe?Yo(d):g==rn?xn(d):Ql(d,s(d))}}function Nr(s,d,g,x,E,j,H,W){var K=d&Q;if(!K&&typeof s!="function")throw new En(b);var de=x?x.length:0;if(de||(d&=~(re|be),x=E=l),H=H===l?H:Lt(it(H),0),W=W===l?W:it(W),de-=E?E.length:0,d&be){var ue=x,pe=E;x=E=l}var Te=K?l:gu(s),je=[s,d,g,x,E,ue,pe,j,H,W];if(Te&&zt(je,Te),s=je[0],d=je[1],g=je[2],x=je[3],E=je[4],W=je[9]=je[9]===l?K?0:s.length:Lt(je[9]-de,0),!W&&d&(ee|oe)&&(d&=~(ee|oe)),!d||d==G)var Ke=yc(s,d,g);else d==ee||d==oe?Ke=af(s,d,W):(d==re||d==(G|re))&&!E.length?Ke=lf(s,d,g,x):Ke=Ya.apply(l,je);var ht=Te?tf:Mc;return ku(ht(Ke,je),s,d)}function hu(s,d,g,x){return s===l||or(s,_r[g])&&!Ct.call(x,g)?d:s}function uf(s,d,g,x,E,j){return Ze(s)&&Ze(d)&&(j.set(d,s),hc(s,d,l,uf,j),j.delete(d)),s}function el(s){return jr(s)?l:s}function hf(s,d,g,x,E,j){var H=g&F,W=s.length,K=d.length;if(W!=K&&!(H&&K>W))return!1;var de=j.get(s),ue=j.get(d);if(de&&ue)return de==d&&ue==s;var pe=-1,Te=!0,je=g&Z?new wn:l;for(j.set(s,d),j.set(d,s);++pe<W;){var Ke=s[pe],ht=d[pe];if(x)var We=H?x(ht,Ke,pe,d,s,j):x(Ke,ht,pe,s,d,j);if(We!==l){if(We)continue;Te=!1;break}if(je){if(!Ko(d,function(pt,bt){if(!Ao(je,bt)&&(Ke===pt||E(Ke,pt,g,x,j)))return je.push(bt)})){Te=!1;break}}else if(!(Ke===ht||E(Ke,ht,g,x,j))){Te=!1;break}}return j.delete(s),j.delete(d),Te}function ff(s,d,g,x,E,j,H){switch(g){case wi:if(s.byteLength!=d.byteLength||s.byteOffset!=d.byteOffset)return!1;s=s.buffer,d=d.buffer;case ur:return!(s.byteLength!=d.byteLength||!j(new Zo(s),new Zo(d)));case rt:case qe:case Fe:return or(+s,+d);case Ye:return s.name==d.name&&s.message==d.message;case Sn:case Bi:return s==d+"";case xe:var W=Yo;case rn:var K=x&F;if(W||(W=vr),s.size!=d.size&&!K)return!1;var de=H.get(s);if(de)return de==d;x|=Z,H.set(s,d);var ue=hf(W(s),W(d),x,E,j,H);return H.delete(s),ue;case uo:if(ot)return ot.call(s)==ot.call(d)}return!1}function ss(s,d,g,x,E,j){var H=g&F,W=fu(s),K=W.length,de=fu(d),ue=de.length;if(K!=ue&&!H)return!1;for(var pe=K;pe--;){var Te=W[pe];if(!(H?Te in d:Ct.call(d,Te)))return!1}var je=j.get(s),Ke=j.get(d);if(je&&Ke)return je==d&&Ke==s;var ht=!0;j.set(s,d),j.set(d,s);for(var We=H;++pe<K;){Te=W[pe];var pt=s[Te],bt=d[Te];if(x)var gi=H?x(bt,pt,Te,d,s,j):x(pt,bt,Te,s,d,j);if(!(gi===l?pt===bt||E(pt,bt,g,x,j):gi)){ht=!1;break}We||(We=Te=="constructor")}if(ht&&!We){var qn=s.constructor,ji=d.constructor;qn!=ji&&"constructor"in s&&"constructor"in d&&!(typeof qn=="function"&&qn instanceof qn&&typeof ji=="function"&&ji instanceof ji)&&(ht=!1)}return j.delete(s),j.delete(d),ht}function ro(s){return Oc(ni(s,l,xf),s+"")}function fu(s){return Wh(s,gn,bu)}function pu(s){return Wh(s,Dn,vu)}var gu=oc?function(s){return oc.get(s)}:gl;function Tc(s){for(var d=s.name+"",g=Mo[d],x=Ct.call(Mo,d)?g.length:0;x--;){var E=g[x],j=E.func;if(j==null||j==s)return E.name}return d}function Vs(s){var d=Ct.call(R,"placeholder")?R:s;return d.placeholder}function Ue(){var s=R.iteratee||Jc;return s=s===Jc?Jd:s,arguments.length?s(arguments[0],arguments[1]):s}function Ac(s,d){var g=s.__data__;return tl(d)?g[typeof d=="string"?"string":"hash"]:g.map}function mu(s){for(var d=gn(s),g=d.length;g--;){var x=d[g],E=s[x];d[g]=[x,E,wu(E)]}return d}function Ii(s,d){var g=Na(s,d);return Qh(g)?g:l}function dm(s){var d=Ct.call(s,te),g=s[te];try{s[te]=l;var x=!0}catch{}var E=wr.call(s);return x&&(d?s[te]=g:delete s[te]),E}var bu=Po?function(s){return s==null?[]:(s=Ot(s),gr(Po(s),function(d){return ic.call(s,d)}))}:na,vu=Po?function(s){for(var d=[];s;)mr(d,bu(s)),s=Qr(s);return d}:na,Mn=ei;(es&&Mn(new es(new ArrayBuffer(1)))!=wi||xr&&Mn(new xr)!=xe||rc&&Mn(rc.resolve())!=hn||Io&&Mn(new Io)!=rn||Xr&&Mn(new Xr)!=$n)&&(Mn=function(s){var d=ei(s),g=d==Et?s.constructor:l,x=g?Lo(g):"";if(x)switch(x){case Ih:return wi;case Ug:return xe;case La:return hn;case _n:return rn;case Wg:return $n}return d});function um(s,d,g){for(var x=-1,E=g.length;++x<E;){var j=g[x],H=j.size;switch(j.type){case"drop":s+=H;break;case"dropRight":d-=H;break;case"take":d=ft(d,s+H);break;case"takeRight":s=Lt(s,d-H);break}}return{start:s,end:d}}function hm(s){var d=s.match(mo);return d?d[1].split(_s):[]}function _u(s,d,g){d=he(d,s);for(var x=-1,E=d.length,j=!1;++x<E;){var H=Dr(d[x]);if(!(j=s!=null&&g(s,H)))break;s=s[H]}return j||++x!=E?j:(E=s==null?0:s.length,!!E&&hs(E)&&On(H,E)&&(Je(s)||ds(s)))}function fm(s){var d=s.length,g=new s.constructor(d);return d&&typeof s[0]=="string"&&Ct.call(s,"index")&&(g.index=s.index,g.input=s.input),g}function Sc(s){return typeof s.constructor=="function"&&!$s(s)?Oo(Qr(s)):{}}function pf(s,d,g){var x=s.constructor;switch(d){case ur:return Ka(s);case rt:case qe:return new x(+s);case wi:return _c(s,g);case ho:case Gi:case fo:case po:case go:case Yt:case Gt:case an:case ln:return of(s,g);case xe:return new x;case Fe:case Bi:return new x(s);case Sn:return wc(s);case rn:return new x;case uo:return ru(s)}}function Ec(s,d){var g=d.length;if(!g)return s;var x=g-1;return d[x]=(g>1?"& ":"")+d[x],d=d.join(g>2?", ":" "),s.replace(xi,`{ /* [wrapped with `+d+`] */ `)}function Ui(s){return Je(s)||ds(s)||!!(M&&s&&s[M])}function On(s,d){var g=typeof s;return d=d??Oe,!!d&&(g=="number"||g!="symbol"&&El.test(s))&&s>-1&&s%1==0&&s<d}function Nn(s,d,g){if(!Ze(g))return!1;var x=typeof d;return(x=="number"?tn(g)&&On(d,g.length):x=="string"&&d in g)?or(g[d],s):!1}function Pc(s,d){if(Je(s))return!1;var g=typeof s;return g=="number"||g=="symbol"||g=="boolean"||s==null||Ri(s)?!0:Al.test(s)||!md.test(s)||d!=null&&s in Ot(d)}function tl(s){var d=typeof s;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?s!=="__proto__":s===null}function Ic(s){var d=Tc(s),g=R[d];if(typeof g!="function"||!(d in mt.prototype))return!1;if(s===g)return!0;var x=gu(g);return!!x&&s===x[0]}function nl(s){return!!ja&&ja in s}var il=Xo?sr:th;function $s(s){var d=s&&s.constructor,g=typeof d=="function"&&d.prototype||_r;return s===g}function wu(s){return s===s&&!Ze(s)}function on(s,d){return function(g){return g==null?!1:g[s]===d&&(d!==l||s in Ot(g))}}function pm(s){var d=Vc(s,function(x){return g.size===B&&g.clear(),x}),g=d.cache;return d}function zt(s,d){var g=s[1],x=d[1],E=g|x,j=E<(G|Q|we),H=x==we&&g==ee||x==we&&g==Ae&&s[7].length<=d[8]||x==(we|Ae)&&d[7].length<=d[8]&&g==ee;if(!(j||H))return s;x&G&&(s[2]=d[2],E|=g&G?0:ne);var W=d[3];if(W){var K=s[3];s[3]=K?Mr(K,W,d[4]):W,s[4]=K?br(s[3],y):d[4]}return W=d[5],W&&(K=s[5],s[5]=K?su(K,W,d[6]):W,s[6]=K?br(s[5],y):d[6]),W=d[7],W&&(s[7]=W),x&we&&(s[8]=s[8]==null?d[8]:ft(s[8],d[8])),s[9]==null&&(s[9]=d[9]),s[0]=d[0],s[1]=E,s}function Tn(s){var d=[];if(s!=null)for(var g in Ot(s))d.push(g);return d}function pi(s){return wr.call(s)}function ni(s,d,g){return d=Lt(d===l?s.length-1:d,0),function(){for(var x=arguments,E=-1,j=Lt(x.length-d,0),H=Y(j);++E<j;)H[E]=x[d+E];E=-1;for(var W=Y(d+1);++E<d;)W[E]=x[E];return W[d]=g(H),yn(s,this,W)}}function Rr(s,d){return d.length<2?s:eo(s,Pi(d,0,-1))}function pn(s,d){for(var g=s.length,x=ft(d.length,g),E=fi(s);x--;){var j=d[x];s[x]=On(j,g)?E[j]:l}return s}function Ht(s,d){if(!(d==="constructor"&&typeof s[d]=="function")&&d!="__proto__")return s[d]}var Mc=Hs(tf),rl=tt||function(s,d){return vn.setTimeout(s,d)},Oc=Hs(nf);function ku(s,d,g){var x=d+"";return Oc(s,Ec(x,gm(hm(x),g)))}function Hs(s){var d=0,g=0;return function(){var x=ci(),E=_e-(x-g);if(g=x,E>0){if(++d>=fe)return arguments[0]}else d=0;return s.apply(l,arguments)}}function Nc(s,d){var g=-1,x=s.length,E=x-1;for(d=d===l?x:d;++g<d;){var j=pc(g,E),H=s[j];s[j]=s[g],s[g]=H}return s.length=d,s}var yu=pm(function(s){var d=[];return s.charCodeAt(0)===46&&d.push(""),s.replace(bd,function(g,x,E,j){d.push(E?j.replace(bo,"$1"):x||g)}),d});function Dr(s){if(typeof s=="string"||Ri(s))return s;var d=s+"";return d=="0"&&1/s==-Pe?"-0":d}function Lo(s){if(s!=null){try{return Gr.call(s)}catch{}try{return s+""}catch{}}return""}function gm(s,d){return Jn(He,function(g){var x="_."+g[0];d&g[1]&&!Ns(s,x)&&s.push(x)}),s.sort()}function gf(s){if(s instanceof mt)return s.clone();var d=new Ai(s.__wrapped__,s.__chain__);return d.__actions__=fi(s.__actions__),d.__index__=s.__index__,d.__values__=s.__values__,d}function mm(s,d,g){(g?Nn(s,d,g):d===l)?d=1:d=Lt(it(d),0);var x=s==null?0:s.length;if(!x||d<1)return[];for(var E=0,j=0,H=Y(jt(x/d));E<x;)H[j++]=Pi(s,E,E+=d);return H}function mf(s){for(var d=-1,g=s==null?0:s.length,x=0,E=[];++d<g;){var j=s[d];j&&(E[x++]=j)}return E}function bf(){var s=arguments.length;if(!s)return[];for(var d=Y(s-1),g=arguments[0],x=s;x--;)d[x-1]=arguments[x];return mr(Je(g)?fi(g):[g],In(d,1))}var vf=st(function(s,d){return sn(s)?rs(s,In(d,1,sn,!0)):[]}),_f=st(function(s,d){var g=Mi(d);return sn(g)&&(g=l),sn(s)?rs(s,In(d,1,sn,!0),Ue(g,2)):[]}),wf=st(function(s,d){var g=Mi(d);return sn(g)&&(g=l),sn(s)?rs(s,In(d,1,sn,!0),l,g):[]});function ol(s,d,g){var x=s==null?0:s.length;return x?(d=g||d===l?1:it(d),Pi(s,d<0?0:d,x)):[]}function An(s,d,g){var x=s==null?0:s.length;return x?(d=g||d===l?1:it(d),d=x-d,Pi(s,0,d<0?0:d)):[]}function rr(s,d){return s&&s.length?Nt(s,Ue(d,3),!0,!0):[]}function Rn(s,d){return s&&s.length?Nt(s,Ue(d,3),!0):[]}function bm(s,d,g,x){var E=s==null?0:s.length;return E?(g&&typeof g!="number"&&Nn(s,d,g)&&(g=0,x=E),uc(s,d,g,x)):[]}function kf(s,d,g){var x=s==null?0:s.length;if(!x)return-1;var E=g==null?0:it(g);return E<0&&(E=Lt(x+E,0)),Go(s,Ue(d,3),E)}function yf(s,d,g){var x=s==null?0:s.length;if(!x)return-1;var E=x-1;return g!==l&&(E=it(g),E=g<0?Lt(x+E,0):ft(E,x-1)),Go(s,Ue(d,3),E,!0)}function xf(s){var d=s==null?0:s.length;return d?In(s,1):[]}function xu(s){var d=s==null?0:s.length;return d?In(s,Pe):[]}function Cf(s,d){var g=s==null?0:s.length;return g?(d=d===l?1:it(d),In(s,d)):[]}function Tf(s){for(var d=-1,g=s==null?0:s.length,x={};++d<g;){var E=s[d];x[E[0]]=E[1]}return x}function Af(s){return s&&s.length?s[0]:l}function vm(s,d,g){var x=s==null?0:s.length;if(!x)return-1;var E=g==null?0:it(g);return E<0&&(E=Lt(x+E,0)),To(s,d,E)}function _m(s){var d=s==null?0:s.length;return d?Pi(s,0,-1):[]}var wm=st(function(s){var d=Mt(s,nr);return d.length&&d[0]===s[0]?Qd(d):[]}),Sf=st(function(s){var d=Mi(s),g=Mt(s,nr);return d===Mi(g)?d=l:g.pop(),g.length&&g[0]===s[0]?Qd(g,Ue(d,2)):[]}),km=st(function(s){var d=Mi(s),g=Mt(s,nr);return d=typeof d=="function"?d:l,d&&g.pop(),g.length&&g[0]===s[0]?Qd(g,l,d):[]});function ym(s,d){return s==null?"":Be.call(s,d)}function Mi(s){var d=s==null?0:s.length;return d?s[d-1]:l}function Ef(s,d,g){var x=s==null?0:s.length;if(!x)return-1;var E=x;return g!==l&&(E=it(g),E=E<0?Lt(x+E,0):ft(E,x-1)),d===d?qr(s,d,E):Go(s,Sa,E,!0)}function Pf(s,d){return s&&s.length?Zh(s,it(d)):l}var xm=st(Cu);function Cu(s,d){return s&&s.length&&d&&d.length?yt(s,d):s}function Cm(s,d,g){return s&&s.length&&d&&d.length?yt(s,d,Ue(g,2)):s}function Tu(s,d,g){return s&&s.length&&d&&d.length?yt(s,d,l,g):s}var If=ro(function(s,d){var g=s==null?0:s.length,x=Ud(s,d);return Wa(s,Mt(d,function(E){return On(E,g)?+E:E}).sort(ou)),x});function Tm(s,d){var g=[];if(!(s&&s.length))return g;var x=-1,E=[],j=s.length;for(d=Ue(d,3);++x<j;){var H=s[x];d(H,x,s)&&(g.push(H),E.push(x))}return Wa(s,E),g}function Au(s){return s==null?s:Yr.call(s)}function Mf(s,d,g){var x=s==null?0:s.length;return x?(g&&typeof g!="number"&&Nn(s,d,g)?(d=0,g=x):(d=d==null?0:it(d),g=g===l?x:it(g)),Pi(s,d,g)):[]}function Oi(s,d){return qa(s,d)}function Su(s,d,g){return mc(s,d,Ue(g,2))}function Eu(s,d){var g=s==null?0:s.length;if(g){var x=qa(s,d);if(x<g&&or(s[x],d))return x}return-1}function Pu(s,d){return qa(s,d,!0)}function as(s,d,g){return mc(s,d,Ue(g,2),!0)}function ut(s,d){var g=s==null?0:s.length;if(g){var x=qa(s,d,!0)-1;if(or(s[x],d))return x}return-1}function Ni(s){return s&&s.length?nu(s):[]}function sl(s,d){return s&&s.length?nu(s,Ue(d,2)):[]}function Am(s){var d=s==null?0:s.length;return d?Pi(s,1,d):[]}function Of(s,d,g){return s&&s.length?(d=g||d===l?1:it(d),Pi(s,0,d<0?0:d)):[]}function Rc(s,d,g){var x=s==null?0:s.length;return x?(d=g||d===l?1:it(d),d=x-d,Pi(s,d<0?0:d,x)):[]}function Nf(s,d){return s&&s.length?Nt(s,Ue(d,3),!1,!0):[]}function Sm(s,d){return s&&s.length?Nt(s,Ue(d,3)):[]}var Em=st(function(s){return no(In(s,1,sn,!0))}),Pm=st(function(s){var d=Mi(s);return sn(d)&&(d=l),no(In(s,1,sn,!0),Ue(d,2))}),Rf=st(function(s){var d=Mi(s);return d=typeof d=="function"?d:l,no(In(s,1,sn,!0),l,d)});function Df(s){return s&&s.length?no(s):[]}function jf(s,d){return s&&s.length?no(s,Ue(d,2)):[]}function Lf(s,d){return d=typeof d=="function"?d:l,s&&s.length?no(s,l,d):[]}function Dc(s){if(!(s&&s.length))return[];var d=0;return s=gr(s,function(g){if(sn(g))return d=Lt(g.length,d),!0}),Ma(d,function(g){return Mt(s,Pa(g))})}function ls(s,d){if(!(s&&s.length))return[];var g=Dc(s);return d==null?g:Mt(g,function(x){return yn(d,l,x)})}var jc=st(function(s,d){return sn(s)?rs(s,d):[]}),Iu=st(function(s){return jo(gr(s,sn))}),Mu=st(function(s){var d=Mi(s);return sn(d)&&(d=l),jo(gr(s,sn),Ue(d,2))}),zf=st(function(s){var d=Mi(s);return d=typeof d=="function"?d:l,jo(gr(s,sn),l,d)}),Im=st(Dc);function Lc(s,d){return Rt(s||[],d||[],Fa)}function Bf(s,d){return Rt(s||[],d||[],Ei)}var Jt=st(function(s){var d=s.length,g=d>1?s[d-1]:l;return g=typeof g=="function"?(s.pop(),g):l,ls(s,g)});function zc(s){var d=R(s);return d.__chain__=!0,d}function Us(s,d){return d(s),s}function Ws(s,d){return d(s)}var Ff=ro(function(s){var d=s.length,g=d?s[0]:0,x=this.__wrapped__,E=function(j){return Ud(j,s)};return d>1||this.__actions__.length||!(x instanceof mt)||!On(g)?this.thru(E):(x=x.slice(g,+g+(d?1:0)),x.__actions__.push({func:Ws,args:[E],thisArg:l}),new Ai(x,this.__chain__).thru(function(j){return d&&!j.length&&j.push(l),j}))});function Vf(){return zc(this)}function $f(){return new Ai(this.value(),this.__chain__)}function Mm(){this.__values__===l&&(this.__values__=$u(this.value()));var s=this.__index__>=this.__values__.length,d=s?l:this.__values__[this.__index__++];return{done:s,value:d}}function Hf(){return this}function Ou(s){for(var d,g=this;g instanceof za;){var x=gf(g);x.__index__=0,x.__values__=l,d?E.__wrapped__=x:d=x;var E=x;g=g.__wrapped__}return E.__wrapped__=s,d}function Uf(){var s=this.__wrapped__;if(s instanceof mt){var d=s;return this.__actions__.length&&(d=new mt(this)),d=d.reverse(),d.__actions__.push({func:Ws,args:[Au],thisArg:l}),new Ai(d,this.__chain__)}return this.thru(Au)}function Wf(){return tr(this.__wrapped__,this.__actions__)}var qs=kc(function(s,d,g){Ct.call(s,g)?++s[g]:Jr(s,g,1)});function qf(s,d,g){var x=Je(s)?xa:Jg;return g&&Nn(s,d,g)&&(d=l),x(s,Ue(d,3))}function Om(s,d){var g=Je(s)?gr:Uh;return g(s,Ue(d,3))}var Kf=cu(kf),Nu=cu(yf);function Nm(s,d){return In(Bc(s,d),1)}function Rm(s,d){return In(Bc(s,d),Pe)}function Dm(s,d,g){return g=g===l?1:it(g),In(Bc(s,d),g)}function Gf(s,d){var g=Je(s)?Jn:Zr;return g(s,Ue(d,3))}function Qf(s,d){var g=Je(s)?Wl:Er;return g(s,Ue(d,3))}var jm=kc(function(s,d,g){Ct.call(s,g)?s[g].push(d):Jr(s,g,[d])});function cs(s,d,g,x){s=tn(s)?s:ea(s),g=g&&!x?it(g):0;var E=s.length;return g<0&&(g=Lt(E+g,0)),ul(s)?g<=E&&s.indexOf(d,g)>-1:!!E&&To(s,d,g)>-1}var Yf=st(function(s,d,g){var x=-1,E=typeof d=="function",j=tn(s)?Y(s.length):[];return Zr(s,function(H){j[++x]=E?yn(d,H,g):os(H,d,g)}),j}),Xf=kc(function(s,d,g){Jr(s,g,d)});function Bc(s,d){var g=Je(s)?Mt:Yh;return g(s,Ue(d,3))}function Jf(s,d,g,x){return s==null?[]:(Je(d)||(d=d==null?[]:[d]),g=x?l:g,Je(g)||(g=g==null?[]:[g]),eu(s,d,g))}var Lm=kc(function(s,d,g){s[g?0:1].push(d)},function(){return[[],[]]});function zm(s,d,g){var x=Je(s)?Xi:Kl,E=arguments.length<3;return x(s,Ue(d,4),g,E,Zr)}function Bm(s,d,g){var x=Je(s)?Co:Kl,E=arguments.length<3;return x(s,Ue(d,4),g,E,Er)}function Fm(s,d){var g=Je(s)?gr:Uh;return g(s,ll(Ue(d,3)))}function Ru(s){var d=Je(s)?ns:ui;return d(s)}function Du(s,d,g){(g?Nn(s,d,g):d===l)?d=1:d=it(d);var x=Je(s)?Vh:$i;return x(s,d)}function ju(s){var d=Je(s)?$h:lm;return d(s)}function Lu(s){if(s==null)return 0;if(tn(s))return ul(s)?_t(s):s.length;var d=Mn(s);return d==xe||d==rn?s.size:Zd(s).length}function Zf(s,d,g){var x=Je(s)?Ko:rf;return g&&Nn(s,d,g)&&(d=l),x(s,Ue(d,3))}var ep=st(function(s,d){if(s==null)return[];var g=d.length;return g>1&&Nn(s,d[0],d[1])?d=[]:g>2&&Nn(d[0],d[1],d[2])&&(d=[d[0]]),eu(s,In(d,1),[])}),at=Qe||function(){return vn.Date.now()};function zu(s,d){if(typeof d!="function")throw new En(b);return s=it(s),function(){if(--s<1)return d.apply(this,arguments)}}function Un(s,d,g){return d=g?l:d,d=s&&d==null?s.length:d,Nr(s,we,l,l,l,l,d)}function Wn(s,d){var g;if(typeof d!="function")throw new En(b);return s=it(s),function(){return--s>0&&(g=d.apply(this,arguments)),s<=1&&(d=l),g}}var Ks=st(function(s,d,g){var x=G;if(g.length){var E=br(g,Vs(Ks));x|=re}return Nr(s,x,d,g,E)}),al=st(function(s,d,g){var x=G|Q;if(g.length){var E=br(g,Vs(al));x|=re}return Nr(d,x,s,g,E)});function tp(s,d,g){d=g?l:d;var x=Nr(s,ee,l,l,l,l,l,d);return x.placeholder=tp.placeholder,x}function np(s,d,g){d=g?l:d;var x=Nr(s,oe,l,l,l,l,l,d);return x.placeholder=np.placeholder,x}function Gs(s,d,g){var x,E,j,H,W,K,de=0,ue=!1,pe=!1,Te=!0;if(typeof s!="function")throw new En(b);d=Di(d)||0,Ze(g)&&(ue=!!g.leading,pe="maxWait"in g,j=pe?Lt(Di(g.maxWait)||0,d):j,Te="trailing"in g?!!g.trailing:Te);function je(un){var lr=x,lo=E;return x=E=l,de=un,H=s.apply(lo,lr),H}function Ke(un){return de=un,W=rl(pt,d),ue?je(un):H}function ht(un){var lr=un-K,lo=un-de,sh=d-lr;return pe?ft(sh,j-lo):sh}function We(un){var lr=un-K,lo=un-de;return K===l||lr>=d||lr<0||pe&&lo>=j}function pt(){var un=at();if(We(un))return bt(un);W=rl(pt,ht(un))}function bt(un){return W=l,Te&&x?je(un):(x=E=l,H)}function gi(){W!==l&&iu(W),de=0,x=K=E=W=l}function qn(){return W===l?H:bt(at())}function ji(){var un=at(),lr=We(un);if(x=arguments,E=this,K=un,lr){if(W===l)return Ke(K);if(pe)return iu(W),W=rl(pt,d),je(K)}return W===l&&(W=rl(pt,d)),H}return ji.cancel=gi,ji.flush=qn,ji}var Vm=st(function(s,d){return is(s,1,d)}),Fc=st(function(s,d,g){return is(s,Di(d)||0,g)});function ip(s){return Nr(s,Ee)}function Vc(s,d){if(typeof s!="function"||d!=null&&typeof d!="function")throw new En(b);var g=function(){var x=arguments,E=d?d.apply(this,x):x[0],j=g.cache;if(j.has(E))return j.get(E);var H=s.apply(this,x);return g.cache=j.set(E,H)||j,H};return g.cache=new(Vc.Cache||Ar),g}Vc.Cache=Ar;function ll(s){if(typeof s!="function")throw new En(b);return function(){var d=arguments;switch(d.length){case 0:return!s.call(this);case 1:return!s.call(this,d[0]);case 2:return!s.call(this,d[0],d[1]);case 3:return!s.call(this,d[0],d[1],d[2])}return!s.apply(this,d)}}function rp(s){return Wn(2,s)}var $m=zs(function(s,d){d=d.length==1&&Je(d[0])?Mt(d[0],dt(Ue())):Mt(In(d,1),dt(Ue()));var g=d.length;return st(function(x){for(var E=-1,j=ft(x.length,g);++E<j;)x[E]=d[E].call(this,x[E]);return yn(s,this,x)})}),cl=st(function(s,d){var g=br(d,Vs(cl));return Nr(s,re,l,d,g)}),wt=st(function(s,d){var g=br(d,Vs(wt));return Nr(s,be,l,d,g)}),Hm=ro(function(s,d){return Nr(s,Ae,l,l,l,d)});function op(s,d){if(typeof s!="function")throw new En(b);return d=d===l?d:it(d),st(s,d)}function Um(s,d){if(typeof s!="function")throw new En(b);return d=d==null?0:Lt(it(d),0),st(function(g){var x=g[d],E=Ir(g,0,d);return x&&mr(E,x),yn(s,this,E)})}function Wm(s,d,g){var x=!0,E=!0;if(typeof s!="function")throw new En(b);return Ze(g)&&(x="leading"in g?!!g.leading:x,E="trailing"in g?!!g.trailing:E),Gs(s,d,{leading:x,maxWait:d,trailing:E})}function sp(s){return Un(s,1)}function ap(s,d){return cl(io(d),s)}function lp(){if(!arguments.length)return[];var s=arguments[0];return Je(s)?s:[s]}function cp(s){return Si(s,V)}function Qs(s,d){return d=typeof d=="function"?d:l,Si(s,V,d)}function qm(s){return Si(s,L|V)}function $c(s,d){return d=typeof d=="function"?d:l,Si(s,L|V,d)}function Ys(s,d){return d==null||Va(s,d,gn(d))}function or(s,d){return s===d||s!==s&&d!==d}var Km=Ja(Gd),Bu=Ja(function(s,d){return s>=d}),ds=to(function(){return arguments}())?to:function(s){return Zt(s)&&Ct.call(s,"callee")&&!ic.call(s,"callee")},Je=Y.isArray,dp=Ul?dt(Ul):em;function tn(s){return s!=null&&hs(s.length)&&!sr(s)}function sn(s){return Zt(s)&&tn(s)}function Gm(s){return s===!0||s===!1||Zt(s)&&ei(s)==rt}var oo=Zn||th,up=ya?dt(ya):Yd;function Hc(s){return Zt(s)&&s.nodeType===1&&!jr(s)}function hp(s){if(s==null)return!0;if(tn(s)&&(Je(s)||typeof s=="string"||typeof s.splice=="function"||oo(s)||Xs(s)||ds(s)))return!s.length;var d=Mn(s);if(d==xe||d==rn)return!s.size;if($s(s))return!Zd(s).length;for(var g in s)if(Ct.call(s,g))return!1;return!0}function fp(s,d){return Ha(s,d)}function Qm(s,d,g){g=typeof g=="function"?g:l;var x=g?g(s,d):l;return x===l?Ha(s,d,l,g):!!x}function us(s){if(!Zt(s))return!1;var d=ei(s);return d==Ye||d==lt||typeof s.message=="string"&&typeof s.name=="string"&&!jr(s)}function pp(s){return typeof s=="number"&&ge(s)}function sr(s){if(!Ze(s))return!1;var d=ei(s);return d==en||d==Vn||d==gt||d==Yn}function gp(s){return typeof s=="number"&&s==it(s)}function hs(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Oe}function Ze(s){var d=typeof s;return s!=null&&(d=="object"||d=="function")}function Zt(s){return s!=null&&typeof s=="object"}var mp=ko?dt(ko):nm;function Ym(s,d){return s===d||Xd(s,d,mu(d))}function Uc(s,d,g){return g=typeof g=="function"?g:l,Xd(s,d,mu(d),g)}function Xm(s){return bp(s)&&s!=+s}function Fu(s){if(il(s))throw new Xe(w);return Qh(s)}function dl(s){return s===null}function Jm(s){return s==null}function bp(s){return typeof s=="number"||Zt(s)&&ei(s)==Fe}function jr(s){if(!Zt(s)||ei(s)!=Et)return!1;var d=Qr(s);if(d===null)return!0;var g=Ct.call(d,"constructor")&&d.constructor;return typeof g=="function"&&g instanceof g&&Gr.call(g)==fn}var so=Ms?dt(Ms):im;function vp(s){return gp(s)&&s>=-Oe&&s<=Oe}var Vu=yo?dt(yo):rm;function ul(s){return typeof s=="string"||!Je(s)&&Zt(s)&&ei(s)==Bi}function Ri(s){return typeof s=="symbol"||Zt(s)&&ei(s)==uo}var Xs=xo?dt(xo):om;function Zm(s){return s===l}function _p(s){return Zt(s)&&Mn(s)==$n}function wp(s){return Zt(s)&&ei(s)==bs}var hl=Ja(Ua),eb=Ja(function(s,d){return s<=d});function $u(s){if(!s)return[];if(tn(s))return ul(s)?cn(s):fi(s);if($&&s[$])return Nd(s[$]());var d=Mn(s),g=d==xe?Yo:d==rn?vr:ea;return g(s)}function ao(s){if(!s)return s===0?s:0;if(s=Di(s),s===Pe||s===-Pe){var d=s<0?-1:1;return d*nt}return s===s?s:0}function it(s){var d=ao(s),g=d%1;return d===d?g?d-g:d:0}function Hu(s){return s?Sr(it(s),0,De):0}function Di(s){if(typeof s=="number")return s;if(Ri(s))return $e;if(Ze(s)){var d=typeof s.valueOf=="function"?s.valueOf():s;s=Ze(d)?d+"":d}if(typeof s!="string")return s===0?s:+s;s=Yl(s);var g=$r.test(s);return g||kd.test(s)?Hl(s.slice(2),g?2:8):Wt.test(s)?$e:+s}function Uu(s){return ir(s,Dn(s))}function tb(s){return s?Sr(it(s),-Oe,Oe):s===0?s:0}function Tt(s){return s==null?"":hi(s)}var nb=Bs(function(s,d){if($s(d)||tn(d)){ir(d,gn(d),s);return}for(var g in d)Ct.call(d,g)&&Fa(s,g,d[g])}),Wu=Bs(function(s,d){ir(d,Dn(d),s)}),Js=Bs(function(s,d,g,x){ir(d,Dn(d),s,x)}),ib=Bs(function(s,d,g,x){ir(d,gn(d),s,x)}),rb=ro(Ud);function kp(s,d){var g=Oo(s);return d==null?g:Hd(g,d)}var ob=st(function(s,d){s=Ot(s);var g=-1,x=d.length,E=x>2?d[2]:l;for(E&&Nn(d[0],d[1],E)&&(x=1);++g<x;)for(var j=d[g],H=Dn(j),W=-1,K=H.length;++W<K;){var de=H[W],ue=s[de];(ue===l||or(ue,_r[de])&&!Ct.call(s,de))&&(s[de]=j[de])}return s}),sb=st(function(s){return s.push(l,uf),yn(Sp,l,s)});function ab(s,d){return Ta(s,Ue(d,3),Pr)}function lb(s,d){return Ta(s,Ue(d,3),Kd)}function cb(s,d){return s==null?s:Wd(s,Ue(d,3),Dn)}function yp(s,d){return s==null?s:qd(s,Ue(d,3),Dn)}function db(s,d){return s&&Pr(s,Ue(d,3))}function ub(s,d){return s&&Kd(s,Ue(d,3))}function xp(s){return s==null?[]:$a(s,gn(s))}function Cp(s){return s==null?[]:$a(s,Dn(s))}function Wc(s,d,g){var x=s==null?l:eo(s,d);return x===l?g:x}function hb(s,d){return s!=null&&_u(s,d,qh)}function qc(s,d){return s!=null&&_u(s,d,Zg)}var qu=du(function(s,d,g){d!=null&&typeof d.toString!="function"&&(d=wr.call(d)),s[d]=g},Yc(ii)),Tp=du(function(s,d,g){d!=null&&typeof d.toString!="function"&&(d=wr.call(d)),Ct.call(s,d)?s[d].push(g):s[d]=[g]},Ue),Ku=st(os);function gn(s){return tn(s)?Vd(s):Zd(s)}function Dn(s){return tn(s)?Vd(s,!0):sm(s)}function Kc(s,d){var g={};return d=Ue(d,3),Pr(s,function(x,E,j){Jr(g,d(x,E,j),x)}),g}function Ap(s,d){var g={};return d=Ue(d,3),Pr(s,function(x,E,j){Jr(g,E,d(x,E,j))}),g}var fb=Bs(function(s,d,g){hc(s,d,g)}),Sp=Bs(function(s,d,g,x){hc(s,d,g,x)}),pb=ro(function(s,d){var g={};if(s==null)return g;var x=!1;d=Mt(d,function(j){return j=he(j,s),x||(x=j.length>1),j}),ir(s,pu(s),g),x&&(g=Si(g,L|O|V,el));for(var E=d.length;E--;)vc(g,d[E]);return g});function Ep(s,d){return Pp(s,ll(Ue(d)))}var gb=ro(function(s,d){return s==null?{}:fc(s,d)});function Pp(s,d){if(s==null)return{};var g=Mt(pu(s),function(x){return[x]});return d=Ue(d),tu(s,g,function(x,E){return d(x,E[0])})}function mb(s,d,g){d=he(d,s);var x=-1,E=d.length;for(E||(E=1,s=l);++x<E;){var j=s==null?l:s[Dr(d[x])];j===l&&(x=E,j=g),s=sr(j)?j.call(s):j}return s}function bb(s,d,g){return s==null?s:Ei(s,d,g)}function Zs(s,d,g,x){return x=typeof x=="function"?x:l,s==null?s:Ei(s,d,g,x)}var fs=uu(gn),Gu=uu(Dn);function Ip(s,d,g){var x=Je(s),E=x||oo(s)||Xs(s);if(d=Ue(d,4),g==null){var j=s&&s.constructor;E?g=x?new j:[]:Ze(s)?g=sr(j)?Oo(Qr(s)):{}:g={}}return(E?Jn:Pr)(s,function(H,W,K){return d(g,H,W,K)}),g}function vb(s,d){return s==null?!0:vc(s,d)}function _b(s,d,g){return s==null?s:Do(s,d,io(g))}function wb(s,d,g,x){return x=typeof x=="function"?x:l,s==null?s:Do(s,d,io(g),x)}function ea(s){return s==null?[]:Qo(s,gn(s))}function kb(s){return s==null?[]:Qo(s,Dn(s))}function Mp(s,d,g){return g===l&&(g=d,d=l),g!==l&&(g=Di(g),g=g===g?g:0),d!==l&&(d=Di(d),d=d===d?d:0),Sr(Di(s),d,g)}function Op(s,d,g){return d=ao(d),g===l?(g=d,d=0):g=ao(g),s=Di(s),Kh(s,d,g)}function yb(s,d,g){if(g&&typeof g!="boolean"&&Nn(s,d,g)&&(d=g=l),g===l&&(typeof d=="boolean"?(g=d,d=l):typeof s=="boolean"&&(g=s,s=l)),s===l&&d===l?(s=0,d=1):(s=ao(s),d===l?(d=s,s=0):d=ao(d)),s>d){var x=s;s=d,d=x}if(g||s%1||d%1){var E=di();return ft(s+E*(d-s+_a("1e-"+((E+"").length-1))),d)}return pc(s,d)}var Np=ti(function(s,d,g){return d=d.toLowerCase(),s+(g?Qu(d):d)});function Qu(s){return Xu(Tt(s).toLowerCase())}function ar(s){return s=Tt(s),s&&s.replace(Hr,Md).replace(Ad,"")}function Yu(s,d,g){s=Tt(s),d=hi(d);var x=s.length;g=g===l?x:Sr(it(g),0,x);var E=g;return g-=d.length,g>=0&&s.slice(g,E)==d}function xb(s){return s=Tt(s),s&&oi.test(s)?s.replace(It,ai):s}function Cb(s){return s=Tt(s),s&&vd.test(s)?s.replace(Fo,"\\$&"):s}var Tb=ti(function(s,d,g){return s+(g?"-":"")+d.toLowerCase()}),Ab=ti(function(s,d,g){return s+(g?" ":"")+d.toLowerCase()}),zo=lu("toLowerCase");function ta(s,d,g){s=Tt(s),d=it(d);var x=d?_t(s):0;if(!d||x>=d)return s;var E=(d-x)/2;return Xa(Vt(E),g)+s+Xa(jt(E),g)}function Rp(s,d,g){s=Tt(s),d=it(d);var x=d?_t(s):0;return d&&x<d?s+Xa(d-x,g):s}function Gc(s,d,g){s=Tt(s),d=it(d);var x=d?_t(s):0;return d&&x<d?Xa(d-x,g)+s:s}function Dp(s,d,g){return g||d==null?d=0:d&&(d=+d),Cn(Tt(s).replace(ha,""),d||0)}function Sb(s,d,g){return(g?Nn(s,d,g):d===l)?d=1:d=it(d),gc(Tt(s),d)}function Eb(){var s=arguments,d=Tt(s[0]);return s.length<3?d:d.replace(s[1],s[2])}var Pb=ti(function(s,d,g){return s+(g?"_":"")+d.toLowerCase()});function Ib(s,d,g){return g&&typeof g!="number"&&Nn(s,d,g)&&(d=g=l),g=g===l?De:g>>>0,g?(s=Tt(s),s&&(typeof d=="string"||d!=null&&!so(d))&&(d=hi(d),!d&&xt(s))?Ir(cn(s),0,g):s.split(d,g)):[]}var Mb=ti(function(s,d,g){return s+(g?" ":"")+Xu(d)});function Qc(s,d,g){return s=Tt(s),g=g==null?0:Sr(it(g),0,s.length),d=hi(d),s.slice(g,g+d.length)==d}function jp(s,d,g){var x=R.templateSettings;g&&Nn(s,d,g)&&(d=l),s=Tt(s),d=Js({},d,x,hu);var E=Js({},d.imports,x.imports,hu),j=gn(E),H=Qo(E,j),W,K,de=0,ue=d.interpolate||Le,pe="__p += '",Te=js((d.escape||Le).source+"|"+ue.source+"|"+(ue===vs?Sl:Le).source+"|"+(d.evaluate||Le).source+"|$","g"),je="//# sourceURL="+(Ct.call(d,"sourceURL")?(d.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Vl+"]")+` `;s.replace(Te,function(We,pt,bt,gi,qn,ji){return bt||(bt=gi),pe+=s.slice(de,ji).replace(me,li),pt&&(W=!0,pe+=`' + __e(`+pt+`) + '`),qn&&(K=!0,pe+=`'; `+qn+`; __p += '`),bt&&(pe+=`' + ((__t = (`+bt+`)) == null ? '' : __t) + '`),de=ji+We.length,We}),pe+=`'; `;var Ke=Ct.call(d,"variable")&&d.variable;if(!Ke)pe=`with (obj) { `+pe+` } `;else if(Vr.test(Ke))throw new Xe(T);pe=(K?pe.replace(kn,""):pe).replace(bn,"$1").replace(Pt,"$1;"),pe="function("+(Ke||"obj")+`) { `+(Ke?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(W?", __e = _.escape":"")+(K?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+pe+`return __p }`;var ht=Ju(function(){return kt(j,je+"return "+pe).apply(l,H)});if(ht.source=pe,us(ht))throw ht;return ht}function Lp(s){return Tt(s).toLowerCase()}function Ob(s){return Tt(s).toUpperCase()}function Nb(s,d,g){if(s=Tt(s),s&&(g||d===l))return Yl(s);if(!s||!(d=hi(d)))return s;var x=cn(s),E=cn(d),j=Ji(x,E),H=Oa(x,E)+1;return Ir(x,j,H).join("")}function Rb(s,d,g){if(s=Tt(s),s&&(g||d===l))return s.slice(0,Ti(s)+1);if(!s||!(d=hi(d)))return s;var x=cn(s),E=Oa(x,cn(d))+1;return Ir(x,0,E).join("")}function Db(s,d,g){if(s=Tt(s),s&&(g||d===l))return s.replace(ha,"");if(!s||!(d=hi(d)))return s;var x=cn(s),E=Ji(x,cn(d));return Ir(x,E).join("")}function zp(s,d){var g=Ne,x=ie;if(Ze(d)){var E="separator"in d?d.separator:E;g="length"in d?it(d.length):g,x="omission"in d?hi(d.omission):x}s=Tt(s);var j=s.length;if(xt(s)){var H=cn(s);j=H.length}if(g>=j)return s;var W=g-_t(x);if(W<1)return x;var K=H?Ir(H,0,W).join(""):s.slice(0,W);if(E===l)return K+x;if(H&&(W+=K.length-W),so(E)){if(s.slice(W).search(E)){var de,ue=K;for(E.global||(E=js(E.source,Tt(ks.exec(E))+"g")),E.lastIndex=0;de=E.exec(ue);)var pe=de.index;K=K.slice(0,pe===l?W:pe)}}else if(s.indexOf(hi(E),W)!=W){var Te=K.lastIndexOf(E);Te>-1&&(K=K.slice(0,Te))}return K+x}function jb(s){return s=Tt(s),s&&yi.test(s)?s.replace(ki,Vi):s}var Lb=ti(function(s,d,g){return s+(g?" ":"")+d.toUpperCase()}),Xu=lu("toUpperCase");function Bp(s,d,g){return s=Tt(s),d=g?l:d,d===l?Od(s)?Ds(s):Ca(s):s.match(d)||[]}var Ju=st(function(s,d){try{return yn(s,l,d)}catch(g){return us(g)?g:new Xe(g)}}),zb=ro(function(s,d){return Jn(d,function(g){g=Dr(g),Jr(s,g,Ks(s[g],s))}),s});function fl(s){var d=s==null?0:s.length,g=Ue();return s=d?Mt(s,function(x){if(typeof x[1]!="function")throw new En(b);return[g(x[0]),x[1]]}):[],st(function(x){for(var E=-1;++E<d;){var j=s[E];if(yn(j[0],this,x))return yn(j[1],this,x)}})}function Bb(s){return Hh(Si(s,L))}function Yc(s){return function(){return s}}function Fb(s,d){return s==null||s!==s?d:s}var Vb=Qa(),Xc=Qa(!0);function ii(s){return s}function Jc(s){return Jd(typeof s=="function"?s:Si(s,L))}function Fp(s){return Xh(Si(s,L))}function $b(s,d){return Jh(s,Si(d,L))}var Zu=st(function(s,d){return function(g){return os(g,s,d)}}),Hb=st(function(s,d){return function(g){return os(s,g,d)}});function pl(s,d,g){var x=gn(d),E=$a(d,x);g==null&&!(Ze(d)&&(E.length||!x.length))&&(g=d,d=s,s=this,E=$a(d,gn(d)));var j=!(Ze(g)&&"chain"in g)||!!g.chain,H=sr(s);return Jn(E,function(W){var K=d[W];s[W]=K,H&&(s.prototype[W]=function(){var de=this.__chain__;if(j||de){var ue=s(this.__wrapped__),pe=ue.__actions__=fi(this.__actions__);return pe.push({func:K,args:arguments,thisArg:s}),ue.__chain__=de,ue}return K.apply(s,mr([this.value()],arguments))})}),s}function Vp(){return vn._===this&&(vn._=Jo),this}function gl(){}function Lr(s){return s=it(s),st(function(d){return Zh(d,s)})}var $p=xc(Mt),Ub=xc(xa),Wb=xc(Ko);function eh(s){return Pc(s)?Pa(Dr(s)):ef(s)}function qb(s){return function(d){return s==null?l:eo(s,d)}}var Hp=cf(),Up=cf(!0);function na(){return[]}function th(){return!1}function Kb(){return{}}function Wp(){return""}function qp(){return!0}function Kp(s,d){if(s=it(s),s<1||s>Oe)return[];var g=De,x=ft(s,De);d=Ue(d),s-=De;for(var E=Ma(x,d);++g<s;)d(g);return E}function Gb(s){return Je(s)?Mt(s,Dr):Ri(s)?[s]:fi(yu(Tt(s)))}function Qb(s){var d=++tc;return Tt(s)+d}var Yb=Fs(function(s,d){return s+d},0),nh=Za("ceil"),ih=Fs(function(s,d){return s/d},1),Xb=Za("floor");function Jb(s){return s&&s.length?dc(s,ii,Gd):l}function Gp(s,d){return s&&s.length?dc(s,Ue(d,2),Gd):l}function Zb(s){return Ea(s,ii)}function ev(s,d){return Ea(s,Ue(d,2))}function tv(s){return s&&s.length?dc(s,ii,Ua):l}function Qp(s,d){return s&&s.length?dc(s,Ue(d,2),Ua):l}var Yp=Fs(function(s,d){return s*d},1),rh=Za("round"),oh=Fs(function(s,d){return s-d},0);function Xp(s){return s&&s.length?Ia(s,ii):0}function Jp(s,d){return s&&s.length?Ia(s,Ue(d,2)):0}return R.after=zu,R.ary=Un,R.assign=nb,R.assignIn=Wu,R.assignInWith=Js,R.assignWith=ib,R.at=rb,R.before=Wn,R.bind=Ks,R.bindAll=zb,R.bindKey=al,R.castArray=lp,R.chain=zc,R.chunk=mm,R.compact=mf,R.concat=bf,R.cond=fl,R.conforms=Bb,R.constant=Yc,R.countBy=qs,R.create=kp,R.curry=tp,R.curryRight=np,R.debounce=Gs,R.defaults=ob,R.defaultsDeep=sb,R.defer=Vm,R.delay=Fc,R.difference=vf,R.differenceBy=_f,R.differenceWith=wf,R.drop=ol,R.dropRight=An,R.dropRightWhile=rr,R.dropWhile=Rn,R.fill=bm,R.filter=Om,R.flatMap=Nm,R.flatMapDeep=Rm,R.flatMapDepth=Dm,R.flatten=xf,R.flattenDeep=xu,R.flattenDepth=Cf,R.flip=ip,R.flow=Vb,R.flowRight=Xc,R.fromPairs=Tf,R.functions=xp,R.functionsIn=Cp,R.groupBy=jm,R.initial=_m,R.intersection=wm,R.intersectionBy=Sf,R.intersectionWith=km,R.invert=qu,R.invertBy=Tp,R.invokeMap=Yf,R.iteratee=Jc,R.keyBy=Xf,R.keys=gn,R.keysIn=Dn,R.map=Bc,R.mapKeys=Kc,R.mapValues=Ap,R.matches=Fp,R.matchesProperty=$b,R.memoize=Vc,R.merge=fb,R.mergeWith=Sp,R.method=Zu,R.methodOf=Hb,R.mixin=pl,R.negate=ll,R.nthArg=Lr,R.omit=pb,R.omitBy=Ep,R.once=rp,R.orderBy=Jf,R.over=$p,R.overArgs=$m,R.overEvery=Ub,R.overSome=Wb,R.partial=cl,R.partialRight=wt,R.partition=Lm,R.pick=gb,R.pickBy=Pp,R.property=eh,R.propertyOf=qb,R.pull=xm,R.pullAll=Cu,R.pullAllBy=Cm,R.pullAllWith=Tu,R.pullAt=If,R.range=Hp,R.rangeRight=Up,R.rearg=Hm,R.reject=Fm,R.remove=Tm,R.rest=op,R.reverse=Au,R.sampleSize=Du,R.set=bb,R.setWith=Zs,R.shuffle=ju,R.slice=Mf,R.sortBy=ep,R.sortedUniq=Ni,R.sortedUniqBy=sl,R.split=Ib,R.spread=Um,R.tail=Am,R.take=Of,R.takeRight=Rc,R.takeRightWhile=Nf,R.takeWhile=Sm,R.tap=Us,R.throttle=Wm,R.thru=Ws,R.toArray=$u,R.toPairs=fs,R.toPairsIn=Gu,R.toPath=Gb,R.toPlainObject=Uu,R.transform=Ip,R.unary=sp,R.union=Em,R.unionBy=Pm,R.unionWith=Rf,R.uniq=Df,R.uniqBy=jf,R.uniqWith=Lf,R.unset=vb,R.unzip=Dc,R.unzipWith=ls,R.update=_b,R.updateWith=wb,R.values=ea,R.valuesIn=kb,R.without=jc,R.words=Bp,R.wrap=ap,R.xor=Iu,R.xorBy=Mu,R.xorWith=zf,R.zip=Im,R.zipObject=Lc,R.zipObjectDeep=Bf,R.zipWith=Jt,R.entries=fs,R.entriesIn=Gu,R.extend=Wu,R.extendWith=Js,pl(R,R),R.add=Yb,R.attempt=Ju,R.camelCase=Np,R.capitalize=Qu,R.ceil=nh,R.clamp=Mp,R.clone=cp,R.cloneDeep=qm,R.cloneDeepWith=$c,R.cloneWith=Qs,R.conformsTo=Ys,R.deburr=ar,R.defaultTo=Fb,R.divide=ih,R.endsWith=Yu,R.eq=or,R.escape=xb,R.escapeRegExp=Cb,R.every=qf,R.find=Kf,R.findIndex=kf,R.findKey=ab,R.findLast=Nu,R.findLastIndex=yf,R.findLastKey=lb,R.floor=Xb,R.forEach=Gf,R.forEachRight=Qf,R.forIn=cb,R.forInRight=yp,R.forOwn=db,R.forOwnRight=ub,R.get=Wc,R.gt=Km,R.gte=Bu,R.has=hb,R.hasIn=qc,R.head=Af,R.identity=ii,R.includes=cs,R.indexOf=vm,R.inRange=Op,R.invoke=Ku,R.isArguments=ds,R.isArray=Je,R.isArrayBuffer=dp,R.isArrayLike=tn,R.isArrayLikeObject=sn,R.isBoolean=Gm,R.isBuffer=oo,R.isDate=up,R.isElement=Hc,R.isEmpty=hp,R.isEqual=fp,R.isEqualWith=Qm,R.isError=us,R.isFinite=pp,R.isFunction=sr,R.isInteger=gp,R.isLength=hs,R.isMap=mp,R.isMatch=Ym,R.isMatchWith=Uc,R.isNaN=Xm,R.isNative=Fu,R.isNil=Jm,R.isNull=dl,R.isNumber=bp,R.isObject=Ze,R.isObjectLike=Zt,R.isPlainObject=jr,R.isRegExp=so,R.isSafeInteger=vp,R.isSet=Vu,R.isString=ul,R.isSymbol=Ri,R.isTypedArray=Xs,R.isUndefined=Zm,R.isWeakMap=_p,R.isWeakSet=wp,R.join=ym,R.kebabCase=Tb,R.last=Mi,R.lastIndexOf=Ef,R.lowerCase=Ab,R.lowerFirst=zo,R.lt=hl,R.lte=eb,R.max=Jb,R.maxBy=Gp,R.mean=Zb,R.meanBy=ev,R.min=tv,R.minBy=Qp,R.stubArray=na,R.stubFalse=th,R.stubObject=Kb,R.stubString=Wp,R.stubTrue=qp,R.multiply=Yp,R.nth=Pf,R.noConflict=Vp,R.noop=gl,R.now=at,R.pad=ta,R.padEnd=Rp,R.padStart=Gc,R.parseInt=Dp,R.random=yb,R.reduce=zm,R.reduceRight=Bm,R.repeat=Sb,R.replace=Eb,R.result=mb,R.round=rh,R.runInContext=q,R.sample=Ru,R.size=Lu,R.snakeCase=Pb,R.some=Zf,R.sortedIndex=Oi,R.sortedIndexBy=Su,R.sortedIndexOf=Eu,R.sortedLastIndex=Pu,R.sortedLastIndexBy=as,R.sortedLastIndexOf=ut,R.startCase=Mb,R.startsWith=Qc,R.subtract=oh,R.sum=Xp,R.sumBy=Jp,R.template=jp,R.times=Kp,R.toFinite=ao,R.toInteger=it,R.toLength=Hu,R.toLower=Lp,R.toNumber=Di,R.toSafeInteger=tb,R.toString=Tt,R.toUpper=Ob,R.trim=Nb,R.trimEnd=Rb,R.trimStart=Db,R.truncate=zp,R.unescape=jb,R.uniqueId=Qb,R.upperCase=Lb,R.upperFirst=Xu,R.each=Gf,R.eachRight=Qf,R.first=Af,pl(R,function(){var s={};return Pr(R,function(d,g){Ct.call(R.prototype,g)||(s[g]=d)}),s}(),{chain:!1}),R.VERSION=f,Jn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){R[s].placeholder=R}),Jn(["drop","take"],function(s,d){mt.prototype[s]=function(g){g=g===l?1:Lt(it(g),0);var x=this.__filtered__&&!d?new mt(this):this.clone();return x.__filtered__?x.__takeCount__=ft(g,x.__takeCount__):x.__views__.push({size:ft(g,De),type:s+(x.__dir__<0?"Right":"")}),x},mt.prototype[s+"Right"]=function(g){return this.reverse()[s](g).reverse()}}),Jn(["filter","map","takeWhile"],function(s,d){var g=d+1,x=g==ve||g==Se;mt.prototype[s]=function(E){var j=this.clone();return j.__iteratees__.push({iteratee:Ue(E,3),type:g}),j.__filtered__=j.__filtered__||x,j}}),Jn(["head","last"],function(s,d){var g="take"+(d?"Right":"");mt.prototype[s]=function(){return this[g](1).value()[0]}}),Jn(["initial","tail"],function(s,d){var g="drop"+(d?"":"Right");mt.prototype[s]=function(){return this.__filtered__?new mt(this):this[g](1)}}),mt.prototype.compact=function(){return this.filter(ii)},mt.prototype.find=function(s){return this.filter(s).head()},mt.prototype.findLast=function(s){return this.reverse().find(s)},mt.prototype.invokeMap=st(function(s,d){return typeof s=="function"?new mt(this):this.map(function(g){return os(g,s,d)})}),mt.prototype.reject=function(s){return this.filter(ll(Ue(s)))},mt.prototype.slice=function(s,d){s=it(s);var g=this;return g.__filtered__&&(s>0||d<0)?new mt(g):(s<0?g=g.takeRight(-s):s&&(g=g.drop(s)),d!==l&&(d=it(d),g=d<0?g.dropRight(-d):g.take(d-s)),g)},mt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},mt.prototype.toArray=function(){return this.take(De)},Pr(mt.prototype,function(s,d){var g=/^(?:filter|find|map|reject)|While$/.test(d),x=/^(?:head|last)$/.test(d),E=R[x?"take"+(d=="last"?"Right":""):d],j=x||/^find/.test(d);E&&(R.prototype[d]=function(){var H=this.__wrapped__,W=x?[1]:arguments,K=H instanceof mt,de=W[0],ue=K||Je(H),pe=function(pt){var bt=E.apply(R,mr([pt],W));return x&&Te?bt[0]:bt};ue&&g&&typeof de=="function"&&de.length!=1&&(K=ue=!1);var Te=this.__chain__,je=!!this.__actions__.length,Ke=j&&!Te,ht=K&&!je;if(!j&&ue){H=ht?H:new mt(this);var We=s.apply(H,W);return We.__actions__.push({func:Ws,args:[pe],thisArg:l}),new Ai(We,Te)}return Ke&&ht?s.apply(this,W):(We=this.thru(pe),Ke?x?We.value()[0]:We.value():We)})}),Jn(["pop","push","shift","sort","splice","unshift"],function(s){var d=So[s],g=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",x=/^(?:pop|shift)$/.test(s);R.prototype[s]=function(){var E=arguments;if(x&&!this.__chain__){var j=this.value();return d.apply(Je(j)?j:[],E)}return this[g](function(H){return d.apply(Je(H)?H:[],E)})}}),Pr(mt.prototype,function(s,d){var g=R[d];if(g){var x=g.name+"";Ct.call(Mo,x)||(Mo[x]=[]),Mo[x].push({name:d,func:g})}}),Mo[Ya(l,Q).name]=[{name:"wrapper",func:l}],mt.prototype.clone=jd,mt.prototype.reverse=qg,mt.prototype.value=Kg,R.prototype.at=Ff,R.prototype.chain=Vf,R.prototype.commit=$f,R.prototype.next=Mm,R.prototype.plant=Ou,R.prototype.reverse=Uf,R.prototype.toJSON=R.prototype.valueOf=R.prototype.value=Wf,R.prototype.first=R.prototype.head,$&&(R.prototype[$]=Hf),R},Kr=ec();Ci?((Ci.exports=Kr)._=Kr,qo._=Kr):vn._=Kr}).call(nn)})(Cg,Cg.exports);var xE=Cg.exports;const CE=Ag(xE),TE=(p,_=!0)=>{const[l,f]=X.useState("idle"),[v,w]=X.useState(void 0),[b,T]=X.useState(void 0),P=X.useRef(!1),B=X.useCallback(y=>(f("pending"),T(null),p(y).then(L=>{P.current&&(w(L),f("success"))}).catch(L=>{P.current&&(T(L),f("error"))})),[p]);return X.useEffect(()=>{_&&B()},[B,_]),X.useEffect(()=>(P.current=!0,()=>{P.current=!1}),[]),{execute:B,status:l,value:v,error:b,setValue:w,setStatus:f}},p0={noOptionsMessage:()=>"Không có lựa chọn",placeholder:"Nhấp để chọn",loadingMessage:()=>"Đang tìm kiếm",menuPosition:"fixed"},hg=10,AE={display:"flex",alignItems:"center",justifyContent:"space-between"},SE={backgroundColor:"#EBECF0",borderRadius:"2em",color:"#172B4D",display:"inline-block",fontSize:12,fontWeight:"normal",lineHeight:"1",minWidth:1,padding:"0.16em 0.5em",textAlign:"center"},EE=X.forwardRef(({onChange:p,id:_,name:l,placeholder:f,getOptionLabel:v,getOptionValue:w,onAdd:b,value:T,disabled:P,endPoint:B,fieldLabel:y,fieldValue:L,isClearable:O,isGroup:V,conditions:F,keySearch:Z,...G},Q)=>{const[ne,ee]=X.useState(null),[oe,re]=X.useState([]),[be,we]=X.useState([]),[Ae,Ee]=X.useState(null),Ne=X.useRef(),ie=X.useRef(),fe=X.useRef(null);f&&(p0.placeholder=f),X.useEffect(()=>{F&&(re([]),we([]),Ne.current={top:hg,skip:0},ie.current={top:hg,skip:0},fe.current=F)},[F]),X.useEffect(()=>(Ne.current={top:hg,skip:0},ie.current={top:hg,skip:0},()=>{fe.current=null}),[]);const _e=(Ie,He,Ve)=>{let Re="";if(He){const{top:gt,skip:rt}=ie.current;Ve?Re+=`&$top=${gt}&$skip=${rt}&$inlinecount=allpages`:(ie.current.skip=0,Re+=`&$top=${gt}&$skip=0&$inlinecount=allpages`)}else{const{top:gt,skip:rt}=Ne.current;Re+=`&$top=${gt}&$skip=${rt}&$inlinecount=allpages`}return Ie.length>0&&(Re+=Ie.reduce((gt,rt,qe)=>{const lt=qe===Ie.length-1?"":",";return gt+=`${rt}${lt}`,gt},"&$select=")),Re},ve=X.useCallback(async(Ie,He)=>{if(B){let Ve=_e([y,L],Ie,He),Re=[];(F&&F.length>0||fe.current&&fe.current.length>0)&&((F.length>0?F:fe.current).map((Ye,en)=>Ye.expression==="in"?Re.push(`${Ye.field} ${Ye.expression} (${Ye.value})`):Re.push(`${Ye.field} ${Ye.expression} ${Ye.value}`)),Re=Re.join(" or "),Ve=`${Ve}&$filter=${Re}`),Ie&&(Ve.indexOf("$filter")>-1?Ve+=` and substringof('${Ie}',${y})`:Ve+=`&$filter=substringof('${Ie}',${y})`);const{value:gt,...rt}=await B(`${Ve}`),qe=lt=>{let Ye=[...lt];return He?Ye=[...Ye,...gt]:Ye=gt,Ye};return Ie?(ie.current.count=parseInt(rt["odata.count"]),we(qe)):(Ne.current.count=parseInt(rt["odata.count"]),re(qe)),gt}return[]},[F,B,y,L]),ke=X.useCallback(({curSearch:Ie,preSearch:He,isScroll:Ve}={})=>{if(Ie){if(Ie!=="")return Ee(Ie),new Promise(Re=>{setTimeout(()=>Re(ve(Ie,Ve)),1e3)})}else return Ie!==""?(Ee(null),we([]),ie.current.count=0,new Promise(Re=>{setTimeout(()=>Re(ve(null,Ve)),1e3)})):(ie.current.count=0,Promise.resolve([]))},[ve]),{execute:Se,status:Pe}=TE(ke,!1);X.useEffect(()=>{T&&ee(T)},[T]),X.useCallback(async Ie=>{const He=await ke(),[Ve]=He.filter(Re=>Re[w||"value"]===Ie);return Ve||null},[w,ke]);const Oe=X.useCallback((Ie,He)=>{const{count:Ve}=Ne.current;Ne.current.skip+=He,Ne.current.skip<=Ve&&Se({curSearch:Ie,preSearch:Ie,isScroll:!0})},[Se]),nt=X.useCallback(Ie=>{p(Ie||[])},[p]),$e=X.useCallback(CE.debounce(Se,1e3),[]),De=X.useCallback((Ie,He)=>{$e({curSearch:Ie,preSearch:He})},[$e]),et=Ie=>A.jsxs("div",{style:AE,children:[A.jsx("span",{children:Ie.label}),A.jsx("span",{style:SE,children:Ie.options.length})]});return A.jsx(yE,{children:A.jsxs(Kx,{className:b&&"d-flex justify-content-between basic-single",children:[A.jsx(wg,{className:"pr-0",children:A.jsx(kx,{...G,style:{control:Ie=>({...Ie,lineHeight:"1.5",cursor:"pointer",borderRadius:"0.2rem"}),option:Ie=>({...Ie,fontSize:"0.76563rem",cursor:"pointer"}),input:Ie=>({...Ie,position:"unset"})},isMulti:!0,onMenuScrollToBottom:()=>Oe(Ae,10),options:Ae?be:oe,isLoading:Pe==="pending",isDisabled:P,defaultOptions:!0,value:ne,name:l,onChange:nt,onInputChange:Ie=>De(Ie,Ae),getOptionValue:w,getOptionLabel:v,inputId:l,id:_,instanceId:l,onMenuClose:()=>{Ee(null),we([])},onMenuOpen:()=>oe.length===0&&Se({curSearch:null,preSearch:null,isScroll:!1}),...p0,isClearable:O,formatGroupLabel:V?et:{}})}),b&&A.jsx(wg,{md:"1",className:"pl-0",children:A.jsx(Sg,{className:"h-100",onClick:b})})]})})}),PE=X.memo(EE);const IE=({value:p,thonXom:_,title:l,onChange:f,placeholder:v,disabledTinh:w,disabledQuanHuyen:b})=>{var Z;const[T,P]=X.useState(""),[B,y]=X.useState(!1),[L,O]=X.useState({IdTinh:"54",IdQuan:b?(Z=Bt)==null?void 0:Z.MaQuanHuyen:null,IdPhuong:p,IdThon:null});X.useEffect(()=>{p&&zn(`PhuongXas(${p})?$expand=QuanHuyen/TinhThanh`).then(G=>{P(`${G.TenPhuongXa}, ${G.QuanHuyen.TenQuanHuyen}, ${G.QuanHuyen.TinhThanh.TenTinhThanh}`),V("IdTinh",G.QuanHuyen.MaTinhThanh),V("IdQuan",G.QuanHuyen.MaQuanHuyen),V("IdPhuong",G.MaPhuongXa),_&&zn(`ThonXoms(${_})`).then(Q=>{V("IdThon",Q.Id),P(ne=>`Thôn ${Q.Ten}, ${ne}`)})})},[_,p]);const V=(G,Q)=>{q_(O,G,Q)},F=()=>{P(""),y(!1),O({IdTinh:"54",IdQuan:null,IdPhuong:p,IdThon:null}),f(null,null)};return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"form-input-location",children:[A.jsx(aa,{style:{cursor:"pointer"},onClick:()=>y(!0),value:T,placeholder:v||"Chọn vị trí"}),T&&A.jsx("div",{onClick:F,className:"clear",children:A.jsx(Fn,{fa:"times"})})]}),A.jsxs(kl,{zIndex:3900,isOpen:B,toggle:()=>y(G=>!G),children:[A.jsxs("div",{className:"p-4 d-block",children:[A.jsxs("div",{className:"d-flex w-100 mb-3",children:[A.jsx("strong",{className:"text-red me-2",children:"*"}),A.jsxs("h6",{children:[l||"Địa chỉ"," :"]})]}),A.jsxs("div",{className:"d-block w-100",children:[A.jsx(zi,{data:{title:"Tỉnh thành",required:!0,type:"data-select",disabled:w,dataSelect:{url:"TinhThanhs",value_field:"MaTinhThanh",text_field:"TenTinhThanh",placeholder:"Chọn tỉnh thành"}},value:L==null?void 0:L.IdTinh,inline:!1,onChange:(G,Q)=>{V(["IdTinh"],Q),V(["IdQuan"],null),V(["IdPhuong"],null),V(["IdThon"],null)}}),A.jsx(zi,{data:{title:"Quận/Huyện",required:!0,type:"data-select",disabled:b,dataSelect:{url:"QuanHuyens",value_field:"MaQuanHuyen",text_field:"TenQuanHuyen",placeholder:"Chọn Quận/Huyện",where:`MaTinhThanh eq '${L.IdTinh}'`}},value:L==null?void 0:L.IdQuan,inline:!1,onChange:(G,Q)=>{V(["IdQuan"],Q),V(["IdPhuong"],null),V(["IdThon"],null)}}),A.jsx(zi,{data:{title:"Phường/Xã",required:!0,type:"data-select",dataSelect:{url:"PhuongXas",value_field:"MaPhuongXa",text_field:"TenPhuongXa",placeholder:"Chọn Phường/Xã",where:`MaQuanHuyen eq '${L.IdQuan}'`}},value:L==null?void 0:L.IdPhuong,inline:!1,onChange:(G,Q)=>{V(["IdPhuong"],Q),V(["IdThon"],null)}}),_!==void 0&&A.jsx(zi,{data:{title:"Thôn/Xóm",type:"data-select",dataSelect:{url:"ThonXoms",value_field:"Id",text_field:"Ten",placeholder:"Chọn Thôn/Xóm",where:`MaPhuongXa eq '${L.IdPhuong}'`}},value:L==null?void 0:L.IdThon,inline:!1,onChange:(G,Q)=>{V(["IdThon"],Q)}})]})]}),A.jsx(Ch,{children:A.jsx(Sg,{onClick:()=>{f&&f(L.IdPhuong,L.IdThon),y(!1)},disabled:!L.IdPhuong,children:"Lưu"})})]})]})};function ME(p,_){X.useEffect(()=>{const l=f=>{!p.current||p.current.contains(f.target)||_(f)};return document.addEventListener("mousedown",l),document.addEventListener("touchstart",l),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("touchstart",l)}},[p,_])}const OE=({value:p,onChange:_})=>{const[l,f]=X.useState({status:null,text:null}),v=X.useRef();ME(v,()=>{l.status==="error"&&_(null)});const w=X.useCallback(b=>{if(_(b),b&&b.length!==9&&b.length!==12){f({status:"error",text:"Nhập đủ 9 hoặc 12 số"});return}if(!b){f({status:null,text:null});return}(b.length===9||b.length===12)&&f({status:"success",text:"Số CMND/CCCD hợp lệ"})},[_]);return A.jsx(A.Fragment,{children:A.jsxs("div",{ref:v,className:"position-relative",children:[A.jsx(aa,{className:` ${l.status==="error"?"error-input":l.status==="success"&&"success-input"}`,type:"number",onChange:b=>{w(b.target.value)},value:p,placeholder:"Nhập số CMND/CCCD"}),A.jsx("p",{className:`text-conform-input-check-cmnd ${l.status==="error"?"error-text-confim":l.status==="success"&&"success-text-confim"}`,children:l.text})]})})},NE=({value:p,title:_,onChange:l,placeholder:f})=>{var O,V,F,Z;const[v,w]=X.useState(""),[b,T]=X.useState(!1),[P,B]=X.useState({IdTinh:"54",IdQuan:((O=Bt)==null?void 0:O.MaQuanHuyen)||null,IdPhuong:(V=Bt)==null?void 0:V.MaPhuongXa,IdThon:p});X.useEffect(()=>{p&&zn(`ThonXoms(${p})?$expand=PhuongXa/QuanHuyen`).then(G=>{w(`${G.Ten}, ${G.PhuongXa.TenPhuongXa}, ${G.PhuongXa.QuanHuyen.TenQuanHuyen}, Tỉnh Phú Yên`),B(Q=>({...Q,IdQuan:G.PhuongXa.QuanHuyen.MaQuanHuyen,IdPhuong:G.PhuongXa.MaPhuongXa,IdThon:G.Id}))})},[p]);const y=(G,Q)=>{q_(B,G,Q)},L=()=>{var G,Q;w(""),T(!1),B({IdTinh:"54",IdQuan:((G=Bt)==null?void 0:G.MaQuanHuyen)||null,IdPhuong:(Q=Bt)==null?void 0:Q.MaPhuongXa,IdThon:null}),l(null,null)};return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"form-input-location",children:[A.jsx(aa,{style:{cursor:"pointer"},onClick:()=>T(!0),value:v,placeholder:f||"Chọn vị trí"}),v&&A.jsx("div",{onClick:L,className:"clear",children:A.jsx(Fn,{fa:"times"})})]}),A.jsxs(kl,{zIndex:1500,isOpen:b,toggle:()=>T(G=>!G),children:[A.jsxs("div",{className:"p-4 d-block",children:[A.jsxs("div",{className:"d-flex w-100 mb-3",children:[A.jsx("strong",{className:"text-red me-2",children:"*"}),A.jsxs("h6",{children:[_||"Thôn xóm"," :"]})]}),A.jsxs("div",{style:{display:"grid",gap:"1rem"},className:"w-100",children:[A.jsx(zi,{data:{title:"Tỉnh thành",required:!0,type:"data-select",disabled:!0,dataSelect:{url:"TinhThanhs",value_field:"MaTinhThanh",text_field:"TenTinhThanh",placeholder:"Chọn tỉnh thành"}},value:P==null?void 0:P.IdTinh,inline:!1,onChange:(G,Q)=>{y(["IdTinh"],Q),y(["IdQuan"],null),y(["IdPhuong"],null),y(["IdThon"],null)}}),A.jsx(zi,{data:{title:"Quận/Huyện",required:!0,type:"data-select",disabled:(F=Bt)==null?void 0:F.MaQuanHuyen,dataSelect:{url:"QuanHuyens",value_field:"MaQuanHuyen",text_field:"TenQuanHuyen",placeholder:"Chọn Quận/Huyện",where:`MaTinhThanh eq '${P.IdTinh}'`}},value:P==null?void 0:P.IdQuan,inline:!1,onChange:(G,Q)=>{y(["IdQuan"],Q),y(["IdPhuong"],null),y(["IdThon"],null)}}),A.jsx(zi,{data:{title:"Phường/Xã",required:!0,type:"data-select",disabled:(Z=Bt)==null?void 0:Z.MaPhuongXa,dataSelect:{url:"PhuongXas",value_field:"MaPhuongXa",text_field:"TenPhuongXa",placeholder:"Chọn Quận/Huyện",where:`MaQuanHuyen eq '${P.IdQuan}'`}},value:P==null?void 0:P.IdPhuong,inline:!1,onChange:(G,Q)=>{y(["IdPhuong"],Q),y(["IdThon"],null)}}),A.jsx(zi,{data:{title:"Thôn/Xóm",type:"data-select",required:!0,dataSelect:{url:"ThonXoms",value_field:"Id",text_field:"Ten",placeholder:"Chọn Thôn/Xóm",addFast:!0,where:`MaPhuongXa eq '${P.IdPhuong}'`}},value:P==null?void 0:P.IdThon,inline:!1,onChange:(G,Q)=>{y(["IdThon"],Q)}})]})]}),A.jsx(Ch,{children:A.jsx(Sg,{onClick:()=>{l&&l(P.IdThon),T(!1)},disabled:!P.IdThon,children:"Lưu"})})]})]})},RE=({value:p,onChange:_,placeholder:l})=>{const[f,v]=X.useState();let w=new Date().getFullYear();return A.jsx(A.Fragment,{children:A.jsx(Px,{value:f||p,onBlur:()=>{f!==0&&(+f<1e3||+f>w)&&wh("Bạn chưa nhập đúng định dạng năm!")},onChange:b=>{v(+b.target.value),+b.target.value>=1e3&&+b.target.value<=w&&_(+b.target.value)},placeholder:l||"Nhập năm"})})};class U_ extends X.Component{render(){const{value:_,onChange:l,disabled:f}=this.props,v=()=>{let w=[];for(var b=1;b<=31;b++)w.push({value:b,label:`Ngày ${b}`});return w};return A.jsx(p_,{disabled:f,value:_||"",onChange:l,options:v(),valueRef:"value",labelRef:"label",placeholder:"Chọn ngày"})}}U_.propTypes={};U_.defaultProps={placeholder:"Chọn..."};const DE=({value:p,title:_,onChange:l,placeholder:f})=>{var L,O;const[v,w]=X.useState(""),[b,T]=X.useState(!1),[P,B]=X.useState({IdTinh:"54",IdQuan:((L=Bt)==null?void 0:L.MaQuanHuyen)||null,IdPhuong:(O=Bt)==null?void 0:O.MaPhuongXa,IdThon:p});X.useEffect(()=>{p&&zn(`ThonXoms(${p})?$expand=PhuongXa/QuanHuyen`).then(V=>{w(`Thôn ${V.Ten}, ${V.PhuongXa.TenPhuongXa}, ${V.PhuongXa.QuanHuyen.TenQuanHuyen}, Tỉnh Phú Yên`),B(F=>({...F,IdQuan:V.PhuongXa.QuanHuyen.MaQuanHuyen,IdPhuong:V.PhuongXa.MaPhuongXa,IdThon:V.Id}))})},[p]);const y=(V,F)=>{q_(B,V,F)};return A.jsxs(A.Fragment,{children:[A.jsx(aa,{style:{cursor:"pointer"},onClick:()=>T(!0),value:v,placeholder:f||"Chọn vị trí"}),A.jsxs(kl,{zIndex:3900,isOpen:b,toggle:()=>T(V=>!V),children:[A.jsxs("div",{className:"p-4 d-block",children:[A.jsxs("div",{className:"d-flex w-100 mb-3",children:[A.jsx("strong",{className:"text-red me-2",children:"*"}),A.jsxs("h6",{children:[_||"Thôn xóm"," :"]})]}),A.jsxs("div",{style:{display:"grid",gap:"1rem"},className:"w-100",children:[A.jsx(zi,{data:{title:"Tỉnh thành",required:!0,type:"data-select",disabled:!0,dataSelect:{url:"TinhThanhs",value_field:"MaTinhThanh",text_field:"TenTinhThanh",placeholder:"Chọn tỉnh thành"}},value:P==null?void 0:P.IdTinh,inline:!1,onChange:(V,F)=>{y(["IdTinh"],F),y(["IdQuan"],null),y(["IdPhuong"],null),y(["IdThon"],null)}}),A.jsx(zi,{data:{title:"Quận/Huyện",required:!0,type:"data-select",disabled:!1,dataSelect:{url:"QuanHuyens",value_field:"MaQuanHuyen",text_field:"TenQuanHuyen",placeholder:"Chọn Quận/Huyện",where:`MaTinhThanh eq '${P.IdTinh}'`}},value:P==null?void 0:P.IdQuan,inline:!1,onChange:(V,F)=>{y(["IdQuan"],F),y(["IdPhuong"],null),y(["IdThon"],null)}}),A.jsx(zi,{data:{title:"Phường/Xã",required:!0,type:"data-select",disabled:!1,dataSelect:{url:"PhuongXas",value_field:"MaPhuongXa",text_field:"TenPhuongXa",placeholder:"Chọn Quận/Huyện",where:`MaQuanHuyen eq '${P.IdQuan}'`}},value:P==null?void 0:P.IdPhuong,inline:!1,onChange:(V,F)=>{y(["IdPhuong"],F),y(["IdThon"],null)}})]})]}),A.jsx(Ch,{children:A.jsx(Sg,{onClick:()=>{l&&l(P.IdQuan),T(!1)},children:"Lưu"})})]})]})},ad=[{title:"Id",field:"Id",hidden:"true",dataID:!0,table:!0,notEdit:!0},{title:"Mã hộ",field:"MaHo",type:"textbox",searchable:!0,table:!0,required:!0},{field:"ThonXom.Ten",table:!0,hidden:!0},{field:"ThonXom/PhuongXa.TenPhuongXa",table:!0,hidden:!0},{field:"ThonXom/PhuongXa.MaQuanHuyen",table:!0,hidden:!0},{title:"Thôn/Xóm",field:"Thon_Id",type:"input-thon-xom",disabledTinh:!0,required:!0},{title:"Số CCCD",field:"CCCD",type:"input-check-cmnd",searchable:!0,table:!0,required:!0},{title:"Tên chủ hộ",field:"TenChuHo",type:"textbox",searchable:!0,table:!0,required:!0},{title:"Giới tính",field:"GioiTinh",type:"data-select",dataSelect:{url:"DM_GioiTinh",value_field:"Id",text_field:"Name",placeholder:"Chọn giới tính"},required:!0},{title:"Ngày tháng năm sinh",field:"NgaySinh",type:"date",table:!0,required:!0}];var jE=function(_){return{root:{display:"block",backgroundColor:Fx(_.palette.text.primary,_.palette.type==="light"?.11:.13),height:"1.2em"},text:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 60%",transform:"scale(1, 0.60)",borderRadius:_.shape.borderRadius,"&:empty:before":{content:'"\\00a0"'}},rect:{},circle:{borderRadius:"50%"},pulse:{animation:"$pulse 1.5s ease-in-out 0.5s infinite"},"@keyframes pulse":{"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}},wave:{position:"relative",overflow:"hidden","&::after":{animation:"$wave 1.6s linear 0.5s infinite",background:"linear-gradient(90deg, transparent, ".concat(_.palette.action.hover,", transparent)"),content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}},"@keyframes wave":{"0%":{transform:"translateX(-100%)"},"60%":{transform:"translateX(100%)"},"100%":{transform:"translateX(100%)"}},withChildren:{"& > *":{visibility:"hidden"}},fitContent:{maxWidth:"fit-content"},heightAuto:{height:"auto"}}},LE=X.forwardRef(function(_,l){var f=_.animation,v=f===void 0?"pulse":f,w=_.classes,b=_.className,T=_.component,P=T===void 0?"span":T,B=_.height,y=_.variant,L=y===void 0?"text":y,O=_.width,V=g_(_,["animation","classes","className","component","height","variant","width"]),F=!!V.children;return X.createElement(P,vg({ref:l,className:x0(w.root,w[L],b,F&&[w.withChildren,!O&&w.fitContent,!B&&w.heightAuto],v!==!1&&w[v])},V,{style:vg({width:O,height:B},V.style)}))});const h_=A0(jE,{name:"MuiSkeleton"})(LE),zE=({maPhuongXa:p,maThonXom:_})=>{const[l,f]=X.useState(void 0);return X.useEffect(()=>{p&&zn(`PhuongXas?$filter=MaPhuongXa eq '${p}' &$expand=QuanHuyen,QuanHuyen/TinhThanh`).then(({value:[v]})=>{f(`${v.TenPhuongXa}, ${v.QuanHuyen.TenQuanHuyen}, ${v.QuanHuyen.TinhThanh.TenTinhThanh}`),_&&zn(`ThonXoms(${_})`).then(w=>{f(b=>`Thôn ${w==null?void 0:w.Ten}, `+b)})})},[p,_]),l===void 0?A.jsxs("div",{children:[A.jsx(h_,{width:250}),A.jsx(h_,{width:100})]}):l},BE=({value:p})=>{const[_,l]=X.useState(void 0);return X.useEffect(()=>{p&&zn(`ThonXoms(${p})?$expand=PhuongXa/QuanHuyen`).then(f=>{l(`${f.Ten}, ${f.PhuongXa.TenPhuongXa}, ${f.PhuongXa.QuanHuyen.TenQuanHuyen}, Tỉnh Phú Yên`)})},[p]),_===void 0?A.jsx("div",{children:A.jsx(h_,{width:100})}):_},FE=({item:p,data:_,fullScreen:l,close:f})=>{var w,b,T,P,B;let v=_[p==null?void 0:p.field]?p!=null&&p.dataSelect?(w=p==null?void 0:p.dataSelect)!=null&&w.urlExpand?_[(b=p==null?void 0:p.dataSelect)==null?void 0:b.urlExpand][(T=p==null?void 0:p.dataSelect)==null?void 0:T.text_field]:_[(P=p==null?void 0:p.dataSelect)==null?void 0:P.url][(B=p==null?void 0:p.dataSelect)==null?void 0:B.text_field]:_[p==null?void 0:p.field]:null;return A.jsx(A.Fragment,{children:A.jsxs("div",{className:"form-item-detail",children:[A.jsxs("div",{className:"mb-2 ms-2",children:[!(p!=null&&p.hiddenLabel)&&p.title,A.jsx("span",{style:p!=null&&p.hiddenLabel?{color:"transparent"}:{},children:":"})]}),A.jsxs("div",{style:p!=null&&p.style?p==null?void 0:p.style:l?{background:"white",padding:"0"}:{},className:"value-detail-custom",children:[_[p==null?void 0:p.field]!==void 0&&_[p==null?void 0:p.field]!==null?VE(p.type,v):A.jsx(A.Fragment,{children:A.jsx("i",{className:"text-muted",children:"Chưa có thông tin"})}),(p==null?void 0:p.btnClose)&&f&&A.jsx(A.Fragment,{children:A.jsxs(Bn,{onClick:f,className:"btn-close-in-item",children:[A.jsx(Fn,{style:{marginTop:"0.1rem"},fa:"gg"}),"Thay đổi"]})})]})]})})},VE=(p,_)=>{switch(p){case"date":return v0(_);case"datetime":return b0(_);case"number":return vh(_);case"currency":return vh(_);case"input-hpx":return A.jsx(zE,{maPhuongXa:_});case"input-thon-xom":return A.jsx(BE,{value:_});case"checkbox":return _?"Có":"Không";case"danh-sach-ho-gd":return A.jsx(Sy,{value:_,isDetail:!0});default:return _}},$E=({listFormControl:p,data:_,children:l,isFormControl:f,close:v})=>A.jsxs(A.Fragment,{children:[l&&l.filter(w=>(w==null?void 0:w.position)==="top"&&(w==null?void 0:w.component)&&!(w!=null&&w.hidden)).map(w=>A.jsx(A.Fragment,{children:A.jsx(g0,{item:w})})),p.map(w=>{var b,T;return A.jsx(A.Fragment,{children:A.jsxs("div",{children:[(w==null?void 0:w.tabName)&&(w==null?void 0:w.hidden)!==!0&&A.jsx("h6",{className:"title-tab-name",children:w==null?void 0:w.tabName}),!!((b=w==null?void 0:w.children)!=null&&b.length)&&_&&A.jsx("div",{style:f?{marginTop:"1rem",boxShadow:"none",marginBottom:0,padding:0}:!(w!=null&&w.tabName)||(w==null?void 0:w.hidden)===!0?{borderRadius:"10px"}:{},className:"form-group",children:A.jsx(A.Fragment,{children:A.jsx("div",{style:{gridTemplateColumns:_0(w==null?void 0:w.ratio)},className:"form-body-group",children:(T=w==null?void 0:w.children)==null?void 0:T.map(P=>A.jsx(A.Fragment,{children:A.jsx(FE,{close:v,fullScreen:(w==null?void 0:w.ratio)===1,item:P,data:_})}))})})})]})})}),l&&l.filter(w=>(w==null?void 0:w.position)!=="top"&&(w==null?void 0:w.component)&&!(w!=null&&w.hidden)).map(w=>A.jsx(A.Fragment,{children:A.jsx(g0,{item:w})}))]}),g0=({item:p})=>A.jsx(A.Fragment,{children:A.jsxs("div",{children:[(p==null?void 0:p.title)&&A.jsx("h6",{className:"title-tab-name",children:p==null?void 0:p.title}),A.jsx("div",{style:p!=null&&p.title?{}:{borderRadius:"10px"},className:"form-group",children:p==null?void 0:p.component})]})}),xy=X.forwardRef(({Id:p,columns:_,children:l,close:f,title:v,url:w,isDetail:b,disabled:T,isFormControl:P,titleSecond:B,getData:y,apiGetData:L,RenderAttachment:O},V)=>{let F=_.filter(ee=>ee.type||ee.tabName),Z=w0(F)||[];const[G,Q]=X.useState();X.useEffect(()=>{y&&y(G)},[G]),X.useImperativeHandle(V,()=>({loadData(){ne()}}));const ne=X.useCallback(()=>{let ee=L||`${w}(${p})${rk(_)?`?$expand=${rk(_)}`:""}`;zn(ee,"GET",null,{odata:!L}).then(oe=>{Q(oe)})},[p,L,_,w]);return X.useEffect(()=>{ne()},[ne]),X.useEffect(()=>{const ee=oe=>{oe.key==="Escape"&&f()};return document.addEventListener("keydown",ee),()=>{document.removeEventListener("keydown",ee)}},[f]),A.jsx(A.Fragment,{children:A.jsx("div",{onClick:()=>!P&&f(),className:P?"":"outline-form-detail-custom",children:A.jsxs("div",{onClick:ee=>ee.stopPropagation(),style:P?{padding:0}:{},className:`form-detail-custom ${P?"bg-white":(F.length>10,"form-modal-min")}`,children:[!P&&A.jsxs("div",{style:{borderBottom:"solid 1px #f1f1f1"},className:"d-flex mb-4 align-items-start justify-content-between hidden-by-formcontrol",children:[v!==!1&&A.jsxs("div",{children:[A.jsx("div",{className:"d-flex align-items-center gap-4",children:A.jsxs("h3",{className:"fw-bold mb-0",children:["Thông tin chi tiết ",B||""]})}),A.jsx("p",{className:"mb-4"})]}),A.jsxs("div",{className:"d-flex align-items-center gap-4",children:[A.jsxs("div",{className:"id-data",children:[A.jsx(Fn,{fa:"500px"}),"ID Dữ liêu: ",p]}),!b&&A.jsxs(A.Fragment,{children:[A.jsx("p",{style:{fontSize:"20px"},className:"mb-1 text-muted",children:"|"}),A.jsx(Bn,{onClick:f,style:{boxShadow:"none",fontSize:"20px"},className:"btn-close"})]})]})]}),G&&A.jsx($E,{listFormControl:Z,isFormControl:P,title:v,data:G,children:l,close:P&&!b&&!T?f:!1}),O,!(_!=null&&_.find(ee=>ee.btnClose===!0))&&P&&!b&&G&&!T&&A.jsx(A.Fragment,{children:A.jsx("div",{style:{padding:P?"2rem":"0.7rem"},children:A.jsx("div",{className:"form-btn-change-select",children:A.jsx(Bn,{onClick:f,children:"Thay đổi lựa chọn"})})})})]})})})}),HE=({columns:p,onChange:_})=>{const[l,f]=X.useState(fg(p)),[v,w]=X.useState(!1),[b,T]=X.useState(!0);let P=Object.values(l);X.useEffect(()=>{let y=P.join(",").replace(/,/g,"").length===0;b?!y&&_(ok(p,l),l):_(ok(p,l),l)},[l]);const B=(y,L)=>{T(!1),f(O=>({...Wv(p,O,y,L),[y]:L}))};return A.jsx(A.Fragment,{children:!!(p!=null&&p.length)&&A.jsx(A.Fragment,{children:A.jsxs("div",{className:"outline-form-item-search-table-custom",children:[A.jsx("div",{className:"icon-search",children:A.jsx(Fn,{fa:"search"})}),A.jsx("p",{style:{fontSize:"20px"},className:"mb-1 text-muted",children:"|"}),A.jsxs("div",{className:"form-item-search-table-custom",children:[p.slice(0,!v&&p.length>5?4:p.length).map(y=>{var L,O,V;return A.jsx(A.Fragment,{children:k0((L=y==null?void 0:y.dependent)==null?void 0:L.name,l[(O=y==null?void 0:y.dependent)==null?void 0:O.name],(V=y==null?void 0:y.dependent)==null?void 0:V.comparison)&&A.jsxs("div",{className:"position-relative",children:[l[y==null?void 0:y.field]&&A.jsx("p",{className:"mb-0 title-item-search",children:y.title}),Cx(y.type)?A.jsx(A.Fragment,{children:A.jsx(aa,{onKeyPress:F=>{F.charCode===13&&B(y==null?void 0:y.field,F.target.value)},onBlur:F=>{l[y.field]&&F.target.value===""&&B(y==null?void 0:y.field,"")},placeholder:`Nhập ${y.title}`,defaultValue:l?l[y==null?void 0:y.field]:null})}):A.jsx(zi,{data:{...y,hidden_label:!0,disabled:!1,...y0(y,l)},value:l?l[y==null?void 0:y.field]:null,onChange:(F,Z)=>{B(y==null?void 0:y.field,Z)}})]})})}),p.length>5&&A.jsx(A.Fragment,{children:A.jsx("div",{className:`form-btn-search-extend ${v?"form-btn-search-extend-close":""}`,children:A.jsxs(Bn,{onClick:()=>w(y=>!y),children:[A.jsx(Fn,{fa:v?"angle-up":"filter"}),A.jsx("span",{children:"Tìm kiếm mở rộng"})]})})})]})]})})})},W_=X.forwardRef(({title:p,titleSecond:_,url:l,columns:f,listSearch:v,where:w,childrenModal:b,afterSaving:T,getId:P,getData:B,openDetailSave:y,value:L,onChange:O,isDetail:V,isEdit:F,isAdd:Z,defaultValue:G,onRowClick:Q,onAdd:ne,onEdit:ee,onDelete:oe,isDelete:re,addValue:be,apiGetData:we,apiUrl:Ae,method:Ee,urlExt:Ne,getDataAfterLoad:ie,getDataSearch:fe,formAddAction:_e,isFormControl:ve},ke)=>{var rt;const[Se,Pe]=X.useState(!1),[Oe,nt]=X.useState(L||L===0?L:null),$e=f!=null&&f.length?f.filter(qe=>qe.table):[],De=X.useRef(),et=X.useCallback(()=>De.current&&De.current.onQueryChange(),[De]),Ie=f.filter(qe=>qe.dataID)[0].field,[He,Ve]=X.useState([]),Re=X.useRef(),gt=X.useRef();return X.useImperativeHandle(ke,()=>({reloadTable(){et()},reloadDetail(){Re.current.loadData()},reloadModal(){gt.current.loadData()}})),X.useEffect(()=>{L&&nt(L)},[L]),A.jsx(A.Fragment,{children:((rt=sk($e))==null?void 0:rt.length)&&A.jsxs("div",{className:`form-table-auto-custom position-relative ${ve?"form-table-auto-custom-form-control":""}`,children:[A.jsx("div",{className:"form-add-btn-action",style:Z!==!1&&ne!==!1?{right:"14.5rem"}:{right:"6.5rem"},children:_e}),A.jsx("div",{className:`${Oe!==null&&ve?"d-none":""}`,children:A.jsx(Gx,{title:p,url:Ne?!1:l,urlExt:Ne,columns:sk($e),getDataAfterLoad:ie,fomrSearch:A.jsx(HE,{columns:v?[...f.filter(qe=>qe.searchable),...v]:f.filter(qe=>qe.searchable),onChange:(qe,lt)=>{fe&&fe(lt),Ve(qe),et()}}),where:w?[...He,w].join(" and "):[...He].join(" and "),tableRef:De,SearchAdvanced:()=>A.jsx(A.Fragment,{}),onRowClick:!ve&&V!==!1?(qe,lt)=>{Q?Q(lt):(nt(lt[Ie]),P&&P(lt[Ie],!0))}:void 0,onEdit:!ve&&F!==!1&&ee!==!1?{onClick:(qe,lt)=>{ee?ee(lt):(Pe(lt[Ie]),P&&P(lt[Ie],!1))}}:!1,onAdd:Z!==!1&&ne!==!1?{onClick:(qe,lt)=>{ne?ne(lt):(Pe(!0),P&&P(null,!1))}}:!1,onActions:ve&&[{icon:"tag",tooltip:"Chọn",onClick:(qe,lt)=>{nt(lt[Ie]),P&&P(lt[Ie],!0),O&&O(lt[Ie])}}],onDelete:re===!1?!1:oe?{onClick:(qe,lt)=>oe(lt)}:ve?!1:{}})}),Oe!==null&&!Q&&A.jsx(A.Fragment,{children:A.jsx(xy,{apiGetData:we,getData:B,ref:Re,title:p,titleSecond:_,url:l,isDetail:V,Id:Oe,isFormControl:ve,close:()=>{nt(null),P&&P(null,!1),O&&O(null)},columns:f,children:b})}),(Se||Se===0)&&(!ee||!ne)&&A.jsx(Tg,{apiUrl:Ae,apiGetData:we,method:Ee,getData:B,ref:gt,columns:f,open:Se||Se===0,close:()=>{Pe(!1),P&&P(null,!1)},Id:Se!==!0?Se:null,title:p,titleSecond:_,url:l,getId:qe=>{P&&P(qe,y),(y||O)&&nt(qe),O&&O(qe)},openDetailSave:y,afterSaving:(qe,lt)=>{et(),T&&T(qe,lt)},isFormControl:ve,children:b,defaultValue:G,addValue:be})]})})}),Cy=({isFormControl:p,getId:_})=>{const[l,f]=X.useState([]);return X.useEffect(()=>{zn("QuanHuyens?$filter=MaTinhThanh eq '54'").then(({value:v})=>{f(v)})},[]),A.jsx(A.Fragment,{children:A.jsx("div",{className:"bg-white p-3 rounded",children:A.jsx(W_,{isFormControl:p,getId:_,columns:[...ad,{title:"Địa chỉ",table:!0,field:"Thon_Id",render:v=>{var w,b,T,P;return`${((w=v==null?void 0:v.ThonXom)==null?void 0:w.Ten)||"??"}, ${((T=(b=v==null?void 0:v.ThonXom)==null?void 0:b.PhuongXa)==null?void 0:T.TenPhuongXa)||"??"}, ${l.length&&((P=l.find(B=>{var y,L;return B.MaQuanHuyen===((L=(y=v==null?void 0:v.ThonXom)==null?void 0:y.PhuongXa)==null?void 0:L.MaQuanHuyen)}))==null?void 0:P.TenQuanHuyen)||"??"}`}}],listSearch:[{title:"Quận/Huyện",field:"ThonXom/PhuongXa/MaQuanHuyen",type:"data-select",dataSelect:{url:"QuanHuyens",value_field:"MaQuanHuyen",text_field:"TenQuanHuyen",placeholder:"Chọn Quận/Huyện"}},{title:"Phường/Xã",field:"ThonXom/MaPhuongXa",type:"data-select",dataSelect:{url:"PhuongXas",value_field:"MaPhuongXa",text_field:"TenPhuongXa",placeholder:"Chọn Phường/Xã"},dependent:{name:"ThonXom/PhuongXa/MaQuanHuyen",fieldWhere:"MaQuanHuyen"}},{title:"Thôn/Xóm",field:"Thon_Id",type:"data-select",dataSelect:{url:"ThonXoms",value_field:"Id",text_field:"Ten",placeholder:"Chọn Thôn/Xóm"},dependent:{name:"ThonXom/MaPhuongXa",fieldWhere:"MaPhuongXa"}}],title:"Danh sách Hộ gia đình",url:"HNCN_HoGiaDinh"})})})},AP=Object.freeze(Object.defineProperty({__proto__:null,default:Cy},Symbol.toStringTag,{value:"Module"})),Ty=({isFormControl:p,getId:_})=>{var l;return A.jsx("div",{className:"bg-white p-3 rounded",children:A.jsx(W_,{isFormControl:p,getId:_,columns:[...ad,{title:"Địa chỉ",table:!0,field:"Thon_Id",render:f=>{var v,w,b;return`${((v=f==null?void 0:f.ThonXom)==null?void 0:v.Ten)||"??"}, ${((b=(w=f==null?void 0:f.ThonXom)==null?void 0:w.PhuongXa)==null?void 0:b.TenPhuongXa)||"??"}`}}],listSearch:[{title:"Thôn/Xóm",field:"Thon_Id",type:"data-select",dataSelect:{url:"ThonXoms",where:`MaPhuongXa eq '${(l=Bt)==null?void 0:l.MaPhuongXa}'`,value_field:"Id",text_field:"Ten",placeholder:"Chọn Thôn/Xóm"},required:!0}],title:"Danh sách Hộ gia đình",url:"HNCN_HoGiaDinh",where:`ThonXom/MaPhuongXa eq '${Bt.MaPhuongXa}'`})})},SP=Object.freeze(Object.defineProperty({__proto__:null,default:Ty},Symbol.toStringTag,{value:"Module"})),Ay=({isFormControl:p,getId:_})=>{var l;return A.jsx(A.Fragment,{children:A.jsx("div",{className:"bg-white p-3 rounded",children:A.jsx(W_,{isFormControl:p,getId:_,isAdd:!1,isEdit:!1,isDelete:!1,columns:[...ad,{title:"Địa chỉ",table:!0,field:"Thon_Id",render:f=>{var v,w,b;return`${((v=f==null?void 0:f.ThonXom)==null?void 0:v.Ten)||"??"}, ${((b=(w=f==null?void 0:f.ThonXom)==null?void 0:w.PhuongXa)==null?void 0:b.TenPhuongXa)||"??"}`}}],listSearch:[{title:"Phường/Xã",field:"ThonXom/MaPhuongXa",type:"data-select",dataSelect:{url:"PhuongXas",where:`MaQuanHuyen eq '${(l=Bt)==null?void 0:l.MaQuanHuyen}'`,value_field:"MaPhuongXa",text_field:"TenPhuongXa",placeholder:"Chọn Phường/Xã"}},{title:"Thôn/Xóm",field:"Thon_Id",type:"data-select",dataSelect:{url:"ThonXoms",value_field:"Id",text_field:"Ten",placeholder:"Chọn Thôn/Xóm"},dependent:{name:"ThonXom/MaPhuongXa",fieldWhere:"MaPhuongXa"}}],title:"Danh sách Hộ gia đình",url:"HNCN_HoGiaDinh",where:`ThonXom/PhuongXa/MaQuanHuyen eq '${Bt.MaQuanHuyen}'`})})})},EP=Object.freeze(Object.defineProperty({__proto__:null,default:Ay},Symbol.toStringTag,{value:"Module"})),UE=({getId:p})=>A.jsx(A.Fragment,{children:_y?A.jsx(Ty,{isFormControl:!0,getId:p}):KS?A.jsx(Ay,{isFormControl:!0,getId:p}):A.jsx(Cy,{isFormControl:!0,getId:p})}),Sy=({value:p,onChange:_,isDetail:l,disabled:f})=>{const[v,w]=X.useState(!1),[b,T]=X.useState(null),[P,B]=X.useState(""),[y,L]=X.useState(!1),[O,V]=X.useState(!1),F=X.useRef(),Z=X.useCallback((G,Q)=>{var ne;if(G&&Q){_(G);return}G?zn(`BaoCaoTienUngHoDN/KiemTraMaHo?maHo=${G}${qS?"":`&maPhuongXa=${(ne=Bt)==null?void 0:ne.MaPhuongXa}`}`,"GET",null,{odata:!1}).then(ee=>{if(!(ee!=null&&ee.Id)){w(!0),_(null);return}T(ee.Id),_(ee.Id)}).catch(ee=>{ee.search("đã thuộc")?wh(ee):(w(!0),_(null))}):T(null)},[_]);return A.jsx(A.Fragment,{children:A.jsxs("div",{style:l?{}:{borderRadius:"10px",boxShadow:"rgba(0, 0, 0, 0.06) 0px 2px 4px 0px inset",border:"solid 1px lightgray"},className:l?"":"p-2",children:[!l&&A.jsx(A.Fragment,{children:!p&&A.jsx(A.Fragment,{children:!v&&A.jsx(A.Fragment,{children:A.jsxs("div",{className:"d-flex",children:[A.jsx("div",{className:"d-block w-25",children:A.jsx(aa,{value:P,onChange:G=>{B(G.target.value)},onKeyPress:G=>{G.charCode===13&&Z(G.target.value)},placeholder:"Tìm kiếm theo Mã hộ"})}),A.jsxs("div",{className:"d-flex gap-3 ms-3",children:[A.jsxs(Bn,{style:{background:"#004cb3",padding:"0.5rem 1rem",display:"flex",alignItems:"center",gap:"0.5rem",fontWeight:500,fontSize:"small"},onClick:()=>{Z(P)},children:[A.jsx(Fn,{fa:"500px"}),"Kiểm tra"]}),A.jsxs(Bn,{style:{color:"rgb(0 48 114)",background:"#f8f8f8",fontWeight:500,fontSize:"small",padding:"0.5rem 1rem",display:"flex",alignItems:"center",gap:"0.5rem",border:"solid 1px rgb(160 179 204)"},onClick:()=>V(!0),children:[A.jsx(Fn,{fa:"stack-overflow"})," Chọn từ danh sách"]})]})]})})})}),O&&A.jsx(A.Fragment,{children:A.jsx(kl,{zIndex:1500,isOpen:O,size:"xl",toggle:()=>V(!1),children:A.jsx("div",{className:"p-3",children:A.jsx(UE,{getId:G=>{G&&V(!1),_(G)}})})})}),v&&P&&!b&&A.jsxs("span",{style:{fontWeight:"500"},className:"ms-2",children:["Không có kết quả phù hợp với ",A.jsx("strong",{children:P}),", Hãy tiến hành Thêm mới!"]}),p&&A.jsx(A.Fragment,{children:A.jsxs("div",{className:l?"":"mt-3",children:[_y&&A.jsxs("div",{style:{fontWeight:"500",borderRadius:"10px",padding:"1rem",background:"#f2f5f6"},className:" d-flex justify-content-between gap-3 align-items-center mb-4",children:["Cập nhật nhanh thông tin Hộ gia đình",A.jsxs(Bn,{style:{background:l?"linear-gradient(90deg, rgba(38,206,255,1) 0%, rgba(0,154,170,1) 100%)":"#0049a3"},className:"fw-bold d-flex align-items-center gap-2",onClick:()=>L(!0),children:[A.jsx(Fn,{style:{marginTop:"0.2rem"},fa:"pencil-square-o"}),"Cập nhật"]})]}),A.jsx(xy,{title:"Hộ gia đình",ref:F,url:"HNCN_HoGiaDinh",isDetail:l,disabled:f,Id:p||b,isFormControl:!0,close:()=>{_(null),T(null)},columns:ad}),y&&A.jsx(Tg,{columns:ad,open:y,close:()=>L(!1),Id:p||b,url:"HNCN_HoGiaDinh",afterSaving:()=>{var G,Q;(G=F==null?void 0:F.current)!=null&&G.loadData&&((Q=F==null?void 0:F.current)==null||Q.loadData())}})]})}),v&&A.jsx(A.Fragment,{children:A.jsx("div",{className:"p-2",children:A.jsx(Tg,{columns:ad,open:v,close:()=>w(!1),title:"Hộ gia đình",url:"HNCN_HoGiaDinh",defaultValue:{MaHo:P},getId:G=>{Z(G,!0)},children:[{position:"top",component:A.jsx(A.Fragment,{children:A.jsx("div",{style:{background:"linear-gradient(90deg, rgba(235,235,235,1) 0%, rgba(219,230,235,1) 100%)",padding:"1rem",borderRadius:"10px",marginBottom:"1rem"},children:A.jsxs("span",{style:{fontWeight:"500"},className:"ms-2",children:["Không có kết quả phù hợp với ",A.jsx("strong",{children:P}),", Hãy tiến hành Thêm mới!"]})})})}],afterSaving:()=>w(!1)})})})]})})},q_=(p,_,l)=>{p(f=>({...f,[_]:l}))},WE=(p,_)=>{let{data:l,onChange:f,onKeyDown:v,value:w,isDetail:b,onBlur:T,donVi:P,valueId:B}=p;const y=O=>`Nhập ${O==null?void 0:O.toLowerCase()}`;switch(b&&l.type!=="data-select"?"label":l.type){case"number_current":return A.jsx(ky,{disabled:l.disabled,id:l.field_name,name:l.field_name,placeholder:"0",defaultValue:w,decimalsLimit:0,decimalScale:0,value:w,onValueChange:(O,V)=>{f&&f(l.field_name,parseFloat(O))},className:"number-format form-control-sm form-control text-right"});case"label":return A.jsx("span",{style:l.style,children:l.type==="datetime"?b0(w):l.type==="date"?v0(w):l.type==="radio-list"?w===2?w="Thông báo giá":w="Kê khai giá":l.type==="numeric"?vh(w):w});case"textbox":return A.jsx(aa,{style:{background:l.disabled?"#dedede":"inherit",textAlign:l.textAlign?l.textAlign:"left"},autoFocus:l.autoFocus,disabled:_||(l.disabled?l.disabled:!1),plaintext:l.plaintext||!1,name:l.field_name,value:w??"",onChange:O=>f&&f(O.target.name,O.target.value),onBlur:O=>T&&T(O.target.name,O.target.value),placeholder:l.placeholder?l.placeholder:y(l.title)});case"password":return A.jsx(Lx,{style:{background:l.disabled?"#dedede":"inherit"},autoFocus:l.autoFocus,name:l.field_name,value:w??"",onChange:O=>f&&f(O.target.name,O.target.value),onBlur:O=>T&&T(O.target.name,O.target.value),placeholder:y(l.title),validation:{regex:/^(?=.*[A-Z])(?=.*[!@#$&*]).{6,}$/,text:"Mật khẩu không được nhỏ hơn 6 ký tự, có chữ hoa và ký tự đặc biệt"}});case"textarea":return A.jsx(Ex,{style:{background:l.disabled?"#dedede":"inherit"},autoFocus:l.autoFocus,rows:l.rows,disabled:l.disabled?l.disabled:!1,name:l.field_name,value:w??"",onChange:O=>f&&f(O.target.name,O.target.value),onBlur:O=>T&&T(O.target.name,O.target.value),onKeyDown:v,placeholder:y(l.title)});case"checkbox":return A.jsx(E0,{autoFocus:l.autoFocus,disabled:l.disabled?l.disabled:!1,name:l.field_name,checked:w||!1,onChange:O=>f&&f(l.field_name,O),placeholder:y(l.title)});case"datetime":return A.jsx(jx,{style:{background:l.disabled?"#dedede":"inherit"},autoFocus:l.autoFocus,disabled:l.disabled?l.disabled:!1,name:l.field_name,value:w,onChange:O=>f&&f(l.field_name,O),placeholderText:y(l.title)});case"date":return A.jsx(Dx,{style:{background:l.disabled?"#dedede":"inherit"},autoFocus:l.autoFocus,disabled:l.disabled?l.disabled:!1,name:l.field_name,value:w,onChange:O=>f&&f(l.field_name,O),placeholderText:y(l.title),notFormat:l.notFormat});case"data-select":return l.dataSelect&&A.jsx(JE,{addFast:l.dataSelect.addFast,menuPosition:l.menuPosition,autoFocus:l.dataSelect.autoFocus,isDetail:b,isMulti:l.dataSelect.isMulti?l.dataSelect.isMulti:!1,isClearable:l.dataSelect.isClearable,disabled:l.disabled?l.disabled:!1,url:l.dataSelect.url,odata:l.dataSelect.odata,where:l.dataSelect.where,group_by:l.dataSelect.group_by,columns:l.dataSelect.columns,valueField:l.dataSelect.value_field,textField:l.dataSelect.text_field,textFieldSub:l.dataSelect.text_field_sub,options:l.dataSelect.options,value:w,placeholder:l.dataSelect.placeholder,onChange:(O,V)=>{f&&f(l.field_name,O,V)}});case"data-select-async":return l.dataSelect&&A.jsx(yx,{disabled:_,value:w||"",url:l.dataSelect.url,column:l.dataSelect.column,options:l.dataSelect.options,whereOne:l.dataSelect.whereOne,where:l.dataSelect.where,onChange:O=>{O?f(l.field_name,O.value):f(null)}});case"numeric":case"currency":return A.jsx(dk,{style:{background:l.disabled||_?"#dedede":"inherit"},autoFocus:l.autoFocus,isDetail:b,decimalScale:l.decimalScale,className:"number-format",disabled:_||(l.disabled?l.disabled:!1),value:vh(w),placeholder:l.placeholder||l.placeholder===null?l.placeholder:"0",onValueChange:O=>{f&&f(l.field_name,parseFloat(O.value))},onBlur:O=>T&&T(l.field_name,O),onKeyDown:v,onFocus:O=>l.onFocus&&O.target.select()});case"number":return A.jsxs("div",{className:"row m-0 justify-content-center align-items-baseline",children:[A.jsx(dk,{style:{background:l.disabled?"#dedede":"inherit"},autoFocus:l.autoFocus,isDetail:b,className:"number-format ms-3 me-3",disabled:l.disabled?l.disabled:!1,value:w,placeholder:"0",onValueChange:O=>{f&&(O.value||O.value===0)?f(l.field_name,O.value):f(l.field_name,null)},onBlur:O=>T&&T(l.field_name,O),onFocus:O=>l.onFocus&&O.target.select()})," ",A.jsx("p",{className:"col-2 mb-0 justify-content-center",children:P})]});case"number-not-seperator":return A.jsx("div",{style:{padding:"0 13px"},className:"row justify-content-center align-items-baseline",children:A.jsx(m_,{style:{background:l.disabled?"#dedede":"inherit"},autoFocus:l.autoFocus,isDetail:b,className:"number-format ms-3 me-3",disabled:l.disabled?l.disabled:!1,value:w,placeholder:"0",onValueChange:O=>{f&&f(l.field_name,O.value)},onBlur:O=>T&&T(l.field_name,O)})});case"radio-list":return A.jsx(iC,{name:l.field_name,disabled:l.disabled?l.disabled:!1,data:l.data,value:w,onChange:O=>f&&p.onChange(l.field_name,O)});case"radio":return A.jsx(Eg,{name:l.field_name,disabled:l.disabled,value:w,label:l.title,hidden_label:l.hidden_label,checked:w===l.valueCompare&&!l.disabled,onChange:O=>{l.valueCompare!==w&&p.onChange(O.target.value)}});case"checkbox-list":return A.jsx(rC,{name:l.field_name,disabled:l.disabled?l.disabled:!1,data:l.data,value:w,onChange:O=>f&&p.onChange(l.field_name,O)});case"select-year":return A.jsx(b_,{disabled:l.disabled?l.disabled:!1,value:w,onChange:O=>{f&&p.onChange(l.field_name,O&&O.value)},placeholder:y(l.title)});case"input-year":return A.jsx(A.Fragment,{children:A.jsx(RE,{value:w,onChange:O=>{f&&p.onChange(l.field_name,O)},placeholder:y(l.title)})});case"select-date":return A.jsx(U_,{disabled:l.disabled?l.disabled:!1,value:w,onChange:O=>{f&&p.onChange(l.field_name,O&&O.value)},placeholder:y(l.title)});case"select-month":return A.jsx(v_,{disabled:l.disabled?l.disabled:!1,value:w,onChange:O=>{f&&p.onChange(l.field_name,O&&O.value)},placeholder:y(l.title)});case"select-custom":return A.jsx(Bx,{value:w,onChange:O=>{f&&p.onChange(l.field_name,O&&O.value)},options:p.data.options});case"select-multi":return A.jsx(fC,{isSearchable:!1,cacheOptions:!0,isDisabled:l.isDisabled,className:"flex-grow-1",isMulti:!0,noOptionsMessage:()=>"Không có",loadingMessage:()=>"Đang tải các lựa chọn",placeholder:"Chọn...",onChange:O=>p.onChange&&p.onChange(l.field_name,O),value:w,getOptionValue:O=>O.Id,getOptionLabel:O=>O.Name,defaultOptions:!0,loadOptions:l.loadOptions});case"popup-select-tree":return A.jsx(YS,{isDieu18:l.isDieu18,dataSelect:{disableSelect:l.disabled,endPoint:l.popupSelect.endPoint,template:l.popupSelect.template,label:l.popupSelect.label,placeholder:l.popupSelect.placeholder},EndPoint_Tree:l.popupSelect.EndPoint_Tree,EndPoint_Odata:l.popupSelect.EndPoint_Odata,valueDisplay:w,Id:B,onClickButton:l.popupSelect.onClickButton,onCallback:O=>f&&p.onChange(l.field_name,O&&O.value)});case"chkeditor":return A.jsx(pC.CKEditor,{editor:mC,data:w||"",disabled:l.disabled,config:{toolbar:["heading","|","bold","italic","bulletedList","numberedList","|","outdent","indent","|","undo","redo"]},onReady:O=>{},onChange:(O,V)=>{},onBlur:(O,V)=>{let F=V.getData();f&&p.onChange(l.field_name,F)},onFocus:(O,V)=>{}});case"ranger":return A.jsx(_E,{value:w,rtl:!1,onChange:O=>p.onChange(l.field_name,O)});case"select-async-multi":return A.jsx(PE,{name:l.field_name,onChange:O=>p.onChange(l.field_name,O),placeholder:l.dataSelect.placeholder||"Chọn",endPoint:l.dataSelect.endpoint,fieldValue:l.dataSelect.value_field,fieldLabel:l.dataSelect.text_field,getOptionValue:O=>O[l.dataSelect.value_field],getOptionLabel:O=>O[l.dataSelect.text_field],value:w,disabled:!1,conditions:l.dataSelect.conditions});case"input-check-cmnd":return A.jsx(OE,{style:{background:l.disabled?"#dedede":"inherit",textAlign:l.textAlign?l.textAlign:"left"},autoFocus:l.autoFocus,disabled:_||(l.disabled?l.disabled:!1),plaintext:l.plaintext||!1,name:l.field_name,value:w??"",onChange:O=>f&&f(null,O),onBlur:O=>T&&T(O.target.name,O.target.value),placeholder:l.placeholder?l.placeholder:y(l.title)});case"input-hpx":return A.jsx(IE,{style:{background:l.disabled?"#dedede":"inherit",textAlign:l.textAlign?l.textAlign:"left"},disabledTinh:l.disabledTinh?l.disabledTinh:!1,disabledQuanHuyen:l.disabledQuanHuyen?l.disabledQuanHuyen:!1,autoFocus:l.autoFocus,disabled:_||(l.disabled?l.disabled:!1),plaintext:l.plaintext||!1,name:l.field_name,value:w??"",onChange:O=>f&&f(null,O),onBlur:O=>T&&T(O.target.name,O.target.value),placeholder:l.placeholder?l.placeholder:y(l.title)});case"input-thon-xom":return A.jsx(A.Fragment,{children:A.jsx(NE,{value:w??"",onChange:O=>f&&f(null,O)})});case"input-address":return A.jsx(A.Fragment,{children:A.jsx(DE,{value:w??"",onChange:O=>{f&&f(null,O)}})});case"danh-sach-ho-gd":return A.jsx(A.Fragment,{children:A.jsx(Sy,{disabled:_||(l.disabled?l.disabled:!1),value:w,onChange:O=>f&&f(null,O)})})}},K_=p=>{const{data:_,value:l,colLabel:f,colValue:v,onChange:w,onBlur:b,onKeyDown:T,onChangeRender:P,inline_equal:B,inline:y,className:L,style:O,styleRow:V,disabled:F,error:Z,invalid:G}=p,Q=ne=>`Nhập ${ne==null?void 0:ne.toLowerCase()}`;return _&&_.type!=="hidden"&&A.jsxs("div",{row:!0,className:`form-control-${_.field_name}`,style:V,children:[!(_!=null&&_.hidden_label)&&A.jsx(wg,{md:f||(y===!1?"12":"6"),children:_.required?A.jsx(Ox,{children:_.title}):A.jsx("strong",{style:{fontSize:"12px"},children:_.title})}),A.jsxs(wg,{md:v||(y===!1||_.hidden_label===!0?"12":"6"),style:O,children:[A.jsx("div",{className:`form-control-value ${G?"is-invalid":""}`,style:_.width&&{maxWidth:_.width},children:_.render?_.render(l,P):_.lookup?A.jsx(Ix,{style:{background:_.disabled?"#dedede":"inherit"},name:_.field_name,value:l,onChange:ne=>w&&w(ne.target.name,ne.target.value),onBlur:ne=>b&&b(ne.target.name,ne.target.value),onKeyDown:T,placeholder:Q(_.title),children:Object.keys(_.lookup).map((ne,ee)=>A.jsx("option",{value:ne,children:_.lookup[ne]},ee))}):WE(p,F)}),A.jsx(Mx,{children:Z==null?void 0:Z.message})]})]})};K_.propTypes={data:le.object.isRequired};K_.defaultProps={};const zi=K_,qE=({data:p,item:_,setData:l,isErr:f,columns:v,fullScreen:w,isEdit:b,getData:T})=>{var P,B,y;return A.jsx(A.Fragment,{children:k0((P=_==null?void 0:_.dependent)==null?void 0:P.name,p[(B=_==null?void 0:_.dependent)==null?void 0:B.name],(y=_==null?void 0:_.dependent)==null?void 0:y.comparison)&&A.jsxs("div",{style:_!=null&&_.style?_==null?void 0:_.style:w?{background:"none",padding:"0"}:{},className:`item-form-control ${p[_==null?void 0:_.field]||p[_==null?void 0:_.field]===0?"form-custom-formcontrol":""} ${f?"form-custom-formcontrol-err":""}`,children:[A.jsx("p",{className:"title-item-form",children:!(_!=null&&_.hiddenLabel)&&A.jsxs(A.Fragment,{children:[_==null?void 0:_.title," ",(_==null?void 0:_.required)&&A.jsx("strong",{style:{color:"red"},children:"*"})]})}),A.jsx("div",{children:A.jsx(zi,{data:{hidden_label:!0,disabled:_!=null&&_.disabledWhenEdit?!!b:!!(_!=null&&_.disabled),...y0(_,p)},value:p?p[_==null?void 0:_.field]:null,onChange:(L,O)=>{l(V=>({...Wv(v,V,_==null?void 0:_.field,O),[_==null?void 0:_.field]:O})),T({...Wv(v,p,_==null?void 0:_.field,O),[_==null?void 0:_.field]:O})}})})]})})},KE=({children:p,listFormControl:_,listErr:l,data:f,listData:v,setData:w,isEdit:b,search:T,hidden:P,getData:B})=>A.jsxs(A.Fragment,{children:[p&&p.filter(y=>(y==null?void 0:y.position)==="top"&&(y==null?void 0:y.component)&&!(y!=null&&y.hidden)).map(y=>A.jsx(A.Fragment,{children:A.jsx(m0,{item:y})})),!P&&_.map(y=>{var L,O;return A.jsx(A.Fragment,{children:A.jsxs("div",{children:[(y==null?void 0:y.tabName)&&(y==null?void 0:y.hidden)!==!0&&A.jsx("h4",{className:"title-item-name-group",children:y==null?void 0:y.tabName}),!!((L=y==null?void 0:y.children)!=null&&L.length)&&A.jsx("div",{className:"form-group",children:A.jsx(A.Fragment,{children:A.jsx("div",{style:{gridTemplateColumns:_0(y==null?void 0:y.ratio)},className:"form-body-group",children:(O=y==null?void 0:y.children)==null?void 0:O.filter(V=>{var F,Z;return T&&(T!=null&&T.text)?(Z=V==null?void 0:V.title)==null?void 0:Z.toUpperCase().includes((F=T==null?void 0:T.text)==null?void 0:F.toUpperCase()):!0}).map(V=>A.jsx(A.Fragment,{children:A.jsx(qE,{isErr:l.includes(V.field)&&(f[V==null?void 0:V.field]===null||f[V==null?void 0:V.field]===""),fullScreen:(y==null?void 0:y.ratio)===1,columns:v,item:V,data:f,setData:w,getData:F=>B&&B(F),isEdit:b})}))})})})]})})}),p&&p.filter(y=>(y==null?void 0:y.position)!=="top"&&(y==null?void 0:y.component)&&!(y!=null&&y.hidden)).map(y=>A.jsx(A.Fragment,{children:A.jsx(m0,{item:y})}))]}),m0=({item:p})=>A.jsx(A.Fragment,{children:A.jsxs("div",{children:[(p==null?void 0:p.title)&&A.jsx("h4",{className:"title-item-name-group",children:p==null?void 0:p.title}),A.jsx("div",{className:"form-group",children:p==null?void 0:p.component})]})}),GE=({data:p,setData:_,Id:l,url:f,onChange:v,value:w,isHidenSearch:b})=>{let T=localStorage.getItem(f);const[P,B]=X.useState(!!T||!1);return A.jsx(A.Fragment,{children:A.jsxs("div",{className:"toolbar-form",children:[!b&&A.jsx(aa,{onChange:y=>v(y.target.value),value:w,className:"input-search",placeholder:"Tìm kiếm"}),f&&!l&&A.jsxs("div",{className:"form-btn-toolbar",children:[A.jsxs(Bn,{onClick:()=>{localStorage.removeItem(f),B(!1),_h("Bản lưu tạm đã được xóa!")},disabled:!P||l,className:"delete",children:[A.jsx(Fn,{fa:"trash-o"})," ",A.jsx("div",{className:"text-name-toolbar",children:"Xóa bản lưu tạm"})]}),A.jsxs(Bn,{onClick:()=>{_(y=>({...JSON.parse(T),...Tx(y)}))},disabled:!P||l,className:"paste",children:[A.jsx(Fn,{fa:"file-text"})," ",A.jsx("div",{className:"text-name-toolbar",children:"Dùng bản lưu tạm"})]}),A.jsxs(Bn,{onClick:()=>{localStorage.setItem(f,JSON.stringify(p)),B(!0),_h("Bản copy này đã được lưu lại. Bạn có thể sử dụng dữ liệu này cho các lần nhập liệu kế tiếp.","Lưu thành công")},disabled:P||l,className:"copy",children:[A.jsx(Fn,{fa:"clone"})," ",A.jsx("div",{className:"text-name-toolbar",children:"Copy bản lưu tạm"})]})]})]})})},QE=X.forwardRef(({open:p,close:_,Id:l,columns:f,title:v,titleSecond:w,url:b,children:T,afterSaving:P,getId:B,defaultValue:y,addValue:L,getData:O,hidden:V,apiUrl:F,apiGetData:Z,method:G,isHidenSearch:Q,size:ne},ee)=>{let oe=`${l||l===0?"Cập nhật":"Thêm mới"}`;const re=f.filter(De=>De.type),be=re!=null&&re.length?re.filter(De=>De.required):[],we=y?{...fg(re),...y}:fg(re),[Ae,Ee]=X.useState(we),[Ne,ie]=X.useState([]);let fe=f.filter(De=>De.type||De.tabName);const _e=w0(fe),ve=f.filter(De=>De.dataID)[0].field,[ke,Se]=X.useState({text:"",required:!1}),[Pe,Oe]=X.useState(null);X.useEffect(()=>{Ee(De=>({...De,...y}))},[y]),X.useImperativeHandle(ee,()=>({loadData(){nt()}}));const nt=X.useCallback(()=>{let De=f.filter(He=>He.type),et=fg(De),Ie=Z||`${b}(${l})`;l!==!0&&(l||l===0)&&et&&zn(Ie,"GET",null,{odata:!Z}).then(He=>{Ee(ak(et,He)),Oe(ak(et,He))})},[l,Z,f,b]);X.useEffect(()=>{nt(),!l&&Ee(we)},[]);const $e=()=>{let De=Ax(be,Ae);if(xv(De,Ae)){console.log(xv(De,Ae)),wh("Bạn nhập thiếu trường dữ liệu!"),ie(xv(De,Ae));return}let et=F||(l||l===0?`${b}(${l})`:`${b}`),Ie=G||(F?"POST":l||l===0?"PATCH":"POST"),He=F?Pe?{...Pe,...Ae}:Ae:Pe?Sx(Pe,Ae):Ae,Ve=L?{...He,...L}:He,Re=Object.keys(Ve).length,gt=!F;if(!Re&&l){wh("Bạn chưa thay đổi bất cứ trường nào");return}zn(et,Ie,JSON.stringify(Ve),{odata:gt}).then(rt=>{if(P&&P(rt,!l),_h("Thành công!"),_&&_(),F){B&&B(rt);return}B&&B(rt[ve]||l)}).catch(rt=>{var qe,lt;if(F){_g(rt||"Không thành công!");return}_g(rt["odata.error"]?(lt=(qe=rt["odata.error"])==null?void 0:qe.message)==null?void 0:lt.value:"Không thành công!")})};return A.jsx(A.Fragment,{children:A.jsx(kl,{size:ne||"xl",zIndex:1500,className:"form-modal-auto-custom",isOpen:p,toggle:()=>{_(),O&&O(we)},children:A.jsxs("div",{className:"inline-form-modal-auto-custom",children:[A.jsxs("div",{className:"form-list-btn-action",children:[A.jsxs("div",{className:"list-btn-action",children:[A.jsx("div",{className:"form-info",children:l||l===0?A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"d-flex align-items-center gap-2",children:[A.jsx(Fn,{fa:"500px"})," ID Dữ Liệu: ",l]})," "]}):A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"d-flex align-items-center gap-2",children:[A.jsx(Fn,{fa:"dashcube"})," Thêm mới"]})," "]})}),A.jsx(Bn,{onClick:$e,className:"btn-action",children:"Lưu thông tin"})]}),A.jsx(Bn,{style:{boxShadow:"none"},onClick:_,className:"btn-close btn-close-custom"})]}),A.jsxs("div",{className:"header-modal-custom",children:[A.jsx("div",{style:{width:"max-content"},className:"d-flex justify-content-bettween position-relative",children:A.jsxs("div",{children:[A.jsxs("h4",{className:"fw-bold",children:[oe," ",w||""]}),A.jsx("p",{className:"mb-3 fw-bold text-muted"})]})}),A.jsx(GE,{onChange:De=>Se(et=>({...et,text:De})),value:ke.text,Id:l,data:Ae,setData:Ee,url:b,isHidenSearch:Q})]}),A.jsx("div",{className:"outline-form",children:A.jsx(KE,{search:ke,children:T,listFormControl:_e,listErr:Ne,data:Ae,listData:re,hidden:V,setData:Ee,getData:De=>O&&O(De),isEdit:l})})]})})})}),Tg=QE,YE={multiValueLabel:p=>({...p,padding:"0px 0px 0px 6px",fontSize:13}),control:p=>({...p,backgroundColor:"white",height:"28.38px",minHeight:"28.38px",fontSize:"12px",lineHeight:"1.5",cursor:"pointer",borderRadius:"4px"}),option:p=>({...p,fontSize:"12px",cursor:"pointer"}),input:p=>({...p,position:"unset"}),placeholder:p=>({...p,marginLeft:5,marginRight:5}),singleValue:(p,{data:_})=>({...p,transform:"inherit",top:"unset"}),container:p=>({...p,width:"100%"}),valueContainer:p=>({...p,padding:"0px 5px"}),indicatorsContainer:p=>({...p,padding:"0px 5px"}),indicatorContainer:p=>({...p,padding:"0px 5px !important",fontSize:"12px"})};class XE extends X.Component{constructor(l){super(l);ng(this,"loadDataFromApi",()=>{let{columns:l,odata:f,url:v,where:w,valueField:b,textField:T,textFieldSub:P}=this.props,B=[],y="";f!==!1?(y=`${v}`,w?y+=`/?$filter=${w}&`:y+="",l&&l.length>0&&(y+=`$select=${this.props.columns.join()}`)):y=this.props.url,zn(y,"GET",null,f).then(L=>{f!==!1?L.value.forEach(O=>{B.push({value:O[b],label:P?`${O[P]} - ${O[T]}`:O[T],obj:O})}):B=L,this.setState({data:B,isLoading:!1}),this.setStateSelected(this.state.value)}).catch(L=>console.log(L))});ng(this,"onChange",(l,f)=>{if(this.setState({selected:l}),this.props.isMulti){var v=[];if(l)for(let w=0;w<l.length;w++)v.push(l[w].value);this.props.onChange(v,null)}else this.props.onChange(l?l.value:null,l?l.obj:null)});this.state={data:[],value:null,selected:null,isLoading:!1}}componentDidMount(){this.setState({isLoading:!0});let{options:l}=this.props;l&&l.length!==void 0?(this.loadDataFromOption(),this.setStateSelected(this.state.value)):this.loadDataFromApi()}getSnapshotBeforeUpdate(l,f){return l.value!==this.props.value?(this.setState({value:this.props.value}),this.setStateSelected(this.props.value),this.props.value||null):null}setStateSelected(l){this.props.isMulti?this.setState({selected:this.getOptionsMulti(l)}):this.setState({selected:this.getOptionsSingle(l)})}getOptionsSingle(l,f){let v=null,{data:w}=this.state;if(w&&w.length>0&&(l||l===0||l===!1)){for(let b=0;b<w.length;b++)if(w[b].value!=null&&w[b].value===l){v=w[b];break}else if(w[b].options){for(let T=0;T<w[b].options.length;T++)if(w[b].options[T].value&&w[b].options[T].value===l){v=w[b].options[T];break}}}return v}getOptionsMulti(l){let f=[],{data:v}=this.state;if(v&&v.length>0&&l)for(let w=0;w<v.length;w++){let b=v[w];for(let T=0;T<l.length;T++)b.value&&b.value===l[T]&&f.push(b)}return f}componentDidUpdate(l,f,v){const{options:w,where:b,url:T}=this.props;(b!==l.where||T!==l.url)&&this.loadDataFromApi(),w&&w.length!==void 0&&w.length!==l.options.length&&this.loadDataFromOption()}loadDataFromOption(){let l=this.props.options.map(f=>({value:f[this.props.valueField],label:this.props.textFieldSub?`${f[this.props.textFieldSub]} - ${f[this.props.textField]}`:f[this.props.textField],obj:f}));this.setState({data:l,isLoading:!1})}render(){let{isMulti:l,isDetail:f,value:v,menuPosition:w}=this.props,b=l?this.getOptionsMulti(v):this.getOptionsSingle(v);return this.state.data.length>0&&f?A.jsx("span",{children:b&&b.label}):A.jsx(A.Fragment,{children:A.jsxs("div",{className:"position-relative",children:[A.jsx(xx,{autoFocus:this.props.autoFocus,placeholder:this.props.placeholder,isMulti:l,isLoading:this.state.isLoading,isDisabled:this.props.disabled,isClearable:this.props.isClearable!==!1,menuPosition:w,className:"dropdownlist",value:b,styles:YE,options:this.state.data,onChange:this.onChange}),this.props.addFast&&A.jsx(eP,{...this.props,reload:this.loadDataFromApi})]})})}}const JE=XE;function ZE(p){return p.replace(/[^\w\s]/gi,"")}const eP=({url:p,where:_,reload:l,title:f})=>{const[v,w]=X.useState(!1);let b=_==null?void 0:_.split(" ");const T=b[1]==="eq"?{[b[0]]:ZE(b[2])}:!1;return A.jsxs(A.Fragment,{children:[A.jsxs("div",{style:{cursor:"pointer"},onClick:()=>w(!0),className:"p-2 mt-2 d-flex align-items-center gap-3 border rounded",children:[A.jsx(Bn,{style:{background:"linear-gradient(90deg, rgb(0, 133, 126) 0%, rgb(0, 155, 194) 100%)"},children:A.jsx(Fn,{fa:"plus"})}),A.jsx("strong",{children:"Thêm nhanh Thôn/Xóm"})]}),v&&A.jsx(Tg,{open:v,close:()=>w(!1),url:p,addValue:T,afterSaving:()=>l(),size:"md",columns:[{title:"Id",field:"Id",hidden:"true",dataID:!0,table:!0,notEdit:!0},{tabName:"Địa chỉ",ratio:1,hidden:!0},{title:"Tên",field:"Ten",type:"textbox",required:!0}]})]})};export{E0 as C,JE as D,zi as F,SP as H,S0 as I,Ch as M,h_ as S,WS as T,Vg as a,GS as b,_y as c,qS as d,KS as e,xy as f,W_ as g,Tg as h,TP as i,b_ as j,AP as k,EP as l,q_ as s,ME as u};