????
Current Path : C:/inetpub/vhost/sdoc.nextform.vn/www/assets/ |
Current File : C:/inetpub/vhost/sdoc.nextform.vn/www/assets/DropdownList-ca18995c.js |
var Ux=Object.defineProperty;var Wx=(h,g,l)=>g in h?Ux(h,g,{enumerable:!0,configurable:!0,writable:!0,value:l}):h[g]=l;var ig=(h,g,l)=>(Wx(h,typeof g!="symbol"?g+"":g,l),l);import{P as le,R as hi,j as A,r as Y,i as Bn,U as cd,F as wg,K as an,M as Eg,O as qx,W as Kx,T as Vn,d as O_,m as kg,z as J0,n as xh,C as yg,E as Gx,a2 as X0,aa as Z0}from"./index-727ccf4d.js";import{S as N_,m as Yx,h as Qx,i as Jx,B as Xx,d as Zx,c as Pg,D as eC,f as tC}from"./DataSelect-00074039.js";import{t as ey,m as ty,_ as $i,B as Qn}from"./Button-9330b92c.js";import{F as kn}from"./FontAwesome4-32fe4385.js";import{N as nC,M as da,a as Tk,b as Sk,S as rC,c as Ak}from"./SelectCustom-701e5fac.js";import{C as xg}from"./Col-ed66bf37.js";import{I as Cl,b as iC,c as oC,F as sC}from"./InputNumber-dceb4c1c.js";import{R as aC}from"./Required-e4b19dca.js";import{g as lC,a as cC,w as Ch,I as dC,b as uC,P as hC}from"./InputTime-0a0b65be.js";import{T as fC}from"./TextArea-56268c1b.js";import{I as l_}from"./Input-ae2484bb.js";import{a as R_,k as pC}from"./useTheme-41684c89.js";import{_ as gC}from"./classCallCheck-22a738c0.js";import{a as mC}from"./withStyles-da525f81.js";import{b as bC,_ as Ek,a as vC}from"./possibleConstructorReturn-e4ffd6dd.js";import{D as _C,I as wC}from"./Dropdown-ab2dfbba.js";import"./Button-461c8cce.js";import"./SelectPanelMulti-70ffdcea.js";import{R as kC}from"./Row-4ad47f29.js";import{w as ny,c as yC}from"./capitalize-f7a57a5c.js";import{D as xC}from"./DataTable-2f4d7f97.js";var CC=["className","cssModule","tag"];function c_(){return c_=Object.assign?Object.assign.bind():function(h){for(var g=1;g<arguments.length;g++){var l=arguments[g];for(var p in l)Object.prototype.hasOwnProperty.call(l,p)&&(h[p]=l[p])}return h},c_.apply(this,arguments)}function TC(h,g){if(h==null)return{};var l=SC(h,g),p,_;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(h);for(_=0;_<w.length;_++)p=w[_],!(g.indexOf(p)>=0)&&Object.prototype.propertyIsEnumerable.call(h,p)&&(l[p]=h[p])}return l}function SC(h,g){if(h==null)return{};var l={},p=Object.keys(h),_,w;for(w=0;w<p.length;w++)_=p[w],!(g.indexOf(_)>=0)&&(l[_]=h[_]);return l}var AC={className:le.string,cssModule:le.object,tag:ey};function Ah(h){var g=h.className,l=h.cssModule,p=h.tag,_=p===void 0?"div":p,w=TC(h,CC),v=ty($i(g,"modal-footer"),l);return hi.createElement(_,c_({},w,{className:v}))}Ah.propTypes=AC;var EC=["className","cssModule","tag","type","size"];function Cg(){return Cg=Object.assign?Object.assign.bind():function(h){for(var g=1;g<arguments.length;g++){var l=arguments[g];for(var p in l)Object.prototype.hasOwnProperty.call(l,p)&&(h[p]=l[p])}return h},Cg.apply(this,arguments)}function PC(h,g){if(h==null)return{};var l=IC(h,g),p,_;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(h);for(_=0;_<w.length;_++)p=w[_],!(g.indexOf(p)>=0)&&Object.prototype.propertyIsEnumerable.call(h,p)&&(l[p]=h[p])}return l}function IC(h,g){if(h==null)return{};var l={},p=Object.keys(h),_,w;for(w=0;w<p.length;w++)_=p[w],!(g.indexOf(_)>=0)&&(l[_]=h[_]);return l}var MC={className:le.string,cssModule:le.object,size:le.string,tag:ey,type:le.string};function ry(h){var g=h.className,l=h.cssModule,p=h.tag,_=p===void 0?"div":p;h.type;var w=h.size,v=PC(h,EC),x=ty($i(g,"input-group",w?"input-group-".concat(w):null),l);return h.type==="dropdown"?hi.createElement(_C,Cg({},v,{className:x})):hi.createElement(wC.Provider,{value:{insideInputGroup:!0}},hi.createElement(_,Cg({},v,{className:x})))}ry.propTypes=MC;const OC=h=>{var p,_,w,v;let g=[],l={};for(let x=0;x<h.length;x++)h[x].tabName?(Object.keys(l).length!==0&&(g.push(l),l={}),h[x].ratio?l={tabName:h[x].tabName,ratio:h[x].ratio,hidden:((p=h[x])==null?void 0:p.hidden)||!1,style:((_=h[x])==null?void 0:_.style)||!1,children:[]}:l={tabName:h[x].tabName,hidden:((w=h[x])==null?void 0:w.hidden)||!1,style:((v=h[x])==null?void 0:v.style)||!1,children:[]}):l.children.push(h[x]);return Object.keys(l).length!==0&&g.push(l),g},Pk=h=>h.map(l=>l.type==="data-select"?{title:l.title,field:`${l.dataSelect.url}.${l.dataSelect.text_field}`}:l),iy=h=>{let g=h.findIndex(x=>x.tabName)<0?h.length:h.findIndex(x=>x.tabName),l=h.slice(0,g)||[],p=g>=0?h.slice(g,h.length):[],_=[{children:l}],w=p.length?OC(p):[];return[..._,...w]},oy=h=>{let g=[];if(!h)return"1fr 1fr";if(Array.isArray(h))h.forEach(l=>g.push(`${l}fr`));else{let l=+h;for(let p=1;p<=+l;p++)g.push("1fr")}return g.join(" ")},gg=(h,g,l="field",p)=>{let _={};return g?h.forEach(w=>{g.hasOwnProperty(w.field)&&(_[w[l]]=g[w.field])}):h.forEach(w=>{_[w[l]]=p||p===0?p:(w==null?void 0:w.valueDefault)||null}),_},Ik=(h,g,l="field")=>{let p=h.filter(_=>g[_[l]]===null||g[_[l]]==="");return p.length>0?p.map(w=>w.field):!1},NC=(h,g)=>h.filter(l=>{if(l.dependent)if(l.dependent.comparison!==void 0){let p=l.dependent.comparison;return typeof p=="string"||typeof p=="number"||typeof p=="boolean"?g[l.dependent.name]===p:p.includes(g[l.dependent.name])}else return g[l.dependent.name]!==void 0&&g[l.dependent.name]!==null;else return!0}),D_=(h,g,l)=>l&&h?typeof l=="number"||typeof l=="boolean"||typeof l=="string"?g===l:l.includes(g):!(h&&!g&&g!==0),d_=(h,g)=>h==="number"?g:`'${g}'`,sy=(h,g)=>{var l,p,_,w,v,x,P,F;return(l=h==null?void 0:h.dependent)!=null&&l.fieldWhere&&(h!=null&&h.dataSelect)&&((p=h==null?void 0:h.dependent)!=null&&p.name)?{...h,dataSelect:{...h.dataSelect,where:`${(_=h==null?void 0:h.dependent)==null?void 0:_.fieldWhere} ${(w=h==null?void 0:h.dependent)!=null&&w.logical?(v=h==null?void 0:h.dependent)==null?void 0:v.logical:"eq"} ${d_(((x=h==null?void 0:h.dependent)==null?void 0:x.type)||typeof g[(P=h==null?void 0:h.dependent)==null?void 0:P.name],g[(F=h==null?void 0:h.dependent)==null?void 0:F.name])}`}}:h},u_=(h,g,l,p)=>{let _={...g};return h.forEach(w=>{w.dependent&&l===w.dependent.name?_[w.field]=null:w.copy&&l===w.copy&&(_[w.field]=p)}),_},Mk=h=>{let g=[];return h.filter(l=>(l==null?void 0:l.dataSelect)&&(l==null?void 0:l.type)!=="select-async-multi").forEach(l=>{var p,_,w;g.push((p=l==null?void 0:l.dataSelect)!=null&&p.urlExpand?(_=l==null?void 0:l.dataSelect)==null?void 0:_.urlExpand:(w=l==null?void 0:l.dataSelect)==null?void 0:w.url)}),g.join(",")},Ok=(h,g)=>{for(let l in h)g.hasOwnProperty(l)&&g[l]!==null&&(h[l]=g[l]);return h},ay=h=>!!["textbox","number-not-seperator","number","numeric","currency","input-check-cmnd"].includes(h),RC=h=>h.map(l=>l!=null&&l.convertTextSearch?l==null?void 0:l.convertTextSearch(l):l.type==="date"||l.type==="datetime"?`${l.field} ${l.compareSearch?l.compareSearch:"eq"} datetime'${l.value}' `:ay(l.type)?`(substringof(${d_(typeof l.value,l.value)},${l.field}))`:`${l.field} ${l.compareSearch?l.compareSearch:"eq"} ${d_(typeof l.value,l.value)}`),Nk=(h,g)=>{let l=h.map(_=>{let w=g[_.field];if(w!=null&&w!=="")return{..._,value:w}});return RC(l.filter(_=>_!==void 0))},DC=(h,g)=>{let l={};for(let p in h)h[p]!==g[p]&&(l[p]=g[p]);return l},jC=h=>{let g={};for(const l in h)h[l]!==null&&(g[l]=h[l]);return g},LC=(h,g)=>{const l=w=>w===null||typeof w!="object"&&typeof w!="function",p=Object.keys(h),_=Object.keys(g);if(p.length!==_.length)return!0;for(const w of p)if(l(h[w])&&l(g[w])&&h[w]!==g[w])return!0;return!1},zC=(h,g)=>{const l=g.split(".");let p=h;for(const _ of l)if(p[_]!==void 0)p=p[_];else return;return p},Ig=h=>{const{disabled:g,name:l,label:p,checked:_,type:w,children:v,hidden_label:x,...P}=h;return A.jsxs("label",{className:"radio me-0",children:[A.jsx("input",{...P,type:"radio",name:l,checked:_,disabled:g,className:"me-0",children:v}),!x&&A.jsx("span",{className:g?"disabled":"",children:p})]})};Ig.propTypes={};Ig.defaultProps={};class FC extends Y.Component{constructor(g){var l;super(g),this.state={value:((l=this==null?void 0:this.props)==null?void 0:l.value)||null,dataState:[]}}componentDidMount(){var p,_;const{dataSelect:g,data:l}=this.props;!this.props.value&&(l!=null&&l.length)&&(this.setState({value:(p=l==null?void 0:l[0])==null?void 0:p.value}),this.props.onChange&&this.props.onChange((_=l==null?void 0:l[0])==null?void 0:_.value)),g!=null&&g.url&&Bn(g==null?void 0:g.url,"GET",null,{odata:(g==null?void 0:g.isOdata)!==void 0?g==null?void 0:g.isOdata:!0}).then(w=>{var P,F;let x=(g!=null&&g.dataSelect?g==null?void 0:g.dataSelect(w):w==null?void 0:w.value).map(y=>({value:y[g.value_field],label:y[g.text_field]}));this.setState({dataState:x}),!this.props.value&&(x!=null&&x.length)&&(this.setState({value:(P=x==null?void 0:x[0])==null?void 0:P.value}),this.props.onChange&&this.props.onChange((F=x==null?void 0:x[0])==null?void 0:F.value))})}render(){var w;const{name:g,disabled:l,data:p}=this.props;let _=(w=this.state.dataState)!=null&&w.length?this.state.dataState:p;return this.props.value!==this.state.value&&this.setState({value:this.props.value}),_&&_.map((v,x)=>A.jsx(Ig,{name:g,disabled:l||v.disabled,value:v.value,label:v.label,checked:this.state.value===v.value,onChange:P=>{this.setState({value:v==null?void 0:v.value}),this.props.onChange(v==null?void 0:v.value)}},x))}}class h_ extends Y.Component{constructor(g){super(g),this.state={checked:!1}}componentDidMount(){this.setState({checked:this.props.checked})}componentDidUpdate(g){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:g=>{this.setState({checked:g.target.checked}),this.props.onChange(g.target.checked)}}),A.jsx("span",{children:this.props.label})]})}}class BC extends Y.Component{constructor(l){super(l);ig(this,"handleChange",(l,p)=>{let{selected:_}=this.state;var w=_.indexOf(l);w<0?_.push(l):_.splice(w,1),this.setState({selected:_}),this.props.onChange(_)});this.state={selected:[]}}componentDidUpdate(l,p){this.props.value!==this.state.selected&&this.setState({selected:this.props.value})}render(){const{name:l,disabled:p,data:_}=this.props;return _&&_.map((w,v)=>A.jsx(h_,{name:l,disabled:p||w.disabled,value:w.value,label:w.label,checked:this.state.selected&&this.state.selected.indexOf(w.value)>=0&&!w.disabled,onChange:x=>this.handleChange(w.value,x)},v))}}class j_ extends Y.Component{render(){const{isDetail:g,value:l,invalid:p,onValueChange:_,onKeyDown:w,bsSize:v="sm",style:x,onBlur:P,onFocus:F,decimalScale:y,thousandSeparator:R,decimalSeparator:$,customInput:B,...V}=this.props;return g?A.jsx("div",{style:{textAlign:"right"},children:l===0||l===null?"":cd(l)}):A.jsx(nC,{...V,style:{textAlign:"right",...x},value:l,onValueChange:ee=>{_(ee)},onBlur:ee=>P&&P(ee),onKeyDown:w,onFocus:F,customInput:B||l_,bsSize:v,decimalScale:y||2,invalid:p})}}j_.defaultProps={placeholder:"Nhâp..."};j_.propTypes={placeholder:le.string};const VC=()=>{const h=new Date().getFullYear();let g=[];for(var l=h-5;l<=h+2;l++)g.push({value:l,label:`Năm ${l}`});return g},$C=h=>{let g=[],l=new Date().getFullYear(),p=l-2,_=l+5;h.minYear&&h.maxYear&&(p=h.minYear,_=h.maxYear);for(let w=p;w<=_;w++)g.push({value:w,label:w});return g};class L_ extends Y.Component{render(){const{value:g,onChange:l,isDetail:p,disabled:_,options:w,generateOptions:v}=this.props,x=v?$C(v):VC(),P=g||"";return p?A.jsx("div",{style:{textAlign:"center"},children:P?"Năm "+P:""}):A.jsx(N_,{disabled:_,value:P,onChange:l,options:w||x,valueRef:"value",labelRef:"label",placeholder:"Chọn năm"})}}L_.propTypes={};L_.defaultProps={placeholder:"Chọn..."};class z_ extends Y.Component{render(){const{value:g,onChange:l,disabled:p}=this.props,_=()=>{let w=[];for(var v=1;v<=12;v++)w.push({value:v,label:`Tháng ${v}`});return w};return A.jsx(N_,{disabled:p,value:g||"",onChange:l,options:_(),valueRef:"value",labelRef:"label",placeholder:"Chọn tháng"})}}z_.propTypes={};z_.defaultProps={placeholder:"Chọn..."};function HC(h){var g=UC();return function(){var p=Ek(h),_;if(g){var w=Ek(this).constructor;_=Reflect.construct(p,arguments,w)}else _=p.apply(this,arguments);return vC(this,_)}}function UC(){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 WC={cacheOptions:!1,defaultOptions:!1,filterOption:null,isLoading:!1},qC=function(g){var l,p;return p=l=function(_){bC(v,_);var w=HC(v);function v(x){var P;return gC(this,v),P=w.call(this),P.select=void 0,P.lastRequest=void 0,P.mounted=!1,P.optionsCache={},P.handleInputChange=function(F,y){var R=P.props,$=R.cacheOptions,B=R.onInputChange,V=Jx(F,y,B);if(!V){delete P.lastRequest,P.setState({inputValue:"",loadedInputValue:"",loadedOptions:[],isLoading:!1,passEmptyOptions:!1});return}if($&&P.optionsCache[V])P.setState({inputValue:V,loadedInputValue:V,loadedOptions:P.optionsCache[V],isLoading:!1,passEmptyOptions:!1});else{var ee=P.lastRequest={};P.setState({inputValue:V,isLoading:!0,passEmptyOptions:!P.state.loadedInputValue},function(){P.loadOptions(V,function(Z){P.mounted&&(Z&&(P.optionsCache[V]=Z),ee===P.lastRequest&&(delete P.lastRequest,P.setState({isLoading:!1,loadedInputValue:V,loadedOptions:Z||[],passEmptyOptions:!1})))})})}return V},P.state={defaultOptions:Array.isArray(x.defaultOptions)?x.defaultOptions:void 0,inputValue:typeof x.inputValue<"u"?x.inputValue:"",isLoading:x.defaultOptions===!0,loadedOptions:[],passEmptyOptions:!1},P}return mC(v,[{key:"componentDidMount",value:function(){var P=this;this.mounted=!0;var F=this.props.defaultOptions,y=this.state.inputValue;F===!0&&this.loadOptions(y,function(R){if(P.mounted){var $=!!P.lastRequest;P.setState({defaultOptions:R||[],isLoading:$})}})}},{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,F){var y=this.props.loadOptions;if(!y)return F();var R=y(P,F);R&&typeof R.then=="function"&&R.then(F,function(){return F()})}},{key:"render",value:function(){var P=this,F=this.props;F.loadOptions;var y=F.isLoading,R=R_(F,["loadOptions","isLoading"]),$=this.state,B=$.defaultOptions,V=$.inputValue,ee=$.isLoading,Z=$.loadedInputValue,z=$.loadedOptions,re=$.passEmptyOptions,X=re?[]:V&&Z?z:B||[];return hi.createElement(g,wg({},R,{ref:function(ie){P.select=ie},options:X,isLoading:ee||y,onInputChange:this.handleInputChange}))}}]),v}(Y.Component),l.defaultProps=WC,p},KC=Yx(Qx),GC=qC(KC);const YC=GC;var Tg={exports:{}};/*! * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. */Tg.exports;(function(h,g){(function(l,p){h.exports=p(Y)})(self,l=>(()=>{var p={703:(x,P,F)=>{var y=F(414);function R(){}function $(){}$.resetWarningCache=R,x.exports=function(){function B(Z,z,re,X,ne,ie){if(ie!==y){var ae=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 ae.name="Invariant Violation",ae}}function V(){return B}B.isRequired=B;var ee={array:B,bigint:B,bool:B,func:B,number:B,object:B,string:B,symbol:B,any:B,arrayOf:V,element:B,elementType:B,instanceOf:V,node:B,objectOf:V,oneOf:V,oneOfType:V,shape:V,exact:V,checkPropTypes:$,resetWarningCache:R};return ee.PropTypes=ee,ee}},697:(x,P,F)=>{x.exports=F(703)()},414:x=>{x.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},787:x=>{x.exports=l}},_={};function w(x){var P=_[x];if(P!==void 0)return P.exports;var F=_[x]={exports:{}};return p[x](F,F.exports,w),F.exports}w.n=x=>{var P=x&&x.__esModule?()=>x.default:()=>x;return w.d(P,{a:P}),P},w.d=(x,P)=>{for(var F in P)w.o(P,F)&&!w.o(x,F)&&Object.defineProperty(x,F,{enumerable:!0,get:P[F]})},w.o=(x,P)=>Object.prototype.hasOwnProperty.call(x,P),w.r=x=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(x,"__esModule",{value:!0})};var v={};return(()=>{w.r(v),w.d(v,{CKEditor:()=>Ci,CKEditorContext:()=>Bs});var x=w(787),P=w.n(x),F=w(697),y=w.n(F);const R=function(I){var M=typeof I;return I!=null&&(M=="object"||M=="function")},$=typeof an=="object"&&an&&an.Object===Object&&an;var B=typeof self=="object"&&self&&self.Object===Object&&self;const V=$||B||Function("return this")(),ee=function(){return V.Date.now()};var Z=/\s/;const z=function(I){for(var M=I.length;M--&&Z.test(I.charAt(M)););return M};var re=/^\s+/;const X=function(I){return I&&I.slice(0,z(I)+1).replace(re,"")},ne=V.Symbol;var ie=Object.prototype,ae=ie.hasOwnProperty,_e=ie.toString,Se=ne?ne.toStringTag:void 0;const Pe=function(I){var M=ae.call(I,Se),H=I[Se];try{I[Se]=void 0;var te=!0}catch{}var Te=_e.call(I);return te&&(M?I[Se]=H:delete I[Se]),Te};var Me=Object.prototype.toString;const Re=function(I){return Me.call(I)};var ce="[object Null]",pe="[object Undefined]",be=ne?ne.toStringTag:void 0;const ke=function(I){return I==null?I===void 0?pe:ce:be&&be in Object(I)?Pe(I):Re(I)},ye=function(I){return I!=null&&typeof I=="object"};var Ce="[object Symbol]";const ze=function(I){return typeof I=="symbol"||ye(I)&&ke(I)==Ce};var He=NaN,Ge=/^[-+]0x[0-9a-f]+$/i,qe=/^0b[01]+$/i,gt=/^0o[0-7]+$/i,je=parseInt;const ut=function(I){if(typeof I=="number")return I;if(ze(I))return He;if(R(I)){var M=typeof I.valueOf=="function"?I.valueOf():I;I=R(M)?M+"":M}if(typeof I!="string")return I===0?I:+I;I=X(I);var H=qe.test(I);return H||gt.test(I)?je(I.slice(2),H?2:8):Ge.test(I)?He:+I};var De="Expected a function",Oe=Math.max,tt=Math.min;const ht=function(I,M,H){var te,Te,Qe,Je,nt,zt,Ht=0,Oo=!1,nr=!1,me=!0;if(typeof I!="function")throw new TypeError(De);function $e(An){var fr=te,Zi=Te;return te=Te=void 0,Ht=An,Je=I.apply(Zi,fr)}function Ti(An){var fr=An-zt;return zt===void 0||fr>=M||fr<0||nr&&An-Ht>=Qe}function Ft(){var An=ee();if(Ti(An))return ft(An);nt=setTimeout(Ft,function(fr){var Zi=M-(fr-zt);return nr?tt(Zi,Qe-(fr-Ht)):Zi}(An))}function ft(An){return nt=void 0,me&&te?$e(An):(te=Te=void 0,Je)}function hr(){var An=ee(),fr=Ti(An);if(te=arguments,Te=this,zt=An,fr){if(nt===void 0)return function(Zi){return Ht=Zi,nt=setTimeout(Ft,M),Oo?$e(Zi):Je}(zt);if(nr)return clearTimeout(nt),nt=setTimeout(Ft,M),$e(zt)}return nt===void 0&&(nt=setTimeout(Ft,M)),Je}return M=ut(M)||0,R(H)&&(Oo=!!H.leading,Qe=(nr="maxWait"in H)?Oe(ut(H.maxWait)||0,M):Qe,me="trailing"in H?!!H.trailing:me),hr.cancel=function(){nt!==void 0&&clearTimeout(nt),Ht=0,te=zt=Te=nt=void 0},hr.flush=function(){return nt===void 0?Je:ft(ee())},hr};var kt="Expected a function";const Kt=function(I,M,H){var te=!0,Te=!0;if(typeof I!="function")throw new TypeError(kt);return R(H)&&(te="leading"in H?!!H.leading:te,Te="trailing"in H?!!H.trailing:Te),ht(I,M,{leading:te,maxWait:M,trailing:Te})},Ee=function(){this.__data__=[],this.size=0},yt=function(I,M){return I===M||I!=I&&M!=M},on=function(I,M){for(var H=I.length;H--;)if(yt(I[H][0],M))return H;return-1};var we=Array.prototype.splice;const Ne=function(I){var M=this.__data__,H=on(M,I);return!(H<0)&&(H==M.length-1?M.pop():we.call(M,H,1),--this.size,!0)},mt=function(I){var M=this.__data__,H=on(M,I);return H<0?void 0:M[H][1]},Fe=function(I){return on(this.__data__,I)>-1},Ye=function(I,M){var H=this.__data__,te=on(H,I);return te<0?(++this.size,H.push([I,M])):H[te][1]=M,this};function Vt(I){var M=-1,H=I==null?0:I.length;for(this.clear();++M<H;){var te=I[M];this.set(te[0],te[1])}}Vt.prototype.clear=Ee,Vt.prototype.delete=Ne,Vt.prototype.get=mt,Vt.prototype.has=Fe,Vt.prototype.set=Ye;const gn=Vt,Zt=function(){this.__data__=new gn,this.size=0},Vr=function(I){var M=this.__data__,H=M.delete(I);return this.size=M.size,H},po=function(I){return this.__data__.get(I)},fa=function(I){return this.__data__.has(I)};var $n="[object AsyncFunction]",ws="[object Function]",pi="[object GeneratorFunction]",xr="[object Proxy]";const go=function(I){if(!R(I))return!1;var M=ke(I);return M==ws||M==pi||M==$n||M==xr},Qr=V["__core-js_shared__"];var mo=function(){var I=/[^.]+$/.exec(Qr&&Qr.keys&&Qr.keys.IE_PROTO||"");return I?"Symbol(src)_1."+I:""}();const bo=function(I){return!!mo&&mo in I};var vo=Function.prototype.toString;const en=function(I){if(I!=null){try{return vo.call(I)}catch{}try{return I+""}catch{}}return""};var Xt=/^\[object .+?Constructor\]$/,un=Function.prototype,ln=Object.prototype,Hn=un.toString,mn=ln.hasOwnProperty,vt=RegExp("^"+Hn.call(mn).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Zn=function(I){return!(!R(I)||bo(I))&&(go(I)?vt:Xt).test(en(I))},Tt=function(I,M){return I==null?void 0:I[M]},Cr=function(I,M){var H=Tt(I,M);return Zn(H)?H:void 0},lr=Cr(V,"Map"),cr=Cr(Object,"create"),El=function(){this.__data__=cr?cr(null):{},this.size=0},ks=function(I){var M=this.has(I)&&delete this.__data__[I];return this.size-=M?1:0,M};var kd="__lodash_hash_undefined__",Pl=Object.prototype.hasOwnProperty;const yd=function(I){var M=this.__data__;if(cr){var H=M[I];return H===kd?void 0:H}return Pl.call(M,I)?M[I]:void 0};var Ho=Object.prototype.hasOwnProperty;const xd=function(I){var M=this.__data__;return cr?M[I]!==void 0:Ho.call(M,I)};var pa="__lodash_hash_undefined__";const Cd=function(I,M){var H=this.__data__;return this.size+=this.has(I)?0:1,H[I]=cr&&M===void 0?pa:M,this};function Tr(I){var M=-1,H=I==null?0:I.length;for(this.clear();++M<H;){var te=I[M];this.set(te[0],te[1])}}Tr.prototype.clear=El,Tr.prototype.delete=ks,Tr.prototype.get=yd,Tr.prototype.has=xd,Tr.prototype.set=Cd;const _o=Tr,ys=function(){this.size=0,this.__data__={hash:new _o,map:new(lr||gn),string:new _o}},xs=function(I){var M=typeof I;return M=="string"||M=="number"||M=="symbol"||M=="boolean"?I!=="__proto__":I===null},Ui=function(I,M){var H=I.__data__;return xs(M)?H[typeof M=="string"?"string":"hash"]:H.map},wo=function(I){var M=Ui(this,I).delete(I);return this.size-=M?1:0,M},Il=function(I){return Ui(this,I).get(I)},Cs=function(I){return Ui(this,I).has(I)},Gt=function(I,M){var H=Ui(this,I),te=H.size;return H.set(I,M),this.size+=H.size==te?0:1,this};function Wi(I){var M=-1,H=I==null?0:I.length;for(this.clear();++M<H;){var te=I[M];this.set(te[0],te[1])}}Wi.prototype.clear=ys,Wi.prototype.delete=wo,Wi.prototype.get=Il,Wi.prototype.has=Cs,Wi.prototype.set=Gt;const Td=Wi;var Sd=200;const Ml=function(I,M){var H=this.__data__;if(H instanceof gn){var te=H.__data__;if(!lr||te.length<Sd-1)return te.push([I,M]),this.size=++H.size,this;H=this.__data__=new Td(te)}return H.set(I,M),this.size=H.size,this};function qi(I){var M=this.__data__=new gn(I);this.size=M.size}qi.prototype.clear=Zt,qi.prototype.delete=Vr,qi.prototype.get=po,qi.prototype.has=fa,qi.prototype.set=Ml;const Be=qi,ve=function(I,M){for(var H=-1,te=I==null?0:I.length;++H<te&&M(I[H],H,I)!==!1;);return I},ko=function(){try{var I=Cr(Object,"defineProperty");return I({},"",{}),I}catch{}}(),at=function(I,M,H){M=="__proto__"&&ko?ko(I,M,{configurable:!0,enumerable:!0,value:H,writable:!0}):I[M]=H};var Ol=Object.prototype.hasOwnProperty;const ga=function(I,M,H){var te=I[M];Ol.call(I,M)&&yt(te,H)&&(H!==void 0||M in I)||at(I,M,H)},yo=function(I,M,H,te){var Te=!H;H||(H={});for(var Qe=-1,Je=M.length;++Qe<Je;){var nt=M[Qe],zt=te?te(H[nt],I[nt],nt,H,I):void 0;zt===void 0&&(zt=I[nt]),Te?at(H,nt,zt):ga(H,nt,zt)}return H},Ts=function(I,M){for(var H=-1,te=Array(I);++H<I;)te[H]=M(H);return te};var Nl="[object Arguments]";const Rl=function(I){return ye(I)&&ke(I)==Nl};var ma=Object.prototype,Ad=ma.hasOwnProperty,Ed=ma.propertyIsEnumerable;const er=Rl(function(){return arguments}())?Rl:function(I){return ye(I)&&Ad.call(I,"callee")&&!Ed.call(I,"callee")},Ss=Array.isArray,Uo=function(){return!1};var As=g&&!g.nodeType&&g,Dl=As&&!0&&h&&!h.nodeType&&h,ba=Dl&&Dl.exports===As?V.Buffer:void 0;const Wo=(ba?ba.isBuffer:void 0)||Uo;var jl=9007199254740991,xo=/^(?:0|[1-9]\d*)$/;const qo=function(I,M){var H=typeof I;return!!(M=M??jl)&&(H=="number"||H!="symbol"&&xo.test(I))&&I>-1&&I%1==0&&I<M};var Ll=9007199254740991;const Es=function(I){return typeof I=="number"&&I>-1&&I%1==0&&I<=Ll};var Yt={};Yt["[object Float32Array]"]=Yt["[object Float64Array]"]=Yt["[object Int8Array]"]=Yt["[object Int16Array]"]=Yt["[object Int32Array]"]=Yt["[object Uint8Array]"]=Yt["[object Uint8ClampedArray]"]=Yt["[object Uint16Array]"]=Yt["[object Uint32Array]"]=!0,Yt["[object Arguments]"]=Yt["[object Array]"]=Yt["[object ArrayBuffer]"]=Yt["[object Boolean]"]=Yt["[object DataView]"]=Yt["[object Date]"]=Yt["[object Error]"]=Yt["[object Function]"]=Yt["[object Map]"]=Yt["[object Number]"]=Yt["[object Object]"]=Yt["[object RegExp]"]=Yt["[object Set]"]=Yt["[object String]"]=Yt["[object WeakMap]"]=!1;const zl=function(I){return ye(I)&&Es(I.length)&&!!Yt[ke(I)]},Jr=function(I){return function(M){return I(M)}};var gi=g&&!g.nodeType&&g,$r=gi&&!0&&h&&!h.nodeType&&h,Ps=$r&&$r.exports===gi&&$.process;const Ki=function(){try{var I=$r&&$r.require&&$r.require("util").types;return I||Ps&&Ps.binding&&Ps.binding("util")}catch{}}();var Fl=Ki&&Ki.isTypedArray;const Bl=Fl?Jr(Fl):zl;var Vl=Object.prototype.hasOwnProperty;const va=function(I,M){var H=Ss(I),te=!H&&er(I),Te=!H&&!te&&Wo(I),Qe=!H&&!te&&!Te&&Bl(I),Je=H||te||Te||Qe,nt=Je?Ts(I.length,String):[],zt=nt.length;for(var Ht in I)!M&&!Vl.call(I,Ht)||Je&&(Ht=="length"||Te&&(Ht=="offset"||Ht=="parent")||Qe&&(Ht=="buffer"||Ht=="byteLength"||Ht=="byteOffset")||qo(Ht,zt))||nt.push(Ht);return nt};var Gi=Object.prototype;const Is=function(I){var M=I&&I.constructor;return I===(typeof M=="function"&&M.prototype||Gi)},$l=function(I,M){return function(H){return I(M(H))}},Pd=$l(Object.keys,Object);var Ko=Object.prototype.hasOwnProperty;const Id=function(I){if(!Is(I))return Pd(I);var M=[];for(var H in Object(I))Ko.call(I,H)&&H!="constructor"&&M.push(H);return M},Hl=function(I){return I!=null&&Es(I.length)&&!go(I)},_a=function(I){return Hl(I)?va(I):Id(I)},Md=function(I,M){return I&&yo(M,_a(M),I)},mi=function(I){var M=[];if(I!=null)for(var H in Object(I))M.push(H);return M};var Ms=Object.prototype.hasOwnProperty;const Od=function(I){if(!R(I))return mi(I);var M=Is(I),H=[];for(var te in I)(te!="constructor"||!M&&Ms.call(I,te))&&H.push(te);return H},bi=function(I){return Hl(I)?va(I,!0):Od(I)},Go=function(I,M){return I&&yo(M,bi(M),I)};var Ul=g&&!g.nodeType&&g,$t=Ul&&!0&&h&&!h.nodeType&&h,Lt=$t&&$t.exports===Ul?V.Buffer:void 0,Wl=Lt?Lt.allocUnsafe:void 0;const wa=function(I,M){if(M)return I.slice();var H=I.length,te=Wl?Wl(H):new I.constructor(H);return I.copy(te),te},Nd=function(I,M){var H=-1,te=I.length;for(M||(M=Array(te));++H<te;)M[H]=I[H];return M},Rd=function(I,M){for(var H=-1,te=I==null?0:I.length,Te=0,Qe=[];++H<te;){var Je=I[H];M(Je,H,I)&&(Qe[Te++]=Je)}return Qe},ka=function(){return[]};var ql=Object.prototype.propertyIsEnumerable,ya=Object.getOwnPropertySymbols;const Os=ya?function(I){return I==null?[]:(I=Object(I),Rd(ya(I),function(M){return ql.call(I,M)}))}:ka,yn=function(I,M){return yo(I,Os(I),M)},Yo=function(I,M){for(var H=-1,te=M.length,Te=I.length;++H<te;)I[Te+H]=M[H];return I},Sr=$l(Object.getPrototypeOf,Object),xa=Object.getOwnPropertySymbols?function(I){for(var M=[];I;)Yo(M,Os(I)),I=Sr(I);return M}:ka,Ns=function(I,M){return yo(I,xa(I),M)},Un=function(I,M,H){var te=M(I);return Ss(I)?te:Yo(te,H(I))},Kl=function(I){return Un(I,_a,Os)},Ca=function(I){return Un(I,bi,xa)},Co=Cr(V,"DataView"),Rs=Cr(V,"Promise"),To=Cr(V,"Set"),So=Cr(V,"WeakMap");var Tn="[object Map]",Ds="[object Promise]",tr="[object Set]",Gl="[object WeakMap]",Ta="[object DataView]",vi=en(Co),js=en(lr),Xr=en(Rs),Ot=en(To),_i=en(So),Zr=ke;(Co&&Zr(new Co(new ArrayBuffer(1)))!=Ta||lr&&Zr(new lr)!=Tn||Rs&&Zr(Rs.resolve())!=Ds||To&&Zr(new To)!=tr||So&&Zr(new So)!=Gl)&&(Zr=function(I){var M=ke(I),H=M=="[object Object]"?I.constructor:void 0,te=H?en(H):"";if(te)switch(te){case vi:return Ta;case js:return Tn;case Xr:return Ds;case Ot:return tr;case _i:return Gl}return M});const Ao=Zr;var Qo=Object.prototype.hasOwnProperty;const Dd=function(I){var M=I.length,H=new I.constructor(M);return M&&typeof I[0]=="string"&&Qo.call(I,"index")&&(H.index=I.index,H.input=I.input),H},Yl=V.Uint8Array,Sa=function(I){var M=new I.constructor(I.byteLength);return new Yl(M).set(new Yl(I)),M},Aa=function(I,M){var H=M?Sa(I.buffer):I.buffer;return new I.constructor(H,I.byteOffset,I.byteLength)};var Jo=/\w*$/;const Eo=function(I){var M=new I.constructor(I.source,Jo.exec(I));return M.lastIndex=I.lastIndex,M};var Ea=ne?ne.prototype:void 0,Pa=Ea?Ea.valueOf:void 0;const Ia=function(I){return Pa?Object(Pa.call(I)):{}},Ma=function(I,M){var H=M?Sa(I.buffer):I.buffer;return new I.constructor(H,I.byteOffset,I.length)};var Ls="[object Boolean]",Ql="[object Date]",Jl="[object Map]",Oa="[object Number]",Na="[object RegExp]",Xl="[object Set]",Zl="[object String]",lt="[object Symbol]",Xo="[object ArrayBuffer]",Po="[object DataView]",ei="[object Float32Array]",Ra="[object Float64Array]",ec="[object Int8Array]",jd="[object Int16Array]",dr="[object Int32Array]",ur="[object Uint8Array]",Da="[object Uint8ClampedArray]",Pt="[object Uint16Array]",Ld="[object Uint32Array]";const zd=function(I,M,H){var te=I.constructor;switch(M){case Xo:return Sa(I);case Ls:case Ql:return new te(+I);case Po:return Aa(I,H);case ei:case Ra:case ec:case jd:case dr:case ur:case Da:case Pt:case Ld:return Ma(I,H);case Jl:return new te;case Oa:case Zl:return new te(I);case Na:return Eo(I);case Xl:return new te;case lt:return Ia(I)}};var Zo=Object.create;const tc=function(){function I(){}return function(M){if(!R(M))return{};if(Zo)return Zo(M);I.prototype=M;var H=new I;return I.prototype=void 0,H}}(),wi=function(I){return typeof I.constructor!="function"||Is(I)?{}:tc(Sr(I))};var ki="[object Map]";const Sn=function(I){return ye(I)&&Ao(I)==ki};var ja=Ki&&Ki.isMap;const Yi=ja?Jr(ja):Sn;var xt="[object Set]";const hn=function(I){return ye(I)&&Ao(I)==xt};var Ar=Ki&&Ki.isSet;const Hr=Ar?Jr(Ar):hn;var nc=1,La=2,zs=4,rc="[object Arguments]",Qi="[object Function]",K="[object GeneratorFunction]",se="[object Object]",Q={};Q[rc]=Q["[object Array]"]=Q["[object ArrayBuffer]"]=Q["[object DataView]"]=Q["[object Boolean]"]=Q["[object Date]"]=Q["[object Float32Array]"]=Q["[object Float64Array]"]=Q["[object Int8Array]"]=Q["[object Int16Array]"]=Q["[object Int32Array]"]=Q["[object Map]"]=Q["[object Number]"]=Q[se]=Q["[object RegExp]"]=Q["[object Set]"]=Q["[object String]"]=Q["[object Symbol]"]=Q["[object Uint8Array]"]=Q["[object Uint8ClampedArray]"]=Q["[object Uint16Array]"]=Q["[object Uint32Array]"]=!0,Q["[object Error]"]=Q[Qi]=Q["[object WeakMap]"]=!1;const Ie=function I(M,H,te,Te,Qe,Je){var nt,zt=H&nc,Ht=H&La,Oo=H&zs;if(te&&(nt=Qe?te(M,Te,Qe,Je):te(M)),nt!==void 0)return nt;if(!R(M))return M;var nr=Ss(M);if(nr){if(nt=Dd(M),!zt)return Nd(M,nt)}else{var me=Ao(M),$e=me==Qi||me==K;if(Wo(M))return wa(M,zt);if(me==se||me==rc||$e&&!Qe){if(nt=Ht||$e?{}:wi(M),!zt)return Ht?Ns(M,Go(nt,M)):yn(M,Md(nt,M))}else{if(!Q[me])return Qe?M:{};nt=zd(M,me,zt)}}Je||(Je=new Be);var Ti=Je.get(M);if(Ti)return Ti;Je.set(M,nt),Hr(M)?M.forEach(function(ft){nt.add(I(ft,H,te,ft,M,Je))}):Yi(M)&&M.forEach(function(ft,hr){nt.set(hr,I(ft,H,te,hr,M,Je))});var Ft=nr?void 0:(Oo?Ht?Ca:Kl:Ht?bi:_a)(M);return ve(Ft||M,function(ft,hr){Ft&&(ft=M[hr=ft]),ga(nt,hr,I(ft,H,te,hr,M,Je))}),nt};var Xe=1,St=4;const fn=function(I,M){return Ie(I,Xe|St,M=typeof M=="function"?M:void 0)};var Nt="[object Object]",Fs=Function.prototype,Fd=Object.prototype,In=Fs.toString,Io=Fd.hasOwnProperty,Bd=In.call(Object);const yi=function(I){if(!ye(I)||ke(I)!=Nt)return!1;var M=Sr(I);if(M===null)return!0;var H=Io.call(M,"constructor")&&M.constructor;return typeof H=="function"&&H instanceof H&&In.call(H)==Bd},es=function(I){return ye(I)&&I.nodeType===1&&!yi(I)};function Ji(I,M=new Set){const H=[I],te=new Set;let Te=0;for(;H.length>Te;){const Qe=H[Te++];if(!(te.has(Qe)||It(Qe)||M.has(Qe)))if(te.add(Qe),Qe[Symbol.iterator])try{for(const Je of Qe)H.push(Je)}catch{}else for(const Je in Qe)Je!=="defaultValue"&&H.push(Qe[Je])}return te}function It(I){const M=Object.prototype.toString.call(I),H=typeof I;return H==="number"||H==="boolean"||H==="string"||H==="symbol"||H==="function"||M==="[object Date]"||M==="[object RegExp]"||M==="[object Module]"||I==null||I._watchdogExcluded===!0||I instanceof EventTarget||I instanceof Event}function ic(I,M,H=new Set){if(I===M&&typeof(te=I)=="object"&&te!==null)return!0;var te;const Te=Ji(I,H),Qe=Ji(M,H);for(const Je of Te)if(Qe.has(Je))return!0;return!1}class za{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=H=>{const te=H.error||H.reason;te instanceof Error&&this._handleError(te,H)},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,H){this._listeners[M]||(this._listeners[M]=[]),this._listeners[M].push(H)}off(M,H){this._listeners[M]=this._listeners[M].filter(te=>te!==H)}_fire(M,...H){const te=this._listeners[M]||[];for(const Te of te)Te.apply(this,[null,...H])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(M,H){if(this._shouldReactToError(M)){this.crashes.push({message:M.message,stack:M.stack,filename:H.filename,lineno:H.lineno,colno:H.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 xi extends za{constructor(M,H={}){super(H),this._editor=null,this._throttledSave=Kt(this._save.bind(this),typeof H.saveInterval=="number"?H.saveInterval:5e3),this._creator=(te,Te)=>M.create(te,Te),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,H=this._config,te){return Promise.resolve().then(()=>(super._startErrorHandling(),this._elementOrData=M,this._config=this._cloneEditorConfiguration(H)||{},this._config.context=te,this._creator(M,this._config))).then(Te=>{this._editor=Te,Te.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=Te.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(H){console.error(H,"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 H of this._editor.model.document.getRootNames())M[H]=this._editor.data.get({rootName:H});return M}_isErrorComingFromThisItem(M){return ic(this._editor,M.context,this._excludedProps)}_cloneEditorConfiguration(M){return fn(M,(H,te)=>es(H)||te==="context"?H:void 0)}}const bn=new Array(256).fill("").map((I,M)=>("0"+M.toString(16)).slice(-2)),ts=Symbol("MainQueueId");class oc extends za{constructor(M,H={}){super(H),this._watchdogs=new Map,this._watchdogConfig=H,this._context=null,this._contextProps=new Set,this._actionQueues=new Mo,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(ts,()=>(this._contextConfig=M,this._create()))}getItem(M){return this._getWatchdog(M)._item}getItemState(M){return this._getWatchdog(M).state}add(M){const H=ti(M);return Promise.all(H.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 Te;if(this._watchdogs.has(te.id))throw new Error(`Item with the given id is already added: '${te.id}'.`);if(te.type==="editor")return Te=new xi(this._watchdogConfig),Te.setCreator(te.creator),Te._setExcludedProperties(this._contextProps),te.destructor&&Te.setDestructor(te.destructor),this._watchdogs.set(te.id,Te),Te.on("error",(Qe,{error:Je,causesRestart:nt})=>{this._fire("itemError",{itemId:te.id,error:Je}),nt&&this._actionQueues.enqueue(te.id,()=>new Promise(zt=>{Te.on("restart",(function Ht(){Te.off("restart",Ht),this._fire("itemRestart",{itemId:te.id}),zt()}).bind(this))}))}),Te.create(te.sourceElementOrData,te.config,this._context);throw new Error(`Not supported item type: '${te.type}'.`)})))}remove(M){const H=ti(M);return Promise.all(H.map(te=>this._actionQueues.enqueue(te,()=>{const Te=this._getWatchdog(te);return this._watchdogs.delete(te),Te.destroy()})))}destroy(){return this._actionQueues.enqueue(ts,()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_restart(){return this._actionQueues.enqueue(ts,()=>(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=Ji(this._context),Promise.all(Array.from(this._watchdogs.values()).map(H=>(H._setExcludedProperties(this._contextProps),H.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(H=>H.destroy())).then(()=>this._destructor(M))})}_getWatchdog(M){const H=this._watchdogs.get(M);if(!H)throw new Error(`Item with the given id was not registered: ${M}.`);return H}_isErrorComingFromThisItem(M){for(const H of this._watchdogs.values())if(H._isErrorComingFromThisItem(M))return!1;return ic(this._context,M.context)}}class Mo{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,H){const te=M===ts;this._activeActions++,this._queues.get(M)||this._queues.set(M,Promise.resolve());const Te=(te?Promise.all(this._queues.values()):Promise.all([this._queues.get(ts),this._queues.get(M)])).then(H),Qe=Te.catch(()=>{});return this._queues.set(M,Qe),Te.finally(()=>{this._activeActions--,this._queues.get(M)===Qe&&this._activeActions===0&&this._onEmptyCallbacks.forEach(Je=>Je())})}}function ti(I){return Array.isArray(I)?I:[I]}const ns=P().createContext("contextWatchdog");class Bs extends P().Component{constructor(M,H){super(M,H),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(ns.Provider,{value:this.contextWatchdog},this.props.children)}async componentWillUnmount(){await this._destroyContext()}async _initializeContextWatchdog(M){this.contextWatchdog=new oc(this.props.context,this.props.watchdogConfig),this.contextWatchdog.on("error",(H,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(H=>{this.props.onError(H,{phase:"initialization",willContextRestart:!1})})}async _destroyContext(){this.contextWatchdog&&(await this.contextWatchdog.destroy(),this.contextWatchdog=null)}}Bs.defaultProps={isLayoutReady:!0,onError:(I,M)=>console.error(I,M)},Bs.propTypes={id:y().string,isLayoutReady:y().bool,context:y().func,watchdogConfig:y().object,config:y().object,onReady:y().func,onError:y().func};const Xi="Lock from React integration (@ckeditor/ckeditor5-react)";class Ci extends P().Component{constructor(M){super(M),this.editorDestructionInProgress=null,this.domContainer=P().createRef(),this.watchdog=null;const{CKEDITOR_VERSION:H}=window;if(H){const[te]=H.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(Xi):this.editor.disableReadOnlyMode(Xi)),!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 oc?this.watchdog=new sc(this.context):this.watchdog=new Ci._EditorWatchdog(this.props.editor,this.props.watchdogConfig),this.watchdog.setCreator((M,H)=>this._createEditor(M,H)),this.watchdog.on("error",(M,{error:H,causesRestart:te})=>{this.props.onError(H,{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,H){return this.props.editor.create(M,H).then(te=>{"disabled"in this.props&&this.props.disabled&&te.enableReadOnlyMode(Xi);const Te=te.model.document,Qe=te.editing.view.document;return Te.on("change:data",Je=>{this.props.onChange&&this.props.onChange(Je,te)}),Qe.on("focus",Je=>{this.props.onFocus&&this.props.onFocus(Je,te)}),Qe.on("blur",Je=>{this.props.onBlur&&this.props.onBlur(Je,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 sc{constructor(M){this._contextWatchdog=M,this._id=function(){const H=4294967296*Math.random()>>>0,te=4294967296*Math.random()>>>0,Te=4294967296*Math.random()>>>0,Qe=4294967296*Math.random()>>>0;return"e"+bn[H>>0&255]+bn[H>>8&255]+bn[H>>16&255]+bn[H>>24&255]+bn[te>>0&255]+bn[te>>8&255]+bn[te>>16&255]+bn[te>>24&255]+bn[Te>>0&255]+bn[Te>>8&255]+bn[Te>>16&255]+bn[Te>>24&255]+bn[Qe>>0&255]+bn[Qe>>8&255]+bn[Qe>>16&255]+bn[Qe>>24&255]}()}setCreator(M){this._creator=M}create(M,H){return this._contextWatchdog.add({sourceElementOrData:M,config:H,creator:this._creator,id:this._id,type:"editor"})}on(M,H){this._contextWatchdog.on("itemError",(te,{itemId:Te,causesRestart:Qe,error:Je})=>{Te===this._id&&H(null,{error:Je,causesRestart:Qe})})}destroy(){return this._contextWatchdog.state==="ready"?this._contextWatchdog.remove(this._id):Promise.resolve()}get editor(){return this._contextWatchdog.getItem(this._id)}}Ci.contextType=ns,Ci.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.')}},Ci.defaultProps={config:{},onError:(I,M)=>console.error(I,M)},Ci._EditorWatchdog=xi})(),v})())})(Tg,Tg.exports);var QC=Tg.exports,f_={exports:{}};/*! * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */(function(h,g){(function(l){const p=l.en=l.en||{};p.dictionary=Object.assign(p.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,p){h.exports=p()}(window,function(){return function(l){var p={};function _(w){if(p[w])return p[w].exports;var v=p[w]={i:w,l:!1,exports:{}};return l[w].call(v.exports,v,v.exports,_),v.l=!0,v.exports}return _.m=l,_.c=p,_.d=function(w,v,x){_.o(w,v)||Object.defineProperty(w,v,{enumerable:!0,get:x})},_.r=function(w){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(w,"__esModule",{value:!0})},_.t=function(w,v){if(1&v&&(w=_(w)),8&v||4&v&&typeof w=="object"&&w&&w.__esModule)return w;var x=Object.create(null);if(_.r(x),Object.defineProperty(x,"default",{enumerable:!0,value:w}),2&v&&typeof w!="string")for(var P in w)_.d(x,P,(function(F){return w[F]}).bind(null,P));return x},_.n=function(w){var v=w&&w.__esModule?function(){return w.default}:function(){return w};return _.d(v,"a",v),v},_.o=function(w,v){return Object.prototype.hasOwnProperty.call(w,v)},_.p="",_(_.s=108)}([function(l,p,_){_.d(p,"a",function(){return w}),_.d(p,"b",function(){return v});class w extends Error{constructor(y,R,$){super(`${y}${$?" "+JSON.stringify($):""}${x(y)}`),this.name="CKEditorError",this.context=R,this.data=$}is(y){return y==="CKEditorError"}static rethrowUnexpectedError(y,R){if(y.is&&y.is("CKEditorError"))throw y;const $=new w(y.message,R);throw $.stack=y.stack,$}}function v(F,y){console.warn(...P(F,y))}function x(F){return` Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-`+F}function P(F,y){const R=x(F);return y?[F,y,R]:[F,R]}},function(l,p,_){var w,v=function(){return w===void 0&&(w=!!(window&&document&&document.all&&!window.atob)),w},x=function(){var X={};return function(ne){if(X[ne]===void 0){var ie=document.querySelector(ne);if(window.HTMLIFrameElement&&ie instanceof window.HTMLIFrameElement)try{ie=ie.contentDocument.head}catch{ie=null}X[ne]=ie}return X[ne]}}(),P=[];function F(X){for(var ne=-1,ie=0;ie<P.length;ie++)if(P[ie].identifier===X){ne=ie;break}return ne}function y(X,ne){for(var ie={},ae=[],_e=0;_e<X.length;_e++){var Se=X[_e],Pe=ne.base?Se[0]+ne.base:Se[0],Me=ie[Pe]||0,Re="".concat(Pe," ").concat(Me);ie[Pe]=Me+1;var ce=F(Re),pe={css:Se[1],media:Se[2],sourceMap:Se[3]};ce!==-1?(P[ce].references++,P[ce].updater(pe)):P.push({identifier:Re,updater:re(pe,ne),references:1}),ae.push(Re)}return ae}function R(X){var ne=document.createElement("style"),ie=X.attributes||{};if(ie.nonce===void 0){var ae=_.nc;ae&&(ie.nonce=ae)}if(Object.keys(ie).forEach(function(Se){ne.setAttribute(Se,ie[Se])}),typeof X.insert=="function")X.insert(ne);else{var _e=x(X.insert||"head");if(!_e)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");_e.appendChild(ne)}return ne}var $,B=($=[],function(X,ne){return $[X]=ne,$.filter(Boolean).join(` `)});function V(X,ne,ie,ae){var _e=ie?"":ae.media?"@media ".concat(ae.media," {").concat(ae.css,"}"):ae.css;if(X.styleSheet)X.styleSheet.cssText=B(ne,_e);else{var Se=document.createTextNode(_e),Pe=X.childNodes;Pe[ne]&&X.removeChild(Pe[ne]),Pe.length?X.insertBefore(Se,Pe[ne]):X.appendChild(Se)}}function ee(X,ne,ie){var ae=ie.css,_e=ie.media,Se=ie.sourceMap;if(_e?X.setAttribute("media",_e):X.removeAttribute("media"),Se&&typeof btoa<"u"&&(ae+=` /*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(Se))))," */")),X.styleSheet)X.styleSheet.cssText=ae;else{for(;X.firstChild;)X.removeChild(X.firstChild);X.appendChild(document.createTextNode(ae))}}var Z=null,z=0;function re(X,ne){var ie,ae,_e;if(ne.singleton){var Se=z++;ie=Z||(Z=R(ne)),ae=V.bind(null,ie,Se,!1),_e=V.bind(null,ie,Se,!0)}else ie=R(ne),ae=ee.bind(null,ie,ne),_e=function(){(function(Pe){if(Pe.parentNode===null)return!1;Pe.parentNode.removeChild(Pe)})(ie)};return ae(X),function(Pe){if(Pe){if(Pe.css===X.css&&Pe.media===X.media&&Pe.sourceMap===X.sourceMap)return;ae(X=Pe)}else _e()}}l.exports=function(X,ne){(ne=ne||{}).singleton||typeof ne.singleton=="boolean"||(ne.singleton=v());var ie=y(X=X||[],ne);return function(ae){if(ae=ae||[],Object.prototype.toString.call(ae)==="[object Array]"){for(var _e=0;_e<ie.length;_e++){var Se=F(ie[_e]);P[Se].references--}for(var Pe=y(ae,ne),Me=0;Me<ie.length;Me++){var Re=F(ie[Me]);P[Re].references===0&&(P[Re].updater(),P.splice(Re,1))}ie=Pe}}}},,function(l,p,_){var w=_(8),v=typeof self=="object"&&self&&self.Object===Object&&self,x=w.a||v||Function("return this")();p.a=x},function(l,p,_){(function(w){var v=_(3),x=_(14),P=g&&!g.nodeType&&g,F=P&&typeof w=="object"&&w&&!w.nodeType&&w,y=F&&F.exports===P?v.a.Buffer:void 0,R=(y?y.isBuffer:void 0)||x.a;p.a=R}).call(this,_(10)(l))},function(l,p,_){(function(w){var v=_(8),x=g&&!g.nodeType&&g,P=x&&typeof w=="object"&&w&&!w.nodeType&&w,F=P&&P.exports===x&&v.a.process,y=function(){try{var R=P&&P.require&&P.require("util").types;return R||F&&F.binding&&F.binding("util")}catch{}}();p.a=y}).call(this,_(10)(l))},function(l,p,_){(function(w){var v=_(0);const x=typeof window=="object"?window:w;if(x.CKEDITOR_VERSION)throw new v.a("ckeditor-duplicated-modules",null);x.CKEDITOR_VERSION="29.2.0"}).call(this,_(12))},function(l,p,_){var w=_(1),v=_(76);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p,_){(function(w){var v=typeof w=="object"&&w&&w.Object===Object&&w;p.a=v}).call(this,_(12))},function(l,p,_){(function(w){var v=_(3),x=g&&!g.nodeType&&g,P=x&&typeof w=="object"&&w&&!w.nodeType&&w,F=P&&P.exports===x?v.a.Buffer:void 0,y=F?F.allocUnsafe:void 0;p.a=function(R,$){if($)return R.slice();var B=R.length,V=y?y(B):new R.constructor(B);return R.copy(V),V}}).call(this,_(10)(l))},function(l,p){l.exports=function(_){if(!_.webpackPolyfill){var w=Object.create(_);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,p,_){var w=_(1),v=_(77);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){var _;_=function(){return this}();try{_=_||new Function("return this")()}catch{typeof window=="object"&&(_=window)}l.exports=_},function(l,p,_){var w=_(1),v=_(71);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p,_){p.a=function(){return!1}},function(l,p,_){var w=_(1),v=_(16);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(18);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(20);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(22);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(24);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(26);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(28);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(30);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(32);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(34);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(36);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(38);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(40);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(42);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){l.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(l,p,_){var w=_(1),v=_(44);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(46);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(48);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(50);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(52);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(54);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(56);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(58);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(60);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(62);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(64);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(66);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(68);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(70);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p){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,p,_){var w=_(1),v=_(73);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(75);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p){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,p){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,p,_){var w=_(1),v=_(79);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(81);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(83);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(85);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(87);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(89);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(91);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(93);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(95);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(97);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(99);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){l.exports=".ck-content .media{clear:both;margin:.9em 0;display:block;min-width:15em}"},function(l,p,_){var w=_(1),v=_(101);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(103);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(105);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){var w=_(1),v=_(107);typeof(v=v.__esModule?v.default:v)=="string"&&(v=[[l.i,v,""]]);var x={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};w(v,x),l.exports=v.locals||{}},function(l,p){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,p,_){_.r(p),_.d(p,"default",function(){return Nv});var w=function(){return function i(){i.called=!0}};class v{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=w(),this.off=w()}}const x=new Array(256).fill().map((i,e)=>("0"+e.toString(16)).slice(-2));function P(){const i=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0;return"e"+x[i>>0&255]+x[i>>8&255]+x[i>>16&255]+x[i>>24&255]+x[e>>0&255]+x[e>>8&255]+x[e>>16&255]+x[e>>24&255]+x[t>>0&255]+x[t>>8&255]+x[t>>16&255]+x[t>>24&255]+x[n>>0&255]+x[n>>8&255]+x[n>>16&255]+x[n>>24&255]}var F={get(i){return typeof i!="number"?this[i]||this.normal:i},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5},y=(_(6),_(0));const R=Symbol("listeningTo"),$=Symbol("emitterId");var B={on(i,e,t={}){this.listenTo(this,i,e,t)},once(i,e,t){let n=!1;this.listenTo(this,i,function(r,...o){n||(n=!0,r.off(),e.call(this,r,...o))},t)},off(i,e){this.stopListening(this,i,e)},listenTo(i,e,t,n={}){let r,o;this[R]||(this[R]={});const a=this[R];ee(i)||V(i);const c=ee(i);(r=a[c])||(r=a[c]={emitter:i,callbacks:{}}),(o=r.callbacks[e])||(o=r.callbacks[e]=[]),o.push(t),function(u,f,b,k,T){f._addEventListener?f._addEventListener(b,k,T):u._addEventListener.call(f,b,k,T)}(this,i,e,t,n)},stopListening(i,e,t){const n=this[R];let r=i&&ee(i);const o=n&&r&&n[r],a=o&&e&&o.callbacks[e];if(!(!n||i&&!o||e&&!a))if(t)X(this,i,e,t),a.indexOf(t)!==-1&&(a.length===1?delete o.callbacks[e]:X(this,i,e,t));else if(a){for(;t=a.pop();)X(this,i,e,t);delete o.callbacks[e]}else if(o){for(e in o.callbacks)this.stopListening(i,e);delete n[r]}else{for(r in n)this.stopListening(n[r].emitter);delete this[R]}},fire(i,...e){try{const t=i instanceof v?i:new v(this,i),n=t.name;let r=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),r){const o=[t,...e];r=Array.from(r);for(let a=0;a<r.length&&(r[a].callback.apply(this,o),t.off.called&&(delete t.off.called,this._removeEventListener(n,r[a].callback)),!t.stop.called);a++);}if(this._delegations){const o=this._delegations.get(n),a=this._delegations.get("*");o&&re(o,t,e),a&&re(a,t,e)}return t.return}catch(t){y.a.rethrowUnexpectedError(t,this)}},delegate(...i){return{to:(e,t)=>{this._delegations||(this._delegations=new Map),i.forEach(n=>{const r=this._delegations.get(n);r?r.set(e,t):this._delegations.set(n,new Map([[e,t]]))})}}},stopDelegating(i,e){if(this._delegations)if(i)if(e){const t=this._delegations.get(i);t&&t.delete(e)}else this._delegations.delete(i);else this._delegations.clear()},_addEventListener(i,e,t){(function(a,c){const u=Z(a);if(u[c])return;let f=c,b=null;const k=[];for(;f!==""&&!u[f];)u[f]={callbacks:[],childEvents:[]},k.push(u[f]),b&&u[f].childEvents.push(b),b=f,f=f.substr(0,f.lastIndexOf(":"));if(f!==""){for(const T of k)T.callbacks=u[f].callbacks.slice();u[f].childEvents.push(b)}})(this,i);const n=z(this,i),r=F.get(t.priority),o={callback:e,priority:r};for(const a of n){let c=!1;for(let u=0;u<a.length;u++)if(a[u].priority<r){a.splice(u,0,o),c=!0;break}c||a.push(o)}},_removeEventListener(i,e){const t=z(this,i);for(const n of t)for(let r=0;r<n.length;r++)n[r].callback==e&&(n.splice(r,1),r--)}};function V(i,e){i[$]||(i[$]=e||P())}function ee(i){return i[$]}function Z(i){return i._events||Object.defineProperty(i,"_events",{value:{}}),i._events}function z(i,e){const t=Z(i)[e];if(!t)return[];let n=[t.callbacks];for(let r=0;r<t.childEvents.length;r++){const o=z(i,t.childEvents[r]);n=n.concat(o)}return n}function re(i,e,t){for(let[n,r]of i){r?typeof r=="function"&&(r=r(e.name)):r=e.name;const o=new v(e.source,r);o.path=[...e.path],n.fire(o,...t)}}function X(i,e,t,n){e._removeEventListener?e._removeEventListener(t,n):i._removeEventListener.call(e,t,n)}var ne=function(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")},ie=_(3),ae=ie.a.Symbol,_e=Object.prototype,Se=_e.hasOwnProperty,Pe=_e.toString,Me=ae?ae.toStringTag:void 0,Re=function(i){var e=Se.call(i,Me),t=i[Me];try{i[Me]=void 0;var n=!0}catch{}var r=Pe.call(i);return n&&(e?i[Me]=t:delete i[Me]),r},ce=Object.prototype.toString,pe=function(i){return ce.call(i)},be=ae?ae.toStringTag:void 0,ke=function(i){return i==null?i===void 0?"[object Undefined]":"[object Null]":be&&be in Object(i)?Re(i):pe(i)},ye,Ce=function(i){if(!ne(i))return!1;var e=ke(i);return e=="[object Function]"||e=="[object GeneratorFunction]"||e=="[object AsyncFunction]"||e=="[object Proxy]"},ze=ie.a["__core-js_shared__"],He=(ye=/[^.]+$/.exec(ze&&ze.keys&&ze.keys.IE_PROTO||""))?"Symbol(src)_1."+ye:"",Ge=function(i){return!!He&&He in i},qe=Function.prototype.toString,gt=function(i){if(i!=null){try{return qe.call(i)}catch{}try{return i+""}catch{}}return""},je=/^\[object .+?Constructor\]$/,ut=Function.prototype,De=Object.prototype,Oe=ut.toString,tt=De.hasOwnProperty,ht=RegExp("^"+Oe.call(tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),kt=function(i){return!(!ne(i)||Ge(i))&&(Ce(i)?ht:je).test(gt(i))},Kt=function(i,e){return i==null?void 0:i[e]},Ee=function(i,e){var t=Kt(i,e);return kt(t)?t:void 0},yt=function(){try{var i=Ee(Object,"defineProperty");return i({},"",{}),i}catch{}}(),on=function(i,e,t){e=="__proto__"&&yt?yt(i,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):i[e]=t},we=function(i,e){return i===e||i!=i&&e!=e},Ne=Object.prototype.hasOwnProperty,mt=function(i,e,t){var n=i[e];Ne.call(i,e)&&we(n,t)&&(t!==void 0||e in i)||on(i,e,t)},Fe=function(i,e,t,n){var r=!t;t||(t={});for(var o=-1,a=e.length;++o<a;){var c=e[o],u=n?n(t[c],i[c],c,t,i):void 0;u===void 0&&(u=i[c]),r?on(t,c,u):mt(t,c,u)}return t},Ye=function(i){return i},Vt=function(i,e,t){switch(t.length){case 0:return i.call(e);case 1:return i.call(e,t[0]);case 2:return i.call(e,t[0],t[1]);case 3:return i.call(e,t[0],t[1],t[2])}return i.apply(e,t)},gn=Math.max,Zt=function(i,e,t){return e=gn(e===void 0?i.length-1:e,0),function(){for(var n=arguments,r=-1,o=gn(n.length-e,0),a=Array(o);++r<o;)a[r]=n[e+r];r=-1;for(var c=Array(e+1);++r<e;)c[r]=n[r];return c[e]=t(a),Vt(i,this,c)}},Vr=function(i){return function(){return i}},po=yt?function(i,e){return yt(i,"toString",{configurable:!0,enumerable:!1,value:Vr(e),writable:!0})}:Ye,fa=Date.now,$n=function(i){var e=0,t=0;return function(){var n=fa(),r=16-(n-t);if(t=n,r>0){if(++e>=800)return arguments[0]}else e=0;return i.apply(void 0,arguments)}}(po),ws=function(i,e){return $n(Zt(i,e,Ye),i+"")},pi=function(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=9007199254740991},xr=function(i){return i!=null&&pi(i.length)&&!Ce(i)},go=/^(?:0|[1-9]\d*)$/,Qr=function(i,e){var t=typeof i;return!!(e=e??9007199254740991)&&(t=="number"||t!="symbol"&&go.test(i))&&i>-1&&i%1==0&&i<e},mo=function(i,e,t){if(!ne(t))return!1;var n=typeof e;return!!(n=="number"?xr(t)&&Qr(e,t.length):n=="string"&&e in t)&&we(t[e],i)},bo=function(i){return ws(function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(o=i.length>3&&typeof o=="function"?(r--,o):void 0,a&&mo(t[0],t[1],a)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var c=t[n];c&&i(e,c,n,o)}return e})},vo=function(i,e){for(var t=-1,n=Array(i);++t<i;)n[t]=e(t);return n},en=function(i){return i!=null&&typeof i=="object"},Xt=function(i){return en(i)&&ke(i)=="[object Arguments]"},un=Object.prototype,ln=un.hasOwnProperty,Hn=un.propertyIsEnumerable,mn=Xt(function(){return arguments}())?Xt:function(i){return en(i)&&ln.call(i,"callee")&&!Hn.call(i,"callee")},vt=Array.isArray,Zn=_(4),Tt={};Tt["[object Float32Array]"]=Tt["[object Float64Array]"]=Tt["[object Int8Array]"]=Tt["[object Int16Array]"]=Tt["[object Int32Array]"]=Tt["[object Uint8Array]"]=Tt["[object Uint8ClampedArray]"]=Tt["[object Uint16Array]"]=Tt["[object Uint32Array]"]=!0,Tt["[object Arguments]"]=Tt["[object Array]"]=Tt["[object ArrayBuffer]"]=Tt["[object Boolean]"]=Tt["[object DataView]"]=Tt["[object Date]"]=Tt["[object Error]"]=Tt["[object Function]"]=Tt["[object Map]"]=Tt["[object Number]"]=Tt["[object Object]"]=Tt["[object RegExp]"]=Tt["[object Set]"]=Tt["[object String]"]=Tt["[object WeakMap]"]=!1;var Cr=function(i){return en(i)&&pi(i.length)&&!!Tt[ke(i)]},lr=function(i){return function(e){return i(e)}},cr=_(5),El=cr.a&&cr.a.isTypedArray,ks=El?lr(El):Cr,kd=Object.prototype.hasOwnProperty,Pl=function(i,e){var t=vt(i),n=!t&&mn(i),r=!t&&!n&&Object(Zn.a)(i),o=!t&&!n&&!r&&ks(i),a=t||n||r||o,c=a?vo(i.length,String):[],u=c.length;for(var f in i)!e&&!kd.call(i,f)||a&&(f=="length"||r&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||Qr(f,u))||c.push(f);return c},yd=Object.prototype,Ho=function(i){var e=i&&i.constructor;return i===(typeof e=="function"&&e.prototype||yd)},xd=function(i){var e=[];if(i!=null)for(var t in Object(i))e.push(t);return e},pa=Object.prototype.hasOwnProperty,Cd=function(i){if(!ne(i))return xd(i);var e=Ho(i),t=[];for(var n in i)(n!="constructor"||!e&&pa.call(i,n))&&t.push(n);return t},Tr=function(i){return xr(i)?Pl(i,!0):Cd(i)},_o=bo(function(i,e){Fe(e,Tr(e),i)});const ys=Symbol("observableProperties"),xs=Symbol("boundObservables"),Ui=Symbol("boundProperties"),wo=Symbol("decoratedMethods"),Il=Symbol("decoratedOriginal"),Cs={set(i,e){if(ne(i))return void Object.keys(i).forEach(n=>{this.set(n,i[n])},this);Wi(this);const t=this[ys];if(i in this&&!t.has(i))throw new y.a("observable-set-cannot-override",this);Object.defineProperty(this,i,{enumerable:!0,configurable:!0,get:()=>t.get(i),set(n){const r=t.get(i);let o=this.fire("set:"+i,i,n,r);o===void 0&&(o=n),r===o&&t.has(i)||(t.set(i,o),this.fire("change:"+i,i,o,r))}}),this[i]=e},bind(...i){if(!i.length||!Ml(i))throw new y.a("observable-bind-wrong-properties",this);if(new Set(i).size!==i.length)throw new y.a("observable-bind-duplicate-properties",this);Wi(this);const e=this[Ui];i.forEach(n=>{if(e.has(n))throw new y.a("observable-bind-rebind",this)});const t=new Map;return i.forEach(n=>{const r={property:n,to:[]};e.set(n,r),t.set(n,r)}),{to:Td,toMany:Sd,_observable:this,_bindProperties:i,_to:[],_bindings:t}},unbind(...i){if(!this[ys])return;const e=this[Ui],t=this[xs];if(i.length){if(!Ml(i))throw new y.a("observable-unbind-wrong-properties",this);i.forEach(n=>{const r=e.get(n);if(!r)return;let o,a,c,u;r.to.forEach(f=>{o=f[0],a=f[1],c=t.get(o),u=c[a],u.delete(r),u.size||delete c[a],Object.keys(c).length||(t.delete(o),this.stopListening(o,"change"))}),e.delete(n)})}else t.forEach((n,r)=>{this.stopListening(r,"change")}),t.clear(),e.clear()},decorate(i){const e=this[i];if(!e)throw new y.a("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:i});this.on(i,(t,n)=>{t.return=e.apply(this,n)}),this[i]=function(...t){return this.fire(i,t)},this[i][Il]=e,this[wo]||(this[wo]=[]),this[wo].push(i)}};_o(Cs,B),Cs.stopListening=function(i,e,t){if(!i&&this[wo]){for(const n of this[wo])this[n]=this[n][Il];delete this[wo]}B.stopListening.call(this,i,e,t)};var Gt=Cs;function Wi(i){i[ys]||(Object.defineProperty(i,ys,{value:new Map}),Object.defineProperty(i,xs,{value:new Map}),Object.defineProperty(i,Ui,{value:new Map}))}function Td(...i){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}(...i),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 r;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),r=this._observable,this._to.forEach(o=>{const a=r[xs];let c;a.get(o.observable)||r.listenTo(o.observable,"change",(u,f)=>{c=a.get(o.observable)[f],c&&c.forEach(b=>{qi(r,b.property)})})}),function(o){let a;o._bindings.forEach((c,u)=>{o._to.forEach(f=>{a=f.properties[c.callback?0:o._bindProperties.indexOf(u)],c.to.push([f.observable,a]),function(b,k,T,S){const O=b[xs],D=O.get(T),L=D||{};L[S]||(L[S]=new Set),L[S].add(k),D||O.set(T,L)}(o._observable,c,f.observable,a)})})}(this),this._bindProperties.forEach(o=>{qi(this._observable,o)})}function Sd(i,e,t){if(this._bindings.size>1)throw new y.a("observable-bind-to-many-not-one-binding",this);this.to(...function(n,r){const o=n.map(a=>[a,r]);return Array.prototype.concat.apply([],o)}(i,e),t)}function Ml(i){return i.every(e=>typeof e=="string")}function qi(i,e){const t=i[Ui].get(e);let n;t.callback?n=t.callback.apply(i,t.to.map(r=>r[0][r[1]])):(n=t.to[0],n=n[0][n[1]]),Object.prototype.hasOwnProperty.call(i,e)?i[e]=n:i.set(e,n)}function Be(i,...e){e.forEach(t=>{Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)).forEach(n=>{if(n in i.prototype)return;const r=Object.getOwnPropertyDescriptor(t,n);r.enumerable=!1,Object.defineProperty(i.prototype,n,r)})})}class ve{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",ko,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",ko),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function ko(i){i.return=!1,i.stop()}Be(ve,Gt);class at{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,r)=>{r?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",Ol,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",Ol),this.refresh())}execute(){}destroy(){this.stopListening()}}function Ol(i){i.return=!1,i.stop()}Be(at,Gt);class ga extends at{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 yo=function(i,e){return function(t){return i(e(t))}},Ts=yo(Object.getPrototypeOf,Object),Nl=Function.prototype,Rl=Object.prototype,ma=Nl.toString,Ad=Rl.hasOwnProperty,Ed=ma.call(Object),er=function(i){if(!en(i)||ke(i)!="[object Object]")return!1;var e=Ts(i);if(e===null)return!0;var t=Ad.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&ma.call(t)==Ed},Ss=function(){this.__data__=[],this.size=0},Uo=function(i,e){for(var t=i.length;t--;)if(we(i[t][0],e))return t;return-1},As=Array.prototype.splice,Dl=function(i){var e=this.__data__,t=Uo(e,i);return!(t<0)&&(t==e.length-1?e.pop():As.call(e,t,1),--this.size,!0)},ba=function(i){var e=this.__data__,t=Uo(e,i);return t<0?void 0:e[t][1]},Wo=function(i){return Uo(this.__data__,i)>-1},jl=function(i,e){var t=this.__data__,n=Uo(t,i);return n<0?(++this.size,t.push([i,e])):t[n][1]=e,this};function xo(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}xo.prototype.clear=Ss,xo.prototype.delete=Dl,xo.prototype.get=ba,xo.prototype.has=Wo,xo.prototype.set=jl;var qo=xo,Ll=function(){this.__data__=new qo,this.size=0},Es=function(i){var e=this.__data__,t=e.delete(i);return this.size=e.size,t},Yt=function(i){return this.__data__.get(i)},zl=function(i){return this.__data__.has(i)},Jr=Ee(ie.a,"Map"),gi=Ee(Object,"create"),$r=function(){this.__data__=gi?gi(null):{},this.size=0},Ps=function(i){var e=this.has(i)&&delete this.__data__[i];return this.size-=e?1:0,e},Ki=Object.prototype.hasOwnProperty,Fl=function(i){var e=this.__data__;if(gi){var t=e[i];return t==="__lodash_hash_undefined__"?void 0:t}return Ki.call(e,i)?e[i]:void 0},Bl=Object.prototype.hasOwnProperty,Vl=function(i){var e=this.__data__;return gi?e[i]!==void 0:Bl.call(e,i)},va=function(i,e){var t=this.__data__;return this.size+=this.has(i)?0:1,t[i]=gi&&e===void 0?"__lodash_hash_undefined__":e,this};function Gi(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}Gi.prototype.clear=$r,Gi.prototype.delete=Ps,Gi.prototype.get=Fl,Gi.prototype.has=Vl,Gi.prototype.set=va;var Is=Gi,$l=function(){this.size=0,this.__data__={hash:new Is,map:new(Jr||qo),string:new Is}},Pd=function(i){var e=typeof i;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?i!=="__proto__":i===null},Ko=function(i,e){var t=i.__data__;return Pd(e)?t[typeof e=="string"?"string":"hash"]:t.map},Id=function(i){var e=Ko(this,i).delete(i);return this.size-=e?1:0,e},Hl=function(i){return Ko(this,i).get(i)},_a=function(i){return Ko(this,i).has(i)},Md=function(i,e){var t=Ko(this,i),n=t.size;return t.set(i,e),this.size+=t.size==n?0:1,this};function mi(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}mi.prototype.clear=$l,mi.prototype.delete=Id,mi.prototype.get=Hl,mi.prototype.has=_a,mi.prototype.set=Md;var Ms=mi,Od=function(i,e){var t=this.__data__;if(t instanceof qo){var n=t.__data__;if(!Jr||n.length<199)return n.push([i,e]),this.size=++t.size,this;t=this.__data__=new Ms(n)}return t.set(i,e),this.size=t.size,this};function bi(i){var e=this.__data__=new qo(i);this.size=e.size}bi.prototype.clear=Ll,bi.prototype.delete=Es,bi.prototype.get=Yt,bi.prototype.has=zl,bi.prototype.set=Od;var Go=bi,Ul=function(i,e){for(var t=-1,n=i==null?0:i.length;++t<n&&e(i[t],t,i)!==!1;);return i},$t=yo(Object.keys,Object),Lt=Object.prototype.hasOwnProperty,Wl=function(i){if(!Ho(i))return $t(i);var e=[];for(var t in Object(i))Lt.call(i,t)&&t!="constructor"&&e.push(t);return e},wa=function(i){return xr(i)?Pl(i):Wl(i)},Nd=function(i,e){return i&&Fe(e,wa(e),i)},Rd=function(i,e){return i&&Fe(e,Tr(e),i)},ka=_(9),ql=function(i,e){var t=-1,n=i.length;for(e||(e=Array(n));++t<n;)e[t]=i[t];return e},ya=function(i,e){for(var t=-1,n=i==null?0:i.length,r=0,o=[];++t<n;){var a=i[t];e(a,t,i)&&(o[r++]=a)}return o},Os=function(){return[]},yn=Object.prototype.propertyIsEnumerable,Yo=Object.getOwnPropertySymbols,Sr=Yo?function(i){return i==null?[]:(i=Object(i),ya(Yo(i),function(e){return yn.call(i,e)}))}:Os,xa=function(i,e){return Fe(i,Sr(i),e)},Ns=function(i,e){for(var t=-1,n=e.length,r=i.length;++t<n;)i[r+t]=e[t];return i},Un=Object.getOwnPropertySymbols?function(i){for(var e=[];i;)Ns(e,Sr(i)),i=Ts(i);return e}:Os,Kl=function(i,e){return Fe(i,Un(i),e)},Ca=function(i,e,t){var n=e(i);return vt(i)?n:Ns(n,t(i))},Co=function(i){return Ca(i,wa,Sr)},Rs=function(i){return Ca(i,Tr,Un)},To=Ee(ie.a,"DataView"),So=Ee(ie.a,"Promise"),Tn=Ee(ie.a,"Set"),Ds=Ee(ie.a,"WeakMap"),tr=gt(To),Gl=gt(Jr),Ta=gt(So),vi=gt(Tn),js=gt(Ds),Xr=ke;(To&&Xr(new To(new ArrayBuffer(1)))!="[object DataView]"||Jr&&Xr(new Jr)!="[object Map]"||So&&Xr(So.resolve())!="[object Promise]"||Tn&&Xr(new Tn)!="[object Set]"||Ds&&Xr(new Ds)!="[object WeakMap]")&&(Xr=function(i){var e=ke(i),t=e=="[object Object]"?i.constructor:void 0,n=t?gt(t):"";if(n)switch(n){case tr:return"[object DataView]";case Gl:return"[object Map]";case Ta:return"[object Promise]";case vi:return"[object Set]";case js:return"[object WeakMap]"}return e});var Ot=Xr,_i=Object.prototype.hasOwnProperty,Zr=function(i){var e=i.length,t=new i.constructor(e);return e&&typeof i[0]=="string"&&_i.call(i,"index")&&(t.index=i.index,t.input=i.input),t},Ao=ie.a.Uint8Array,Qo=function(i){var e=new i.constructor(i.byteLength);return new Ao(e).set(new Ao(i)),e},Dd=function(i,e){var t=e?Qo(i.buffer):i.buffer;return new i.constructor(t,i.byteOffset,i.byteLength)},Yl=/\w*$/,Sa=function(i){var e=new i.constructor(i.source,Yl.exec(i));return e.lastIndex=i.lastIndex,e},Aa=ae?ae.prototype:void 0,Jo=Aa?Aa.valueOf:void 0,Eo=function(i){return Jo?Object(Jo.call(i)):{}},Ea=function(i,e){var t=e?Qo(i.buffer):i.buffer;return new i.constructor(t,i.byteOffset,i.length)},Pa=function(i,e,t){var n=i.constructor;switch(e){case"[object ArrayBuffer]":return Qo(i);case"[object Boolean]":case"[object Date]":return new n(+i);case"[object DataView]":return Dd(i,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 Ea(i,t);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(i);case"[object RegExp]":return Sa(i);case"[object Set]":return new n;case"[object Symbol]":return Eo(i)}},Ia=Object.create,Ma=function(){function i(){}return function(e){if(!ne(e))return{};if(Ia)return Ia(e);i.prototype=e;var t=new i;return i.prototype=void 0,t}}(),Ls=function(i){return typeof i.constructor!="function"||Ho(i)?{}:Ma(Ts(i))},Ql=function(i){return en(i)&&Ot(i)=="[object Map]"},Jl=cr.a&&cr.a.isMap,Oa=Jl?lr(Jl):Ql,Na=function(i){return en(i)&&Ot(i)=="[object Set]"},Xl=cr.a&&cr.a.isSet,Zl=Xl?lr(Xl):Na,lt={};lt["[object Arguments]"]=lt["[object Array]"]=lt["[object ArrayBuffer]"]=lt["[object DataView]"]=lt["[object Boolean]"]=lt["[object Date]"]=lt["[object Float32Array]"]=lt["[object Float64Array]"]=lt["[object Int8Array]"]=lt["[object Int16Array]"]=lt["[object Int32Array]"]=lt["[object Map]"]=lt["[object Number]"]=lt["[object Object]"]=lt["[object RegExp]"]=lt["[object Set]"]=lt["[object String]"]=lt["[object Symbol]"]=lt["[object Uint8Array]"]=lt["[object Uint8ClampedArray]"]=lt["[object Uint16Array]"]=lt["[object Uint32Array]"]=!0,lt["[object Error]"]=lt["[object Function]"]=lt["[object WeakMap]"]=!1;var Xo=function i(e,t,n,r,o,a){var c,u=1&t,f=2&t,b=4&t;if(n&&(c=o?n(e,r,o,a):n(e)),c!==void 0)return c;if(!ne(e))return e;var k=vt(e);if(k){if(c=Zr(e),!u)return ql(e,c)}else{var T=Ot(e),S=T=="[object Function]"||T=="[object GeneratorFunction]";if(Object(Zn.a)(e))return Object(ka.a)(e,u);if(T=="[object Object]"||T=="[object Arguments]"||S&&!o){if(c=f||S?{}:Ls(e),!u)return f?Kl(e,Rd(c,e)):xa(e,Nd(c,e))}else{if(!lt[T])return o?e:{};c=Pa(e,T,u)}}a||(a=new Go);var O=a.get(e);if(O)return O;a.set(e,c),Zl(e)?e.forEach(function(L){c.add(i(L,t,n,L,e,a))}):Oa(e)&&e.forEach(function(L,W){c.set(W,i(L,t,n,W,e,a))});var D=k?void 0:(b?f?Rs:Co:f?Tr:wa)(e);return Ul(D||e,function(L,W){D&&(L=e[W=L]),mt(c,W,i(L,t,n,W,e,a))}),c},Po=function(i,e){return Xo(i,5,e=typeof e=="function"?e:void 0)},ei=function(i){return en(i)&&i.nodeType===1&&!er(i)};class Ra{constructor(e,t){this._config={},t&&this.define(ec(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,r=!1){if(er(t))return void this._setObjectToTarget(e,t,r);const o=t.split(".");t=o.pop();for(const a of o)er(e[a])||(e[a]={}),e=e[a];if(er(n))return er(e[t])||(e[t]={}),e=e[t],void this._setObjectToTarget(e,n,r);r&&e[t]!==void 0||(e[t]=n)}_getFromSource(e,t){const n=t.split(".");t=n.pop();for(const r of n){if(!er(e[r])){e=null;break}e=e[r]}return e?ec(e[t]):void 0}_setObjectToTarget(e,t,n){Object.keys(t).forEach(r=>{this._setToTarget(e,r,t[r],n)})}}function ec(i){return Po(i,jd)}function jd(i){return ei(i)?i:void 0}function dr(i){return!(!i||!i[Symbol.iterator])}class ur{constructor(e={},t={}){const n=dr(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 r of e)this._items.push(r),this._itemMap.set(this._getItemIdBeforeAdding(r),r)}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 r=e[n],o=this._getItemIdBeforeAdding(r),a=t+n;this._items.splice(a,0,r),this._itemMap.set(o,r),this.fire("add",r,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=(r,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 f=e(o);if(!f)return void this._skippedIndexesFromExternal.push(a);let b=a;for(const k of this._skippedIndexesFromExternal)a>k&&b--;for(const k of t._skippedIndexesFromExternal)b>=k&&b++;this._bindToExternalToInternalMap.set(o,f),this._bindToInternalToExternalMap.set(f,o),this.add(f,b);for(let k=0;k<t._skippedIndexesFromExternal.length;k++)b<=t._skippedIndexesFromExternal[k]&&t._skippedIndexesFromExternal[k]++}};for(const r of t)n(0,r,t.getIndex(r));this.listenTo(t,"add",n),this.listenTo(t,"remove",(r,o,a)=>{const c=this._bindToExternalToInternalMap.get(o);c&&this.remove(c),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((u,f)=>(a<f&&u.push(f-1),a>f&&u.push(f),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,r,o=!1;const a=this._idProperty;if(typeof e=="string"?(n=e,r=this._itemMap.get(n),o=!r,r&&(t=this._items.indexOf(r))):typeof e=="number"?(t=e,r=this._items[t],o=!r,r&&(n=r[a])):(r=e,n=r[a],t=this._items.indexOf(r),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(r);return this._bindToInternalToExternalMap.delete(r),this._bindToExternalToInternalMap.delete(c),this.fire("remove",r,t),[r,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}Be(ur,B);class Da{constructor(e,t=[],n=[]){this._context=e,this._plugins=new Map,this._availablePlugins=new Map;for(const r of t)r.pluginName&&this._availablePlugins.set(r.pluginName,r);this._contextPlugins=new Map;for(const[r,o]of n)this._contextPlugins.set(r,o),this._contextPlugins.set(o,r),r.pluginName&&this._availablePlugins.set(r.pluginName,r)}*[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 r=this,o=this._context;(function O(D,L=new Set){D.forEach(W=>{u(W)&&(L.has(W)||(L.add(W),W.pluginName&&!r._availablePlugins.has(W.pluginName)&&r._availablePlugins.set(W.pluginName,W),W.requires&&O(W.requires,L)))})})(e),T(e);const a=[...function O(D,L=new Set){return D.map(W=>u(W)?W:r._availablePlugins.get(W)).reduce((W,J)=>L.has(J)?W:(L.add(J),J.requires&&(T(J.requires,J),O(J.requires,L).forEach(de=>W.add(de))),W.add(J)),new Set)}(e.filter(O=>!b(O,t)))];(function(O,D){for(const L of D){if(typeof L!="function")throw new y.a("plugincollection-replace-plugin-invalid-type",null,{pluginItem:L});const W=L.pluginName;if(!W)throw new y.a("plugincollection-replace-plugin-missing-name",null,{pluginItem:L});if(L.requires&&L.requires.length)throw new y.a("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:W});const J=r._availablePlugins.get(W);if(!J)throw new y.a("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:W});const de=O.indexOf(J);if(de===-1){if(r._contextPlugins.has(J))return;throw new y.a("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:W})}if(J.requires&&J.requires.length)throw new y.a("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:W});O.splice(de,1,L),r._availablePlugins.set(W,L)}})(a,n);const c=function(O){return O.map(D=>{const L=r._contextPlugins.get(D)||new D(o);return r._add(D,L),L})}(a);return S(c,"init").then(()=>S(c,"afterInit")).then(()=>c);function u(O){return typeof O=="function"}function f(O){return u(O)&&O.isContextPlugin}function b(O,D){return D.some(L=>L===O||k(O)===L||k(L)===O)}function k(O){return u(O)?O.pluginName||O.name:O}function T(O,D=null){O.map(L=>u(L)?L:r._availablePlugins.get(L)||L).forEach(L=>{(function(W,J){if(!u(W))throw J?new y.a("plugincollection-soft-required",o,{missingPlugin:W,requiredBy:k(J)}):new y.a("plugincollection-plugin-not-found",o,{plugin:W})})(L,D),function(W,J){if(f(J)&&!f(W))throw new y.a("plugincollection-context-required",o,{plugin:k(W),requiredBy:k(J)})}(L,D),function(W,J){if(J&&b(W,t))throw new y.a("plugincollection-required",o,{plugin:k(W),requiredBy:k(J)})}(L,D)})}function S(O,D){return O.reduce((L,W)=>W[D]?r._contextPlugins.has(W)?L:L.then(W[D].bind(W)):L,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 Pt(i){return Array.isArray(i)?i:[i]}function Ld(i,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&&(i=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]);const r=e.id||e.string;if(n===0||!function(u,f){return!!window.CKEDITOR_TRANSLATIONS[u]&&!!window.CKEDITOR_TRANSLATIONS[u].dictionary[f]}(i,r))return t!==1?e.plural:e.string;const o=window.CKEDITOR_TRANSLATIONS[i].dictionary,a=window.CKEDITOR_TRANSLATIONS[i].getPluralForm||(u=>u===1?0:1);if(typeof o[r]=="string")return o[r];const c=Number(a(t));return o[r][c]}Be(Da,B),window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});const zd=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];function Zo(i){return zd.includes(i)?"rtl":"ltr"}class tc{constructor(e={}){this.uiLanguage=e.uiLanguage||"en",this.contentLanguage=e.contentLanguage||this.uiLanguage,this.uiLanguageDirection=Zo(this.uiLanguage),this.contentLanguageDirection=Zo(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=Pt(t),typeof e=="string"&&(e={string:e});const n=e.plural?t[0]:1;return function(r,o){return r.replace(/%(\d+)/g,(a,c)=>c<o.length?o[c]:a)}(Ld(this.uiLanguage,e,n),t)}}class wi{constructor(e){this.config=new Ra(e,this.constructor.defaultConfig);const t=this.constructor.builtinPlugins;this.config.define("plugins",t),this.plugins=new Da(this,t);const n=this.config.get("language")||{};this.locale=new tc({uiLanguage:typeof n=="string"?n:n.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.editors=new ur,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 ki{constructor(e){this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}function Sn(i,e){const t=Math.min(i.length,e.length);for(let n=0;n<t;n++)if(i[n]!=e[n])return n;return i.length==e.length?"same":i.length<e.length?"prefix":"extension"}Be(ki,Gt);var ja=function(i){return Xo(i,4)};class Yi{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),r=e.getAncestors(t);let o=0;for(;n[o]==r[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(),r=Sn(t,n);switch(r){case"prefix":return!0;case"extension":return!1;default:return t[r]<n[r]}}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=ja(this);return delete e.parent,e}is(e){return e==="node"||e==="view:node"}}Be(Yi,B);class xt extends Yi{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 xt&&(this===e||this.data===e.data)}_clone(){return new xt(this.document,this.data)}}class hn{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 Ar(i){return dr(i)?new Map(i):function(e){const t=new Map;for(const n in e)t.set(n,e[n]);return t}(i)}class Hr{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 r=nc(t,n);if(r)return{element:t,pattern:n,match:r}}return null}matchAll(...e){const t=[];for(const n of e)for(const r of this._patterns){const o=nc(n,r);o&&t.push({element:n,pattern:r,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 nc(i,e){if(typeof e=="function")return e(i);const t={};return e.name&&(t.name=function(n,r){return n instanceof RegExp?n.test(r):n===r}(e.name,i.name),!t.name)||e.attributes&&(t.attributes=function(n,r){const o=new Set(r.getAttributeKeys());return er(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")),La(n,o,a=>r.getAttribute(a))}(e.attributes,i),!t.attributes)?null:!(e.classes&&(t.classes=function(n,r){return La(n,r.getClassNames())}(e.classes,i),!t.classes))&&!(e.styles&&(t.styles=function(n,r){return La(n,r.getStyleNames(!0),o=>r.getStyle(o))}(e.styles,i),!t.styles))&&t}function La(i,e,t){const n=function(a){return Array.isArray(a)?a.map(c=>er(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]):er(a)?Object.entries(a):[[a,!0]]}(i),r=Array.from(e),o=[];return n.forEach(([a,c])=>{r.forEach(u=>{(function(f,b){return f===!0||f===b||f instanceof RegExp&&f.test(b)})(a,u)&&function(f,b,k){if(f===!0)return!0;const T=k(b);return f===T||f instanceof RegExp&&f.test(T)}(c,u,t)&&o.push(u)})}),!n.length||o.length<n.length?null:o}var zs=function(i){return typeof i=="symbol"||en(i)&&ke(i)=="[object Symbol]"},rc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qi=/^\w*$/,K=function(i,e){if(vt(i))return!1;var t=typeof i;return!(t!="number"&&t!="symbol"&&t!="boolean"&&i!=null&&!zs(i))||Qi.test(i)||!rc.test(i)||e!=null&&i in Object(e)};function se(i,e){if(typeof i!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var t=function(){var n=arguments,r=e?e.apply(this,n):n[0],o=t.cache;if(o.has(r))return o.get(r);var a=i.apply(this,n);return t.cache=o.set(r,a)||o,a};return t.cache=new(se.Cache||Ms),t}se.Cache=Ms;var Q=se,Ie=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xe=/\\(\\)?/g,St=function(i){var e=Q(i,function(n){return t.size===500&&t.clear(),n}),t=e.cache;return e}(function(i){var e=[];return i.charCodeAt(0)===46&&e.push(""),i.replace(Ie,function(t,n,r,o){e.push(r?o.replace(Xe,"$1"):n||t)}),e}),fn=function(i,e){for(var t=-1,n=i==null?0:i.length,r=Array(n);++t<n;)r[t]=e(i[t],t,i);return r},Nt=ae?ae.prototype:void 0,Fs=Nt?Nt.toString:void 0,Fd=function i(e){if(typeof e=="string")return e;if(vt(e))return fn(e,i)+"";if(zs(e))return Fs?Fs.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t},In=function(i){return i==null?"":Fd(i)},Io=function(i,e){return vt(i)?i:K(i,e)?[i]:St(In(i))},Bd=function(i){var e=i==null?0:i.length;return e?i[e-1]:void 0},yi=function(i){if(typeof i=="string"||zs(i))return i;var e=i+"";return e=="0"&&1/i==-1/0?"-0":e},es=function(i,e){for(var t=0,n=(e=Io(e,i)).length;i!=null&&t<n;)i=i[yi(e[t++])];return t&&t==n?i:void 0},Ji=function(i,e,t){var n=-1,r=i.length;e<0&&(e=-e>r?0:r+e),(t=t>r?r:t)<0&&(t+=r),r=e>t?0:t-e>>>0,e>>>=0;for(var o=Array(r);++n<r;)o[n]=i[n+e];return o},It=function(i,e){return e.length<2?i:es(i,Ji(e,0,-1))},ic=function(i,e){return e=Io(e,i),(i=It(i,e))==null||delete i[yi(Bd(e))]},za=function(i,e){return i==null||ic(i,e)},xi=function(i,e,t){var n=i==null?void 0:es(i,e);return n===void 0?t:n},bn=function(i,e,t){(t!==void 0&&!we(i[e],t)||t===void 0&&!(e in i))&&on(i,e,t)},ts=function(i){return function(e,t,n){for(var r=-1,o=Object(e),a=n(e),c=a.length;c--;){var u=a[i?c:++r];if(t(o[u],u,o)===!1)break}return e}}(),oc=function(i){return en(i)&&xr(i)},Mo=function(i,e){if((e!=="constructor"||typeof i[e]!="function")&&e!="__proto__")return i[e]},ti=function(i){return Fe(i,Tr(i))},ns=function(i,e,t,n,r,o,a){var c=Mo(i,t),u=Mo(e,t),f=a.get(u);if(f)bn(i,t,f);else{var b=o?o(c,u,t+"",i,e,a):void 0,k=b===void 0;if(k){var T=vt(u),S=!T&&Object(Zn.a)(u),O=!T&&!S&&ks(u);b=u,T||S||O?vt(c)?b=c:oc(c)?b=ql(c):S?(k=!1,b=Object(ka.a)(u,!0)):O?(k=!1,b=Ea(u,!0)):b=[]:er(u)||mn(u)?(b=c,mn(c)?b=ti(c):ne(c)&&!Ce(c)||(b=Ls(u))):k=!1}k&&(a.set(u,b),r(b,u,n,o,a),a.delete(u)),bn(i,t,b)}},Bs=function i(e,t,n,r,o){e!==t&&ts(t,function(a,c){if(o||(o=new Go),ne(a))ns(e,t,c,n,i,r,o);else{var u=r?r(Mo(e,c),a,c+"",e,t,o):void 0;u===void 0&&(u=a),bn(e,c,u)}},Tr)},Xi=bo(function(i,e,t){Bs(i,e,t)}),Ci=function(i,e,t,n){if(!ne(i))return i;for(var r=-1,o=(e=Io(e,i)).length,a=o-1,c=i;c!=null&&++r<o;){var u=yi(e[r]),f=t;if(u==="__proto__"||u==="constructor"||u==="prototype")return i;if(r!=a){var b=c[u];(f=n?n(b,u,c):void 0)===void 0&&(f=ne(b)?b:Qr(e[r+1])?[]:{})}mt(c,u,f),c=c[u]}return i},sc=function(i,e,t){return i==null?i:Ci(i,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 r=null,o=0,a=0,c=null;const u=new Map;if(n==="")return u;n.charAt(n.length-1)!=";"&&(n+=";");for(let f=0;f<n.length;f++){const b=n.charAt(f);if(r===null)switch(b){case":":c||(c=n.substr(o,f-o),a=f+1);break;case'"':case"'":r=b;break;case";":{const k=n.substr(a,f-a);c&&u.set(c.trim(),k.trim()),c=null,o=f+1;break}}else b===r&&(r=null)}return u}(e).entries());for(const[n,r]of t)this._styleProcessor.toNormalizedForm(n,r,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(ne(e))for(const[n,r]of Object.entries(e))this._styleProcessor.toNormalizedForm(n,r,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){const t=H(e);za(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]&&!ne(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("."),r=xi(this._styles,n);r&&!Array.from(Object.keys(r)).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(ne(t))te(n,H(e),t);else if(this._normalizers.has(e)){const r=this._normalizers.get(e),{path:o,value:a}=r(t);te(n,o,a)}else te(n,e,t)}getNormalized(e,t){if(!e)return Xi({},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 xi(t,n);const r=n(e,t);if(r)return r}return xi(t,H(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(r=>{const o=this.getNormalized(r,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 H(i){return i.replace("-",".")}function te(i,e,t){let n=t;ne(t)&&(n=Xi({},xi(i,e),t)),sc(i,e,n)}class Te extends Yi{constructor(e,t,n,r){if(super(e),this.name=t,this._attrs=function(o){o=Ar(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=[],r&&this._insertChild(0,r),this._classes=new Set,this._attrs.has("class")){const o=this._attrs.get("class");Qe(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 Te))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 Hr(...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(r=>`${r[0]}="${r[1]}"`).sort().join(" ");return this.name+(e==""?"":` class="${e}"`)+(t?` style="${t}"`:"")+(n==""?"":" "+n)}_clone(e=!1){const t=[];if(e)for(const r of this.getChildren())t.push(r._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 r=function(o,a){return typeof a=="string"?[new xt(o,a)]:(dr(a)||(a=[a]),Array.from(a).map(c=>typeof c=="string"?new xt(o,c):c instanceof hn?new xt(o,c.data):c))}(this.document,t);for(const o of r)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"?Qe(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 Pt(e))this._classes.add(t)}_removeClass(e){this._fireChange("attributes",this);for(const t of Pt(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 Pt(e))this._styles.remove(t)}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function Qe(i,e){const t=e.split(/\s+/);i.clear(),t.forEach(n=>i.add(n))}class Je extends Te{constructor(e,t,n,r){super(e,t,n,r),this.getFillerOffset=nt}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 nt(){const i=[...this.getChildren()],e=i[this.childCount-1];if(e&&e.is("element","br"))return this.childCount;for(const t of i)if(!t.is("uiElement"))return null;return this.childCount}class zt extends Je{constructor(e,t,n,r){super(e,t,n,r),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()}}Be(zt,Gt);const Ht=Symbol("rootName");class Oo extends zt{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(Ht)}set rootName(e){this._setCustomProperty(Ht,e)}set _name(e){this.name=e}}class nr{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=me._createAt(e.startPosition):this.position=me._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,r;do r=this.position,{done:t,value:n}=this.next();while(!t&&e(n));t||(this.position=r)}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 r;if(n instanceof xt){if(e.isAtEnd)return this.position=me._createAfter(n),this._next();r=n.data[e.offset]}else r=n.getChild(e.offset);if(r instanceof Te)return this.shallow?e.offset++:e=new me(r,0),this.position=e,this._formatReturnValue("elementStart",r,t,e,1);if(r instanceof xt){if(this.singleCharacters)return e=new me(r,0),this.position=e,this._next();{let o,a=r.data.length;return r==this._boundaryEndParent?(a=this.boundaries.end.offset,o=new hn(r,0,a),e=me._createAfter(o)):(o=new hn(r,0,r.data.length),e.offset++),this.position=e,this._formatReturnValue("text",o,t,e,a)}}if(typeof r=="string"){let o;this.singleCharacters?o=1:o=(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-e.offset;const a=new hn(n,e.offset,o);return e.offset+=o,this.position=e,this._formatReturnValue("text",a,t,e,o)}return e=me._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 r;if(n instanceof xt){if(e.isAtStart)return this.position=me._createBefore(n),this._previous();r=n.data[e.offset-1]}else r=n.getChild(e.offset-1);if(r instanceof Te)return this.shallow?(e.offset--,this.position=e,this._formatReturnValue("elementStart",r,t,e,1)):(e=new me(r,r.childCount),this.position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",r,t,e));if(r instanceof xt){if(this.singleCharacters)return e=new me(r,r.data.length),this.position=e,this._previous();{let o,a=r.data.length;if(r==this._boundaryStartParent){const c=this.boundaries.start.offset;o=new hn(r,c,r.data.length-c),a=o.data.length,e=me._createBefore(o)}else o=new hn(r,0,r.data.length),e.offset--;return this.position=e,this._formatReturnValue("text",o,t,e,a)}}if(typeof r=="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 hn(n,e.offset,o);return this.position=e,this._formatReturnValue("text",a,t,e,o)}return e=me._createBefore(n),this.position=e,this._formatReturnValue("elementStart",n,t,e,1)}_formatReturnValue(e,t,n,r,o){return t instanceof hn&&(t.offsetInText+t.data.length==t.textNode.data.length&&(this.direction!="forward"||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=me._createAfter(t.textNode):(r=me._createAfter(t.textNode),this.position=r)),t.offsetInText===0&&(this.direction!="backward"||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=me._createBefore(t.textNode):(r=me._createBefore(t.textNode),this.position=r))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:r,length:o}}}}class me{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 zt);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=me._createAt(this),n=t.offset+e;return t.offset=n<0?0:n,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new nr(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 r=0;for(;t[r]==n[r]&&t[r];)r++;return r===0?null:t[r-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 r=Sn(t,n);switch(r){case"prefix":return"before";case"extension":return"after";default:return t[r]<n[r]?"before":"after"}}getWalker(e={}){return e.startPosition=this,new nr(e)}clone(){return new me(this.parent,this.offset)}static _createAt(e,t){if(e instanceof me)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 me(n,t)}}static _createAfter(e){if(e.is("$textProxy"))return new me(e.textNode,e.offsetInText+e.data.length);if(!e.parent)throw new y.a("view-position-after-root",e,{root:e});return new me(e.parent,e.index+1)}static _createBefore(e){if(e.is("$textProxy"))return new me(e.textNode,e.offsetInText);if(!e.parent)throw new y.a("view-position-before-root",e,{root:e});return new me(e.parent,e.index)}}class $e{constructor(e,t=null){this.start=e.clone(),this.end=t?t.clone():e.clone()}*[Symbol.iterator](){yield*new nr({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(Ti,{direction:"backward"}),t=this.end.getLastMatchingPosition(Ti);return e.parent.is("$text")&&e.isAtStart&&(e=me._createBefore(e.parent)),t.parent.is("$text")&&t.isAtEnd&&(t=me._createAfter(t.parent)),new $e(e,t)}getTrimmed(){let e=this.start.getLastMatchingPosition(Ti);if(e.isAfter(this.end)||e.isEqual(this.end))return new $e(e,e);let t=this.end.getLastMatchingPosition(Ti,{direction:"backward"});const n=e.nodeAfter,r=t.nodeBefore;return n&&n.is("$text")&&(e=new me(n,0)),r&&r.is("$text")&&(t=new me(r,r.data.length)),new $e(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),r=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&r}getDifference(e){const t=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&t.push(new $e(this.start,e.start)),this.containsPosition(e.end)&&t.push(new $e(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 $e(t,n)}return null}getWalker(e={}){return e.boundaries=this,new nr(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 $e(this.start,this.end)}*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}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,r){return new this(new me(e,t),new me(n,r))}static _createFromPositionAndShift(e,t){const n=e,r=e.getShiftedBy(t);return t>0?new this(n,r):new this(r,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(me._createBefore(e),t)}}function Ti(i){return!(!i.item.is("attributeElement")&&!i.item.is("uiElement"))}function Ft(i){let e=0;for(const t of i)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 r of e._ranges)if(t.isEqual(r)){n=!0;break}if(!n)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=Ft(this.getRanges());if(t!=Ft(e.getRanges()))return!1;if(t==0)return!0;for(let n of this.getRanges()){n=n.getTrimmed();let r=!1;for(let o of e.getRanges())if(o=o.getTrimmed(),n.start.isEqual(o.start)&&n.end.isEqual(o.end)){r=!0;break}if(!r)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 hr)this._setRanges(e.getRanges(),e.isBackward),this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel});else if(e instanceof $e)this._setRanges([e],t&&t.backward),this._setFakeOptions(t);else if(e instanceof me)this._setRanges([new $e(e)]),this._setFakeOptions(t);else if(e instanceof Yi){const r=!!n&&!!n.backward;let o;if(t===void 0)throw new y.a("view-selection-setto-required-second-parameter",this);o=t=="in"?$e._createIn(e):t=="on"?$e._createOn(e):new $e(me._createAt(e,t)),this._setRanges([o],r),this._setFakeOptions(n)}else{if(!dr(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=me._createAt(e,t);if(n.compareWith(this.focus)=="same")return;const r=this.anchor;this._ranges.pop(),n.compareWith(r)=="before"?this._addRange(new $e(n,r),!0):this._addRange(new $e(r,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 $e))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 $e(e.start,e.end))}}Be(ft,B);class hr{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)}}Be(hr,B);class An extends v{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 fr=Symbol("bubbling contexts");var Zi={fire(i,...e){try{const t=i instanceof v?i:new v(this,i),n=No(this);if(!n.size)return;if(rs(t,"capturing",this),Si(n,"$capture",t,...e))return t.return;const r=t.startRange||this.selection.getFirstRange(),o=r?r.getContainedElement():null,a=!!o&&!!ac(n,o);let c=o||function(u){if(!u)return null;const f=u.start.parent,b=u.end.parent,k=f.getPath(),T=b.getPath();return k.length>T.length?f:b}(r);if(rs(t,"atTarget",c),!a){if(Si(n,"$text",t,...e))return t.return;rs(t,"bubbling",c)}for(;c;){if(c.is("rootElement")){if(Si(n,"$root",t,...e))return t.return}else if(c.is("element")&&Si(n,c.name,t,...e))return t.return;if(Si(n,c,t,...e))return t.return;c=c.parent,rs(t,"bubbling",c)}return rs(t,"bubbling",this),Si(n,"$document",t,...e),t.return}catch(t){y.a.rethrowUnexpectedError(t,this)}},_addEventListener(i,e,t){const n=Pt(t.context||"$document"),r=No(this);for(const o of n){let a=r.get(o);a||(a=Object.create(B),r.set(o,a)),this.listenTo(a,i,e,t)}},_removeEventListener(i,e){const t=No(this);for(const n of t.values())this.stopListening(n,i,e)}};function rs(i,e,t){i instanceof An&&(i._eventPhase=e,i._currentTarget=t)}function Si(i,e,t,...n){const r=typeof e=="string"?i.get(e):ac(i,e);return!!r&&(r.fire(t,...n),t.stop.called)}function ac(i,e){for(const[t,n]of i)if(typeof t=="function"&&t(e))return n;return null}function No(i){return i[fr]||(i[fr]=new Map),i[fr]}class eo{constructor(e){this.selection=new hr,this.roots=new ur({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)}}Be(eo,Zi),Be(eo,Gt);class Ai extends Te{constructor(e,t,n,r){super(e,t,n,r),this.getFillerOffset=lc,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 lc(){if(Ro(this))return null;let i=this.parent;for(;i&&i.is("attributeElement");){if(Ro(i)>1)return null;i=i.parent}return!i||Ro(i)>1?null:this.childCount}function Ro(i){return Array.from(i.getChildren()).filter(e=>!e.is("uiElement")).length}Ai.DEFAULT_PRIORITY=10;class Oh extends Te{constructor(e,t,n,r){super(e,t,n,r),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=tm}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 Yi||Array.from(t).length>0))throw new y.a("view-emptyelement-cannot-add",[this,t])}}function tm(){return null}const Fa=navigator.userAgent.toLowerCase();var xn={isMac:function(i){return i.indexOf("macintosh")>-1}(Fa),isGecko:function(i){return!!i.match(/gecko\/\d+/)}(Fa),isSafari:function(i){return i.indexOf(" applewebkit/")>-1&&i.indexOf("chrome")===-1}(Fa),isAndroid:function(i){return i.indexOf("android")>-1}(Fa),isBlink:function(i){return i.indexOf("chrome/")>-1&&i.indexOf("edge/")<0}(Fa),features:{isRegExpUnicodePropertySupported:function(){let i=!1;try{i="ć".search(new RegExp("[\\p{L}]","u"))===0}catch{}return i}()}};const nm={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},cc={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},it=function(){const i={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);i[t.toLowerCase()]=e}for(let e=48;e<=57;e++)i[e-48]=e;for(let e=112;e<=123;e++)i["f"+(e-111)]=e;return i}(),Nh=Object.fromEntries(Object.entries(it).map(([i,e])=>[e,i.charAt(0).toUpperCase()+i.slice(1)]));function N(i){let e;if(typeof i=="string"){if(e=it[i.toLowerCase()],!e)throw new y.a("keyboard-unknown-key",null,{key:i})}else e=i.keyCode+(i.altKey?it.alt:0)+(i.ctrlKey?it.ctrl:0)+(i.shiftKey?it.shift:0)+(i.metaKey?it.cmd:0);return e}function Do(i){return typeof i=="string"&&(i=function(e){return e.split("+").map(t=>t.trim())}(i)),i.map(e=>typeof e=="string"?function(t){if(t.endsWith("!"))return N(t.slice(0,-1));const n=N(t);return xn.isMac&&n==it.ctrl?it.cmd:n}(e):e).reduce((e,t)=>t+e,0)}function Ba(i){let e=Do(i);return Object.entries(xn.isMac?nm:cc).reduce((t,[n,r])=>(e&it[n]&&(e&=~it[n],t+=r),t),"")+(e?Nh[e]:"")}function Er(i,e){const t=e==="ltr";switch(i){case it.arrowleft:return t?"left":"right";case it.arrowright:return t?"right":"left";case it.arrowup:return"up";case it.arrowdown:return"down"}}function bt(i,e){const t=Er(i,e);return t==="down"||t==="right"}class Vd extends Te{constructor(e,t,n,r){super(e,t,n,r),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=im}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 Yi||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 rm(i){i.document.on("arrowKey",(e,t)=>function(n,r,o){if(r.keyCode==it.arrowright){const a=r.domTarget.ownerDocument.defaultView.getSelection(),c=a.rangeCount==1&&a.getRangeAt(0).collapsed;if(c||r.shiftKey){const u=a.focusNode,f=a.focusOffset,b=o.domPositionToView(u,f);if(b===null)return;let k=!1;const T=b.getLastMatchingPosition(S=>(S.item.is("uiElement")&&(k=!0),!(!S.item.is("uiElement")&&!S.item.is("attributeElement"))));if(k){const S=o.viewPositionToDom(T);c?a.collapse(S.parent,S.offset):a.extend(S.parent,S.offset)}}}}(0,t,i.domConverter),{priority:"low"})}function im(){return null}class jo extends Te{constructor(e,t,n,r){super(e,t,n,r),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=om}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 Yi||Array.from(t).length>0))throw new y.a("view-rawelement-cannot-add",[this,t])}}function om(){return null}class is{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 r=function(o,a){return typeof a=="string"?[new xt(o,a)]:(dr(a)||(a=[a]),Array.from(a).map(c=>typeof c=="string"?new xt(o,c):c instanceof hn?new xt(o,c.data):c))}(this.document,t);for(const o of r)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)}}Be(is,B);class Rh{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 is(this.document,e)}createText(e){return new xt(this.document,e)}createAttributeElement(e,t,n={}){const r=new Ai(this.document,e,t);return typeof n.priority=="number"&&(r._priority=n.priority),n.id&&(r._id=n.id),r}createContainerElement(e,t,n={}){const r=new Je(this.document,e,t);return n.isAllowedInsideAttributeElement!==void 0&&(r._isAllowedInsideAttributeElement=n.isAllowedInsideAttributeElement),r}createEditableElement(e,t){const n=new zt(this.document,e,t);return n._document=this.document,n}createEmptyElement(e,t,n={}){const r=new Oh(this.document,e,t);return n.isAllowedInsideAttributeElement!==void 0&&(r._isAllowedInsideAttributeElement=n.isAllowedInsideAttributeElement),r}createUIElement(e,t,n,r={}){const o=new Vd(this.document,e,t);return n&&(o.render=n),r.isAllowedInsideAttributeElement!==void 0&&(o._isAllowedInsideAttributeElement=r.isAllowedInsideAttributeElement),o}createRawElement(e,t,n,r={}){const o=new jo(this.document,e,t);return o.render=n||(()=>{}),r.isAllowedInsideAttributeElement!==void 0&&(o._isAllowedInsideAttributeElement=r.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){er(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 me?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 me._createBefore(t);if(!e.isAtEnd){const n=t._clone(!1);this.insert(me._createAfter(t),n);const r=new $e(e,me._createAt(t,"end")),o=new me(n,0);this.move(r,o)}return me._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 me(a,c))}const r=n.getChild(t-1),o=n.getChild(t);if(!r||!o)return e;if(r.is("$text")&&o.is("$text"))return Dh(r,o);if(r.is("attributeElement")&&o.is("attributeElement")&&r.isSimilar(o)){const a=r.childCount;return r._appendChild(o.getChildren()),o._remove(),this._removeFromClonedElementsGroup(o),this.mergeAttributes(new me(r,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 r=t.getChild(t.childCount-1),o=r instanceof xt?me._createAt(r,"end"):me._createAt(t,"end");return this.move($e._createIn(n),me._createAt(t,"end")),this.remove($e._createOn(n)),o}insert(e,t){(function a(c,u){for(const f of c){if(!am.some(b=>f instanceof b))throw new y.a("view-writer-insert-invalid-node-type",u);f.is("$text")||a(f.getChildren(),u)}})(t=dr(t)?[...t]:[t],this.document);const n=t.reduce((a,c)=>{const u=a[a.length-1],f=!(c.is("uiElement")&&c.isAllowedInsideAttributeElement);return u&&u.breakAttributes==f?u.nodes.push(c):a.push({breakAttributes:f,nodes:[c]}),a},[]);let r=null,o=e;for(const{nodes:a,breakAttributes:c}of n){const u=this._insertNodes(o,a,c);r||(r=u.start),o=u.end}return r?new $e(r,o):new $e(e)}remove(e){const t=e instanceof $e?e:$e._createOn(e);if(Va(t,this.document),t.isCollapsed)return new is(this.document);const{start:n,end:r}=this._breakAttributesRange(t,!0),o=n.parent,a=r.offset-n.offset,c=o._removeChildren(n.offset,a);for(const f of c)this._removeFromClonedElementsGroup(f);const u=this.mergeAttributes(n);return t.start=u,t.end=u.clone(),new is(this.document,c)}clear(e,t){Va(e,this.document);const n=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const r of n){const o=r.item;let a;if(o.is("element")&&t.isSimilar(o))a=$e._createOn(o);else if(!r.nextPosition.isAfter(e.start)&&o.is("$textProxy")){const c=o.getAncestors().find(u=>u.is("element")&&t.isSimilar(u));c&&(a=$e._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 r=(t=this._breakAttributes(t,!0)).parent,o=r.childCount;e=this._breakAttributesRange(e,!0),n=this.remove(e),t.offset+=r.childCount-o}else n=this.remove(e);return this.insert(t,n)}wrap(e,t){if(!(t instanceof Ai))throw new y.a("view-writer-wrap-invalid-attribute",this.document);if(Va(e,this.document),e.isCollapsed){let r=e.start;r.parent.is("element")&&(n=r.parent,!Array.from(n.getChildren()).some(a=>!a.is("uiElement")))&&(r=r.getLastMatchingPosition(a=>a.item.is("uiElement"))),r=this._wrapPosition(r,t);const o=this.document.selection;return o.isCollapsed&&o.getFirstPosition().isEqual(e.start)&&this.setSelection(r),new $e(r)}return this._wrapRange(e,t);var n}unwrap(e,t){if(!(t instanceof Ai))throw new y.a("view-writer-unwrap-invalid-attribute",this.document);if(Va(e,this.document),e.isCollapsed)return e;const{start:n,end:r}=this._breakAttributesRange(e,!0),o=n.parent,a=this._unwrapChildren(o,n.offset,r.offset,t),c=this.mergeAttributes(a.start);c.isEqual(a.start)||a.end.offset--;const u=this.mergeAttributes(a.end);return new $e(c,u)}rename(e,t){const n=new Je(this.document,e,t.getAttributes());return this.insert(me._createAfter(t),n),this.move($e._createIn(t),me._createAt(n,0)),this.remove($e._createOn(t)),n}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return me._createAt(e,t)}createPositionAfter(e){return me._createAfter(e)}createPositionBefore(e){return me._createBefore(e)}createRange(e,t){return new $e(e,t)}createRangeOn(e){return $e._createOn(e)}createRangeIn(e){return $e._createIn(e)}createSelection(e,t,n){return new ft(e,t,n)}_insertNodes(e,t,n){let r,o;if(r=n?$d(e):e.parent.is("$text")?e.parent.parent:e.parent,!r)throw new y.a("view-writer-invalid-position-container",this.document);o=n?this._breakAttributes(e,!0):e.parent.is("$text")?Hd(e):e;const a=r._insertChild(o.offset,t);for(const b of t)this._addToClonedElementsGroup(b);const c=o.getShiftedBy(a),u=this.mergeAttributes(o);u.isEqual(o)||c.offset--;const f=this.mergeAttributes(c);return new $e(u,f)}_wrapChildren(e,t,n,r){let o=t;const a=[];for(;o<n;){const u=e.getChild(o),f=u.is("$text"),b=u.is("attributeElement"),k=u.isAllowedInsideAttributeElement;if(b&&this._wrapAttributeElement(r,u))a.push(new me(e,o));else if(f||k||b&&sm(r,u)){const T=r._clone();u._remove(),T._appendChild(u),e._insertChild(o,T),this._addToClonedElementsGroup(T),a.push(new me(e,o))}else b&&this._wrapChildren(u,0,u.childCount,r);o++}let c=0;for(const u of a)u.offset-=c,u.offset!=t&&(this.mergeAttributes(u).isEqual(u)||(c++,n--));return $e._createFromParentsAndOffsets(e,t,e,n)}_unwrapChildren(e,t,n,r){let o=t;const a=[];for(;o<n;){const u=e.getChild(o);if(u.is("attributeElement"))if(u.isSimilar(r)){const f=u.getChildren(),b=u.childCount;u._remove(),e._insertChild(o,f),this._removeFromClonedElementsGroup(u),a.push(new me(e,o),new me(e,o+b)),o+=b,n+=b-1}else this._unwrapAttributeElement(r,u)?(a.push(new me(e,o),new me(e,o+1)),o++):(this._unwrapChildren(u,0,u.childCount,r),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 $e._createFromParentsAndOffsets(e,t,e,n)}_wrapRange(e,t){const{start:n,end:r}=this._breakAttributesRange(e,!0),o=n.parent,a=this._wrapChildren(o,n.offset,r.offset,t),c=this.mergeAttributes(a.start);c.isEqual(a.start)||a.end.offset--;const u=this.mergeAttributes(a.end);return new $e(c,u)}_wrapPosition(e,t){if(t.isSimilar(e.parent))return Ei(e.clone());e.parent.is("$text")&&(e=Hd(e));const n=this.createAttributeElement();n._priority=Number.POSITIVE_INFINITY,n.isSimilar=()=>!1,e.parent._insertChild(e.offset,n);const r=new $e(e,e.getShiftedBy(1));this.wrap(r,t);const o=new me(n.parent,n.index);n._remove();const a=o.nodeBefore,c=o.nodeAfter;return a instanceof xt&&c instanceof xt?Dh(a,c):Ei(o)}_wrapAttributeElement(e,t){if(!Pi(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(!Pi(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,r=e.end;if(Va(e,this.document),e.isCollapsed){const u=this._breakAttributes(e.start,t);return new $e(u,u)}const o=this._breakAttributes(r,t),a=o.parent.childCount,c=this._breakAttributes(n,t);return o.offset+=o.parent.childCount-a,new $e(c,o)}_breakAttributes(e,t=!1){const n=e.offset,r=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&&r.is("$text")&&Ud(r.parent)||Ud(r))return e.clone();if(r.is("$text"))return this._breakAttributes(Hd(e),t);if(n==r.childCount){const o=new me(r.parent,r.index+1);return this._breakAttributes(o,t)}if(n===0){const o=new me(r.parent,r.index);return this._breakAttributes(o,t)}{const o=r.index+1,a=r._clone();r.parent._insertChild(o,a),this._addToClonedElementsGroup(a);const c=r.childCount-n,u=r._removeChildren(n,c);a._appendChild(u);const f=new me(r.parent,o);return this._breakAttributes(f,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const r of e.getChildren())this._addToClonedElementsGroup(r);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 r of e.getChildren())this._removeFromClonedElementsGroup(r);const t=e.id;if(!t)return;const n=this._cloneGroups.get(t);n&&n.delete(e)}}function $d(i){let e=i.parent;for(;!Ud(e);){if(!e)return;e=e.parent}return e}function sm(i,e){return i.priority<e.priority||!(i.priority>e.priority)&&i.getIdentity()<e.getIdentity()}function Ei(i){const e=i.nodeBefore;if(e&&e.is("$text"))return new me(e,e.data.length);const t=i.nodeAfter;return t&&t.is("$text")?new me(t,0):i}function Hd(i){if(i.offset==i.parent.data.length)return new me(i.parent.parent,i.parent.index+1);if(i.offset===0)return new me(i.parent.parent,i.parent.index);const e=i.parent.data.slice(i.offset);return i.parent._data=i.parent.data.slice(0,i.offset),i.parent.parent._insertChild(i.parent.index+1,new xt(i.root.document,e)),new me(i.parent.parent,i.parent.index+1)}function Dh(i,e){const t=i.data.length;return i._data+=e.data,e._remove(),new me(i,t)}const am=[xt,Ai,Je,Oh,jo,Vd];function Ud(i){return i&&(i.is("containerElement")||i.is("documentFragment"))}function Va(i,e){const t=$d(i.start),n=$d(i.end);if(!t||!n||t!==n)throw new y.a("view-writer-invalid-range-container",e)}function Pi(i,e){return i.id===null&&e.id===null}function Mn(i){return Object.prototype.toString.call(i)=="[object Text]"}const jh=i=>i.createTextNode(" "),Lh=i=>{const e=i.createElement("span");return e.dataset.ckeFiller=!0,e.innerHTML=" ",e},zh=i=>{const e=i.createElement("br");return e.dataset.ckeFiller=!0,e},dc="".repeat(7);function Cn(i){return Mn(i)&&i.data.substr(0,7)===dc}function uc(i){return i.data.length==7&&Cn(i)}function Wd(i){return Cn(i)?i.data.slice(7):i.data}function ni(i,e){if(e.keyCode==it.arrowleft){const t=e.domTarget.ownerDocument.defaultView.getSelection();if(t.rangeCount==1&&t.getRangeAt(0).collapsed){const n=t.getRangeAt(0).startContainer,r=t.getRangeAt(0).startOffset;Cn(n)&&r<=7&&t.collapse(n,0)}}}function Fh(i,e,t,n=!1){t=t||function(o,a){return o===a},Array.isArray(i)||(i=Array.prototype.slice.call(i)),Array.isArray(e)||(e=Array.prototype.slice.call(e));const r=function(o,a,c){const u=Bh(o,a,c);if(u===-1)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const f=Vh(o,u),b=Vh(a,u),k=Bh(f,b,c),T=o.length-k,S=a.length-k;return{firstIndex:u,lastIndexOld:T,lastIndexNew:S}}(i,e,t);return n?function(o,a){const{firstIndex:c,lastIndexOld:u,lastIndexNew:f}=o;if(c===-1)return Array(a).fill("equal");let b=[];return c>0&&(b=b.concat(Array(c).fill("equal"))),f-c>0&&(b=b.concat(Array(f-c).fill("insert"))),u-c>0&&(b=b.concat(Array(u-c).fill("delete"))),f<a&&(b=b.concat(Array(a-f).fill("equal"))),b}(r,e.length):function(o,a){const c=[],{firstIndex:u,lastIndexOld:f,lastIndexNew:b}=a;return b-u>0&&c.push({index:u,type:"insert",values:o.slice(u,b)}),f-u>0&&c.push({index:u+(b-u),type:"delete",howMany:f-u}),c}(e,r)}function Bh(i,e,t){for(let n=0;n<Math.max(i.length,e.length);n++)if(i[n]===void 0||e[n]===void 0||!t(i[n],e[n]))return n;return-1}function Vh(i,e){return i.slice(e).reverse()}function Lo(i,e,t){t=t||function(D,L){return D===L};const n=i.length,r=e.length;if(n>200||r>200||n+r>300)return Lo.fastDiff(i,e,t,!0);let o,a;if(r<n){const D=i;i=e,e=D,o="delete",a="insert"}else o="insert",a="delete";const c=i.length,u=e.length,f=u-c,b={},k={};function T(D){const L=(k[D-1]!==void 0?k[D-1]:-1)+1,W=k[D+1]!==void 0?k[D+1]:-1,J=L>W?-1:1;b[D+J]&&(b[D]=b[D+J].slice(0)),b[D]||(b[D]=[]),b[D].push(L>W?o:a);let de=Math.max(L,W),xe=de-D;for(;xe<c&&de<u&&t(i[xe],e[de]);)xe++,de++,b[D].push("equal");return de}let S,O=0;do{for(S=-O;S<f;S++)k[S]=T(S);for(S=f+O;S>f;S--)k[S]=T(S);k[f]=T(f),O++}while(k[f]!==u);return b[f].slice(1)}function $h(i,e,t){i.insertBefore(t,i.childNodes[e]||null)}function qd(i){const e=i.parentNode;e&&e.removeChild(i)}function os(i){if(i){if(i.defaultView)return i instanceof i.defaultView.Document;if(i.ownerDocument&&i.ownerDocument.defaultView)return i instanceof i.ownerDocument.defaultView.Node}return!1}Lo.fastDiff=Fh;class Hh{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;Cn(t.parent)?this._inlineFiller=t.parent:this._inlineFiller=Uh(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),r=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,{withChildren:!1})),o=this._diffNodeLists(n,r),a=this._findReplaceActions(o,n,r);if(a.indexOf("replace")!==-1){const c={equal:0,insert:0,delete:0};for(const u of a)if(u==="replace"){const f=c.equal+c.insert,b=c.equal+c.delete,k=e.getChild(f);!k||k.is("uiElement")||k.is("rawElement")||this._updateElementMappings(k,n[b]),qd(r[f]),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")?me._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&&Mn(t.parent)&&Cn(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!Cn(e))throw new y.a("view-renderer-filler-was-lost",this);uc(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 r=e.nodeBefore,o=e.nodeAfter;return!(r instanceof xt||o instanceof xt)}_updateText(e,t){const n=this.domConverter.findCorrespondingDomText(e),r=this.domConverter.viewToDom(e,n.ownerDocument),o=n.data;let a=r.data;const c=t.inlineFillerPosition;if(c&&c.parent==e.parent&&c.offset==e.index&&(a=dc+a),o!=a){const u=Fh(o,a);for(const f of u)f.type==="insert"?n.insertData(f.index,f.values.join("")):n.deleteData(f.index,f.howMany)}}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=Array.from(t.attributes).map(o=>o.name),r=e.getAttributeKeys();for(const o of r)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 r=t.inlineFillerPosition,o=this.domConverter.mapViewToDom(e).childNodes,a=Array.from(this.domConverter.viewChildrenToDom(e,n.ownerDocument,{bind:!0,inlineFillerPosition:r}));r&&r.parent===e&&Uh(n.ownerDocument,a,r.offset);const c=this._diffNodeLists(o,a);let u=0;const f=new Set;for(const b of c)b==="delete"?(f.add(o[u]),qd(o[u])):b==="equal"&&u++;u=0;for(const b of c)b==="insert"?($h(n,u,a[u]),u++):b==="equal"&&(this._markDescendantTextToSync(this.domConverter.domToView(a[u])),u++);for(const b of f)b.parentNode||this.domConverter.unbindDomElement(b)}_diffNodeLists(e,t){return Lo(e=function(n,r){const o=Array.from(n);return o.length==0||!r||o[o.length-1]==r&&o.pop(),o}(e,this._fakeSelectionContainer),t,$a.bind(null,this.domConverter))}_findReplaceActions(e,t,n){if(e.indexOf("insert")===-1||e.indexOf("delete")===-1)return e;let r=[],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]):(r=r.concat(Lo(o,a,hc).map(f=>f==="equal"?"replace":f)),r.push("equal"),o=[],a=[]),c[u]++;return r.concat(Lo(o,a,hc).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 r=t.getSelection(),o=t.createRange();r.removeAllRanges(),o.selectNodeContents(n),r.addRange(o)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),r=this.domConverter.viewPositionToDom(this.selection.focus);t.collapse(n.parent,n.offset),t.extend(r.parent,r.offset),xn.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))}(r,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 Uh(i,e,t){const n=e instanceof Array?e:e.childNodes,r=n[t];if(Mn(r))return r.data=dc+r.data,r;{const o=i.createTextNode(dc);return Array.isArray(e)?n.splice(t,0,o):$h(e,t,o),o}}function hc(i,e){return os(i)&&os(e)&&!Mn(i)&&!Mn(e)&&i.nodeType!==Node.COMMENT_NODE&&e.nodeType!==Node.COMMENT_NODE&&i.tagName.toLowerCase()===e.tagName.toLowerCase()}function $a(i,e,t){return e===t||(Mn(e)&&Mn(t)?e.data===t.data:!(!i.isBlockFiller(e)||!i.isBlockFiller(t)))}Be(Hh,Gt);var Ut={window,document};function Kd(i){let e=0;for(;i.previousSibling;)i=i.previousSibling,e++;return e}function Gd(i){const e=[];for(;i&&i.nodeType!=Node.DOCUMENT_NODE;)e.unshift(i),i=i.parentNode;return e}const lm=zh(document),to=jh(document),Yd=Lh(document);class Ii{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 Hr,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 r=this._processDataFromViewText(e);return t.createTextNode(r)}{if(this.mapViewToDom(e))return this.mapViewToDom(e);let r;if(e.is("documentFragment"))r=t.createDocumentFragment(),n.bind&&this.bindDocumentFragments(r,e);else{if(e.is("uiElement"))return r=e.name==="$comment"?t.createComment(e.getCustomProperty("$rawContent")):e.render(t),n.bind&&this.bindElements(r,e),r;r=e.hasAttribute("xmlns")?t.createElementNS(e.getAttribute("xmlns"),e.name):t.createElement(e.name),e.is("rawElement")&&e.render(r),n.bind&&this.bindElements(r,e);for(const o of e.getAttributeKeys())r.setAttribute(o,e.getAttribute(o))}if(n.withChildren!==!1)for(const o of this.viewChildrenToDom(e,t,n))r.appendChild(o);return r}}*viewChildrenToDom(e,t,n={}){const r=e.getFillerOffset&&e.getFillerOffset();let o=0;for(const a of e.getChildren())r===o&&(yield this._getBlockFiller(t)),yield this.viewToDom(a,t,n),o++;r===o&&(yield this._getBlockFiller(t))}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),n=this.viewPositionToDom(e.end),r=document.createRange();return r.setStart(t.parent,t.offset),r.setEnd(n.parent,n.offset),r}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const n=this.findCorrespondingDomText(t);if(!n)return null;let r=e.offset;return Cn(n)&&(r+=7),{parent:n,offset:r}}{let n,r,o;if(e.offset===0){if(n=this.mapViewToDom(t),!n)return null;o=n.childNodes[0]}else{const a=e.nodeBefore;if(r=a.is("$text")?this.findCorrespondingDomText(a):this.mapViewToDom(e.nodeBefore),!r)return null;n=r.parentNode,o=r.nextSibling}return Mn(o)&&Cn(o)?{parent:o,offset:7}:{parent:n,offset:r?Kd(r)+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(Mn(e)){if(uc(e))return null;{const r=this._processDataFromDomText(e);return r===""?null:new xt(this.document,r)}}{if(this.mapDomToView(e))return this.mapDomToView(e);let r;if(this.isDocumentFragment(e))r=new is(this.document),t.bind&&this.bindDocumentFragments(e,r);else{r=this._createViewElement(e,t),t.bind&&this.bindElements(e,r);const o=e.attributes;if(o)for(let a=o.length-1;a>=0;a--)r._setAttribute(o[a].name,o[a].value);if(this._isViewElementWithRawContent(r,t)||this.isComment(e)){const a=this.isComment(e)?e.data:e.innerHTML;return r._setCustomProperty("$rawContent",a),this._encounteredRawContentDomNodes.add(e),r}}if(t.withChildren!==!1)for(const o of this.domChildrenToView(e,t))r._appendChild(o);return r}}*domChildrenToView(e,t={}){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n],o=this.domToView(r,t);o!==null&&(yield o)}}domSelectionToView(e){if(e.rangeCount===1){let r=e.getRangeAt(0).startContainer;Mn(r)&&(r=r.parentNode);const o=this.fakeSelectionToView(r);if(o)return o}const t=this.isDomSelectionBackward(e),n=[];for(let r=0;r<e.rangeCount;r++){const o=e.getRangeAt(r),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 $e(t,n):null}domPositionToView(e,t){if(this.isBlockFiller(e))return this.domPositionToView(e.parentNode,Kd(e));const n=this.mapDomToView(e);if(n&&(n.is("uiElement")||n.is("rawElement")))return me._createBefore(n);if(Mn(e)){if(uc(e))return this.domPositionToView(e.parentNode,Kd(e));const r=this.findCorrespondingViewText(e);let o=t;return r?(Cn(e)&&(o-=7,o=o<0?0:o),new me(r,o)):null}if(t===0){const r=this.mapDomToView(e);if(r)return new me(r,0)}else{const r=e.childNodes[t-1],o=Mn(r)?this.findCorrespondingViewText(r):this.mapDomToView(r);if(o&&o.parent)return new me(o.parent,o.index+1)}return null}mapDomToView(e){return this.getHostViewElement(e)||this._domToViewMapping.get(e)}findCorrespondingViewText(e){if(uc(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 r=this.mapDomToView(n);if(r)return r.nextSibling instanceof xt?r.nextSibling:null}else{const r=this.mapDomToView(e.parentNode);if(r){const o=r.getChild(0);return o instanceof xt?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:r}=Ut.window,o=[];Pr(t,a=>{const{scrollLeft:c,scrollTop:u}=a;o.push([c,u])}),t.focus(),Pr(t,a=>{const[c,u]=o.shift();a.scrollLeft=c,a.scrollTop=u}),Ut.window.scrollTo(n,r)}}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(lm):!(e.tagName!=="BR"||!Wh(e,this.blockElements)||e.parentNode.childNodes.length!==1)||e.isEqualNode(Yd)||function(t,n){return t.isEqualNode(to)&&Wh(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=Gd(e);for(t.pop();t.length;){const n=t.pop(),r=this._domToViewMapping.get(n);if(r&&(r.is("uiElement")||r.is("rawElement")))return r}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 jh(e);case"markedNbsp":return Lh(e);case"br":return zh(e)}}_isDomSelectionPositionCorrect(e,t){if(Mn(e)&&Cn(e)&&t<7||this.isElement(e)&&Cn(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),r=n&&n.is("$textProxy")&&n.data.charAt(0)==" ";t.charAt(t.length-2)!=" "&&n&&!r||(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(f,b){return Gd(f).some(k=>k.tagName&&b.includes(k.tagName.toLowerCase()))}(e,this.preElements))return Wd(e);t=t.replace(/[ \n\t\r]{1,}/g," ");const n=this._getTouchingInlineDomNode(e,!1),r=this._getTouchingInlineDomNode(e,!0),o=this._checkShouldLeftTrimDomText(e,n),a=this._checkShouldRightTrimDomText(e,r);o&&(t=t.replace(/^ /,"")),a&&(t=t.replace(/ $/,"")),t=Wd(new Text(t)),t=t.replace(/ \u00A0/g," ");const c=r&&this.isElement(r)&&r.tagName!="BR",u=r&&Mn(r)&&r.data.charAt(0)==" ";return(/( |\u00A0)\u00A0$/.test(t)||!r||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&&!Cn(e)}_getTouchingInlineViewNode(e,t){const n=new nr({startPosition:t?me._createAfter(e):me._createBefore(e),direction:t?"forward":"backward"});for(const r of n){if(r.item.is("element")&&this.inlineObjectElements.includes(r.item.name))return r.item;if(r.item.is("containerElement")||r.item.is("element","br"))return null;if(r.item.is("$textProxy"))return r.item}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode)return null;const n=t?"firstChild":"lastChild",r=t?"nextSibling":"previousSibling";let o=!0;do if(!o&&e[n]?e=e[n]:e[r]?(e=e[r],o=!1):(e=e.parentNode,o=!0),!e||this._isBlockElement(e))return null;while(!Mn(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 Vd(this.document,"$comment");const n=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();return new Te(this.document,n)}_isViewElementWithRawContent(e,t){return t.withChildren!==!1&&this._rawContentElementMatcher.match(e)}}function Pr(i,e){for(;i&&i!=Ut.document;)e(i),i=i.parentNode}function Wh(i,e){const t=i.parentNode;return t&&t.tagName&&e.includes(t.tagName.toLowerCase())}function Ha(i){const e=Object.prototype.toString.apply(i);return e=="[object Window]"||e=="[object global]"}var ss=_o({},B,{listenTo(i,...e){if(os(i)||Ha(i)){const t=this._getProxyEmitter(i)||new as(i);t.attach(...e),i=t}B.listenTo.call(this,i,...e)},stopListening(i,e,t){if(os(i)||Ha(i)){const n=this._getProxyEmitter(i);if(!n)return;i=n}B.stopListening.call(this,i,e,t),i instanceof as&&i.detach(e)},_getProxyEmitter(i){return e=this,t=no(i),e[R]&&e[R][t]?e[R][t].emitter:null;var e,t}});class as{constructor(e){V(this,no(e)),this._domNode=e}}function no(i){return i["data-ck-expando"]||(i["data-ck-expando"]=P())}_o(as.prototype,B,{attach(i,e,t={}){if(this._domListeners&&this._domListeners[i])return;const n={capture:!!t.useCapture,passive:!!t.usePassive},r=this._createDomListener(i,n);this._domNode.addEventListener(i,r,n),this._domListeners||(this._domListeners={}),this._domListeners[i]=r},detach(i){let e;!this._domListeners[i]||(e=this._events[i])&&e.callbacks.length||this._domListeners[i].removeListener()},_createDomListener(i,e){const t=n=>{this.fire(i,n)};return t.removeListener=()=>{this._domNode.removeEventListener(i,t,e),delete this._domListeners[i]},t}});class Mi{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] *")}}Be(Mi,ss);var cm=function(i){return this.__data__.set(i,"__lodash_hash_undefined__"),this},fc=function(i){return this.__data__.has(i)};function pc(i){var e=-1,t=i==null?0:i.length;for(this.__data__=new Ms;++e<t;)this.add(i[e])}pc.prototype.add=pc.prototype.push=cm,pc.prototype.has=fc;var qh=pc,On=function(i,e){for(var t=-1,n=i==null?0:i.length;++t<n;)if(e(i[t],t,i))return!0;return!1},Qd=function(i,e){return i.has(e)},Jd=function(i,e,t,n,r,o){var a=1&t,c=i.length,u=e.length;if(c!=u&&!(a&&u>c))return!1;var f=o.get(i),b=o.get(e);if(f&&b)return f==e&&b==i;var k=-1,T=!0,S=2&t?new qh:void 0;for(o.set(i,e),o.set(e,i);++k<c;){var O=i[k],D=e[k];if(n)var L=a?n(D,O,k,e,i,o):n(O,D,k,i,e,o);if(L!==void 0){if(L)continue;T=!1;break}if(S){if(!On(e,function(W,J){if(!Qd(S,J)&&(O===W||r(O,W,t,n,o)))return S.push(J)})){T=!1;break}}else if(O!==D&&!r(O,D,t,n,o)){T=!1;break}}return o.delete(i),o.delete(e),T},Oi=function(i){var e=-1,t=Array(i.size);return i.forEach(function(n,r){t[++e]=[r,n]}),t},Xd=function(i){var e=-1,t=Array(i.size);return i.forEach(function(n){t[++e]=n}),t},Ua=ae?ae.prototype:void 0,ro=Ua?Ua.valueOf:void 0,Kh=function(i,e,t,n,r,o,a){switch(t){case"[object DataView]":if(i.byteLength!=e.byteLength||i.byteOffset!=e.byteOffset)return!1;i=i.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(i.byteLength!=e.byteLength||!o(new Ao(i),new Ao(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return we(+i,+e);case"[object Error]":return i.name==e.name&&i.message==e.message;case"[object RegExp]":case"[object String]":return i==e+"";case"[object Map]":var c=Oi;case"[object Set]":var u=1&n;if(c||(c=Xd),i.size!=e.size&&!u)return!1;var f=a.get(i);if(f)return f==e;n|=2,a.set(i,e);var b=Jd(c(i),c(e),n,r,o,a);return a.delete(i),b;case"[object Symbol]":if(ro)return ro.call(i)==ro.call(e)}return!1},rr=Object.prototype.hasOwnProperty,Zd=function(i,e,t,n,r,o){var a=1&t,c=Co(i),u=c.length;if(u!=Co(e).length&&!a)return!1;for(var f=u;f--;){var b=c[f];if(!(a?b in e:rr.call(e,b)))return!1}var k=o.get(i),T=o.get(e);if(k&&T)return k==e&&T==i;var S=!0;o.set(i,e),o.set(e,i);for(var O=a;++f<u;){var D=i[b=c[f]],L=e[b];if(n)var W=a?n(L,D,b,e,i,o):n(D,L,b,i,e,o);if(!(W===void 0?D===L||r(D,L,t,n,o):W)){S=!1;break}O||(O=b=="constructor")}if(S&&!O){var J=i.constructor,de=e.constructor;J==de||!("constructor"in i)||!("constructor"in e)||typeof J=="function"&&J instanceof J&&typeof de=="function"&&de instanceof de||(S=!1)}return o.delete(i),o.delete(e),S},Gh=Object.prototype.hasOwnProperty,dm=function(i,e,t,n,r,o){var a=vt(i),c=vt(e),u=a?"[object Array]":Ot(i),f=c?"[object Array]":Ot(e),b=(u=u=="[object Arguments]"?"[object Object]":u)=="[object Object]",k=(f=f=="[object Arguments]"?"[object Object]":f)=="[object Object]",T=u==f;if(T&&Object(Zn.a)(i)){if(!Object(Zn.a)(e))return!1;a=!0,b=!1}if(T&&!b)return o||(o=new Go),a||ks(i)?Jd(i,e,t,n,r,o):Kh(i,e,u,t,n,r,o);if(!(1&t)){var S=b&&Gh.call(i,"__wrapped__"),O=k&&Gh.call(e,"__wrapped__");if(S||O){var D=S?i.value():i,L=O?e.value():e;return o||(o=new Go),r(D,L,t,n,o)}}return!!T&&(o||(o=new Go),Zd(i,e,t,n,r,o))},Yh=function i(e,t,n,r,o){return e===t||(e==null||t==null||!en(e)&&!en(t)?e!=e&&t!=t:dm(e,t,n,r,i,o))},eu=function(i,e,t){var n=(t=typeof t=="function"?t:void 0)?t(i,e):void 0;return n===void 0?Yh(i,e,void 0,t):!!n};class Qh extends Mi{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,r=new Set;for(const f of e)if(f.type==="childList"){const b=t.mapDomToView(f.target);if(b&&(b.is("uiElement")||b.is("rawElement")))continue;b&&!this._isBogusBrMutation(f)&&r.add(b)}for(const f of e){const b=t.mapDomToView(f.target);if((!b||!b.is("uiElement")&&!b.is("rawElement"))&&f.type==="characterData"){const k=t.findCorrespondingViewText(f.target);k&&!r.has(k.parent)?n.set(k,{type:"text",oldText:k.data,newText:Wd(f.target),node:k}):!k&&Cn(f.target)&&r.add(t.mapDomToView(f.target.parentNode))}}const o=[];for(const f of n.values())this.renderer.markToSync("text",f.node),o.push(f);for(const f of r){const b=t.mapViewToDom(f),k=Array.from(f.getChildren()),T=Array.from(t.domChildrenToView(b,{withChildren:!1}));eu(k,T,u)||(this.renderer.markToSync("children",f),o.push({type:"children",oldChildren:k,newChildren:T,node:f}))}const a=e[0].target.ownerDocument.getSelection();let c=null;if(a&&a.anchorNode){const f=t.domPositionToView(a.anchorNode,a.anchorOffset),b=t.domPositionToView(a.focusNode,a.focusOffset);f&&b&&(c=new ft(f),c.setFocus(b))}function u(f,b){if(!Array.isArray(f))return f===b||!(!f.is("$text")||!b.is("$text"))&&f.data===b.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 ls{constructor(e,t,n){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,_o(this,n)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class io extends Mi{constructor(e){super(e),this.useCapture=!1}observe(e){(typeof this.domEventType=="string"?[this.domEventType]:this.domEventType).forEach(t=>{this.listenTo(e,t,(n,r)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(r.target)&&this.onDomEvent(r)},{useCapture:this.useCapture})})}fire(e,t,n){this.isEnabled&&this.document.fire(e,new ls(this.view,t,n))}}class um extends io{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 N(this)}})}}var tu=function(){return ie.a.Date.now()},Wa=/\s/,hm=function(i){for(var e=i.length;e--&&Wa.test(i.charAt(e)););return e},fm=/^\s+/,nu=function(i){return i&&i.slice(0,hm(i)+1).replace(fm,"")},Jh=/^[-+]0x[0-9a-f]+$/i,pm=/^0b[01]+$/i,gm=/^0o[0-7]+$/i,mm=parseInt,ru=function(i){if(typeof i=="number")return i;if(zs(i))return NaN;if(ne(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=ne(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=nu(i);var t=pm.test(i);return t||gm.test(i)?mm(i.slice(2),t?2:8):Jh.test(i)?NaN:+i},iu=Math.max,bm=Math.min,qa=function(i,e,t){var n,r,o,a,c,u,f=0,b=!1,k=!1,T=!0;if(typeof i!="function")throw new TypeError("Expected a function");function S(de){var xe=n,Ve=r;return n=r=void 0,f=de,a=i.apply(Ve,xe)}function O(de){return f=de,c=setTimeout(L,e),b?S(de):a}function D(de){var xe=de-u;return u===void 0||xe>=e||xe<0||k&&de-f>=o}function L(){var de=tu();if(D(de))return W(de);c=setTimeout(L,function(xe){var Ve=e-(xe-u);return k?bm(Ve,o-(xe-f)):Ve}(de))}function W(de){return c=void 0,T&&n?S(de):(n=r=void 0,a)}function J(){var de=tu(),xe=D(de);if(n=arguments,r=this,u=de,xe){if(c===void 0)return O(u);if(k)return clearTimeout(c),c=setTimeout(L,e),S(u)}return c===void 0&&(c=setTimeout(L,e)),a}return e=ru(e)||0,ne(t)&&(b=!!t.leading,o=(k="maxWait"in t)?iu(ru(t.maxWait)||0,e):o,T="trailing"in t?!!t.trailing:T),J.cancel=function(){c!==void 0&&clearTimeout(c),f=0,n=u=r=c=void 0},J.flush=function(){return c===void 0?a:W(tu())},J};class Xh extends Mi{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=qa(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!=it.arrowleft&&e!=it.arrowup||n.setTo(n.getFirstPosition()),e!=it.arrowright&&e!=it.arrowdown||n.setTo(n.getLastPosition());const r={oldSelection:t,newSelection:n,domSelection:null};this.document.fire("selectionChange",r),this._fireSelectionChangeDoneDebounced(r)}}class Zh extends Mi{constructor(e){super(e),this.mutationObserver=e.getObserver(Qh),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=qa(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,r)=>{this._handleSelectionChange(r,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 r=this.domConverter.domSelectionToView(n);if(r.rangeCount!=0){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(r)&&this.domConverter.isDomSelectionCorrect(n)||++this._loopbackCounter>60))if(this.selection.isSimilar(r))this.view.forceRender();else{const o={oldSelection:this.selection,newSelection:r,domSelection:n};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class ef extends io{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,r)=>{const o=t.selection.editableElement;o!==null&&o!==r.target||(t.isFocused=!1,e.change(()=>{}))})}onDomEvent(e){this.fire(e.type,e)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class gc extends io{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 vm extends io{constructor(e){super(e),this.domEventType=["beforeinput"]}onDomEvent(e){this.fire(e.type,e)}}class tf{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 ou=function(i){return typeof i=="string"||!vt(i)&&en(i)&&ke(i)=="[object String]"};function mc(i){return Object.prototype.toString.apply(i)=="[object Range]"}function su(i){const e=i.ownerDocument.defaultView.getComputedStyle(i);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}const nf=["top","right","bottom","left","width","height"];class At{constructor(e){const t=mc(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),ei(e)||t)if(t){const n=At.getDomRangeRects(e);Ka(this,At.getBoundingRect(n))}else Ka(this,e.getBoundingClientRect());else if(Ha(e)){const{innerWidth:n,innerHeight:r}=e;Ka(this,{top:0,right:n,bottom:r,left:0,width:n,height:r})}else Ka(this,e)}clone(){return new At(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 At(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(!bc(e)){let n=e.parentNode||e.commonAncestorContainer;for(;n&&!bc(n);){const r=new At(n),o=t.getIntersection(r);if(!o)return null;o.getArea()<t.getArea()&&(t=o),n=n.parentNode}}return t}isEqual(e){for(const t of nf)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,r;if(Ha(e))t=e.innerWidth-e.document.documentElement.clientWidth,n=e.innerHeight-e.document.documentElement.clientHeight,r=e.getComputedStyle(e.document.documentElement).direction;else{const o=su(this._source);t=e.offsetWidth-e.clientWidth-o.left-o.right,n=e.offsetHeight-e.clientHeight-o.top-o.bottom,r=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,r==="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 r of n)t.push(new At(r));else{let r=e.startContainer;Mn(r)&&(r=r.parentNode);const o=new At(r.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 r of e)n++,t.left=Math.min(t.left,r.left),t.top=Math.min(t.top,r.top),t.right=Math.max(t.right,r.right),t.bottom=Math.max(t.bottom,r.bottom);return n==0?null:(t.width=t.right-t.left,t.height=t.bottom-t.top,new At(t))}}function Ka(i,e){for(const t of nf)i[t]=e[t]}function bc(i){return!!ei(i)&&i===i.ownerDocument.body}class tn{constructor(e,t){tn._observerInstance||tn._createObserver(),this._element=e,this._callback=t,tn._addElementCallback(e,t),tn._observerInstance.observe(e)}destroy(){tn._deleteElementCallback(this._element,this._callback)}static _addElementCallback(e,t){tn._elementCallbacks||(tn._elementCallbacks=new Map);let n=tn._elementCallbacks.get(e);n||(n=new Set,tn._elementCallbacks.set(e,n)),n.add(t)}static _deleteElementCallback(e,t){const n=tn._getElementCallbacks(e);n&&(n.delete(t),n.size||(tn._elementCallbacks.delete(e),tn._observerInstance.unobserve(e))),tn._elementCallbacks&&!tn._elementCallbacks.size&&(tn._observerInstance=null,tn._elementCallbacks=null)}static _getElementCallbacks(e){return tn._elementCallbacks?tn._elementCallbacks.get(e):null}static _createObserver(){let e;e=typeof Ut.window.ResizeObserver=="function"?Ut.window.ResizeObserver:vc,tn._observerInstance=new e(t=>{for(const n of t){const r=tn._getElementCallbacks(n.target);if(r)for(const o of r)o(n)}})}}tn._observerInstance=null,tn._elementCallbacks=null;class vc{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(Ut.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 At(e),n=this._previousRects.get(e),r=!n||!n.isEqual(t);return this._previousRects.set(e,t),r}}function ot(i){return e=>e+i}function pr(i){const e=i.next();return e.done?null:e.value}Be(vc,ss);class Ur{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)}}Be(Ur,ss),Be(Ur,Gt);class Ir{constructor(){this._listener=Object.create(ss)}listenTo(e){this._listener.listenTo(e,"keydown",(t,n)=>{this._listener.fire("_keydown:"+N(n),n)})}set(e,t,n={}){const r=Do(e),o=n.priority;this._listener.listenTo(this._listener,"_keydown:"+r,(a,c)=>{t(c,()=>{c.preventDefault(),c.stopPropagation(),a.stop()}),a.return=!0},{priority:o})}press(e){return!!this._listener.fire("_keydown:"+N(e),e)}destroy(){this._listener.stopListening()}}class rf extends Mi{constructor(e){super(e),this.document.on("keydown",(t,n)=>{if(this.isEnabled&&((r=n.keyCode)==it.arrowright||r==it.arrowleft||r==it.arrowup||r==it.arrowdown)){const o=new An(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(o,n),o.stop.called&&t.stop()}var r})}observe(){}}function of({target:i,viewportOffset:e=0}){const t=wc(i);let n=t,r=null;for(;n;){let o;o=gr(n==t?i:r),Mr(o,()=>oo(i,n));const a=oo(i,n);if(_m(n,a,e),n.parent!=n){if(r=n.frameElement,n=n.parent,!r)return}else n=null}}function _m(i,e,t){const n=e.clone().moveBy(0,t),r=e.clone().moveBy(0,-t),o=new At(i).excludeScrollbarsAndBorders();if(![r,n].every(a=>o.contains(a))){let{scrollX:a,scrollY:c}=i;Ga(r,o)?c-=o.top-e.top+t:sf(n,o)&&(c+=e.bottom-o.bottom+t),_c(e,o)?a-=o.left-e.left+t:au(e,o)&&(a+=e.right-o.right+t),i.scrollTo(a,c)}}function Mr(i,e){const t=wc(i);let n,r;for(;i!=t.document.body;)r=e(),n=new At(i).excludeScrollbarsAndBorders(),n.contains(r)||(Ga(r,n)?i.scrollTop-=n.top-r.top:sf(r,n)&&(i.scrollTop+=r.bottom-n.bottom),_c(r,n)?i.scrollLeft-=n.left-r.left:au(r,n)&&(i.scrollLeft+=r.right-n.right)),i=i.parentNode}function sf(i,e){return i.bottom>e.bottom}function Ga(i,e){return i.top<e.top}function _c(i,e){return i.left<e.left}function au(i,e){return i.right>e.right}function wc(i){return mc(i)?i.startContainer.ownerDocument.defaultView:i.ownerDocument.defaultView}function gr(i){if(mc(i)){let e=i.commonAncestorContainer;return Mn(e)&&(e=e.parentNode),e}return i.parentNode}function oo(i,e){const t=wc(i),n=new At(i);if(t===e)return n;{let r=t;for(;r!=e;){const o=r.frameElement,a=new At(o).excludeScrollbarsAndBorders();n.moveBy(a.left,a.top),r=r.parent}}return n}Object.assign({},{scrollViewportToShowTarget:of,scrollAncestorsToShowTarget:function(i){Mr(gr(i),()=>new At(i))}});class kc{constructor(e){this.document=new eo(e),this.domConverter=new Ii(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Hh(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 Rh(this.document),this.addObserver(Qh),this.addObserver(Zh),this.addObserver(ef),this.addObserver(um),this.addObserver(Xh),this.addObserver(gc),this.addObserver(rf),xn.isAndroid&&this.addObserver(vm),this.document.on("arrowKey",ni,{priority:"low"}),rm(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 r={};for(const{name:a,value:c}of Array.from(e.attributes))r[a]=c,a==="class"?this._writer.addClass(c.split(" "),n):this._writer.setAttribute(a,c,n);this._initialDomRootAttributes.set(e,r);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:r})=>t.removeAttribute(r));const n=this._initialDomRootAttributes.get(t);for(const r in n)t.setAttribute(r,n[r]);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,r]of this.domRoots)t.observe(r,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&&of({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 me._createAt(e,t)}createPositionAfter(e){return me._createAfter(e)}createPositionBefore(e){return me._createBefore(e)}createRange(e,t){return new $e(e,t)}createRangeOn(e){return $e._createOn(e)}createRangeIn(e){return $e._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}}Be(kc,Gt);class zo{constructor(e){this.parent=null,this._attrs=Ar(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),r=e.getAncestors(t);let o=0;for(;n[o]==r[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(),r=Sn(t,n);switch(r){case"prefix":return!0;case"extension":return!1;default:return t[r]<n[r]}}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 zo(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=Ar(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}class Rt extends zo{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 Rt(this.data,this.getAttributes())}static fromJSON(e){return new Rt(e.data,e.attributes)}}class ri{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 Fo{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,r)=>n+r.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 zo))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 Dt extends zo{constructor(e,t,n){super(t),this.name=e,this._children=new Fo,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 Dt(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(r){return typeof r=="string"?[new Rt(r)]:(dr(r)||(r=[r]),Array.from(r).map(o=>typeof o=="string"?new Rt(o):o instanceof ri?new Rt(o.data,o.getAttributes()):o))}(t);for(const r of n)r.parent!==null&&r._remove(),r.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const r of n)r.parent=null;return n}static fromJSON(e){let t=null;if(e.children){t=[];for(const n of e.children)n.name?t.push(Dt.fromJSON(n)):t.push(Rt.fromJSON(n))}return new Dt(e.name,e.attributes,t)}}class ii{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=fe._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,r,o;do r=this.position,o=this._visitedParent,{done:t,value:n}=this.next();while(!t&&e(n));t||(this.position=r,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 r=t.parent,o=Vs(t,r),a=o||Ni(t,r,o);if(a instanceof Dt)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=a),this.position=t,so("elementStart",a,e,t,1);if(a instanceof Rt){let c;if(this.singleCharacters)c=1;else{let b=a.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offset<b&&(b=this.boundaries.end.offset),c=b-t.offset}const u=t.offset-a.startOffset,f=new ri(a,u,c);return t.offset+=c,this.position=t,so("text",f,e,t,c)}return t.path.pop(),t.offset++,this.position=t,this._visitedParent=n.parent,this.ignoreElementEnd?this._next():so("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 r=t.parent,o=Vs(t,r),a=o||lu(t,r,o);if(a instanceof Dt)return t.offset--,this.shallow?(this.position=t,so("elementStart",a,e,t,1)):(t.path.push(a.maxOffset),this.position=t,this._visitedParent=a,this.ignoreElementEnd?this._previous():so("elementEnd",a,e,t));if(a instanceof Rt){let c;if(this.singleCharacters)c=1;else{let b=a.startOffset;this._boundaryStartParent==n&&this.boundaries.start.offset>b&&(b=this.boundaries.start.offset),c=t.offset-b}const u=t.offset-a.startOffset,f=new ri(a,u-c,c);return t.offset-=c,this.position=t,so("text",f,e,t,c)}return t.path.pop(),this.position=t,this._visitedParent=n.parent,so("elementStart",n,e,t,1)}}function so(i,e,t,n,r){return{done:!1,value:{type:i,item:e,previousPosition:t,nextPosition:n,length:r}}}class fe{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 Vs(this,this.parent)}get nodeAfter(){const e=this.parent;return Ni(this,e,Vs(this,e))}get nodeBefore(){const e=this.parent;return lu(this,e,Vs(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=Sn(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 ii(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=Sn(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 r=0;for(;t[r]==n[r]&&t[r];)r++;return r===0?null:t[r-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=fe._createAt(this),n=fe._createAt(e);break;case"after":t=fe._createAt(e),n=fe._createAt(this);break;default:return!1}let r=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!==r.maxOffset)return!1;t.path=t.path.slice(0,-1),r=r.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:Sn(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=fe._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)?fe._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),n}_getTransformedByDeletion(e,t){const n=fe._createAt(this);if(this.root!=e.root)return n;if(Sn(e.getParentPath(),this.getParentPath())=="same"){if(e.offset<this.offset){if(e.offset+t>this.offset)return null;n.offset-=t}}else if(Sn(e.getParentPath(),this.getParentPath())=="prefix"){const r=e.path.length-1;if(e.offset<=this.path[r]){if(e.offset+t>this.path[r])return null;n.path[r]-=t}}return n}_getTransformedByInsertion(e,t){const n=fe._createAt(this);if(this.root!=e.root)return n;if(Sn(e.getParentPath(),this.getParentPath())=="same")(e.offset<this.offset||e.offset==this.offset&&this.stickiness!="toPrevious")&&(n.offset+=t);else if(Sn(e.getParentPath(),this.getParentPath())=="prefix"){const r=e.path.length-1;e.offset<=this.path[r]&&(n.path[r]+=t)}return n}_getTransformedByMove(e,t,n){if(t=t._getTransformedByDeletion(e,n),e.isEqual(t))return fe._createAt(this);const r=this._getTransformedByDeletion(e,n);return r===null||e.isEqual(this)&&this.stickiness=="toNext"||e.getShiftedBy(n).isEqual(this)&&this.stickiness=="toPrevious"?this._getCombined(e,t):r._getTransformedByInsertion(t,n)}_getCombined(e,t){const n=e.path.length-1,r=fe._createAt(t);return r.stickiness=this.stickiness,r.offset=r.offset+this.path[n]-e.offset,r.path=[...r.path,...this.path.slice(n+1)],r}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 fe)return new fe(e.root,e.path,e.stickiness);{const r=e;if(t=="end")t=r.maxOffset;else{if(t=="before")return this._createBefore(r,n);if(t=="after")return this._createAfter(r,n);if(t!==0&&!t)throw new y.a("model-createpositionat-offset-required",[this,e])}if(!r.is("element")&&!r.is("documentFragment"))throw new y.a("model-position-parent-incorrect",[this,e]);const o=r.getPath();return o.push(t),new this(r.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 fe(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 fe(t.getRoot(e.root),e.path,e.stickiness)}}function Vs(i,e){const t=e.getChild(e.offsetToIndex(i.offset));return t&&t.is("$text")&&t.startOffset<i.offset?t:null}function Ni(i,e,t){return t!==null?null:e.getChild(e.offsetToIndex(i.offset))}function lu(i,e,t){return t!==null?null:e.getChild(e.offsetToIndex(i.offset)-1)}class oe{constructor(e,t=null){this.start=fe._createAt(e),this.end=t?fe._createAt(t):fe._createAt(e),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}*[Symbol.iterator](){yield*new ii({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return Sn(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),r=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&r}containsItem(e){const t=fe._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 oe(this.start,e.start)),this.containsPosition(e.end)&&t.push(new oe(e.end,this.end))):t.push(new oe(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 oe(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 r=this.start,o=this.end;return e.start.isBefore(r)&&(r=e.start),e.end.isAfter(o)&&(o=e.end),new oe(r,o)}getMinimalFlatRanges(){const e=[],t=this.start.getCommonPath(this.end).length,n=fe._createAt(this.start);let r=n.parent;for(;n.path.length>t+1;){const o=r.maxOffset-n.offset;o!==0&&e.push(new oe(n,n.getShiftedBy(o))),n.path=n.path.slice(0,-1),n.offset++,r=r.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 oe(n,n.getShiftedBy(a))),n.offset=o,n.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new ii(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new ii(e);for(const n of t)yield n.item}*getPositions(e={}){e.boundaries=this;const t=new ii(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 oe(this.start,this.end)]}getTransformedByOperations(e){const t=[new oe(this.start,this.end)];for(const n of e)for(let r=0;r<t.length;r++){const o=t[r].getTransformedByOperation(n);t.splice(r,1,...o),r+=o.length-1}for(let n=0;n<t.length;n++){const r=t[n];for(let o=n+1;o<t.length;o++){const a=t[o];(r.containsRange(a)||a.containsRange(r)||r.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,r=e.howMany,o=e.targetPosition;return this._getTransformedByMove(n,o,r,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 oe(t,n)}_getTransformedByMergeOperation(e){if(this.start.isEqual(e.targetPosition)&&this.end.isEqual(e.deletionPosition))return new oe(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=fe._createAt(n),t.offset=0):(e.deletionPosition.isEqual(t)||(n=e.deletionPosition),t=e.targetPosition),new oe(t,n)):new oe(t,n)}_getTransformedByInsertion(e,t,n=!1){if(n&&this.containsPosition(e))return[new oe(this.start,e),new oe(e.getShiftedBy(t),this.end._getTransformedByInsertion(e,t))];{const r=new oe(this.start,this.end);return r.start=r.start._getTransformedByInsertion(e,t),r.end=r.end._getTransformedByInsertion(e,t),[r]}}_getTransformedByMove(e,t,n,r=!1){if(this.isCollapsed){const k=this.start._getTransformedByMove(e,t,n);return[new oe(k)]}const o=oe._createFromPositionAndShift(e,n),a=t._getTransformedByDeletion(e,n);if(this.containsPosition(t)&&!r&&(o.containsPosition(this.start)||o.containsPosition(this.end))){const k=this.start._getTransformedByMove(e,t,n),T=this.end._getTransformedByMove(e,t,n);return[new oe(k,T)]}let c;const u=this.getDifference(o);let f=null;const b=this.getIntersection(o);if(u.length==1?f=new oe(u[0].start._getTransformedByDeletion(e,n),u[0].end._getTransformedByDeletion(e,n)):u.length==2&&(f=new oe(this.start,this.end._getTransformedByDeletion(e,n))),c=f?f._getTransformedByInsertion(a,n,b!==null||r):[],b){const k=new oe(b.start._getCombined(o.start,a),b.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),r=this.end._getTransformedByDeletion(e,t);return n==null&&r==null?null:(n==null&&(n=e),r==null&&(r=e),new oe(n,r))}static _createFromPositionAndShift(e,t){const n=e,r=e.getShiftedBy(t);return t>0?new this(n,r):new this(r,n)}static _createIn(e){return new this(fe._createAt(e,0),fe._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(fe._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),r=new this(t.start,t.end);if(n>0)for(let o=n-1;e[o].end.isEqual(r.start);o++)r.start=fe._createAt(e[o].start);for(let o=n+1;o<e.length&&e[o].start.isEqual(r.end);o++)r.end=fe._createAt(e[o].end);return r}static fromJSON(e,t){return new this(fe.fromJSON(e.start,t),fe.fromJSON(e.end,t))}}class Ya{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),r=this._viewToModelMapping.get(n),o=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,n);t.modelPosition=fe._createAt(r,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 r=this._elementToMarkerNames.get(e)||new Set;r.add(t),this._markerNameToElements.set(t,n),this._elementToMarkerNames.set(e,r)}unbindElementFromMarkerName(e,t){const n=this._markerNameToElements.get(t);n&&(n.delete(e),n.size==0&&this._markerNameToElements.delete(t));const r=this._elementToMarkerNames.get(e);r&&(r.delete(t),r.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 oe(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new $e(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 r of t)if(r.is("attributeElement"))for(const o of r.getElementsWithSameId())n.add(o);else n.add(r);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 r=0;for(let o=0;o<t;o++)r+=this.getModelLength(e.getChild(o));return r}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,r=0,o=0,a=0;if(e.is("$text"))return new me(e,t);for(;o<t;)n=e.getChild(a),r=this.getModelLength(n),o+=r,a++;return o==t?this._moveViewPositionToTextNode(new me(e,a)):this.findPositionIn(n,t-(o-r))}_moveViewPositionToTextNode(e){const t=e.nodeBefore,n=e.nodeAfter;return t instanceof xt?new me(t,t.data.length):n instanceof xt?new me(n,0):e}}Be(Ya,B);class yc{constructor(){this._consumable=new Map,this._textProxyRegistry=new Map}add(e,t){t=xc(t),e instanceof ri&&(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=xc(t),e instanceof ri&&(e=this._getSymbolForTextProxy(e)),!!this.test(e,t)&&(this._consumable.get(e).set(t,!1),!0)}test(e,t){t=xc(t),e instanceof ri&&(e=this._getSymbolForTextProxy(e));const n=this._consumable.get(e);if(n===void 0)return null;const r=n.get(t);return r===void 0?null:r}revert(e,t){t=xc(t),e instanceof ri&&(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 r=n.get(e.endOffset);r&&(t=r.get(e.parent))}return t||(t=this._addSymbolForTextProxy(e.startOffset,e.endOffset,e.parent)),t}_addSymbolForTextProxy(e,t,n){const r=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,r),r}}function xc(i){const e=i.split(":");return e[0]=="addMarker"||e[0]=="removeMarker"?i:e.length>1?e[0]+":"+e[1]:e[0]}class cu{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 r=this._mapChangesWithAutomaticReconversion(e);for(const o of r)o.type==="insert"?this.convertInsert(oe._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(du))this._convertInsertWithAttributes(n);this._clearConversionApi()}convertRemove(e,t,n,r){this.conversionApi.writer=r,this.fire("remove:"+n,{position:e,length:t},this.conversionApi),this._clearConversionApi()}convertAttribute(e,t,n,r,o){this.conversionApi.writer=o,this.conversionApi.consumable=this._createConsumableForRange(e,"attribute:"+t);for(const a of e){const c={item:a.item,range:oe._createFromPositionAndShift(a.previousPosition,a.length),attributeKey:t,attributeOldValue:n,attributeNewValue:r};this._testAndFire("attribute:"+t,c)}this._clearConversionApi()}reconvertElement(e,t){const n=oe._createOn(e);this.conversionApi.writer=t,this.conversionApi.consumable=this._createInsertConsumable(n);const r=this.conversionApi.mapper,o=r.toViewElement(e);t.remove(o),this._convertInsertWithAttributes({item:e,range:n});const a=r.toViewElement(e);for(const c of oe._createIn(e)){const{item:u}=c,f=wm(u,r);f?f.root!==a.root&&t.move(t.createRangeOn(f),r.toViewPosition(fe._createBefore(u))):this._convertInsertWithAttributes(du(c))}r.unbindViewElement(o),this._clearConversionApi()}convertSelection(e,t,n){const r=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));if(this.conversionApi.writer=n,this.conversionApi.consumable=this._createSelectionConsumable(e,r),this.fire("selection",{selection:e},this.conversionApi),e.isCollapsed){for(const o of r){const a=o.getRange();if(!af(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 r="addMarker:"+e,o=new yc;if(o.add(t,r),this.conversionApi.consumable=o,this.fire(r,{markerName:e,markerRange:t},this.conversionApi),o.test(t,r)){this.conversionApi.consumable=this._createConsumableForRange(t,r);for(const a of t.getItems()){if(!this.conversionApi.consumable.test(a,r))continue;const c={item:a,range:oe._createOn(a),markerName:e,markerRange:t};this.fire(r,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 yc;for(const n of e){const r=n.item;t.add(r,"insert");for(const o of r.getAttributeKeys())t.add(r,"attribute:"+o)}return t}_createConsumableForRange(e,t){const n=new yc;for(const r of e.getItems())n.add(r,t);return n}_createSelectionConsumable(e,t){const n=new yc;n.add(e,"selection");for(const r of t)n.add(e,"addMarker:"+r.name);for(const r of e.getAttributeKeys())n.add(e,"attribute:"+r);return n}_testAndFire(e,t){this.conversionApi.consumable.test(t.item,e)&&this.fire(function(n,r){const o=r.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 r of e.getChanges()){const o=r.position||r.range.start,a=o.parent;if(Vs(o,a)){n.push(r);continue}const c=r.type==="attribute"?Ni(o,a,null):a;if(c.is("$text")){n.push(r);continue}let u;if(u=r.type==="attribute"?`attribute:${r.attributeKey}:${c.name}`:`${r.type}:${r.name}`,this._isReconvertTriggerEvent(u,c.name)){if(t.has(c))continue;t.add(c),n.push({type:"reconvert",element:c})}else n.push(r)}return n}_isReconvertTriggerEvent(e,t){return this._reconversionEventsMapping.get(e)===t}}function af(i,e,t){const n=e.getRange(),r=Array.from(i.getAncestors());return r.shift(),r.reverse(),!r.some(o=>{if(n.containsItem(o))return!!t.toViewElement(o).getCustomProperty("addHighlight")})}function du(i){return{item:i.item,range:oe._createFromPositionAndShift(i.previousPosition,i.length)}}function wm(i,e){if(i.is("textProxy")){const t=e.toViewPosition(fe._createBefore(i)).parent;return t.is("$text")?t:null}return e.toViewElement(i)}Be(cu,B);class Ri{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 r of e._ranges)if(t.isEqual(r)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new oe(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 oe(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 oe(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 Ri)this._setRanges(e.getRanges(),e.isBackward);else if(e&&typeof e.getRanges=="function")this._setRanges(e.getRanges(),e.isBackward);else if(e instanceof oe)this._setRanges([e],!!t&&!!t.backward);else if(e instanceof fe)this._setRanges([new oe(e)]);else if(e instanceof zo){const r=!!n&&!!n.backward;let o;if(t=="in")o=oe._createIn(e);else if(t=="on")o=oe._createOn(e);else{if(t===void 0)throw new y.a("model-selection-setto-required-second-parameter",[this,e]);o=new oe(fe._createAt(e,t))}this._setRanges([o],r)}else{if(!dr(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(r=>{if(!(r instanceof oe))throw new y.a("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every(o=>!o.isEqual(r))});if(e.length!==this._ranges.length||n){this._removeAllRanges();for(const r of e)this._pushRange(r);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=fe._createAt(e,t);if(n.compareWith(this.focus)=="same")return;const r=this.anchor;this._ranges.length&&this._popRange(),n.compareWith(r)=="before"?(this._pushRange(new oe(n,r)),this._lastRangeBackward=!0):(this._pushRange(new oe(r,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=oi(t.start,e);n&&hu(n,t)&&(yield n);for(const o of t.getWalker()){const a=o.item;o.type=="elementEnd"&&mr(a,e,t)&&(yield a)}const r=oi(t.end,e);r&&!t.end.isTouching(fe._createAt(r,0))&&hu(r,t)&&(yield r)}}containsEntireContent(e=this.anchor.root){const t=fe._createAt(e,0),n=fe._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(new oe(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 uu(i,e){return!e.has(i)&&(e.add(i),i.root.document.model.schema.isBlock(i)&&i.parent)}function mr(i,e,t){return uu(i,e)&&hu(i,t)}function oi(i,e){const t=i.parent.root.document.model.schema,n=i.parent.getAncestors({parentFirst:!0,includeSelf:!0});let r=!1;const o=n.find(a=>!r&&(r=t.isLimit(a),!r&&uu(a,e)));return n.forEach(a=>e.add(a)),o}function hu(i,e){const t=function(n){const r=n.root.document.model.schema;let o=n.parent;for(;o;){if(r.isBlock(o))return o;o=o.parent}}(i);return t?!e.containsRange(oe._createOn(t),!0):!0}Be(Ri,B);class Di extends oe{constructor(e,t){super(e,t),Cc.call(this)}detach(){this.stopListening()}is(e){return e==="liveRange"||e==="model:liveRange"||e=="range"||e==="model:range"}toRange(){return new oe(this.start,this.end)}static fromRange(e){return new Di(e.start,e.end)}}function Cc(){this.listenTo(this.root.document.model,"applyOperation",(i,e)=>{const t=e[0];t.isDocumentOperation&&$s.call(this,t)},{priority:"low"})}function $s(i){const e=this.getTransformedByOperation(i),t=oe._createFromRanges(e),n=!t.isEqual(this),r=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,i);let o=null;if(n){t.root.rootName=="$graveyard"&&(o=i.type=="remove"?i.sourcePosition:i.deletionPosition);const a=this.toRange();this.start=t.start,this.end=t.end,this.fire("change:range",a,{deletionPosition:o})}else r&&this.fire("change:content",this.toRange(),{deletionPosition:o})}Be(Di,B);class Wr{constructor(e){this._selection=new lf(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:")}}Be(Wr,B);class lf extends Ri{constructor(e){super(),this.markers=new ur({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 r=n[0];r.isDocumentOperation&&r.type!="marker"&&r.type!="rename"&&r.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,r,o)=>{this._updateMarker(n,o)}),this.listenTo(this._document,"change",(t,n)=>{(function(r,o){const a=r.document.differ;for(const c of a.getChanges()){if(c.type!="insert")continue;const u=c.position.parent;c.length===u.maxOffset&&r.enqueueChange(o,f=>{const b=Array.from(u.getAttributeKeys()).filter(k=>k.startsWith("selection:"));for(const k of b)f.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=Di.fromRange(e);return t.on("change:range",(n,r,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 r of this._model.markers){const o=r.name.split(":",1)[0];if(!this._observedMarkers.has(o))continue;const a=r.getRange();for(const c of this.getRanges())a.containsRange(c,!c.isCollapsed)&&e.push(r)}const n=Array.from(this.markers);for(const r of e)this.markers.has(r)||(this.markers.add(r),t=!0);for(const r of Array.from(this.markers))e.includes(r)||(this.markers.remove(r),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 r=!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),r=!0):!c&&a&&(this.markers.remove(e),r=!0)}else a&&(this.markers.remove(e),r=!0);r&&this.fire("change:marker",{oldMarkers:o,directChange:!1})}_updateAttributes(e){const t=Ar(this._getSurroundingAttributes()),n=Ar(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 r=[];for(const[o,a]of this.getAttributes())n.has(o)&&n.get(o)===a||r.push(o);for(const[o]of n)this.hasAttribute(o)||r.push(o);r.length>0&&this.fire("change:attribute",{attributeKeys:r,directChange:!1})}_setAttribute(e,t,n=!0){const r=n?"normal":"low";return r=="low"&&this._attributePriority.get(e)=="normal"?!1:super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,r),!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,r]of this.getAttributes())e.get(n)!==r&&this._removeAttribute(n,!1);for(const[n,r]of e)this._setAttribute(n,r,!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 r=e.textNode?e.textNode:e.nodeBefore,o=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(n=Tc(r)),n||(n=Tc(o)),!this.isGravityOverridden&&!n){let a=r;for(;a&&!t.isInline(a)&&!n;)a=a.previousSibling,n=Tc(a)}if(!n){let a=o;for(;a&&!t.isInline(a)&&!n;)a=a.nextSibling,n=Tc(a)}n||(n=this._getStoredAttributes())}else{const r=this.getFirstRange();for(const o of r){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 Tc(i){return i instanceof ri||i instanceof Rt?i.getAttributes():null}class fu{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}var ir=function(i){return Xo(i,5)};class Qa extends fu{elementToElement(e){return this.add(function(t){return(t=ir(t)).view=Ja(t.view,"container"),n=>{var r;if(n.on("insert:"+t.model,(r=t.view,(o,a,c)=>{const u=r(a.item,c);if(!u||!c.consumable.consume(a.item,"insert"))return;const f=c.mapper.toViewPosition(a.range.start);c.mapper.bindElements(a.item,u),c.writer.insert(f,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=ir(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]=Ja(t.view[o],"attribute");else t.view=Ja(t.view,"attribute");const r=Xa(t);return o=>{o.on(n,function(a){return(c,u,f)=>{const b=a(u.attributeOldValue,f),k=a(u.attributeNewValue,f);if(!b&&!k||!f.consumable.consume(u.item,c.name))return;const T=f.writer,S=T.document.selection;if(u.item instanceof Ri||u.item instanceof Wr)T.wrap(S.getFirstRange(),k);else{let O=f.mapper.toViewRange(u.range);u.attributeOldValue!==null&&b&&(O=T.unwrap(O,b)),u.attributeNewValue!==null&&k&&T.wrap(O,k)}}}(r),{priority:t.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(t){t=ir(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]=gu(t.view[o]);else t.view=gu(t.view);const r=Xa(t);return o=>{var a;o.on(n,(a=r,(c,u,f)=>{const b=a(u.attributeOldValue,f),k=a(u.attributeNewValue,f);if(!b&&!k||!f.consumable.consume(u.item,c.name))return;const T=f.mapper.toViewElement(u.item),S=f.writer;if(!T)throw new y.a("conversion-attribute-to-attribute-on-text",[u,f]);if(u.attributeOldValue!==null&&b)if(b.key=="class"){const O=Pt(b.value);for(const D of O)S.removeClass(D,T)}else if(b.key=="style"){const O=Object.keys(b.value);for(const D of O)S.removeStyle(D,T)}else S.removeAttribute(b.key,T);if(u.attributeNewValue!==null&&k)if(k.key=="class"){const O=Pt(k.value);for(const D of O)S.addClass(D,T)}else if(k.key=="style"){const O=Object.keys(k.value);for(const D of O)S.setStyle(D,k.value[D],T)}else S.setAttribute(k.key,k.value,T)}),{priority:t.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(t){return(t=ir(t)).view=Ja(t.view,"ui"),n=>{var r;n.on("addMarker:"+t.model,(r=t.view,(o,a,c)=>{a.isOpening=!0;const u=r(a,c);a.isOpening=!1;const f=r(a,c);if(!u||!f)return;const b=a.markerRange;if(b.isCollapsed&&!c.consumable.consume(b,o.name))return;for(const S of b)if(!c.consumable.consume(S.item,o.name))return;const k=c.mapper,T=c.writer;T.insert(k.toViewPosition(b.start),u),c.mapper.bindElementToMarker(u,a.markerName),b.isCollapsed||(T.insert(k.toViewPosition(b.end),f),c.mapper.bindElementToMarker(f,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 f of u)c.mapper.unbindElementFromMarkerName(f,a.markerName),c.writer.clear(c.writer.createRangeOn(f),f);c.writer.clearClonedElementsGroup(a.markerName),o.stop()}}),{priority:t.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(t){return n=>{var r;n.on("addMarker:"+t.model,(r=t.view,(o,a,c)=>{if(!a.item||!(a.item instanceof Ri||a.item instanceof Wr||a.item.is("$textProxy")))return;const u=Hs(r,a,c);if(!u||!c.consumable.consume(a.item,o.name))return;const f=c.writer,b=cf(f,u),k=f.document.selection;if(a.item instanceof Ri||a.item instanceof Wr)f.wrap(k.getFirstRange(),b,k);else{const T=c.mapper.toViewRange(a.range),S=f.wrap(T,b);for(const O of S.getItems())if(O.is("attributeElement")&&O.isSimilar(b)){c.mapper.bindElementToMarker(O,a.markerName);break}}}),{priority:t.converterPriority||"normal"}),n.on("addMarker:"+t.model,function(o){return(a,c,u)=>{if(!c.item||!(c.item instanceof Dt))return;const f=Hs(o,c,u);if(!f||!u.consumable.test(c.item,a.name))return;const b=u.mapper.toViewElement(c.item);if(b&&b.getCustomProperty("addHighlight")){u.consumable.consume(c.item,a.name);for(const k of oe._createIn(c.item))u.consumable.consume(k.item,a.name);b.getCustomProperty("addHighlight")(b,f,u.writer),u.mapper.bindElementToMarker(b,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 f=Hs(o,c,u);if(!f)return;const b=cf(u.writer,f),k=u.mapper.markerNameToElements(c.markerName);if(k){for(const T of k)u.mapper.unbindElementFromMarkerName(T,c.markerName),T.is("attributeElement")?u.writer.unwrap(u.writer.createRangeOn(T),b):T.getCustomProperty("removeHighlight")(T,f.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=ir(t)).model;return t.view||(t.view=r=>({group:n,name:r.substr(t.model.length+1)})),r=>{var o;r.on("addMarker:"+n,(o=t.view,(a,c,u)=>{const f=o(c.markerName,u);if(!f)return;const b=c.markerRange;u.consumable.consume(b,a.name)&&(pu(b,!1,u,c,f),pu(b,!0,u,c,f),a.stop())}),{priority:t.converterPriority||"normal"}),r.on("removeMarker:"+n,function(a){return(c,u,f)=>{const b=a(u.markerName,f);if(!b)return;const k=f.mapper.markerNameToElements(u.markerName);if(k){for(const S of k)f.mapper.unbindElementFromMarkerName(S,u.markerName),S.is("containerElement")?(T(`data-${b.group}-start-before`,S),T(`data-${b.group}-start-after`,S),T(`data-${b.group}-end-before`,S),T(`data-${b.group}-end-after`,S)):f.writer.clear(f.writer.createRangeOn(S),S);f.writer.clearClonedElementsGroup(u.markerName),c.stop()}function T(S,O){if(O.hasAttribute(S)){const D=new Set(O.getAttribute(S).split(","));D.delete(b.name),D.size==0?f.writer.removeAttribute(S,O):f.writer.setAttribute(S,Array.from(D).join(","),O)}}}}(t.view),{priority:t.converterPriority||"normal"})}}(e))}}function cf(i,e){const t=i.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 pu(i,e,t,n,r){const o=e?i.start:i.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,f;e&&a||!e&&!c?(u=a,f=!0):(u=c,f=!1);const b=t.mapper.toViewElement(u);if(b)return void function(k,T,S,O,D,L){const W=`data-${L.group}-${T?"start":"end"}-${S?"before":"after"}`,J=k.hasAttribute(W)?k.getAttribute(W).split(","):[];J.unshift(L.name),O.writer.setAttribute(W,J.join(","),k),O.mapper.bindElementToMarker(k,D.markerName)}(b,e,f,t,n,r)}(function(u,f,b,k,T){const S=`${T.group}-${f?"start":"end"}`,O=T.name?{name:T.name}:null,D=b.writer.createUIElement(S,O);b.writer.insert(u,D),b.mapper.bindElementToMarker(D,k.markerName)})(t.mapper.toViewPosition(o),e,t,n,r)}function Ja(i,e){return typeof i=="function"?i:(t,n)=>function(r,o,a){typeof r=="string"&&(r={name:r});let c;const u=o.writer,f=Object.assign({},r.attributes);if(a=="container")c=u.createContainerElement(r.name,f);else if(a=="attribute"){const b={priority:r.priority||Ai.DEFAULT_PRIORITY};c=u.createAttributeElement(r.name,f,b)}else c=u.createUIElement(r.name,f);if(r.styles){const b=Object.keys(r.styles);for(const k of b)u.setStyle(k,r.styles[k],c)}if(r.classes){const b=r.classes;if(typeof b=="string")u.addClass(b,c);else for(const k of b)u.addClass(k,c)}return c}(i,n,e)}function Xa(i){return i.model.values?(e,t)=>{const n=i.view[e];return n?n(e,t):null}:i.view}function gu(i){return typeof i=="string"?e=>({key:i,value:e}):typeof i=="object"?i.value?()=>i:e=>({key:i.key,value:e}):i}function Hs(i,e,t){const n=typeof i=="function"?i(e,t):i;return n?(n.priority||(n.priority=10),n.id||(n.id=e.markerName),n):null}function Sc(i){const{schema:e,document:t}=i.model;for(const n of t.getRootNames()){const r=t.getRoot(n);if(r.isEmpty&&!e.checkChild(r,"$text")&&e.checkChild(r,"paragraph"))return i.insertElement("paragraph",r),!0}return!1}function Za(i,e,t){const n=t.createContext(i);return!!t.checkChild(n,"paragraph")&&!!t.checkChild(n.push("paragraph"),e)}function df(i,e){const t=e.createElement("paragraph");return e.insert(t,i),e.createPositionAt(t,0)}class uf extends fu{elementToElement(e){return this.add(el(e))}elementToAttribute(e){return this.add(function(t){hf(t=ir(t));const n=mu(t,!1),r=Ac(t.view),o=r?"element:"+r:"element";return a=>{a.on(o,n,{priority:t.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(t){t=ir(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)),hf(t,n);const r=mu(t,!0);return o=>{o.on("element",r,{priority:t.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add(function(t){return function(n){const r=n.model;n.model=(o,a)=>{const c=typeof r=="string"?r:r(o,a);return a.writer.createElement("$marker",{"data-name":c})}}(t=ir(t)),el(t)}(e))}dataToMarker(e){return this.add(function(t){(t=ir(t)).model||(t.model=o=>o?t.view+":"+o:t.view);const n=tl(ji(t,"start")),r=tl(ji(t,"end"));return o=>{o.on("element:"+t.view+"-start",n,{priority:t.converterPriority||"normal"}),o.on("element:"+t.view+"-end",r,{priority:t.converterPriority||"normal"});const a=F.get("low"),c=F.get("highest"),u=F.get(t.converterPriority)/c;o.on("element",function(f){return(b,k,T)=>{const S="data-"+f.view;function O(D,L){for(const W of L){const J=f.model(W,T),de=T.writer.createElement("$marker",{"data-name":J});T.writer.insert(de,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]}}(T.consumable.test(k.viewItem,{attributes:S+"-end-after"})||T.consumable.test(k.viewItem,{attributes:S+"-start-after"})||T.consumable.test(k.viewItem,{attributes:S+"-end-before"})||T.consumable.test(k.viewItem,{attributes:S+"-start-before"}))&&(k.modelRange||Object.assign(k,T.convertChildren(k.viewItem,k.modelCursor)),T.consumable.consume(k.viewItem,{attributes:S+"-end-after"})&&O(k.modelRange.end,k.viewItem.getAttribute(S+"-end-after").split(",")),T.consumable.consume(k.viewItem,{attributes:S+"-start-after"})&&O(k.modelRange.end,k.viewItem.getAttribute(S+"-start-after").split(",")),T.consumable.consume(k.viewItem,{attributes:S+"-end-before"})&&O(k.modelRange.start,k.viewItem.getAttribute(S+"-end-before").split(",")),T.consumable.consume(k.viewItem,{attributes:S+"-start-before"})&&O(k.modelRange.start,k.viewItem.getAttribute(S+"-start-before").split(",")))}}(t),{priority:a+u})}}(e))}}function el(i){const e=tl(i=ir(i)),t=Ac(i.view),n=t?"element:"+t:"element";return r=>{r.on(n,e,{priority:i.converterPriority||"normal"})}}function Ac(i){return typeof i=="string"?i:typeof i=="object"&&typeof i.name=="string"?i.name:null}function tl(i){const e=new Hr(i.view);return(t,n,r)=>{const o=e.match(n.viewItem);if(!o)return;const a=o.match;if(a.name=!0,!r.consumable.test(n.viewItem,a))return;const c=function(u,f,b){return u instanceof Function?u(f,b):b.writer.createElement(u)}(i.model,n.viewItem,r);c&&r.safeInsert(c,n.modelCursor)&&(r.consumable.consume(n.viewItem,a),r.convertChildren(n.viewItem,c),r.updateConversionResult(c,n))}}function hf(i,e=null){const t=e===null||(o=>o.getAttribute(e)),n=typeof i.model!="object"?i.model:i.model.key,r=typeof i.model!="object"||i.model.value===void 0?t:i.model.value;i.model={key:n,value:r}}function mu(i,e){const t=new Hr(i.view);return(n,r,o)=>{const a=t.match(r.viewItem);if(!a||(function(f,b){const k=typeof f=="function"?f(b):f;return typeof k=="object"&&!Ac(k)?!1:!k.classes&&!k.attributes&&!k.styles}(i.view,r.viewItem)?a.match.name=!0:delete a.match.name,!o.consumable.test(r.viewItem,a.match)))return;const c=i.model.key,u=typeof i.model.value=="function"?i.model.value(r.viewItem,o):i.model.value;u!==null&&(r.modelRange||Object.assign(r,o.convertChildren(r.viewItem,r.modelCursor)),function(f,b,k,T){let S=!1;for(const O of Array.from(f.getItems({shallow:k})))T.schema.checkAttribute(O,b.key)&&(S=!0,O.hasAttribute(b.key)||T.writer.setAttribute(b.key,b.value,O));return S}(r.modelRange,{key:c,value:u},e,o)&&o.consumable.consume(r.viewItem,a.match))}}function ji(i,e){const t={};return t.view=i.view+"-"+e,t.model=(n,r)=>{const o=n.getAttribute("name"),a=i.model(o,r);return r.writer.createElement("$marker",{"data-name":a})},t}class bu{constructor(e,t){this.model=e,this.view=new kc(t),this.mapper=new Ya,this.downcastDispatcher=new cu({mapper:this.mapper,schema:e.schema});const n=this.model.document,r=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(r,o,a)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(a,c){return(u,f)=>{const b=f.newSelection,k=[];for(const S of b.getRanges())k.push(c.toModelRange(S));const T=a.createSelection(k,{backward:b.isBackward});T.isEqual(a.document.selection)||a.change(S=>{S.setSelection(T)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(a,c,u)=>{if(!u.consumable.consume(c.item,"insert"))return;const f=u.writer,b=u.mapper.toViewPosition(c.range.start),k=f.createText(c.item.data);f.insert(b,k)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(a,c,u)=>{const f=u.mapper.toViewPosition(c.position),b=c.position.getShiftedBy(c.length),k=u.mapper.toViewPosition(b,{isPhantom:!0}),T=u.writer.createRange(f,k),S=u.writer.remove(T.getTrimmed());for(const O of u.writer.createRangeIn(S).getItems())u.mapper.unbindViewElement(O)},{priority:"low"}),this.downcastDispatcher.on("selection",(a,c,u)=>{const f=u.writer,b=f.document.selection;for(const k of b.getRanges())k.isCollapsed&&k.end.parent.isAttached()&&u.writer.mergeAttributes(k.start);f.setSelection(null)},{priority:"high"}),this.downcastDispatcher.on("selection",(a,c,u)=>{const f=c.selection;if(f.isCollapsed||!u.consumable.consume(f,"selection"))return;const b=[];for(const k of f.getRanges()){const T=u.mapper.toViewRange(k);b.push(T)}u.writer.setSelection(b,{backward:f.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(a,c,u)=>{const f=c.selection;if(!f.isCollapsed||!u.consumable.consume(f,"selection"))return;const b=u.writer,k=f.getFirstPosition(),T=u.mapper.toViewPosition(k),S=b.breakAttributes(T);b.setSelection(S)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(a=>{if(a.rootName=="$graveyard")return null;const c=new Oo(this.view.document,a.name);return c.rootName=a.rootName,this.mapper.bindElements(a,c),c})}destroy(){this.view.destroy(),this.stopListening()}}Be(bu,Gt);class ff{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 nl{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 pf(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 r=e.getClassNames();for(const a of r)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 nl(e)),e.is("$text"))return t.add(e),t;e.is("element")&&t.add(e,nl.consumablesFromElement(e)),e.is("documentFragment")&&t.add(e);for(const n of e.getChildren())t=nl.createFrom(n,t);return t}}class pf{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=vt(t)?t:[t],r=this._consumables[e];for(const o of n){if(e==="attributes"&&(o==="class"||o==="style"))throw new y.a("viewconsumable-invalid-attribute",this);if(r.set(o,!0),e==="styles")for(const a of this.element.document.stylesProcessor.getRelatedStyles(o))r.set(a,!0)}}_test(e,t){const n=vt(t)?t:[t],r=this._consumables[e];for(const o of n)if(e!=="attributes"||o!=="class"&&o!=="style"){const a=r.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=vt(t)?t:[t],r=this._consumables[e];for(const o of n)if(e!=="attributes"||o!=="class"&&o!=="style"){if(r.set(o,!1),e=="styles")for(const a of this.element.document.stylesProcessor.getRelatedStyles(o))r.set(a,!1)}else{const a=o=="class"?"classes":"styles";this._consume(a,[...this._consumables[a].keys()])}}_revert(e,t){const n=vt(t)?t:[t],r=this._consumables[e];for(const o of n)if(e!=="attributes"||o!=="class"&&o!=="style")r.get(o)===!1&&r.set(o,!0);else{const a=o=="class"?"classes":"styles";this._revert(a,[...this._consumables[a].keys()])}}}class gf{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(e,t)=>{t[0]=new cs(t[0])},{priority:"highest"}),this.on("checkChild",(e,t)=>{t[0]=new cs(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 fe){const n=e.nodeBefore,r=e.nodeAfter;if(!(n instanceof Dt))throw new y.a("schema-check-merge-no-element-before",this);if(!(r instanceof Dt))throw new y.a("schema-check-merge-no-element-after",this);return this.checkMerge(n,r)}for(const n of t.getChildren())if(!this.checkChild(e,n))return!1;return!0}addChildCheck(e){this.on("checkChild",(t,[n,r])=>{if(!r)return;const o=e(n,r);typeof o=="boolean"&&(t.stop(),t.return=o)},{priority:"high"})}addAttributeCheck(e){this.on("checkAttribute",(t,[n,r])=>{const o=e(n,r);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 fe?t=e.parent:t=(e instanceof oe?[e]:Array.from(e.getRanges())).reduce((n,r)=>{const o=r.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 Rt("",e.getAttributes())];return this.checkAttribute(n,t)}{const n=e.getRanges();for(const r of n)for(const o of r)if(this.checkAttribute(o.item,t))return!0}return!1}*getValidRanges(e,t){e=function*(n){for(const r of n)yield*r.getMinimalFlatRanges()}(e);for(const n of e)yield*this._getValidRangesForRange(n,t)}getNearestSelectionRange(e,t="both"){if(this.checkChild(e,"$text"))return new oe(e);let n,r;const o=e.getAncestors().reverse().find(a=>this.isLimit(a))||e.root;t!="both"&&t!="backward"||(n=new ii({boundaries:oe._createIn(o),startPosition:e,direction:"backward"})),t!="both"&&t!="forward"||(r=new ii({boundaries:oe._createIn(o),startPosition:e}));for(const a of function*(c,u){let f=!1;for(;!f;){if(f=!0,c){const b=c.next();b.done||(f=!1,yield{walker:c,value:b.value})}if(u){const b=u.next();b.done||(f=!1,yield{walker:u,value:b.value})}}}(n,r)){const c=a.walker==n?"elementEnd":"elementStart",u=a.value;if(u.type==c&&this.isObject(u.item))return oe._createOn(u.item);if(this.checkChild(u.nextPosition,"$text"))return new oe(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"))xu(this,n,t);else{const r=oe._createIn(n).getPositions();for(const o of r)xu(this,o.nodeBefore||o.parent,t)}}createContext(e){return new cs(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,n=Object.keys(t);for(const r of n)e[r]=ao(t[r],r);for(const r of n)vu(e,r);for(const r of n)_u(e,r);for(const r of n)wu(e,r);for(const r of n)Ec(e,r),Us(e,r);for(const r of n)Ue(e,r),Pc(e,r),ku(e,r);this._compiledDefinitions=e}_checkContextMatch(e,t,n=t.length-1){const r=t.getItem(n);if(e.allowIn.includes(r.name)){if(n==0)return!0;{const o=this.getDefinition(r);return this._checkContextMatch(o,t,n-1)}}return!1}*_getValidRangesForRange(e,t){let n=e.start,r=e.start;for(const o of e.getItems({shallow:!0}))o.is("element")&&(yield*this._getValidRangesForRange(oe._createIn(o),t)),this.checkAttribute(o,t)||(n.isEqual(r)||(yield new oe(n,r)),n=fe._createAfter(o)),r=fe._createAfter(o);n.isEqual(r)||(yield new oe(n,r))}}Be(gf,Gt);class cs{constructor(e){if(e instanceof cs)return e;typeof e=="string"?e=[e]:Array.isArray(e)||(e=e.getAncestors({includeSelf:!0})),this._items=e.map(yu)}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 cs([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 ao(i,e){const t={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(n,r){for(const o of n){const a=Object.keys(o).filter(c=>c.startsWith("is"));for(const c of a)r[c]=o[c]}}(i,t),Or(i,t,"allowIn"),Or(i,t,"allowContentOf"),Or(i,t,"allowWhere"),Or(i,t,"allowAttributes"),Or(i,t,"allowAttributesOf"),Or(i,t,"allowChildren"),Or(i,t,"inheritTypesFrom"),function(n,r){for(const o of n){const a=o.inheritAllFrom;a&&(r.allowContentOf.push(a),r.allowWhere.push(a),r.allowAttributesOf.push(a),r.inheritTypesFrom.push(a))}}(i,t),t}function vu(i,e){const t=i[e];for(const n of t.allowChildren){const r=i[n];r&&r.allowIn.push(e)}t.allowChildren.length=0}function _u(i,e){for(const t of i[e].allowContentOf)i[t]&&km(i,t).forEach(n=>{n.allowIn.push(e)});delete i[e].allowContentOf}function wu(i,e){for(const t of i[e].allowWhere){const n=i[t];if(n){const r=n.allowIn;i[e].allowIn.push(...r)}}delete i[e].allowWhere}function Ec(i,e){for(const t of i[e].allowAttributesOf){const n=i[t];if(n){const r=n.allowAttributes;i[e].allowAttributes.push(...r)}}delete i[e].allowAttributesOf}function Us(i,e){const t=i[e];for(const n of t.inheritTypesFrom){const r=i[n];if(r){const o=Object.keys(r).filter(a=>a.startsWith("is"));for(const a of o)a in t||(t[a]=r[a])}}delete t.inheritTypesFrom}function Ue(i,e){const t=i[e],n=t.allowIn.filter(r=>i[r]);t.allowIn=Array.from(new Set(n))}function Pc(i,e){const t=i[e];for(const n of t.allowIn)i[n].allowChildren.push(e)}function ku(i,e){const t=i[e];t.allowAttributes=Array.from(new Set(t.allowAttributes))}function Or(i,e,t){for(const n of i)typeof n[t]=="string"?e[t].push(n[t]):Array.isArray(n[t])&&e[t].push(...n[t])}function km(i,e){const t=i[e];return(n=i,Object.keys(n).map(r=>n[r])).filter(r=>r.allowIn.includes(t.name));var n}function yu(i){return typeof i=="string"||i.is("documentFragment")?{name:typeof i=="string"?i:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:i.is("element")?i.name:"$text",*getAttributeKeys(){yield*i.getAttributeKeys()},getAttribute:e=>i.getAttribute(e)}}function xu(i,e,t){for(const n of e.getAttributeKeys())i.checkAttribute(e,n)||t.removeAttribute(n,e)}class Nn{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 f of new cs(a)){const b={};for(const T of f.getAttributeKeys())b[T]=f.getAttribute(T);const k=c.createElement(f.name,b);u&&c.append(k,u),u=fe._createAt(k,0)}return u}(n,t),this.conversionApi.writer=t,this.conversionApi.consumable=nl.createFrom(e),this.conversionApi.store={};const{modelRange:r}=this._convertItem(e,this._modelCursor),o=t.createDocumentFragment();if(r){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,f=new Map,b=oe._createIn(a).getItems();for(const k of b)k.name=="$marker"&&u.add(k);for(const k of u){const T=k.getAttribute("data-name"),S=c.createPositionBefore(k);f.has(T)?f.get(T).end=S.clone():f.set(T,new oe(S.clone())),c.remove(k)}return f}(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 oe))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:fe._createAt(t,0);const r=new oe(n);for(const o of Array.from(e.getChildren())){const a=this._convertItem(o,n);a.modelRange instanceof oe&&(r.end=a.modelRange.end,n=a.modelCursor)}return{modelRange:r,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),r=this.conversionApi.writer;t.modelRange||(t.modelRange=r.createRange(r.createPositionBefore(e),r.createPositionAfter(n[n.length-1])));const o=this._cursorParents.get(e);t.modelCursor=o?r.createPositionAt(o,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:n,writer:r}=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 Za(t,e,n)?{position:df(t,r)}:null;const a=this.conversionApi.writer.split(t,o),c=[];for(const f of a.range.getWalker())if(f.type=="elementEnd")c.push(f.item);else{const b=c.pop(),k=f.item;this._registerSplitPair(b,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()}}Be(Nn,B);class ym{getHtml(e){const t=document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}}class xm{constructor(e){this._domParser=new DOMParser,this._domConverter=new Ii(e,{blockFillerMode:"nbsp"}),this._htmlWriter=new ym}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 r=t.firstChild;for(;!r.isSameNode(t.documentElement);){const a=r;r=r.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 Cu{constructor(e,t){this.model=e,this.mapper=new Ya,this.downcastDispatcher=new cu({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",(n,r,o)=>{if(!o.consumable.consume(r.item,"insert"))return;const a=o.writer,c=o.mapper.toViewPosition(r.range.start),u=a.createText(r.item.data);a.insert(c,u)},{priority:"lowest"}),this.upcastDispatcher=new Nn({schema:e.schema}),this.viewDocument=new eo(t),this.stylesProcessor=t,this.htmlProcessor=new xm(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new Rh(this.viewDocument),this.upcastDispatcher.on("text",(n,r,{schema:o,consumable:a,writer:c})=>{let u=r.modelCursor;if(!a.test(r.viewItem))return;if(!o.checkChild(u,"$text")){if(!Za(u,"$text",o))return;u=df(u,c)}a.consume(r.viewItem);const f=c.createText(r.viewItem.data);c.insert(f,u),r.modelRange=c.createRange(u,u.getShiftedBy(f.offsetSize)),r.modelCursor=r.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(n,r,o)=>{if(!r.modelRange&&o.consumable.consume(r.viewItem,{name:!0})){const{modelRange:a,modelCursor:c}=o.convertChildren(r.viewItem,r.modelCursor);r.modelRange=a,r.modelCursor=c}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(n,r,o)=>{if(!r.modelRange&&o.consumable.consume(r.viewItem,{name:!0})){const{modelRange:a,modelCursor:c}=o.convertChildren(r.viewItem,r.modelCursor);r.modelRange=a,r.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",Sc)},{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 r=this.model.document.getRoot(t);return n!=="empty"||this.model.hasContent(r,{ignoreWhitespaces:!0})?this.stringify(r,e):""}stringify(e,t={}){const n=this.toView(e,t);return this.processor.toData(n)}toView(e,t={}){const n=this.viewDocument,r=this._viewWriter;this.mapper.clearBindings();const o=oe._createIn(e),a=new is(n);this.mapper.bindElements(e,a),this.downcastDispatcher.conversionApi.options=t,this.downcastDispatcher.convertInsert(o,r);const c=e.is("documentFragment")?Array.from(e.markers):function(u){const f=[],b=u.root.document;if(!b)return[];const k=oe._createIn(u);for(const T of b.model.markers){const S=T.getRange(),O=S.isCollapsed,D=S.start.isEqual(k.start)||S.end.isEqual(k.end);if(O&&D)f.push([T.name,S]);else{const L=k.getIntersection(S);L&&f.push([T.name,L])}}return f}(e);for(const[u,f]of c)this.downcastDispatcher.convertMarkerAdd(u,f,r);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 r of Object.keys(t)){const o=this.model.document.getRoot(r);n.insert(this.parse(t[r],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 r=t.batchType||"default";this.model.enqueueChange(r,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}}Be(Cu,Gt);class Cm{constructor(e,t){this._helpers=new Map,this._downcast=Pt(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Pt(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 Ic(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 Ic(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 Ic(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 r=n?new Qa(t):new uf(t);this._helpers.set(e,r)}}function*Ic(i){if(i.model.values)for(const e of i.model.values){const t={key:i.model.key,value:e},n=i.view[e],r=i.upcastAlso?i.upcastAlso[e]:void 0;yield*mf(t,n,r)}else yield*mf(i.model,i.view,i.upcastAlso)}function*mf(i,e,t){if(yield{model:i,view:e},t)for(const n of Pt(t))yield{model:i,view:n}}class Mc{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 qr{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 Rn{constructor(e){this.markers=new Map,this._children=new Fo,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(Dt.fromJSON(n)):t.push(Rt.fromJSON(n));return new Rn(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(r){return typeof r=="string"?[new Rt(r)]:(dr(r)||(r=[r]),Array.from(r).map(o=>typeof o=="string"?new Rt(o):o instanceof ri?new Rt(o.data,o.getAttributes()):o))}(t);for(const r of n)r.parent!==null&&r._remove(),r.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const r of n)r.parent=null;return n}}function Dn(i,e){const t=(e=Nc(e)).reduce((o,a)=>o+a.offsetSize,0),n=i.parent;ol(i);const r=i.index;return n._insertChild(r,e),il(n,r+e.length),il(n,r),new oe(i,i.getShiftedBy(t))}function Oc(i){if(!i.isFlat)throw new y.a("operation-utils-remove-range-not-flat",this);const e=i.start.parent;ol(i.start),ol(i.end);const t=e._removeChildren(i.start.index,i.end.index-i.start.index);return il(e,i.start.index),t}function rl(i,e){if(!i.isFlat)throw new y.a("operation-utils-move-range-not-flat",this);const t=Oc(i);return Dn(e=e._getTransformedByDeletion(i.start,i.end.offset-i.start.offset),t)}function Nc(i){const e=[];i instanceof Array||(i=[i]);for(let t=0;t<i.length;t++)if(typeof i[t]=="string")e.push(new Rt(i[t]));else if(i[t]instanceof ri)e.push(new Rt(i[t].data,i[t].getAttributes()));else if(i[t]instanceof Rn||i[t]instanceof Fo)for(const n of i[t])e.push(n);else i[t]instanceof zo&&e.push(i[t]);for(let t=1;t<e.length;t++){const n=e[t],r=e[t-1];n instanceof Rt&&r instanceof Rt&&Ws(n,r)&&(e.splice(t-1,2,new Rt(r.data+n.data,r.getAttributes())),t--)}return e}function il(i,e){const t=i.getChild(e-1),n=i.getChild(e);if(t&&n&&t.is("$text")&&n.is("$text")&&Ws(t,n)){const r=new Rt(t.data+n.data,t.getAttributes());i._removeChildren(e-1,2),i._insertChild(e-1,r)}}function ol(i){const e=i.textNode,t=i.parent;if(e){const n=i.offset-e.startOffset,r=e.index;t._removeChildren(r,1);const o=new Rt(e.data.substr(0,n),e.getAttributes()),a=new Rt(e.data.substr(n),e.getAttributes());t._insertChild(r,[o,a])}}function Ws(i,e){const t=i.getAttributes(),n=e.getAttributes();for(const r of t){if(r[1]!==e.getAttribute(r[0]))return!1;n.next()}return n.next().done}var Tu=function(i,e){return Yh(i,e)};class cn extends qr{constructor(e,t,n,r,o){super(o),this.range=e.clone(),this.key=t,this.oldValue=n===void 0?null:n,this.newValue=r===void 0?null:r}get type(){return this.oldValue===null?"addAttribute":this.newValue===null?"removeAttribute":"changeAttribute"}clone(){return new cn(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new cn(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&&!Tu(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(){Tu(this.oldValue,this.newValue)||function(e,t,n){ol(e.start),ol(e.end);for(const r of e.getItems({shallow:!0})){const o=r.is("$textProxy")?r.textNode:r;n!==null?o._setAttribute(t,n):o._removeAttribute(t),il(o.parent,o.index)}il(e.end.parent,e.end.index)}(this.range,this.key,this.newValue)}static get className(){return"AttributeOperation"}static fromJSON(e,t){return new cn(oe.fromJSON(e.range,t),e.key,e.oldValue,e.newValue,e.baseVersion)}}class Tm extends qr{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(){Oc(oe._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class Bt extends qr{constructor(e,t,n,r){super(r),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,r=this.targetPosition.offset;if(n+this.howMany>e.maxOffset)throw new y.a("move-operation-nodes-do-not-exist",this);if(e===t&&n<r&&r<n+this.howMany)throw new y.a("move-operation-range-into-itself",this);if(this.sourcePosition.root==this.targetPosition.root&&Sn(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(){rl(oe._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=fe.fromJSON(e.sourcePosition,t),r=fe.fromJSON(e.targetPosition,t);return new this(n,e.howMany,r,e.baseVersion)}}class En extends qr{constructor(e,t,n){super(n),this.position=e.clone(),this.position.stickiness="toNone",this.nodes=new Fo(Nc(t)),this.shouldReceiveAttributes=!1}get type(){return"insert"}get howMany(){return this.nodes.maxOffset}clone(){const e=new Fo([...this.nodes].map(n=>n._clone(!0))),t=new En(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new fe(e,[0]);return new Bt(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 Fo([...e].map(t=>t._clone(!0))),Dn(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(Dt.fromJSON(o)):n.push(Rt.fromJSON(o));const r=new En(fe.fromJSON(e.position,t),n,e.baseVersion);return r.shouldReceiveAttributes=e.shouldReceiveAttributes,r}}class br extends qr{constructor(e,t,n,r,o,a){super(a),this.name=e,this.oldRange=t?t.clone():null,this.newRange=n?n.clone():null,this.affectsData=o,this._markers=r}get type(){return"marker"}clone(){return new br(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new br(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 br(e.name,e.oldRange?oe.fromJSON(e.oldRange,t):null,e.newRange?oe.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}class or extends qr{constructor(e,t,n,r){super(r),this.position=e,this.position.stickiness="toNext",this.oldName=t,this.newName=n}get type(){return"rename"}clone(){return new or(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new or(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof Dt))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 or(fe.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class Li extends qr{constructor(e,t,n,r,o){super(o),this.root=e,this.key=t,this.oldValue=n,this.newValue=r}get type(){return this.oldValue===null?"addRootAttribute":this.newValue===null?"removeRootAttribute":"changeRootAttribute"}clone(){return new Li(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Li(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 Li(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class vn extends qr{constructor(e,t,n,r,o){super(o),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=t,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=r.clone()}get type(){return"merge"}get deletionPosition(){return new fe(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new oe(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 fe(this.sourcePosition.root,t)._getTransformedByMergeOperation(this);return new Wt(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;rl(oe._createIn(e),this.targetPosition),rl(oe._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=fe.fromJSON(e.sourcePosition,t),r=fe.fromJSON(e.targetPosition,t),o=fe.fromJSON(e.graveyardPosition,t);return new this(n,e.howMany,r,o,e.baseVersion)}}class Wt extends qr{constructor(e,t,n,r,o){super(o),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=n,this.graveyardPosition=r?r.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 fe(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new oe(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 fe(e,[0]);return new vn(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)rl(oe._createFromPositionAndShift(this.graveyardPosition,1),this.insertionPosition);else{const t=e._clone();Dn(this.insertionPosition,t)}rl(new oe(fe._createAt(e,this.splitPosition.offset),fe._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 fe(e.root,t,"toPrevious")}static fromJSON(e,t){const n=fe.fromJSON(e.splitPosition,t),r=fe.fromJSON(e.insertionPosition,t),o=e.graveyardPosition?fe.fromJSON(e.graveyardPosition,t):null;return new this(n,e.howMany,r,o,e.baseVersion)}}class Rc extends Dt{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 sl{constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new Rt(e,t)}createElement(e,t){return new Dt(e,t)}createDocumentFragment(){return new Rn}cloneElement(e,t=!0){return e._clone(t)}insert(e,t,n=0){if(this._assertWriterUsedCorrectly(),e instanceof Rt&&e.data=="")return;const r=fe._createAt(t,n);if(e.parent){if(Au(e.root,r.root))return void this.move(oe._createOn(e),r);if(e.root.document)throw new y.a("model-writer-insert-forbidden-move",this);this.remove(e)}const o=r.root.document?r.root.document.version:null,a=new En(r,e,o);if(e instanceof Rt&&(a.shouldReceiveAttributes=!0),this.batch.addOperation(a),this.model.applyOperation(a),e instanceof Rn)for(const[c,u]of e.markers){const f=fe._createAt(u.root,0),b={range:new oe(u.start._getCombined(f,r),u.end._getCombined(f,r)),usingOperation:!0,affectsData:!0};this.model.markers.has(c)?this.updateMarker(c,b):this.addMarker(c,b)}}insertText(e,t,n,r){t instanceof Rn||t instanceof Dt||t instanceof fe?this.insert(this.createText(e),t,n):this.insert(this.createText(e,t),n,r)}insertElement(e,t,n,r){t instanceof Rn||t instanceof Dt||t instanceof fe?this.insert(this.createElement(e),t,n):this.insert(this.createElement(e,t),n,r)}append(e,t){this.insert(e,t,"end")}appendText(e,t,n){t instanceof Rn||t instanceof Dt?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),n,"end")}appendElement(e,t,n){t instanceof Rn||t instanceof Dt?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),n,"end")}setAttribute(e,t,n){if(this._assertWriterUsedCorrectly(),n instanceof oe){const r=n.getMinimalFlatRanges();for(const o of r)Dc(this,e,t,o)}else Su(this,e,t,n)}setAttributes(e,t){for(const[n,r]of Ar(e))this.setAttribute(n,r,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof oe){const n=t.getMinimalFlatRanges();for(const r of n)Dc(this,e,null,r)}else Su(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=n=>{for(const r of n.getAttributeKeys())this.removeAttribute(r,n)};if(e instanceof oe)for(const n of e.getItems())t(n);else t(e)}move(e,t,n){if(this._assertWriterUsedCorrectly(),!(e instanceof oe))throw new y.a("writer-move-invalid-range",this);if(!e.isFlat)throw new y.a("writer-move-range-not-flat",this);const r=fe._createAt(t,n);if(r.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!Au(e.root,r.root))throw new y.a("writer-move-different-document",this);const o=e.root.document?e.root.document.version:null,a=new Bt(e.start,e.end.offset-e.start.offset,r,o);this.batch.addOperation(a),this.model.applyOperation(a)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof oe?e:oe._createOn(e)).getMinimalFlatRanges().reverse();for(const n of t)this._addOperationForAffectedMarkers("move",n),jc(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 Dt))throw new y.a("writer-merge-no-element-before",this);if(!(n instanceof Dt))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(oe._createIn(n),fe._createAt(t,"end")),this.remove(n)}_merge(e){const t=fe._createAt(e.nodeBefore,"end"),n=fe._createAt(e.nodeAfter,0),r=e.root.document.graveyard,o=new fe(r,[0]),a=e.root.document.version,c=new vn(n,e.nodeAfter.maxOffset,t,o,a);this.batch.addOperation(c),this.model.applyOperation(c)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof Dt))throw new y.a("writer-rename-not-element-instance",this);const n=e.root.document?e.root.document.version:null,r=new or(fe._createBefore(e),e.name,t,n);this.batch.addOperation(r),this.model.applyOperation(r)}split(e,t){this._assertWriterUsedCorrectly();let n,r,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=Wt.getInsertionPosition(e),f=new Wt(e,c,u,null,a);this.batch.addOperation(f),this.model.applyOperation(f),n||r||(n=o,r=e.parent.nextSibling),o=(e=this.createPositionAfter(e.parent)).parent}while(o!==t);return{position:e,range:new oe(fe._createAt(n,"end"),fe._createAt(r,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new y.a("writer-wrap-range-not-flat",this);const n=t instanceof Dt?t:new Dt(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 r=new oe(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(r,fe._createAt(n,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),e.parent===null)throw new y.a("writer-unwrap-element-no-parent",this);this.move(oe._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,r=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(!r)throw new y.a("writer-addmarker-no-range",this);return n?(qs(this,e,null,r,o),this.model.markers.get(e)):this.model.markers._set(e,r,n,o)}updateMarker(e,t){this._assertWriterUsedCorrectly();const n=typeof e=="string"?e:e.name,r=this.model.markers.get(n);if(!r)throw new y.a("writer-updatemarker-marker-not-exists",this);if(!t)return void this.model.markers._refresh(r);const o=typeof t.usingOperation=="boolean",a=typeof t.affectsData=="boolean",c=a?t.affectsData:r.affectsData;if(!o&&!t.range&&!a)throw new y.a("writer-updatemarker-wrong-options",this);const u=r.getRange(),f=t.range?t.range:u;o&&t.usingOperation!==r.managedUsingOperations?t.usingOperation?qs(this,n,null,f,c):(qs(this,n,u,null,c),this.model.markers._set(n,f,void 0,c)):r.managedUsingOperations?qs(this,n,u,f,c):this.model.markers._set(n,f,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);qs(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,r]of Ar(e))this._setSelectionAttribute(n,r)}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 r=Wr._getStoreAttributeKey(e);this.setAttribute(r,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=Wr._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 r=n.getRange();let o=!1;if(e==="move")o=t.containsPosition(r.start)||t.start.isEqual(r.start)||t.containsPosition(r.end)||t.end.isEqual(r.end);else{const a=t.nodeBefore,c=t.nodeAfter,u=r.start.parent==a&&r.start.isAtEnd,f=r.end.parent==c&&r.end.offset==0,b=r.end.nodeAfter==c,k=r.start.nodeAfter==c;o=u||f||b||k}o&&this.updateMarker(n.name,{range:r})}}}function Dc(i,e,t,n){const r=i.model,o=r.document;let a,c,u,f=n.start;for(const k of n.getWalker({shallow:!0}))u=k.item.getAttribute(e),a&&c!=u&&(c!=t&&b(),f=a),a=k.nextPosition,c=u;function b(){const k=new oe(f,a),T=k.root.document?o.version:null,S=new cn(k,e,c,t,T);i.batch.addOperation(S),r.applyOperation(S)}a instanceof fe&&a!=f&&c!=t&&b()}function Su(i,e,t,n){const r=i.model,o=r.document,a=n.getAttribute(e);let c,u;if(a!=t){if(n.root===n){const f=n.document?o.version:null;u=new Li(n,e,a,t,f)}else{c=new oe(fe._createBefore(n),i.createPositionAfter(n));const f=c.root.document?o.version:null;u=new cn(c,e,a,t,f)}i.batch.addOperation(u),r.applyOperation(u)}}function qs(i,e,t,n,r){const o=i.model,a=o.document,c=new br(e,t,n,o.markers,r,a.version);i.batch.addOperation(c),o.applyOperation(c)}function jc(i,e,t,n){let r;if(i.root.document){const o=n.document,a=new fe(o.graveyard,[0]);r=new Bt(i,e,a,o.version)}else r=new Tm(i,e);t.addOperation(r),n.applyOperation(r)}function Au(i,e){return i===e||i instanceof Rc&&e instanceof Rc}class zi{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=oe._createOn(e);for(const n of this._markerCollection.getMarkersIntersectingRange(t)){const r=n.getRange();this.bufferMarkerChange(n.name,r,r,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=oe._createFromPositionAndShift(e.position,1);for(const n of this._markerCollection.getMarkersIntersectingRange(t)){const r=n.getRange();this.bufferMarkerChange(n.name,r,r,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 r=e.targetPosition.parent;this._isInInsertedElement(r)||this._markInsert(r,e.targetPosition.offset,t.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(e,t,n,r){const o=this._changedMarkers.get(e);o?(o.newRange=n,o.affectsData=r,o.oldRange==null&&o.newRange==null&&this._changedMarkers.delete(e)):this._changedMarkers.set(e,{oldRange:t,newRange:n,affectsData:r})}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 r=this._changesInElement.get(n).sort((b,k)=>b.offset===k.offset?b.type!=k.type?b.type=="remove"?-1:1:0:b.offset<k.offset?-1:1),o=this._elementSnapshots.get(n),a=Bo(n.getChildren()),c=Sm(o.length,r);let u=0,f=0;for(const b of c)if(b==="i")t.push(this._getInsertDiff(n,u,a[u].name)),u++;else if(b==="r")t.push(this._getRemoveDiff(n,u,o[f].name)),f++;else if(b==="a"){const k=a[u].attributes,T=o[f].attributes;let S;if(a[u].name=="$text")S=new oe(fe._createAt(n,u),fe._createAt(n,u+1));else{const O=n.offsetToIndex(u);S=new oe(fe._createAt(n,u),fe._createAt(n.getChild(O),0))}t.push(...this._getAttributesDiff(S,T,k)),u++,f++}else u++,f++}t.sort((n,r)=>n.position.root!=r.position.root?n.position.root.rootName<r.position.root.rootName?-1:1:n.position.isEqual(r.position)?n.changeCount-r.changeCount:n.position.isBefore(r.position)?-1:1);for(let n=1,r=0;n<t.length;n++){const o=t[r],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,f=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||f?(o.length++,f&&(o.range.end=o.range.end.getShiftedBy(1)),t[n]=null):r=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(bf),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard:this._cachedChanges}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._cachedChanges=null}_markInsert(e,t,n){const r={type:"insert",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,r)}_markRemove(e,t,n){const r={type:"remove",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,r),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 r=0;r<n.length;r++)n[r].howMany<1&&(n.splice(r,1),r--)}_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,Bo(e.getChildren()))}_handleChange(e,t){e.nodesToHandle=e.howMany;for(const n of t){const r=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:r,howMany:a-n.howMany,count:this._changeCount++})}}if(e.type=="remove"){if(n.type=="insert"){if(r<=n.offset)n.offset-=e.howMany;else if(r<=o)if(e.offset<n.offset){const a=r-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"&&(r<=n.offset?n.offset-=e.howMany:e.offset<n.offset&&(e.nodesToHandle+=n.howMany,n.howMany=0)),n.type=="attribute"){if(r<=n.offset)n.offset-=e.howMany;else if(e.offset<n.offset){const a=r-n.offset;n.offset=e.offset,n.howMany-=a}else if(e.offset<o)if(r<=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&&r>n.offset){if(r>o){const a={type:"attribute",offset:o,howMany:r-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&&(r>o?(e.nodesToHandle=r-o,e.offset=o):e.nodesToHandle=0);if(n.type=="remove"&&e.offset<n.offset&&r>n.offset){const a={type:"attribute",offset:n.offset,howMany:r-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&&r<=o?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=n.offset&&r>=o&&(n.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,n){return{type:"insert",position:fe._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,n){return{type:"remove",position:fe._createAt(e,t),name:n,length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,n){const r=[];n=new Map(n);for(const[o,a]of t){const c=n.has(o)?n.get(o):null;c!==a&&r.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)r.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:o,attributeOldValue:null,attributeNewValue:a,changeCount:this._changeCount++});return r}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const n=this._changesInElement.get(t),r=e.startOffset;if(n){for(const o of n)if(o.type=="insert"&&r>=o.offset&&r<o.offset+o.howMany)return!0}return this._isInInsertedElement(t)}_removeAllNestedChanges(e,t,n){const r=new oe(fe._createAt(e,t),fe._createAt(e,t+n));for(const o of r.getItems({shallow:!0}))o.is("element")&&(this._elementSnapshots.delete(o),this._changesInElement.delete(o),this._removeAllNestedChanges(o,0,o.maxOffset))}}function Bo(i){const e=[];for(const t of i)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 Sm(i,e){const t=[];let n=0,r=0;for(const o of e){if(o.offset>n){for(let a=0;a<o.offset-n;a++)t.push("e");r+=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,r+=o.howMany}else t.push(..."a".repeat(o.howMany).split("")),n=o.offset+o.howMany,r+=o.howMany}if(r<i)for(let o=0;o<i-r-n;o++)t.push("e");return t}function bf(i){const e=i.position&&i.position.root.rootName=="$graveyard",t=i.range&&i.range.root.rootName=="$graveyard";return!e&&!t}class Am{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 r of this._operations)r.baseVersion>=e&&r.baseVersion<t&&n.push(r);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 vf(i,e){return!!(t=i.charAt(e-1))&&t.length==1&&/[\ud800-\udbff]/.test(t)&&function(n){return!!n&&n.length==1&&/[\udc00-\udfff]/.test(n)}(i.charAt(e));var t}function _f(i,e){return!!(t=i.charAt(e))&&t.length==1&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(t);var t}class wf{constructor(e){this.model=e,this.version=0,this.history=new Am(this),this.selection=new Wr(this),this.roots=new ur({idProperty:"rootName"}),this.differ=new zi(e.markers),this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root","$graveyard"),this.listenTo(e,"applyOperation",(t,n)=>{const r=n[0];if(r.isDocumentOperation&&r.baseVersion!==this.version)throw new y.a("model-document-applyoperation-wrong-version",this,{operation:r})},{priority:"highest"}),this.listenTo(e,"applyOperation",(t,n)=>{const r=n[0];r.isDocumentOperation&&this.differ.bufferOperation(r)},{priority:"high"}),this.listenTo(e,"applyOperation",(t,n)=>{const r=n[0];r.isDocumentOperation&&(this.version++,this.history.addOperation(r))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(e.markers,"update",(t,n,r,o)=>{this.differ.bufferMarkerChange(n.name,r,o,n.affectsData),r===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 Rc(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=ja(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,r=t.createPositionFromPath(e,[0]);return n.getNearestSelectionRange(r)||t.createRange(r)}_validateSelectionRange(e){return kf(e.start)&&kf(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 kf(i){const e=i.textNode;if(e){const t=e.data,n=i.offset-e.startOffset;return!vf(t,n)&&!_f(t,n)}return!0}Be(wf,B);class yf{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,r=!1){const o=e instanceof al?e.name:e;if(o.includes(","))throw new y.a("markercollection-incorrect-marker-name",this);const a=this._markers.get(o);if(a){const f=a.getRange();let b=!1;return f.isEqual(t)||(a._attachLiveRange(Di.fromRange(t)),b=!0),n!=a.managedUsingOperations&&(a._managedUsingOperations=n,b=!0),typeof r=="boolean"&&r!=a.affectsData&&(a._affectsData=r,b=!0),b&&this.fire("update:"+o,a,f,t),a}const c=Di.fromRange(t),u=new al(o,c,n,r);return this._markers.set(o,u),this.fire("update:"+o,u,null,t),u}_remove(e){const t=e instanceof al?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 al?e.name:e,n=this._markers.get(t);if(!n)throw new y.a("markercollection-refresh-marker-not-exists",this);const r=n.getRange();this.fire("update:"+t,n,r,r,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()}}Be(yf,B);class al{constructor(e,t,n,r){this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=n,this._affectsData=r}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}}Be(al,B);class Pn extends qr{get type(){return"noop"}clone(){return new Pn(this.baseVersion)}getReversed(){return new Pn(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const si={};si[cn.className]=cn,si[En.className]=En,si[br.className]=br,si[Bt.className]=Bt,si[Pn.className]=Pn,si[qr.className]=qr,si[or.className]=or,si[Li.className]=Li,si[Wt.className]=Wt,si[vn.className]=vn;class jn extends fe{constructor(e,t,n="toNone"){if(super(e,t,n),!this.root.is("rootElement"))throw new y.a("model-liveposition-root-not-rootelement",e);Em.call(this)}detach(){this.stopListening()}is(e){return e==="livePosition"||e==="model:livePosition"||e=="position"||e==="model:position"}toPosition(){return new fe(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t||e.stickiness)}}function Em(){this.listenTo(this.root.document.model,"applyOperation",(i,e)=>{const t=e[0];t.isDocumentOperation&&xf.call(this,t)},{priority:"low"})}function xf(i){const e=this.getTransformedByOperation(i);if(!this.isEqual(e)){const t=this.toPosition();this.path=e.path,this.root=e.root,this.fire("change",t)}}Be(jn,B);class Cf{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?oe._createOn(this.nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new oe(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=jn.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=jn.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=jn.fromPosition(e,"toNext"))}_mergeOnLeft(){const e=this._firstNode;if(!(e instanceof Dt)||!this._canMergeLeft(e))return;const t=jn._createBefore(e);t.stickiness="toNext";const n=jn.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=jn._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=jn._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 Dt)||!this._canMergeRight(e))return;const t=jn._createAfter(e);if(t.stickiness="toNext",!this.position.isEqual(t))throw new y.a("insertcontent-invalid-insertion-position",this);this.position=fe._createAt(t.nodeBefore,"end");const n=jn.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=jn._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=jn._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 Dt&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){const t=e.nextSibling;return t instanceof Dt&&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 Tf(i,e,t={}){if(e.isCollapsed)return;const n=e.getFirstRange();if(n.root.rootName=="$graveyard")return;const r=i.schema;i.change(o=>{if(!t.doNotResetEntireContent&&function(u,f){const b=u.getLimitElement(f);if(!f.containsEntireContent(b))return!1;const k=f.getFirstRange();return k.start.parent==k.end.parent?!1:u.checkChild(b,"paragraph")}(r,e))return void function(u,f){const b=u.model.schema.getLimitElement(f);u.remove(u.createRangeIn(b)),Sf(u,u.createPositionAt(b,0),f)}(o,e);const[a,c]=function(u){const f=u.root.document.model,b=u.start;let k=u.end;if(f.hasContent(u,{ignoreMarkers:!0})){const T=function(S){const O=S.parent,D=O.root.document.model.schema,L=O.getAncestors({parentFirst:!0,includeSelf:!0});for(const W of L){if(D.isLimit(W))return null;if(D.isBlock(W))return W}}(k);if(T&&k.isTouching(f.createPositionAt(T,0))){const S=f.createSelection(u);f.modifySelection(S,{direction:"backward"});const O=S.getLastPosition(),D=f.createRange(O,k);f.hasContent(D,{ignoreMarkers:!0})||(k=O)}}return[jn.fromPosition(b,"toPrevious"),jn.fromPosition(k,"toNext")]}(n);a.isTouching(c)||o.remove(o.createRange(a,c)),t.leaveUnmerged||(function(u,f,b){const k=u.model;if(!Eu(u.model.schema,f,b))return;const[T,S]=function(O,D){const L=O.getAncestors(),W=D.getAncestors();let J=0;for(;L[J]&&L[J]==W[J];)J++;return[L[J],W[J]]}(f,b);!T||!S||(!k.hasContent(T,{ignoreMarkers:!0})&&k.hasContent(S,{ignoreMarkers:!0})?function O(D,L,W,J){const de=L.parent,xe=W.parent;if(!(de==J||xe==J)){for(L=D.createPositionAfter(de),(W=D.createPositionBefore(xe)).isEqual(L)||D.insert(de,W);L.parent.isEmpty;){const Ve=L.parent;L=D.createPositionBefore(Ve),D.remove(Ve)}W=D.createPositionBefore(xe),function(Ve,Qt){const wt=Qt.nodeBefore,Gn=Qt.nodeAfter;wt.name!=Gn.name&&Ve.rename(wt,Gn.name),Ve.clearAttributes(wt),Ve.setAttributes(Object.fromEntries(Gn.getAttributes()),wt),Ve.merge(Qt)}(D,W),Eu(D.model.schema,L,W)&&O(D,L,W,J)}}(u,f,b,T.parent):function O(D,L,W,J){const de=L.parent,xe=W.parent;if(!(de==J||xe==J)){for(L=D.createPositionAfter(de),(W=D.createPositionBefore(xe)).isEqual(L)||D.insert(xe,L),D.merge(L);W.parent.isEmpty;){const Ve=W.parent;W=D.createPositionBefore(Ve),D.remove(Ve)}Eu(D.model.schema,L,W)&&O(D,L,W,J)}}(u,f,b,T.parent))}(o,a,c),r.removeDisallowedAttributes(a.parent.getChildren(),o)),Af(o,e,a),!t.doNotAutoparagraph&&function(u,f){const b=u.checkChild(f,"$text"),k=u.checkChild(f,"paragraph");return!b&&k}(r,a)&&Sf(o,a,e),a.detach(),c.detach()})}function Eu(i,e,t){const n=e.parent,r=t.parent;return n!=r&&!i.isLimit(n)&&!i.isLimit(r)&&function(o,a,c){const u=new oe(o,a);for(const f of u.getWalker())if(c.isLimit(f.item))return!1;return!0}(e,t,i)}function Sf(i,e,t){const n=i.createElement("paragraph");i.insert(n,e),Af(i,t,i.createPositionAt(n,0))}function Af(i,e,t){e instanceof Wr?i.setSelection(t):e.setTo(t)}function Ef(i,e){const{isForward:t,walker:n,unit:r,schema:o}=i,{type:a,item:c,nextPosition:u}=e;if(a=="text")return i.unit==="word"?function(f,b){let k=f.position.textNode;if(k){let T=f.position.offset-k.startOffset;for(;!Im(k.data,T,b)&&!Mm(k,T,b);){f.next();const S=b?f.position.nodeAfter:f.position.nodeBefore;if(S&&S.is("$text")){const O=S.data.charAt(b?0:S.data.length-1);' ,.?!:;"-()'.includes(O)||(f.next(),k=f.position.textNode)}T=f.position.offset-k.startOffset}}return f.position}(n,t):function(f,b){const k=f.position.textNode;if(k){const T=k.data;let S=f.position.offset-k.startOffset;for(;vf(T,S)||b=="character"&&_f(T,S);)f.next(),S=f.position.offset-k.startOffset}return f.position}(n,r);if(a==(t?"elementStart":"elementEnd")){if(o.isSelectable(c))return fe._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 Pm(i,e){const t=i.root,n=fe._createAt(t,e?"end":0);return e?new oe(i,n):new oe(n,i)}function Im(i,e,t){const n=e+(t?0:-1);return' ,.?!:;"-()'.includes(i.charAt(n))}function Mm(i,e,t){return e===(t?i.endOffset:0)}function Pf(i,e){const t=[];Array.from(i.getItems({direction:"backward"})).map(n=>e.createRangeOn(n)).filter(n=>(n.start.isAfter(i.start)||n.start.isEqual(i.start))&&(n.end.isBefore(i.end)||n.end.isEqual(i.end))).forEach(n=>{t.push(n.start.parent),e.remove(n)}),t.forEach(n=>{let r=n;for(;r.parent&&r.isEmpty;){const o=e.createRangeOn(r);r=r.parent,e.remove(o)}})}function Om(i){i.document.registerPostFixer(e=>function(t,n){const r=n.document.selection,o=n.schema,a=[];let c=!1;for(const u of r.getRanges()){const f=Nm(u,o);f&&!f.isEqual(u)?(a.push(f),c=!0):a.push(u)}c&&t.setSelection(function(u){const f=[];f.push(u.shift());for(const b of u){const k=f.pop();if(b.isEqual(k))f.push(k);else if(b.isIntersecting(k)){const T=k.start.isAfter(b.start)?b.start:k.start,S=k.end.isAfter(b.end)?k.end:b.end,O=new oe(T,S);f.push(O)}else f.push(k),f.push(b)}return f}(a),{backward:r.isBackward})}(e,i))}function Nm(i,e){return i.isCollapsed?function(t,n){const r=t.start,o=n.getNearestSelectionRange(r);if(!o)return null;if(!o.isCollapsed)return o;const a=o.start;return r.isEqual(a)?null:new oe(a)}(i,e):function(t,n){const{start:r,end:o}=t,a=n.checkChild(r,"$text"),c=n.checkChild(o,"$text"),u=n.getLimitElement(r),f=n.getLimitElement(o);if(u===f){if(a&&c)return null;if(function(T,S,O){const D=T.nodeAfter&&!O.isLimit(T.nodeAfter)||O.checkChild(T,"$text"),L=S.nodeBefore&&!O.isLimit(S.nodeBefore)||O.checkChild(S,"$text");return D||L}(r,o,n)){const T=r.nodeAfter&&n.isSelectable(r.nodeAfter)?null:n.getNearestSelectionRange(r,"forward"),S=o.nodeBefore&&n.isSelectable(o.nodeBefore)?null:n.getNearestSelectionRange(o,"backward"),O=T?T.start:r,D=S?S.end:o;return new oe(O,D)}}const b=u&&!u.is("rootElement"),k=f&&!f.is("rootElement");if(b||k){const T=r.nodeAfter&&o.nodeBefore&&r.nodeAfter.parent===o.nodeBefore.parent,S=b&&(!T||!If(r.nodeAfter,n)),O=k&&(!T||!If(o.nodeBefore,n));let D=r,L=o;return S&&(D=fe._createBefore(Nr(u,n))),O&&(L=fe._createAfter(Nr(f,n))),new oe(D,L)}return null}(i,e)}function Nr(i,e){let t=i,n=t;for(;e.isLimit(n)&&n.parent;)t=n,n=n.parent;return t}function If(i,e){return i&&e.isSelectable(i)}class Mf{constructor(){this.markers=new yf,this.document=new wf(this),this.schema=new gf,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}),Om(this),this.document.registerPostFixer(Sc)}change(e){try{return this._pendingChanges.length===0?(this._pendingChanges.push({batch:new Mc,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(t){y.a.rethrowUnexpectedError(t,this)}}enqueueChange(e,t){try{typeof e=="string"?e=new Mc(e):typeof e=="function"&&(t=e,e=new Mc),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(r,o,a,c){return r.change(u=>{let f;f=a?a instanceof Ri||a instanceof Wr?a:u.createSelection(a,c):r.document.selection,f.isCollapsed||r.deleteContent(f,{doNotAutoparagraph:!0});const b=new Cf(r,u,f.anchor);let k;k=o.is("documentFragment")?o.getChildren():[o],b.handleNodes(k);const T=b.getSelectionRange();T&&(f instanceof Wr?u.setSelection(T):f.setTo(T));const S=b.getAffectedRange()||r.createRange(f.anchor);return b.destroy(),S})}(this,e,t,n)}deleteContent(e,t){Tf(this,e,t)}modifySelection(e,t){(function(n,r,o={}){const a=n.schema,c=o.direction!="backward",u=o.unit?o.unit:"character",f=r.focus,b=new ii({boundaries:Pm(f,c),singleCharacters:!0,direction:c?"forward":"backward"}),k={walker:b,schema:a,isForward:c,unit:u};let T;for(;T=b.next();){if(T.done)return;const S=Ef(k,T.value);if(S)return void(r instanceof Wr?n.change(O=>{O.setSelectionFocus(S)}):r.setFocus(S))}})(this,e,t)}getSelectedContent(e){return function(t,n){return t.change(r=>{const o=r.createDocumentFragment(),a=n.getFirstRange();if(!a||a.isCollapsed)return o;const c=a.start.root,u=a.start.getCommonPath(a.end),f=c.getNodeByPath(u);let b;b=a.start.parent==a.end.parent?a:r.createRange(r.createPositionAt(f,a.start.path[u.length]),r.createPositionAt(f,a.end.path[u.length]+1));const k=b.end.offset-b.start.offset;for(const T of b.getItems({shallow:!0}))T.is("$textProxy")?r.appendText(T.data,T.getAttributes(),o):r.append(r.cloneElement(T,!0),o);if(b!=a){const T=a._getTransformedByMove(b.start,r.createPositionAt(o,0),k)[0],S=r.createRange(r.createPositionAt(o,0),T.start);Pf(r.createRange(T.end,r.createPositionAt(o,"end")),r),Pf(S,r)}return o})}(this,e)}hasContent(e,t={}){const n=e instanceof Dt?oe._createIn(e):e;if(n.isCollapsed)return!1;const{ignoreWhitespaces:r=!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")||!r||a.data.search(/\S/)!==-1))return!0;return!1}createPositionFromPath(e,t,n){return new fe(e,t,n)}createPositionAt(e,t){return fe._createAt(e,t)}createPositionAfter(e){return fe._createAfter(e)}createPositionBefore(e){return fe._createBefore(e)}createRange(e,t){return new oe(e,t)}createRangeIn(e){return oe._createIn(e)}createRangeOn(e){return oe._createOn(e)}createSelection(e,t,n){return new Ri(e,t,n)}createBatch(e){return new Mc(e)}createOperationFromJSON(e){return(class{static fromJSON(t,n){return si[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 sl(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}}Be(Mf,Gt);class Rm extends Ir{constructor(e){super(),this.editor=e}set(e,t,n={}){if(typeof t=="string"){const r=t;t=(o,a)=>{this.editor.execute(r),a()}}super.set(e,t,n)}}class Pu{constructor(e={}){this._context=e.context||new wi({language:e.language}),this._context._addEditor(this,!e.context);const t=Array.from(this.constructor.builtinPlugins||[]);this.config=new Ra(e,this.constructor.defaultConfig),this.config.define("plugins",t),this.config.define(this._context._getEditorConfig()),this.plugins=new Da(this,t,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this.commands=new ff,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 Mf;const n=new M;this.data=new Cu(this.model,n),this.editing=new bu(this.model,n),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new Cm([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 Rm(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const e=this.config,t=e.get("plugins"),n=e.get("removePlugins")||[],r=e.get("extraPlugins")||[],o=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(r),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()}}Be(Pu,Gt);class Dm{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(Iu(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(Iu(e)).callback(this.editor.locale)}has(e){return this._components.has(Iu(e))}}function Iu(i){return String(i).toLowerCase()}class Of{constructor(e){this.editor=e,this.componentFactory=new Dm(e),this.focusTracker=new Ur,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}}Be(Of,B);var jm={setData(i){this.data.set(i)},getData(i){return this.data.get(i)}},Mu={updateSourceElement(){if(!this.sourceElement)throw new y.a("editor-missing-sourceelement",this);var i,e;i=this.sourceElement,e=this.data.get(),i instanceof HTMLTextAreaElement&&(i.value=e),i.innerHTML=e}};class Nf extends ki{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new ur({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(Gt);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 Rr={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 Ou({emitter:i,activator:e,callback:t,contextElements:n}){i.listenTo(document,"mousedown",(r,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 Nu(i){i.set("_isCssTransitionsDisabled",!1),i.disableCssTransitions=()=>{i._isCssTransitionsDisabled=!0},i.enableCssTransitions=()=>{i._isCssTransitionsDisabled=!1},i.extendTemplate({attributes:{class:[i.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}function Ru({view:i}){i.listenTo(i.element,"submit",(e,t)=>{t.preventDefault(),i.fire("submit")},{useCapture:!0})}class ds extends ur{constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(t,n,r)=>{this._renderViewIntoCollectionParent(n,r)}),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 r of e)n.delegate(r).to(t);this.on("add",(n,r)=>{for(const o of e)r.delegate(o).to(t)}),this.on("remove",(n,r)=>{for(const o of e)r.stopDelegating(o,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}}_(15);class ct{constructor(e){this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new ur,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=Dr.bind(this,this)}createCollection(e){const t=new ds(e);return this._viewCollections.add(t),t}registerChild(e){dr(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){dr(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new Dr(e)}extendTemplate(e){Dr.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)}}Be(ct,ss),Be(ct,Gt);class Dr{constructor(e){Object.assign(this,Lf(jf(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)Fc(n)?yield n:Du(n)&&(yield*e(n))}(this)}static bind(e,t){return{to:(n,r)=>new Lm({eventNameOrFunction:n,attribute:n,observable:e,emitter:t,callback:r}),if:(n,r,o)=>new Rf({observable:e,emitter:t,attribute:n,valueIfTrue:r,callback:o})}}static extend(e,t){if(e._isRendered)throw new y.a("template-extend-render",[this,e]);(function n(r,o){if(o.attributes&&(r.attributes||(r.attributes={}),zc(r.attributes,o.attributes)),o.eventListeners&&(r.eventListeners||(r.eventListeners={}),zc(r.eventListeners,o.eventListeners)),o.text&&r.text.push(...o.text),o.children&&o.children.length){if(r.children.length!=o.children.length)throw new y.a("ui-template-extend-children-mismatch",r);let a=0;for(const c of o.children)n(r.children[a++],c)}})(e,Lf(jf(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(""),Lc(this.text)?this._bindToObservable({schema:this.text,updater:zm(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){let t,n,r,o;if(!this.attributes)return;const a=e.node,c=e.revertData;for(t in this.attributes)if(r=a.getAttribute(t),n=this.attributes[t],c&&(c.attributes[t]=r),o=ne(n[0])&&n[0].ns?n[0].ns:null,Lc(n)){const u=o?n[0].value:n;c&&Bf(t)&&u.unshift(r),this._bindToObservable({schema:u,updater:Fm(a,t,o),data:e})}else t=="style"&&typeof n[0]!="string"?this._renderStyleAttribute(n[0],e):(c&&r&&Bf(t)&&n.unshift(r),n=n.map(u=>u&&u.value||u).reduce((u,f)=>u.concat(f),[]).reduce(Ff,""),us(n)||a.setAttributeNS(o,t,n))}_renderStyleAttribute(e,t){const n=t.node;for(const r in e){const o=e[r];Lc(o)?this._bindToObservable({schema:[o],updater:Bm(n,r),data:t}):n.style[r]=o}}_renderElementChildren(e){const t=e.node,n=e.intoFragment?document.createDocumentFragment():t,r=e.isApplying;let o=0;for(const a of this.children)if(ju(a)){if(!r){a.setParent(t);for(const c of a)n.appendChild(c.element)}}else if(Fc(a))r||(a.isRendered||a.render(),n.appendChild(a.element));else if(os(a))n.appendChild(a);else if(r){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(r=>{const[o,a]=t.split("@");return r.activateDomEventListener(o,a,e)});e.revertData&&e.revertData.bindings.push(n)}}_bindToObservable({schema:e,updater:t,data:n}){const r=n.revertData;Df(e,t,n);const o=e.filter(a=>!us(a)).filter(a=>a.observable).map(a=>a.activateAttributeListener(e,t,n));r&&r.bindings.push(o)}_revertTemplateFromNode(e,t){for(const n of t.bindings)for(const r of n)r();if(t.text)e.textContent=t.text;else{for(const n in t.attributes){const r=t.attributes[n];r===null?e.removeAttribute(n):e.setAttribute(n,r)}for(let n=0;n<t.children.length;++n)this._revertTemplateFromNode(e.childNodes[n],t.children[n])}}}Be(Dr,B);class ll{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 r=()=>Df(e,t,n);return this.emitter.listenTo(this.observable,"change:"+this.attribute,r),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,r)}}}class Lm extends ll{activateDomEventListener(e,t,n){const r=(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,r),()=>{this.emitter.stopListening(n.node,e,r)}}}class Rf extends ll{getValue(e){return!us(super.getValue(e))&&(this.valueIfTrue||!0)}}function Lc(i){return!!i&&(i.value&&(i=i.value),Array.isArray(i)?i.some(Lc):i instanceof ll)}function Df(i,e,{node:t}){let n=function(r,o){return r.map(a=>a instanceof ll?a.getValue(o):a)}(i,t);n=i.length==1&&i[0]instanceof Rf?n[0]:n.reduce(Ff,""),us(n)?e.remove():e.set(n)}function zm(i){return{set(e){i.textContent=e},remove(){i.textContent=""}}}function Fm(i,e,t){return{set(n){i.setAttributeNS(t,e,n)},remove(){i.removeAttributeNS(t,e)}}}function Bm(i,e){return{set(t){i.style[e]=t},remove(){i.style[e]=null}}}function jf(i){return Po(i,e=>{if(e&&(e instanceof ll||Du(e)||Fc(e)||ju(e)))return e})}function Lf(i){if(typeof i=="string"?i=function(e){return{text:[e]}}(i):i.text&&function(e){e.text=Pt(e.text)}(i),i.on&&(i.eventListeners=function(e){for(const t in e)zf(e,t);return e}(i.on),delete i.on),!i.text){i.attributes&&function(t){for(const n in t)t[n].value&&(t[n].value=Pt(t[n].value)),zf(t,n)}(i.attributes);const e=[];if(i.children)if(ju(i.children))e.push(i.children);else for(const t of i.children)Du(t)||Fc(t)||os(t)?e.push(t):e.push(new Dr(t));i.children=e}return i}function zf(i,e){i[e]=Pt(i[e])}function Ff(i,e){return us(e)?i:us(i)?e:`${i} ${e}`}function zc(i,e){for(const t in e)i[t]?i[t].push(...e[t]):i[t]=e[t]}function us(i){return!i&&i!==0}function Fc(i){return i instanceof ct}function Du(i){return i instanceof Dr}function ju(i){return i instanceof ds}function Bf(i){return i=="class"||i=="style"}class Vm extends ds{constructor(e,t=[]){super(t),this.locale=e}attachToDom(){this._bodyCollectionContainer=new Dr({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,r={},o=[]){const a=r&&r.xmlns,c=a?t.createElementNS(a,n):t.createElement(n);for(const u in r)c.setAttribute(u,r[u]);!ou(o)&&dr(o)||(o=[o]);for(let u of o)ou(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()}}_(17);class Bc extends ct{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})}}_(19);class Vf extends ct{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")}]}]})}}_(21);class nn extends ct{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 Bc,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",r=>!r),t.if("isVisible","ck-hidden",r=>!r),t.to("isOn",r=>r?"ck-on":"ck-off"),t.if("withText","ck-button_with-text"),t.if("withKeystroke","ck-button_with-keystroke")],type:t.to("type",r=>r||"button"),tabindex:t.to("tabindex"),"aria-labelledby":"ck-editor__aria-label_"+n,"aria-disabled":t.if("isEnabled",!0,r=>!r),"aria-pressed":t.to("isOn",r=>!!this.isToggleable&&String(r))},children:this.children,on:{mousedown:t.to(r=>{r.preventDefault()}),click:t.to(r=>{this.isEnabled?this.fire("execute"):r.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 Vf;return e.bind("text").to(this,"_tooltipString"),e.bind("position").to(this,"tooltipPosition"),e}_createLabelView(e){const t=new ct,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 ct;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>Ba(t))}]}),e}_getTooltipString(e,t,n){return e?typeof e=="string"?e:(n&&(n=Ba(n)),e instanceof Function?e(t,n):`${t}${n?` (${n})`:""}`):""}}_(23);class Vc extends nn{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 ct;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}class Ks{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 r of n)e.keystrokeHandler.set(r,(o,a)=>{this[t](),a()})}}get first(){return this.focusables.find(Gs)||null}get last(){return this.focusables.filter(Gs).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 r=t.element===this.focusTracker.focusedElement;return r&&(e=n),r}),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 r=(t+n+e)%n;do{const o=this.focusables.get(r);if(Gs(o))return o;r=(r+n+e)%n}while(r!==t);return null}}function Gs(i){return!(!i.focus||Ut.window.getComputedStyle(i.element).display=="none")}_(25);var $f='<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 Hf extends nn{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 Bc;return e.content=$f,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}_(27);class Uf extends ct{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 Ir,this.focusTracker=new Ur,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 nn;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 nn,t=e.bindTemplate;return e.icon=$f,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 $m extends ct{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()}}}_(29);function Wf({element:i,target:e,positions:t,limiter:n,fitInViewport:r}){Ce(e)&&(e=e()),Ce(n)&&(n=n());const o=function(k){return k&&k.parentNode?k.offsetParent===Ut.document.body?null:k.offsetParent:null}(i),a=new At(i),c=new At(e);let u,f;n||r?[f,u]=function(T,S){const{elementRect:O,viewportRect:D}=S,L=O.getArea(),W=function(J,{targetRect:de,elementRect:xe,limiterRect:Ve,viewportRect:Qt}){const wt=[],Gn=xe.getArea();for(const ar of J){const Yn=Lu(ar,de,xe);if(!Yn)continue;const[Kr,_r]=Yn;let Fr=0,bs=0;if(Ve)if(Qt){const ph=Ve.getIntersection(Qt);ph&&(Fr=ph.getIntersectionArea(_r))}else Fr=Ve.getIntersectionArea(_r);Qt&&(bs=Qt.getIntersectionArea(_r));const fh={positionName:Kr,positionRect:_r,limiterIntersectArea:Fr,viewportIntersectArea:bs};if(Fr===Gn)return[fh];wt.push(fh)}return wt}(T,S);if(D){const J=qf(W.filter(({viewportIntersectArea:de})=>de===L),L);if(J)return J}return qf(W,L)}(t,{targetRect:c,elementRect:a,limiterRect:n&&new At(n).getVisible(),viewportRect:r&&new At(Ut.window)})||Lu(t[0],c,a):[f,u]=Lu(t[0],c,a);let b=Kf(u);return o&&(b=function({left:k,top:T},S){const O=Kf(new At(S)),D=su(S);return k-=O.left,T-=O.top,k+=S.scrollLeft,T+=S.scrollTop,k-=D.left,T-=D.top,{left:k,top:T}}(b,o)),{left:b.left,top:b.top,name:f}}function Lu(i,e,t){const n=i(e,t);if(!n)return null;const{left:r,top:o,name:a}=n;return[a,t.clone().moveTo(r,o)]}function qf(i,e){let t,n,r=0;for(const{positionName:o,positionRect:a,limiterIntersectArea:c,viewportIntersectArea:u}of i){if(c===e)return[o,a];const f=u**2+c**2;f>r&&(r=f,t=a,n=o)}return t?[n,t]:null}function Kf({left:i,top:e}){const{scrollX:t,scrollY:n}=Ut.window;return{left:i+t,top:e+n}}class Ys extends ct{constructor(e,t,n){super(e);const r=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 Ir,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",r.to("class"),r.if("isEnabled","ck-disabled",o=>!o)],id:r.to("id"),"aria-describedby":r.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=Ys._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:r,northEast:o,northWest:a,southMiddleEast:c,southMiddleWest:u,northMiddleEast:f,northMiddleWest:b}=Ys.defaultPanelPositions;return this.locale.uiLanguageDirection!=="rtl"?[n,r,c,u,e,o,a,f,b,t]:[r,n,u,c,e,a,o,b,f,t]}}Ys.defaultPanelPositions={south:(i,e)=>({top:i.bottom,left:i.left-(e.width-i.width)/2,name:"s"}),southEast:i=>({top:i.bottom,left:i.left,name:"se"}),southWest:(i,e)=>({top:i.bottom,left:i.left-e.width+i.width,name:"sw"}),southMiddleEast:(i,e)=>({top:i.bottom,left:i.left-(e.width-i.width)/4,name:"sme"}),southMiddleWest:(i,e)=>({top:i.bottom,left:i.left-3*(e.width-i.width)/4,name:"smw"}),north:(i,e)=>({top:i.top-e.height,left:i.left-(e.width-i.width)/2,name:"n"}),northEast:(i,e)=>({top:i.top-e.height,left:i.left,name:"ne"}),northWest:(i,e)=>({top:i.top-e.height,left:i.left-e.width+i.width,name:"nw"}),northMiddleEast:(i,e)=>({top:i.top-e.height,left:i.left-(e.width-i.width)/4,name:"nme"}),northMiddleWest:(i,e)=>({top:i.top-e.height,left:i.left-3*(e.width-i.width)/4,name:"nmw"})},Ys._getOptimalPosition=Wf;class Gf extends ct{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class Hm extends ct{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function Yf(i){return Array.isArray(i)?{items:i,removeItems:[]}:i?Object.assign({items:[],removeItems:[]},i):{items:[],removeItems:[]}}_(31);class zu extends ct{constructor(e,t){super(e);const n=this.bindTemplate,r=this.t;this.options=t||{},this.set("ariaLabel",r("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new Ur,this.keystrokes=new Ir,this.set("class"),this.set("isCompact",!1),this.itemsView=new Um(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const o=e.uiLanguageDirection==="rtl";this._focusCycler=new Ks({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 qm(this):new Wm(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=Yf(e),r=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(r).map(a=>a==="|"?new Gf:a==="-"?new Hm:t.create(a));this.items.addMany(o)}_cleanSeparators(e){const t=a=>a!=="-"&&a!=="|",n=e.length,r=e.findIndex(t),o=n-e.slice().reverse().findIndex(t);return e.slice(r,o).filter((a,c,u)=>t(a)?!0:!(c>0&&u[c-1]===a))}}class Um extends ct{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Wm{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 qm{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 r=n.index;for(const o of n.removed)r>=this.ungroupedItems.length?this.groupedItems.remove(o):this.ungroupedItems.remove(o);for(let o=r;o<r+n.added.length;o++){const a=n.added[o-r];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 At(e.lastChild),r=new At(e);if(!this.cachedPadding){const o=Ut.window.getComputedStyle(e),a=t==="ltr"?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(o[a])}return t==="ltr"?n.right>r.right-this.cachedPadding:n.left<r.left+this.cachedPadding}_enableGroupingOnResize(){let e;this.resizeObserver=new tn(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 Gf),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=hs(e);return n.class="ck-toolbar__grouped-dropdown",n.panelPosition=e.uiLanguageDirection==="ltr"?"sw":"se",Xf(n,[]),n.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:e.uiLanguageDirection==="rtl"?"se":"sw",icon:Rr.threeVerticalDots}),n.toolbarView.items.bindTo(this.groupedItems).using(r=>r),n}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}_(33);class Qf extends ct{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new Ur,this.keystrokes=new Ir,this._focusCycler=new Ks({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 Jf extends ct{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 Km extends ct{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}_(35),_(37);function hs(i,e=Hf){const t=new e(i),n=new $m(i),r=new Ys(i,t,n);return t.bind("isEnabled").to(r),t instanceof Hf?t.bind("isOn").to(r,"isOpen"):t.arrowView.bind("isOn").to(r,"isOpen"),function(o){(function(a){a.on("render",()=>{Ou({emitter:a,activator:()=>a.isOpen,callback:()=>{a.isOpen=!1},contextElements:[a.element]})})})(o),function(a){a.on("execute",c=>{c.source instanceof Vc||(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)}(r),r}function Xf(i,e){const t=i.locale,n=t.t,r=i.toolbarView=new zu(t);r.set("ariaLabel",n("Dropdown toolbar")),i.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.map(o=>r.items.add(o)),i.panelView.children.add(r),r.items.delegate("execute").to(i)}function Zf(i,e){const t=i.locale,n=i.listView=new Qf(t);n.items.bindTo(e).using(({type:r,model:o})=>{if(r==="separator")return new Km(t);if(r==="button"||r==="switchbutton"){const a=new Jf(t);let c;return c=r==="button"?new nn(t):new Vc(t),c.bind(...Object.keys(o)).to(o),c.delegate("execute").to(a),a.children.add(c),a}}),i.panelView.children.add(n),n.items.delegate("execute").to(i)}_(39);class $c extends ct{constructor(e){super(e),this.body=new Vm(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}_(41);class ep extends ct{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 Gm extends $c{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 ep;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class Ym extends ct{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(r=>{const o=e.document.getRoot(n.name);r.addClass(n.isFocused?"ck-focused":"ck-blurred",o),r.removeClass(n.isFocused?"ck-blurred":"ck-focused",o)})}e.isRenderingInProgress?function n(r){e.once("change:isRenderingInProgress",(o,a,c)=>{c?n(r):t(r)})}(this):t(this)}}class Qm extends Ym{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 r=e.document.getRoot(this.name);n.setAttribute("aria-label",t("Rich Text Editor, %0",this.name),r)})}}_(43),_(45);class Jm extends ct{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 Ur,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:""}}_(47);class Fu extends ct{constructor(e,t){super(e);const n="ck-labeled-field-view-"+P(),r="ck-labeled-field-view-status-"+P();this.fieldView=t(this,n,r),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(r),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 ep(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new ct(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",r=>!r)],id:e,role:n.if("errorText","alert")},children:[{text:n.to("_statusText")}]}),t}focus(){this.fieldView.focus()}}function Bu(i,e,t){const n=new Jm(i.locale);return n.set({id:e,ariaDescribedById:t}),n.bind("isReadOnly").to(i,"isEnabled",r=>!r),n.bind("hasError").to(i,"errorText",r=>!!r),n.on("input",()=>{i.errorText=null}),i.bind("isEmpty","isFocused","placeholder").to(n),n}class Vu extends ki{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 $u{constructor(e,t){t&&_o(this,t),e&&this.set(e)}}Be($u,Gt),_(49);const tp=ot("px"),np=Ut.document.body;class st extends ct{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",tp),left:t.to("left",tp)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){this.show();const t=st.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:np,fitInViewport:!0},e),r=st._getOptimalPosition(n),o=parseInt(r.left),a=parseInt(r.top),c=r.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=Hu(e.target),n=e.limiter?Hu(e.limiter):np;this.listenTo(Ut.document,"scroll",(r,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(Ut.window,"resize",()=>{this.attachTo(e)})}_stopPinning(){this.stopListening(Ut.document,"scroll"),this.stopListening(Ut.window,"resize")}}function Hu(i){return ei(i)?i:mc(i)?i.commonAncestorContainer:typeof i=="function"?Hu(i()):null}function Wn(i,e){return i.top-e.height-st.arrowVerticalOffset}function qn(i){return i.bottom+st.arrowVerticalOffset}st.arrowHorizontalOffset=25,st.arrowVerticalOffset=10,st._getOptimalPosition=Wf,st.defaultPositions={northWestArrowSouthWest:(i,e)=>({top:Wn(i,e),left:i.left-st.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthMiddleWest:(i,e)=>({top:Wn(i,e),left:i.left-.25*e.width-st.arrowHorizontalOffset,name:"arrow_smw"}),northWestArrowSouth:(i,e)=>({top:Wn(i,e),left:i.left-e.width/2,name:"arrow_s"}),northWestArrowSouthMiddleEast:(i,e)=>({top:Wn(i,e),left:i.left-.75*e.width+st.arrowHorizontalOffset,name:"arrow_sme"}),northWestArrowSouthEast:(i,e)=>({top:Wn(i,e),left:i.left-e.width+st.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(i,e)=>({top:Wn(i,e),left:i.left+i.width/2-st.arrowHorizontalOffset,name:"arrow_sw"}),northArrowSouthMiddleWest:(i,e)=>({top:Wn(i,e),left:i.left+i.width/2-.25*e.width-st.arrowHorizontalOffset,name:"arrow_smw"}),northArrowSouth:(i,e)=>({top:Wn(i,e),left:i.left+i.width/2-e.width/2,name:"arrow_s"}),northArrowSouthMiddleEast:(i,e)=>({top:Wn(i,e),left:i.left+i.width/2-.75*e.width+st.arrowHorizontalOffset,name:"arrow_sme"}),northArrowSouthEast:(i,e)=>({top:Wn(i,e),left:i.left+i.width/2-e.width+st.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(i,e)=>({top:Wn(i,e),left:i.right-st.arrowHorizontalOffset,name:"arrow_sw"}),northEastArrowSouthMiddleWest:(i,e)=>({top:Wn(i,e),left:i.right-.25*e.width-st.arrowHorizontalOffset,name:"arrow_smw"}),northEastArrowSouth:(i,e)=>({top:Wn(i,e),left:i.right-e.width/2,name:"arrow_s"}),northEastArrowSouthMiddleEast:(i,e)=>({top:Wn(i,e),left:i.right-.75*e.width+st.arrowHorizontalOffset,name:"arrow_sme"}),northEastArrowSouthEast:(i,e)=>({top:Wn(i,e),left:i.right-e.width+st.arrowHorizontalOffset,name:"arrow_se"}),southWestArrowNorthWest:(i,e)=>({top:qn(i),left:i.left-st.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthMiddleWest:(i,e)=>({top:qn(i),left:i.left-.25*e.width-st.arrowHorizontalOffset,name:"arrow_nmw"}),southWestArrowNorth:(i,e)=>({top:qn(i),left:i.left-e.width/2,name:"arrow_n"}),southWestArrowNorthMiddleEast:(i,e)=>({top:qn(i),left:i.left-.75*e.width+st.arrowHorizontalOffset,name:"arrow_nme"}),southWestArrowNorthEast:(i,e)=>({top:qn(i),left:i.left-e.width+st.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(i,e)=>({top:qn(i),left:i.left+i.width/2-st.arrowHorizontalOffset,name:"arrow_nw"}),southArrowNorthMiddleWest:(i,e)=>({top:qn(i),left:i.left+i.width/2-.25*e.width-st.arrowHorizontalOffset,name:"arrow_nmw"}),southArrowNorth:(i,e)=>({top:qn(i),left:i.left+i.width/2-e.width/2,name:"arrow_n"}),southArrowNorthMiddleEast:(i,e)=>({top:qn(i),left:i.left+i.width/2-.75*e.width+st.arrowHorizontalOffset,name:"arrow_nme"}),southArrowNorthEast:(i,e)=>({top:qn(i),left:i.left+i.width/2-e.width+st.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(i,e)=>({top:qn(i),left:i.right-st.arrowHorizontalOffset,name:"arrow_nw"}),southEastArrowNorthMiddleWest:(i,e)=>({top:qn(i),left:i.right-.25*e.width-st.arrowHorizontalOffset,name:"arrow_nmw"}),southEastArrowNorth:(i,e)=>({top:qn(i),left:i.right-e.width/2,name:"arrow_n"}),southEastArrowNorthMiddleEast:(i,e)=>({top:qn(i),left:i.right-.75*e.width+st.arrowHorizontalOffset,name:"arrow_nme"}),southEastArrowNorthEast:(i,e)=>({top:qn(i),left:i.right-e.width+st.arrowHorizontalOffset,name:"arrow_ne"})},_(51),_(53);const Qs=ot("px");class cl extends ve{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 st(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 rp(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(n,r)=>!r&&n>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(n,r)=>{if(r<2)return"";const o=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[o,r])}),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 ip(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:r=!1}){this.view.class=t,this.view.withArrow=n,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),r&&(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 rp extends ct{constructor(e){super(e);const t=e.t,n=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new Ur,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",r=>r?"":"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 nn(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n}}class ip extends ct{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",r=>r?"":"ck-hidden")],style:{top:n.to("top",Qs),left:n.to("left",Qs),width:n.to("width",Qs),height:n.to("height",Qs)}},children:this.content}),this.on("change:numberOfPanels",(r,o,a,c)=>{a>c?this._addPanels(a-c):this._removePanels(c-a),this.updatePosition()})}_addPanels(e){for(;e--;){const t=new ct;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:r}=new At(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:n,height:r})}}}_(55);const Js=ot("px");class Xm extends ct{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 Dr({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",n=>n?"block":"none"),height:t.to("isSticky",n=>n?Js(this._panelRect.height):null)}}}).render(),this._contentPanel=new Dr({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?Js(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_hasViewportTopOffset",n=>n?Js(this.viewportTopOffset):null),bottom:t.to("_isStickyToTheLimiter",n=>n?Js(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(Ut.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:Js(-Ut.window.scrollX)):(this._isStickyToTheLimiter=!1,this._hasViewportTopOffset=!1,this._marginLeft=null)}}_(57),_(59);const Hc=new WeakMap;function op(i){const{view:e,element:t,text:n,isDirectHost:r=!0,keepOnFocus:o=!1}=i,a=e.document;Hc.has(a)||(Hc.set(a,new Map),a.registerPostFixer(c=>dl(a,c))),Hc.get(a).set(t,{text:n,isDirectHost:r,keepOnFocus:o,hostElement:r?t:null}),e.change(c=>dl(a,c))}function Uc(i,e){return!!e.hasClass("ck-placeholder")&&(i.removeClass("ck-placeholder",e),!0)}function dl(i,e){const t=Hc.get(i),n=[];let r=!1;for(const[o,a]of t)a.isDirectHost&&(n.push(o),sp(e,o,a)&&(r=!0));for(const[o,a]of t){if(a.isDirectHost)continue;const c=Zm(o);c&&(n.includes(c)||(a.hostElement=c,sp(e,o,a)&&(r=!0)))}return r}function sp(i,e,t){const{text:n,isDirectHost:r,hostElement:o}=t;let a=!1;return o.getAttribute("data-placeholder")!==n&&(i.setAttribute("data-placeholder",n,o),a=!0),(r||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 f=c.document;if(!f.isFocused)return!0;const b=f.selection.anchor;return b&&b.parent!==c}(o,t.keepOnFocus)?function(c,u){return!u.hasClass("ck-placeholder")&&(c.addClass("ck-placeholder",u),!0)}(i,o)&&(a=!0):Uc(i,o)&&(a=!0),a}function Zm(i){if(i.childCount){const e=i.getChild(0);if(e.is("element")&&!e.is("uiElement"))return e}return null}const ul=new Map;function Ct(i,e,t){let n=ul.get(i);n||(n=new Map,ul.set(i,n)),n.set(e,t)}function eb(i){return[i]}function ap(i,e,t={}){const n=function(r,o){const a=ul.get(r);return a&&a.has(o)?a.get(o):eb}(i.constructor,e.constructor);try{return n(i=i.clone(),e,t)}catch(r){throw r}}function tb(i,e,t){i=i.slice(),e=e.slice();const n=new nb(t.document,t.useRelations,t.forceWeakRemove);n.setOriginalOperations(i),n.setOriginalOperations(e);const r=n.originalOperations;if(i.length==0||e.length==0)return{operationsA:i,operationsB:e,originalOperations:r};const o=new WeakMap;for(const u of i)o.set(u,0);const a={nextBaseVersionA:i[i.length-1].baseVersion+1,nextBaseVersionB:e[e.length-1].baseVersion+1,originalOperationsACount:i.length,originalOperationsBCount:e.length};let c=0;for(;c<i.length;){const u=i[c],f=o.get(u);if(f==e.length){c++;continue}const b=e[f],k=ap(u,b,n.getContext(u,b,!0)),T=ap(b,u,n.getContext(b,u,!1));n.updateRelation(u,b),n.setOriginalOperations(k,u),n.setOriginalOperations(T,b);for(const S of k)o.set(S,f+T.length);i.splice(c,1,...k),e.splice(f,1,...T)}if(t.padWithNoOps){const u=i.length-a.originalOperationsACount,f=e.length-a.originalOperationsBCount;cp(i,f-u),cp(e,u-f)}return lp(i,a.nextBaseVersionB),lp(e,a.nextBaseVersionA),{operationsA:i,operationsB:e,originalOperations:r}}class nb{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 r of e)this.originalOperations.set(r,n||r)}updateRelation(e,t){switch(e.constructor){case Bt:switch(t.constructor){case vn: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 Bt:e.targetPosition.isEqual(t.sourcePosition)||e.targetPosition.isBefore(t.sourcePosition)?this._setRelation(e,t,"insertBefore"):this._setRelation(e,t,"insertAfter")}break;case Wt:switch(t.constructor){case vn:e.splitPosition.isBefore(t.sourcePosition)&&this._setRelation(e,t,"splitBefore");break;case Bt:if(e.splitPosition.isEqual(t.sourcePosition)||e.splitPosition.isBefore(t.sourcePosition))this._setRelation(e,t,"splitBefore");else{const n=oe._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.splitPosition)){const r=n.end.offset-e.splitPosition.offset,o=e.splitPosition.offset-n.start.offset;this._setRelation(e,t,{howMany:r,offset:o})}}}break;case vn:switch(t.constructor){case vn: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 Wt:e.sourcePosition.isEqual(t.splitPosition)&&this._setRelation(e,t,"splitAtSource")}break;case br:{const n=e.newRange;if(!n)return;switch(t.constructor){case Bt:{const r=oe._createFromPositionAndShift(t.sourcePosition,t.howMany),o=r.containsPosition(n.start)||r.start.isEqual(n.start),a=r.containsPosition(n.end)||r.end.isEqual(n.end);!o&&!a||r.containsRange(n)||this._setRelation(e,t,{side:o?"left":"right",path:o?n.start.path.slice():n.end.path.slice()});break}case vn:{const r=n.start.isEqual(t.targetPosition),o=n.start.isEqual(t.deletionPosition),a=n.end.isEqual(t.deletionPosition),c=n.end.isEqual(t.sourcePosition);(r||o||a||c)&&this._setRelation(e,t,{wasInLeftElement:r,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),r=this._history.getUndoneOperation(n);if(!r)return null;const o=this.originalOperations.get(e),a=this._relations.get(o);return a&&a.get(r)||null}_setRelation(e,t,n){const r=this.originalOperations.get(e),o=this.originalOperations.get(t);let a=this._relations.get(r);a||(a=new Map,this._relations.set(r,a)),a.set(o,n)}}function lp(i,e){for(const t of i)t.baseVersion=e++}function cp(i,e){for(let t=0;t<e;t++)i.push(new Pn(0))}function dp(i,e,t){const n=i.nodes.getNode(0).getAttribute(e);if(n==t)return null;const r=new oe(i.position,i.position.getShiftedBy(i.howMany));return new cn(r,e,n,t,0)}function up(i,e){return i.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany)===null}function Xs(i,e){const t=[];for(let n=0;n<i.length;n++){const r=i[n],o=new Bt(r.start,r.end.offset-r.start.offset,e,0);t.push(o);for(let a=n+1;a<i.length;a++)i[a]=i[a]._getTransformedByMove(o.sourcePosition,o.targetPosition,o.howMany)[0];e=e._getTransformedByMove(o.sourcePosition,o.targetPosition,o.howMany)}return t}Ct(cn,cn,(i,e,t)=>{if(i.key===e.key&&i.range.start.hasSameParentAs(e.range.start)){const n=i.range.getDifference(e.range).map(o=>new cn(o,i.key,i.oldValue,i.newValue,0)),r=i.range.getIntersection(e.range);return r&&t.aIsStrong&&n.push(new cn(r,e.key,e.newValue,i.newValue,0)),n.length==0?[new Pn(0)]:n}return[i]}),Ct(cn,En,(i,e)=>{if(i.range.start.hasSameParentAs(e.position)&&i.range.containsPosition(e.position)){const t=i.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes).map(n=>new cn(n,i.key,i.oldValue,i.newValue,i.baseVersion));if(e.shouldReceiveAttributes){const n=dp(e,i.key,i.oldValue);n&&t.unshift(n)}return t}return i.range=i.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[i]}),Ct(cn,vn,(i,e)=>{const t=[];i.range.start.hasSameParentAs(e.deletionPosition)&&(i.range.containsPosition(e.deletionPosition)||i.range.start.isEqual(e.deletionPosition))&&t.push(oe._createFromPositionAndShift(e.graveyardPosition,1));const n=i.range._getTransformedByMergeOperation(e);return n.isCollapsed||t.push(n),t.map(r=>new cn(r,i.key,i.oldValue,i.newValue,i.baseVersion))}),Ct(cn,Bt,(i,e)=>function(t,n){const r=oe._createFromPositionAndShift(n.sourcePosition,n.howMany);let o=null,a=[];r.containsRange(t,!0)?o=t:t.start.hasSameParentAs(r.start)?(a=t.getDifference(r),o=t.getIntersection(r)):a=[t];const c=[];for(let u of a){u=u._getTransformedByDeletion(n.sourcePosition,n.howMany);const f=n.getMovedRangeStart(),b=u.start.hasSameParentAs(f);u=u._getTransformedByInsertion(f,n.howMany,b),c.push(...u)}return o&&c.push(o._getTransformedByMove(n.sourcePosition,n.targetPosition,n.howMany,!1)[0]),c}(i.range,e).map(t=>new cn(t,i.key,i.oldValue,i.newValue,i.baseVersion))),Ct(cn,Wt,(i,e)=>{if(i.range.end.isEqual(e.insertionPosition))return e.graveyardPosition||i.range.end.offset++,[i];if(i.range.start.hasSameParentAs(e.splitPosition)&&i.range.containsPosition(e.splitPosition)){const t=i.clone();return t.range=new oe(e.moveTargetPosition.clone(),i.range.end._getCombined(e.splitPosition,e.moveTargetPosition)),i.range.end=e.splitPosition.clone(),i.range.end.stickiness="toPrevious",[i,t]}return i.range=i.range._getTransformedBySplitOperation(e),[i]}),Ct(En,cn,(i,e)=>{const t=[i];if(i.shouldReceiveAttributes&&i.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(i.position)){const n=dp(i,e.key,e.newValue);n&&t.push(n)}return t}),Ct(En,En,(i,e,t)=>(i.position.isEqual(e.position)&&t.aIsStrong||(i.position=i.position._getTransformedByInsertOperation(e)),[i])),Ct(En,Bt,(i,e)=>(i.position=i.position._getTransformedByMoveOperation(e),[i])),Ct(En,Wt,(i,e)=>(i.position=i.position._getTransformedBySplitOperation(e),[i])),Ct(En,vn,(i,e)=>(i.position=i.position._getTransformedByMergeOperation(e),[i])),Ct(br,En,(i,e)=>(i.oldRange&&(i.oldRange=i.oldRange._getTransformedByInsertOperation(e)[0]),i.newRange&&(i.newRange=i.newRange._getTransformedByInsertOperation(e)[0]),[i])),Ct(br,br,(i,e,t)=>{if(i.name==e.name){if(!t.aIsStrong)return[new Pn(0)];i.oldRange=e.newRange?e.newRange.clone():null}return[i]}),Ct(br,vn,(i,e)=>(i.oldRange&&(i.oldRange=i.oldRange._getTransformedByMergeOperation(e)),i.newRange&&(i.newRange=i.newRange._getTransformedByMergeOperation(e)),[i])),Ct(br,Bt,(i,e,t)=>{if(i.oldRange&&(i.oldRange=oe._createFromRanges(i.oldRange._getTransformedByMoveOperation(e))),i.newRange){if(t.abRelation){const n=oe._createFromRanges(i.newRange._getTransformedByMoveOperation(e));if(t.abRelation.side=="left"&&e.targetPosition.isEqual(i.newRange.start))return i.newRange.start.path=t.abRelation.path,i.newRange.end=n.end,[i];if(t.abRelation.side=="right"&&e.targetPosition.isEqual(i.newRange.end))return i.newRange.start=n.start,i.newRange.end.path=t.abRelation.path,[i]}i.newRange=oe._createFromRanges(i.newRange._getTransformedByMoveOperation(e))}return[i]}),Ct(br,Wt,(i,e,t)=>{if(i.oldRange&&(i.oldRange=i.oldRange._getTransformedBySplitOperation(e)),i.newRange){if(t.abRelation){const n=i.newRange._getTransformedBySplitOperation(e);return i.newRange.start.isEqual(e.splitPosition)&&t.abRelation.wasStartBeforeMergedElement?i.newRange.start=fe._createAt(e.insertionPosition):i.newRange.start.isEqual(e.splitPosition)&&!t.abRelation.wasInLeftElement&&(i.newRange.start=fe._createAt(e.moveTargetPosition)),i.newRange.end.isEqual(e.splitPosition)&&t.abRelation.wasInRightElement?i.newRange.end=fe._createAt(e.moveTargetPosition):i.newRange.end.isEqual(e.splitPosition)&&t.abRelation.wasEndBeforeMergedElement?i.newRange.end=fe._createAt(e.insertionPosition):i.newRange.end=n.end,[i]}i.newRange=i.newRange._getTransformedBySplitOperation(e)}return[i]}),Ct(vn,En,(i,e)=>(i.sourcePosition.hasSameParentAs(e.position)&&(i.howMany+=e.howMany),i.sourcePosition=i.sourcePosition._getTransformedByInsertOperation(e),i.targetPosition=i.targetPosition._getTransformedByInsertOperation(e),[i])),Ct(vn,vn,(i,e,t)=>{if(i.sourcePosition.isEqual(e.sourcePosition)&&i.targetPosition.isEqual(e.targetPosition)){if(t.bWasUndone){const n=e.graveyardPosition.path.slice();return n.push(0),i.sourcePosition=new fe(e.graveyardPosition.root,n),i.howMany=0,[i]}return[new Pn(0)]}if(i.sourcePosition.isEqual(e.sourcePosition)&&!i.targetPosition.isEqual(e.targetPosition)&&!t.bWasUndone&&t.abRelation!="splitAtSource"){const n=i.targetPosition.root.rootName=="$graveyard",r=e.targetPosition.root.rootName=="$graveyard";if(r&&!n||!(n&&!r)&&t.aIsStrong){const a=e.targetPosition._getTransformedByMergeOperation(e),c=i.targetPosition._getTransformedByMergeOperation(e);return[new Bt(a,i.howMany,c,0)]}return[new Pn(0)]}return i.sourcePosition.hasSameParentAs(e.targetPosition)&&(i.howMany+=e.howMany),i.sourcePosition=i.sourcePosition._getTransformedByMergeOperation(e),i.targetPosition=i.targetPosition._getTransformedByMergeOperation(e),i.graveyardPosition.isEqual(e.graveyardPosition)&&t.aIsStrong||(i.graveyardPosition=i.graveyardPosition._getTransformedByMergeOperation(e)),[i]}),Ct(vn,Bt,(i,e,t)=>{const n=oe._createFromPositionAndShift(e.sourcePosition,e.howMany);return e.type=="remove"&&!t.bWasUndone&&!t.forceWeakRemove&&i.deletionPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(i.sourcePosition)?[new Pn(0)]:(i.sourcePosition.hasSameParentAs(e.targetPosition)&&(i.howMany+=e.howMany),i.sourcePosition.hasSameParentAs(e.sourcePosition)&&(i.howMany-=e.howMany),i.sourcePosition=i.sourcePosition._getTransformedByMoveOperation(e),i.targetPosition=i.targetPosition._getTransformedByMoveOperation(e),i.graveyardPosition.isEqual(e.targetPosition)||(i.graveyardPosition=i.graveyardPosition._getTransformedByMoveOperation(e)),[i])}),Ct(vn,Wt,(i,e,t)=>{if(e.graveyardPosition&&(i.graveyardPosition=i.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1),i.deletionPosition.isEqual(e.graveyardPosition)&&(i.howMany=e.howMany)),i.targetPosition.isEqual(e.splitPosition)){const n=e.howMany!=0,r=e.graveyardPosition&&i.deletionPosition.isEqual(e.graveyardPosition);if(n||r||t.abRelation=="mergeTargetNotMoved")return i.sourcePosition=i.sourcePosition._getTransformedBySplitOperation(e),[i]}if(i.sourcePosition.isEqual(e.splitPosition)){if(t.abRelation=="mergeSourceNotMoved")return i.howMany=0,i.targetPosition=i.targetPosition._getTransformedBySplitOperation(e),[i];if(t.abRelation=="mergeSameElement"||i.sourcePosition.offset>0)return i.sourcePosition=e.moveTargetPosition.clone(),i.targetPosition=i.targetPosition._getTransformedBySplitOperation(e),[i]}return i.sourcePosition.hasSameParentAs(e.splitPosition)&&(i.howMany=e.splitPosition.offset),i.sourcePosition=i.sourcePosition._getTransformedBySplitOperation(e),i.targetPosition=i.targetPosition._getTransformedBySplitOperation(e),[i]}),Ct(Bt,En,(i,e)=>{const t=oe._createFromPositionAndShift(i.sourcePosition,i.howMany)._getTransformedByInsertOperation(e,!1)[0];return i.sourcePosition=t.start,i.howMany=t.end.offset-t.start.offset,i.targetPosition.isEqual(e.position)||(i.targetPosition=i.targetPosition._getTransformedByInsertOperation(e)),[i]}),Ct(Bt,Bt,(i,e,t)=>{const n=oe._createFromPositionAndShift(i.sourcePosition,i.howMany),r=oe._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=i.targetPosition.isEqual(e.targetPosition)&&c?i.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):i.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),up(i,e)&&up(e,i))return[e.getReversed()];if(n.containsPosition(e.targetPosition)&&n.containsRange(r,!0))return n.start=n.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),n.end=n.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Xs([n],o);if(r.containsPosition(i.targetPosition)&&r.containsRange(n,!0))return n.start=n.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),n.end=n.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),Xs([n],o);const u=Sn(i.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),Xs([n],o);i.type!="remove"||e.type=="remove"||t.aWasUndone||t.forceWeakRemove?i.type=="remove"||e.type!="remove"||t.bWasUndone||t.forceWeakRemove||(a=!1):a=!0;const f=[],b=n.getDifference(r);for(const T of b){T.start=T.start._getTransformedByDeletion(e.sourcePosition,e.howMany),T.end=T.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const S=Sn(T.start.getParentPath(),e.getMovedRangeStart().getParentPath())=="same",O=T._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,S);f.push(...O)}const k=n.getIntersection(r);return k!==null&&a&&(k.start=k.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),k.end=k.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),f.length===0?f.push(k):f.length==1?r.start.isBefore(n.start)||r.start.isEqual(n.start)?f.unshift(k):f.push(k):f.splice(1,0,k)),f.length===0?[new Pn(i.baseVersion)]:Xs(f,o)}),Ct(Bt,Wt,(i,e,t)=>{let n=i.targetPosition.clone();i.targetPosition.isEqual(e.insertionPosition)&&e.graveyardPosition&&t.abRelation!="moveTargetAfter"||(n=i.targetPosition._getTransformedBySplitOperation(e));const r=oe._createFromPositionAndShift(i.sourcePosition,i.howMany);if(r.end.isEqual(e.insertionPosition))return e.graveyardPosition||i.howMany++,i.targetPosition=n,[i];if(r.start.hasSameParentAs(e.splitPosition)&&r.containsPosition(e.splitPosition)){let a=new oe(e.splitPosition,r.end);return a=a._getTransformedBySplitOperation(e),Xs([new oe(r.start,e.splitPosition),a],n)}i.targetPosition.isEqual(e.splitPosition)&&t.abRelation=="insertAtSource"&&(n=e.moveTargetPosition),i.targetPosition.isEqual(e.insertionPosition)&&t.abRelation=="insertBetween"&&(n=i.targetPosition);const o=[r._getTransformedBySplitOperation(e)];if(e.graveyardPosition){const a=r.start.isEqual(e.graveyardPosition)||r.containsPosition(e.graveyardPosition);i.howMany>1&&a&&!t.aWasUndone&&o.push(oe._createFromPositionAndShift(e.insertionPosition,1))}return Xs(o,n)}),Ct(Bt,vn,(i,e,t)=>{const n=oe._createFromPositionAndShift(i.sourcePosition,i.howMany);if(e.deletionPosition.hasSameParentAs(i.sourcePosition)&&n.containsPosition(e.sourcePosition)){if(i.type!="remove"||t.forceWeakRemove){if(i.howMany==1)return t.bWasUndone?(i.sourcePosition=e.graveyardPosition.clone(),i.targetPosition=i.targetPosition._getTransformedByMergeOperation(e),[i]):[new Pn(0)]}else if(!t.aWasUndone){const o=[];let a=e.graveyardPosition.clone(),c=e.targetPosition._getTransformedByMergeOperation(e);i.howMany>1&&(o.push(new Bt(i.sourcePosition,i.howMany-1,i.targetPosition,0)),a=a._getTransformedByMove(i.sourcePosition,i.targetPosition,i.howMany-1),c=c._getTransformedByMove(i.sourcePosition,i.targetPosition,i.howMany-1));const u=e.deletionPosition._getCombined(i.sourcePosition,i.targetPosition),f=new Bt(a,1,u,0),b=f.getMovedRangeStart().path.slice();b.push(0);const k=new fe(f.targetPosition.root,b);c=c._getTransformedByMove(a,u,1);const T=new Bt(c,e.howMany,k,0);return o.push(f),o.push(T),o}}const r=oe._createFromPositionAndShift(i.sourcePosition,i.howMany)._getTransformedByMergeOperation(e);return i.sourcePosition=r.start,i.howMany=r.end.offset-r.start.offset,i.targetPosition=i.targetPosition._getTransformedByMergeOperation(e),[i]}),Ct(or,En,(i,e)=>(i.position=i.position._getTransformedByInsertOperation(e),[i])),Ct(or,vn,(i,e)=>i.position.isEqual(e.deletionPosition)?(i.position=e.graveyardPosition.clone(),i.position.stickiness="toNext",[i]):(i.position=i.position._getTransformedByMergeOperation(e),[i])),Ct(or,Bt,(i,e)=>(i.position=i.position._getTransformedByMoveOperation(e),[i])),Ct(or,or,(i,e,t)=>{if(i.position.isEqual(e.position)){if(!t.aIsStrong)return[new Pn(0)];i.oldName=e.newName}return[i]}),Ct(or,Wt,(i,e)=>{if(Sn(i.position.path,e.splitPosition.getParentPath())=="same"&&!e.graveyardPosition){const t=new or(i.position.getShiftedBy(1),i.oldName,i.newName,0);return[i,t]}return i.position=i.position._getTransformedBySplitOperation(e),[i]}),Ct(Li,Li,(i,e,t)=>{if(i.root===e.root&&i.key===e.key){if(!t.aIsStrong||i.newValue===e.newValue)return[new Pn(0)];i.oldValue=e.newValue}return[i]}),Ct(Wt,En,(i,e)=>(i.splitPosition.hasSameParentAs(e.position)&&i.splitPosition.offset<e.position.offset&&(i.howMany+=e.howMany),i.splitPosition=i.splitPosition._getTransformedByInsertOperation(e),i.insertionPosition=i.insertionPosition._getTransformedByInsertOperation(e),[i])),Ct(Wt,vn,(i,e,t)=>{if(!i.graveyardPosition&&!t.bWasUndone&&i.splitPosition.hasSameParentAs(e.sourcePosition)){const n=e.graveyardPosition.path.slice();n.push(0);const r=new fe(e.graveyardPosition.root,n),o=Wt.getInsertionPosition(new fe(e.graveyardPosition.root,n)),a=new Wt(r,0,o,null,0);return i.splitPosition=i.splitPosition._getTransformedByMergeOperation(e),i.insertionPosition=Wt.getInsertionPosition(i.splitPosition),i.graveyardPosition=a.insertionPosition.clone(),i.graveyardPosition.stickiness="toNext",[a,i]}return i.splitPosition.hasSameParentAs(e.deletionPosition)&&!i.splitPosition.isAfter(e.deletionPosition)&&i.howMany--,i.splitPosition.hasSameParentAs(e.targetPosition)&&(i.howMany+=e.howMany),i.splitPosition=i.splitPosition._getTransformedByMergeOperation(e),i.insertionPosition=Wt.getInsertionPosition(i.splitPosition),i.graveyardPosition&&(i.graveyardPosition=i.graveyardPosition._getTransformedByMergeOperation(e)),[i]}),Ct(Wt,Bt,(i,e,t)=>{const n=oe._createFromPositionAndShift(e.sourcePosition,e.howMany);if(i.graveyardPosition){const o=n.start.isEqual(i.graveyardPosition)||n.containsPosition(i.graveyardPosition);if(!t.bWasUndone&&o){const a=i.splitPosition._getTransformedByMoveOperation(e),c=i.graveyardPosition._getTransformedByMoveOperation(e),u=c.path.slice();u.push(0);const f=new fe(c.root,u);return[new Bt(a,i.howMany,f,0)]}i.graveyardPosition=i.graveyardPosition._getTransformedByMoveOperation(e)}const r=i.splitPosition.isEqual(e.targetPosition);if(r&&(t.baRelation=="insertAtSource"||t.abRelation=="splitBefore"))return i.howMany+=e.howMany,i.splitPosition=i.splitPosition._getTransformedByDeletion(e.sourcePosition,e.howMany),i.insertionPosition=Wt.getInsertionPosition(i.splitPosition),[i];if(r&&t.abRelation&&t.abRelation.howMany){const{howMany:o,offset:a}=t.abRelation;return i.howMany+=o,i.splitPosition=i.splitPosition.getShiftedBy(a),[i]}if(i.splitPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(i.splitPosition)){const o=e.howMany-(i.splitPosition.offset-e.sourcePosition.offset);return i.howMany-=o,i.splitPosition.hasSameParentAs(e.targetPosition)&&i.splitPosition.offset<e.targetPosition.offset&&(i.howMany+=e.howMany),i.splitPosition=e.sourcePosition.clone(),i.insertionPosition=Wt.getInsertionPosition(i.splitPosition),[i]}return e.sourcePosition.isEqual(e.targetPosition)||(i.splitPosition.hasSameParentAs(e.sourcePosition)&&i.splitPosition.offset<=e.sourcePosition.offset&&(i.howMany-=e.howMany),i.splitPosition.hasSameParentAs(e.targetPosition)&&i.splitPosition.offset<e.targetPosition.offset&&(i.howMany+=e.howMany)),i.splitPosition.stickiness="toNone",i.splitPosition=i.splitPosition._getTransformedByMoveOperation(e),i.splitPosition.stickiness="toNext",i.graveyardPosition?i.insertionPosition=i.insertionPosition._getTransformedByMoveOperation(e):i.insertionPosition=Wt.getInsertionPosition(i.splitPosition),[i]}),Ct(Wt,Wt,(i,e,t)=>{if(i.splitPosition.isEqual(e.splitPosition)){if(!i.graveyardPosition&&!e.graveyardPosition)return[new Pn(0)];if(i.graveyardPosition&&e.graveyardPosition&&i.graveyardPosition.isEqual(e.graveyardPosition))return[new Pn(0)];if(t.abRelation=="splitBefore")return i.howMany=0,i.graveyardPosition=i.graveyardPosition._getTransformedBySplitOperation(e),[i]}if(i.graveyardPosition&&e.graveyardPosition&&i.graveyardPosition.isEqual(e.graveyardPosition)){const n=i.splitPosition.root.rootName=="$graveyard",r=e.splitPosition.root.rootName=="$graveyard";if(r&&!n||!(n&&!r)&&t.aIsStrong){const a=[];return e.howMany&&a.push(new Bt(e.moveTargetPosition,e.howMany,e.splitPosition,0)),i.howMany&&a.push(new Bt(i.splitPosition,i.howMany,i.moveTargetPosition,0)),a}return[new Pn(0)]}if(i.graveyardPosition&&(i.graveyardPosition=i.graveyardPosition._getTransformedBySplitOperation(e)),i.splitPosition.isEqual(e.insertionPosition)&&t.abRelation=="splitBefore")return i.howMany++,[i];if(e.splitPosition.isEqual(i.insertionPosition)&&t.baRelation=="splitBefore"){const n=e.insertionPosition.path.slice();n.push(0);const r=new fe(e.insertionPosition.root,n);return[i,new Bt(i.insertionPosition,1,r,0)]}return i.splitPosition.hasSameParentAs(e.splitPosition)&&i.splitPosition.offset<e.splitPosition.offset&&(i.howMany-=e.howMany),i.splitPosition=i.splitPosition._getTransformedBySplitOperation(e),i.insertionPosition=Wt.getInsertionPosition(i.splitPosition),[i]});class rb extends io{constructor(e){super(e),this.domEventType="click"}onDomEvent(e){this.fire(e.type,e)}}class Wc extends io{constructor(e){super(e),this.domEventType=["mousedown","mouseup","mouseover","mouseout"]}onDomEvent(e){this.fire(e.type,e)}}class Zs{constructor(e){this.document=e}createDocumentFragment(e){return new is(this.document,e)}createElement(e,t,n){return new Te(this.document,e,t,n)}createText(e){return new xt(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 r=n.getChildIndex(e);return this.removeChildren(r,1,n),this.insertChild(r,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 Te(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){er(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 me._createAt(e,t)}createPositionAfter(e){return me._createAfter(e)}createPositionBefore(e){return me._createBefore(e)}createRange(e,t){return new $e(e,t)}createRangeOn(e){return $e._createOn(e)}createRangeIn(e){return $e._createIn(e)}createSelection(e,t,n){return new ft(e,t,n)}}class ai extends Of{constructor(e,t){super(e),this.view=t,this._toolbarConfig=Yf(e.config.get("toolbar")),this._elementReplacer=new tf}get element(){return this.view.element}init(e){const t=this.editor,n=this.view,r=t.editing.view,o=n.editable,a=r.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),r.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:r,originKeystrokeHandler:o,originFocusTracker:a,toolbar:c,beforeFocus:u,afterBlur:f}){a.add(c.element),o.set("Alt+F10",(b,k)=>{a.isFocused&&!c.focusTracker.isFocused&&(u&&u(),c.focus(),k())}),c.keystrokes.set("Esc",(b,k)=>{c.focusTracker.isFocused&&(r.focus(),f&&f(),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(),r=e.sourceElement,o=e.config.get("placeholder")||r&&r.tagName.toLowerCase()==="textarea"&&r.getAttribute("placeholder");o&&op({view:t,element:n,text:o,isDirectHost:!1,keepOnFocus:!0})}}_(61);class ib extends Gm{constructor(e,t,n={}){super(e),this.stickyPanel=new Xm(e),this.toolbar=new zu(e,{shouldGroupWhenFull:n.shouldToolbarGroupWhenFull}),this.editable=new Qm(e,t)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class Uu extends Pu{constructor(e,t){super(t),ei(e)&&(this.sourceElement=e),this.model.document.createRoot();const n=!this.config.get("toolbar.shouldNotGroupWhenFull"),r=new ib(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:n});this.ui=new ai(this,r),function(o){if(!Ce(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,f=()=>o.updateSourceElement();Ce(u.submit)&&(c=u.submit,u.submit=()=>{f(),c.apply(u)}),u.addEventListener("submit",f),o.on("destroy",()=>{u.removeEventListener("submit",f),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 r=new this(e,t);n(r.initPlugins().then(()=>r.ui.init(ei(e)?e:null)).then(()=>{if(!ei(e)&&t.initialData)throw new y.a("editor-create-initial-data",null);const o=t.initialData!==void 0?t.initialData:function(a){return ei(a)?(c=a,c instanceof HTMLTextAreaElement?c.value:c.innerHTML):a;var c}(e);return r.data.init(o)}).then(()=>r.fire("ready")).then(()=>r))})}}Be(Uu,jm),Be(Uu,Mu);class fs{constructor(e){this.files=function(t){const n=Array.from(t.files||[]),r=Array.from(t.items||[]);return n.length?n:r.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 Ze extends io{constructor(e){super(e);const t=this.document;function n(r){return(o,a)=>{a.preventDefault();const c=a.dropRange?[a.dropRange]:null,u=new v(t,r);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 fs(e.clipboardData?e.clipboardData:e.dataTransfer)};e.type!="drop"&&e.type!="dragover"||(t.dropRange=function(n,r){const o=r.target.ownerDocument,a=r.clientX,c=r.clientY;let u;return o.caretRangeFromPoint&&o.caretRangeFromPoint(a,c)?u=o.caretRangeFromPoint(a,c):r.rangeParent&&(u=o.createRange(),u.setStart(r.rangeParent,r.rangeOffset),u.collapse(!0)),u?n.domConverter.domRangeToView(u):null}(this.view,e)),this.fire(e.type,e,t)}}const hp=["figcaption","li"];class sn extends ve{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(Ze),this._setupPasteDrop(),this._setupCopyCut()}_setupPasteDrop(){const e=this.editor,t=e.model,n=e.editing.view,r=n.document;this.listenTo(r,"clipboardInput",o=>{e.isReadOnly&&o.stop()},{priority:"highest"}),this.listenTo(r,"clipboardInput",(o,a)=>{const c=a.dataTransfer;let u=a.content||"";var f;u||(c.getData("text/html")?u=function(k){return k.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(T,S)=>S.length==1?" ":S).replace(/<!--[\s\S]*?-->/g,"")}(c.getData("text/html")):c.getData("text/plain")&&(((f=(f=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>")||f.includes("<br>"))&&(f=`<p>${f}</p>`),u=f),u=this.editor.data.htmlProcessor.toView(u));const b=new v(this,"inputTransformation");this.fire(b,{content:u,dataTransfer:c,targetRanges:a.targetRanges,method:a.method}),b.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 r(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",r,{priority:"low"}),this.listenTo(n,"cut",(o,a)=>{e.isReadOnly?a.preventDefault():r(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 f="";if(u.is("$text")||u.is("$textProxy"))f=u.data;else if(u.is("element","img")&&u.hasAttribute("alt"))f=u.getAttribute("alt");else if(u.is("element","br"))f=` `;else{let b=null;for(const k of u.getChildren()){const T=c(k);b&&(b.is("containerElement")||k.is("containerElement"))&&(hp.includes(b.name)||hp.includes(k.name)?f+=` `:f+=` `),f+=T,b=k}}return f}(a.content))),a.method=="cut"&&e.model.deleteContent(t.selection)},{priority:"low"})}}function*dn(i,e){for(const t of e)t&&i.getAttributeProperties(t[0]).copyOnEnter&&(yield t)}class ob extends at{execute(){const e=this.editor.model,t=e.document;e.change(n=>{(function(r,o,a,c){const u=a.isCollapsed,f=a.getFirstRange(),b=f.start.parent,k=f.end.parent;if(c.isLimit(b)||c.isLimit(k))return void(u||b!=k||r.deleteContent(a));if(u){const T=dn(o.model.schema,a.getAttributes());lo(o,f.start),o.setSelectionAttribute(T)}else{const T=!(f.start.isAtStart&&f.end.isAtEnd),S=b==k;r.deleteContent(a,{leaveUnmerged:T}),T&&(S?lo(o,a.focus):o.setSelection(k,0))}})(this.editor.model,n,t.selection,e.schema),this.fire("afterExecute",{writer:n})})}}function lo(i,e){i.split(e),i.setSelection(e.parent.nextSibling,0)}class fp extends Mi{constructor(e){super(e);const t=this.document;t.on("keydown",(n,r)=>{if(this.isEnabled&&r.keyCode==it.enter){const o=new An(t,"enter",t.selection.getFirstRange());t.fire(o,new ls(t,r.domEvent,{isSoft:r.shiftKey})),o.stop.called&&n.stop()}})}observe(){}}class qc extends ve{static get pluginName(){return"Enter"}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(fp),e.commands.add("enter",new ob(e)),this.listenTo(n,"enter",(r,o)=>{o.preventDefault(),o.isSoft||(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"})}}class pp{constructor(e,t=20){this.model=e,this.size=0,this.limit=t,this.isLocked=!1,this._changeCallback=(n,r)=>{r.type!="transparent"&&r!==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 gp extends at{constructor(e,t){super(e),this.direction=t,this._buffer=new pp(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,r=>{this._buffer.lock();const o=r.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(r);if(this._shouldReplaceFirstBlockWithParagraph(o,a))return void this.editor.execute("paragraph",{selection:o});if(o.isCollapsed)return;let u=0;o.getFirstRange().getMinimalFlatRanges().forEach(f=>{u+=Ft(f.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(o,{doNotResetEntireContent:c,direction:this.direction}),this._buffer.input(u),r.setSelection(o),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,n=t.document.selection,r=t.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(r))||!t.schema.checkChild(r,"paragraph"))return!1;const o=r.getChild(0);return!o||o.name!=="paragraph"}_replaceEntireContentWithParagraph(e){const t=this.editor.model,n=t.document.selection,r=t.schema.getLimitElement(n),o=e.createElement("paragraph");e.remove(e.createRangeIn(r)),e.insert(o,r),e.setSelection(o,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const n=this.editor.model;if(t>1||this.direction!="backward"||!e.isCollapsed)return!1;const r=e.getFirstPosition(),o=n.schema.getLimitElement(r),a=o.getChild(0);return r.parent==a&&!!e.containsEntireContent(a)&&!!n.schema.checkChild(o,"paragraph")&&a.name!="paragraph"}}class sb extends Mi{constructor(e){super(e);const t=e.document;let n=0;function r(o,a,c){const u=new An(t,"delete",t.selection.getFirstRange());t.fire(u,new ls(t,a,c)),u.stop.called&&o.stop()}t.on("keyup",(o,a)=>{a.keyCode!=it.delete&&a.keyCode!=it.backspace||(n=0)}),t.on("keydown",(o,a)=>{const c={};if(a.keyCode==it.delete)c.direction="forward",c.unit="character";else{if(a.keyCode!=it.backspace)return;c.direction="backward",c.unit="codePoint"}const u=xn.isMac?a.altKey:a.ctrlKey;c.unit=u?"word":c.unit,c.sequence=++n,r(o,a.domEvent,c)}),xn.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)),r(o,a.domEvent,c)})}observe(){}}class ps extends ve{static get pluginName(){return"Delete"}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(sb);const r=new gp(e,"forward");if(e.commands.add("deleteForward",r),e.commands.add("forwardDelete",r),e.commands.add("delete",new gp(e,"backward")),this.listenTo(n,"delete",(o,a)=>{const c={unit:a.unit,sequence:a.sequence};if(a.selectionToRemove){const u=e.model.createSelection(),f=[];for(const b of a.selectionToRemove.getRanges())f.push(e.editing.mapper.toModelRange(b));u.setTo(f),c.selection=u}e.execute(a.direction=="forward"?"deleteForward":"delete",c),a.preventDefault(),t.scrollToTheSelection()},{priority:"low"}),xn.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 mp{constructor(){this._stack=[]}add(e,t){const n=this._stack,r=n[0];this._insertDescriptor(e);const o=n[0];r===o||li(r,o)||this.fire("change:top",{oldDescriptor:r,newDescriptor:o,writer:t})}remove(e,t){const n=this._stack,r=n[0];this._removeDescriptor(e);const o=n[0];r===o||li(r,o)||this.fire("change:top",{oldDescriptor:r,newDescriptor:o,writer:t})}_insertDescriptor(e){const t=this._stack,n=t.findIndex(o=>o.id===e.id);if(li(e,t[n]))return;n>-1&&t.splice(n,1);let r=0;for(;t[r]&&bp(t[r],e);)r++;t.splice(r,0,e)}_removeDescriptor(e){const t=this._stack,n=t.findIndex(r=>r.id===e);n>-1&&t.splice(n,1)}}function li(i,e){return i&&e&&i.priority==e.priority&&gs(i.classes)==gs(e.classes)}function bp(i,e){return i.priority>e.priority||!(i.priority<e.priority)&&gs(i.classes)>gs(e.classes)}function gs(i){return Array.isArray(i)?i.sort().join(","):i}Be(mp,B);function et(i){return!!i.is("element")&&!!i.getCustomProperty("widget")}function rn(i,e,t={}){if(!i.is("containerElement"))throw new y.a("widget-to-widget-wrong-element-type",null,{element:i});return e.setAttribute("contenteditable","false",i),e.addClass("ck-widget",i),e.setCustomProperty("widget",!0,i),i.getFillerOffset=_p,t.label&&function(n,r,o){o.setCustomProperty("widgetLabel",r,n)}(i,t.label,e),t.hasSelectionHandle&&function(n,r){const o=r.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(a){const c=this.toDomElement(a),u=new Bc;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});r.insert(r.createPositionAt(n,0),o),r.addClass(["ck-widget_with-selection-handle"],n)}(i,e),Kc(i,e,vp,ab),i}function vp(i,e,t){if(e.classes&&t.addClass(Pt(e.classes),i),e.attributes)for(const n in e.attributes)t.setAttribute(n,e.attributes[n],i)}function ab(i,e,t){if(e.classes&&t.removeClass(Pt(e.classes),i),e.attributes)for(const n in e.attributes)t.removeAttribute(n,i)}function Kc(i,e,t,n){const r=new mp;r.on("change:top",(o,a)=>{a.oldDescriptor&&n(i,a.oldDescriptor,a.writer),a.newDescriptor&&t(i,a.newDescriptor,a.writer)}),e.setCustomProperty("addHighlight",(o,a,c)=>r.add(a,c),i),e.setCustomProperty("removeHighlight",(o,a,c)=>r.remove(a,c),i)}function lb(i){const e=i.getCustomProperty("widgetLabel");return e?typeof e=="function"?e():e:""}function Wu(i,e){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],i),e.setAttribute("contenteditable",i.isReadOnly?"false":"true",i),i.on("change:isReadOnly",(t,n,r)=>{e.setAttribute("contenteditable",r?"false":"true",i)}),i.on("change:isFocused",(t,n,r)=>{r?e.addClass("ck-editor__nested-editable_focused",i):e.removeClass("ck-editor__nested-editable_focused",i)}),i}function hl(i,e){const t=i.getSelectedElement();if(t){const r=co(i);if(r)return e.createRange(e.createPositionAt(t,r));if(e.schema.isObject(t)&&!e.schema.isInline(t))return e.createRangeOn(t)}const n=i.getSelectedBlocks().next().value;if(n){if(n.isEmpty)return e.createRange(e.createPositionAt(n,0));const r=e.createPositionAfter(n);return i.focus.isTouching(r)?e.createRange(r):e.createRange(e.createPositionBefore(n))}return e.createRange(i.focus)}function cb(i,e){const t=new At(Ut.window),n=t.getIntersection(i),r=e.height+st.arrowVerticalOffset;if(i.top-r>t.top||i.bottom+r<t.bottom)return null;const o=n||i,a=o.left+o.width/2-e.width/2;return{top:Math.max(i.top,0)+st.arrowVerticalOffset,left:a,name:"arrow_n"}}function _p(){return null}function Fi(i,e,t){return i&&et(i)&&!t.isInline(e)}function co(i){return i.getAttribute("widget-type-around")}const wp=[N("arrowUp"),N("arrowRight"),N("arrowDown"),N("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 i=112;i<=135;i++)wp.push(i);function qu(i){return!(!i.ctrlKey&&!i.metaKey)||wp.includes(i.keyCode)}_(63);const fl=["before","after"],jr=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 ea extends ve{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[qc,ps]}constructor(e){super(e),this._currentFakeCaretModelElement=null}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",(n,r,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,r=n.editing.view;n.execute("insertParagraph",{position:n.model.createPositionAt(e,t)}),r.focus(),r.scrollToTheSelection()}_listenToIfEnabled(e,t,n,r){this.listenTo(e,t,(...o)=>{this.isEnabled&&n(...o)},r)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=co(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,r={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);Fi(u,a.item,t)&&function(f,b,k){const T=f.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(S){const O=this.toDomElement(S);return function(D,L){for(const W of fl){const J=new Dr({tag:"div",attributes:{class:["ck","ck-widget__type-around__button","ck-widget__type-around__button_"+W],title:L[W]},children:[D.ownerDocument.importNode(jr,!0)]});D.appendChild(J.render())}}(O,b),function(D){const L=new Dr({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});D.appendChild(L.render())}(O),O});f.insert(f.createPositionAt(k,"end"),T)}(c.writer,r,u)},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,n=t.document.selection,r=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:[et,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",(c,u)=>{u.directChange&&e.model.change(f=>{f.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(t.document,"change:data",()=>{const c=n.getSelectedElement();c&&Fi(e.editing.mapper.toViewElement(c),c,r)||e.model.change(u=>{u.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(c,u,f)=>{const b=f.writer;if(this._currentFakeCaretModelElement){const O=f.mapper.toViewElement(this._currentFakeCaretModelElement);O&&(b.removeClass(fl.map(a),O),this._currentFakeCaretModelElement=null)}const k=u.selection.getSelectedElement();if(!k)return;const T=f.mapper.toViewElement(k);if(!Fi(T,k,r))return;const S=co(u.selection);S&&(b.addClass(a(S),T),this._currentFakeCaretModelElement=k)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(c,u,f)=>{f||e.model.change(b=>{b.removeSelectionAttribute("widget-type-around")})})}_handleArrowKeyPress(e,t){const n=this.editor,r=n.model,o=r.document.selection,a=r.schema,c=n.editing.view,u=bt(t.keyCode,n.locale.contentLanguageDirection),f=c.document.selection.getSelectedElement();let b;Fi(f,n.editing.mapper.toModelElement(f),a)?b=this._handleArrowKeyPressOnSelectedWidget(u):o.isCollapsed&&(b=this._handleArrowKeyPressWhenSelectionNextToAWidget(u)),b&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,n=co(t.document.selection);return t.change(r=>n?n!==(e?"after":"before")?(r.removeSelectionAttribute("widget-type-around"),!0):!1:(r.setSelectionAttribute("widget-type-around",e?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,n=t.model,r=n.schema,o=t.plugins.get("Widget"),a=o._getObjectElementNextToSelection(e);return!!Fi(t.editing.mapper.toViewElement(a),a,r)&&(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,r)=>{const o=r.domTarget.closest(".ck-widget__type-around__button");if(!o)return;const a=function(f){return f.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(o),c=function(f,b){const k=f.closest(".ck-widget");return b.mapDomToView(k)}(o,t.domConverter),u=e.editing.mapper.toModelElement(c);this._insertParagraph(u,a),r.preventDefault(),n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,n=e.editing.view;this._listenToIfEnabled(n.document,"enter",(r,o)=>{if(r.eventPhase!="atTarget")return;const a=t.getSelectedElement(),c=e.editing.mapper.toViewElement(a),u=e.model.schema;let f;this._insertParagraphAccordingToFakeCaretPosition()?f=!0:Fi(c,a,u)&&(this._insertParagraph(a,o.isSoft?"before":"after"),f=!0),f&&(o.preventDefault(),r.stop())},{context:et})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view,t=[it.enter,it.delete,it.backspace];this._listenToIfEnabled(e.document,"keydown",(n,r)=>{t.includes(r.keyCode)||qu(r)||this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,n=e.model,r=n.schema;this._listenToIfEnabled(t.document,"delete",(o,a)=>{if(o.eventPhase!="atTarget")return;const c=co(n.document.selection);if(!c)return;const u=a.direction,f=n.document.selection.getSelectedElement(),b=u=="forward";if(c==="before"===b)e.execute("delete",{selection:n.createSelection(f,"on")});else{const k=r.getNearestSelectionRange(n.createPositionAt(f,c),u);if(k)if(k.isCollapsed){const T=n.createSelection(k.start);if(n.modifySelection(T,{direction:u}),T.focus.isEqual(k.start)){const S=function(O,D){let L=D;for(const W of D.getAncestors({parentFirst:!0})){if(W.childCount>1||O.isLimit(W))break;L=W}return L}(r,k.start.parent);n.deleteContent(n.createSelection(S,"on"),{doNotAutoparagraph:!0})}else n.change(S=>{S.setSelection(k),e.execute(b?"deleteForward":"delete")})}else n.change(T=>{T.setSelection(k),e.execute(b?"deleteForward":"delete")})}a.preventDefault(),o.stop()},{context:et})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,n=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(r,[o,a])=>{if(a&&!a.is("documentSelection"))return;const c=co(n);return c?(r.stop(),t.change(u=>{const f=n.getSelectedElement(),b=t.createPositionAt(f,c),k=u.createSelection(b),T=t.insertContent(o,k);return u.setSelection(k),T})):void 0},{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(n,[r])=>{r&&!r.is("documentSelection")||co(t)&&n.stop()},{priority:"high"})}}_(65);function db(i){const e=i.model;return(t,n)=>{const r=n.keyCode==it.arrowup,o=n.keyCode==it.arrowdown,a=n.shiftKey,c=e.document.selection;if(!r&&!o)return;const u=o;if(a&&function(b,k){return!b.isCollapsed&&b.isBackward==k}(c,u))return;const f=function(b,k,T){const S=b.model;if(T){const O=k.isCollapsed?k.focus:k.getLastPosition(),D=kp(S,O,"forward");if(!D)return null;const L=S.createRange(O,D),W=yp(S.schema,L,"backward");return W&&O.isBefore(W)?S.createRange(O,W):null}{const O=k.isCollapsed?k.focus:k.getFirstPosition(),D=kp(S,O,"backward");if(!D)return null;const L=S.createRange(D,O),W=yp(S.schema,L,"forward");return W&&O.isAfter(W)?S.createRange(W,O):null}}(i,c,u);f&&!f.isCollapsed&&function(b,k,T){const S=b.model,O=b.view.domConverter;if(T){const de=S.createSelection(k.start);S.modifySelection(de),de.focus.isAtEnd||k.start.isEqual(de.focus)||(k=S.createRange(de.focus,k.end))}const D=b.mapper.toViewRange(k),L=O.viewRangeToDom(D),W=At.getDomRangeRects(L);let J;for(const de of W)if(J!==void 0){if(Math.round(de.top)>=J)return!1;J=Math.max(J,Math.round(de.bottom))}else J=Math.round(de.bottom);return!0}(i,f,u)&&(e.change(b=>{const k=u?f.end:f.start;if(a){const T=e.createSelection(c.anchor);T.setFocus(k),b.setSelection(T)}else b.setSelection(k)}),t.stop(),n.preventDefault(),n.stopPropagation())}}function kp(i,e,t){const n=i.schema,r=i.createRangeIn(e.root),o=t=="forward"?"elementStart":"elementEnd";for(const{previousPosition:a,item:c,type:u}of r.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 yp(i,e,t){const n=t=="backward"?e.end:e.start;if(i.checkChild(n,"$text"))return n;for(const{nextPosition:r}of e.getWalker({direction:t}))if(i.checkChild(r,"$text"))return r}class pl extends ve{static get pluginName(){return"Widget"}static get requires(){return[ea,ps]}init(){const e=this.editor,t=e.editing.view,n=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(r,o,a)=>{const c=a.writer,u=o.selection;if(u.isCollapsed)return;const f=u.getSelectedElement();if(!f)return;const b=e.editing.mapper.toViewElement(f);et(b)&&a.consumable.consume(u,"selection")&&c.setSelection(c.createRangeOn(b),{fake:!0,label:lb(b)})}),this.editor.editing.downcastDispatcher.on("selection",(r,o,a)=>{this._clearPreviouslySelectedWidgets(a.writer);const c=a.writer,u=c.document.selection;let f=null;for(const b of u.getRanges())for(const k of b){const T=k.item;et(T)&&!ub(T,f)&&(c.addClass("ck-widget_selected",T),this._previouslySelected.add(T),f=T)}},{priority:"low"}),t.addObserver(Wc),this.listenTo(n,"mousedown",(...r)=>this._onMousedown(...r)),this.listenTo(n,"arrowKey",(...r)=>{this._handleSelectionChangeOnArrowKeyPress(...r)},{context:[et,"$text"]}),this.listenTo(n,"arrowKey",(...r)=>{this._preventDefaultOnArrowKeyPress(...r)},{context:"$root"}),this.listenTo(n,"arrowKey",db(this.editor.editing),{context:"$text"}),this.listenTo(n,"delete",(r,o)=>{this._handleDelete(o.direction=="forward")&&(o.preventDefault(),r.stop())},{context:"$root"})}_onMousedown(e,t){const n=this.editor,r=n.editing.view,o=r.document;let a=t.target;if(function(u){for(;u;){if(u.is("editableElement")&&!u.is("rootElement"))return!0;if(et(u))return!1;u=u.parent}return!1}(a)){if((xn.isSafari||xn.isGecko)&&t.domEvent.detail>=3){const u=n.editing.mapper,f=a.is("attributeElement")?a.findAncestor(k=>!k.is("attributeElement")):a,b=u.toModelElement(f);t.preventDefault(),this.editor.model.change(k=>{k.setSelection(b,"in")})}return}if(!et(a)&&(a=a.findAncestor(et),!a))return;xn.isAndroid&&t.preventDefault(),o.isFocused||r.focus();const c=n.editing.mapper.toModelElement(a);this._setSelectionOverElement(c)}_handleSelectionChangeOnArrowKeyPress(e,t){const n=t.keyCode,r=this.editor.model,o=r.schema,a=r.document.selection,c=a.getSelectedElement(),u=bt(n,this.editor.locale.contentLanguageDirection);if(c&&o.isObject(c)){const b=u?a.getLastPosition():a.getFirstPosition(),k=o.getNearestSelectionRange(b,u?"forward":"backward");return void(k&&(r.change(T=>{T.setSelection(k)}),t.preventDefault(),e.stop()))}if(!a.isCollapsed)return;const f=this._getObjectElementNextToSelection(u);f&&o.isObject(f)&&(this._setSelectionOverElement(f),t.preventDefault(),e.stop())}_preventDefaultOnArrowKeyPress(e,t){const n=this.editor.model,r=n.schema,o=n.document.selection.getSelectedElement();o&&r.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(r=>{let o=t.anchor.parent;for(;o.isEmpty;){const a=o;o=a.parent,r.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,r=t.document.selection,o=t.createSelection(r);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 ub(i,e){return!!e&&Array.from(i.getAncestors()).includes(e)}var Ku=function(i,e,t){var n=!0,r=!0;if(typeof i!="function")throw new TypeError("Expected a function");return ne(t)&&(n="leading"in t?!!t.leading:n,r="trailing"in t?!!t.trailing:r),qa(i,e,{leading:n,maxWait:e,trailing:r})};_(67);class uo extends ve{static get pluginName(){return"DragDrop"}static get requires(){return[sn,pl]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=Ku(n=>this._updateDropMarker(n),40),this._removeDropMarkerDelayed=Lr(()=>this._removeDropMarker(),40),this._clearDraggableAttributesDelayed=Lr(()=>this._clearDraggableAttributes(),40),t.addObserver(Ze),t.addObserver(Wc),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(n,r,o)=>{o?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(n,r,o)=>{o||this._finalizeDragging(!1)}),xn.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,r=e.editing.view,o=r.document;this.listenTo(o,"dragstart",(a,c)=>{const u=n.selection;if(c.target&&c.target.is("editableElement"))return void c.preventDefault();const f=c.target?Yu(c.target):null;if(f){const T=e.editing.mapper.toModelElement(f);this._draggedRange=Di.fromRange(t.createRangeOn(T)),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}else if(!o.selection.isCollapsed){const T=o.selection.getSelectedElement();T&&et(T)||(this._draggedRange=Di.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 b=t.createSelection(this._draggedRange.toRange()),k=e.data.toView(t.getSelectedContent(b));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&&r.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=rt(e,c.targetRanges,c.target);this._draggedRange||(c.dataTransfer.dropEffect="copy"),xn.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,r)=>{if(r.method!="drop")return;const o=rt(e,r.targetRanges,r.target);if(this._removeDropMarker(),!o)return this._finalizeDragging(!1),void n.stop();if(this._draggedRange&&this._draggingUid!=r.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),Gu(r.dataTransfer)=="move"&&this._draggedRange&&this._draggedRange.containsRange(o,!0))return this._finalizeDragging(!1),void n.stop();r.targetRanges=[e.editing.mapper.toViewRange(o)]},{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(sn);e.on("contentInsertion",(t,n)=>{if(!this.isEnabled||n.method!=="drop")return;const r=n.targetRanges.map(o=>this.editor.editing.mapper.toModelRange(o));this.editor.model.change(o=>o.setSelection(r))},{priority:"high"}),e.on("contentInsertion",(t,n)=>{if(!this.isEnabled||n.method!=="drop")return;const r=Gu(n.dataTransfer)=="move",o=!n.resultRange||!n.resultRange.isCollapsed;this._finalizeDragging(o&&r)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,n=t.document;this.listenTo(n,"mousedown",(r,o)=>{if(xn.isAndroid||!o)return;this._clearDraggableAttributesDelayed.cancel();let a=Yu(o.target);if(xn.isBlink&&!e.isReadOnly&&!a&&!n.selection.isCollapsed){const c=n.selection.getSelectedElement();c&&et(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",()=>{xn.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(r){const o=this.toDomElement(r);return o.innerHTML="⁠<span></span>⁠",o})}})}_updateDropMarker(e){const t=this.editor,n=t.model.markers;t.model.change(r=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(e)||r.updateMarker("drop-target",{range:e}):r.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 rt(i,e,t){const n=i.model,r=i.editing.mapper;let o=null;const a=e?e[0].start:null;if(t.is("uiElement")&&(t=t.parent),o=function(f,b){const k=f.model,T=f.editing.mapper;if(et(b))return k.createRangeOn(T.toModelElement(b));if(!b.is("editableElement")){const S=b.findAncestor(O=>et(O)||O.is("editableElement"));if(et(S))return k.createRangeOn(T.toModelElement(S))}return null}(i,t),o)return o;const c=function(f,b){const k=f.editing.mapper,T=f.editing.view,S=k.toModelElement(b);if(S)return S;const O=T.createPositionBefore(b),D=k.findMappedViewAncestor(O);return k.toModelElement(D)}(i,t),u=a?r.toModelPosition(a):null;return u?(o=function(f,b,k){const T=f.model;if(!T.schema.checkChild(k,"$block"))return null;const S=T.createPositionAt(k,0),O=b.path.slice(0,S.path.length),D=T.createPositionFromPath(b.root,O).nodeAfter;return D&&T.schema.isObject(D)?T.createRangeOn(D):null}(i,u,c),o||(o=n.schema.getNearestSelectionRange(u,xn.isGecko?"forward":"backward"),o||function(f,b){const k=f.model;for(;b;){if(k.schema.isObject(b))return k.createRangeOn(b);b=b.parent}}(i,u.parent))):function(f,b){const k=f.model,T=k.schema,S=k.createPositionAt(b,0);return T.getNearestSelectionRange(S,"forward")}(i,c)}function Gu(i){return xn.isGecko?i.dropEffect:["all","copyMove"].includes(i.effectAllowed)?"move":"copy"}function Lr(i,e){let t;function n(...r){n.cancel(),t=setTimeout(()=>i(...r),e)}return n.cancel=()=>{clearTimeout(t)},n}function Yu(i){if(i.is("editableElement"))return null;if(i.hasClass("ck-widget__selection-handle"))return i.findAncestor(et);if(et(i))return i;const e=i.findAncestor(t=>et(t)||t.is("editableElement"));return et(e)?e:null}class hb extends ve{static get pluginName(){return"PastePlainText"}static get requires(){return[sn]}init(){const e=this.editor,t=e.model,n=e.editing.view,r=n.document,o=t.document.selection;let a=!1;n.addObserver(Ze),this.listenTo(r,"keydown",(c,u)=>{a=u.shiftKey}),e.plugins.get(sn).on("contentInsertion",(c,u)=>{(a||function(f,b){if(f.childCount>1)return!1;const k=f.getChild(0);return b.isObject(k)?!1:[...k.getAttributeKeys()].length==0}(u.content,t.schema))&&t.change(f=>{const b=Array.from(o.getAttributes()).filter(([T])=>t.schema.getAttributeProperties(T).isFormatting);o.isCollapsed||t.deleteContent(o,{doNotAutoparagraph:!0}),b.push(...o.getAttributes());const k=f.createRangeIn(u.content);for(const T of k.getItems())T.is("$textProxy")&&f.setAttributes(b,T)})})}}class Mt extends ve{static get pluginName(){return"Clipboard"}static get requires(){return[sn,uo,hb]}}class fb extends at{execute(){const e=this.editor.model,t=e.document;e.change(n=>{(function(r,o,a){const c=a.isCollapsed,u=a.getFirstRange(),f=u.start.parent,b=u.end.parent,k=f==b;if(c){const T=dn(r.schema,a.getAttributes());Qu(r,o,u.end),o.removeSelectionAttribute(a.getAttributeKeys()),o.setSelectionAttribute(T)}else{const T=!(u.start.isAtStart&&u.end.isAtEnd);r.deleteContent(a,{leaveUnmerged:T}),k?Qu(r,o,a.focus):T&&o.setSelection(b,0)}})(e,n,t.selection),this.fire("afterExecute",{writer:n})})}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(n,r){if(r.rangeCount>1)return!1;const o=r.anchor;if(!o||!n.checkChild(o,"softBreak"))return!1;const a=r.getFirstRange(),c=a.start.parent,u=a.end.parent;return!((ta(c,n)||ta(u,n))&&c!==u)}(e.schema,t.selection)}}function Qu(i,e,t){const n=e.createElement("softBreak");i.insertContent(n,t),e.setSelection(n,"after")}function ta(i,e){return!i.is("rootElement")&&(e.isLimit(i)||ta(i.parent,e))}class pb extends ve{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor,t=e.model.schema,n=e.conversion,r=e.editing.view,o=r.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")}),r.addObserver(fp),e.commands.add("shiftEnter",new fb(e)),this.listenTo(o,"enter",(a,c)=>{c.preventDefault(),c.isSoft&&(e.execute("shiftEnter"),r.scrollToTheSelection())},{priority:"low"})}}class gb extends at{execute(){const e=this.editor.model,t=e.document.selection;let n=e.schema.getLimitElement(t);if(t.containsEntireContent(n)||!xp(e.schema,n))do if(n=n.parent,!n)return;while(!xp(e.schema,n));e.change(r=>{r.setSelection(n,"in")})}}function xp(i,e){return i.isLimit(e)&&(i.checkChild(e,"$text")||i.checkChild(e,"paragraph"))}const mb=Do("Ctrl+A");class bb extends ve{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor,t=e.editing.view.document;e.commands.add("selectAll",new gb(e)),this.listenTo(t,"keydown",(n,r)=>{N(r)===mb&&(e.execute("selectAll"),r.preventDefault())})}}class vb extends ve{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",t=>{const n=e.commands.get("selectAll"),r=new nn(t),o=t.t;return r.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}),r.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(r,"execute",()=>{e.execute("selectAll"),e.editing.view.focus()}),r})}}class _b extends ve{static get requires(){return[bb,vb]}static get pluginName(){return"SelectAll"}}class wb extends at{constructor(e,t){super(e),this._buffer=new pp(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,r=e.text||"",o=r.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),r&&t.insertContent(u.createText(r,n.selection.getAttributes()),a),c?u.setSelection(c):a.is("documentSelection")||u.setSelection(a),this._buffer.unlock(),this._buffer.input(o)})}}function Cp(i){if(i.newChildren.length-i.oldChildren.length!=1)return;const e=function(n,r){const o=[];let a,c=0;return n.forEach(b=>{b=="equal"?(u(),c++):b=="insert"?(f("insert")?a.values.push(r[c]):(u(),a={type:"insert",index:c,values:[r[c]]}),c++):f("delete")?a.howMany++:(u(),a={type:"delete",index:c,howMany:1})}),u(),o;function u(){a&&(o.push(a),a=null)}function f(b){return a&&a.type==b}}(Lo(i.oldChildren,i.newChildren,kb),i.newChildren);if(e.length>1)return;const t=e[0];return t.values[0]&&t.values[0].is("$text")?t:void 0}function kb(i,e){return i&&i.is("$text")&&e&&e.is("$text")?i.data===e.data:i===e}class yb{constructor(e){this.editor=e,this.editing=this.editor.editing}handle(e,t){if(function(n){if(n.length==0)return!1;for(const r of n)if(r.type==="children"&&!Cp(r))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(Gn){const ar=Gn.map(Yn=>Yn.node).reduce((Yn,Kr)=>Yn.getCommonAncestor(Kr,{includeSelf:!0}));if(ar)return ar.getAncestors({includeSelf:!0,parentFirst:!0}).find(Yn=>Yn.is("containerElement")||Yn.is("rootElement"))}(e);if(!n)return;const r=this.editor.editing.view.domConverter.mapViewToDom(n),o=new Ii(this.editor.editing.view.document),a=this.editor.data.toModel(o.domToView(r)).getChild(0),c=this.editor.editing.mapper.toModelElement(n);if(!c)return;const u=Array.from(a.getChildren()),f=Array.from(c.getChildren()),b=u[u.length-1],k=f[f.length-1],T=b&&b.is("element","softBreak"),S=k&&!k.is("element","softBreak");T&&S&&u.pop();const O=this.editor.model.schema;if(!Tp(u,O)||!Tp(f,O))return;const D=u.map(Gn=>Gn.is("$text")?Gn.data:"@").join("").replace(/\u00A0/g," "),L=f.map(Gn=>Gn.is("$text")?Gn.data:"@").join("").replace(/\u00A0/g," ");if(L===D)return;const W=Lo(L,D),{firstChangeAt:J,insertions:de,deletions:xe}=Sp(W);let Ve=null;t&&(Ve=this.editing.mapper.toModelRange(t.getFirstRange()));const Qt=D.substr(J,de),wt=this.editor.model.createRange(this.editor.model.createPositionAt(c,J),this.editor.model.createPositionAt(c,J+xe));this.editor.execute("input",{text:Qt,range:wt,resultRange:Ve})}_handleTextMutation(e,t){if(e.type!="text")return;const n=e.newText.replace(/\u00A0/g," "),r=e.oldText.replace(/\u00A0/g," ");if(r===n)return;const o=Lo(r,n),{firstChangeAt:a,insertions:c,deletions:u}=Sp(o);let f=null;t&&(f=this.editing.mapper.toModelRange(t.getFirstRange()));const b=this.editing.view.createPositionAt(e.node,a),k=this.editing.mapper.toModelPosition(b),T=this.editor.model.createRange(k,k.getShiftedBy(u)),S=n.substr(a,c);this.editor.execute("input",{text:S,range:T,resultRange:f})}_handleTextNodeInsertion(e){if(e.type!="children")return;const t=Cp(e),n=this.editing.view.createPositionAt(e.node,t.index),r=this.editing.mapper.toModelPosition(n),o=t.values[0].data;this.editor.execute("input",{text:o.replace(/\u00A0/g," "),range:this.editor.model.createRange(r)})}}function Tp(i,e){return i.every(t=>e.isInline(t))}function Sp(i){let e=null,t=null;for(let o=0;o<i.length;o++)i[o]!="equal"&&(e=e===null?o:e,t=o);let n=0,r=0;for(let o=e;o<=t;o++)i[o]!="insert"&&n++,i[o]!="delete"&&r++;return{insertions:r,deletions:n,firstChangeAt:e}}class Gc extends ve{static get pluginName(){return"Input"}init(){const e=this.editor,t=new wb(e,e.config.get("typing.undoStep")||20);e.commands.add("input",t),function(n){let r=null;const o=n.model,a=n.editing.view,c=n.commands.get("input");function u(b){const k=o.document,T=a.document.isComposing,S=r&&r.isEqual(k.selection);r=null,c.isEnabled&&(qu(b)||k.selection.isCollapsed||T&&b.keyCode===229||!T&&b.keyCode===229&&S||f())}function f(){const b=c.buffer;b.lock();const k=b.batch;c._batches.add(k),o.enqueueChange(k,()=>{o.deleteContent(o.document.selection)}),b.unlock()}xn.isAndroid?a.document.on("beforeinput",(b,k)=>u(k),{priority:"lowest"}):a.document.on("keydown",(b,k)=>u(k),{priority:"lowest"}),a.document.on("compositionstart",function(){const b=o.document,k=b.selection.rangeCount!==1||b.selection.getFirstRange().isFlat;b.selection.isCollapsed||k||f()},{priority:"lowest"}),a.document.on("compositionend",()=>{r=o.createSelection(o.document.selection)},{priority:"lowest"})}(e),function(n){n.editing.view.document.on("mutations",(r,o,a)=>{new yb(n).handle(o,a)})}(e)}isInput(e){return this.editor.commands.get("input")._batches.has(e)}}class xb extends ve{static get requires(){return[Gc,ps]}static get pluginName(){return"Typing"}}function Yc(i,e){let t=i.start;return{text:Array.from(i.getItems()).reduce((n,r)=>r.is("$text")||r.is("$textProxy")?n+r.data:(t=e.createPositionAfter(r),""),""),range:e.createRange(t,i.end)}}class Ju{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,r=n.document.selection,o=n.createRange(n.createPositionAt(r.focus.parent,0),r.focus),{text:a,range:c}=Yc(o,n),u=this.testCallback(a);if(!u&&this.hasMatch&&this.fire("unmatched"),this.hasMatch=!!u,u){const f=Object.assign(t,{text:a,range:c});typeof u=="object"&&Object.assign(f,u),this.fire("matched:"+e,f)}}}Be(Ju,Gt);class Ap extends ve{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,r=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==it.arrowright,f=c.keyCode==it.arrowleft;if(!u&&!f)return;const b=r.contentLanguageDirection;let k=!1;k=b==="ltr"&&u||b==="rtl"&&f?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&&Qc(o.getFirstPosition(),this.attributes)||this._restoreGravity())})}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,n=this.editor.model.document.selection,r=n.getFirstPosition();return!this._isGravityOverridden&&(!r.isAtStart||!Xu(n,t))&&(Qc(r,t)?(Ln(e),this._overrideGravity(),!0):void 0)}_handleBackwardMovement(e){const t=this.attributes,n=this.editor.model,r=n.document.selection,o=r.getFirstPosition();return this._isGravityOverridden?(Ln(e),this._restoreGravity(),_n(n,t,o),!0):o.isAtStart?!!Xu(r,t)&&(Ln(e),_n(n,t,o),!0):function(a,c){return Qc(a.getShiftedBy(-1),c)}(o,t)?o.isAtEnd&&!Xu(r,t)&&Qc(o,t)?(Ln(e),_n(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 Xu(i,e){for(const t of e)if(i.hasAttribute(t))return!0;return!1}function _n(i,e,t){const n=t.nodeBefore;i.change(r=>{n?r.setSelectionAttribute(n.getAttributes()):r.removeSelectionAttribute(e)})}function Ln(i){i.preventDefault()}function Qc(i,e){const{nodeBefore:t,nodeAfter:n}=i;for(const r of e){const o=t?t.getAttribute(r):void 0;if((n?n.getAttribute(r):void 0)!==o)return!0}return!1}var Ep=/[\\^$.*+?()[\]{}|]/g,Cb=RegExp(Ep.source),Pp=function(i){return(i=In(i))&&Cb.test(i)?i.replace(Ep,"\\$&"):i};const Tb={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:na('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:na("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:na("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:na('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:na('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:na("'"),to:[null,"‚",null,"’"]}},Ip={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},Sb=["symbols","mathematical","typography","quotes"];function Mp(i){return typeof i=="string"?new RegExp(`(${Pp(i)})$`):i}function Ab(i){return typeof i=="string"?()=>[i]:i instanceof Array?()=>i:i}function Eb(i){return(i.textNode?i.textNode:i.nodeAfter).getAttributes()}function na(i){return new RegExp(`(^|\\s)(${i})([^${i}]*)(${i})$`)}function ms(i,e,t,n){return n.createRange(Zu(i,e,t,!0,n),Zu(i,e,t,!1,n))}function Zu(i,e,t,n,r){let o=i.textNode||(n?i.nodeBefore:i.nodeAfter),a=null;for(;o&&o.getAttribute(e)==t;)a=o,o=n?o.previousSibling:o.nextSibling;return a?r.createPositionAt(a,n?"before":"after"):i}class Op extends at{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this.listenTo(e.data,"set",(t,n)=>{n[1]={...n[1]};const r=n[1];r.batchType||(r.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 r=this.editor.model,o=r.document,a=[],c=e.map(f=>f.getTransformedByOperations(n)),u=c.flat();for(const f of c){const b=f.filter(k=>k.root!=o.graveyard).filter(k=>!Ib(k,u));b.length&&(Pb(b),a.push(b[0]))}a.length&&r.change(f=>{f.setSelection(a,{backward:t})})}_undo(e,t){const n=this.editor.model,r=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(r.history.getOperations(c)),f=tb([a.getReversed()],u,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const b of f)t.addOperation(b),n.applyOperation(b),r.history.setOperationAsUndone(a,b)}}}function Pb(i){i.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let e=1;e<i.length;e++){const t=i[e-1].getJoined(i[e],!0);t&&(e--,i.splice(e,2,t))}}function Ib(i,e){return e.some(t=>t!==i&&t.containsRange(i,!0))}class Mb extends Op{execute(e=null){const t=e?this._stack.findIndex(o=>o.batch==e):this._stack.length-1,n=this._stack.splice(t,1)[0],r=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(r,()=>{this._undo(n.batch,r);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,r)}),this.refresh()}}class ra extends Op{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,r=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,r),this._undo(e.batch,t)}),this.refresh()}}class Ob extends ve{static get pluginName(){return"UndoEditing"}constructor(e){super(e),this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new Mb(e),this._redoCommand=new ra(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(t,n)=>{const r=n[0];if(!r.isDocumentOperation)return;const o=r.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,r)=>{this._redoCommand.addBatch(r)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo")}}var Np='<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>',Rp='<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 Nb extends ve{static get pluginName(){return"UndoUI"}init(){const e=this.editor,t=e.locale,n=e.t,r=t.uiLanguageDirection=="ltr"?Np:Rp,o=t.uiLanguageDirection=="ltr"?Rp:Np;this._addButton("undo",n("Undo"),"CTRL+Z",r),this._addButton("redo",n("Redo"),"CTRL+Y",o)}_addButton(e,t,n,r){const o=this.editor;o.ui.componentFactory.add(e,a=>{const c=o.commands.get(e),u=new nn(a);return u.set({label:t,icon:r,keystroke:n,tooltip:!0}),u.bind("isEnabled").to(c,"isEnabled"),this.listenTo(u,"execute",()=>{o.execute(e),o.editing.view.focus()}),u})}}class Dp extends ve{static get requires(){return[Ob,Nb]}static get pluginName(){return"Undo"}}class eh{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,r)=>{t.onload=()=>{const o=t.result;this._data=o,n(o)},t.onerror=()=>{r("error")},t.onabort=()=>{r("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}Be(eh,Gt);class ci extends ve{static get pluginName(){return"FileRepository"}static get requires(){return[Nf]}init(){this.loaders=new ur,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 th(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 r of this.loaders)n+=r.uploaded;this.uploaded=n}),t.on("change:uploadTotal",()=>{let n=0;for(const r of this.loaders)r.uploadTotal&&(n+=r.uploadTotal);this.uploadTotal=n}),t}destroyLoader(e){const t=e instanceof th?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((n,r)=>{n===t&&this._loadersMap.delete(r)})}_updatePendingAction(){const e=this.editor.plugins.get(Nf);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,n=r=>`${t("Upload in progress")} ${parseInt(r)}%.`;this._pendingAction=e.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else e.remove(this._pendingAction),this._pendingAction=null}}Be(ci,Gt);class th{constructor(e,t){this.id=P(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new eh,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(n,r)=>r?n/r*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,r)=>{t.rejecter=r,t.isFulfilled=!1,e.then(o=>{t.isFulfilled=!0,n(o)}).catch(o=>{t.isFulfilled=!0,r(o)})}),t}}Be(th,Gt);class Rb extends ct{constructor(e){super(e),this.buttonView=new nn(e),this._fileInputView=new Db(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 Db extends ct{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 jb(){let i=function(n){n=n.toLowerCase();const r=document.cookie.split(";");for(const o of r){const a=o.split("=");if(decodeURIComponent(a[0].trim().toLowerCase())===n)return decodeURIComponent(a[1])}return null}("ckCsrfToken");var e,t;return i&&i.length==40||(i=function(n){let r="";const o=new Uint8Array(n);window.crypto.getRandomValues(o);for(let a=0;a<o.length;a++){const c="abcdefghijklmnopqrstuvwxyz0123456789".charAt(o[a]%36);r+=Math.random()>.5?c.toUpperCase():c}return r}(40),e="ckCsrfToken",t=i,document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/"),i}class Lb{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 r=this.xhr,o=this.loader,a=(0,this.t)("Cannot upload file:")+` ${n.name}.`;r.addEventListener("error",()=>t(a)),r.addEventListener("abort",()=>t()),r.addEventListener("load",()=>{const c=r.response;if(!c||!c.uploaded)return t(c&&c.error&&c.error.message?c.error.message:a);e({default:c.url})}),r.upload&&r.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",jb()),this.xhr.send(t)}}function Vo(i,e,t,n){let r,o=null;typeof n=="function"?r=n:(o=i.commands.get(n),r=()=>{i.execute(n)}),i.model.document.on("change:data",(a,c)=>{if(o&&!o.isEnabled||!e.isEnabled)return;const u=pr(i.model.document.selection.getRanges());if(!u.isCollapsed||c.type=="transparent")return;const f=Array.from(i.model.document.differ.getChanges()),b=f[0];if(f.length!=1||b.type!=="insert"||b.name!="$text"||b.length!=1)return;const k=b.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 T=k.getChild(0),S=i.model.createRangeOn(T);if(!S.containsRange(u)&&!u.end.isEqual(S.end))return;const O=t.exec(T.data.substr(0,u.end.offset));O&&i.model.enqueueChange(D=>{const L=D.createPositionAt(k,0),W=D.createPositionAt(k,O[0].length),J=new Di(L,W);if(r({match:O})!==!1){D.remove(J);const de=i.model.document.selection.getFirstRange(),xe=D.createRangeIn(k);!k.isEmpty||xe.isEqual(de)||xe.containsRange(de,!0)||D.remove(k)}J.detach()})})}function ia(i,e,t,n){let r,o;t instanceof RegExp?r=t:o=t,o=o||(a=>{let c;const u=[],f=[];for(;(c=r.exec(a))!==null&&!(c&&c.length<4);){let{index:b,1:k,2:T,3:S}=c;const O=k+T+S;b+=c[0].length-O.length;const D=[b,b+k.length],L=[b+k.length+T.length,b+k.length+T.length+S.length];u.push(D),u.push(L),f.push([b+k.length,b+k.length+T.length])}return{remove:u,format:f}}),i.model.document.on("change:data",(a,c)=>{if(c.type=="transparent"||!e.isEnabled)return;const u=i.model,f=u.document.selection;if(!f.isCollapsed)return;const b=Array.from(u.document.differ.getChanges()),k=b[0];if(b.length!=1||k.type!=="insert"||k.name!="$text"||k.length!=1)return;const T=f.focus,S=T.parent,{text:O,range:D}=function(de,xe){let Ve=de.start;return{text:Array.from(de.getItems()).reduce((Qt,wt)=>!wt.is("$text")&&!wt.is("$textProxy")||wt.getAttribute("code")?(Ve=xe.createPositionAfter(wt),""):Qt+wt.data,""),range:xe.createRange(Ve,de.end)}}(u.createRange(u.createPositionAt(S,0),T),u),L=o(O),W=jp(D.start,L.format,u),J=jp(D.start,L.remove,u);W.length&&J.length&&u.enqueueChange(de=>{if(n(de,W)!==!1)for(const xe of J.reverse())de.remove(xe)})})}function jp(i,e,t){return e.filter(n=>n[0]!==void 0&&n[1]!==void 0).map(n=>t.createRange(i.getShiftedBy(n[0]),i.getShiftedBy(n[1])))}function Jc(i,e){return(t,n)=>{if(!i.commands.get(e).isEnabled)return!1;const r=i.model.schema.getValidRanges(n,e);for(const o of r)t.setAttribute(e,!0,o);t.removeSelectionAttribute(e)}}class Lp extends at{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,r=e.forceValue===void 0?!this.value:e.forceValue;t.change(o=>{if(n.isCollapsed)r?o.setSelectionAttribute(this.attributeKey,!0):o.removeSelectionAttribute(this.attributeKey);else{const a=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const c of a)r?o.setAttribute(this.attributeKey,r,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 r of n.getRanges())for(const o of r.getItems())if(t.checkAttribute(o,this.attributeKey))return o.hasAttribute(this.attributeKey);return!1}}class zb extends ve{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 Lp(e,"bold")),e.keystrokes.set("CTRL+B","bold")}}class Fb extends ve{static get pluginName(){return"BoldUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("bold",n=>{const r=e.commands.get("bold"),o=new nn(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(r,"value","isEnabled"),this.listenTo(o,"execute",()=>{e.execute("bold"),e.editing.view.focus()}),o})}}class Bb extends ve{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 Lp(e,"italic")),e.keystrokes.set("CTRL+I","italic")}}class Vb extends ve{static get pluginName(){return"ItalicUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("italic",n=>{const r=e.commands.get("italic"),o=new nn(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(r,"value","isEnabled"),this.listenTo(o,"execute",()=>{e.execute("italic"),e.editing.view.focus()}),o})}}class $b extends at{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.schema,r=t.document.selection,o=Array.from(r.getSelectedBlocks()),a=e.forceValue===void 0?!this.value:e.forceValue;t.change(c=>{if(a){const u=o.filter(f=>Xc(f)||Fp(n,f));this._applyQuote(c,u)}else this._removeQuote(c,o.filter(Xc))})}_getValue(){const e=pr(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!Xc(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=pr(e.getSelectedBlocks());return!!n&&Fp(t,n)}_removeQuote(e,t){zp(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 r=e.createPositionAfter(n.end.parent);e.move(n,r)})}_applyQuote(e,t){const n=[];zp(e,t).reverse().forEach(r=>{let o=Xc(r.start);o||(o=e.createElement("blockQuote"),e.wrap(r,o)),n.push(o)}),n.reverse().reduce((r,o)=>r.nextSibling==o?(e.merge(e.createPositionAfter(r)),r):o)}}function Xc(i){return i.parent.name=="blockQuote"?i.parent:null}function zp(i,e){let t,n=0;const r=[];for(;n<e.length;){const o=e[n],a=e[n+1];t||(t=i.createPositionBefore(o)),a&&o.nextSibling==a||(r.push(i.createRange(t,i.createPositionAfter(o))),t=null),n++}return r}function Fp(i,e){const t=i.checkChild(e.parent,"blockQuote"),n=i.checkChild(["$root","blockQuote"],e);return t&&n}class Hb extends ve{static get pluginName(){return"BlockQuoteEditing"}static get requires(){return[qc,ps]}init(){const e=this.editor,t=e.model.schema;e.commands.add("blockQuote",new $b(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 f=u.position.nodeAfter;if(!f)continue;if(f.is("element","blockQuote")&&f.isEmpty)return a.remove(f),!0;if(f.is("element","blockQuote")&&!t.checkChild(u.position,f))return a.unwrap(f),!0;if(f.is("element")){const b=a.createRangeIn(f);for(const k of b.getItems())if(k.is("element","blockQuote")&&!t.checkChild(a.createPositionBefore(k),k))return a.unwrap(k),!0}}else if(u.type=="remove"){const f=u.position.parent;if(f.is("element","blockQuote")&&f.isEmpty)return a.remove(f),!0}return!1});const n=this.editor.editing.view.document,r=e.model.document.selection,o=e.commands.get("blockQuote");this.listenTo(n,"enter",(a,c)=>{!r.isCollapsed||!o.value||r.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"||!r.isCollapsed||!o.value)return;const u=r.getLastPosition().parent;u.isEmpty&&!u.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),c.preventDefault(),a.stop())},{context:"blockquote"})}}_(69);class Ub extends ve{static get pluginName(){return"BlockQuoteUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("blockQuote",n=>{const r=e.commands.get("blockQuote"),o=new nn(n);return o.set({label:t("Block quote"),icon:Rr.quote,tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(o,"execute",()=>{e.execute("blockQuote"),e.editing.view.focus()}),o})}}class Wb extends ve{static get pluginName(){return"CKFinderUI"}init(){const e=this.editor,t=e.ui.componentFactory,n=e.t;t.add("ckfinder",r=>{const o=e.commands.get("ckfinder"),a=new nn(r);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 qb extends at{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 r=n.onInit;n.language||(n.language=e.locale.uiLanguage),n.onInit=o=>{r&&r(o),o.on("files:choose",a=>{const c=a.data.files.toArray(),u=c.filter(k=>!k.isImage()),f=c.filter(k=>k.isImage());for(const k of u)e.execute("link",k.getUrl());const b=[];for(const k of f){const T=k.getUrl();b.push(T||o.request("file:getProxyUrl",{file:k}))}b.length&&Bp(e,b)}),o.on("file:choose:resizedImage",a=>{const c=a.data.resizedUrl;if(c)Bp(e,[c]);else{const u=e.plugins.get("Notification"),f=e.locale.t;u.showWarning(f("Could not obtain resized image URL."),{title:f("Selecting resized image failed"),namespace:"ckfinder"})}})},window.CKFinder[t](n)}}function Bp(i,e){if(i.commands.get("insertImage").isEnabled)i.execute("insertImage",{source:e});else{const t=i.plugins.get("Notification"),n=i.locale.t;t.showWarning(n("Could not insert image at the current position."),{title:n("Inserting image failed"),namespace:"ckfinder"})}}class Kb extends ve{static get pluginName(){return"CKFinderEditing"}static get requires(){return[Vu,"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 qb(e))}}class Gb extends ve{static get pluginName(){return"CloudServicesUploadAdapter"}static get requires(){return["CloudServices",ci]}init(){const e=this.editor,t=e.plugins.get("CloudServices"),n=t.token,r=t.uploadUrl;n&&(this._uploadGateway=e.plugins.get("CloudServicesCore").createUploadGateway(n,r),e.plugins.get(ci).createUploadAdapter=o=>new nh(this._uploadGateway,o))}}class nh{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 Vp extends at{refresh(){const e=this.editor.model,t=pr(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&rh(t,e.schema)}execute(e={}){const t=this.editor.model,n=t.document;t.change(r=>{const o=(e.selection||n.selection).getSelectedBlocks();for(const a of o)!a.is("element","paragraph")&&rh(a,t.schema)&&r.rename(a,"paragraph")})}}function rh(i,e){return e.checkChild(i.parent,"paragraph")&&!e.isObject(i)}class Yb extends at{execute(e){const t=this.editor.model;let n=e.position;t.change(r=>{const o=r.createElement("paragraph");if(!t.schema.checkChild(n.parent,o)){const a=t.schema.findAllowedParent(n,o);if(!a)return;n=r.split(n,a).position}t.insertContent(o,n),r.setSelection(o,"in")})}}class gl extends ve{static get pluginName(){return"Paragraph"}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new Vp(e)),e.commands.add("insertParagraph",new Yb(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(n,{writer:r})=>gl.paragraphLikeElements.has(n.name)?n.isEmpty?null:r.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}gl.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class Qb extends at{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=pr(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>Zc(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,n=t.document,r=e.value;t.change(o=>{const a=Array.from(n.selection.getSelectedBlocks()).filter(c=>Zc(c,r,t.schema));for(const c of a)c.is("element",r)||o.rename(c,r)})}}function Zc(i,e,t){return t.checkChild(i.parent,e)&&!t.isObject(i)}class Jb extends ve{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[gl]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const r of t)r.model!=="paragraph"&&(e.model.schema.register(r.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(r),n.push(r.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new Qb(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(r,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:F.get("low")+1})}}_(13);class Xb extends ve{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(f=>{const b=u[f.title];return b&&b!=f.title&&(f.title=b),f})}(e),r=t("Choose heading"),o=t("Heading");e.ui.componentFactory.add("heading",a=>{const c={},u=new ur,f=e.commands.get("heading"),b=e.commands.get("paragraph"),k=[f];for(const S of n){const O={type:"button",model:new $u({label:S.title,class:S.class,withText:!0})};S.model==="paragraph"?(O.model.bind("isOn").to(b,"value"),O.model.set("commandName","paragraph"),k.push(b)):(O.model.bind("isOn").to(f,"value",D=>D===S.model),O.model.set({commandName:"heading",commandValue:S.model})),u.add(O),c[S.model]=S.title}const T=hs(a);return Zf(T,u),T.buttonView.set({isOn:!1,withText:!0,tooltip:o}),T.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),T.bind("isEnabled").toMany(k,"isEnabled",(...S)=>S.some(O=>O)),T.buttonView.bind("label").to(f,"value",b,"value",(S,O)=>{const D=S||O&&"paragraph";return c[D]?c[D]:r}),this.listenTo(T,"execute",S=>{e.execute(S.source.commandName,S.source.commandValue?{value:S.source.commandValue}:void 0),e.editing.view.focus()}),T})}}class ed extends ve{static get requires(){return[cl]}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(r){const o=r.getSelectedElement();return!(!o||!et(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:r,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 zu(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:r,balloonClassName:o})}_updateToolbarsVisibility(){let e=0,t=null,n=null;for(const r of this._toolbarDefinitions.values()){const o=r.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=r)}else this._isToolbarVisible(r)&&this._hideToolbar(r);else this._isToolbarInBalloon(r)&&this._hideToolbar(r)}n&&this._showToolbar(n,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?sr(this.editor,t):this._isToolbarInBalloon(e)||(this._balloon.add({view:e.view,position:td(this.editor,t),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const n of this._toolbarDefinitions.values())if(this._isToolbarVisible(n)){const r=n.getRelatedElement(this.editor.editing.view.document.selection);sr(this.editor,r)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function sr(i,e){const t=i.plugins.get("ContextualBalloon"),n=td(i,e);t.updatePosition(n)}function td(i,e){const t=i.editing.view,n=st.defaultPositions;return{target:t.domConverter.mapViewToDom(e),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,cb]}}class $p{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 r=new At(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 At(a),f=c.split("-"),b={x:f[1]=="right"?u.right:u.left,y:f[0]=="bottom"?u.bottom:u.top};return b.x+=a.ownerDocument.defaultView.scrollX,b.y+=a.ownerDocument.defaultView.scrollY,b}(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=r.width,this.originalHeight=r.height,this.aspectRatio=r.width/r.height;const o=n.style.width;o&&o.match(/^\d+(\.\d*)?%$/)?this.originalWidthPercents=parseFloat(o):this.originalWidthPercents=function(a,c){const u=a.parentElement,f=parseFloat(u.ownerDocument.defaultView.getComputedStyle(u).width);return c.width/f*100}(n,r)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}Be($p,Gt);class Zb extends ct{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,r)=>n!==null&&r!==null),this.bind("_label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",(n,r,o)=>e.unit==="px"?`${n}×${r}`:o+"%"),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",(n,r,o)=>r<50||o<50?"above-center":n)}_dismiss(){this.unbind(),this._isVisible=!1}}class ih{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 r=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,f)=>{a.style.display=f?"":"none"}),a.style.display=e.isEnabled?"":"none",a});n.insert(n.createPositionAt(t,"end"),r),n.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=r})}begin(e){this.state=new $p(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(),r=new At(n);t.handleHostWidth=Math.round(r.width),t.handleHostHeight=Math.round(r.height);const o=new At(n);t.width=Math.round(o.width),t.height=Math.round(o.height),this.redraw(r),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 r=t.parentElement,o=this._getHandleHost(),a=this._viewResizerWrapper,c=[a.getStyle("width"),a.getStyle("height"),a.getStyle("left"),a.getStyle("top")];let u;if(r.isSameNode(o)){const f=e||new At(o);u=[f.width+"px",f.height+"px",void 0,void 0]}else u=[o.offsetWidth+"px",o.offsetHeight+"px",o.offsetLeft+"px",o.offsetTop+"px"];Sn(c,u)!=="same"&&this._options.editor.editing.view.change(f=>{f.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:(r=e).pageX,y:r.pageY};var r;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 r of t)e.appendChild(new Dr({tag:"div",attributes:{class:"ck-widget__resizer__handle "+(n=r,"ck-widget__resizer__handle-"+n)}}).render());var n}_appendSizeUI(e){this._sizeView=new Zb,this._sizeView.render(),e.appendChild(this._sizeView.element)}}Be(ih,Gt),_(72),Be(class extends ve{static get pluginName(){return"WidgetResize"}init(){const i=this.editor.editing,e=Ut.window.document;this.set("visibleResizer",null),this.set("_activeResizer",null),this._resizers=new Map,i.view.addObserver(Wc),this._observer=Object.create(ss),this.listenTo(i.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=Ku(t,200),this.on("change:visibleResizer",t),this.editor.ui.on("update",this._redrawFocusedResizerThrottled),this.editor.model.document.on("change",()=>{for(const[r,o]of this._resizers)r.isAttached()||(this._resizers.delete(r),o.destroy())},{priority:"lowest"}),this._observer.listenTo(Ut.window,"resize",this._redrawFocusedResizerThrottled);const n=this.editor.editing.view.document.selection;n.on("change",()=>{const r=n.getSelectedElement();this.visibleResizer=this.getResizerByViewElement(r)||null})}destroy(){this._observer.stopListening();for(const i of this._resizers.values())i.destroy();this._redrawFocusedResizerThrottled.cancel()}attachTo(i){const e=new ih(i),t=this.editor.plugins;if(e.attach(),t.has("WidgetToolbarRepository")){const r=t.get("WidgetToolbarRepository");e.on("begin",()=>{r.forceDisabled("resize")},{priority:"lowest"}),e.on("cancel",()=>{r.clearForceDisabled("resize")},{priority:"highest"}),e.on("commit",()=>{r.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(i.viewElement,e);const n=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(n)==e&&(this.visibleResizer=e),e}getResizerByViewElement(i){return this._resizers.get(i)}_getResizerByHandle(i){for(const e of this._resizers.values())if(e.containsHandle(i))return e}_mouseDownListener(i,e){const t=e.domTarget;ih.isResizeHandle(t)&&(this._activeResizer=this._getResizerByHandle(t),this._activeResizer&&(this._activeResizer.begin(t),i.stop(),e.preventDefault()))}_mouseMoveListener(i,e){this._activeResizer&&this._activeResizer.updateSize(e)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}},Gt);class ev extends at{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"),r=t.model,o=n.getClosestSelectedImageElement(r.document.selection);r.change(a=>{a.setAttribute("alt",e.newValue,o)})}}function ml(i,e){const t=i.createEmptyElement("img"),n=e==="imageBlock"?i.createContainerElement("figure",{class:"image"}):i.createContainerElement("span",{class:"image-inline"},{isAllowedInsideAttributeElement:!0});return i.insert(i.createPositionAt(n,0),t),n}function Hp(i,e){if(i.plugins.has("ImageInlineEditing")!==i.plugins.has("ImageBlockEditing"))return{name:"img",attributes:{src:!0}};const t=i.plugins.get("ImageUtils");return n=>!t.isInlineImageView(n)||!n.hasAttribute("src")||(n.findAncestor(t.isBlockImageView)?"imageBlock":"imageInline")!==e?null:{name:!0,attributes:["src"]}}function bl(i,e){const t=pr(e.getSelectedBlocks());return!t||i.isObject(t)||t.isEmpty&&t.name!="listItem"?"imageBlock":"imageInline"}class Bi extends ve{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 r=this.editor,o=r.model,a=o.document.selection;n=Up(r,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=hl(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(Up(t,n)=="imageBlock"){const r=function(o,a){const c=hl(o,a).start.parent;return c.isEmpty&&!c.is("element","$root")?c.parent:c}(n,t.model);if(t.model.schema.checkChild(r,"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),rn(e,t,{label:()=>{const r=this.findViewImgElement(e).getAttribute("alt");return r?`${r} ${n}`:n}})}isImageWidget(e){return!!e.getCustomProperty("image")&&et(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 Up(i,e,t){const n=i.model.schema,r=i.config.get("image.insert.type");return i.plugins.has("ImageBlockEditing")?i.plugins.has("ImageInlineEditing")?t||(r==="inline"?"imageInline":r==="block"?"imageBlock":e.is("selection")?bl(n,e):n.checkChild(e,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class tv extends ve{static get requires(){return[Bi]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new ev(this.editor))}}_(74),_(7);class nv extends ct{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new Ur,this.keystrokes=new Ir,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),Rr.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),Rr.cancel,"ck-button-cancel","cancel"),this._focusables=new ds,this._focusCycler=new Ks({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]}),Nu(this)}render(){super.render(),this.keystrokes.listenTo(this.element),Ru({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}_createButton(e,t,n,r){const o=new nn(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),r&&o.delegate("execute").to(this,r),o}_createLabeledInputView(){const e=this.locale.t,t=new Fu(this.locale,Bu);return t.label=e("Text alternative"),t}}function oh(i){const e=i.editing.view,t=st.defaultPositions,n=i.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 rv extends ve{static get requires(){return[cl]}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 r=e.commands.get("imageTextAlternative"),o=new nn(n);return o.set({label:t("Change image text alternative"),icon:Rr.lowVision,tooltip:!0}),o.bind("isEnabled").to(r,"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 nv(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",(r,o)=>{this._hideForm(!0),o()}),this.listenTo(e.ui,"update",()=>{n.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(r){const o=r.plugins.get("ContextualBalloon");if(r.plugins.get("ImageUtils").getClosestSelectedImageWidget(r.editing.view.document.selection)){const a=oh(r);o.updatePosition(a)}}(e):this._hideForm(!0)}),Ou({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:oh(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 Wp extends ve{static get requires(){return[tv,rv]}static get pluginName(){return"ImageTextAlternative"}}function qp(i,e){return n=>{n.on("attribute:srcset:"+e,t)};function t(n,r,o){if(!o.consumable.consume(r.item,n.name))return;const a=o.writer,c=o.mapper.toViewElement(r.item),u=i.findViewImgElement(c);if(r.attributeNewValue===null){const f=r.attributeOldValue;f.data&&(a.removeAttribute("srcset",u),a.removeAttribute("sizes",u),f.width&&a.removeAttribute("width",u))}else{const f=r.attributeNewValue;f.data&&(a.setAttribute("srcset",f.data,u),a.setAttribute("sizes","100vw",u),f.width&&a.setAttribute("width",f.width,u))}}}function oa(i,e,t){return r=>{r.on(`attribute:${t}:${e}`,n)};function n(r,o,a){if(!a.consumable.consume(o.item,r.name))return;const c=a.writer,u=a.mapper.toViewElement(o.item),f=i.findViewImgElement(u);c.setAttribute(o.attributeKey,o.attributeNewValue||"",f)}}class sh extends Mi{observe(e){this.listenTo(e,"load",(t,n)=>{const r=n.target;this.checkShouldIgnoreEventFromTarget(r)||r.tagName=="IMG"&&this._fireEvents(n)},{useCapture:!0})}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class iv extends at{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=Pt(e.source),n=this.editor.model.document.selection,r=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&&r.isImage(u)){const f=this.editor.model.createPositionAfter(u);r.insertImage({...a,...o},f)}else r.insertImage({...a,...o})})}}class Kp extends ve{static get requires(){return[Bi]}static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(sh),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:r=>{const o={data:r.getAttribute("srcset")};return r.hasAttribute("width")&&(o.width=r.getAttribute("width")),o}}});const n=new iv(e);e.commands.add("insertImage",n),e.commands.add("imageInsert",n)}}class Gp extends at{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"),r=n.getClosestSelectedImageElement(t.document.selection),o=Object.fromEntries(r.getAttributes());return o.src||o.uploadId?t.change(a=>{const c=Array.from(t.markers).filter(b=>b.getRange().containsItem(r)),u=n.insertImage(o,t.createSelection(r,"on"),this._modelElementName);if(!u)return null;const f=a.createRangeOn(u);for(const b of c){const k=b.getRange(),T=k.root.rootName!="$graveyard"?k.getJoined(f,!0):f;a.updateMarker(b,{range:T})}return{oldElement:r,newElement:u}}):null}}class Yp extends ve{static get requires(){return[Kp,Bi,sn]}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 Gp(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,r=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageBlock",view:(o,{writer:a})=>ml(a,"imageBlock")}),n.for("editingDowncast").elementToElement({model:"imageBlock",view:(o,{writer:a})=>r.toImageWidget(ml(a,"imageBlock"),a,t("image widget"))}),n.for("downcast").add(oa(r,"imageBlock","src")).add(oa(r,"imageBlock","alt")).add(qp(r,"imageBlock")),n.for("upcast").elementToElement({view:Hp(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,f){if(!f.consumable.test(u.viewItem,{name:!0,classes:"image"}))return;const b=o.findViewImgElement(u.viewItem);if(!b||!b.hasAttribute("src")||!f.consumable.test(b,{name:!0}))return;const k=pr(f.convertItem(b,u.modelCursor).modelRange.getItems());k&&(f.convertChildren(u.viewItem,k),f.updateConversionResult(k,u))}}(r))}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,r=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(r.isInlineImageView))return;u=a.targetRanges?e.editing.mapper.toModelRange(a.targetRanges[0]):t.document.selection.getFirstRange();const f=t.createSelection(u);if(bl(t.schema,f)==="imageBlock"){const b=new Zs(n.document),k=c.map(T=>b.createElement("figure",{class:"image"},T));a.content=b.createDocumentFragment(k)}})}}_(11);class ov extends ve{static get requires(){return[Yp,pl,Wp]}static get pluginName(){return"ImageBlock"}}class sv extends ve{static get requires(){return[Kp,Bi,sn]}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,r)=>{if(n.endsWith("caption")&&r.name==="imageInline")return!1}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new Gp(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,r=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})=>r.toImageWidget(ml(a,"imageInline"),a,t("image widget"))}),n.for("downcast").add(oa(r,"imageInline","src")).add(oa(r,"imageInline","alt")).add(qp(r,"imageInline")),n.for("upcast").elementToElement({view:Hp(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,r=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(r.isBlockImageView))return;u=a.targetRanges?e.editing.mapper.toModelRange(a.targetRanges[0]):t.document.selection.getFirstRange();const f=t.createSelection(u);if(bl(t.schema,f)==="imageInline"){const b=new Zs(n.document),k=c.map(T=>T.childCount===1?(Array.from(T.getAttributes()).forEach(S=>b.setAttribute(...S,r.findViewImgElement(T))),T.getChild(0)):T);a.content=b.createDocumentFragment(k)}})}}class av extends ve{static get requires(){return[sv,pl,Wp]}static get pluginName(){return"ImageInline"}}function ah(i){for(const e of i.getChildren())if(e&&e.is("element","caption"))return e;return null}function lh(i,e){const t=e.getFirstPosition().findAncestor("caption");return t&&i.isBlockImage(t.parent)?t:null}class lv extends at{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils");if(!e.plugins.has(Yp))return this.isEnabled=!1,void(this.value=!1);const n=e.model.document.selection,r=n.getSelectedElement();if(!r){const o=lh(t,n);return this.isEnabled=!!o,void(this.value=!!o)}this.isEnabled=this.editor.plugins.get("ImageUtils").isImage(r),this.isEnabled?this.value=!!ah(r):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,r=this.editor.plugins.get("ImageCaptionEditing");let o=n.getSelectedElement();const a=r._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,r=t.plugins.get("ImageCaptionEditing"),o=t.plugins.get("ImageUtils");let a,c=n.getSelectedElement();c?a=ah(c):(a=lh(o,n),c=a.parent),r._saveCaption(c,a),e.setSelection(c,"on"),e.remove(a)}}class cv extends ve{static get requires(){return[Bi]}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 lv(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration()}_setupConversion(){const e=this.editor,t=e.editing.view,n=e.plugins.get("ImageUtils"),r=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),op({view:t,element:c,text:r("Enter image caption"),keepOnFocus:!0});const u=Wu(c,a);return Kc(u,a,(f,b,k)=>k.addClass(Pt(b.classes),f),(f,b,k)=>k.removeClass(Pt(b.classes),f)),u}}),e.editing.mapper.on("modelToViewPosition",Qp(t)),e.data.mapper.on("modelToViewPosition",Qp(t))}_setupImageTypeCommandsIntegration(){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.commands.get("imageTypeInline"),r=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 b=ah(c);if(b)return void this._saveCaption(u,b)}const f=this._getSavedCaption(c);f&&this._saveCaption(u,f)};n&&this.listenTo(n,"execute",o,{priority:"low"}),r&&this.listenTo(r,"execute",o,{priority:"low"})}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?Dt.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}}function Qp(i){return(e,t)=>{const n=t.modelPosition,r=n.parent;if(!r.is("element","imageBlock"))return;const o=t.mapper.toViewElement(r);t.viewPosition=i.createPositionAt(o,n.offset+1)}}class dv extends ve{static get requires(){return[Bi]}static get pluginName(){return"ImageCaptionUI"}init(){const e=this.editor,t=e.editing.view,n=e.plugins.get("ImageUtils"),r=e.t;e.ui.componentFactory.add("toggleImageCaption",o=>{const a=e.commands.get("toggleImageCaption"),c=new nn(o);return c.set({icon:Rr.caption,tooltip:!0,isToggleable:!0}),c.bind("isOn","isEnabled").to(a,"value","isEnabled"),c.bind("label").to(a,"value",u=>r(u?"Toggle caption off":"Toggle caption on")),this.listenTo(c,"execute",()=>{e.execute("toggleImageCaption",{focusCaptionOnShow:!0});const u=lh(n,e.model.document.selection);if(u){const f=e.editing.mapper.toViewElement(u);t.scrollToTheSelection(),t.change(b=>{b.addClass("image__caption_highlighted",f)})}}),c})}}_(78);class uv extends at{constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map(n=>{if(n.isDefault)for(const r of n.modelElements)this._defaultStyles[r]=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,r=t.plugins.get("ImageUtils");n.change(o=>{const a=e.value;let c=r.getClosestSelectedImageElement(n.document.selection);a&&this.shouldConvertImageType(a,c)&&(this.editor.execute(r.isBlockImage(c)?"imageTypeInline":"imageTypeBlock"),c=r.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:hv,objectInline:Jp,objectLeft:Xp,objectRight:ch,objectCenter:dh,objectBlockLeft:Zp,objectBlockRight:eg}=Rr,s={inline:{name:"inline",title:"In line",icon:Jp,modelElements:["imageInline"],isDefault:!0},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:Xp,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"},alignBlockLeft:{name:"alignBlockLeft",title:"Left aligned image",icon:Zp,modelElements:["imageBlock"],className:"image-style-block-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:dh,modelElements:["imageBlock"],className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:ch,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"},alignBlockRight:{name:"alignBlockRight",title:"Right aligned image",icon:eg,modelElements:["imageBlock"],className:"image-style-block-align-right"},block:{name:"block",title:"Centered image",icon:dh,modelElements:["imageBlock"],isDefault:!0},side:{name:"side",title:"Side image",icon:ch,modelElements:["imageBlock"],className:"image-style-side"}},d={full:hv,left:Zp,right:eg,center:dh,inlineLeft:Xp,inlineRight:ch,inline:Jp},m=[{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 C(i){Object(y.b)("image-style-configuration-definition-invalid",i)}var E={normalizeStyles:function(i){return(i.configuredStyles.options||[]).map(e=>function(t){return t=typeof t=="string"?s[t]?{...s[t]}:{name:t}:function(n,r){const o={...r};for(const a in n)Object.prototype.hasOwnProperty.call(r,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:r}){const{modelElements:o,name:a}=t;if(!(o&&o.length&&a))return C({style:t}),!1;{const c=[n?"imageBlock":null,r?"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,i))},getDefaultStylesConfiguration:function(i,e){return i&&e?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:i?{options:["block","side"]}:e?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(i){return i.has("ImageBlockEditing")&&i.has("ImageInlineEditing")?[...m]:[]},warnInvalidStyle:C,DEFAULT_OPTIONS:s,DEFAULT_ICONS:d,DEFAULT_DROPDOWN_DEFINITIONS:m};function j(i,e){for(const t of e)if(t.name===i)return t}class U extends ve{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[Bi]}init(){const{normalizeStyles:e,getDefaultStylesConfiguration:t}=E,n=this.editor,r=n.plugins.has("ImageBlockEditing"),o=n.plugins.has("ImageInlineEditing");n.config.define("image.styles",t(r,o)),this.normalizedStyles=e({configuredStyles:n.config.get("image.styles"),isBlockPluginLoaded:r,isInlinePluginLoaded:o}),this._setupConversion(r,o),this._setupPostFixer(),n.commands.add("imageStyle",new uv(n,this.normalizedStyles))}_setupConversion(e,t){const n=this.editor,r=n.model.schema,o=(a=this.normalizedStyles,(u,f,b)=>{if(!b.consumable.consume(f.item,u.name))return;const k=j(f.attributeNewValue,a),T=j(f.attributeOldValue,a),S=b.mapper.toViewElement(f.item),O=b.writer;T&&O.removeClass(T.className,S),k&&O.addClass(k.className,S)});var a;const c=function(u){const f={imageInline:u.filter(b=>!b.isDefault&&b.modelElements.includes("imageInline")),imageBlock:u.filter(b=>!b.isDefault&&b.modelElements.includes("imageBlock"))};return(b,k,T)=>{if(!k.modelRange)return;const S=k.viewItem,O=pr(k.modelRange.getItems());if(O&&T.schema.checkAttribute(O,"imageStyle"))for(const D of f[O.name])T.consumable.consume(S,{classes:D.className})&&T.writer.setAttribute("imageStyle",D.name,O)}}(this.normalizedStyles);n.editing.downcastDispatcher.on("attribute:imageStyle",o),n.data.downcastDispatcher.on("attribute:imageStyle",o),e&&(r.extend("imageBlock",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:figure",c,{priority:"low"})),t&&(r.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(Bi),r=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 f=u.getAttribute("imageStyle");if(!f)continue;const b=r.get(f);b&&b.modelElements.includes(u.name)||(o.removeAttribute("imageStyle",u),a=!0)}return a})}}_(80);class q extends ve{static get requires(){return[U]}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=G(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const o of n)this._createButton(o);const r=G([...t.filter(ne),...E.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(const o of r)this._createDropdown(o,n)}_createDropdown(e,t){const n=this.editor.ui.componentFactory;n.add(e.name,r=>{let o;const{defaultItem:a,items:c,title:u}=e,f=c.filter(T=>t.find(({name:S})=>ue(S)===T)).map(T=>{const S=n.create(T);return T===a&&(o=S),S});c.length!==f.length&&E.warnInvalidStyle({dropdown:e});const b=hs(r,Uf),k=b.buttonView;return Xf(b,f),k.set({label:he(u,o.label),class:null,tooltip:!0}),k.bind("icon").toMany(f,"isOn",(...T)=>{const S=T.findIndex(Ye);return S<0?o.icon:f[S].icon}),k.bind("label").toMany(f,"isOn",(...T)=>{const S=T.findIndex(Ye);return he(u,S<0?o.label:f[S].label)}),k.bind("isOn").toMany(f,"isOn",(...T)=>T.some(Ye)),k.bind("class").toMany(f,"isOn",(...T)=>T.some(Ye)?"ck-splitbutton_flatten":null),k.on("execute",()=>{f.some(({isOn:T})=>T)?b.isOpen=!b.isOpen:o.fire("execute")}),b.bind("isEnabled").toMany(f,"isEnabled",(...T)=>T.some(Ye)),b})}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(ue(t),n=>{const r=this.editor.commands.get("imageStyle"),o=new nn(n);return o.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(r,"isEnabled"),o.bind("isOn").to(r,"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 G(i,e){for(const t of i)e[t.title]&&(t.title=e[t.title]);return i}function ue(i){return"imageStyle:"+i}function he(i,e){return(i?i+": ":"")+e}function ge(i){const e=i.map(t=>t.replace("+","\\+"));return new RegExp(`^image\\/(${e.join("|")})$`)}function Ae(i){return new Promise((e,t)=>{const n=i.getAttribute("src");fetch(n).then(r=>r.blob()).then(r=>{const o=Le(r,n),a=o.replace("image/",""),c=new File([r],"image."+a,{type:o});e(c)}).catch(r=>r&&r.name==="TypeError"?function(o){return function(a){return new Promise((c,u)=>{const f=Ut.document.createElement("img");f.addEventListener("load",()=>{const b=Ut.document.createElement("canvas");b.width=f.width,b.height=f.height,b.getContext("2d").drawImage(f,0,0),b.toBlob(k=>k?c(k):u())}),f.addEventListener("error",()=>u()),f.src=a})}(o).then(a=>{const c=Le(a,o),u=c.replace("image/","");return new File([a],"image."+u,{type:c})})}(n).then(e).catch(t):t(r))})}function Le(i,e){return i.type?i.type:e.match(/data:(image\/\w+);base64/)?e.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class Ke extends ve{static get pluginName(){return"ImageUploadUI"}init(){const e=this.editor,t=e.t,n=r=>{const o=new Rb(r),a=e.commands.get("uploadImage"),c=e.config.get("image.upload.types"),u=ge(c);return o.set({acceptedType:c.map(f=>"image/"+f).join(","),allowMultipleFiles:!0}),o.buttonView.set({label:t("Insert image"),icon:Rr.image,tooltip:!0}),o.buttonView.bind("isEnabled").to(a),o.on("done",(f,b)=>{const k=Array.from(b).filter(T=>u.test(T.type));k.length&&e.execute("uploadImage",{file:k})}),o};e.ui.componentFactory.add("uploadImage",n),e.ui.componentFactory.add("imageUpload",n)}}_(82),_(84),_(86);class dt extends ve{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 r=this.editor,o=t.item,a=o.getAttribute("uploadId");if(!n.consumable.consume(t.item,e.name))return;const c=r.plugins.get("ImageUtils"),u=r.plugins.get(ci),f=a?t.attributeNewValue:null,b=this.placeholder,k=r.editing.mapper.toViewElement(o),T=n.writer;if(f=="reading")return We(k,T),void pt(c,b,k,T);if(f=="uploading"){const S=u.loaders.get(a);return We(k,T),void(S?(_t(k,T),function(O,D,L,W){const J=function(de){const xe=de.createUIElement("div",{class:"ck-progress-bar"});return de.setCustomProperty("progressBar",!0,xe),xe}(D);D.insert(D.createPositionAt(O,"end"),J),L.on("change:uploadedPercent",(de,xe,Ve)=>{W.change(Qt=>{Qt.setStyle("width",Ve+"%",J)})})}(k,T,S,r.editing.view),function(O,D,L,W){if(W.data){const J=O.findViewImgElement(D);L.setAttribute("src",W.data,J)}}(c,k,T,S)):pt(c,b,k,T))}f=="complete"&&u.loaders.get(a)&&function(S,O,D){const L=O.createUIElement("div",{class:"ck-image-upload-complete-icon"});O.insert(O.createPositionAt(S,"end"),L),setTimeout(()=>{D.change(W=>W.remove(W.createRangeOn(L)))},3e3)}(k,T,r.editing.view),function(S,O){Kn(S,O,"progressBar")}(k,T),_t(k,T),function(S,O){O.removeClass("ck-appear",S)}(k,T)}}function We(i,e){i.hasClass("ck-appear")||e.addClass("ck-appear",i)}function pt(i,e,t,n){t.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",t);const r=i.findViewImgElement(t);r.getAttribute("src")!==e&&n.setAttribute("src",e,r),vr(t,"placeholder")||n.insert(n.createPositionAfter(r),function(o){const a=o.createUIElement("div",{class:"ck-upload-placeholder-loader"});return o.setCustomProperty("placeholder",!0,a),a}(n))}function _t(i,e){i.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",i),Kn(i,e,"placeholder")}function vr(i,e){for(const t of i.getChildren())if(t.getCustomProperty(e))return t}function Kn(i,e,t){const n=vr(i,t);n&&e.remove(e.createRangeOn(n))}class zr extends at{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=Pt(e.file),n=this.editor.model.document.selection,r=this.editor.plugins.get("ImageUtils"),o=Object.fromEntries(n.getAttributes());t.forEach((a,c)=>{const u=n.getSelectedElement();if(c&&u&&r.isImage(u)){const f=this.editor.model.createPositionAfter(u);this._uploadImage(a,o,f)}else this._uploadImage(a,o)})}_uploadImage(e,t,n){const r=this.editor,o=r.plugins.get(ci).createLoader(e),a=r.plugins.get("ImageUtils");o&&a.insertImage({...t,uploadId:o.id},n)}}class pn extends ve{static get requires(){return[ci,Vu,sn,Bi]}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,r=e.plugins.get(ci),o=e.plugins.get("ImageUtils"),a=ge(e.config.get("image.upload.types")),c=new zr(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,f)=>{if(b=f.dataTransfer,Array.from(b.types).includes("text/html")&&b.getData("text/html")!=="")return;var b;const k=Array.from(f.dataTransfer.files).filter(T=>!!T&&a.test(T.type));k.length&&(u.stop(),e.model.change(T=>{f.targetRanges&&T.setSelection(f.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,f)=>{const b=Array.from(e.editing.view.createRangeIn(f.content)).filter(T=>function(S,O){return!(!S.isInlineImageView(O)||!O.getAttribute("src"))&&(O.getAttribute("src").match(/^data:image\/\w+;base64,/g)||O.getAttribute("src").match(/^blob:/g))}(o,T.item)&&!T.item.getAttribute("uploadProcessed")).map(T=>({promise:Ae(T.item),imageElement:T.item}));if(!b.length)return;const k=new Zs(e.editing.view.document);for(const T of b){k.setAttribute("uploadProcessed",!0,T.imageElement);const S=r.createLoader(T.promise);S&&(k.setAttribute("src","",T.imageElement),k.setAttribute("uploadId",S.id,T.imageElement))}}),e.editing.view.document.on("dragover",(u,f)=>{f.preventDefault()}),t.on("change",()=>{const u=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),f=new Set;for(const b of u)if(b.type=="insert"&&b.name!="$text"){const k=b.position.nodeAfter,T=b.position.root.rootName=="$graveyard";for(const S of di(e,k)){const O=S.getAttribute("uploadId");if(!O)continue;const D=r.loaders.get(O);D&&(T?f.has(O)||D.abort():(f.add(O),this._uploadImageElements.set(O,S),D.status=="idle"&&this._readAndUpload(D)))}}}),this.on("uploadComplete",(u,{imageElement:f,data:b})=>{const k=b.urls?b.urls:b;this.editor.model.change(T=>{T.setAttribute("src",k.default,f),this._parseAndSetSrcsetAttributeOnImage(k,f,T)})},{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,r=t.locale.t,o=t.plugins.get(ci),a=t.plugins.get(Vu),c=t.plugins.get("ImageUtils"),u=this._uploadImageElements;return n.enqueueChange("transparent",b=>{b.setAttribute("uploadStatus","reading",u.get(e.id))}),e.read().then(()=>{const b=e.upload(),k=u.get(e.id);if(xn.isSafari){const T=t.editing.mapper.toViewElement(k),S=c.findViewImgElement(T);t.editing.view.once("render",()=>{if(!S.parent)return;const O=t.editing.view.domConverter.mapViewToDom(S.parent);if(!O)return;const D=O.style.display;O.style.display="none",O._ckHack=O.offsetHeight,O.style.display=D})}return n.enqueueChange("transparent",T=>{T.setAttribute("uploadStatus","uploading",k)}),b}).then(b=>{n.enqueueChange("transparent",k=>{const T=u.get(e.id);k.setAttribute("uploadStatus","complete",T),this.fire("uploadComplete",{data:b,imageElement:T})}),f()}).catch(b=>{if(e.status!=="error"&&e.status!=="aborted")throw b;e.status=="error"&&b&&a.showWarning(b,{title:r("Upload failed"),namespace:"upload"}),n.enqueueChange("transparent",k=>{k.remove(u.get(e.id))}),f()});function f(){n.enqueueChange("transparent",b=>{const k=u.get(e.id);b.removeAttribute("uploadId",k),b.removeAttribute("uploadStatus",k),u.delete(e.id)}),o.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let r=0;const o=Object.keys(e).filter(a=>{const c=parseInt(a,10);if(!isNaN(c))return r=Math.max(r,c),!0}).map(a=>`${e[a]} ${a}w`).join(", ");o!=""&&n.setAttribute("srcset",{data:o,width:r},t)}}function di(i,e){const t=i.plugins.get("ImageUtils");return Array.from(i.model.createRangeOn(e)).filter(n=>t.isImage(n.item)).map(n=>n.item)}class ho extends ve{static get pluginName(){return"IndentEditing"}init(){const e=this.editor;e.commands.add("indent",new ga(e)),e.commands.add("outdent",new ga(e))}}var uh='<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>',gw='<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 a1 extends ve{static get pluginName(){return"IndentUI"}init(){const e=this.editor,t=e.locale,n=e.t,r=t.uiLanguageDirection=="ltr"?uh:gw,o=t.uiLanguageDirection=="ltr"?gw:uh;this._defineButton("indent",n("Increase indent"),r),this._defineButton("outdent",n("Decrease indent"),o)}_defineButton(e,t,n){const r=this.editor;r.ui.componentFactory.add(e,o=>{const a=r.commands.get(e),c=new nn(o);return c.set({label:t,icon:n,tooltip:!0}),c.bind("isOn","isEnabled").to(a,"value","isEnabled"),this.listenTo(c,"execute",()=>{r.execute(e),r.editing.view.focus()}),c})}}class l1{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,r)=>{if(!r.consumable.test(n.item,"attribute:linkHref"))return;const o=r.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 f in c.styles)o.setStyle(f,c.styles[f],u);o.setCustomProperty("link",!0,u),c.callback(n.attributeNewValue)?n.item.is("selection")?o.wrap(a.getFirstRange(),u):o.wrap(r.mapper.toViewRange(n.range),u):o.unwrap(r.mapper.toViewRange(n.range),u)}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",(t,n,{writer:r,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 f=Ar(u.attributes);if(u.callback(n.attributeNewValue)){for(const[b,k]of f)b==="class"?r.addClass(k,c):r.setAttribute(b,k,c);u.classes&&r.addClass(u.classes,c);for(const b in u.styles)r.setStyle(b,u.styles[b],c)}else{for(const[b,k]of f)b==="class"?r.removeClass(k,c):r.removeAttribute(b,c);u.classes&&r.removeClass(u.classes,c);for(const b in u.styles)r.removeStyle(b,c)}}})}}}var c1=function(i,e,t){var n=i.length;return t=t===void 0?n:t,!e&&t>=n?i:Ji(i,e,t)},d1=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),mw=function(i){return d1.test(i)},u1=function(i){return i.split("")},h1="[\\ud800-\\udfff]",fv="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",pv="\\ud83c[\\udffb-\\udfff]",bw="[^\\ud800-\\udfff]",vw="(?:\\ud83c[\\udde6-\\uddff]){2}",_w="[\\ud800-\\udbff][\\udc00-\\udfff]",ww="(?:"+fv+"|"+pv+")?",f1="[\\ufe0e\\ufe0f]?"+ww+("(?:\\u200d(?:"+[bw,vw,_w].join("|")+")[\\ufe0e\\ufe0f]?"+ww+")*"),p1="(?:"+[bw+fv+"?",fv,vw,_w,h1].join("|")+")",g1=RegExp(pv+"(?="+pv+")|"+p1+f1,"g"),m1=function(i){return i.match(g1)||[]},b1=function(i){return mw(i)?m1(i):u1(i)},v1=function(i){return function(e){e=In(e);var t=mw(e)?b1(e):void 0,n=t?t[0]:e.charAt(0),r=t?c1(t,1).join(""):e.slice(1);return n[i]()+r}}("toUpperCase");const _1=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,w1=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,k1=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,y1=/^((\w+:(\/{2,})?)|(\W))/i;function kw(i,{writer:e}){const t=e.createAttributeElement("a",{href:i},{priority:5});return e.setCustomProperty("link",!0,t),t}function yw(i){return function(e){return e.replace(_1,"").match(w1)}(i=String(i))?i:"#"}function gv(i,e){return!!i&&e.checkAttribute(i.name,"linkHref")}function xw(i,e){const t=(n=i,k1.test(n)?"mailto:":e);var n;const r=!!t&&!y1.test(i);return i&&r?t+i:i}class x1 extends at{constructor(e){super(e),this.manualDecorators=new ur,this.automaticDecorators=new l1}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()||pr(t.getSelectedBlocks());gv(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 r of this.manualDecorators)r.value=this._getDecoratorStateFromModel(r.id)}execute(e,t={}){const n=this.editor.model,r=n.document.selection,o=[],a=[];for(const c in t)t[c]?o.push(c):a.push(c);n.change(c=>{if(r.isCollapsed){const u=r.getFirstPosition();if(r.hasAttribute("linkHref")){const f=ms(u,"linkHref",r.getAttribute("linkHref"),n);c.setAttribute("linkHref",e,f),o.forEach(b=>{c.setAttribute(b,!0,f)}),a.forEach(b=>{c.removeAttribute(b,f)}),c.setSelection(c.createPositionAfter(f.end.nodeBefore))}else if(e!==""){const f=Ar(r.getAttributes());f.set("linkHref",e),o.forEach(k=>{f.set(k,!0)});const{end:b}=n.insertContent(c.createText(e,f),u);c.setSelection(b)}["linkHref",...o,...a].forEach(f=>{c.removeSelectionAttribute(f)})}else{const u=n.schema.getValidRanges(r.getRanges(),"linkHref"),f=[];for(const k of r.getSelectedBlocks())n.schema.checkAttribute(k,"linkHref")&&f.push(c.createRangeOn(k));const b=f.slice();for(const k of u)this._isRangeToUpdate(k,f)&&b.push(k);for(const k of b)c.setAttribute("linkHref",e,k),o.forEach(T=>{c.setAttribute(T,!0,k)}),a.forEach(T=>{c.removeAttribute(T,k)})}})}_getDecoratorStateFromModel(e){const t=this.editor.model,n=t.document.selection,r=n.getSelectedElement();return gv(r,t.schema)?r.getAttribute(e):n.getAttribute(e)}_isRangeToUpdate(e,t){for(const n of t)if(n.containsRange(e))return!1;return!0}}class C1 extends at{refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement();gv(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,r=e.commands.get("link");t.change(o=>{const a=n.isCollapsed?[ms(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),t)]:t.schema.getValidRanges(n.getRanges(),"linkHref");for(const c of a)if(o.removeAttribute("linkHref",c),r)for(const u of r.manualDecorators)o.removeAttribute(u.id,c)})}}class Cw{constructor({id:e,label:t,attributes:n,classes:r,styles:o,defaultValue:a}){this.id=e,this.set("value"),this.defaultValue=a,this.label=t,this.attributes=n,this.classes=r,this.styles=o}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}Be(Cw,Gt),_(88);const T1=/^(https?:)?\/\//;class S1 extends ve{static get pluginName(){return"LinkEditing"}static get requires(){return[Ap,Gc,sn]}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:kw}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(n,r)=>kw(yw(n),r)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:n=>n.getAttribute("href")}}),e.commands.add("link",new x1(e)),e.commands.add("unlink",new C1(e));const t=function(n,r){const o={"Open in a new tab":n("Open in a new tab"),Downloadable:n("Downloadable")};return r.forEach(a=>(a.label&&o[a.label]&&(a.label=o[a.label]),a)),r}(e.t,function(n){const r=[];if(n)for(const[o,a]of Object.entries(n)){const c=Object.assign({},a,{id:"link"+v1(o)});r.push(c)}return r}(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter(n=>n.mode==="automatic")),this._enableManualDecorators(t.filter(n=>n.mode==="manual")),e.plugins.get(Ap).registerAttribute("linkHref"),function(n,r,o,a){const c=n.editing.view,u=new Set;c.document.registerPostFixer(f=>{const b=n.model.document.selection;let k=!1;if(b.hasAttribute(r)){const T=ms(b.getFirstPosition(),r,b.getAttribute(r),n.model),S=n.editing.mapper.toViewRange(T);for(const O of S.getItems())O.is("element",o)&&!O.hasClass(a)&&(f.addClass(a,O),u.add(O),k=!0)}return k}),n.conversion.for("editingDowncast").add(f=>{function b(){c.change(k=>{for(const T of u.values())k.removeClass(a,T),u.delete(T)})}f.on("insert",b,{priority:"highest"}),f.on("remove",b,{priority:"highest"}),f.on("attribute",b,{priority:"highest"}),f.on("selection",b,{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:r=>T1.test(r),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(r=>{t.model.schema.extend("$text",{allowAttributes:r.id}),r=new Cw(r),n.add(r),t.conversion.for("downcast").attributeToElement({model:r.id,view:(o,{writer:a})=>{if(o){const c=a.createAttributeElement("a",r.attributes,{priority:5});r.classes&&a.addClass(r.classes,c);for(const u in r.styles)a.setStyle(u,r.styles[u],c);return a.setCustomProperty("link",!0,c),c}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...r._createPattern()},model:{key:r.id}})})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(e,"insertContent",()=>{const n=t.anchor.nodeBefore,r=t.anchor.nodeAfter;t.hasAttribute("linkHref")&&n&&n.hasAttribute("linkHref")&&(r&&r.hasAttribute("linkHref")||e.change(o=>{mv(o,bv(e.schema))}))},{priority:"low"})}_enableClickingAfterLink(){const e=this.editor,t=e.model;e.editing.view.addObserver(Wc);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 r=t.document.selection;if(!r.isCollapsed||!r.hasAttribute("linkHref"))return;const o=r.getFirstPosition(),a=ms(o,"linkHref",r.getAttribute("linkHref"),t);(o.isTouching(a.start)||o.isTouching(a.end))&&t.change(c=>{mv(c,bv(t.schema))})})}_enableTypingOverLink(){const e=this.editor,t=e.editing.view;let n,r;this.listenTo(t.document,"delete",()=>{r=!0},{priority:"high"}),this.listenTo(e.model,"deleteContent",()=>{const o=e.model.document.selection;o.isCollapsed||(r?r=!1:Tw(e)&&function(a){const c=a.document.selection,u=c.getFirstPosition(),f=c.getLastPosition(),b=u.nodeAfter;if(!b||!b.is("$text")||!b.hasAttribute("linkHref"))return!1;const k=f.textNode||f.nodeBefore;return b===k?!0:ms(u,"linkHref",b.getAttribute("linkHref"),a).containsRange(a.createRange(u,f),!0)}(e.model)&&(n=o.getAttributes()))},{priority:"high"}),this.listenTo(e.model,"insertContent",(o,[a])=>{r=!1,Tw(e)&&n&&(e.model.change(c=>{for(const[u,f]of n)c.setAttribute(u,f,a)}),n=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const e=this.editor,t=e.model,n=t.document.selection,r=e.editing.view;let o=!1,a=!1;this.listenTo(r.document,"delete",(c,u)=>{a=u.domEvent.keyCode===it.backspace},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{o=!1;const c=n.getFirstPosition(),u=n.getAttribute("linkHref");if(!u)return;const f=ms(c,"linkHref",u,t);o=f.containsPosition(c)||f.end.isEqual(c)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{a&&(a=!1,o||e.model.enqueueChange(c=>{mv(c,bv(t.schema))}))},{priority:"low"})}}function mv(i,e){i.removeSelectionAttribute("linkHref");for(const t of e)i.removeSelectionAttribute(t)}function Tw(i){return i.plugins.get("Input").isInput(i.model.change(e=>e.batch))}function bv(i){return i.getDefinition("$text").allowAttributes.filter(e=>e.startsWith("link"))}_(90);class A1 extends ct{constructor(e,t){super(e);const n=e.t;this.focusTracker=new Ur,this.keystrokes=new Ir,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),Rr.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),Rr.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusables=new ds,this._focusCycler=new Ks({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const r=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&r.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:r,tabindex:"-1"},children:this.children}),Nu(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>(e[t.name]=t.isOn,e),{})}render(){super.render(),Ru({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 Fu(this.locale,Bu);return t.label=e("Link URL"),t}_createButton(e,t,n,r){const o=new nn(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),r&&o.delegate("execute").to(this,r),o}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const n of e.manualDecorators){const r=new Vc(this.locale);r.set({name:n.id,label:n.label,withText:!0}),r.bind("isOn").toMany([n,e],"value",(o,a)=>a===void 0&&o===void 0?n.defaultValue:o),r.on("execute",()=>{n.set("value",!r.isOn)}),t.add(r)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const n=new ct;n.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(r=>({tag:"li",children:[r],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}}_(92);class E1 extends ct{constructor(e){super(e);const t=e.t;this.focusTracker=new Ur,this.keystrokes=new Ir,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"),Rr.pencil,"edit"),this.set("href"),this._focusables=new ds,this._focusCycler=new Ks({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 r=new nn(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.delegate("execute").to(this,n),r}_createPreviewButton(){const e=new nn(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",r=>r&&yw(r)),target:"_blank",rel:"noopener noreferrer"}}),e.bind("label").to(this,"href",r=>r||n("This link has no URL")),e.bind("isEnabled").to(this,"href",r=>!!r),e.template.tag="a",e.template.eventListeners={},e}}class P1 extends ve{static get requires(){return[cl]}static get pluginName(){return"LinkUI"}init(){const e=this.editor;e.editing.view.addObserver(rb),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=e.plugins.get(cl),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 E1(e.locale),n=e.commands.get("link"),r=e.commands.get("unlink");return t.bind("href").to(n,"value"),t.editButtonView.bind("isEnabled").to(n),t.unlinkButtonView.bind("isEnabled").to(r),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"),r=new A1(e.locale,t);return r.urlInputView.fieldView.bind("value").to(t,"value"),r.urlInputView.bind("isReadOnly").to(t,"isEnabled",o=>!o),r.saveButtonView.bind("isEnabled").to(t),this.listenTo(r,"submit",()=>{const{value:o}=r.urlInputView.fieldView.element,a=xw(o,n);e.execute("link",a,r.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(r,"cancel",()=>{this._closeFormView()}),r.keystrokes.set("Esc",(o,a)=>{this._closeFormView(),a()}),r}_createToolbarLinkButton(){const e=this.editor,t=e.commands.get("link"),n=e.t;e.keystrokes.set("Ctrl+K",(r,o)=>{o(),t.isEnabled&&this._showUI(!0)}),e.ui.componentFactory.add("link",r=>{const o=new nn(r);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())}),Ou({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(),r=a();const o=()=>{const c=this._getSelectedLinkElement(),u=a();n&&!c||!n&&u!==r?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=c,r=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 r=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]));r=e.domConverter.viewRangeToDom(a)}else r=()=>{const o=this._getSelectedLinkElement();return o?e.domConverter.mapViewToDom(o):e.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:r}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,n=t.getSelectedElement();if(t.isCollapsed||n&&et(n))return vv(t.getFirstPosition());{const r=t.getFirstRange().getTrimmed(),o=vv(r.start),a=vv(r.end);return o&&o==a&&e.createRangeIn(o).getTrimmed().isEqual(r)?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 r=n.start.getLastMatchingPosition(({item:o})=>!e.schema.isContent(o),{boundaries:n});t.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:t.createRange(r,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 vv(i){return i.getAncestors().find(e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t})}const I1=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 M1 extends ve{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 Ju(e.model,r=>{if(!function(a){return a.length>4&&a[a.length-1]===" "&&a[a.length-2]!==" "}(r))return;const o=Sw(r.substr(0,r.length-1));return o?{url:o}:void 0}),n=e.plugins.get("Input");t.on("matched:data",(r,o)=>{const{batch:a,range:c,url:u}=o;if(!n.isInput(a))return;const f=c.end.getShiftedBy(-1),b=f.getShiftedBy(-u.length),k=e.model.createRange(b,f);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 r=t.document.selection.getFirstPosition();if(!r.parent.previousSibling)return;const o=t.createRangeIn(r.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(o)})}_enableShiftEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("shiftEnter");n&&n.on("execute",()=>{const r=t.document.selection.getFirstPosition(),o=t.createRange(t.createPositionAt(r.parent,0),r.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(o)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:n,range:r}=Yc(e,t),o=Sw(n);if(o){const a=t.createRange(r.end.getShiftedBy(-o.length),r.end);this._applyAutoLink(o,a)}}_applyAutoLink(e,t){const n=this.editor.model;this.isEnabled&&function(r,o){return o.schema.checkAttributeInSelection(o.createSelection(r),"linkHref")}(t,n)&&n.enqueueChange(r=>{const o=this.editor.config.get("link.defaultProtocol"),a=xw(e,o);r.setAttribute("linkHref",a,t)})}}function Sw(i){const e=I1.exec(i);return e?e[2]:null}class Aw extends at{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,r=Array.from(n.selection.getSelectedBlocks()).filter(a=>Pw(a,t.schema)),o=e.forceValue!==void 0?!e.forceValue:this.value;t.change(a=>{if(o){let c=r[r.length-1].nextSibling,u=Number.POSITIVE_INFINITY,f=[];for(;c&&c.name=="listItem"&&c.getAttribute("listIndent")!==0;){const b=c.getAttribute("listIndent");b<u&&(u=b);const k=b-u;f.push({element:c,listIndent:k}),c=c.nextSibling}f=f.reverse();for(const b of f)a.setAttribute("listIndent",b.listIndent,b.element)}if(!o){let c=Number.POSITIVE_INFINITY;for(const u of r)u.is("element","listItem")&&u.getAttribute("listIndent")<c&&(c=u.getAttribute("listIndent"));c=c===0?1:c,Ew(r,!0,c),Ew(r,!1,c)}for(const c of r.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",r)})}_getValue(){const e=pr(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=pr(e.getSelectedBlocks());return!!n&&Pw(n,t)}}function Ew(i,e,t){const n=e?i[0]:i[i.length-1];if(n.is("element","listItem")){let r=n[e?"previousSibling":"nextSibling"],o=n.getAttribute("listIndent");for(;r&&r.is("element","listItem")&&r.getAttribute("listIndent")>=t;)o>r.getAttribute("listIndent")&&(o=r.getAttribute("listIndent")),r.getAttribute("listIndent")==o&&i[e?"unshift":"push"](r),r=r[e?"previousSibling":"nextSibling"]}}function Pw(i,e){return e.checkChild(i.parent,"listItem")&&!e.isObject(i)}class Iw extends at{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(r=>{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?r.rename(c,"paragraph"):r.setAttribute("listIndent",u,c)}this.fire("_executeCleanup",n)})}_checkEnabled(){const e=pr(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 r=e.previousSibling;for(;r&&r.is("element","listItem")&&r.getAttribute("listIndent")>=t;){if(r.getAttribute("listIndent")==t)return r.getAttribute("listType")==n;r=r.previousSibling}return!1}return!0}}function O1(i,e){const t=e.mapper,n=e.writer,r=i.getAttribute("listType")=="numbered"?"ol":"ul",o=function(c){const u=c.createContainerElement("li");return u.getFillerOffset=N1,u}(n),a=n.createContainerElement(r,null);return n.insert(n.createPositionAt(a,0),o),t.bindElements(i,o),o}function Mw(i,e,t,n){const r=e.parent,o=t.mapper,a=t.writer;let c=o.toViewPosition(n.createPositionBefore(i));const u=Nw(i.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:i.getAttribute("listIndent")}),f=i.previousSibling;if(u&&u.getAttribute("listIndent")==i.getAttribute("listIndent")){const b=o.toViewElement(u);c=a.breakContainer(a.createPositionAfter(b))}else if(f&&f.name=="listItem"){c=o.toViewPosition(n.createPositionAt(f,"end"));const b=o.findMappedViewAncestor(c),k=function(T){for(const S of T.getChildren())if(S.name=="ul"||S.name=="ol")return S;return null}(b);c=k?a.createPositionBefore(k):a.createPositionAt(b,"end")}else c=o.toViewPosition(n.createPositionBefore(i));if(c=Ow(c),a.insert(c,r),f&&f.name=="listItem"){const b=o.toViewElement(f),k=a.createRange(a.createPositionAt(b,0),c).getWalker({ignoreElementEnd:!0});for(const T of k)if(T.item.is("element","li")){const S=a.breakContainer(a.createPositionBefore(T.item)),O=T.item.parent,D=a.createPositionAt(e,"end");Vi(a,D.nodeBefore,D.nodeAfter),a.move(a.createRangeOn(O),D),k.position=S}}else{const b=r.nextSibling;if(b&&(b.is("element","ul")||b.is("element","ol"))){let k=null;for(const T of b.getChildren()){const S=o.toModelElement(T);if(!(S&&S.getAttribute("listIndent")>i.getAttribute("listIndent")))break;k=T}k&&(a.breakContainer(a.createPositionAfter(k)),a.move(a.createRangeOn(k.parent),a.createPositionAt(e,"end")))}}Vi(a,r,r.nextSibling),Vi(a,r.previousSibling,r)}function Vi(i,e,t){return!e||!t||e.name!="ul"&&e.name!="ol"||e.name!=t.name||e.getAttribute("class")!==t.getAttribute("class")?null:i.mergeContainers(i.createPositionAfter(e))}function Ow(i){return i.getLastMatchingPosition(e=>e.item.is("uiElement"))}function Nw(i,e){const t=!!e.sameIndent,n=!!e.smallerIndent,r=e.listIndent;let o=i;for(;o&&o.name=="listItem";){const a=o.getAttribute("listIndent");if(t&&r==a||n&&r>a)return o;o=e.direction==="forward"?o.nextSibling:o.previousSibling}return null}function Rw(i,e,t,n){i.ui.componentFactory.add(e,r=>{const o=i.commands.get(e),a=new nn(r);return a.set({label:t,icon:n,tooltip:!0,isToggleable:!0}),a.bind("isOn","isEnabled").to(o,"value","isEnabled"),a.on("execute",()=>{i.execute(e),i.editing.view.focus()}),a})}function N1(){const i=!this.isEmpty&&(this.getChild(0).name=="ul"||this.getChild(0).name=="ol");return this.isEmpty||i?0:nt.call(this)}function Dw(i){return(e,t,n)=>{const r=n.consumable;if(!r.test(t.item,"insert")||!r.test(t.item,"attribute:listType")||!r.test(t.item,"attribute:listIndent"))return;r.consume(t.item,"insert"),r.consume(t.item,"attribute:listType"),r.consume(t.item,"attribute:listIndent");const o=t.item;Mw(o,O1(o,n),n,i)}}function R1(i,e,t){if(!t.consumable.consume(e.item,"attribute:listType"))return;const n=t.mapper.toViewElement(e.item),r=t.writer;r.breakContainer(r.createPositionBefore(n)),r.breakContainer(r.createPositionAfter(n));const o=n.parent,a=e.attributeNewValue=="numbered"?"ol":"ul";r.rename(a,o)}function D1(i,e,t){const n=t.mapper.toViewElement(e.item).parent,r=t.writer;Vi(r,n,n.nextSibling),Vi(r,n.previousSibling,n);for(const o of e.item.getChildren())t.consumable.consume(o,"insert")}function jw(i,e,t){if(e.item.name!="listItem"){let n=t.mapper.toViewPosition(e.range.start);const r=t.writer,o=[];for(;(n.parent.name=="ul"||n.parent.name=="ol")&&(n=r.breakContainer(n),n.parent.name=="li");){const a=n,c=r.createPositionAt(n.parent,"end");if(!a.isEqual(c)){const u=r.remove(r.createRange(a,c));o.push(u)}n=r.createPositionAfter(n.parent)}if(o.length>0){for(let a=0;a<o.length;a++){const c=n.nodeBefore;if(n=r.insert(n,o[a]).end,a>0){const u=Vi(r,c,c.nextSibling);u&&u.parent==c&&n.offset--}}Vi(r,n.nodeBefore,n.nodeAfter)}}}function j1(i,e,t){const n=t.mapper.toViewPosition(e.position),r=n.nodeBefore,o=n.nodeAfter;Vi(t.writer,r,o)}function L1(i,e,t){if(t.consumable.consume(e.viewItem,{name:!0})){const n=t.writer,r=n.createElement("listItem"),o=function(u){let f=0,b=u.parent;for(;b;){if(b.is("element","li"))f++;else{const k=b.previousSibling;k&&k.is("element","li")&&f++}b=b.parent}return f}(e.viewItem);n.setAttribute("listIndent",o,r);const a=e.viewItem.parent&&e.viewItem.parent.name=="ol"?"numbered":"bulleted";if(n.setAttribute("listType",a,r),!t.safeInsert(r,e.modelCursor))return;const c=function(u,f,b){const{writer:k,schema:T}=b;let S=k.createPositionAfter(u);for(const O of f)if(O.name=="ul"||O.name=="ol")S=b.convertItem(O,S).modelCursor;else{const D=b.convertItem(O,k.createPositionAt(u,"end")),L=D.modelRange.start.nodeAfter;L&&L.is("element")&&!T.checkChild(u,L.name)&&(u=D.modelCursor.parent.is("element","listItem")?D.modelCursor.parent:B1(D.modelCursor),S=k.createPositionAfter(u))}return S}(r,e.viewItem.getChildren(),t);e.modelRange=n.createRange(e.modelCursor,c),t.updateConversionResult(r,e)}}function Lw(i,e,t){if(t.consumable.test(e.viewItem,{name:!0})){const n=Array.from(e.viewItem.getChildren());for(const r of n)!(r.is("element","li")||vl(r))&&r._remove()}}function z1(i,e,t){if(t.consumable.test(e.viewItem,{name:!0})){if(e.viewItem.childCount===0)return;const n=[...e.viewItem.getChildren()];let r=!1,o=!0;for(const a of n)r&&!vl(a)&&a._remove(),a.is("$text")?(o&&(a._data=a.data.trimStart()),a.nextSibling&&!vl(a.nextSibling)||(a._data=a.data.trimEnd())):vl(a)&&(r=!0),o=!1}}function zw(i){return(e,t)=>{if(t.isPhantom)return;const n=t.modelPosition.nodeBefore;if(n&&n.is("element","listItem")){const r=t.mapper.toViewElement(n),o=r.getAncestors().find(vl),a=i.createPositionAt(r,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 F1(i,[e,t]){let n,r=e.is("documentFragment")?e.getChild(0):e;if(n=t?this.createSelection(t):this.document.selection,r&&r.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(;r&&r.is("element","listItem");)r._setAttribute("listIndent",r.getAttribute("listIndent")+c),r=r.nextSibling}}}function B1(i){const e=new ii({startPosition:i});let t;do t=e.next();while(!t.value.item.is("element","listItem"));return t.value.item}function Fw(i,e,t,n,r,o){const a=Nw(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:i,foo:"b"}),c=r.mapper,u=r.writer,f=a?a.getAttribute("listIndent"):null;let b;if(a)if(f==i){const k=c.toViewElement(a).parent;b=u.createPositionAfter(k)}else{const k=o.createPositionAt(a,"end");b=c.toViewPosition(k)}else b=t;b=Ow(b);for(const k of[...n.getChildren()])vl(k)&&(b=u.move(u.createRangeOn(k),b).end,Vi(u,k,k.nextSibling),Vi(u,k.previousSibling,k))}function vl(i){return i.is("element","ol")||i.is("element","ul")}class V1 extends ve{static get pluginName(){return"ListEditing"}static get requires(){return[qc,ps]}init(){const e=this.editor;e.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const t=e.data,n=e.editing;var r;e.model.document.registerPostFixer(c=>function(u,f){const b=u.document.differ.getChanges(),k=new Map;let T=!1;for(const L of b)if(L.type=="insert"&&L.name=="listItem")S(L.position);else if(L.type=="insert"&&L.name!="listItem"){if(L.name!="$text"){const W=L.position.nodeAfter;W.hasAttribute("listIndent")&&(f.removeAttribute("listIndent",W),T=!0),W.hasAttribute("listType")&&(f.removeAttribute("listType",W),T=!0),W.hasAttribute("listStyle")&&(f.removeAttribute("listStyle",W),T=!0);for(const J of Array.from(u.createRangeIn(W)).filter(de=>de.item.is("element","listItem")))S(J.previousPosition)}S(L.position.getShiftedBy(L.length))}else L.type=="remove"&&L.name=="listItem"?S(L.position):(L.type=="attribute"&&L.attributeKey=="listIndent"||L.type=="attribute"&&L.attributeKey=="listType")&&S(L.range.start);for(const L of k.values())O(L),D(L);return T;function S(L){const W=L.nodeBefore;if(W&&W.is("element","listItem")){let J=W;if(k.has(J))return;for(let de=J.previousSibling;de&&de.is("element","listItem");de=J.previousSibling)if(J=de,k.has(J))return;k.set(W,J)}else{const J=L.nodeAfter;J&&J.is("element","listItem")&&k.set(J,J)}}function O(L){let W=0,J=null;for(;L&&L.is("element","listItem");){const de=L.getAttribute("listIndent");if(de>W){let xe;J===null?(J=de-W,xe=W):(J>de&&(J=de),xe=de-J),f.setAttribute("listIndent",xe,L),T=!0}else J=null,W=L.getAttribute("listIndent")+1;L=L.nextSibling}}function D(L){let W=[],J=null;for(;L&&L.is("element","listItem");){const de=L.getAttribute("listIndent");if(J&&J.getAttribute("listIndent")>de&&(W=W.slice(0,de+1)),de!=0)if(W[de]){const xe=W[de];L.getAttribute("listType")!=xe&&(f.setAttribute("listType",xe,L),T=!0)}else W[de]=L.getAttribute("listType");J=L,L=L.nextSibling}}}(e.model,c)),n.mapper.registerViewToModelLength("li",_v),t.mapper.registerViewToModelLength("li",_v),n.mapper.on("modelToViewPosition",zw(n.view)),n.mapper.on("viewToModelPosition",(r=e.model,(c,u)=>{const f=u.viewPosition,b=f.parent,k=u.mapper;if(b.name=="ul"||b.name=="ol"){if(f.isAtEnd){const T=k.toModelElement(f.nodeBefore),S=k.getModelLength(f.nodeBefore);u.modelPosition=r.createPositionBefore(T).getShiftedBy(S)}else{const T=k.toModelElement(f.nodeAfter);u.modelPosition=r.createPositionBefore(T)}c.stop()}else if(b.name=="li"&&f.nodeBefore&&(f.nodeBefore.name=="ul"||f.nodeBefore.name=="ol")){const T=k.toModelElement(b);let S=1,O=f.nodeBefore;for(;O&&vl(O);)S+=k.getModelLength(O),O=O.previousSibling;u.modelPosition=r.createPositionBefore(T).getShiftedBy(S),c.stop()}})),t.mapper.on("modelToViewPosition",zw(n.view)),e.conversion.for("editingDowncast").add(c=>{c.on("insert",jw,{priority:"high"}),c.on("insert:listItem",Dw(e.model)),c.on("attribute:listType:listItem",R1,{priority:"high"}),c.on("attribute:listType:listItem",D1,{priority:"low"}),c.on("attribute:listIndent:listItem",function(u){return(f,b,k)=>{if(!k.consumable.consume(b.item,"attribute:listIndent"))return;const T=k.mapper.toViewElement(b.item),S=k.writer;S.breakContainer(S.createPositionBefore(T)),S.breakContainer(S.createPositionAfter(T));const O=T.parent,D=O.previousSibling,L=S.createRangeOn(O);S.remove(L),D&&D.nextSibling&&Vi(S,D,D.nextSibling),Fw(b.attributeOldValue+1,b.range.start,L.start,T,k,u),Mw(b.item,T,k,u);for(const W of b.item.getChildren())k.consumable.consume(W,"insert")}}(e.model)),c.on("remove:listItem",function(u){return(f,b,k)=>{const T=k.mapper.toViewPosition(b.position).getLastMatchingPosition(J=>!J.item.is("element","li")).nodeAfter,S=k.writer;S.breakContainer(S.createPositionBefore(T)),S.breakContainer(S.createPositionAfter(T));const O=T.parent,D=O.previousSibling,L=S.createRangeOn(O),W=S.remove(L);D&&D.nextSibling&&Vi(S,D,D.nextSibling),Fw(k.mapper.toModelElement(T).getAttribute("listIndent")+1,b.position,L.start,T,k,u);for(const J of S.createRangeIn(W).getItems())k.mapper.unbindViewElement(J);f.stop()}}(e.model)),c.on("remove",j1,{priority:"low"})}),e.conversion.for("dataDowncast").add(c=>{c.on("insert",jw,{priority:"high"}),c.on("insert:listItem",Dw(e.model))}),e.conversion.for("upcast").add(c=>{c.on("element:ul",Lw,{priority:"high"}),c.on("element:ol",Lw,{priority:"high"}),c.on("element:li",z1,{priority:"high"}),c.on("element:li",L1)}),e.model.on("insertContent",F1,{priority:"high"}),e.commands.add("numberedList",new Aw(e,"numbered")),e.commands.add("bulletedList",new Aw(e,"bulleted")),e.commands.add("indentList",new Iw(e,"forward")),e.commands.add("outdentList",new Iw(e,"backward"));const o=n.view.document;this.listenTo(o,"enter",(c,u)=>{const f=this.editor.model.document,b=f.selection.getLastPosition().parent;f.selection.isCollapsed&&b.name=="listItem"&&b.isEmpty&&(this.editor.execute("outdentList"),u.preventDefault(),c.stop())},{context:"li"}),this.listenTo(o,"delete",(c,u)=>{if(u.direction!=="backward")return;const f=this.editor.model.document.selection;if(!f.isCollapsed)return;const b=f.getFirstPosition();if(!b.isAtStart)return;const k=b.parent;k.name==="listItem"&&(k.previousSibling&&k.previousSibling.name==="listItem"||(this.editor.execute("outdentList"),u.preventDefault(),c.stop()))},{context:"li"});const a=c=>(u,f)=>{this.editor.commands.get(c).isEnabled&&(this.editor.execute(c),f())};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 _v(i){let e=1;for(const t of i.getChildren())if(t.name=="ul"||t.name=="ol")for(const n of t.getChildren())e+=_v(n);return e}class $1 extends ve{static get pluginName(){return"ListUI"}init(){const e=this.editor.t;Rw(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>'),Rw(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 Bw(i,e){return n=>{n.on("attribute:url:media",t)};function t(n,r,o){if(!o.consumable.consume(r.item,n.name))return;const a=r.attributeNewValue,c=o.writer,u=o.mapper.toViewElement(r.item),f=[...u.getChildren()].find(k=>k.getCustomProperty("media-content"));c.remove(f);const b=i.getMediaViewElement(c,a,e);c.insert(c.createPositionAt(u,0),b)}}function Vw(i,e,t,n){const r=i.createContainerElement("figure",{class:"media"});return i.insert(i.createPositionAt(r,0),e.getMediaViewElement(i,t,n)),r}function $w(i){const e=i.getSelectedElement();return e&&e.is("element","media")?e:null}function Hw(i,e,t){i.change(n=>{const r=n.createElement("media",{url:e});i.insertContent(r,t),n.setSelection(r,"on")})}class H1 extends at{refresh(){const e=this.editor.model,t=e.document.selection,n=$w(t);this.value=n?n.getAttribute("url"):null,this.isEnabled=function(r){const o=r.getSelectedElement();return!!o&&o.name==="media"}(t)||function(r,o){let a=hl(r,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,r=$w(n);r?t.change(o=>{o.setAttribute("url",e,r)}):Hw(t,e,hl(n,t))}}class U1{constructor(e,t){const n=t.providers,r=t.extraProviders||[],o=new Set(t.removeProviders),a=n.concat(r).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 Uw(this.locale);e=e.trim();for(const t of this.providerDefinitions){const n=t.html,r=Pt(t.url);for(const o of r){const a=this._getUrlMatches(e,o);if(a)return new Uw(this.locale,e,a,n)}}return null}_getUrlMatches(e,t){let n=e.match(t);if(n)return n;let r=e.replace(/^https?:\/\//,"");return n=r.match(t),n||(r=r.replace(/^www\./,""),n=r.match(t),n||null)}}class Uw{constructor(e,t,n,r){this.url=this._getValidUrl(t),this._t=e.t,this._match=n,this._previewRenderer=r}getViewElement(e,t){const n={};let r;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);r=e.createRawElement("div",n,function(a){a.innerHTML=o})}else this.url&&(n.url=this.url),r=e.createEmptyElement(t.elementName,n);return e.setCustomProperty("media-content",!0,r),r}_getPreviewHtml(e){return this._previewRenderer?this._previewRenderer(this._match):this.url&&e.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const e=new Vf,t=new Bc;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 Dr({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}}_(94);class tg extends ve{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,r=e.conversion,o=e.config.get("mediaEmbed.previewsInData"),a=e.config.get("mediaEmbed.elementName"),c=this.registry;e.commands.add("mediaEmbed",new H1(e)),t.register("media",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["url"]}),r.for("dataDowncast").elementToElement({model:"media",view:(u,{writer:f})=>{const b=u.getAttribute("url");return Vw(f,c,b,{elementName:a,renderMediaPreview:b&&o})}}),r.for("dataDowncast").add(Bw(c,{elementName:a,renderMediaPreview:o})),r.for("editingDowncast").elementToElement({model:"media",view:(u,{writer:f})=>{const b=u.getAttribute("url");return function(k,T,S){return T.setCustomProperty("media",!0,k),rn(k,T,{label:S})}(Vw(f,c,b,{elementName:a,renderForEditingView:!0}),f,n("media widget"))}}),r.for("editingDowncast").add(Bw(c,{elementName:a,renderForEditingView:!0})),r.for("upcast").elementToElement({view:u=>["oembed",a].includes(u.name)&&u.getAttribute("url")?{name:!0}:null,model:(u,{writer:f})=>{const b=u.getAttribute("url");if(c.hasMedia(b))return f.createElement("media",{url:b})}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(u,{writer:f})=>{const b=u.getAttribute("data-oembed-url");if(c.hasMedia(b))return f.createElement("media",{url:b})}})}}const W1=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class q1 extends ve{static get requires(){return[Mt,Dp]}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(),r=jn.fromPosition(n.start);r.stickiness="toPrevious";const o=jn.fromPosition(n.end);o.stickiness="toNext",t.once("change:data",()=>{this._embedMediaBetweenPositions(r,o),r.detach(),o.detach()},{priority:"high"})}),e.commands.get("undo").on("execute",()=>{this._timeoutId&&(Ut.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(e,t){const n=this.editor,r=n.plugins.get(tg).registry,o=new Di(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(W1)||!r.hasMedia(c))return void o.detach();n.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=jn.fromPosition(e),this._timeoutId=Ut.window.setTimeout(()=>{n.model.change(u=>{let f;this._timeoutId=null,u.remove(o),o.detach(),this._positionToInsert.root.rootName!=="$graveyard"&&(f=this._positionToInsert),Hw(n.model,c,f),this._positionToInsert.detach(),this._positionToInsert=null})},100)):o.detach()}}_(96);class K1 extends ct{constructor(e,t){super(t);const n=t.t;this.focusTracker=new Ur,this.keystrokes=new Ir,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),Rr.check,"ck-button-save"),this.saveButtonView.type="submit",this.saveButtonView.bind("isEnabled").to(this,"mediaURLInputValue",r=>!!r),this.cancelButtonView=this._createButton(n("Cancel"),Rr.cancel,"ck-button-cancel","cancel"),this._focusables=new ds,this._focusCycler=new Ks({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]}),Nu(this)}render(){super.render(),Ru({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 Fu(this.locale,Bu),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,r){const o=new nn(this.locale);return o.set({label:e,icon:t,tooltip:!0}),o.extendTemplate({attributes:{class:n}}),r&&o.delegate("execute").to(this,r),o}}class G1 extends ve{static get requires(){return[tg]}static get pluginName(){return"MediaEmbedUI"}init(){const e=this.editor,t=e.commands.get("mediaEmbed"),n=e.plugins.get(tg).registry;e.ui.componentFactory.add("mediaEmbed",r=>{const o=hs(r),a=new K1(function(c,u){return[f=>{if(!f.url.length)return c("The URL must not be empty.")},f=>{if(!u.hasMedia(f.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 r=this.editor,o=r.t,a=e.buttonView;function c(){r.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()&&(r.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",r=>!r)}}_(98);function Y1(i,e){if(!i.childCount)return;const t=new Zs(i.document),n=function(a,c){const u=c.createRangeIn(a),f=new Hr({name:/^p|h\d+$/,styles:{"mso-list":/.*/}}),b=[];for(const k of u)if(k.type==="elementStart"&&f.match(k.item)){const T=J1(k.item);b.push({element:k.item,id:T.id,order:T.order,indent:T.indent})}return b}(i,t);if(!n.length)return;let r=null,o=1;n.forEach((a,c)=>{const u=function(O,D){if(!O)return!0;if(O.id!==D.id)return D.indent-O.indent!=1;const L=D.element.previousSibling;if(!L)return!0;return W=L,!(W.is("element","ol")||W.is("element","ul"));var W}(n[c-1],a),f=u?null:n[c-1],b=(T=a,(k=f)?T.indent-k.indent:T.indent-1);var k,T;if(u&&(r=null,o=1),!r||b!==0){const O=function(D,L){const W=new RegExp(`@list l${D.id}:level${D.indent}\\s*({[^}]*)`,"gi"),J=/mso-level-number-format:([^;]{0,100});/gi,de=W.exec(L);let xe="decimal",Ve="ol";if(de&&de[1]){const Qt=J.exec(de[1]);if(Qt&&Qt[1]&&(xe=Qt[1].trim(),Ve=xe!=="bullet"&&xe!=="image"?"ol":"ul"),xe==="bullet"){const wt=function(Gn){const ar=function(Kr){if(Kr.getChild(0).is("$text"))return null;for(const _r of Kr.getChildren()){if(!_r.is("element","span"))continue;const Fr=_r.getChild(0);return Fr.is("$text")?Fr:Fr.getChild(0)}}(Gn);if(!ar)return null;const Yn=ar._data;return Yn==="o"?"circle":Yn==="·"?"disc":Yn==="§"?"square":null}(D.element);wt&&(xe=wt)}}return{type:Ve,style:Q1(xe)}}(a,e);if(r){if(a.indent>o){const D=r.getChild(r.childCount-1),L=D.getChild(D.childCount-1);r=Ww(O,L,t),o+=1}else if(a.indent<o){const D=o-a.indent;r=function(L,W){const J=L.getAncestors({parentFirst:!0});let de=null,xe=0;for(const Ve of J)if(Ve.name!=="ul"&&Ve.name!=="ol"||xe++,xe===W){de=Ve;break}return de}(r,D),o=parseInt(a.indent)}}else r=Ww(O,a.element,t);a.indent<=o&&(r.is("element",O.type)||(r=t.rename(O.type,r)))}const S=function(O,D){return function(L,W){const J=new Hr({name:"span",styles:{"mso-list":"Ignore"}}),de=W.createRangeIn(L);for(const xe of de)xe.type==="elementStart"&&J.match(xe.item)&&W.remove(xe.item)}(O,D),D.rename("li",O)}(a.element,t);t.appendChild(S,r)})}function Q1(i){switch(i){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 i;default:return null}}function Ww(i,e,t){const n=e.parent,r=t.createElement(i.type),o=n.getChildIndex(e)+1;return t.insertChild(o,r,n),i.style&&t.setStyle("list-style-type",i.style,r),r}function J1(i){const e={},t=i.getStyle("mso-list");if(t){const n=t.match(/(^|\s{1,100})l(\d+)/i),r=t.match(/\s{0,100}lfo(\d+)/i),o=t.match(/\s{0,100}level(\d+)/i);n&&r&&o&&(e.id=n[2],e.order=r[1],e.indent=o[1])}return e}const X1=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class Z1{constructor(e){this.document=e}isActive(e){return X1.test(e)}execute(e){const t=new Zs(this.document),{body:n}=e._parsedData;(function(r,o){for(const a of r.getChildren())if(a.is("element","b")&&a.getStyle("font-weight")==="normal"){const c=r.getChildIndex(a);o.remove(a),o.insertChild(c,a.getChildren(),r)}})(n,t),function(r,o){for(const a of o.createRangeIn(r)){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 ex(i,e){if(!i.childCount)return;const t=new Zs;(function(r,o,a){const c=a.createRangeIn(o),u=new Hr({name:"img"}),f=[];for(const b of c)if(u.match(b.item)){const k=b.item,T=k.getAttribute("v:shapes")?k.getAttribute("v:shapes").split(" "):[];T.length&&T.every(S=>r.indexOf(S)>-1)?f.push(k):k.getAttribute("src")||f.push(k)}for(const b of f)a.remove(b)})(function(r,o){const a=o.createRangeIn(r),c=new Hr({name:/v:(.+)/}),u=[];for(const f of a){const b=f.item,k=b.previousSibling&&b.previousSibling.name||null;c.match(b)&&b.getAttribute("o:gfxdata")&&k!=="v:shapetype"&&u.push(f.item.getAttribute("id"))}return u}(i,t),i,t),function(r,o){const a=o.createRangeIn(r),c=new Hr({name:/v:(.+)/}),u=[];for(const f of a)c.match(f.item)&&u.push(f.item);for(const f of u)o.remove(f)}(i,t);const n=function(r,o){const a=o.createRangeIn(r),c=new Hr({name:"img"}),u=[];for(const f of a)c.match(f.item)&&f.item.getAttribute("src").startsWith("file://")&&u.push(f.item);return u}(i,t);n.length&&function(r,o,a){if(r.length===o.length)for(let u=0;u<r.length;u++){const f=`data:${o[u].type};base64,${c=o[u].hex,btoa(c.match(/\w{2}/g).map(b=>String.fromCharCode(parseInt(b,16))).join(""))}`;a.setAttribute("src",f,r[u])}var c}(n,function(r){if(!r)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=r.match(a),u=[];if(c)for(const f of c){let b=!1;f.includes("\\pngblip")?b="image/png":f.includes("\\jpegblip")&&(b="image/jpeg"),b&&u.push({hex:f.replace(o,"").replace(/[^\da-fA-F]/g,""),type:b})}return u}(e),t)}const tx=/<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i,nx=/xmlns:o="urn:schemas-microsoft-com/i;class rx{constructor(e){this.document=e}isActive(e){return tx.test(e)||nx.test(e)}execute(e){const{body:t,stylesString:n}=e._parsedData;Y1(t,n),ex(t,e.dataTransfer.getData("text/rtf")),e.content=t}}function qw(i){return i.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(e,t)=>t.length===1?" ":Array(t.length+1).join(" ").substr(0,t.length))}function ix(i,e){const t=new DOMParser,n=function(u){return qw(qw(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 f=u.indexOf("</body>");if(f<0)return u;const b=u.indexOf("</html>",f+7);return u.substring(0,f+7)+(b>=0?u.substring(b):"")}(i=i.replace(/<!--\[if gte vml 1]>/g,""))),r=t.parseFromString(n,"text/html");(function(u){u.querySelectorAll("span[style*=spacerun]").forEach(f=>{const b=f.innerText.length||0;f.innerHTML=Array(b+1).join(" ").substr(0,b)})})(r);const o=r.body.innerHTML,a=function(u,f){const b=new eo(f),k=new Ii(b,{blockFillerMode:"nbsp"}),T=u.createDocumentFragment(),S=u.body.childNodes;for(;S.length>0;)T.appendChild(S[0]);return k.domToView(T,{skipComments:!0})}(r,e),c=function(u){const f=[],b=[],k=Array.from(u.getElementsByTagName("style"));for(const T of k)T.sheet&&T.sheet.cssRules&&T.sheet.cssRules.length&&(f.push(T.sheet),b.push(T.innerHTML));return{styles:f,stylesString:b.join(" ")}}(r);return{body:a,bodyString:o,styles:c.styles,stylesString:c.stylesString}}function wn(i,e,t,n,r=1){e>r?n.setAttribute(i,e,t):n.removeAttribute(i,t)}function _l(i,e,t={}){const n=i.createElement("tableCell",t);return i.insertElement("paragraph",n),i.insert(n,e),n}function wv(i,e){const t=e.parent.parent,n=parseInt(t.getAttribute("headingColumns")||0),{column:r}=i.getCellLocation(e);return!!n&&r<n}function ox(){return i=>{i.on("element:table",(e,t,n)=>{const r=t.viewItem;if(!n.consumable.test(r,{name:!0}))return;const{rows:o,headingRows:a,headingColumns:c}=function(b){const k={headingRows:0,headingColumns:0},T=[],S=[];let O;for(const D of Array.from(b.getChildren()))if(D.name==="tbody"||D.name==="thead"||D.name==="tfoot"){D.name!=="thead"||O||(O=D);const L=Array.from(D.getChildren()).filter(W=>W.is("element","tr"));for(const W of L)if(W.parent.name==="thead"&&W.parent===O)k.headingRows++,T.push(W);else{S.push(W);const J=sx(W);J>k.headingColumns&&(k.headingColumns=J)}}return k.rows=[...T,...S],k}(r),u={};c&&(u.headingColumns=c),a&&(u.headingRows=a);const f=n.writer.createElement("table",u);if(n.safeInsert(f,t.modelCursor)){if(n.consumable.consume(r,{name:!0}),o.forEach(b=>n.convertItem(b,n.writer.createPositionAt(f,"end"))),n.convertChildren(r,n.writer.createPositionAt(f,"end")),f.isEmpty){const b=n.writer.createElement("tableRow");n.writer.insert(b,n.writer.createPositionAt(f,"end")),_l(n.writer,n.writer.createPositionAt(b,"end"))}n.updateConversionResult(f,t)}})}}function Kw(i){return e=>{e.on("element:"+i,(t,n,r)=>{if(n.modelRange&&n.viewItem.isEmpty){const o=n.modelRange.start.nodeAfter,a=r.writer.createPositionAt(o,0);r.writer.insertElement("paragraph",a)}},{priority:"low"})}}function sx(i){let e=0,t=0;const n=Array.from(i.getChildren()).filter(r=>r.name==="th"||r.name==="td");for(;t<n.length&&n[t].name==="th";){const r=n[t];e+=parseInt(r.getAttribute("colspan")||1),t++}return e}class qt{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 r=e.getChild(this._cellIndex);if(!r)return this._advanceToNextRow();const o=parseInt(r.getAttribute("colspan")||1),a=parseInt(r.getAttribute("rowspan")||1);(o>1||a>1)&&this._recordSpans(r,a,o),this._shouldSkipSlot()||(t=this._formatOutValue(r)),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 ax(this,e,t,n)}}_shouldSkipSlot(){const e=this._skipRows.has(this._row),t=this._row<this._startRow,n=this._column<this._startColumn,r=this._endColumn!==void 0&&this._column>this._endColumn;return e||t||n||r}_getSpanned(){const e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,n){const r={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,r)}_markSpannedCell(e,t,n){this._spannedCells.has(e)||this._spannedCells.set(e,new Map),this._spannedCells.get(e).set(t,n)}}class ax{constructor(e,t,n,r){this.cell=t,this.row=e._row,this.column=e._column,this.cellAnchorRow=n,this.cellAnchorColumn=r,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 Gw(i={}){return e=>e.on("insert:table",(t,n,r)=>{const o=n.item;if(!r.consumable.consume(o,"insert"))return;r.consumable.consume(o,"attribute:headingRows:table"),r.consumable.consume(o,"attribute:headingColumns:table");const a=i&&i.asWidget,c=r.writer.createContainerElement("figure",{class:"table"}),u=r.writer.createContainerElement("table");let f;var b,k;r.writer.insert(r.writer.createPositionAt(c,0),u),a&&(b=c,(k=r.writer).setCustomProperty("table",!0,b),f=rn(b,k,{hasSelectionHandle:!0}));const T=new qt(o),S={headingRows:o.getAttribute("headingRows")||0,headingColumns:o.getAttribute("headingColumns")||0},O=new Map;for(const L of T){const{row:W,cell:J}=L,de=o.getChild(W),xe=O.get(W)||yv(u,de,W,S,r);O.set(W,xe),r.consumable.consume(J,"insert"),kv(L,S,r.writer.createPositionAt(xe,"end"),r,i)}for(const L of o.getChildren()){const W=L.index;L.is("element","tableRow")&&!O.has(W)&&O.set(W,yv(u,L,W,S,r))}const D=r.mapper.toViewPosition(n.range.start);r.mapper.bindElements(o,a?f:c),r.writer.insert(D,a?f:c)})}function lx(i,e){const{writer:t}=e;if(i.parent.is("element","tableCell"))return Yw(i)?t.createContainerElement("span",{class:"ck-table-bogus-paragraph"}):t.createContainerElement("p")}function Yw(i){return i.parent.childCount===1&&!Zw(i)}function cx(i,e,t){const{cell:n}=i,r=Qw(i,e),o=t.mapper.toViewElement(n);o&&o.name!==r&&function(a,c,u){const f=u.writer,b=u.mapper.toViewElement(a),k=Wu(f.createEditableElement(c,b.getAttributes()),f);Kc(k,f,(T,S,O)=>O.addClass(Pt(S.classes),T),(T,S,O)=>O.removeClass(Pt(S.classes),T)),f.insert(f.createPositionAfter(b),k),f.move(f.createRangeIn(b),f.createPositionAt(k,0)),f.remove(f.createRangeOn(b)),u.mapper.unbindViewElement(b),u.mapper.bindElements(a,k)}(n,r,t)}function kv(i,e,t,n,r){const o=r&&r.asWidget,a=Qw(i,e),c=o?Wu(n.writer.createEditableElement(a),n.writer):n.writer.createContainerElement(a);o&&Kc(c,n.writer,(k,T,S)=>S.addClass(Pt(T.classes),k),(k,T,S)=>S.removeClass(Pt(T.classes),k));const u=i.cell,f=u.getChild(0),b=u.childCount===1&&f.name==="paragraph";if(n.writer.insert(t,c),n.mapper.bindElements(u,c),!o&&b&&!Zw(f)){const k=u.getChild(0);n.consumable.consume(k,"insert"),n.mapper.bindElements(k,c)}}function yv(i,e,t,n,r){r.consumable.consume(e,"insert");const o=e.isEmpty?r.writer.createEmptyElement("tr"):r.writer.createContainerElement("tr");r.mapper.bindElements(e,o);const a=n.headingRows,c=function(b,k,T){return Jw(b,k)||function(O,D,L){const W=L.writer.createContainerElement(O),J=L.writer.createPositionAt(D,O=="tbody"?"end":0);return L.writer.insert(J,W),W}(b,k,T)}(function(b,k){return b<k.headingRows?"thead":"tbody"}(t,n),i,r),u=a>0&&t>=a?t-a:t,f=r.writer.createPositionAt(c,u);return r.writer.insert(f,o),o}function Qw(i,e){const{row:t,column:n}=i,{headingColumns:r,headingRows:o}=e;return o&&o>t||r&&r>n?"th":"td"}function Jw(i,e){for(const t of e.getChildren())if(t.name==i)return t}function Xw(i,e,t){const n=Jw(i,e);n&&n.childCount===0&&t.writer.remove(t.writer.createRangeOn(n))}function Zw(i){return!![...i.getAttributeKeys()].length}class dx extends at{refresh(){const e=this.editor.model,t=e.document.selection,n=e.schema;this.isEnabled=function(r,o){const a=r.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,r=this.editor.plugins.get("TableUtils"),o=this.editor.config.get("table"),a=hl(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(f=>{const b=r.createTable(f,e);t.insertContent(b,a),f.setSelection(f.createPositionAt(b.getNodeByPath([0,0,0]),0))})}}function nd(i){const e=[];for(const t of ek(i.getRanges())){const n=t.getContainedElement();n&&n.is("element","tableCell")&&e.push(n)}return e}function hh(i){const e=[];for(const t of i.getRanges()){const n=t.start.findAncestor("tableCell");n&&e.push(n)}return e}function zn(i){const e=nd(i);return e.length?e:hh(i)}function sa(i){return tk(i.map(e=>e.parent.index))}function rd(i){const e=i[0].findAncestor("table");return tk([...new qt(e)].filter(t=>i.includes(t.cell)).map(t=>t.column))}function xv(i,e){if(i.length<2||!function(o){const a=o[0].findAncestor("table"),c=sa(o),u=parseInt(a.getAttribute("headingRows")||0);if(!nk(c,u))return!1;const f=parseInt(a.getAttribute("headingColumns")||0);return nk(rd(o),f)}(i))return!1;const t=new Set,n=new Set;let r=0;for(const o of i){const{row:a,column:c}=e.getCellLocation(o),u=parseInt(o.getAttribute("rowspan")||1),f=parseInt(o.getAttribute("colspan")||1);t.add(a),n.add(c),u>1&&t.add(a+u-1),f>1&&n.add(c+f-1),r+=u*f}return function(o,a){const c=Array.from(o.values()),u=Array.from(a.values()),f=Math.max(...c),b=Math.min(...c),k=Math.max(...u),T=Math.min(...u);return(f-b+1)*(k-T+1)}(t,n)==r}function ek(i){return Array.from(i).sort(ux)}function tk(i){const e=i.sort((t,n)=>t-n);return{first:e[0],last:e[e.length-1]}}function ux(i,e){const t=i.start,n=e.start;return t.isBefore(n)?-1:1}function nk({first:i,last:e},t){return i<t==e<t}class rk extends at{constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){const e=!!zn(this.editor.model.document.selection).length;this.isEnabled=e}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),r=this.order==="above",o=zn(t),a=sa(o),c=r?a.first:a.last,u=o[0].findAncestor("table");n.insertRows(u,{at:r?c:c+1,copyStructureFromAbove:!r})}}class ik extends at{constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){const e=!!zn(this.editor.model.document.selection).length;this.isEnabled=e}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),r=this.order==="left",o=zn(t),a=rd(o),c=r?a.first:a.last,u=o[0].findAncestor("table");n.insertColumns(u,{columns:1,at:r?c:c+1})}}class ok extends at{constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){const e=zn(this.editor.model.document.selection);this.isEnabled=e.length===1}execute(){const e=zn(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 sk(i,e,t){const{startRow:n,startColumn:r,endRow:o,endColumn:a}=e,c=t.createElement("table"),u=o-n+1;for(let b=0;b<u;b++)t.insertElement("tableRow",c,"end");const f=[...new qt(i,{startRow:n,endRow:o,startColumn:r,endColumn:a,includeAllSlots:!0})];for(const{row:b,column:k,cell:T,isAnchor:S,cellAnchorRow:O,cellAnchorColumn:D}of f){const L=b-n,W=c.getChild(L);if(S){const J=t.cloneElement(T);t.append(J,W),uk(J,b,k,o,a,t)}else(O<n||D<r)&&_l(t,t.createPositionAt(W,"end"))}return function(b,k,T,S,O){const D=parseInt(k.getAttribute("headingRows")||0);D>0&&wn("headingRows",D-T,b,O,0);const L=parseInt(k.getAttribute("headingColumns")||0);L>0&&wn("headingColumns",L-S,b,O,0)}(c,i,n,r,t),c}function ak(i,e,t=0){const n=[],r=new qt(i,{startRow:t,endRow:e-1});for(const o of r){const{row:a,cellHeight:c}=o,u=a+c-1;a<e&&e<=u&&n.push(o)}return n}function lk(i,e,t){const n=i.parent,r=n.parent,o=n.index,a=e-o,c={},u=parseInt(i.getAttribute("rowspan"))-a;u>1&&(c.rowspan=u);const f=parseInt(i.getAttribute("colspan")||1);f>1&&(c.colspan=f);const b=o+a,k=[...new qt(r,{startRow:o,endRow:b,includeAllSlots:!0})];let T,S=null;for(const O of k){const{row:D,column:L,cell:W}=O;W===i&&T===void 0&&(T=L),T!==void 0&&T===L&&D===b&&(S=_l(t,O.getPositionBefore(),c))}return wn("rowspan",a,i,t),S}function ck(i,e){const t=[],n=new qt(i);for(const r of n){const{column:o,cellWidth:a}=r,c=o+a-1;o<e&&e<=c&&t.push(r)}return t}function dk(i,e,t,n){const r=t-e,o={},a=parseInt(i.getAttribute("colspan"))-r;a>1&&(o.colspan=a);const c=parseInt(i.getAttribute("rowspan")||1);c>1&&(o.rowspan=c);const u=_l(n,n.createPositionAfter(i),o);return wn("colspan",r,i,n),u}function uk(i,e,t,n,r,o){const a=parseInt(i.getAttribute("colspan")||1),c=parseInt(i.getAttribute("rowspan")||1);t+a-1>r&&wn("colspan",r-t+1,i,o,1),e+c-1>n&&wn("rowspan",n-e+1,i,o,1)}function Cv(i,e){const t=e.getColumns(i),n=new Array(t).fill(0);for(const{column:o}of new qt(i))n[o]++;const r=n.reduce((o,a,c)=>a?o:[...o,c],[]);if(r.length>0){const o=r[r.length-1];return e.removeColumns(i,{at:o}),!0}return!1}function Tv(i,e){const t=[],n=e.getRows(i);for(let r=0;r<n;r++)i.getChild(r).isEmpty&&t.push(r);if(t.length>0){const r=t[t.length-1];return e.removeRows(i,{at:r}),!0}return!1}function Sv(i,e){Cv(i,e)||Tv(i,e)}function hk(i,e){const t=Array.from(new qt(i,{startColumn:e.firstColumn,endColumn:e.lastColumn,row:e.lastRow}));if(t.every(({cellHeight:r})=>r===1))return e.lastRow;const n=t[0].cellHeight-1;return e.lastRow+n}function fk(i,e){const t=Array.from(new qt(i,{startRow:e.firstRow,endRow:e.lastRow,column:e.lastColumn}));if(t.every(({cellWidth:r})=>r===1))return e.lastColumn;const n=t[0].cellWidth-1;return e.lastColumn+n}class ng extends at{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=hh(e.document.selection)[0],n=this.value,r=this.direction;e.change(o=>{const a=r=="right"||r=="down",c=a?t:n,u=a?n:t,f=u.parent;(function(O,D,L){pk(O)||(pk(D)&&L.remove(L.createRangeIn(D)),L.move(L.createRangeIn(O),L.createPositionAt(D,"end"))),L.remove(O)})(u,c,o);const b=this.isHorizontal?"colspan":"rowspan",k=parseInt(t.getAttribute(b)||1),T=parseInt(n.getAttribute(b)||1);o.setAttribute(b,k+T,c),o.setSelection(o.createRangeIn(c));const S=this.editor.plugins.get("TableUtils");Sv(f.findAncestor("table"),S)})}_getMergeableCell(){const e=hh(this.editor.model.document.selection)[0];if(!e)return;const t=this.editor.plugins.get("TableUtils"),n=this.isHorizontal?function(a,c,u){const f=a.parent.parent,b=c=="right"?a.nextSibling:a.previousSibling,k=(f.getAttribute("headingColumns")||0)>0;if(!b)return;const T=c=="right"?a:b,S=c=="right"?b:a,{column:O}=u.getCellLocation(T),{column:D}=u.getCellLocation(S),L=parseInt(T.getAttribute("colspan")||1),W=wv(u,T),J=wv(u,S);if(!(k&&W!=J))return O+L===D?b:void 0}(e,this.direction,t):function(a,c,u){const f=a.parent,b=f.parent,k=b.getChildIndex(f);if(c=="down"&&k===u.getRows(b)-1||c=="up"&&k===0)return;const T=parseInt(a.getAttribute("rowspan")||1),S=b.getAttribute("headingRows")||0,O=c=="down"&&k+T===S,D=c=="up"&&k===S;if(S&&(O||D))return;const L=parseInt(a.getAttribute("rowspan")||1),W=c=="down"?k+L:k,J=[...new qt(b,{endRow:W})],de=J.find(Ve=>Ve.cell===a).column,xe=J.find(({row:Ve,cellHeight:Qt,column:wt})=>wt===de&&(c=="down"?Ve===W:W===Ve+Qt));return xe&&xe.cell}(e,this.direction,t);if(!n)return;const r=this.isHorizontal?"rowspan":"colspan",o=parseInt(e.getAttribute(r)||1);return parseInt(n.getAttribute(r)||1)===o?n:void 0}}function pk(i){return i.childCount==1&&i.getChild(0).is("element","paragraph")&&i.getChild(0).isEmpty}class hx extends at{refresh(){const e=zn(this.editor.model.document.selection),t=e[0];if(t){const n=t.findAncestor("table"),r=this.editor.plugins.get("TableUtils").getRows(n)-1,o=sa(e),a=o.first===0&&o.last===r;this.isEnabled=!a}else this.isEnabled=!1}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),n=zn(e.document.selection),r=sa(n),o=n[0],a=o.findAncestor("table"),c=t.getCellLocation(o).column;e.change(u=>{const f=r.last-r.first+1;t.removeRows(a,{at:r.first,rows:f});const b=function(k,T,S,O){const D=k.getChild(Math.min(T,O-1));let L=D.getChild(0),W=0;for(const J of D.getChildren()){if(W>S)return L;L=J,W+=parseInt(J.getAttribute("colspan")||1)}return L}(a,r.first,c,t.getRows(a));u.setSelection(u.createPositionAt(b,0))})}}class fx extends at{refresh(){const e=zn(this.editor.model.document.selection),t=e[0];if(t){const n=t.findAncestor("table"),r=this.editor.plugins.get("TableUtils").getColumns(n),{first:o,last:a}=rd(e);this.isEnabled=a-o<r-1}else this.isEnabled=!1}execute(){const[e,t]=function(c){const u=zn(c),f=u[0],b=u.pop(),k=[f,b];return f.isBefore(b)?k:k.reverse()}(this.editor.model.document.selection),n=e.parent.parent,r=[...new qt(n)],o={first:r.find(c=>c.cell===e).column,last:r.find(c=>c.cell===t).column},a=function(c,u,f,b){return parseInt(f.getAttribute("colspan")||1)>1?f:u.previousSibling||f.nextSibling?f.nextSibling||u.previousSibling:b.first?c.reverse().find(({column:k})=>k<b.first).cell:c.reverse().find(({column:k})=>k>b.last).cell}(r,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 px extends at{refresh(){const e=zn(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=zn(t.document.selection),r=n[0].findAncestor("table"),{first:o,last:a}=sa(n),c=this.value?o:a+1,u=r.getAttribute("headingRows")||0;t.change(f=>{if(c){const b=ak(r,c,c>u?u:0);for(const{cell:k}of b)lk(k,c,f)}wn("headingRows",c,r,f,0)})}_isInHeading(e,t){const n=parseInt(t.getAttribute("headingRows")||0);return!!n&&e.parent.index<n}}class gx extends at{refresh(){const e=zn(this.editor.model.document.selection),t=this.editor.plugins.get("TableUtils"),n=e.length>0;this.isEnabled=n,this.value=n&&e.every(r=>wv(t,r))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.model,n=zn(t.document.selection),r=n[0].findAncestor("table"),{first:o,last:a}=rd(n),c=this.value?o:a+1;t.change(u=>{if(c){const f=ck(r,c);for(const{cell:b,column:k}of f)dk(b,k,c,u)}wn("headingColumns",c,r,u,0)})}}class id extends ve{static get pluginName(){return"TableUtils"}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(e){const t=e.parent,n=t.parent,r=n.getChildIndex(t),o=new qt(n,{row:r});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"),r=parseInt(t.rows)||2,o=parseInt(t.columns)||2;return Av(e,n,0,r,o),t.headingRows&&wn("headingRows",Math.min(t.headingRows,r),n,e,0),t.headingColumns&&wn("headingColumns",Math.min(t.headingColumns,o),n,e,0),n}insertRows(e,t={}){const n=this.editor.model,r=t.at||0,o=t.rows||1,a=t.copyStructureFromAbove!==void 0,c=t.copyStructureFromAbove?r-1:r,u=this.getRows(e),f=this.getColumns(e);if(r>u)throw new y.a("tableutils-insertrows-insert-out-of-range",this,{options:t});n.change(b=>{const k=e.getAttribute("headingRows")||0;if(k>r&&wn("headingRows",k+o,e,b,0),!a&&(r===0||r===u))return void Av(b,e,r,o,f);const T=a?Math.max(r,c):r,S=new qt(e,{endRow:T}),O=new Array(f).fill(1);for(const{row:D,column:L,cellHeight:W,cellWidth:J,cell:de}of S){const xe=D+W-1,Ve=D<=c&&c<=xe;D<r&&r<=xe?(b.setAttribute("rowspan",W+o,de),O[L]=-J):a&&Ve&&(O[L]=J)}for(let D=0;D<o;D++){const L=b.createElement("tableRow");b.insert(L,e,r);for(let W=0;W<O.length;W++){const J=O[W],de=b.createPositionAt(L,"end");J>0&&_l(b,de,J>1?{colspan:J}:null),W+=Math.abs(J)-1}}})}insertColumns(e,t={}){const n=this.editor.model,r=t.at||0,o=t.columns||1;n.change(a=>{const c=e.getAttribute("headingColumns");r<c&&a.setAttribute("headingColumns",c+o,e);const u=this.getColumns(e);if(r===0||u===r){for(const b of e.getChildren())b.is("element","tableRow")&&od(o,a,a.createPositionAt(b,r?"end":0));return}const f=new qt(e,{column:r,includeAllSlots:!0});for(const b of f){const{row:k,cell:T,cellAnchorColumn:S,cellAnchorRow:O,cellWidth:D,cellHeight:L}=b;if(S<r){a.setAttribute("colspan",D+o,T);const W=O+L-1;for(let J=k;J<=W;J++)f.skipRow(J)}else od(o,a,b.getPositionBefore())}})}removeRows(e,t){const n=this.editor.model,r=t.rows||1,o=this.getRows(e),a=t.at,c=a+r-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:f,cellsToTrim:b}=function(k,T,S){const O=new Map,D=[];for(const{row:L,column:W,cellHeight:J,cell:de}of new qt(k,{endRow:S})){const xe=L+J-1;if(L>=T&&L<=S&&xe>S){const Ve=J-(S-L+1);O.set(W,{cell:de,rowspan:Ve})}if(L<T&&xe>=T){let Ve;Ve=xe>=S?S-T+1:xe-T+1,D.push({cell:de,rowspan:J-Ve})}}return{cellsToMove:O,cellsToTrim:D}}(e,a,c);f.size&&function(k,T,S,O){const D=[...new qt(k,{includeAllSlots:!0,row:T})],L=k.getChild(T);let W;for(const{column:J,cell:de,isAnchor:xe}of D)if(S.has(J)){const{cell:Ve,rowspan:Qt}=S.get(J),wt=W?O.createPositionAfter(W):O.createPositionAt(L,0);O.move(O.createRangeOn(Ve),wt),wn("rowspan",Qt,Ve,O),W=Ve}else xe&&(W=de)}(e,c+1,f,u);for(let k=c;k>=a;k--)u.remove(e.getChild(k));for(const{rowspan:k,cell:T}of b)wn("rowspan",k,T,u);(function(k,T,S,O){const D=k.getAttribute("headingRows")||0;T<D&&wn("headingRows",S<D?D-(S-T+1):T,k,O,0)})(e,a,c,u),Cv(e,this)||Tv(e,this)})}removeColumns(e,t){const n=this.editor.model,r=t.at,o=t.columns||1,a=t.at+o-1;n.change(c=>{(function(u,f,b){const k=u.getAttribute("headingColumns")||0;if(k&&f.first<k){const T=Math.min(k-1,f.last)-f.first+1;b.setAttribute("headingColumns",k-T,u)}})(e,{first:r,last:a},c);for(let u=a;u>=r;u--)for(const{cell:f,column:b,cellWidth:k}of[...new qt(e)])b<=u&&k>1&&b+k>u?wn("colspan",k-1,f,c):b===u&&c.remove(f);Tv(e,this)||Cv(e,this)})}splitCellVertically(e,t=2){const n=this.editor.model,r=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:f}=gk(a,t);wn("colspan",f,e,c);const b={};u>1&&(b.colspan=u),o>1&&(b.rowspan=o),od(a>t?t-1:a-1,c,c.createPositionAfter(e),b)}if(a<t){const u=t-a,f=[...new qt(r)],{column:b}=f.find(({cell:O})=>O===e),k=f.filter(({cell:O,cellWidth:D,column:L})=>O!==e&&L===b||L<b&&L+D>b);for(const{cell:O,cellWidth:D}of k)c.setAttribute("colspan",D+u,O);const T={};o>1&&(T.rowspan=o),od(u,c,c.createPositionAfter(e),T);const S=r.getAttribute("headingColumns")||0;S>b&&wn("headingColumns",S+u,r,c)}})}splitCellHorizontally(e,t=2){const n=this.editor.model,r=e.parent,o=r.parent,a=o.getChildIndex(r),c=parseInt(e.getAttribute("rowspan")||1),u=parseInt(e.getAttribute("colspan")||1);n.change(f=>{if(c>1){const b=[...new qt(o,{startRow:a,endRow:a+c-1,includeAllSlots:!0})],{newCellsSpan:k,updatedSpan:T}=gk(c,t);wn("rowspan",T,e,f);const{column:S}=b.find(({cell:D})=>D===e),O={};k>1&&(O.rowspan=k),u>1&&(O.colspan=u);for(const D of b){const{column:L,row:W}=D,J=L===S,de=(W+a+T)%k==0;W>=a+T&&J&&de&&od(1,f,D.getPositionBefore(),O)}}if(c<t){const b=t-c,k=[...new qt(o,{startRow:0,endRow:a})];for(const{cell:O,cellHeight:D,row:L}of k)if(O!==e&&L+D>a){const W=D+b;f.setAttribute("rowspan",W,O)}const T={};u>1&&(T.colspan=u),Av(f,o,a+1,b,1,T);const S=o.getAttribute("headingRows")||0;S>a&&wn("headingRows",S+b,o,f)}})}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 Av(i,e,t,n,r,o={}){for(let a=0;a<n;a++){const c=i.createElement("tableRow");i.insert(c,e,t),od(r,i,i.createPositionAt(c,"end"),o)}}function od(i,e,t,n={}){for(let r=0;r<i;r++)_l(e,t,n)}function gk(i,e){if(i<e)return{newCellsSpan:1,updatedSpan:1};const t=Math.floor(i/e);return{newCellsSpan:t,updatedSpan:i-t*e+t}}class mx extends at{refresh(){const e=nd(this.editor.model.document.selection);this.isEnabled=xv(e,this.editor.plugins.get(id))}execute(){const e=this.editor.model,t=this.editor.plugins.get(id);e.change(n=>{const r=nd(e.document.selection),o=r.shift(),{mergeWidth:a,mergeHeight:c}=function(u,f,b){let k=0,T=0;for(const D of f){const{row:L,column:W}=b.getCellLocation(D);k=bk(D,W,k,"colspan"),T=bk(D,L,T,"rowspan")}const{row:S,column:O}=b.getCellLocation(u);return{mergeWidth:k-O,mergeHeight:T-S}}(o,r,t);wn("colspan",a,o,n),wn("rowspan",c,o,n);for(const u of r)bx(u,o,n);Sv(o.findAncestor("table"),t),n.setSelection(o,"in")})}}function bx(i,e,t){mk(i)||(mk(e)&&t.remove(t.createRangeIn(e)),t.move(t.createRangeIn(i),t.createPositionAt(e,"end"))),t.remove(i)}function mk(i){return i.childCount==1&&i.getChild(0).is("element","paragraph")&&i.getChild(0).isEmpty}function bk(i,e,t,n){const r=parseInt(i.getAttribute(n)||1);return Math.max(t,e+r)}class vx extends at{refresh(){const e=zn(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=zn(e.document.selection),n=sa(t),r=t[0].findAncestor("table"),o=[];for(let a=n.first;a<=n.last;a++)for(const c of r.getChild(a).getChildren())o.push(e.createRangeOn(c));e.change(a=>{a.setSelection(o)})}}class _x extends at{refresh(){const e=zn(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=zn(e.document.selection),n=t[0],r=t.pop(),o=n.findAncestor("table"),a=this.editor.plugins.get("TableUtils"),c=a.getCellLocation(n),u=a.getCellLocation(r),f=Math.min(c.column,u.column),b=Math.max(c.column,u.column),k=[];for(const T of new qt(o,{startColumn:f,endColumn:b}))k.push(e.createRangeOn(T.cell));e.change(T=>{T.setSelection(k)})}}function wx(i){i.document.registerPostFixer(e=>function(t,n){const r=n.document.differ.getChanges();let o=!1;const a=new Set;for(const c of r){let u;c.name=="table"&&c.type=="insert"&&(u=c.position.nodeAfter),c.name!="tableRow"&&c.name!="tableCell"||(u=c.position.findAncestor("table")),xx(c)&&(u=c.range.start.findAncestor("table")),u&&!a.has(u)&&(o=kx(u,t)||o,o=yx(u,t)||o,a.add(u))}return o}(e,i))}function kx(i,e){let t=!1;const n=function(r){const o=parseInt(r.getAttribute("headingRows")||0),a=Array.from(r.getChildren()).reduce((u,f)=>f.is("element","tableRow")?u+1:u,0),c=[];for(const{row:u,cell:f,cellHeight:b}of new qt(r)){if(b<2)continue;const k=u<o?o:a;if(u+b>k){const T=k-u;c.push({cell:f,rowspan:T})}}return c}(i);if(n.length){t=!0;for(const r of n)wn("rowspan",r.rowspan,r.cell,e,1)}return t}function yx(i,e){let t=!1;const n=function(c){const u=new Array(c.childCount).fill(0);for(const{rowIndex:f}of new qt(c,{includeAllSlots:!0}))u[f]++;return u}(i),r=[];for(const[c,u]of n.entries())!u&&i.getChild(c).is("element","tableRow")&&r.push(c);if(r.length){t=!0;for(const c of r.reverse())e.remove(i.getChild(c)),n.splice(c,1)}const o=n.filter((c,u)=>i.getChild(u).is("element","tableRow")),a=o[0];if(!o.every(c=>c===a)){const c=o.reduce((u,f)=>f>u?f:u,0);for(const[u,f]of o.entries()){const b=c-f;if(b){for(let k=0;k<b;k++)_l(e,e.createPositionAt(i.getChild(u),"end"));t=!0}}}return t}function xx(i){const e=i.type==="attribute",t=i.attributeKey;return e&&(t==="headingRows"||t==="colspan"||t==="rowspan")}function Cx(i){i.document.registerPostFixer(e=>function(t,n){const r=n.document.differ.getChanges();let o=!1;for(const a of r)a.type=="insert"&&a.name=="table"&&(o=Tx(a.position.nodeAfter,t)||o),a.type=="insert"&&a.name=="tableRow"&&(o=vk(a.position.nodeAfter,t)||o),a.type=="insert"&&a.name=="tableCell"&&(o=Ev(a.position.nodeAfter,t)||o),Sx(a)&&(o=Ev(a.position.parent,t)||o);return o}(e,i))}function Tx(i,e){let t=!1;for(const n of i.getChildren())n.is("element","tableRow")&&(t=vk(n,e)||t);return t}function vk(i,e){let t=!1;for(const n of i.getChildren())t=Ev(n,e)||t;return t}function Ev(i,e){if(i.childCount==0)return e.insertElement("paragraph",i),!0;const t=Array.from(i.getChildren()).filter(n=>n.is("$text"));for(const n of t)e.wrap(e.createRangeOn(n),"paragraph");return!!t.length}function Sx(i){return!(!i.position||!i.position.parent.is("element","tableCell"))&&(i.type=="insert"&&i.name=="$text"||i.type=="remove")}function Ax(i,e){i.document.registerPostFixer(()=>function(t,n){const r=new Set;for(const o of t.getChanges()){const a=o.type=="attribute"?o.range.start.parent:o.position.parent;a.is("element","tableCell")&&r.add(a)}for(const o of r.values())for(const a of[...o.getChildren()].filter(c=>Ex(c,n)))t.refreshItem(a);return!1}(i.document.differ,e))}function Ex(i,e){if(!i.is("element","paragraph"))return!1;const t=e.toViewElement(i);return!!t&&Yw(i)!==t.is("element","span")}function Px(i){i.document.registerPostFixer(()=>function(e){const t=e.document.differ,n=new Set;for(const r of t.getChanges()){if(r.type!="attribute")continue;const o=r.range.start.nodeAfter;o&&o.is("element","table")&&r.attributeKey=="headingRows"&&n.add(o)}if(n.size){for(const r of n.values())t.refreshItem(r);return!0}return!1}(i))}_(100);class Ix extends ve{static get pluginName(){return"TableEditing"}init(){const e=this.editor,t=e.model,n=t.schema,r=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}),r.for("upcast").add(o=>{o.on("element:figure",(a,c,u)=>{if(!u.consumable.test(c.viewItem,{name:!0,classes:"table"}))return;const f=function(k){for(const T of k.getChildren())if(T.is("element","table"))return T}(c.viewItem);if(!f||!u.consumable.test(f,{name:!0}))return;const b=pr(u.convertItem(f,c.modelCursor).modelRange.getItems());b&&(u.convertChildren(c.viewItem,u.writer.createPositionAt(b,"end")),u.updateConversionResult(b,c))})}),r.for("upcast").add(ox()),r.for("editingDowncast").add(Gw({asWidget:!0})),r.for("dataDowncast").add(Gw()),r.for("upcast").elementToElement({model:"tableRow",view:"tr"}),r.for("upcast").add(o=>{o.on("element:tr",(a,c)=>{c.viewItem.isEmpty&&c.modelCursor.index==0&&a.stop()},{priority:"high"})}),r.for("editingDowncast").add(o=>o.on("insert:tableRow",(a,c,u)=>{const f=c.item;if(!u.consumable.consume(f,"insert"))return;const b=f.parent,k=function(L){for(const W of L.getChildren())if(W.name==="table")return W}(u.mapper.toViewElement(b)),T=b.getChildIndex(f),S=new qt(b,{row:T}),O={headingRows:b.getAttribute("headingRows")||0,headingColumns:b.getAttribute("headingColumns")||0},D=new Map;for(const L of S){const W=D.get(T)||yv(k,f,T,O,u);D.set(T,W),u.consumable.consume(L.cell,"insert"),kv(L,O,u.writer.createPositionAt(W,"end"),u,{asWidget:!0})}})),r.for("editingDowncast").add(o=>o.on("remove:tableRow",(a,c,u)=>{a.stop();const f=u.writer,b=u.mapper,k=b.toViewPosition(c.position).getLastMatchingPosition(D=>!D.item.is("element","tr")).nodeAfter,T=k.parent.parent,S=f.createRangeOn(k),O=f.remove(S);for(const D of f.createRangeIn(O).getItems())b.unbindViewElement(D);Xw("thead",T,u),Xw("tbody",T,u)},{priority:"higher"})),r.for("upcast").elementToElement({model:"tableCell",view:"td"}),r.for("upcast").elementToElement({model:"tableCell",view:"th"}),r.for("upcast").add(Kw("td")),r.for("upcast").add(Kw("th")),r.for("editingDowncast").add(o=>o.on("insert:tableCell",(a,c,u)=>{const f=c.item;if(!u.consumable.consume(f,"insert"))return;const b=f.parent,k=b.parent,T=k.getChildIndex(b),S=new qt(k,{row:T}),O={headingRows:k.getAttribute("headingRows")||0,headingColumns:k.getAttribute("headingColumns")||0};for(const D of S)if(D.cell===f){const L=u.mapper.toViewElement(b);return void kv(D,O,u.writer.createPositionAt(L,b.getChildIndex(f)),u,{asWidget:!0})}})),r.for("editingDowncast").elementToElement({model:"paragraph",view:lx,converterPriority:"high"}),r.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),r.for("upcast").attributeToAttribute({model:{key:"colspan",value:_k("colspan")},view:"colspan"}),r.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),r.for("upcast").attributeToAttribute({model:{key:"rowspan",value:_k("rowspan")},view:"rowspan"}),r.for("editingDowncast").add(o=>o.on("attribute:headingColumns:table",(a,c,u)=>{const f=c.item;if(!u.consumable.consume(c.item,a.name))return;const b={headingRows:f.getAttribute("headingRows")||0,headingColumns:f.getAttribute("headingColumns")||0},k=c.attributeOldValue,T=c.attributeNewValue,S=(k>T?k:T)-1;for(const O of new qt(f,{endColumn:S}))cx(O,b,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 f=a.mapper.toViewElement(u),b=a.mapper.toViewElement(c);f===b&&(a.viewPosition=a.mapper.findPositionIn(b,u.maxOffset))}),e.config.define("table.defaultHeadings.rows",0),e.config.define("table.defaultHeadings.columns",0),e.commands.add("insertTable",new dx(e)),e.commands.add("insertTableRowAbove",new rk(e,{order:"above"})),e.commands.add("insertTableRowBelow",new rk(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new ik(e,{order:"left"})),e.commands.add("insertTableColumnRight",new ik(e,{order:"right"})),e.commands.add("removeTableRow",new hx(e)),e.commands.add("removeTableColumn",new fx(e)),e.commands.add("splitTableCellVertically",new ok(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new ok(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new mx(e)),e.commands.add("mergeTableCellRight",new ng(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new ng(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new ng(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new ng(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new gx(e)),e.commands.add("setTableRowHeader",new px(e)),e.commands.add("selectTableRow",new vx(e)),e.commands.add("selectTableColumn",new _x(e)),Px(t),wx(t),Ax(t,e.editing.mapper),Cx(t)}static get requires(){return[id]}}function _k(i){return e=>{const t=parseInt(e.getAttribute(i));return Number.isNaN(t)||t<=0?null:t}}_(102);class Mx extends ct{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,r)=>`${r} × ${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,r)=>{const{row:o,column:a}=r.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,r)=>{const o=Math.floor(r/10)<e&&r%10<t;n.set("isOn",o)})}_createGridCollection(){const e=[];for(let t=0;t<100;t++){const n=Math.floor(t/10),r=t%10;e.push(new Ox(this.locale,n+1,r+1))}return this.createCollection(e)}}class Ox extends ct{constructor(e,t,n){super(e);const r=this.bindTemplate;this.set("isOn",!1),this.setTemplate({tag:"div",attributes:{class:["ck-insert-table-dropdown-grid-box",r.if("isOn","ck-on")],"data-row":t,"data-column":n}})}}class Nx extends ve{static get pluginName(){return"TableUI"}init(){const e=this.editor,t=this.editor.t,n=e.locale.contentLanguageDirection==="ltr";e.ui.componentFactory.add("insertTable",r=>{const o=e.commands.get("insertTable"),a=hs(r);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 Mx(r),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",r=>{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,r)}),e.ui.componentFactory.add("tableRow",r=>{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,r)}),e.ui.componentFactory.add("mergeTableCells",r=>{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,r)})}_prepareDropdown(e,t,n,r){const o=this.editor,a=hs(r),c=this._fillDropdownWithListOptions(a,n);return a.buttonView.set({label:e,icon:t,tooltip:!0}),a.bind("isEnabled").toMany(c,"isEnabled",(...u)=>u.some(f=>f)),this.listenTo(a,"execute",u=>{o.execute(u.source.commandName),o.editing.view.focus()}),a}_prepareMergeSplitButtonDropdown(e,t,n,r){const o=this.editor,a=hs(r,Uf),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",(...f)=>f.some(b=>b)),this.listenTo(a.buttonView,"execute",()=>{o.execute("mergeTableCells"),o.editing.view.focus()}),this.listenTo(a,"execute",f=>{o.execute(f.source.commandName),o.editing.view.focus()}),a}_fillDropdownWithListOptions(e,t){const n=this.editor,r=[],o=new ur;for(const a of t)Rx(a,n,r,o);return Zf(e,o,n.ui.componentFactory),r}}function Rx(i,e,t,n){const r=i.model=new $u(i.model),{commandName:o,bindIsOn:a}=i.model;if(i.type==="button"||i.type==="switchbutton"){const c=e.commands.get(o);t.push(c),r.set({commandName:o}),r.bind("isEnabled").to(c),a&&r.bind("isOn").to(c,"value")}r.set({withText:!0}),n.add(i)}_(104);class wl extends ve{static get pluginName(){return"TableSelection"}static get requires(){return[id]}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=nd(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(),r=this.editor.plugins.get("TableUtils"),{first:o,last:a}=rd(e),{first:c,last:u}=sa(e),f=e[0].findAncestor("table");let b=u,k=a;if(xv(e,r)){const S={firstColumn:o,lastColumn:a,firstRow:c,lastRow:u};b=hk(f,S),k=fk(f,S)}const T=sk(f,{startRow:c,startColumn:o,endRow:b,endColumn:k},t);return t.insert(T,n,0),n}):null}setCellSelection(e,t){const n=this._getCellsToSelect(e,t);this.editor.model.change(r=>{r.setSelection(n.cells.map(o=>r.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=pr(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",(r,o,a)=>{const c=a.writer;(function(b){for(const k of t)b.removeClass("ck-editor__editable_selected",k);t.clear()})(c);const u=this.getSelectedTableCells();if(!u)return;for(const b of u){const k=a.mapper.toViewElement(b);c.addClass("ck-editor__editable_selected",k),t.add(k)}const f=a.mapper.toViewElement(u[u.length-1]);c.setSelection(f,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 r=n.createPositionAt(t[0],0),o=e.model.schema.getNearestSelectionRange(r);n.setSelection(o)})}})}_handleDeleteContent(e,t){const[n,r]=t,o=this.editor.model,a=!r||r.direction=="backward",c=nd(n);c.length&&(e.stop(),o.change(u=>{const f=c[a?c.length-1:0];o.change(k=>{for(const T of c)o.deleteContent(k.createSelection(T,"in"))});const b=o.schema.getNearestSelectionRange(u.createPositionAt(f,0));n.is("documentSelection")?u.setSelection(b):n.setTo(b)}))}_getCellsToSelect(e,t){const n=this.editor.plugins.get("TableUtils"),r=n.getCellLocation(e),o=n.getCellLocation(t),a=Math.min(r.row,o.row),c=Math.max(r.row,o.row),u=Math.min(r.column,o.column),f=Math.max(r.column,o.column),b=new Array(c-a+1).fill(null).map(()=>[]),k={startRow:a,endRow:c,startColumn:u,endColumn:f};for(const{row:O,cell:D}of new qt(e.findAncestor("table"),k))b[O-a].push(D);const T=o.row<r.row,S=o.column<r.column;return T&&b.reverse(),S&&b.forEach(O=>O.reverse()),{cells:b.flat(),backward:T||S}}}class Dx extends ve{static get pluginName(){return"TableClipboard"}static get requires(){return[wl,id]}init(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"copy",(n,r)=>this._onCopyCut(n,r)),this.listenTo(t,"cut",(n,r)=>this._onCopyCut(n,r)),this.listenTo(e.model,"insertContent",(n,r)=>this._onInsertContent(n,...r),{priority:"high"}),this.decorate("_replaceTableSlotCell")}_onCopyCut(e,t){const n=this.editor.plugins.get(wl);if(!n.getSelectedTableCells()||e.name=="cut"&&this.editor.isReadOnly)return;t.preventDefault(),e.stop();const r=this.editor.data,o=this.editor.editing.view.document,a=r.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 r=this.editor.model,o=this.editor.plugins.get(id);let a=function(u,f){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 b=f.createRangeIn(u);for(const k of b.getItems())if(k.is("element","table")){const T=f.createRange(b.start,f.createPositionBefore(k));if(f.hasContent(T,{ignoreWhitespaces:!0}))return null;const S=f.createRange(f.createPositionAfter(k),b.end);return f.hasContent(S,{ignoreWhitespaces:!0})?null:k}return null}(t,r);if(!a)return;const c=zn(r.document.selection);c.length?(e.stop(),r.change(u=>{const f={width:o.getColumns(a),height:o.getRows(a)},b=function(L,W,J,de){const xe=L[0].findAncestor("table"),Ve=rd(L),Qt=sa(L),wt={firstColumn:Ve.first,lastColumn:Ve.last,firstRow:Qt.first,lastRow:Qt.last},Gn=L.length===1;return Gn&&(wt.lastRow+=W.height-1,wt.lastColumn+=W.width-1,function(ar,Yn,Kr,_r){const Fr=_r.getColumns(ar),bs=_r.getRows(ar);Kr>Fr&&_r.insertColumns(ar,{at:Fr,columns:Kr-Fr}),Yn>bs&&_r.insertRows(ar,{at:bs,rows:Yn-bs})}(xe,wt.lastRow+1,wt.lastColumn+1,de)),Gn||!xv(L,de)?function(ar,Yn,Kr){const{firstRow:_r,lastRow:Fr,firstColumn:bs,lastColumn:fh}=Yn,ph={first:_r,last:Fr},Ck={first:bs,last:fh};Iv(ar,bs,ph,Kr),Iv(ar,fh+1,ph,Kr),Pv(ar,_r,Ck,Kr),Pv(ar,Fr+1,Ck,Kr,_r)}(xe,wt,J):(wt.lastRow=hk(xe,wt),wt.lastColumn=fk(xe,wt)),wt}(c,f,u,o),k=b.lastRow-b.firstRow+1,T=b.lastColumn-b.firstColumn+1,S={startRow:0,startColumn:0,endRow:Math.min(k,f.height)-1,endColumn:Math.min(T,f.width)-1};a=sk(a,S,u);const O=c[0].findAncestor("table"),D=this._replaceSelectedCellsWithPasted(a,f,O,b,u);if(this.editor.plugins.get("TableSelection").isEnabled){const L=ek(D.map(W=>u.createRangeOn(W)));u.setSelection(L)}else u.setSelection(D[0],0)})):Sv(a,o)}_replaceSelectedCellsWithPasted(e,t,n,r,o){const{width:a,height:c}=t,u=function(L,W,J){const de=new Array(J).fill(null).map(()=>new Array(W).fill(null));for(const{column:xe,row:Ve,cell:Qt}of new qt(L))de[Ve][xe]=Qt;return de}(e,a,c),f=[...new qt(n,{startRow:r.firstRow,endRow:r.lastRow,startColumn:r.firstColumn,endColumn:r.lastColumn,includeAllSlots:!0})],b=[];let k;for(const L of f){const{row:W,column:J}=L;J===r.firstColumn&&(k=L.getPositionBefore());const de=W-r.firstRow,xe=J-r.firstColumn,Ve=u[de%c][xe%a],Qt=Ve?o.cloneElement(Ve):null,wt=this._replaceTableSlotCell(L,Qt,k,o);wt&&(uk(wt,W,J,r.lastRow,r.lastColumn,o),b.push(wt),k=o.createPositionAfter(wt))}const T=parseInt(n.getAttribute("headingRows")||0),S=parseInt(n.getAttribute("headingColumns")||0),O=r.firstRow<T&&T<=r.lastRow,D=r.firstColumn<S&&S<=r.lastColumn;if(O){const L=Pv(n,T,{first:r.firstColumn,last:r.lastColumn},o,r.firstRow);b.push(...L)}if(D){const L=Iv(n,S,{first:r.firstRow,last:r.lastRow},o);b.push(...L)}return b}_replaceTableSlotCell(e,t,n,r){const{cell:o,isAnchor:a}=e;return a&&r.remove(o),t?(r.insert(t,n),t):null}}function Pv(i,e,t,n,r=0){if(!(e<1))return ak(i,e,r).filter(({column:o,cellWidth:a})=>wk(o,a,t)).map(({cell:o})=>lk(o,e,n))}function Iv(i,e,t,n){if(!(e<1))return ck(i,e).filter(({row:r,cellHeight:o})=>wk(r,o,t)).map(({cell:r,column:o})=>dk(r,o,e,n))}function wk(i,e,t){const n=i+e-1,{first:r,last:o}=t;return i>=r&&i<=o||i<r&&n>=r}class jx extends ve{static get pluginName(){return"TableKeyboard"}static get requires(){return[wl]}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,r=n.model.document.selection.getSelectedElement();r&&r.is("element","table")&&(t(),n.model.change(o=>{o.setSelection(o.createRangeIn(r.getChild(0).getChild(0)))}))}_getTabHandler(e){const t=this.editor;return(n,r)=>{let o=hh(t.model.document.selection)[0];if(o||(o=this.editor.plugins.get("TableSelection").getFocusCell()),!o)return;r();const a=o.parent,c=a.parent,u=c.getChildIndex(a),f=a.getChildIndex(o),b=f===0;if(!e&&b&&u===0)return void t.model.change(D=>{D.setSelection(D.createRangeOn(c))});const k=this.editor.plugins.get("TableUtils"),T=f===a.childCount-1,S=u===k.getRows(c)-1;if(e&&S&&T&&(t.execute("insertTableRowBelow"),u===k.getRows(c)-1))return void t.model.change(D=>{D.setSelection(D.createRangeOn(c))});let O;if(e&&T)O=c.getChild(u+1).getChild(0);else if(!e&&b){const D=c.getChild(u-1);O=D.getChild(D.childCount-1)}else O=a.getChild(f+(e?1:-1));t.model.change(D=>{D.setSelection(D.createRangeIn(O))})}}_onArrowKey(e,t){const n=this.editor,r=Er(t.keyCode,n.locale.contentLanguageDirection);this._handleArrowKeys(r,t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),e.stop())}_handleArrowKeys(e,t){const n=this.editor.model.document.selection,r=["right","down"].includes(e),o=nd(n);if(o.length){let c;return c=t?this.editor.plugins.get("TableSelection").getFocusCell():r?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==r)&&!!this._isSelectionAtCellEdge(n,a,r)&&(this._navigateFromCellInDirection(a,e,t),!0)}_isSelectionAtCellEdge(e,t,n){const r=this.editor.model,o=this.editor.model.schema,a=n?e.getLastPosition():e.getFirstPosition();if(!o.getLimitElement(a).is("element","tableCell"))return r.createPositionAt(t,n?"end":0).isTouching(a);const c=r.createSelection(a);return r.modifySelection(c,{direction:n?"forward":"backward"}),a.isEqual(c.focus)}_navigateFromCellInDirection(e,t,n=!1){const r=this.editor.model,o=e.findAncestor("table"),a=[...new qt(o,{includeAllSlots:!0})],{row:c,column:u}=a[a.length-1],f=a.find(({cell:D})=>D==e);let{row:b,column:k}=f;switch(t){case"left":k--;break;case"up":b--;break;case"right":k+=f.cellWidth;break;case"down":b+=f.cellHeight}if(b<0||b>c||k<0&&b<=0||k>u&&b>=c)return void r.change(D=>{D.setSelection(D.createRangeOn(o))});k<0?(k=n?0:u,b--):k>u&&(k=n?u:0,b++);const T=a.find(D=>D.row==b&&D.column==k).cell,S=["right","down"].includes(t),O=this.editor.plugins.get("TableSelection");if(n&&O.isEnabled){const D=O.getAnchorCell()||e;O.setCellSelection(D,T)}else{const D=r.createPositionAt(T,S?0:"end");r.change(L=>{L.setSelection(D)})}}}class Lx extends io{constructor(e){super(e),this.domEventType=["mousemove","mouseleave"]}onDomEvent(e){this.fire(e.type,e)}}class zx extends ve{static get pluginName(){return"TableMouse"}static get requires(){return[wl]}init(){this.editor.editing.view.addObserver(Lx),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const e=this.editor;let t=!1;const n=e.plugins.get(wl);this.listenTo(e.editing.view.document,"mousedown",(r,o)=>{if(!this.isEnabled||!n.isEnabled||!o.domEvent.shiftKey)return;const a=n.getAnchorCell()||hh(e.model.document.selection)[0];if(!a)return;const c=this._getModelTableCellFromDomEvent(o);c&&kk(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",r=>{t&&r.stop()},{priority:"highest"})}_enableMouseDragSelection(){const e=this.editor;let t,n,r=!1,o=!1;const a=e.plugins.get(wl);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 f=this._getModelTableCellFromDomEvent(u);f&&kk(t,f)&&(n=f,r||n==t||(r=!0)),r&&(o=!0,a.setCellSelection(t,n),u.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{r=!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 kk(i,e){return i.parent.parent==e.parent.parent}_(106);function Fx(i){const e=i.getSelectedElement();return e&&yk(e)?e:null}function Bx(i){let e=i.getFirstPosition().parent;for(;e;){if(e.is("element")&&yk(e))return e;e=e.parent}return null}function yk(i){return!!i.getCustomProperty("table")&&et(i)}const Mv={autoRefresh:!0};class rg{constructor(e,t=Mv){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((r,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)):r(u)}),a.addEventListener("error",()=>o(new Error("Network Error"))),a.addEventListener("abort",()=>o(new Error("Abort"))),a.send()});var n},this._options=Object.assign({},Mv,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),r=t&&e.split(".").length===3;if(!n||!r)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=Mv){return new rg(e,t).init()}}Be(rg,Gt);var Vx=rg;const Ov=/^data:(\S*?);base64,/;class xk{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(r){if(typeof r!="string")return!1;const o=r.match(Ov);return!(!o||!o.length)}(e)?function(r,o=512){try{const a=r.match(Ov)[1],c=atob(r.replace(Ov,"")),u=[];for(let f=0;f<c.length;f+=o){const b=c.slice(f,f+o),k=new Array(b.length);for(let T=0;T<b.length;T++)k[T]=b.charCodeAt(T);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(r){return()=>e.fire("error",r)}t.addEventListener("error",n("Network Error")),t.addEventListener("abort",n("Abort")),t.upload&&t.upload.addEventListener("progress",r=>{r.lengthComputable&&this.fire("progress",{total:r.total,uploaded:r.loaded})}),t.addEventListener("load",()=>{const r=t.status,o=t.response;if(r<200||r>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,r)=>{t.addEventListener("load",()=>{const o=t.status,a=t.response;return o<200||o>299?a.message?r(new y.a("fileuploader-uploading-data-failed",this,{message:a.message})):r(a.error):n(a)}),t.addEventListener("error",()=>r(new Error("Network Error"))),t.addEventListener("abort",()=>r(new Error("Abort"))),t.send(e)})}}Be(xk,B);class $x{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 xk(e,this._token,this._apiAddress)}}class Hx extends ki{static get pluginName(){return"CloudServicesCore"}createToken(e,t){return new Vx(e,t)}createUploadGateway(e,t){return new $x(e,t)}}class Nv extends Uu{}Nv.builtinPlugins=[class extends ve{static get requires(){return[Mt,qc,_b,pb,xb,Dp]}static get pluginName(){return"Essentials"}},class extends ve{static get requires(){return[ci]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const i=this.editor.config.get("ckfinder.uploadUrl");i&&(this.editor.plugins.get(ci).createUploadAdapter=e=>new Lb(e,i,this.editor.t))}},class extends ve{static get pluginName(){return"Autoformat"}afterInit(){this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats()}_addListAutoformats(){const i=this.editor.commands;i.get("bulletedList")&&Vo(this.editor,this,/^[*-]\s$/,"bulletedList"),i.get("numberedList")&&Vo(this.editor,this,/^1[.|)]\s$/,"numberedList"),i.get("todoList")&&Vo(this.editor,this,/^\[\s?\]\s$/,"todoList"),i.get("checkTodoList")&&Vo(this.editor,this,/^\[\s?x\s?\]\s$/,()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")})}_addBasicStylesAutoformats(){const i=this.editor.commands;if(i.get("bold")){const e=Jc(this.editor,"bold");ia(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,e),ia(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,e)}if(i.get("italic")){const e=Jc(this.editor,"italic");ia(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,e),ia(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,e)}if(i.get("code")){const e=Jc(this.editor,"code");ia(this.editor,this,/(`)([^`]+)(`)$/g,e)}if(i.get("strikethrough")){const e=Jc(this.editor,"strikethrough");ia(this.editor,this,/(~~)([^~]+)(~~)$/g,e)}}_addHeadingAutoformats(){const i=this.editor.commands.get("heading");i&&i.modelElements.filter(e=>e.match(/^heading[1-6]$/)).forEach(e=>{const t=e[7],n=new RegExp(`^(#{${t}})\\s$`);Vo(this.editor,this,n,()=>{if(!i.isEnabled||i.value===e)return!1;this.editor.execute("heading",{value:e})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&Vo(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){const i=this.editor,e=i.model.document.selection;i.commands.get("codeBlock")&&Vo(i,this,/^```$/,()=>{if(e.getFirstPosition().parent.is("element","listItem"))return!1;this.editor.execute("codeBlock",{usePreviousLanguageChoice:!0})})}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&Vo(this.editor,this,/^---$/,"horizontalLine")}},class extends ve{static get requires(){return[zb,Fb]}static get pluginName(){return"Bold"}},class extends ve{static get requires(){return[Bb,Vb]}static get pluginName(){return"Italic"}},class extends ve{static get requires(){return[Hb,Ub]}static get pluginName(){return"BlockQuote"}},class extends ve{static get pluginName(){return"CKFinder"}static get requires(){return["Link","CKFinderUploadAdapter",Kb,Wb]}},class extends ki{static get pluginName(){return"CloudServices"}static get requires(){return[Hx]}init(){const i=this.context.config.get("cloudServices")||{};for(const e in i)this[e]=i[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(i){if(this._tokens.has(i))return Promise.resolve(this.getTokenFor(i));const e=this.context.plugins.get("CloudServicesCore").createToken(i);return this._tokens.set(i,e),e.init()}getTokenFor(i){const e=this._tokens.get(i);if(!e)throw new y.a("cloudservices-token-not-registered",this);return e}destroy(){super.destroy();for(const i of this._tokens.values())i.destroy()}},class extends ve{static get requires(){return[Gb,"ImageUpload"]}init(){const i=this.editor;i.plugins.has("ImageBlockEditing")||i.plugins.has("ImageInlineEditing")||Object(y.b)("easy-image-image-feature-missing",i)}static get pluginName(){return"EasyImage"}},class extends ve{static get requires(){return[Jb,Xb]}static get pluginName(){return"Heading"}},class extends ve{static get requires(){return[ov,av]}static get pluginName(){return"Image"}},class extends ve{static get requires(){return[cv,dv]}static get pluginName(){return"ImageCaption"}},class extends ve{static get requires(){return[U,q]}static get pluginName(){return"ImageStyle"}},class extends ve{static get requires(){return[ed,Bi]}static get pluginName(){return"ImageToolbar"}afterInit(){const i=this.editor,e=i.t,t=i.plugins.get(ed),n=i.plugins.get("ImageUtils");var r;t.register("image",{ariaLabel:e("Image toolbar"),items:(r=i.config.get("image.toolbar")||[],r.map(o=>ne(o)?o.name:o)),getRelatedElement:o=>n.getClosestSelectedImageWidget(o)})}},class extends ve{static get pluginName(){return"ImageUpload"}static get requires(){return[pn,Ke,dt]}},class extends ve{static get pluginName(){return"Indent"}static get requires(){return[ho,a1]}},class extends ve{static get requires(){return[S1,P1,M1]}static get pluginName(){return"Link"}},class extends ve{static get requires(){return[V1,$1]}static get pluginName(){return"List"}},class extends ve{static get requires(){return[tg,G1,q1,pl]}static get pluginName(){return"MediaEmbed"}},gl,class extends ve{static get pluginName(){return"PasteFromOffice"}static get requires(){return[sn]}init(){const i=this.editor,e=i.editing.view.document,t=[];t.push(new rx(e)),t.push(new Z1(e)),i.plugins.get("ClipboardPipeline").on("inputTransformation",(n,r)=>{if(r._isTransformedWithPasteFromOffice)return;const o=r.dataTransfer.getData("text/html"),a=t.find(c=>c.isActive(o));a&&(r._parsedData=ix(o,e.stylesProcessor),a.execute(r),r._isTransformedWithPasteFromOffice=!0)},{priority:"high"})}},class extends ve{static get requires(){return[Ix,Nx,wl,zx,jx,Dx,pl]}static get pluginName(){return"Table"}},class extends ve{static get requires(){return[ed]}static get pluginName(){return"TableToolbar"}afterInit(){const i=this.editor,e=i.t,t=i.plugins.get(ed),n=i.config.get("table.contentToolbar"),r=i.config.get("table.tableToolbar");n&&t.register("tableContent",{ariaLabel:e("Table toolbar"),items:n,getRelatedElement:Bx}),r&&t.register("table",{ariaLabel:e("Table toolbar"),items:r,getRelatedElement:Fx})}},class extends ve{static get pluginName(){return"TextTransformation"}constructor(i){super(i),i.config.define("typing",{transformations:{include:Sb}})}init(){const i=this.editor.model.document.selection;i.on("change:range",()=>{this.isEnabled=!i.anchor.parent.is("element","codeBlock")}),this._enableTransformationWatchers()}_enableTransformationWatchers(){const i=this.editor,e=i.model,t=i.plugins.get("Input"),n=function(o){const a=o.extra||[],c=o.remove||[],u=f=>!c.includes(f);return function(f){const b=new Set;for(const k of f)if(Ip[k])for(const T of Ip[k])b.add(T);else b.add(k);return Array.from(b)}(o.include.concat(a).filter(u)).filter(u).map(f=>Tb[f]||f).map(f=>({from:Mp(f.from),to:Ab(f.to)}))}(i.config.get("typing.transformations")),r=new Ju(i.model,o=>{for(const a of n)if(a.from.test(o))return{normalizedTransformation:a}});r.on("matched:data",(o,a)=>{if(!t.isInput(a.batch))return;const{from:c,to:u}=a.normalizedTransformation,f=c.exec(a.text),b=u(f.slice(1)),k=a.range;let T=f.index;e.enqueueChange(S=>{for(let O=1;O<f.length;O++){const D=f[O],L=b[O-1];if(L==null){T+=D.length;continue}const W=k.start.getShiftedBy(T),J=e.createRange(W,W.getShiftedBy(D.length)),de=Eb(W);e.insertContent(S.createText(L,de),J),T+=L.length}})}),r.bind("isEnabled").to(this)}}],Nv.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})})(f_,f_.exports);var JC=f_.exports;const XC=Eg(JC);var ly={exports:{}},Jt={};/** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Xn=typeof Symbol=="function"&&Symbol.for,F_=Xn?Symbol.for("react.element"):60103,B_=Xn?Symbol.for("react.portal"):60106,Mg=Xn?Symbol.for("react.fragment"):60107,Og=Xn?Symbol.for("react.strict_mode"):60108,Ng=Xn?Symbol.for("react.profiler"):60114,Rg=Xn?Symbol.for("react.provider"):60109,Dg=Xn?Symbol.for("react.context"):60110,V_=Xn?Symbol.for("react.async_mode"):60111,jg=Xn?Symbol.for("react.concurrent_mode"):60111,Lg=Xn?Symbol.for("react.forward_ref"):60112,zg=Xn?Symbol.for("react.suspense"):60113,ZC=Xn?Symbol.for("react.suspense_list"):60120,Fg=Xn?Symbol.for("react.memo"):60115,Bg=Xn?Symbol.for("react.lazy"):60116,eT=Xn?Symbol.for("react.block"):60121,tT=Xn?Symbol.for("react.fundamental"):60117,nT=Xn?Symbol.for("react.responder"):60118,rT=Xn?Symbol.for("react.scope"):60119;function fi(h){if(typeof h=="object"&&h!==null){var g=h.$$typeof;switch(g){case F_:switch(h=h.type,h){case V_:case jg:case Mg:case Ng:case Og:case zg:return h;default:switch(h=h&&h.$$typeof,h){case Dg:case Lg:case Bg:case Fg:case Rg:return h;default:return g}}case B_:return g}}}function cy(h){return fi(h)===jg}Jt.AsyncMode=V_;Jt.ConcurrentMode=jg;Jt.ContextConsumer=Dg;Jt.ContextProvider=Rg;Jt.Element=F_;Jt.ForwardRef=Lg;Jt.Fragment=Mg;Jt.Lazy=Bg;Jt.Memo=Fg;Jt.Portal=B_;Jt.Profiler=Ng;Jt.StrictMode=Og;Jt.Suspense=zg;Jt.isAsyncMode=function(h){return cy(h)||fi(h)===V_};Jt.isConcurrentMode=cy;Jt.isContextConsumer=function(h){return fi(h)===Dg};Jt.isContextProvider=function(h){return fi(h)===Rg};Jt.isElement=function(h){return typeof h=="object"&&h!==null&&h.$$typeof===F_};Jt.isForwardRef=function(h){return fi(h)===Lg};Jt.isFragment=function(h){return fi(h)===Mg};Jt.isLazy=function(h){return fi(h)===Bg};Jt.isMemo=function(h){return fi(h)===Fg};Jt.isPortal=function(h){return fi(h)===B_};Jt.isProfiler=function(h){return fi(h)===Ng};Jt.isStrictMode=function(h){return fi(h)===Og};Jt.isSuspense=function(h){return fi(h)===zg};Jt.isValidElementType=function(h){return typeof h=="string"||typeof h=="function"||h===Mg||h===jg||h===Ng||h===Og||h===zg||h===ZC||typeof h=="object"&&h!==null&&(h.$$typeof===Bg||h.$$typeof===Fg||h.$$typeof===Rg||h.$$typeof===Dg||h.$$typeof===Lg||h.$$typeof===tT||h.$$typeof===nT||h.$$typeof===rT||h.$$typeof===eT)};Jt.typeOf=fi;ly.exports=Jt;var iT=ly.exports;function ud(h){var g=[];return hi.Children.forEach(h,function(l){l!=null&&(Array.isArray(l)?g=g.concat(ud(l)):iT.isFragment(l)&&l.props?g=g.concat(ud(l.props.children)):g.push(l))}),g}function dy(){var h=this.constructor.getDerivedStateFromProps(this.props,this.state);h!=null&&this.setState(h)}function uy(h){function g(l){var p=this.constructor.getDerivedStateFromProps(h,l);return p??null}this.setState(g.bind(this))}function hy(h,g){try{var l=this.props,p=this.state;this.props=h,this.state=g,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(l,p)}finally{this.props=l,this.state=p}}dy.__suppressDeprecationWarning=!0;uy.__suppressDeprecationWarning=!0;hy.__suppressDeprecationWarning=!0;function $_(h){var g=h.prototype;if(!g||!g.isReactComponent)throw new Error("Can only polyfill class components");if(typeof h.getDerivedStateFromProps!="function"&&typeof g.getSnapshotBeforeUpdate!="function")return h;var l=null,p=null,_=null;if(typeof g.componentWillMount=="function"?l="componentWillMount":typeof g.UNSAFE_componentWillMount=="function"&&(l="UNSAFE_componentWillMount"),typeof g.componentWillReceiveProps=="function"?p="componentWillReceiveProps":typeof g.UNSAFE_componentWillReceiveProps=="function"&&(p="UNSAFE_componentWillReceiveProps"),typeof g.componentWillUpdate=="function"?_="componentWillUpdate":typeof g.UNSAFE_componentWillUpdate=="function"&&(_="UNSAFE_componentWillUpdate"),l!==null||p!==null||_!==null){var w=h.displayName||h.name,v=typeof h.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. `+w+" uses "+v+" but also contains the following legacy lifecycles:"+(l!==null?` `+l:"")+(p!==null?` `+p:"")+(_!==null?` `+_:"")+` The above lifecycles should be removed. Learn more about this warning here: https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof h.getDerivedStateFromProps=="function"&&(g.componentWillMount=dy,g.componentWillReceiveProps=uy),typeof g.getSnapshotBeforeUpdate=="function"){if(typeof g.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");g.componentWillUpdate=hy;var x=g.componentDidUpdate;g.componentDidUpdate=function(F,y,R){var $=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:R;x.call(this,F,y,$)}}return h}var p_={exports:{}},g_={exports:{}};(function(h,g){g.__esModule=!0;var l=Y;P(l);var p=qx,_=P(p),w=lC,v=P(w),x=cC;P(x);function P(z){return z&&z.__esModule?z:{default:z}}function F(z,re){if(!(z instanceof re))throw new TypeError("Cannot call a class as a function")}function y(z,re){if(!z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return re&&(typeof re=="object"||typeof re=="function")?re:z}function R(z,re){if(typeof re!="function"&&re!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof re);z.prototype=Object.create(re&&re.prototype,{constructor:{value:z,enumerable:!1,writable:!0,configurable:!0}}),re&&(Object.setPrototypeOf?Object.setPrototypeOf(z,re):z.__proto__=re)}var $=1073741823;function B(z,re){return z===re?z!==0||1/z===1/re:z!==z&&re!==re}function V(z){var re=[];return{on:function(ne){re.push(ne)},off:function(ne){re=re.filter(function(ie){return ie!==ne})},get:function(){return z},set:function(ne,ie){z=ne,re.forEach(function(ae){return ae(z,ie)})}}}function ee(z){return Array.isArray(z)?z[0]:z}function Z(z,re){var X,ne,ie="__create-react-context-"+(0,v.default)()+"__",ae=function(Se){R(Pe,Se);function Pe(){var Me,Re,ce;F(this,Pe);for(var pe=arguments.length,be=Array(pe),ke=0;ke<pe;ke++)be[ke]=arguments[ke];return ce=(Me=(Re=y(this,Se.call.apply(Se,[this].concat(be))),Re),Re.emitter=V(Re.props.value),Me),y(Re,ce)}return Pe.prototype.getChildContext=function(){var Re;return Re={},Re[ie]=this.emitter,Re},Pe.prototype.componentWillReceiveProps=function(Re){if(this.props.value!==Re.value){var ce=this.props.value,pe=Re.value,be=void 0;B(ce,pe)?be=0:(be=typeof re=="function"?re(ce,pe):$,be|=0,be!==0&&this.emitter.set(Re.value,be))}},Pe.prototype.render=function(){return this.props.children},Pe}(l.Component);ae.childContextTypes=(X={},X[ie]=_.default.object.isRequired,X);var _e=function(Se){R(Pe,Se);function Pe(){var Me,Re,ce;F(this,Pe);for(var pe=arguments.length,be=Array(pe),ke=0;ke<pe;ke++)be[ke]=arguments[ke];return ce=(Me=(Re=y(this,Se.call.apply(Se,[this].concat(be))),Re),Re.state={value:Re.getValue()},Re.onUpdate=function(ye,Ce){var ze=Re.observedBits|0;ze&Ce&&Re.setState({value:Re.getValue()})},Me),y(Re,ce)}return Pe.prototype.componentWillReceiveProps=function(Re){var ce=Re.observedBits;this.observedBits=ce??$},Pe.prototype.componentDidMount=function(){this.context[ie]&&this.context[ie].on(this.onUpdate);var Re=this.props.observedBits;this.observedBits=Re??$},Pe.prototype.componentWillUnmount=function(){this.context[ie]&&this.context[ie].off(this.onUpdate)},Pe.prototype.getValue=function(){return this.context[ie]?this.context[ie].get():z},Pe.prototype.render=function(){return ee(this.props.children)(this.state.value)},Pe}(l.Component);return _e.contextTypes=(ne={},ne[ie]=_.default.object,ne),{Provider:ae,Consumer:_e}}g.default=Z,h.exports=g.default})(g_,g_.exports);var oT=g_.exports;(function(h,g){g.__esModule=!0;var l=Y,p=v(l),_=oT,w=v(_);function v(x){return x&&x.__esModule?x:{default:x}}g.default=p.default.createContext||w.default,h.exports=g.default})(p_,p_.exports);var sT=p_.exports;const aT=Eg(sT);var fy=aT(null),py={exports:{}},lT=py.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=lT);var Tl=py.exports,gy={exports:{}},cT=gy.exports={version:"2.6.12"};typeof __e=="number"&&(__e=cT);var ua=gy.exports,dT=function(h){if(typeof h!="function")throw TypeError(h+" is not a function!");return h},uT=dT,my=function(h,g,l){if(uT(h),g===void 0)return h;switch(l){case 1:return function(p){return h.call(g,p)};case 2:return function(p,_){return h.call(g,p,_)};case 3:return function(p,_,w){return h.call(g,p,_,w)}}return function(){return h.apply(g,arguments)}},Rv={},fd=function(h){return typeof h=="object"?h!==null:typeof h=="function"},hT=fd,Eh=function(h){if(!hT(h))throw TypeError(h+" is not an object!");return h},Ph=function(h){try{return!!h()}catch{return!0}},Dv,Rk;function ha(){return Rk||(Rk=1,Dv=!Ph(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})),Dv}var jv,Dk;function by(){if(Dk)return jv;Dk=1;var h=fd,g=Tl.document,l=h(g)&&h(g.createElement);return jv=function(p){return l?g.createElement(p):{}},jv}var Lv,jk;function vy(){return jk||(jk=1,Lv=!ha()&&!Ph(function(){return Object.defineProperty(by()("div"),"a",{get:function(){return 7}}).a!=7})),Lv}var og=fd,H_=function(h,g){if(!og(h))return h;var l,p;if(g&&typeof(l=h.toString)=="function"&&!og(p=l.call(h))||typeof(l=h.valueOf)=="function"&&!og(p=l.call(h))||!g&&typeof(l=h.toString)=="function"&&!og(p=l.call(h)))return p;throw TypeError("Can't convert object to primitive value")},Lk;function Sl(){if(Lk)return Rv;Lk=1;var h=Eh,g=vy(),l=H_,p=Object.defineProperty;return Rv.f=ha()?Object.defineProperty:function(w,v,x){if(h(w),v=l(v,!0),h(x),g)try{return p(w,v,x)}catch{}if("get"in x||"set"in x)throw TypeError("Accessors not supported!");return"value"in x&&(w[v]=x.value),w},Rv}var Vg=function(h,g){return{enumerable:!(h&1),configurable:!(h&2),writable:!(h&4),value:g}},fT=Sl(),pT=Vg,pd=ha()?function(h,g,l){return fT.f(h,g,pT(1,l))}:function(h,g,l){return h[g]=l,h},gT={}.hasOwnProperty,Al=function(h,g){return gT.call(h,g)},sg=Tl,zv=ua,zk=my,mT=pd,bT=Al,ag="prototype",kr=function(h,g,l){var p=h&kr.F,_=h&kr.G,w=h&kr.S,v=h&kr.P,x=h&kr.B,P=h&kr.W,F=_?zv:zv[g]||(zv[g]={}),y=F[ag],R=_?sg:w?sg[g]:(sg[g]||{})[ag],$,B,V;_&&(l=g);for($ in l)B=!p&&R&&R[$]!==void 0,!(B&&bT(F,$))&&(V=B?R[$]:l[$],F[$]=_&&typeof R[$]!="function"?l[$]:x&&B?zk(V,sg):P&&R[$]==V?function(ee){var Z=function(z,re,X){if(this instanceof ee){switch(arguments.length){case 0:return new ee;case 1:return new ee(z);case 2:return new ee(z,re)}return new ee(z,re,X)}return ee.apply(this,arguments)};return Z[ag]=ee[ag],Z}(V):v&&typeof V=="function"?zk(Function.call,V):V,v&&((F.virtual||(F.virtual={}))[$]=V,h&kr.R&&y&&!y[$]&&mT(y,$,V)))};kr.F=1;kr.G=2;kr.S=4;kr.P=8;kr.B=16;kr.W=32;kr.U=64;kr.R=128;var gd=kr,Fv=gd;Fv(Fv.S+Fv.F*!ha(),"Object",{defineProperty:Sl().f});var vT=ua.Object,_T=function(g,l,p){return vT.defineProperty(g,l,p)},_y={default:_T,__esModule:!0},wT=_y,kT=yT(wT);function yT(h){return h&&h.__esModule?h:{default:h}}var Bv=function(h,g,l){return g in h?(0,kT.default)(h,g,{value:l,enumerable:!0,configurable:!0,writable:!0}):h[g]=l,h},xT={}.toString,wy=function(h){return xT.call(h).slice(8,-1)},Vv,Fk;function ky(){if(Fk)return Vv;Fk=1;var h=wy;return Vv=Object("z").propertyIsEnumerable(0)?Object:function(g){return h(g)=="String"?g.split(""):Object(g)},Vv}var U_=function(h){if(h==null)throw TypeError("Can't call method on "+h);return h},CT=ky(),TT=U_,md=function(h){return CT(TT(h))},ST=Math.ceil,AT=Math.floor,W_=function(h){return isNaN(h=+h)?0:(h>0?AT:ST)(h)},ET=W_,PT=Math.min,IT=function(h){return h>0?PT(ET(h),9007199254740991):0},MT=W_,OT=Math.max,NT=Math.min,RT=function(h,g){return h=MT(h),h<0?OT(h+g,0):NT(h,g)},DT=md,jT=IT,LT=RT,zT=function(h){return function(g,l,p){var _=DT(g),w=jT(_.length),v=LT(p,w),x;if(h&&l!=l){for(;w>v;)if(x=_[v++],x!=x)return!0}else for(;w>v;v++)if((h||v in _)&&_[v]===l)return h||v||0;return!h&&-1}},yy={exports:{}},FT=!0,BT=ua,Bk=Tl,Vk="__core-js_shared__",$k=Bk[Vk]||(Bk[Vk]={});(yy.exports=function(h,g){return $k[h]||($k[h]=g!==void 0?g:{})})("versions",[]).push({version:BT.version,mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});var q_=yy.exports,VT=0,$T=Math.random(),$g=function(h){return"Symbol(".concat(h===void 0?"":h,")_",(++VT+$T).toString(36))},Hk=q_("keys"),HT=$g,K_=function(h){return Hk[h]||(Hk[h]=HT(h))},Uk=Al,UT=md,WT=zT(!1),qT=K_("IE_PROTO"),xy=function(h,g){var l=UT(h),p=0,_=[],w;for(w in l)w!=qT&&Uk(l,w)&&_.push(w);for(;g.length>p;)Uk(l,w=g[p++])&&(~WT(_,w)||_.push(w));return _},G_="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),KT=xy,GT=G_,Hg=Object.keys||function(g){return KT(g,GT)},Ug={};Ug.f=Object.getOwnPropertySymbols;var $v={},Wk;function Wg(){return Wk||(Wk=1,$v.f={}.propertyIsEnumerable),$v}var YT=U_,Y_=function(h){return Object(YT(h))},Hv,qk;function QT(){if(qk)return Hv;qk=1;var h=ha(),g=Hg,l=Ug,p=Wg(),_=Y_,w=ky(),v=Object.assign;return Hv=!v||Ph(function(){var x={},P={},F=Symbol(),y="abcdefghijklmnopqrst";return x[F]=7,y.split("").forEach(function(R){P[R]=R}),v({},x)[F]!=7||Object.keys(v({},P)).join("")!=y})?function(P,F){for(var y=_(P),R=arguments.length,$=1,B=l.f,V=p.f;R>$;)for(var ee=w(arguments[$++]),Z=B?g(ee).concat(B(ee)):g(ee),z=Z.length,re=0,X;z>re;)X=Z[re++],(!h||V.call(ee,X))&&(y[X]=ee[X]);return y}:v,Hv}var Uv=gd;Uv(Uv.S+Uv.F,"Object",{assign:QT()});var JT=ua.Object.assign,XT={default:JT,__esModule:!0},ZT=XT,eS=tS(ZT);function tS(h){return h&&h.__esModule?h:{default:h}}var sd=eS.default||function(h){for(var g=1;g<arguments.length;g++){var l=arguments[g];for(var p in l)Object.prototype.hasOwnProperty.call(l,p)&&(h[p]=l[p])}return h},nS=function(h,g){if(!(h instanceof g))throw new TypeError("Cannot call a class as a function")},rS=_y,iS=oS(rS);function oS(h){return h&&h.__esModule?h:{default:h}}var sS=function(){function h(g,l){for(var p=0;p<l.length;p++){var _=l[p];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),(0,iS.default)(g,_.key,_)}}return function(g,l,p){return l&&h(g.prototype,l),p&&h(g,p),g}}(),qg={},aS=W_,lS=U_,cS=function(h){return function(g,l){var p=String(lS(g)),_=aS(l),w=p.length,v,x;return _<0||_>=w?h?"":void 0:(v=p.charCodeAt(_),v<55296||v>56319||_+1===w||(x=p.charCodeAt(_+1))<56320||x>57343?h?p.charAt(_):v:h?p.slice(_,_+2):(v-55296<<10)+(x-56320)+65536)}},Cy=pd,Q_={},dS=Sl(),uS=Eh,hS=Hg,fS=ha()?Object.defineProperties:function(g,l){uS(g);for(var p=hS(l),_=p.length,w=0,v;_>w;)dS.f(g,v=p[w++],l[v]);return g},Wv,Kk;function pS(){if(Kk)return Wv;Kk=1;var h=Tl.document;return Wv=h&&h.documentElement,Wv}var gS=Eh,mS=fS,Gk=G_,bS=K_("IE_PROTO"),qv=function(){},m_="prototype",mg=function(){var h=by()("iframe"),g=Gk.length,l="<",p=">",_;for(h.style.display="none",pS().appendChild(h),h.src="javascript:",_=h.contentWindow.document,_.open(),_.write(l+"script"+p+"document.F=Object"+l+"/script"+p),_.close(),mg=_.F;g--;)delete mg[m_][Gk[g]];return mg()},J_=Object.create||function(g,l){var p;return g!==null?(qv[m_]=gS(g),p=new qv,qv[m_]=null,p[bS]=g):p=mg(),l===void 0?p:mS(p,l)},Ty={exports:{}},b_=q_("wks"),vS=$g,v_=Tl.Symbol,Yk=typeof v_=="function",_S=Ty.exports=function(h){return b_[h]||(b_[h]=Yk&&v_[h]||(Yk?v_:vS)("Symbol."+h))};_S.store=b_;var bd=Ty.exports,wS=Sl().f,kS=Al,Qk=bd("toStringTag"),X_=function(h,g,l){h&&!kS(h=l?h:h.prototype,Qk)&&wS(h,Qk,{configurable:!0,value:g})},yS=J_,xS=Vg,CS=X_,Sy={};pd(Sy,bd("iterator"),function(){return this});var TS=function(h,g,l){h.prototype=yS(Sy,{next:xS(1,l)}),CS(h,g+" Iterator")},SS=Al,AS=Y_,Jk=K_("IE_PROTO"),ES=Object.prototype,PS=Object.getPrototypeOf||function(h){return h=AS(h),SS(h,Jk)?h[Jk]:typeof h.constructor=="function"&&h instanceof h.constructor?h.constructor.prototype:h instanceof Object?ES:null},Kv=gd,IS=Cy,MS=pd,Xk=Q_,OS=TS,NS=X_,RS=PS,Gv=bd("iterator"),Yv=!([].keys&&"next"in[].keys()),DS="@@iterator",Zk="keys",lg="values",jS=function(){return this},Ay=function(h,g,l,p,_,w,v){OS(l,g,p);var x=function(X){if(!Yv&&X in R)return R[X];switch(X){case Zk:return function(){return new l(this,X)};case lg:return function(){return new l(this,X)}}return function(){return new l(this,X)}},P=g+" Iterator",F=_==lg,y=!1,R=h.prototype,$=R[Gv]||R[DS]||_&&R[_],B=$||x(_),V=_?F?x("entries"):B:void 0,ee=g=="Array"&&R.entries||$,Z,z,re;if(ee&&(re=RS(ee.call(new h)),re!==Object.prototype&&re.next&&NS(re,P,!0)),F&&$&&$.name!==lg&&(y=!0,B=function(){return $.call(this)}),v&&(Yv||y||!R[Gv])&&MS(R,Gv,B),Xk[g]=B,Xk[P]=jS,_)if(Z={values:F?B:x(lg),keys:w?B:x(Zk),entries:V},v)for(z in Z)z in R||IS(R,z,Z[z]);else Kv(Kv.P+Kv.F*(Yv||y),g,Z);return Z},LS=cS(!0);Ay(String,"String",function(h){this._t=String(h),this._i=0},function(){var h=this._t,g=this._i,l;return g>=h.length?{value:void 0,done:!0}:(l=LS(h,g),this._i+=l.length,{value:l,done:!1})});var zS=function(h,g){return{value:g,done:!!h}},cg=zS,e0=Q_,FS=md;Ay(Array,"Array",function(h,g){this._t=FS(h),this._i=0,this._k=g},function(){var h=this._t,g=this._k,l=this._i++;return!h||l>=h.length?(this._t=void 0,cg(1)):g=="keys"?cg(0,l):g=="values"?cg(0,h[l]):cg(0,[l,h[l]])},"values");e0.Arguments=e0.Array;var BS=Tl,VS=pd,t0=Q_,n0=bd("toStringTag"),r0="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 Qv=0;Qv<r0.length;Qv++){var Jv=r0[Qv],i0=BS[Jv],Xv=i0&&i0.prototype;Xv&&!Xv[n0]&&VS(Xv,n0,Jv),t0[Jv]=t0.Array}var Kg={};Kg.f=bd;var $S=Kg.f("iterator"),HS={default:$S,__esModule:!0},Ey={exports:{}},xl=$g("meta"),US=fd,Z_=Al,WS=Sl().f,qS=0,Gg=Object.isExtensible||function(){return!0},KS=!Ph(function(){return Gg(Object.preventExtensions({}))}),ew=function(h){WS(h,xl,{value:{i:"O"+ ++qS,w:{}}})},GS=function(h,g){if(!US(h))return typeof h=="symbol"?h:(typeof h=="string"?"S":"P")+h;if(!Z_(h,xl)){if(!Gg(h))return"F";if(!g)return"E";ew(h)}return h[xl].i},YS=function(h,g){if(!Z_(h,xl)){if(!Gg(h))return!0;if(!g)return!1;ew(h)}return h[xl].w},QS=function(h){return KS&&JS.NEED&&Gg(h)&&!Z_(h,xl)&&ew(h),h},JS=Ey.exports={KEY:xl,NEED:!1,fastKey:GS,getWeak:YS,onFreeze:QS},XS=Ey.exports,o0=ua,ZS=Kg,eA=Sl().f,tw=function(h){var g=o0.Symbol||(o0.Symbol={});h.charAt(0)!="_"&&!(h in g)&&eA(g,h,{value:ZS.f(h)})},tA=Hg,nA=Ug,rA=Wg(),iA=function(h){var g=tA(h),l=nA.f;if(l)for(var p=l(h),_=rA.f,w=0,v;p.length>w;)_.call(h,v=p[w++])&&g.push(v);return g},oA=wy,sA=Array.isArray||function(g){return oA(g)=="Array"},Py={},Zv={},s0;function Iy(){if(s0)return Zv;s0=1;var h=xy,g=G_.concat("length","prototype");return Zv.f=Object.getOwnPropertyNames||function(p){return h(p,g)},Zv}var aA=md,My=Iy().f,lA={}.toString,Oy=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],cA=function(h){try{return My(h)}catch{return Oy.slice()}};Py.f=function(g){return Oy&&lA.call(g)=="[object Window]"?cA(g):My(aA(g))};var nw={},dA=Wg(),uA=Vg,hA=md,fA=H_,pA=Al,gA=vy(),a0=Object.getOwnPropertyDescriptor;nw.f=ha()?a0:function(g,l){if(g=hA(g),l=fA(l,!0),gA)try{return a0(g,l)}catch{}if(pA(g,l))return uA(!dA.f.call(g,l),g[l])};var Yg=Tl,Jn=Al,__=ha(),yr=gd,l0=Cy,mA=XS.KEY,rw=Ph,iw=q_,ow=X_,bA=$g,Ih=bd,vA=Kg,_A=tw,wA=iA,kA=sA,w_=Eh,yA=fd,xA=Y_,Qg=md,sw=H_,k_=Vg,Th=J_,Ny=Py,Ry=nw,Jg=Ug,Dy=Sl(),CA=Hg,jy=Ry.f,yl=Dy.f,Ly=Ny.f,Yr=Yg.Symbol,Sg=Yg.JSON,dg=Sg&&Sg.stringify,ca="prototype",Gr=Ih("_hidden"),c0=Ih("toPrimitive"),TA={}.propertyIsEnumerable,gh=iw("symbol-registry"),_s=iw("symbols"),Mh=iw("op-symbols"),Hi=Object[ca],vd=typeof Yr=="function"&&!!Jg.f,e_=Yg.QObject,y_=!e_||!e_[ca]||!e_[ca].findChild,x_=__&&rw(function(){return Th(yl({},"a",{get:function(){return yl(this,"a",{value:7}).a}})).a!=7})?function(h,g,l){var p=jy(Hi,g);p&&delete Hi[g],yl(h,g,l),p&&h!==Hi&&yl(Hi,g,p)}:yl,d0=function(h){var g=_s[h]=Th(Yr[ca]);return g._k=h,g},C_=vd&&typeof Yr.iterator=="symbol"?function(h){return typeof h=="symbol"}:function(h){return h instanceof Yr},Xg=function(g,l,p){return g===Hi&&Xg(Mh,l,p),w_(g),l=sw(l,!0),w_(p),Jn(_s,l)?(p.enumerable?(Jn(g,Gr)&&g[Gr][l]&&(g[Gr][l]=!1),p=Th(p,{enumerable:k_(0,!1)})):(Jn(g,Gr)||yl(g,Gr,k_(1,{})),g[Gr][l]=!0),x_(g,l,p)):yl(g,l,p)},zy=function(g,l){w_(g);for(var p=wA(l=Qg(l)),_=0,w=p.length,v;w>_;)Xg(g,v=p[_++],l[v]);return g},SA=function(g,l){return l===void 0?Th(g):zy(Th(g),l)},u0=function(g){var l=TA.call(this,g=sw(g,!0));return this===Hi&&Jn(_s,g)&&!Jn(Mh,g)?!1:l||!Jn(this,g)||!Jn(_s,g)||Jn(this,Gr)&&this[Gr][g]?l:!0},Fy=function(g,l){if(g=Qg(g),l=sw(l,!0),!(g===Hi&&Jn(_s,l)&&!Jn(Mh,l))){var p=jy(g,l);return p&&Jn(_s,l)&&!(Jn(g,Gr)&&g[Gr][l])&&(p.enumerable=!0),p}},By=function(g){for(var l=Ly(Qg(g)),p=[],_=0,w;l.length>_;)!Jn(_s,w=l[_++])&&w!=Gr&&w!=mA&&p.push(w);return p},Vy=function(g){for(var l=g===Hi,p=Ly(l?Mh:Qg(g)),_=[],w=0,v;p.length>w;)Jn(_s,v=p[w++])&&(!l||Jn(Hi,v))&&_.push(_s[v]);return _};vd||(Yr=function(){if(this instanceof Yr)throw TypeError("Symbol is not a constructor!");var g=bA(arguments.length>0?arguments[0]:void 0),l=function(p){this===Hi&&l.call(Mh,p),Jn(this,Gr)&&Jn(this[Gr],g)&&(this[Gr][g]=!1),x_(this,g,k_(1,p))};return __&&y_&&x_(Hi,g,{configurable:!0,set:l}),d0(g)},l0(Yr[ca],"toString",function(){return this._k}),Ry.f=Fy,Dy.f=Xg,Iy().f=Ny.f=By,Wg().f=u0,Jg.f=Vy,__&&!FT&&l0(Hi,"propertyIsEnumerable",u0),vA.f=function(h){return d0(Ih(h))});yr(yr.G+yr.W+yr.F*!vd,{Symbol:Yr});for(var h0="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),f0=0;h0.length>f0;)Ih(h0[f0++]);for(var p0=CA(Ih.store),g0=0;p0.length>g0;)_A(p0[g0++]);yr(yr.S+yr.F*!vd,"Symbol",{for:function(h){return Jn(gh,h+="")?gh[h]:gh[h]=Yr(h)},keyFor:function(g){if(!C_(g))throw TypeError(g+" is not a symbol!");for(var l in gh)if(gh[l]===g)return l},useSetter:function(){y_=!0},useSimple:function(){y_=!1}});yr(yr.S+yr.F*!vd,"Object",{create:SA,defineProperty:Xg,defineProperties:zy,getOwnPropertyDescriptor:Fy,getOwnPropertyNames:By,getOwnPropertySymbols:Vy});var AA=rw(function(){Jg.f(1)});yr(yr.S+yr.F*AA,"Object",{getOwnPropertySymbols:function(g){return Jg.f(xA(g))}});Sg&&yr(yr.S+yr.F*(!vd||rw(function(){var h=Yr();return dg([h])!="[null]"||dg({a:h})!="{}"||dg(Object(h))!="{}"})),"JSON",{stringify:function(g){for(var l=[g],p=1,_,w;arguments.length>p;)l.push(arguments[p++]);if(w=_=l[1],!(!yA(_)&&g===void 0||C_(g)))return kA(_)||(_=function(v,x){if(typeof w=="function"&&(x=w.call(this,v,x)),!C_(x))return x}),l[1]=_,dg.apply(Sg,l)}});Yr[ca][c0]||pd(Yr[ca],c0,Yr[ca].valueOf);ow(Yr,"Symbol");ow(Math,"Math",!0);ow(Yg.JSON,"JSON",!0);tw("asyncIterator");tw("observable");var EA=ua.Symbol,PA={default:EA,__esModule:!0};qg.__esModule=!0;var IA=HS,$y=Hy(IA),MA=PA,la=Hy(MA),t_=typeof la.default=="function"&&typeof $y.default=="symbol"?function(h){return typeof h}:function(h){return h&&typeof la.default=="function"&&h.constructor===la.default&&h!==la.default.prototype?"symbol":typeof h};function Hy(h){return h&&h.__esModule?h:{default:h}}qg.default=typeof la.default=="function"&&t_($y.default)==="symbol"?function(h){return typeof h>"u"?"undefined":t_(h)}:function(h){return h&&typeof la.default=="function"&&h.constructor===la.default&&h!==la.default.prototype?"symbol":typeof h>"u"?"undefined":t_(h)};var OA=qg,NA=RA(OA);function RA(h){return h&&h.__esModule?h:{default:h}}var DA=function(h,g){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&((typeof g>"u"?"undefined":(0,NA.default)(g))==="object"||typeof g=="function")?g:h},n_,m0;function jA(){if(m0)return n_;m0=1;var h=fd,g=Eh,l=function(p,_){if(g(p),!h(_)&&_!==null)throw TypeError(_+": can't set as prototype!")};return n_={set:Object.setPrototypeOf||("__proto__"in{}?function(p,_,w){try{w=my(Function.call,nw.f(Object.prototype,"__proto__").set,2),w(p,[]),_=!(p instanceof Array)}catch{_=!0}return function(x,P){return l(x,P),_?x.__proto__=P:w(x,P),x}}({},!1):void 0),check:l},n_}var b0=gd;b0(b0.S,"Object",{setPrototypeOf:jA().set});var LA=ua.Object.setPrototypeOf,zA={default:LA,__esModule:!0},v0=gd;v0(v0.S,"Object",{create:J_});var FA=ua.Object,BA=function(g,l){return FA.create(g,l)},VA={default:BA,__esModule:!0},$A=zA,_0=aw($A),HA=VA,UA=aw(HA),WA=qg,qA=aw(WA);function aw(h){return h&&h.__esModule?h:{default:h}}var KA=function(h,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+(typeof g>"u"?"undefined":(0,qA.default)(g)));h.prototype=(0,UA.default)(g&&g.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),g&&(_0.default?(0,_0.default)(h,g):h.__proto__=g)};function GA(h){return h instanceof HTMLElement?h:Kx.findDOMNode(h)}var Zg={exports:{}},yh={exports:{}};(function(){var h,g,l,p,_,w;typeof performance<"u"&&performance!==null&&performance.now?yh.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(yh.exports=function(){return(h()-_)/1e6},g=process.hrtime,h=function(){var v;return v=g(),v[0]*1e9+v[1]},p=h(),w=process.uptime()*1e9,_=p-w):Date.now?(yh.exports=function(){return Date.now()-l},l=Date.now()):(yh.exports=function(){return new Date().getTime()-l},l=new Date().getTime())}).call(an);var YA=yh.exports,QA=YA,vs=typeof window>"u"?an:window,ug=["moz","webkit"],dd="AnimationFrame",hd=vs["request"+dd],Sh=vs["cancel"+dd]||vs["cancelRequest"+dd];for(var mh=0;!hd&&mh<ug.length;mh++)hd=vs[ug[mh]+"Request"+dd],Sh=vs[ug[mh]+"Cancel"+dd]||vs[ug[mh]+"CancelRequest"+dd];if(!hd||!Sh){var r_=0,w0=0,kl=[],JA=1e3/60;hd=function(h){if(kl.length===0){var g=QA(),l=Math.max(0,JA-(g-r_));r_=l+g,setTimeout(function(){var p=kl.slice(0);kl.length=0;for(var _=0;_<p.length;_++)if(!p[_].cancelled)try{p[_].callback(r_)}catch(w){setTimeout(function(){throw w},0)}},Math.round(l))}return kl.push({handle:++w0,callback:h,cancelled:!1}),w0},Sh=function(h){for(var g=0;g<kl.length;g++)kl[g].handle===h&&(kl[g].cancelled=!0)}}Zg.exports=function(h){return hd.call(vs,h)};Zg.exports.cancel=function(){Sh.apply(vs,arguments)};Zg.exports.polyfill=function(h){h||(h=vs),h.requestAnimationFrame=hd,h.cancelAnimationFrame=Sh};var XA=Zg.exports;const k0=Eg(XA);var Uy=!!(typeof window<"u"&&window.document&&window.document.createElement);function y0(h,g){var l={};return l[h.toLowerCase()]=g.toLowerCase(),l["Webkit"+h]="webkit"+g,l["Moz"+h]="moz"+g,l["ms"+h]="MS"+g,l["O"+h]="o"+g.toLowerCase(),l}function ZA(h,g){var l={animationend:y0("Animation","AnimationEnd"),transitionend:y0("Transition","TransitionEnd")};return h&&("AnimationEvent"in g||delete l.animationend.animation,"TransitionEvent"in g||delete l.transitionend.transition),l}var eE=ZA(Uy,typeof window<"u"?window:{}),Wy={};Uy&&(Wy=document.createElement("div").style);var hg={};function qy(h){if(hg[h])return hg[h];var g=eE[h];if(g)for(var l=Object.keys(g),p=l.length,_=0;_<p;_+=1){var w=l[_];if(Object.prototype.hasOwnProperty.call(g,w)&&w in Wy)return hg[h]=g[w],hg[h]}return""}var T_=qy("animationend"),S_=qy("transitionend"),tE=!!(T_&&S_);function x0(h,g){if(!h)return null;if(typeof h=="object"){var l=g.replace(/-\w/g,function(p){return p[1].toUpperCase()});return h[l]}return h+"-"+g}var aa="none",bh="appear",vh="enter",_h="leave",nE={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 rE(h){var g=h,l=!!hi.forwardRef;typeof h=="object"&&(g=h.transitionSupport,l="forwardRef"in h?h.forwardRef:l);function p(w){return!!(w.motionName&&g)}var _=function(w){KA(v,w);function v(){nS(this,v);var x=DA(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return x.onDomUpdate=function(){var P=x.state,F=P.status,y=P.newStatus,R=x.props,$=R.onAppearStart,B=R.onEnterStart,V=R.onLeaveStart,ee=R.onAppearActive,Z=R.onEnterActive,z=R.onLeaveActive,re=R.motionAppear,X=R.motionEnter,ne=R.motionLeave;if(p(x.props)){var ie=x.getElement();x.$cacheEle!==ie&&(x.removeEventListener(x.$cacheEle),x.addEventListener(ie),x.$cacheEle=ie),y&&F===bh&&re?x.updateStatus($,null,null,function(){x.updateActiveStatus(ee,bh)}):y&&F===vh&&X?x.updateStatus(B,null,null,function(){x.updateActiveStatus(Z,vh)}):y&&F===_h&&ne&&x.updateStatus(V,null,null,function(){x.updateActiveStatus(z,_h)})}},x.onMotionEnd=function(P){var F=x.state,y=F.status,R=F.statusActive,$=x.props,B=$.onAppearEnd,V=$.onEnterEnd,ee=$.onLeaveEnd;y===bh&&R?x.updateStatus(B,{status:aa},P):y===vh&&R?x.updateStatus(V,{status:aa},P):y===_h&&R&&x.updateStatus(ee,{status:aa},P)},x.setNodeRef=function(P){var F=x.props.internalRef;x.node=P,typeof F=="function"?F(P):F&&"current"in F&&(F.current=P)},x.getElement=function(){try{return GA(x.node||x)}catch{return x.$cacheEle}},x.addEventListener=function(P){P&&(P.addEventListener(S_,x.onMotionEnd),P.addEventListener(T_,x.onMotionEnd))},x.removeEventListener=function(P){P&&(P.removeEventListener(S_,x.onMotionEnd),P.removeEventListener(T_,x.onMotionEnd))},x.updateStatus=function(P,F,y,R){var $=P?P(x.getElement(),y):null;if(!($===!1||x._destroyed)){var B=void 0;R&&(B=function(){x.nextFrame(R)}),x.setState(sd({statusStyle:typeof $=="object"?$:null,newStatus:!1},F),B)}},x.updateActiveStatus=function(P,F){x.nextFrame(function(){var y=x.state.status;if(y===F){var R=x.props.motionDeadline;x.updateStatus(P,{statusActive:!0}),R>0&&setTimeout(function(){x.onMotionEnd({deadline:!0})},R)}})},x.nextFrame=function(P){x.cancelNextFrame(),x.raf=k0(P)},x.cancelNextFrame=function(){x.raf&&(k0.cancel(x.raf),x.raf=null)},x.state={status:aa,statusActive:!1,newStatus:!1,statusStyle:null},x.$cacheEle=null,x.node=null,x.raf=null,x}return sS(v,[{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,F=this.state,y=F.status,R=F.statusActive,$=F.statusStyle,B=this.props,V=B.children,ee=B.motionName,Z=B.visible,z=B.removeOnLeave,re=B.leavedClassName,X=B.eventProps;return V?y===aa||!p(this.props)?Z?V(sd({},X),this.setNodeRef):z?null:V(sd({},X,{className:re}),this.setNodeRef):V(sd({},X,{className:$i((P={},Bv(P,x0(ee,y),y!==aa),Bv(P,x0(ee,y+"-active"),y!==aa&&R),Bv(P,ee,typeof ee=="string"),P)),style:$}),this.setNodeRef):null}}],[{key:"getDerivedStateFromProps",value:function(P,F){var y=F.prevProps,R=F.status;if(!p(P))return{};var $=P.visible,B=P.motionAppear,V=P.motionEnter,ee=P.motionLeave,Z=P.motionLeaveImmediately,z={prevProps:P};return(R===bh&&!B||R===vh&&!V||R===_h&&!ee)&&(z.status=aa,z.statusActive=!1,z.newStatus=!1),!y&&$&&B&&(z.status=bh,z.statusActive=!1,z.newStatus=!0),y&&!y.visible&&$&&V&&(z.status=vh,z.statusActive=!1,z.newStatus=!0),(y&&y.visible&&!$&&ee||!y&&Z&&!$&&ee)&&(z.status=_h,z.statusActive=!1,z.newStatus=!0),z}}]),v}(hi.Component);return _.propTypes=sd({},nE,{internalRef:le.oneOfType([le.object,le.func])}),_.defaultProps={visible:!0,motionEnter:!0,motionAppear:!0,motionLeave:!0,removeOnLeave:!0},$_(_),l?hi.forwardRef(function(w,v){return hi.createElement(_,sd({internalRef:v},w))}):_}const iE=rE(tE);function bg(h){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(h)}function oE(h,g){if(h==null)return{};var l=sE(h,g),p,_;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(h);for(_=0;_<w.length;_++)p=w[_],!(g.indexOf(p)>=0)&&Object.prototype.propertyIsEnumerable.call(h,p)&&(l[p]=h[p])}return l}function sE(h,g){if(h==null)return{};var l={},p=Object.keys(h),_,w;for(w=0;w<p.length;w++)_=p[w],!(g.indexOf(_)>=0)&&(l[_]=h[_]);return l}function C0(h,g){var l=Object.keys(h);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(h);g&&(p=p.filter(function(_){return Object.getOwnPropertyDescriptor(h,_).enumerable})),l.push.apply(l,p)}return l}function T0(h){for(var g=1;g<arguments.length;g++){var l=arguments[g]!=null?arguments[g]:{};g%2?C0(l,!0).forEach(function(p){fo(h,p,l[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(l)):C0(l).forEach(function(p){Object.defineProperty(h,p,Object.getOwnPropertyDescriptor(l,p))})}return h}function fo(h,g,l){return g in h?Object.defineProperty(h,g,{value:l,enumerable:!0,configurable:!0,writable:!0}):h[g]=l,h}function aE(h,g){if(!(h instanceof g))throw new TypeError("Cannot call a class as a function")}function S0(h,g){for(var l=0;l<g.length;l++){var p=g[l];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}function lE(h,g,l){return g&&S0(h.prototype,g),l&&S0(h,l),h}function cE(h,g){return g&&(bg(g)==="object"||typeof g=="function")?g:wr(h)}function A_(h){return A_=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},A_(h)}function wr(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}function dE(h,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function");h.prototype=Object.create(g&&g.prototype,{constructor:{value:h,writable:!0,configurable:!0}}),g&&E_(h,g)}function E_(h,g){return E_=Object.setPrototypeOf||function(p,_){return p.__proto__=_,p},E_(h,g)}var A0="open",E0="close",uE="---",lw=function(h){dE(g,h);function g(){var l;return aE(this,g),l=cE(this,A_(g).apply(this,arguments)),l.state={dragNodeHighlight:!1},l.onSelectorClick=function(p){var _=l.props.context.onNodeClick;_(p,wr(l)),l.isSelectable()?l.onSelect(p):l.onCheck(p)},l.onSelectorDoubleClick=function(p){var _=l.props.context.onNodeDoubleClick;_(p,wr(l))},l.onSelect=function(p){if(!l.isDisabled()){var _=l.props.context.onNodeSelect;p.preventDefault(),_(p,wr(l))}},l.onCheck=function(p){if(!l.isDisabled()){var _=l.props,w=_.disableCheckbox,v=_.checked,x=l.props.context.onNodeCheck;if(!(!l.isCheckable()||w)){p.preventDefault();var P=!v;x(p,wr(l),P)}}},l.onMouseEnter=function(p){var _=l.props.context.onNodeMouseEnter;_(p,wr(l))},l.onMouseLeave=function(p){var _=l.props.context.onNodeMouseLeave;_(p,wr(l))},l.onContextMenu=function(p){var _=l.props.context.onNodeContextMenu;_(p,wr(l))},l.onDragStart=function(p){var _=l.props.context.onNodeDragStart;p.stopPropagation(),l.setState({dragNodeHighlight:!0}),_(p,wr(l));try{p.dataTransfer.setData("text/plain","")}catch{}},l.onDragEnter=function(p){var _=l.props.context.onNodeDragEnter;p.preventDefault(),p.stopPropagation(),_(p,wr(l))},l.onDragOver=function(p){var _=l.props.context.onNodeDragOver;p.preventDefault(),p.stopPropagation(),_(p,wr(l))},l.onDragLeave=function(p){var _=l.props.context.onNodeDragLeave;p.stopPropagation(),_(p,wr(l))},l.onDragEnd=function(p){var _=l.props.context.onNodeDragEnd;p.stopPropagation(),l.setState({dragNodeHighlight:!1}),_(p,wr(l))},l.onDrop=function(p){var _=l.props.context.onNodeDrop;p.preventDefault(),p.stopPropagation(),l.setState({dragNodeHighlight:!1}),_(p,wr(l))},l.onExpand=function(p){var _=l.props.context.onNodeExpand;_(p,wr(l))},l.setSelectHandle=function(p){l.selectHandle=p},l.getNodeChildren=function(){var p=l.props.children,_=ud(p).filter(function(v){return v}),w=Yy(_);return _.length!==w.length&&Ky(),w},l.getNodeState=function(){var p=l.props.expanded;return l.isLeaf()?null:p?A0:E0},l.isLeaf=function(){var p=l.props,_=p.isLeaf,w=p.loaded,v=l.props.context.loadData,x=l.getNodeChildren().length!==0;return _===!1?!1:_||!v&&!x||v&&w&&!x},l.isDisabled=function(){var p=l.props.disabled,_=l.props.context.disabled;return p===!1?!1:!!(_||p)},l.isCheckable=function(){var p=l.props.checkable,_=l.props.context.checkable;return!_||p===!1?!1:_},l.syncLoadData=function(p){var _=p.expanded,w=p.loading,v=p.loaded,x=l.props.context,P=x.loadData,F=x.onNodeLoad;if(!w&&P&&_&&!l.isLeaf()){var y=l.getNodeChildren().length!==0;!y&&!v&&F(wr(l))}},l.renderSwitcher=function(){var p=l.props,_=p.expanded,w=p.switcherIcon,v=l.props.context,x=v.prefixCls,P=v.switcherIcon,F=w||P;if(l.isLeaf())return Y.createElement("span",{className:$i("".concat(x,"-switcher"),"".concat(x,"-switcher-noop"))},typeof F=="function"?F(T0({},l.props,{isLeaf:!0})):F);var y=$i("".concat(x,"-switcher"),"".concat(x,"-switcher_").concat(_?A0:E0));return Y.createElement("span",{onClick:l.onExpand,className:y},typeof F=="function"?F(T0({},l.props,{isLeaf:!1})):F)},l.renderCheckbox=function(){var p=l.props,_=p.checked,w=p.halfChecked,v=p.disableCheckbox,x=l.props.context.prefixCls,P=l.isDisabled(),F=l.isCheckable();if(!F)return null;var y=typeof F!="boolean"?F:null;return Y.createElement("span",{className:$i("".concat(x,"-checkbox"),_&&"".concat(x,"-checkbox-checked"),!_&&w&&"".concat(x,"-checkbox-indeterminate"),(P||v)&&"".concat(x,"-checkbox-disabled")),onClick:l.onCheck},y)},l.renderIcon=function(){var p=l.props.loading,_=l.props.context.prefixCls;return Y.createElement("span",{className:$i("".concat(_,"-iconEle"),"".concat(_,"-icon__").concat(l.getNodeState()||"docu"),p&&"".concat(_,"-icon_loading"))})},l.renderSelector=function(){var p=l.state.dragNodeHighlight,_=l.props,w=_.title,v=_.selected,x=_.icon,P=_.loading,F=l.props.context,y=F.prefixCls,R=F.showIcon,$=F.icon,B=F.draggable,V=F.loadData,ee=l.isDisabled(),Z="".concat(y,"-node-content-wrapper"),z;if(R){var re=x||$;z=re?Y.createElement("span",{className:$i("".concat(y,"-iconEle"),"".concat(y,"-icon__customize"))},typeof re=="function"?re(l.props):re):l.renderIcon()}else V&&P&&(z=l.renderIcon());var X=Y.createElement("span",{className:"".concat(y,"-title")},w);return Y.createElement("span",{ref:l.setSelectHandle,title:typeof w=="string"?w:"",className:$i("".concat(Z),"".concat(Z,"-").concat(l.getNodeState()||"normal"),!ee&&(v||p)&&"".concat(y,"-node-selected"),!ee&&B&&"draggable"),draggable:!ee&&B||void 0,"aria-grabbed":!ee&&B||void 0,onMouseEnter:l.onMouseEnter,onMouseLeave:l.onMouseLeave,onContextMenu:l.onContextMenu,onClick:l.onSelectorClick,onDoubleClick:l.onSelectorDoubleClick,onDragStart:B?l.onDragStart:void 0},z,X)},l.renderChildren=function(){var p=l.props,_=p.expanded,w=p.pos,v=l.props.context,x=v.prefixCls,P=v.motion,F=v.renderTreeNode,y=l.getNodeChildren();return y.length===0?null:Y.createElement(iE,Object.assign({visible:_},P),function(R){var $=R.style,B=R.className;return Y.createElement("ul",{className:$i(B,"".concat(x,"-child-tree"),_&&"".concat(x,"-child-tree-open")),style:$,"data-expanded":_,role:"group"},Jy(y,function(V,ee){return F(V,ee,w)}))})},l}return lE(g,[{key:"componentDidMount",value:function(){var p=this.props,_=p.eventKey,w=p.context.registerTreeNode;this.syncLoadData(this.props),w(_,this)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"componentWillUnmount",value:function(){var p=this.props,_=p.eventKey,w=p.context.registerTreeNode;w(_,null)}},{key:"isSelectable",value:function(){var p=this.props.selectable,_=this.props.context.selectable;return typeof p=="boolean"?p:_}},{key:"render",value:function(){var p,_=this.props.loading,w=this.props,v=w.className,x=w.style,P=w.dragOver,F=w.dragOverGapTop,y=w.dragOverGapBottom,R=w.isLeaf,$=w.expanded,B=w.selected,V=w.checked,ee=w.halfChecked,Z=oE(w,["className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","expanded","selected","checked","halfChecked"]),z=this.props.context,re=z.prefixCls,X=z.filterTreeNode,ne=z.draggable,ie=this.isDisabled(),ae=Zy(Z);return Y.createElement("li",Object.assign({className:$i(v,(p={},fo(p,"".concat(re,"-treenode-disabled"),ie),fo(p,"".concat(re,"-treenode-switcher-").concat($?"open":"close"),!R),fo(p,"".concat(re,"-treenode-checkbox-checked"),V),fo(p,"".concat(re,"-treenode-checkbox-indeterminate"),ee),fo(p,"".concat(re,"-treenode-selected"),B),fo(p,"".concat(re,"-treenode-loading"),_),fo(p,"drag-over",!ie&&P),fo(p,"drag-over-gap-top",!ie&&F),fo(p,"drag-over-gap-bottom",!ie&&y),fo(p,"filter-node",X&&X(this)),p)),style:x,role:"treeitem",onDragEnter:ne?this.onDragEnter:void 0,onDragOver:ne?this.onDragOver:void 0,onDragLeave:ne?this.onDragLeave:void 0,onDrop:ne?this.onDrop:void 0,onDragEnd:ne?this.onDragEnd:void 0},ae),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector(),this.renderChildren())}}]),g}(Y.Component);lw.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])};$_(lw);var _d=function(g){return Y.createElement(fy.Consumer,null,function(l){return Y.createElement(lw,Object.assign({},g,{context:l}))})};_d.defaultProps={title:uE};_d.isTreeNode=1;function vg(h){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?vg=function(l){return typeof l}:vg=function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},vg(h)}function hE(h,g){if(h==null)return{};var l=fE(h,g),p,_;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(h);for(_=0;_<w.length;_++)p=w[_],!(g.indexOf(p)>=0)&&Object.prototype.propertyIsEnumerable.call(h,p)&&(l[p]=h[p])}return l}function fE(h,g){if(h==null)return{};var l={},p=Object.keys(h),_,w;for(w=0;w<p.length;w++)_=p[w],!(g.indexOf(_)>=0)&&(l[_]=h[_]);return l}var pE=.25,gE=2,P0=!1;function Ky(){P0||(P0=!0,Ch(!1,"Tree only accept TreeNode as children."))}function ad(h,g){var l=h.slice(),p=l.indexOf(g);return p>=0&&l.splice(p,1),l}function ld(h,g){var l=h.slice();return l.indexOf(g)===-1&&l.push(g),l}function mE(h){return h.split("-")}function Gy(h,g){return"".concat(h,"-").concat(g)}function bE(h){return h&&h.type&&h.type.isTreeNode}function Yy(h){return ud(h).filter(bE)}function wh(h){var g=h.props||{},l=g.disabled,p=g.disableCheckbox,_=g.checkable;return!!(l||p)||_===!1}function Qy(h,g){function l(p,_,w){var v=p?p.props.children:h,x=p?Gy(w.pos,_):0,P=Yy(v);if(p){var F={node:p,index:_,pos:x,key:p.key||x,parentPos:w.node?w.pos:null};g(F)}Y.Children.forEach(P,function(y,R){l(y,R,{node:p,pos:x})})}l(null)}function Jy(h,g){var l=ud(h).map(g);return l.length===1?l[0]:l}function vE(h,g){var l=g.props,p=l.eventKey,_=l.pos,w=[];return Qy(h,function(v){var x=v.key;w.push(x)}),w.push(p||_),w}function I0(h,g){var l=h.clientY,p=g.selectHandle.getBoundingClientRect(),_=p.top,w=p.bottom,v=p.height,x=Math.max(v*pE,gE);return l<=_+x?-1:l>=w-x?1:0}function M0(h,g){if(h){var l=g.multiple;return l?h.slice():h.length?[h[0]]:h}}function O0(h){return h&&h.map(function(g){return String(g)})}var _E=function(g){return g};function Xy(h,g){if(!h)return[];var l=g||{},p=l.processProps,_=p===void 0?_E:p,w=Array.isArray(h)?h:[h];return w.map(function(v){var x=v.children,P=hE(v,["children"]),F=Xy(x,g);return hi.createElement(_d,Object.assign({},_(P)),F)})}function wE(h){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=g.initWrapper,p=g.processEntity,_=g.onProcessFinished,w={},v={},x={posEntities:w,keyEntities:v};return l&&(x=l(x)||x),Qy(h,function(P){var F=P.node,y=P.index,R=P.pos,$=P.key,B=P.parentPos,V={node:F,index:y,key:$,pos:R};w[R]=V,v[$]=V,V.parent=w[B],V.parent&&(V.parent.children=V.parent.children||[],V.parent.children.push(V)),p&&p(V,x)}),_&&_(x),x}function i_(h){if(!h)return null;var g;if(Array.isArray(h))g={checkedKeys:h,halfCheckedKeys:void 0};else if(vg(h)==="object")g={checkedKeys:h.checked||void 0,halfCheckedKeys:h.halfChecked||void 0};else return Ch(!1,"`checkedKeys` is not an array or an object"),null;return g.checkedKeys=O0(g.checkedKeys),g.halfCheckedKeys=O0(g.halfCheckedKeys),g}function N0(h,g,l){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},_={},w={};(p.checkedKeys||[]).forEach(function(R){_[R]=!0}),(p.halfCheckedKeys||[]).forEach(function(R){w[R]=!0});function v(R){if(_[R]!==g){var $=l[R];if($){var B=$.children,V=$.parent,ee=$.node;if(!wh(ee)){var Z=!0,z=!1;(B||[]).filter(function(re){return!wh(re.node)}).forEach(function(re){var X=re.key,ne=_[X],ie=w[X];(ne||ie)&&(z=!0),ne||(Z=!1)}),g?_[R]=Z:_[R]=!1,w[R]=z,V&&v(V.key)}}}}function x(R){if(_[R]!==g){var $=l[R];if($){var B=$.children,V=$.node;wh(V)||(_[R]=g,(B||[]).forEach(function(ee){x(ee.key)}))}}}function P(R){var $=l[R];if(!$){Ch(!1,"'".concat(R,"' does not exist in the tree."));return}var B=$.children,V=$.parent,ee=$.node;_[R]=g,!wh(ee)&&((B||[]).filter(function(Z){return!wh(Z.node)}).forEach(function(Z){x(Z.key)}),V&&v(V.key))}(h||[]).forEach(function(R){P(R)});var F=[],y=[];return Object.keys(_).forEach(function(R){_[R]&&F.push(R)}),Object.keys(w).forEach(function(R){!_[R]&&w[R]&&y.push(R)}),{checkedKeys:F,halfCheckedKeys:y}}function R0(h,g){var l={};function p(_){if(!l[_]){var w=g[_];if(w){l[_]=!0;var v=w.parent,x=w.node;x.props&&x.props.disabled||v&&p(v.key)}}}return(h||[]).forEach(function(_){p(_)}),Object.keys(l)}function Zy(h){return Object.keys(h).reduce(function(g,l){return(l.substr(0,5)==="data-"||l.substr(0,5)==="aria-")&&(g[l]=h[l]),g},{})}function _g(h){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_g=function(l){return typeof l}:_g=function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},_g(h)}function kE(h,g,l){return g in h?Object.defineProperty(h,g,{value:l,enumerable:!0,configurable:!0,writable:!0}):h[g]=l,h}function yE(h,g){if(!(h instanceof g))throw new TypeError("Cannot call a class as a function")}function D0(h,g){for(var l=0;l<g.length;l++){var p=g[l];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}function xE(h,g,l){return g&&D0(h.prototype,g),l&&D0(h,l),h}function CE(h,g){return g&&(_g(g)==="object"||typeof g=="function")?g:TE(h)}function TE(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}function P_(h){return P_=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},P_(h)}function SE(h,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function");h.prototype=Object.create(g&&g.prototype,{constructor:{value:h,writable:!0,configurable:!0}}),g&&I_(h,g)}function I_(h,g){return I_=Object.setPrototypeOf||function(p,_){return p.__proto__=_,p},I_(h,g)}var em=function(h){SE(g,h);function g(){var l;return yE(this,g),l=CE(this,P_(g).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(p,_){var w=l.state.expandedKeys,v=l.props.onDragStart,x=_.props,P=x.eventKey,F=x.children;l.dragNode=_,l.setState({dragNodesKeys:vE(F,_),expandedKeys:ad(w,P)}),v&&v({event:p,node:_})},l.onNodeDragEnter=function(p,_){var w=l.state.expandedKeys,v=l.props.onDragEnter,x=_.props,P=x.pos,F=x.eventKey;if(l.dragNode){var y=I0(p,_);if(l.dragNode.props.eventKey===F&&y===0){l.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){l.setState({dragOverNodeKey:F,dropPosition:y}),l.delayedDragEnterLogic||(l.delayedDragEnterLogic={}),Object.keys(l.delayedDragEnterLogic).forEach(function(R){clearTimeout(l.delayedDragEnterLogic[R])}),l.delayedDragEnterLogic[P]=window.setTimeout(function(){var R=ld(w,F);"expandedKeys"in l.props||l.setState({expandedKeys:R}),v&&v({event:p,node:_,expandedKeys:R})},400)},0)}},l.onNodeDragOver=function(p,_){var w=l.props.onDragOver,v=_.props.eventKey;if(l.dragNode&&v===l.state.dragOverNodeKey){var x=I0(p,_);if(x===l.state.dropPosition)return;l.setState({dropPosition:x})}w&&w({event:p,node:_})},l.onNodeDragLeave=function(p,_){var w=l.props.onDragLeave;l.setState({dragOverNodeKey:""}),w&&w({event:p,node:_})},l.onNodeDragEnd=function(p,_){var w=l.props.onDragEnd;l.setState({dragOverNodeKey:""}),w&&w({event:p,node:_}),l.dragNode=null},l.onNodeDrop=function(p,_){var w=l.state,v=w.dragNodesKeys,x=v===void 0?[]:v,P=w.dropPosition,F=l.props.onDrop,y=_.props,R=y.eventKey,$=y.pos;if(l.setState({dragOverNodeKey:""}),x.indexOf(R)!==-1){Ch(!1,"Can not drop to dragNode(include it's children node)");return}var B=mE($),V={event:p,node:_,dragNode:l.dragNode,dragNodesKeys:x.slice(),dropPosition:P+Number(B[B.length-1]),dropToGap:!1};P!==0&&(V.dropToGap=!0),F&&F(V),l.dragNode=null},l.onNodeClick=function(p,_){var w=l.props.onClick;w&&w(p,_)},l.onNodeDoubleClick=function(p,_){var w=l.props.onDoubleClick;w&&w(p,_)},l.onNodeSelect=function(p,_){var w=l.state.selectedKeys,v=l.state.keyEntities,x=l.props,P=x.onSelect,F=x.multiple,y=_.props,R=y.selected,$=y.eventKey,B=!R;B?F?w=ld(w,$):w=[$]:w=ad(w,$);var V=w.map(function(ee){var Z=v[ee];return Z?Z.node:null}).filter(function(ee){return ee});l.setUncontrolledState({selectedKeys:w}),P&&P(w,{event:"select",selected:B,node:_,selectedNodes:V,nativeEvent:p.nativeEvent})},l.onNodeCheck=function(p,_,w){var v=l.state,x=v.keyEntities,P=v.checkedKeys,F=v.halfCheckedKeys,y=l.props,R=y.checkStrictly,$=y.onCheck,B=_.props.eventKey,V,ee={event:"check",node:_,checked:w,nativeEvent:p.nativeEvent};if(R){var Z=w?ld(P,B):ad(P,B),z=ad(F,B);V={checked:Z,halfChecked:z},ee.checkedNodes=Z.map(function(ie){return x[ie]}).filter(function(ie){return ie}).map(function(ie){return ie.node}),l.setUncontrolledState({checkedKeys:Z})}else{var re=N0([B],w,x,{checkedKeys:P,halfCheckedKeys:F}),X=re.checkedKeys,ne=re.halfCheckedKeys;V=X,ee.checkedNodes=[],ee.checkedNodesPositions=[],ee.halfCheckedKeys=ne,X.forEach(function(ie){var ae=x[ie];if(ae){var _e=ae.node,Se=ae.pos;ee.checkedNodes.push(_e),ee.checkedNodesPositions.push({node:_e,pos:Se})}}),l.setUncontrolledState({checkedKeys:X,halfCheckedKeys:ne})}$&&$(V,ee)},l.onNodeLoad=function(p){return new Promise(function(_){l.setState(function(w){var v=w.loadedKeys,x=v===void 0?[]:v,P=w.loadingKeys,F=P===void 0?[]:P,y=l.props,R=y.loadData,$=y.onLoad,B=p.props.eventKey;if(!R||x.indexOf(B)!==-1||F.indexOf(B)!==-1)return{};var V=R(p);return V.then(function(){var ee=l.state,Z=ee.loadedKeys,z=ee.loadingKeys,re=ld(Z,B),X=ad(z,B);$&&$(re,{event:"load",node:p}),l.setUncontrolledState({loadedKeys:re}),l.setState({loadingKeys:X}),_()}),{loadingKeys:ld(F,B)}})})},l.onNodeExpand=function(p,_){var w=l.state.expandedKeys,v=l.props,x=v.onExpand,P=v.loadData,F=_.props,y=F.eventKey,R=F.expanded,$=w.indexOf(y),B=!R;if(Ch(R&&$!==-1||!R&&$===-1,"Expand state not sync with index check"),B?w=ld(w,y):w=ad(w,y),l.setUncontrolledState({expandedKeys:w}),x&&x(w,{node:_,expanded:B,nativeEvent:p.nativeEvent}),B&&P){var V=l.onNodeLoad(_);return V?V.then(function(){l.setUncontrolledState({expandedKeys:w})}):null}return null},l.onNodeMouseEnter=function(p,_){var w=l.props.onMouseEnter;w&&w({event:p,node:_})},l.onNodeMouseLeave=function(p,_){var w=l.props.onMouseLeave;w&&w({event:p,node:_})},l.onNodeContextMenu=function(p,_){var w=l.props.onRightClick;w&&(p.preventDefault(),w({event:p,node:_}))},l.setUncontrolledState=function(p){var _=!1,w={};Object.keys(p).forEach(function(v){v in l.props||(_=!0,w[v]=p[v])}),_&&l.setState(w)},l.registerTreeNode=function(p,_){_?l.domTreeNodes[p]=_:delete l.domTreeNodes[p]},l.isKeyChecked=function(p){var _=l.state.checkedKeys,w=_===void 0?[]:_;return w.indexOf(p)!==-1},l.renderTreeNode=function(p,_){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,v=l.state,x=v.keyEntities,P=v.expandedKeys,F=P===void 0?[]:P,y=v.selectedKeys,R=y===void 0?[]:y,$=v.halfCheckedKeys,B=$===void 0?[]:$,V=v.loadedKeys,ee=V===void 0?[]:V,Z=v.loadingKeys,z=Z===void 0?[]:Z,re=v.dragOverNodeKey,X=v.dropPosition,ne=Gy(w,_),ie=p.key||ne;return x[ie]?Y.cloneElement(p,{key:ie,eventKey:ie,expanded:F.indexOf(ie)!==-1,selected:R.indexOf(ie)!==-1,loaded:ee.indexOf(ie)!==-1,loading:z.indexOf(ie)!==-1,checked:l.isKeyChecked(ie),halfChecked:B.indexOf(ie)!==-1,pos:ne,dragOver:re===ie&&X===0,dragOverGapTop:re===ie&&X===-1,dragOverGapBottom:re===ie&&X===1}):(Ky(),null)},l}return xE(g,[{key:"render",value:function(){var p=this,_=this.state.treeNode,w=this.props,v=w.prefixCls,x=w.className,P=w.focusable,F=w.style,y=w.showLine,R=w.tabIndex,$=R===void 0?0:R,B=w.selectable,V=w.showIcon,ee=w.icon,Z=w.switcherIcon,z=w.draggable,re=w.checkable,X=w.checkStrictly,ne=w.disabled,ie=w.motion,ae=w.loadData,_e=w.filterTreeNode,Se=Zy(this.props);return P&&(Se.tabIndex=$),Y.createElement(fy.Provider,{value:{prefixCls:v,selectable:B,showIcon:V,icon:ee,switcherIcon:Z,draggable:z,checkable:re,checkStrictly:X,disabled:ne,motion:ie,loadData:ae,filterTreeNode:_e,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}},Y.createElement("ul",Object.assign({},Se,{className:$i(v,x,kE({},"".concat(v,"-show-line"),y)),style:F,role:"tree",unselectable:"on"}),Jy(_,function(Pe,Me){return p.renderTreeNode(Pe,Me)})))}}],[{key:"getDerivedStateFromProps",value:function(p,_){var w=_.prevProps,v={prevProps:p};function x(re){return!w&&re in p||w&&w[re]!==p[re]}var P=null;if(x("treeData")?P=Xy(p.treeData):x("children")&&(P=ud(p.children)),P){v.treeNode=P;var F=wE(P);v.keyEntities=F.keyEntities}var y=v.keyEntities||_.keyEntities;if(x("expandedKeys")||w&&x("autoExpandParent")?v.expandedKeys=p.autoExpandParent||!w&&p.defaultExpandParent?R0(p.expandedKeys,y):p.expandedKeys:!w&&p.defaultExpandAll?v.expandedKeys=Object.keys(y):!w&&p.defaultExpandedKeys&&(v.expandedKeys=p.autoExpandParent||p.defaultExpandParent?R0(p.defaultExpandedKeys,y):p.defaultExpandedKeys),p.selectable&&(x("selectedKeys")?v.selectedKeys=M0(p.selectedKeys,p):!w&&p.defaultSelectedKeys&&(v.selectedKeys=M0(p.defaultSelectedKeys,p))),p.checkable){var R;if(x("checkedKeys")?R=i_(p.checkedKeys)||{}:!w&&p.defaultCheckedKeys?R=i_(p.defaultCheckedKeys)||{}:P&&(R=i_(p.checkedKeys)||{checkedKeys:_.checkedKeys,halfCheckedKeys:_.halfCheckedKeys}),R){var $=R,B=$.checkedKeys,V=B===void 0?[]:B,ee=$.halfCheckedKeys,Z=ee===void 0?[]:ee;if(!p.checkStrictly){var z=N0(V,!0,y);V=z.checkedKeys,Z=z.halfCheckedKeys}v.checkedKeys=V,v.halfCheckedKeys=Z}}return x("loadedKeys")&&(v.loadedKeys=p.loadedKeys),v}}]),g}(Y.Component);em.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])};em.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:[]};$_(em);var e1=em;e1.TreeNode=_d;var U0;const lI=((U0=Vn)==null?void 0:U0.MaLoaiDonVi)==="UBMT";var W0;const cI=((W0=Vn)==null?void 0:W0.MaLoaiDonVi)==="PhuongXa";var q0;const dI=((q0=Vn)==null?void 0:q0.MaLoaiDonVi)==="QuanHuyen";var K0;const AE=((K0=Vn)==null?void 0:K0.MaLoaiDonVi)==="UBNDHuyen";var G0;(G0=Vn)==null||G0.IDDonVi;var Y0;(Y0=Vn)==null||Y0.MaTaiKhoan;var Q0;(Q0=Vn)==null||Q0.MaTaiKhoan;const o_=O_.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; } } `,j0={Name:{field_name:"Name",title:"Tên",type:"textbox",required:!0},MaKiHieu:{field_name:"MaKiHieu",title:"Mã kí hiệu",type:"textbox"}},EE=O_(_d)` .rc-tree-node-content-wrapper { white-space: nowrap; width: 780px; overflow: hidden; text-overflow: ellipsis; } `;function PE(h){const{dataSelect:g,valueDisplay:l,onClickButton:p,onCallback:_,Id:w,EndPoint_Tree:v,EndPoint_Odata:x,isDieu18:P}=h,{placeholder:F}=g,[y,R]=Y.useState(!1),[$,B]=Y.useState([]),[V,ee]=Y.useState({value:null,label:""}),[Z,z]=Y.useState(!1),[re,X]=Y.useState(!1),[ne,ie]=Y.useState(!0),[ae,_e]=Y.useState(!0),[Se,Pe]=Y.useState(!0),[Me,Re]=Y.useState(!0),[ce,pe]=Y.useState([]),[be,ke]=Y.useState({}),[ye,Ce]=Y.useState({valueFake:null,labelFake:"",isFake:!0}),[ze,He]=Y.useState({});Y.useEffect(()=>He({label:l}),[l]),Y.useEffect(()=>{w&&ee(we=>({...we,value:[`${w}`]}))},[w]);const Ge=Y.useCallback(()=>{Bn(v,"GET",null,{odata:!1}).then(Ne=>B(Ne)).catch(Ne=>kg("Không thể tải dữ liệu danh mục nội dung","Thông báo"))},[v]);Y.useEffect(()=>{Ge()},[Ge]);const qe=Y.useCallback(we=>{p&&p(),y?!w&&!we.isValue&&(ee({}),ie(!0),_e(!0),Pe(!0)):(B($),pe([])),R(!y)},[w,$,y,p]),gt=Y.useMemo(()=>{const{label:we}=ze;return A.jsxs(ry,{children:[A.jsx(l_,{readOnly:!0,placeholder:F,value:we||""}),A.jsx(Qn,{color:"primary",onClick:qe,children:"Chọn"})]})},[qe,ze,F]),je=Y.useCallback((we,Ne)=>{const{node:{props:{title:mt,isChildren:Fe}}}=Ne;we.length!==0&&(X(Ne.selected),ie(!Ne.selected),_e(!Ne.selected),Pe(!Ne.selected),ee({value:we,label:we.length?mt:""}),Ce({isFake:!1}),Re(Fe))},[]),ut=Y.useCallback(()=>{He({value:V.value[0],label:V.label}),_({value:V.value[0],label:V.label}),qe({isValue:V.value[0]})},[qe,_,V]),De=Y.useCallback(we=>{we&&Bn(`${x}(${we})`).then(Ne=>ke(Ne))},[x]),Oe=Y.useCallback(()=>{z(!1),ke({}),Ce({})},[]),tt=Y.useCallback(we=>{J0("Bạn có muốn xóa nguồn vốn này không").then(Ne=>{Ne&&Ne.isConfirmed&&Bn(`${x}(${we})`,"DELETE",null).then(()=>{Ge(),xh("Xóa thành công","Thông báo"),Oe(),_({})})})},[x,Ge,Oe,_]);Y.useCallback(we=>{const Ne=Vn.IDDonVi==="bccb8adf-7788-4ddc-9376-640a7f90cd29";return A.jsxs(Y.Fragment,{children:[A.jsx("span",{children:we.title}),A.jsx("span",{children:Ne&&AE&&A.jsxs(A.Fragment,{children:[A.jsxs(o_,{id:"add",onClick:()=>{z("addChildren"),Ce(mt=>({...mt,valueFake:we.key,labelFake:we.title,isFake:!0}))},className:"ms-3",children:[A.jsx(kn,{fa:"plus-circle"}),A.jsx("span",{className:"ms-1",children:"Thêm danh mục con"})]}),A.jsxs(o_,{id:"update",onClick:()=>{z("update"),Ce(mt=>({...mt,valueFake:we.key,labelFake:we.title,isFake:!0})),De(we.key)},className:"ms-3",children:[A.jsx(kn,{fa:"pencil-square-o"}),A.jsx("span",{className:"ms-1",children:"Cập nhật"})]}),we.children.length===0&&A.jsxs(o_,{id:"delete",onClick:()=>{tt(we.key)},className:"ms-2",children:[A.jsx(kn,{fa:"times"}),A.jsx("span",{className:"ms-1",children:"Xóa"})]})]})})]})},[De,tt]);const ht=Y.useCallback(we=>we.map(Ne=>Ne.children&&Ne.children.length?A.jsx(_d,{className:"parent",isChildren:!0,title:Ne.title,children:ht(Ne.children)},Ne.key):A.jsx(EE,{className:"children",isChildren:!1,title:Ne.title},Ne.key)),[]),kt=Y.useCallback(we=>{let Ne=document.getElementById("value").value;we.type==="click"&&Bn(`Dieu18Ext/GetTree_NguonVon?search=${Ne}`,"GET",null,{odata:!1}).then(mt=>{pe(mt)}),we.key==="Enter"||we.type==="click"?we.target.value?Bn(`Dieu18Ext/GetTree_NguonVon?search=${we.target.value}`,"GET",null,{odata:!1}).then(mt=>{pe(mt)}):pe($):we.target.value||pe($)},[$]),Kt=Y.useMemo(()=>{const{value:we}=V;Vn.IDDonVi;let Ne=ce.length===0?$:ce;return A.jsxs(da,{size:"xl",isOpen:y,toggle:qe,zIndex:1301,children:[A.jsx(Tk,{className:"align-items-center pb-0",style:{borderBottom:"none"},children:A.jsx("span",{children:"Thêm mới"})}),A.jsx(Sk,{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(Qn,{disabled:ne,onClick:()=>z("addChildren"),children:"Thêm danh mục con"}),A.jsx(Qn,{disabled:ae,onClick:()=>{z("update"),De(we[0])},children:"Cập nhật"}),A.jsx(Qn,{disabled:Se,onClick:()=>tt(we[0]),style:{color:"red"},children:"Xóa"})]})}),A.jsx("div",{className:"me-1",children:A.jsxs(Qn,{onClick:ut,disabled:!we||!we.length||Me,size:"sm",color:"primary",children:[A.jsx(kn,{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(l_,{onKeyPress:kt,onChange:kt,placeholder:"Tìm tên nguồn vốn...",id:"value"}),A.jsx(IE,{onClick:mt=>kt(mt),className:"w-25",children:"Tìm kiếm"})]}),A.jsx(e1,{className:"myCls",showLine:!0,selectedKeys:we,onSelect:je,defaultExpandAll:!!w,defaultExpandedKeys:P&&["A","B"],children:ht(Ne)})]})]})})]})},[V,ce,$,y,qe,ne,ae,Se,ut,Me,kt,je,w,P,ht,De,tt]),Ee=Y.useCallback((we,Ne)=>{ke(mt=>({...mt,[we]:Ne}))},[]),yt=Y.useCallback((we,Ne)=>{const{Name:mt,MaKiHieu:Fe}=be;if(mt&&Fe){let Ye=Ne&&we==="update"?`${x}(${Ne})`:x,Vt=Ne&&we==="update"?"PATCH":"POST",gn=Ne&&we==="update"?"Cập nhật":"Thêm mới",Zt={...be,IsDM:!0};Ne&&we==="addChildren"&&(Zt={...Zt,Parent_Id:Ne,Created_By:Vn.MaTaiKhoan}),!Ne&&we==="add"&&(Zt={...Zt,IsFixed:!0}),Ne&&we==="update"&&(Zt={Name:be.Name,MaKiHieu:be.MaKiHieu}),Bn(Ye,Vt,JSON.stringify(Zt),!0).then(Vr=>{Ge(),xh(`${gn} thành công`,"Thông báo"),Oe()}).catch(Vr=>kg(`${gn} không thành công`,"Thông báo"))}else yg("Vui lòng nhập đầy đủ vào thông tin có dấu sao đỏ")},[x,be,Ge,Oe]),on=Y.useMemo(()=>{const{valueFake:we,labelFake:Ne,isFake:mt}=ye,Fe=Z,Ye=mt?we:V&&V.value&&V.value.length?V.value[0]:null,Vt=mt?Ne:V?V.label:"";return A.jsxs(da,{isOpen:!!Z,toggle:()=>Oe(),size:"lg",zIndex:"1302",children:[A.jsx(Tk,{children:A.jsx("b",{children:Ye?"Cập nhật danh mục":"Thêm mới danh mục"})}),A.jsxs(Sk,{children:[Ye&&Fe==="addChildren"&&A.jsxs("h5",{children:['Thuộc danh mục "',Vt,'"']}),A.jsx(Br,{data:j0.Name,value:be.Name,onChange:Ee}),A.jsx(Br,{data:j0.MaKiHieu,value:be.MaKiHieu,onChange:Ee})]}),A.jsxs(Ah,{children:[A.jsx(Xx,{onClick:()=>yt(Fe,Ye),children:"Lưu"})," ",A.jsx(Qn,{onClick:Oe,children:"Hủy"})]})]})},[Z,V,be,Ee,Oe,yt,ye]);return A.jsxs(Y.Fragment,{children:[gt,Kt,on]})}const IE=O_.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 jt=function(){return jt=Object.assign||function(g){for(var l,p=1,_=arguments.length;p<_;p++){l=arguments[p];for(var w in l)Object.prototype.hasOwnProperty.call(l,w)&&(g[w]=l[w])}return g},jt.apply(this,arguments)};function cw(h,g){var l={};for(var p in h)Object.prototype.hasOwnProperty.call(h,p)&&g.indexOf(p)<0&&(l[p]=h[p]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function")for(var _=0,p=Object.getOwnPropertySymbols(h);_<p.length;_++)g.indexOf(p[_])<0&&Object.prototype.propertyIsEnumerable.call(h,p[_])&&(l[p[_]]=h[p[_]]);return l}function ui(h,g,l){if(l||arguments.length===2)for(var p=0,_=g.length,w;p<_;p++)(w||!(p in g))&&(w||(w=Array.prototype.slice.call(g,0,p)),w[p]=g[p]);return h.concat(w||Array.prototype.slice.call(g))}var $o=function(h){return h.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},ME={k:1e3,m:1e6,b:1e9},OE=function(h,g){g===void 0&&(g=".");var l=new RegExp("(\\d+(".concat($o(g),"\\d*)?)([kmb])$"),"i"),p=h.match(l);if(p){var _=p[1],w=p[3],v=ME[w.toLowerCase()];return Number(_.replace(g,"."))*v}},NE=function(h,g){g===void 0&&(g=",");var l=new RegExp($o(g),"g");return h.replace(l,"")},RE=function(h,g){var l=$o(g.join("")),p=new RegExp("[^\\d".concat(l,"]"),"gi");return h.replace(p,"")},s_=function(h){var g=h.value,l=h.groupSeparator,p=l===void 0?",":l,_=h.decimalSeparator,w=_===void 0?".":_,v=h.allowDecimals,x=v===void 0?!0:v,P=h.decimalsLimit,F=P===void 0?2:P,y=h.allowNegativeValue,R=y===void 0?!0:y,$=h.disableAbbreviations,B=$===void 0?!1:$,V=h.prefix,ee=V===void 0?"":V,Z=h.transformRawValue,z=Z===void 0?function(Ge){return Ge}:Z,re=z(g);if(re==="-")return re;var X=B?[]:["k","m","b"],ne=new RegExp("((^|\\D)-\\d)|(-".concat($o(ee),")")),ie=ne.test(re),ae=RegExp("(\\d+)-?".concat($o(ee))).exec(g)||[],_e=ae[0],Se=ae[1],Pe=ee?_e?re.replace(_e,"").concat(Se):re.replace(ee,""):re,Me=NE(Pe,p),Re=RE(Me,ui([p,w],X,!0)),ce=Re;if(!B){if(X.some(function(Ge){return Ge===Re.toLowerCase().replace(w,"")}))return"";var pe=OE(Re,w);pe&&(ce=String(pe))}var be=ie&&R?"-":"";if(w&&ce.includes(w)){var ke=Re.split(w),ye=ke[0],Ce=ke[1],ze=F&&Ce?Ce.slice(0,F):Ce,He=x?"".concat(w).concat(ze):"";return"".concat(be).concat(ye).concat(He)}return"".concat(be).concat(ce)},DE=function(h,g,l){if(l!==void 0&&h.length>1){if(l===0)return h.replace(g,"");if(h.includes(g)){var p=h.split(g),_=p[0],w=p[1];if(w.length===l)return h;if(w.length>l)return"".concat(_).concat(g).concat(w.slice(0,l))}var v=h.length>l?new RegExp("(\\d+)(\\d{".concat(l,"})")):new RegExp("(\\d)(\\d+)"),x=h.match(v);if(x){var _=x[1],w=x[2];return"".concat(_).concat(g).concat(w)}}return h},t1=function(h,g){var l=g.groupSeparator,p=l===void 0?",":l,_=g.decimalSeparator,w=_===void 0?".":_,v=new RegExp("\\d([^".concat($o(p)).concat($o(w),"0-9]+)")),x=h.match(v);return x?x[1]:void 0},kh=function(h){var g=h.value,l=h.decimalSeparator,p=h.intlConfig,_=h.decimalScale,w=h.prefix,v=w===void 0?"":w,x=h.suffix,P=x===void 0?"":x;if(g===""||g===void 0)return"";if(g==="-")return"-";var F=new RegExp("^\\d?-".concat(v?"".concat($o(v),"?"):"","\\d")).test(g),y=l!=="."?jE(g,l,F):g;l&&l!=="-"&&y.startsWith(l)&&(y="0"+y);var R=p||{},$=R.locale,B=R.currency,V=cw(R,["locale","currency"]),ee=jt(jt({},V),{minimumFractionDigits:_||0,maximumFractionDigits:20}),Z=p?new Intl.NumberFormat($,jt(jt({},ee),B&&{style:"currency",currency:B})):new Intl.NumberFormat(void 0,ee),z=Z.formatToParts(Number(y)),re=LE(z,h),X=t1(re,jt({},h)),ne=g.slice(-1)===l?l:"",ie=y.match(RegExp("\\d+\\.(\\d+)"))||[],ae=ie[1];return _===void 0&&ae&&l&&(re.includes(l)?re=re.replace(RegExp("(\\d+)(".concat($o(l),")(\\d+)"),"g"),"$1$2".concat(ae)):X&&!P?re=re.replace(X,"".concat(l).concat(ae).concat(X)):re="".concat(re).concat(l).concat(ae)),P&&ne?"".concat(re).concat(ne).concat(P):X&&ne?re.replace(X,"".concat(ne).concat(X)):X&&P?re.replace(X,"".concat(ne).concat(P)):[re,ne,P].join("")},jE=function(h,g,l){var p=h;return g&&g!=="."&&(p=p.replace(RegExp($o(g),"g"),"."),l&&g==="-"&&(p="-".concat(p.slice(1)))),p},LE=function(h,g){var l=g.prefix,p=g.groupSeparator,_=g.decimalSeparator,w=g.decimalScale,v=g.disableGroupSeparators,x=v===void 0?!1:v;return h.reduce(function(P,F,y){var R=F.type,$=F.value;return y===0&&l?R==="minusSign"?[$,l]:R==="currency"?ui(ui([],P,!0),[l],!1):[l,$]:R==="currency"?l?P:ui(ui([],P,!0),[$],!1):R==="group"?x?P:ui(ui([],P,!0),[p!==void 0?p:$],!1):R==="decimal"?w!==void 0&&w===0?P:ui(ui([],P,!0),[_!==void 0?_:$],!1):R==="fraction"?ui(ui([],P,!0),[w!==void 0?$.slice(0,w):$],!1):ui(ui([],P,!0),[$],!1)},[""]).join("")},zE={currencySymbol:"",groupSeparator:"",decimalSeparator:"",prefix:"",suffix:""},FE=function(h){var g=h||{},l=g.locale,p=g.currency,_=cw(g,["locale","currency"]),w=l?new Intl.NumberFormat(l,jt(jt({},_),p&&{currency:p,style:"currency"})):new Intl.NumberFormat;return w.formatToParts(1000.1).reduce(function(v,x,P){return x.type==="currency"?P===0?jt(jt({},v),{currencySymbol:x.value,prefix:x.value}):jt(jt({},v),{currencySymbol:x.value,suffix:x.value}):x.type==="group"?jt(jt({},v),{groupSeparator:x.value}):x.type==="decimal"?jt(jt({},v),{decimalSeparator:x.value}):v},zE)},L0=function(h){return RegExp(/\d/,"gi").test(h)},BE=function(h,g,l){if(l===void 0||g===""||g===void 0||h===""||h===void 0)return h;if(!h.match(/\d/g))return"";var p=h.split(g),_=p[0],w=p[1];if(l===0)return _;var v=w||"";if(v.length<l)for(;v.length<l;)v+="0";else v=v.slice(0,l);return"".concat(_).concat(g).concat(v)},VE=function(h){var g=h.selectionStart,l=h.value,p=h.lastKeyStroke,_=h.stateValue,w=h.groupSeparator,v=g,x=l;if(_&&v){var P=l.split("");return p==="Backspace"&&_[v]===w&&(P.splice(v-1,1),v-=1),p==="Delete"&&_[v]===w&&(P.splice(v,1),v+=1),x=P.join(""),{modifiedValue:x,cursorPosition:v}}return{modifiedValue:x,cursorPosition:g}},n1=Y.forwardRef(function(h,g){var l=h.allowDecimals,p=l===void 0?!0:l,_=h.allowNegativeValue,w=_===void 0?!0:_,v=h.id,x=h.name,P=h.className,F=h.customInput,y=h.decimalsLimit,R=h.defaultValue,$=h.disabled,B=$===void 0?!1:$,V=h.maxLength,ee=h.value,Z=h.onValueChange,z=h.fixedDecimalLength,re=h.placeholder,X=h.decimalScale,ne=h.prefix,ie=h.suffix,ae=h.intlConfig,_e=h.step,Se=h.min,Pe=h.max,Me=h.disableGroupSeparators,Re=Me===void 0?!1:Me,ce=h.disableAbbreviations,pe=ce===void 0?!1:ce,be=h.decimalSeparator,ke=h.groupSeparator,ye=h.onChange,Ce=h.onFocus,ze=h.onBlur,He=h.onKeyDown,Ge=h.onKeyUp,qe=h.transformRawValue,gt=h.formatValueOnBlur,je=gt===void 0?!0:gt,ut=cw(h,["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(be&&L0(be))throw new Error("decimalSeparator cannot be a number");if(ke&&L0(ke))throw new Error("groupSeparator cannot be a number");var De=Y.useMemo(function(){return FE(ae)},[ae]),Oe=be||De.decimalSeparator||"",tt=ke||De.groupSeparator||"";if(Oe&&tt&&Oe===tt&&Re===!1)throw new Error("decimalSeparator cannot be the same as groupSeparator");var ht={decimalSeparator:Oe,groupSeparator:tt,disableGroupSeparators:Re,intlConfig:ae,prefix:ne||De.prefix,suffix:ie},kt={decimalSeparator:Oe,groupSeparator:tt,allowDecimals:p,decimalsLimit:y||z||2,allowNegativeValue:w,disableAbbreviations:pe,prefix:ne||De.prefix,transformRawValue:qe},Kt=Y.useState(function(){return R!=null?kh(jt(jt({},ht),{decimalScale:X,value:String(R)})):ee!=null?kh(jt(jt({},ht),{decimalScale:X,value:String(ee)})):""}),Ee=Kt[0],yt=Kt[1],on=Y.useState(!1),we=on[0],Ne=on[1],mt=Y.useState(0),Fe=mt[0],Ye=mt[1],Vt=Y.useState(0),gn=Vt[0],Zt=Vt[1],Vr=Y.useState(null),po=Vr[0],fa=Vr[1],$n=Y.useRef(null);Y.useImperativeHandle(g,function(){return $n.current});var ws=function(Xt,un){Ne(!0);var ln=VE({selectionStart:un,value:Xt,lastKeyStroke:po,stateValue:Ee,groupSeparator:tt}),Hn=ln.modifiedValue,mn=ln.cursorPosition,vt=s_(jt({value:Hn},kt));if(!(V&&vt.replace(/-/g,"").length>V)){if(vt===""||vt==="-"||vt===Oe){Z&&Z(void 0,x,{float:null,formatted:"",value:""}),yt(vt),Ye(1);return}var Zn=Oe?vt.replace(Oe,"."):vt,Tt=parseFloat(Zn),Cr=kh(jt({value:vt},ht));if(mn!=null){var lr=mn+(Cr.length-Xt.length);lr=lr<=0?ne?ne.length:0:lr,Ye(lr),Zt(gn+1)}if(yt(Cr),Z){var cr={float:Tt,formatted:Cr,value:vt};Z(vt,x,cr)}}},pi=function(Xt){var un=Xt.target,ln=un.value,Hn=un.selectionStart;ws(ln,Hn),ye&&ye(Xt)},xr=function(Xt){return Ce&&Ce(Xt),Ee?Ee.length:0},go=function(Xt){var un=Xt.target.value,ln=s_(jt({value:un},kt));if(ln==="-"||ln===Oe||!ln){yt(""),ze&&ze(Xt);return}var Hn=DE(ln,Oe,z),mn=BE(Hn,Oe,X!==void 0?X:z),vt=Oe?mn.replace(Oe,"."):mn,Zn=parseFloat(vt),Tt=kh(jt(jt({},ht),{value:mn}));Z&&je&&Z(mn,x,{float:Zn,formatted:Tt,value:mn}),yt(Tt),ze&&ze(Xt)},Qr=function(Xt){var un=Xt.key;if(fa(un),_e&&(un==="ArrowUp"||un==="ArrowDown")){Xt.preventDefault(),Ye(Ee.length);var ln=ee!=null?String(ee):void 0,Hn=Oe&&ln?ln.replace(Oe,"."):ln,mn=parseFloat(Hn??s_(jt({value:Ee},kt)))||0,vt=un==="ArrowUp"?mn+_e:mn-_e;if(Se!==void 0&&vt<Number(Se)||!w&&vt<0||Pe!==void 0&&vt>Number(Pe))return;var Zn=String(_e).includes(".")?Number(String(_e).split(".")[1].length):void 0;ws(String(Zn?vt.toFixed(Zn):vt).replace(".",Oe))}He&&He(Xt)},mo=function(Xt){var un=Xt.key,ln=Xt.currentTarget.selectionStart;if(un!=="ArrowUp"&&un!=="ArrowDown"&&Ee!=="-"){var Hn=t1(Ee,{groupSeparator:tt,decimalSeparator:Oe});if(Hn&&ln&&ln>Ee.length-Hn.length&&$n.current){var mn=Ee.length-Hn.length;$n.current.setSelectionRange(mn,mn)}}Ge&&Ge(Xt)};Y.useEffect(function(){ee==null&&R==null&&yt("")},[R,ee]),Y.useEffect(function(){we&&Ee!=="-"&&$n.current&&document.activeElement===$n.current&&$n.current.setSelectionRange(Fe,Fe)},[Ee,Fe,$n,we,gn]);var bo=function(){return ee!=null&&Ee!=="-"&&(!Oe||Ee!==Oe)?kh(jt(jt({},ht),{decimalScale:we?void 0:X,value:String(ee)})):Ee},vo=jt({type:"text",inputMode:"decimal",id:v,name:x,className:P,onChange:pi,onBlur:go,onFocus:xr,onKeyDown:Qr,onKeyUp:mo,placeholder:re,disabled:B,value:bo(),ref:$n},ut);if(F){var en=F;return hi.createElement(en,jt({},vo))}return hi.createElement("input",jt({},vo))});n1.displayName="CurrencyInput";var r1={},dw={},uw={},wd={};Object.defineProperty(wd,"__esModule",{value:!0});wd.Direction=void 0;var z0;(function(h){h.Right="to right",h.Left="to left",h.Down="to bottom",h.Up="to top"})(z0||(wd.Direction=z0={}));(function(h){var g=an&&an.__spreadArray||function(ce,pe,be){if(be||arguments.length===2)for(var ke=0,ye=pe.length,Ce;ke<ye;ke++)(Ce||!(ke in pe))&&(Ce||(Ce=Array.prototype.slice.call(pe,0,ke)),Ce[ke]=pe[ke]);return ce.concat(Ce||Array.prototype.slice.call(pe))};Object.defineProperty(h,"__esModule",{value:!0}),h.isIOS=h.useThumbOverlap=h.assertUnreachable=h.voidFn=h.getTrackBackground=h.replaceAt=h.schd=h.translate=h.getClosestThumbIndex=h.translateThumbs=h.getPaddingAndBorder=h.getMargin=h.checkInitialOverlap=h.checkValuesAgainstBoundaries=h.checkBoundaries=h.isVertical=h.relativeValue=h.normalizeValue=h.isStepDivisible=h.isTouchEvent=h.getStepDecimals=void 0;var l=Y,p=wd,_=function(ce){var pe=ce.toString().split(".")[1];return pe?pe.length:0};h.getStepDecimals=_;function w(ce){return ce.touches&&ce.touches.length||ce.changedTouches&&ce.changedTouches.length}h.isTouchEvent=w;function v(ce,pe,be){var ke=(pe-ce)/be,ye=8,Ce=Number(ke.toFixed(ye));return parseInt(Ce.toString(),10)===Ce}h.isStepDivisible=v;function x(ce,pe,be,ke,ye,Ce,ze){var He=1e11;if(ce=Math.round(ce*He)/He,!Ce){var Ge=ze[pe-1],qe=ze[pe+1];if(Ge&&Ge>ce)return Ge;if(qe&&qe<ce)return qe}if(ce>ke)return ke;if(ce<be)return be;var gt=Math.floor(ce*He-be*He)%Math.floor(ye*He),je=Math.floor(ce*He-Math.abs(gt)),ut=gt===0?ce:je/He,De=Math.abs(gt/He)<ye/2?ut:ut+ye,Oe=(0,h.getStepDecimals)(ye);return parseFloat(De.toFixed(Oe))}h.normalizeValue=x;function P(ce,pe,be){return(ce-pe)/(be-pe)}h.relativeValue=P;function F(ce){return ce===p.Direction.Up||ce===p.Direction.Down}h.isVertical=F;function y(ce,pe,be){if(pe>=be)throw new RangeError("min (".concat(pe,") is equal/bigger than max (").concat(be,")"));if(ce<pe)throw new RangeError("value (".concat(ce,") is smaller than min (").concat(pe,")"));if(ce>be)throw new RangeError("value (".concat(ce,") is bigger than max (").concat(be,")"))}h.checkBoundaries=y;function R(ce,pe,be){return ce<pe?pe:ce>be?be:ce}h.checkValuesAgainstBoundaries=R;function $(ce){if(!(ce.length<2)&&!ce.slice(1).every(function(pe,be){return ce[be]<=pe}))throw new RangeError("values={[".concat(ce,"]} needs to be sorted when allowOverlap={false}"))}h.checkInitialOverlap=$;function B(ce){var pe=window.getComputedStyle(ce);return{top:parseInt(pe["margin-top"],10),bottom:parseInt(pe["margin-bottom"],10),left:parseInt(pe["margin-left"],10),right:parseInt(pe["margin-right"],10)}}h.getMargin=B;function V(ce){var pe=window.getComputedStyle(ce);return{top:parseInt(pe["padding-top"],10)+parseInt(pe["border-top-width"],10),bottom:parseInt(pe["padding-bottom"],10)+parseInt(pe["border-bottom-width"],10),left:parseInt(pe["padding-left"],10)+parseInt(pe["border-left-width"],10),right:parseInt(pe["padding-right"],10)+parseInt(pe["border-right-width"],10)}}h.getPaddingAndBorder=V;function ee(ce,pe,be){var ke=be?-1:1;ce.forEach(function(ye,Ce){return z(ye,ke*pe[Ce].x,pe[Ce].y)})}h.translateThumbs=ee;function Z(ce,pe,be,ke){for(var ye=0,Ce=Me(ce[0],pe,be,ke),ze=1;ze<ce.length;ze++){var He=Me(ce[ze],pe,be,ke);He<Ce&&(Ce=He,ye=ze)}return ye}h.getClosestThumbIndex=Z;function z(ce,pe,be){ce.style.transform="translate(".concat(pe,"px, ").concat(be,"px)")}h.translate=z;var re=function(ce){var pe=[],be=null,ke=function(){for(var ye=[],Ce=0;Ce<arguments.length;Ce++)ye[Ce]=arguments[Ce];pe=ye,!be&&(be=requestAnimationFrame(function(){be=null,ce.apply(void 0,pe)}))};return ke};h.schd=re;function X(ce,pe,be){var ke=ce.slice(0);return ke[pe]=be,ke}h.replaceAt=X;function ne(ce){var pe=ce.values,be=ce.colors,ke=ce.min,ye=ce.max,Ce=ce.direction,ze=Ce===void 0?p.Direction.Right:Ce,He=ce.rtl,Ge=He===void 0?!1:He;Ge&&ze===p.Direction.Right?ze=p.Direction.Left:Ge&&p.Direction.Left&&(ze=p.Direction.Right);var qe=pe.slice(0).sort(function(je,ut){return je-ut}).map(function(je){return(je-ke)/(ye-ke)*100}),gt=qe.reduce(function(je,ut,De){return"".concat(je,", ").concat(be[De]," ").concat(ut,"%, ").concat(be[De+1]," ").concat(ut,"%")},"");return"linear-gradient(".concat(ze,", ").concat(be[0]," 0%").concat(gt,", ").concat(be[be.length-1]," 100%)")}h.getTrackBackground=ne;function ie(){}h.voidFn=ie;function ae(ce){throw new Error("Didn't expect to get here")}h.assertUnreachable=ae;var _e=function(ce,pe,be,ke,ye){ye===void 0&&(ye=function(ze){return ze});var Ce=Math.ceil(g([ce],Array.from(ce.children),!0).reduce(function(ze,He){var Ge=Math.ceil(He.getBoundingClientRect().width);if(He.innerText&&He.innerText.includes(be)&&He.childElementCount===0){var qe=He.cloneNode(!0);qe.innerHTML=ye(pe.toFixed(ke)),qe.style.visibility="hidden",document.body.appendChild(qe),Ge=Math.ceil(qe.getBoundingClientRect().width),document.body.removeChild(qe)}return Ge>ze?Ge:ze},ce.getBoundingClientRect().width));return Ce},Se=function(ce,pe,be,ke,ye,Ce,ze){ze===void 0&&(ze=function(qe){return qe});var He=[],Ge=function(qe){var gt=_e(be[qe],ke[qe],ye,Ce,ze),je=pe[qe].x;pe.forEach(function(ut,De){var Oe=ut.x,tt=_e(be[De],ke[De],ye,Ce,ze);qe!==De&&(je>=Oe&&je<=Oe+tt||je+gt>=Oe&&je+gt<=Oe+tt)&&(He.includes(De)||(He.push(qe),He.push(De),He=g(g([],He,!0),[qe,De],!1),Ge(De)))})};return Ge(ce),Array.from(new Set(He.sort()))},Pe=function(ce,pe,be,ke,ye,Ce){ke===void 0&&(ke=.1),ye===void 0&&(ye=" - "),Ce===void 0&&(Ce=function(De){return De});var ze=(0,h.getStepDecimals)(ke),He=(0,l.useState)({}),Ge=He[0],qe=He[1],gt=(0,l.useState)(Ce(pe[be].toFixed(ze))),je=gt[0],ut=gt[1];return(0,l.useEffect)(function(){if(ce){var De=ce.getThumbs();if(De.length<1)return;var Oe={},tt=ce.getOffsets(),ht=Se(be,tt,De,pe,ye,ze,Ce),kt=Ce(pe[be].toFixed(ze));if(ht.length){var Kt=ht.reduce(function(Ne,mt,Fe,Ye){return Ne.length?g(g([],Ne,!0),[tt[Ye[Fe]].x],!1):[tt[Ye[Fe]].x]},[]);if(Math.min.apply(Math,Kt)===tt[be].x){var Ee=[];ht.forEach(function(Ne){Ee.push(pe[Ne].toFixed(ze))}),kt=Array.from(new Set(Ee.sort(function(Ne,mt){return parseFloat(Ne)-parseFloat(mt)}))).map(Ce).join(ye);var yt=Math.min.apply(Math,Kt),on=Math.max.apply(Math,Kt),we=De[ht[Kt.indexOf(on)]].getBoundingClientRect().width;Oe.left="".concat(Math.abs(yt-(on+we))/2,"px"),Oe.transform="translate(-50%, 0)"}else Oe.visibility="hidden"}ut(kt),qe(Oe)}},[ce,pe]),[je,Ge]};h.useThumbOverlap=Pe;function Me(ce,pe,be,ke){var ye=ce.getBoundingClientRect(),Ce=ye.left,ze=ye.top,He=ye.width,Ge=ye.height;return F(ke)?Math.abs(be-(ze+Ge/2)):Math.abs(pe-(Ce+He/2))}var Re=function(){var ce,pe=((ce=navigator.userAgentData)===null||ce===void 0?void 0:ce.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(pe)||navigator.userAgent.includes("Mac")&&"ontouchend"in document};h.isIOS=Re})(uw);var $E=an&&an.__extends||function(){var h=function(g,l){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,_){p.__proto__=_}||function(p,_){for(var w in _)Object.prototype.hasOwnProperty.call(_,w)&&(p[w]=_[w])},h(g,l)};return function(g,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");h(g,l);function p(){this.constructor=g}g.prototype=l===null?Object.create(l):(p.prototype=l.prototype,new p)}}(),HE=an&&an.__createBinding||(Object.create?function(h,g,l,p){p===void 0&&(p=l);var _=Object.getOwnPropertyDescriptor(g,l);(!_||("get"in _?!g.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return g[l]}}),Object.defineProperty(h,p,_)}:function(h,g,l,p){p===void 0&&(p=l),h[p]=g[l]}),UE=an&&an.__setModuleDefault||(Object.create?function(h,g){Object.defineProperty(h,"default",{enumerable:!0,value:g})}:function(h,g){h.default=g}),WE=an&&an.__importStar||function(h){if(h&&h.__esModule)return h;var g={};if(h!=null)for(var l in h)l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)&&HE(g,h,l);return UE(g,h),g},F0=an&&an.__spreadArray||function(h,g,l){if(l||arguments.length===2)for(var p=0,_=g.length,w;p<_;p++)(w||!(p in g))&&(w||(w=Array.prototype.slice.call(g,0,p)),w[p]=g[p]);return h.concat(w||Array.prototype.slice.call(g))};Object.defineProperty(dw,"__esModule",{value:!0});var fg=WE(Y),Et=uw,Fn=wd,qE=["ArrowRight","ArrowUp","k","PageUp"],KE=["ArrowLeft","ArrowDown","j","PageDown"],GE=function(h){$E(g,h);function g(l){var p=h.call(this,l)||this;if(p.trackRef=fg.createRef(),p.thumbRefs=[],p.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(p.props.values.length).fill(0).map(function(_,w){return w}),isChanged:!1,markOffsets:[]},p.getOffsets=function(){var _=p.props,w=_.direction,v=_.values,x=_.min,P=_.max,F=p.trackRef.current;if(!F)return console.warn("No track element found."),[];var y=F.getBoundingClientRect(),R=(0,Et.getPaddingAndBorder)(F);return p.getThumbs().map(function($,B){var V={x:0,y:0},ee=$.getBoundingClientRect(),Z=(0,Et.getMargin)($);switch(w){case Fn.Direction.Right:return V.x=(Z.left+R.left)*-1,V.y=((ee.height-y.height)/2+R.top)*-1,V.x+=y.width*(0,Et.relativeValue)(v[B],x,P)-ee.width/2,V;case Fn.Direction.Left:return V.x=(Z.right+R.right)*-1,V.y=((ee.height-y.height)/2+R.top)*-1,V.x+=y.width-y.width*(0,Et.relativeValue)(v[B],x,P)-ee.width/2,V;case Fn.Direction.Up:return V.x=((ee.width-y.width)/2+Z.left+R.left)*-1,V.y=-R.left,V.y+=y.height-y.height*(0,Et.relativeValue)(v[B],x,P)-ee.height/2,V;case Fn.Direction.Down:return V.x=((ee.width-y.width)/2+Z.left+R.left)*-1,V.y=-R.left,V.y+=y.height*(0,Et.relativeValue)(v[B],x,P)-ee.height/2,V;default:return(0,Et.assertUnreachable)(w)}})},p.getThumbs=function(){return p.trackRef&&p.trackRef.current?Array.from(p.trackRef.current.children).filter(function(_){return _.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},p.getTargetIndex=function(_){return p.getThumbs().findIndex(function(w){return w===_.target||w.contains(_.target)})},p.addTouchEvents=function(_){document.addEventListener("touchmove",p.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",p.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",p.schdOnEnd,{passive:!1})},p.addMouseEvents=function(_){document.addEventListener("mousemove",p.schdOnMouseMove),document.addEventListener("mouseup",p.schdOnEnd)},p.onMouseDownTrack=function(_){var w;if(!(_.button!==0||(0,Et.isIOS)()))if(_.persist(),_.preventDefault(),p.addMouseEvents(_.nativeEvent),p.props.values.length>1&&p.props.draggableTrack){if(p.thumbRefs.some(function(x){var P;return(P=x.current)===null||P===void 0?void 0:P.contains(_.target)}))return;p.setState({draggedTrackPos:[_.clientX,_.clientY]},function(){return p.onMove(_.clientX,_.clientY)})}else{var v=(0,Et.getClosestThumbIndex)(p.thumbRefs.map(function(x){return x.current}),_.clientX,_.clientY,p.props.direction);(w=p.thumbRefs[v].current)===null||w===void 0||w.focus(),p.setState({draggedThumbIndex:v},function(){return p.onMove(_.clientX,_.clientY)})}},p.onResize=function(){(0,Et.translateThumbs)(p.getThumbs(),p.getOffsets(),p.props.rtl),p.calculateMarkOffsets()},p.onTouchStartTrack=function(_){var w;if(_.persist(),p.addTouchEvents(_.nativeEvent),p.props.values.length>1&&p.props.draggableTrack){if(p.thumbRefs.some(function(x){var P;return(P=x.current)===null||P===void 0?void 0:P.contains(_.target)}))return;p.setState({draggedTrackPos:[_.touches[0].clientX,_.touches[0].clientY]},function(){return p.onMove(_.touches[0].clientX,_.touches[0].clientY)})}else{var v=(0,Et.getClosestThumbIndex)(p.thumbRefs.map(function(x){return x.current}),_.touches[0].clientX,_.touches[0].clientY,p.props.direction);(w=p.thumbRefs[v].current)===null||w===void 0||w.focus(),p.setState({draggedThumbIndex:v},function(){return p.onMove(_.touches[0].clientX,_.touches[0].clientY)})}},p.onMouseOrTouchStart=function(_){if(!p.props.disabled){var w=(0,Et.isTouchEvent)(_);if(!(!w&&_.button!==0)){var v=p.getTargetIndex(_);v!==-1&&(w?p.addTouchEvents(_):p.addMouseEvents(_),p.setState({draggedThumbIndex:v,thumbZIndexes:p.state.thumbZIndexes.map(function(x,P){return P===v?Math.max.apply(Math,p.state.thumbZIndexes):x<=p.state.thumbZIndexes[v]?x:x-1})}))}}},p.onMouseMove=function(_){_.preventDefault(),p.onMove(_.clientX,_.clientY)},p.onTouchMove=function(_){_.preventDefault(),p.onMove(_.touches[0].clientX,_.touches[0].clientY)},p.onKeyDown=function(_){var w=p.props,v=w.values,x=w.onChange,P=w.step,F=w.rtl,y=w.direction,R=p.state.isChanged,$=p.getTargetIndex(_.nativeEvent),B=F||y===Fn.Direction.Left||y===Fn.Direction.Down?-1:1;$!==-1&&(qE.includes(_.key)?(_.preventDefault(),p.setState({draggedThumbIndex:$,isChanged:!0}),x((0,Et.replaceAt)(v,$,p.normalizeValue(v[$]+B*(_.key==="PageUp"?P*10:P),$)))):KE.includes(_.key)?(_.preventDefault(),p.setState({draggedThumbIndex:$,isChanged:!0}),x((0,Et.replaceAt)(v,$,p.normalizeValue(v[$]-B*(_.key==="PageDown"?P*10:P),$)))):_.key==="Tab"?p.setState({draggedThumbIndex:-1},function(){R&&p.fireOnFinalChange()}):R&&p.fireOnFinalChange())},p.onKeyUp=function(_){var w=p.state.isChanged;p.setState({draggedThumbIndex:-1},function(){w&&p.fireOnFinalChange()})},p.onMove=function(_,w){var v=p.state,x=v.draggedThumbIndex,P=v.draggedTrackPos,F=p.props,y=F.direction,R=F.min,$=F.max,B=F.onChange,V=F.values,ee=F.step,Z=F.rtl;if(x===-1&&P[0]===-1&&P[1]===-1)return null;var z=p.trackRef.current;if(!z)return null;var re=z.getBoundingClientRect(),X=(0,Et.isVertical)(y)?re.height:re.width;if(P[0]!==-1&&P[1]!==-1){var ne=_-P[0],ie=w-P[1],ae=0;switch(y){case Fn.Direction.Right:case Fn.Direction.Left:ae=ne/X*($-R);break;case Fn.Direction.Down:case Fn.Direction.Up:ae=ie/X*($-R);break;default:(0,Et.assertUnreachable)(y)}if(Z&&(ae*=-1),Math.abs(ae)>=ee/2){for(var _e=0;_e<p.thumbRefs.length;_e++){if(V[_e]===$&&Math.sign(ae)===1||V[_e]===R&&Math.sign(ae)===-1)return;var Se=V[_e]+ae;Se>$?ae=$-V[_e]:Se<R&&(ae=R-V[_e])}for(var Pe=V.slice(0),_e=0;_e<p.thumbRefs.length;_e++)Pe=(0,Et.replaceAt)(Pe,_e,p.normalizeValue(V[_e]+ae,_e));p.setState({draggedTrackPos:[_,w]}),B(Pe)}}else{var Me=0;switch(y){case Fn.Direction.Right:Me=(_-re.left)/X*($-R)+R;break;case Fn.Direction.Left:Me=(X-(_-re.left))/X*($-R)+R;break;case Fn.Direction.Down:Me=(w-re.top)/X*($-R)+R;break;case Fn.Direction.Up:Me=(X-(w-re.top))/X*($-R)+R;break;default:(0,Et.assertUnreachable)(y)}Z&&(Me=$+R-Me),Math.abs(V[x]-Me)>=ee/2&&B((0,Et.replaceAt)(V,x,p.normalizeValue(Me,x)))}},p.normalizeValue=function(_,w){var v=p.props,x=v.min,P=v.max,F=v.step,y=v.allowOverlap,R=v.values;return(0,Et.normalizeValue)(_,w,x,P,F,y,R)},p.onEnd=function(_){if(_.preventDefault(),document.removeEventListener("mousemove",p.schdOnMouseMove),document.removeEventListener("touchmove",p.schdOnTouchMove),document.removeEventListener("mouseup",p.schdOnEnd),document.removeEventListener("touchend",p.schdOnEnd),document.removeEventListener("touchcancel",p.schdOnEnd),p.state.draggedThumbIndex===-1&&p.state.draggedTrackPos[0]===-1&&p.state.draggedTrackPos[1]===-1)return null;p.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){p.fireOnFinalChange()})},p.fireOnFinalChange=function(){p.setState({isChanged:!1});var _=p.props,w=_.onFinalChange,v=_.values;w&&w(v)},p.updateMarkRefs=function(_){if(!_.renderMark){p.numOfMarks=void 0,p.markRefs=void 0;return}p.numOfMarks=(_.max-_.min)/p.props.step,p.markRefs=[];for(var w=0;w<p.numOfMarks+1;w++)p.markRefs[w]=fg.createRef()},p.calculateMarkOffsets=function(){if(!(!p.props.renderMark||!p.trackRef||!p.numOfMarks||!p.markRefs||p.trackRef.current===null)){for(var _=window.getComputedStyle(p.trackRef.current),w=parseInt(_.width,10),v=parseInt(_.height,10),x=parseInt(_.paddingLeft,10),P=parseInt(_.paddingTop,10),F=[],y=0;y<p.numOfMarks+1;y++){var R=9999,$=9999;if(p.markRefs[y].current){var B=p.markRefs[y].current.getBoundingClientRect();R=B.height,$=B.width}p.props.direction===Fn.Direction.Left||p.props.direction===Fn.Direction.Right?F.push([Math.round(w/p.numOfMarks*y+x-$/2),-Math.round((R-v)/2)]):F.push([Math.round(v/p.numOfMarks*y+P-R/2),-Math.round(($-w)/2)])}p.setState({markOffsets:F})}},l.step===0)throw new Error('"step" property should be a positive number');return p.schdOnMouseMove=(0,Et.schd)(p.onMouseMove),p.schdOnTouchMove=(0,Et.schd)(p.onTouchMove),p.schdOnEnd=(0,Et.schd)(p.onEnd),p.thumbRefs=l.values.map(function(){return fg.createRef()}),p.updateMarkRefs(l),p}return g.prototype.componentDidMount=function(){var l=this,p=this.props,_=p.values,w=p.min,v=p.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,Et.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(x){return(0,Et.checkBoundaries)(x,l.props.min,l.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,Et.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),_.forEach(function(x){(0,Et.isStepDivisible)(w,x,v)||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.")})},g.prototype.componentDidUpdate=function(l,p){var _=this.props,w=_.max,v=_.min,x=_.step,P=_.values,F=_.rtl;(l.max!==w||l.min!==v||l.step!==x)&&this.updateMarkRefs(this.props),(0,Et.translateThumbs)(this.getThumbs(),this.getOffsets(),F),(l.max!==w||l.min!==v||l.step!==x||p.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),P.forEach(function(y){(0,Et.isStepDivisible)(v,y,x)||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.")}))},g.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)},g.prototype.render=function(){var l=this,p=this.props,_=p.label,w=p.labelledBy,v=p.renderTrack,x=p.renderThumb,P=p.renderMark,F=P===void 0?function(){return null}:P,y=p.values,R=p.min,$=p.max,B=p.allowOverlap,V=p.disabled,ee=this.state,Z=ee.draggedThumbIndex,z=ee.thumbZIndexes,re=ee.markOffsets;return v({props:{style:{transform:"scale(1)",cursor:Z>-1?"grabbing":this.props.draggableTrack?(0,Et.isVertical)(this.props.direction)?"ns-resize":"ew-resize":y.length===1&&!V?"pointer":"inherit"},onMouseDown:V?Et.voidFn:this.onMouseDownTrack,onTouchStart:V?Et.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:V,children:F0(F0([],re.map(function(X,ne,ie){return F({props:{style:l.props.direction===Fn.Direction.Left||l.props.direction===Fn.Direction.Right?{position:"absolute",left:"".concat(X[0],"px"),marginTop:"".concat(X[1],"px")}:{position:"absolute",top:"".concat(X[0],"px"),marginLeft:"".concat(X[1],"px")},key:"mark".concat(ne),ref:l.markRefs[ne]},index:ne})}),!0),y.map(function(X,ne){var ie=l.state.draggedThumbIndex===ne;return x({index:ne,value:X,isDragged:ie,props:{style:{position:"absolute",zIndex:z[ne],cursor:V?"inherit":ie?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:ne,tabIndex:V?void 0:0,"aria-valuemax":B?$:y[ne+1]||$,"aria-valuemin":B?R:y[ne-1]||R,"aria-valuenow":X,draggable:!1,ref:l.thumbRefs[ne],"aria-label":_,"aria-labelledby":w,role:"slider",onKeyDown:V?Et.voidFn:l.onKeyDown,onKeyUp:V?Et.voidFn:l.onKeyUp}})}),!0)})},g.defaultProps={label:"Accessibility label",labelledBy:null,step:1,direction:Fn.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},g}(fg.Component);dw.default=GE;(function(h){var g=an&&an.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(h,"__esModule",{value:!0}),h.checkValuesAgainstBoundaries=h.relativeValue=h.useThumbOverlap=h.Direction=h.getTrackBackground=h.Range=void 0;var l=g(dw);h.Range=l.default;var p=uw;Object.defineProperty(h,"getTrackBackground",{enumerable:!0,get:function(){return p.getTrackBackground}}),Object.defineProperty(h,"useThumbOverlap",{enumerable:!0,get:function(){return p.useThumbOverlap}}),Object.defineProperty(h,"relativeValue",{enumerable:!0,get:function(){return p.relativeValue}}),Object.defineProperty(h,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return p.checkValuesAgainstBoundaries}});var _=wd;Object.defineProperty(h,"Direction",{enumerable:!0,get:function(){return _.Direction}})})(r1);const YE=1,B0=15,V0=100;function QE({values:h,colors:g,min:l,max:p,direction:_="to right",rtl:w=!1}){w&&_==="to right"?_="to left":w&&(_="to right");const x=h.slice(0).sort((P,F)=>P-F).map(P=>(P-l)/(p-l)*100).reduce((P,F,y)=>`${P}, ${g[y]} ${F}%, ${g[y+1]} ${F}%`,"");return`linear-gradient(${_}, ${g[0]} 0%${x}, ${g[g.length-1]} 100%)`}const JE=({rtl:h,value:g,onChange:l})=>{const[p,_]=Y.useState([15,15]);return Y.useEffect(()=>{g&&_(g)},[g]),A.jsx("div",{style:{display:"flex",justifyContent:"center",flexWrap:"wrap"},children:A.jsx(r1.Range,{values:p,step:YE,min:B0,max:V0,rtl:h,onChange:w=>l(w),renderTrack:({props:w,children:v})=>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:QE({values:p,colors:["#ccc","#548BF4","#ccc"],min:B0,max:V0,rtl:h}),alignSelf:"center"},children:v})}),renderThumb:({index:w,props:v,isDragged:x})=>A.jsxs("div",{...v,style:{...v.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:p[w]}),A.jsx("div",{style:{height:"16px",width:"5px",backgroundColor:x?"#548BF4":"#CCC"}})]})})})};var XE={root:{display:"flex",flexDirection:"column",flexWrap:"wrap"},row:{flexDirection:"row"}},ZE=Y.forwardRef(function(g,l){var p=g.classes,_=g.className,w=g.row,v=w===void 0?!1:w,x=R_(g,["classes","className","row"]);return Y.createElement("div",wg({className:yC(p.root,_,v&&p.row),ref:l},x))});const eP=ny(XE,{name:"MuiFormGroup"})(ZE);var Ag={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 */Ag.exports;(function(h,g){(function(){var l,p="4.17.21",_=200,w="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",v="Expected a function",x="Invalid `variable` option passed into `_.template`",P="__lodash_hash_undefined__",F=500,y="__lodash_placeholder__",R=1,$=2,B=4,V=1,ee=2,Z=1,z=2,re=4,X=8,ne=16,ie=32,ae=64,_e=128,Se=256,Pe=512,Me=30,Re="...",ce=800,pe=16,be=1,ke=2,ye=3,Ce=1/0,ze=9007199254740991,He=17976931348623157e292,Ge=0/0,qe=4294967295,gt=qe-1,je=qe>>>1,ut=[["ary",_e],["bind",Z],["bindKey",z],["curry",X],["curryRight",ne],["flip",Pe],["partial",ie],["partialRight",ae],["rearg",Se]],De="[object Arguments]",Oe="[object Array]",tt="[object AsyncFunction]",ht="[object Boolean]",kt="[object Date]",Kt="[object DOMException]",Ee="[object Error]",yt="[object Function]",on="[object GeneratorFunction]",we="[object Map]",Ne="[object Number]",mt="[object Null]",Fe="[object Object]",Ye="[object Promise]",Vt="[object Proxy]",gn="[object RegExp]",Zt="[object Set]",Vr="[object String]",po="[object Symbol]",fa="[object Undefined]",$n="[object WeakMap]",ws="[object WeakSet]",pi="[object ArrayBuffer]",xr="[object DataView]",go="[object Float32Array]",Qr="[object Float64Array]",mo="[object Int8Array]",bo="[object Int16Array]",vo="[object Int32Array]",en="[object Uint8Array]",Xt="[object Uint8ClampedArray]",un="[object Uint16Array]",ln="[object Uint32Array]",Hn=/\b__p \+= '';/g,mn=/\b(__p \+=) '' \+/g,vt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Zn=/&(?:amp|lt|gt|quot|#39);/g,Tt=/[&<>"']/g,Cr=RegExp(Zn.source),lr=RegExp(Tt.source),cr=/<%-([\s\S]+?)%>/g,El=/<%([\s\S]+?)%>/g,ks=/<%=([\s\S]+?)%>/g,kd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pl=/^\w*$/,yd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ho=/[\\^$.*+?()[\]{}|]/g,xd=RegExp(Ho.source),pa=/^\s+/,Cd=/\s/,Tr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,_o=/\{\n\/\* \[wrapped with (.+)\] \*/,ys=/,? & /,xs=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ui=/[()=,{}\[\]\/\s]/,wo=/\\(\\)?/g,Il=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Cs=/\w*$/,Gt=/^[-+]0x[0-9a-f]+$/i,Wi=/^0b[01]+$/i,Td=/^\[object .+?Constructor\]$/,Sd=/^0o[0-7]+$/i,Ml=/^(?:0|[1-9]\d*)$/,qi=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Be=/($^)/,ve=/['\n\r\u2028\u2029\\]/g,ko="\\ud800-\\udfff",at="\\u0300-\\u036f",Ol="\\ufe20-\\ufe2f",ga="\\u20d0-\\u20ff",yo=at+Ol+ga,Ts="\\u2700-\\u27bf",Nl="a-z\\xdf-\\xf6\\xf8-\\xff",Rl="\\xac\\xb1\\xd7\\xf7",ma="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ad="\\u2000-\\u206f",Ed=" \\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",er="A-Z\\xc0-\\xd6\\xd8-\\xde",Ss="\\ufe0e\\ufe0f",Uo=Rl+ma+Ad+Ed,As="['’]",Dl="["+ko+"]",ba="["+Uo+"]",Wo="["+yo+"]",jl="\\d+",xo="["+Ts+"]",qo="["+Nl+"]",Ll="[^"+ko+Uo+jl+Ts+Nl+er+"]",Es="\\ud83c[\\udffb-\\udfff]",Yt="(?:"+Wo+"|"+Es+")",zl="[^"+ko+"]",Jr="(?:\\ud83c[\\udde6-\\uddff]){2}",gi="[\\ud800-\\udbff][\\udc00-\\udfff]",$r="["+er+"]",Ps="\\u200d",Ki="(?:"+qo+"|"+Ll+")",Fl="(?:"+$r+"|"+Ll+")",Bl="(?:"+As+"(?:d|ll|m|re|s|t|ve))?",Vl="(?:"+As+"(?:D|LL|M|RE|S|T|VE))?",va=Yt+"?",Gi="["+Ss+"]?",Is="(?:"+Ps+"(?:"+[zl,Jr,gi].join("|")+")"+Gi+va+")*",$l="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ko=Gi+va+Is,Id="(?:"+[xo,Jr,gi].join("|")+")"+Ko,Hl="(?:"+[zl+Wo+"?",Wo,Jr,gi,Dl].join("|")+")",_a=RegExp(As,"g"),Md=RegExp(Wo,"g"),mi=RegExp(Es+"(?="+Es+")|"+Hl+Ko,"g"),Ms=RegExp([$r+"?"+qo+"+"+Bl+"(?="+[ba,$r,"$"].join("|")+")",Fl+"+"+Vl+"(?="+[ba,$r+Ki,"$"].join("|")+")",$r+"?"+Ki+"+"+Bl,$r+"+"+Vl,Pd,$l,jl,Id].join("|"),"g"),Od=RegExp("["+Ps+ko+yo+Ss+"]"),bi=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Go=["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"],Ul=-1,$t={};$t[go]=$t[Qr]=$t[mo]=$t[bo]=$t[vo]=$t[en]=$t[Xt]=$t[un]=$t[ln]=!0,$t[De]=$t[Oe]=$t[pi]=$t[ht]=$t[xr]=$t[kt]=$t[Ee]=$t[yt]=$t[we]=$t[Ne]=$t[Fe]=$t[gn]=$t[Zt]=$t[Vr]=$t[$n]=!1;var Lt={};Lt[De]=Lt[Oe]=Lt[pi]=Lt[xr]=Lt[ht]=Lt[kt]=Lt[go]=Lt[Qr]=Lt[mo]=Lt[bo]=Lt[vo]=Lt[we]=Lt[Ne]=Lt[Fe]=Lt[gn]=Lt[Zt]=Lt[Vr]=Lt[po]=Lt[en]=Lt[Xt]=Lt[un]=Lt[ln]=!0,Lt[Ee]=Lt[yt]=Lt[$n]=!1;var Wl={À:"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"},wa={"&":"&","<":"<",">":">",'"':""","'":"'"},Nd={"&":"&","<":"<",">":">",""":'"',"'":"'"},Rd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ka=parseFloat,ql=parseInt,ya=typeof an=="object"&&an&&an.Object===Object&&an,Os=typeof self=="object"&&self&&self.Object===Object&&self,yn=ya||Os||Function("return this")(),Yo=g&&!g.nodeType&&g,Sr=Yo&&!0&&h&&!h.nodeType&&h,xa=Sr&&Sr.exports===Yo,Ns=xa&&ya.process,Un=function(){try{var K=Sr&&Sr.require&&Sr.require("util").types;return K||Ns&&Ns.binding&&Ns.binding("util")}catch{}}(),Kl=Un&&Un.isArrayBuffer,Ca=Un&&Un.isDate,Co=Un&&Un.isMap,Rs=Un&&Un.isRegExp,To=Un&&Un.isSet,So=Un&&Un.isTypedArray;function Tn(K,se,Q){switch(Q.length){case 0:return K.call(se);case 1:return K.call(se,Q[0]);case 2:return K.call(se,Q[0],Q[1]);case 3:return K.call(se,Q[0],Q[1],Q[2])}return K.apply(se,Q)}function Ds(K,se,Q,Ie){for(var Xe=-1,St=K==null?0:K.length;++Xe<St;){var fn=K[Xe];se(Ie,fn,Q(fn),K)}return Ie}function tr(K,se){for(var Q=-1,Ie=K==null?0:K.length;++Q<Ie&&se(K[Q],Q,K)!==!1;);return K}function Gl(K,se){for(var Q=K==null?0:K.length;Q--&&se(K[Q],Q,K)!==!1;);return K}function Ta(K,se){for(var Q=-1,Ie=K==null?0:K.length;++Q<Ie;)if(!se(K[Q],Q,K))return!1;return!0}function vi(K,se){for(var Q=-1,Ie=K==null?0:K.length,Xe=0,St=[];++Q<Ie;){var fn=K[Q];se(fn,Q,K)&&(St[Xe++]=fn)}return St}function js(K,se){var Q=K==null?0:K.length;return!!Q&&Eo(K,se,0)>-1}function Xr(K,se,Q){for(var Ie=-1,Xe=K==null?0:K.length;++Ie<Xe;)if(Q(se,K[Ie]))return!0;return!1}function Ot(K,se){for(var Q=-1,Ie=K==null?0:K.length,Xe=Array(Ie);++Q<Ie;)Xe[Q]=se(K[Q],Q,K);return Xe}function _i(K,se){for(var Q=-1,Ie=se.length,Xe=K.length;++Q<Ie;)K[Xe+Q]=se[Q];return K}function Zr(K,se,Q,Ie){var Xe=-1,St=K==null?0:K.length;for(Ie&&St&&(Q=K[++Xe]);++Xe<St;)Q=se(Q,K[Xe],Xe,K);return Q}function Ao(K,se,Q,Ie){var Xe=K==null?0:K.length;for(Ie&&Xe&&(Q=K[--Xe]);Xe--;)Q=se(Q,K[Xe],Xe,K);return Q}function Qo(K,se){for(var Q=-1,Ie=K==null?0:K.length;++Q<Ie;)if(se(K[Q],Q,K))return!0;return!1}var Dd=Ma("length");function Yl(K){return K.split("")}function Sa(K){return K.match(xs)||[]}function Aa(K,se,Q){var Ie;return Q(K,function(Xe,St,fn){if(se(Xe,St,fn))return Ie=St,!1}),Ie}function Jo(K,se,Q,Ie){for(var Xe=K.length,St=Q+(Ie?1:-1);Ie?St--:++St<Xe;)if(se(K[St],St,K))return St;return-1}function Eo(K,se,Q){return se===se?ja(K,se,Q):Jo(K,Pa,Q)}function Ea(K,se,Q,Ie){for(var Xe=Q-1,St=K.length;++Xe<St;)if(Ie(K[Xe],se))return Xe;return-1}function Pa(K){return K!==K}function Ia(K,se){var Q=K==null?0:K.length;return Q?Oa(K,se)/Q:Ge}function Ma(K){return function(se){return se==null?l:se[K]}}function Ls(K){return function(se){return K==null?l:K[se]}}function Ql(K,se,Q,Ie,Xe){return Xe(K,function(St,fn,Nt){Q=Ie?(Ie=!1,St):se(Q,St,fn,Nt)}),Q}function Jl(K,se){var Q=K.length;for(K.sort(se);Q--;)K[Q]=K[Q].value;return K}function Oa(K,se){for(var Q,Ie=-1,Xe=K.length;++Ie<Xe;){var St=se(K[Ie]);St!==l&&(Q=Q===l?St:Q+St)}return Q}function Na(K,se){for(var Q=-1,Ie=Array(K);++Q<K;)Ie[Q]=se(Q);return Ie}function Xl(K,se){return Ot(se,function(Q){return[Q,K[Q]]})}function Zl(K){return K&&K.slice(0,Ar(K)+1).replace(pa,"")}function lt(K){return function(se){return K(se)}}function Xo(K,se){return Ot(se,function(Q){return K[Q]})}function Po(K,se){return K.has(se)}function ei(K,se){for(var Q=-1,Ie=K.length;++Q<Ie&&Eo(se,K[Q],0)>-1;);return Q}function Ra(K,se){for(var Q=K.length;Q--&&Eo(se,K[Q],0)>-1;);return Q}function ec(K,se){for(var Q=K.length,Ie=0;Q--;)K[Q]===se&&++Ie;return Ie}var jd=Ls(Wl),dr=Ls(wa);function ur(K){return"\\"+Rd[K]}function Da(K,se){return K==null?l:K[se]}function Pt(K){return Od.test(K)}function Ld(K){return bi.test(K)}function zd(K){for(var se,Q=[];!(se=K.next()).done;)Q.push(se.value);return Q}function Zo(K){var se=-1,Q=Array(K.size);return K.forEach(function(Ie,Xe){Q[++se]=[Xe,Ie]}),Q}function tc(K,se){return function(Q){return K(se(Q))}}function wi(K,se){for(var Q=-1,Ie=K.length,Xe=0,St=[];++Q<Ie;){var fn=K[Q];(fn===se||fn===y)&&(K[Q]=y,St[Xe++]=Q)}return St}function ki(K){var se=-1,Q=Array(K.size);return K.forEach(function(Ie){Q[++se]=Ie}),Q}function Sn(K){var se=-1,Q=Array(K.size);return K.forEach(function(Ie){Q[++se]=[Ie,Ie]}),Q}function ja(K,se,Q){for(var Ie=Q-1,Xe=K.length;++Ie<Xe;)if(K[Ie]===se)return Ie;return-1}function Yi(K,se,Q){for(var Ie=Q+1;Ie--;)if(K[Ie]===se)return Ie;return Ie}function xt(K){return Pt(K)?nc(K):Dd(K)}function hn(K){return Pt(K)?La(K):Yl(K)}function Ar(K){for(var se=K.length;se--&&Cd.test(K.charAt(se)););return se}var Hr=Ls(Nd);function nc(K){for(var se=mi.lastIndex=0;mi.test(K);)++se;return se}function La(K){return K.match(mi)||[]}function zs(K){return K.match(Ms)||[]}var rc=function K(se){se=se==null?yn:Qi.defaults(yn.Object(),se,Qi.pick(yn,Go));var Q=se.Array,Ie=se.Date,Xe=se.Error,St=se.Function,fn=se.Math,Nt=se.Object,Fs=se.RegExp,Fd=se.String,In=se.TypeError,Io=Q.prototype,Bd=St.prototype,yi=Nt.prototype,es=se["__core-js_shared__"],Ji=Bd.toString,It=yi.hasOwnProperty,ic=0,za=function(){var s=/[^.]+$/.exec(es&&es.keys&&es.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),xi=yi.toString,bn=Ji.call(Nt),ts=yn._,oc=Fs("^"+Ji.call(It).replace(Ho,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Mo=xa?se.Buffer:l,ti=se.Symbol,ns=se.Uint8Array,Bs=Mo?Mo.allocUnsafe:l,Xi=tc(Nt.getPrototypeOf,Nt),Ci=Nt.create,sc=yi.propertyIsEnumerable,I=Io.splice,M=ti?ti.isConcatSpreadable:l,H=ti?ti.iterator:l,te=ti?ti.toStringTag:l,Te=function(){try{var s=Or(Nt,"defineProperty");return s({},"",{}),s}catch{}}(),Qe=se.clearTimeout!==yn.clearTimeout&&se.clearTimeout,Je=Ie&&Ie.now!==yn.Date.now&&Ie.now,nt=se.setTimeout!==yn.setTimeout&&se.setTimeout,zt=fn.ceil,Ht=fn.floor,Oo=Nt.getOwnPropertySymbols,nr=Mo?Mo.isBuffer:l,me=se.isFinite,$e=Io.join,Ti=tc(Nt.keys,Nt),Ft=fn.max,ft=fn.min,hr=Ie.now,An=se.parseInt,fr=fn.random,Zi=Io.reverse,rs=Or(se,"DataView"),Si=Or(se,"Map"),ac=Or(se,"Promise"),No=Or(se,"Set"),eo=Or(se,"WeakMap"),Ai=Or(Nt,"create"),lc=eo&&new eo,Ro={},Oh=Bo(rs),tm=Bo(Si),Fa=Bo(ac),xn=Bo(No),nm=Bo(eo),cc=ti?ti.prototype:l,it=cc?cc.valueOf:l,Nh=cc?cc.toString:l;function N(s){if(rn(s)&&!Ze(s)&&!(s instanceof bt)){if(s instanceof Er)return s;if(It.call(s,"__wrapped__"))return bf(s)}return new Er(s)}var Do=function(){function s(){}return function(d){if(!et(d))return{};if(Ci)return Ci(d);s.prototype=d;var m=new s;return s.prototype=l,m}}();function Ba(){}function Er(s,d){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!d,this.__index__=0,this.__values__=l}N.templateSettings={escape:cr,evaluate:El,interpolate:ks,variable:"",imports:{_:N}},N.prototype=Ba.prototype,N.prototype.constructor=N,Er.prototype=Do(Ba.prototype),Er.prototype.constructor=Er;function bt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=qe,this.__views__=[]}function Vd(){var s=new bt(this.__wrapped__);return s.__actions__=mr(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=mr(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=mr(this.__views__),s}function rm(){if(this.__filtered__){var s=new bt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function im(){var s=this.__wrapped__.value(),d=this.__dir__,m=Ze(s),C=d<0,E=m?s.length:0,j=ym(0,E,this.__views__),U=j.start,q=j.end,G=q-U,ue=C?q:U-1,he=this.__iteratees__,ge=he.length,Ae=0,Le=ft(G,this.__takeCount__);if(!m||!C&&E==G&&Le==G)return ri(s,this.__actions__);var Ke=[];e:for(;G--&&Ae<Le;){ue+=d;for(var dt=-1,We=s[ue];++dt<ge;){var pt=he[dt],_t=pt.iteratee,vr=pt.type,Kn=_t(We);if(vr==ke)We=Kn;else if(!Kn){if(vr==be)continue e;break e}}Ke[Ae++]=We}return Ke}bt.prototype=Do(Ba.prototype),bt.prototype.constructor=bt;function jo(s){var d=-1,m=s==null?0:s.length;for(this.clear();++d<m;){var C=s[d];this.set(C[0],C[1])}}function om(){this.__data__=Ai?Ai(null):{},this.size=0}function is(s){var d=this.has(s)&&delete this.__data__[s];return this.size-=d?1:0,d}function Rh(s){var d=this.__data__;if(Ai){var m=d[s];return m===P?l:m}return It.call(d,s)?d[s]:l}function $d(s){var d=this.__data__;return Ai?d[s]!==l:It.call(d,s)}function sm(s,d){var m=this.__data__;return this.size+=this.has(s)?0:1,m[s]=Ai&&d===l?P:d,this}jo.prototype.clear=om,jo.prototype.delete=is,jo.prototype.get=Rh,jo.prototype.has=$d,jo.prototype.set=sm;function Ei(s){var d=-1,m=s==null?0:s.length;for(this.clear();++d<m;){var C=s[d];this.set(C[0],C[1])}}function Hd(){this.__data__=[],this.size=0}function Dh(s){var d=this.__data__,m=Ut(d,s);if(m<0)return!1;var C=d.length-1;return m==C?d.pop():I.call(d,m,1),--this.size,!0}function am(s){var d=this.__data__,m=Ut(d,s);return m<0?l:d[m][1]}function Ud(s){return Ut(this.__data__,s)>-1}function Va(s,d){var m=this.__data__,C=Ut(m,s);return C<0?(++this.size,m.push([s,d])):m[C][1]=d,this}Ei.prototype.clear=Hd,Ei.prototype.delete=Dh,Ei.prototype.get=am,Ei.prototype.has=Ud,Ei.prototype.set=Va;function Pi(s){var d=-1,m=s==null?0:s.length;for(this.clear();++d<m;){var C=s[d];this.set(C[0],C[1])}}function Mn(){this.size=0,this.__data__={hash:new jo,map:new(Si||Ei),string:new jo}}function jh(s){var d=Pc(this,s).delete(s);return this.size-=d?1:0,d}function Lh(s){return Pc(this,s).get(s)}function zh(s){return Pc(this,s).has(s)}function dc(s,d){var m=Pc(this,s),C=m.size;return m.set(s,d),this.size+=m.size==C?0:1,this}Pi.prototype.clear=Mn,Pi.prototype.delete=jh,Pi.prototype.get=Lh,Pi.prototype.has=zh,Pi.prototype.set=dc;function Cn(s){var d=-1,m=s==null?0:s.length;for(this.__data__=new Pi;++d<m;)this.add(s[d])}function uc(s){return this.__data__.set(s,P),this}function Wd(s){return this.__data__.has(s)}Cn.prototype.add=Cn.prototype.push=uc,Cn.prototype.has=Wd;function ni(s){var d=this.__data__=new Ei(s);this.size=d.size}function Fh(){this.__data__=new Ei,this.size=0}function Bh(s){var d=this.__data__,m=d.delete(s);return this.size=d.size,m}function Vh(s){return this.__data__.get(s)}function Lo(s){return this.__data__.has(s)}function $h(s,d){var m=this.__data__;if(m instanceof Ei){var C=m.__data__;if(!Si||C.length<_-1)return C.push([s,d]),this.size=++m.size,this;m=this.__data__=new Pi(C)}return m.set(s,d),this.size=m.size,this}ni.prototype.clear=Fh,ni.prototype.delete=Bh,ni.prototype.get=Vh,ni.prototype.has=Lo,ni.prototype.set=$h;function qd(s,d){var m=Ze(s),C=!m&&fs(s),E=!m&&!C&&lo(s),j=!m&&!C&&!E&&ea(s),U=m||C||E||j,q=U?Na(s.length,Fd):[],G=q.length;for(var ue in s)(d||It.call(s,ue))&&!(U&&(ue=="length"||E&&(ue=="offset"||ue=="parent")||j&&(ue=="buffer"||ue=="byteLength"||ue=="byteOffset")||Rn(ue,G)))&&q.push(ue);return q}function os(s){var d=s.length;return d?s[bc(0,d-1)]:l}function Hh(s,d){return jc(mr(s),Ii(d,0,s.length))}function Uh(s){return jc(mr(s))}function hc(s,d,m){(m!==l&&!ai(s[d],m)||m===l&&!(d in s))&&to(s,d,m)}function $a(s,d,m){var C=s[d];(!(It.call(s,d)&&ai(C,m))||m===l&&!(d in s))&&to(s,d,m)}function Ut(s,d){for(var m=s.length;m--;)if(ai(s[m][0],d))return m;return-1}function Kd(s,d,m,C){return no(s,function(E,j,U){d(C,E,m(E),U)}),C}function Gd(s,d){return s&&oi(d,_n(d),s)}function lm(s,d){return s&&oi(d,Ln(d),s)}function to(s,d,m){d=="__proto__"&&Te?Te(s,d,{configurable:!0,enumerable:!0,value:m,writable:!0}):s[d]=m}function Yd(s,d){for(var m=-1,C=d.length,E=Q(C),j=s==null;++m<C;)E[m]=j?l:Gc(s,d[m]);return E}function Ii(s,d,m){return s===s&&(m!==l&&(s=s<=m?s:m),d!==l&&(s=s>=d?s:d)),s}function Pr(s,d,m,C,E,j){var U,q=d&R,G=d&$,ue=d&B;if(m&&(U=E?m(s,C,E,j):m(s)),U!==l)return U;if(!et(s))return s;var he=Ze(s);if(he){if(U=Cm(s),!q)return mr(s,U)}else{var ge=Nn(s),Ae=ge==yt||ge==on;if(lo(s))return oe(s,q);if(ge==Fe||ge==De||Ae&&!E){if(U=G||Ae?{}:Ic(s),!q)return G?Di(s,lm(U,s)):hu(s,Gd(U,s))}else{if(!Lt[ge])return E?s:{};U=mf(s,ge,q)}}j||(j=new ni);var Le=j.get(s);if(Le)return Le;j.set(s,U),qu(s)?s.forEach(function(We){U.add(Pr(We,d,m,We,s,j))}):vp(s)&&s.forEach(function(We,pt){U.set(pt,Pr(We,d,m,pt,s,j))});var Ke=ue?G?_u:vu:G?Ln:_n,dt=he?l:Ke(s);return tr(dt||s,function(We,pt){dt&&(pt=We,We=s[pt]),$a(U,pt,Pr(We,d,m,pt,s,j))}),U}function Wh(s){var d=_n(s);return function(m){return Ha(m,s,d)}}function Ha(s,d,m){var C=m.length;if(s==null)return!C;for(s=Nt(s);C--;){var E=m[C],j=d[E],U=s[E];if(U===l&&!(E in s)||!j(U))return!1}return!0}function ss(s,d,m){if(typeof s!="function")throw new In(v);return sl(function(){s.apply(l,m)},d)}function as(s,d,m,C){var E=-1,j=js,U=!0,q=s.length,G=[],ue=d.length;if(!q)return G;m&&(d=Ot(d,lt(m))),C?(j=Xr,U=!1):d.length>=_&&(j=Po,U=!1,d=new Cn(d));e:for(;++E<q;){var he=s[E],ge=m==null?he:m(he);if(he=C||he!==0?he:0,U&&ge===ge){for(var Ae=ue;Ae--;)if(d[Ae]===ge)continue e;G.push(he)}else j(d,ge,C)||G.push(he)}return G}var no=Wr(Oi),Mi=Wr(Xd,!0);function cm(s,d){var m=!0;return no(s,function(C,E,j){return m=!!d(C,E,j),m}),m}function fc(s,d,m){for(var C=-1,E=s.length;++C<E;){var j=s[C],U=d(j);if(U!=null&&(q===l?U===U&&!jr(U):m(U,q)))var q=U,G=j}return G}function pc(s,d,m,C){var E=s.length;for(m=rt(m),m<0&&(m=-m>E?0:E+m),C=C===l||C>E?E:rt(C),C<0&&(C+=E),C=m>C?0:Gu(C);m<C;)s[m++]=d;return s}function qh(s,d){var m=[];return no(s,function(C,E,j){d(C,E,j)&&m.push(C)}),m}function On(s,d,m,C,E){var j=-1,U=s.length;for(m||(m=qr),E||(E=[]);++j<U;){var q=s[j];d>0&&m(q)?d>1?On(q,d-1,m,C,E):_i(E,q):C||(E[E.length]=q)}return E}var Qd=lf(),Jd=lf(!0);function Oi(s,d){return s&&Qd(s,d,_n)}function Xd(s,d){return s&&Jd(s,d,_n)}function Ua(s,d){return vi(d,function(m){return li(s[m])})}function ro(s,d){d=fe(d,s);for(var m=0,C=d.length;s!=null&&m<C;)s=s[zi(d[m++])];return m&&m==C?s:l}function Kh(s,d,m){var C=d(s);return Ze(s)?C:_i(C,m(s))}function rr(s){return s==null?s===l?fa:mt:te&&te in Nt(s)?km(s):br(s)}function Zd(s,d){return s>d}function Gh(s,d){return s!=null&&It.call(s,d)}function dm(s,d){return s!=null&&d in Nt(s)}function Yh(s,d,m){return s>=ft(d,m)&&s<Ft(d,m)}function eu(s,d,m){for(var C=m?Xr:js,E=s[0].length,j=s.length,U=j,q=Q(j),G=1/0,ue=[];U--;){var he=s[U];U&&d&&(he=Ot(he,lt(d))),G=ft(he.length,G),q[U]=!m&&(d||E>=120&&he.length>=120)?new Cn(U&&he):l}he=s[0];var ge=-1,Ae=q[0];e:for(;++ge<E&&ue.length<G;){var Le=he[ge],Ke=d?d(Le):Le;if(Le=m||Le!==0?Le:0,!(Ae?Po(Ae,Ke):C(ue,Ke,m))){for(U=j;--U;){var dt=q[U];if(!(dt?Po(dt,Ke):C(s[U],Ke,m)))continue e}Ae&&Ae.push(Ke),ue.push(Le)}}return ue}function Qh(s,d,m,C){return Oi(s,function(E,j,U){d(C,m(E),j,U)}),C}function ls(s,d,m){d=fe(d,s),s=Li(s,d);var C=s==null?s:s[zi(Nr(d))];return C==null?l:Tn(C,s,m)}function io(s){return rn(s)&&rr(s)==De}function um(s){return rn(s)&&rr(s)==pi}function tu(s){return rn(s)&&rr(s)==kt}function Wa(s,d,m,C,E){return s===d?!0:s==null||d==null||!rn(s)&&!rn(d)?s!==s&&d!==d:hm(s,d,m,C,Wa,E)}function hm(s,d,m,C,E,j){var U=Ze(s),q=Ze(d),G=U?Oe:Nn(s),ue=q?Oe:Nn(d);G=G==De?Fe:G,ue=ue==De?Fe:ue;var he=G==Fe,ge=ue==Fe,Ae=G==ue;if(Ae&&lo(s)){if(!lo(d))return!1;U=!0,he=!1}if(Ae&&!he)return j||(j=new ni),U||ea(s)?pf(s,d,m,C,E,j):gf(s,d,G,m,C,E,j);if(!(m&V)){var Le=he&&It.call(s,"__wrapped__"),Ke=ge&&It.call(d,"__wrapped__");if(Le||Ke){var dt=Le?s.value():s,We=Ke?d.value():d;return j||(j=new ni),E(dt,We,m,C,j)}}return Ae?(j||(j=new ni),cs(s,d,m,C,E,j)):!1}function fm(s){return rn(s)&&Nn(s)==we}function nu(s,d,m,C){var E=m.length,j=E,U=!C;if(s==null)return!j;for(s=Nt(s);E--;){var q=m[E];if(U&&q[2]?q[1]!==s[q[0]]:!(q[0]in s))return!1}for(;++E<j;){q=m[E];var G=q[0],ue=s[G],he=q[1];if(U&&q[2]){if(ue===l&&!(G in s))return!1}else{var ge=new ni;if(C)var Ae=C(ue,he,G,s,d,ge);if(!(Ae===l?Wa(he,ue,V|ee,C,ge):Ae))return!1}}return!0}function Jh(s){if(!et(s)||il(s))return!1;var d=li(s)?oc:Td;return d.test(Bo(s))}function pm(s){return rn(s)&&rr(s)==gn}function gm(s){return rn(s)&&Nn(s)==Zt}function mm(s){return rn(s)&&gs(s.length)&&!!$t[rr(s)]}function ru(s){return typeof s=="function"?s:s==null?sr:typeof s=="object"?Ze(s)?ef(s[0],s[1]):Zh(s):oh(s)}function iu(s){if(!Ws(s))return Ti(s);var d=[];for(var m in Nt(s))It.call(s,m)&&m!="constructor"&&d.push(m);return d}function bm(s){if(!et(s))return En(s);var d=Ws(s),m=[];for(var C in s)C=="constructor"&&(d||!It.call(s,C))||m.push(C);return m}function qa(s,d){return s<d}function Xh(s,d){var m=-1,C=sn(s)?Q(s.length):[];return no(s,function(E,j,U){C[++m]=d(E,j,U)}),C}function Zh(s){var d=ku(s);return d.length==1&&d[0][2]?cn(d[0][0],d[0][1]):function(m){return m===s||nu(m,s,d)}}function ef(s,d){return Oc(s)&&Tu(d)?cn(zi(s),d):function(m){var C=Gc(m,s);return C===l&&C===d?Yc(m,s):Wa(d,C,V|ee)}}function gc(s,d,m,C,E){s!==d&&Qd(d,function(j,U){if(E||(E=new ni),et(j))vm(s,d,U,m,gc,C,E);else{var q=C?C(Wt(s,U),j,U+"",s,d,E):l;q===l&&(q=j),hc(s,U,q)}},Ln)}function vm(s,d,m,C,E,j,U){var q=Wt(s,m),G=Wt(d,m),ue=U.get(G);if(ue){hc(s,m,ue);return}var he=j?j(q,G,m+"",s,d,U):l,ge=he===l;if(ge){var Ae=Ze(G),Le=!Ae&&lo(G),Ke=!Ae&&!Le&&ea(G);he=G,Ae||Le||Ke?Ze(q)?he=q:dn(q)?he=mr(q):Le?(ge=!1,he=oe(G,!0)):Ke?(ge=!1,he=af(G,!0)):he=[]:Fi(G)||fs(G)?(he=q,fs(q)?he=Yu(q):(!et(q)||li(q))&&(he=Ic(G))):ge=!1}ge&&(U.set(G,he),E(he,G,C,j,U),U.delete(G)),hc(s,m,he)}function tf(s,d){var m=s.length;if(m)return d+=d<0?m:0,Rn(d,m)?s[d]:l}function ou(s,d,m){d.length?d=Ot(d,function(j){return Ze(j)?function(U){return ro(U,j.length===1?j[0]:j)}:j}):d=[sr];var C=-1;d=Ot(d,lt(Ue()));var E=Xh(s,function(j,U,q){var G=Ot(d,function(ue){return ue(j)});return{criteria:G,index:++C,value:j}});return Jl(E,function(j,U){return wm(j,U,m)})}function mc(s,d){return su(s,d,function(m,C){return Yc(s,C)})}function su(s,d,m){for(var C=-1,E=d.length,j={};++C<E;){var U=d[C],q=ro(s,U);m(q,U)&&Ir(j,fe(U,s),q)}return j}function nf(s){return function(d){return ro(d,s)}}function At(s,d,m,C){var E=C?Ea:Eo,j=-1,U=d.length,q=s;for(s===d&&(d=mr(d)),m&&(q=Ot(s,lt(m)));++j<U;)for(var G=0,ue=d[j],he=m?m(ue):ue;(G=E(q,he,G,C))>-1;)q!==s&&I.call(q,G,1),I.call(s,G,1);return s}function Ka(s,d){for(var m=s?d.length:0,C=m-1;m--;){var E=d[m];if(m==C||E!==j){var j=E;Rn(E)?I.call(s,E,1):kc(s,E)}}return s}function bc(s,d){return s+Ht(fr()*(d-s+1))}function tn(s,d,m,C){for(var E=-1,j=Ft(zt((d-s)/(m||1)),0),U=Q(j);j--;)U[C?j:++E]=s,s+=m;return U}function vc(s,d){var m="";if(!s||d<1||d>ze)return m;do d%2&&(m+=s),d=Ht(d/2),d&&(s+=s);while(d);return m}function ot(s,d){return Dc(or(s,d,sr),s+"")}function pr(s){return os(ra(s))}function Ur(s,d){var m=ra(s);return jc(m,Ii(d,0,m.length))}function Ir(s,d,m,C){if(!et(s))return s;d=fe(d,s);for(var E=-1,j=d.length,U=j-1,q=s;q!=null&&++E<j;){var G=zi(d[E]),ue=m;if(G==="__proto__"||G==="constructor"||G==="prototype")return s;if(E!=U){var he=q[G];ue=C?C(he,G,q):l,ue===l&&(ue=et(he)?he:Rn(d[E+1])?[]:{})}$a(q,G,ue),q=q[G]}return s}var rf=lc?function(s,d){return lc.set(s,d),s}:sr,of=Te?function(s,d){return Te(s,"toString",{configurable:!0,enumerable:!1,value:Zc(d),writable:!0})}:sr;function _m(s){return jc(ra(s))}function Mr(s,d,m){var C=-1,E=s.length;d<0&&(d=-d>E?0:E+d),m=m>E?E:m,m<0&&(m+=E),E=d>m?0:m-d>>>0,d>>>=0;for(var j=Q(E);++C<E;)j[C]=s[C+d];return j}function sf(s,d){var m;return no(s,function(C,E,j){return m=d(C,E,j),!m}),!!m}function Ga(s,d,m){var C=0,E=s==null?C:s.length;if(typeof d=="number"&&d===d&&E<=je){for(;C<E;){var j=C+E>>>1,U=s[j];U!==null&&!jr(U)&&(m?U<=d:U<d)?C=j+1:E=j}return E}return _c(s,d,sr,m)}function _c(s,d,m,C){var E=0,j=s==null?0:s.length;if(j===0)return 0;d=m(d);for(var U=d!==d,q=d===null,G=jr(d),ue=d===l;E<j;){var he=Ht((E+j)/2),ge=m(s[he]),Ae=ge!==l,Le=ge===null,Ke=ge===ge,dt=jr(ge);if(U)var We=C||Ke;else ue?We=Ke&&(C||Ae):q?We=Ke&&Ae&&(C||!Le):G?We=Ke&&Ae&&!Le&&(C||!dt):Le||dt?We=!1:We=C?ge<=d:ge<d;We?E=he+1:j=he}return ft(j,gt)}function au(s,d){for(var m=-1,C=s.length,E=0,j=[];++m<C;){var U=s[m],q=d?d(U):U;if(!m||!ai(q,G)){var G=q;j[E++]=U===0?0:U}}return j}function wc(s){return typeof s=="number"?s:jr(s)?Ge:+s}function gr(s){if(typeof s=="string")return s;if(Ze(s))return Ot(s,gr)+"";if(jr(s))return Nh?Nh.call(s):"";var d=s+"";return d=="0"&&1/s==-Ce?"-0":d}function oo(s,d,m){var C=-1,E=js,j=s.length,U=!0,q=[],G=q;if(m)U=!1,E=Xr;else if(j>=_){var ue=d?null:hf(s);if(ue)return ki(ue);U=!1,E=Po,G=new Cn}else G=d?[]:q;e:for(;++C<j;){var he=s[C],ge=d?d(he):he;if(he=m||he!==0?he:0,U&&ge===ge){for(var Ae=G.length;Ae--;)if(G[Ae]===ge)continue e;d&&G.push(ge),q.push(he)}else E(G,ge,m)||(G!==q&&G.push(ge),q.push(he))}return q}function kc(s,d){return d=fe(d,s),s=Li(s,d),s==null||delete s[zi(Nr(d))]}function zo(s,d,m,C){return Ir(s,d,m(ro(s,d)),C)}function Rt(s,d,m,C){for(var E=s.length,j=C?E:-1;(C?j--:++j<E)&&d(s[j],j,s););return m?Mr(s,C?0:j,C?j+1:E):Mr(s,C?j+1:0,C?E:j)}function ri(s,d){var m=s;return m instanceof bt&&(m=m.value()),Zr(d,function(C,E){return E.func.apply(E.thisArg,_i([C],E.args))},m)}function Fo(s,d,m){var C=s.length;if(C<2)return C?oo(s[0]):[];for(var E=-1,j=Q(C);++E<C;)for(var U=s[E],q=-1;++q<C;)q!=E&&(j[E]=as(j[E]||U,s[q],d,m));return oo(On(j,1),d,m)}function Dt(s,d,m){for(var C=-1,E=s.length,j=d.length,U={};++C<E;){var q=C<j?d[C]:l;m(U,s[C],q)}return U}function ii(s){return dn(s)?s:[]}function so(s){return typeof s=="function"?s:sr}function fe(s,d){return Ze(s)?s:Oc(s,d)?[s]:Au(Mt(s))}var Vs=ot;function Ni(s,d,m){var C=s.length;return m=m===l?C:m,!d&&m>=C?s:Mr(s,d,m)}var lu=Qe||function(s){return yn.clearTimeout(s)};function oe(s,d){if(d)return s.slice();var m=s.length,C=Bs?Bs(m):new s.constructor(m);return s.copy(C),C}function Ya(s){var d=new s.constructor(s.byteLength);return new ns(d).set(new ns(s)),d}function yc(s,d){var m=d?Ya(s.buffer):s.buffer;return new s.constructor(m,s.byteOffset,s.byteLength)}function xc(s){var d=new s.constructor(s.source,Cs.exec(s));return d.lastIndex=s.lastIndex,d}function cu(s){return it?Nt(it.call(s)):{}}function af(s,d){var m=d?Ya(s.buffer):s.buffer;return new s.constructor(m,s.byteOffset,s.length)}function du(s,d){if(s!==d){var m=s!==l,C=s===null,E=s===s,j=jr(s),U=d!==l,q=d===null,G=d===d,ue=jr(d);if(!q&&!ue&&!j&&s>d||j&&U&&G&&!q&&!ue||C&&U&&G||!m&&G||!E)return 1;if(!C&&!j&&!ue&&s<d||ue&&m&&E&&!C&&!j||q&&m&&E||!U&&E||!G)return-1}return 0}function wm(s,d,m){for(var C=-1,E=s.criteria,j=d.criteria,U=E.length,q=m.length;++C<U;){var G=du(E[C],j[C]);if(G){if(C>=q)return G;var ue=m[C];return G*(ue=="desc"?-1:1)}}return s.index-d.index}function Ri(s,d,m,C){for(var E=-1,j=s.length,U=m.length,q=-1,G=d.length,ue=Ft(j-U,0),he=Q(G+ue),ge=!C;++q<G;)he[q]=d[q];for(;++E<U;)(ge||E<j)&&(he[m[E]]=s[E]);for(;ue--;)he[q++]=s[E++];return he}function uu(s,d,m,C){for(var E=-1,j=s.length,U=-1,q=m.length,G=-1,ue=d.length,he=Ft(j-q,0),ge=Q(he+ue),Ae=!C;++E<he;)ge[E]=s[E];for(var Le=E;++G<ue;)ge[Le+G]=d[G];for(;++U<q;)(Ae||E<j)&&(ge[Le+m[U]]=s[E++]);return ge}function mr(s,d){var m=-1,C=s.length;for(d||(d=Q(C));++m<C;)d[m]=s[m];return d}function oi(s,d,m,C){var E=!m;m||(m={});for(var j=-1,U=d.length;++j<U;){var q=d[j],G=C?C(m[q],s[q],q,m,s):l;G===l&&(G=s[q]),E?to(m,q,G):$a(m,q,G)}return m}function hu(s,d){return oi(s,yu(s),d)}function Di(s,d){return oi(s,xu(s),d)}function Cc(s,d){return function(m,C){var E=Ze(m)?Ds:Kd,j=d?d():{};return E(m,s,Ue(C,2),j)}}function $s(s){return ot(function(d,m){var C=-1,E=m.length,j=E>1?m[E-1]:l,U=E>2?m[2]:l;for(j=s.length>3&&typeof j=="function"?(E--,j):l,U&&Dn(m[0],m[1],U)&&(j=E<3?l:j,E=1),d=Nt(d);++C<E;){var q=m[C];q&&s(d,q,C,j)}return d})}function Wr(s,d){return function(m,C){if(m==null)return m;if(!sn(m))return s(m,C);for(var E=m.length,j=d?E:-1,U=Nt(m);(d?j--:++j<E)&&C(U[j],j,U)!==!1;);return m}}function lf(s){return function(d,m,C){for(var E=-1,j=Nt(d),U=C(d),q=U.length;q--;){var G=U[s?q:++E];if(m(j[G],G,j)===!1)break}return d}}function Tc(s,d,m){var C=d&Z,E=Qa(s);function j(){var U=this&&this!==yn&&this instanceof j?E:s;return U.apply(C?m:this,arguments)}return j}function fu(s){return function(d){d=Mt(d);var m=Pt(d)?hn(d):l,C=m?m[0]:d.charAt(0),E=m?Ni(m,1).join(""):d.slice(1);return C[s]()+E}}function ir(s){return function(d){return Zr(Vp(ci(d).replace(_a,"")),s,"")}}function Qa(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 m=Do(s.prototype),C=s.apply(m,d);return et(C)?C:m}}function cf(s,d,m){var C=Qa(s);function E(){for(var j=arguments.length,U=Q(j),q=j,G=Us(E);q--;)U[q]=arguments[q];var ue=j<3&&U[0]!==G&&U[j-1]!==G?[]:wi(U,G);if(j-=ue.length,j<m)return Ac(s,d,Xa,E.placeholder,l,U,ue,l,l,m-j);var he=this&&this!==yn&&this instanceof E?C:s;return Tn(he,this,U)}return E}function pu(s){return function(d,m,C){var E=Nt(d);if(!sn(d)){var j=Ue(m,3);d=_n(d),m=function(q){return j(E[q],q,E)}}var U=s(d,m,C);return U>-1?E[j?d[U]:U]:l}}function Ja(s){return ao(function(d){var m=d.length,C=m,E=Er.prototype.thru;for(s&&d.reverse();C--;){var j=d[C];if(typeof j!="function")throw new In(v);if(E&&!U&&Ec(j)=="wrapper")var U=new Er([],!0)}for(C=U?C:m;++C<m;){j=d[C];var q=Ec(j),G=q=="wrapper"?wu(j):l;G&&Nc(G[0])&&G[1]==(_e|X|ie|Se)&&!G[4].length&&G[9]==1?U=U[Ec(G[0])].apply(U,G[3]):U=j.length==1&&Nc(j)?U[q]():U.thru(j)}return function(){var ue=arguments,he=ue[0];if(U&&ue.length==1&&Ze(he))return U.plant(he).value();for(var ge=0,Ae=m?d[ge].apply(this,ue):he;++ge<m;)Ae=d[ge].call(this,Ae);return Ae}})}function Xa(s,d,m,C,E,j,U,q,G,ue){var he=d&_e,ge=d&Z,Ae=d&z,Le=d&(X|ne),Ke=d&Pe,dt=Ae?l:Qa(s);function We(){for(var pt=arguments.length,_t=Q(pt),vr=pt;vr--;)_t[vr]=arguments[vr];if(Le)var Kn=Us(We),zr=ec(_t,Kn);if(C&&(_t=Ri(_t,C,E,Le)),j&&(_t=uu(_t,j,U,Le)),pt-=zr,Le&&pt<ue){var pn=wi(_t,Kn);return Ac(s,d,Xa,We.placeholder,m,_t,pn,q,G,ue-pt)}var di=ge?m:this,ho=Ae?di[s]:s;return pt=_t.length,q?_t=vn(_t,q):Ke&&pt>1&&_t.reverse(),he&&G<pt&&(_t.length=G),this&&this!==yn&&this instanceof We&&(ho=dt||Qa(ho)),ho.apply(di,_t)}return We}function gu(s,d){return function(m,C){return Qh(m,s,d(C),{})}}function Hs(s,d){return function(m,C){var E;if(m===l&&C===l)return d;if(m!==l&&(E=m),C!==l){if(E===l)return C;typeof m=="string"||typeof C=="string"?(m=gr(m),C=gr(C)):(m=wc(m),C=wc(C)),E=s(m,C)}return E}}function Sc(s){return ao(function(d){return d=Ot(d,lt(Ue())),ot(function(m){var C=this;return s(d,function(E){return Tn(E,C,m)})})})}function Za(s,d){d=d===l?" ":gr(d);var m=d.length;if(m<2)return m?vc(d,s):d;var C=vc(d,zt(s/xt(d)));return Pt(d)?Ni(hn(C),0,s).join(""):C.slice(0,s)}function df(s,d,m,C){var E=d&Z,j=Qa(s);function U(){for(var q=-1,G=arguments.length,ue=-1,he=C.length,ge=Q(he+G),Ae=this&&this!==yn&&this instanceof U?j:s;++ue<he;)ge[ue]=C[ue];for(;G--;)ge[ue++]=arguments[++q];return Tn(Ae,E?m:this,ge)}return U}function uf(s){return function(d,m,C){return C&&typeof C!="number"&&Dn(d,m,C)&&(m=C=l),d=uo(d),m===l?(m=d,d=0):m=uo(m),C=C===l?d<m?1:-1:uo(C),tn(d,m,C,s)}}function el(s){return function(d,m){return typeof d=="string"&&typeof m=="string"||(d=Lr(d),m=Lr(m)),s(d,m)}}function Ac(s,d,m,C,E,j,U,q,G,ue){var he=d&X,ge=he?U:l,Ae=he?l:U,Le=he?j:l,Ke=he?l:j;d|=he?ie:ae,d&=~(he?ae:ie),d&re||(d&=~(Z|z));var dt=[s,d,E,Le,ge,Ke,Ae,q,G,ue],We=m.apply(l,dt);return Nc(s)&&Rc(We,dt),We.placeholder=C,Su(We,s,d)}function tl(s){var d=fn[s];return function(m,C){if(m=Lr(m),C=C==null?0:ft(rt(C),292),C&&me(m)){var E=(Mt(m)+"e").split("e"),j=d(E[0]+"e"+(+E[1]+C));return E=(Mt(j)+"e").split("e"),+(E[0]+"e"+(+E[1]-C))}return d(m)}}var hf=No&&1/ki(new No([,-0]))[1]==Ce?function(s){return new No(s)}:bl;function mu(s){return function(d){var m=Nn(d);return m==we?Zo(d):m==Zt?Sn(d):Xl(d,s(d))}}function ji(s,d,m,C,E,j,U,q){var G=d&z;if(!G&&typeof s!="function")throw new In(v);var ue=C?C.length:0;if(ue||(d&=~(ie|ae),C=E=l),U=U===l?U:Ft(rt(U),0),q=q===l?q:rt(q),ue-=E?E.length:0,d&ae){var he=C,ge=E;C=E=l}var Ae=G?l:wu(s),Le=[s,d,m,C,E,he,ge,j,U,q];if(Ae&&Bt(Le,Ae),s=Le[0],d=Le[1],m=Le[2],C=Le[3],E=Le[4],q=Le[9]=Le[9]===l?G?0:s.length:Ft(Le[9]-ue,0),!q&&d&(X|ne)&&(d&=~(X|ne)),!d||d==Z)var Ke=Tc(s,d,m);else d==X||d==ne?Ke=cf(s,d,q):(d==ie||d==(Z|ie))&&!E.length?Ke=df(s,d,m,C):Ke=Xa.apply(l,Le);var dt=Ae?rf:Rc;return Su(dt(Ke,Le),s,d)}function bu(s,d,m,C){return s===l||ai(s,yi[m])&&!It.call(C,m)?d:s}function ff(s,d,m,C,E,j){return et(s)&&et(d)&&(j.set(d,s),gc(s,d,l,ff,j),j.delete(d)),s}function nl(s){return Fi(s)?l:s}function pf(s,d,m,C,E,j){var U=m&V,q=s.length,G=d.length;if(q!=G&&!(U&&G>q))return!1;var ue=j.get(s),he=j.get(d);if(ue&&he)return ue==d&&he==s;var ge=-1,Ae=!0,Le=m&ee?new Cn:l;for(j.set(s,d),j.set(d,s);++ge<q;){var Ke=s[ge],dt=d[ge];if(C)var We=U?C(dt,Ke,ge,d,s,j):C(Ke,dt,ge,s,d,j);if(We!==l){if(We)continue;Ae=!1;break}if(Le){if(!Qo(d,function(pt,_t){if(!Po(Le,_t)&&(Ke===pt||E(Ke,pt,m,C,j)))return Le.push(_t)})){Ae=!1;break}}else if(!(Ke===dt||E(Ke,dt,m,C,j))){Ae=!1;break}}return j.delete(s),j.delete(d),Ae}function gf(s,d,m,C,E,j,U){switch(m){case xr:if(s.byteLength!=d.byteLength||s.byteOffset!=d.byteOffset)return!1;s=s.buffer,d=d.buffer;case pi:return!(s.byteLength!=d.byteLength||!j(new ns(s),new ns(d)));case ht:case kt:case Ne:return ai(+s,+d);case Ee:return s.name==d.name&&s.message==d.message;case gn:case Vr:return s==d+"";case we:var q=Zo;case Zt:var G=C&V;if(q||(q=ki),s.size!=d.size&&!G)return!1;var ue=U.get(s);if(ue)return ue==d;C|=ee,U.set(s,d);var he=pf(q(s),q(d),C,E,j,U);return U.delete(s),he;case po:if(it)return it.call(s)==it.call(d)}return!1}function cs(s,d,m,C,E,j){var U=m&V,q=vu(s),G=q.length,ue=vu(d),he=ue.length;if(G!=he&&!U)return!1;for(var ge=G;ge--;){var Ae=q[ge];if(!(U?Ae in d:It.call(d,Ae)))return!1}var Le=j.get(s),Ke=j.get(d);if(Le&&Ke)return Le==d&&Ke==s;var dt=!0;j.set(s,d),j.set(d,s);for(var We=U;++ge<G;){Ae=q[ge];var pt=s[Ae],_t=d[Ae];if(C)var vr=U?C(_t,pt,Ae,d,s,j):C(pt,_t,Ae,s,d,j);if(!(vr===l?pt===_t||E(pt,_t,m,C,j):vr)){dt=!1;break}We||(We=Ae=="constructor")}if(dt&&!We){var Kn=s.constructor,zr=d.constructor;Kn!=zr&&"constructor"in s&&"constructor"in d&&!(typeof Kn=="function"&&Kn instanceof Kn&&typeof zr=="function"&&zr instanceof zr)&&(dt=!1)}return j.delete(s),j.delete(d),dt}function ao(s){return Dc(or(s,l,Tf),s+"")}function vu(s){return Kh(s,_n,yu)}function _u(s){return Kh(s,Ln,xu)}var wu=lc?function(s){return lc.get(s)}:bl;function Ec(s){for(var d=s.name+"",m=Ro[d],C=It.call(Ro,d)?m.length:0;C--;){var E=m[C],j=E.func;if(j==null||j==s)return E.name}return d}function Us(s){var d=It.call(N,"placeholder")?N:s;return d.placeholder}function Ue(){var s=N.iteratee||td;return s=s===td?ru:s,arguments.length?s(arguments[0],arguments[1]):s}function Pc(s,d){var m=s.__data__;return rl(d)?m[typeof d=="string"?"string":"hash"]:m.map}function ku(s){for(var d=_n(s),m=d.length;m--;){var C=d[m],E=s[C];d[m]=[C,E,Tu(E)]}return d}function Or(s,d){var m=Da(s,d);return Jh(m)?m:l}function km(s){var d=It.call(s,te),m=s[te];try{s[te]=l;var C=!0}catch{}var E=xi.call(s);return C&&(d?s[te]=m:delete s[te]),E}var yu=Oo?function(s){return s==null?[]:(s=Nt(s),vi(Oo(s),function(d){return sc.call(s,d)}))}:oa,xu=Oo?function(s){for(var d=[];s;)_i(d,yu(s)),s=Xi(s);return d}:oa,Nn=rr;(rs&&Nn(new rs(new ArrayBuffer(1)))!=xr||Si&&Nn(new Si)!=we||ac&&Nn(ac.resolve())!=Ye||No&&Nn(new No)!=Zt||eo&&Nn(new eo)!=$n)&&(Nn=function(s){var d=rr(s),m=d==Fe?s.constructor:l,C=m?Bo(m):"";if(C)switch(C){case Oh:return xr;case tm:return we;case Fa:return Ye;case xn:return Zt;case nm:return $n}return d});function ym(s,d,m){for(var C=-1,E=m.length;++C<E;){var j=m[C],U=j.size;switch(j.type){case"drop":s+=U;break;case"dropRight":d-=U;break;case"take":d=ft(d,s+U);break;case"takeRight":s=Ft(s,d-U);break}}return{start:s,end:d}}function xm(s){var d=s.match(_o);return d?d[1].split(ys):[]}function Cu(s,d,m){d=fe(d,s);for(var C=-1,E=d.length,j=!1;++C<E;){var U=zi(d[C]);if(!(j=s!=null&&m(s,U)))break;s=s[U]}return j||++C!=E?j:(E=s==null?0:s.length,!!E&&gs(E)&&Rn(U,E)&&(Ze(s)||fs(s)))}function Cm(s){var d=s.length,m=new s.constructor(d);return d&&typeof s[0]=="string"&&It.call(s,"index")&&(m.index=s.index,m.input=s.input),m}function Ic(s){return typeof s.constructor=="function"&&!Ws(s)?Do(Xi(s)):{}}function mf(s,d,m){var C=s.constructor;switch(d){case pi:return Ya(s);case ht:case kt:return new C(+s);case xr:return yc(s,m);case go:case Qr:case mo:case bo:case vo:case en:case Xt:case un:case ln:return af(s,m);case we:return new C;case Ne:case Vr:return new C(s);case gn:return xc(s);case Zt:return new C;case po:return cu(s)}}function Mc(s,d){var m=d.length;if(!m)return s;var C=m-1;return d[C]=(m>1?"& ":"")+d[C],d=d.join(m>2?", ":" "),s.replace(Tr,`{ /* [wrapped with `+d+`] */ `)}function qr(s){return Ze(s)||fs(s)||!!(M&&s&&s[M])}function Rn(s,d){var m=typeof s;return d=d??ze,!!d&&(m=="number"||m!="symbol"&&Ml.test(s))&&s>-1&&s%1==0&&s<d}function Dn(s,d,m){if(!et(m))return!1;var C=typeof d;return(C=="number"?sn(m)&&Rn(d,m.length):C=="string"&&d in m)?ai(m[d],s):!1}function Oc(s,d){if(Ze(s))return!1;var m=typeof s;return m=="number"||m=="symbol"||m=="boolean"||s==null||jr(s)?!0:Pl.test(s)||!kd.test(s)||d!=null&&s in Nt(d)}function rl(s){var d=typeof s;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?s!=="__proto__":s===null}function Nc(s){var d=Ec(s),m=N[d];if(typeof m!="function"||!(d in bt.prototype))return!1;if(s===m)return!0;var C=wu(m);return!!C&&s===C[0]}function il(s){return!!za&&za in s}var ol=es?li:sh;function Ws(s){var d=s&&s.constructor,m=typeof d=="function"&&d.prototype||yi;return s===m}function Tu(s){return s===s&&!et(s)}function cn(s,d){return function(m){return m==null?!1:m[s]===d&&(d!==l||s in Nt(m))}}function Tm(s){var d=Uc(s,function(C){return m.size===F&&m.clear(),C}),m=d.cache;return d}function Bt(s,d){var m=s[1],C=d[1],E=m|C,j=E<(Z|z|_e),U=C==_e&&m==X||C==_e&&m==Se&&s[7].length<=d[8]||C==(_e|Se)&&d[7].length<=d[8]&&m==X;if(!(j||U))return s;C&Z&&(s[2]=d[2],E|=m&Z?0:re);var q=d[3];if(q){var G=s[3];s[3]=G?Ri(G,q,d[4]):q,s[4]=G?wi(s[3],y):d[4]}return q=d[5],q&&(G=s[5],s[5]=G?uu(G,q,d[6]):q,s[6]=G?wi(s[5],y):d[6]),q=d[7],q&&(s[7]=q),C&_e&&(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 En(s){var d=[];if(s!=null)for(var m in Nt(s))d.push(m);return d}function br(s){return xi.call(s)}function or(s,d,m){return d=Ft(d===l?s.length-1:d,0),function(){for(var C=arguments,E=-1,j=Ft(C.length-d,0),U=Q(j);++E<j;)U[E]=C[d+E];E=-1;for(var q=Q(d+1);++E<d;)q[E]=C[E];return q[d]=m(U),Tn(s,this,q)}}function Li(s,d){return d.length<2?s:ro(s,Mr(d,0,-1))}function vn(s,d){for(var m=s.length,C=ft(d.length,m),E=mr(s);C--;){var j=d[C];s[C]=Rn(j,m)?E[j]:l}return s}function Wt(s,d){if(!(d==="constructor"&&typeof s[d]=="function")&&d!="__proto__")return s[d]}var Rc=qs(rf),sl=nt||function(s,d){return yn.setTimeout(s,d)},Dc=qs(of);function Su(s,d,m){var C=d+"";return Dc(s,Mc(C,Sm(xm(C),m)))}function qs(s){var d=0,m=0;return function(){var C=hr(),E=pe-(C-m);if(m=C,E>0){if(++d>=ce)return arguments[0]}else d=0;return s.apply(l,arguments)}}function jc(s,d){var m=-1,C=s.length,E=C-1;for(d=d===l?C:d;++m<d;){var j=bc(m,E),U=s[j];s[j]=s[m],s[m]=U}return s.length=d,s}var Au=Tm(function(s){var d=[];return s.charCodeAt(0)===46&&d.push(""),s.replace(yd,function(m,C,E,j){d.push(E?j.replace(wo,"$1"):C||m)}),d});function zi(s){if(typeof s=="string"||jr(s))return s;var d=s+"";return d=="0"&&1/s==-Ce?"-0":d}function Bo(s){if(s!=null){try{return Ji.call(s)}catch{}try{return s+""}catch{}}return""}function Sm(s,d){return tr(ut,function(m){var C="_."+m[0];d&m[1]&&!js(s,C)&&s.push(C)}),s.sort()}function bf(s){if(s instanceof bt)return s.clone();var d=new Er(s.__wrapped__,s.__chain__);return d.__actions__=mr(s.__actions__),d.__index__=s.__index__,d.__values__=s.__values__,d}function Am(s,d,m){(m?Dn(s,d,m):d===l)?d=1:d=Ft(rt(d),0);var C=s==null?0:s.length;if(!C||d<1)return[];for(var E=0,j=0,U=Q(zt(C/d));E<C;)U[j++]=Mr(s,E,E+=d);return U}function vf(s){for(var d=-1,m=s==null?0:s.length,C=0,E=[];++d<m;){var j=s[d];j&&(E[C++]=j)}return E}function _f(){var s=arguments.length;if(!s)return[];for(var d=Q(s-1),m=arguments[0],C=s;C--;)d[C-1]=arguments[C];return _i(Ze(m)?mr(m):[m],On(d,1))}var wf=ot(function(s,d){return dn(s)?as(s,On(d,1,dn,!0)):[]}),kf=ot(function(s,d){var m=Nr(d);return dn(m)&&(m=l),dn(s)?as(s,On(d,1,dn,!0),Ue(m,2)):[]}),yf=ot(function(s,d){var m=Nr(d);return dn(m)&&(m=l),dn(s)?as(s,On(d,1,dn,!0),l,m):[]});function al(s,d,m){var C=s==null?0:s.length;return C?(d=m||d===l?1:rt(d),Mr(s,d<0?0:d,C)):[]}function Pn(s,d,m){var C=s==null?0:s.length;return C?(d=m||d===l?1:rt(d),d=C-d,Mr(s,0,d<0?0:d)):[]}function si(s,d){return s&&s.length?Rt(s,Ue(d,3),!0,!0):[]}function jn(s,d){return s&&s.length?Rt(s,Ue(d,3),!0):[]}function Em(s,d,m,C){var E=s==null?0:s.length;return E?(m&&typeof m!="number"&&Dn(s,d,m)&&(m=0,C=E),pc(s,d,m,C)):[]}function xf(s,d,m){var C=s==null?0:s.length;if(!C)return-1;var E=m==null?0:rt(m);return E<0&&(E=Ft(C+E,0)),Jo(s,Ue(d,3),E)}function Cf(s,d,m){var C=s==null?0:s.length;if(!C)return-1;var E=C-1;return m!==l&&(E=rt(m),E=m<0?Ft(C+E,0):ft(E,C-1)),Jo(s,Ue(d,3),E,!0)}function Tf(s){var d=s==null?0:s.length;return d?On(s,1):[]}function Eu(s){var d=s==null?0:s.length;return d?On(s,Ce):[]}function Sf(s,d){var m=s==null?0:s.length;return m?(d=d===l?1:rt(d),On(s,d)):[]}function Af(s){for(var d=-1,m=s==null?0:s.length,C={};++d<m;){var E=s[d];C[E[0]]=E[1]}return C}function Ef(s){return s&&s.length?s[0]:l}function Pm(s,d,m){var C=s==null?0:s.length;if(!C)return-1;var E=m==null?0:rt(m);return E<0&&(E=Ft(C+E,0)),Eo(s,d,E)}function Im(s){var d=s==null?0:s.length;return d?Mr(s,0,-1):[]}var Mm=ot(function(s){var d=Ot(s,ii);return d.length&&d[0]===s[0]?eu(d):[]}),Pf=ot(function(s){var d=Nr(s),m=Ot(s,ii);return d===Nr(m)?d=l:m.pop(),m.length&&m[0]===s[0]?eu(m,Ue(d,2)):[]}),Om=ot(function(s){var d=Nr(s),m=Ot(s,ii);return d=typeof d=="function"?d:l,d&&m.pop(),m.length&&m[0]===s[0]?eu(m,l,d):[]});function Nm(s,d){return s==null?"":$e.call(s,d)}function Nr(s){var d=s==null?0:s.length;return d?s[d-1]:l}function If(s,d,m){var C=s==null?0:s.length;if(!C)return-1;var E=C;return m!==l&&(E=rt(m),E=E<0?Ft(C+E,0):ft(E,C-1)),d===d?Yi(s,d,E):Jo(s,Pa,E,!0)}function Mf(s,d){return s&&s.length?tf(s,rt(d)):l}var Rm=ot(Pu);function Pu(s,d){return s&&s.length&&d&&d.length?At(s,d):s}function Dm(s,d,m){return s&&s.length&&d&&d.length?At(s,d,Ue(m,2)):s}function Iu(s,d,m){return s&&s.length&&d&&d.length?At(s,d,l,m):s}var Of=ao(function(s,d){var m=s==null?0:s.length,C=Yd(s,d);return Ka(s,Ot(d,function(E){return Rn(E,m)?+E:E}).sort(du)),C});function jm(s,d){var m=[];if(!(s&&s.length))return m;var C=-1,E=[],j=s.length;for(d=Ue(d,3);++C<j;){var U=s[C];d(U,C,s)&&(m.push(U),E.push(C))}return Ka(s,E),m}function Mu(s){return s==null?s:Zi.call(s)}function Nf(s,d,m){var C=s==null?0:s.length;return C?(m&&typeof m!="number"&&Dn(s,d,m)?(d=0,m=C):(d=d==null?0:rt(d),m=m===l?C:rt(m)),Mr(s,d,m)):[]}function Rr(s,d){return Ga(s,d)}function Ou(s,d,m){return _c(s,d,Ue(m,2))}function Nu(s,d){var m=s==null?0:s.length;if(m){var C=Ga(s,d);if(C<m&&ai(s[C],d))return C}return-1}function Ru(s,d){return Ga(s,d,!0)}function ds(s,d,m){return _c(s,d,Ue(m,2),!0)}function ct(s,d){var m=s==null?0:s.length;if(m){var C=Ga(s,d,!0)-1;if(ai(s[C],d))return C}return-1}function Dr(s){return s&&s.length?au(s):[]}function ll(s,d){return s&&s.length?au(s,Ue(d,2)):[]}function Lm(s){var d=s==null?0:s.length;return d?Mr(s,1,d):[]}function Rf(s,d,m){return s&&s.length?(d=m||d===l?1:rt(d),Mr(s,0,d<0?0:d)):[]}function Lc(s,d,m){var C=s==null?0:s.length;return C?(d=m||d===l?1:rt(d),d=C-d,Mr(s,d<0?0:d,C)):[]}function Df(s,d){return s&&s.length?Rt(s,Ue(d,3),!1,!0):[]}function zm(s,d){return s&&s.length?Rt(s,Ue(d,3)):[]}var Fm=ot(function(s){return oo(On(s,1,dn,!0))}),Bm=ot(function(s){var d=Nr(s);return dn(d)&&(d=l),oo(On(s,1,dn,!0),Ue(d,2))}),jf=ot(function(s){var d=Nr(s);return d=typeof d=="function"?d:l,oo(On(s,1,dn,!0),l,d)});function Lf(s){return s&&s.length?oo(s):[]}function zf(s,d){return s&&s.length?oo(s,Ue(d,2)):[]}function Ff(s,d){return d=typeof d=="function"?d:l,s&&s.length?oo(s,l,d):[]}function zc(s){if(!(s&&s.length))return[];var d=0;return s=vi(s,function(m){if(dn(m))return d=Ft(m.length,d),!0}),Na(d,function(m){return Ot(s,Ma(m))})}function us(s,d){if(!(s&&s.length))return[];var m=zc(s);return d==null?m:Ot(m,function(C){return Tn(d,l,C)})}var Fc=ot(function(s,d){return dn(s)?as(s,d):[]}),Du=ot(function(s){return Fo(vi(s,dn))}),ju=ot(function(s){var d=Nr(s);return dn(d)&&(d=l),Fo(vi(s,dn),Ue(d,2))}),Bf=ot(function(s){var d=Nr(s);return d=typeof d=="function"?d:l,Fo(vi(s,dn),l,d)}),Vm=ot(zc);function Bc(s,d){return Dt(s||[],d||[],$a)}function Vf(s,d){return Dt(s||[],d||[],Ir)}var nn=ot(function(s){var d=s.length,m=d>1?s[d-1]:l;return m=typeof m=="function"?(s.pop(),m):l,us(s,m)});function Vc(s){var d=N(s);return d.__chain__=!0,d}function Ks(s,d){return d(s),s}function Gs(s,d){return d(s)}var $f=ao(function(s){var d=s.length,m=d?s[0]:0,C=this.__wrapped__,E=function(j){return Yd(j,s)};return d>1||this.__actions__.length||!(C instanceof bt)||!Rn(m)?this.thru(E):(C=C.slice(m,+m+(d?1:0)),C.__actions__.push({func:Gs,args:[E],thisArg:l}),new Er(C,this.__chain__).thru(function(j){return d&&!j.length&&j.push(l),j}))});function Hf(){return Vc(this)}function Uf(){return new Er(this.value(),this.__chain__)}function $m(){this.__values__===l&&(this.__values__=Ku(this.value()));var s=this.__index__>=this.__values__.length,d=s?l:this.__values__[this.__index__++];return{done:s,value:d}}function Wf(){return this}function Lu(s){for(var d,m=this;m instanceof Ba;){var C=bf(m);C.__index__=0,C.__values__=l,d?E.__wrapped__=C:d=C;var E=C;m=m.__wrapped__}return E.__wrapped__=s,d}function qf(){var s=this.__wrapped__;if(s instanceof bt){var d=s;return this.__actions__.length&&(d=new bt(this)),d=d.reverse(),d.__actions__.push({func:Gs,args:[Mu],thisArg:l}),new Er(d,this.__chain__)}return this.thru(Mu)}function Kf(){return ri(this.__wrapped__,this.__actions__)}var Ys=Cc(function(s,d,m){It.call(s,m)?++s[m]:to(s,m,1)});function Gf(s,d,m){var C=Ze(s)?Ta:cm;return m&&Dn(s,d,m)&&(d=l),C(s,Ue(d,3))}function Hm(s,d){var m=Ze(s)?vi:qh;return m(s,Ue(d,3))}var Yf=pu(xf),zu=pu(Cf);function Um(s,d){return On($c(s,d),1)}function Wm(s,d){return On($c(s,d),Ce)}function qm(s,d,m){return m=m===l?1:rt(m),On($c(s,d),m)}function Qf(s,d){var m=Ze(s)?tr:no;return m(s,Ue(d,3))}function Jf(s,d){var m=Ze(s)?Gl:Mi;return m(s,Ue(d,3))}var Km=Cc(function(s,d,m){It.call(s,m)?s[m].push(d):to(s,m,[d])});function hs(s,d,m,C){s=sn(s)?s:ra(s),m=m&&!C?rt(m):0;var E=s.length;return m<0&&(m=Ft(E+m,0)),fl(s)?m<=E&&s.indexOf(d,m)>-1:!!E&&Eo(s,d,m)>-1}var Xf=ot(function(s,d,m){var C=-1,E=typeof d=="function",j=sn(s)?Q(s.length):[];return no(s,function(U){j[++C]=E?Tn(d,U,m):ls(U,d,m)}),j}),Zf=Cc(function(s,d,m){to(s,m,d)});function $c(s,d){var m=Ze(s)?Ot:Xh;return m(s,Ue(d,3))}function ep(s,d,m,C){return s==null?[]:(Ze(d)||(d=d==null?[]:[d]),m=C?l:m,Ze(m)||(m=m==null?[]:[m]),ou(s,d,m))}var Gm=Cc(function(s,d,m){s[m?0:1].push(d)},function(){return[[],[]]});function Ym(s,d,m){var C=Ze(s)?Zr:Ql,E=arguments.length<3;return C(s,Ue(d,4),m,E,no)}function Qm(s,d,m){var C=Ze(s)?Ao:Ql,E=arguments.length<3;return C(s,Ue(d,4),m,E,Mi)}function Jm(s,d){var m=Ze(s)?vi:qh;return m(s,dl(Ue(d,3)))}function Fu(s){var d=Ze(s)?os:pr;return d(s)}function Bu(s,d,m){(m?Dn(s,d,m):d===l)?d=1:d=rt(d);var C=Ze(s)?Hh:Ur;return C(s,d)}function Vu(s){var d=Ze(s)?Uh:_m;return d(s)}function $u(s){if(s==null)return 0;if(sn(s))return fl(s)?xt(s):s.length;var d=Nn(s);return d==we||d==Zt?s.size:iu(s).length}function tp(s,d,m){var C=Ze(s)?Qo:sf;return m&&Dn(s,d,m)&&(d=l),C(s,Ue(d,3))}var np=ot(function(s,d){if(s==null)return[];var m=d.length;return m>1&&Dn(s,d[0],d[1])?d=[]:m>2&&Dn(d[0],d[1],d[2])&&(d=[d[0]]),ou(s,On(d,1),[])}),st=Je||function(){return yn.Date.now()};function Hu(s,d){if(typeof d!="function")throw new In(v);return s=rt(s),function(){if(--s<1)return d.apply(this,arguments)}}function Wn(s,d,m){return d=m?l:d,d=s&&d==null?s.length:d,ji(s,_e,l,l,l,l,d)}function qn(s,d){var m;if(typeof d!="function")throw new In(v);return s=rt(s),function(){return--s>0&&(m=d.apply(this,arguments)),s<=1&&(d=l),m}}var Qs=ot(function(s,d,m){var C=Z;if(m.length){var E=wi(m,Us(Qs));C|=ie}return ji(s,C,d,m,E)}),cl=ot(function(s,d,m){var C=Z|z;if(m.length){var E=wi(m,Us(cl));C|=ie}return ji(d,C,s,m,E)});function rp(s,d,m){d=m?l:d;var C=ji(s,X,l,l,l,l,l,d);return C.placeholder=rp.placeholder,C}function ip(s,d,m){d=m?l:d;var C=ji(s,ne,l,l,l,l,l,d);return C.placeholder=ip.placeholder,C}function Js(s,d,m){var C,E,j,U,q,G,ue=0,he=!1,ge=!1,Ae=!0;if(typeof s!="function")throw new In(v);d=Lr(d)||0,et(m)&&(he=!!m.leading,ge="maxWait"in m,j=ge?Ft(Lr(m.maxWait)||0,d):j,Ae="trailing"in m?!!m.trailing:Ae);function Le(pn){var di=C,ho=E;return C=E=l,ue=pn,U=s.apply(ho,di),U}function Ke(pn){return ue=pn,q=sl(pt,d),he?Le(pn):U}function dt(pn){var di=pn-G,ho=pn-ue,uh=d-di;return ge?ft(uh,j-ho):uh}function We(pn){var di=pn-G,ho=pn-ue;return G===l||di>=d||di<0||ge&&ho>=j}function pt(){var pn=st();if(We(pn))return _t(pn);q=sl(pt,dt(pn))}function _t(pn){return q=l,Ae&&C?Le(pn):(C=E=l,U)}function vr(){q!==l&&lu(q),ue=0,C=G=E=q=l}function Kn(){return q===l?U:_t(st())}function zr(){var pn=st(),di=We(pn);if(C=arguments,E=this,G=pn,di){if(q===l)return Ke(G);if(ge)return lu(q),q=sl(pt,d),Le(G)}return q===l&&(q=sl(pt,d)),U}return zr.cancel=vr,zr.flush=Kn,zr}var Xm=ot(function(s,d){return ss(s,1,d)}),Hc=ot(function(s,d,m){return ss(s,Lr(d)||0,m)});function op(s){return ji(s,Pe)}function Uc(s,d){if(typeof s!="function"||d!=null&&typeof d!="function")throw new In(v);var m=function(){var C=arguments,E=d?d.apply(this,C):C[0],j=m.cache;if(j.has(E))return j.get(E);var U=s.apply(this,C);return m.cache=j.set(E,U)||j,U};return m.cache=new(Uc.Cache||Pi),m}Uc.Cache=Pi;function dl(s){if(typeof s!="function")throw new In(v);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 sp(s){return qn(2,s)}var Zm=Vs(function(s,d){d=d.length==1&&Ze(d[0])?Ot(d[0],lt(Ue())):Ot(On(d,1),lt(Ue()));var m=d.length;return ot(function(C){for(var E=-1,j=ft(C.length,m);++E<j;)C[E]=d[E].call(this,C[E]);return Tn(s,this,C)})}),ul=ot(function(s,d){var m=wi(d,Us(ul));return ji(s,ie,l,d,m)}),Ct=ot(function(s,d){var m=wi(d,Us(Ct));return ji(s,ae,l,d,m)}),eb=ao(function(s,d){return ji(s,Se,l,l,l,d)});function ap(s,d){if(typeof s!="function")throw new In(v);return d=d===l?d:rt(d),ot(s,d)}function tb(s,d){if(typeof s!="function")throw new In(v);return d=d==null?0:Ft(rt(d),0),ot(function(m){var C=m[d],E=Ni(m,0,d);return C&&_i(E,C),Tn(s,this,E)})}function nb(s,d,m){var C=!0,E=!0;if(typeof s!="function")throw new In(v);return et(m)&&(C="leading"in m?!!m.leading:C,E="trailing"in m?!!m.trailing:E),Js(s,d,{leading:C,maxWait:d,trailing:E})}function lp(s){return Wn(s,1)}function cp(s,d){return ul(so(d),s)}function dp(){if(!arguments.length)return[];var s=arguments[0];return Ze(s)?s:[s]}function up(s){return Pr(s,B)}function Xs(s,d){return d=typeof d=="function"?d:l,Pr(s,B,d)}function rb(s){return Pr(s,R|B)}function Wc(s,d){return d=typeof d=="function"?d:l,Pr(s,R|B,d)}function Zs(s,d){return d==null||Ha(s,d,_n(d))}function ai(s,d){return s===d||s!==s&&d!==d}var ib=el(Zd),Uu=el(function(s,d){return s>=d}),fs=io(function(){return arguments}())?io:function(s){return rn(s)&&It.call(s,"callee")&&!sc.call(s,"callee")},Ze=Q.isArray,hp=Kl?lt(Kl):um;function sn(s){return s!=null&&gs(s.length)&&!li(s)}function dn(s){return rn(s)&&sn(s)}function ob(s){return s===!0||s===!1||rn(s)&&rr(s)==ht}var lo=nr||sh,fp=Ca?lt(Ca):tu;function qc(s){return rn(s)&&s.nodeType===1&&!Fi(s)}function pp(s){if(s==null)return!0;if(sn(s)&&(Ze(s)||typeof s=="string"||typeof s.splice=="function"||lo(s)||ea(s)||fs(s)))return!s.length;var d=Nn(s);if(d==we||d==Zt)return!s.size;if(Ws(s))return!iu(s).length;for(var m in s)if(It.call(s,m))return!1;return!0}function gp(s,d){return Wa(s,d)}function sb(s,d,m){m=typeof m=="function"?m:l;var C=m?m(s,d):l;return C===l?Wa(s,d,l,m):!!C}function ps(s){if(!rn(s))return!1;var d=rr(s);return d==Ee||d==Kt||typeof s.message=="string"&&typeof s.name=="string"&&!Fi(s)}function mp(s){return typeof s=="number"&&me(s)}function li(s){if(!et(s))return!1;var d=rr(s);return d==yt||d==on||d==tt||d==Vt}function bp(s){return typeof s=="number"&&s==rt(s)}function gs(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=ze}function et(s){var d=typeof s;return s!=null&&(d=="object"||d=="function")}function rn(s){return s!=null&&typeof s=="object"}var vp=Co?lt(Co):fm;function ab(s,d){return s===d||nu(s,d,ku(d))}function Kc(s,d,m){return m=typeof m=="function"?m:l,nu(s,d,ku(d),m)}function lb(s){return _p(s)&&s!=+s}function Wu(s){if(ol(s))throw new Xe(w);return Jh(s)}function hl(s){return s===null}function cb(s){return s==null}function _p(s){return typeof s=="number"||rn(s)&&rr(s)==Ne}function Fi(s){if(!rn(s)||rr(s)!=Fe)return!1;var d=Xi(s);if(d===null)return!0;var m=It.call(d,"constructor")&&d.constructor;return typeof m=="function"&&m instanceof m&&Ji.call(m)==bn}var co=Rs?lt(Rs):pm;function wp(s){return bp(s)&&s>=-ze&&s<=ze}var qu=To?lt(To):gm;function fl(s){return typeof s=="string"||!Ze(s)&&rn(s)&&rr(s)==Vr}function jr(s){return typeof s=="symbol"||rn(s)&&rr(s)==po}var ea=So?lt(So):mm;function db(s){return s===l}function kp(s){return rn(s)&&Nn(s)==$n}function yp(s){return rn(s)&&rr(s)==ws}var pl=el(qa),ub=el(function(s,d){return s<=d});function Ku(s){if(!s)return[];if(sn(s))return fl(s)?hn(s):mr(s);if(H&&s[H])return zd(s[H]());var d=Nn(s),m=d==we?Zo:d==Zt?ki:ra;return m(s)}function uo(s){if(!s)return s===0?s:0;if(s=Lr(s),s===Ce||s===-Ce){var d=s<0?-1:1;return d*He}return s===s?s:0}function rt(s){var d=uo(s),m=d%1;return d===d?m?d-m:d:0}function Gu(s){return s?Ii(rt(s),0,qe):0}function Lr(s){if(typeof s=="number")return s;if(jr(s))return Ge;if(et(s)){var d=typeof s.valueOf=="function"?s.valueOf():s;s=et(d)?d+"":d}if(typeof s!="string")return s===0?s:+s;s=Zl(s);var m=Wi.test(s);return m||Sd.test(s)?ql(s.slice(2),m?2:8):Gt.test(s)?Ge:+s}function Yu(s){return oi(s,Ln(s))}function hb(s){return s?Ii(rt(s),-ze,ze):s===0?s:0}function Mt(s){return s==null?"":gr(s)}var fb=$s(function(s,d){if(Ws(d)||sn(d)){oi(d,_n(d),s);return}for(var m in d)It.call(d,m)&&$a(s,m,d[m])}),Qu=$s(function(s,d){oi(d,Ln(d),s)}),ta=$s(function(s,d,m,C){oi(d,Ln(d),s,C)}),pb=$s(function(s,d,m,C){oi(d,_n(d),s,C)}),gb=ao(Yd);function xp(s,d){var m=Do(s);return d==null?m:Gd(m,d)}var mb=ot(function(s,d){s=Nt(s);var m=-1,C=d.length,E=C>2?d[2]:l;for(E&&Dn(d[0],d[1],E)&&(C=1);++m<C;)for(var j=d[m],U=Ln(j),q=-1,G=U.length;++q<G;){var ue=U[q],he=s[ue];(he===l||ai(he,yi[ue])&&!It.call(s,ue))&&(s[ue]=j[ue])}return s}),bb=ot(function(s){return s.push(l,ff),Tn(Pp,l,s)});function vb(s,d){return Aa(s,Ue(d,3),Oi)}function _b(s,d){return Aa(s,Ue(d,3),Xd)}function wb(s,d){return s==null?s:Qd(s,Ue(d,3),Ln)}function Cp(s,d){return s==null?s:Jd(s,Ue(d,3),Ln)}function kb(s,d){return s&&Oi(s,Ue(d,3))}function yb(s,d){return s&&Xd(s,Ue(d,3))}function Tp(s){return s==null?[]:Ua(s,_n(s))}function Sp(s){return s==null?[]:Ua(s,Ln(s))}function Gc(s,d,m){var C=s==null?l:ro(s,d);return C===l?m:C}function xb(s,d){return s!=null&&Cu(s,d,Gh)}function Yc(s,d){return s!=null&&Cu(s,d,dm)}var Ju=gu(function(s,d,m){d!=null&&typeof d.toString!="function"&&(d=xi.call(d)),s[d]=m},Zc(sr)),Ap=gu(function(s,d,m){d!=null&&typeof d.toString!="function"&&(d=xi.call(d)),It.call(s,d)?s[d].push(m):s[d]=[m]},Ue),Xu=ot(ls);function _n(s){return sn(s)?qd(s):iu(s)}function Ln(s){return sn(s)?qd(s,!0):bm(s)}function Qc(s,d){var m={};return d=Ue(d,3),Oi(s,function(C,E,j){to(m,d(C,E,j),C)}),m}function Ep(s,d){var m={};return d=Ue(d,3),Oi(s,function(C,E,j){to(m,E,d(C,E,j))}),m}var Cb=$s(function(s,d,m){gc(s,d,m)}),Pp=$s(function(s,d,m,C){gc(s,d,m,C)}),Tb=ao(function(s,d){var m={};if(s==null)return m;var C=!1;d=Ot(d,function(j){return j=fe(j,s),C||(C=j.length>1),j}),oi(s,_u(s),m),C&&(m=Pr(m,R|$|B,nl));for(var E=d.length;E--;)kc(m,d[E]);return m});function Ip(s,d){return Mp(s,dl(Ue(d)))}var Sb=ao(function(s,d){return s==null?{}:mc(s,d)});function Mp(s,d){if(s==null)return{};var m=Ot(_u(s),function(C){return[C]});return d=Ue(d),su(s,m,function(C,E){return d(C,E[0])})}function Ab(s,d,m){d=fe(d,s);var C=-1,E=d.length;for(E||(E=1,s=l);++C<E;){var j=s==null?l:s[zi(d[C])];j===l&&(C=E,j=m),s=li(j)?j.call(s):j}return s}function Eb(s,d,m){return s==null?s:Ir(s,d,m)}function na(s,d,m,C){return C=typeof C=="function"?C:l,s==null?s:Ir(s,d,m,C)}var ms=mu(_n),Zu=mu(Ln);function Op(s,d,m){var C=Ze(s),E=C||lo(s)||ea(s);if(d=Ue(d,4),m==null){var j=s&&s.constructor;E?m=C?new j:[]:et(s)?m=li(j)?Do(Xi(s)):{}:m={}}return(E?tr:Oi)(s,function(U,q,G){return d(m,U,q,G)}),m}function Pb(s,d){return s==null?!0:kc(s,d)}function Ib(s,d,m){return s==null?s:zo(s,d,so(m))}function Mb(s,d,m,C){return C=typeof C=="function"?C:l,s==null?s:zo(s,d,so(m),C)}function ra(s){return s==null?[]:Xo(s,_n(s))}function Ob(s){return s==null?[]:Xo(s,Ln(s))}function Np(s,d,m){return m===l&&(m=d,d=l),m!==l&&(m=Lr(m),m=m===m?m:0),d!==l&&(d=Lr(d),d=d===d?d:0),Ii(Lr(s),d,m)}function Rp(s,d,m){return d=uo(d),m===l?(m=d,d=0):m=uo(m),s=Lr(s),Yh(s,d,m)}function Nb(s,d,m){if(m&&typeof m!="boolean"&&Dn(s,d,m)&&(d=m=l),m===l&&(typeof d=="boolean"?(m=d,d=l):typeof s=="boolean"&&(m=s,s=l)),s===l&&d===l?(s=0,d=1):(s=uo(s),d===l?(d=s,s=0):d=uo(d)),s>d){var C=s;s=d,d=C}if(m||s%1||d%1){var E=fr();return ft(s+E*(d-s+ka("1e-"+((E+"").length-1))),d)}return bc(s,d)}var Dp=ir(function(s,d,m){return d=d.toLowerCase(),s+(m?eh(d):d)});function eh(s){return nh(Mt(s).toLowerCase())}function ci(s){return s=Mt(s),s&&s.replace(qi,jd).replace(Md,"")}function th(s,d,m){s=Mt(s),d=gr(d);var C=s.length;m=m===l?C:Ii(rt(m),0,C);var E=m;return m-=d.length,m>=0&&s.slice(m,E)==d}function Rb(s){return s=Mt(s),s&&lr.test(s)?s.replace(Tt,dr):s}function Db(s){return s=Mt(s),s&&xd.test(s)?s.replace(Ho,"\\$&"):s}var jb=ir(function(s,d,m){return s+(m?"-":"")+d.toLowerCase()}),Lb=ir(function(s,d,m){return s+(m?" ":"")+d.toLowerCase()}),Vo=fu("toLowerCase");function ia(s,d,m){s=Mt(s),d=rt(d);var C=d?xt(s):0;if(!d||C>=d)return s;var E=(d-C)/2;return Za(Ht(E),m)+s+Za(zt(E),m)}function jp(s,d,m){s=Mt(s),d=rt(d);var C=d?xt(s):0;return d&&C<d?s+Za(d-C,m):s}function Jc(s,d,m){s=Mt(s),d=rt(d);var C=d?xt(s):0;return d&&C<d?Za(d-C,m)+s:s}function Lp(s,d,m){return m||d==null?d=0:d&&(d=+d),An(Mt(s).replace(pa,""),d||0)}function zb(s,d,m){return(m?Dn(s,d,m):d===l)?d=1:d=rt(d),vc(Mt(s),d)}function Fb(){var s=arguments,d=Mt(s[0]);return s.length<3?d:d.replace(s[1],s[2])}var Bb=ir(function(s,d,m){return s+(m?"_":"")+d.toLowerCase()});function Vb(s,d,m){return m&&typeof m!="number"&&Dn(s,d,m)&&(d=m=l),m=m===l?qe:m>>>0,m?(s=Mt(s),s&&(typeof d=="string"||d!=null&&!co(d))&&(d=gr(d),!d&&Pt(s))?Ni(hn(s),0,m):s.split(d,m)):[]}var $b=ir(function(s,d,m){return s+(m?" ":"")+nh(d)});function Xc(s,d,m){return s=Mt(s),m=m==null?0:Ii(rt(m),0,s.length),d=gr(d),s.slice(m,m+d.length)==d}function zp(s,d,m){var C=N.templateSettings;m&&Dn(s,d,m)&&(d=l),s=Mt(s),d=ta({},d,C,bu);var E=ta({},d.imports,C.imports,bu),j=_n(E),U=Xo(E,j),q,G,ue=0,he=d.interpolate||Be,ge="__p += '",Ae=Fs((d.escape||Be).source+"|"+he.source+"|"+(he===ks?Il:Be).source+"|"+(d.evaluate||Be).source+"|$","g"),Le="//# sourceURL="+(It.call(d,"sourceURL")?(d.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ul+"]")+` `;s.replace(Ae,function(We,pt,_t,vr,Kn,zr){return _t||(_t=vr),ge+=s.slice(ue,zr).replace(ve,ur),pt&&(q=!0,ge+=`' + __e(`+pt+`) + '`),Kn&&(G=!0,ge+=`'; `+Kn+`; __p += '`),_t&&(ge+=`' + ((__t = (`+_t+`)) == null ? '' : __t) + '`),ue=zr+We.length,We}),ge+=`'; `;var Ke=It.call(d,"variable")&&d.variable;if(!Ke)ge=`with (obj) { `+ge+` } `;else if(Ui.test(Ke))throw new Xe(x);ge=(G?ge.replace(Hn,""):ge).replace(mn,"$1").replace(vt,"$1;"),ge="function("+(Ke||"obj")+`) { `+(Ke?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(q?", __e = _.escape":"")+(G?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+ge+`return __p }`;var dt=rh(function(){return St(j,Le+"return "+ge).apply(l,U)});if(dt.source=ge,ps(dt))throw dt;return dt}function Fp(s){return Mt(s).toLowerCase()}function Hb(s){return Mt(s).toUpperCase()}function Ub(s,d,m){if(s=Mt(s),s&&(m||d===l))return Zl(s);if(!s||!(d=gr(d)))return s;var C=hn(s),E=hn(d),j=ei(C,E),U=Ra(C,E)+1;return Ni(C,j,U).join("")}function Wb(s,d,m){if(s=Mt(s),s&&(m||d===l))return s.slice(0,Ar(s)+1);if(!s||!(d=gr(d)))return s;var C=hn(s),E=Ra(C,hn(d))+1;return Ni(C,0,E).join("")}function qb(s,d,m){if(s=Mt(s),s&&(m||d===l))return s.replace(pa,"");if(!s||!(d=gr(d)))return s;var C=hn(s),E=ei(C,hn(d));return Ni(C,E).join("")}function Bp(s,d){var m=Me,C=Re;if(et(d)){var E="separator"in d?d.separator:E;m="length"in d?rt(d.length):m,C="omission"in d?gr(d.omission):C}s=Mt(s);var j=s.length;if(Pt(s)){var U=hn(s);j=U.length}if(m>=j)return s;var q=m-xt(C);if(q<1)return C;var G=U?Ni(U,0,q).join(""):s.slice(0,q);if(E===l)return G+C;if(U&&(q+=G.length-q),co(E)){if(s.slice(q).search(E)){var ue,he=G;for(E.global||(E=Fs(E.source,Mt(Cs.exec(E))+"g")),E.lastIndex=0;ue=E.exec(he);)var ge=ue.index;G=G.slice(0,ge===l?q:ge)}}else if(s.indexOf(gr(E),q)!=q){var Ae=G.lastIndexOf(E);Ae>-1&&(G=G.slice(0,Ae))}return G+C}function Kb(s){return s=Mt(s),s&&Cr.test(s)?s.replace(Zn,Hr):s}var Gb=ir(function(s,d,m){return s+(m?" ":"")+d.toUpperCase()}),nh=fu("toUpperCase");function Vp(s,d,m){return s=Mt(s),d=m?l:d,d===l?Ld(s)?zs(s):Sa(s):s.match(d)||[]}var rh=ot(function(s,d){try{return Tn(s,l,d)}catch(m){return ps(m)?m:new Xe(m)}}),Yb=ao(function(s,d){return tr(d,function(m){m=zi(m),to(s,m,Qs(s[m],s))}),s});function gl(s){var d=s==null?0:s.length,m=Ue();return s=d?Ot(s,function(C){if(typeof C[1]!="function")throw new In(v);return[m(C[0]),C[1]]}):[],ot(function(C){for(var E=-1;++E<d;){var j=s[E];if(Tn(j[0],this,C))return Tn(j[1],this,C)}})}function Qb(s){return Wh(Pr(s,R))}function Zc(s){return function(){return s}}function Jb(s,d){return s==null||s!==s?d:s}var Xb=Ja(),ed=Ja(!0);function sr(s){return s}function td(s){return ru(typeof s=="function"?s:Pr(s,R))}function $p(s){return Zh(Pr(s,R))}function Zb(s,d){return ef(s,Pr(d,R))}var ih=ot(function(s,d){return function(m){return ls(m,s,d)}}),ev=ot(function(s,d){return function(m){return ls(s,m,d)}});function ml(s,d,m){var C=_n(d),E=Ua(d,C);m==null&&!(et(d)&&(E.length||!C.length))&&(m=d,d=s,s=this,E=Ua(d,_n(d)));var j=!(et(m)&&"chain"in m)||!!m.chain,U=li(s);return tr(E,function(q){var G=d[q];s[q]=G,U&&(s.prototype[q]=function(){var ue=this.__chain__;if(j||ue){var he=s(this.__wrapped__),ge=he.__actions__=mr(this.__actions__);return ge.push({func:G,args:arguments,thisArg:s}),he.__chain__=ue,he}return G.apply(s,_i([this.value()],arguments))})}),s}function Hp(){return yn._===this&&(yn._=ts),this}function bl(){}function Bi(s){return s=rt(s),ot(function(d){return tf(d,s)})}var Up=Sc(Ot),tv=Sc(Ta),nv=Sc(Qo);function oh(s){return Oc(s)?Ma(zi(s)):nf(s)}function rv(s){return function(d){return s==null?l:ro(s,d)}}var Wp=uf(),qp=uf(!0);function oa(){return[]}function sh(){return!1}function iv(){return{}}function Kp(){return""}function Gp(){return!0}function Yp(s,d){if(s=rt(s),s<1||s>ze)return[];var m=qe,C=ft(s,qe);d=Ue(d),s-=qe;for(var E=Na(C,d);++m<s;)d(m);return E}function ov(s){return Ze(s)?Ot(s,zi):jr(s)?[s]:mr(Au(Mt(s)))}function sv(s){var d=++ic;return Mt(s)+d}var av=Hs(function(s,d){return s+d},0),ah=tl("ceil"),lh=Hs(function(s,d){return s/d},1),lv=tl("floor");function cv(s){return s&&s.length?fc(s,sr,Zd):l}function Qp(s,d){return s&&s.length?fc(s,Ue(d,2),Zd):l}function dv(s){return Ia(s,sr)}function uv(s,d){return Ia(s,Ue(d,2))}function hv(s){return s&&s.length?fc(s,sr,qa):l}function Jp(s,d){return s&&s.length?fc(s,Ue(d,2),qa):l}var Xp=Hs(function(s,d){return s*d},1),ch=tl("round"),dh=Hs(function(s,d){return s-d},0);function Zp(s){return s&&s.length?Oa(s,sr):0}function eg(s,d){return s&&s.length?Oa(s,Ue(d,2)):0}return N.after=Hu,N.ary=Wn,N.assign=fb,N.assignIn=Qu,N.assignInWith=ta,N.assignWith=pb,N.at=gb,N.before=qn,N.bind=Qs,N.bindAll=Yb,N.bindKey=cl,N.castArray=dp,N.chain=Vc,N.chunk=Am,N.compact=vf,N.concat=_f,N.cond=gl,N.conforms=Qb,N.constant=Zc,N.countBy=Ys,N.create=xp,N.curry=rp,N.curryRight=ip,N.debounce=Js,N.defaults=mb,N.defaultsDeep=bb,N.defer=Xm,N.delay=Hc,N.difference=wf,N.differenceBy=kf,N.differenceWith=yf,N.drop=al,N.dropRight=Pn,N.dropRightWhile=si,N.dropWhile=jn,N.fill=Em,N.filter=Hm,N.flatMap=Um,N.flatMapDeep=Wm,N.flatMapDepth=qm,N.flatten=Tf,N.flattenDeep=Eu,N.flattenDepth=Sf,N.flip=op,N.flow=Xb,N.flowRight=ed,N.fromPairs=Af,N.functions=Tp,N.functionsIn=Sp,N.groupBy=Km,N.initial=Im,N.intersection=Mm,N.intersectionBy=Pf,N.intersectionWith=Om,N.invert=Ju,N.invertBy=Ap,N.invokeMap=Xf,N.iteratee=td,N.keyBy=Zf,N.keys=_n,N.keysIn=Ln,N.map=$c,N.mapKeys=Qc,N.mapValues=Ep,N.matches=$p,N.matchesProperty=Zb,N.memoize=Uc,N.merge=Cb,N.mergeWith=Pp,N.method=ih,N.methodOf=ev,N.mixin=ml,N.negate=dl,N.nthArg=Bi,N.omit=Tb,N.omitBy=Ip,N.once=sp,N.orderBy=ep,N.over=Up,N.overArgs=Zm,N.overEvery=tv,N.overSome=nv,N.partial=ul,N.partialRight=Ct,N.partition=Gm,N.pick=Sb,N.pickBy=Mp,N.property=oh,N.propertyOf=rv,N.pull=Rm,N.pullAll=Pu,N.pullAllBy=Dm,N.pullAllWith=Iu,N.pullAt=Of,N.range=Wp,N.rangeRight=qp,N.rearg=eb,N.reject=Jm,N.remove=jm,N.rest=ap,N.reverse=Mu,N.sampleSize=Bu,N.set=Eb,N.setWith=na,N.shuffle=Vu,N.slice=Nf,N.sortBy=np,N.sortedUniq=Dr,N.sortedUniqBy=ll,N.split=Vb,N.spread=tb,N.tail=Lm,N.take=Rf,N.takeRight=Lc,N.takeRightWhile=Df,N.takeWhile=zm,N.tap=Ks,N.throttle=nb,N.thru=Gs,N.toArray=Ku,N.toPairs=ms,N.toPairsIn=Zu,N.toPath=ov,N.toPlainObject=Yu,N.transform=Op,N.unary=lp,N.union=Fm,N.unionBy=Bm,N.unionWith=jf,N.uniq=Lf,N.uniqBy=zf,N.uniqWith=Ff,N.unset=Pb,N.unzip=zc,N.unzipWith=us,N.update=Ib,N.updateWith=Mb,N.values=ra,N.valuesIn=Ob,N.without=Fc,N.words=Vp,N.wrap=cp,N.xor=Du,N.xorBy=ju,N.xorWith=Bf,N.zip=Vm,N.zipObject=Bc,N.zipObjectDeep=Vf,N.zipWith=nn,N.entries=ms,N.entriesIn=Zu,N.extend=Qu,N.extendWith=ta,ml(N,N),N.add=av,N.attempt=rh,N.camelCase=Dp,N.capitalize=eh,N.ceil=ah,N.clamp=Np,N.clone=up,N.cloneDeep=rb,N.cloneDeepWith=Wc,N.cloneWith=Xs,N.conformsTo=Zs,N.deburr=ci,N.defaultTo=Jb,N.divide=lh,N.endsWith=th,N.eq=ai,N.escape=Rb,N.escapeRegExp=Db,N.every=Gf,N.find=Yf,N.findIndex=xf,N.findKey=vb,N.findLast=zu,N.findLastIndex=Cf,N.findLastKey=_b,N.floor=lv,N.forEach=Qf,N.forEachRight=Jf,N.forIn=wb,N.forInRight=Cp,N.forOwn=kb,N.forOwnRight=yb,N.get=Gc,N.gt=ib,N.gte=Uu,N.has=xb,N.hasIn=Yc,N.head=Ef,N.identity=sr,N.includes=hs,N.indexOf=Pm,N.inRange=Rp,N.invoke=Xu,N.isArguments=fs,N.isArray=Ze,N.isArrayBuffer=hp,N.isArrayLike=sn,N.isArrayLikeObject=dn,N.isBoolean=ob,N.isBuffer=lo,N.isDate=fp,N.isElement=qc,N.isEmpty=pp,N.isEqual=gp,N.isEqualWith=sb,N.isError=ps,N.isFinite=mp,N.isFunction=li,N.isInteger=bp,N.isLength=gs,N.isMap=vp,N.isMatch=ab,N.isMatchWith=Kc,N.isNaN=lb,N.isNative=Wu,N.isNil=cb,N.isNull=hl,N.isNumber=_p,N.isObject=et,N.isObjectLike=rn,N.isPlainObject=Fi,N.isRegExp=co,N.isSafeInteger=wp,N.isSet=qu,N.isString=fl,N.isSymbol=jr,N.isTypedArray=ea,N.isUndefined=db,N.isWeakMap=kp,N.isWeakSet=yp,N.join=Nm,N.kebabCase=jb,N.last=Nr,N.lastIndexOf=If,N.lowerCase=Lb,N.lowerFirst=Vo,N.lt=pl,N.lte=ub,N.max=cv,N.maxBy=Qp,N.mean=dv,N.meanBy=uv,N.min=hv,N.minBy=Jp,N.stubArray=oa,N.stubFalse=sh,N.stubObject=iv,N.stubString=Kp,N.stubTrue=Gp,N.multiply=Xp,N.nth=Mf,N.noConflict=Hp,N.noop=bl,N.now=st,N.pad=ia,N.padEnd=jp,N.padStart=Jc,N.parseInt=Lp,N.random=Nb,N.reduce=Ym,N.reduceRight=Qm,N.repeat=zb,N.replace=Fb,N.result=Ab,N.round=ch,N.runInContext=K,N.sample=Fu,N.size=$u,N.snakeCase=Bb,N.some=tp,N.sortedIndex=Rr,N.sortedIndexBy=Ou,N.sortedIndexOf=Nu,N.sortedLastIndex=Ru,N.sortedLastIndexBy=ds,N.sortedLastIndexOf=ct,N.startCase=$b,N.startsWith=Xc,N.subtract=dh,N.sum=Zp,N.sumBy=eg,N.template=zp,N.times=Yp,N.toFinite=uo,N.toInteger=rt,N.toLength=Gu,N.toLower=Fp,N.toNumber=Lr,N.toSafeInteger=hb,N.toString=Mt,N.toUpper=Hb,N.trim=Ub,N.trimEnd=Wb,N.trimStart=qb,N.truncate=Bp,N.unescape=Kb,N.uniqueId=sv,N.upperCase=Gb,N.upperFirst=nh,N.each=Qf,N.eachRight=Jf,N.first=Ef,ml(N,function(){var s={};return Oi(N,function(d,m){It.call(N.prototype,m)||(s[m]=d)}),s}(),{chain:!1}),N.VERSION=p,tr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){N[s].placeholder=N}),tr(["drop","take"],function(s,d){bt.prototype[s]=function(m){m=m===l?1:Ft(rt(m),0);var C=this.__filtered__&&!d?new bt(this):this.clone();return C.__filtered__?C.__takeCount__=ft(m,C.__takeCount__):C.__views__.push({size:ft(m,qe),type:s+(C.__dir__<0?"Right":"")}),C},bt.prototype[s+"Right"]=function(m){return this.reverse()[s](m).reverse()}}),tr(["filter","map","takeWhile"],function(s,d){var m=d+1,C=m==be||m==ye;bt.prototype[s]=function(E){var j=this.clone();return j.__iteratees__.push({iteratee:Ue(E,3),type:m}),j.__filtered__=j.__filtered__||C,j}}),tr(["head","last"],function(s,d){var m="take"+(d?"Right":"");bt.prototype[s]=function(){return this[m](1).value()[0]}}),tr(["initial","tail"],function(s,d){var m="drop"+(d?"":"Right");bt.prototype[s]=function(){return this.__filtered__?new bt(this):this[m](1)}}),bt.prototype.compact=function(){return this.filter(sr)},bt.prototype.find=function(s){return this.filter(s).head()},bt.prototype.findLast=function(s){return this.reverse().find(s)},bt.prototype.invokeMap=ot(function(s,d){return typeof s=="function"?new bt(this):this.map(function(m){return ls(m,s,d)})}),bt.prototype.reject=function(s){return this.filter(dl(Ue(s)))},bt.prototype.slice=function(s,d){s=rt(s);var m=this;return m.__filtered__&&(s>0||d<0)?new bt(m):(s<0?m=m.takeRight(-s):s&&(m=m.drop(s)),d!==l&&(d=rt(d),m=d<0?m.dropRight(-d):m.take(d-s)),m)},bt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},bt.prototype.toArray=function(){return this.take(qe)},Oi(bt.prototype,function(s,d){var m=/^(?:filter|find|map|reject)|While$/.test(d),C=/^(?:head|last)$/.test(d),E=N[C?"take"+(d=="last"?"Right":""):d],j=C||/^find/.test(d);E&&(N.prototype[d]=function(){var U=this.__wrapped__,q=C?[1]:arguments,G=U instanceof bt,ue=q[0],he=G||Ze(U),ge=function(pt){var _t=E.apply(N,_i([pt],q));return C&&Ae?_t[0]:_t};he&&m&&typeof ue=="function"&&ue.length!=1&&(G=he=!1);var Ae=this.__chain__,Le=!!this.__actions__.length,Ke=j&&!Ae,dt=G&&!Le;if(!j&&he){U=dt?U:new bt(this);var We=s.apply(U,q);return We.__actions__.push({func:Gs,args:[ge],thisArg:l}),new Er(We,Ae)}return Ke&&dt?s.apply(this,q):(We=this.thru(ge),Ke?C?We.value()[0]:We.value():We)})}),tr(["pop","push","shift","sort","splice","unshift"],function(s){var d=Io[s],m=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",C=/^(?:pop|shift)$/.test(s);N.prototype[s]=function(){var E=arguments;if(C&&!this.__chain__){var j=this.value();return d.apply(Ze(j)?j:[],E)}return this[m](function(U){return d.apply(Ze(U)?U:[],E)})}}),Oi(bt.prototype,function(s,d){var m=N[d];if(m){var C=m.name+"";It.call(Ro,C)||(Ro[C]=[]),Ro[C].push({name:d,func:m})}}),Ro[Xa(l,z).name]=[{name:"wrapper",func:l}],bt.prototype.clone=Vd,bt.prototype.reverse=rm,bt.prototype.value=im,N.prototype.at=$f,N.prototype.chain=Hf,N.prototype.commit=Uf,N.prototype.next=$m,N.prototype.plant=Lu,N.prototype.reverse=qf,N.prototype.toJSON=N.prototype.valueOf=N.prototype.value=Kf,N.prototype.first=N.prototype.head,H&&(N.prototype[H]=Wf),N},Qi=rc();Sr?((Sr.exports=Qi)._=Qi,Yo._=Qi):yn._=Qi}).call(an)})(Ag,Ag.exports);var tP=Ag.exports;const nP=Eg(tP),rP=(h,g=!0)=>{const[l,p]=Y.useState("idle"),[_,w]=Y.useState(void 0),[v,x]=Y.useState(void 0),P=Y.useRef(!1),F=Y.useCallback(y=>(p("pending"),x(null),h(y).then(R=>{P.current&&(w(R),p("success"))}).catch(R=>{P.current&&(x(R),p("error"))})),[h]);return Y.useEffect(()=>{g&&F()},[F,g]),Y.useEffect(()=>(P.current=!0,()=>{P.current=!1}),[]),{execute:F,status:l,value:_,error:v,setValue:w,setStatus:p}},$0={noOptionsMessage:()=>"Không có lựa chọn",placeholder:"Nhấp để chọn",loadingMessage:()=>"Đang tìm kiếm",menuPosition:"fixed"},pg=10,iP={display:"flex",alignItems:"center",justifyContent:"space-between"},oP={backgroundColor:"#EBECF0",borderRadius:"2em",color:"#172B4D",display:"inline-block",fontSize:12,fontWeight:"normal",lineHeight:"1",minWidth:1,padding:"0.16em 0.5em",textAlign:"center"},sP=Y.forwardRef(({onChange:h,id:g,name:l,placeholder:p,getOptionLabel:_,getOptionValue:w,onAdd:v,value:x,disabled:P,endPoint:F,fieldLabel:y,fieldValue:R,isClearable:$,isGroup:B,conditions:V,keySearch:ee,...Z},z)=>{const[re,X]=Y.useState(null),[ne,ie]=Y.useState([]),[ae,_e]=Y.useState([]),[Se,Pe]=Y.useState(null),Me=Y.useRef(),Re=Y.useRef(),ce=Y.useRef(null);p&&($0.placeholder=p),Y.useEffect(()=>{V&&(ie([]),_e([]),Me.current={top:pg,skip:0},Re.current={top:pg,skip:0},ce.current=V)},[V]),Y.useEffect(()=>(Me.current={top:pg,skip:0},Re.current={top:pg,skip:0},()=>{ce.current=null}),[]);const pe=(je,ut,De)=>{let Oe="";if(ut){const{top:tt,skip:ht}=Re.current;De?Oe+=`&$top=${tt}&$skip=${ht}&$inlinecount=allpages`:(Re.current.skip=0,Oe+=`&$top=${tt}&$skip=0&$inlinecount=allpages`)}else{const{top:tt,skip:ht}=Me.current;Oe+=`&$top=${tt}&$skip=${ht}&$inlinecount=allpages`}return je.length>0&&(Oe+=je.reduce((tt,ht,kt)=>{const Kt=kt===je.length-1?"":",";return tt+=`${ht}${Kt}`,tt},"&$select=")),Oe},be=Y.useCallback(async(je,ut)=>{if(F){let De=pe([y,R],je,ut),Oe=[];(V&&V.length>0||ce.current&&ce.current.length>0)&&((V.length>0?V:ce.current).map((Ee,yt)=>Ee.expression==="in"?Oe.push(`${Ee.field} ${Ee.expression} (${Ee.value})`):Oe.push(`${Ee.field} ${Ee.expression} ${Ee.value}`)),Oe=Oe.join(" or "),De=`${De}&$filter=${Oe}`),je&&(De.indexOf("$filter")>-1?De+=` and substringof('${je}',${y})`:De+=`&$filter=substringof('${je}',${y})`);const{value:tt,...ht}=await F(`${De}`),kt=Kt=>{let Ee=[...Kt];return ut?Ee=[...Ee,...tt]:Ee=tt,Ee};return je?(Re.current.count=parseInt(ht["odata.count"]),_e(kt)):(Me.current.count=parseInt(ht["odata.count"]),ie(kt)),tt}return[]},[V,F,y,R]),ke=Y.useCallback(({curSearch:je,preSearch:ut,isScroll:De}={})=>{if(je){if(je!=="")return Pe(je),new Promise(Oe=>{setTimeout(()=>Oe(be(je,De)),1e3)})}else return je!==""?(Pe(null),_e([]),Re.current.count=0,new Promise(Oe=>{setTimeout(()=>Oe(be(null,De)),1e3)})):(Re.current.count=0,Promise.resolve([]))},[be]),{execute:ye,status:Ce}=rP(ke,!1);Y.useEffect(()=>{x&&X(x)},[x]),Y.useCallback(async je=>{const ut=await ke(),[De]=ut.filter(Oe=>Oe[w||"value"]===je);return De||null},[w,ke]);const ze=Y.useCallback((je,ut)=>{const{count:De}=Me.current;Me.current.skip+=ut,Me.current.skip<=De&&ye({curSearch:je,preSearch:je,isScroll:!0})},[ye]),He=Y.useCallback(je=>{h(je||[])},[h]),Ge=Y.useCallback(nP.debounce(ye,1e3),[]),qe=Y.useCallback((je,ut)=>{Ge({curSearch:je,preSearch:ut})},[Ge]),gt=je=>A.jsxs("div",{style:iP,children:[A.jsx("span",{children:je.label}),A.jsx("span",{style:oP,children:je.options.length})]});return A.jsx(eP,{children:A.jsxs(kC,{className:v&&"d-flex justify-content-between basic-single",children:[A.jsx(xg,{className:"pr-0",children:A.jsx(Zx,{...Z,isMulti:!0,onMenuScrollToBottom:()=>ze(Se,10),options:Se?ae:ne,isLoading:Ce==="pending",isDisabled:P,defaultOptions:!0,value:re,name:l,onChange:He,onInputChange:je=>qe(je,Se),getOptionValue:w,getOptionLabel:_,inputId:l,id:g,instanceId:l,onMenuClose:()=>{Pe(null),_e([])},onMenuOpen:()=>ne.length===0&&ye({curSearch:null,preSearch:null,isScroll:!1}),...$0,isClearable:$,formatGroupLabel:B?gt:{}})}),v&&A.jsx(xg,{md:"1",className:"pl-0",children:A.jsx(Pg,{className:"h-100",onClick:v})})]})})}),aP=Y.memo(sP);const lP=({value:h,thonXom:g,title:l,onChange:p,placeholder:_,disabledTinh:w,disabledQuanHuyen:v})=>{var ee;const[x,P]=Y.useState(""),[F,y]=Y.useState(!1),[R,$]=Y.useState({IdTinh:"52",IdQuan:v?(ee=Vn)==null?void 0:ee.MaQuanHuyen:null,IdPhuong:h,IdThon:null});Y.useEffect(()=>{h&&Bn(`PhuongXas(${h})?$expand=QuanHuyen/TinhThanh`).then(Z=>{P(`${Z.TenPhuongXa}, ${Z.QuanHuyen.TenQuanHuyen}, ${Z.QuanHuyen.TinhThanh.TenTinhThanh}`),B("IdTinh",Z.QuanHuyen.MaTinhThanh),B("IdQuan",Z.QuanHuyen.MaQuanHuyen),B("IdPhuong",Z.MaPhuongXa),g&&Bn(`ThonXoms(${g})`).then(z=>{B("IdThon",z.Id),P(re=>`Thôn ${z.Ten}, ${re}`)})})},[g,h]);const B=(Z,z)=>{fw($,Z,z)},V=()=>{P(""),y(!1),$({IdTinh:"54",IdQuan:null,IdPhuong:h,IdThon:null}),p(null,null)};return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"form-input-location",children:[A.jsx(Cl,{style:{cursor:"pointer"},onClick:()=>y(!0),value:x,placeholder:_||"Chọn vị trí"}),x&&A.jsx("div",{onClick:V,className:"clear",children:A.jsx(kn,{fa:"times"})})]}),A.jsxs(da,{zIndex:3900,isOpen:F,toggle:()=>y(Z=>!Z),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(Br,{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:R==null?void 0:R.IdTinh,inline:!1,onChange:(Z,z)=>{B(["IdTinh"],z),B(["IdQuan"],null),B(["IdPhuong"],null),B(["IdThon"],null)}}),A.jsx(Br,{data:{title:"Quận/Huyện",required:!0,type:"data-select",disabled:v,dataSelect:{url:"QuanHuyens",value_field:"MaQuanHuyen",text_field:"TenQuanHuyen",placeholder:"Chọn Quận/Huyện",where:`MaTinhThanh eq '${R.IdTinh}'`}},value:R==null?void 0:R.IdQuan,inline:!1,onChange:(Z,z)=>{B(["IdQuan"],z),B(["IdPhuong"],null),B(["IdThon"],null)}}),A.jsx(Br,{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 '${R.IdQuan}'`}},value:R==null?void 0:R.IdPhuong,inline:!1,onChange:(Z,z)=>{B(["IdPhuong"],z),B(["IdThon"],null)}}),g!==void 0&&A.jsx(Br,{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 '${R.IdPhuong}'`}},value:R==null?void 0:R.IdThon,inline:!1,onChange:(Z,z)=>{B(["IdThon"],z)}})]})]}),A.jsx(Ah,{children:A.jsx(Pg,{onClick:()=>{p&&p(R.IdPhuong,R.IdThon),y(!1)},disabled:!R.IdPhuong,children:"Lưu"})})]})]})};function cP(h,g){Y.useEffect(()=>{const l=p=>{!h.current||h.current.contains(p.target)||g(p)};return document.addEventListener("mousedown",l),document.addEventListener("touchstart",l),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("touchstart",l)}},[h,g])}function uI(h){h=h.startsWith("?")?h.substring(1):h;const g={};return h.split("&").forEach(l=>{const[p,_]=l.split("=");g[p]=_}),g}const dP=({value:h,onChange:g,disabled:l,onKeyPress:p,placeholder:_,title:w,bound:v})=>{const[x,P]=Y.useState({status:null,text:null}),F=Y.useRef();let y=(v==null?void 0:v.min)||9,R=(v==null?void 0:v.max)||12;cP(F,()=>{x.status==="error"&&g(null)});const $=Y.useCallback(B=>{if(g(B),B&&B.length!==y&&B.length!==R){P({status:"error",text:`Nhập đủ ${y} hoặc ${R} số`});return}if(!B){P({status:null,text:null});return}(B.length===y||B.length===R)&&P({status:"success",text:`Định dạng ${w||"CMND/CCCD"} hợp lệ.`})},[R,y,g,w]);return A.jsx(A.Fragment,{children:A.jsxs("div",{ref:F,className:"position-relative",children:[A.jsx(Cl,{disabled:l,className:` ${x.status==="error"?"error-input":x.status==="success"&&"success-input"}`,type:"number",onChange:B=>{$(B.target.value)},onKeyPress:B=>{var V,ee,Z,z;(((ee=(V=B==null?void 0:B.target)==null?void 0:V.value)==null?void 0:ee.length)===y||((z=(Z=B==null?void 0:B.target)==null?void 0:Z.value)==null?void 0:z.length)===R)&&p(B)},value:h,placeholder:_||`Nhập số ${w||"CMND/CCCD"}`}),h&&A.jsx("p",{className:`text-conform-input-check-cmnd ${x.status==="error"?"error-text-confim":x.status==="success"&&"success-text-confim"}`,children:x.text})]})})},uP=({value:h,title:g,onChange:l,placeholder:p})=>{var $,B,V,ee;const[_,w]=Y.useState(""),[v,x]=Y.useState(!1),[P,F]=Y.useState({IdTinh:"52",IdQuan:(($=Vn)==null?void 0:$.MaQuanHuyen)||null,IdPhuong:(B=Vn)==null?void 0:B.MaPhuongXa,IdThon:h});Y.useEffect(()=>{h&&Bn(`ThonXoms(${h})?$expand=PhuongXa/QuanHuyen`).then(Z=>{w(`${Z.Ten}, ${Z.PhuongXa.TenPhuongXa}, ${Z.PhuongXa.QuanHuyen.TenQuanHuyen}, Tỉnh Bình Định`),F(z=>({...z,IdQuan:Z.PhuongXa.QuanHuyen.MaQuanHuyen,IdPhuong:Z.PhuongXa.MaPhuongXa,IdThon:Z.Id}))})},[h]);const y=(Z,z)=>{fw(F,Z,z)},R=()=>{var Z,z;w(""),x(!1),F({IdTinh:"54",IdQuan:((Z=Vn)==null?void 0:Z.MaQuanHuyen)||null,IdPhuong:(z=Vn)==null?void 0:z.MaPhuongXa,IdThon:null}),l(null,null)};return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"form-input-location",children:[A.jsx(Cl,{style:{cursor:"pointer"},onClick:()=>x(!0),value:_,placeholder:p||"Chọn vị trí"}),_&&A.jsx("div",{onClick:R,className:"clear",children:A.jsx(kn,{fa:"times"})})]}),A.jsxs(da,{zIndex:1500,isOpen:v,toggle:()=>x(Z=>!Z),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:[g||"Thôn xóm"," :"]})]}),A.jsxs("div",{style:{display:"grid",gap:"1rem"},className:"w-100",children:[A.jsx(Br,{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:(Z,z)=>{y(["IdTinh"],z),y(["IdQuan"],null),y(["IdPhuong"],null),y(["IdThon"],null)}}),A.jsx(Br,{data:{title:"Quận/Huyện",required:!0,type:"data-select",disabled:(V=Vn)==null?void 0:V.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:(Z,z)=>{y(["IdQuan"],z),y(["IdPhuong"],null),y(["IdThon"],null)}}),A.jsx(Br,{data:{title:"Phường/Xã",required:!0,type:"data-select",disabled:(ee=Vn)==null?void 0:ee.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:(Z,z)=>{y(["IdPhuong"],z),y(["IdThon"],null)}}),A.jsx(Br,{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:(Z,z)=>{y(["IdThon"],z)}})]})]}),A.jsx(Ah,{children:A.jsx(Pg,{onClick:()=>{l&&l(P.IdThon),x(!1)},disabled:!P.IdThon,children:"Lưu"})})]})]})},hP=({value:h,onChange:g,placeholder:l})=>{const[p,_]=Y.useState();let w=new Date().getFullYear();return A.jsx(A.Fragment,{children:A.jsx(iC,{value:p||h,onBlur:()=>{p!==0&&(+p<1e3||+p>w)&&yg("Bạn chưa nhập đúng định dạng năm!")},onChange:v=>{_(+v.target.value),+v.target.value>=1e3&&+v.target.value<=w&&g(+v.target.value)},placeholder:l||"Nhập năm"})})};class hw extends Y.Component{render(){const{value:g,onChange:l,disabled:p}=this.props,_=()=>{let w=[];for(var v=1;v<=31;v++)w.push({value:v,label:`Ngày ${v}`});return w};return A.jsx(N_,{disabled:p,value:g||"",onChange:l,options:_(),valueRef:"value",labelRef:"label",placeholder:"Chọn ngày"})}}hw.propTypes={};hw.defaultProps={placeholder:"Chọn..."};const fP=({value:h,title:g,onChange:l,placeholder:p})=>{var R,$;const[_,w]=Y.useState(""),[v,x]=Y.useState(!1),[P,F]=Y.useState({IdTinh:"54",IdQuan:((R=Vn)==null?void 0:R.MaQuanHuyen)||null,IdPhuong:($=Vn)==null?void 0:$.MaPhuongXa,IdThon:h});Y.useEffect(()=>{h&&Bn(`ThonXoms(${h})?$expand=PhuongXa/QuanHuyen`).then(B=>{w(`Thôn ${B.Ten}, ${B.PhuongXa.TenPhuongXa}, ${B.PhuongXa.QuanHuyen.TenQuanHuyen}, Tỉnh Bình Định`),F(V=>({...V,IdQuan:B.PhuongXa.QuanHuyen.MaQuanHuyen,IdPhuong:B.PhuongXa.MaPhuongXa,IdThon:B.Id}))})},[h]);const y=(B,V)=>{fw(F,B,V)};return A.jsxs(A.Fragment,{children:[A.jsx(Cl,{style:{cursor:"pointer"},onClick:()=>x(!0),value:_,placeholder:p||"Chọn vị trí"}),A.jsxs(da,{zIndex:3900,isOpen:v,toggle:()=>x(B=>!B),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:[g||"Thôn xóm"," :"]})]}),A.jsxs("div",{style:{display:"grid",gap:"1rem"},className:"w-100",children:[A.jsx(Br,{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:(B,V)=>{y(["IdTinh"],V),y(["IdQuan"],null),y(["IdPhuong"],null),y(["IdThon"],null)}}),A.jsx(Br,{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:(B,V)=>{y(["IdQuan"],V),y(["IdPhuong"],null),y(["IdThon"],null)}}),A.jsx(Br,{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:(B,V)=>{y(["IdPhuong"],V),y(["IdThon"],null)}})]})]}),A.jsx(Ah,{children:A.jsx(Pg,{onClick:()=>{l&&l(P.IdQuan),x(!1)},children:"Lưu"})})]})]})};const i1=({getFile:h,reset:g,name:l,required:p,onChange:_,value:w,url:v,isDetail:x,disabled:P})=>{const F=Y.useRef(),[y,R]=Y.useState(null),[$,B]=Y.useState(100),[V,ee]=Y.useState("select"),[Z,z]=Y.useState(!0);Y.useEffect(()=>{Z&&w&&R({name:w})},[w]);const re=ae=>{var _e,Se,Pe;z(!1),ae.target.files&&ae.target.files.length>0&&(R((_e=ae==null?void 0:ae.target)==null?void 0:_e.files[0]),h&&h((Se=ae==null?void 0:ae.target)==null?void 0:Se.files[0]),_(l,(Pe=ae==null?void 0:ae.target)==null?void 0:Pe.files[0]))},X=()=>{var ae,_e;(ae=F==null?void 0:F.current)!=null&&ae.click&&((_e=F==null?void 0:F.current)==null||_e.click())},ne=()=>{F.current.value="",R(null),h&&h(null),B(0),ee("select"),g&&g()},ie=()=>{Gx(v,w)};return A.jsxs("div",{className:"form-input-file-custom",children:[A.jsx("input",{ref:F,name:l,required:p,disabled:P,type:"file",onChange:re,style:{display:"none"}}),!y&&A.jsxs("button",{className:`file-btn ${P?"file-btn-disabled":""}`,onClick:X,children:[A.jsx(kn,{fa:"upload"})," ",P?"Không có File":"Upload File",A.jsx("h6",{children:P?"Không có dữ liệu để hiển thị!":"Chọn File bạn muốn tải lên"})]}),y&&A.jsx(A.Fragment,{children:A.jsxs("div",{className:"file-card",children:[A.jsx("div",{className:"icon-file-card",children:A.jsx(kn,{fa:"trello"})}),A.jsxs("div",{className:"file-info",children:[A.jsxs("div",{style:{flex:1},children:[A.jsx("h6",{onClick:()=>w&&v&&ie(),children:y==null?void 0:y.name}),A.jsx("div",{className:"progress-bg",children:A.jsx("div",{className:"progress"})})]})," ",w&&v&&Z&&A.jsx("button",{onClick:()=>w&&v&&ie(),children:A.jsx(kn,{fa:"download"})}),!x&&A.jsx(A.Fragment,{children:V==="select"?A.jsx("button",{onClick:ne,children:A.jsx(kn,{fa:"times"})}):A.jsx("div",{className:"check-circle",children:V==="uploading"?`${$}%`:V==="done"?A.jsx("span",{class:"material-symbols-outlined",style:{fontSize:"20px"},children:"check"}):null})})]})]})})]})};function o1(h){var g,l,p="";if(typeof h=="string"||typeof h=="number")p+=h;else if(typeof h=="object")if(Array.isArray(h))for(g=0;g<h.length;g++)h[g]&&(l=o1(h[g]))&&(p&&(p+=" "),p+=l);else for(g in h)h[g]&&(p&&(p+=" "),p+=g);return p}function pP(){for(var h,g,l=0,p="";l<arguments.length;)(h=arguments[l++])&&(g=o1(h))&&(p&&(p+=" "),p+=g);return p}var gP=function(g){return{root:{display:"block",backgroundColor:pC(g.palette.text.primary,g.palette.type==="light"?.11:.13),height:"1.2em"},text:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 60%",transform:"scale(1, 0.60)",borderRadius:g.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(g.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"}}},mP=Y.forwardRef(function(g,l){var p=g.animation,_=p===void 0?"pulse":p,w=g.classes,v=g.className,x=g.component,P=x===void 0?"span":x,F=g.height,y=g.variant,R=y===void 0?"text":y,$=g.width,B=R_(g,["animation","classes","className","component","height","variant","width"]),V=!!B.children;return Y.createElement(P,wg({ref:l,className:pP(w.root,w[R],v,V&&[w.withChildren,!$&&w.fitContent,!F&&w.heightAuto],_!==!1&&w[_])},B,{style:wg({width:$,height:F},B.style)}))});const M_=ny(gP,{name:"MuiSkeleton"})(mP),bP=({maPhuongXa:h,maThonXom:g})=>{const[l,p]=Y.useState(void 0);return Y.useEffect(()=>{h&&Bn(`PhuongXas?$filter=MaPhuongXa eq '${h}' &$expand=QuanHuyen,QuanHuyen/TinhThanh`).then(({value:[_]})=>{p(`${_.TenPhuongXa}, ${_.QuanHuyen.TenQuanHuyen}, ${_.QuanHuyen.TinhThanh.TenTinhThanh}`),g&&Bn(`ThonXoms(${g})`).then(w=>{p(v=>`Thôn ${w==null?void 0:w.Ten}, `+v)})})},[h,g]),l===void 0?A.jsxs("div",{children:[A.jsx(M_,{width:250}),A.jsx(M_,{width:100})]}):l},vP=({value:h})=>{const[g,l]=Y.useState(void 0);return Y.useEffect(()=>{h&&Bn(`ThonXoms(${h})?$expand=PhuongXa/QuanHuyen`).then(p=>{l(`${p.Ten}, ${p.PhuongXa.TenPhuongXa}, ${p.PhuongXa.QuanHuyen.TenQuanHuyen}, Tỉnh Bình Định`)})},[h]),g===void 0?A.jsx("div",{children:A.jsx(M_,{width:100})}):g},_P=({item:h,data:g,fullScreen:l,close:p})=>{var w,v,x,P,F,y,R,$;let _=(h==null?void 0:h.type)==="select-async-multi"?g==null?void 0:g[h==null?void 0:h.field]:h!=null&&h.fieldExpand?zC(g,h==null?void 0:h.fieldExpand):g[h==null?void 0:h.field]||g[h==null?void 0:h.field]===!1||g[h==null?void 0:h.field]===0?h!=null&&h.dataSelect?(w=h==null?void 0:h.dataSelect)!=null&&w.urlExpand?g[(v=h==null?void 0:h.dataSelect)==null?void 0:v.urlExpand][(x=h==null?void 0:h.dataSelect)==null?void 0:x.text_field]:g[(P=h==null?void 0:h.dataSelect)==null?void 0:P.url][(F=h==null?void 0:h.dataSelect)==null?void 0:F.text_field]:g[h==null?void 0:h.field]:null;return A.jsx(A.Fragment,{children:!(h!=null&&h.hidden)&&!(h!=null&&h.hiddenDetail)&&D_((y=h==null?void 0:h.dependent)==null?void 0:y.name,g[(R=h==null?void 0:h.dependent)==null?void 0:R.name],($=h==null?void 0:h.dependent)==null?void 0:$.comparison)&&A.jsxs("div",{className:`form-item-detail ${h!=null&&h.childern?"form-item-detail-childern":""}`,children:[!(h!=null&&h.hiddenLabel)&&A.jsxs("div",{className:"mb-2 ms-2",children:[h.title,A.jsx("span",{style:h!=null&&h.hiddenLabel?{color:"transparent"}:{},children:":"})]}),A.jsxs("div",{style:h!=null&&h.style?h==null?void 0:h.style:l?{background:"white",padding:"0"}:{},className:`value-detail-custom ${(h==null?void 0:h.type)==="textarea"?"value-detail-custom-textarea":""}`,children:[h!=null&&h.fieldExpand?_:g[h==null?void 0:h.field]!==void 0&&g[h==null?void 0:h.field]!==null&&g[h==null?void 0:h.field]!==""?wP(h.type,_,h):A.jsx(A.Fragment,{children:A.jsx("i",{className:"text-muted",children:"Chưa có thông tin..."})}),(h==null?void 0:h.btnClose)&&p&&A.jsx(A.Fragment,{children:A.jsxs(Qn,{onClick:p,className:"btn-close-in-item",children:[A.jsx(kn,{style:{marginTop:"0.1rem"},fa:"gg"}),"Thay đổi"]})}),(h==null?void 0:h.childern)&&A.jsx(A.Fragment,{children:h==null?void 0:h.childern})]})]})})},wP=(h,g,l)=>{var p,_,w;switch(h){case"date":return Z0(g);case"datetime":return X0(g);case"number":return cd(g);case"currency":return cd(g);case"input-hpx":return A.jsx(bP,{maPhuongXa:g});case"input-thon-xom":return A.jsx(vP,{value:g});case"checkbox":return g?"Có":"Không";case"boolean":return g?"Có":"Không";case"radio-list":return l!=null&&l.dataSelect?g:((p=l==null?void 0:l.data)==null?void 0:p.length)&&((w=(_=l==null?void 0:l.data)==null?void 0:_.filter(v=>(v==null?void 0:v.value)===g)[0])==null?void 0:w.label);case"input-file":return A.jsx("div",{className:"my-2",children:A.jsx(i1,{value:g,isDetail:!0,url:l==null?void 0:l.url,disabled:!0})});case"select-async-multi":return typeof g!="string"&&(g!=null&&g.length)?g.map(v=>{var x;return v==null?void 0:v[(x=l==null?void 0:l.dataSelect)==null?void 0:x.text_field]}).join(", "):"";default:return g}},kP=(h,g)=>{const l=[],p=g!=null&&g.length?new Map(g.map(_=>[_.position,_])):[];return g!=null&&g.length&&h.forEach((_,w)=>{if(l.push(_),p.has(w)){const{component:v,title:x,style:P}=p.get(w);l.push({component:v,title:x,style:P})}}),g!=null&&g.length?l:h},yP=({listFormControl:h,data:g,children:l,isFormControl:p,close:_})=>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(a_,{item:w})})),g&&kP(h,l?l.filter(w=>typeof(w==null?void 0:w.position)=="number"&&!(w!=null&&w.hidden)):[]).map(w=>{var v,x,P;return A.jsx(A.Fragment,{children:w!=null&&w.component?A.jsx(a_,{item:w}):A.jsx(A.Fragment,{children:!!((v=w==null?void 0:w.children)!=null&&v.length)&&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}),!!((x=w==null?void 0:w.children)!=null&&x.length)&&g&&A.jsx("div",{style:p?{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:oy(w==null?void 0:w.ratio)},className:"form-body-group pb-4",children:(P=w==null?void 0:w.children)==null?void 0:P.map(F=>A.jsx(A.Fragment,{children:A.jsx(_P,{close:_,item:F,data:g})}))})})})]})})})}),l&&l.filter(w=>(w==null?void 0:w.position)!=="top"&&typeof(w==null?void 0:w.position)!="number"&&(w==null?void 0:w.component)&&!(w!=null&&w.hidden)).map(w=>A.jsx(A.Fragment,{children:A.jsx(a_,{item:w})}))]}),a_=({item:h})=>A.jsx(A.Fragment,{children:A.jsxs("div",{children:[(h==null?void 0:h.title)&&A.jsx("h6",{className:"title-tab-name",children:h==null?void 0:h.title}),A.jsx("div",{style:h!=null&&h.style?h==null?void 0:h.style:h!=null&&h.title?{}:{borderRadius:"10px"},className:"form-group",children:h==null?void 0:h.component})]})}),xP=Y.forwardRef(({Id:h,columns:g,children:l,close:p,title:_,url:w,isDetail:v,disabled:x,isFormControl:P,titleSecond:F,getData:y,apiGetData:R,defaultValue:$},B)=>{let V=g.filter(ae=>ae.type||ae.tabName),ee=iy(V)||[];const[Z,z]=Y.useState(),[re,X]=Y.useState(!0);Y.useEffect(()=>{$&&z($)},[$]),Y.useEffect(()=>{Z&&re&&(y&&y(Z),X(!1))},[Z]),Y.useImperativeHandle(B,()=>({loadData(){ie()},close(){p()}}));const ne=ae=>typeof ae=="string"?`'${ae}'`:ae,ie=Y.useCallback(()=>{let ae=R||`${w}(${ne(h)})${Mk(g)?`?$expand=${Mk(g)}`:""}`;w&&Bn(ae,"GET",null,{odata:!R}).then(_e=>{z(Se=>({...Se,..._e}))})},[h,R,g,w]);return Y.useEffect(()=>{ie()},[ie]),Y.useEffect(()=>{const ae=_e=>{_e.key==="Escape"&&p()};return document.addEventListener("keydown",ae),()=>{document.removeEventListener("keydown",ae)}},[p]),A.jsx(A.Fragment,{children:A.jsx(CP,{form:P?"div":"modal",close:p,children:A.jsxs("div",{onClick:ae=>ae.stopPropagation(),style:P?{padding:0}:{},className:`form-detail-custom ${P?"bg-white":(V.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:[_!==!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 ",F||""]})}),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(kn,{fa:"500px"}),"ID Dữ liêu: ",h]}),!v&&A.jsxs(A.Fragment,{children:[A.jsx("p",{style:{fontSize:"20px"},className:"mb-1 text-muted",children:"|"}),A.jsx(Qn,{onClick:p,style:{boxShadow:"none",fontSize:"20px"},className:"btn-close"})]})]})]}),Z&&A.jsx(yP,{listFormControl:ee,isFormControl:P,title:_,data:Z,children:l,close:P&&!v&&!x?p:!1}),!(g!=null&&g.find(ae=>ae.btnClose===!0))&&P&&!v&&Z&&!x&&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(Qn,{onClick:p,children:"Thay đổi lựa chọn"})})})})]})})})}),CP=({children:h,form:g,close:l})=>{switch(g){case"modal":return A.jsx(da,{size:"xl",zIndex:1500,onClick:()=>l&&l(),toggle:()=>l(),isOpen:!0,className:"outline-form-detail-custom",children:h});case"div":return A.jsx("div",{children:h})}},TP=({columns:h,onChange:g})=>{const[l,p]=Y.useState(gg(h)),[_,w]=Y.useState(!1),[v,x]=Y.useState(!0);let P=Object.values(l);Y.useEffect(()=>{let y=P.join(",").replace(/,/g,"").length===0;v?!y&&g(Nk(h,l),l):g(Nk(h,l),l)},[l]);const F=(y,R)=>{x(!1),p($=>({...u_(h,$,y,R),[y]:R}))};return A.jsx(A.Fragment,{children:!!(h!=null&&h.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(kn,{fa:"search"})}),A.jsx("p",{style:{fontSize:"20px"},className:"mb-1 text-muted",children:"|"}),A.jsxs("div",{className:"form-item-search-table-custom",children:[h.slice(0,!_&&h.length>5?4:h.length).map(y=>{var R,$,B;return A.jsx(A.Fragment,{children:D_((R=y==null?void 0:y.dependent)==null?void 0:R.name,l[($=y==null?void 0:y.dependent)==null?void 0:$.name],(B=y==null?void 0:y.dependent)==null?void 0:B.comparison)&&A.jsxs("div",{className:"position-relative",children:[(l[y==null?void 0:y.field]||l[y==null?void 0:y.field]===0)&&A.jsx("p",{className:"mb-0 title-item-search",children:y.title}),ay(y.type)?A.jsx(A.Fragment,{children:A.jsx(Cl,{onKeyPress:V=>{V.charCode===13&&F(y==null?void 0:y.field,V.target.value)},onBlur:V=>{l[y.field]&&V.target.value===""&&F(y==null?void 0:y.field,"")},placeholder:`Nhập ${y.title}`,defaultValue:l?l[y==null?void 0:y.field]:null})}):A.jsx(Br,{data:{...y,hidden_label:!0,disabled:!1,...sy(y,l)},value:l?l[y==null?void 0:y.field]:null,onChange:(V,ee)=>{F(y==null?void 0:y.field,ee)}})]})})}),h.length>5&&A.jsx(A.Fragment,{children:A.jsx("div",{className:`form-btn-search-extend ${_?"form-btn-search-extend-close":""}`,children:A.jsxs(Qn,{onClick:()=>w(y=>!y),children:[A.jsx(kn,{fa:_?"angle-up":"filter"}),A.jsx("span",{children:"Tìm kiếm mở rộng"})]})})})]})]})})})},SP=Y.forwardRef(({title:h,titleSecond:g,titleAdd:l,url:p,columns:_,listSearch:w,where:v,childrenModal:x,beforSaving:P,afterSaving:F,getId:y,getData:R,openDetailSave:$,value:B,onChange:V,isDetail:ee,isEdit:Z,isAdd:z,onRowClick:re,onAdd:X,onEdit:ne,onDelete:ie,isDelete:ae,addValue:_e,defaultValue:Se,deleteValue:Pe,apiGetData:Me,apiUrl:Re,method:ce,urlExt:pe,getDataSearch:be,formAddAction:ke,isFormControl:ye,save:Ce,isToolBar:ze,saveAndContinue:He,renderSearch:Ge},qe)=>{var mt;const[gt,je]=Y.useState(!1),[ut,De]=Y.useState(B||B===0?B:null),Oe=_!=null&&_.length?_.filter(Fe=>(Fe==null?void 0:Fe.table)||(Fe==null?void 0:Fe.dataID)):[],tt=Y.useRef(),ht=Y.useCallback(()=>tt.current&&tt.current.onQueryChange(),[tt]),kt=_.filter(Fe=>Fe.dataID)[0].field,[Kt,Ee]=Y.useState([]),[yt,on]=Y.useState({}),we=Y.useRef(),Ne=Y.useRef();return Y.useImperativeHandle(qe,()=>({reloadTable(){ht()},reloadDetail(){we.current.loadData()},reloadModal(){Ne.current.loadData()},closeModal(){Ne.current.close()},closeDetail(){we.current.close()}})),Y.useEffect(()=>{B&&De(B)},[B]),A.jsx(A.Fragment,{children:((mt=Pk(Oe))==null?void 0:mt.length)&&A.jsxs("div",{className:`form-table-auto-custom position-relative ${ye?"form-table-auto-custom-form-control":""}`,children:[A.jsx("div",{className:"form-add-btn-action",style:z!==!1&&X!==!1?{right:"14.5rem"}:{right:"6.5rem"},children:ke}),A.jsx(xC,{title:h,url:pe?!1:p,urlExt:pe,columns:Pk(Oe),fomrSearch:A.jsx(TP,{columns:w?[..._.filter(Fe=>Fe.searchable),...w]:_.filter(Fe=>Fe.searchable),onChange:(Fe,Ye)=>{be&&be(Ye),on(Ye),Ee(Fe),ht()}}),where:Ge?v?[...Ge(yt,Kt),v].join(" and "):Ge(yt,Kt).join(" and "):v?[...Kt,v].join(" and "):[...Kt].join(" and "),tableRef:tt,SearchAdvanced:()=>A.jsx(A.Fragment,{}),onRowClick:!ye&&ee!==!1?(Fe,Ye)=>{re?re(Ye):(De(Ye[kt]),y&&y(Ye[kt],!0))}:void 0,onEdit:!ye&&Z!==!1&&ne!==!1?{onClick:(Fe,Ye)=>{ne?ne(Ye):(je(Ye[kt]),y&&y(Ye[kt],!1))}}:!1,onAdd:z!==!1&&X!==!1?{onClick:(Fe,Ye)=>{X?X(Ye):(je(!0),y&&y(null,!1))}}:!1,onActions:ye&&[{icon:"tag",tooltip:"Chọn",onClick:(Fe,Ye)=>{De(Ye[kt]),y&&y(Ye[kt],!0),V&&V(Ye[kt],Ye)}}],onDelete:ae===!1?!1:ie?{onClick:(Fe,Ye)=>ie(Ye)}:ye?!1:{}}),ut!==null&&!re&&A.jsx(A.Fragment,{children:A.jsx(xP,{apiGetData:Me,getData:R,ref:we,title:h,titleSecond:g,url:p,isDetail:ee,Id:ut,isFormControl:ye,defaultValue:Se,close:()=>{De(null),y&&y(null,!1),V&&V(null)},columns:_,children:x})}),(gt||gt===0)&&(!ne||!X)&&A.jsx(s1,{save:Ce,apiUrl:Re,apiGetData:Me,titleAdd:l,method:ce,getData:R,ref:Ne,isToolBar:ze,columns:_,open:gt||gt===0,deleteValue:Pe,saveAndContinue:He,close:()=>{je(!1),y&&y(null,!1)},Id:gt!==!0?gt:null,title:h,titleSecond:g,url:p,getId:Fe=>{y&&y(Fe,$),($||V)&&De(Fe),re&&$&&re(Fe),V&&V(Fe)},openDetailSave:$,beforSaving:P,afterSaving:(Fe,Ye,Vt)=>{ht(),F&&F(Fe,Ye,Vt)},isFormControl:ye,children:x,defaultValue:Se,addValue:_e})]})})}),AP=SP,EP=h=>{const g={};return h.split(" and ").forEach(p=>{const[_,w]=p.split(" eq ");g[_]=isNaN(w)?w.replace(/'/g,""):Number(w)}),g},PP=({textField:h,value:g,onChange:l,columns:p,where:_,url:w,disabled:v,title:x,placeholder:P})=>{const[F,y]=Y.useState(!1),[R,$]=Y.useState({Id:null,title:""});let B=_?EP(_):null;return Y.useEffect(()=>{g&&Bn(`${w}(${g})`).then(V=>{$(ee=>({...ee,title:V[h]}))})},[h,w,g]),A.jsxs(A.Fragment,{children:[A.jsx("div",{className:"form-select-table",children:A.jsxs(Qn,{className:"mb-3",onClick:()=>!v&&y(!0),disabled:v,children:[A.jsx(kn,{fa:"stack-overflow"}),"Danh sách"]})}),F&&A.jsx(da,{zIndex:1500,size:"xl",isOpen:F,toggle:()=>y(!1),children:A.jsx("div",{className:"p-4",children:A.jsx(AP,{url:w,title:x,columns:p,where:_,defaultValue:B,isFormControl:!0,onChange:V=>{l(V),y(!1)}})})})]})},fw=(h,g,l)=>{h(p=>({...p,[g]:l}))},IP=(h,g)=>{var B,V,ee,Z;let{data:l,onChange:p,onKeyDown:_,value:w,isDetail:v,onBlur:x,donVi:P,valueId:F,onKeyPress:y}=h;const R=z=>`Nhập ${z==null?void 0:z.toLowerCase()}`;switch(v&&l.type!=="data-select"?"label":l.type){case"number_current":return A.jsx(n1,{disabled:l.disabled,id:l.field_name,name:l.field_name,placeholder:"0",defaultValue:w,decimalsLimit:0,decimalScale:0,value:w,onValueChange:(z,re)=>{p&&p(l.field_name,parseFloat(z))},className:"number-format form-control-sm form-control text-right"});case"label":return A.jsx("span",{style:l.style,children:l.type==="datetime"?X0(w):l.type==="date"?Z0(w):l.type==="radio-list"?w===2?w="Thông báo giá":w="Kê khai giá":l.type==="numeric"?cd(w):w});case"textbox":return A.jsx(Cl,{style:{background:l.disabled?"#dedede":"inherit",textAlign:l.textAlign?l.textAlign:"left"},autoFocus:l.autoFocus,disabled:g||(l.disabled?l.disabled:!1),plaintext:l.plaintext||!1,name:l.field_name,value:w??"",onChange:z=>p&&p(z.target.name,z.target.value,z),onBlur:z=>x&&x(z.target.name,z.target.value),placeholder:l.placeholder?l.placeholder:R(l.title)});case"input-file":return A.jsx(i1,{name:l.field,url:l==null?void 0:l.url,value:w??"",disabled:g||(l.disabled?l.disabled:!1),onChange:(z,re)=>p&&p(z,re)});case"password":return A.jsx(hC,{style:{background:l.disabled?"#dedede":"inherit"},autoFocus:l.autoFocus,name:l.field_name,value:w??"",onChange:z=>p&&p(z.target.name,z.target.value),onBlur:z=>x&&x(z.target.name,z.target.value),placeholder:R(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(fC,{style:{background:l.disabled?"#dedede":"inherit"},autoFocus:l.autoFocus,rows:l.rows||7,disabled:l.disabled?l.disabled:!1,name:l.field_name,value:w??"",onChange:z=>p&&p(z.target.name,z.target.value),onBlur:z=>x&&x(z.target.name,z.target.value),onKeyDown:_,placeholder:R(l.title)});case"boolean":return A.jsx(h_,{autoFocus:l.autoFocus,disabled:l.disabled?l.disabled:!1,name:l.field_name,checked:w||!1,onChange:z=>p&&p(l.field_name,z),placeholder:R(l.title)});case"checkbox":return A.jsx(h_,{autoFocus:l.autoFocus,disabled:l.disabled?l.disabled:!1,name:l.field_name,checked:w||!1,onChange:z=>p&&p(l.field_name,z),placeholder:R(l.title)});case"datetime":return A.jsx(uC,{style:{background:l.disabled?"#dedede":"inherit"},autoFocus:l.autoFocus,disabled:l.disabled?l.disabled:!1,name:l.field_name,value:w,onChange:z=>p&&p(l.field_name,z),placeholderText:R(l.title)});case"date":return A.jsx(dC,{style:{background:l.disabled?"#dedede":"inherit"},autoFocus:l.autoFocus,disabled:l.disabled?l.disabled:!1,name:l.field_name,format:l.format,value:w,onChange:z=>p&&p(l.field_name,z),placeholderText:R(l.title),notFormat:l.notFormat});case"data-select":return l.dataSelect&&A.jsx(LP,{addFast:l.dataSelect.addFast,menuPosition:l.menuPosition,autoFocus:l.dataSelect.autoFocus,isDetail:v,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:(z,re)=>{p&&p(l.field_name,z,re)}});case"data-select-table":return l.dataSelect&&A.jsx(PP,{addFast:l.dataSelect.addFast,menuPosition:l.menuPosition,autoFocus:l.dataSelect.autoFocus,isDetail:v,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,title:l==null?void 0:l.title,value:w,placeholder:l.dataSelect.placeholder,onChange:(z,re)=>{p&&p(l.field_name,z,re)}});case"data-select-async":return l.dataSelect&&A.jsx(eC,{disabled:g,value:w||"",url:l.dataSelect.url,column:l.dataSelect.column,options:l.dataSelect.options,whereOne:l.dataSelect.whereOne,where:l.dataSelect.where,onChange:z=>{z?p(l.field_name,z.value):p(null)}});case"numeric":case"currency":return A.jsx(Ak,{style:{background:l.disabled||g?"#dedede":"inherit"},autoFocus:l.autoFocus,isDetail:v,decimalScale:l.decimalScale,className:"number-format",disabled:g||(l.disabled?l.disabled:!1),value:cd(w),placeholder:l.placeholder||l.placeholder===null?l.placeholder:"0",onValueChange:z=>{p&&p(l.field_name,parseFloat(z.value))},onBlur:z=>x&&x(l.field_name,z),onKeyDown:_,onFocus:z=>l.onFocus&&z.target.select()});case"number":return A.jsx(Ak,{style:{background:l.disabled||g?"#dedede":"inherit"},autoFocus:l.autoFocus,isDetail:v,decimalScale:l.decimalScale,className:"number-format",disabled:g||(l.disabled?l.disabled:!1),value:cd(w),placeholder:l.placeholder||l.placeholder===null?l.placeholder:"0",onValueChange:z=>{let re=+(l==null?void 0:l.max),X=+(l==null?void 0:l.min),ne=re&&+z.value>re?re:X&&+z.value<X?X:z.value;p&&(z.value||z.value===0)?p(l.field_name,`${parseFloat(ne)}`):p(l.field_name,"")},onBlur:z=>x&&x(l.field_name,z),onKeyDown:_,onFocus:z=>l.onFocus&&z.target.select()});case"number-not-seperator":return A.jsx("div",{style:{padding:"0 13px"},className:"row justify-content-center align-items-baseline",children:A.jsx(j_,{style:{background:l.disabled?"#dedede":"inherit"},autoFocus:l.autoFocus,isDetail:v,className:"number-format ms-3 me-3",disabled:l.disabled?l.disabled:!1,value:w,placeholder:"0",onValueChange:z=>{p&&p(l.field_name,z.value)},onBlur:z=>x&&x(l.field_name,z)})});case"radio-list":return A.jsx(FC,{name:l.field_name,disabled:l.disabled?l.disabled:!1,data:l.data,dataSelect:l==null?void 0:l.dataSelect,value:w,onChange:z=>p&&h.onChange(l.field_name,z)});case"radio":return A.jsx(Ig,{name:l.field_name,disabled:l.disabled,value:w,label:l.title,hidden_label:l.hidden_label,checked:w===l.valueCompare&&!l.disabled,onChange:z=>{l.valueCompare!==w&&h.onChange(z.target.value)}});case"checkbox-list":return A.jsx(BC,{name:l.field_name,disabled:l.disabled?l.disabled:!1,data:l.data,value:w,onChange:z=>p&&h.onChange(l.field_name,z)});case"select-year":return A.jsx(L_,{disabled:l.disabled?l.disabled:!1,value:w,onChange:z=>{p&&h.onChange(l.field_name,z&&z.value)},placeholder:R(l.title)});case"input-year":return A.jsx(A.Fragment,{children:A.jsx(hP,{value:w,onChange:z=>{p&&h.onChange(l.field_name,z)},placeholder:R(l.title)})});case"select-date":return A.jsx(hw,{disabled:l.disabled?l.disabled:!1,value:w,onChange:z=>{p&&h.onChange(l.field_name,z&&z.value)},placeholder:R(l.title)});case"select-month":return A.jsx(z_,{disabled:l.disabled?l.disabled:!1,value:w,onChange:z=>{p&&h.onChange(l.field_name,z&&z.value)},placeholder:R(l.title)});case"select-custom":return A.jsx(rC,{value:w,onChange:z=>{p&&h.onChange(l.field_name,z&&z.value)},options:(B=h==null?void 0:h.data)!=null&&B.dataSelect.options?(ee=(V=h==null?void 0:h.data)==null?void 0:V.dataSelect)==null?void 0:ee.options:h.data.options,dataSelect:(Z=h==null?void 0:h.data)==null?void 0:Z.dataSelect});case"select-multi":return A.jsx(YC,{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:z=>h.onChange&&h.onChange(l.field_name,z),value:w,getOptionValue:z=>z.Id,getOptionLabel:z=>z.Name,defaultOptions:!0,loadOptions:l.loadOptions});case"popup-select-tree":return A.jsx(PE,{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:F,onClickButton:l.popupSelect.onClickButton,onCallback:z=>p&&h.onChange(l.field_name,z&&z.value)});case"chkeditor":return A.jsx(QC.CKEditor,{editor:XC,data:w||"",disabled:l.disabled,config:{toolbar:["heading","|","bold","italic","bulletedList","numberedList","|","outdent","indent","|","undo","redo"]},onReady:z=>{},onChange:(z,re)=>{},onBlur:(z,re)=>{let X=re.getData();p&&h.onChange(l.field_name,X)},onFocus:(z,re)=>{}});case"ranger":return A.jsx(JE,{value:w,rtl:!1,onChange:z=>h.onChange(l.field_name,z)});case"select-async-multi":return A.jsx(aP,{name:l.field_name,onChange:z=>h.onChange(l.field_name,z),placeholder:l.dataSelect.placeholder||"Chọn",endPoint:l.dataSelect.endpoint,fieldValue:l.dataSelect.value_field,fieldLabel:l.dataSelect.text_field,getOptionValue:z=>z[l.dataSelect.value_field],getOptionLabel:z=>z[l.dataSelect.text_field],value:w,disabled:!1,conditions:l.dataSelect.conditions});case"input-check-cmnd":return A.jsx(dP,{disabled:g||(l.disabled?l.disabled:!1),title:l==null?void 0:l.title,value:w??"",placeholder:l==null?void 0:l.placeholder,bound:l==null?void 0:l.bound,onChange:z=>p&&p(null,z),onKeyPress:z=>y&&y(z)});case"input-hpx":return A.jsx(lP,{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:g||(l.disabled?l.disabled:!1),plaintext:l.plaintext||!1,name:l.field_name,value:w??"",onChange:z=>p&&p(null,z),onBlur:z=>x&&x(z.target.name,z.target.value),placeholder:l.placeholder?l.placeholder:R(l.title)});case"input-thon-xom":return A.jsx(A.Fragment,{children:A.jsx(uP,{value:w??"",onChange:z=>p&&p(null,z)})});case"input-address":return A.jsx(A.Fragment,{children:A.jsx(fP,{value:w??"",onChange:z=>{p&&p(null,z)}})})}},pw=h=>{const{data:g,value:l,colLabel:p,colValue:_,onChange:w,onBlur:v,onKeyDown:x,onChangeRender:P,inline_equal:F,inline:y,style:R,styleRow:$,disabled:B,error:V,invalid:ee}=h,Z=z=>`Nhập ${z==null?void 0:z.toLowerCase()}`;return g&&g.type!=="hidden"&&A.jsxs("div",{row:!0,className:`form-control-${g.field_name}`,style:$,children:[!(g!=null&&g.hidden_label)&&A.jsx(xg,{md:p||(y===!1?"12":"6"),children:g.required?A.jsx(aC,{children:g.title}):A.jsx("strong",{style:{fontSize:"12px"},children:g.title})}),A.jsxs(xg,{md:_||(y===!1||g.hidden_label===!0?"12":"6"),style:R,children:[A.jsx("div",{className:`form-control-value ${ee?"is-invalid":""}`,style:g.width&&{maxWidth:g.width},children:g.render?g.render(l,P):g.lookup?A.jsx(oC,{style:{background:g.disabled?"#dedede":"inherit"},name:g.field_name,value:l,onChange:z=>w&&w(z.target.name,z.target.value),onBlur:z=>v&&v(z.target.name,z.target.value),onKeyDown:x,placeholder:Z(g.title),children:Object.keys(g.lookup).map((z,re)=>A.jsx("option",{value:z,children:g.lookup[z]},re))}):IP(h,B)}),A.jsx(sC,{children:V==null?void 0:V.message})]})]})};pw.propTypes={data:le.object.isRequired};pw.defaultProps={};const Br=pw,MP=({data:h,item:g,setData:l,isErr:p,columns:_,fullScreen:w,isEdit:v,getData:x})=>{var P,F,y;return A.jsx(A.Fragment,{children:!(g!=null&&g.hidden)&&D_((P=g==null?void 0:g.dependent)==null?void 0:P.name,h[(F=g==null?void 0:g.dependent)==null?void 0:F.name],(y=g==null?void 0:g.dependent)==null?void 0:y.comparison)&&A.jsxs("div",{style:g!=null&&g.style?g==null?void 0:g.style:w?{background:"none",padding:"0"}:{},className:`item-form-control ${h[g==null?void 0:g.field]||h[g==null?void 0:g.field]===0?"form-custom-formcontrol":""} ${p?"form-custom-formcontrol-err":""}`,children:[A.jsx("p",{className:"title-item-form",children:!(g!=null&&g.hiddenLabel)&&A.jsxs(A.Fragment,{children:[g==null?void 0:g.title," ",(g==null?void 0:g.required)&&A.jsx("strong",{style:{color:"red"},children:"*"})]})}),A.jsx("div",{children:A.jsx(Br,{data:{hidden_label:!0,disabled:g!=null&&g.disabledWhenEdit?!!v||v===0:!!(g!=null&&g.disabled),...sy(g,h)},value:h?h[g==null?void 0:g.field]:null,onChange:(R,$)=>{l(B=>(x({...u_(_,B,g==null?void 0:g.field,$),[g==null?void 0:g.field]:$}),{...u_(_,B,g==null?void 0:g.field,$),[g==null?void 0:g.field]:$}))}})})]})})},OP=({children:h,listFormControl:g,listErr:l=[],data:p,listData:_,setData:w,isEdit:v,search:x,hidden:P,getData:F})=>A.jsxs(A.Fragment,{children:[h&&h.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(H0,{item:y})})),!P&&g.map(y=>{var R,$;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}),!!((R=y==null?void 0:y.children)!=null&&R.length)&&A.jsx("div",{className:"form-group",children:A.jsx(A.Fragment,{children:A.jsx("div",{style:{gridTemplateColumns:oy(y==null?void 0:y.ratio)},className:"form-body-group",children:($=y==null?void 0:y.children)==null?void 0:$.filter(B=>{var V,ee;return x&&(x!=null&&x.text)?(ee=B==null?void 0:B.title)==null?void 0:ee.toUpperCase().includes((V=x==null?void 0:x.text)==null?void 0:V.toUpperCase()):!0}).map(B=>A.jsx(A.Fragment,{children:A.jsx(MP,{isErr:l.includes(B.field)&&(p[B==null?void 0:B.field]===null||p[B==null?void 0:B.field]===""),fullScreen:(y==null?void 0:y.ratio)===1,columns:_,item:B,data:p,setData:w,getData:V=>F&&F(V),isEdit:v})}))})})})]})})}),h&&h.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(H0,{item:y})}))]}),H0=({item:h})=>A.jsx(A.Fragment,{children:A.jsxs("div",{children:[(h==null?void 0:h.title)&&A.jsx("h4",{className:"title-item-name-group",children:h==null?void 0:h.title}),A.jsx("div",{className:"form-group",children:h==null?void 0:h.component})]})}),NP=({data:h,setData:g,Id:l,url:p,onChange:_,value:w,isHidenSearch:v})=>{let x=localStorage.getItem(p);const[P,F]=Y.useState(!!x||!1);return A.jsx(A.Fragment,{children:A.jsxs("div",{className:"toolbar-form",children:[!v&&A.jsx(Cl,{onChange:y=>_(y.target.value),value:w,className:"input-search",placeholder:"Tìm kiếm"}),p&&!l&&A.jsxs("div",{className:"form-btn-toolbar",children:[A.jsxs(Qn,{onClick:()=>{localStorage.removeItem(p),F(!1),xh("Bản lưu tạm đã được xóa!")},disabled:!P||l,className:"delete",children:[A.jsx(kn,{fa:"trash-o"})," ",A.jsx("div",{className:"text-name-toolbar",children:"Xóa bản lưu tạm"})]}),A.jsxs(Qn,{onClick:()=>{g(y=>({...JSON.parse(x),...jC(y)}))},disabled:!P||l,className:"paste",children:[A.jsx(kn,{fa:"file-text"})," ",A.jsx("div",{className:"text-name-toolbar",children:"Dùng bản lưu tạm"})]}),A.jsxs(Qn,{onClick:()=>{localStorage.setItem(p,JSON.stringify(h)),F(!0),xh("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(kn,{fa:"clone"})," ",A.jsx("div",{className:"text-name-toolbar",children:"Copy bản lưu tạm"})]})]})]})})},RP=Y.forwardRef(({open:h,close:g,Id:l,columns:p,title:_,titleSecond:w,url:v,children:x,beforSaving:P,afterSaving:F,getId:y,defaultValue:R,addValue:$,getData:B,getFullData:V,hidden:ee,apiUrl:Z,apiGetData:z,method:re,isHidenSearch:X,size:ne,save:ie,isToolBar:ae,titleAdd:_e,deleteValue:Se,saveAndContinue:Pe,expand:Me},Re)=>{let ce=l||l===0?A.jsx(A.Fragment,{children:"Cập nhật"}):_e||A.jsx(A.Fragment,{children:"Thêm mới"});const pe=p.filter(Ee=>Ee.type),be=pe!=null&&pe.length?pe.filter(Ee=>Ee.required):[],ke=R?{...gg(pe),...R}:gg(pe),[ye,Ce]=Y.useState(ke),[ze,He]=Y.useState([]);let Ge=p.filter(Ee=>Ee.type||Ee.tabName);const qe=iy(Ge),gt=p.filter(Ee=>Ee.dataID)[0].field,[je,ut]=Y.useState({text:"",required:!1}),[De,Oe]=Y.useState(null);Y.useEffect(()=>{Ce(Ee=>({...Ee,...R}))},[R]),Y.useImperativeHandle(Re,()=>({loadData(){ht()},close(){g()}}));const tt=Ee=>typeof Ee=="string"?`'${Ee}'`:Ee,ht=Y.useCallback(()=>{let Ee=p.filter(we=>we.type),yt=gg(Ee),on=z||`${v}(${tt(l)})${Me&&(Me!=null&&Me.length)?`?$expand=${Me.map(we=>we).join(",")}`:""}`;v&&l!==!0&&(l||l===0)&&yt&&Bn(on,"GET",null,{odata:!z}).then(we=>{Ce(Ne=>({...Ne,...Ok(yt,we)})),V&&V(we),Oe(Ne=>({...Ne,...Ok(yt,we)}))})},[l,z,p,v,Me]);Y.useEffect(()=>{ht(),!l&&Ce(ke)},[]);const kt=()=>{if(LC(ke,ye)&&!l&&l!==0){J0("Bạn có chắc chắn muốn đóng không!").then(()=>g());return}g()},Kt=Ee=>{let yt=NC(be,ye);if(Ik(yt,ye)){yg("Bạn nhập thiếu trường dữ liệu!"),He(Ik(yt,ye));return}let on=Z||(l||l===0?`${v}(${tt(l)})`:`${v}`),we=re||(Z?"POST":l||l===0?"PATCH":"POST"),Ne=Z?De?{...De,...ye}:ye:De?DC(De,ye):ye,mt=$?{...Ne,...$}:Ne,Fe=Object.keys(mt).length,Ye=!Z;if(!Fe&&l){yg("Bạn chưa thay đổi bất cứ trường nào");return}if(P&&(P(ye),P(ye)===!1))return!1;if(ie){ie(ye,l);return}Se&&(Se!=null&&Se.length)&&Se.forEach(Vt=>delete mt[Vt]),Bn(on,we,JSON.stringify(mt),{odata:Ye}).then(Vt=>{if(F&&F(Vt,!l,ye),xh("Thành công!"),Ee?Ce(ke):g&&g(),Z){y&&y(Vt);return}y&&y(Vt[gt]||l)}).catch(Vt=>{var gn,Zt;if(Z){kg(Vt||"Không thành công!");return}kg(Vt["odata.error"]?(Zt=(gn=Vt["odata.error"])==null?void 0:gn.message)==null?void 0:Zt.value:"Không thành công!")})};return A.jsx(A.Fragment,{children:A.jsx(da,{size:ne||"xl",zIndex:1500,className:"form-modal-auto-custom",isOpen:h,toggle:()=>{kt(),B&&B(ke)},children:A.jsxs("div",{style:ae!==!1?{}:{paddingTop:"7rem"},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:A.jsx("div",{className:"d-flex align-items-center gap-2",children:l||l===0?A.jsxs(A.Fragment,{children:[A.jsx(kn,{fa:"500px"})," ID Dữ Liệu: ",l]}):A.jsxs(A.Fragment,{children:[A.jsx(kn,{fa:"dashcube"})," Thêm mới"]})})}),A.jsx(Qn,{onClick:()=>Kt(),className:"btn-action",children:"Lưu thông tin"}),Pe&&!l&&l!==0&&A.jsx(Qn,{onClick:()=>Kt(!0),className:"btn-action second",children:"Lưu và tiếp tục"})]}),A.jsx(Qn,{style:{boxShadow:"none"},onClick:kt,className:"btn-close btn-close-custom"})]}),A.jsxs("div",{style:ae!==!1?{}:{paddingBottom:"5rem"},className:"header-modal-custom",children:[A.jsxs("div",{style:{width:"max-content"},className:"d-flex justify-content-bettween align-items-center position-relative gap-3",children:[A.jsx(kn,{fa:l||l===0?"pencil-square-o":"clone"}),A.jsxs("div",{children:[A.jsxs("h4",{className:"fw-bold",children:[ce," ",w||""]}),A.jsx("p",{className:"text-muted",children:l||l===0?"Bạn có thể chỉnh sửa tất cả các thông tin.":"Thêm mới thông tin, tất cả các trường có dấu * là bắt buộc"})]})]}),ae!==!1&&A.jsx(NP,{onChange:Ee=>ut(yt=>({...yt,text:Ee})),value:je.text,Id:l,data:ye,setData:Ce,url:v,isHidenSearch:X})]}),A.jsx("div",{className:"outline-form",children:A.jsx(OP,{search:je,children:x,listFormControl:qe,listErr:ze,data:ye,listData:pe,hidden:ee,setData:Ce,getData:Ee=>B&&B(Ee),isEdit:l})})]})})})}),s1=RP,DP={multiValueLabel:h=>({...h,padding:"0px 0px 0px 6px",fontSize:13}),control:h=>({...h,backgroundColor:"white",height:"28.38px",minHeight:"28.38px",fontSize:"12px",lineHeight:"1.5",cursor:"pointer",borderRadius:"4px"}),option:h=>({...h,fontSize:"12px",cursor:"pointer"}),input:h=>({...h,position:"unset"}),placeholder:h=>({...h,marginLeft:5,marginRight:5}),singleValue:(h,{data:g})=>({...h,transform:"inherit",top:"unset"}),container:h=>({...h,width:"100%"}),valueContainer:h=>({...h,padding:"0px 5px"}),indicatorsContainer:h=>({...h,padding:"0px 5px"}),indicatorContainer:h=>({...h,padding:"0px 5px !important",fontSize:"12px"})};class jP extends Y.Component{constructor(l){super(l);ig(this,"loadDataFromApi",()=>{let{columns:l,odata:p,url:_,where:w,valueField:v,textField:x,textFieldSub:P}=this.props,F=[],y="";p!==!1?(y=`${_}`,w?y+=`/?$filter=${w}&`:y+="",l&&l.length>0&&(y+=`$select=${this.props.columns.join()}`)):y=this.props.url,Bn(y,"GET",null,p).then(R=>{p!==!1?R.value.forEach($=>{F.push({value:$[v],label:P?`${$[P]} - ${$[x]}`:$[x],obj:$})}):F=R,this.setState({data:F,isLoading:!1}),this.setStateSelected(this.state.value)}).catch(R=>console.log(R))});ig(this,"onChange",(l,p)=>{if(this.setState({selected:l}),this.props.isMulti){var _=[];if(l)for(let w=0;w<l.length;w++)_.push(l[w].value);this.props.onChange(_,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,p){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,p){let _=null,{data:w}=this.state;if(w&&w.length>0&&(l||l===0||l===!1)){for(let v=0;v<w.length;v++)if(w[v].value!=null&&w[v].value===l){_=w[v];break}else if(w[v].options){for(let x=0;x<w[v].options.length;x++)if(w[v].options[x].value&&w[v].options[x].value===l){_=w[v].options[x];break}}}return _}getOptionsMulti(l){let p=[],{data:_}=this.state;if(_&&_.length>0&&l)for(let w=0;w<_.length;w++){let v=_[w];for(let x=0;x<l.length;x++)v.value&&v.value===l[x]&&p.push(v)}return p}componentDidUpdate(l,p,_){const{options:w,where:v,url:x}=this.props;(v!==l.where||x!==l.url)&&this.loadDataFromApi(),w&&w.length!==void 0&&w.length!==l.options.length&&this.loadDataFromOption()}loadDataFromOption(){let l=this.props.options.map(p=>({value:p[this.props.valueField],label:this.props.textFieldSub?`${p[this.props.textFieldSub]} - ${p[this.props.textField]}`:p[this.props.textField],obj:p}));this.setState({data:l,isLoading:!1})}render(){let{isMulti:l,isDetail:p,value:_,menuPosition:w}=this.props,v=l?this.getOptionsMulti(_):this.getOptionsSingle(_);return this.state.data.length>0&&p?A.jsx("span",{children:v&&v.label}):A.jsx(A.Fragment,{children:A.jsxs("div",{className:"position-relative",children:[A.jsx(tC,{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:v,styles:DP,options:this.state.data,onChange:this.onChange}),this.props.addFast&&A.jsx(FP,{...this.props,reload:this.loadDataFromApi})]})})}}const LP=jP;function zP(h){return h.replace(/[^\w\s]/gi,"")}const FP=({url:h,where:g,reload:l,title:p})=>{const[_,w]=Y.useState(!1);let v=g==null?void 0:g.split(" ");const x=v[1]==="eq"?{[v[0]]:zP(v[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(Qn,{style:{background:"linear-gradient(90deg, rgb(0, 133, 126) 0%, rgb(0, 155, 194) 100%)"},children:A.jsx(kn,{fa:"plus"})}),A.jsx("strong",{children:"Thêm nhanh Thôn/Xóm"})]}),_&&A.jsx(s1,{open:_,close:()=>w(!1),url:h,addValue:x,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{h_ as C,LP as D,Br as F,ry as I,s1 as M,M_ as S,AP as T,Ah as a,pP as b,iy as c,i1 as d,lI as e,dI as f,xP as g,L_ as h,cI as i,uI as j,d_ as r,fw as s,cP as u};