????
Current Path : C:/inetpub/vhost/gdnn.gdtsolutions.vn/build/assets/ |
Current File : C:/inetpub/vhost/gdnn.gdtsolutions.vn/build/assets/FormControl-dda7d30a.js |
var L1=Object.defineProperty;var V1=(v,_,u)=>_ in v?L1(v,_,{enumerable:!0,configurable:!0,writable:!0,value:u}):v[_]=u;var G_=(v,_,u)=>(V1(v,typeof _!="symbol"?_+"":_,u),u);import{j as V,r as J,P as ee,ah as Bv,R as kr,D as n0,C as ml,s as No,v as z1,t as eo,n as gl,m as tu,z as aw,l as F1,x as B1,a2 as on,M as mg,ai as H1,H as $1,W as U1,T as bv,aj as W1,ak as K1}from"./index-fa055cb8.js";import{I as uh,k as dh,l as iu,M as ou,A as q1,H as lw,B as Li,G as i0,R as Hv,C as bl,J as Q_,d as G1,e as Q1,z as Y1,_ as _r,E as hh,n as J1,F as Z1,g as X1}from"./reactstrap.modern-274e1102.js";import{R as ex}from"./Required-11df292c.js";import{a as tx,c as nx,T as ix,I as ox}from"./InputNumber-092cea71.js";import{g as rx,I as sx,a as ax,P as lx}from"./InputTime-cf0160db.js";import{D as cx}from"./DropdownList-1816cc1a.js";import{N as ux,S as dx,a as Y_}from"./SelectCustom-028e0a1b.js";import{A as hx,T as vv,S as fx}from"./TextHuyenPhuongXa-91b9e817.js";import{S as px,B as gx,c as mx}from"./ButtonLoad-5b8d7df7.js";import{_ as o0}from"./OdataUtils-36531977.js";import{_ as bx}from"./classCallCheck-22a738c0.js";import{a as vx}from"./createClass-5c3a3f66.js";import{m as wx,a as _x,_ as kx,h as yx,b as J_,c as xx,A as Cx}from"./Select-d5b8e2a0.js";import{D as Tx}from"./DataTable-fad8b46b.js";import{F as to}from"./FontAwesome4-64371a0f.js";import"./Button-b6c26fff.js";import"./ButtonClose-01990b88.js";import{i as Ex}from"./PhanRow-9a886c05.js";import{D as Sx}from"./DataSelect-7a237583.js";import"./SelectPanelMulti-c769273a.js";import{c as Ax}from"./withStyles-fa9fb6d9.js";import{w as Nx}from"./capitalize-d666ae9b.js";import{M as Px}from"./ModalChiTietGiaDinh-0c4f19f4.js";import{F as Ix,H as Mx}from"./BodyDialog-341140bb.js";import{T as Dx}from"./TabsBasic-86b6759a.js";import{f as Ri}from"./DetailFormControl-8e322b93.js";const bg=v=>{const{disabled:_,name:u,label:g,checked:w,type:k,children:m,hidden_label:C,...M}=v;return V.jsxDEV("label",{className:"radio me-0",children:[V.jsxDEV(tx,{...M,type:"radio",name:u,checked:w,disabled:_,className:"me-0",children:m},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Input/Radio.jsx",lineNumber:8,columnNumber:7},globalThis),!C&&V.jsxDEV("span",{className:_?"disabled":"",children:g},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Input/Radio.jsx",lineNumber:11,columnNumber:25},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Input/Radio.jsx",lineNumber:7,columnNumber:5},globalThis)};bg.propTypes={};bg.defaultProps={};class Ox extends J.Component{constructor(_){super(_),this.state={value:null}}componentDidUpdate(_,u){this.props.value!==this.state.value&&this.setState({value:this.props.value})}render(){const{name:_,disabled:u,data:g}=this.props;return g&&g.map((w,k)=>V.jsxDEV(bg,{name:_,disabled:u||w.disabled,value:w.value,label:w.label,checked:this.state.value===w.value&&!w.disabled,onChange:m=>{this.state.value!==m.target.value&&(this.setState({value:m.target.value}),this.props.onChange(m.target.value))}},k,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/select/RadioList.jsx",lineNumber:24,columnNumber:11},this))}}class r0 extends J.Component{constructor(_){super(_),this.state={checked:!1}}componentDidMount(){this.setState({checked:this.props.checked})}componentDidUpdate(_){this.props.checked!==this.state.checked&&this.setState({checked:this.props.checked})}render(){return V.jsxDEV("label",{className:"checkbox",children:[V.jsxDEV("input",{type:"checkbox",disabled:this.props.disabled,checked:this.state.checked,onChange:_=>{this.setState({checked:_.target.checked}),this.props.onChange(_.target.checked)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Input/InputBoolean.jsx",lineNumber:25,columnNumber:9},this),V.jsxDEV("span",{children:this.props.label},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Input/InputBoolean.jsx",lineNumber:34,columnNumber:9},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Input/InputBoolean.jsx",lineNumber:24,columnNumber:7},this)}}class jx extends J.Component{constructor(u){super(u);G_(this,"handleChange",(u,g)=>{let{selected:w}=this.state;var k=w.indexOf(u);k<0?w.push(u):w.splice(k,1),this.setState({selected:w}),this.props.onChange(w)});this.state={selected:[]}}componentDidUpdate(u,g){this.props.value!==this.state.selected&&this.setState({selected:this.props.value})}render(){const{name:u,disabled:g,data:w}=this.props;return w&&w.map((k,m)=>V.jsxDEV(r0,{name:u,disabled:g||k.disabled,value:k.value,label:k.label,checked:this.state.selected&&this.state.selected.indexOf(k.value)>=0&&!k.disabled,onChange:C=>this.handleChange(k.value,C)},m,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/select/CheckboxList.jsx",lineNumber:43,columnNumber:11},this))}}class cw extends J.Component{render(){const{isDetail:_,value:u,invalid:g,onValueChange:w,onKeyDown:k,bsSize:m="sm",style:C,onBlur:M,onFocus:B,decimalScale:T,thousandSeparator:L,decimalSeparator:U,customInput:j,...$}=this.props;return _?V.jsxDEV("div",{style:{textAlign:"right"},children:u===0||u===null?"":Bv(u)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/numberformat/NumberNotSeperator.jsx",lineNumber:27,columnNumber:14},this):V.jsxDEV(ux,{...$,style:{textAlign:"right",...C},value:u,onValueChange:Z=>{w(Z)},onBlur:Z=>M&&M(Z),onKeyDown:k,onFocus:B,customInput:j||uh,bsSize:m,decimalScale:T||2,invalid:g},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/numberformat/NumberNotSeperator.jsx",lineNumber:30,columnNumber:9},this)}}cw.defaultProps={placeholder:"Nhâp..."};cw.propTypes={placeholder:ee.string};class uw extends J.Component{render(){const{value:_,onChange:u}=this.props,g=()=>{let w=[];for(var k=1;k<=12;k++)w.push({value:k,label:`Tháng ${k}`});return w};return V.jsxDEV(px,{value:_||"",onChange:u,options:g(),valueRef:"value",labelRef:"label",placeholder:"Chọn tháng"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/select/SelectMonth.jsx",lineNumber:15,columnNumber:7},this)}}uw.propTypes={};uw.defaultProps={placeholder:"Chọn..."};function Rx(v){var _=Lx();return function(){var g=J_(v),w;if(_){var k=J_(this).constructor;w=Reflect.construct(g,arguments,k)}else w=g.apply(this,arguments);return xx(this,w)}}function Lx(){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 Vx={cacheOptions:!1,defaultOptions:!1,filterOption:null,isLoading:!1},zx=function(_){var u,g;return g=u=function(w){kx(m,w);var k=Rx(m);function m(C){var M;return bx(this,m),M=k.call(this),M.select=void 0,M.lastRequest=void 0,M.mounted=!1,M.optionsCache={},M.handleInputChange=function(B,T){var L=M.props,U=L.cacheOptions,j=L.onInputChange,$=yx(B,T,j);if(!$){delete M.lastRequest,M.setState({inputValue:"",loadedInputValue:"",loadedOptions:[],isLoading:!1,passEmptyOptions:!1});return}if(U&&M.optionsCache[$])M.setState({inputValue:$,loadedInputValue:$,loadedOptions:M.optionsCache[$],isLoading:!1,passEmptyOptions:!1});else{var Z=M.lastRequest={};M.setState({inputValue:$,isLoading:!0,passEmptyOptions:!M.state.loadedInputValue},function(){M.loadOptions($,function(se){M.mounted&&(se&&(M.optionsCache[$]=se),Z===M.lastRequest&&(delete M.lastRequest,M.setState({isLoading:!1,loadedInputValue:$,loadedOptions:se||[],passEmptyOptions:!1})))})})}return $},M.state={defaultOptions:Array.isArray(C.defaultOptions)?C.defaultOptions:void 0,inputValue:typeof C.inputValue<"u"?C.inputValue:"",isLoading:C.defaultOptions===!0,loadedOptions:[],passEmptyOptions:!1},M}return vx(m,[{key:"componentDidMount",value:function(){var M=this;this.mounted=!0;var B=this.props.defaultOptions,T=this.state.inputValue;B===!0&&this.loadOptions(T,function(L){if(M.mounted){var U=!!M.lastRequest;M.setState({defaultOptions:L||[],isLoading:U})}})}},{key:"UNSAFE_componentWillReceiveProps",value:function(M){M.cacheOptions!==this.props.cacheOptions&&(this.optionsCache={}),M.defaultOptions!==this.props.defaultOptions&&this.setState({defaultOptions:Array.isArray(M.defaultOptions)?M.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(M,B){var T=this.props.loadOptions;if(!T)return B();var L=T(M,B);L&&typeof L.then=="function"&&L.then(B,function(){return B()})}},{key:"render",value:function(){var M=this,B=this.props;B.loadOptions;var T=B.isLoading,L=o0(B,["loadOptions","isLoading"]),U=this.state,j=U.defaultOptions,$=U.inputValue,Z=U.isLoading,se=U.loadedInputValue,ue=U.loadedOptions,le=U.passEmptyOptions,G=le?[]:$&&se?ue:j||[];return kr.createElement(_,n0({},L,{ref:function(ie){M.select=ie},options:G,isLoading:Z||T,onInputChange:this.handleInputChange}))}}]),m}(J.Component),u.defaultProps=Vx,g},Fx=wx(_x),Bx=zx(Fx);const Hx=Bx,$x=(v={},_={},u,g={},w)=>({handleChange:async(C,M,B="",T="",L="onChange")=>{let U={...v};U[C]=M===""||M===void 0?null:M,u(U)},handleValidate:(C=[])=>{C.length&&C.forEach(B=>{_[B].required=!1});const M=Object.values(_).filter(B=>B.required===!0);for(let B=0;B<M.length;B++){const T=M[B],L=T.maxLength,U=T.minLength;let j=v[T.field_name];if(j===null||j===""||j===void 0)return ml('Vui lòng nhập "'+T.title+'"'),!1;if(U&&j.length>U)return ml('Ô "'+T.title+'" phải có ít nhất '+U+" ký tự."),!1;if(L&&j.length>L)return ml('Ô "'+T.title+'" vượt quá số ký tự cho phép. Tối đa '+L+" ký tự."),!1}return!0}}),wv=No.div` margin-bottom: 20px; font-weight: bold; `,Ux=No.span` position: relative; overflow: hidden; input.upload { position: absolute; top: 0; right: 0; margin: 0; padding: 0; font-size: 20px; cursor: pointer; opacity: 0; filter: alpha(opacity=0); } `,Wx=No(ou)` max-width: 100%; `,Kx=No(i0)` thead tr th { vertical-align: middle; font-size: 12px; background-color: yellow; border: 1px solid #aaa; border-bottom: none; text-align: center; } tbody tr { td { font-size: 12px; border: 1px solid #aaa; vertical-align: middle; } } `,qx=No(i0)` margin-bottom: 0px; thead tr th { vertical-align: middle; font-size: 12px; background-color: yellow; border: 1px solid #aaa; border-bottom: none; text-align: center; position: sticky; top: 0px; } tbody tr { td { font-size: 12px; border: 1px solid #aaa; vertical-align: middle; } } `;function Gx(v){const{title:_,isClose:u,isOpen:g,zIndex:w,urldownload:k,urlPreImport:m,urlDelete:C,columnsImport:M,theadTableImport:B,urlImport:T,reloadData:L,BaoCao_Id:U,isNew:j}=v,[$,Z]=J.useState(""),[se,ue]=J.useState(null),[le,G]=J.useState(!1),[ne,ie]=J.useState([]),[me,pe]=J.useState(!1),[De,Ie]=J.useState(0),[Me,Ue]=J.useState([]),[te,ce]=J.useState(!1),[be,ke]=J.useState([]),[Ne,xe]=J.useState([]),Le=J.useCallback(ot=>{const tt=ot.target.files[0];Z(tt?tt.name:""),ue(tt)},[]),Fe=J.useCallback(()=>se?!0:(ml("Vui lòng chọn file trước khi import"),!1),[se]),Ye=J.useCallback(()=>T&&m?!0:(ml("Vui lòng thử lại sau!","Chức năng đang hoàn thiện"),!1),[T,m]),Ve=J.useCallback(()=>{ue(null),Z(""),G(!1),ie([]),ke([]),u()},[u]),yt=J.useCallback(async()=>{if(Fe()&&Ye())if(se.name.split(".").pop()==="xlsx"){const tt=new FormData;tt.append("file",se),U&&tt.append("BaoCao_Id",U.ID);const $e=await z1(m,"POST",tt),Je=$e.filter(we=>we.Error),qt=$e.filter(we=>!we.Error),Qt=$e.filter(we=>we.GhiChu);Ue(qt),$e.length===Je.length?ce(!0):ce(!1),Je.length?(Ie(Je.length),G(!0),ie(Je)):Qt.length?(ke(Qt),xe($e)):(eo(T,"POST",JSON.stringify($e),!1).then(we=>{gl("Import thành công").then(()=>{Ve(),L()})}).catch(we=>tu(we,"Import lỗi")),G(!1),ie([]),Ie(0))}else ml("Vui lòng chọn file .xlsx")},[Fe,Ye,se,U,m,T,Ve,L]),Se=J.useCallback(()=>{eo(T,"POST",JSON.stringify(Ne),!1).then(ot=>{gl("Import thành công").then(()=>{Ve(),L()})}).catch(()=>tu("Import lỗi","Không thành công")),G(!1),ie([]),Ie(0)},[Ne,Ve,L,T]),We=J.useCallback(()=>{pe(!me)},[me]),Oe=J.useCallback(()=>{const ot=Me.map(tt=>(delete tt.MaChuong,delete tt.MaNganhKinhTe,delete tt.LoaiDuAn_Name,delete tt.NhomDuAn_Name,delete tt.NhomDuAn_Code,delete tt.LoaiDuAn_Code,{...tt}));eo(T,"POST",JSON.stringify(ot),!1).then(tt=>{gl("Import thành công").then(()=>{u(),L()})}).catch(()=>tu("Import lỗi","Không thành công"))},[Me,u,L,T]),He=J.useMemo(()=>V.jsxDEV(Wx,{size:"xl",isOpen:me,zIndex:w+1,toggle:We,children:[V.jsxDEV(dh,{children:"CHI TIẾT LỖI FILE EXCEL"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:216,columnNumber:9},this),V.jsxDEV(iu,{children:[V.jsxDEV(Kx,{size:"sm",bordered:!0,striped:!0,children:[B,V.jsxDEV("tbody",{children:ne.map((ot,tt)=>V.jsxDEV("tr",{children:M&&M.length&&M.map(($e,Je)=>{const qt=ot[$e.field];return V.jsxDEV("td",{className:$e.align,children:$e.render?$e.render(ot):qt},Je,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:229,columnNumber:27},this)})},tt,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:223,columnNumber:19},this))},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:220,columnNumber:13},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:218,columnNumber:11},this),V.jsxDEV("div",{className:"w-100 text-right",style:{color:"red",fontWeight:"bold"},children:"Vui lòng cập nhật file excel rồi sau đó import ạ"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:239,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:217,columnNumber:9},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:215,columnNumber:7},this),[me,We,ne,w,M,B]),ht=J.useCallback(()=>{aw("Bạn có chắc chắn muốn xóa dữ liệu không","THÔNG BÁO").then(ot=>{ot&&eo(`${C}?baoCao_Id=${U.ID}`,"DELETE",null,!1).then(()=>gl("Xóa thành công").then(()=>L())).catch(tt=>tu("Xóa không thanh công"))})},[U,L,C]);return V.jsxDEV(J.Fragment,{children:V.jsxDEV(ou,{size:"xl",isOpen:g,zIndex:w,toggle:Ve,children:[V.jsxDEV(dh,{style:{textTransform:"uppercase"},children:_},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:260,columnNumber:9},this),V.jsxDEV(iu,{children:[j&&V.jsxDEV(q1,{color:"warning",children:"Có mẫu excel mới vui lòng tải về mẫu này rồi import vào ạ"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:262,columnNumber:21},this),V.jsxDEV(wv,{className:"d-flex align-items-center",children:[V.jsxDEV("span",{style:{color:"#20a8d8"},className:"me-2",children:["Bước 1:"," "]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:264,columnNumber:13},this),V.jsxDEV("span",{className:"d-flex align-items-center",children:["Tải về tập tin",V.jsxDEV("a",{className:"ms-1 me-1",href:k?`/assets/FileMau/${k}`:"#",style:{color:"green"},children:[V.jsxDEV(to,{fa:"file-excel-o"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:274,columnNumber:17},this),V.jsxDEV("span",{className:"ms-1",children:["Excel mẫu ",V.jsxDEV("span",{style:{color:"red"},children:j?"(mẫu mới)":""},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:276,columnNumber:29},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:275,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:269,columnNumber:15},this),"và điền đầy đủ thông tin vào tập tin Excel vừa mới tải về"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:267,columnNumber:13},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:263,columnNumber:11},this),V.jsxDEV(wv,{children:[V.jsxDEV("span",{style:{color:"#20a8d8"},className:"me-1",children:["Bước 2:"," "]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:283,columnNumber:13},this),V.jsxDEV("span",{children:["Chọn tập tin Excel ",V.jsxDEV("span",{style:{color:"#3ea662"},children:"(.xlsx)"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:287,columnNumber:34},this)," đã điền đầy đủ thông tin"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:286,columnNumber:13},this),V.jsxDEV("div",{children:V.jsxDEV(lw,{children:[V.jsxDEV(uh,{value:$,readOnly:!0,placeholder:"Chọn file..."},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:291,columnNumber:17},this),V.jsxDEV(Ux,{className:"btn btn-success",children:[V.jsxDEV("span",{className:"upl",id:"upload",children:[V.jsxDEV(to,{fa:"upload"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:294,columnNumber:21},this),V.jsxDEV("span",{className:"ms-2",children:"Tải lên"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:295,columnNumber:21},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:293,columnNumber:19},this),V.jsxDEV("input",{onChange:Le,accept:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",type:"file",className:"upload up",id:"up"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:297,columnNumber:19},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:292,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:290,columnNumber:15},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:289,columnNumber:13},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:282,columnNumber:11},this),be.length===0&&V.jsxDEV(wv,{children:[V.jsxDEV("span",{style:{color:"#20a8d8"},className:"me-1",children:["Bước 3:"," "]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:310,columnNumber:15},this),V.jsxDEV("span",{children:["Nhấn nút"," ",V.jsxDEV(Li,{size:"sm",onClick:yt,color:"success",children:[V.jsxDEV(to,{fa:"upload"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:316,columnNumber:19},this),V.jsxDEV("span",{className:"ms-1",children:"IMPORT FILE"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:317,columnNumber:19},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:315,columnNumber:17},this)," ","để import dữ liệu vào hệ thống"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:313,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:309,columnNumber:13},this),C&&V.jsxDEV("div",{className:"d-flex align-items-center justify-content-between",style:{color:"darkorange",fontWeight:"bold"},children:[V.jsxDEV("span",{children:[V.jsxDEV(to,{fa:"exclamation-triangle"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:329,columnNumber:17},this),V.jsxDEV("span",{className:"ms-1",children:"Lưu ý: Nếu trường hợp import sai dữ liệu của bảng, vui lòng xóa rồi thực lại các bước"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:330,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:328,columnNumber:15},this),V.jsxDEV(Li,{onClick:ht,color:"danger",size:"sm",children:[V.jsxDEV(to,{fa:"trash"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:335,columnNumber:17},this),V.jsxDEV("span",{className:"ms-1",children:"Xóa dữ liệu"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:336,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:334,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:324,columnNumber:13},this),be.length?V.jsxDEV(V.Fragment,{children:[V.jsxDEV("div",{className:"pb-2 d-flex justify-content-between align-items-center",children:[V.jsxDEV("span",{style:{color:"#20a8d8",fontWeight:"bold"},children:"Có thông tin cần được xác định"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:343,columnNumber:17},this),V.jsxDEV(Li,{onClick:Se,size:"sm",color:"success",children:[V.jsxDEV(to,{fa:"upload"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:345,columnNumber:19},this),V.jsxDEV("span",{className:"ms-1",children:"Import vào hệ thống"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:346,columnNumber:19},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:344,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:342,columnNumber:15},this),V.jsxDEV("div",{style:{height:"calc(100vh - 365px)",overflow:"auto"},children:V.jsxDEV(qx,{size:"sm",bordered:!0,striped:!0,children:[B,V.jsxDEV("tbody",{children:be.map((ot,tt)=>V.jsxDEV("tr",{children:M&&M.length&&M.map(($e,Je)=>{const qt=ot[$e.field];return V.jsxDEV("td",{className:$e.align,children:$e.render?$e.render(ot):qt},Je,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:361,columnNumber:33},this)})},tt,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:355,columnNumber:25},this))},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:352,columnNumber:19},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:350,columnNumber:17},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:349,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:341,columnNumber:13},this):"",le&&V.jsxDEV("div",{className:"d-flex align-items-center justify-content-between",children:[V.jsxDEV(Li,{onClick:()=>We(),className:"text-left",size:"sm",color:"link",style:{color:"red",fontSize:15},children:["Có ",V.jsxDEV("b",{style:{fontSize:20},children:De},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:385,columnNumber:20},this)," lỗi, Nhấn vào này để xem chi tiết"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:378,columnNumber:15},this),V.jsxDEV(Li,{disabled:te,size:"sm",color:"primary",onClick:Oe,children:"Vẫn import những dòng dữ liệu không lỗi"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:387,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:377,columnNumber:13},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:261,columnNumber:9},this),He]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:259,columnNumber:7},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Modal/ModalImport.jsx",lineNumber:258,columnNumber:5},this)}function Qx(v){const{children:_,onClose:u,open:g,className:w}=v;return V.jsxDEV(Ix,{open:g,onClose:u,className:w,children:V.jsxDEV(Mx,{children:_},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/dialog/FullScreenDialogNew.jsx",lineNumber:11,columnNumber:7},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/dialog/FullScreenDialogNew.jsx",lineNumber:10,columnNumber:5},this)}var Yx={root:{display:"flex",flexDirection:"column",flexWrap:"wrap"},row:{flexDirection:"row"}},s0=J.forwardRef(function(_,u){var g=_.classes,w=_.className,k=_.row,m=k===void 0?!1:k,C=o0(_,["classes","className","row"]);return J.createElement("div",n0({className:Ax(g.root,w,m&&g.row),ref:u},C))});s0.propTypes={children:ee.node,classes:ee.object,className:ee.string,row:ee.bool};const Jx=Nx(Yx,{name:"MuiFormGroup"})(s0);function Zx(v){var w,k,m,C;const{data:_}=v,[,u]=J.useState(0),g=J.useMemo(()=>V.jsxDEV(hx,{target_id:_==null?void 0:_.Id,target_module:"NguoiLaoDong",isChange:u},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:13,columnNumber:11},this),[_]);return V.jsxDEV(V.Fragment,{children:V.jsxDEV(Hv,{className:"bg-white p-3 mt-0",children:V.jsxDEV(bl,{children:[V.jsxDEV(Hv,{children:[V.jsxDEV(bl,{children:[V.jsxDEV(cn,{data:Ri.HoVaTen,value:_==null?void 0:_.HoVaTen},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:23,columnNumber:15},this),V.jsxDEV(cn,{data:Ri.NgayThangNamSinh,value:_==null?void 0:_.NgayThangNamSinh,isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:24,columnNumber:15},this),V.jsxDEV(cn,{data:Ri.Gioitinh,value:_==null?void 0:_.QLLD_DM_GioiTinh.Name,isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:25,columnNumber:15},this),V.jsxDEV(cn,{data:Ri.SoCCCD,value:_==null?void 0:_.SoCCCD},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:26,columnNumber:15},this),V.jsxDEV(cn,{data:Ri.SoDinhDanh,value:_==null?void 0:_.SoDinhDanh},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:27,columnNumber:15},this),V.jsxDEV(cn,{data:Ri.DanToc,value:_!=null&&_.QLLD_DM_DanToc?_==null?void 0:_.QLLD_DM_DanToc.Name:"",isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:28,columnNumber:15},this),V.jsxDEV(cn,{data:Ri.TonGiao,value:_!=null&&_.QLLD_DM_TonGiao?_==null?void 0:_.QLLD_DM_TonGiao.Name:"",isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:29,columnNumber:15},this),V.jsxDEV("div",{className:"d-flex row",children:[V.jsxDEV("strong",{className:"col-6 text-small",children:"Quê quán:"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:35,columnNumber:17},this),V.jsxDEV("p",{className:"col-6",children:V.jsxDEV(vv,{maPhuongXa:_==null?void 0:_.QueQuan},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:37,columnNumber:19},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:36,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:34,columnNumber:15},this),V.jsxDEV("div",{className:"d-flex row",children:[V.jsxDEV("strong",{className:"col-6 text-small",children:"Thường trú:"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:41,columnNumber:17},this),V.jsxDEV("p",{className:"col-6",children:V.jsxDEV(vv,{maPhuongXa:_==null?void 0:_.ThuongTru,maThonXom:_==null?void 0:_.ThuongTru_ThonXom_Id},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:43,columnNumber:19},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:42,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:40,columnNumber:15},this),V.jsxDEV("div",{className:"d-flex row",children:[V.jsxDEV("strong",{className:"col-6 text-small",children:"Nơi ở hiện tại:"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:47,columnNumber:17},this),V.jsxDEV("p",{className:"col-6",children:V.jsxDEV(vv,{maPhuongXa:_==null?void 0:_.NoiOHienTai},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:49,columnNumber:19},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:48,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:46,columnNumber:15},this),V.jsxDEV(cn,{data:Ri.DiaChiCuThe,value:_==null?void 0:_.DiaChiCuThe},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:52,columnNumber:15},this),V.jsxDEV(cn,{data:{title:"Người lao động nước ngoài:",type:"label"},value:_!=null&&_.IsNuocNgoai?"Có":"Không"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:53,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:22,columnNumber:13},this),V.jsxDEV(bl,{children:[V.jsxDEV(cn,{data:Ri.TrinhDoHV,value:_!=null&&_.QLLD_DM_TrinhDoHocVan?_==null?void 0:_.QLLD_DM_TrinhDoHocVan.Name:"",isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:59,columnNumber:15},this),V.jsxDEV(cn,{data:{title:"Trình độ học vấn(1/12 - 12/12):",type:"label"},value:_==null?void 0:_.TrinhDoHVText},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:64,columnNumber:15},this),V.jsxDEV(cn,{data:Ri.TrinhDoCMKT,value:_!=null&&_.QLLD_DM_TrinhDoCMKT?_==null?void 0:_.QLLD_DM_TrinhDoCMKT.Name:"",isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:68,columnNumber:15},this),V.jsxDEV(cn,{data:Ri.TinhTrangHonNhan,value:_!=null&&_.QLLD_DM_TinhTrangHonNhan?_==null?void 0:_.QLLD_DM_TinhTrangHonNhan.Name:"",isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:73,columnNumber:15},this),V.jsxDEV(cn,{data:Ri.TinhTrangThamGiaHDKT,value:_!=null&&_.QLLD_DM_TinhTrangViecLam?_==null?void 0:_.QLLD_DM_TinhTrangViecLam.Name:"",isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:78,columnNumber:15},this),V.jsxDEV(cn,{data:Ri.ThamGiaBHXH,value:_!=null&&_.QLLD_DM_ThamGiaBHXH?_==null?void 0:_.QLLD_DM_ThamGiaBHXH.Name:"",isDetail:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:83,columnNumber:15},this),V.jsxDEV(cn,{data:Ri.MaBHXH,value:_==null?void 0:_.MaBHXH},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:88,columnNumber:15},this),V.jsxDEV(cn,{data:{title:"Số điện thoại:",type:"label"},value:_==null?void 0:_.SoDienThoai},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:89,columnNumber:15},this),V.jsxDEV(cn,{data:{title:"Chuyên ngành đào tạo:",type:"label"},value:(w=_==null?void 0:_.QLLD_DM_GiaoDucQuocDan)==null?void 0:w.Name},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:90,columnNumber:15},this),V.jsxDEV(cn,{data:{title:"Nhóm ngành kinh tế:",type:"label"},value:(k=_==null?void 0:_.QLLD_DM_NhomNganhKinhTe1)==null?void 0:k.Name},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:94,columnNumber:15},this),V.jsxDEV(cn,{data:{title:"Công việc cụ thể:",type:"label"},value:(m=_==null?void 0:_.QLLD_DM_NhomNganhKinhTe)==null?void 0:m.Name},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:98,columnNumber:15},this),V.jsxDEV(cn,{data:{title:"Quốc gia:",type:"label"},value:(C=_==null?void 0:_.QLLD_DM_QuocGia)==null?void 0:C.Name},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:102,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:58,columnNumber:13},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:21,columnNumber:11},this),_&&g]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:20,columnNumber:9},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:19,columnNumber:7},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/DetailThongTin.jsx",lineNumber:18,columnNumber:5},this)}function Xx(v){const{ID:_,isOpen:u,isClose:g}=v,[w,k]=J.useState(),m=J.useCallback(()=>{eo(`QLLD_NguoiLaoDong(${_})?$expand=QLLD_DM_QuocGia,PhuongXa,PhuongXa1,PhuongXa2,QLLD_DM_GioiTinh,QLLD_DM_DanToc,QLLD_DM_TonGiao,PhuongXa,QLLD_DM_QuanHeVoiChuHo,QLLD_DM_TrinhDoHocVan,QLLD_DM_TrinhDoCMKT,QLLD_DM_TinhTrangHonNhan,QLLD_DM_TinhTrangViecLam,QLLD_DM_ThamGiaBHXH,QLLD_DM_NhomNganhKinhTe,QLLD_DM_NhomNganhKinhTe1,QLLD_DM_GiaoDucQuocDan`,"GET",null).then(M=>k(M))},[_]),C=J.useCallback(()=>{g()},[g]);return J.useEffect(()=>{m()},[m]),V.jsxDEV(eC,{style:{zIndex:"9999"},open:u,onClose:C,children:V.jsxDEV(J.Suspense,{fallback:()=>V.jsxDEV(F1,{},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:35,columnNumber:33},this),children:V.jsxDEV("div",{className:"csdlg-detail",children:V.jsxDEV(Dx,{renderButton:V.jsxDEV(Li,{color:"danger",size:"sm",onClick:C,className:"me-2",children:[V.jsxDEV(to,{fa:"times-circle"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:40,columnNumber:17},this),V.jsxDEV("span",{className:"ms-1",children:"Đóng"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:41,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:39,columnNumber:15},this),isTabNew:!0,setStyle:{activeTab:1,style:{width:"100%"}},setClassName:{activeTab:1,className:"overflowTabBasic"},data:[{TabName:"Thông tin người lao động",TabContent:V.jsxDEV(Zx,{data:w,reloadAll:()=>m(w==null?void 0:w.Id)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:50,columnNumber:29},this)}]},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:37,columnNumber:11},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:36,columnNumber:9},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:35,columnNumber:7},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/views/QuanLyLaoDong/Components/Detail/Detail.jsx",lineNumber:34,columnNumber:5},this)}const eC=No(Qx)` .MuiDialogContent-root { overflow: auto !important; z-index: 9999 !important; } `,tC=No.div` position: absolute; top: -12px; left: 12px; background-color: #fff; color: #374dc5; font-weight: bold; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; /* number of lines to show */ -webkit-box-orient: vertical; `,nC=No(ou)` .ntable { .search { top: 10px !important; left: 15px !important; } .ntable-wrap { .ntable-inner { height: calc(100vh - 200px); overflow-y: auto !important; } } } `,iC=No(lw)` .input-group-text { transition: 0.3s linear; font-size: 12px; max-height: 27px; font-weight: bold; cursor: pointer; color: white; &:hover { opacity: 0.8; } } `,oC=J.memo(v=>{const{label:_,onClick:u,selectedItem:g,dataSelect:w,valueDisplay:k,onDelete:m,placeholder:C,labelDelete:M,handelDeleteSelected:B}=v,T=typeof m;return V.jsxDEV(iC,{children:[V.jsxDEV(uh,{style:{fontSize:"0.775rem",maxHeight:"27px"},value:g?g[w.selectColumn]:k||C||"Chưa chọn...",readOnly:!0},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:76,columnNumber:7},globalThis),V.jsxDEV(Q_,{className:"bg-info",style:{pointerEvents:w.disableSelect?"none":"auto",opacity:w.disableSelect?.65:1},onClick:u,children:_},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:89,columnNumber:7},globalThis),m&&V.jsxDEV(Q_,{className:"bg-danger",style:{pointerEvents:w.disableSelect?"none":"auto",opacity:w.disableSelect?.65:1},onClick:T==="function"?m:B,children:M||"Xóa"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:100,columnNumber:9},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:75,columnNumber:5},globalThis)}),rC=J.memo(v=>{const{dataSelect:_,onClose:u,isOpen:g,setselectedItem:w,ableCRUD:k,maxWidth:m,isModal:C,toggleAdd:M,tableRef:B,toggleImport:T,toggleOnRowSelect:L,setValueRow:U,isImport:j}=v,$=J.useRef([{title:"Id",field:"Id",type:"numeric",hidden:!0},{title:"Tên",field:"Name",type:"string"}]);return V.jsxDEV(V.Fragment,{children:V.jsxDEV(nC,{maxWidth:m,size:"xl",isOpen:g,toggle:u,zIndex:_.zIndex||1301,children:[V.jsxDEV(iu,{children:V.jsxDEV(Tx,{title:_.title,tableRef:B,url:_.url,columns:_.columns||$,where:_.where,SearchAdvanced:_.isFormSearch?()=>_.isFormSearch:null,onAdd:C?{onClick:()=>M("add",null)}:k?{disabled:!1,defaultValues:_.defaultValues||[]}:null,onEdit:C?{onClick:(Z,se)=>M("edit",se),hidden:!k}:k?{defaultValues:_.defaultValuesEdit||[]}:null,onDelete:k?{}:null,onActions:[{icon:"upload",tooltip:"Import",isFreeAction:!0,hidden:!j,onClick:()=>T()},{icon:"tag",tooltip:"Chọn",onClick:(Z,se)=>{w(se),u()}}],onRowClick:(Z,se)=>{L(),U(se)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:157,columnNumber:11},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:156,columnNumber:9},globalThis)," "]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:149,columnNumber:7},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:148,columnNumber:5},globalThis)});function dw(v){const{isComponent:_,label:u,dataSelect:g,onCallback:w,ableCRUD:k,valueDisplay:m,onDelete:C,placeholder:M,labelDelete:B,onClickButton:T,maxWidth:L,isModal:U,isImport:j,isCheck:$,isOnRowSelect:Z,keyComponent:se}=v,[ue,le]=J.useState(null),[G,ne]=J.useState(!1),[ie,me]=J.useState(!1),[pe,De]=J.useState({}),[Ie,Me]=J.useState(null),[Ue,te]=J.useState(!1),[ce,be]=J.useState(!1),[ke,Ne]=J.useState(!1),[xe,Le]=J.useState(),Fe=J.useContext(B1),Ye=J.useRef(),Ve=J.useCallback(()=>Ye.current&&Ye.current.onQueryChange(),[]);J.useEffect(()=>{Fe.reloadTablePopup&&Ve(),!Fe.reloadTablePopup&&Ve()},[Fe.reloadTablePopup,Ve]);const yt=J.useCallback(()=>{T&&T(),ne(!G)},[T,G]),Se=J.useCallback((Ae,lt)=>{T&&T(),Ae==="add"?(Me(null),De({})):Ae==="edit"?(Me(lt.Id),De({...lt})):De({}),me(!ie)},[T,ie]),We=()=>{Fe.setOpenPopupNguoiLaoDong("abc"),ne(!1)},Oe=J.useCallback(()=>{T&&T(),te(!Ue)},[Ue,T]);J.useEffect(()=>{ue&&w(ue)},[ue]);const{handleChange:He,handleValidate:ht}=$x(pe,g.formAddModal,Ae=>De(Ae)),ot=J.useCallback(async()=>{if(ht()){const Ae=$;let lt=!1;const rt=Ie?"PATCH":"POST",Nt=Ie?`${g.url}(guid'${Ie}')`:`${g.url}`,wn=Ie?"Cập nhật thành công":"Thêm thành công";delete pe.DM_Chuong,delete pe.Dieu18_DM_LinhVuc,delete pe.Id,delete pe.TenChuong,delete pe.tableData,delete pe.PhuongXa,delete pe.QLLD_DM_DanToc,delete pe.QLLD_DM_GioiTinh,delete pe.QLLD_DM_ThamGiaBHXH,delete pe.QLLD_DM_TinhTrangHonNhan,delete pe.QLLD_DM_TinhTrangViecLam,delete pe.QLLD_DM_TonGiao,delete pe.QLLD_DM_TrinhDoCMKT,delete pe.QLLD_DM_TrinhDoHocVan,delete pe.QLLD_DM_QuanHeVoiChuHo,delete pe.ThonXom,$&&!Ie&&(lt=await eo(`${Ae}`,"POST",JSON.stringify(pe),!1));const rn=()=>eo(Nt,rt,JSON.stringify(pe)).then(Mt=>{Se(),Ve(),gl(wn)});lt?aw("Bạn có muốn tiếp tục thêm vào dánh sách dự án",`Mã dự án ${pe.MaDuAnDauTu} đã tồn tại trong danh sách dự án`).then(Mt=>{Mt.isConfirmed&&rn()}):rn()}},[ht,$,Ie,g.url,pe,Se,Ve]),tt=J.useMemo(()=>{if(g.formAddModal){const Ae=Object.values(g.formAddModal),lt=rt=>{var Nt;return rt.type!=="popup-select"?pe[rt.field_name]:pe[(Nt=rt.popupSelect)==null?void 0:Nt.selectColumn]};return V.jsxDEV(ou,{size:"lg",isOpen:ie,zIndex:1301,toggle:Se,children:[V.jsxDEV(dh,{children:[Ie?V.jsxDEV("span",{children:"Cập Nhật"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:356,columnNumber:23},this):V.jsxDEV("span",{children:"Thêm Mới"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:356,columnNumber:47},this),V.jsxDEV("span",{className:"float-right",children:[V.jsxDEV(Li,{className:"me-2",color:"success",onClick:ot,children:[V.jsxDEV(to,{fa:"save"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:359,columnNumber:17},this),V.jsxDEV("span",{className:"ms-2",children:"Lưu"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:360,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:358,columnNumber:15},this),V.jsxDEV(Li,{color:"danger",onClick:Se,children:[V.jsxDEV(to,{fa:"times"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:363,columnNumber:17},this),V.jsxDEV("span",{className:"ms-2",children:"Trở lại"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:364,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:362,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:357,columnNumber:13},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:355,columnNumber:11},this),V.jsxDEV(iu,{className:"pt-0",style:{height:"calc(100vh - 130px)",overflow:"auto"},children:Ae.map((rt,Nt)=>V.jsxDEV(G1,{className:"mt-4",children:[V.jsxDEV(tC,{title:rt.title,children:rt.title},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:371,columnNumber:17},this),V.jsxDEV(Q1,{onDragStart:wn=>wn.preventDefault(),className:"pt-3 pb-2",children:[V.jsxDEV(cn,{data:{...rt,hidden_label:!0},value:lt(rt),onChange:(wn,rn)=>He(wn,rn),inline:!1},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:373,columnNumber:19},this),rt.required&&V.jsxDEV("p",{className:"mb-0",children:[V.jsxDEV("span",{style:{color:"red"},children:"(*)"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:381,columnNumber:23},this)," Bắt buộc nhập"]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:380,columnNumber:21},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:372,columnNumber:17},this)]},Nt,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:370,columnNumber:15},this))},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:368,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:354,columnNumber:9},this)}},[g.formAddModal,ie,Se,pe,ot]),$e=J.useCallback(()=>{be(!ce),Ne(!ke)},[ce,ke]),Je=J.useMemo(()=>{switch(se){case"ModalGD":return V.jsxDEV(Px,{valueRow:xe,isOpen:ce,onClose:$e},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:402,columnNumber:16},this);case"ModalNLD":return V.jsxDEV(Xx,{SDDGD:xe==null?void 0:xe.SoDinhDanhHoGD,ID:xe==null?void 0:xe.Id,isOpen:ke,isClose:$e},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:405,columnNumber:11},this);default:return V.jsxDEV("div",{className:""},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:413,columnNumber:16},this)}},[se,ce,ke,$e,xe]),qt=J.useMemo(()=>{const{urlImport:Ae,urlPreImport:lt,columnsImport:rt,theadTableImport:Nt,title:wn,urldownload:rn,isNew:Mt}=g;return V.jsxDEV(Gx,{zIndex:1301,urldownload:rn,title:"Import "+wn,isOpen:Ue,isClose:Oe,isNew:Mt,urlImport:Ae,urlPreImport:lt,columnsImport:rt,theadTableImport:Nt,reloadData:Ve},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:420,columnNumber:7},this)},[Ue,Oe,g,Ve]),Qt=J.useMemo(()=>G&&V.jsxDEV(rC,{ableCRUD:k,isOpen:G,onClose:yt,dataSelect:g,setselectedItem:le,maxWidth:L,isModal:U,isImport:j,toggleAdd:_?We:Se,toggleImport:Oe,tableRef:Ye,isOnRowSelect:Z,toggleOnRowSelect:$e,setValueRow:Le,keyComponent:se},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:439,columnNumber:9},this),[k,g,U,L,G,yt]),we=J.useCallback(()=>{le(null)},[]);return V.jsxDEV(kr.Fragment,{children:[V.jsxDEV(oC,{label:u,onClick:yt,onDelete:C,labelDelete:B,selectedItem:ue,dataSelect:g,valueDisplay:m,placeholder:M,handelDeleteSelected:we},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:467,columnNumber:7},this),Qt,_||ie&&tt,qt,Je]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelect.jsx",lineNumber:466,columnNumber:5},this)}dw.propTypes={label:ee.oneOfType([ee.string,ee.number,ee.element]),dataSelect:ee.shape({title:ee.string,url:ee.string.isRequired,where:ee.string,columns:ee.array,defaultValues:ee.array,selectColumn:ee.string.isRequired,disableSelect:ee.bool}),onCallback:ee.func.isRequired,className:ee.shape({button:ee.string,popup:ee.string}),labelDelete:ee.string,ableCRUD:ee.bool,valueDisplay:ee.string,placeholder:ee.string,maxWidth:ee.number};dw.defaultProps={label:"Chọn",className:{},ableCRUD:!0};var fg={exports:{}};/*! * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. */fg.exports;(function(v,_){(function(u,g){v.exports=g(J)})(self,u=>(()=>{var g={703:(C,M,B)=>{var T=B(414);function L(){}function U(){}U.resetWarningCache=L,C.exports=function(){function j(se,ue,le,G,ne,ie){if(ie!==T){var me=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 me.name="Invariant Violation",me}}function $(){return j}j.isRequired=j;var Z={array:j,bigint:j,bool:j,func:j,number:j,object:j,string:j,symbol:j,any:j,arrayOf:$,element:j,elementType:j,instanceOf:$,node:j,objectOf:$,oneOf:$,oneOfType:$,shape:$,exact:$,checkPropTypes:U,resetWarningCache:L};return Z.PropTypes=Z,Z}},697:(C,M,B)=>{C.exports=B(703)()},414:C=>{C.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},787:C=>{C.exports=u}},w={};function k(C){var M=w[C];if(M!==void 0)return M.exports;var B=w[C]={exports:{}};return g[C](B,B.exports,k),B.exports}k.n=C=>{var M=C&&C.__esModule?()=>C.default:()=>C;return k.d(M,{a:M}),M},k.d=(C,M)=>{for(var B in M)k.o(M,B)&&!k.o(C,B)&&Object.defineProperty(C,B,{enumerable:!0,get:M[B]})},k.o=(C,M)=>Object.prototype.hasOwnProperty.call(C,M),k.r=C=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(C,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(C,"__esModule",{value:!0})};var m={};return(()=>{k.r(m),k.d(m,{CKEditor:()=>Ni,CKEditorContext:()=>Ta});var C=k(787),M=k.n(C),B=k(697),T=k.n(B);const L=function(A){var N=typeof A;return A!=null&&(N=="object"||N=="function")},U=typeof on=="object"&&on&&on.Object===Object&&on;var j=typeof self=="object"&&self&&self.Object===Object&&self;const $=U||j||Function("return this")(),Z=function(){return $.Date.now()};var se=/\s/;const ue=function(A){for(var N=A.length;N--&&se.test(A.charAt(N)););return N};var le=/^\s+/;const G=function(A){return A&&A.slice(0,ue(A)+1).replace(le,"")},ne=$.Symbol;var ie=Object.prototype,me=ie.hasOwnProperty,pe=ie.toString,De=ne?ne.toStringTag:void 0;const Ie=function(A){var N=me.call(A,De),z=A[De];try{A[De]=void 0;var X=!0}catch{}var Pe=pe.call(A);return X&&(N?A[De]=z:delete A[De]),Pe};var Me=Object.prototype.toString;const Ue=function(A){return Me.call(A)};var te=ne?ne.toStringTag:void 0;const ce=function(A){return A==null?A===void 0?"[object Undefined]":"[object Null]":te&&te in Object(A)?Ie(A):Ue(A)},be=function(A){return A!=null&&typeof A=="object"},ke=function(A){return typeof A=="symbol"||be(A)&&ce(A)=="[object Symbol]"};var Ne=/^[-+]0x[0-9a-f]+$/i,xe=/^0b[01]+$/i,Le=/^0o[0-7]+$/i,Fe=parseInt;const Ye=function(A){if(typeof A=="number")return A;if(ke(A))return NaN;if(L(A)){var N=typeof A.valueOf=="function"?A.valueOf():A;A=L(N)?N+"":N}if(typeof A!="string")return A===0?A:+A;A=G(A);var z=xe.test(A);return z||Le.test(A)?Fe(A.slice(2),z?2:8):Ne.test(A)?NaN:+A};var Ve=Math.max,yt=Math.min;const Se=function(A,N,z){var X,Pe,Ce,je,Ke,Et,Jt=0,lr=!1,Pi=!1,Ii=!0;if(typeof A!="function")throw new TypeError("Expected a function");function fi(Xe){var Rt=X,Ct=Pe;return X=Pe=void 0,Jt=Xe,je=A.apply(Ct,Rt)}function K(Xe){return Jt=Xe,Ke=setTimeout(Y,N),lr?fi(Xe):je}function oe(Xe){var Rt=Xe-Et;return Et===void 0||Rt>=N||Rt<0||Pi&&Xe-Jt>=Ce}function Y(){var Xe=Z();if(oe(Xe))return Te(Xe);Ke=setTimeout(Y,function(Rt){var Ct=N-(Rt-Et);return Pi?yt(Ct,Ce-(Rt-Jt)):Ct}(Xe))}function Te(Xe){return Ke=void 0,Ii&&X?fi(Xe):(X=Pe=void 0,je)}function Ze(){var Xe=Z(),Rt=oe(Xe);if(X=arguments,Pe=this,Et=Xe,Rt){if(Ke===void 0)return K(Et);if(Pi)return clearTimeout(Ke),Ke=setTimeout(Y,N),fi(Et)}return Ke===void 0&&(Ke=setTimeout(Y,N)),je}return N=Ye(N)||0,L(z)&&(lr=!!z.leading,Ce=(Pi="maxWait"in z)?Ve(Ye(z.maxWait)||0,N):Ce,Ii="trailing"in z?!!z.trailing:Ii),Ze.cancel=function(){Ke!==void 0&&clearTimeout(Ke),Jt=0,X=Et=Pe=Ke=void 0},Ze.flush=function(){return Ke===void 0?je:Te(Z())},Ze},We=function(A,N,z){var X=!0,Pe=!0;if(typeof A!="function")throw new TypeError("Expected a function");return L(z)&&(X="leading"in z?!!z.leading:X,Pe="trailing"in z?!!z.trailing:Pe),Se(A,N,{leading:X,maxWait:N,trailing:Pe})},Oe=function(){this.__data__=[],this.size=0},He=function(A,N){return A===N||A!=A&&N!=N},ht=function(A,N){for(var z=A.length;z--;)if(He(A[z][0],N))return z;return-1};var ot=Array.prototype.splice;const tt=function(A){var N=this.__data__,z=ht(N,A);return!(z<0)&&(z==N.length-1?N.pop():ot.call(N,z,1),--this.size,!0)},$e=function(A){var N=this.__data__,z=ht(N,A);return z<0?void 0:N[z][1]},Je=function(A){return ht(this.__data__,A)>-1},qt=function(A,N){var z=this.__data__,X=ht(z,A);return X<0?(++this.size,z.push([A,N])):z[X][1]=N,this};function Qt(A){var N=-1,z=A==null?0:A.length;for(this.clear();++N<z;){var X=A[N];this.set(X[0],X[1])}}Qt.prototype.clear=Oe,Qt.prototype.delete=tt,Qt.prototype.get=$e,Qt.prototype.has=Je,Qt.prototype.set=qt;const we=Qt,Ae=function(){this.__data__=new we,this.size=0},lt=function(A){var N=this.__data__,z=N.delete(A);return this.size=N.size,z},rt=function(A){return this.__data__.get(A)},Nt=function(A){return this.__data__.has(A)},wn=function(A){if(!L(A))return!1;var N=ce(A);return N=="[object Function]"||N=="[object GeneratorFunction]"||N=="[object AsyncFunction]"||N=="[object Proxy]"},rn=$["__core-js_shared__"];var Mt=function(){var A=/[^.]+$/.exec(rn&&rn.keys&&rn.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""}();const Fi=function(A){return!!Mt&&Mt in A};var Zo=Function.prototype.toString;const fn=function(A){if(A!=null){try{return Zo.call(A)}catch{}try{return A+""}catch{}}return""};var no=/^\[object .+?Constructor\]$/,Ks=Function.prototype,io=Object.prototype,ui=Ks.toString,xr=io.hasOwnProperty,Po=RegExp("^"+ui.call(xr).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Cr=function(A){return!(!L(A)||Fi(A))&&(wn(A)?Po:no).test(fn(A))},Io=function(A,N){return A==null?void 0:A[N]},di=function(A,N){var z=Io(A,N);return Cr(z)?z:void 0},ft=di($,"Map"),Yt=di(Object,"create"),un=function(){this.__data__=Yt?Yt(null):{},this.size=0},pn=function(A){var N=this.has(A)&&delete this.__data__[A];return this.size-=N?1:0,N};var Cn=Object.prototype.hasOwnProperty;const Sn=function(A){var N=this.__data__;if(Yt){var z=N[A];return z==="__lodash_hash_undefined__"?void 0:z}return Cn.call(N,A)?N[A]:void 0};var sn=Object.prototype.hasOwnProperty;const Ei=function(A){var N=this.__data__;return Yt?N[A]!==void 0:sn.call(N,A)},xt=function(A,N){var z=this.__data__;return this.size+=this.has(A)?0:1,z[A]=Yt&&N===void 0?"__lodash_hash_undefined__":N,this};function oo(A){var N=-1,z=A==null?0:A.length;for(this.clear();++N<z;){var X=A[N];this.set(X[0],X[1])}}oo.prototype.clear=un,oo.prototype.delete=pn,oo.prototype.get=Sn,oo.prototype.has=Ei,oo.prototype.set=xt;const rs=oo,Xo=function(){this.size=0,this.__data__={hash:new rs,map:new(ft||we),string:new rs}},kl=function(A){var N=typeof A;return N=="string"||N=="number"||N=="symbol"||N=="boolean"?A!=="__proto__":A===null},Mo=function(A,N){var z=A.__data__;return kl(N)?z[typeof N=="string"?"string":"hash"]:z.map},pu=function(A){var N=Mo(this,A).delete(A);return this.size-=N?1:0,N},yl=function(A){return Mo(this,A).get(A)},gu=function(A){return Mo(this,A).has(A)},Tr=function(A,N){var z=Mo(this,A),X=z.size;return z.set(A,N),this.size+=z.size==X?0:1,this};function er(A){var N=-1,z=A==null?0:A.length;for(this.clear();++N<z;){var X=A[N];this.set(X[0],X[1])}}er.prototype.clear=Xo,er.prototype.delete=pu,er.prototype.get=yl,er.prototype.has=gu,er.prototype.set=Tr;const qs=er,mu=function(A,N){var z=this.__data__;if(z instanceof we){var X=z.__data__;if(!ft||X.length<199)return X.push([A,N]),this.size=++z.size,this;z=this.__data__=new qs(X)}return z.set(A,N),this.size=z.size,this};function hi(A){var N=this.__data__=new we(A);this.size=N.size}hi.prototype.clear=Ae,hi.prototype.delete=lt,hi.prototype.get=rt,hi.prototype.has=Nt,hi.prototype.set=mu;const Er=hi,ss=function(A,N){for(var z=-1,X=A==null?0:A.length;++z<X&&N(A[z],z,A)!==!1;);return A},Sr=function(){try{var A=di(Object,"defineProperty");return A({},"",{}),A}catch{}}(),Ar=function(A,N,z){N=="__proto__"&&Sr?Sr(A,N,{configurable:!0,enumerable:!0,value:z,writable:!0}):A[N]=z};var tr=Object.prototype.hasOwnProperty;const Gs=function(A,N,z){var X=A[N];tr.call(A,N)&&He(X,z)&&(z!==void 0||N in A)||Ar(A,N,z)},Do=function(A,N,z,X){var Pe=!z;z||(z={});for(var Ce=-1,je=N.length;++Ce<je;){var Ke=N[Ce],Et=X?X(z[Ke],A[Ke],Ke,z,A):void 0;Et===void 0&&(Et=A[Ke]),Pe?Ar(z,Ke,Et):Gs(z,Ke,Et)}return z},$t=function(A,N){for(var z=-1,X=Array(A);++z<A;)X[z]=N(z);return X},Qs=function(A){return be(A)&&ce(A)=="[object Arguments]"};var xl=Object.prototype,bu=xl.hasOwnProperty,Cl=xl.propertyIsEnumerable;const Tl=Qs(function(){return arguments}())?Qs:function(A){return be(A)&&bu.call(A,"callee")&&!Cl.call(A,"callee")},ze=Array.isArray,ve=function(){return!1};var nr=_&&!_.nodeType&&_,pt=nr&&!0&&v&&!v.nodeType&&v,Ys=pt&&pt.exports===nr?$.Buffer:void 0;const Js=(Ys?Ys.isBuffer:void 0)||ve;var Zs=/^(?:0|[1-9]\d*)$/;const as=function(A,N){var z=typeof A;return!!(N=N??9007199254740991)&&(z=="number"||z!="symbol"&&Zs.test(A))&&A>-1&&A%1==0&&A<N},Xs=function(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=9007199254740991};var Ut={};Ut["[object Float32Array]"]=Ut["[object Float64Array]"]=Ut["[object Int8Array]"]=Ut["[object Int16Array]"]=Ut["[object Int32Array]"]=Ut["[object Uint8Array]"]=Ut["[object Uint8ClampedArray]"]=Ut["[object Uint16Array]"]=Ut["[object Uint32Array]"]=!0,Ut["[object Arguments]"]=Ut["[object Array]"]=Ut["[object ArrayBuffer]"]=Ut["[object Boolean]"]=Ut["[object DataView]"]=Ut["[object Date]"]=Ut["[object Error]"]=Ut["[object Function]"]=Ut["[object Map]"]=Ut["[object Number]"]=Ut["[object Object]"]=Ut["[object RegExp]"]=Ut["[object Set]"]=Ut["[object String]"]=Ut["[object WeakMap]"]=!1;const El=function(A){return be(A)&&Xs(A.length)&&!!Ut[ce(A)]},ea=function(A){return function(N){return A(N)}};var Sl=_&&!_.nodeType&&_,_n=Sl&&!0&&v&&!v.nodeType&&v,ls=_n&&_n.exports===Sl&&U.process;const Si=function(){try{var A=_n&&_n.require&&_n.require("util").types;return A||ls&&ls.binding&&ls.binding("util")}catch{}}();var cs=Si&&Si.isTypedArray;const vu=cs?ea(cs):El;var Al=Object.prototype.hasOwnProperty;const Nr=function(A,N){var z=ze(A),X=!z&&Tl(A),Pe=!z&&!X&&Js(A),Ce=!z&&!X&&!Pe&&vu(A),je=z||X||Pe||Ce,Ke=je?$t(A.length,String):[],Et=Ke.length;for(var Jt in A)!N&&!Al.call(A,Jt)||je&&(Jt=="length"||Pe&&(Jt=="offset"||Jt=="parent")||Ce&&(Jt=="buffer"||Jt=="byteLength"||Jt=="byteOffset")||as(Jt,Et))||Ke.push(Jt);return Ke};var Nl=Object.prototype;const ro=function(A){var N=A&&A.constructor;return A===(typeof N=="function"&&N.prototype||Nl)},ir=function(A,N){return function(z){return A(N(z))}},Pl=ir(Object.keys,Object);var ta=Object.prototype.hasOwnProperty;const wu=function(A){if(!ro(A))return Pl(A);var N=[];for(var z in Object(A))ta.call(A,z)&&z!="constructor"&&N.push(z);return N},na=function(A){return A!=null&&Xs(A.length)&&!wn(A)},Bi=function(A){return na(A)?Nr(A):wu(A)},Oo=function(A,N){return A&&Do(N,Bi(N),A)},or=function(A){var N=[];if(A!=null)for(var z in Object(A))N.push(z);return N};var Il=Object.prototype.hasOwnProperty;const Ml=function(A){if(!L(A))return or(A);var N=ro(A),z=[];for(var X in A)(X!="constructor"||!N&&Il.call(A,X))&&z.push(X);return z},ia=function(A){return na(A)?Nr(A,!0):Ml(A)},Dl=function(A,N){return A&&Do(N,ia(N),A)};var oa=_&&!_.nodeType&&_,ra=oa&&!0&&v&&!v.nodeType&&v,so=ra&&ra.exports===oa?$.Buffer:void 0,sa=so?so.allocUnsafe:void 0;const _u=function(A,N){if(N)return A.slice();var z=A.length,X=sa?sa(z):new A.constructor(z);return A.copy(X),X},ku=function(A,N){var z=-1,X=A.length;for(N||(N=Array(X));++z<X;)N[z]=A[z];return N},Pr=function(A,N){for(var z=-1,X=A==null?0:A.length,Pe=0,Ce=[];++z<X;){var je=A[z];N(je,z,A)&&(Ce[Pe++]=je)}return Ce},Ol=function(){return[]};var yu=Object.prototype.propertyIsEnumerable,jl=Object.getOwnPropertySymbols;const aa=jl?function(A){return A==null?[]:(A=Object(A),Pr(jl(A),function(N){return yu.call(A,N)}))}:Ol,ao=function(A,N){return Do(A,aa(A),N)},Ir=function(A,N){for(var z=-1,X=N.length,Pe=A.length;++z<X;)A[Pe+z]=N[z];return A},la=ir(Object.getPrototypeOf,Object),jo=Object.getOwnPropertySymbols?function(A){for(var N=[];A;)Ir(N,aa(A)),A=la(A);return N}:Ol,Mr=function(A,N){return Do(A,jo(A),N)},Rl=function(A,N,z){var X=N(A);return ze(A)?X:Ir(X,z(A))},Wt=function(A){return Rl(A,Bi,aa)},zt=function(A){return Rl(A,ia,jo)},ca=di($,"DataView"),Dr=di($,"Promise"),ua=di($,"Set"),da=di($,"WeakMap");var ha="[object Map]",fa="[object Promise]",pa="[object Set]",ga="[object WeakMap]",gn="[object DataView]",us=fn(ca),Hi=fn(ft),Ll=fn(Dr),ds=fn(ua),Un=fn(da),lo=ce;(ca&&lo(new ca(new ArrayBuffer(1)))!=gn||ft&&lo(new ft)!=ha||Dr&&lo(Dr.resolve())!=fa||ua&&lo(new ua)!=pa||da&&lo(new da)!=ga)&&(lo=function(A){var N=ce(A),z=N=="[object Object]"?A.constructor:void 0,X=z?fn(z):"";if(X)switch(X){case us:return gn;case Hi:return ha;case Ll:return fa;case ds:return pa;case Un:return ga}return N});const Or=lo;var hs=Object.prototype.hasOwnProperty;const Vl=function(A){var N=A.length,z=new A.constructor(N);return N&&typeof A[0]=="string"&&hs.call(A,"index")&&(z.index=A.index,z.input=A.input),z},jr=$.Uint8Array,rr=function(A){var N=new A.constructor(A.byteLength);return new jr(N).set(new jr(A)),N},An=function(A,N){var z=N?rr(A.buffer):A.buffer;return new A.constructor(z,A.byteOffset,A.byteLength)};var ma=/\w*$/;const Zn=function(A){var N=new A.constructor(A.source,ma.exec(A));return N.lastIndex=A.lastIndex,N};var zl=ne?ne.prototype:void 0,ba=zl?zl.valueOf:void 0;const co=function(A){return ba?Object(ba.call(A)):{}},fs=function(A,N){var z=N?rr(A.buffer):A.buffer;return new A.constructor(z,A.byteOffset,A.length)},$i=function(A,N,z){var X=A.constructor;switch(N){case"[object ArrayBuffer]":return rr(A);case"[object Boolean]":case"[object Date]":return new X(+A);case"[object DataView]":return An(A,z);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 fs(A,z);case"[object Map]":case"[object Set]":return new X;case"[object Number]":case"[object String]":return new X(A);case"[object RegExp]":return Zn(A);case"[object Symbol]":return co(A)}};var Pt=Object.create;const uo=function(){function A(){}return function(N){if(!L(N))return{};if(Pt)return Pt(N);A.prototype=N;var z=new A;return A.prototype=void 0,z}}(),va=function(A){return typeof A.constructor!="function"||ro(A)?{}:uo(la(A))},ps=function(A){return be(A)&&Or(A)=="[object Map]"};var sr=Si&&Si.isMap;const xu=sr?ea(sr):ps,Cu=function(A){return be(A)&&Or(A)=="[object Set]"};var Fl=Si&&Si.isSet;const wa=Fl?ea(Fl):Cu;var ar="[object Arguments]",Ro="[object Function]",Bl="[object Object]",jt={};jt[ar]=jt["[object Array]"]=jt["[object ArrayBuffer]"]=jt["[object DataView]"]=jt["[object Boolean]"]=jt["[object Date]"]=jt["[object Float32Array]"]=jt["[object Float64Array]"]=jt["[object Int8Array]"]=jt["[object Int16Array]"]=jt["[object Int32Array]"]=jt["[object Map]"]=jt["[object Number]"]=jt["[object Object]"]=jt["[object RegExp]"]=jt["[object Set]"]=jt["[object String]"]=jt["[object Symbol]"]=jt["[object Uint8Array]"]=jt["[object Uint8ClampedArray]"]=jt["[object Uint16Array]"]=jt["[object Uint32Array]"]=!0,jt["[object Error]"]=jt[Ro]=jt["[object WeakMap]"]=!1;const _a=function A(N,z,X,Pe,Ce,je){var Ke,Et=1&z,Jt=2&z,lr=4&z;if(X&&(Ke=Ce?X(N,Pe,Ce,je):X(N)),Ke!==void 0)return Ke;if(!L(N))return N;var Pi=ze(N);if(Pi){if(Ke=Vl(N),!Et)return ku(N,Ke)}else{var Ii=Or(N),fi=Ii==Ro||Ii=="[object GeneratorFunction]";if(Js(N))return _u(N,Et);if(Ii==Bl||Ii==ar||fi&&!Ce){if(Ke=Jt||fi?{}:va(N),!Et)return Jt?Mr(N,Dl(Ke,N)):ao(N,Oo(Ke,N))}else{if(!jt[Ii])return Ce?N:{};Ke=$i(N,Ii,Et)}}je||(je=new Er);var K=je.get(N);if(K)return K;je.set(N,Ke),wa(N)?N.forEach(function(Y){Ke.add(A(Y,z,X,Y,N,je))}):xu(N)&&N.forEach(function(Y,Te){Ke.set(Te,A(Y,z,X,Te,N,je))});var oe=Pi?void 0:(lr?Jt?zt:Wt:Jt?ia:Bi)(N);return ss(oe||N,function(Y,Te){oe&&(Y=N[Te=Y]),Gs(Ke,Te,A(Y,z,X,Te,N,je))}),Ke},ka=function(A,N){return _a(A,5,N=typeof N=="function"?N:void 0)};var gs=Function.prototype,Hl=Object.prototype,ya=gs.toString,xa=Hl.hasOwnProperty,Ca=ya.call(Object);const $l=function(A){if(!be(A)||ce(A)!="[object Object]")return!1;var N=la(A);if(N===null)return!0;var z=xa.call(N,"constructor")&&N.constructor;return typeof z=="function"&&z instanceof z&&ya.call(z)==Ca},Ul=function(A){return be(A)&&A.nodeType===1&&!$l(A)};function st(A,N=new Set){const z=[A],X=new Set;let Pe=0;for(;z.length>Pe;){const Ce=z[Pe++];if(!(X.has(Ce)||Rr(Ce)||N.has(Ce)))if(X.add(Ce),Ce[Symbol.iterator])try{for(const je of Ce)z.push(je)}catch{}else for(const je in Ce)je!=="defaultValue"&&z.push(Ce[je])}return X}function Rr(A){const N=Object.prototype.toString.call(A),z=typeof A;return z==="number"||z==="boolean"||z==="string"||z==="symbol"||z==="function"||N==="[object Date]"||N==="[object RegExp]"||N==="[object Module]"||A==null||A instanceof EventTarget||A instanceof Event}function Lo(A,N,z=new Set){if(A===N&&typeof(X=A)=="object"&&X!==null)return!0;var X;const Pe=st(A,z),Ce=st(N,z);for(const je of Pe)if(Ce.has(je))return!0;return!1}class Ai{constructor(N){if(this.crashes=[],this.state="initializing",this._crashNumberLimit=typeof N.crashNumberLimit=="number"?N.crashNumberLimit:3,this._now=Date.now,this._minimumNonErrorTimePeriod=typeof N.minimumNonErrorTimePeriod=="number"?N.minimumNonErrorTimePeriod:5e3,this._boundErrorHandler=z=>{const X=z.error||z.reason;X instanceof Error&&this._handleError(X,z)},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(N){this._creator=N}setDestructor(N){this._destructor=N}destroy(){this._stopErrorHandling(),this._listeners={}}on(N,z){this._listeners[N]||(this._listeners[N]=[]),this._listeners[N].push(z)}off(N,z){this._listeners[N]=this._listeners[N].filter(X=>X!==z)}_fire(N,...z){const X=this._listeners[N]||[];for(const Pe of X)Pe.apply(this,[null,...z])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(N,z){if(this._shouldReactToError(N)){this.crashes.push({message:N.message,stack:N.stack,filename:z.filename,lineno:z.lineno,colno:z.colno,date:this._now()});const X=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:N,causesRestart:X}),X?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(N){return N.is&&N.is("CKEditorError")&&N.context!==void 0&&N.context!==null&&this.state==="ready"&&this._isErrorComingFromThisItem(N)}_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 ms extends Ai{constructor(N,z={}){super(z),this._editor=null,this._throttledSave=We(this._save.bind(this),typeof z.saveInterval=="number"?z.saveInterval:5e3),this._creator=(X,Pe)=>N.create(X,Pe),this._destructor=X=>X.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(N=>{console.error("An error happened during the editor destroying.",N)}).then(()=>{if(typeof this._elementOrData=="string")return this.create(this._data,this._config,this._config.context);{const N=Object.assign({},this._config,{initialData:this._data});return this.create(this._elementOrData,N,N.context)}}).then(()=>{this._fire("restart")})}create(N=this._elementOrData,z=this._config,X){return Promise.resolve().then(()=>(super._startErrorHandling(),this._elementOrData=N,this._config=this._cloneEditorConfiguration(z)||{},this._config.context=X,this._creator(N,this._config))).then(Pe=>{this._editor=Pe,Pe.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=Pe.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 N=this._editor;return this._editor=null,N.model.document.off("change:data",this._throttledSave),this._destructor(N)})}_save(){const N=this._editor.model.document.version;try{this._data=this._getData(),this._lastDocumentVersion=N}catch(z){console.error(z,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(N){this._excludedProps=N}_getData(){const N={};for(const z of this._editor.model.document.getRootNames())N[z]=this._editor.data.get({rootName:z});return N}_isErrorComingFromThisItem(N){return Lo(this._editor,N.context,this._excludedProps)}_cloneEditorConfiguration(N){return ka(N,(z,X)=>Ul(z)||X==="context"?z:void 0)}}const kn=new Array(256).fill().map((A,N)=>("0"+N.toString(16)).slice(-2)),Lr=Symbol("MainQueueId");class Wn extends Ai{constructor(N,z={}){super(z),this._watchdogs=new Map,this._watchdogConfig=z,this._context=null,this._contextProps=new Set,this._actionQueues=new Xn,this._creator=X=>N.create(X),this._destructor=X=>X.destroy(),this._actionQueues.onEmpty(()=>{this.state==="initializing"&&(this.state="ready",this._fire("stateChange"))})}get context(){return this._context}create(N={}){return this._actionQueues.enqueue(Lr,()=>(this._contextConfig=N,this._create()))}getItem(N){return this._getWatchdog(N)._item}getItemState(N){return this._getWatchdog(N).state}add(N){const z=bs(N);return Promise.all(z.map(X=>this._actionQueues.enqueue(X.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 Pe;if(this._watchdogs.has(X.id))throw new Error(`Item with the given id is already added: '${X.id}'.`);if(X.type==="editor")return Pe=new ms(this._watchdogConfig),Pe.setCreator(X.creator),Pe._setExcludedProperties(this._contextProps),X.destructor&&Pe.setDestructor(X.destructor),this._watchdogs.set(X.id,Pe),Pe.on("error",(Ce,{error:je,causesRestart:Ke})=>{this._fire("itemError",{itemId:X.id,error:je}),Ke&&this._actionQueues.enqueue(X.id,()=>new Promise(Et=>{Pe.on("restart",(function Jt(){Pe.off("restart",Jt),this._fire("itemRestart",{itemId:X.id}),Et()}).bind(this))}))}),Pe.create(X.sourceElementOrData,X.config,this._context);throw new Error(`Not supported item type: '${X.type}'.`)})))}remove(N){const z=bs(N);return Promise.all(z.map(X=>this._actionQueues.enqueue(X,()=>{const Pe=this._getWatchdog(X);return this._watchdogs.delete(X),Pe.destroy()})))}destroy(){return this._actionQueues.enqueue(Lr,()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_restart(){return this._actionQueues.enqueue(Lr,()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch(N=>{console.error("An error happened during destroying the context or items.",N)}).then(()=>this._create()).then(()=>this._fire("restart"))))}_create(){return Promise.resolve().then(()=>(this._startErrorHandling(),this._creator(this._contextConfig))).then(N=>(this._context=N,this._contextProps=st(this._context),Promise.all(Array.from(this._watchdogs.values()).map(z=>(z._setExcludedProperties(this._contextProps),z.create(void 0,void 0,this._context))))))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling();const N=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map(z=>z.destroy())).then(()=>this._destructor(N))})}_getWatchdog(N){const z=this._watchdogs.get(N);if(!z)throw new Error(`Item with the given id was not registered: ${N}.`);return z}_isErrorComingFromThisItem(N){for(const z of this._watchdogs.values())if(z._isErrorComingFromThisItem(N))return!1;return Lo(this._context,N.context)}}class Xn{constructor(){this._onEmptyCallbacks=[],this._queues=new Map,this._actions=new WeakMap,this._lastActionId=0,this._activeActions=0}onEmpty(N){this._onEmptyCallbacks.push(N)}enqueue(N,z){const X=N===Lr;this._activeActions++,this._queues.get(N)||this._queues.set(N,Promise.resolve());const Pe=(X?Promise.all(this._queues.values()):Promise.all([this._queues.get(Lr),this._queues.get(N)])).then(z),Ce=Pe.catch(()=>{});return this._queues.set(N,Ce),Pe.finally(()=>{this._activeActions--,this._queues.get(N)===Ce&&this._activeActions===0&&this._onEmptyCallbacks.forEach(je=>je())})}}function bs(A){return Array.isArray(A)?A:[A]}const Tt=M().createContext("contextWatchdog");class Ta extends M().Component{constructor(N,z){super(N,z),this.contextWatchdog=null,this.props.isLayoutReady&&this._initializeContextWatchdog(this.props.config)}async shouldComponentUpdate(N){return N.id!==this.props.id&&(this.contextWatchdog&&await this.contextWatchdog.destroy(),await this._initializeContextWatchdog(N.config)),N.isLayoutReady&&!this.contextWatchdog?(await this._initializeContextWatchdog(N.config),!0):this.props.children!==N.children}render(){return M().createElement(Tt.Provider,{value:this.contextWatchdog},this.props.children)}async componentWillUnmount(){await this._destroyContext()}async _initializeContextWatchdog(N){this.contextWatchdog=new Wn(this.props.context),this.contextWatchdog.on("error",(z,X)=>{this.props.onError(X.error,{phase:"runtime",willContextRestart:X.causesRestart})}),this.contextWatchdog.on("stateChange",()=>{this.contextWatchdog.state==="ready"&&this.props.onReady&&this.props.onReady(this.contextWatchdog.context)}),await this.contextWatchdog.create(N).catch(z=>{this.props.onError(z,{phase:"initialization",willContextRestart:!1})})}async _destroyContext(){this.contextWatchdog&&(await this.contextWatchdog.destroy(),this.contextWatchdog=null)}}Ta.defaultProps={isLayoutReady:!0,onError:(A,N)=>console.error(A,N)},Ta.propTypes={id:T().string,isLayoutReady:T().bool,context:T().func,config:T().object,onReady:T().func,onError:T().func};const Ea="Lock from React integration (@ckeditor/ckeditor5-react)";class Ni extends M().Component{constructor(N){super(N),this.editorDestructionInProgress=null,this.domContainer=M().createRef(),this.watchdog=null;const{CKEDITOR_VERSION:z}=window;if(z){const[X]=z.split(".").map(Number);X<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(N){return!!this.editor&&(N.id!==this.props.id||(this._shouldUpdateEditor(N)&&this.editor.setData(N.data),"disabled"in N&&(N.disabled?this.editor.enableReadOnlyMode(Ea):this.editor.disableReadOnlyMode(Ea)),!1))}async componentDidMount(){await this._initializeEditor()}async componentDidUpdate(){await this._destroyEditor(),await this._initializeEditor()}async componentWillUnmount(){await this._destroyEditor()}render(){return M().createElement("div",{ref:this.domContainer})}async _initializeEditor(){await this.editorDestructionInProgress,this.watchdog||(this.context instanceof Wn?this.watchdog=new Wl(this.context):this.watchdog=new Ni._EditorWatchdog(this.props.editor),this.watchdog.setCreator((N,z)=>this._createEditor(N,z)),this.watchdog.on("error",(N,{error:z,causesRestart:X})=>{this.props.onError(z,{phase:"runtime",willEditorRestart:X})}),await this.watchdog.create(this.domContainer.current,this._getConfig()).catch(N=>this.props.onError(N,{phase:"initialization",willEditorRestart:!1})))}_createEditor(N,z){return this.props.editor.create(N,z).then(X=>{"disabled"in this.props&&this.props.disabled&&X.enableReadOnlyMode(Ea);const Pe=X.model.document,Ce=X.editing.view.document;return Pe.on("change:data",je=>{this.props.onChange&&this.props.onChange(je,X)}),Ce.on("focus",je=>{this.props.onFocus&&this.props.onFocus(je,X)}),Ce.on("blur",je=>{this.props.onBlur&&this.props.onBlur(je,X)}),setTimeout(()=>{this.props.onReady&&this.props.onReady(X)}),X})}async _destroyEditor(){this.editorDestructionInProgress=new Promise(N=>{this.watchdog?this.watchdog.destroy().then(()=>{this.watchdog=null,N()}):N()})}_shouldUpdateEditor(N){return this.props.data!==N.data&&this.editor.getData()!==N.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 Wl{constructor(N){this._contextWatchdog=N,this._id=function(){const z=4294967296*Math.random()>>>0,X=4294967296*Math.random()>>>0,Pe=4294967296*Math.random()>>>0,Ce=4294967296*Math.random()>>>0;return"e"+kn[z>>0&255]+kn[z>>8&255]+kn[z>>16&255]+kn[z>>24&255]+kn[X>>0&255]+kn[X>>8&255]+kn[X>>16&255]+kn[X>>24&255]+kn[Pe>>0&255]+kn[Pe>>8&255]+kn[Pe>>16&255]+kn[Pe>>24&255]+kn[Ce>>0&255]+kn[Ce>>8&255]+kn[Ce>>16&255]+kn[Ce>>24&255]}()}setCreator(N){this._creator=N}create(N,z){return this._contextWatchdog.add({sourceElementOrData:N,config:z,creator:this._creator,id:this._id,type:"editor"})}on(N,z){this._contextWatchdog.on("itemError",(X,{itemId:Pe,causesRestart:Ce,error:je})=>{Pe===this._id&&z(null,{error:je,causesRestart:Ce})})}destroy(){this._contextWatchdog.remove(this._id)}get editor(){return this._contextWatchdog.getItem(this._id)}}Ni.contextType=Tt,Ni.propTypes={editor:T().func.isRequired,data:T().string,config:T().object,onChange:T().func,onReady:T().func,onFocus:T().func,onBlur:T().func,onError:T().func,disabled:T().bool,onInit:(A,N)=>{if(A[N])return new Error('The "onInit" property is not supported anymore by the CKEditor component. Use the "onReady" property instead.')}},Ni.defaultProps={config:{},onError:(A,N)=>console.error(A,N)},Ni._EditorWatchdog=ms})(),m})())})(fg,fg.exports);var sC=fg.exports,$v={exports:{}};/*! * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */(function(v,_){(function(u){const g=u.en=u.en||{};g.dictionary=Object.assign(g.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(u,g){v.exports=g()}(window,function(){return function(u){var g={};function w(k){if(g[k])return g[k].exports;var m=g[k]={i:k,l:!1,exports:{}};return u[k].call(m.exports,m,m.exports,w),m.l=!0,m.exports}return w.m=u,w.c=g,w.d=function(k,m,C){w.o(k,m)||Object.defineProperty(k,m,{enumerable:!0,get:C})},w.r=function(k){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})},w.t=function(k,m){if(1&m&&(k=w(k)),8&m||4&m&&typeof k=="object"&&k&&k.__esModule)return k;var C=Object.create(null);if(w.r(C),Object.defineProperty(C,"default",{enumerable:!0,value:k}),2&m&&typeof k!="string")for(var M in k)w.d(C,M,(function(B){return k[B]}).bind(null,M));return C},w.n=function(k){var m=k&&k.__esModule?function(){return k.default}:function(){return k};return w.d(m,"a",m),m},w.o=function(k,m){return Object.prototype.hasOwnProperty.call(k,m)},w.p="",w(w.s=108)}([function(u,g,w){w.d(g,"a",function(){return k}),w.d(g,"b",function(){return m});class k extends Error{constructor(T,L,U){super(`${T}${U?" "+JSON.stringify(U):""}${C(T)}`),this.name="CKEditorError",this.context=L,this.data=U}is(T){return T==="CKEditorError"}static rethrowUnexpectedError(T,L){if(T.is&&T.is("CKEditorError"))throw T;const U=new k(T.message,L);throw U.stack=T.stack,U}}function m(B,T){console.warn(...M(B,T))}function C(B){return` Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-`+B}function M(B,T){const L=C(B);return T?[B,T,L]:[B,L]}},function(u,g,w){var k,m=function(){return k===void 0&&(k=!!(window&&document&&document.all&&!window.atob)),k},C=function(){var G={};return function(ne){if(G[ne]===void 0){var ie=document.querySelector(ne);if(window.HTMLIFrameElement&&ie instanceof window.HTMLIFrameElement)try{ie=ie.contentDocument.head}catch{ie=null}G[ne]=ie}return G[ne]}}(),M=[];function B(G){for(var ne=-1,ie=0;ie<M.length;ie++)if(M[ie].identifier===G){ne=ie;break}return ne}function T(G,ne){for(var ie={},me=[],pe=0;pe<G.length;pe++){var De=G[pe],Ie=ne.base?De[0]+ne.base:De[0],Me=ie[Ie]||0,Ue="".concat(Ie," ").concat(Me);ie[Ie]=Me+1;var te=B(Ue),ce={css:De[1],media:De[2],sourceMap:De[3]};te!==-1?(M[te].references++,M[te].updater(ce)):M.push({identifier:Ue,updater:le(ce,ne),references:1}),me.push(Ue)}return me}function L(G){var ne=document.createElement("style"),ie=G.attributes||{};if(ie.nonce===void 0){var me=w.nc;me&&(ie.nonce=me)}if(Object.keys(ie).forEach(function(De){ne.setAttribute(De,ie[De])}),typeof G.insert=="function")G.insert(ne);else{var pe=C(G.insert||"head");if(!pe)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");pe.appendChild(ne)}return ne}var U,j=(U=[],function(G,ne){return U[G]=ne,U.filter(Boolean).join(` `)});function $(G,ne,ie,me){var pe=ie?"":me.media?"@media ".concat(me.media," {").concat(me.css,"}"):me.css;if(G.styleSheet)G.styleSheet.cssText=j(ne,pe);else{var De=document.createTextNode(pe),Ie=G.childNodes;Ie[ne]&&G.removeChild(Ie[ne]),Ie.length?G.insertBefore(De,Ie[ne]):G.appendChild(De)}}function Z(G,ne,ie){var me=ie.css,pe=ie.media,De=ie.sourceMap;if(pe?G.setAttribute("media",pe):G.removeAttribute("media"),De&&typeof btoa<"u"&&(me+=` /*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(De))))," */")),G.styleSheet)G.styleSheet.cssText=me;else{for(;G.firstChild;)G.removeChild(G.firstChild);G.appendChild(document.createTextNode(me))}}var se=null,ue=0;function le(G,ne){var ie,me,pe;if(ne.singleton){var De=ue++;ie=se||(se=L(ne)),me=$.bind(null,ie,De,!1),pe=$.bind(null,ie,De,!0)}else ie=L(ne),me=Z.bind(null,ie,ne),pe=function(){(function(Ie){if(Ie.parentNode===null)return!1;Ie.parentNode.removeChild(Ie)})(ie)};return me(G),function(Ie){if(Ie){if(Ie.css===G.css&&Ie.media===G.media&&Ie.sourceMap===G.sourceMap)return;me(G=Ie)}else pe()}}u.exports=function(G,ne){(ne=ne||{}).singleton||typeof ne.singleton=="boolean"||(ne.singleton=m());var ie=T(G=G||[],ne);return function(me){if(me=me||[],Object.prototype.toString.call(me)==="[object Array]"){for(var pe=0;pe<ie.length;pe++){var De=B(ie[pe]);M[De].references--}for(var Ie=T(me,ne),Me=0;Me<ie.length;Me++){var Ue=B(ie[Me]);M[Ue].references===0&&(M[Ue].updater(),M.splice(Ue,1))}ie=Ie}}}},,function(u,g,w){var k=w(8),m=typeof self=="object"&&self&&self.Object===Object&&self,C=k.a||m||Function("return this")();g.a=C},function(u,g,w){(function(k){var m=w(3),C=w(14),M=_&&!_.nodeType&&_,B=M&&typeof k=="object"&&k&&!k.nodeType&&k,T=B&&B.exports===M?m.a.Buffer:void 0,L=(T?T.isBuffer:void 0)||C.a;g.a=L}).call(this,w(10)(u))},function(u,g,w){(function(k){var m=w(8),C=_&&!_.nodeType&&_,M=C&&typeof k=="object"&&k&&!k.nodeType&&k,B=M&&M.exports===C&&m.a.process,T=function(){try{var L=M&&M.require&&M.require("util").types;return L||B&&B.binding&&B.binding("util")}catch{}}();g.a=T}).call(this,w(10)(u))},function(u,g,w){(function(k){var m=w(0);const C=typeof window=="object"?window:k;if(C.CKEDITOR_VERSION)throw new m.a("ckeditor-duplicated-modules",null);C.CKEDITOR_VERSION="29.2.0"}).call(this,w(12))},function(u,g,w){var k=w(1),m=w(76);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g,w){(function(k){var m=typeof k=="object"&&k&&k.Object===Object&&k;g.a=m}).call(this,w(12))},function(u,g,w){(function(k){var m=w(3),C=_&&!_.nodeType&&_,M=C&&typeof k=="object"&&k&&!k.nodeType&&k,B=M&&M.exports===C?m.a.Buffer:void 0,T=B?B.allocUnsafe:void 0;g.a=function(L,U){if(U)return L.slice();var j=L.length,$=T?T(j):new L.constructor(j);return L.copy($),$}}).call(this,w(10)(u))},function(u,g){u.exports=function(w){if(!w.webpackPolyfill){var k=Object.create(w);k.children||(k.children=[]),Object.defineProperty(k,"loaded",{enumerable:!0,get:function(){return k.l}}),Object.defineProperty(k,"id",{enumerable:!0,get:function(){return k.i}}),Object.defineProperty(k,"exports",{enumerable:!0}),k.webpackPolyfill=1}return k}},function(u,g,w){var k=w(1),m=w(77);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){var w;w=function(){return this}();try{w=w||new Function("return this")()}catch{typeof window=="object"&&(w=window)}u.exports=w},function(u,g,w){var k=w(1),m=w(71);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g,w){g.a=function(){return!1}},function(u,g,w){var k=w(1),m=w(16);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(18);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(20);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(22);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(24);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(26);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(28);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(30);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(32);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(34);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(36);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(38);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(40);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(42);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(u,g,w){var k=w(1),m=w(44);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(46);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(48);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(50);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(52);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(54);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(56);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(58);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(60);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(62);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(64);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(66);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(68);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(70);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g){u.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(u,g,w){var k=w(1),m=w(73);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(75);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g){u.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(u,g){u.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(u,g,w){var k=w(1),m=w(79);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(81);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(83);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(85);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(87);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(89);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(91);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(93);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(95);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(97);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(99);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.exports=".ck-content .media{clear:both;margin:.9em 0;display:block;min-width:15em}"},function(u,g,w){var k=w(1),m=w(101);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(103);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(105);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){var k=w(1),m=w(107);typeof(m=m.__esModule?m.default:m)=="string"&&(m=[[u.i,m,""]]);var C={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};k(m,C),u.exports=m.locals||{}},function(u,g){u.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(u,g,w){w.r(g),w.d(g,"default",function(){return mv});var k=function(){return function o(){o.called=!0}};class m{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=k(),this.off=k()}}const C=new Array(256).fill().map((o,e)=>("0"+e.toString(16)).slice(-2));function M(){const o=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0;return"e"+C[o>>0&255]+C[o>>8&255]+C[o>>16&255]+C[o>>24&255]+C[e>>0&255]+C[e>>8&255]+C[e>>16&255]+C[e>>24&255]+C[t>>0&255]+C[t>>8&255]+C[t>>16&255]+C[t>>24&255]+C[n>>0&255]+C[n>>8&255]+C[n>>16&255]+C[n>>24&255]}var B={get(o){return typeof o!="number"?this[o]||this.normal:o},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5},T=(w(6),w(0));const L=Symbol("listeningTo"),U=Symbol("emitterId");var j={on(o,e,t={}){this.listenTo(this,o,e,t)},once(o,e,t){let n=!1;this.listenTo(this,o,function(i,...r){n||(n=!0,i.off(),e.call(this,i,...r))},t)},off(o,e){this.stopListening(this,o,e)},listenTo(o,e,t,n={}){let i,r;this[L]||(this[L]={});const a=this[L];Z(o)||$(o);const l=Z(o);(i=a[l])||(i=a[l]={emitter:o,callbacks:{}}),(r=i.callbacks[e])||(r=i.callbacks[e]=[]),r.push(t),function(d,h,p,b,x){h._addEventListener?h._addEventListener(p,b,x):d._addEventListener.call(h,p,b,x)}(this,o,e,t,n)},stopListening(o,e,t){const n=this[L];let i=o&&Z(o);const r=n&&i&&n[i],a=r&&e&&r.callbacks[e];if(!(!n||o&&!r||e&&!a))if(t)G(this,o,e,t),a.indexOf(t)!==-1&&(a.length===1?delete r.callbacks[e]:G(this,o,e,t));else if(a){for(;t=a.pop();)G(this,o,e,t);delete r.callbacks[e]}else if(r){for(e in r.callbacks)this.stopListening(o,e);delete n[i]}else{for(i in n)this.stopListening(n[i].emitter);delete this[L]}},fire(o,...e){try{const t=o instanceof m?o:new m(this,o),n=t.name;let i=function r(a,l){let d;return!a._events||!(d=a._events[l])||!d.callbacks.length?l.indexOf(":")>-1?r(a,l.substr(0,l.lastIndexOf(":"))):null:d.callbacks}(this,n);if(t.path.push(this),i){const r=[t,...e];i=Array.from(i);for(let a=0;a<i.length&&(i[a].callback.apply(this,r),t.off.called&&(delete t.off.called,this._removeEventListener(n,i[a].callback)),!t.stop.called);a++);}if(this._delegations){const r=this._delegations.get(n),a=this._delegations.get("*");r&&le(r,t,e),a&&le(a,t,e)}return t.return}catch(t){T.a.rethrowUnexpectedError(t,this)}},delegate(...o){return{to:(e,t)=>{this._delegations||(this._delegations=new Map),o.forEach(n=>{const i=this._delegations.get(n);i?i.set(e,t):this._delegations.set(n,new Map([[e,t]]))})}}},stopDelegating(o,e){if(this._delegations)if(o)if(e){const t=this._delegations.get(o);t&&t.delete(e)}else this._delegations.delete(o);else this._delegations.clear()},_addEventListener(o,e,t){(function(a,l){const d=se(a);if(d[l])return;let h=l,p=null;const b=[];for(;h!==""&&!d[h];)d[h]={callbacks:[],childEvents:[]},b.push(d[h]),p&&d[h].childEvents.push(p),p=h,h=h.substr(0,h.lastIndexOf(":"));if(h!==""){for(const x of b)x.callbacks=d[h].callbacks.slice();d[h].childEvents.push(p)}})(this,o);const n=ue(this,o),i=B.get(t.priority),r={callback:e,priority:i};for(const a of n){let l=!1;for(let d=0;d<a.length;d++)if(a[d].priority<i){a.splice(d,0,r),l=!0;break}l||a.push(r)}},_removeEventListener(o,e){const t=ue(this,o);for(const n of t)for(let i=0;i<n.length;i++)n[i].callback==e&&(n.splice(i,1),i--)}};function $(o,e){o[U]||(o[U]=e||M())}function Z(o){return o[U]}function se(o){return o._events||Object.defineProperty(o,"_events",{value:{}}),o._events}function ue(o,e){const t=se(o)[e];if(!t)return[];let n=[t.callbacks];for(let i=0;i<t.childEvents.length;i++){const r=ue(o,t.childEvents[i]);n=n.concat(r)}return n}function le(o,e,t){for(let[n,i]of o){i?typeof i=="function"&&(i=i(e.name)):i=e.name;const r=new m(e.source,i);r.path=[...e.path],n.fire(r,...t)}}function G(o,e,t,n){e._removeEventListener?e._removeEventListener(t,n):o._removeEventListener.call(e,t,n)}var ne=function(o){var e=typeof o;return o!=null&&(e=="object"||e=="function")},ie=w(3),me=ie.a.Symbol,pe=Object.prototype,De=pe.hasOwnProperty,Ie=pe.toString,Me=me?me.toStringTag:void 0,Ue=function(o){var e=De.call(o,Me),t=o[Me];try{o[Me]=void 0;var n=!0}catch{}var i=Ie.call(o);return n&&(e?o[Me]=t:delete o[Me]),i},te=Object.prototype.toString,ce=function(o){return te.call(o)},be=me?me.toStringTag:void 0,ke=function(o){return o==null?o===void 0?"[object Undefined]":"[object Null]":be&&be in Object(o)?Ue(o):ce(o)},Ne,xe=function(o){if(!ne(o))return!1;var e=ke(o);return e=="[object Function]"||e=="[object GeneratorFunction]"||e=="[object AsyncFunction]"||e=="[object Proxy]"},Le=ie.a["__core-js_shared__"],Fe=(Ne=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||""))?"Symbol(src)_1."+Ne:"",Ye=function(o){return!!Fe&&Fe in o},Ve=Function.prototype.toString,yt=function(o){if(o!=null){try{return Ve.call(o)}catch{}try{return o+""}catch{}}return""},Se=/^\[object .+?Constructor\]$/,We=Function.prototype,Oe=Object.prototype,He=We.toString,ht=Oe.hasOwnProperty,ot=RegExp("^"+He.call(ht).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tt=function(o){return!(!ne(o)||Ye(o))&&(xe(o)?ot:Se).test(yt(o))},$e=function(o,e){return o==null?void 0:o[e]},Je=function(o,e){var t=$e(o,e);return tt(t)?t:void 0},qt=function(){try{var o=Je(Object,"defineProperty");return o({},"",{}),o}catch{}}(),Qt=function(o,e,t){e=="__proto__"&&qt?qt(o,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):o[e]=t},we=function(o,e){return o===e||o!=o&&e!=e},Ae=Object.prototype.hasOwnProperty,lt=function(o,e,t){var n=o[e];Ae.call(o,e)&&we(n,t)&&(t!==void 0||e in o)||Qt(o,e,t)},rt=function(o,e,t,n){var i=!t;t||(t={});for(var r=-1,a=e.length;++r<a;){var l=e[r],d=n?n(t[l],o[l],l,t,o):void 0;d===void 0&&(d=o[l]),i?Qt(t,l,d):lt(t,l,d)}return t},Nt=function(o){return o},wn=function(o,e,t){switch(t.length){case 0:return o.call(e);case 1:return o.call(e,t[0]);case 2:return o.call(e,t[0],t[1]);case 3:return o.call(e,t[0],t[1],t[2])}return o.apply(e,t)},rn=Math.max,Mt=function(o,e,t){return e=rn(e===void 0?o.length-1:e,0),function(){for(var n=arguments,i=-1,r=rn(n.length-e,0),a=Array(r);++i<r;)a[i]=n[e+i];i=-1;for(var l=Array(e+1);++i<e;)l[i]=n[i];return l[e]=t(a),wn(o,this,l)}},Fi=function(o){return function(){return o}},Zo=qt?function(o,e){return qt(o,"toString",{configurable:!0,enumerable:!1,value:Fi(e),writable:!0})}:Nt,fn=Date.now,no=function(o){var e=0,t=0;return function(){var n=fn(),i=16-(n-t);if(t=n,i>0){if(++e>=800)return arguments[0]}else e=0;return o.apply(void 0,arguments)}}(Zo),Ks=function(o,e){return no(Mt(o,e,Nt),o+"")},io=function(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=9007199254740991},ui=function(o){return o!=null&&io(o.length)&&!xe(o)},xr=/^(?:0|[1-9]\d*)$/,Po=function(o,e){var t=typeof o;return!!(e=e??9007199254740991)&&(t=="number"||t!="symbol"&&xr.test(o))&&o>-1&&o%1==0&&o<e},Cr=function(o,e,t){if(!ne(t))return!1;var n=typeof e;return!!(n=="number"?ui(t)&&Po(e,t.length):n=="string"&&e in t)&&we(t[e],o)},Io=function(o){return Ks(function(e,t){var n=-1,i=t.length,r=i>1?t[i-1]:void 0,a=i>2?t[2]:void 0;for(r=o.length>3&&typeof r=="function"?(i--,r):void 0,a&&Cr(t[0],t[1],a)&&(r=i<3?void 0:r,i=1),e=Object(e);++n<i;){var l=t[n];l&&o(e,l,n,r)}return e})},di=function(o,e){for(var t=-1,n=Array(o);++t<o;)n[t]=e(t);return n},ft=function(o){return o!=null&&typeof o=="object"},Yt=function(o){return ft(o)&&ke(o)=="[object Arguments]"},un=Object.prototype,pn=un.hasOwnProperty,Cn=un.propertyIsEnumerable,Sn=Yt(function(){return arguments}())?Yt:function(o){return ft(o)&&pn.call(o,"callee")&&!Cn.call(o,"callee")},sn=Array.isArray,Ei=w(4),xt={};xt["[object Float32Array]"]=xt["[object Float64Array]"]=xt["[object Int8Array]"]=xt["[object Int16Array]"]=xt["[object Int32Array]"]=xt["[object Uint8Array]"]=xt["[object Uint8ClampedArray]"]=xt["[object Uint16Array]"]=xt["[object Uint32Array]"]=!0,xt["[object Arguments]"]=xt["[object Array]"]=xt["[object ArrayBuffer]"]=xt["[object Boolean]"]=xt["[object DataView]"]=xt["[object Date]"]=xt["[object Error]"]=xt["[object Function]"]=xt["[object Map]"]=xt["[object Number]"]=xt["[object Object]"]=xt["[object RegExp]"]=xt["[object Set]"]=xt["[object String]"]=xt["[object WeakMap]"]=!1;var oo=function(o){return ft(o)&&io(o.length)&&!!xt[ke(o)]},rs=function(o){return function(e){return o(e)}},Xo=w(5),kl=Xo.a&&Xo.a.isTypedArray,Mo=kl?rs(kl):oo,pu=Object.prototype.hasOwnProperty,yl=function(o,e){var t=sn(o),n=!t&&Sn(o),i=!t&&!n&&Object(Ei.a)(o),r=!t&&!n&&!i&&Mo(o),a=t||n||i||r,l=a?di(o.length,String):[],d=l.length;for(var h in o)!e&&!pu.call(o,h)||a&&(h=="length"||i&&(h=="offset"||h=="parent")||r&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Po(h,d))||l.push(h);return l},gu=Object.prototype,Tr=function(o){var e=o&&o.constructor;return o===(typeof e=="function"&&e.prototype||gu)},er=function(o){var e=[];if(o!=null)for(var t in Object(o))e.push(t);return e},qs=Object.prototype.hasOwnProperty,mu=function(o){if(!ne(o))return er(o);var e=Tr(o),t=[];for(var n in o)(n!="constructor"||!e&&qs.call(o,n))&&t.push(n);return t},hi=function(o){return ui(o)?yl(o,!0):mu(o)},Er=Io(function(o,e){rt(e,hi(e),o)});const ss=Symbol("observableProperties"),Sr=Symbol("boundObservables"),Ar=Symbol("boundProperties"),tr=Symbol("decoratedMethods"),Gs=Symbol("decoratedOriginal"),Do={set(o,e){if(ne(o))return void Object.keys(o).forEach(n=>{this.set(n,o[n])},this);Qs(this);const t=this[ss];if(o in this&&!t.has(o))throw new T.a("observable-set-cannot-override",this);Object.defineProperty(this,o,{enumerable:!0,configurable:!0,get:()=>t.get(o),set(n){const i=t.get(o);let r=this.fire("set:"+o,o,n,i);r===void 0&&(r=n),i===r&&t.has(o)||(t.set(o,r),this.fire("change:"+o,o,r,i))}}),this[o]=e},bind(...o){if(!o.length||!Cl(o))throw new T.a("observable-bind-wrong-properties",this);if(new Set(o).size!==o.length)throw new T.a("observable-bind-duplicate-properties",this);Qs(this);const e=this[Ar];o.forEach(n=>{if(e.has(n))throw new T.a("observable-bind-rebind",this)});const t=new Map;return o.forEach(n=>{const i={property:n,to:[]};e.set(n,i),t.set(n,i)}),{to:xl,toMany:bu,_observable:this,_bindProperties:o,_to:[],_bindings:t}},unbind(...o){if(!this[ss])return;const e=this[Ar],t=this[Sr];if(o.length){if(!Cl(o))throw new T.a("observable-unbind-wrong-properties",this);o.forEach(n=>{const i=e.get(n);if(!i)return;let r,a,l,d;i.to.forEach(h=>{r=h[0],a=h[1],l=t.get(r),d=l[a],d.delete(i),d.size||delete l[a],Object.keys(l).length||(t.delete(r),this.stopListening(r,"change"))}),e.delete(n)})}else t.forEach((n,i)=>{this.stopListening(i,"change")}),t.clear(),e.clear()},decorate(o){const e=this[o];if(!e)throw new T.a("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:o});this.on(o,(t,n)=>{t.return=e.apply(this,n)}),this[o]=function(...t){return this.fire(o,t)},this[o][Gs]=e,this[tr]||(this[tr]=[]),this[tr].push(o)}};Er(Do,j),Do.stopListening=function(o,e,t){if(!o&&this[tr]){for(const n of this[tr])this[n]=this[n][Gs];delete this[tr]}j.stopListening.call(this,o,e,t)};var $t=Do;function Qs(o){o[ss]||(Object.defineProperty(o,ss,{value:new Map}),Object.defineProperty(o,Sr,{value:new Map}),Object.defineProperty(o,Ar,{value:new Map}))}function xl(...o){const e=function(...r){if(!r.length)throw new T.a("observable-bind-to-parse-error",null);const a={to:[]};let l;return typeof r[r.length-1]=="function"&&(a.callback=r.pop()),r.forEach(d=>{if(typeof d=="string")l.properties.push(d);else{if(typeof d!="object")throw new T.a("observable-bind-to-parse-error",null);l={observable:d,properties:[]},a.to.push(l)}}),a}(...o),t=Array.from(this._bindings.keys()),n=t.length;if(!e.callback&&e.to.length>1)throw new T.a("observable-bind-to-no-callback",this);if(n>1&&e.callback)throw new T.a("observable-bind-to-extra-callback",this);var i;e.to.forEach(r=>{if(r.properties.length&&r.properties.length!==n)throw new T.a("observable-bind-to-properties-length",this);r.properties.length||(r.properties=this._bindProperties)}),this._to=e.to,e.callback&&(this._bindings.get(t[0]).callback=e.callback),i=this._observable,this._to.forEach(r=>{const a=i[Sr];let l;a.get(r.observable)||i.listenTo(r.observable,"change",(d,h)=>{l=a.get(r.observable)[h],l&&l.forEach(p=>{Tl(i,p.property)})})}),function(r){let a;r._bindings.forEach((l,d)=>{r._to.forEach(h=>{a=h.properties[l.callback?0:r._bindProperties.indexOf(d)],l.to.push([h.observable,a]),function(p,b,x,E){const P=p[Sr],D=P.get(x),R=D||{};R[E]||(R[E]=new Set),R[E].add(b),D||P.set(x,R)}(r._observable,l,h.observable,a)})})}(this),this._bindProperties.forEach(r=>{Tl(this._observable,r)})}function bu(o,e,t){if(this._bindings.size>1)throw new T.a("observable-bind-to-many-not-one-binding",this);this.to(...function(n,i){const r=n.map(a=>[a,i]);return Array.prototype.concat.apply([],r)}(o,e),t)}function Cl(o){return o.every(e=>typeof e=="string")}function Tl(o,e){const t=o[Ar].get(e);let n;t.callback?n=t.callback.apply(o,t.to.map(i=>i[0][i[1]])):(n=t.to[0],n=n[0][n[1]]),Object.prototype.hasOwnProperty.call(o,e)?o[e]=n:o.set(e,n)}function ze(o,...e){e.forEach(t=>{Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)).forEach(n=>{if(n in o.prototype)return;const i=Object.getOwnPropertyDescriptor(t,n);i.enumerable=!1,Object.defineProperty(o.prototype,n,i)})})}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",nr,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",nr),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function nr(o){o.return=!1,o.stop()}ze(ve,$t);class pt{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",t=>{this.isEnabled||t.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(t,n,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",Ys,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",Ys),this.refresh())}execute(){}destroy(){this.stopListening()}}function Ys(o){o.return=!1,o.stop()}ze(pt,$t);class Js extends pt{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 Zs=function(o,e){return function(t){return o(e(t))}},as=Zs(Object.getPrototypeOf,Object),Xs=Function.prototype,Ut=Object.prototype,El=Xs.toString,ea=Ut.hasOwnProperty,Sl=El.call(Object),_n=function(o){if(!ft(o)||ke(o)!="[object Object]")return!1;var e=as(o);if(e===null)return!0;var t=ea.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&El.call(t)==Sl},ls=function(){this.__data__=[],this.size=0},Si=function(o,e){for(var t=o.length;t--;)if(we(o[t][0],e))return t;return-1},cs=Array.prototype.splice,vu=function(o){var e=this.__data__,t=Si(e,o);return!(t<0)&&(t==e.length-1?e.pop():cs.call(e,t,1),--this.size,!0)},Al=function(o){var e=this.__data__,t=Si(e,o);return t<0?void 0:e[t][1]},Nr=function(o){return Si(this.__data__,o)>-1},Nl=function(o,e){var t=this.__data__,n=Si(t,o);return n<0?(++this.size,t.push([o,e])):t[n][1]=e,this};function ro(o){var e=-1,t=o==null?0:o.length;for(this.clear();++e<t;){var n=o[e];this.set(n[0],n[1])}}ro.prototype.clear=ls,ro.prototype.delete=vu,ro.prototype.get=Al,ro.prototype.has=Nr,ro.prototype.set=Nl;var ir=ro,Pl=function(){this.__data__=new ir,this.size=0},ta=function(o){var e=this.__data__,t=e.delete(o);return this.size=e.size,t},wu=function(o){return this.__data__.get(o)},na=function(o){return this.__data__.has(o)},Bi=Je(ie.a,"Map"),Oo=Je(Object,"create"),or=function(){this.__data__=Oo?Oo(null):{},this.size=0},Il=function(o){var e=this.has(o)&&delete this.__data__[o];return this.size-=e?1:0,e},Ml=Object.prototype.hasOwnProperty,ia=function(o){var e=this.__data__;if(Oo){var t=e[o];return t==="__lodash_hash_undefined__"?void 0:t}return Ml.call(e,o)?e[o]:void 0},Dl=Object.prototype.hasOwnProperty,oa=function(o){var e=this.__data__;return Oo?e[o]!==void 0:Dl.call(e,o)},ra=function(o,e){var t=this.__data__;return this.size+=this.has(o)?0:1,t[o]=Oo&&e===void 0?"__lodash_hash_undefined__":e,this};function so(o){var e=-1,t=o==null?0:o.length;for(this.clear();++e<t;){var n=o[e];this.set(n[0],n[1])}}so.prototype.clear=or,so.prototype.delete=Il,so.prototype.get=ia,so.prototype.has=oa,so.prototype.set=ra;var sa=so,_u=function(){this.size=0,this.__data__={hash:new sa,map:new(Bi||ir),string:new sa}},ku=function(o){var e=typeof o;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?o!=="__proto__":o===null},Pr=function(o,e){var t=o.__data__;return ku(e)?t[typeof e=="string"?"string":"hash"]:t.map},Ol=function(o){var e=Pr(this,o).delete(o);return this.size-=e?1:0,e},yu=function(o){return Pr(this,o).get(o)},jl=function(o){return Pr(this,o).has(o)},aa=function(o,e){var t=Pr(this,o),n=t.size;return t.set(o,e),this.size+=t.size==n?0:1,this};function ao(o){var e=-1,t=o==null?0:o.length;for(this.clear();++e<t;){var n=o[e];this.set(n[0],n[1])}}ao.prototype.clear=_u,ao.prototype.delete=Ol,ao.prototype.get=yu,ao.prototype.has=jl,ao.prototype.set=aa;var Ir=ao,la=function(o,e){var t=this.__data__;if(t instanceof ir){var n=t.__data__;if(!Bi||n.length<199)return n.push([o,e]),this.size=++t.size,this;t=this.__data__=new Ir(n)}return t.set(o,e),this.size=t.size,this};function jo(o){var e=this.__data__=new ir(o);this.size=e.size}jo.prototype.clear=Pl,jo.prototype.delete=ta,jo.prototype.get=wu,jo.prototype.has=na,jo.prototype.set=la;var Mr=jo,Rl=function(o,e){for(var t=-1,n=o==null?0:o.length;++t<n&&e(o[t],t,o)!==!1;);return o},Wt=Zs(Object.keys,Object),zt=Object.prototype.hasOwnProperty,ca=function(o){if(!Tr(o))return Wt(o);var e=[];for(var t in Object(o))zt.call(o,t)&&t!="constructor"&&e.push(t);return e},Dr=function(o){return ui(o)?yl(o):ca(o)},ua=function(o,e){return o&&rt(e,Dr(e),o)},da=function(o,e){return o&&rt(e,hi(e),o)},ha=w(9),fa=function(o,e){var t=-1,n=o.length;for(e||(e=Array(n));++t<n;)e[t]=o[t];return e},pa=function(o,e){for(var t=-1,n=o==null?0:o.length,i=0,r=[];++t<n;){var a=o[t];e(a,t,o)&&(r[i++]=a)}return r},ga=function(){return[]},gn=Object.prototype.propertyIsEnumerable,us=Object.getOwnPropertySymbols,Hi=us?function(o){return o==null?[]:(o=Object(o),pa(us(o),function(e){return gn.call(o,e)}))}:ga,Ll=function(o,e){return rt(o,Hi(o),e)},ds=function(o,e){for(var t=-1,n=e.length,i=o.length;++t<n;)o[i+t]=e[t];return o},Un=Object.getOwnPropertySymbols?function(o){for(var e=[];o;)ds(e,Hi(o)),o=as(o);return e}:ga,lo=function(o,e){return rt(o,Un(o),e)},Or=function(o,e,t){var n=e(o);return sn(o)?n:ds(n,t(o))},hs=function(o){return Or(o,Dr,Hi)},Vl=function(o){return Or(o,hi,Un)},jr=Je(ie.a,"DataView"),rr=Je(ie.a,"Promise"),An=Je(ie.a,"Set"),ma=Je(ie.a,"WeakMap"),Zn=yt(jr),zl=yt(Bi),ba=yt(rr),co=yt(An),fs=yt(ma),$i=ke;(jr&&$i(new jr(new ArrayBuffer(1)))!="[object DataView]"||Bi&&$i(new Bi)!="[object Map]"||rr&&$i(rr.resolve())!="[object Promise]"||An&&$i(new An)!="[object Set]"||ma&&$i(new ma)!="[object WeakMap]")&&($i=function(o){var e=ke(o),t=e=="[object Object]"?o.constructor:void 0,n=t?yt(t):"";if(n)switch(n){case Zn:return"[object DataView]";case zl:return"[object Map]";case ba:return"[object Promise]";case co:return"[object Set]";case fs:return"[object WeakMap]"}return e});var Pt=$i,uo=Object.prototype.hasOwnProperty,va=function(o){var e=o.length,t=new o.constructor(e);return e&&typeof o[0]=="string"&&uo.call(o,"index")&&(t.index=o.index,t.input=o.input),t},ps=ie.a.Uint8Array,sr=function(o){var e=new o.constructor(o.byteLength);return new ps(e).set(new ps(o)),e},xu=function(o,e){var t=e?sr(o.buffer):o.buffer;return new o.constructor(t,o.byteOffset,o.byteLength)},Cu=/\w*$/,Fl=function(o){var e=new o.constructor(o.source,Cu.exec(o));return e.lastIndex=o.lastIndex,e},wa=me?me.prototype:void 0,ar=wa?wa.valueOf:void 0,Ro=function(o){return ar?Object(ar.call(o)):{}},Bl=function(o,e){var t=e?sr(o.buffer):o.buffer;return new o.constructor(t,o.byteOffset,o.length)},jt=function(o,e,t){var n=o.constructor;switch(e){case"[object ArrayBuffer]":return sr(o);case"[object Boolean]":case"[object Date]":return new n(+o);case"[object DataView]":return xu(o,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 Bl(o,t);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(o);case"[object RegExp]":return Fl(o);case"[object Set]":return new n;case"[object Symbol]":return Ro(o)}},_a=Object.create,ka=function(){function o(){}return function(e){if(!ne(e))return{};if(_a)return _a(e);o.prototype=e;var t=new o;return o.prototype=void 0,t}}(),gs=function(o){return typeof o.constructor!="function"||Tr(o)?{}:ka(as(o))},Hl=function(o){return ft(o)&&Pt(o)=="[object Map]"},ya=Xo.a&&Xo.a.isMap,xa=ya?rs(ya):Hl,Ca=function(o){return ft(o)&&Pt(o)=="[object Set]"},$l=Xo.a&&Xo.a.isSet,Ul=$l?rs($l):Ca,st={};st["[object Arguments]"]=st["[object Array]"]=st["[object ArrayBuffer]"]=st["[object DataView]"]=st["[object Boolean]"]=st["[object Date]"]=st["[object Float32Array]"]=st["[object Float64Array]"]=st["[object Int8Array]"]=st["[object Int16Array]"]=st["[object Int32Array]"]=st["[object Map]"]=st["[object Number]"]=st["[object Object]"]=st["[object RegExp]"]=st["[object Set]"]=st["[object String]"]=st["[object Symbol]"]=st["[object Uint8Array]"]=st["[object Uint8ClampedArray]"]=st["[object Uint16Array]"]=st["[object Uint32Array]"]=!0,st["[object Error]"]=st["[object Function]"]=st["[object WeakMap]"]=!1;var Rr=function o(e,t,n,i,r,a){var l,d=1&t,h=2&t,p=4&t;if(n&&(l=r?n(e,i,r,a):n(e)),l!==void 0)return l;if(!ne(e))return e;var b=sn(e);if(b){if(l=va(e),!d)return fa(e,l)}else{var x=Pt(e),E=x=="[object Function]"||x=="[object GeneratorFunction]";if(Object(Ei.a)(e))return Object(ha.a)(e,d);if(x=="[object Object]"||x=="[object Arguments]"||E&&!r){if(l=h||E?{}:gs(e),!d)return h?lo(e,da(l,e)):Ll(e,ua(l,e))}else{if(!st[x])return r?e:{};l=jt(e,x,d)}}a||(a=new Mr);var P=a.get(e);if(P)return P;a.set(e,l),Ul(e)?e.forEach(function(R){l.add(o(R,t,n,R,e,a))}):xa(e)&&e.forEach(function(R,H){l.set(H,o(R,t,n,H,e,a))});var D=b?void 0:(p?h?Vl:hs:h?hi:Dr)(e);return Rl(D||e,function(R,H){D&&(R=e[H=R]),lt(l,H,o(R,t,n,H,e,a))}),l},Lo=function(o,e){return Rr(o,5,e=typeof e=="function"?e:void 0)},Ai=function(o){return ft(o)&&o.nodeType===1&&!_n(o)};class ms{constructor(e,t){this._config={},t&&this.define(kn(t)),e&&this._setObjectToTarget(this._config,e)}set(e,t){this._setToTarget(this._config,e,t)}define(e,t){this._setToTarget(this._config,e,t,!0)}get(e){return this._getFromSource(this._config,e)}*names(){for(const e of Object.keys(this._config))yield e}_setToTarget(e,t,n,i=!1){if(_n(t))return void this._setObjectToTarget(e,t,i);const r=t.split(".");t=r.pop();for(const a of r)_n(e[a])||(e[a]={}),e=e[a];if(_n(n))return _n(e[t])||(e[t]={}),e=e[t],void this._setObjectToTarget(e,n,i);i&&e[t]!==void 0||(e[t]=n)}_getFromSource(e,t){const n=t.split(".");t=n.pop();for(const i of n){if(!_n(e[i])){e=null;break}e=e[i]}return e?kn(e[t]):void 0}_setObjectToTarget(e,t,n){Object.keys(t).forEach(i=>{this._setToTarget(e,i,t[i],n)})}}function kn(o){return Lo(o,Lr)}function Lr(o){return Ai(o)?o:void 0}function Wn(o){return!(!o||!o[Symbol.iterator])}class Xn{constructor(e={},t={}){const n=Wn(e);if(n||(t=e),this._items=[],this._itemMap=new Map,this._idProperty=t.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],n)for(const i of e)this._items.push(i),this._itemMap.set(this._getItemIdBeforeAdding(i),i)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,t){return this.addMany([e],t)}addMany(e,t){if(t===void 0)t=this._items.length;else if(t>this._items.length||t<0)throw new T.a("collection-add-item-invalid-index",this);for(let n=0;n<e.length;n++){const i=e[n],r=this._getItemIdBeforeAdding(i),a=t+n;this._items.splice(a,0,i),this._itemMap.set(r,i),this.fire("add",i,a)}return this.fire("change",{added:e,removed:[],index:t}),this}get(e){let t;if(typeof e=="string")t=this._itemMap.get(e);else{if(typeof e!="number")throw new T.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 T.a("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:t=>{this._setUpBindToBinding(n=>new t(n))},using:t=>{typeof t=="function"?this._setUpBindToBinding(n=>t(n)):this._setUpBindToBinding(n=>n[t])}}}_setUpBindToBinding(e){const t=this._bindToCollection,n=(i,r,a)=>{const l=t._bindToCollection==this,d=t._bindToInternalToExternalMap.get(r);if(l&&d)this._bindToExternalToInternalMap.set(r,d),this._bindToInternalToExternalMap.set(d,r);else{const h=e(r);if(!h)return void this._skippedIndexesFromExternal.push(a);let p=a;for(const b of this._skippedIndexesFromExternal)a>b&&p--;for(const b of t._skippedIndexesFromExternal)p>=b&&p++;this._bindToExternalToInternalMap.set(r,h),this._bindToInternalToExternalMap.set(h,r),this.add(h,p);for(let b=0;b<t._skippedIndexesFromExternal.length;b++)p<=t._skippedIndexesFromExternal[b]&&t._skippedIndexesFromExternal[b]++}};for(const i of t)n(0,i,t.getIndex(i));this.listenTo(t,"add",n),this.listenTo(t,"remove",(i,r,a)=>{const l=this._bindToExternalToInternalMap.get(r);l&&this.remove(l),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((d,h)=>(a<h&&d.push(h-1),a>h&&d.push(h),d),[])})}_getItemIdBeforeAdding(e){const t=this._idProperty;let n;if(t in e){if(n=e[t],typeof n!="string")throw new T.a("collection-add-invalid-id",this);if(this.get(n))throw new T.a("collection-add-item-already-exists",this)}else e[t]=n=M();return n}_remove(e){let t,n,i,r=!1;const a=this._idProperty;if(typeof e=="string"?(n=e,i=this._itemMap.get(n),r=!i,i&&(t=this._items.indexOf(i))):typeof e=="number"?(t=e,i=this._items[t],r=!i,i&&(n=i[a])):(i=e,n=i[a],t=this._items.indexOf(i),r=t==-1||!this._itemMap.get(n)),r)throw new T.a("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(n);const l=this._bindToInternalToExternalMap.get(i);return this._bindToInternalToExternalMap.delete(i),this._bindToExternalToInternalMap.delete(l),this.fire("remove",i,t),[i,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}ze(Xn,j);class bs{constructor(e,t=[],n=[]){this._context=e,this._plugins=new Map,this._availablePlugins=new Map;for(const i of t)i.pluginName&&this._availablePlugins.set(i.pluginName,i);this._contextPlugins=new Map;for(const[i,r]of n)this._contextPlugins.set(i,r),this._contextPlugins.set(r,i),i.pluginName&&this._availablePlugins.set(i.pluginName,i)}*[Symbol.iterator](){for(const e of this._plugins)typeof e[0]=="function"&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let n=e;throw typeof e=="function"&&(n=e.pluginName||e.name),new T.a("plugincollection-plugin-not-loaded",this._context,{plugin:n})}return t}has(e){return this._plugins.has(e)}init(e,t=[],n=[]){const i=this,r=this._context;(function P(D,R=new Set){D.forEach(H=>{d(H)&&(R.has(H)||(R.add(H),H.pluginName&&!i._availablePlugins.has(H.pluginName)&&i._availablePlugins.set(H.pluginName,H),H.requires&&P(H.requires,R)))})})(e),x(e);const a=[...function P(D,R=new Set){return D.map(H=>d(H)?H:i._availablePlugins.get(H)).reduce((H,Q)=>R.has(Q)?H:(R.add(Q),Q.requires&&(x(Q.requires,Q),P(Q.requires,R).forEach(ae=>H.add(ae))),H.add(Q)),new Set)}(e.filter(P=>!p(P,t)))];(function(P,D){for(const R of D){if(typeof R!="function")throw new T.a("plugincollection-replace-plugin-invalid-type",null,{pluginItem:R});const H=R.pluginName;if(!H)throw new T.a("plugincollection-replace-plugin-missing-name",null,{pluginItem:R});if(R.requires&&R.requires.length)throw new T.a("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:H});const Q=i._availablePlugins.get(H);if(!Q)throw new T.a("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:H});const ae=P.indexOf(Q);if(ae===-1){if(i._contextPlugins.has(Q))return;throw new T.a("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:H})}if(Q.requires&&Q.requires.length)throw new T.a("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:H});P.splice(ae,1,R),i._availablePlugins.set(H,R)}})(a,n);const l=function(P){return P.map(D=>{const R=i._contextPlugins.get(D)||new D(r);return i._add(D,R),R})}(a);return E(l,"init").then(()=>E(l,"afterInit")).then(()=>l);function d(P){return typeof P=="function"}function h(P){return d(P)&&P.isContextPlugin}function p(P,D){return D.some(R=>R===P||b(P)===R||b(R)===P)}function b(P){return d(P)?P.pluginName||P.name:P}function x(P,D=null){P.map(R=>d(R)?R:i._availablePlugins.get(R)||R).forEach(R=>{(function(H,Q){if(!d(H))throw Q?new T.a("plugincollection-soft-required",r,{missingPlugin:H,requiredBy:b(Q)}):new T.a("plugincollection-plugin-not-found",r,{plugin:H})})(R,D),function(H,Q){if(h(Q)&&!h(H))throw new T.a("plugincollection-context-required",r,{plugin:b(H),requiredBy:b(Q)})}(R,D),function(H,Q){if(Q&&p(H,t))throw new T.a("plugincollection-required",r,{plugin:b(H),requiredBy:b(Q)})}(R,D)})}function E(P,D){return P.reduce((R,H)=>H[D]?i._contextPlugins.has(H)?R:R.then(H[D].bind(H)):R,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 T.a("plugincollection-plugin-name-conflict",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:e});this._plugins.set(n,t)}}}function Tt(o){return Array.isArray(o)?o:[o]}function Ta(o,e,t=1){if(typeof t!="number")throw new T.a("translation-service-quantity-not-a-number",null,{quantity:t});const n=Object.keys(window.CKEDITOR_TRANSLATIONS).length;n===1&&(o=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]);const i=e.id||e.string;if(n===0||!function(d,h){return!!window.CKEDITOR_TRANSLATIONS[d]&&!!window.CKEDITOR_TRANSLATIONS[d].dictionary[h]}(o,i))return t!==1?e.plural:e.string;const r=window.CKEDITOR_TRANSLATIONS[o].dictionary,a=window.CKEDITOR_TRANSLATIONS[o].getPluralForm||(d=>d===1?0:1);if(typeof r[i]=="string")return r[i];const l=Number(a(t));return r[i][l]}ze(bs,j),window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});const Ea=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];function Ni(o){return Ea.includes(o)?"rtl":"ltr"}class Wl{constructor(e={}){this.uiLanguage=e.uiLanguage||"en",this.contentLanguage=e.contentLanguage||this.uiLanguage,this.uiLanguageDirection=Ni(this.uiLanguage),this.contentLanguageDirection=Ni(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=Tt(t),typeof e=="string"&&(e={string:e});const n=e.plural?t[0]:1;return function(i,r){return i.replace(/%(\d+)/g,(a,l)=>l<r.length?r[l]:a)}(Ta(this.uiLanguage,e,n),t)}}class A{constructor(e){this.config=new ms(e,this.constructor.defaultConfig);const t=this.constructor.builtinPlugins;this.config.define("plugins",t),this.plugins=new bs(this,t);const n=this.config.get("language")||{};this.locale=new Wl({uiLanguage:typeof n=="string"?n:n.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.editors=new Xn,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 T.a("context-initplugins-constructor-only",null,{Plugin:n});if(n.isContextPlugin!==!0)throw new T.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 T.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 N{constructor(e){this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}function z(o,e){const t=Math.min(o.length,e.length);for(let n=0;n<t;n++)if(o[n]!=e[n])return n;return o.length==e.length?"same":o.length<e.length?"prefix":"extension"}ze(N,$t);var X=function(o){return Rr(o,4)};class Pe{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 T.a("view-node-not-found-in-parent",this);return e}get nextSibling(){const e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.index),t=t.parent;return e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),i=e.getAncestors(t);let r=0;for(;n[r]==i[r]&&n[r];)r++;return r===0?null:n[r-1]}isBefore(e){if(this==e||this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),i=z(t,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return t[i]<n[i]}}isAfter(e){return this!=e&&this.root===e.root&&!this.isBefore(e)}_remove(){this.parent._removeChildren(this.index)}_fireChange(e,t){this.fire("change:"+e,t),this.parent&&this.parent._fireChange(e,t)}toJSON(){const e=X(this);return delete e.parent,e}is(e){return e==="node"||e==="view:node"}}ze(Pe,j);class Ce extends Pe{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 Ce&&(this===e||this.data===e.data)}_clone(){return new Ce(this.document,this.data)}}class je{constructor(e,t,n){if(this.textNode=e,t<0||t>e.data.length)throw new T.a("view-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.data.length)throw new T.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 Ke(o){return Wn(o)?new Map(o):function(e){const t=new Map;for(const n in e)t.set(n,e[n]);return t}(o)}class Et{constructor(...e){this._patterns=[],this.add(...e)}add(...e){for(let t of e)(typeof t=="string"||t instanceof RegExp)&&(t={name:t}),this._patterns.push(t)}match(...e){for(const t of e)for(const n of this._patterns){const i=Jt(t,n);if(i)return{element:t,pattern:n,match:i}}return null}matchAll(...e){const t=[];for(const n of e)for(const i of this._patterns){const r=Jt(n,i);r&&t.push({element:n,pattern:i,match:r})}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 Jt(o,e){if(typeof e=="function")return e(o);const t={};return e.name&&(t.name=function(n,i){return n instanceof RegExp?n.test(i):n===i}(e.name,o.name),!t.name)||e.attributes&&(t.attributes=function(n,i){const r=new Set(i.getAttributeKeys());return _n(n)?(n.style!==void 0&&Object(T.b)("matcher-pattern-deprecated-attributes-style-key",n),n.class!==void 0&&Object(T.b)("matcher-pattern-deprecated-attributes-class-key",n)):(r.delete("style"),r.delete("class")),lr(n,r,a=>i.getAttribute(a))}(e.attributes,o),!t.attributes)?null:!(e.classes&&(t.classes=function(n,i){return lr(n,i.getClassNames())}(e.classes,o),!t.classes))&&!(e.styles&&(t.styles=function(n,i){return lr(n,i.getStyleNames(!0),r=>i.getStyle(r))}(e.styles,o),!t.styles))&&t}function lr(o,e,t){const n=function(a){return Array.isArray(a)?a.map(l=>_n(l)?(l.key!==void 0&&l.value!==void 0||Object(T.b)("matcher-pattern-missing-key-or-value",l),[l.key,l.value]):[l,!0]):_n(a)?Object.entries(a):[[a,!0]]}(o),i=Array.from(e),r=[];return n.forEach(([a,l])=>{i.forEach(d=>{(function(h,p){return h===!0||h===p||h instanceof RegExp&&h.test(p)})(a,d)&&function(h,p,b){if(h===!0)return!0;const x=b(p);return h===x||h instanceof RegExp&&h.test(x)}(l,d,t)&&r.push(d)})}),!n.length||r.length<n.length?null:r}var Pi=function(o){return typeof o=="symbol"||ft(o)&&ke(o)=="[object Symbol]"},Ii=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fi=/^\w*$/,K=function(o,e){if(sn(o))return!1;var t=typeof o;return!(t!="number"&&t!="symbol"&&t!="boolean"&&o!=null&&!Pi(o))||fi.test(o)||!Ii.test(o)||e!=null&&o in Object(e)};function oe(o,e){if(typeof o!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var t=function(){var n=arguments,i=e?e.apply(this,n):n[0],r=t.cache;if(r.has(i))return r.get(i);var a=o.apply(this,n);return t.cache=r.set(i,a)||r,a};return t.cache=new(oe.Cache||Ir),t}oe.Cache=Ir;var Y=oe,Te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ze=/\\(\\)?/g,Xe=function(o){var e=Y(o,function(n){return t.size===500&&t.clear(),n}),t=e.cache;return e}(function(o){var e=[];return o.charCodeAt(0)===46&&e.push(""),o.replace(Te,function(t,n,i,r){e.push(i?r.replace(Ze,"$1"):n||t)}),e}),Rt=function(o,e){for(var t=-1,n=o==null?0:o.length,i=Array(n);++t<n;)i[t]=e(o[t],t,o);return i},Ct=me?me.prototype:void 0,Kl=Ct?Ct.toString:void 0,Mg=function o(e){if(typeof e=="string")return e;if(sn(e))return Rt(e,o)+"";if(Pi(e))return Kl?Kl.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t},ei=function(o){return o==null?"":Mg(o)},vs=function(o,e){return sn(o)?o:K(o,e)?[o]:Xe(ei(o))},Dg=function(o){var e=o==null?0:o.length;return e?o[e-1]:void 0},cr=function(o){if(typeof o=="string"||Pi(o))return o;var e=o+"";return e=="0"&&1/o==-1/0?"-0":e},Sa=function(o,e){for(var t=0,n=(e=vs(e,o)).length;o!=null&&t<n;)o=o[cr(e[t++])];return t&&t==n?o:void 0},Aa=function(o,e,t){var n=-1,i=o.length;e<0&&(e=-e>i?0:i+e),(t=t>i?i:t)<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var r=Array(i);++n<i;)r[n]=o[n+e];return r},Lt=function(o,e){return e.length<2?o:Sa(o,Aa(e,0,-1))},Og=function(o,e){return e=vs(e,o),(o=Lt(o,e))==null||delete o[cr(Dg(e))]},_h=function(o,e){return o==null||Og(o,e)},Vr=function(o,e,t){var n=o==null?void 0:Sa(o,e);return n===void 0?t:n},Tu=function(o,e,t){(t!==void 0&&!we(o[e],t)||t===void 0&&!(e in o))&&Qt(o,e,t)},jg=function(o){return function(e,t,n){for(var i=-1,r=Object(e),a=n(e),l=a.length;l--;){var d=a[o?l:++i];if(t(r[d],d,r)===!1)break}return e}}(),Rg=function(o){return ft(o)&&ui(o)},ws=function(o,e){if((e!=="constructor"||typeof o[e]!="function")&&e!="__proto__")return o[e]},ur=function(o){return rt(o,hi(o))},ql=function(o,e,t,n,i,r,a){var l=ws(o,t),d=ws(e,t),h=a.get(d);if(h)Tu(o,t,h);else{var p=r?r(l,d,t+"",o,e,a):void 0,b=p===void 0;if(b){var x=sn(d),E=!x&&Object(Ei.a)(d),P=!x&&!E&&Mo(d);p=d,x||E||P?sn(l)?p=l:Rg(l)?p=fa(l):E?(b=!1,p=Object(ha.a)(d,!0)):P?(b=!1,p=Bl(d,!0)):p=[]:_n(d)||Sn(d)?(p=l,Sn(l)?p=ur(l):ne(l)&&!xe(l)||(p=gs(d))):b=!1}b&&(a.set(d,p),i(p,d,n,r,a),a.delete(d)),Tu(o,t,p)}},kh=function o(e,t,n,i,r){e!==t&&jg(t,function(a,l){if(r||(r=new Mr),ne(a))ql(e,t,l,n,o,i,r);else{var d=i?i(ws(e,l),a,l+"",e,t,r):void 0;d===void 0&&(d=a),Tu(e,l,d)}},hi)},Na=Io(function(o,e,t){kh(o,e,t)}),yh=function(o,e,t,n){if(!ne(o))return o;for(var i=-1,r=(e=vs(e,o)).length,a=r-1,l=o;l!=null&&++i<r;){var d=cr(e[i]),h=t;if(d==="__proto__"||d==="constructor"||d==="prototype")return o;if(i!=a){var p=l[d];(h=n?n(p,d,l):void 0)===void 0&&(h=ne(p)?p:Po(e[i+1])?[]:{})}lt(l,d,h),l=l[d]}return o},xh=function(o,e,t){return o==null?o:yh(o,e,t)};class Gl{constructor(e){this._styles={},this._styleProcessor=e}get isEmpty(){const e=Object.entries(this._styles);return!Array.from(e).length}get size(){return this.isEmpty?0:this.getStyleNames().length}setTo(e){this.clear();const t=Array.from(function(n){let i=null,r=0,a=0,l=null;const d=new Map;if(n==="")return d;n.charAt(n.length-1)!=";"&&(n+=";");for(let h=0;h<n.length;h++){const p=n.charAt(h);if(i===null)switch(p){case":":l||(l=n.substr(r,h-r),a=h+1);break;case'"':case"'":i=p;break;case";":{const b=n.substr(a,h-a);l&&d.set(l.trim(),b.trim()),l=null,r=h+1;break}}else p===i&&(i=null)}return d}(e).entries());for(const[n,i]of t)this._styleProcessor.toNormalizedForm(n,i,this._styles)}has(e){if(this.isEmpty)return!1;const t=this._styleProcessor.getReducedForm(e,this._styles).find(([n])=>n===e);return Array.isArray(t)}set(e,t){if(ne(e))for(const[n,i]of Object.entries(e))this._styleProcessor.toNormalizedForm(n,i,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){const t=zr(e);_h(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("."),i=Vr(this._styles,n);i&&!Array.from(Object.keys(i)).length&&this.remove(n)}}class Ch{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,n){if(ne(t))Vo(n,zr(e),t);else if(this._normalizers.has(e)){const i=this._normalizers.get(e),{path:r,value:a}=i(t);Vo(n,r,a)}else Vo(n,e,t)}getNormalized(e,t){if(!e)return Na({},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 Vr(t,n);const i=n(e,t);if(i)return i}return Vr(t,zr(e))}getReducedForm(e,t){const n=this.getNormalized(e,t);return n===void 0?[]:this._reducers.has(e)?this._reducers.get(e)(n):[[e,n]]}getStyleNames(e){const t=Array.from(this._consumables.keys()).filter(i=>{const r=this.getNormalized(i,e);return r&&typeof r=="object"?Object.keys(r).length:r}),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 zr(o){return o.replace("-",".")}function Vo(o,e,t){let n=t;ne(t)&&(n=Na({},Vr(o,e),t)),xh(o,e,n)}class Kn extends Pe{constructor(e,t,n,i){if(super(e),this.name=t,this._attrs=function(r){r=Ke(r);for(const[a,l]of r)l===null?r.delete(a):typeof l!="string"&&r.set(a,String(l));return r}(n),this._children=[],i&&this._insertChild(0,i),this._classes=new Set,this._attrs.has("class")){const r=this._attrs.get("class");Th(this._classes,r),this._attrs.delete("class")}this._styles=new Gl(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 Kn))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 Et(...e);let n=this.parent;for(;n;){if(t.match(n))return n;n=n.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(","),t=this._styles.toString(),n=Array.from(this._attrs).map(i=>`${i[0]}="${i[1]}"`).sort().join(" ");return this.name+(e==""?"":` class="${e}"`)+(t?` style="${t}"`:"")+(n==""?"":" "+n)}_clone(e=!1){const t=[];if(e)for(const i of this.getChildren())t.push(i._clone(e));const n=new this.constructor(this.document,this.name,this._attrs,t);return n._classes=new Set(this._classes),n._styles.set(this._styles.getNormalized()),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n._isAllowedInsideAttributeElement=this.isAllowedInsideAttributeElement,n}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let n=0;const i=function(r,a){return typeof a=="string"?[new Ce(r,a)]:(Wn(a)||(a=[a]),Array.from(a).map(l=>typeof l=="string"?new Ce(r,l):l instanceof je?new Ce(r,l.data):l))}(this.document,t);for(const r of i)r.parent!==null&&r._remove(),r.parent=this,r.document=this.document,this._children.splice(e,0,r),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"?Th(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 Tt(e))this._classes.add(t)}_removeClass(e){this._fireChange("attributes",this);for(const t of Tt(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 Tt(e))this._styles.remove(t)}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function Th(o,e){const t=e.split(/\s+/);o.clear(),t.forEach(n=>o.add(n))}class Ql extends Kn{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=Eh}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 Eh(){const o=[...this.getChildren()],e=o[this.childCount-1];if(e&&e.is("element","br"))return this.childCount;for(const t of o)if(!t.is("uiElement"))return null;return this.childCount}class Fr extends Ql{constructor(e,t,n,i){super(e,t,n,i),this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(e),this.bind("isFocused").to(e,"isFocused",r=>r&&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()}}ze(Fr,$t);const Pa=Symbol("rootName");class Eu extends Fr{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(Pa)}set rootName(e){this._setCustomProperty(Pa,e)}set _name(e){this.name=e}}class Br{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new T.a("view-tree-walker-no-start-position",null);if(e.direction&&e.direction!="forward"&&e.direction!="backward")throw new T.a("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this.position=_e._createAt(e.startPosition):this.position=_e._createAt(e.boundaries[e.direction=="backward"?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(e){let t,n,i;do i=this.position,{done:t,value:n}=this.next();while(!t&&e(n));t||(this.position=i)}next(){return this.direction=="forward"?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,n=e.parent;if(n.parent===null&&e.offset===n.childCount)return{done:!0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};let i;if(n instanceof Ce){if(e.isAtEnd)return this.position=_e._createAfter(n),this._next();i=n.data[e.offset]}else i=n.getChild(e.offset);if(i instanceof Kn)return this.shallow?e.offset++:e=new _e(i,0),this.position=e,this._formatReturnValue("elementStart",i,t,e,1);if(i instanceof Ce){if(this.singleCharacters)return e=new _e(i,0),this.position=e,this._next();{let r,a=i.data.length;return i==this._boundaryEndParent?(a=this.boundaries.end.offset,r=new je(i,0,a),e=_e._createAfter(r)):(r=new je(i,0,i.data.length),e.offset++),this.position=e,this._formatReturnValue("text",r,t,e,a)}}if(typeof i=="string"){let r;this.singleCharacters?r=1:r=(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-e.offset;const a=new je(n,e.offset,r);return e.offset+=r,this.position=e,this._formatReturnValue("text",a,t,e,r)}return e=_e._createAfter(n),this.position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",n,t,e)}_previous(){let e=this.position.clone();const t=this.position,n=e.parent;if(n.parent===null&&e.offset===0)return{done:!0};if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0};let i;if(n instanceof Ce){if(e.isAtStart)return this.position=_e._createBefore(n),this._previous();i=n.data[e.offset-1]}else i=n.getChild(e.offset-1);if(i instanceof Kn)return this.shallow?(e.offset--,this.position=e,this._formatReturnValue("elementStart",i,t,e,1)):(e=new _e(i,i.childCount),this.position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",i,t,e));if(i instanceof Ce){if(this.singleCharacters)return e=new _e(i,i.data.length),this.position=e,this._previous();{let r,a=i.data.length;if(i==this._boundaryStartParent){const l=this.boundaries.start.offset;r=new je(i,l,i.data.length-l),a=r.data.length,e=_e._createBefore(r)}else r=new je(i,0,i.data.length),e.offset--;return this.position=e,this._formatReturnValue("text",r,t,e,a)}}if(typeof i=="string"){let r;if(this.singleCharacters)r=1;else{const l=n===this._boundaryStartParent?this.boundaries.start.offset:0;r=e.offset-l}e.offset-=r;const a=new je(n,e.offset,r);return this.position=e,this._formatReturnValue("text",a,t,e,r)}return e=_e._createBefore(n),this.position=e,this._formatReturnValue("elementStart",n,t,e,1)}_formatReturnValue(e,t,n,i,r){return t instanceof je&&(t.offsetInText+t.data.length==t.textNode.data.length&&(this.direction!="forward"||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=_e._createAfter(t.textNode):(i=_e._createAfter(t.textNode),this.position=i)),t.offsetInText===0&&(this.direction!="backward"||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=_e._createBefore(t.textNode):(i=_e._createBefore(t.textNode),this.position=i))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:i,length:r}}}}class _e{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 Fr);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=_e._createAt(this),n=t.offset+e;return t.offset=n<0?0:n,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new Br(t);return n.skip(e),n.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),n=e.getAncestors();let i=0;for(;t[i]==n[i]&&t[i];)i++;return i===0?null:t[i-1]}is(e){return e==="position"||e==="view:position"}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return this.compareWith(e)=="before"}isAfter(e){return this.compareWith(e)=="after"}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],n=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),n.push(e.offset);const i=z(t,n);switch(i){case"prefix":return"before";case"extension":return"after";default:return t[i]<n[i]?"before":"after"}}getWalker(e={}){return e.startPosition=this,new Br(e)}clone(){return new _e(this.parent,this.offset)}static _createAt(e,t){if(e instanceof _e)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 T.a("view-createpositionat-offset-required",n)}return new _e(n,t)}}static _createAfter(e){if(e.is("$textProxy"))return new _e(e.textNode,e.offsetInText+e.data.length);if(!e.parent)throw new T.a("view-position-after-root",e,{root:e});return new _e(e.parent,e.index+1)}static _createBefore(e){if(e.is("$textProxy"))return new _e(e.textNode,e.offsetInText);if(!e.parent)throw new T.a("view-position-before-root",e,{root:e});return new _e(e.parent,e.index)}}class et{constructor(e,t=null){this.start=e.clone(),this.end=t?t.clone():e.clone()}*[Symbol.iterator](){yield*new Br({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(Yl,{direction:"backward"}),t=this.end.getLastMatchingPosition(Yl);return e.parent.is("$text")&&e.isAtStart&&(e=_e._createBefore(e.parent)),t.parent.is("$text")&&t.isAtEnd&&(t=_e._createAfter(t.parent)),new et(e,t)}getTrimmed(){let e=this.start.getLastMatchingPosition(Yl);if(e.isAfter(this.end)||e.isEqual(this.end))return new et(e,e);let t=this.end.getLastMatchingPosition(Yl,{direction:"backward"});const n=e.nodeAfter,i=t.nodeBefore;return n&&n.is("$text")&&(e=new _e(n,0)),i&&i.is("$text")&&(t=new _e(i,i.data.length)),new et(e,t)}isEqual(e){return this==e||this.start.isEqual(e.start)&&this.end.isEqual(e.end)}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,t=!1){e.isCollapsed&&(t=!1);const n=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),i=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&i}getDifference(e){const t=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&t.push(new et(this.start,e.start)),this.containsPosition(e.end)&&t.push(new et(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 et(t,n)}return null}getWalker(e={}){return e.boundaries=this,new Br(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 et(this.start,this.end)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new Br(e);for(const n of t)yield n.item}*getPositions(e={}){e.boundaries=this;const t=new Br(e);yield t.position;for(const n of t)yield n.nextPosition}is(e){return e==="range"||e==="view:range"}isIntersecting(e){return this.start.isBefore(e.end)&&this.end.isAfter(e.start)}static _createFromParentsAndOffsets(e,t,n,i){return new this(new _e(e,t),new _e(n,i))}static _createFromPositionAndShift(e,t){const n=e,i=e.getShiftedBy(t);return t>0?new this(n,i):new this(i,n)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(_e._createBefore(e),t)}}function Yl(o){return!(!o.item.is("attributeElement")&&!o.item.is("uiElement"))}function dn(o){let e=0;for(const t of o)e++;return e}class Gt{constructor(e=null,t,n){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(e,t,n)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}get isCollapsed(){return this.rangeCount===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake||this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel||this.rangeCount!=e.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const i of e._ranges)if(t.isEqual(i)){n=!0;break}if(!n)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=dn(this.getRanges());if(t!=dn(e.getRanges()))return!1;if(t==0)return!0;for(let n of this.getRanges()){n=n.getTrimmed();let i=!1;for(let r of e.getRanges())if(r=r.getTrimmed(),n.start.isEqual(r.start)&&n.end.isEqual(r.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}setTo(e,t,n){if(e===null)this._setRanges([]),this._setFakeOptions(t);else if(e instanceof Gt||e instanceof Su)this._setRanges(e.getRanges(),e.isBackward),this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel});else if(e instanceof et)this._setRanges([e],t&&t.backward),this._setFakeOptions(t);else if(e instanceof _e)this._setRanges([new et(e)]),this._setFakeOptions(t);else if(e instanceof Pe){const i=!!n&&!!n.backward;let r;if(t===void 0)throw new T.a("view-selection-setto-required-second-parameter",this);r=t=="in"?et._createIn(e):t=="on"?et._createOn(e):new et(_e._createAt(e,t)),this._setRanges([r],i),this._setFakeOptions(n)}else{if(!Wn(e))throw new T.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 T.a("view-selection-setfocus-no-ranges",this);const n=_e._createAt(e,t);if(n.compareWith(this.focus)=="same")return;const i=this.anchor;this._ranges.pop(),n.compareWith(i)=="before"?this._addRange(new et(n,i),!0):this._addRange(new et(i,n)),this.fire("change")}is(e){return e==="selection"||e==="view:selection"}_setRanges(e,t=!1){e=Array.from(e),this._ranges=[];for(const n of e)this._addRange(n);this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,t=!1){if(!(e instanceof et))throw new T.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 T.a("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new et(e.start,e.end))}}ze(Gt,j);class Su{constructor(e=null,t,n){this._selection=new Gt,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)}}ze(Su,j);class Jl extends m{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 Zl=Symbol("bubbling contexts");var Lg={fire(o,...e){try{const t=o instanceof m?o:new m(this,o),n=dr(this);if(!n.size)return;if(Hr(t,"capturing",this),ho(n,"$capture",t,...e))return t.return;const i=t.startRange||this.selection.getFirstRange(),r=i?i.getContainedElement():null,a=!!r&&!!Xl(n,r);let l=r||function(d){if(!d)return null;const h=d.start.parent,p=d.end.parent,b=h.getPath(),x=p.getPath();return b.length>x.length?h:p}(i);if(Hr(t,"atTarget",l),!a){if(ho(n,"$text",t,...e))return t.return;Hr(t,"bubbling",l)}for(;l;){if(l.is("rootElement")){if(ho(n,"$root",t,...e))return t.return}else if(l.is("element")&&ho(n,l.name,t,...e))return t.return;if(ho(n,l,t,...e))return t.return;l=l.parent,Hr(t,"bubbling",l)}return Hr(t,"bubbling",this),ho(n,"$document",t,...e),t.return}catch(t){T.a.rethrowUnexpectedError(t,this)}},_addEventListener(o,e,t){const n=Tt(t.context||"$document"),i=dr(this);for(const r of n){let a=i.get(r);a||(a=Object.create(j),i.set(r,a)),this.listenTo(a,o,e,t)}},_removeEventListener(o,e){const t=dr(this);for(const n of t.values())this.stopListening(n,o,e)}};function Hr(o,e,t){o instanceof Jl&&(o._eventPhase=e,o._currentTarget=t)}function ho(o,e,t,...n){const i=typeof e=="string"?o.get(e):Xl(o,e);return!!i&&(i.fire(t,...n),t.stop.called)}function Xl(o,e){for(const[t,n]of o)if(typeof t=="function"&&t(e))return n;return null}function dr(o){return o[Zl]||(o[Zl]=new Map),o[Zl]}class zo{constructor(e){this.selection=new Su,this.roots=new Xn({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)}}ze(zo,Lg),ze(zo,$t);class fo extends Kn{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=ec,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 T.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 ec(){if(hr(this))return null;let o=this.parent;for(;o&&o.is("attributeElement");){if(hr(o)>1)return null;o=o.parent}return!o||hr(o)>1?null:this.childCount}function hr(o){return Array.from(o.getChildren()).filter(e=>!e.is("uiElement")).length}fo.DEFAULT_PRIORITY=10;class Sh extends Kn{constructor(e,t,n,i){super(e,t,n,i),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=Vg}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 Pe||Array.from(t).length>0))throw new T.a("view-emptyelement-cannot-add",[this,t])}}function Vg(){return null}const Ia=navigator.userAgent.toLowerCase();var yn={isMac:function(o){return o.indexOf("macintosh")>-1}(Ia),isGecko:function(o){return!!o.match(/gecko\/\d+/)}(Ia),isSafari:function(o){return o.indexOf(" applewebkit/")>-1&&o.indexOf("chrome")===-1}(Ia),isAndroid:function(o){return o.indexOf("android")>-1}(Ia),isBlink:function(o){return o.indexOf("chrome/")>-1&&o.indexOf("edge/")<0}(Ia),features:{isRegExpUnicodePropertySupported:function(){let o=!1;try{o="ć".search(new RegExp("[\\p{L}]","u"))===0}catch{}return o}()}};const zg={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},tc={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},ct=function(){const o={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);o[t.toLowerCase()]=e}for(let e=48;e<=57;e++)o[e-48]=e;for(let e=112;e<=123;e++)o["f"+(e-111)]=e;return o}(),Ah=Object.fromEntries(Object.entries(ct).map(([o,e])=>[e,o.charAt(0).toUpperCase()+o.slice(1)]));function I(o){let e;if(typeof o=="string"){if(e=ct[o.toLowerCase()],!e)throw new T.a("keyboard-unknown-key",null,{key:o})}else e=o.keyCode+(o.altKey?ct.alt:0)+(o.ctrlKey?ct.ctrl:0)+(o.shiftKey?ct.shift:0)+(o.metaKey?ct.cmd:0);return e}function fr(o){return typeof o=="string"&&(o=function(e){return e.split("+").map(t=>t.trim())}(o)),o.map(e=>typeof e=="string"?function(t){if(t.endsWith("!"))return I(t.slice(0,-1));const n=I(t);return yn.isMac&&n==ct.ctrl?ct.cmd:n}(e):e).reduce((e,t)=>t+e,0)}function Ma(o){let e=fr(o);return Object.entries(yn.isMac?zg:tc).reduce((t,[n,i])=>(e&ct[n]&&(e&=~ct[n],t+=i),t),"")+(e?Ah[e]:"")}function pi(o,e){const t=e==="ltr";switch(o){case ct.arrowleft:return t?"left":"right";case ct.arrowright:return t?"right":"left";case ct.arrowup:return"up";case ct.arrowdown:return"down"}}function vt(o,e){const t=pi(o,e);return t==="down"||t==="right"}class Au extends Kn{constructor(e,t,n,i){super(e,t,n,i),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=Bg}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 Pe||Array.from(t).length>0))throw new T.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 Fg(o){o.document.on("arrowKey",(e,t)=>function(n,i,r){if(i.keyCode==ct.arrowright){const a=i.domTarget.ownerDocument.defaultView.getSelection(),l=a.rangeCount==1&&a.getRangeAt(0).collapsed;if(l||i.shiftKey){const d=a.focusNode,h=a.focusOffset,p=r.domPositionToView(d,h);if(p===null)return;let b=!1;const x=p.getLastMatchingPosition(E=>(E.item.is("uiElement")&&(b=!0),!(!E.item.is("uiElement")&&!E.item.is("attributeElement"))));if(b){const E=r.viewPositionToDom(x);l?a.collapse(E.parent,E.offset):a.extend(E.parent,E.offset)}}}}(0,t,o.domConverter),{priority:"low"})}function Bg(){return null}class pr extends Kn{constructor(e,t,n,i){super(e,t,n,i),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=Hg}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 Pe||Array.from(t).length>0))throw new T.a("view-rawelement-cannot-add",[this,t])}}function Hg(){return null}class $r{constructor(e,t){this.document=e,this._children=[],t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}is(e){return e==="documentFragment"||e==="view:documentFragment"}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this);let n=0;const i=function(r,a){return typeof a=="string"?[new Ce(r,a)]:(Wn(a)||(a=[a]),Array.from(a).map(l=>typeof l=="string"?new Ce(r,l):l instanceof je?new Ce(r,l.data):l))}(this.document,t);for(const r of i)r.parent!==null&&r._remove(),r.parent=this,this._children.splice(e,0,r),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)}}ze($r,j);class Nh{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 $r(this.document,e)}createText(e){return new Ce(this.document,e)}createAttributeElement(e,t,n={}){const i=new fo(this.document,e,t);return typeof n.priority=="number"&&(i._priority=n.priority),n.id&&(i._id=n.id),i}createContainerElement(e,t,n={}){const i=new Ql(this.document,e,t);return n.isAllowedInsideAttributeElement!==void 0&&(i._isAllowedInsideAttributeElement=n.isAllowedInsideAttributeElement),i}createEditableElement(e,t){const n=new Fr(this.document,e,t);return n._document=this.document,n}createEmptyElement(e,t,n={}){const i=new Sh(this.document,e,t);return n.isAllowedInsideAttributeElement!==void 0&&(i._isAllowedInsideAttributeElement=n.isAllowedInsideAttributeElement),i}createUIElement(e,t,n,i={}){const r=new Au(this.document,e,t);return n&&(r.render=n),i.isAllowedInsideAttributeElement!==void 0&&(r._isAllowedInsideAttributeElement=i.isAllowedInsideAttributeElement),r}createRawElement(e,t,n,i={}){const r=new pr(this.document,e,t);return r.render=n||(()=>{}),i.isAllowedInsideAttributeElement!==void 0&&(r._isAllowedInsideAttributeElement=i.isAllowedInsideAttributeElement),r}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){_n(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 _e?this._breakAttributes(e):this._breakAttributesRange(e)}breakContainer(e){const t=e.parent;if(!t.is("containerElement"))throw new T.a("view-writer-break-non-container-element",this.document);if(!t.parent)throw new T.a("view-writer-break-root",this.document);if(e.isAtStart)return _e._createBefore(t);if(!e.isAtEnd){const n=t._clone(!1);this.insert(_e._createAfter(t),n);const i=new et(e,_e._createAt(t,"end")),r=new _e(n,0);this.move(i,r)}return _e._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,l=n.index;return n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new _e(a,l))}const i=n.getChild(t-1),r=n.getChild(t);if(!i||!r)return e;if(i.is("$text")&&r.is("$text"))return Ph(i,r);if(i.is("attributeElement")&&r.is("attributeElement")&&i.isSimilar(r)){const a=i.childCount;return i._appendChild(r.getChildren()),r._remove(),this._removeFromClonedElementsGroup(r),this.mergeAttributes(new _e(i,a))}return e}mergeContainers(e){const t=e.nodeBefore,n=e.nodeAfter;if(!(t&&n&&t.is("containerElement")&&n.is("containerElement")))throw new T.a("view-writer-merge-containers-invalid-position",this.document);const i=t.getChild(t.childCount-1),r=i instanceof Ce?_e._createAt(i,"end"):_e._createAt(t,"end");return this.move(et._createIn(n),_e._createAt(t,"end")),this.remove(et._createOn(n)),r}insert(e,t){(function a(l,d){for(const h of l){if(!Ug.some(p=>h instanceof p))throw new T.a("view-writer-insert-invalid-node-type",d);h.is("$text")||a(h.getChildren(),d)}})(t=Wn(t)?[...t]:[t],this.document);const n=t.reduce((a,l)=>{const d=a[a.length-1],h=!(l.is("uiElement")&&l.isAllowedInsideAttributeElement);return d&&d.breakAttributes==h?d.nodes.push(l):a.push({breakAttributes:h,nodes:[l]}),a},[]);let i=null,r=e;for(const{nodes:a,breakAttributes:l}of n){const d=this._insertNodes(r,a,l);i||(i=d.start),r=d.end}return i?new et(i,r):new et(e)}remove(e){const t=e instanceof et?e:et._createOn(e);if(Da(t,this.document),t.isCollapsed)return new $r(this.document);const{start:n,end:i}=this._breakAttributesRange(t,!0),r=n.parent,a=i.offset-n.offset,l=r._removeChildren(n.offset,a);for(const h of l)this._removeFromClonedElementsGroup(h);const d=this.mergeAttributes(n);return t.start=d,t.end=d.clone(),new $r(this.document,l)}clear(e,t){Da(e,this.document);const n=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const i of n){const r=i.item;let a;if(r.is("element")&&t.isSimilar(r))a=et._createOn(r);else if(!i.nextPosition.isAfter(e.start)&&r.is("$textProxy")){const l=r.getAncestors().find(d=>d.is("element")&&t.isSimilar(d));l&&(a=et._createIn(l))}a&&(a.end.isAfter(e.end)&&(a.end=e.end),a.start.isBefore(e.start)&&(a.start=e.start),this.remove(a))}}move(e,t){let n;if(t.isAfter(e.end)){const i=(t=this._breakAttributes(t,!0)).parent,r=i.childCount;e=this._breakAttributesRange(e,!0),n=this.remove(e),t.offset+=i.childCount-r}else n=this.remove(e);return this.insert(t,n)}wrap(e,t){if(!(t instanceof fo))throw new T.a("view-writer-wrap-invalid-attribute",this.document);if(Da(e,this.document),e.isCollapsed){let i=e.start;i.parent.is("element")&&(n=i.parent,!Array.from(n.getChildren()).some(a=>!a.is("uiElement")))&&(i=i.getLastMatchingPosition(a=>a.item.is("uiElement"))),i=this._wrapPosition(i,t);const r=this.document.selection;return r.isCollapsed&&r.getFirstPosition().isEqual(e.start)&&this.setSelection(i),new et(i)}return this._wrapRange(e,t);var n}unwrap(e,t){if(!(t instanceof fo))throw new T.a("view-writer-unwrap-invalid-attribute",this.document);if(Da(e,this.document),e.isCollapsed)return e;const{start:n,end:i}=this._breakAttributesRange(e,!0),r=n.parent,a=this._unwrapChildren(r,n.offset,i.offset,t),l=this.mergeAttributes(a.start);l.isEqual(a.start)||a.end.offset--;const d=this.mergeAttributes(a.end);return new et(l,d)}rename(e,t){const n=new Ql(this.document,e,t.getAttributes());return this.insert(_e._createAfter(t),n),this.move(et._createIn(t),_e._createAt(n,0)),this.remove(et._createOn(t)),n}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return _e._createAt(e,t)}createPositionAfter(e){return _e._createAfter(e)}createPositionBefore(e){return _e._createBefore(e)}createRange(e,t){return new et(e,t)}createRangeOn(e){return et._createOn(e)}createRangeIn(e){return et._createIn(e)}createSelection(e,t,n){return new Gt(e,t,n)}_insertNodes(e,t,n){let i,r;if(i=n?Nu(e):e.parent.is("$text")?e.parent.parent:e.parent,!i)throw new T.a("view-writer-invalid-position-container",this.document);r=n?this._breakAttributes(e,!0):e.parent.is("$text")?Pu(e):e;const a=i._insertChild(r.offset,t);for(const p of t)this._addToClonedElementsGroup(p);const l=r.getShiftedBy(a),d=this.mergeAttributes(r);d.isEqual(r)||l.offset--;const h=this.mergeAttributes(l);return new et(d,h)}_wrapChildren(e,t,n,i){let r=t;const a=[];for(;r<n;){const d=e.getChild(r),h=d.is("$text"),p=d.is("attributeElement"),b=d.isAllowedInsideAttributeElement;if(p&&this._wrapAttributeElement(i,d))a.push(new _e(e,r));else if(h||b||p&&$g(i,d)){const x=i._clone();d._remove(),x._appendChild(d),e._insertChild(r,x),this._addToClonedElementsGroup(x),a.push(new _e(e,r))}else p&&this._wrapChildren(d,0,d.childCount,i);r++}let l=0;for(const d of a)d.offset-=l,d.offset!=t&&(this.mergeAttributes(d).isEqual(d)||(l++,n--));return et._createFromParentsAndOffsets(e,t,e,n)}_unwrapChildren(e,t,n,i){let r=t;const a=[];for(;r<n;){const d=e.getChild(r);if(d.is("attributeElement"))if(d.isSimilar(i)){const h=d.getChildren(),p=d.childCount;d._remove(),e._insertChild(r,h),this._removeFromClonedElementsGroup(d),a.push(new _e(e,r),new _e(e,r+p)),r+=p,n+=p-1}else this._unwrapAttributeElement(i,d)?(a.push(new _e(e,r),new _e(e,r+1)),r++):(this._unwrapChildren(d,0,d.childCount,i),r++);else r++}let l=0;for(const d of a)d.offset-=l,!(d.offset==t||d.offset==n)&&(this.mergeAttributes(d).isEqual(d)||(l++,n--));return et._createFromParentsAndOffsets(e,t,e,n)}_wrapRange(e,t){const{start:n,end:i}=this._breakAttributesRange(e,!0),r=n.parent,a=this._wrapChildren(r,n.offset,i.offset,t),l=this.mergeAttributes(a.start);l.isEqual(a.start)||a.end.offset--;const d=this.mergeAttributes(a.end);return new et(l,d)}_wrapPosition(e,t){if(t.isSimilar(e.parent))return po(e.clone());e.parent.is("$text")&&(e=Pu(e));const n=this.createAttributeElement();n._priority=Number.POSITIVE_INFINITY,n.isSimilar=()=>!1,e.parent._insertChild(e.offset,n);const i=new et(e,e.getShiftedBy(1));this.wrap(i,t);const r=new _e(n.parent,n.index);n._remove();const a=r.nodeBefore,l=r.nodeAfter;return a instanceof Ce&&l instanceof Ce?Ph(a,l):po(r)}_wrapAttributeElement(e,t){if(!go(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(!go(e,t)||e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if(n!=="class"&&n!=="style"&&(!t.hasAttribute(n)||t.getAttribute(n)!==e.getAttribute(n)))return!1;if(!t.hasClass(...e.getClassNames()))return!1;for(const n of e.getStyleNames())if(!t.hasStyle(n)||t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())n!=="class"&&n!=="style"&&this.removeAttribute(n,t);return this.removeClass(Array.from(e.getClassNames()),t),this.removeStyle(Array.from(e.getStyleNames()),t),!0}_breakAttributesRange(e,t=!1){const n=e.start,i=e.end;if(Da(e,this.document),e.isCollapsed){const d=this._breakAttributes(e.start,t);return new et(d,d)}const r=this._breakAttributes(i,t),a=r.parent.childCount,l=this._breakAttributes(n,t);return r.offset+=r.parent.childCount-a,new et(l,r)}_breakAttributes(e,t=!1){const n=e.offset,i=e.parent;if(e.parent.is("emptyElement"))throw new T.a("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new T.a("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new T.a("view-writer-cannot-break-raw-element",this.document);if(!t&&i.is("$text")&&Iu(i.parent)||Iu(i))return e.clone();if(i.is("$text"))return this._breakAttributes(Pu(e),t);if(n==i.childCount){const r=new _e(i.parent,i.index+1);return this._breakAttributes(r,t)}if(n===0){const r=new _e(i.parent,i.index);return this._breakAttributes(r,t)}{const r=i.index+1,a=i._clone();i.parent._insertChild(r,a),this._addToClonedElementsGroup(a);const l=i.childCount-n,d=i._removeChildren(n,l);a._appendChild(d);const h=new _e(i.parent,r);return this._breakAttributes(h,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const i of e.getChildren())this._addToClonedElementsGroup(i);const t=e.id;if(!t)return;let n=this._cloneGroups.get(t);n||(n=new Set,this._cloneGroups.set(t,n)),n.add(e),e._clonesGroup=n}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const i of e.getChildren())this._removeFromClonedElementsGroup(i);const t=e.id;if(!t)return;const n=this._cloneGroups.get(t);n&&n.delete(e)}}function Nu(o){let e=o.parent;for(;!Iu(e);){if(!e)return;e=e.parent}return e}function $g(o,e){return o.priority<e.priority||!(o.priority>e.priority)&&o.getIdentity()<e.getIdentity()}function po(o){const e=o.nodeBefore;if(e&&e.is("$text"))return new _e(e,e.data.length);const t=o.nodeAfter;return t&&t.is("$text")?new _e(t,0):o}function Pu(o){if(o.offset==o.parent.data.length)return new _e(o.parent.parent,o.parent.index+1);if(o.offset===0)return new _e(o.parent.parent,o.parent.index);const e=o.parent.data.slice(o.offset);return o.parent._data=o.parent.data.slice(0,o.offset),o.parent.parent._insertChild(o.parent.index+1,new Ce(o.root.document,e)),new _e(o.parent.parent,o.parent.index+1)}function Ph(o,e){const t=o.data.length;return o._data+=e.data,e._remove(),new _e(o,t)}const Ug=[Ce,fo,Ql,Sh,pr,Au];function Iu(o){return o&&(o.is("containerElement")||o.is("documentFragment"))}function Da(o,e){const t=Nu(o.start),n=Nu(o.end);if(!t||!n||t!==n)throw new T.a("view-writer-invalid-range-container",e)}function go(o,e){return o.id===null&&e.id===null}function Nn(o){return Object.prototype.toString.call(o)=="[object Text]"}const Ih=o=>o.createTextNode(" "),Mh=o=>{const e=o.createElement("span");return e.dataset.ckeFiller=!0,e.innerHTML=" ",e},Dh=o=>{const e=o.createElement("br");return e.dataset.ckeFiller=!0,e},nc="".repeat(7);function xn(o){return Nn(o)&&o.data.substr(0,7)===nc}function ic(o){return o.data.length==7&&xn(o)}function Mu(o){return xn(o)?o.data.slice(7):o.data}function Ui(o,e){if(e.keyCode==ct.arrowleft){const t=e.domTarget.ownerDocument.defaultView.getSelection();if(t.rangeCount==1&&t.getRangeAt(0).collapsed){const n=t.getRangeAt(0).startContainer,i=t.getRangeAt(0).startOffset;xn(n)&&i<=7&&t.collapse(n,0)}}}function Oh(o,e,t,n=!1){t=t||function(r,a){return r===a},Array.isArray(o)||(o=Array.prototype.slice.call(o)),Array.isArray(e)||(e=Array.prototype.slice.call(e));const i=function(r,a,l){const d=jh(r,a,l);if(d===-1)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const h=Rh(r,d),p=Rh(a,d),b=jh(h,p,l),x=r.length-b,E=a.length-b;return{firstIndex:d,lastIndexOld:x,lastIndexNew:E}}(o,e,t);return n?function(r,a){const{firstIndex:l,lastIndexOld:d,lastIndexNew:h}=r;if(l===-1)return Array(a).fill("equal");let p=[];return l>0&&(p=p.concat(Array(l).fill("equal"))),h-l>0&&(p=p.concat(Array(h-l).fill("insert"))),d-l>0&&(p=p.concat(Array(d-l).fill("delete"))),h<a&&(p=p.concat(Array(a-h).fill("equal"))),p}(i,e.length):function(r,a){const l=[],{firstIndex:d,lastIndexOld:h,lastIndexNew:p}=a;return p-d>0&&l.push({index:d,type:"insert",values:r.slice(d,p)}),h-d>0&&l.push({index:d+(p-d),type:"delete",howMany:h-d}),l}(e,i)}function jh(o,e,t){for(let n=0;n<Math.max(o.length,e.length);n++)if(o[n]===void 0||e[n]===void 0||!t(o[n],e[n]))return n;return-1}function Rh(o,e){return o.slice(e).reverse()}function gr(o,e,t){t=t||function(D,R){return D===R};const n=o.length,i=e.length;if(n>200||i>200||n+i>300)return gr.fastDiff(o,e,t,!0);let r,a;if(i<n){const D=o;o=e,e=D,r="delete",a="insert"}else r="insert",a="delete";const l=o.length,d=e.length,h=d-l,p={},b={};function x(D){const R=(b[D-1]!==void 0?b[D-1]:-1)+1,H=b[D+1]!==void 0?b[D+1]:-1,Q=R>H?-1:1;p[D+Q]&&(p[D]=p[D+Q].slice(0)),p[D]||(p[D]=[]),p[D].push(R>H?r:a);let ae=Math.max(R,H),ye=ae-D;for(;ye<l&&ae<d&&t(o[ye],e[ae]);)ye++,ae++,p[D].push("equal");return ae}let E,P=0;do{for(E=-P;E<h;E++)b[E]=x(E);for(E=h+P;E>h;E--)b[E]=x(E);b[h]=x(h),P++}while(b[h]!==d);return p[h].slice(1)}function Lh(o,e,t){o.insertBefore(t,o.childNodes[e]||null)}function Du(o){const e=o.parentNode;e&&e.removeChild(o)}function Ur(o){if(o){if(o.defaultView)return o instanceof o.defaultView.Document;if(o.ownerDocument&&o.ownerDocument.defaultView)return o instanceof o.ownerDocument.defaultView.Node}return!1}gr.fastDiff=Oh;class Vh{constructor(e,t){this.domDocuments=new Set,this.domConverter=e,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=t,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(e,t){if(e==="text")this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if(e==="attributes")this.markedAttributes.add(t);else{if(e!=="children")throw new T.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;xn(t.parent)?this._inlineFiller=t.parent:this._inlineFiller=zh(n,t.parent,t.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=Array.from(this.domConverter.mapViewToDom(e).childNodes),i=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,{withChildren:!1})),r=this._diffNodeLists(n,i),a=this._findReplaceActions(r,n,i);if(a.indexOf("replace")!==-1){const l={equal:0,insert:0,delete:0};for(const d of a)if(d==="replace"){const h=l.equal+l.insert,p=l.equal+l.delete,b=e.getChild(h);!b||b.is("uiElement")||b.is("rawElement")||this._updateElementMappings(b,n[p]),Du(i[h]),l.equal++}else l[d]++}}_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")?_e._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&&Nn(t.parent)&&xn(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!xn(e))throw new T.a("view-renderer-filler-was-lost",this);ic(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 l=a.findAncestor(d=>d.hasAttribute("contenteditable"));return!l||l.getAttribute("contenteditable")=="true"}(t)||n===t.getFillerOffset())return!1;const i=e.nodeBefore,r=e.nodeAfter;return!(i instanceof Ce||r instanceof Ce)}_updateText(e,t){const n=this.domConverter.findCorrespondingDomText(e),i=this.domConverter.viewToDom(e,n.ownerDocument),r=n.data;let a=i.data;const l=t.inlineFillerPosition;if(l&&l.parent==e.parent&&l.offset==e.index&&(a=nc+a),r!=a){const d=Oh(r,a);for(const h of d)h.type==="insert"?n.insertData(h.index,h.values.join("")):n.deleteData(h.index,h.howMany)}}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=Array.from(t.attributes).map(r=>r.name),i=e.getAttributeKeys();for(const r of i)t.setAttribute(r,e.getAttribute(r));for(const r of n)e.hasAttribute(r)||t.removeAttribute(r)}_updateChildren(e,t){const n=this.domConverter.mapViewToDom(e);if(!n)return;const i=t.inlineFillerPosition,r=this.domConverter.mapViewToDom(e).childNodes,a=Array.from(this.domConverter.viewChildrenToDom(e,n.ownerDocument,{bind:!0,inlineFillerPosition:i}));i&&i.parent===e&&zh(n.ownerDocument,a,i.offset);const l=this._diffNodeLists(r,a);let d=0;const h=new Set;for(const p of l)p==="delete"?(h.add(r[d]),Du(r[d])):p==="equal"&&d++;d=0;for(const p of l)p==="insert"?(Lh(n,d,a[d]),d++):p==="equal"&&(this._markDescendantTextToSync(this.domConverter.domToView(a[d])),d++);for(const p of h)p.parentNode||this.domConverter.unbindDomElement(p)}_diffNodeLists(e,t){return gr(e=function(n,i){const r=Array.from(n);return r.length==0||!i||r[r.length-1]==i&&r.pop(),r}(e,this._fakeSelectionContainer),t,Oa.bind(null,this.domConverter))}_findReplaceActions(e,t,n){if(e.indexOf("insert")===-1||e.indexOf("delete")===-1)return e;let i=[],r=[],a=[];const l={equal:0,insert:0,delete:0};for(const d of e)d==="insert"?a.push(n[l.equal+l.insert]):d==="delete"?r.push(t[l.equal+l.delete]):(i=i.concat(gr(r,a,oc).map(h=>h==="equal"?"replace":h)),i.push("equal"),r=[],a=[]),l[d]++;return i.concat(gr(r,a,oc).map(d=>d==="equal"?"replace":d))}_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 l=a.createElement("div");return l.className="ck-fake-selection-container",Object.assign(l.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),l.textContent=" ",l}(t));const n=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(n,this.selection),!this._fakeSelectionNeedsUpdate(e))return;n.parentElement&&n.parentElement==e||e.appendChild(n),n.textContent=this.selection.fakeSelectionLabel||" ";const i=t.getSelection(),r=t.createRange();i.removeAllRanges(),r.selectNodeContents(n),i.addRange(r)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),i=this.domConverter.viewPositionToDom(this.selection.focus);t.collapse(n.parent,n.offset),t.extend(i.parent,i.offset),yn.isGecko&&function(r,a){const l=r.parent;if(l.nodeType!=Node.ELEMENT_NODE||r.offset!=l.childNodes.length-1)return;const d=l.childNodes[r.offset];d&&d.tagName=="BR"&&a.addRange(a.getRangeAt(0))}(i,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return(!t||!this.selection.isEqual(t))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer,n=e.ownerDocument.getSelection();return!t||t.parentElement!==e||n.anchorNode!==t&&!t.contains(n.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const e of this.domDocuments)if(e.getSelection().rangeCount){const t=e.activeElement,n=this.domConverter.mapDomToView(t);t&&n&&e.getSelection().removeAllRanges()}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function zh(o,e,t){const n=e instanceof Array?e:e.childNodes,i=n[t];if(Nn(i))return i.data=nc+i.data,i;{const r=o.createTextNode(nc);return Array.isArray(e)?n.splice(t,0,r):Lh(e,t,r),r}}function oc(o,e){return Ur(o)&&Ur(e)&&!Nn(o)&&!Nn(e)&&o.nodeType!==Node.COMMENT_NODE&&e.nodeType!==Node.COMMENT_NODE&&o.tagName.toLowerCase()===e.tagName.toLowerCase()}function Oa(o,e,t){return e===t||(Nn(e)&&Nn(t)?e.data===t.data:!(!o.isBlockFiller(e)||!o.isBlockFiller(t)))}ze(Vh,$t);var Ft={window,document};function Ou(o){let e=0;for(;o.previousSibling;)o=o.previousSibling,e++;return e}function ju(o){const e=[];for(;o&&o.nodeType!=Node.DOCUMENT_NODE;)e.unshift(o),o=o.parentNode;return e}const Wg=Dh(document),Fo=Ih(document),Ru=Mh(document);class mo{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 Et,this._encounteredRawContentDomNodes=new WeakSet}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new Gt(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const n of e.childNodes)this.unbindDomElement(n)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}viewToDom(e,t,n={}){if(e.is("$text")){const i=this._processDataFromViewText(e);return t.createTextNode(i)}{if(this.mapViewToDom(e))return this.mapViewToDom(e);let i;if(e.is("documentFragment"))i=t.createDocumentFragment(),n.bind&&this.bindDocumentFragments(i,e);else{if(e.is("uiElement"))return i=e.name==="$comment"?t.createComment(e.getCustomProperty("$rawContent")):e.render(t),n.bind&&this.bindElements(i,e),i;i=e.hasAttribute("xmlns")?t.createElementNS(e.getAttribute("xmlns"),e.name):t.createElement(e.name),e.is("rawElement")&&e.render(i),n.bind&&this.bindElements(i,e);for(const r of e.getAttributeKeys())i.setAttribute(r,e.getAttribute(r))}if(n.withChildren!==!1)for(const r of this.viewChildrenToDom(e,t,n))i.appendChild(r);return i}}*viewChildrenToDom(e,t,n={}){const i=e.getFillerOffset&&e.getFillerOffset();let r=0;for(const a of e.getChildren())i===r&&(yield this._getBlockFiller(t)),yield this.viewToDom(a,t,n),r++;i===r&&(yield this._getBlockFiller(t))}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),n=this.viewPositionToDom(e.end),i=document.createRange();return i.setStart(t.parent,t.offset),i.setEnd(n.parent,n.offset),i}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const n=this.findCorrespondingDomText(t);if(!n)return null;let i=e.offset;return xn(n)&&(i+=7),{parent:n,offset:i}}{let n,i,r;if(e.offset===0){if(n=this.mapViewToDom(t),!n)return null;r=n.childNodes[0]}else{const a=e.nodeBefore;if(i=a.is("$text")?this.findCorrespondingDomText(a):this.mapViewToDom(e.nodeBefore),!i)return null;n=i.parentNode,r=i.nextSibling}return Nn(r)&&xn(r)?{parent:r,offset:7}:{parent:n,offset:i?Ou(i)+1:0}}}domToView(e,t={}){if(this.isBlockFiller(e))return null;const n=this.getHostViewElement(e);if(n)return n;if(this.isComment(e)&&t.skipComments)return null;if(Nn(e)){if(ic(e))return null;{const i=this._processDataFromDomText(e);return i===""?null:new Ce(this.document,i)}}{if(this.mapDomToView(e))return this.mapDomToView(e);let i;if(this.isDocumentFragment(e))i=new $r(this.document),t.bind&&this.bindDocumentFragments(e,i);else{i=this._createViewElement(e,t),t.bind&&this.bindElements(e,i);const r=e.attributes;if(r)for(let a=r.length-1;a>=0;a--)i._setAttribute(r[a].name,r[a].value);if(this._isViewElementWithRawContent(i,t)||this.isComment(e)){const a=this.isComment(e)?e.data:e.innerHTML;return i._setCustomProperty("$rawContent",a),this._encounteredRawContentDomNodes.add(e),i}}if(t.withChildren!==!1)for(const r of this.domChildrenToView(e,t))i._appendChild(r);return i}}*domChildrenToView(e,t={}){for(let n=0;n<e.childNodes.length;n++){const i=e.childNodes[n],r=this.domToView(i,t);r!==null&&(yield r)}}domSelectionToView(e){if(e.rangeCount===1){let i=e.getRangeAt(0).startContainer;Nn(i)&&(i=i.parentNode);const r=this.fakeSelectionToView(i);if(r)return r}const t=this.isDomSelectionBackward(e),n=[];for(let i=0;i<e.rangeCount;i++){const r=e.getRangeAt(i),a=this.domRangeToView(r);a&&n.push(a)}return new Gt(n,{backward:t})}domRangeToView(e){const t=this.domPositionToView(e.startContainer,e.startOffset),n=this.domPositionToView(e.endContainer,e.endOffset);return t&&n?new et(t,n):null}domPositionToView(e,t){if(this.isBlockFiller(e))return this.domPositionToView(e.parentNode,Ou(e));const n=this.mapDomToView(e);if(n&&(n.is("uiElement")||n.is("rawElement")))return _e._createBefore(n);if(Nn(e)){if(ic(e))return this.domPositionToView(e.parentNode,Ou(e));const i=this.findCorrespondingViewText(e);let r=t;return i?(xn(e)&&(r-=7,r=r<0?0:r),new _e(i,r)):null}if(t===0){const i=this.mapDomToView(e);if(i)return new _e(i,0)}else{const i=e.childNodes[t-1],r=Nn(i)?this.findCorrespondingViewText(i):this.mapDomToView(i);if(r&&r.parent)return new _e(r.parent,r.index+1)}return null}mapDomToView(e){return this.getHostViewElement(e)||this._domToViewMapping.get(e)}findCorrespondingViewText(e){if(ic(e))return null;const t=this.getHostViewElement(e);if(t)return t;const n=e.previousSibling;if(n){if(!this.isElement(n))return null;const i=this.mapDomToView(n);if(i)return i.nextSibling instanceof Ce?i.nextSibling:null}else{const i=this.mapDomToView(e.parentNode);if(i){const r=i.getChild(0);return r instanceof Ce?r:null}}return null}mapViewToDom(e){return this._viewToDomMapping.get(e)}findCorrespondingDomText(e){const t=e.previousSibling;return t&&this.mapViewToDom(t)?this.mapViewToDom(t).nextSibling:!t&&e.parent&&this.mapViewToDom(e.parent)?this.mapViewToDom(e.parent).childNodes[0]:null}focus(e){const t=this.mapViewToDom(e);if(t&&t.ownerDocument.activeElement!==t){const{scrollX:n,scrollY:i}=Ft.window,r=[];gi(t,a=>{const{scrollLeft:l,scrollTop:d}=a;r.push([l,d])}),t.focus(),gi(t,a=>{const[l,d]=r.shift();a.scrollLeft=l,a.scrollTop=d}),Ft.window.scrollTo(n,i)}}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(e){return e&&e.nodeType==Node.COMMENT_NODE}isBlockFiller(e){return this.blockFillerMode=="br"?e.isEqualNode(Wg):!(e.tagName!=="BR"||!Fh(e,this.blockElements)||e.parentNode.childNodes.length!==1)||e.isEqualNode(Ru)||function(t,n){return t.isEqualNode(Fo)&&Fh(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=ju(e);for(t.pop();t.length;){const n=t.pop(),i=this._domToViewMapping.get(n);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}_getBlockFiller(e){switch(this.blockFillerMode){case"nbsp":return Ih(e);case"markedNbsp":return Mh(e);case"br":return Dh(e)}}_isDomSelectionPositionCorrect(e,t){if(Nn(e)&&xn(e)&&t<7||this.isElement(e)&&xn(e.childNodes[t]))return!1;const n=this.mapDomToView(e);return!n||!n.is("uiElement")&&!n.is("rawElement")}_processDataFromViewText(e){let t=e.data;if(e.getAncestors().some(n=>this.preElements.includes(n.name)))return t;if(t.charAt(0)==" "){const n=this._getTouchingInlineViewNode(e,!1);!(n&&n.is("$textProxy")&&this._nodeEndsWithSpace(n))&&n||(t=" "+t.substr(1))}if(t.charAt(t.length-1)==" "){const n=this._getTouchingInlineViewNode(e,!0),i=n&&n.is("$textProxy")&&n.data.charAt(0)==" ";t.charAt(t.length-2)!=" "&&n&&!i||(t=t.substr(0,t.length-1)+" ")}return t.replace(/ {2}/g," ")}_nodeEndsWithSpace(e){if(e.getAncestors().some(n=>this.preElements.includes(n.name)))return!1;const t=this._processDataFromViewText(e);return t.charAt(t.length-1)==" "}_processDataFromDomText(e){let t=e.data;if(function(h,p){return ju(h).some(b=>b.tagName&&p.includes(b.tagName.toLowerCase()))}(e,this.preElements))return Mu(e);t=t.replace(/[ \n\t\r]{1,}/g," ");const n=this._getTouchingInlineDomNode(e,!1),i=this._getTouchingInlineDomNode(e,!0),r=this._checkShouldLeftTrimDomText(e,n),a=this._checkShouldRightTrimDomText(e,i);r&&(t=t.replace(/^ /,"")),a&&(t=t.replace(/ $/,"")),t=Mu(new Text(t)),t=t.replace(/ \u00A0/g," ");const l=i&&this.isElement(i)&&i.tagName!="BR",d=i&&Nn(i)&&i.data.charAt(0)==" ";return(/( |\u00A0)\u00A0$/.test(t)||!i||l||d)&&(t=t.replace(/\u00A0$/," ")),(r||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&&!xn(e)}_getTouchingInlineViewNode(e,t){const n=new Br({startPosition:t?_e._createAfter(e):_e._createBefore(e),direction:t?"forward":"backward"});for(const i of n){if(i.item.is("element")&&this.inlineObjectElements.includes(i.item.name))return i.item;if(i.item.is("containerElement")||i.item.is("element","br"))return null;if(i.item.is("$textProxy"))return i.item}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode)return null;const n=t?"firstChild":"lastChild",i=t?"nextSibling":"previousSibling";let r=!0;do if(!r&&e[n]?e=e[n]:e[i]?(e=e[i],r=!1):(e=e.parentNode,r=!0),!e||this._isBlockElement(e))return null;while(!Nn(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 Au(this.document,"$comment");const n=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();return new Kn(this.document,n)}_isViewElementWithRawContent(e,t){return t.withChildren!==!1&&this._rawContentElementMatcher.match(e)}}function gi(o,e){for(;o&&o!=Ft.document;)e(o),o=o.parentNode}function Fh(o,e){const t=o.parentNode;return t&&t.tagName&&e.includes(t.tagName.toLowerCase())}function ja(o){const e=Object.prototype.toString.apply(o);return e=="[object Window]"||e=="[object global]"}var Wr=Er({},j,{listenTo(o,...e){if(Ur(o)||ja(o)){const t=this._getProxyEmitter(o)||new Kr(o);t.attach(...e),o=t}j.listenTo.call(this,o,...e)},stopListening(o,e,t){if(Ur(o)||ja(o)){const n=this._getProxyEmitter(o);if(!n)return;o=n}j.stopListening.call(this,o,e,t),o instanceof Kr&&o.detach(e)},_getProxyEmitter(o){return e=this,t=Bo(o),e[L]&&e[L][t]?e[L][t].emitter:null;var e,t}});class Kr{constructor(e){$(this,Bo(e)),this._domNode=e}}function Bo(o){return o["data-ck-expando"]||(o["data-ck-expando"]=M())}Er(Kr.prototype,j,{attach(o,e,t={}){if(this._domListeners&&this._domListeners[o])return;const n={capture:!!t.useCapture,passive:!!t.usePassive},i=this._createDomListener(o,n);this._domNode.addEventListener(o,i,n),this._domListeners||(this._domListeners={}),this._domListeners[o]=i},detach(o){let e;!this._domListeners[o]||(e=this._events[o])&&e.callbacks.length||this._domListeners[o].removeListener()},_createDomListener(o,e){const t=n=>{this.fire(o,n)};return t.removeListener=()=>{this._domNode.removeEventListener(o,t,e),delete this._domListeners[o]},t}});class bo{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] *")}}ze(bo,Wr);var Kg=function(o){return this.__data__.set(o,"__lodash_hash_undefined__"),this},rc=function(o){return this.__data__.has(o)};function sc(o){var e=-1,t=o==null?0:o.length;for(this.__data__=new Ir;++e<t;)this.add(o[e])}sc.prototype.add=sc.prototype.push=Kg,sc.prototype.has=rc;var Bh=sc,Pn=function(o,e){for(var t=-1,n=o==null?0:o.length;++t<n;)if(e(o[t],t,o))return!0;return!1},Lu=function(o,e){return o.has(e)},Vu=function(o,e,t,n,i,r){var a=1&t,l=o.length,d=e.length;if(l!=d&&!(a&&d>l))return!1;var h=r.get(o),p=r.get(e);if(h&&p)return h==e&&p==o;var b=-1,x=!0,E=2&t?new Bh:void 0;for(r.set(o,e),r.set(e,o);++b<l;){var P=o[b],D=e[b];if(n)var R=a?n(D,P,b,e,o,r):n(P,D,b,o,e,r);if(R!==void 0){if(R)continue;x=!1;break}if(E){if(!Pn(e,function(H,Q){if(!Lu(E,Q)&&(P===H||i(P,H,t,n,r)))return E.push(Q)})){x=!1;break}}else if(P!==D&&!i(P,D,t,n,r)){x=!1;break}}return r.delete(o),r.delete(e),x},vo=function(o){var e=-1,t=Array(o.size);return o.forEach(function(n,i){t[++e]=[i,n]}),t},zu=function(o){var e=-1,t=Array(o.size);return o.forEach(function(n){t[++e]=n}),t},Ra=me?me.prototype:void 0,Ho=Ra?Ra.valueOf:void 0,Hh=function(o,e,t,n,i,r,a){switch(t){case"[object DataView]":if(o.byteLength!=e.byteLength||o.byteOffset!=e.byteOffset)return!1;o=o.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(o.byteLength!=e.byteLength||!r(new ps(o),new ps(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return we(+o,+e);case"[object Error]":return o.name==e.name&&o.message==e.message;case"[object RegExp]":case"[object String]":return o==e+"";case"[object Map]":var l=vo;case"[object Set]":var d=1&n;if(l||(l=zu),o.size!=e.size&&!d)return!1;var h=a.get(o);if(h)return h==e;n|=2,a.set(o,e);var p=Vu(l(o),l(e),n,i,r,a);return a.delete(o),p;case"[object Symbol]":if(Ho)return Ho.call(o)==Ho.call(e)}return!1},qn=Object.prototype.hasOwnProperty,Fu=function(o,e,t,n,i,r){var a=1&t,l=hs(o),d=l.length;if(d!=hs(e).length&&!a)return!1;for(var h=d;h--;){var p=l[h];if(!(a?p in e:qn.call(e,p)))return!1}var b=r.get(o),x=r.get(e);if(b&&x)return b==e&&x==o;var E=!0;r.set(o,e),r.set(e,o);for(var P=a;++h<d;){var D=o[p=l[h]],R=e[p];if(n)var H=a?n(R,D,p,e,o,r):n(D,R,p,o,e,r);if(!(H===void 0?D===R||i(D,R,t,n,r):H)){E=!1;break}P||(P=p=="constructor")}if(E&&!P){var Q=o.constructor,ae=e.constructor;Q==ae||!("constructor"in o)||!("constructor"in e)||typeof Q=="function"&&Q instanceof Q&&typeof ae=="function"&&ae instanceof ae||(E=!1)}return r.delete(o),r.delete(e),E},$h=Object.prototype.hasOwnProperty,qg=function(o,e,t,n,i,r){var a=sn(o),l=sn(e),d=a?"[object Array]":Pt(o),h=l?"[object Array]":Pt(e),p=(d=d=="[object Arguments]"?"[object Object]":d)=="[object Object]",b=(h=h=="[object Arguments]"?"[object Object]":h)=="[object Object]",x=d==h;if(x&&Object(Ei.a)(o)){if(!Object(Ei.a)(e))return!1;a=!0,p=!1}if(x&&!p)return r||(r=new Mr),a||Mo(o)?Vu(o,e,t,n,i,r):Hh(o,e,d,t,n,i,r);if(!(1&t)){var E=p&&$h.call(o,"__wrapped__"),P=b&&$h.call(e,"__wrapped__");if(E||P){var D=E?o.value():o,R=P?e.value():e;return r||(r=new Mr),i(D,R,t,n,r)}}return!!x&&(r||(r=new Mr),Fu(o,e,t,n,i,r))},Uh=function o(e,t,n,i,r){return e===t||(e==null||t==null||!ft(e)&&!ft(t)?e!=e&&t!=t:qg(e,t,n,i,o,r))},Bu=function(o,e,t){var n=(t=typeof t=="function"?t:void 0)?t(o,e):void 0;return n===void 0?Uh(o,e,void 0,t):!!n};class Wh extends bo{constructor(e){super(e),this._config={childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},this.domConverter=e.domConverter,this.renderer=e._renderer,this._domElements=[],this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(e){this._domElements.push(e),this.isEnabled&&this._mutationObserver.observe(e,this._config)}enable(){super.enable();for(const e of this._domElements)this._mutationObserver.observe(e,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(e){if(e.length===0)return;const t=this.domConverter,n=new Map,i=new Set;for(const h of e)if(h.type==="childList"){const p=t.mapDomToView(h.target);if(p&&(p.is("uiElement")||p.is("rawElement")))continue;p&&!this._isBogusBrMutation(h)&&i.add(p)}for(const h of e){const p=t.mapDomToView(h.target);if((!p||!p.is("uiElement")&&!p.is("rawElement"))&&h.type==="characterData"){const b=t.findCorrespondingViewText(h.target);b&&!i.has(b.parent)?n.set(b,{type:"text",oldText:b.data,newText:Mu(h.target),node:b}):!b&&xn(h.target)&&i.add(t.mapDomToView(h.target.parentNode))}}const r=[];for(const h of n.values())this.renderer.markToSync("text",h.node),r.push(h);for(const h of i){const p=t.mapViewToDom(h),b=Array.from(h.getChildren()),x=Array.from(t.domChildrenToView(p,{withChildren:!1}));Bu(b,x,d)||(this.renderer.markToSync("children",h),r.push({type:"children",oldChildren:b,newChildren:x,node:h}))}const a=e[0].target.ownerDocument.getSelection();let l=null;if(a&&a.anchorNode){const h=t.domPositionToView(a.anchorNode,a.anchorOffset),p=t.domPositionToView(a.focusNode,a.focusOffset);h&&p&&(l=new Gt(h),l.setFocus(p))}function d(h,p){if(!Array.isArray(h))return h===p||!(!h.is("$text")||!p.is("$text"))&&h.data===p.data}r.length&&(this.document.fire("mutations",r,l),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 qr{constructor(e,t,n){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,Er(this,n)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class $o extends bo{constructor(e){super(e),this.useCapture=!1}observe(e){(typeof this.domEventType=="string"?[this.domEventType]:this.domEventType).forEach(t=>{this.listenTo(e,t,(n,i)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(i.target)&&this.onDomEvent(i)},{useCapture:this.useCapture})})}fire(e,t,n){this.isEnabled&&this.document.fire(e,new qr(this.view,t,n))}}class Gg extends $o{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 I(this)}})}}var Hu=function(){return ie.a.Date.now()},La=/\s/,Qg=function(o){for(var e=o.length;e--&&La.test(o.charAt(e)););return e},Yg=/^\s+/,$u=function(o){return o&&o.slice(0,Qg(o)+1).replace(Yg,"")},Kh=/^[-+]0x[0-9a-f]+$/i,Jg=/^0b[01]+$/i,Zg=/^0o[0-7]+$/i,Xg=parseInt,Uu=function(o){if(typeof o=="number")return o;if(Pi(o))return NaN;if(ne(o)){var e=typeof o.valueOf=="function"?o.valueOf():o;o=ne(e)?e+"":e}if(typeof o!="string")return o===0?o:+o;o=$u(o);var t=Jg.test(o);return t||Zg.test(o)?Xg(o.slice(2),t?2:8):Kh.test(o)?NaN:+o},Wu=Math.max,em=Math.min,Va=function(o,e,t){var n,i,r,a,l,d,h=0,p=!1,b=!1,x=!0;if(typeof o!="function")throw new TypeError("Expected a function");function E(ae){var ye=n,Be=i;return n=i=void 0,h=ae,a=o.apply(Be,ye)}function P(ae){return h=ae,l=setTimeout(R,e),p?E(ae):a}function D(ae){var ye=ae-d;return d===void 0||ye>=e||ye<0||b&&ae-h>=r}function R(){var ae=Hu();if(D(ae))return H(ae);l=setTimeout(R,function(ye){var Be=e-(ye-d);return b?em(Be,r-(ye-h)):Be}(ae))}function H(ae){return l=void 0,x&&n?E(ae):(n=i=void 0,a)}function Q(){var ae=Hu(),ye=D(ae);if(n=arguments,i=this,d=ae,ye){if(l===void 0)return P(d);if(b)return clearTimeout(l),l=setTimeout(R,e),E(d)}return l===void 0&&(l=setTimeout(R,e)),a}return e=Uu(e)||0,ne(t)&&(p=!!t.leading,r=(b="maxWait"in t)?Wu(Uu(t.maxWait)||0,e):r,x="trailing"in t?!!t.trailing:x),Q.cancel=function(){l!==void 0&&clearTimeout(l),h=0,n=d=i=l=void 0},Q.flush=function(){return l===void 0?a:H(Hu())},Q};class qh extends bo{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=Va(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 Gt(t.getRanges(),{backward:t.isBackward,fake:!1});e!=ct.arrowleft&&e!=ct.arrowup||n.setTo(n.getFirstPosition()),e!=ct.arrowright&&e!=ct.arrowdown||n.setTo(n.getLastPosition());const i={oldSelection:t,newSelection:n,domSelection:null};this.document.fire("selectionChange",i),this._fireSelectionChangeDoneDebounced(i)}}class Gh extends bo{constructor(e){super(e),this.mutationObserver=e.getObserver(Wh),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Va(t=>this.document.fire("selectionChangeDone",t),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(e){const t=e.ownerDocument;this._documents.has(t)||(this.listenTo(t,"selectionchange",(n,i)=>{this._handleSelectionChange(i,t)}),this._documents.add(t))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(e,t){if(!this.isEnabled)return;const n=t.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(n.anchorNode))return;this.mutationObserver.flush();const i=this.domConverter.domSelectionToView(n);if(i.rangeCount!=0){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(i)&&this.domConverter.isDomSelectionCorrect(n)||++this._loopbackCounter>60))if(this.selection.isSimilar(i))this.view.forceRender();else{const r={oldSelection:this.selection,newSelection:i,domSelection:n};this.document.fire("selectionChange",r),this._fireSelectionChangeDoneDebounced(r)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class Qh extends $o{constructor(e){super(e),this.domEventType=["focus","blur"],this.useCapture=!0;const t=this.document;t.on("focus",()=>{t.isFocused=!0,this._renderTimeoutId=setTimeout(()=>e.change(()=>{}),50)}),t.on("blur",(n,i)=>{const r=t.selection.editableElement;r!==null&&r!==i.target||(t.isFocused=!1,e.change(()=>{}))})}onDomEvent(e){this.fire(e.type,e)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class ac extends $o{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 tm extends $o{constructor(e){super(e),this.domEventType=["beforeinput"]}onDomEvent(e){this.fire(e.type,e)}}class Yh{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 Ku=function(o){return typeof o=="string"||!sn(o)&&ft(o)&&ke(o)=="[object String]"};function lc(o){return Object.prototype.toString.apply(o)=="[object Range]"}function qu(o){const e=o.ownerDocument.defaultView.getComputedStyle(o);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}const Jh=["top","right","bottom","left","width","height"];class St{constructor(e){const t=lc(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),Ai(e)||t)if(t){const n=St.getDomRangeRects(e);za(this,St.getBoundingRect(n))}else za(this,e.getBoundingClientRect());else if(ja(e)){const{innerWidth:n,innerHeight:i}=e;za(this,{top:0,right:n,bottom:i,left:0,width:n,height:i})}else za(this,e)}clone(){return new St(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 St(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(!cc(e)){let n=e.parentNode||e.commonAncestorContainer;for(;n&&!cc(n);){const i=new St(n),r=t.getIntersection(i);if(!r)return null;r.getArea()<t.getArea()&&(t=r),n=n.parentNode}}return t}isEqual(e){for(const t of Jh)if(this[t]!==e[t])return!1;return!0}contains(e){const t=this.getIntersection(e);return!(!t||!t.isEqual(e))}excludeScrollbarsAndBorders(){const e=this._source;let t,n,i;if(ja(e))t=e.innerWidth-e.document.documentElement.clientWidth,n=e.innerHeight-e.document.documentElement.clientHeight,i=e.getComputedStyle(e.document.documentElement).direction;else{const r=qu(this._source);t=e.offsetWidth-e.clientWidth-r.left-r.right,n=e.offsetHeight-e.clientHeight-r.top-r.bottom,i=e.ownerDocument.defaultView.getComputedStyle(e).direction,this.left+=r.left,this.top+=r.top,this.right-=r.right,this.bottom-=r.bottom,this.width=this.right-this.left,this.height=this.bottom-this.top}return this.width-=t,i==="ltr"?this.right-=t:this.left+=t,this.height-=n,this.bottom-=n,this}static getDomRangeRects(e){const t=[],n=Array.from(e.getClientRects());if(n.length)for(const i of n)t.push(new St(i));else{let i=e.startContainer;Nn(i)&&(i=i.parentNode);const r=new St(i.getBoundingClientRect());r.right=r.left,r.width=0,t.push(r)}return t}static getBoundingRect(e){const t={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY};let n=0;for(const i of e)n++,t.left=Math.min(t.left,i.left),t.top=Math.min(t.top,i.top),t.right=Math.max(t.right,i.right),t.bottom=Math.max(t.bottom,i.bottom);return n==0?null:(t.width=t.right-t.left,t.height=t.bottom-t.top,new St(t))}}function za(o,e){for(const t of Jh)o[t]=e[t]}function cc(o){return!!Ai(o)&&o===o.ownerDocument.body}class Zt{constructor(e,t){Zt._observerInstance||Zt._createObserver(),this._element=e,this._callback=t,Zt._addElementCallback(e,t),Zt._observerInstance.observe(e)}destroy(){Zt._deleteElementCallback(this._element,this._callback)}static _addElementCallback(e,t){Zt._elementCallbacks||(Zt._elementCallbacks=new Map);let n=Zt._elementCallbacks.get(e);n||(n=new Set,Zt._elementCallbacks.set(e,n)),n.add(t)}static _deleteElementCallback(e,t){const n=Zt._getElementCallbacks(e);n&&(n.delete(t),n.size||(Zt._elementCallbacks.delete(e),Zt._observerInstance.unobserve(e))),Zt._elementCallbacks&&!Zt._elementCallbacks.size&&(Zt._observerInstance=null,Zt._elementCallbacks=null)}static _getElementCallbacks(e){return Zt._elementCallbacks?Zt._elementCallbacks.get(e):null}static _createObserver(){let e;e=typeof Ft.window.ResizeObserver=="function"?Ft.window.ResizeObserver:uc,Zt._observerInstance=new e(t=>{for(const n of t){const i=Zt._getElementCallbacks(n.target);if(i)for(const r of i)r(n)}})}}Zt._observerInstance=null,Zt._elementCallbacks=null;class uc{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(Ft.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 St(e),n=this._previousRects.get(e),i=!n||!n.isEqual(t);return this._previousRects.set(e,t),i}}function ut(o){return e=>e+o}function ti(o){const e=o.next();return e.done?null:e.value}ze(uc,Wr);class Mi{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 T.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)}}ze(Mi,Wr),ze(Mi,$t);class mi{constructor(){this._listener=Object.create(Wr)}listenTo(e){this._listener.listenTo(e,"keydown",(t,n)=>{this._listener.fire("_keydown:"+I(n),n)})}set(e,t,n={}){const i=fr(e),r=n.priority;this._listener.listenTo(this._listener,"_keydown:"+i,(a,l)=>{t(l,()=>{l.preventDefault(),l.stopPropagation(),a.stop()}),a.return=!0},{priority:r})}press(e){return!!this._listener.fire("_keydown:"+I(e),e)}destroy(){this._listener.stopListening()}}class Zh extends bo{constructor(e){super(e),this.document.on("keydown",(t,n)=>{if(this.isEnabled&&((i=n.keyCode)==ct.arrowright||i==ct.arrowleft||i==ct.arrowup||i==ct.arrowdown)){const r=new Jl(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(r,n),r.stop.called&&t.stop()}var i})}observe(){}}function Xh({target:o,viewportOffset:e=0}){const t=hc(o);let n=t,i=null;for(;n;){let r;r=ni(n==t?o:i),bi(r,()=>Uo(o,n));const a=Uo(o,n);if(nm(n,a,e),n.parent!=n){if(i=n.frameElement,n=n.parent,!i)return}else n=null}}function nm(o,e,t){const n=e.clone().moveBy(0,t),i=e.clone().moveBy(0,-t),r=new St(o).excludeScrollbarsAndBorders();if(![i,n].every(a=>r.contains(a))){let{scrollX:a,scrollY:l}=o;Fa(i,r)?l-=r.top-e.top+t:ef(n,r)&&(l+=e.bottom-r.bottom+t),dc(e,r)?a-=r.left-e.left+t:Gu(e,r)&&(a+=e.right-r.right+t),o.scrollTo(a,l)}}function bi(o,e){const t=hc(o);let n,i;for(;o!=t.document.body;)i=e(),n=new St(o).excludeScrollbarsAndBorders(),n.contains(i)||(Fa(i,n)?o.scrollTop-=n.top-i.top:ef(i,n)&&(o.scrollTop+=i.bottom-n.bottom),dc(i,n)?o.scrollLeft-=n.left-i.left:Gu(i,n)&&(o.scrollLeft+=i.right-n.right)),o=o.parentNode}function ef(o,e){return o.bottom>e.bottom}function Fa(o,e){return o.top<e.top}function dc(o,e){return o.left<e.left}function Gu(o,e){return o.right>e.right}function hc(o){return lc(o)?o.startContainer.ownerDocument.defaultView:o.ownerDocument.defaultView}function ni(o){if(lc(o)){let e=o.commonAncestorContainer;return Nn(e)&&(e=e.parentNode),e}return o.parentNode}function Uo(o,e){const t=hc(o),n=new St(o);if(t===e)return n;{let i=t;for(;i!=e;){const r=i.frameElement,a=new St(r).excludeScrollbarsAndBorders();n.moveBy(a.left,a.top),i=i.parent}}return n}Object.assign({},{scrollViewportToShowTarget:Xh,scrollAncestorsToShowTarget:function(o){bi(ni(o),()=>new St(o))}});class fc{constructor(e){this.document=new zo(e),this.domConverter=new mo(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Vh(this.domConverter,this.document.selection),this._renderer.bind("isFocused").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new Nh(this.document),this.addObserver(Wh),this.addObserver(Gh),this.addObserver(Qh),this.addObserver(Gg),this.addObserver(qh),this.addObserver(ac),this.addObserver(Zh),yn.isAndroid&&this.addObserver(tm),this.document.on("arrowKey",Ui,{priority:"low"}),Fg(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0}),this.listenTo(this.document,"change:isFocused",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(e,t="main"){const n=this.document.getRoot(t);n._name=e.tagName.toLowerCase();const i={};for(const{name:a,value:l}of Array.from(e.attributes))i[a]=l,a==="class"?this._writer.addClass(l.split(" "),n):this._writer.setAttribute(a,l,n);this._initialDomRootAttributes.set(e,i);const r=()=>{this._writer.setAttribute("contenteditable",!n.isReadOnly,n),n.isReadOnly?this._writer.addClass("ck-read-only",n):this._writer.removeClass("ck-read-only",n)};r(),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,l)=>this._renderer.markToSync("children",l)),n.on("change:attributes",(a,l)=>this._renderer.markToSync("attributes",l)),n.on("change:text",(a,l)=>this._renderer.markToSync("text",l)),n.on("change:isReadOnly",()=>this.change(r)),n.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const a of this._observers.values())a.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:i})=>t.removeAttribute(i));const n=this._initialDomRootAttributes.get(t);for(const i in n)t.setAttribute(i,n[i]);this.domRoots.delete(e),this.domConverter.unbindDomElement(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(const[n,i]of this.domRoots)t.observe(i,n);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection(){const e=this.document.selection.getFirstRange();e&&Xh({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 T.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){T.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 _e._createAt(e,t)}createPositionAfter(e){return _e._createAfter(e)}createPositionBefore(e){return _e._createBefore(e)}createRange(e,t){return new et(e,t)}createRangeOn(e){return et._createOn(e)}createRangeIn(e){return et._createIn(e)}createSelection(e,t,n){return new Gt(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}}ze(fc,$t);class mr{constructor(e){this.parent=null,this._attrs=Ke(e)}get index(){let e;if(!this.parent)return null;if((e=this.parent.getChildIndex(this))===null)throw new T.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 T.a("model-node-not-found-in-parent",this);return e}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),i=e.getAncestors(t);let r=0;for(;n[r]==i[r]&&n[r];)r++;return r===0?null:n[r-1]}isBefore(e){if(this==e||this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),i=z(t,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return t[i]<n[i]}}isAfter(e){return this!=e&&this.root===e.root&&!this.isBefore(e)}hasAttribute(e){return this._attrs.has(e)}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}toJSON(){const e={};return this._attrs.size&&(e.attributes=Array.from(this._attrs).reduce((t,n)=>(t[n[0]]=n[1],t),{})),e}is(e){return e==="node"||e==="model:node"}_clone(){return new mr(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=Ke(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}class Dt extends mr{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 Dt(this.data,this.getAttributes())}static fromJSON(e){return new Dt(e.data,e.attributes)}}class Wi{constructor(e,t,n){if(this.textNode=e,t<0||t>e.offsetSize)throw new T.a("model-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.offsetSize)throw new T.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 br{constructor(e){this._nodes=[],e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((e,t)=>e+t.offsetSize,0)}getNode(e){return this._nodes[e]||null}getNodeIndex(e){const t=this._nodes.indexOf(e);return t==-1?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return t===null?null:this._nodes.slice(0,t).reduce((n,i)=>n+i.offsetSize,0)}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const t=this._nodes[e];if(!t)throw new T.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 T.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 mr))throw new T.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 Ot extends mr{constructor(e,t,n){super(t),this.name=e,this._children=new br,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 Ot(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(i){return typeof i=="string"?[new Dt(i)]:(Wn(i)||(i=[i]),Array.from(i).map(r=>typeof r=="string"?new Dt(r):r instanceof Wi?new Dt(r.data,r.getAttributes()):r))}(t);for(const i of n)i.parent!==null&&i._remove(),i.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const i of n)i.parent=null;return n}static fromJSON(e){let t=null;if(e.children){t=[];for(const n of e.children)n.name?t.push(Ot.fromJSON(n)):t.push(Dt.fromJSON(n))}return new Ot(e.name,e.attributes,t)}}class Ki{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new T.a("model-tree-walker-no-start-position",null);const t=e.direction||"forward";if(t!="forward"&&t!="backward")throw new T.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,i,r;do i=this.position,r=this._visitedParent,{done:t,value:n}=this.next();while(!t&&e(n));t||(this.position=i,this._visitedParent=r)}next(){return this.direction=="forward"?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),n=this._visitedParent;if(n.parent===null&&t.offset===n.maxOffset)return{done:!0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};const i=t.parent,r=_s(t,i),a=r||wo(t,i,r);if(a instanceof Ot)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=a),this.position=t,Wo("elementStart",a,e,t,1);if(a instanceof Dt){let l;if(this.singleCharacters)l=1;else{let p=a.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offset<p&&(p=this.boundaries.end.offset),l=p-t.offset}const d=t.offset-a.startOffset,h=new Wi(a,d,l);return t.offset+=l,this.position=t,Wo("text",h,e,t,l)}return t.path.pop(),t.offset++,this.position=t,this._visitedParent=n.parent,this.ignoreElementEnd?this._next():Wo("elementEnd",n,e,t)}_previous(){const e=this.position,t=this.position.clone(),n=this._visitedParent;if(n.parent===null&&t.offset===0)return{done:!0};if(n==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};const i=t.parent,r=_s(t,i),a=r||Qu(t,i,r);if(a instanceof Ot)return t.offset--,this.shallow?(this.position=t,Wo("elementStart",a,e,t,1)):(t.path.push(a.maxOffset),this.position=t,this._visitedParent=a,this.ignoreElementEnd?this._previous():Wo("elementEnd",a,e,t));if(a instanceof Dt){let l;if(this.singleCharacters)l=1;else{let p=a.startOffset;this._boundaryStartParent==n&&this.boundaries.start.offset>p&&(p=this.boundaries.start.offset),l=t.offset-p}const d=t.offset-a.startOffset,h=new Wi(a,d-l,l);return t.offset-=l,this.position=t,Wo("text",h,e,t,l)}return t.path.pop(),this.position=t,this._visitedParent=n.parent,Wo("elementStart",n,e,t,1)}}function Wo(o,e,t,n,i){return{done:!1,value:{type:o,item:e,previousPosition:t,nextPosition:n,length:i}}}class fe{constructor(e,t,n="toNone"){if(!e.is("element")&&!e.is("documentFragment"))throw new T.a("model-position-root-invalid",e);if(!(t instanceof Array)||t.length===0)throw new T.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 T.a("model-position-path-incorrect",this,{position:this});if(e.is("$text"))throw new T.a("model-position-path-incorrect",this,{position:this});return e}get index(){return this.parent.offsetToIndex(this.offset)}get textNode(){return _s(this,this.parent)}get nodeAfter(){const e=this.parent;return wo(this,e,_s(this,e))}get nodeBefore(){const e=this.parent;return Qu(this,e,_s(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=z(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 Ki(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=z(this.path,e.path),n=typeof t=="string"?Math.min(this.path.length,e.path.length):t;return this.path.slice(0,n)}getCommonAncestor(e){const t=this.getAncestors(),n=e.getAncestors();let i=0;for(;t[i]==n[i]&&t[i];)i++;return i===0?null:t[i-1]}getShiftedBy(e){const t=this.clone(),n=t.offset+e;return t.offset=n<0?0:n,t}isAfter(e){return this.compareWith(e)=="after"}isBefore(e){return this.compareWith(e)=="before"}isEqual(e){return this.compareWith(e)=="same"}isTouching(e){let t=null,n=null;switch(this.compareWith(e)){case"same":return!0;case"before":t=fe._createAt(this),n=fe._createAt(e);break;case"after":t=fe._createAt(e),n=fe._createAt(this);break;default:return!1}let i=t.parent;for(;t.path.length+n.path.length;){if(t.isEqual(n))return!0;if(t.path.length>n.path.length){if(t.offset!==i.maxOffset)return!1;t.path=t.path.slice(0,-1),i=i.parent,t.offset++}else{if(n.offset!==0)return!1;n.path=n.path.slice(0,-1)}}}is(e){return e==="position"||e==="model:position"}hasSameParentAs(e){return this.root!==e.root?!1:z(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(z(e.getParentPath(),this.getParentPath())=="same"){if(e.offset<this.offset){if(e.offset+t>this.offset)return null;n.offset-=t}}else if(z(e.getParentPath(),this.getParentPath())=="prefix"){const i=e.path.length-1;if(e.offset<=this.path[i]){if(e.offset+t>this.path[i])return null;n.path[i]-=t}}return n}_getTransformedByInsertion(e,t){const n=fe._createAt(this);if(this.root!=e.root)return n;if(z(e.getParentPath(),this.getParentPath())=="same")(e.offset<this.offset||e.offset==this.offset&&this.stickiness!="toPrevious")&&(n.offset+=t);else if(z(e.getParentPath(),this.getParentPath())=="prefix"){const i=e.path.length-1;e.offset<=this.path[i]&&(n.path[i]+=t)}return n}_getTransformedByMove(e,t,n){if(t=t._getTransformedByDeletion(e,n),e.isEqual(t))return fe._createAt(this);const i=this._getTransformedByDeletion(e,n);return i===null||e.isEqual(this)&&this.stickiness=="toNext"||e.getShiftedBy(n).isEqual(this)&&this.stickiness=="toPrevious"?this._getCombined(e,t):i._getTransformedByInsertion(t,n)}_getCombined(e,t){const n=e.path.length-1,i=fe._createAt(t);return i.stickiness=this.stickiness,i.offset=i.offset+this.path[n]-e.offset,i.path=[...i.path,...this.path.slice(n+1)],i}toJSON(){return{root:this.root.toJSON(),path:Array.from(this.path),stickiness:this.stickiness}}clone(){return new this.constructor(this.root,this.path,this.stickiness)}static _createAt(e,t,n="toNone"){if(e instanceof fe)return new fe(e.root,e.path,e.stickiness);{const i=e;if(t=="end")t=i.maxOffset;else{if(t=="before")return this._createBefore(i,n);if(t=="after")return this._createAfter(i,n);if(t!==0&&!t)throw new T.a("model-createpositionat-offset-required",[this,e])}if(!i.is("element")&&!i.is("documentFragment"))throw new T.a("model-position-parent-incorrect",[this,e]);const r=i.getPath();return r.push(t),new this(i.root,r,n)}}static _createAfter(e,t){if(!e.parent)throw new T.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 T.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 T.a("model-position-fromjson-no-root",t,{rootName:e.root});return new fe(t.getRoot(e.root),e.path,e.stickiness)}}function _s(o,e){const t=e.getChild(e.offsetToIndex(o.offset));return t&&t.is("$text")&&t.startOffset<o.offset?t:null}function wo(o,e,t){return t!==null?null:e.getChild(e.offsetToIndex(o.offset))}function Qu(o,e,t){return t!==null?null:e.getChild(e.offsetToIndex(o.offset)-1)}class re{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 Ki({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return z(this.start.getParentPath(),this.end.getParentPath())=="same"}get root(){return this.start.root}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,t=!1){e.isCollapsed&&(t=!1);const n=this.containsPosition(e.start)||t&&this.start.isEqual(e.start),i=this.containsPosition(e.end)||t&&this.end.isEqual(e.end);return n&&i}containsItem(e){const t=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 re(this.start,e.start)),this.containsPosition(e.end)&&t.push(new re(e.end,this.end))):t.push(new re(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 re(t,n)}return null}getJoined(e,t=!1){let n=this.isIntersecting(e);if(n||(n=this.start.isBefore(e.start)?t?this.end.isTouching(e.start):this.end.isEqual(e.start):t?e.end.isTouching(this.start):e.end.isEqual(this.start)),!n)return null;let i=this.start,r=this.end;return e.start.isBefore(i)&&(i=e.start),e.end.isAfter(r)&&(r=e.end),new re(i,r)}getMinimalFlatRanges(){const e=[],t=this.start.getCommonPath(this.end).length,n=fe._createAt(this.start);let i=n.parent;for(;n.path.length>t+1;){const r=i.maxOffset-n.offset;r!==0&&e.push(new re(n,n.getShiftedBy(r))),n.path=n.path.slice(0,-1),n.offset++,i=i.parent}for(;n.path.length<=this.end.path.length;){const r=this.end.path[n.path.length-1],a=r-n.offset;a!==0&&e.push(new re(n,n.getShiftedBy(a))),n.offset=r,n.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new Ki(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new Ki(e);for(const n of t)yield n.item}*getPositions(e={}){e.boundaries=this;const t=new Ki(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 re(this.start,this.end)]}getTransformedByOperations(e){const t=[new re(this.start,this.end)];for(const n of e)for(let i=0;i<t.length;i++){const r=t[i].getTransformedByOperation(n);t.splice(i,1,...r),i+=r.length-1}for(let n=0;n<t.length;n++){const i=t[n];for(let r=n+1;r<t.length;r++){const a=t[r];(i.containsRange(a)||a.containsRange(i)||i.isEqual(a))&&t.splice(r,1)}}return t}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;const e=this.start.nodeAfter,t=this.end.nodeBefore;return e&&e.is("element")&&e===t?e:null}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}clone(){return new this.constructor(this.start,this.end)}_getTransformedByInsertOperation(e,t=!1){return this._getTransformedByInsertion(e.position,e.howMany,t)}_getTransformedByMoveOperation(e,t=!1){const n=e.sourcePosition,i=e.howMany,r=e.targetPosition;return this._getTransformedByMove(n,r,i,t)}_getTransformedBySplitOperation(e){const t=this.start._getTransformedBySplitOperation(e);let n=this.end._getTransformedBySplitOperation(e);return this.end.isEqual(e.insertionPosition)&&(n=this.end.getShiftedBy(1)),t.root!=n.root&&(n=this.end.getShiftedBy(-1)),new re(t,n)}_getTransformedByMergeOperation(e){if(this.start.isEqual(e.targetPosition)&&this.end.isEqual(e.deletionPosition))return new re(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 re(t,n)):new re(t,n)}_getTransformedByInsertion(e,t,n=!1){if(n&&this.containsPosition(e))return[new re(this.start,e),new re(e.getShiftedBy(t),this.end._getTransformedByInsertion(e,t))];{const i=new re(this.start,this.end);return i.start=i.start._getTransformedByInsertion(e,t),i.end=i.end._getTransformedByInsertion(e,t),[i]}}_getTransformedByMove(e,t,n,i=!1){if(this.isCollapsed){const b=this.start._getTransformedByMove(e,t,n);return[new re(b)]}const r=re._createFromPositionAndShift(e,n),a=t._getTransformedByDeletion(e,n);if(this.containsPosition(t)&&!i&&(r.containsPosition(this.start)||r.containsPosition(this.end))){const b=this.start._getTransformedByMove(e,t,n),x=this.end._getTransformedByMove(e,t,n);return[new re(b,x)]}let l;const d=this.getDifference(r);let h=null;const p=this.getIntersection(r);if(d.length==1?h=new re(d[0].start._getTransformedByDeletion(e,n),d[0].end._getTransformedByDeletion(e,n)):d.length==2&&(h=new re(this.start,this.end._getTransformedByDeletion(e,n))),l=h?h._getTransformedByInsertion(a,n,p!==null||i):[],p){const b=new re(p.start._getCombined(r.start,a),p.end._getCombined(r.start,a));l.length==2?l.splice(1,0,b):l.push(b)}return l}_getTransformedByDeletion(e,t){let n=this.start._getTransformedByDeletion(e,t),i=this.end._getTransformedByDeletion(e,t);return n==null&&i==null?null:(n==null&&(n=e),i==null&&(i=e),new re(n,i))}static _createFromPositionAndShift(e,t){const n=e,i=e.getShiftedBy(t);return t>0?new this(n,i):new this(i,n)}static _createIn(e){return new this(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 T.a("range-create-from-ranges-empty-array",null);if(e.length==1)return e[0].clone();const t=e[0];e.sort((r,a)=>r.start.isAfter(a.start)?1:-1);const n=e.indexOf(t),i=new this(t.start,t.end);if(n>0)for(let r=n-1;e[r].end.isEqual(i.start);r++)i.start=fe._createAt(e[r].start);for(let r=n+1;r<e.length&&e[r].start.isEqual(i.end);r++)i.end=fe._createAt(e[r].end);return i}static fromJSON(e,t){return new this(fe.fromJSON(e.start,t),fe.fromJSON(e.end,t))}}class Ba{constructor(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._viewToModelLengthCallbacks=new Map,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this.on("modelToViewPosition",(e,t)=>{if(t.viewPosition)return;const n=this._modelToViewMapping.get(t.modelPosition.parent);t.viewPosition=this.findPositionIn(n,t.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(e,t)=>{if(t.modelPosition)return;const n=this.findMappedViewAncestor(t.viewPosition),i=this._viewToModelMapping.get(n),r=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,n);t.modelPosition=fe._createAt(i,r)},{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e){const t=this.toModelElement(e);if(this._viewToModelMapping.delete(e),this._elementToMarkerNames.has(e))for(const n of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(n);this._modelToViewMapping.get(t)==e&&this._modelToViewMapping.delete(t)}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e&&this._viewToModelMapping.delete(t)}bindElementToMarker(e,t){const n=this._markerNameToElements.get(t)||new Set;n.add(e);const i=this._elementToMarkerNames.get(e)||new Set;i.add(t),this._markerNameToElements.set(t,n),this._elementToMarkerNames.set(e,i)}unbindElementFromMarkerName(e,t){const n=this._markerNameToElements.get(t);n&&(n.delete(e),n.size==0&&this._markerNameToElements.delete(t));const i=this._elementToMarkerNames.get(e);i&&(i.delete(t),i.size==0&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new re(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new et(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={isPhantom:!1}){const n={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const n=new Set;for(const i of t)if(i.is("attributeElement"))for(const r of i.getElementsWithSameId())n.add(r);else n.add(i);return n}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,n){if(n!=e)return this._toModelOffset(e.parent,e.index,n)+this._toModelOffset(e,t,e);if(e.is("$text"))return t;let i=0;for(let r=0;r<t;r++)i+=this.getModelLength(e.getChild(r));return i}getModelLength(e){if(this._viewToModelLengthCallbacks.get(e.name))return this._viewToModelLengthCallbacks.get(e.name)(e);if(this._viewToModelMapping.has(e))return 1;if(e.is("$text"))return e.data.length;if(e.is("uiElement"))return 0;{let t=0;for(const n of e.getChildren())t+=this.getModelLength(n);return t}}findPositionIn(e,t){let n,i=0,r=0,a=0;if(e.is("$text"))return new _e(e,t);for(;r<t;)n=e.getChild(a),i=this.getModelLength(n),r+=i,a++;return r==t?this._moveViewPositionToTextNode(new _e(e,a)):this.findPositionIn(n,t-(r-i))}_moveViewPositionToTextNode(e){const t=e.nodeBefore,n=e.nodeAfter;return t instanceof Ce?new _e(t,t.data.length):n instanceof Ce?new _e(n,0):e}}ze(Ba,j);class pc{constructor(){this._consumable=new Map,this._textProxyRegistry=new Map}add(e,t){t=gc(t),e instanceof Wi&&(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=gc(t),e instanceof Wi&&(e=this._getSymbolForTextProxy(e)),!!this.test(e,t)&&(this._consumable.get(e).set(t,!1),!0)}test(e,t){t=gc(t),e instanceof Wi&&(e=this._getSymbolForTextProxy(e));const n=this._consumable.get(e);if(n===void 0)return null;const i=n.get(t);return i===void 0?null:i}revert(e,t){t=gc(t),e instanceof Wi&&(e=this._getSymbolForTextProxy(e));const n=this.test(e,t);return n===!1?(this._consumable.get(e).set(t,!0),!0):n!==!0&&null}_getSymbolForTextProxy(e){let t=null;const n=this._textProxyRegistry.get(e.startOffset);if(n){const i=n.get(e.endOffset);i&&(t=i.get(e.parent))}return t||(t=this._addSymbolForTextProxy(e.startOffset,e.endOffset,e.parent)),t}_addSymbolForTextProxy(e,t,n){const i=Symbol("textProxySymbol");let r,a;return r=this._textProxyRegistry.get(e),r||(r=new Map,this._textProxyRegistry.set(e,r)),a=r.get(t),a||(a=new Map,r.set(t,a)),a.set(n,i),i}}function gc(o){const e=o.split(":");return e[0]=="addMarker"||e[0]=="removeMarker"?o:e.length>1?e[0]+":"+e[1]:e[0]}class Yu{constructor(e){this.conversionApi=Object.assign({dispatcher:this},e),this._reconversionEventsMapping=new Map}convertChanges(e,t,n){for(const r of e.getMarkersToRemove())this.convertMarkerRemove(r.name,r.range,n);const i=this._mapChangesWithAutomaticReconversion(e);for(const r of i)r.type==="insert"?this.convertInsert(re._createFromPositionAndShift(r.position,r.length),n):r.type==="remove"?this.convertRemove(r.position,r.length,r.name,n):r.type==="reconvert"?this.reconvertElement(r.element,n):this.convertAttribute(r.range,r.attributeKey,r.attributeOldValue,r.attributeNewValue,n);for(const r of this.conversionApi.mapper.flushUnboundMarkerNames()){const a=t.get(r).getRange();this.convertMarkerRemove(r,a,n),this.convertMarkerAdd(r,a,n)}for(const r of e.getMarkersToAdd())this.convertMarkerAdd(r.name,r.range,n)}convertInsert(e,t){this.conversionApi.writer=t,this.conversionApi.consumable=this._createInsertConsumable(e);for(const n of Array.from(e).map(Ju))this._convertInsertWithAttributes(n);this._clearConversionApi()}convertRemove(e,t,n,i){this.conversionApi.writer=i,this.fire("remove:"+n,{position:e,length:t},this.conversionApi),this._clearConversionApi()}convertAttribute(e,t,n,i,r){this.conversionApi.writer=r,this.conversionApi.consumable=this._createConsumableForRange(e,"attribute:"+t);for(const a of e){const l={item:a.item,range:re._createFromPositionAndShift(a.previousPosition,a.length),attributeKey:t,attributeOldValue:n,attributeNewValue:i};this._testAndFire("attribute:"+t,l)}this._clearConversionApi()}reconvertElement(e,t){const n=re._createOn(e);this.conversionApi.writer=t,this.conversionApi.consumable=this._createInsertConsumable(n);const i=this.conversionApi.mapper,r=i.toViewElement(e);t.remove(r),this._convertInsertWithAttributes({item:e,range:n});const a=i.toViewElement(e);for(const l of re._createIn(e)){const{item:d}=l,h=im(d,i);h?h.root!==a.root&&t.move(t.createRangeOn(h),i.toViewPosition(fe._createBefore(d))):this._convertInsertWithAttributes(Ju(l))}i.unbindViewElement(r),this._clearConversionApi()}convertSelection(e,t,n){const i=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));if(this.conversionApi.writer=n,this.conversionApi.consumable=this._createSelectionConsumable(e,i),this.fire("selection",{selection:e},this.conversionApi),e.isCollapsed){for(const r of i){const a=r.getRange();if(!tf(e.getFirstPosition(),r,this.conversionApi.mapper))continue;const l={item:e,markerName:r.name,markerRange:a};this.conversionApi.consumable.test(e,"addMarker:"+r.name)&&this.fire("addMarker:"+r.name,l,this.conversionApi)}for(const r of e.getAttributeKeys()){const a={item:e,range:e.getFirstRange(),attributeKey:r,attributeOldValue:null,attributeNewValue:e.getAttribute(r)};this.conversionApi.consumable.test(e,"attribute:"+a.attributeKey)&&this.fire("attribute:"+a.attributeKey+":$text",a,this.conversionApi)}this._clearConversionApi()}else this._clearConversionApi()}convertMarkerAdd(e,t,n){if(t.root.rootName=="$graveyard")return;this.conversionApi.writer=n;const i="addMarker:"+e,r=new pc;if(r.add(t,i),this.conversionApi.consumable=r,this.fire(i,{markerName:e,markerRange:t},this.conversionApi),r.test(t,i)){this.conversionApi.consumable=this._createConsumableForRange(t,i);for(const a of t.getItems()){if(!this.conversionApi.consumable.test(a,i))continue;const l={item:a,range:re._createOn(a),markerName:e,markerRange:t};this.fire(i,l,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 pc;for(const n of e){const i=n.item;t.add(i,"insert");for(const r of i.getAttributeKeys())t.add(i,"attribute:"+r)}return t}_createConsumableForRange(e,t){const n=new pc;for(const i of e.getItems())n.add(i,t);return n}_createSelectionConsumable(e,t){const n=new pc;n.add(e,"selection");for(const i of t)n.add(e,"addMarker:"+i.name);for(const i of e.getAttributeKeys())n.add(e,"attribute:"+i);return n}_testAndFire(e,t){this.conversionApi.consumable.test(t.item,e)&&this.fire(function(n,i){const r=i.item.name||"$text";return`${n}:${r}`}(e,t),t,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}_convertInsertWithAttributes(e){this._testAndFire("insert",e);for(const t of e.item.getAttributeKeys())e.attributeKey=t,e.attributeOldValue=null,e.attributeNewValue=e.item.getAttribute(t),this._testAndFire("attribute:"+t,e)}_mapChangesWithAutomaticReconversion(e){const t=new Set,n=[];for(const i of e.getChanges()){const r=i.position||i.range.start,a=r.parent;if(_s(r,a)){n.push(i);continue}const l=i.type==="attribute"?wo(r,a,null):a;if(l.is("$text")){n.push(i);continue}let d;if(d=i.type==="attribute"?`attribute:${i.attributeKey}:${l.name}`:`${i.type}:${i.name}`,this._isReconvertTriggerEvent(d,l.name)){if(t.has(l))continue;t.add(l),n.push({type:"reconvert",element:l})}else n.push(i)}return n}_isReconvertTriggerEvent(e,t){return this._reconversionEventsMapping.get(e)===t}}function tf(o,e,t){const n=e.getRange(),i=Array.from(o.getAncestors());return i.shift(),i.reverse(),!i.some(r=>{if(n.containsItem(r))return!!t.toViewElement(r).getCustomProperty("addHighlight")})}function Ju(o){return{item:o.item,range:re._createFromPositionAndShift(o.previousPosition,o.length)}}function im(o,e){if(o.is("textProxy")){const t=e.toViewPosition(fe._createBefore(o)).parent;return t.is("$text")?t:null}return e.toViewElement(o)}ze(Yu,j);class _o{constructor(e,t,n){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,e&&this.setTo(e,t,n)}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){return this._ranges.length===1&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const i of e._ranges)if(t.isEqual(i)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new re(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 re(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 re(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 _o)this._setRanges(e.getRanges(),e.isBackward);else if(e&&typeof e.getRanges=="function")this._setRanges(e.getRanges(),e.isBackward);else if(e instanceof re)this._setRanges([e],!!t&&!!t.backward);else if(e instanceof fe)this._setRanges([new re(e)]);else if(e instanceof mr){const i=!!n&&!!n.backward;let r;if(t=="in")r=re._createIn(e);else if(t=="on")r=re._createOn(e);else{if(t===void 0)throw new T.a("model-selection-setto-required-second-parameter",[this,e]);r=new re(fe._createAt(e,t))}this._setRanges([r],i)}else{if(!Wn(e))throw new T.a("model-selection-setto-not-selectable",[this,e]);this._setRanges(e,t&&!!t.backward)}}_setRanges(e,t=!1){const n=(e=Array.from(e)).some(i=>{if(!(i instanceof re))throw new T.a("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every(r=>!r.isEqual(i))});if(e.length!==this._ranges.length||n){this._removeAllRanges();for(const i of e)this._pushRange(i);this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0})}}setFocus(e,t){if(this.anchor===null)throw new T.a("model-selection-setfocus-no-ranges",[this,e]);const n=fe._createAt(e,t);if(n.compareWith(this.focus)=="same")return;const i=this.anchor;this._ranges.length&&this._popRange(),n.compareWith(i)=="before"?(this._pushRange(new re(n,i)),this._lastRangeBackward=!0):(this._pushRange(new re(i,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}is(e){return e==="selection"||e==="model:selection"}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const n=qi(t.start,e);n&&Xu(n,t)&&(yield n);for(const r of t.getWalker()){const a=r.item;r.type=="elementEnd"&&ii(a,e,t)&&(yield a)}const i=qi(t.end,e);i&&!t.end.isTouching(fe._createAt(i,0))&&Xu(i,t)&&(yield i)}}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 re(e.start,e.end))}_checkRange(e){for(let t=0;t<this._ranges.length;t++)if(e.isIntersecting(this._ranges[t]))throw new T.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 Zu(o,e){return!e.has(o)&&(e.add(o),o.root.document.model.schema.isBlock(o)&&o.parent)}function ii(o,e,t){return Zu(o,e)&&Xu(o,t)}function qi(o,e){const t=o.parent.root.document.model.schema,n=o.parent.getAncestors({parentFirst:!0,includeSelf:!0});let i=!1;const r=n.find(a=>!i&&(i=t.isLimit(a),!i&&Zu(a,e)));return n.forEach(a=>e.add(a)),r}function Xu(o,e){const t=function(n){const i=n.root.document.model.schema;let r=n.parent;for(;r;){if(i.isBlock(r))return r;r=r.parent}}(o);return t?!e.containsRange(re._createOn(t),!0):!0}ze(_o,j);class ko extends re{constructor(e,t){super(e,t),mc.call(this)}detach(){this.stopListening()}is(e){return e==="liveRange"||e==="model:liveRange"||e=="range"||e==="model:range"}toRange(){return new re(this.start,this.end)}static fromRange(e){return new ko(e.start,e.end)}}function mc(){this.listenTo(this.root.document.model,"applyOperation",(o,e)=>{const t=e[0];t.isDocumentOperation&&ks.call(this,t)},{priority:"low"})}function ks(o){const e=this.getTransformedByOperation(o),t=re._createFromRanges(e),n=!t.isEqual(this),i=function(a,l){switch(l.type){case"insert":return a.containsPosition(l.position);case"move":case"remove":case"reinsert":case"merge":return a.containsPosition(l.sourcePosition)||a.start.isEqual(l.sourcePosition)||a.containsPosition(l.targetPosition);case"split":return a.containsPosition(l.splitPosition)||a.containsPosition(l.insertionPosition)}return!1}(this,o);let r=null;if(n){t.root.rootName=="$graveyard"&&(r=o.type=="remove"?o.sourcePosition:o.deletionPosition);const a=this.toRange();this.start=t.start,this.end=t.end,this.fire("change:range",a,{deletionPosition:r})}else i&&this.fire("change:content",this.toRange(),{deletionPosition:r})}ze(ko,j);class Di{constructor(e){this._selection=new nf(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:")}}ze(Di,j);class nf extends _o{constructor(e){super(),this.markers=new Xn({idProperty:"name"}),this._model=e.model,this._document=e,this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this.listenTo(this._model,"applyOperation",(t,n)=>{const i=n[0];i.isDocumentOperation&&i.type!="marker"&&i.type!="rename"&&i.type!="noop"&&(this._ranges.length==0&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{for(const t of this.getRanges())if(!this._document._validateSelectionRange(t))throw new T.a("document-selection-wrong-position",this,{range:t})}),this.listenTo(this._model.markers,"update",(t,n,i,r)=>{this._updateMarker(n,r)}),this.listenTo(this._document,"change",(t,n)=>{(function(i,r){const a=i.document.differ;for(const l of a.getChanges()){if(l.type!="insert")continue;const d=l.position.parent;l.length===d.maxOffset&&i.enqueueChange(r,h=>{const p=Array.from(d.getAttributeKeys()).filter(b=>b.startsWith("selection:"));for(const b of p)h.removeAttribute(b,d)})}})(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=M();return this._overriddenGravityRegister.add(e),this._overriddenGravityRegister.size===1&&this._updateAttributes(!0),e}restoreGravity(e){if(!this._overriddenGravityRegister.has(e))throw new T.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=ko.fromRange(e);return t.on("change:range",(n,i,r)=>{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=r.deletionPosition;const a=this._ranges.indexOf(t);this._ranges.splice(a,1),t.detach()}}),t}_updateMarkers(){if(!this._observedMarkers.size)return;const e=[];let t=!1;for(const i of this._model.markers){const r=i.name.split(":",1)[0];if(!this._observedMarkers.has(r))continue;const a=i.getRange();for(const l of this.getRanges())a.containsRange(l,!l.isCollapsed)&&e.push(i)}const n=Array.from(this.markers);for(const i of e)this.markers.has(i)||(this.markers.add(i),t=!0);for(const i of Array.from(this.markers))e.includes(i)||(this.markers.remove(i),t=!0);t&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateMarker(e,t){const n=e.name.split(":",1)[0];if(!this._observedMarkers.has(n))return;let i=!1;const r=Array.from(this.markers),a=this.markers.has(e);if(t){let l=!1;for(const d of this.getRanges())if(t.containsRange(d,!d.isCollapsed)){l=!0;break}l&&!a?(this.markers.add(e),i=!0):!l&&a&&(this.markers.remove(e),i=!0)}else a&&(this.markers.remove(e),i=!0);i&&this.fire("change:marker",{oldMarkers:r,directChange:!1})}_updateAttributes(e){const t=Ke(this._getSurroundingAttributes()),n=Ke(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[r,a]of this._attributePriority)a=="low"&&(this._attrs.delete(r),this._attributePriority.delete(r));this._setAttributesTo(t);const i=[];for(const[r,a]of this.getAttributes())n.has(r)&&n.get(r)===a||i.push(r);for(const[r]of n)this.hasAttribute(r)||i.push(r);i.length>0&&this.fire("change:attribute",{attributeKeys:i,directChange:!1})}_setAttribute(e,t,n=!0){const i=n?"normal":"low";return i=="low"&&this._attributePriority.get(e)=="normal"?!1:super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,i),!0)}_removeAttribute(e,t=!0){const n=t?"normal":"low";return(n!="low"||this._attributePriority.get(e)!="normal")&&(this._attributePriority.set(e,n),!!super.hasAttribute(e)&&(this._attrs.delete(e),!0))}_setAttributesTo(e){const t=new Set;for(const[n,i]of this.getAttributes())e.get(n)!==i&&this._removeAttribute(n,!1);for(const[n,i]of e)this._setAttribute(n,i,!1)&&t.add(n);return t}*_getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())t.startsWith("selection:")&&(yield[t.substr(10),e.getAttribute(t)])}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;let n=null;if(this.isCollapsed){const i=e.textNode?e.textNode:e.nodeBefore,r=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(n=bc(i)),n||(n=bc(r)),!this.isGravityOverridden&&!n){let a=i;for(;a&&!t.isInline(a)&&!n;)a=a.previousSibling,n=bc(a)}if(!n){let a=r;for(;a&&!t.isInline(a)&&!n;)a=a.nextSibling,n=bc(a)}n||(n=this._getStoredAttributes())}else{const i=this.getFirstRange();for(const r of i){if(r.item.is("element")&&t.isObject(r.item))break;if(r.type=="text"){n=r.item.getAttributes();break}}}return n}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}}function bc(o){return o instanceof Wi||o instanceof Dt?o.getAttributes():null}class ed{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}var Gn=function(o){return Rr(o,5)};class Ha extends ed{elementToElement(e){return this.add(function(t){return(t=Gn(t)).view=$a(t.view,"container"),n=>{var i;if(n.on("insert:"+t.model,(i=t.view,(r,a,l)=>{const d=i(a.item,l);if(!d||!l.consumable.consume(a.item,"insert"))return;const h=l.mapper.toViewPosition(a.range.start);l.mapper.bindElements(a.item,d),l.writer.insert(h,d)}),{priority:t.converterPriority||"normal"}),t.triggerBy){if(t.triggerBy.attributes)for(const r of t.triggerBy.attributes)n._mapReconversionTriggerEvent(t.model,`attribute:${r}:${t.model}`);if(t.triggerBy.children)for(const r of t.triggerBy.children)n._mapReconversionTriggerEvent(t.model,"insert:"+r),n._mapReconversionTriggerEvent(t.model,"remove:"+r)}}}(e))}attributeToElement(e){return this.add(function(t){t=Gn(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 r of t.model.values)t.view[r]=$a(t.view[r],"attribute");else t.view=$a(t.view,"attribute");const i=Ua(t);return r=>{r.on(n,function(a){return(l,d,h)=>{const p=a(d.attributeOldValue,h),b=a(d.attributeNewValue,h);if(!p&&!b||!h.consumable.consume(d.item,l.name))return;const x=h.writer,E=x.document.selection;if(d.item instanceof _o||d.item instanceof Di)x.wrap(E.getFirstRange(),b);else{let P=h.mapper.toViewRange(d.range);d.attributeOldValue!==null&&p&&(P=x.unwrap(P,p)),d.attributeNewValue!==null&&b&&x.wrap(P,b)}}}(i),{priority:t.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(t){t=Gn(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 r of t.model.values)t.view[r]=nd(t.view[r]);else t.view=nd(t.view);const i=Ua(t);return r=>{var a;r.on(n,(a=i,(l,d,h)=>{const p=a(d.attributeOldValue,h),b=a(d.attributeNewValue,h);if(!p&&!b||!h.consumable.consume(d.item,l.name))return;const x=h.mapper.toViewElement(d.item),E=h.writer;if(!x)throw new T.a("conversion-attribute-to-attribute-on-text",[d,h]);if(d.attributeOldValue!==null&&p)if(p.key=="class"){const P=Tt(p.value);for(const D of P)E.removeClass(D,x)}else if(p.key=="style"){const P=Object.keys(p.value);for(const D of P)E.removeStyle(D,x)}else E.removeAttribute(p.key,x);if(d.attributeNewValue!==null&&b)if(b.key=="class"){const P=Tt(b.value);for(const D of P)E.addClass(D,x)}else if(b.key=="style"){const P=Object.keys(b.value);for(const D of P)E.setStyle(D,b.value[D],x)}else E.setAttribute(b.key,b.value,x)}),{priority:t.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(t){return(t=Gn(t)).view=$a(t.view,"ui"),n=>{var i;n.on("addMarker:"+t.model,(i=t.view,(r,a,l)=>{a.isOpening=!0;const d=i(a,l);a.isOpening=!1;const h=i(a,l);if(!d||!h)return;const p=a.markerRange;if(p.isCollapsed&&!l.consumable.consume(p,r.name))return;for(const E of p)if(!l.consumable.consume(E.item,r.name))return;const b=l.mapper,x=l.writer;x.insert(b.toViewPosition(p.start),d),l.mapper.bindElementToMarker(d,a.markerName),p.isCollapsed||(x.insert(b.toViewPosition(p.end),h),l.mapper.bindElementToMarker(h,a.markerName)),r.stop()}),{priority:t.converterPriority||"normal"}),n.on("removeMarker:"+t.model,(t.view,(r,a,l)=>{const d=l.mapper.markerNameToElements(a.markerName);if(d){for(const h of d)l.mapper.unbindElementFromMarkerName(h,a.markerName),l.writer.clear(l.writer.createRangeOn(h),h);l.writer.clearClonedElementsGroup(a.markerName),r.stop()}}),{priority:t.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(t){return n=>{var i;n.on("addMarker:"+t.model,(i=t.view,(r,a,l)=>{if(!a.item||!(a.item instanceof _o||a.item instanceof Di||a.item.is("$textProxy")))return;const d=ys(i,a,l);if(!d||!l.consumable.consume(a.item,r.name))return;const h=l.writer,p=of(h,d),b=h.document.selection;if(a.item instanceof _o||a.item instanceof Di)h.wrap(b.getFirstRange(),p,b);else{const x=l.mapper.toViewRange(a.range),E=h.wrap(x,p);for(const P of E.getItems())if(P.is("attributeElement")&&P.isSimilar(p)){l.mapper.bindElementToMarker(P,a.markerName);break}}}),{priority:t.converterPriority||"normal"}),n.on("addMarker:"+t.model,function(r){return(a,l,d)=>{if(!l.item||!(l.item instanceof Ot))return;const h=ys(r,l,d);if(!h||!d.consumable.test(l.item,a.name))return;const p=d.mapper.toViewElement(l.item);if(p&&p.getCustomProperty("addHighlight")){d.consumable.consume(l.item,a.name);for(const b of re._createIn(l.item))d.consumable.consume(b.item,a.name);p.getCustomProperty("addHighlight")(p,h,d.writer),d.mapper.bindElementToMarker(p,l.markerName)}}}(t.view),{priority:t.converterPriority||"normal"}),n.on("removeMarker:"+t.model,function(r){return(a,l,d)=>{if(l.markerRange.isCollapsed)return;const h=ys(r,l,d);if(!h)return;const p=of(d.writer,h),b=d.mapper.markerNameToElements(l.markerName);if(b){for(const x of b)d.mapper.unbindElementFromMarkerName(x,l.markerName),x.is("attributeElement")?d.writer.unwrap(d.writer.createRangeOn(x),p):x.getCustomProperty("removeHighlight")(x,h.id,d.writer);d.writer.clearClonedElementsGroup(l.markerName),a.stop()}}}(t.view),{priority:t.converterPriority||"normal"})}}(e))}markerToData(e){return this.add(function(t){const n=(t=Gn(t)).model;return t.view||(t.view=i=>({group:n,name:i.substr(t.model.length+1)})),i=>{var r;i.on("addMarker:"+n,(r=t.view,(a,l,d)=>{const h=r(l.markerName,d);if(!h)return;const p=l.markerRange;d.consumable.consume(p,a.name)&&(td(p,!1,d,l,h),td(p,!0,d,l,h),a.stop())}),{priority:t.converterPriority||"normal"}),i.on("removeMarker:"+n,function(a){return(l,d,h)=>{const p=a(d.markerName,h);if(!p)return;const b=h.mapper.markerNameToElements(d.markerName);if(b){for(const E of b)h.mapper.unbindElementFromMarkerName(E,d.markerName),E.is("containerElement")?(x(`data-${p.group}-start-before`,E),x(`data-${p.group}-start-after`,E),x(`data-${p.group}-end-before`,E),x(`data-${p.group}-end-after`,E)):h.writer.clear(h.writer.createRangeOn(E),E);h.writer.clearClonedElementsGroup(d.markerName),l.stop()}function x(E,P){if(P.hasAttribute(E)){const D=new Set(P.getAttribute(E).split(","));D.delete(p.name),D.size==0?h.writer.removeAttribute(E,P):h.writer.setAttribute(E,Array.from(D).join(","),P)}}}}(t.view),{priority:t.converterPriority||"normal"})}}(e))}}function of(o,e){const t=o.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 td(o,e,t,n,i){const r=e?o.start:o.end,a=r.nodeAfter&&r.nodeAfter.is("element")?r.nodeAfter:null,l=r.nodeBefore&&r.nodeBefore.is("element")?r.nodeBefore:null;if(a||l){let d,h;e&&a||!e&&!l?(d=a,h=!0):(d=l,h=!1);const p=t.mapper.toViewElement(d);if(p)return void function(b,x,E,P,D,R){const H=`data-${R.group}-${x?"start":"end"}-${E?"before":"after"}`,Q=b.hasAttribute(H)?b.getAttribute(H).split(","):[];Q.unshift(R.name),P.writer.setAttribute(H,Q.join(","),b),P.mapper.bindElementToMarker(b,D.markerName)}(p,e,h,t,n,i)}(function(d,h,p,b,x){const E=`${x.group}-${h?"start":"end"}`,P=x.name?{name:x.name}:null,D=p.writer.createUIElement(E,P);p.writer.insert(d,D),p.mapper.bindElementToMarker(D,b.markerName)})(t.mapper.toViewPosition(r),e,t,n,i)}function $a(o,e){return typeof o=="function"?o:(t,n)=>function(i,r,a){typeof i=="string"&&(i={name:i});let l;const d=r.writer,h=Object.assign({},i.attributes);if(a=="container")l=d.createContainerElement(i.name,h);else if(a=="attribute"){const p={priority:i.priority||fo.DEFAULT_PRIORITY};l=d.createAttributeElement(i.name,h,p)}else l=d.createUIElement(i.name,h);if(i.styles){const p=Object.keys(i.styles);for(const b of p)d.setStyle(b,i.styles[b],l)}if(i.classes){const p=i.classes;if(typeof p=="string")d.addClass(p,l);else for(const b of p)d.addClass(b,l)}return l}(o,n,e)}function Ua(o){return o.model.values?(e,t)=>{const n=o.view[e];return n?n(e,t):null}:o.view}function nd(o){return typeof o=="string"?e=>({key:o,value:e}):typeof o=="object"?o.value?()=>o:e=>({key:o.key,value:e}):o}function ys(o,e,t){const n=typeof o=="function"?o(e,t):o;return n?(n.priority||(n.priority=10),n.id||(n.id=e.markerName),n):null}function vc(o){const{schema:e,document:t}=o.model;for(const n of t.getRootNames()){const i=t.getRoot(n);if(i.isEmpty&&!e.checkChild(i,"$text")&&e.checkChild(i,"paragraph"))return o.insertElement("paragraph",i),!0}return!1}function Wa(o,e,t){const n=t.createContext(o);return!!t.checkChild(n,"paragraph")&&!!t.checkChild(n.push("paragraph"),e)}function rf(o,e){const t=e.createElement("paragraph");return e.insert(t,o),e.createPositionAt(t,0)}class sf extends ed{elementToElement(e){return this.add(Ka(e))}elementToAttribute(e){return this.add(function(t){af(t=Gn(t));const n=id(t,!1),i=wc(t.view),r=i?"element:"+i:"element";return a=>{a.on(r,n,{priority:t.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(t){t=Gn(t);let n=null;(typeof t.view=="string"||t.view.key)&&(n=function(r){typeof r.view=="string"&&(r.view={key:r.view});const a=r.view.key;let l;if(a=="class"||a=="style")l={[a=="class"?"classes":"styles"]:r.view.value};else{const d=r.view.value===void 0?/[\s\S]*/:r.view.value;l={attributes:{[a]:d}}}return r.view.name&&(l.name=r.view.name),r.view=l,a}(t)),af(t,n);const i=id(t,!0);return r=>{r.on("element",i,{priority:t.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add(function(t){return function(n){const i=n.model;n.model=(r,a)=>{const l=typeof i=="string"?i:i(r,a);return a.writer.createElement("$marker",{"data-name":l})}}(t=Gn(t)),Ka(t)}(e))}dataToMarker(e){return this.add(function(t){(t=Gn(t)).model||(t.model=r=>r?t.view+":"+r:t.view);const n=qa(yo(t,"start")),i=qa(yo(t,"end"));return r=>{r.on("element:"+t.view+"-start",n,{priority:t.converterPriority||"normal"}),r.on("element:"+t.view+"-end",i,{priority:t.converterPriority||"normal"});const a=B.get("low"),l=B.get("highest"),d=B.get(t.converterPriority)/l;r.on("element",function(h){return(p,b,x)=>{const E="data-"+h.view;function P(D,R){for(const H of R){const Q=h.model(H,x),ae=x.writer.createElement("$marker",{"data-name":Q});x.writer.insert(ae,D),b.modelCursor.isEqual(D)?b.modelCursor=b.modelCursor.getShiftedBy(1):b.modelCursor=b.modelCursor._getTransformedByInsertion(D,1),b.modelRange=b.modelRange._getTransformedByInsertion(D,1)[0]}}(x.consumable.test(b.viewItem,{attributes:E+"-end-after"})||x.consumable.test(b.viewItem,{attributes:E+"-start-after"})||x.consumable.test(b.viewItem,{attributes:E+"-end-before"})||x.consumable.test(b.viewItem,{attributes:E+"-start-before"}))&&(b.modelRange||Object.assign(b,x.convertChildren(b.viewItem,b.modelCursor)),x.consumable.consume(b.viewItem,{attributes:E+"-end-after"})&&P(b.modelRange.end,b.viewItem.getAttribute(E+"-end-after").split(",")),x.consumable.consume(b.viewItem,{attributes:E+"-start-after"})&&P(b.modelRange.end,b.viewItem.getAttribute(E+"-start-after").split(",")),x.consumable.consume(b.viewItem,{attributes:E+"-end-before"})&&P(b.modelRange.start,b.viewItem.getAttribute(E+"-end-before").split(",")),x.consumable.consume(b.viewItem,{attributes:E+"-start-before"})&&P(b.modelRange.start,b.viewItem.getAttribute(E+"-start-before").split(",")))}}(t),{priority:a+d})}}(e))}}function Ka(o){const e=qa(o=Gn(o)),t=wc(o.view),n=t?"element:"+t:"element";return i=>{i.on(n,e,{priority:o.converterPriority||"normal"})}}function wc(o){return typeof o=="string"?o:typeof o=="object"&&typeof o.name=="string"?o.name:null}function qa(o){const e=new Et(o.view);return(t,n,i)=>{const r=e.match(n.viewItem);if(!r)return;const a=r.match;if(a.name=!0,!i.consumable.test(n.viewItem,a))return;const l=function(d,h,p){return d instanceof Function?d(h,p):p.writer.createElement(d)}(o.model,n.viewItem,i);l&&i.safeInsert(l,n.modelCursor)&&(i.consumable.consume(n.viewItem,a),i.convertChildren(n.viewItem,l),i.updateConversionResult(l,n))}}function af(o,e=null){const t=e===null||(r=>r.getAttribute(e)),n=typeof o.model!="object"?o.model:o.model.key,i=typeof o.model!="object"||o.model.value===void 0?t:o.model.value;o.model={key:n,value:i}}function id(o,e){const t=new Et(o.view);return(n,i,r)=>{const a=t.match(i.viewItem);if(!a||(function(h,p){const b=typeof h=="function"?h(p):h;return typeof b=="object"&&!wc(b)?!1:!b.classes&&!b.attributes&&!b.styles}(o.view,i.viewItem)?a.match.name=!0:delete a.match.name,!r.consumable.test(i.viewItem,a.match)))return;const l=o.model.key,d=typeof o.model.value=="function"?o.model.value(i.viewItem,r):o.model.value;d!==null&&(i.modelRange||Object.assign(i,r.convertChildren(i.viewItem,i.modelCursor)),function(h,p,b,x){let E=!1;for(const P of Array.from(h.getItems({shallow:b})))x.schema.checkAttribute(P,p.key)&&(E=!0,P.hasAttribute(p.key)||x.writer.setAttribute(p.key,p.value,P));return E}(i.modelRange,{key:l,value:d},e,r)&&r.consumable.consume(i.viewItem,a.match))}}function yo(o,e){const t={};return t.view=o.view+"-"+e,t.model=(n,i)=>{const r=n.getAttribute("name"),a=o.model(r,i);return i.writer.createElement("$marker",{"data-name":a})},t}class od{constructor(e,t){this.model=e,this.view=new fc(t),this.mapper=new Ba,this.downcastDispatcher=new Yu({mapper:this.mapper,schema:e.schema});const n=this.model.document,i=n.selection,r=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,r,a),this.downcastDispatcher.convertSelection(i,r,a)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(a,l){return(d,h)=>{const p=h.newSelection,b=[];for(const E of p.getRanges())b.push(l.toModelRange(E));const x=a.createSelection(b,{backward:p.isBackward});x.isEqual(a.document.selection)||a.change(E=>{E.setSelection(x)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(a,l,d)=>{if(!d.consumable.consume(l.item,"insert"))return;const h=d.writer,p=d.mapper.toViewPosition(l.range.start),b=h.createText(l.item.data);h.insert(p,b)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(a,l,d)=>{const h=d.mapper.toViewPosition(l.position),p=l.position.getShiftedBy(l.length),b=d.mapper.toViewPosition(p,{isPhantom:!0}),x=d.writer.createRange(h,b),E=d.writer.remove(x.getTrimmed());for(const P of d.writer.createRangeIn(E).getItems())d.mapper.unbindViewElement(P)},{priority:"low"}),this.downcastDispatcher.on("selection",(a,l,d)=>{const h=d.writer,p=h.document.selection;for(const b of p.getRanges())b.isCollapsed&&b.end.parent.isAttached()&&d.writer.mergeAttributes(b.start);h.setSelection(null)},{priority:"high"}),this.downcastDispatcher.on("selection",(a,l,d)=>{const h=l.selection;if(h.isCollapsed||!d.consumable.consume(h,"selection"))return;const p=[];for(const b of h.getRanges()){const x=d.mapper.toViewRange(b);p.push(x)}d.writer.setSelection(p,{backward:h.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(a,l,d)=>{const h=l.selection;if(!h.isCollapsed||!d.consumable.consume(h,"selection"))return;const p=d.writer,b=h.getFirstPosition(),x=d.mapper.toViewPosition(b),E=p.breakAttributes(x);p.setSelection(E)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(a=>{if(a.rootName=="$graveyard")return null;const l=new Eu(this.view.document,a.name);return l.rootName=a.rootName,this.mapper.bindElements(a,l),l})}destroy(){this.view.destroy(),this.stopListening()}}ze(od,$t);class lf{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 T.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 Ga{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 cf(e),this._consumables.set(e,n)),n.add(t))}test(e,t){const n=this._consumables.get(e);return n===void 0?null:e.is("$text")||e.is("documentFragment")?n:n.test(t)}consume(e,t){return!!this.test(e,t)&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!1):this._consumables.get(e).consume(t),!0)}revert(e,t){const n=this._consumables.get(e);n!==void 0&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):n.revert(t))}static consumablesFromElement(e){const t={element:e,name:!0,attributes:[],classes:[],styles:[]},n=e.getAttributeKeys();for(const a of n)a!="style"&&a!="class"&&t.attributes.push(a);const i=e.getClassNames();for(const a of i)t.classes.push(a);const r=e.getStyleNames();for(const a of r)t.styles.push(a);return t}static createFrom(e,t){if(t||(t=new Ga(e)),e.is("$text"))return t.add(e),t;e.is("element")&&t.add(e,Ga.consumablesFromElement(e)),e.is("documentFragment")&&t.add(e);for(const n of e.getChildren())t=Ga.createFrom(n,t);return t}}class cf{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=sn(t)?t:[t],i=this._consumables[e];for(const r of n){if(e==="attributes"&&(r==="class"||r==="style"))throw new T.a("viewconsumable-invalid-attribute",this);if(i.set(r,!0),e==="styles")for(const a of this.element.document.stylesProcessor.getRelatedStyles(r))i.set(a,!0)}}_test(e,t){const n=sn(t)?t:[t],i=this._consumables[e];for(const r of n)if(e!=="attributes"||r!=="class"&&r!=="style"){const a=i.get(r);if(a===void 0)return null;if(!a)return!1}else{const a=r=="class"?"classes":"styles",l=this._test(a,[...this._consumables[a].keys()]);if(l!==!0)return l}return!0}_consume(e,t){const n=sn(t)?t:[t],i=this._consumables[e];for(const r of n)if(e!=="attributes"||r!=="class"&&r!=="style"){if(i.set(r,!1),e=="styles")for(const a of this.element.document.stylesProcessor.getRelatedStyles(r))i.set(a,!1)}else{const a=r=="class"?"classes":"styles";this._consume(a,[...this._consumables[a].keys()])}}_revert(e,t){const n=sn(t)?t:[t],i=this._consumables[e];for(const r of n)if(e!=="attributes"||r!=="class"&&r!=="style")i.get(r)===!1&&i.set(r,!0);else{const a=r=="class"?"classes":"styles";this._revert(a,[...this._consumables[a].keys()])}}}class uf{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(e,t)=>{t[0]=new Gr(t[0])},{priority:"highest"}),this.on("checkChild",(e,t)=>{t[0]=new Gr(t[0]),t[1]=this.getDefinition(t[1])},{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new T.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 T.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,i=e.nodeAfter;if(!(n instanceof Ot))throw new T.a("schema-check-merge-no-element-before",this);if(!(i instanceof Ot))throw new T.a("schema-check-merge-no-element-after",this);return this.checkMerge(n,i)}for(const n of t.getChildren())if(!this.checkChild(e,n))return!1;return!0}addChildCheck(e){this.on("checkChild",(t,[n,i])=>{if(!i)return;const r=e(n,i);typeof r=="boolean"&&(t.stop(),t.return=r)},{priority:"high"})}addAttributeCheck(e){this.on("checkAttribute",(t,[n,i])=>{const r=e(n,i);typeof r=="boolean"&&(t.stop(),t.return=r)},{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 re?[e]:Array.from(e.getRanges())).reduce((n,i)=>{const r=i.getCommonAncestor();return n?n.getCommonAncestor(r,{includeSelf:!0}):r},null);!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const n=[...e.getFirstPosition().getAncestors(),new Dt("",e.getAttributes())];return this.checkAttribute(n,t)}{const n=e.getRanges();for(const i of n)for(const r of i)if(this.checkAttribute(r.item,t))return!0}return!1}*getValidRanges(e,t){e=function*(n){for(const i of n)yield*i.getMinimalFlatRanges()}(e);for(const n of e)yield*this._getValidRangesForRange(n,t)}getNearestSelectionRange(e,t="both"){if(this.checkChild(e,"$text"))return new re(e);let n,i;const r=e.getAncestors().reverse().find(a=>this.isLimit(a))||e.root;t!="both"&&t!="backward"||(n=new Ki({boundaries:re._createIn(r),startPosition:e,direction:"backward"})),t!="both"&&t!="forward"||(i=new Ki({boundaries:re._createIn(r),startPosition:e}));for(const a of function*(l,d){let h=!1;for(;!h;){if(h=!0,l){const p=l.next();p.done||(h=!1,yield{walker:l,value:p.value})}if(d){const p=d.next();p.done||(h=!1,yield{walker:d,value:p.value})}}}(n,i)){const l=a.walker==n?"elementEnd":"elementStart",d=a.value;if(d.type==l&&this.isObject(d.item))return re._createOn(d.item);if(this.checkChild(d.nextPosition,"$text"))return new re(d.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"))ud(this,n,t);else{const i=re._createIn(n).getPositions();for(const r of i)ud(this,r.nodeBefore||r.parent,t)}}createContext(e){return new Gr(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,n=Object.keys(t);for(const i of n)e[i]=Ko(t[i],i);for(const i of n)rd(e,i);for(const i of n)sd(e,i);for(const i of n)ad(e,i);for(const i of n)_c(e,i),xs(e,i);for(const i of n)qe(e,i),kc(e,i),ld(e,i);this._compiledDefinitions=e}_checkContextMatch(e,t,n=t.length-1){const i=t.getItem(n);if(e.allowIn.includes(i.name)){if(n==0)return!0;{const r=this.getDefinition(i);return this._checkContextMatch(r,t,n-1)}}return!1}*_getValidRangesForRange(e,t){let n=e.start,i=e.start;for(const r of e.getItems({shallow:!0}))r.is("element")&&(yield*this._getValidRangesForRange(re._createIn(r),t)),this.checkAttribute(r,t)||(n.isEqual(i)||(yield new re(n,i)),n=fe._createAfter(r)),i=fe._createAfter(r);n.isEqual(i)||(yield new re(n,i))}}ze(uf,$t);class Gr{constructor(e){if(e instanceof Gr)return e;typeof e=="string"?e=[e]:Array.isArray(e)||(e=e.getAncestors({includeSelf:!0})),this._items=e.map(cd)}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 Gr([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 Ko(o,e){const t={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(n,i){for(const r of n){const a=Object.keys(r).filter(l=>l.startsWith("is"));for(const l of a)i[l]=r[l]}}(o,t),vi(o,t,"allowIn"),vi(o,t,"allowContentOf"),vi(o,t,"allowWhere"),vi(o,t,"allowAttributes"),vi(o,t,"allowAttributesOf"),vi(o,t,"allowChildren"),vi(o,t,"inheritTypesFrom"),function(n,i){for(const r of n){const a=r.inheritAllFrom;a&&(i.allowContentOf.push(a),i.allowWhere.push(a),i.allowAttributesOf.push(a),i.inheritTypesFrom.push(a))}}(o,t),t}function rd(o,e){const t=o[e];for(const n of t.allowChildren){const i=o[n];i&&i.allowIn.push(e)}t.allowChildren.length=0}function sd(o,e){for(const t of o[e].allowContentOf)o[t]&&om(o,t).forEach(n=>{n.allowIn.push(e)});delete o[e].allowContentOf}function ad(o,e){for(const t of o[e].allowWhere){const n=o[t];if(n){const i=n.allowIn;o[e].allowIn.push(...i)}}delete o[e].allowWhere}function _c(o,e){for(const t of o[e].allowAttributesOf){const n=o[t];if(n){const i=n.allowAttributes;o[e].allowAttributes.push(...i)}}delete o[e].allowAttributesOf}function xs(o,e){const t=o[e];for(const n of t.inheritTypesFrom){const i=o[n];if(i){const r=Object.keys(i).filter(a=>a.startsWith("is"));for(const a of r)a in t||(t[a]=i[a])}}delete t.inheritTypesFrom}function qe(o,e){const t=o[e],n=t.allowIn.filter(i=>o[i]);t.allowIn=Array.from(new Set(n))}function kc(o,e){const t=o[e];for(const n of t.allowIn)o[n].allowChildren.push(e)}function ld(o,e){const t=o[e];t.allowAttributes=Array.from(new Set(t.allowAttributes))}function vi(o,e,t){for(const n of o)typeof n[t]=="string"?e[t].push(n[t]):Array.isArray(n[t])&&e[t].push(...n[t])}function om(o,e){const t=o[e];return(n=o,Object.keys(n).map(i=>n[i])).filter(i=>i.allowIn.includes(t.name));var n}function cd(o){return typeof o=="string"||o.is("documentFragment")?{name:typeof o=="string"?o:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:o.is("element")?o.name:"$text",*getAttributeKeys(){yield*o.getAttributeKeys()},getAttribute:e=>o.getAttribute(e)}}function ud(o,e,t){for(const n of e.getAttributeKeys())o.checkAttribute(e,n)||t.removeAttribute(n,e)}class In{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,l){let d;for(const h of new Gr(a)){const p={};for(const x of h.getAttributeKeys())p[x]=h.getAttribute(x);const b=l.createElement(h.name,p);d&&l.append(b,d),d=fe._createAt(b,0)}return d}(n,t),this.conversionApi.writer=t,this.conversionApi.consumable=Ga.createFrom(e),this.conversionApi.store={};const{modelRange:i}=this._convertItem(e,this._modelCursor),r=t.createDocumentFragment();if(i){this._removeEmptyElements();for(const a of Array.from(this._modelCursor.parent.getChildren()))t.append(a,r);r.markers=function(a,l){const d=new Set,h=new Map,p=re._createIn(a).getItems();for(const b of p)b.name=="$marker"&&d.add(b);for(const b of d){const x=b.getAttribute("data-name"),E=l.createPositionBefore(b);h.has(x)?h.get(x).end=E.clone():h.set(x,new re(E.clone())),l.remove(b)}return h}(r,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,r}_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 re))throw new T.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 i=new re(n);for(const r of Array.from(e.getChildren())){const a=this._convertItem(r,n);a.modelRange instanceof re&&(i.end=a.modelRange.end,n=a.modelCursor)}return{modelRange:i,modelCursor:n}}_safeInsert(e,t){const n=this._splitToAllowedParent(e,t);return!!n&&(this.conversionApi.writer.insert(e,n.position),!0)}_updateConversionResult(e,t){const n=this._getSplitParts(e),i=this.conversionApi.writer;t.modelRange||(t.modelRange=i.createRange(i.createPositionBefore(e),i.createPositionAfter(n[n.length-1])));const r=this._cursorParents.get(e);t.modelCursor=r?i.createPositionAt(r,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:n,writer:i}=this.conversionApi;let r=n.findAllowedParent(t,e);if(r){if(r===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(r)&&(r=null)}if(!r)return Wa(t,e,n)?{position:rf(t,i)}:null;const a=this.conversionApi.writer.split(t,r),l=[];for(const h of a.range.getWalker())if(h.type=="elementEnd")l.push(h.item);else{const p=l.pop(),b=h.item;this._registerSplitPair(p,b)}const d=a.range.end.parent;return this._cursorParents.set(e,d),{position:a.position,cursorParent:d}}_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()}}ze(In,j);class rm{getHtml(e){const t=document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}}class sm{constructor(e){this._domParser=new DOMParser,this._domConverter=new mo(e,{blockFillerMode:"nbsp"}),this._htmlWriter=new rm}toData(e){const t=this._domConverter.viewToDom(e,document);return this._htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this._domConverter.domToView(t)}registerRawContentMatcher(e){this._domConverter.registerRawContentMatcher(e)}useFillerType(e){this._domConverter.blockFillerMode=e=="marked"?"markedNbsp":"nbsp"}_toDom(e){const t=this._domParser.parseFromString(e,"text/html"),n=t.createDocumentFragment();let i=t.firstChild;for(;!i.isSameNode(t.documentElement);){const a=i;i=i.nextSibling,a.nodeType==Node.COMMENT_NODE&&n.appendChild(a)}const r=t.body.childNodes;for(;r.length>0;)n.appendChild(r[0]);return n}}class dd{constructor(e,t){this.model=e,this.mapper=new Ba,this.downcastDispatcher=new Yu({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",(n,i,r)=>{if(!r.consumable.consume(i.item,"insert"))return;const a=r.writer,l=r.mapper.toViewPosition(i.range.start),d=a.createText(i.item.data);a.insert(l,d)},{priority:"lowest"}),this.upcastDispatcher=new In({schema:e.schema}),this.viewDocument=new zo(t),this.stylesProcessor=t,this.htmlProcessor=new sm(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new Nh(this.viewDocument),this.upcastDispatcher.on("text",(n,i,{schema:r,consumable:a,writer:l})=>{let d=i.modelCursor;if(!a.test(i.viewItem))return;if(!r.checkChild(d,"$text")){if(!Wa(d,"$text",r))return;d=rf(d,l)}a.consume(i.viewItem);const h=l.createText(i.viewItem.data);l.insert(h,d),i.modelRange=l.createRange(d,d.getShiftedBy(h.offsetSize)),i.modelCursor=i.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(n,i,r)=>{if(!i.modelRange&&r.consumable.consume(i.viewItem,{name:!0})){const{modelRange:a,modelCursor:l}=r.convertChildren(i.viewItem,i.modelCursor);i.modelRange=a,i.modelCursor=l}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(n,i,r)=>{if(!i.modelRange&&r.consumable.consume(i.viewItem,{name:!0})){const{modelRange:a,modelCursor:l}=r.convertChildren(i.viewItem,i.modelCursor);i.modelRange=a,i.modelCursor=l}},{priority:"lowest"}),this.decorate("init"),this.decorate("set"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange("transparent",vc)},{priority:"lowest"})}get(e={}){const{rootName:t="main",trim:n="empty"}=e;if(!this._checkIfRootsExists([t]))throw new T.a("datacontroller-get-non-existent-root",this);const i=this.model.document.getRoot(t);return n!=="empty"||this.model.hasContent(i,{ignoreWhitespaces:!0})?this.stringify(i,e):""}stringify(e,t={}){const n=this.toView(e,t);return this.processor.toData(n)}toView(e,t={}){const n=this.viewDocument,i=this._viewWriter;this.mapper.clearBindings();const r=re._createIn(e),a=new $r(n);this.mapper.bindElements(e,a),this.downcastDispatcher.conversionApi.options=t,this.downcastDispatcher.convertInsert(r,i);const l=e.is("documentFragment")?Array.from(e.markers):function(d){const h=[],p=d.root.document;if(!p)return[];const b=re._createIn(d);for(const x of p.model.markers){const E=x.getRange(),P=E.isCollapsed,D=E.start.isEqual(b.start)||E.end.isEqual(b.end);if(P&&D)h.push([x.name,E]);else{const R=b.getIntersection(E);R&&h.push([x.name,R])}}return h}(e);for(const[d,h]of l)this.downcastDispatcher.convertMarkerAdd(d,h,i);return delete this.downcastDispatcher.conversionApi.options,a}init(e){if(this.model.document.version)throw new T.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 T.a("datacontroller-init-non-existent-root",this);return this.model.enqueueChange("transparent",n=>{for(const i of Object.keys(t)){const r=this.model.document.getRoot(i);n.insert(this.parse(t[i],r),r,0)}}),Promise.resolve()}set(e,t={}){let n={};if(typeof e=="string"?n.main=e:n=e,!this._checkIfRootsExists(Object.keys(n)))throw new T.a("datacontroller-set-non-existent-root",this);const i=t.batchType||"default";this.model.enqueueChange(i,r=>{r.setSelection(null),r.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const a of Object.keys(n)){const l=this.model.document.getRoot(a);r.remove(r.createRangeIn(l)),r.insert(this.parse(n[a],l),l,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}}ze(dd,$t);class am{constructor(e,t){this._helpers=new Map,this._downcast=Tt(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Tt(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 T.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 T.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 yc(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 yc(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 yc(e))this.for("upcast").attributeToAttribute({view:n,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:n}){if(this._helpers.has(e))throw new T.a("conversion-group-exists",this);const i=n?new Ha(t):new sf(t);this._helpers.set(e,i)}}function*yc(o){if(o.model.values)for(const e of o.model.values){const t={key:o.model.key,value:e},n=o.view[e],i=o.upcastAlso?o.upcastAlso[e]:void 0;yield*df(t,n,i)}else yield*df(o.model,o.view,o.upcastAlso)}function*df(o,e,t){if(yield{model:o,view:e},t)for(const n of Tt(t))yield{model:o,view:n}}class xc{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 Oi{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 Mn{constructor(e){this.markers=new Map,this._children=new br,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(Ot.fromJSON(n)):t.push(Dt.fromJSON(n));return new Mn(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(i){return typeof i=="string"?[new Dt(i)]:(Wn(i)||(i=[i]),Array.from(i).map(r=>typeof r=="string"?new Dt(r):r instanceof Wi?new Dt(r.data,r.getAttributes()):r))}(t);for(const i of n)i.parent!==null&&i._remove(),i.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const i of n)i.parent=null;return n}}function Dn(o,e){const t=(e=Tc(e)).reduce((r,a)=>r+a.offsetSize,0),n=o.parent;Ja(o);const i=o.index;return n._insertChild(i,e),Ya(n,i+e.length),Ya(n,i),new re(o,o.getShiftedBy(t))}function Cc(o){if(!o.isFlat)throw new T.a("operation-utils-remove-range-not-flat",this);const e=o.start.parent;Ja(o.start),Ja(o.end);const t=e._removeChildren(o.start.index,o.end.index-o.start.index);return Ya(e,o.start.index),t}function Qa(o,e){if(!o.isFlat)throw new T.a("operation-utils-move-range-not-flat",this);const t=Cc(o);return Dn(e=e._getTransformedByDeletion(o.start,o.end.offset-o.start.offset),t)}function Tc(o){const e=[];o instanceof Array||(o=[o]);for(let t=0;t<o.length;t++)if(typeof o[t]=="string")e.push(new Dt(o[t]));else if(o[t]instanceof Wi)e.push(new Dt(o[t].data,o[t].getAttributes()));else if(o[t]instanceof Mn||o[t]instanceof br)for(const n of o[t])e.push(n);else o[t]instanceof mr&&e.push(o[t]);for(let t=1;t<e.length;t++){const n=e[t],i=e[t-1];n instanceof Dt&&i instanceof Dt&&Cs(n,i)&&(e.splice(t-1,2,new Dt(i.data+n.data,i.getAttributes())),t--)}return e}function Ya(o,e){const t=o.getChild(e-1),n=o.getChild(e);if(t&&n&&t.is("$text")&&n.is("$text")&&Cs(t,n)){const i=new Dt(t.data+n.data,t.getAttributes());o._removeChildren(e-1,2),o._insertChild(e-1,i)}}function Ja(o){const e=o.textNode,t=o.parent;if(e){const n=o.offset-e.startOffset,i=e.index;t._removeChildren(i,1);const r=new Dt(e.data.substr(0,n),e.getAttributes()),a=new Dt(e.data.substr(n),e.getAttributes());t._insertChild(i,[r,a])}}function Cs(o,e){const t=o.getAttributes(),n=e.getAttributes();for(const i of t){if(i[1]!==e.getAttribute(i[0]))return!1;n.next()}return n.next().done}var hd=function(o,e){return Uh(o,e)};class an extends Oi{constructor(e,t,n,i,r){super(r),this.range=e.clone(),this.key=t,this.oldValue=n===void 0?null:n,this.newValue=i===void 0?null:i}get type(){return this.oldValue===null?"addAttribute":this.newValue===null?"removeAttribute":"changeAttribute"}clone(){return new an(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new an(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 T.a("attribute-operation-range-not-flat",this);for(const e of this.range.getItems({shallow:!0})){if(this.oldValue!==null&&!hd(e.getAttribute(this.key),this.oldValue))throw new T.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 T.a("attribute-operation-attribute-exists",this,{node:e,key:this.key})}}_execute(){hd(this.oldValue,this.newValue)||function(e,t,n){Ja(e.start),Ja(e.end);for(const i of e.getItems({shallow:!0})){const r=i.is("$textProxy")?i.textNode:i;n!==null?r._setAttribute(t,n):r._removeAttribute(t),Ya(r.parent,r.index)}Ya(e.end.parent,e.end.index)}(this.range,this.key,this.newValue)}static get className(){return"AttributeOperation"}static fromJSON(e,t){return new an(re.fromJSON(e.range,t),e.key,e.oldValue,e.newValue,e.baseVersion)}}class lm extends Oi{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 T.a("detach-operation-on-document-node",this)}_execute(){Cc(re._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class Vt extends Oi{constructor(e,t,n,i){super(i),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toNext",this.howMany=t,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNone"}get type(){return this.targetPosition.root.rootName=="$graveyard"?"remove":this.sourcePosition.root.rootName=="$graveyard"?"reinsert":"move"}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.baseVersion)}getMovedRangeStart(){return this.targetPosition._getTransformedByDeletion(this.sourcePosition,this.howMany)}getReversed(){const e=this.sourcePosition._getTransformedByInsertion(this.targetPosition,this.howMany);return new this.constructor(this.getMovedRangeStart(),this.howMany,e,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent,n=this.sourcePosition.offset,i=this.targetPosition.offset;if(n+this.howMany>e.maxOffset)throw new T.a("move-operation-nodes-do-not-exist",this);if(e===t&&n<i&&i<n+this.howMany)throw new T.a("move-operation-range-into-itself",this);if(this.sourcePosition.root==this.targetPosition.root&&z(this.sourcePosition.getParentPath(),this.targetPosition.getParentPath())=="prefix"){const r=this.sourcePosition.path.length-1;if(this.targetPosition.path[r]>=n&&this.targetPosition.path[r]<n+this.howMany)throw new T.a("move-operation-node-into-itself",this)}}_execute(){Qa(re._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),i=fe.fromJSON(e.targetPosition,t);return new this(n,e.howMany,i,e.baseVersion)}}class Tn extends Oi{constructor(e,t,n){super(n),this.position=e.clone(),this.position.stickiness="toNone",this.nodes=new br(Tc(t)),this.shouldReceiveAttributes=!1}get type(){return"insert"}get howMany(){return this.nodes.maxOffset}clone(){const e=new br([...this.nodes].map(n=>n._clone(!0))),t=new Tn(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new fe(e,[0]);return new Vt(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffset<this.position.offset)throw new T.a("insert-operation-position-invalid",this)}_execute(){const e=this.nodes;this.nodes=new br([...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 r of e.nodes)r.name?n.push(Ot.fromJSON(r)):n.push(Dt.fromJSON(r));const i=new Tn(fe.fromJSON(e.position,t),n,e.baseVersion);return i.shouldReceiveAttributes=e.shouldReceiveAttributes,i}}class oi extends Oi{constructor(e,t,n,i,r,a){super(a),this.name=e,this.oldRange=t?t.clone():null,this.newRange=n?n.clone():null,this.affectsData=r,this._markers=i}get type(){return"marker"}clone(){return new oi(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new oi(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 oi(e.name,e.oldRange?re.fromJSON(e.oldRange,t):null,e.newRange?re.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}class Qn extends Oi{constructor(e,t,n,i){super(i),this.position=e,this.position.stickiness="toNext",this.oldName=t,this.newName=n}get type(){return"rename"}clone(){return new Qn(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new Qn(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof Ot))throw new T.a("rename-operation-wrong-position",this);if(e.name!==this.oldName)throw new T.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 Qn(fe.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class xo extends Oi{constructor(e,t,n,i,r){super(r),this.root=e,this.key=t,this.oldValue=n,this.newValue=i}get type(){return this.oldValue===null?"addRootAttribute":this.newValue===null?"removeRootAttribute":"changeRootAttribute"}clone(){return new xo(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new xo(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new T.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 T.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 T.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 T.a("rootattribute-operation-fromjson-no-root",this,{rootName:e.root});return new xo(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class mn extends Oi{constructor(e,t,n,i,r){super(r),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=t,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=i.clone()}get type(){return"merge"}get deletionPosition(){return new fe(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new re(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 Bt(e,this.howMany,n,this.graveyardPosition,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent;if(!e.parent)throw new T.a("merge-operation-source-position-invalid",this);if(!t.parent)throw new T.a("merge-operation-target-position-invalid",this);if(this.howMany!=e.maxOffset)throw new T.a("merge-operation-how-many-invalid",this)}_execute(){const e=this.sourcePosition.parent;Qa(re._createIn(e),this.targetPosition),Qa(re._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),i=fe.fromJSON(e.targetPosition,t),r=fe.fromJSON(e.graveyardPosition,t);return new this(n,e.howMany,i,r,e.baseVersion)}}class Bt extends Oi{constructor(e,t,n,i,r){super(r),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=n,this.graveyardPosition=i?i.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new fe(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new re(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 mn(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 T.a("split-operation-position-invalid",this);if(!e.parent)throw new T.a("split-operation-split-in-root",this);if(this.howMany!=e.maxOffset-this.splitPosition.offset)throw new T.a("split-operation-how-many-invalid",this);if(this.graveyardPosition&&!this.graveyardPosition.nodeAfter)throw new T.a("split-operation-graveyard-position-invalid",this)}_execute(){const e=this.splitPosition.parent;if(this.graveyardPosition)Qa(re._createFromPositionAndShift(this.graveyardPosition,1),this.insertionPosition);else{const t=e._clone();Dn(this.insertionPosition,t)}Qa(new re(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),i=fe.fromJSON(e.insertionPosition,t),r=e.graveyardPosition?fe.fromJSON(e.graveyardPosition,t):null;return new this(n,e.howMany,i,r,e.baseVersion)}}class Ec extends Ot{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 Za{constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new Dt(e,t)}createElement(e,t){return new Ot(e,t)}createDocumentFragment(){return new Mn}cloneElement(e,t=!0){return e._clone(t)}insert(e,t,n=0){if(this._assertWriterUsedCorrectly(),e instanceof Dt&&e.data=="")return;const i=fe._createAt(t,n);if(e.parent){if(pd(e.root,i.root))return void this.move(re._createOn(e),i);if(e.root.document)throw new T.a("model-writer-insert-forbidden-move",this);this.remove(e)}const r=i.root.document?i.root.document.version:null,a=new Tn(i,e,r);if(e instanceof Dt&&(a.shouldReceiveAttributes=!0),this.batch.addOperation(a),this.model.applyOperation(a),e instanceof Mn)for(const[l,d]of e.markers){const h=fe._createAt(d.root,0),p={range:new re(d.start._getCombined(h,i),d.end._getCombined(h,i)),usingOperation:!0,affectsData:!0};this.model.markers.has(l)?this.updateMarker(l,p):this.addMarker(l,p)}}insertText(e,t,n,i){t instanceof Mn||t instanceof Ot||t instanceof fe?this.insert(this.createText(e),t,n):this.insert(this.createText(e,t),n,i)}insertElement(e,t,n,i){t instanceof Mn||t instanceof Ot||t instanceof fe?this.insert(this.createElement(e),t,n):this.insert(this.createElement(e,t),n,i)}append(e,t){this.insert(e,t,"end")}appendText(e,t,n){t instanceof Mn||t instanceof Ot?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),n,"end")}appendElement(e,t,n){t instanceof Mn||t instanceof Ot?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),n,"end")}setAttribute(e,t,n){if(this._assertWriterUsedCorrectly(),n instanceof re){const i=n.getMinimalFlatRanges();for(const r of i)Sc(this,e,t,r)}else fd(this,e,t,n)}setAttributes(e,t){for(const[n,i]of Ke(e))this.setAttribute(n,i,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof re){const n=t.getMinimalFlatRanges();for(const i of n)Sc(this,e,null,i)}else fd(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=n=>{for(const i of n.getAttributeKeys())this.removeAttribute(i,n)};if(e instanceof re)for(const n of e.getItems())t(n);else t(e)}move(e,t,n){if(this._assertWriterUsedCorrectly(),!(e instanceof re))throw new T.a("writer-move-invalid-range",this);if(!e.isFlat)throw new T.a("writer-move-range-not-flat",this);const i=fe._createAt(t,n);if(i.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!pd(e.root,i.root))throw new T.a("writer-move-different-document",this);const r=e.root.document?e.root.document.version:null,a=new Vt(e.start,e.end.offset-e.start.offset,i,r);this.batch.addOperation(a),this.model.applyOperation(a)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof re?e:re._createOn(e)).getMinimalFlatRanges().reverse();for(const n of t)this._addOperationForAffectedMarkers("move",n),Ac(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 Ot))throw new T.a("writer-merge-no-element-before",this);if(!(n instanceof Ot))throw new T.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(re._createIn(n),fe._createAt(t,"end")),this.remove(n)}_merge(e){const t=fe._createAt(e.nodeBefore,"end"),n=fe._createAt(e.nodeAfter,0),i=e.root.document.graveyard,r=new fe(i,[0]),a=e.root.document.version,l=new mn(n,e.nodeAfter.maxOffset,t,r,a);this.batch.addOperation(l),this.model.applyOperation(l)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof Ot))throw new T.a("writer-rename-not-element-instance",this);const n=e.root.document?e.root.document.version:null,i=new Qn(fe._createBefore(e),e.name,t,n);this.batch.addOperation(i),this.model.applyOperation(i)}split(e,t){this._assertWriterUsedCorrectly();let n,i,r=e.parent;if(!r.parent)throw new T.a("writer-split-element-no-parent",this);if(t||(t=r.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new T.a("writer-split-invalid-limit-element",this);do{const a=r.root.document?r.root.document.version:null,l=r.maxOffset-e.offset,d=Bt.getInsertionPosition(e),h=new Bt(e,l,d,null,a);this.batch.addOperation(h),this.model.applyOperation(h),n||i||(n=r,i=e.parent.nextSibling),r=(e=this.createPositionAfter(e.parent)).parent}while(r!==t);return{position:e,range:new re(fe._createAt(n,"end"),fe._createAt(i,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new T.a("writer-wrap-range-not-flat",this);const n=t instanceof Ot?t:new Ot(t);if(n.childCount>0)throw new T.a("writer-wrap-element-not-empty",this);if(n.parent!==null)throw new T.a("writer-wrap-element-attached",this);this.insert(n,e.start);const i=new re(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(i,fe._createAt(n,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),e.parent===null)throw new T.a("writer-unwrap-element-no-parent",this);this.move(re._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||typeof t.usingOperation!="boolean")throw new T.a("writer-addmarker-no-usingoperation",this);const n=t.usingOperation,i=t.range,r=t.affectsData!==void 0&&t.affectsData;if(this.model.markers.has(e))throw new T.a("writer-addmarker-marker-exists",this);if(!i)throw new T.a("writer-addmarker-no-range",this);return n?(Ts(this,e,null,i,r),this.model.markers.get(e)):this.model.markers._set(e,i,n,r)}updateMarker(e,t){this._assertWriterUsedCorrectly();const n=typeof e=="string"?e:e.name,i=this.model.markers.get(n);if(!i)throw new T.a("writer-updatemarker-marker-not-exists",this);if(!t)return void this.model.markers._refresh(i);const r=typeof t.usingOperation=="boolean",a=typeof t.affectsData=="boolean",l=a?t.affectsData:i.affectsData;if(!r&&!t.range&&!a)throw new T.a("writer-updatemarker-wrong-options",this);const d=i.getRange(),h=t.range?t.range:d;r&&t.usingOperation!==i.managedUsingOperations?t.usingOperation?Ts(this,n,null,h,l):(Ts(this,n,d,null,l),this.model.markers._set(n,h,void 0,l)):i.managedUsingOperations?Ts(this,n,d,h,l):this.model.markers._set(n,h,void 0,l)}removeMarker(e){this._assertWriterUsedCorrectly();const t=typeof e=="string"?e:e.name;if(!this.model.markers.has(t))throw new T.a("writer-removemarker-no-marker",this);const n=this.model.markers.get(t);if(!n.managedUsingOperations)return void this.model.markers._remove(t);Ts(this,t,n.getRange(),null,n.affectsData)}setSelection(e,t,n){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(e,t,n)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),typeof e=="string")this._setSelectionAttribute(e,t);else for(const[n,i]of Ke(e))this._setSelectionAttribute(n,i)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),typeof e=="string")this._removeSelectionAttribute(e);else for(const t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const i=Di._getStoreAttributeKey(e);this.setAttribute(i,t,n.anchor.parent)}n._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const n=Di._getStoreAttributeKey(e);this.removeAttribute(n,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new T.a("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(const n of this.model.markers){if(!n.managedUsingOperations)continue;const i=n.getRange();let r=!1;if(e==="move")r=t.containsPosition(i.start)||t.start.isEqual(i.start)||t.containsPosition(i.end)||t.end.isEqual(i.end);else{const a=t.nodeBefore,l=t.nodeAfter,d=i.start.parent==a&&i.start.isAtEnd,h=i.end.parent==l&&i.end.offset==0,p=i.end.nodeAfter==l,b=i.start.nodeAfter==l;r=d||h||p||b}r&&this.updateMarker(n.name,{range:i})}}}function Sc(o,e,t,n){const i=o.model,r=i.document;let a,l,d,h=n.start;for(const b of n.getWalker({shallow:!0}))d=b.item.getAttribute(e),a&&l!=d&&(l!=t&&p(),h=a),a=b.nextPosition,l=d;function p(){const b=new re(h,a),x=b.root.document?r.version:null,E=new an(b,e,l,t,x);o.batch.addOperation(E),i.applyOperation(E)}a instanceof fe&&a!=h&&l!=t&&p()}function fd(o,e,t,n){const i=o.model,r=i.document,a=n.getAttribute(e);let l,d;if(a!=t){if(n.root===n){const h=n.document?r.version:null;d=new xo(n,e,a,t,h)}else{l=new re(fe._createBefore(n),o.createPositionAfter(n));const h=l.root.document?r.version:null;d=new an(l,e,a,t,h)}o.batch.addOperation(d),i.applyOperation(d)}}function Ts(o,e,t,n,i){const r=o.model,a=r.document,l=new oi(e,t,n,r.markers,i,a.version);o.batch.addOperation(l),r.applyOperation(l)}function Ac(o,e,t,n){let i;if(o.root.document){const r=n.document,a=new fe(r.graveyard,[0]);i=new Vt(o,e,a,r.version)}else i=new lm(o,e);t.addOperation(i),n.applyOperation(i)}function pd(o,e){return o===e||o instanceof Ec&&e instanceof Ec}class Co{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=re._createOn(e);for(const n of this._markerCollection.getMarkersIntersectingRange(t)){const i=n.getRange();this.bufferMarkerChange(n.name,i,i,n.affectsData)}this._cachedChanges=null}bufferOperation(e){switch(e.type){case"insert":if(this._isInInsertedElement(e.position.parent))return;this._markInsert(e.position.parent,e.position.offset,e.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const t of e.range.getItems({shallow:!0}))this._isInInsertedElement(t.parent)||this._markAttribute(t);break;case"remove":case"move":case"reinsert":{if(e.sourcePosition.isEqual(e.targetPosition)||e.sourcePosition.getShiftedBy(e.howMany).isEqual(e.targetPosition))return;const t=this._isInInsertedElement(e.sourcePosition.parent),n=this._isInInsertedElement(e.targetPosition.parent);t||this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany),n||this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany);break}case"rename":{if(this._isInInsertedElement(e.position.parent))return;this._markRemove(e.position.parent,e.position.offset,1),this._markInsert(e.position.parent,e.position.offset,1);const t=re._createFromPositionAndShift(e.position,1);for(const n of this._markerCollection.getMarkersIntersectingRange(t)){const i=n.getRange();this.bufferMarkerChange(n.name,i,i,n.affectsData)}break}case"split":{const t=e.splitPosition.parent;this._isInInsertedElement(t)||this._markRemove(t,e.splitPosition.offset,e.howMany),this._isInInsertedElement(e.insertionPosition.parent)||this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1),e.graveyardPosition&&this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1);break}case"merge":{const t=e.sourcePosition.parent;this._isInInsertedElement(t.parent)||this._markRemove(t.parent,t.startOffset,1);const n=e.graveyardPosition.parent;this._markInsert(n,e.graveyardPosition.offset,1);const i=e.targetPosition.parent;this._isInInsertedElement(i)||this._markInsert(i,e.targetPosition.offset,t.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(e,t,n,i){const r=this._changedMarkers.get(e);r?(r.newRange=n,r.affectsData=i,r.oldRange==null&&r.newRange==null&&this._changedMarkers.delete(e)):this._changedMarkers.set(e,{oldRange:t,newRange:n,affectsData:i})}getMarkersToRemove(){const e=[];for(const[t,n]of this._changedMarkers)n.oldRange!=null&&e.push({name:t,range:n.oldRange});return e}getMarkersToAdd(){const e=[];for(const[t,n]of this._changedMarkers)n.newRange!=null&&e.push({name:t,range:n.newRange});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map(e=>({name:e[0],data:{oldRange:e[1].oldRange,newRange:e[1].newRange}}))}hasDataChanges(){for(const[,e]of this._changedMarkers)if(e.affectsData)return!0;return this._changesInElement.size>0}getChanges(e={includeChangesInGraveyard:!1}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let t=[];for(const n of this._changesInElement.keys()){const i=this._changesInElement.get(n).sort((p,b)=>p.offset===b.offset?p.type!=b.type?p.type=="remove"?-1:1:0:p.offset<b.offset?-1:1),r=this._elementSnapshots.get(n),a=vr(n.getChildren()),l=cm(r.length,i);let d=0,h=0;for(const p of l)if(p==="i")t.push(this._getInsertDiff(n,d,a[d].name)),d++;else if(p==="r")t.push(this._getRemoveDiff(n,d,r[h].name)),h++;else if(p==="a"){const b=a[d].attributes,x=r[h].attributes;let E;if(a[d].name=="$text")E=new re(fe._createAt(n,d),fe._createAt(n,d+1));else{const P=n.offsetToIndex(d);E=new re(fe._createAt(n,d),fe._createAt(n.getChild(P),0))}t.push(...this._getAttributesDiff(E,x,b)),d++,h++}else d++,h++}t.sort((n,i)=>n.position.root!=i.position.root?n.position.root.rootName<i.position.root.rootName?-1:1:n.position.isEqual(i.position)?n.changeCount-i.changeCount:n.position.isBefore(i.position)?-1:1);for(let n=1,i=0;n<t.length;n++){const r=t[i],a=t[n],l=r.type=="remove"&&a.type=="remove"&&r.name=="$text"&&a.name=="$text"&&r.position.isEqual(a.position),d=r.type=="insert"&&a.type=="insert"&&r.name=="$text"&&a.name=="$text"&&r.position.parent==a.position.parent&&r.position.offset+r.length==a.position.offset,h=r.type=="attribute"&&a.type=="attribute"&&r.position.parent==a.position.parent&&r.range.isFlat&&a.range.isFlat&&r.position.offset+r.length==a.position.offset&&r.attributeKey==a.attributeKey&&r.attributeOldValue==a.attributeOldValue&&r.attributeNewValue==a.attributeNewValue;l||d||h?(r.length++,h&&(r.range.end=r.range.end.getShiftedBy(1)),t[n]=null):i=n}t=t.filter(n=>n);for(const n of t)delete n.changeCount,n.type=="attribute"&&(delete n.position,delete n.length);return this._changeCount=0,this._cachedChangesWithGraveyard=t.slice(),this._cachedChanges=t.filter(hf),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard:this._cachedChanges}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._cachedChanges=null}_markInsert(e,t,n){const i={type:"insert",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,i)}_markRemove(e,t,n){const i={type:"remove",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,i),this._removeAllNestedChanges(e,t,n)}_markAttribute(e){const t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshot(e);const n=this._getChangesForElement(e);this._handleChange(t,n),n.push(t);for(let i=0;i<n.length;i++)n[i].howMany<1&&(n.splice(i,1),i--)}_getChangesForElement(e){let t;return this._changesInElement.has(e)?t=this._changesInElement.get(e):(t=[],this._changesInElement.set(e,t)),t}_makeSnapshot(e){this._elementSnapshots.has(e)||this._elementSnapshots.set(e,vr(e.getChildren()))}_handleChange(e,t){e.nodesToHandle=e.howMany;for(const n of t){const i=e.offset+e.howMany,r=n.offset+n.howMany;if(e.type=="insert"&&(n.type=="insert"&&(e.offset<=n.offset?n.offset+=e.howMany:e.offset<r&&(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<r){const a=n.howMany;n.howMany=e.offset-n.offset,t.unshift({type:"attribute",offset:i,howMany:a-n.howMany,count:this._changeCount++})}}if(e.type=="remove"){if(n.type=="insert"){if(i<=n.offset)n.offset-=e.howMany;else if(i<=r)if(e.offset<n.offset){const a=i-n.offset;n.offset=e.offset,n.howMany-=a,e.nodesToHandle-=a}else n.howMany-=e.nodesToHandle,e.nodesToHandle=0;else if(e.offset<=n.offset)e.nodesToHandle-=n.howMany,n.howMany=0;else if(e.offset<r){const a=r-e.offset;n.howMany-=a,e.nodesToHandle-=a}}if(n.type=="remove"&&(i<=n.offset?n.offset-=e.howMany:e.offset<n.offset&&(e.nodesToHandle+=n.howMany,n.howMany=0)),n.type=="attribute"){if(i<=n.offset)n.offset-=e.howMany;else if(e.offset<n.offset){const a=i-n.offset;n.offset=e.offset,n.howMany-=a}else if(e.offset<r)if(i<=r){const a=n.howMany;n.howMany=e.offset-n.offset;const l=a-n.howMany-e.nodesToHandle;t.unshift({type:"attribute",offset:e.offset,howMany:l,count:this._changeCount++})}else n.howMany-=r-e.offset}}if(e.type=="attribute"){if(n.type=="insert")if(e.offset<n.offset&&i>n.offset){if(i>r){const a={type:"attribute",offset:r,howMany:i-r,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<r&&(i>r?(e.nodesToHandle=i-r,e.offset=r):e.nodesToHandle=0);if(n.type=="remove"&&e.offset<n.offset&&i>n.offset){const a={type:"attribute",offset:n.offset,howMany:i-n.offset,count:this._changeCount++};this._handleChange(a,t),t.push(a),e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}n.type=="attribute"&&(e.offset>=n.offset&&i<=r?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=n.offset&&i>=r&&(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 i=[];n=new Map(n);for(const[r,a]of t){const l=n.has(r)?n.get(r):null;l!==a&&i.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:r,attributeOldValue:a,attributeNewValue:l,changeCount:this._changeCount++}),n.delete(r)}for(const[r,a]of n)i.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:r,attributeOldValue:null,attributeNewValue:a,changeCount:this._changeCount++});return i}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const n=this._changesInElement.get(t),i=e.startOffset;if(n){for(const r of n)if(r.type=="insert"&&i>=r.offset&&i<r.offset+r.howMany)return!0}return this._isInInsertedElement(t)}_removeAllNestedChanges(e,t,n){const i=new re(fe._createAt(e,t),fe._createAt(e,t+n));for(const r of i.getItems({shallow:!0}))r.is("element")&&(this._elementSnapshots.delete(r),this._changesInElement.delete(r),this._removeAllNestedChanges(r,0,r.maxOffset))}}function vr(o){const e=[];for(const t of o)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 cm(o,e){const t=[];let n=0,i=0;for(const r of e){if(r.offset>n){for(let a=0;a<r.offset-n;a++)t.push("e");i+=r.offset-n}if(r.type=="insert"){for(let a=0;a<r.howMany;a++)t.push("i");n=r.offset+r.howMany}else if(r.type=="remove"){for(let a=0;a<r.howMany;a++)t.push("r");n=r.offset,i+=r.howMany}else t.push(..."a".repeat(r.howMany).split("")),n=r.offset+r.howMany,i+=r.howMany}if(i<o)for(let r=0;r<o-i-n;r++)t.push("e");return t}function hf(o){const e=o.position&&o.position.root.rootName=="$graveyard",t=o.range&&o.range.root.rootName=="$graveyard";return!e&&!t}class um{constructor(){this._operations=[],this._undoPairs=new Map,this._undoneOperations=new Set}addOperation(e){this._operations.includes(e)||this._operations.push(e)}getOperations(e=Number.NEGATIVE_INFINITY,t=Number.POSITIVE_INFINITY){const n=[];for(const i of this._operations)i.baseVersion>=e&&i.baseVersion<t&&n.push(i);return n}getOperation(e){for(const t of this._operations)if(t.baseVersion==e)return t}setOperationAsUndone(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}isUndoingOperation(e){return this._undoPairs.has(e)}isUndoneOperation(e){return this._undoneOperations.has(e)}getUndoneOperation(e){return this._undoPairs.get(e)}}function ff(o,e){return!!(t=o.charAt(e-1))&&t.length==1&&/[\ud800-\udbff]/.test(t)&&function(n){return!!n&&n.length==1&&/[\udc00-\udfff]/.test(n)}(o.charAt(e));var t}function pf(o,e){return!!(t=o.charAt(e))&&t.length==1&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(t);var t}class gf{constructor(e){this.model=e,this.version=0,this.history=new um(this),this.selection=new Di(this),this.roots=new Xn({idProperty:"rootName"}),this.differ=new Co(e.markers),this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root","$graveyard"),this.listenTo(e,"applyOperation",(t,n)=>{const i=n[0];if(i.isDocumentOperation&&i.baseVersion!==this.version)throw new T.a("model-document-applyoperation-wrong-version",this,{operation:i})},{priority:"highest"}),this.listenTo(e,"applyOperation",(t,n)=>{const i=n[0];i.isDocumentOperation&&this.differ.bufferOperation(i)},{priority:"high"}),this.listenTo(e,"applyOperation",(t,n)=>{const i=n[0];i.isDocumentOperation&&(this.version++,this.history.addOperation(i))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(e.markers,"update",(t,n,i,r)=>{this.differ.bufferMarkerChange(n.name,i,r,n.affectsData),i===null&&n.on("change",(a,l)=>{this.differ.bufferMarkerChange(n.name,l,n.getRange(),n.affectsData)})})}get graveyard(){return this.getRoot("$graveyard")}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new T.a("model-document-createroot-name-exists",this,{name:t});const n=new Ec(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=X(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const e of this.roots)if(e!==this.graveyard)return e;return this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),t=this.model,n=t.schema,i=t.createPositionFromPath(e,[0]);return n.getNearestSelectionRange(i)||t.createRange(i)}_validateSelectionRange(e){return mf(e.start)&&mf(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 mf(o){const e=o.textNode;if(e){const t=e.data,n=o.offset-e.startOffset;return!ff(t,n)&&!pf(t,n)}return!0}ze(gf,j);class bf{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){return this._markers.has(e)}get(e){return this._markers.get(e)||null}_set(e,t,n=!1,i=!1){const r=e instanceof Xa?e.name:e;if(r.includes(","))throw new T.a("markercollection-incorrect-marker-name",this);const a=this._markers.get(r);if(a){const h=a.getRange();let p=!1;return h.isEqual(t)||(a._attachLiveRange(ko.fromRange(t)),p=!0),n!=a.managedUsingOperations&&(a._managedUsingOperations=n,p=!0),typeof i=="boolean"&&i!=a.affectsData&&(a._affectsData=i,p=!0),p&&this.fire("update:"+r,a,h,t),a}const l=ko.fromRange(t),d=new Xa(r,l,n,i);return this._markers.set(r,d),this.fire("update:"+r,d,null,t),d}_remove(e){const t=e instanceof Xa?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 Xa?e.name:e,n=this._markers.get(t);if(!n)throw new T.a("markercollection-refresh-marker-not-exists",this);const i=n.getRange();this.fire("update:"+t,n,i,i,n.managedUsingOperations,n.affectsData)}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)t.getRange().getIntersection(e)!==null&&(yield t)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}ze(bf,j);class Xa{constructor(e,t,n,i){this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=n,this._affectsData=i}get managedUsingOperations(){if(!this._liveRange)throw new T.a("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new T.a("marker-destroyed",this);return this._affectsData}getStart(){if(!this._liveRange)throw new T.a("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new T.a("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new T.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}}ze(Xa,j);class En extends Oi{get type(){return"noop"}clone(){return new En(this.baseVersion)}getReversed(){return new En(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const Gi={};Gi[an.className]=an,Gi[Tn.className]=Tn,Gi[oi.className]=oi,Gi[Vt.className]=Vt,Gi[En.className]=En,Gi[Oi.className]=Oi,Gi[Qn.className]=Qn,Gi[xo.className]=xo,Gi[Bt.className]=Bt,Gi[mn.className]=mn;class On extends fe{constructor(e,t,n="toNone"){if(super(e,t,n),!this.root.is("rootElement"))throw new T.a("model-liveposition-root-not-rootelement",e);dm.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 dm(){this.listenTo(this.root.document.model,"applyOperation",(o,e)=>{const t=e[0];t.isDocumentOperation&&vf.call(this,t)},{priority:"low"})}function vf(o){const e=this.getTransformedByOperation(o);if(!this.isEqual(e)){const t=this.toPosition();this.path=e.path,this.root=e.root,this.fire("change",t)}}ze(On,j);class wf{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 T.a("insertcontent-invalid-insertion-position",this);this.position=n,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this.nodeToSelect?re._createOn(this.nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new re(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=On.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 T.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=On.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=On.fromPosition(e,"toNext"))}_mergeOnLeft(){const e=this._firstNode;if(!(e instanceof Ot)||!this._canMergeLeft(e))return;const t=On._createBefore(e);t.stickiness="toNext";const n=On.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=On._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=On._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 Ot)||!this._canMergeRight(e))return;const t=On._createAfter(e);if(t.stickiness="toNext",!this.position.isEqual(t))throw new T.a("insertcontent-invalid-insertion-position",this);this.position=fe._createAt(t.nodeBefore,"end");const n=On.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=On._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=On._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 Ot&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){const t=e.nextSibling;return t instanceof Ot&&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 _f(o,e,t={}){if(e.isCollapsed)return;const n=e.getFirstRange();if(n.root.rootName=="$graveyard")return;const i=o.schema;o.change(r=>{if(!t.doNotResetEntireContent&&function(d,h){const p=d.getLimitElement(h);if(!h.containsEntireContent(p))return!1;const b=h.getFirstRange();return b.start.parent==b.end.parent?!1:d.checkChild(p,"paragraph")}(i,e))return void function(d,h){const p=d.model.schema.getLimitElement(h);d.remove(d.createRangeIn(p)),kf(d,d.createPositionAt(p,0),h)}(r,e);const[a,l]=function(d){const h=d.root.document.model,p=d.start;let b=d.end;if(h.hasContent(d,{ignoreMarkers:!0})){const x=function(E){const P=E.parent,D=P.root.document.model.schema,R=P.getAncestors({parentFirst:!0,includeSelf:!0});for(const H of R){if(D.isLimit(H))return null;if(D.isBlock(H))return H}}(b);if(x&&b.isTouching(h.createPositionAt(x,0))){const E=h.createSelection(d);h.modifySelection(E,{direction:"backward"});const P=E.getLastPosition(),D=h.createRange(P,b);h.hasContent(D,{ignoreMarkers:!0})||(b=P)}}return[On.fromPosition(p,"toPrevious"),On.fromPosition(b,"toNext")]}(n);a.isTouching(l)||r.remove(r.createRange(a,l)),t.leaveUnmerged||(function(d,h,p){const b=d.model;if(!gd(d.model.schema,h,p))return;const[x,E]=function(P,D){const R=P.getAncestors(),H=D.getAncestors();let Q=0;for(;R[Q]&&R[Q]==H[Q];)Q++;return[R[Q],H[Q]]}(h,p);!x||!E||(!b.hasContent(x,{ignoreMarkers:!0})&&b.hasContent(E,{ignoreMarkers:!0})?function P(D,R,H,Q){const ae=R.parent,ye=H.parent;if(!(ae==Q||ye==Q)){for(R=D.createPositionAfter(ae),(H=D.createPositionBefore(ye)).isEqual(R)||D.insert(ae,H);R.parent.isEmpty;){const Be=R.parent;R=D.createPositionBefore(Be),D.remove(Be)}H=D.createPositionBefore(ye),function(Be,Kt){const _t=Kt.nodeBefore,Bn=Kt.nodeAfter;_t.name!=Bn.name&&Be.rename(_t,Bn.name),Be.clearAttributes(_t),Be.setAttributes(Object.fromEntries(Bn.getAttributes()),_t),Be.merge(Kt)}(D,H),gd(D.model.schema,R,H)&&P(D,R,H,Q)}}(d,h,p,x.parent):function P(D,R,H,Q){const ae=R.parent,ye=H.parent;if(!(ae==Q||ye==Q)){for(R=D.createPositionAfter(ae),(H=D.createPositionBefore(ye)).isEqual(R)||D.insert(ye,R),D.merge(R);H.parent.isEmpty;){const Be=H.parent;H=D.createPositionBefore(Be),D.remove(Be)}gd(D.model.schema,R,H)&&P(D,R,H,Q)}}(d,h,p,x.parent))}(r,a,l),i.removeDisallowedAttributes(a.parent.getChildren(),r)),yf(r,e,a),!t.doNotAutoparagraph&&function(d,h){const p=d.checkChild(h,"$text"),b=d.checkChild(h,"paragraph");return!p&&b}(i,a)&&kf(r,a,e),a.detach(),l.detach()})}function gd(o,e,t){const n=e.parent,i=t.parent;return n!=i&&!o.isLimit(n)&&!o.isLimit(i)&&function(r,a,l){const d=new re(r,a);for(const h of d.getWalker())if(l.isLimit(h.item))return!1;return!0}(e,t,o)}function kf(o,e,t){const n=o.createElement("paragraph");o.insert(n,e),yf(o,t,o.createPositionAt(n,0))}function yf(o,e,t){e instanceof Di?o.setSelection(t):e.setTo(t)}function xf(o,e){const{isForward:t,walker:n,unit:i,schema:r}=o,{type:a,item:l,nextPosition:d}=e;if(a=="text")return o.unit==="word"?function(h,p){let b=h.position.textNode;if(b){let x=h.position.offset-b.startOffset;for(;!fm(b.data,x,p)&&!pm(b,x,p);){h.next();const E=p?h.position.nodeAfter:h.position.nodeBefore;if(E&&E.is("$text")){const P=E.data.charAt(p?0:E.data.length-1);' ,.?!:;"-()'.includes(P)||(h.next(),b=h.position.textNode)}x=h.position.offset-b.startOffset}}return h.position}(n,t):function(h,p){const b=h.position.textNode;if(b){const x=b.data;let E=h.position.offset-b.startOffset;for(;ff(x,E)||p=="character"&&pf(x,E);)h.next(),E=h.position.offset-b.startOffset}return h.position}(n,i);if(a==(t?"elementStart":"elementEnd")){if(r.isSelectable(l))return fe._createAt(l,t?"after":"before");if(r.checkChild(d,"$text"))return d}else{if(r.isLimit(l))return void n.skip(()=>!0);if(r.checkChild(d,"$text"))return d}}function hm(o,e){const t=o.root,n=fe._createAt(t,e?"end":0);return e?new re(o,n):new re(n,o)}function fm(o,e,t){const n=e+(t?0:-1);return' ,.?!:;"-()'.includes(o.charAt(n))}function pm(o,e,t){return e===(t?o.endOffset:0)}function Cf(o,e){const t=[];Array.from(o.getItems({direction:"backward"})).map(n=>e.createRangeOn(n)).filter(n=>(n.start.isAfter(o.start)||n.start.isEqual(o.start))&&(n.end.isBefore(o.end)||n.end.isEqual(o.end))).forEach(n=>{t.push(n.start.parent),e.remove(n)}),t.forEach(n=>{let i=n;for(;i.parent&&i.isEmpty;){const r=e.createRangeOn(i);i=i.parent,e.remove(r)}})}function gm(o){o.document.registerPostFixer(e=>function(t,n){const i=n.document.selection,r=n.schema,a=[];let l=!1;for(const d of i.getRanges()){const h=mm(d,r);h&&!h.isEqual(d)?(a.push(h),l=!0):a.push(d)}l&&t.setSelection(function(d){const h=[];h.push(d.shift());for(const p of d){const b=h.pop();if(p.isEqual(b))h.push(b);else if(p.isIntersecting(b)){const x=b.start.isAfter(p.start)?p.start:b.start,E=b.end.isAfter(p.end)?b.end:p.end,P=new re(x,E);h.push(P)}else h.push(b),h.push(p)}return h}(a),{backward:i.isBackward})}(e,o))}function mm(o,e){return o.isCollapsed?function(t,n){const i=t.start,r=n.getNearestSelectionRange(i);if(!r)return null;if(!r.isCollapsed)return r;const a=r.start;return i.isEqual(a)?null:new re(a)}(o,e):function(t,n){const{start:i,end:r}=t,a=n.checkChild(i,"$text"),l=n.checkChild(r,"$text"),d=n.getLimitElement(i),h=n.getLimitElement(r);if(d===h){if(a&&l)return null;if(function(x,E,P){const D=x.nodeAfter&&!P.isLimit(x.nodeAfter)||P.checkChild(x,"$text"),R=E.nodeBefore&&!P.isLimit(E.nodeBefore)||P.checkChild(E,"$text");return D||R}(i,r,n)){const x=i.nodeAfter&&n.isSelectable(i.nodeAfter)?null:n.getNearestSelectionRange(i,"forward"),E=r.nodeBefore&&n.isSelectable(r.nodeBefore)?null:n.getNearestSelectionRange(r,"backward"),P=x?x.start:i,D=E?E.end:r;return new re(P,D)}}const p=d&&!d.is("rootElement"),b=h&&!h.is("rootElement");if(p||b){const x=i.nodeAfter&&r.nodeBefore&&i.nodeAfter.parent===r.nodeBefore.parent,E=p&&(!x||!Tf(i.nodeAfter,n)),P=b&&(!x||!Tf(r.nodeBefore,n));let D=i,R=r;return E&&(D=fe._createBefore(wi(d,n))),P&&(R=fe._createAfter(wi(h,n))),new re(D,R)}return null}(o,e)}function wi(o,e){let t=o,n=t;for(;e.isLimit(n)&&n.parent;)t=n,n=n.parent;return t}function Tf(o,e){return o&&e.isSelectable(o)}class Ef{constructor(){this.markers=new bf,this.document=new gf(this),this.schema=new uf,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}),gm(this),this.document.registerPostFixer(vc)}change(e){try{return this._pendingChanges.length===0?(this._pendingChanges.push({batch:new xc,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(t){T.a.rethrowUnexpectedError(t,this)}}enqueueChange(e,t){try{typeof e=="string"?e=new xc(e):typeof e=="function"&&(t=e,e=new xc),this._pendingChanges.push({batch:e,callback:t}),this._pendingChanges.length==1&&this._runPendingChanges()}catch(n){T.a.rethrowUnexpectedError(n,this)}}applyOperation(e){e._execute()}insertContent(e,t,n){return function(i,r,a,l){return i.change(d=>{let h;h=a?a instanceof _o||a instanceof Di?a:d.createSelection(a,l):i.document.selection,h.isCollapsed||i.deleteContent(h,{doNotAutoparagraph:!0});const p=new wf(i,d,h.anchor);let b;b=r.is("documentFragment")?r.getChildren():[r],p.handleNodes(b);const x=p.getSelectionRange();x&&(h instanceof Di?d.setSelection(x):h.setTo(x));const E=p.getAffectedRange()||i.createRange(h.anchor);return p.destroy(),E})}(this,e,t,n)}deleteContent(e,t){_f(this,e,t)}modifySelection(e,t){(function(n,i,r={}){const a=n.schema,l=r.direction!="backward",d=r.unit?r.unit:"character",h=i.focus,p=new Ki({boundaries:hm(h,l),singleCharacters:!0,direction:l?"forward":"backward"}),b={walker:p,schema:a,isForward:l,unit:d};let x;for(;x=p.next();){if(x.done)return;const E=xf(b,x.value);if(E)return void(i instanceof Di?n.change(P=>{P.setSelectionFocus(E)}):i.setFocus(E))}})(this,e,t)}getSelectedContent(e){return function(t,n){return t.change(i=>{const r=i.createDocumentFragment(),a=n.getFirstRange();if(!a||a.isCollapsed)return r;const l=a.start.root,d=a.start.getCommonPath(a.end),h=l.getNodeByPath(d);let p;p=a.start.parent==a.end.parent?a:i.createRange(i.createPositionAt(h,a.start.path[d.length]),i.createPositionAt(h,a.end.path[d.length]+1));const b=p.end.offset-p.start.offset;for(const x of p.getItems({shallow:!0}))x.is("$textProxy")?i.appendText(x.data,x.getAttributes(),r):i.append(i.cloneElement(x,!0),r);if(p!=a){const x=a._getTransformedByMove(p.start,i.createPositionAt(r,0),b)[0],E=i.createRange(i.createPositionAt(r,0),x.start);Cf(i.createRange(x.end,i.createPositionAt(r,"end")),i),Cf(E,i)}return r})}(this,e)}hasContent(e,t={}){const n=e instanceof Ot?re._createIn(e):e;if(n.isCollapsed)return!1;const{ignoreWhitespaces:i=!1,ignoreMarkers:r=!1}=t;if(!r){for(const a of this.markers.getMarkersIntersectingRange(n))if(a.affectsData)return!0}for(const a of n.getItems())if(this.schema.isContent(a)&&(!a.is("$textProxy")||!i||a.data.search(/\S/)!==-1))return!0;return!1}createPositionFromPath(e,t,n){return new 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 re(e,t)}createRangeIn(e){return re._createIn(e)}createRangeOn(e){return re._createOn(e)}createSelection(e,t,n){return new _o(e,t,n)}createBatch(e){return new xc(e)}createOperationFromJSON(e){return(class{static fromJSON(t,n){return Gi[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 Za(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}}ze(Ef,$t);class bm extends mi{constructor(e){super(),this.editor=e}set(e,t,n={}){if(typeof t=="string"){const i=t;t=(r,a)=>{this.editor.execute(i),a()}}super.set(e,t,n)}}class md{constructor(e={}){this._context=e.context||new A({language:e.language}),this._context._addEditor(this,!e.context);const t=Array.from(this.constructor.builtinPlugins||[]);this.config=new ms(e,this.constructor.defaultConfig),this.config.define("plugins",t),this.config.define(this._context._getEditorConfig()),this.plugins=new bs(this,t,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this.commands=new lf,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 Ef;const n=new Ch;this.data=new dd(this.model,n),this.editing=new od(this.model,n),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new am([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 bm(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const e=this.config,t=e.get("plugins"),n=e.get("removePlugins")||[],i=e.get("extraPlugins")||[],r=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(i),n,r)}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){T.a.rethrowUnexpectedError(t,this)}}focus(){this.editing.view.focus()}}ze(md,$t);class vm{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(bd(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new T.a("componentfactory-item-missing",this,{name:e});return this._components.get(bd(e)).callback(this.editor.locale)}has(e){return this._components.has(bd(e))}}function bd(o){return String(o).toLowerCase()}class Sf{constructor(e){this.editor=e,this.componentFactory=new vm(e),this.focusTracker=new Mi,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}}ze(Sf,j);var wm={setData(o){this.data.set(o)},getData(o){return this.data.get(o)}},vd={updateSourceElement(){if(!this.sourceElement)throw new T.a("editor-missing-sourceelement",this);var o,e;o=this.sourceElement,e=this.data.get(),o instanceof HTMLTextAreaElement&&(o.value=e),o.innerHTML=e}};class Af extends N{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new Xn({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if(typeof e!="string")throw new T.a("pendingactions-add-invalid-message",this);const t=Object.create($t);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 _i={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 wd({emitter:o,activator:e,callback:t,contextElements:n}){o.listenTo(document,"mousedown",(i,r)=>{if(!e())return;const a=typeof r.composedPath=="function"?r.composedPath():[];for(const l of n)if(l.contains(r.target)||a.includes(l))return;t()})}function _d(o){o.set("_isCssTransitionsDisabled",!1),o.disableCssTransitions=()=>{o._isCssTransitionsDisabled=!0},o.enableCssTransitions=()=>{o._isCssTransitionsDisabled=!1},o.extendTemplate({attributes:{class:[o.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}function kd({view:o}){o.listenTo(o.element,"submit",(e,t)=>{t.preventDefault(),o.fire("submit")},{useCapture:!0})}class Qr extends Xn{constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(t,n,i)=>{this._renderViewIntoCollectionParent(n,i)}),this.on("remove",(t,n)=>{n.element&&this._parentElement&&n.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(const t of this)this._renderViewIntoCollectionParent(t)}delegate(...e){if(!e.length||!e.every(t=>typeof t=="string"))throw new T.a("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const n of this)for(const i of e)n.delegate(i).to(t);this.on("add",(n,i)=>{for(const r of e)i.delegate(r).to(t)}),this.on("remove",(n,i)=>{for(const r of e)i.stopDelegating(r,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}}w(15);class gt{constructor(e){this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new Xn,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=ki.bind(this,this)}createCollection(e){const t=new Qr(e);return this._viewCollections.add(t),t}registerChild(e){Wn(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){Wn(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new ki(e)}extendTemplate(e){ki.extend(this.template,e)}render(){if(this.isRendered)throw new T.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)}}ze(gt,Wr),ze(gt,$t);class ki{constructor(e){Object.assign(this,Mf(If(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 T.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)Ic(n)?yield n:yd(n)&&(yield*e(n))}(this)}static bind(e,t){return{to:(n,i)=>new _m({eventNameOrFunction:n,attribute:n,observable:e,emitter:t,callback:i}),if:(n,i,r)=>new Nf({observable:e,emitter:t,attribute:n,valueIfTrue:i,callback:r})}}static extend(e,t){if(e._isRendered)throw new T.a("template-extend-render",[this,e]);(function n(i,r){if(r.attributes&&(i.attributes||(i.attributes={}),Pc(i.attributes,r.attributes)),r.eventListeners&&(i.eventListeners||(i.eventListeners={}),Pc(i.eventListeners,r.eventListeners)),r.text&&i.text.push(...r.text),r.children&&r.children.length){if(i.children.length!=r.children.length)throw new T.a("ui-template-extend-children-mismatch",i);let a=0;for(const l of r.children)n(i.children[a++],l)}})(e,Mf(If(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new T.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(""),Nc(this.text)?this._bindToObservable({schema:this.text,updater:km(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){let t,n,i,r;if(!this.attributes)return;const a=e.node,l=e.revertData;for(t in this.attributes)if(i=a.getAttribute(t),n=this.attributes[t],l&&(l.attributes[t]=i),r=ne(n[0])&&n[0].ns?n[0].ns:null,Nc(n)){const d=r?n[0].value:n;l&&jf(t)&&d.unshift(i),this._bindToObservable({schema:d,updater:ym(a,t,r),data:e})}else t=="style"&&typeof n[0]!="string"?this._renderStyleAttribute(n[0],e):(l&&i&&jf(t)&&n.unshift(i),n=n.map(d=>d&&d.value||d).reduce((d,h)=>d.concat(h),[]).reduce(Of,""),Yr(n)||a.setAttributeNS(r,t,n))}_renderStyleAttribute(e,t){const n=t.node;for(const i in e){const r=e[i];Nc(r)?this._bindToObservable({schema:[r],updater:xm(n,i),data:t}):n.style[i]=r}}_renderElementChildren(e){const t=e.node,n=e.intoFragment?document.createDocumentFragment():t,i=e.isApplying;let r=0;for(const a of this.children)if(xd(a)){if(!i){a.setParent(t);for(const l of a)n.appendChild(l.element)}}else if(Ic(a))i||(a.isRendered||a.render(),n.appendChild(a.element));else if(Ur(a))n.appendChild(a);else if(i){const l={children:[],bindings:[],attributes:{}};e.revertData.children.push(l),a._renderNode({node:n.childNodes[r++],isApplying:!0,revertData:l})}else n.appendChild(a.render());e.intoFragment&&t.appendChild(n)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const n=this.eventListeners[t].map(i=>{const[r,a]=t.split("@");return i.activateDomEventListener(r,a,e)});e.revertData&&e.revertData.bindings.push(n)}}_bindToObservable({schema:e,updater:t,data:n}){const i=n.revertData;Pf(e,t,n);const r=e.filter(a=>!Yr(a)).filter(a=>a.observable).map(a=>a.activateAttributeListener(e,t,n));i&&i.bindings.push(r)}_revertTemplateFromNode(e,t){for(const n of t.bindings)for(const i of n)i();if(t.text)e.textContent=t.text;else{for(const n in t.attributes){const i=t.attributes[n];i===null?e.removeAttribute(n):e.setAttribute(n,i)}for(let n=0;n<t.children.length;++n)this._revertTemplateFromNode(e.childNodes[n],t.children[n])}}}ze(ki,j);class el{constructor(e){Object.assign(this,e)}getValue(e){const t=this.observable[this.attribute];return this.callback?this.callback(t,e):t}activateAttributeListener(e,t,n){const i=()=>Pf(e,t,n);return this.emitter.listenTo(this.observable,"change:"+this.attribute,i),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,i)}}}class _m extends el{activateDomEventListener(e,t,n){const i=(r,a)=>{t&&!a.target.matches(t)||(typeof this.eventNameOrFunction=="function"?this.eventNameOrFunction(a):this.observable.fire(this.eventNameOrFunction,a))};return this.emitter.listenTo(n.node,e,i),()=>{this.emitter.stopListening(n.node,e,i)}}}class Nf extends el{getValue(e){return!Yr(super.getValue(e))&&(this.valueIfTrue||!0)}}function Nc(o){return!!o&&(o.value&&(o=o.value),Array.isArray(o)?o.some(Nc):o instanceof el)}function Pf(o,e,{node:t}){let n=function(i,r){return i.map(a=>a instanceof el?a.getValue(r):a)}(o,t);n=o.length==1&&o[0]instanceof Nf?n[0]:n.reduce(Of,""),Yr(n)?e.remove():e.set(n)}function km(o){return{set(e){o.textContent=e},remove(){o.textContent=""}}}function ym(o,e,t){return{set(n){o.setAttributeNS(t,e,n)},remove(){o.removeAttributeNS(t,e)}}}function xm(o,e){return{set(t){o.style[e]=t},remove(){o.style[e]=null}}}function If(o){return Lo(o,e=>{if(e&&(e instanceof el||yd(e)||Ic(e)||xd(e)))return e})}function Mf(o){if(typeof o=="string"?o=function(e){return{text:[e]}}(o):o.text&&function(e){e.text=Tt(e.text)}(o),o.on&&(o.eventListeners=function(e){for(const t in e)Df(e,t);return e}(o.on),delete o.on),!o.text){o.attributes&&function(t){for(const n in t)t[n].value&&(t[n].value=Tt(t[n].value)),Df(t,n)}(o.attributes);const e=[];if(o.children)if(xd(o.children))e.push(o.children);else for(const t of o.children)yd(t)||Ic(t)||Ur(t)?e.push(t):e.push(new ki(t));o.children=e}return o}function Df(o,e){o[e]=Tt(o[e])}function Of(o,e){return Yr(e)?o:Yr(o)?e:`${o} ${e}`}function Pc(o,e){for(const t in e)o[t]?o[t].push(...e[t]):o[t]=e[t]}function Yr(o){return!o&&o!==0}function Ic(o){return o instanceof gt}function yd(o){return o instanceof ki}function xd(o){return o instanceof Qr}function jf(o){return o=="class"||o=="style"}class Cm extends Qr{constructor(e,t=[]){super(t),this.locale=e}attachToDom(){this._bodyCollectionContainer=new ki({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let e=document.querySelector(".ck-body-wrapper");e||(e=function(t,n,i={},r=[]){const a=i&&i.xmlns,l=a?t.createElementNS(a,n):t.createElement(n);for(const d in i)l.setAttribute(d,i[d]);!Ku(r)&&Wn(r)||(r=[r]);for(let d of r)Ku(d)&&(d=t.createTextNode(d)),l.appendChild(d);return l}(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()}}w(17);class Mc extends gt{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})}}w(19);class Rf extends gt{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")}]}]})}}w(21);class Xt extends gt{constructor(e){super(e);const t=this.bindTemplate,n=M();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 Mc,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this)),this.setTemplate({tag:"button",attributes:{class:["ck","ck-button",t.to("class"),t.if("isEnabled","ck-disabled",i=>!i),t.if("isVisible","ck-hidden",i=>!i),t.to("isOn",i=>i?"ck-on":"ck-off"),t.if("withText","ck-button_with-text"),t.if("withKeystroke","ck-button_with-keystroke")],type:t.to("type",i=>i||"button"),tabindex:t.to("tabindex"),"aria-labelledby":"ck-editor__aria-label_"+n,"aria-disabled":t.if("isEnabled",!0,i=>!i),"aria-pressed":t.to("isOn",i=>!!this.isToggleable&&String(i))},children:this.children,on:{mousedown:t.to(i=>{i.preventDefault()}),click:t.to(i=>{this.isEnabled?this.fire("execute"):i.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView),this.withKeystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createTooltipView(){const e=new Rf;return e.bind("text").to(this,"_tooltipString"),e.bind("position").to(this,"tooltipPosition"),e}_createLabelView(e){const t=new gt,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 gt;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>Ma(t))}]}),e}_getTooltipString(e,t,n){return e?typeof e=="string"?e:(n&&(n=Ma(n)),e instanceof Function?e(t,n):`${t}${n?` (${n})`:""}`):""}}w(23);class Dc extends Xt{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 gt;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}class Es{constructor(e){if(Object.assign(this,e),e.actions&&e.keystrokeHandler)for(const t in e.actions){let n=e.actions[t];typeof n=="string"&&(n=[n]);for(const i of n)e.keystrokeHandler.set(i,(r,a)=>{this[t](),a()})}}get first(){return this.focusables.find(Ss)||null}get last(){return this.focusables.filter(Ss).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;return this.focusTracker.focusedElement===null?null:(this.focusables.find((t,n)=>{const i=t.element===this.focusTracker.focusedElement;return i&&(e=n),i}),e)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){e&&e.focus()}_getFocusableItem(e){const t=this.current,n=this.focusables.length;if(!n)return null;if(t===null)return this[e===1?"first":"last"];let i=(t+n+e)%n;do{const r=this.focusables.get(i);if(Ss(r))return r;i=(i+n+e)%n}while(i!==t);return null}}function Ss(o){return!(!o.focus||Ft.window.getComputedStyle(o.element).display=="none")}w(25);var Lf='<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z"/></svg>';class Vf extends Xt{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 Mc;return e.content=Lf,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}w(27);class zf extends gt{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 mi,this.focusTracker=new Mi,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 Xt;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 Xt,t=e.bindTemplate;return e.icon=Lf,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 Tm extends gt{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()}}}w(29);function Ff({element:o,target:e,positions:t,limiter:n,fitInViewport:i}){xe(e)&&(e=e()),xe(n)&&(n=n());const r=function(b){return b&&b.parentNode?b.offsetParent===Ft.document.body?null:b.offsetParent:null}(o),a=new St(o),l=new St(e);let d,h;n||i?[h,d]=function(x,E){const{elementRect:P,viewportRect:D}=E,R=P.getArea(),H=function(Q,{targetRect:ae,elementRect:ye,limiterRect:Be,viewportRect:Kt}){const _t=[],Bn=ye.getArea();for(const Jn of Q){const Hn=Cd(Jn,ae,ye);if(!Hn)continue;const[ji,si]=Hn;let Ti=0,ns=0;if(Be)if(Kt){const th=Be.getIntersection(Kt);th&&(Ti=th.getIntersectionArea(si))}else Ti=Be.getIntersectionArea(si);Kt&&(ns=Kt.getIntersectionArea(si));const eh={positionName:ji,positionRect:si,limiterIntersectArea:Ti,viewportIntersectArea:ns};if(Ti===Bn)return[eh];_t.push(eh)}return _t}(x,E);if(D){const Q=Bf(H.filter(({viewportIntersectArea:ae})=>ae===R),R);if(Q)return Q}return Bf(H,R)}(t,{targetRect:l,elementRect:a,limiterRect:n&&new St(n).getVisible(),viewportRect:i&&new St(Ft.window)})||Cd(t[0],l,a):[h,d]=Cd(t[0],l,a);let p=Hf(d);return r&&(p=function({left:b,top:x},E){const P=Hf(new St(E)),D=qu(E);return b-=P.left,x-=P.top,b+=E.scrollLeft,x+=E.scrollTop,b-=D.left,x-=D.top,{left:b,top:x}}(p,r)),{left:p.left,top:p.top,name:h}}function Cd(o,e,t){const n=o(e,t);if(!n)return null;const{left:i,top:r,name:a}=n;return[a,t.clone().moveTo(i,r)]}function Bf(o,e){let t,n,i=0;for(const{positionName:r,positionRect:a,limiterIntersectArea:l,viewportIntersectArea:d}of o){if(l===e)return[r,a];const h=d**2+l**2;h>i&&(i=h,t=a,n=r)}return t?[n,t]:null}function Hf({left:o,top:e}){const{scrollX:t,scrollY:n}=Ft.window;return{left:o+t,top:e+n}}class As extends gt{constructor(e,t,n){super(e);const i=this.bindTemplate;this.buttonView=t,this.panelView=n,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class"),this.set("id"),this.set("panelPosition","auto"),this.keystrokes=new mi,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",i.to("class"),i.if("isEnabled","ck-disabled",r=>!r)],id:i.to("id"),"aria-describedby":i.to("ariaDescribedById")},children:[t,n]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",()=>{this.isOpen&&(this.panelPosition==="auto"?this.panelView.position=As._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)}),this.keystrokes.listenTo(this.element);const e=(t,n)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,n())};this.keystrokes.set("arrowdown",(t,n)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,n())}),this.keystrokes.set("arrowright",(t,n)=>{this.isOpen&&n()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:e,north:t,southEast:n,southWest:i,northEast:r,northWest:a,southMiddleEast:l,southMiddleWest:d,northMiddleEast:h,northMiddleWest:p}=As.defaultPanelPositions;return this.locale.uiLanguageDirection!=="rtl"?[n,i,l,d,e,r,a,h,p,t]:[i,n,d,l,e,a,r,p,h,t]}}As.defaultPanelPositions={south:(o,e)=>({top:o.bottom,left:o.left-(e.width-o.width)/2,name:"s"}),southEast:o=>({top:o.bottom,left:o.left,name:"se"}),southWest:(o,e)=>({top:o.bottom,left:o.left-e.width+o.width,name:"sw"}),southMiddleEast:(o,e)=>({top:o.bottom,left:o.left-(e.width-o.width)/4,name:"sme"}),southMiddleWest:(o,e)=>({top:o.bottom,left:o.left-3*(e.width-o.width)/4,name:"smw"}),north:(o,e)=>({top:o.top-e.height,left:o.left-(e.width-o.width)/2,name:"n"}),northEast:(o,e)=>({top:o.top-e.height,left:o.left,name:"ne"}),northWest:(o,e)=>({top:o.top-e.height,left:o.left-e.width+o.width,name:"nw"}),northMiddleEast:(o,e)=>({top:o.top-e.height,left:o.left-(e.width-o.width)/4,name:"nme"}),northMiddleWest:(o,e)=>({top:o.top-e.height,left:o.left-3*(e.width-o.width)/4,name:"nmw"})},As._getOptimalPosition=Ff;class $f extends gt{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class Em extends gt{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function Uf(o){return Array.isArray(o)?{items:o,removeItems:[]}:o?Object.assign({items:[],removeItems:[]},o):{items:[],removeItems:[]}}w(31);class Td extends gt{constructor(e,t){super(e);const n=this.bindTemplate,i=this.t;this.options=t||{},this.set("ariaLabel",i("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new Mi,this.keystrokes=new mi,this.set("class"),this.set("isCompact",!1),this.itemsView=new Sm(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const r=e.uiLanguageDirection==="rtl";this._focusCycler=new Es({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[r?"arrowright":"arrowleft","arrowup"],focusNext:[r?"arrowleft":"arrowright","arrowdown"]}});const a=["ck","ck-toolbar",n.to("class"),n.if("isCompact","ck-toolbar_compact")];var l;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:(l=this,l.bindTemplate.to(d=>{d.target===l.element&&d.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new Nm(this):new Am(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=Uf(e),i=n.items.filter((a,l,d)=>a==="|"||n.removeItems.indexOf(a)===-1&&(a==="-"?!this.options.shouldGroupWhenFull||(Object(T.b)("toolbarview-line-break-ignored-when-grouping-items",d),!1):!!t.has(a)||(Object(T.b)("toolbarview-item-unavailable",{name:a}),!1))),r=this._cleanSeparators(i).map(a=>a==="|"?new $f:a==="-"?new Em:t.create(a));this.items.addMany(r)}_cleanSeparators(e){const t=a=>a!=="-"&&a!=="|",n=e.length,i=e.findIndex(t),r=n-e.slice().reverse().findIndex(t);return e.slice(i,r).filter((a,l,d)=>t(a)?!0:!(l>0&&d[l-1]===a))}}class Sm extends gt{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Am{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 Nm{constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,e.itemsView.children.bindTo(this.ungroupedItems).using(t=>t),this.ungroupedItems.on("add",this._updateFocusCycleableItems.bind(this)),this.ungroupedItems.on("remove",this._updateFocusCycleableItems.bind(this)),e.children.on("add",this._updateFocusCycleableItems.bind(this)),e.children.on("remove",this._updateFocusCycleableItems.bind(this)),e.items.on("change",(t,n)=>{const i=n.index;for(const r of n.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(r):this.ungroupedItems.remove(r);for(let r=i;r<i+n.added.length;r++){const a=n.added[r-i];r>this.ungroupedItems.length?this.groupedItems.add(a,r-this.ungroupedItems.length):this.ungroupedItems.add(a,r)}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 St(e.lastChild),i=new St(e);if(!this.cachedPadding){const r=Ft.window.getComputedStyle(e),a=t==="ltr"?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(r[a])}return t==="ltr"?n.right>i.right-this.cachedPadding:n.left<i.left+this.cachedPadding}_enableGroupingOnResize(){let e;this.resizeObserver=new Zt(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 $f),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=Jr(e);return n.class="ck-toolbar__grouped-dropdown",n.panelPosition=e.uiLanguageDirection==="ltr"?"sw":"se",qf(n,[]),n.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:e.uiLanguageDirection==="rtl"?"se":"sw",icon:_i.threeVerticalDots}),n.toolbarView.items.bindTo(this.groupedItems).using(i=>i),n}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}w(33);class Wf extends gt{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new Mi,this.keystrokes=new mi,this._focusCycler=new Es({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 Kf extends gt{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 Pm extends gt{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}w(35),w(37);function Jr(o,e=Vf){const t=new e(o),n=new Tm(o),i=new As(o,t,n);return t.bind("isEnabled").to(i),t instanceof Vf?t.bind("isOn").to(i,"isOpen"):t.arrowView.bind("isOn").to(i,"isOpen"),function(r){(function(a){a.on("render",()=>{wd({emitter:a,activator:()=>a.isOpen,callback:()=>{a.isOpen=!1},contextElements:[a.element]})})})(r),function(a){a.on("execute",l=>{l.source instanceof Dc||(a.isOpen=!1)})}(r),function(a){a.keystrokes.set("arrowdown",(l,d)=>{a.isOpen&&(a.panelView.focus(),d())}),a.keystrokes.set("arrowup",(l,d)=>{a.isOpen&&(a.panelView.focusLast(),d())})}(r)}(i),i}function qf(o,e){const t=o.locale,n=t.t,i=o.toolbarView=new Td(t);i.set("ariaLabel",n("Dropdown toolbar")),o.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.map(r=>i.items.add(r)),o.panelView.children.add(i),i.items.delegate("execute").to(o)}function Gf(o,e){const t=o.locale,n=o.listView=new Wf(t);n.items.bindTo(e).using(({type:i,model:r})=>{if(i==="separator")return new Pm(t);if(i==="button"||i==="switchbutton"){const a=new Kf(t);let l;return l=i==="button"?new Xt(t):new Dc(t),l.bind(...Object.keys(r)).to(r),l.delegate("execute").to(a),a.children.add(l),a}}),o.panelView.children.add(n),n.items.delegate("execute").to(o)}w(39);class Oc extends gt{constructor(e){super(e),this.body=new Cm(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}w(41);class Qf extends gt{constructor(e){super(e),this.set("text"),this.set("for"),this.id="ck-editor__label_"+M();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 Im extends Oc{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 Qf;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class Mm extends gt{constructor(e,t,n){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=n,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){const e=this._editingView;function t(n){e.change(i=>{const r=e.document.getRoot(n.name);i.addClass(n.isFocused?"ck-focused":"ck-blurred",r),i.removeClass(n.isFocused?"ck-blurred":"ck-focused",r)})}e.isRenderingInProgress?function n(i){e.once("change:isRenderingInProgress",(r,a,l)=>{l?n(i):t(i)})}(this):t(this)}}class Dm extends Mm{constructor(e,t,n){super(e,t,n),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView,t=this.t;e.change(n=>{const i=e.document.getRoot(this.name);n.setAttribute("aria-label",t("Rich Text Editor, %0",this.name),i)})}}w(43),w(45);class Om extends gt{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 Mi,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:""}}w(47);class Ed extends gt{constructor(e,t){super(e);const n="ck-labeled-field-view-"+M(),i="ck-labeled-field-view-status-"+M();this.fieldView=t(this,n,i),this.set("label"),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class"),this.set("placeholder"),this.labelView=this._createLabelView(n),this.statusView=this._createStatusView(i),this.bind("_statusText").to(this,"errorText",this,"infoText",(a,l)=>a||l);const r=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",r.to("class"),r.if("isEnabled","ck-disabled",a=>!a),r.if("isEmpty","ck-labeled-field-view_empty"),r.if("isFocused","ck-labeled-field-view_focused"),r.if("placeholder","ck-labeled-field-view_placeholder"),r.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:[this.fieldView,this.labelView]},this.statusView]})}_createLabelView(e){const t=new Qf(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new gt(this.locale),n=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",n.if("errorText","ck-labeled-field-view__status_error"),n.if("_statusText","ck-hidden",i=>!i)],id:e,role:n.if("errorText","alert")},children:[{text:n.to("_statusText")}]}),t}focus(){this.fieldView.focus()}}function Sd(o,e,t){const n=new Om(o.locale);return n.set({id:e,ariaDescribedById:t}),n.bind("isReadOnly").to(o,"isEnabled",i=>!i),n.bind("hasError").to(o,"errorText",i=>!!i),n.on("input",()=>{o.errorText=null}),o.bind("isEmpty","isFocused","placeholder").to(n),n}class Ad extends N{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 Nd{constructor(e,t){t&&Er(this,t),e&&this.set(e)}}ze(Nd,$t),w(49);const Yf=ut("px"),Jf=Ft.document.body;class dt extends gt{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",Yf),left:t.to("left",Yf)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){this.show();const t=dt.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:Jf,fitInViewport:!0},e),i=dt._getOptimalPosition(n),r=parseInt(i.left),a=parseInt(i.top),l=i.name;Object.assign(this,{top:a,left:r,position:l})}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=Pd(e.target),n=e.limiter?Pd(e.limiter):Jf;this.listenTo(Ft.document,"scroll",(i,r)=>{const a=r.target,l=t&&a.contains(t),d=n&&a.contains(n);!l&&!d&&t&&n||this.attachTo(e)},{useCapture:!0}),this.listenTo(Ft.window,"resize",()=>{this.attachTo(e)})}_stopPinning(){this.stopListening(Ft.document,"scroll"),this.stopListening(Ft.window,"resize")}}function Pd(o){return Ai(o)?o:lc(o)?o.commonAncestorContainer:typeof o=="function"?Pd(o()):null}function Vn(o,e){return o.top-e.height-dt.arrowVerticalOffset}function zn(o){return o.bottom+dt.arrowVerticalOffset}dt.arrowHorizontalOffset=25,dt.arrowVerticalOffset=10,dt._getOptimalPosition=Ff,dt.defaultPositions={northWestArrowSouthWest:(o,e)=>({top:Vn(o,e),left:o.left-dt.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthMiddleWest:(o,e)=>({top:Vn(o,e),left:o.left-.25*e.width-dt.arrowHorizontalOffset,name:"arrow_smw"}),northWestArrowSouth:(o,e)=>({top:Vn(o,e),left:o.left-e.width/2,name:"arrow_s"}),northWestArrowSouthMiddleEast:(o,e)=>({top:Vn(o,e),left:o.left-.75*e.width+dt.arrowHorizontalOffset,name:"arrow_sme"}),northWestArrowSouthEast:(o,e)=>({top:Vn(o,e),left:o.left-e.width+dt.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(o,e)=>({top:Vn(o,e),left:o.left+o.width/2-dt.arrowHorizontalOffset,name:"arrow_sw"}),northArrowSouthMiddleWest:(o,e)=>({top:Vn(o,e),left:o.left+o.width/2-.25*e.width-dt.arrowHorizontalOffset,name:"arrow_smw"}),northArrowSouth:(o,e)=>({top:Vn(o,e),left:o.left+o.width/2-e.width/2,name:"arrow_s"}),northArrowSouthMiddleEast:(o,e)=>({top:Vn(o,e),left:o.left+o.width/2-.75*e.width+dt.arrowHorizontalOffset,name:"arrow_sme"}),northArrowSouthEast:(o,e)=>({top:Vn(o,e),left:o.left+o.width/2-e.width+dt.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(o,e)=>({top:Vn(o,e),left:o.right-dt.arrowHorizontalOffset,name:"arrow_sw"}),northEastArrowSouthMiddleWest:(o,e)=>({top:Vn(o,e),left:o.right-.25*e.width-dt.arrowHorizontalOffset,name:"arrow_smw"}),northEastArrowSouth:(o,e)=>({top:Vn(o,e),left:o.right-e.width/2,name:"arrow_s"}),northEastArrowSouthMiddleEast:(o,e)=>({top:Vn(o,e),left:o.right-.75*e.width+dt.arrowHorizontalOffset,name:"arrow_sme"}),northEastArrowSouthEast:(o,e)=>({top:Vn(o,e),left:o.right-e.width+dt.arrowHorizontalOffset,name:"arrow_se"}),southWestArrowNorthWest:(o,e)=>({top:zn(o),left:o.left-dt.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthMiddleWest:(o,e)=>({top:zn(o),left:o.left-.25*e.width-dt.arrowHorizontalOffset,name:"arrow_nmw"}),southWestArrowNorth:(o,e)=>({top:zn(o),left:o.left-e.width/2,name:"arrow_n"}),southWestArrowNorthMiddleEast:(o,e)=>({top:zn(o),left:o.left-.75*e.width+dt.arrowHorizontalOffset,name:"arrow_nme"}),southWestArrowNorthEast:(o,e)=>({top:zn(o),left:o.left-e.width+dt.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(o,e)=>({top:zn(o),left:o.left+o.width/2-dt.arrowHorizontalOffset,name:"arrow_nw"}),southArrowNorthMiddleWest:(o,e)=>({top:zn(o),left:o.left+o.width/2-.25*e.width-dt.arrowHorizontalOffset,name:"arrow_nmw"}),southArrowNorth:(o,e)=>({top:zn(o),left:o.left+o.width/2-e.width/2,name:"arrow_n"}),southArrowNorthMiddleEast:(o,e)=>({top:zn(o),left:o.left+o.width/2-.75*e.width+dt.arrowHorizontalOffset,name:"arrow_nme"}),southArrowNorthEast:(o,e)=>({top:zn(o),left:o.left+o.width/2-e.width+dt.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(o,e)=>({top:zn(o),left:o.right-dt.arrowHorizontalOffset,name:"arrow_nw"}),southEastArrowNorthMiddleWest:(o,e)=>({top:zn(o),left:o.right-.25*e.width-dt.arrowHorizontalOffset,name:"arrow_nmw"}),southEastArrowNorth:(o,e)=>({top:zn(o),left:o.right-e.width/2,name:"arrow_n"}),southEastArrowNorthMiddleEast:(o,e)=>({top:zn(o),left:o.right-.75*e.width+dt.arrowHorizontalOffset,name:"arrow_nme"}),southEastArrowNorthEast:(o,e)=>({top:zn(o),left:o.right-e.width+dt.arrowHorizontalOffset,name:"arrow_ne"})},w(51),w(53);const Ns=ut("px");class tl 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 dt(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 T.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 T.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 T.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 Zf(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(n,i)=>!i&&n>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(n,i)=>{if(i<2)return"";const r=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[r,i])}),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){const e=new Xf(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,n)=>!n&&t>=2?Math.min(t-1,2):0),e.listenTo(this.view,"change:top",()=>e.updatePosition()),e.listenTo(this.view,"change:left",()=>e.updatePosition()),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:n=!0,singleViewMode:i=!1}){this.view.class=t,this.view.withArrow=n,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),i&&(this._singleViewMode=!0)}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&!e.limiter&&(e=Object.assign({},e,{limiter:this.positionLimiter})),e}}class Zf extends gt{constructor(e){super(e);const t=e.t,n=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new Mi,this.buttonPrevView=this._createButtonView(t("Previous"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z"/></svg>'),this.buttonNextView=this._createButtonView(t("Next"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.537 14.813a.888.888 0 1 1-1.254-1.255L10.84 10 7.283 6.442a.888.888 0 1 1 1.254-1.255L12.74 9.39a.888.888 0 0 1-.16 1.382l-4.043 4.042z"/></svg>'),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",n.to("isNavigationVisible",i=>i?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:n.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const n=new Xt(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n}}class Xf extends gt{constructor(e,t){super(e);const n=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",n.to("numberOfPanels",i=>i?"":"ck-hidden")],style:{top:n.to("top",Ns),left:n.to("left",Ns),width:n.to("width",Ns),height:n.to("height",Ns)}},children:this.content}),this.on("change:numberOfPanels",(i,r,a,l)=>{a>l?this._addPanels(a-l):this._removePanels(l-a),this.updatePosition()})}_addPanels(e){for(;e--;){const t=new gt;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(e){for(;e--;){const t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView,{width:n,height:i}=new St(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:n,height:i})}}}w(55);const Ps=ut("px");class jm extends gt{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 ki({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",n=>n?"block":"none"),height:t.to("isSticky",n=>n?Ps(this._panelRect.height):null)}}}).render(),this._contentPanel=new ki({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?Ps(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_hasViewportTopOffset",n=>n?Ps(this.viewportTopOffset):null),bottom:t.to("_isStickyToTheLimiter",n=>n?Ps(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(Ft.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:Ps(-Ft.window.scrollX)):(this._isStickyToTheLimiter=!1,this._hasViewportTopOffset=!1,this._marginLeft=null)}}w(57),w(59);const jc=new WeakMap;function ep(o){const{view:e,element:t,text:n,isDirectHost:i=!0,keepOnFocus:r=!1}=o,a=e.document;jc.has(a)||(jc.set(a,new Map),a.registerPostFixer(l=>nl(a,l))),jc.get(a).set(t,{text:n,isDirectHost:i,keepOnFocus:r,hostElement:i?t:null}),e.change(l=>nl(a,l))}function Rc(o,e){return!!e.hasClass("ck-placeholder")&&(o.removeClass("ck-placeholder",e),!0)}function nl(o,e){const t=jc.get(o),n=[];let i=!1;for(const[r,a]of t)a.isDirectHost&&(n.push(r),tp(e,r,a)&&(i=!0));for(const[r,a]of t){if(a.isDirectHost)continue;const l=Rm(r);l&&(n.includes(l)||(a.hostElement=l,tp(e,r,a)&&(i=!0)))}return i}function tp(o,e,t){const{text:n,isDirectHost:i,hostElement:r}=t;let a=!1;return r.getAttribute("data-placeholder")!==n&&(o.setAttribute("data-placeholder",n,r),a=!0),(i||e.childCount==1)&&function(l,d){if(!l.isAttached()||Array.from(l.getChildren()).some(b=>!b.is("uiElement")))return!1;if(d)return!0;const h=l.document;if(!h.isFocused)return!0;const p=h.selection.anchor;return p&&p.parent!==l}(r,t.keepOnFocus)?function(l,d){return!d.hasClass("ck-placeholder")&&(l.addClass("ck-placeholder",d),!0)}(o,r)&&(a=!0):Rc(o,r)&&(a=!0),a}function Rm(o){if(o.childCount){const e=o.getChild(0);if(e.is("element")&&!e.is("uiElement"))return e}return null}const il=new Map;function kt(o,e,t){let n=il.get(o);n||(n=new Map,il.set(o,n)),n.set(e,t)}function Lm(o){return[o]}function np(o,e,t={}){const n=function(i,r){const a=il.get(i);return a&&a.has(r)?a.get(r):Lm}(o.constructor,e.constructor);try{return n(o=o.clone(),e,t)}catch(i){throw i}}function Vm(o,e,t){o=o.slice(),e=e.slice();const n=new zm(t.document,t.useRelations,t.forceWeakRemove);n.setOriginalOperations(o),n.setOriginalOperations(e);const i=n.originalOperations;if(o.length==0||e.length==0)return{operationsA:o,operationsB:e,originalOperations:i};const r=new WeakMap;for(const d of o)r.set(d,0);const a={nextBaseVersionA:o[o.length-1].baseVersion+1,nextBaseVersionB:e[e.length-1].baseVersion+1,originalOperationsACount:o.length,originalOperationsBCount:e.length};let l=0;for(;l<o.length;){const d=o[l],h=r.get(d);if(h==e.length){l++;continue}const p=e[h],b=np(d,p,n.getContext(d,p,!0)),x=np(p,d,n.getContext(p,d,!1));n.updateRelation(d,p),n.setOriginalOperations(b,d),n.setOriginalOperations(x,p);for(const E of b)r.set(E,h+x.length);o.splice(l,1,...b),e.splice(h,1,...x)}if(t.padWithNoOps){const d=o.length-a.originalOperationsACount,h=e.length-a.originalOperationsBCount;op(o,h-d),op(e,d-h)}return ip(o,a.nextBaseVersionB),ip(e,a.nextBaseVersionA),{operationsA:o,operationsB:e,originalOperations:i}}class zm{constructor(e,t,n=!1){this.originalOperations=new Map,this._history=e.history,this._useRelations=t,this._forceWeakRemove=!!n,this._relations=new Map}setOriginalOperations(e,t=null){const n=t?this.originalOperations.get(t):null;for(const i of e)this.originalOperations.set(i,n||i)}updateRelation(e,t){switch(e.constructor){case Vt:switch(t.constructor){case mn: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 Vt:e.targetPosition.isEqual(t.sourcePosition)||e.targetPosition.isBefore(t.sourcePosition)?this._setRelation(e,t,"insertBefore"):this._setRelation(e,t,"insertAfter")}break;case Bt:switch(t.constructor){case mn:e.splitPosition.isBefore(t.sourcePosition)&&this._setRelation(e,t,"splitBefore");break;case Vt:if(e.splitPosition.isEqual(t.sourcePosition)||e.splitPosition.isBefore(t.sourcePosition))this._setRelation(e,t,"splitBefore");else{const n=re._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.splitPosition)){const i=n.end.offset-e.splitPosition.offset,r=e.splitPosition.offset-n.start.offset;this._setRelation(e,t,{howMany:i,offset:r})}}}break;case mn:switch(t.constructor){case mn: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 Bt:e.sourcePosition.isEqual(t.splitPosition)&&this._setRelation(e,t,"splitAtSource")}break;case oi:{const n=e.newRange;if(!n)return;switch(t.constructor){case Vt:{const i=re._createFromPositionAndShift(t.sourcePosition,t.howMany),r=i.containsPosition(n.start)||i.start.isEqual(n.start),a=i.containsPosition(n.end)||i.end.isEqual(n.end);!r&&!a||i.containsRange(n)||this._setRelation(e,t,{side:r?"left":"right",path:r?n.start.path.slice():n.end.path.slice()});break}case mn:{const i=n.start.isEqual(t.targetPosition),r=n.start.isEqual(t.deletionPosition),a=n.end.isEqual(t.deletionPosition),l=n.end.isEqual(t.sourcePosition);(i||r||a||l)&&this._setRelation(e,t,{wasInLeftElement:i,wasStartBeforeMergedElement:r,wasEndBeforeMergedElement:a,wasInRightElement:l});break}}break}}}getContext(e,t,n){return{aIsStrong:n,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(t),abRelation:this._useRelations?this._getRelation(e,t):null,baRelation:this._useRelations?this._getRelation(t,e):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(e){const t=this.originalOperations.get(e);return t.wasUndone||this._history.isUndoneOperation(t)}_getRelation(e,t){const n=this.originalOperations.get(t),i=this._history.getUndoneOperation(n);if(!i)return null;const r=this.originalOperations.get(e),a=this._relations.get(r);return a&&a.get(i)||null}_setRelation(e,t,n){const i=this.originalOperations.get(e),r=this.originalOperations.get(t);let a=this._relations.get(i);a||(a=new Map,this._relations.set(i,a)),a.set(r,n)}}function ip(o,e){for(const t of o)t.baseVersion=e++}function op(o,e){for(let t=0;t<e;t++)o.push(new En(0))}function rp(o,e,t){const n=o.nodes.getNode(0).getAttribute(e);if(n==t)return null;const i=new re(o.position,o.position.getShiftedBy(o.howMany));return new an(i,e,n,t,0)}function sp(o,e){return o.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany)===null}function Is(o,e){const t=[];for(let n=0;n<o.length;n++){const i=o[n],r=new Vt(i.start,i.end.offset-i.start.offset,e,0);t.push(r);for(let a=n+1;a<o.length;a++)o[a]=o[a]._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)[0];e=e._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)}return t}kt(an,an,(o,e,t)=>{if(o.key===e.key&&o.range.start.hasSameParentAs(e.range.start)){const n=o.range.getDifference(e.range).map(r=>new an(r,o.key,o.oldValue,o.newValue,0)),i=o.range.getIntersection(e.range);return i&&t.aIsStrong&&n.push(new an(i,e.key,e.newValue,o.newValue,0)),n.length==0?[new En(0)]:n}return[o]}),kt(an,Tn,(o,e)=>{if(o.range.start.hasSameParentAs(e.position)&&o.range.containsPosition(e.position)){const t=o.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes).map(n=>new an(n,o.key,o.oldValue,o.newValue,o.baseVersion));if(e.shouldReceiveAttributes){const n=rp(e,o.key,o.oldValue);n&&t.unshift(n)}return t}return o.range=o.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[o]}),kt(an,mn,(o,e)=>{const t=[];o.range.start.hasSameParentAs(e.deletionPosition)&&(o.range.containsPosition(e.deletionPosition)||o.range.start.isEqual(e.deletionPosition))&&t.push(re._createFromPositionAndShift(e.graveyardPosition,1));const n=o.range._getTransformedByMergeOperation(e);return n.isCollapsed||t.push(n),t.map(i=>new an(i,o.key,o.oldValue,o.newValue,o.baseVersion))}),kt(an,Vt,(o,e)=>function(t,n){const i=re._createFromPositionAndShift(n.sourcePosition,n.howMany);let r=null,a=[];i.containsRange(t,!0)?r=t:t.start.hasSameParentAs(i.start)?(a=t.getDifference(i),r=t.getIntersection(i)):a=[t];const l=[];for(let d of a){d=d._getTransformedByDeletion(n.sourcePosition,n.howMany);const h=n.getMovedRangeStart(),p=d.start.hasSameParentAs(h);d=d._getTransformedByInsertion(h,n.howMany,p),l.push(...d)}return r&&l.push(r._getTransformedByMove(n.sourcePosition,n.targetPosition,n.howMany,!1)[0]),l}(o.range,e).map(t=>new an(t,o.key,o.oldValue,o.newValue,o.baseVersion))),kt(an,Bt,(o,e)=>{if(o.range.end.isEqual(e.insertionPosition))return e.graveyardPosition||o.range.end.offset++,[o];if(o.range.start.hasSameParentAs(e.splitPosition)&&o.range.containsPosition(e.splitPosition)){const t=o.clone();return t.range=new re(e.moveTargetPosition.clone(),o.range.end._getCombined(e.splitPosition,e.moveTargetPosition)),o.range.end=e.splitPosition.clone(),o.range.end.stickiness="toPrevious",[o,t]}return o.range=o.range._getTransformedBySplitOperation(e),[o]}),kt(Tn,an,(o,e)=>{const t=[o];if(o.shouldReceiveAttributes&&o.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(o.position)){const n=rp(o,e.key,e.newValue);n&&t.push(n)}return t}),kt(Tn,Tn,(o,e,t)=>(o.position.isEqual(e.position)&&t.aIsStrong||(o.position=o.position._getTransformedByInsertOperation(e)),[o])),kt(Tn,Vt,(o,e)=>(o.position=o.position._getTransformedByMoveOperation(e),[o])),kt(Tn,Bt,(o,e)=>(o.position=o.position._getTransformedBySplitOperation(e),[o])),kt(Tn,mn,(o,e)=>(o.position=o.position._getTransformedByMergeOperation(e),[o])),kt(oi,Tn,(o,e)=>(o.oldRange&&(o.oldRange=o.oldRange._getTransformedByInsertOperation(e)[0]),o.newRange&&(o.newRange=o.newRange._getTransformedByInsertOperation(e)[0]),[o])),kt(oi,oi,(o,e,t)=>{if(o.name==e.name){if(!t.aIsStrong)return[new En(0)];o.oldRange=e.newRange?e.newRange.clone():null}return[o]}),kt(oi,mn,(o,e)=>(o.oldRange&&(o.oldRange=o.oldRange._getTransformedByMergeOperation(e)),o.newRange&&(o.newRange=o.newRange._getTransformedByMergeOperation(e)),[o])),kt(oi,Vt,(o,e,t)=>{if(o.oldRange&&(o.oldRange=re._createFromRanges(o.oldRange._getTransformedByMoveOperation(e))),o.newRange){if(t.abRelation){const n=re._createFromRanges(o.newRange._getTransformedByMoveOperation(e));if(t.abRelation.side=="left"&&e.targetPosition.isEqual(o.newRange.start))return o.newRange.start.path=t.abRelation.path,o.newRange.end=n.end,[o];if(t.abRelation.side=="right"&&e.targetPosition.isEqual(o.newRange.end))return o.newRange.start=n.start,o.newRange.end.path=t.abRelation.path,[o]}o.newRange=re._createFromRanges(o.newRange._getTransformedByMoveOperation(e))}return[o]}),kt(oi,Bt,(o,e,t)=>{if(o.oldRange&&(o.oldRange=o.oldRange._getTransformedBySplitOperation(e)),o.newRange){if(t.abRelation){const n=o.newRange._getTransformedBySplitOperation(e);return o.newRange.start.isEqual(e.splitPosition)&&t.abRelation.wasStartBeforeMergedElement?o.newRange.start=fe._createAt(e.insertionPosition):o.newRange.start.isEqual(e.splitPosition)&&!t.abRelation.wasInLeftElement&&(o.newRange.start=fe._createAt(e.moveTargetPosition)),o.newRange.end.isEqual(e.splitPosition)&&t.abRelation.wasInRightElement?o.newRange.end=fe._createAt(e.moveTargetPosition):o.newRange.end.isEqual(e.splitPosition)&&t.abRelation.wasEndBeforeMergedElement?o.newRange.end=fe._createAt(e.insertionPosition):o.newRange.end=n.end,[o]}o.newRange=o.newRange._getTransformedBySplitOperation(e)}return[o]}),kt(mn,Tn,(o,e)=>(o.sourcePosition.hasSameParentAs(e.position)&&(o.howMany+=e.howMany),o.sourcePosition=o.sourcePosition._getTransformedByInsertOperation(e),o.targetPosition=o.targetPosition._getTransformedByInsertOperation(e),[o])),kt(mn,mn,(o,e,t)=>{if(o.sourcePosition.isEqual(e.sourcePosition)&&o.targetPosition.isEqual(e.targetPosition)){if(t.bWasUndone){const n=e.graveyardPosition.path.slice();return n.push(0),o.sourcePosition=new fe(e.graveyardPosition.root,n),o.howMany=0,[o]}return[new En(0)]}if(o.sourcePosition.isEqual(e.sourcePosition)&&!o.targetPosition.isEqual(e.targetPosition)&&!t.bWasUndone&&t.abRelation!="splitAtSource"){const n=o.targetPosition.root.rootName=="$graveyard",i=e.targetPosition.root.rootName=="$graveyard";if(i&&!n||!(n&&!i)&&t.aIsStrong){const a=e.targetPosition._getTransformedByMergeOperation(e),l=o.targetPosition._getTransformedByMergeOperation(e);return[new Vt(a,o.howMany,l,0)]}return[new En(0)]}return o.sourcePosition.hasSameParentAs(e.targetPosition)&&(o.howMany+=e.howMany),o.sourcePosition=o.sourcePosition._getTransformedByMergeOperation(e),o.targetPosition=o.targetPosition._getTransformedByMergeOperation(e),o.graveyardPosition.isEqual(e.graveyardPosition)&&t.aIsStrong||(o.graveyardPosition=o.graveyardPosition._getTransformedByMergeOperation(e)),[o]}),kt(mn,Vt,(o,e,t)=>{const n=re._createFromPositionAndShift(e.sourcePosition,e.howMany);return e.type=="remove"&&!t.bWasUndone&&!t.forceWeakRemove&&o.deletionPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(o.sourcePosition)?[new En(0)]:(o.sourcePosition.hasSameParentAs(e.targetPosition)&&(o.howMany+=e.howMany),o.sourcePosition.hasSameParentAs(e.sourcePosition)&&(o.howMany-=e.howMany),o.sourcePosition=o.sourcePosition._getTransformedByMoveOperation(e),o.targetPosition=o.targetPosition._getTransformedByMoveOperation(e),o.graveyardPosition.isEqual(e.targetPosition)||(o.graveyardPosition=o.graveyardPosition._getTransformedByMoveOperation(e)),[o])}),kt(mn,Bt,(o,e,t)=>{if(e.graveyardPosition&&(o.graveyardPosition=o.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1),o.deletionPosition.isEqual(e.graveyardPosition)&&(o.howMany=e.howMany)),o.targetPosition.isEqual(e.splitPosition)){const n=e.howMany!=0,i=e.graveyardPosition&&o.deletionPosition.isEqual(e.graveyardPosition);if(n||i||t.abRelation=="mergeTargetNotMoved")return o.sourcePosition=o.sourcePosition._getTransformedBySplitOperation(e),[o]}if(o.sourcePosition.isEqual(e.splitPosition)){if(t.abRelation=="mergeSourceNotMoved")return o.howMany=0,o.targetPosition=o.targetPosition._getTransformedBySplitOperation(e),[o];if(t.abRelation=="mergeSameElement"||o.sourcePosition.offset>0)return o.sourcePosition=e.moveTargetPosition.clone(),o.targetPosition=o.targetPosition._getTransformedBySplitOperation(e),[o]}return o.sourcePosition.hasSameParentAs(e.splitPosition)&&(o.howMany=e.splitPosition.offset),o.sourcePosition=o.sourcePosition._getTransformedBySplitOperation(e),o.targetPosition=o.targetPosition._getTransformedBySplitOperation(e),[o]}),kt(Vt,Tn,(o,e)=>{const t=re._createFromPositionAndShift(o.sourcePosition,o.howMany)._getTransformedByInsertOperation(e,!1)[0];return o.sourcePosition=t.start,o.howMany=t.end.offset-t.start.offset,o.targetPosition.isEqual(e.position)||(o.targetPosition=o.targetPosition._getTransformedByInsertOperation(e)),[o]}),kt(Vt,Vt,(o,e,t)=>{const n=re._createFromPositionAndShift(o.sourcePosition,o.howMany),i=re._createFromPositionAndShift(e.sourcePosition,e.howMany);let r,a=t.aIsStrong,l=!t.aIsStrong;if(t.abRelation=="insertBefore"||t.baRelation=="insertAfter"?l=!0:t.abRelation!="insertAfter"&&t.baRelation!="insertBefore"||(l=!1),r=o.targetPosition.isEqual(e.targetPosition)&&l?o.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):o.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),sp(o,e)&&sp(e,o))return[e.getReversed()];if(n.containsPosition(e.targetPosition)&&n.containsRange(i,!0))return n.start=n.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),n.end=n.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Is([n],r);if(i.containsPosition(o.targetPosition)&&i.containsRange(n,!0))return n.start=n.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),n.end=n.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),Is([n],r);const d=z(o.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if(d=="prefix"||d=="extension")return n.start=n.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),n.end=n.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Is([n],r);o.type!="remove"||e.type=="remove"||t.aWasUndone||t.forceWeakRemove?o.type=="remove"||e.type!="remove"||t.bWasUndone||t.forceWeakRemove||(a=!1):a=!0;const h=[],p=n.getDifference(i);for(const x of p){x.start=x.start._getTransformedByDeletion(e.sourcePosition,e.howMany),x.end=x.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const E=z(x.start.getParentPath(),e.getMovedRangeStart().getParentPath())=="same",P=x._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,E);h.push(...P)}const b=n.getIntersection(i);return b!==null&&a&&(b.start=b.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),b.end=b.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),h.length===0?h.push(b):h.length==1?i.start.isBefore(n.start)||i.start.isEqual(n.start)?h.unshift(b):h.push(b):h.splice(1,0,b)),h.length===0?[new En(o.baseVersion)]:Is(h,r)}),kt(Vt,Bt,(o,e,t)=>{let n=o.targetPosition.clone();o.targetPosition.isEqual(e.insertionPosition)&&e.graveyardPosition&&t.abRelation!="moveTargetAfter"||(n=o.targetPosition._getTransformedBySplitOperation(e));const i=re._createFromPositionAndShift(o.sourcePosition,o.howMany);if(i.end.isEqual(e.insertionPosition))return e.graveyardPosition||o.howMany++,o.targetPosition=n,[o];if(i.start.hasSameParentAs(e.splitPosition)&&i.containsPosition(e.splitPosition)){let a=new re(e.splitPosition,i.end);return a=a._getTransformedBySplitOperation(e),Is([new re(i.start,e.splitPosition),a],n)}o.targetPosition.isEqual(e.splitPosition)&&t.abRelation=="insertAtSource"&&(n=e.moveTargetPosition),o.targetPosition.isEqual(e.insertionPosition)&&t.abRelation=="insertBetween"&&(n=o.targetPosition);const r=[i._getTransformedBySplitOperation(e)];if(e.graveyardPosition){const a=i.start.isEqual(e.graveyardPosition)||i.containsPosition(e.graveyardPosition);o.howMany>1&&a&&!t.aWasUndone&&r.push(re._createFromPositionAndShift(e.insertionPosition,1))}return Is(r,n)}),kt(Vt,mn,(o,e,t)=>{const n=re._createFromPositionAndShift(o.sourcePosition,o.howMany);if(e.deletionPosition.hasSameParentAs(o.sourcePosition)&&n.containsPosition(e.sourcePosition)){if(o.type!="remove"||t.forceWeakRemove){if(o.howMany==1)return t.bWasUndone?(o.sourcePosition=e.graveyardPosition.clone(),o.targetPosition=o.targetPosition._getTransformedByMergeOperation(e),[o]):[new En(0)]}else if(!t.aWasUndone){const r=[];let a=e.graveyardPosition.clone(),l=e.targetPosition._getTransformedByMergeOperation(e);o.howMany>1&&(r.push(new Vt(o.sourcePosition,o.howMany-1,o.targetPosition,0)),a=a._getTransformedByMove(o.sourcePosition,o.targetPosition,o.howMany-1),l=l._getTransformedByMove(o.sourcePosition,o.targetPosition,o.howMany-1));const d=e.deletionPosition._getCombined(o.sourcePosition,o.targetPosition),h=new Vt(a,1,d,0),p=h.getMovedRangeStart().path.slice();p.push(0);const b=new fe(h.targetPosition.root,p);l=l._getTransformedByMove(a,d,1);const x=new Vt(l,e.howMany,b,0);return r.push(h),r.push(x),r}}const i=re._createFromPositionAndShift(o.sourcePosition,o.howMany)._getTransformedByMergeOperation(e);return o.sourcePosition=i.start,o.howMany=i.end.offset-i.start.offset,o.targetPosition=o.targetPosition._getTransformedByMergeOperation(e),[o]}),kt(Qn,Tn,(o,e)=>(o.position=o.position._getTransformedByInsertOperation(e),[o])),kt(Qn,mn,(o,e)=>o.position.isEqual(e.deletionPosition)?(o.position=e.graveyardPosition.clone(),o.position.stickiness="toNext",[o]):(o.position=o.position._getTransformedByMergeOperation(e),[o])),kt(Qn,Vt,(o,e)=>(o.position=o.position._getTransformedByMoveOperation(e),[o])),kt(Qn,Qn,(o,e,t)=>{if(o.position.isEqual(e.position)){if(!t.aIsStrong)return[new En(0)];o.oldName=e.newName}return[o]}),kt(Qn,Bt,(o,e)=>{if(z(o.position.path,e.splitPosition.getParentPath())=="same"&&!e.graveyardPosition){const t=new Qn(o.position.getShiftedBy(1),o.oldName,o.newName,0);return[o,t]}return o.position=o.position._getTransformedBySplitOperation(e),[o]}),kt(xo,xo,(o,e,t)=>{if(o.root===e.root&&o.key===e.key){if(!t.aIsStrong||o.newValue===e.newValue)return[new En(0)];o.oldValue=e.newValue}return[o]}),kt(Bt,Tn,(o,e)=>(o.splitPosition.hasSameParentAs(e.position)&&o.splitPosition.offset<e.position.offset&&(o.howMany+=e.howMany),o.splitPosition=o.splitPosition._getTransformedByInsertOperation(e),o.insertionPosition=o.insertionPosition._getTransformedByInsertOperation(e),[o])),kt(Bt,mn,(o,e,t)=>{if(!o.graveyardPosition&&!t.bWasUndone&&o.splitPosition.hasSameParentAs(e.sourcePosition)){const n=e.graveyardPosition.path.slice();n.push(0);const i=new fe(e.graveyardPosition.root,n),r=Bt.getInsertionPosition(new fe(e.graveyardPosition.root,n)),a=new Bt(i,0,r,null,0);return o.splitPosition=o.splitPosition._getTransformedByMergeOperation(e),o.insertionPosition=Bt.getInsertionPosition(o.splitPosition),o.graveyardPosition=a.insertionPosition.clone(),o.graveyardPosition.stickiness="toNext",[a,o]}return o.splitPosition.hasSameParentAs(e.deletionPosition)&&!o.splitPosition.isAfter(e.deletionPosition)&&o.howMany--,o.splitPosition.hasSameParentAs(e.targetPosition)&&(o.howMany+=e.howMany),o.splitPosition=o.splitPosition._getTransformedByMergeOperation(e),o.insertionPosition=Bt.getInsertionPosition(o.splitPosition),o.graveyardPosition&&(o.graveyardPosition=o.graveyardPosition._getTransformedByMergeOperation(e)),[o]}),kt(Bt,Vt,(o,e,t)=>{const n=re._createFromPositionAndShift(e.sourcePosition,e.howMany);if(o.graveyardPosition){const r=n.start.isEqual(o.graveyardPosition)||n.containsPosition(o.graveyardPosition);if(!t.bWasUndone&&r){const a=o.splitPosition._getTransformedByMoveOperation(e),l=o.graveyardPosition._getTransformedByMoveOperation(e),d=l.path.slice();d.push(0);const h=new fe(l.root,d);return[new Vt(a,o.howMany,h,0)]}o.graveyardPosition=o.graveyardPosition._getTransformedByMoveOperation(e)}const i=o.splitPosition.isEqual(e.targetPosition);if(i&&(t.baRelation=="insertAtSource"||t.abRelation=="splitBefore"))return o.howMany+=e.howMany,o.splitPosition=o.splitPosition._getTransformedByDeletion(e.sourcePosition,e.howMany),o.insertionPosition=Bt.getInsertionPosition(o.splitPosition),[o];if(i&&t.abRelation&&t.abRelation.howMany){const{howMany:r,offset:a}=t.abRelation;return o.howMany+=r,o.splitPosition=o.splitPosition.getShiftedBy(a),[o]}if(o.splitPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(o.splitPosition)){const r=e.howMany-(o.splitPosition.offset-e.sourcePosition.offset);return o.howMany-=r,o.splitPosition.hasSameParentAs(e.targetPosition)&&o.splitPosition.offset<e.targetPosition.offset&&(o.howMany+=e.howMany),o.splitPosition=e.sourcePosition.clone(),o.insertionPosition=Bt.getInsertionPosition(o.splitPosition),[o]}return e.sourcePosition.isEqual(e.targetPosition)||(o.splitPosition.hasSameParentAs(e.sourcePosition)&&o.splitPosition.offset<=e.sourcePosition.offset&&(o.howMany-=e.howMany),o.splitPosition.hasSameParentAs(e.targetPosition)&&o.splitPosition.offset<e.targetPosition.offset&&(o.howMany+=e.howMany)),o.splitPosition.stickiness="toNone",o.splitPosition=o.splitPosition._getTransformedByMoveOperation(e),o.splitPosition.stickiness="toNext",o.graveyardPosition?o.insertionPosition=o.insertionPosition._getTransformedByMoveOperation(e):o.insertionPosition=Bt.getInsertionPosition(o.splitPosition),[o]}),kt(Bt,Bt,(o,e,t)=>{if(o.splitPosition.isEqual(e.splitPosition)){if(!o.graveyardPosition&&!e.graveyardPosition)return[new En(0)];if(o.graveyardPosition&&e.graveyardPosition&&o.graveyardPosition.isEqual(e.graveyardPosition))return[new En(0)];if(t.abRelation=="splitBefore")return o.howMany=0,o.graveyardPosition=o.graveyardPosition._getTransformedBySplitOperation(e),[o]}if(o.graveyardPosition&&e.graveyardPosition&&o.graveyardPosition.isEqual(e.graveyardPosition)){const n=o.splitPosition.root.rootName=="$graveyard",i=e.splitPosition.root.rootName=="$graveyard";if(i&&!n||!(n&&!i)&&t.aIsStrong){const a=[];return e.howMany&&a.push(new Vt(e.moveTargetPosition,e.howMany,e.splitPosition,0)),o.howMany&&a.push(new Vt(o.splitPosition,o.howMany,o.moveTargetPosition,0)),a}return[new En(0)]}if(o.graveyardPosition&&(o.graveyardPosition=o.graveyardPosition._getTransformedBySplitOperation(e)),o.splitPosition.isEqual(e.insertionPosition)&&t.abRelation=="splitBefore")return o.howMany++,[o];if(e.splitPosition.isEqual(o.insertionPosition)&&t.baRelation=="splitBefore"){const n=e.insertionPosition.path.slice();n.push(0);const i=new fe(e.insertionPosition.root,n);return[o,new Vt(o.insertionPosition,1,i,0)]}return o.splitPosition.hasSameParentAs(e.splitPosition)&&o.splitPosition.offset<e.splitPosition.offset&&(o.howMany-=e.howMany),o.splitPosition=o.splitPosition._getTransformedBySplitOperation(e),o.insertionPosition=Bt.getInsertionPosition(o.splitPosition),[o]});class Fm extends $o{constructor(e){super(e),this.domEventType="click"}onDomEvent(e){this.fire(e.type,e)}}class Lc extends $o{constructor(e){super(e),this.domEventType=["mousedown","mouseup","mouseover","mouseout"]}onDomEvent(e){this.fire(e.type,e)}}class Ms{constructor(e){this.document=e}createDocumentFragment(e){return new $r(this.document,e)}createElement(e,t,n){return new Kn(this.document,e,t,n)}createText(e){return new Ce(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,n){return n._insertChild(e,t)}removeChildren(e,t,n){return n._removeChildren(e,t)}remove(e){const t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){const n=e.parent;if(n){const i=n.getChildIndex(e);return this.removeChildren(i,1,n),this.insertChild(i,t,n),!0}return!1}unwrapElement(e){const t=e.parent;if(t){const n=t.getChildIndex(e);this.remove(e),this.insertChild(n,e.getChildren(),t)}}rename(e,t){const n=new Kn(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){_n(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 _e._createAt(e,t)}createPositionAfter(e){return _e._createAfter(e)}createPositionBefore(e){return _e._createBefore(e)}createRange(e,t){return new et(e,t)}createRangeOn(e){return et._createOn(e)}createRangeIn(e){return et._createIn(e)}createSelection(e,t,n){return new Gt(e,t,n)}}class Qi extends Sf{constructor(e,t){super(e),this.view=t,this._toolbarConfig=Uf(e.config.get("toolbar")),this._elementReplacer=new Yh}get element(){return this.view.element}init(e){const t=this.editor,n=this.view,i=t.editing.view,r=n.editable,a=i.document.getRoot();r.name=a.rootName,n.render();const l=r.element;this.setEditableElement(r.name,l),this.focusTracker.add(l),n.editable.bind("isFocused").to(this.focusTracker),i.attachDomRoot(l),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const e=this.view,t=this.editor.editing.view;this._elementReplacer.restore(),t.detachDomRoot(e.editable.name),e.destroy(),super.destroy()}_initToolbar(){const e=this.editor,t=this.view,n=e.editing.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,this._toolbarConfig.viewportTopOffset&&(t.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset),t.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),function({origin:i,originKeystrokeHandler:r,originFocusTracker:a,toolbar:l,beforeFocus:d,afterBlur:h}){a.add(l.element),r.set("Alt+F10",(p,b)=>{a.isFocused&&!l.focusTracker.isFocused&&(d&&d(),l.focus(),b())}),l.keystrokes.set("Esc",(p,b)=>{l.focusTracker.isFocused&&(i.focus(),h&&h(),b())})}({origin:n,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:t.toolbar})}_initPlaceholder(){const e=this.editor,t=e.editing.view,n=t.document.getRoot(),i=e.sourceElement,r=e.config.get("placeholder")||i&&i.tagName.toLowerCase()==="textarea"&&i.getAttribute("placeholder");r&&ep({view:t,element:n,text:r,isDirectHost:!1,keepOnFocus:!0})}}w(61);class Bm extends Im{constructor(e,t,n={}){super(e),this.stickyPanel=new jm(e),this.toolbar=new Td(e,{shouldGroupWhenFull:n.shouldToolbarGroupWhenFull}),this.editable=new Dm(e,t)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class Id extends md{constructor(e,t){super(t),Ai(e)&&(this.sourceElement=e),this.model.document.createRoot();const n=!this.config.get("toolbar.shouldNotGroupWhenFull"),i=new Bm(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:n});this.ui=new Qi(this,i),function(r){if(!xe(r.updateSourceElement))throw new T.a("attachtoform-missing-elementapi-interface",r);const a=r.sourceElement;if(a&&a.tagName.toLowerCase()==="textarea"&&a.form){let l;const d=a.form,h=()=>r.updateSourceElement();xe(d.submit)&&(l=d.submit,d.submit=()=>{h(),l.apply(d)}),d.addEventListener("submit",h),r.on("destroy",()=>{d.removeEventListener("submit",h),l&&(d.submit=l)})}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(e,t={}){return new Promise(n=>{const i=new this(e,t);n(i.initPlugins().then(()=>i.ui.init(Ai(e)?e:null)).then(()=>{if(!Ai(e)&&t.initialData)throw new T.a("editor-create-initial-data",null);const r=t.initialData!==void 0?t.initialData:function(a){return Ai(a)?(l=a,l instanceof HTMLTextAreaElement?l.value:l.innerHTML):a;var l}(e);return i.data.init(r)}).then(()=>i.fire("ready")).then(()=>i))})}}ze(Id,wm),ze(Id,vd);class Zr{constructor(e){this.files=function(t){const n=Array.from(t.files||[]),i=Array.from(t.items||[]);return n.length?n:i.filter(r=>r.kind==="file").map(r=>r.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 nt extends $o{constructor(e){super(e);const t=this.document;function n(i){return(r,a)=>{a.preventDefault();const l=a.dropRange?[a.dropRange]:null,d=new m(t,i);t.fire(d,{dataTransfer:a.dataTransfer,method:r.name,targetRanges:l,target:a.target}),d.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 Zr(e.clipboardData?e.clipboardData:e.dataTransfer)};e.type!="drop"&&e.type!="dragover"||(t.dropRange=function(n,i){const r=i.target.ownerDocument,a=i.clientX,l=i.clientY;let d;return r.caretRangeFromPoint&&r.caretRangeFromPoint(a,l)?d=r.caretRangeFromPoint(a,l):i.rangeParent&&(d=r.createRange(),d.setStart(i.rangeParent,i.rangeOffset),d.collapse(!0)),d?n.domConverter.domRangeToView(d):null}(this.view,e)),this.fire(e.type,e,t)}}const ap=["figcaption","li"];class nn extends ve{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(nt),this._setupPasteDrop(),this._setupCopyCut()}_setupPasteDrop(){const e=this.editor,t=e.model,n=e.editing.view,i=n.document;this.listenTo(i,"clipboardInput",r=>{e.isReadOnly&&r.stop()},{priority:"highest"}),this.listenTo(i,"clipboardInput",(r,a)=>{const l=a.dataTransfer;let d=a.content||"";var h;d||(l.getData("text/html")?d=function(b){return b.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(x,E)=>E.length==1?" ":E).replace(/<!--[\s\S]*?-->/g,"")}(l.getData("text/html")):l.getData("text/plain")&&(((h=(h=l.getData("text/plain")).replace(/</g,"<").replace(/>/g,">").replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br>").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," ")).includes("</p><p>")||h.includes("<br>"))&&(h=`<p>${h}</p>`),d=h),d=this.editor.data.htmlProcessor.toView(d));const p=new m(this,"inputTransformation");this.fire(p,{content:d,dataTransfer:l,targetRanges:a.targetRanges,method:a.method}),p.stop.called&&r.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(r,a)=>{if(a.content.isEmpty)return;const l=this.editor.data.toModel(a.content,"$clipboardHolder");l.childCount!=0&&(r.stop(),t.change(()=>{this.fire("contentInsertion",{content:l,method:a.method,dataTransfer:a.dataTransfer,targetRanges:a.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(r,a)=>{a.resultRange=t.insertContent(a.content)},{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,n=e.editing.view.document;function i(r,a){const l=a.dataTransfer;a.preventDefault();const d=e.data.toView(e.model.getSelectedContent(t.selection));n.fire("clipboardOutput",{dataTransfer:l,content:d,method:r.name})}this.listenTo(n,"copy",i,{priority:"low"}),this.listenTo(n,"cut",(r,a)=>{e.isReadOnly?a.preventDefault():i(r,a)},{priority:"low"}),this.listenTo(n,"clipboardOutput",(r,a)=>{a.content.isEmpty||(a.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(a.content)),a.dataTransfer.setData("text/plain",function l(d){let h="";if(d.is("$text")||d.is("$textProxy"))h=d.data;else if(d.is("element","img")&&d.hasAttribute("alt"))h=d.getAttribute("alt");else if(d.is("element","br"))h=` `;else{let p=null;for(const b of d.getChildren()){const x=l(b);p&&(p.is("containerElement")||b.is("containerElement"))&&(ap.includes(p.name)||ap.includes(b.name)?h+=` `:h+=` `),h+=x,p=b}}return h}(a.content))),a.method=="cut"&&e.model.deleteContent(t.selection)},{priority:"low"})}}function*ln(o,e){for(const t of e)t&&o.getAttributeProperties(t[0]).copyOnEnter&&(yield t)}class Hm extends pt{execute(){const e=this.editor.model,t=e.document;e.change(n=>{(function(i,r,a,l){const d=a.isCollapsed,h=a.getFirstRange(),p=h.start.parent,b=h.end.parent;if(l.isLimit(p)||l.isLimit(b))return void(d||p!=b||i.deleteContent(a));if(d){const x=ln(r.model.schema,a.getAttributes());qo(r,h.start),r.setSelectionAttribute(x)}else{const x=!(h.start.isAtStart&&h.end.isAtEnd),E=p==b;i.deleteContent(a,{leaveUnmerged:x}),x&&(E?qo(r,a.focus):r.setSelection(b,0))}})(this.editor.model,n,t.selection,e.schema),this.fire("afterExecute",{writer:n})})}}function qo(o,e){o.split(e),o.setSelection(e.parent.nextSibling,0)}class lp extends bo{constructor(e){super(e);const t=this.document;t.on("keydown",(n,i)=>{if(this.isEnabled&&i.keyCode==ct.enter){const r=new Jl(t,"enter",t.selection.getFirstRange());t.fire(r,new qr(t,i.domEvent,{isSoft:i.shiftKey})),r.stop.called&&n.stop()}})}observe(){}}class Vc extends ve{static get pluginName(){return"Enter"}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(lp),e.commands.add("enter",new Hm(e)),this.listenTo(n,"enter",(i,r)=>{r.preventDefault(),r.isSoft||(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"})}}class cp{constructor(e,t=20){this.model=e,this.size=0,this.limit=t,this.isLocked=!1,this._changeCallback=(n,i)=>{i.type!="transparent"&&i!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch()),this._batch}input(e){this.size+=e,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e){this.isLocked&&!e||(this._batch=null,this.size=0)}}class up extends pt{constructor(e,t){super(e),this.direction=t,this._buffer=new cp(e.model,e.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,n=t.document;t.enqueueChange(this._buffer.batch,i=>{this._buffer.lock();const r=i.createSelection(e.selection||n.selection),a=e.sequence||1,l=r.isCollapsed;if(r.isCollapsed&&t.modifySelection(r,{direction:this.direction,unit:e.unit}),this._shouldEntireContentBeReplacedWithParagraph(a))return void this._replaceEntireContentWithParagraph(i);if(this._shouldReplaceFirstBlockWithParagraph(r,a))return void this.editor.execute("paragraph",{selection:r});if(r.isCollapsed)return;let d=0;r.getFirstRange().getMinimalFlatRanges().forEach(h=>{d+=dn(h.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(r,{doNotResetEntireContent:l,direction:this.direction}),this._buffer.input(d),i.setSelection(r),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,n=t.document.selection,i=t.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(i))||!t.schema.checkChild(i,"paragraph"))return!1;const r=i.getChild(0);return!r||r.name!=="paragraph"}_replaceEntireContentWithParagraph(e){const t=this.editor.model,n=t.document.selection,i=t.schema.getLimitElement(n),r=e.createElement("paragraph");e.remove(e.createRangeIn(i)),e.insert(r,i),e.setSelection(r,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const n=this.editor.model;if(t>1||this.direction!="backward"||!e.isCollapsed)return!1;const i=e.getFirstPosition(),r=n.schema.getLimitElement(i),a=r.getChild(0);return i.parent==a&&!!e.containsEntireContent(a)&&!!n.schema.checkChild(r,"paragraph")&&a.name!="paragraph"}}class $m extends bo{constructor(e){super(e);const t=e.document;let n=0;function i(r,a,l){const d=new Jl(t,"delete",t.selection.getFirstRange());t.fire(d,new qr(t,a,l)),d.stop.called&&r.stop()}t.on("keyup",(r,a)=>{a.keyCode!=ct.delete&&a.keyCode!=ct.backspace||(n=0)}),t.on("keydown",(r,a)=>{const l={};if(a.keyCode==ct.delete)l.direction="forward",l.unit="character";else{if(a.keyCode!=ct.backspace)return;l.direction="backward",l.unit="codePoint"}const d=yn.isMac?a.altKey:a.ctrlKey;l.unit=d?"word":l.unit,l.sequence=++n,i(r,a.domEvent,l)}),yn.isAndroid&&t.on("beforeinput",(r,a)=>{if(a.domEvent.inputType!="deleteContentBackward")return;const l={unit:"codepoint",direction:"backward",sequence:1},d=a.domTarget.ownerDocument.defaultView.getSelection();d.anchorNode==d.focusNode&&d.anchorOffset+1!=d.focusOffset&&(l.selectionToRemove=e.domConverter.domSelectionToView(d)),i(r,a.domEvent,l)})}observe(){}}class Xr extends ve{static get pluginName(){return"Delete"}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver($m);const i=new up(e,"forward");if(e.commands.add("deleteForward",i),e.commands.add("forwardDelete",i),e.commands.add("delete",new up(e,"backward")),this.listenTo(n,"delete",(r,a)=>{const l={unit:a.unit,sequence:a.sequence};if(a.selectionToRemove){const d=e.model.createSelection(),h=[];for(const p of a.selectionToRemove.getRanges())h.push(e.editing.mapper.toModelRange(p));d.setTo(h),l.selection=d}e.execute(a.direction=="forward"?"deleteForward":"delete",l),a.preventDefault(),t.scrollToTheSelection()},{priority:"low"}),yn.isAndroid){let r=null;this.listenTo(n,"delete",(a,l)=>{const d=l.domTarget.ownerDocument.defaultView.getSelection();r={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}},{priority:"lowest"}),this.listenTo(n,"keyup",(a,l)=>{if(r){const d=l.domTarget.ownerDocument.defaultView.getSelection();d.collapse(r.anchorNode,r.anchorOffset),d.extend(r.focusNode,r.focusOffset),r=null}})}}}class dp{constructor(){this._stack=[]}add(e,t){const n=this._stack,i=n[0];this._insertDescriptor(e);const r=n[0];i===r||Yi(i,r)||this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:t})}remove(e,t){const n=this._stack,i=n[0];this._removeDescriptor(e);const r=n[0];i===r||Yi(i,r)||this.fire("change:top",{oldDescriptor:i,newDescriptor:r,writer:t})}_insertDescriptor(e){const t=this._stack,n=t.findIndex(r=>r.id===e.id);if(Yi(e,t[n]))return;n>-1&&t.splice(n,1);let i=0;for(;t[i]&&hp(t[i],e);)i++;t.splice(i,0,e)}_removeDescriptor(e){const t=this._stack,n=t.findIndex(i=>i.id===e);n>-1&&t.splice(n,1)}}function Yi(o,e){return o&&e&&o.priority==e.priority&&es(o.classes)==es(e.classes)}function hp(o,e){return o.priority>e.priority||!(o.priority<e.priority)&&es(o.classes)>es(e.classes)}function es(o){return Array.isArray(o)?o.sort().join(","):o}ze(dp,j);function it(o){return!!o.is("element")&&!!o.getCustomProperty("widget")}function en(o,e,t={}){if(!o.is("containerElement"))throw new T.a("widget-to-widget-wrong-element-type",null,{element:o});return e.setAttribute("contenteditable","false",o),e.addClass("ck-widget",o),e.setCustomProperty("widget",!0,o),o.getFillerOffset=pp,t.label&&function(n,i,r){r.setCustomProperty("widgetLabel",i,n)}(o,t.label,e),t.hasSelectionHandle&&function(n,i){const r=i.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(a){const l=this.toDomElement(a),d=new Mc;return d.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>'),d.render(),l.appendChild(d.element),l});i.insert(i.createPositionAt(n,0),r),i.addClass(["ck-widget_with-selection-handle"],n)}(o,e),zc(o,e,fp,Um),o}function fp(o,e,t){if(e.classes&&t.addClass(Tt(e.classes),o),e.attributes)for(const n in e.attributes)t.setAttribute(n,e.attributes[n],o)}function Um(o,e,t){if(e.classes&&t.removeClass(Tt(e.classes),o),e.attributes)for(const n in e.attributes)t.removeAttribute(n,o)}function zc(o,e,t,n){const i=new dp;i.on("change:top",(r,a)=>{a.oldDescriptor&&n(o,a.oldDescriptor,a.writer),a.newDescriptor&&t(o,a.newDescriptor,a.writer)}),e.setCustomProperty("addHighlight",(r,a,l)=>i.add(a,l),o),e.setCustomProperty("removeHighlight",(r,a,l)=>i.remove(a,l),o)}function Wm(o){const e=o.getCustomProperty("widgetLabel");return e?typeof e=="function"?e():e:""}function Md(o,e){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],o),e.setAttribute("contenteditable",o.isReadOnly?"false":"true",o),o.on("change:isReadOnly",(t,n,i)=>{e.setAttribute("contenteditable",i?"false":"true",o)}),o.on("change:isFocused",(t,n,i)=>{i?e.addClass("ck-editor__nested-editable_focused",o):e.removeClass("ck-editor__nested-editable_focused",o)}),o}function ol(o,e){const t=o.getSelectedElement();if(t){const i=Go(o);if(i)return e.createRange(e.createPositionAt(t,i));if(e.schema.isObject(t)&&!e.schema.isInline(t))return e.createRangeOn(t)}const n=o.getSelectedBlocks().next().value;if(n){if(n.isEmpty)return e.createRange(e.createPositionAt(n,0));const i=e.createPositionAfter(n);return o.focus.isTouching(i)?e.createRange(i):e.createRange(e.createPositionBefore(n))}return e.createRange(o.focus)}function Km(o,e){const t=new St(Ft.window),n=t.getIntersection(o),i=e.height+dt.arrowVerticalOffset;if(o.top-i>t.top||o.bottom+i<t.bottom)return null;const r=n||o,a=r.left+r.width/2-e.width/2;return{top:Math.max(o.top,0)+dt.arrowVerticalOffset,left:a,name:"arrow_n"}}function pp(){return null}function To(o,e,t){return o&&it(o)&&!t.isInline(e)}function Go(o){return o.getAttribute("widget-type-around")}const gp=[I("arrowUp"),I("arrowRight"),I("arrowDown"),I("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 o=112;o<=135;o++)gp.push(o);function Dd(o){return!(!o.ctrlKey&&!o.metaKey)||gp.includes(o.keyCode)}w(63);const rl=["before","after"],yi=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 Ds extends ve{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[Vc,Xr]}constructor(e){super(e),this._currentFakeCaretModelElement=null}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",(n,i,r)=>{t.change(a=>{for(const l of t.document.roots)r?a.removeClass("ck-widget__type-around_disabled",l):a.addClass("ck-widget__type-around_disabled",l)}),r||e.model.change(a=>{a.removeSelectionAttribute("widget-type-around")})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableDeleteContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const n=this.editor,i=n.editing.view;n.execute("insertParagraph",{position:n.model.createPositionAt(e,t)}),i.focus(),i.scrollToTheSelection()}_listenToIfEnabled(e,t,n,i){this.listenTo(e,t,(...r)=>{this.isEnabled&&n(...r)},i)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=Go(e);if(!t)return!1;const n=e.getSelectedElement();return this._insertParagraph(n,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,n=e.locale.t,i={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(r,a,l)=>{const d=l.mapper.toViewElement(a.item);To(d,a.item,t)&&function(h,p,b){const x=h.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(E){const P=this.toDomElement(E);return function(D,R){for(const H of rl){const Q=new ki({tag:"div",attributes:{class:["ck","ck-widget__type-around__button","ck-widget__type-around__button_"+H],title:R[H]},children:[D.ownerDocument.importNode(yi,!0)]});D.appendChild(Q.render())}}(P,p),function(D){const R=new ki({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});D.appendChild(R.render())}(P),P});h.insert(h.createPositionAt(b,"end"),x)}(l.writer,i,d)},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,n=t.document.selection,i=t.schema,r=e.editing.view;function a(l){return"ck-widget_type-around_show-fake-caret_"+l}this._listenToIfEnabled(r.document,"arrowKey",(l,d)=>{this._handleArrowKeyPress(l,d)},{context:[it,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",(l,d)=>{d.directChange&&e.model.change(h=>{h.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(t.document,"change:data",()=>{const l=n.getSelectedElement();l&&To(e.editing.mapper.toViewElement(l),l,i)||e.model.change(d=>{d.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(l,d,h)=>{const p=h.writer;if(this._currentFakeCaretModelElement){const P=h.mapper.toViewElement(this._currentFakeCaretModelElement);P&&(p.removeClass(rl.map(a),P),this._currentFakeCaretModelElement=null)}const b=d.selection.getSelectedElement();if(!b)return;const x=h.mapper.toViewElement(b);if(!To(x,b,i))return;const E=Go(d.selection);E&&(p.addClass(a(E),x),this._currentFakeCaretModelElement=b)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(l,d,h)=>{h||e.model.change(p=>{p.removeSelectionAttribute("widget-type-around")})})}_handleArrowKeyPress(e,t){const n=this.editor,i=n.model,r=i.document.selection,a=i.schema,l=n.editing.view,d=vt(t.keyCode,n.locale.contentLanguageDirection),h=l.document.selection.getSelectedElement();let p;To(h,n.editing.mapper.toModelElement(h),a)?p=this._handleArrowKeyPressOnSelectedWidget(d):r.isCollapsed&&(p=this._handleArrowKeyPressWhenSelectionNextToAWidget(d)),p&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,n=Go(t.document.selection);return t.change(i=>n?n!==(e?"after":"before")?(i.removeSelectionAttribute("widget-type-around"),!0):!1:(i.setSelectionAttribute("widget-type-around",e?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,n=t.model,i=n.schema,r=t.plugins.get("Widget"),a=r._getObjectElementNextToSelection(e);return!!To(t.editing.mapper.toViewElement(a),a,i)&&(n.change(l=>{r._setSelectionOverElement(a),l.setSelectionAttribute("widget-type-around",e?"before":"after")}),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(n,i)=>{const r=i.domTarget.closest(".ck-widget__type-around__button");if(!r)return;const a=function(h){return h.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(r),l=function(h,p){const b=h.closest(".ck-widget");return p.mapDomToView(b)}(r,t.domConverter),d=e.editing.mapper.toModelElement(l);this._insertParagraph(d,a),i.preventDefault(),n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,n=e.editing.view;this._listenToIfEnabled(n.document,"enter",(i,r)=>{if(i.eventPhase!="atTarget")return;const a=t.getSelectedElement(),l=e.editing.mapper.toViewElement(a),d=e.model.schema;let h;this._insertParagraphAccordingToFakeCaretPosition()?h=!0:To(l,a,d)&&(this._insertParagraph(a,r.isSoft?"before":"after"),h=!0),h&&(r.preventDefault(),i.stop())},{context:it})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view,t=[ct.enter,ct.delete,ct.backspace];this._listenToIfEnabled(e.document,"keydown",(n,i)=>{t.includes(i.keyCode)||Dd(i)||this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,n=e.model,i=n.schema;this._listenToIfEnabled(t.document,"delete",(r,a)=>{if(r.eventPhase!="atTarget")return;const l=Go(n.document.selection);if(!l)return;const d=a.direction,h=n.document.selection.getSelectedElement(),p=d=="forward";if(l==="before"===p)e.execute("delete",{selection:n.createSelection(h,"on")});else{const b=i.getNearestSelectionRange(n.createPositionAt(h,l),d);if(b)if(b.isCollapsed){const x=n.createSelection(b.start);if(n.modifySelection(x,{direction:d}),x.focus.isEqual(b.start)){const E=function(P,D){let R=D;for(const H of D.getAncestors({parentFirst:!0})){if(H.childCount>1||P.isLimit(H))break;R=H}return R}(i,b.start.parent);n.deleteContent(n.createSelection(E,"on"),{doNotAutoparagraph:!0})}else n.change(E=>{E.setSelection(b),e.execute(p?"deleteForward":"delete")})}else n.change(x=>{x.setSelection(b),e.execute(p?"deleteForward":"delete")})}a.preventDefault(),r.stop()},{context:it})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,n=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(i,[r,a])=>{if(a&&!a.is("documentSelection"))return;const l=Go(n);return l?(i.stop(),t.change(d=>{const h=n.getSelectedElement(),p=t.createPositionAt(h,l),b=d.createSelection(p),x=t.insertContent(r,b);return d.setSelection(b),x})):void 0},{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(n,[i])=>{i&&!i.is("documentSelection")||Go(t)&&n.stop()},{priority:"high"})}}w(65);function qm(o){const e=o.model;return(t,n)=>{const i=n.keyCode==ct.arrowup,r=n.keyCode==ct.arrowdown,a=n.shiftKey,l=e.document.selection;if(!i&&!r)return;const d=r;if(a&&function(p,b){return!p.isCollapsed&&p.isBackward==b}(l,d))return;const h=function(p,b,x){const E=p.model;if(x){const P=b.isCollapsed?b.focus:b.getLastPosition(),D=mp(E,P,"forward");if(!D)return null;const R=E.createRange(P,D),H=bp(E.schema,R,"backward");return H&&P.isBefore(H)?E.createRange(P,H):null}{const P=b.isCollapsed?b.focus:b.getFirstPosition(),D=mp(E,P,"backward");if(!D)return null;const R=E.createRange(D,P),H=bp(E.schema,R,"forward");return H&&P.isAfter(H)?E.createRange(H,P):null}}(o,l,d);h&&!h.isCollapsed&&function(p,b,x){const E=p.model,P=p.view.domConverter;if(x){const ae=E.createSelection(b.start);E.modifySelection(ae),ae.focus.isAtEnd||b.start.isEqual(ae.focus)||(b=E.createRange(ae.focus,b.end))}const D=p.mapper.toViewRange(b),R=P.viewRangeToDom(D),H=St.getDomRangeRects(R);let Q;for(const ae of H)if(Q!==void 0){if(Math.round(ae.top)>=Q)return!1;Q=Math.max(Q,Math.round(ae.bottom))}else Q=Math.round(ae.bottom);return!0}(o,h,d)&&(e.change(p=>{const b=d?h.end:h.start;if(a){const x=e.createSelection(l.anchor);x.setFocus(b),p.setSelection(x)}else p.setSelection(b)}),t.stop(),n.preventDefault(),n.stopPropagation())}}function mp(o,e,t){const n=o.schema,i=o.createRangeIn(e.root),r=t=="forward"?"elementStart":"elementEnd";for(const{previousPosition:a,item:l,type:d}of i.getWalker({startPosition:e,direction:t})){if(n.isLimit(l)&&!n.isInline(l))return a;if(d==r&&n.isBlock(l))return null}return null}function bp(o,e,t){const n=t=="backward"?e.end:e.start;if(o.checkChild(n,"$text"))return n;for(const{nextPosition:i}of e.getWalker({direction:t}))if(o.checkChild(i,"$text"))return i}class sl extends ve{static get pluginName(){return"Widget"}static get requires(){return[Ds,Xr]}init(){const e=this.editor,t=e.editing.view,n=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(i,r,a)=>{const l=a.writer,d=r.selection;if(d.isCollapsed)return;const h=d.getSelectedElement();if(!h)return;const p=e.editing.mapper.toViewElement(h);it(p)&&a.consumable.consume(d,"selection")&&l.setSelection(l.createRangeOn(p),{fake:!0,label:Wm(p)})}),this.editor.editing.downcastDispatcher.on("selection",(i,r,a)=>{this._clearPreviouslySelectedWidgets(a.writer);const l=a.writer,d=l.document.selection;let h=null;for(const p of d.getRanges())for(const b of p){const x=b.item;it(x)&&!Gm(x,h)&&(l.addClass("ck-widget_selected",x),this._previouslySelected.add(x),h=x)}},{priority:"low"}),t.addObserver(Lc),this.listenTo(n,"mousedown",(...i)=>this._onMousedown(...i)),this.listenTo(n,"arrowKey",(...i)=>{this._handleSelectionChangeOnArrowKeyPress(...i)},{context:[it,"$text"]}),this.listenTo(n,"arrowKey",(...i)=>{this._preventDefaultOnArrowKeyPress(...i)},{context:"$root"}),this.listenTo(n,"arrowKey",qm(this.editor.editing),{context:"$text"}),this.listenTo(n,"delete",(i,r)=>{this._handleDelete(r.direction=="forward")&&(r.preventDefault(),i.stop())},{context:"$root"})}_onMousedown(e,t){const n=this.editor,i=n.editing.view,r=i.document;let a=t.target;if(function(d){for(;d;){if(d.is("editableElement")&&!d.is("rootElement"))return!0;if(it(d))return!1;d=d.parent}return!1}(a)){if((yn.isSafari||yn.isGecko)&&t.domEvent.detail>=3){const d=n.editing.mapper,h=a.is("attributeElement")?a.findAncestor(b=>!b.is("attributeElement")):a,p=d.toModelElement(h);t.preventDefault(),this.editor.model.change(b=>{b.setSelection(p,"in")})}return}if(!it(a)&&(a=a.findAncestor(it),!a))return;yn.isAndroid&&t.preventDefault(),r.isFocused||i.focus();const l=n.editing.mapper.toModelElement(a);this._setSelectionOverElement(l)}_handleSelectionChangeOnArrowKeyPress(e,t){const n=t.keyCode,i=this.editor.model,r=i.schema,a=i.document.selection,l=a.getSelectedElement(),d=vt(n,this.editor.locale.contentLanguageDirection);if(l&&r.isObject(l)){const p=d?a.getLastPosition():a.getFirstPosition(),b=r.getNearestSelectionRange(p,d?"forward":"backward");return void(b&&(i.change(x=>{x.setSelection(b)}),t.preventDefault(),e.stop()))}if(!a.isCollapsed)return;const h=this._getObjectElementNextToSelection(d);h&&r.isObject(h)&&(this._setSelectionOverElement(h),t.preventDefault(),e.stop())}_preventDefaultOnArrowKeyPress(e,t){const n=this.editor.model,i=n.schema,r=n.document.selection.getSelectedElement();r&&i.isObject(r)&&(t.preventDefault(),e.stop())}_handleDelete(e){if(this.editor.isReadOnly)return;const t=this.editor.model.document.selection;if(!t.isCollapsed)return;const n=this._getObjectElementNextToSelection(e);return n?(this.editor.model.change(i=>{let r=t.anchor.parent;for(;r.isEmpty;){const a=r;r=a.parent,i.remove(a)}this._setSelectionOverElement(n)}),!0):void 0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,n=t.schema,i=t.document.selection,r=t.createSelection(i);t.modifySelection(r,{direction:e?"forward":"backward"});const a=e?r.focus.nodeBefore:r.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 Gm(o,e){return!!e&&Array.from(o.getAncestors()).includes(e)}var Od=function(o,e,t){var n=!0,i=!0;if(typeof o!="function")throw new TypeError("Expected a function");return ne(t)&&(n="leading"in t?!!t.leading:n,i="trailing"in t?!!t.trailing:i),Va(o,e,{leading:n,maxWait:e,trailing:i})};w(67);class Qo extends ve{static get pluginName(){return"DragDrop"}static get requires(){return[nn,sl]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=Od(n=>this._updateDropMarker(n),40),this._removeDropMarkerDelayed=xi(()=>this._removeDropMarker(),40),this._clearDraggableAttributesDelayed=xi(()=>this._clearDraggableAttributes(),40),t.addObserver(nt),t.addObserver(Lc),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(n,i,r)=>{r?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(n,i,r)=>{r||this._finalizeDragging(!1)}),yn.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._updateDropMarkerThrottled.cancel(),this._removeDropMarkerDelayed.cancel(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,t=e.model,n=t.document,i=e.editing.view,r=i.document;this.listenTo(r,"dragstart",(a,l)=>{const d=n.selection;if(l.target&&l.target.is("editableElement"))return void l.preventDefault();const h=l.target?Rd(l.target):null;if(h){const x=e.editing.mapper.toModelElement(h);this._draggedRange=ko.fromRange(t.createRangeOn(x)),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}else if(!r.selection.isCollapsed){const x=r.selection.getSelectedElement();x&&it(x)||(this._draggedRange=ko.fromRange(d.getFirstRange()))}if(!this._draggedRange)return void l.preventDefault();this._draggingUid=M(),l.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",l.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const p=t.createSelection(this._draggedRange.toRange()),b=e.data.toView(t.getSelectedContent(p));r.fire("clipboardOutput",{dataTransfer:l.dataTransfer,content:b,method:a.name}),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(r,"dragend",(a,l)=>{this._finalizeDragging(!l.dataTransfer.isCanceled&&l.dataTransfer.dropEffect=="move")},{priority:"low"}),this.listenTo(r,"dragenter",()=>{this.isEnabled&&i.focus()}),this.listenTo(r,"dragleave",()=>{this._removeDropMarkerDelayed()}),this.listenTo(r,"dragging",(a,l)=>{if(!this.isEnabled)return void(l.dataTransfer.dropEffect="none");this._removeDropMarkerDelayed.cancel();const d=at(e,l.targetRanges,l.target);this._draggedRange||(l.dataTransfer.dropEffect="copy"),yn.isGecko||(l.dataTransfer.effectAllowed=="copy"?l.dataTransfer.dropEffect="copy":["all","copyMove"].includes(l.dataTransfer.effectAllowed)&&(l.dataTransfer.dropEffect="move")),d&&this._updateDropMarkerThrottled(d)},{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"clipboardInput",(n,i)=>{if(i.method!="drop")return;const r=at(e,i.targetRanges,i.target);if(this._removeDropMarker(),!r)return this._finalizeDragging(!1),void n.stop();if(this._draggedRange&&this._draggingUid!=i.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),jd(i.dataTransfer)=="move"&&this._draggedRange&&this._draggedRange.containsRange(r,!0))return this._finalizeDragging(!1),void n.stop();i.targetRanges=[e.editing.mapper.toViewRange(r)]},{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(nn);e.on("contentInsertion",(t,n)=>{if(!this.isEnabled||n.method!=="drop")return;const i=n.targetRanges.map(r=>this.editor.editing.mapper.toModelRange(r));this.editor.model.change(r=>r.setSelection(i))},{priority:"high"}),e.on("contentInsertion",(t,n)=>{if(!this.isEnabled||n.method!=="drop")return;const i=jd(n.dataTransfer)=="move",r=!n.resultRange||!n.resultRange.isCollapsed;this._finalizeDragging(r&&i)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,n=t.document;this.listenTo(n,"mousedown",(i,r)=>{if(yn.isAndroid||!r)return;this._clearDraggableAttributesDelayed.cancel();let a=Rd(r.target);if(yn.isBlink&&!e.isReadOnly&&!a&&!n.selection.isCollapsed){const l=n.selection.getSelectedElement();l&&it(l)||(a=n.selection.editableElement)}a&&(t.change(l=>{l.setAttribute("draggable","true",a)}),this._draggableElement=e.editing.mapper.toModelElement(a))}),this.listenTo(n,"mouseup",()=>{yn.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change(t=>{this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_setupDropMarker(){const e=this.editor;e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:n})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return n.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(i){const r=this.toDomElement(i);return r.innerHTML="⁠<span></span>⁠",r})}})}_updateDropMarker(e){const t=this.editor,n=t.model.markers;t.model.change(i=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(e)||i.updateMarker("drop-target",{range:e}):i.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})})}_removeDropMarker(){const e=this.editor.model;this._removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),e.markers.has("drop-target")&&e.change(t=>{t.removeMarker("drop-target")})}_finalizeDragging(e){const t=this.editor,n=t.model;this._removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._draggedRange&&(e&&this.isEnabled&&n.deleteContent(n.createSelection(this._draggedRange),{doNotAutoparagraph:!0}),this._draggedRange.detach(),this._draggedRange=null)}}function at(o,e,t){const n=o.model,i=o.editing.mapper;let r=null;const a=e?e[0].start:null;if(t.is("uiElement")&&(t=t.parent),r=function(h,p){const b=h.model,x=h.editing.mapper;if(it(p))return b.createRangeOn(x.toModelElement(p));if(!p.is("editableElement")){const E=p.findAncestor(P=>it(P)||P.is("editableElement"));if(it(E))return b.createRangeOn(x.toModelElement(E))}return null}(o,t),r)return r;const l=function(h,p){const b=h.editing.mapper,x=h.editing.view,E=b.toModelElement(p);if(E)return E;const P=x.createPositionBefore(p),D=b.findMappedViewAncestor(P);return b.toModelElement(D)}(o,t),d=a?i.toModelPosition(a):null;return d?(r=function(h,p,b){const x=h.model;if(!x.schema.checkChild(b,"$block"))return null;const E=x.createPositionAt(b,0),P=p.path.slice(0,E.path.length),D=x.createPositionFromPath(p.root,P).nodeAfter;return D&&x.schema.isObject(D)?x.createRangeOn(D):null}(o,d,l),r||(r=n.schema.getNearestSelectionRange(d,yn.isGecko?"forward":"backward"),r||function(h,p){const b=h.model;for(;p;){if(b.schema.isObject(p))return b.createRangeOn(p);p=p.parent}}(o,d.parent))):function(h,p){const b=h.model,x=b.schema,E=b.createPositionAt(p,0);return x.getNearestSelectionRange(E,"forward")}(o,l)}function jd(o){return yn.isGecko?o.dropEffect:["all","copyMove"].includes(o.effectAllowed)?"move":"copy"}function xi(o,e){let t;function n(...i){n.cancel(),t=setTimeout(()=>o(...i),e)}return n.cancel=()=>{clearTimeout(t)},n}function Rd(o){if(o.is("editableElement"))return null;if(o.hasClass("ck-widget__selection-handle"))return o.findAncestor(it);if(it(o))return o;const e=o.findAncestor(t=>it(t)||t.is("editableElement"));return it(e)?e:null}class Qm extends ve{static get pluginName(){return"PastePlainText"}static get requires(){return[nn]}init(){const e=this.editor,t=e.model,n=e.editing.view,i=n.document,r=t.document.selection;let a=!1;n.addObserver(nt),this.listenTo(i,"keydown",(l,d)=>{a=d.shiftKey}),e.plugins.get(nn).on("contentInsertion",(l,d)=>{(a||function(h,p){if(h.childCount>1)return!1;const b=h.getChild(0);return p.isObject(b)?!1:[...b.getAttributeKeys()].length==0}(d.content,t.schema))&&t.change(h=>{const p=Array.from(r.getAttributes()).filter(([x])=>t.schema.getAttributeProperties(x).isFormatting);r.isCollapsed||t.deleteContent(r,{doNotAutoparagraph:!0}),p.push(...r.getAttributes());const b=h.createRangeIn(d.content);for(const x of b.getItems())x.is("$textProxy")&&h.setAttributes(p,x)})})}}class It extends ve{static get pluginName(){return"Clipboard"}static get requires(){return[nn,Qo,Qm]}}class Ym extends pt{execute(){const e=this.editor.model,t=e.document;e.change(n=>{(function(i,r,a){const l=a.isCollapsed,d=a.getFirstRange(),h=d.start.parent,p=d.end.parent,b=h==p;if(l){const x=ln(i.schema,a.getAttributes());Ld(i,r,d.end),r.removeSelectionAttribute(a.getAttributeKeys()),r.setSelectionAttribute(x)}else{const x=!(d.start.isAtStart&&d.end.isAtEnd);i.deleteContent(a,{leaveUnmerged:x}),b?Ld(i,r,a.focus):x&&r.setSelection(p,0)}})(e,n,t.selection),this.fire("afterExecute",{writer:n})})}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(n,i){if(i.rangeCount>1)return!1;const r=i.anchor;if(!r||!n.checkChild(r,"softBreak"))return!1;const a=i.getFirstRange(),l=a.start.parent,d=a.end.parent;return!((Os(l,n)||Os(d,n))&&l!==d)}(e.schema,t.selection)}}function Ld(o,e,t){const n=e.createElement("softBreak");o.insertContent(n,t),e.setSelection(n,"after")}function Os(o,e){return!o.is("rootElement")&&(e.isLimit(o)||Os(o.parent,e))}class Jm extends ve{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor,t=e.model.schema,n=e.conversion,i=e.editing.view,r=i.document;t.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(a,{writer:l})=>l.createEmptyElement("br")}),i.addObserver(lp),e.commands.add("shiftEnter",new Ym(e)),this.listenTo(r,"enter",(a,l)=>{l.preventDefault(),l.isSoft&&(e.execute("shiftEnter"),i.scrollToTheSelection())},{priority:"low"})}}class Zm extends pt{execute(){const e=this.editor.model,t=e.document.selection;let n=e.schema.getLimitElement(t);if(t.containsEntireContent(n)||!vp(e.schema,n))do if(n=n.parent,!n)return;while(!vp(e.schema,n));e.change(i=>{i.setSelection(n,"in")})}}function vp(o,e){return o.isLimit(e)&&(o.checkChild(e,"$text")||o.checkChild(e,"paragraph"))}const Xm=fr("Ctrl+A");class eb extends ve{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor,t=e.editing.view.document;e.commands.add("selectAll",new Zm(e)),this.listenTo(t,"keydown",(n,i)=>{I(i)===Xm&&(e.execute("selectAll"),i.preventDefault())})}}class tb extends ve{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",t=>{const n=e.commands.get("selectAll"),i=new Xt(t),r=t.t;return i.set({label:r("Select all"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M.75 15.5a.75.75 0 0 1 .75.75V18l.008.09A.5.5 0 0 0 2 18.5h1.75a.75.75 0 1 1 0 1.5H1.5l-.144-.007a1.5 1.5 0 0 1-1.35-1.349L0 18.5v-2.25a.75.75 0 0 1 .75-.75zm18.5 0a.75.75 0 0 1 .75.75v2.25l-.007.144a1.5 1.5 0 0 1-1.349 1.35L18.5 20h-2.25a.75.75 0 1 1 0-1.5H18a.5.5 0 0 0 .492-.41L18.5 18v-1.75a.75.75 0 0 1 .75-.75zm-10.45 3c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm.45-5.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5h8.5zM1.3 11c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM1.3 7c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5h-2.5a.75.75 0 1 1 0-1.5h2.5zm-5 0a.75.75 0 1 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5h5.5zm-6.5-5a.75.75 0 0 1 0 1.5H2a.5.5 0 0 0-.492.41L1.5 2v1.75a.75.75 0 0 1-1.5 0V1.5l.007-.144A1.5 1.5 0 0 1 1.356.006L1.5 0h2.25zM18.5 0l.144.007a1.5 1.5 0 0 1 1.35 1.349L20 1.5v2.25a.75.75 0 1 1-1.5 0V2l-.008-.09A.5.5 0 0 0 18 1.5h-1.75a.75.75 0 1 1 0-1.5h2.25zM8.8 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6z"/></svg>',keystroke:"Ctrl+A",tooltip:!0}),i.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(i,"execute",()=>{e.execute("selectAll"),e.editing.view.focus()}),i})}}class nb extends ve{static get requires(){return[eb,tb]}static get pluginName(){return"SelectAll"}}class ib extends pt{constructor(e,t){super(e),this._buffer=new cp(e.model,t),this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,n=t.document,i=e.text||"",r=i.length,a=e.range?t.createSelection(e.range):n.selection,l=e.resultRange;t.enqueueChange(this._buffer.batch,d=>{this._buffer.lock(),this._batches.add(this._buffer.batch),t.deleteContent(a),i&&t.insertContent(d.createText(i,n.selection.getAttributes()),a),l?d.setSelection(l):a.is("documentSelection")||d.setSelection(a),this._buffer.unlock(),this._buffer.input(r)})}}function wp(o){if(o.newChildren.length-o.oldChildren.length!=1)return;const e=function(n,i){const r=[];let a,l=0;return n.forEach(p=>{p=="equal"?(d(),l++):p=="insert"?(h("insert")?a.values.push(i[l]):(d(),a={type:"insert",index:l,values:[i[l]]}),l++):h("delete")?a.howMany++:(d(),a={type:"delete",index:l,howMany:1})}),d(),r;function d(){a&&(r.push(a),a=null)}function h(p){return a&&a.type==p}}(gr(o.oldChildren,o.newChildren,ob),o.newChildren);if(e.length>1)return;const t=e[0];return t.values[0]&&t.values[0].is("$text")?t:void 0}function ob(o,e){return o&&o.is("$text")&&e&&e.is("$text")?o.data===e.data:o===e}class rb{constructor(e){this.editor=e,this.editing=this.editor.editing}handle(e,t){if(function(n){if(n.length==0)return!1;for(const i of n)if(i.type==="children"&&!wp(i))return!0;return!1}(e))this._handleContainerChildrenMutations(e,t);else for(const n of e)this._handleTextMutation(n,t),this._handleTextNodeInsertion(n)}_handleContainerChildrenMutations(e,t){const n=function(Bn){const Jn=Bn.map(Hn=>Hn.node).reduce((Hn,ji)=>Hn.getCommonAncestor(ji,{includeSelf:!0}));if(Jn)return Jn.getAncestors({includeSelf:!0,parentFirst:!0}).find(Hn=>Hn.is("containerElement")||Hn.is("rootElement"))}(e);if(!n)return;const i=this.editor.editing.view.domConverter.mapViewToDom(n),r=new mo(this.editor.editing.view.document),a=this.editor.data.toModel(r.domToView(i)).getChild(0),l=this.editor.editing.mapper.toModelElement(n);if(!l)return;const d=Array.from(a.getChildren()),h=Array.from(l.getChildren()),p=d[d.length-1],b=h[h.length-1],x=p&&p.is("element","softBreak"),E=b&&!b.is("element","softBreak");x&&E&&d.pop();const P=this.editor.model.schema;if(!_p(d,P)||!_p(h,P))return;const D=d.map(Bn=>Bn.is("$text")?Bn.data:"@").join("").replace(/\u00A0/g," "),R=h.map(Bn=>Bn.is("$text")?Bn.data:"@").join("").replace(/\u00A0/g," ");if(R===D)return;const H=gr(R,D),{firstChangeAt:Q,insertions:ae,deletions:ye}=kp(H);let Be=null;t&&(Be=this.editing.mapper.toModelRange(t.getFirstRange()));const Kt=D.substr(Q,ae),_t=this.editor.model.createRange(this.editor.model.createPositionAt(l,Q),this.editor.model.createPositionAt(l,Q+ye));this.editor.execute("input",{text:Kt,range:_t,resultRange:Be})}_handleTextMutation(e,t){if(e.type!="text")return;const n=e.newText.replace(/\u00A0/g," "),i=e.oldText.replace(/\u00A0/g," ");if(i===n)return;const r=gr(i,n),{firstChangeAt:a,insertions:l,deletions:d}=kp(r);let h=null;t&&(h=this.editing.mapper.toModelRange(t.getFirstRange()));const p=this.editing.view.createPositionAt(e.node,a),b=this.editing.mapper.toModelPosition(p),x=this.editor.model.createRange(b,b.getShiftedBy(d)),E=n.substr(a,l);this.editor.execute("input",{text:E,range:x,resultRange:h})}_handleTextNodeInsertion(e){if(e.type!="children")return;const t=wp(e),n=this.editing.view.createPositionAt(e.node,t.index),i=this.editing.mapper.toModelPosition(n),r=t.values[0].data;this.editor.execute("input",{text:r.replace(/\u00A0/g," "),range:this.editor.model.createRange(i)})}}function _p(o,e){return o.every(t=>e.isInline(t))}function kp(o){let e=null,t=null;for(let r=0;r<o.length;r++)o[r]!="equal"&&(e=e===null?r:e,t=r);let n=0,i=0;for(let r=e;r<=t;r++)o[r]!="insert"&&n++,o[r]!="delete"&&i++;return{insertions:i,deletions:n,firstChangeAt:e}}class Fc extends ve{static get pluginName(){return"Input"}init(){const e=this.editor,t=new ib(e,e.config.get("typing.undoStep")||20);e.commands.add("input",t),function(n){let i=null;const r=n.model,a=n.editing.view,l=n.commands.get("input");function d(p){const b=r.document,x=a.document.isComposing,E=i&&i.isEqual(b.selection);i=null,l.isEnabled&&(Dd(p)||b.selection.isCollapsed||x&&p.keyCode===229||!x&&p.keyCode===229&&E||h())}function h(){const p=l.buffer;p.lock();const b=p.batch;l._batches.add(b),r.enqueueChange(b,()=>{r.deleteContent(r.document.selection)}),p.unlock()}yn.isAndroid?a.document.on("beforeinput",(p,b)=>d(b),{priority:"lowest"}):a.document.on("keydown",(p,b)=>d(b),{priority:"lowest"}),a.document.on("compositionstart",function(){const p=r.document,b=p.selection.rangeCount!==1||p.selection.getFirstRange().isFlat;p.selection.isCollapsed||b||h()},{priority:"lowest"}),a.document.on("compositionend",()=>{i=r.createSelection(r.document.selection)},{priority:"lowest"})}(e),function(n){n.editing.view.document.on("mutations",(i,r,a)=>{new rb(n).handle(r,a)})}(e)}isInput(e){return this.editor.commands.get("input")._batches.has(e)}}class sb extends ve{static get requires(){return[Fc,Xr]}static get pluginName(){return"Typing"}}function Bc(o,e){let t=o.start;return{text:Array.from(o.getItems()).reduce((n,i)=>i.is("$text")||i.is("$textProxy")?n+i.data:(t=e.createPositionAfter(i),""),""),range:e.createRange(t,o.end)}}class Vd{constructor(e,t){this.model=e,this.testCallback=t,this.hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",(t,{directChange:n})=>{n&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this.hasMatch=!1))}),this.listenTo(e,"change:data",(t,n)=>{n.type!="transparent"&&this._evaluateTextBeforeSelection("data",{batch:n})})}_evaluateTextBeforeSelection(e,t={}){const n=this.model,i=n.document.selection,r=n.createRange(n.createPositionAt(i.focus.parent,0),i.focus),{text:a,range:l}=Bc(r,n),d=this.testCallback(a);if(!d&&this.hasMatch&&this.fire("unmatched"),this.hasMatch=!!d,d){const h=Object.assign(t,{text:a,range:l});typeof d=="object"&&Object.assign(h,d),this.fire("matched:"+e,h)}}}ze(Vd,$t);class yp 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,i=e.locale,r=t.document.selection;this.listenTo(n.document,"arrowKey",(a,l)=>{if(!r.isCollapsed||l.shiftKey||l.altKey||l.ctrlKey)return;const d=l.keyCode==ct.arrowright,h=l.keyCode==ct.arrowleft;if(!d&&!h)return;const p=i.contentLanguageDirection;let b=!1;b=p==="ltr"&&d||p==="rtl"&&h?this._handleForwardMovement(l):this._handleBackwardMovement(l),b===!0&&a.stop()},{context:"$text",priority:"highest"}),this._isNextGravityRestorationSkipped=!1,this.listenTo(r,"change:range",(a,l)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!l.directChange&&Hc(r.getFirstPosition(),this.attributes)||this._restoreGravity())})}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,n=this.editor.model.document.selection,i=n.getFirstPosition();return!this._isGravityOverridden&&(!i.isAtStart||!zd(n,t))&&(Hc(i,t)?(jn(e),this._overrideGravity(),!0):void 0)}_handleBackwardMovement(e){const t=this.attributes,n=this.editor.model,i=n.document.selection,r=i.getFirstPosition();return this._isGravityOverridden?(jn(e),this._restoreGravity(),bn(n,t,r),!0):r.isAtStart?!!zd(i,t)&&(jn(e),bn(n,t,r),!0):function(a,l){return Hc(a.getShiftedBy(-1),l)}(r,t)?r.isAtEnd&&!zd(i,t)&&Hc(r,t)?(jn(e),bn(n,t,r),!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 zd(o,e){for(const t of e)if(o.hasAttribute(t))return!0;return!1}function bn(o,e,t){const n=t.nodeBefore;o.change(i=>{n?i.setSelectionAttribute(n.getAttributes()):i.removeSelectionAttribute(e)})}function jn(o){o.preventDefault()}function Hc(o,e){const{nodeBefore:t,nodeAfter:n}=o;for(const i of e){const r=t?t.getAttribute(i):void 0;if((n?n.getAttribute(i):void 0)!==r)return!0}return!1}var xp=/[\\^$.*+?()[\]{}|]/g,ab=RegExp(xp.source),Cp=function(o){return(o=ei(o))&&ab.test(o)?o.replace(xp,"\\$&"):o};const lb={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:js('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:js("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:js("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:js('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:js('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:js("'"),to:[null,"‚",null,"’"]}},Tp={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},cb=["symbols","mathematical","typography","quotes"];function Ep(o){return typeof o=="string"?new RegExp(`(${Cp(o)})$`):o}function ub(o){return typeof o=="string"?()=>[o]:o instanceof Array?()=>o:o}function db(o){return(o.textNode?o.textNode:o.nodeAfter).getAttributes()}function js(o){return new RegExp(`(^|\\s)(${o})([^${o}]*)(${o})$`)}function ts(o,e,t,n){return n.createRange(Fd(o,e,t,!0,n),Fd(o,e,t,!1,n))}function Fd(o,e,t,n,i){let r=o.textNode||(n?o.nodeBefore:o.nodeAfter),a=null;for(;r&&r.getAttribute(e)==t;)a=r,r=n?r.previousSibling:r.nextSibling;return a?i.createPositionAt(a,n?"before":"after"):o}class Sp extends pt{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this.listenTo(e.data,"set",(t,n)=>{n[1]={...n[1]};const i=n[1];i.batchType||(i.batchType="transparent")},{priority:"high"}),this.listenTo(e.data,"set",(t,n)=>{n[1].batchType==="transparent"&&this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}addBatch(e){const t=this.editor.model.document.selection,n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,n){const i=this.editor.model,r=i.document,a=[],l=e.map(h=>h.getTransformedByOperations(n)),d=l.flat();for(const h of l){const p=h.filter(b=>b.root!=r.graveyard).filter(b=>!fb(b,d));p.length&&(hb(p),a.push(p[0]))}a.length&&i.change(h=>{h.setSelection(a,{backward:t})})}_undo(e,t){const n=this.editor.model,i=n.document;this._createdBatches.add(t);const r=e.operations.slice().filter(a=>a.isDocumentOperation);r.reverse();for(const a of r){const l=a.baseVersion+1,d=Array.from(i.history.getOperations(l)),h=Vm([a.getReversed()],d,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const p of h)t.addOperation(p),n.applyOperation(p),i.history.setOperationAsUndone(a,p)}}}function hb(o){o.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let e=1;e<o.length;e++){const t=o[e-1].getJoined(o[e],!0);t&&(e--,o.splice(e,2,t))}}function fb(o,e){return e.some(t=>t!==o&&t.containsRange(o,!0))}class pb extends Sp{execute(e=null){const t=e?this._stack.findIndex(r=>r.batch==e):this._stack.length-1,n=this._stack.splice(t,1)[0],i=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(i,()=>{this._undo(n.batch,i);const r=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,r),this.fire("revert",n.batch,i)}),this.refresh()}}class Rs extends Sp{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(t,()=>{const n=e.batch.operations[e.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,i),this._undo(e.batch,t)}),this.refresh()}}class gb extends ve{static get pluginName(){return"UndoEditing"}constructor(e){super(e),this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new pb(e),this._redoCommand=new Rs(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(t,n)=>{const i=n[0];if(!i.isDocumentOperation)return;const r=i.batch,a=this._redoCommand._createdBatches.has(r),l=this._undoCommand._createdBatches.has(r);this._batchRegistry.has(r)||r.type=="transparent"&&!a&&!l||(a?this._undoCommand.addBatch(r):l||(this._undoCommand.addBatch(r),this._redoCommand.clearStack()),this._batchRegistry.add(r))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(t,n,i)=>{this._redoCommand.addBatch(i)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo")}}var Ap='<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>',Np='<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 mb extends ve{static get pluginName(){return"UndoUI"}init(){const e=this.editor,t=e.locale,n=e.t,i=t.uiLanguageDirection=="ltr"?Ap:Np,r=t.uiLanguageDirection=="ltr"?Np:Ap;this._addButton("undo",n("Undo"),"CTRL+Z",i),this._addButton("redo",n("Redo"),"CTRL+Y",r)}_addButton(e,t,n,i){const r=this.editor;r.ui.componentFactory.add(e,a=>{const l=r.commands.get(e),d=new Xt(a);return d.set({label:t,icon:i,keystroke:n,tooltip:!0}),d.bind("isEnabled").to(l,"isEnabled"),this.listenTo(d,"execute",()=>{r.execute(e),r.editing.view.focus()}),d})}}class Pp extends ve{static get requires(){return[gb,mb]}static get pluginName(){return"Undo"}}class Bd{constructor(){const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((n,i)=>{t.onload=()=>{const r=t.result;this._data=r,n(r)},t.onerror=()=>{i("error")},t.onabort=()=>{i("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}ze(Bd,$t);class Ji extends ve{static get pluginName(){return"FileRepository"}static get requires(){return[Af]}init(){this.loaders=new Xn,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(T.b)("filerepository-no-upload-adapter"),null;const t=new Hd(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(n=>{this._loadersMap.set(n,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let n=0;for(const i of this.loaders)n+=i.uploaded;this.uploaded=n}),t.on("change:uploadTotal",()=>{let n=0;for(const i of this.loaders)i.uploadTotal&&(n+=i.uploadTotal);this.uploadTotal=n}),t}destroyLoader(e){const t=e instanceof Hd?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((n,i)=>{n===t&&this._loadersMap.delete(i)})}_updatePendingAction(){const e=this.editor.plugins.get(Af);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,n=i=>`${t("Upload in progress")} ${parseInt(i)}%.`;this._pendingAction=e.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else e.remove(this._pendingAction),this._pendingAction=null}}ze(Ji,$t);class Hd{constructor(e,t){this.id=M(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new Bd,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(n,i)=>i?n/i*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new T.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 T.a("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{throw this.status==="aborted"?"aborted":(this.status="error",e)})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?e=="reading"?this._reader.abort():e=="uploading"&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise((n,i)=>{t.rejecter=i,t.isFulfilled=!1,e.then(r=>{t.isFulfilled=!0,n(r)}).catch(r=>{t.isFulfilled=!0,i(r)})}),t}}ze(Hd,$t);class bb extends gt{constructor(e){super(e),this.buttonView=new Xt(e),this._fileInputView=new vb(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 vb extends gt{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 wb(){let o=function(n){n=n.toLowerCase();const i=document.cookie.split(";");for(const r of i){const a=r.split("=");if(decodeURIComponent(a[0].trim().toLowerCase())===n)return decodeURIComponent(a[1])}return null}("ckCsrfToken");var e,t;return o&&o.length==40||(o=function(n){let i="";const r=new Uint8Array(n);window.crypto.getRandomValues(r);for(let a=0;a<r.length;a++){const l="abcdefghijklmnopqrstuvwxyz0123456789".charAt(r[a]%36);i+=Math.random()>.5?l.toUpperCase():l}return i}(40),e="ckCsrfToken",t=o,document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/"),o}class _b{constructor(e,t,n){this.loader=e,this.url=t,this.t=n}upload(){return this.loader.file.then(e=>new Promise((t,n)=>{this._initRequest(),this._initListeners(t,n,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,n){const i=this.xhr,r=this.loader,a=(0,this.t)("Cannot upload file:")+` ${n.name}.`;i.addEventListener("error",()=>t(a)),i.addEventListener("abort",()=>t()),i.addEventListener("load",()=>{const l=i.response;if(!l||!l.uploaded)return t(l&&l.error&&l.error.message?l.error.message:a);e({default:l.url})}),i.upload&&i.upload.addEventListener("progress",l=>{l.lengthComputable&&(r.uploadTotal=l.total,r.uploaded=l.loaded)})}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",wb()),this.xhr.send(t)}}function wr(o,e,t,n){let i,r=null;typeof n=="function"?i=n:(r=o.commands.get(n),i=()=>{o.execute(n)}),o.model.document.on("change:data",(a,l)=>{if(r&&!r.isEnabled||!e.isEnabled)return;const d=ti(o.model.document.selection.getRanges());if(!d.isCollapsed||l.type=="transparent")return;const h=Array.from(o.model.document.differ.getChanges()),p=h[0];if(h.length!=1||p.type!=="insert"||p.name!="$text"||p.length!=1)return;const b=p.position.parent;if(b.is("element","codeBlock")||b.is("element","listItem")&&typeof n!="function"&&!["numberedList","bulletedList","todoList"].includes(n)||r&&r.value===!0)return;const x=b.getChild(0),E=o.model.createRangeOn(x);if(!E.containsRange(d)&&!d.end.isEqual(E.end))return;const P=t.exec(x.data.substr(0,d.end.offset));P&&o.model.enqueueChange(D=>{const R=D.createPositionAt(b,0),H=D.createPositionAt(b,P[0].length),Q=new ko(R,H);if(i({match:P})!==!1){D.remove(Q);const ae=o.model.document.selection.getFirstRange(),ye=D.createRangeIn(b);!b.isEmpty||ye.isEqual(ae)||ye.containsRange(ae,!0)||D.remove(b)}Q.detach()})})}function Ls(o,e,t,n){let i,r;t instanceof RegExp?i=t:r=t,r=r||(a=>{let l;const d=[],h=[];for(;(l=i.exec(a))!==null&&!(l&&l.length<4);){let{index:p,1:b,2:x,3:E}=l;const P=b+x+E;p+=l[0].length-P.length;const D=[p,p+b.length],R=[p+b.length+x.length,p+b.length+x.length+E.length];d.push(D),d.push(R),h.push([p+b.length,p+b.length+x.length])}return{remove:d,format:h}}),o.model.document.on("change:data",(a,l)=>{if(l.type=="transparent"||!e.isEnabled)return;const d=o.model,h=d.document.selection;if(!h.isCollapsed)return;const p=Array.from(d.document.differ.getChanges()),b=p[0];if(p.length!=1||b.type!=="insert"||b.name!="$text"||b.length!=1)return;const x=h.focus,E=x.parent,{text:P,range:D}=function(ae,ye){let Be=ae.start;return{text:Array.from(ae.getItems()).reduce((Kt,_t)=>!_t.is("$text")&&!_t.is("$textProxy")||_t.getAttribute("code")?(Be=ye.createPositionAfter(_t),""):Kt+_t.data,""),range:ye.createRange(Be,ae.end)}}(d.createRange(d.createPositionAt(E,0),x),d),R=r(P),H=Ip(D.start,R.format,d),Q=Ip(D.start,R.remove,d);H.length&&Q.length&&d.enqueueChange(ae=>{if(n(ae,H)!==!1)for(const ye of Q.reverse())ae.remove(ye)})})}function Ip(o,e,t){return e.filter(n=>n[0]!==void 0&&n[1]!==void 0).map(n=>t.createRange(o.getShiftedBy(n[0]),o.getShiftedBy(n[1])))}function $c(o,e){return(t,n)=>{if(!o.commands.get(e).isEnabled)return!1;const i=o.model.schema.getValidRanges(n,e);for(const r of i)t.setAttribute(e,!0,r);t.removeSelectionAttribute(e)}}class Mp extends pt{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,i=e.forceValue===void 0?!this.value:e.forceValue;t.change(r=>{if(n.isCollapsed)i?r.setSelectionAttribute(this.attributeKey,!0):r.removeSelectionAttribute(this.attributeKey);else{const a=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const l of a)i?r.setAttribute(this.attributeKey,i,l):r.removeAttribute(this.attributeKey,l)}})}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,n=e.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const i of n.getRanges())for(const r of i.getItems())if(t.checkAttribute(r,this.attributeKey))return r.hasAttribute(this.attributeKey);return!1}}class kb 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 Mp(e,"bold")),e.keystrokes.set("CTRL+B","bold")}}class yb extends ve{static get pluginName(){return"BoldUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("bold",n=>{const i=e.commands.get("bold"),r=new Xt(n);return r.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}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{e.execute("bold"),e.editing.view.focus()}),r})}}class xb 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 Mp(e,"italic")),e.keystrokes.set("CTRL+I","italic")}}class Cb extends ve{static get pluginName(){return"ItalicUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("italic",n=>{const i=e.commands.get("italic"),r=new Xt(n);return r.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}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{e.execute("italic"),e.editing.view.focus()}),r})}}class Tb extends pt{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.schema,i=t.document.selection,r=Array.from(i.getSelectedBlocks()),a=e.forceValue===void 0?!this.value:e.forceValue;t.change(l=>{if(a){const d=r.filter(h=>Uc(h)||Op(n,h));this._applyQuote(l,d)}else this._removeQuote(l,r.filter(Uc))})}_getValue(){const e=ti(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!Uc(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=ti(e.getSelectedBlocks());return!!n&&Op(t,n)}_removeQuote(e,t){Dp(e,t).reverse().forEach(n=>{if(n.start.isAtStart&&n.end.isAtEnd)return void e.unwrap(n.start.parent);if(n.start.isAtStart){const r=e.createPositionBefore(n.start.parent);return void e.move(n,r)}n.end.isAtEnd||e.split(n.end);const i=e.createPositionAfter(n.end.parent);e.move(n,i)})}_applyQuote(e,t){const n=[];Dp(e,t).reverse().forEach(i=>{let r=Uc(i.start);r||(r=e.createElement("blockQuote"),e.wrap(i,r)),n.push(r)}),n.reverse().reduce((i,r)=>i.nextSibling==r?(e.merge(e.createPositionAfter(i)),i):r)}}function Uc(o){return o.parent.name=="blockQuote"?o.parent:null}function Dp(o,e){let t,n=0;const i=[];for(;n<e.length;){const r=e[n],a=e[n+1];t||(t=o.createPositionBefore(r)),a&&r.nextSibling==a||(i.push(o.createRange(t,o.createPositionAfter(r))),t=null),n++}return i}function Op(o,e){const t=o.checkChild(e.parent,"blockQuote"),n=o.checkChild(["$root","blockQuote"],e);return t&&n}class Eb extends ve{static get pluginName(){return"BlockQuoteEditing"}static get requires(){return[Vc,Xr]}init(){const e=this.editor,t=e.model.schema;e.commands.add("blockQuote",new Tb(e)),t.register("blockQuote",{allowWhere:"$block",allowContentOf:"$root"}),e.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),e.model.document.registerPostFixer(a=>{const l=e.model.document.differ.getChanges();for(const d of l)if(d.type=="insert"){const h=d.position.nodeAfter;if(!h)continue;if(h.is("element","blockQuote")&&h.isEmpty)return a.remove(h),!0;if(h.is("element","blockQuote")&&!t.checkChild(d.position,h))return a.unwrap(h),!0;if(h.is("element")){const p=a.createRangeIn(h);for(const b of p.getItems())if(b.is("element","blockQuote")&&!t.checkChild(a.createPositionBefore(b),b))return a.unwrap(b),!0}}else if(d.type=="remove"){const h=d.position.parent;if(h.is("element","blockQuote")&&h.isEmpty)return a.remove(h),!0}return!1});const n=this.editor.editing.view.document,i=e.model.document.selection,r=e.commands.get("blockQuote");this.listenTo(n,"enter",(a,l)=>{!i.isCollapsed||!r.value||i.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),l.preventDefault(),a.stop())},{context:"blockquote"}),this.listenTo(n,"delete",(a,l)=>{if(l.direction!="backward"||!i.isCollapsed||!r.value)return;const d=i.getLastPosition().parent;d.isEmpty&&!d.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),l.preventDefault(),a.stop())},{context:"blockquote"})}}w(69);class Sb extends ve{static get pluginName(){return"BlockQuoteUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("blockQuote",n=>{const i=e.commands.get("blockQuote"),r=new Xt(n);return r.set({label:t("Block quote"),icon:_i.quote,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(r,"execute",()=>{e.execute("blockQuote"),e.editing.view.focus()}),r})}}class Ab extends ve{static get pluginName(){return"CKFinderUI"}init(){const e=this.editor,t=e.ui.componentFactory,n=e.t;t.add("ckfinder",i=>{const r=e.commands.get("ckfinder"),a=new Xt(i);return a.set({label:n("Insert image or file"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.627 16.5zm5.873-.196zm0-7.001V8h-13v8.5h4.341c.191.54.457 1.044.785 1.5H2a1.5 1.5 0 0 1-1.5-1.5v-13A1.5 1.5 0 0 1 2 2h4.5a1.5 1.5 0 0 1 1.06.44L9.122 4H16a1.5 1.5 0 0 1 1.5 1.5v1A1.5 1.5 0 0 1 19 8v2.531a6.027 6.027 0 0 0-1.5-1.228zM16 6.5v-1H8.5l-2-2H2v13h1V8a1.5 1.5 0 0 1 1.5-1.5H16z"/><path d="M14.5 19.5a5 5 0 1 1 0-10 5 5 0 0 1 0 10zM15 14v-2h-1v2h-2v1h2v2h1v-2h2v-1h-2z"/></svg>',tooltip:!0}),a.bind("isEnabled").to(r),a.on("execute",()=>{e.execute("ckfinder"),e.editing.view.focus()}),a})}}class Nb extends pt{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 T.a("ckfinder-unknown-openermethod",e);const n=this.editor.config.get("ckfinder.options")||{};n.chooseFiles=!0;const i=n.onInit;n.language||(n.language=e.locale.uiLanguage),n.onInit=r=>{i&&i(r),r.on("files:choose",a=>{const l=a.data.files.toArray(),d=l.filter(b=>!b.isImage()),h=l.filter(b=>b.isImage());for(const b of d)e.execute("link",b.getUrl());const p=[];for(const b of h){const x=b.getUrl();p.push(x||r.request("file:getProxyUrl",{file:b}))}p.length&&jp(e,p)}),r.on("file:choose:resizedImage",a=>{const l=a.data.resizedUrl;if(l)jp(e,[l]);else{const d=e.plugins.get("Notification"),h=e.locale.t;d.showWarning(h("Could not obtain resized image URL."),{title:h("Selecting resized image failed"),namespace:"ckfinder"})}})},window.CKFinder[t](n)}}function jp(o,e){if(o.commands.get("insertImage").isEnabled)o.execute("insertImage",{source:e});else{const t=o.plugins.get("Notification"),n=o.locale.t;t.showWarning(n("Could not insert image at the current position."),{title:n("Inserting image failed"),namespace:"ckfinder"})}}class Pb extends ve{static get pluginName(){return"CKFinderEditing"}static get requires(){return[Ad,"LinkEditing"]}init(){const e=this.editor;if(!e.plugins.has("ImageBlockEditing")&&!e.plugins.has("ImageInlineEditing"))throw new T.a("ckfinder-missing-image-plugin",e);e.commands.add("ckfinder",new Nb(e))}}class Ib extends ve{static get pluginName(){return"CloudServicesUploadAdapter"}static get requires(){return["CloudServices",Ji]}init(){const e=this.editor,t=e.plugins.get("CloudServices"),n=t.token,i=t.uploadUrl;n&&(this._uploadGateway=e.plugins.get("CloudServicesCore").createUploadGateway(n,i),e.plugins.get(Ji).createUploadAdapter=r=>new $d(this._uploadGateway,r))}}class $d{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 Rp extends pt{refresh(){const e=this.editor.model,t=ti(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&Ud(t,e.schema)}execute(e={}){const t=this.editor.model,n=t.document;t.change(i=>{const r=(e.selection||n.selection).getSelectedBlocks();for(const a of r)!a.is("element","paragraph")&&Ud(a,t.schema)&&i.rename(a,"paragraph")})}}function Ud(o,e){return e.checkChild(o.parent,"paragraph")&&!e.isObject(o)}class Mb extends pt{execute(e){const t=this.editor.model;let n=e.position;t.change(i=>{const r=i.createElement("paragraph");if(!t.schema.checkChild(n.parent,r)){const a=t.schema.findAllowedParent(n,r);if(!a)return;n=i.split(n,a).position}t.insertContent(r,n),i.setSelection(r,"in")})}}class al extends ve{static get pluginName(){return"Paragraph"}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new Rp(e)),e.commands.add("insertParagraph",new Mb(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(n,{writer:i})=>al.paragraphLikeElements.has(n.name)?n.isEmpty?null:i.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}al.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class Db extends pt{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=ti(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>Wc(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,n=t.document,i=e.value;t.change(r=>{const a=Array.from(n.selection.getSelectedBlocks()).filter(l=>Wc(l,i,t.schema));for(const l of a)l.is("element",i)||r.rename(l,i)})}}function Wc(o,e,t){return t.checkChild(o.parent,e)&&!t.isObject(o)}class Ob 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[al]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const i of t)i.model!=="paragraph"&&(e.model.schema.register(i.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new Db(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(i,r)=>{const a=e.model.document.selection.getFirstPosition().parent;n.some(l=>a.is("element",l.model))&&!a.is("element","paragraph")&&a.childCount===0&&r.writer.rename(a,"paragraph")})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:B.get("low")+1})}}w(13);class jb extends ve{static get pluginName(){return"HeadingUI"}init(){const e=this.editor,t=e.t,n=function(a){const l=a.t,d={Paragraph:l("Paragraph"),"Heading 1":l("Heading 1"),"Heading 2":l("Heading 2"),"Heading 3":l("Heading 3"),"Heading 4":l("Heading 4"),"Heading 5":l("Heading 5"),"Heading 6":l("Heading 6")};return a.config.get("heading.options").map(h=>{const p=d[h.title];return p&&p!=h.title&&(h.title=p),h})}(e),i=t("Choose heading"),r=t("Heading");e.ui.componentFactory.add("heading",a=>{const l={},d=new Xn,h=e.commands.get("heading"),p=e.commands.get("paragraph"),b=[h];for(const E of n){const P={type:"button",model:new Nd({label:E.title,class:E.class,withText:!0})};E.model==="paragraph"?(P.model.bind("isOn").to(p,"value"),P.model.set("commandName","paragraph"),b.push(p)):(P.model.bind("isOn").to(h,"value",D=>D===E.model),P.model.set({commandName:"heading",commandValue:E.model})),d.add(P),l[E.model]=E.title}const x=Jr(a);return Gf(x,d),x.buttonView.set({isOn:!1,withText:!0,tooltip:r}),x.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),x.bind("isEnabled").toMany(b,"isEnabled",(...E)=>E.some(P=>P)),x.buttonView.bind("label").to(h,"value",p,"value",(E,P)=>{const D=E||P&&"paragraph";return l[D]?l[D]:i}),this.listenTo(x,"execute",E=>{e.execute(E.source.commandName,E.source.commandValue?{value:E.source.commandValue}:void 0),e.editing.view.focus()}),x})}}class Kc extends ve{static get requires(){return[tl]}static get pluginName(){return"WidgetToolbarRepository"}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",n=>{(function(i){const r=i.getSelectedElement();return!(!r||!it(r))})(e.editing.view.document.selection)&&n.stop()},{priority:"high"})}this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:n,getRelatedElement:i,balloonClassName:r="ck-toolbar-container"}){if(!n.length)return void Object(T.b)("widget-toolbar-no-items",{toolbarId:e});const a=this.editor,l=a.t,d=new Td(a.locale);if(d.ariaLabel=t||l("Widget toolbar"),this._toolbarDefinitions.has(e))throw new T.a("widget-toolbar-duplicated",this,{toolbarId:e});d.fillFromConfig(n,a.ui.componentFactory),this._toolbarDefinitions.set(e,{view:d,getRelatedElement:i,balloonClassName:r})}_updateToolbarsVisibility(){let e=0,t=null,n=null;for(const i of this._toolbarDefinitions.values()){const r=i.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&r)if(this.editor.ui.focusTracker.isFocused){const a=r.getAncestors().length;a>e&&(e=a,t=r,n=i)}else this._isToolbarVisible(i)&&this._hideToolbar(i);else this._isToolbarInBalloon(i)&&this._hideToolbar(i)}n&&this._showToolbar(n,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?Yn(this.editor,t):this._isToolbarInBalloon(e)||(this._balloon.add({view:e.view,position:qc(this.editor,t),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const n of this._toolbarDefinitions.values())if(this._isToolbarVisible(n)){const i=n.getRelatedElement(this.editor.editing.view.document.selection);Yn(this.editor,i)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function Yn(o,e){const t=o.plugins.get("ContextualBalloon"),n=qc(o,e);t.updatePosition(n)}function qc(o,e){const t=o.editing.view,n=dt.defaultPositions;return{target:t.domConverter.mapViewToDom(e),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,Km]}}class Lp{constructor(e){this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=e,this._referenceCoordinates=null}begin(e,t,n){const i=new St(t);this.activeHandlePosition=function(a){const l=["top-left","top-right","bottom-right","bottom-left"];for(const d of l)if(a.classList.contains("ck-widget__resizer__handle-"+d))return d}(e),this._referenceCoordinates=function(a,l){const d=new St(a),h=l.split("-"),p={x:h[1]=="right"?d.right:d.left,y:h[0]=="bottom"?d.bottom:d.top};return p.x+=a.ownerDocument.defaultView.scrollX,p.y+=a.ownerDocument.defaultView.scrollY,p}(t,function(a){const l=a.split("-"),d={top:"bottom",bottom:"top",left:"right",right:"left"};return`${d[l[0]]}-${d[l[1]]}`}(this.activeHandlePosition)),this.originalWidth=i.width,this.originalHeight=i.height,this.aspectRatio=i.width/i.height;const r=n.style.width;r&&r.match(/^\d+(\.\d*)?%$/)?this.originalWidthPercents=parseFloat(r):this.originalWidthPercents=function(a,l){const d=a.parentElement,h=parseFloat(d.ownerDocument.defaultView.getComputedStyle(d).width);return l.width/h*100}(n,i)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}ze(Lp,$t);class Rb extends gt{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",t=>t?"ck-orientation-"+t:"")],style:{display:e.if("_isVisible","none",t=>!t)}},children:[{text:e.to("_label")}]})}_bindToState(e,t){this.bind("_isVisible").to(t,"proposedWidth",t,"proposedHeight",(n,i)=>n!==null&&i!==null),this.bind("_label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",(n,i,r)=>e.unit==="px"?`${n}×${i}`:r+"%"),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",(n,i,r)=>i<50||r<50?"above-center":n)}_dismiss(){this.unbind(),this._isVisible=!1}}class Wd{constructor(e){this._options=e,this._viewResizerWrapper=null,this.set("isEnabled",!0),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",t=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),t.stop())},{priority:"high"}),this.on("change:isEnabled",()=>{this.isEnabled&&this.redraw()})}attach(){const e=this,t=this._options.viewElement;this._options.editor.editing.view.change(n=>{const i=n.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},function(r){const a=this.toDomElement(r);return e._appendHandles(a),e._appendSizeUI(a),e.on("change:isEnabled",(l,d,h)=>{a.style.display=h?"":"none"}),a.style.display=e.isEnabled?"":"none",a});n.insert(n.createPositionAt(t,"end"),i),n.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=i})}begin(e){this.state=new Lp(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 l=this._options.unit||"%",d=(l==="%"?t.widthPercents:t.width)+l;a.setStyle("width",d,this._options.viewElement)});const n=this._getHandleHost(),i=new St(n);t.handleHostWidth=Math.round(i.width),t.handleHostHeight=Math.round(i.height);const r=new St(n);t.width=Math.round(r.width),t.height=Math.round(r.height),this.redraw(i),this.state.update(t)}commit(){const e=this._options.unit||"%",t=(e==="%"?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(t)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const t=this._domResizerWrapper;if(!((n=t)&&n.ownerDocument&&n.ownerDocument.contains(n)))return;var n;const i=t.parentElement,r=this._getHandleHost(),a=this._viewResizerWrapper,l=[a.getStyle("width"),a.getStyle("height"),a.getStyle("left"),a.getStyle("top")];let d;if(i.isSameNode(r)){const h=e||new St(r);d=[h.width+"px",h.height+"px",void 0,void 0]}else d=[r.offsetWidth+"px",r.offsetHeight+"px",r.offsetLeft+"px",r.offsetTop+"px"];z(l,d)!=="same"&&this._options.editor.editing.view.change(h=>{h.setStyle({width:d[0],height:d[1],left:d[2],top:d[3]},a)})}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss(),this._options.editor.editing.view.change(e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){const t=this.state,n={x:(i=e).pageX,y:i.pageY};var i;const r=!this._options.isCentered||this._options.isCentered(this),a={x:t._referenceCoordinates.x-(n.x+t.originalWidth),y:n.y-t.originalHeight-t._referenceCoordinates.y};r&&t.activeHandlePosition.endsWith("-right")&&(a.x=n.x-(t._referenceCoordinates.x+t.originalWidth)),r&&(a.x*=2);const l={width:Math.abs(t.originalWidth+a.x),height:Math.abs(t.originalHeight+a.y)};l.dominant=l.width/t.aspectRatio>l.height?"width":"height",l.max=l[l.dominant];const d={width:l.width,height:l.height};return l.dominant=="width"?d.height=d.width/t.aspectRatio:d.width=d.height*t.aspectRatio,{width:Math.round(d.width),height:Math.round(d.height),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*d.width*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const i of t)e.appendChild(new ki({tag:"div",attributes:{class:"ck-widget__resizer__handle "+(n=i,"ck-widget__resizer__handle-"+n)}}).render());var n}_appendSizeUI(e){this._sizeView=new Rb,this._sizeView.render(),e.appendChild(this._sizeView.element)}}ze(Wd,$t),w(72),ze(class extends ve{static get pluginName(){return"WidgetResize"}init(){const o=this.editor.editing,e=Ft.window.document;this.set("visibleResizer",null),this.set("_activeResizer",null),this._resizers=new Map,o.view.addObserver(Lc),this._observer=Object.create(Wr),this.listenTo(o.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=Od(t,200),this.on("change:visibleResizer",t),this.editor.ui.on("update",this._redrawFocusedResizerThrottled),this.editor.model.document.on("change",()=>{for(const[i,r]of this._resizers)i.isAttached()||(this._resizers.delete(i),r.destroy())},{priority:"lowest"}),this._observer.listenTo(Ft.window,"resize",this._redrawFocusedResizerThrottled);const n=this.editor.editing.view.document.selection;n.on("change",()=>{const i=n.getSelectedElement();this.visibleResizer=this.getResizerByViewElement(i)||null})}destroy(){this._observer.stopListening();for(const o of this._resizers.values())o.destroy();this._redrawFocusedResizerThrottled.cancel()}attachTo(o){const e=new Wd(o),t=this.editor.plugins;if(e.attach(),t.has("WidgetToolbarRepository")){const i=t.get("WidgetToolbarRepository");e.on("begin",()=>{i.forceDisabled("resize")},{priority:"lowest"}),e.on("cancel",()=>{i.clearForceDisabled("resize")},{priority:"highest"}),e.on("commit",()=>{i.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(o.viewElement,e);const n=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(n)==e&&(this.visibleResizer=e),e}getResizerByViewElement(o){return this._resizers.get(o)}_getResizerByHandle(o){for(const e of this._resizers.values())if(e.containsHandle(o))return e}_mouseDownListener(o,e){const t=e.domTarget;Wd.isResizeHandle(t)&&(this._activeResizer=this._getResizerByHandle(t),this._activeResizer&&(this._activeResizer.begin(t),o.stop(),e.preventDefault()))}_mouseMoveListener(o,e){this._activeResizer&&this._activeResizer.updateSize(e)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}},$t);class Lb extends pt{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,n=t.plugins.get("ImageUtils"),i=t.model,r=n.getClosestSelectedImageElement(i.document.selection);i.change(a=>{a.setAttribute("alt",e.newValue,r)})}}function ll(o,e){const t=o.createEmptyElement("img"),n=e==="imageBlock"?o.createContainerElement("figure",{class:"image"}):o.createContainerElement("span",{class:"image-inline"},{isAllowedInsideAttributeElement:!0});return o.insert(o.createPositionAt(n,0),t),n}function Vp(o,e){if(o.plugins.has("ImageInlineEditing")!==o.plugins.has("ImageBlockEditing"))return{name:"img",attributes:{src:!0}};const t=o.plugins.get("ImageUtils");return n=>!t.isInlineImageView(n)||!n.hasAttribute("src")||(n.findAncestor(t.isBlockImageView)?"imageBlock":"imageInline")!==e?null:{name:!0,attributes:["src"]}}function cl(o,e){const t=ti(e.getSelectedBlocks());return!t||o.isObject(t)||t.isEmpty&&t.name!="listItem"?"imageBlock":"imageInline"}class Eo 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 i=this.editor,r=i.model,a=r.document.selection;n=zp(i,t||a,n),e={...Object.fromEntries(a.getAttributes()),...e};for(const l in e)r.schema.checkAttribute(n,l)||delete e[l];return r.change(l=>{const d=l.createElement(n,e);return t||n=="imageInline"||(t=ol(a,r)),r.insertContent(d,t),d.parent?(l.setSelection(d,"on"),d):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(zp(t,n)=="imageBlock"){const i=function(r,a){const l=ol(r,a).start.parent;return l.isEmpty&&!l.is("element","$root")?l.parent:l}(n,t.model);if(t.model.schema.checkChild(i,"imageBlock"))return!0}else if(t.model.schema.checkChild(n.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(t){return[...t.focus.getAncestors()].every(n=>!n.is("element","imageBlock"))}(e)}toImageWidget(e,t,n){return t.setCustomProperty("image",!0,e),en(e,t,{label:()=>{const i=this.findViewImgElement(e).getAttribute("alt");return i?`${i} ${n}`:n}})}isImageWidget(e){return!!e.getCustomProperty("image")&&it(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 zp(o,e,t){const n=o.model.schema,i=o.config.get("image.insert.type");return o.plugins.has("ImageBlockEditing")?o.plugins.has("ImageInlineEditing")?t||(i==="inline"?"imageInline":i==="block"?"imageBlock":e.is("selection")?cl(n,e):n.checkChild(e,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class Vb extends ve{static get requires(){return[Eo]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new Lb(this.editor))}}w(74),w(7);class zb extends gt{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new Mi,this.keystrokes=new mi,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),_i.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),_i.cancel,"ck-button-cancel","cancel"),this._focusables=new Qr,this._focusCycler=new Es({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]}),_d(this)}render(){super.render(),this.keystrokes.listenTo(this.element),kd({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}_createButton(e,t,n,i){const r=new Xt(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}_createLabeledInputView(){const e=this.locale.t,t=new Ed(this.locale,Sd);return t.label=e("Text alternative"),t}}function Kd(o){const e=o.editing.view,t=dt.defaultPositions,n=o.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 Fb extends ve{static get requires(){return[tl]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",n=>{const i=e.commands.get("imageTextAlternative"),r=new Xt(n);return r.set({label:t("Change image text alternative"),icon:_i.lowVision,tooltip:!0}),r.bind("isEnabled").to(i,"isEnabled"),this.listenTo(r,"execute",()=>{this._showForm()}),r})}_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 zb(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(i,r)=>{this._hideForm(!0),r()}),this.listenTo(e.ui,"update",()=>{n.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(i){const r=i.plugins.get("ContextualBalloon");if(i.plugins.get("ImageUtils").getClosestSelectedImageWidget(i.editing.view.document.selection)){const a=Kd(i);r.updatePosition(a)}}(e):this._hideForm(!0)}),wd({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:Kd(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 Fp extends ve{static get requires(){return[Vb,Fb]}static get pluginName(){return"ImageTextAlternative"}}function Bp(o,e){return n=>{n.on("attribute:srcset:"+e,t)};function t(n,i,r){if(!r.consumable.consume(i.item,n.name))return;const a=r.writer,l=r.mapper.toViewElement(i.item),d=o.findViewImgElement(l);if(i.attributeNewValue===null){const h=i.attributeOldValue;h.data&&(a.removeAttribute("srcset",d),a.removeAttribute("sizes",d),h.width&&a.removeAttribute("width",d))}else{const h=i.attributeNewValue;h.data&&(a.setAttribute("srcset",h.data,d),a.setAttribute("sizes","100vw",d),h.width&&a.setAttribute("width",h.width,d))}}}function Vs(o,e,t){return i=>{i.on(`attribute:${t}:${e}`,n)};function n(i,r,a){if(!a.consumable.consume(r.item,i.name))return;const l=a.writer,d=a.mapper.toViewElement(r.item),h=o.findViewImgElement(d);l.setAttribute(r.attributeKey,r.attributeNewValue||"",h)}}class qd extends bo{observe(e){this.listenTo(e,"load",(t,n)=>{const i=n.target;this.checkShouldIgnoreEventFromTarget(i)||i.tagName=="IMG"&&this._fireEvents(n)},{useCapture:!0})}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class Bb extends pt{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||t==="block"&&Object(T.b)("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||t==="inline"&&Object(T.b)("image-inline-plugin-required")}refresh(){this.isEnabled=this.editor.plugins.get("ImageUtils").isImageAllowed()}execute(e){const t=Tt(e.source),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());t.forEach((a,l)=>{const d=n.getSelectedElement();if(typeof a=="string"&&(a={src:a}),l&&d&&i.isImage(d)){const h=this.editor.model.createPositionAfter(d);i.insertImage({...a,...r},h)}else i.insertImage({...a,...r})})}}class Hp extends ve{static get requires(){return[Eo]}static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(qd),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:i=>{const r={data:i.getAttribute("srcset")};return i.hasAttribute("width")&&(r.width=i.getAttribute("width")),r}}});const n=new Bb(e);e.commands.add("insertImage",n),e.commands.add("imageInsert",n)}}class $p extends pt{constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);this._modelElementName==="imageBlock"?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(){const e=this.editor,t=this.editor.model,n=e.plugins.get("ImageUtils"),i=n.getClosestSelectedImageElement(t.document.selection),r=Object.fromEntries(i.getAttributes());return r.src||r.uploadId?t.change(a=>{const l=Array.from(t.markers).filter(p=>p.getRange().containsItem(i)),d=n.insertImage(r,t.createSelection(i,"on"),this._modelElementName);if(!d)return null;const h=a.createRangeOn(d);for(const p of l){const b=p.getRange(),x=b.root.rootName!="$graveyard"?b.getJoined(h,!0):h;a.updateMarker(p,{range:x})}return{oldElement:i,newElement:d}}):null}}class Up extends ve{static get requires(){return[Hp,Eo,nn]}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 $p(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageBlock",view:(r,{writer:a})=>ll(a,"imageBlock")}),n.for("editingDowncast").elementToElement({model:"imageBlock",view:(r,{writer:a})=>i.toImageWidget(ll(a,"imageBlock"),a,t("image widget"))}),n.for("downcast").add(Vs(i,"imageBlock","src")).add(Vs(i,"imageBlock","alt")).add(Bp(i,"imageBlock")),n.for("upcast").elementToElement({view:Vp(e,"imageBlock"),model:(r,{writer:a})=>a.createElement("imageBlock",{src:r.getAttribute("src")})}).add(function(r){return l=>{l.on("element:figure",a)};function a(l,d,h){if(!h.consumable.test(d.viewItem,{name:!0,classes:"image"}))return;const p=r.findViewImgElement(d.viewItem);if(!p||!p.hasAttribute("src")||!h.consumable.test(p,{name:!0}))return;const b=ti(h.convertItem(p,d.modelCursor).modelRange.getItems());b&&(h.convertChildren(d.viewItem,b),h.updateConversionResult(b,d))}}(i))}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,i=e.plugins.get("ImageUtils");this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(r,a)=>{const l=Array.from(a.content.getChildren());let d;if(!l.every(i.isInlineImageView))return;d=a.targetRanges?e.editing.mapper.toModelRange(a.targetRanges[0]):t.document.selection.getFirstRange();const h=t.createSelection(d);if(cl(t.schema,h)==="imageBlock"){const p=new Ms(n.document),b=l.map(x=>p.createElement("figure",{class:"image"},x));a.content=p.createDocumentFragment(b)}})}}w(11);class Hb extends ve{static get requires(){return[Up,sl,Fp]}static get pluginName(){return"ImageBlock"}}class $b extends ve{static get requires(){return[Hp,Eo,nn]}static get pluginName(){return"ImageInlineEditing"}init(){const e=this.editor,t=e.model.schema;t.register("imageInline",{isObject:!0,isInline:!0,allowWhere:"$text",allowAttributes:["alt","src","srcset"]}),t.addChildCheck((n,i)=>{if(n.endsWith("caption")&&i.name==="imageInline")return!1}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new $p(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageInline",view:(r,{writer:a})=>a.createEmptyElement("img")}),n.for("editingDowncast").elementToElement({model:"imageInline",view:(r,{writer:a})=>i.toImageWidget(ll(a,"imageInline"),a,t("image widget"))}),n.for("downcast").add(Vs(i,"imageInline","src")).add(Vs(i,"imageInline","alt")).add(Bp(i,"imageInline")),n.for("upcast").elementToElement({view:Vp(e,"imageInline"),model:(r,{writer:a})=>a.createElement("imageInline",{src:r.getAttribute("src")})})}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,i=e.plugins.get("ImageUtils");this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(r,a)=>{const l=Array.from(a.content.getChildren());let d;if(!l.every(i.isBlockImageView))return;d=a.targetRanges?e.editing.mapper.toModelRange(a.targetRanges[0]):t.document.selection.getFirstRange();const h=t.createSelection(d);if(cl(t.schema,h)==="imageInline"){const p=new Ms(n.document),b=l.map(x=>x.childCount===1?(Array.from(x.getAttributes()).forEach(E=>p.setAttribute(...E,i.findViewImgElement(x))),x.getChild(0)):x);a.content=p.createDocumentFragment(b)}})}}class Ub extends ve{static get requires(){return[$b,sl,Fp]}static get pluginName(){return"ImageInline"}}function Gd(o){for(const e of o.getChildren())if(e&&e.is("element","caption"))return e;return null}function Qd(o,e){const t=e.getFirstPosition().findAncestor("caption");return t&&o.isBlockImage(t.parent)?t:null}class Wb extends pt{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils");if(!e.plugins.has(Up))return this.isEnabled=!1,void(this.value=!1);const n=e.model.document.selection,i=n.getSelectedElement();if(!i){const r=Qd(t,n);return this.isEnabled=!!r,void(this.value=!!r)}this.isEnabled=this.editor.plugins.get("ImageUtils").isImage(i),this.isEnabled?this.value=!!Gd(i):this.value=!1}execute(e={}){const{focusCaptionOnShow:t}=e;this.editor.model.change(n=>{this.value?this._hideImageCaption(n):this._showImageCaption(n,t)})}_showImageCaption(e,t){const n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageCaptionEditing");let r=n.getSelectedElement();const a=i._getSavedCaption(r);this.editor.plugins.get("ImageUtils").isInlineImage(r)&&(this.editor.execute("imageTypeBlock"),r=n.getSelectedElement());const l=a||e.createElement("caption");e.append(l,r),t&&e.setSelection(l,"in")}_hideImageCaption(e){const t=this.editor,n=t.model.document.selection,i=t.plugins.get("ImageCaptionEditing"),r=t.plugins.get("ImageUtils");let a,l=n.getSelectedElement();l?a=Gd(l):(a=Qd(r,n),l=a.parent),i._saveCaption(l,a),e.setSelection(l,"on"),e.remove(a)}}class Kb extends ve{static get requires(){return[Eo]}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 Wb(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration()}_setupConversion(){const e=this.editor,t=e.editing.view,n=e.plugins.get("ImageUtils"),i=e.t;e.conversion.for("upcast").elementToElement({view:r=>function(a,l){return l.name=="figcaption"&&a.isBlockImageView(l.parent)?{name:!0}:null}(n,r),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(r,{writer:a})=>n.isBlockImage(r.parent)?a.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(r,{writer:a})=>{if(!n.isBlockImage(r.parent))return null;const l=a.createEditableElement("figcaption");a.setCustomProperty("imageCaption",!0,l),ep({view:t,element:l,text:i("Enter image caption"),keepOnFocus:!0});const d=Md(l,a);return zc(d,a,(h,p,b)=>b.addClass(Tt(p.classes),h),(h,p,b)=>b.removeClass(Tt(p.classes),h)),d}}),e.editing.mapper.on("modelToViewPosition",Wp(t)),e.data.mapper.on("modelToViewPosition",Wp(t))}_setupImageTypeCommandsIntegration(){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.commands.get("imageTypeInline"),i=e.commands.get("imageTypeBlock"),r=a=>{if(!a.return)return;const{oldElement:l,newElement:d}=a.return;if(!l)return;if(t.isBlockImage(l)){const p=Gd(l);if(p)return void this._saveCaption(d,p)}const h=this._getSavedCaption(l);h&&this._saveCaption(d,h)};n&&this.listenTo(n,"execute",r,{priority:"low"}),i&&this.listenTo(i,"execute",r,{priority:"low"})}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?Ot.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}}function Wp(o){return(e,t)=>{const n=t.modelPosition,i=n.parent;if(!i.is("element","imageBlock"))return;const r=t.mapper.toViewElement(i);t.viewPosition=o.createPositionAt(r,n.offset+1)}}class qb extends ve{static get requires(){return[Eo]}static get pluginName(){return"ImageCaptionUI"}init(){const e=this.editor,t=e.editing.view,n=e.plugins.get("ImageUtils"),i=e.t;e.ui.componentFactory.add("toggleImageCaption",r=>{const a=e.commands.get("toggleImageCaption"),l=new Xt(r);return l.set({icon:_i.caption,tooltip:!0,isToggleable:!0}),l.bind("isOn","isEnabled").to(a,"value","isEnabled"),l.bind("label").to(a,"value",d=>i(d?"Toggle caption off":"Toggle caption on")),this.listenTo(l,"execute",()=>{e.execute("toggleImageCaption",{focusCaptionOnShow:!0});const d=Qd(n,e.model.document.selection);if(d){const h=e.editing.mapper.toViewElement(d);t.scrollToTheSelection(),t.change(p=>{p.addClass("image__caption_highlighted",h)})}}),l})}}w(78);class Gb extends pt{constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map(n=>{if(n.isDefault)for(const i of n.modelElements)this._defaultStyles[i]=n.name;return[n.name,n]}))}refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?e.hasAttribute("imageStyle")?this.value=e.getAttribute("imageStyle"):this.value=this._defaultStyles[e.name]:this.value=!1}execute(e={}){const t=this.editor,n=t.model,i=t.plugins.get("ImageUtils");n.change(r=>{const a=e.value;let l=i.getClosestSelectedImageElement(n.document.selection);a&&this.shouldConvertImageType(a,l)&&(this.editor.execute(i.isBlockImage(l)?"imageTypeInline":"imageTypeBlock"),l=i.getClosestSelectedImageElement(n.document.selection)),!a||this._styles.get(a).isDefault?r.removeAttribute("imageStyle",l):r.setAttribute("imageStyle",a,l)})}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}const{objectFullWidth:Qb,objectInline:Kp,objectLeft:qp,objectRight:Yd,objectCenter:Jd,objectBlockLeft:Gp,objectBlockRight:Qp}=_i,s={inline:{name:"inline",title:"In line",icon:Kp,modelElements:["imageInline"],isDefault:!0},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:qp,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"},alignBlockLeft:{name:"alignBlockLeft",title:"Left aligned image",icon:Gp,modelElements:["imageBlock"],className:"image-style-block-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:Jd,modelElements:["imageBlock"],className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:Yd,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"},alignBlockRight:{name:"alignBlockRight",title:"Right aligned image",icon:Qp,modelElements:["imageBlock"],className:"image-style-block-align-right"},block:{name:"block",title:"Centered image",icon:Jd,modelElements:["imageBlock"],isDefault:!0},side:{name:"side",title:"Side image",icon:Yd,modelElements:["imageBlock"],className:"image-style-side"}},c={full:Qb,left:Gp,right:Qp,center:Jd,inlineLeft:qp,inlineRight:Yd,inline:Kp},f=[{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 y(o){Object(T.b)("image-style-configuration-definition-invalid",o)}var S={normalizeStyles:function(o){return(o.configuredStyles.options||[]).map(e=>function(t){return t=typeof t=="string"?s[t]?{...s[t]}:{name:t}:function(n,i){const r={...i};for(const a in n)Object.prototype.hasOwnProperty.call(i,a)||(r[a]=n[a]);return r}(s[t.name],t),typeof t.icon=="string"&&(t.icon=c[t.icon]||t.icon),t}(e)).filter(e=>function(t,{isBlockPluginLoaded:n,isInlinePluginLoaded:i}){const{modelElements:r,name:a}=t;if(!(r&&r.length&&a))return y({style:t}),!1;{const l=[n?"imageBlock":null,i?"imageInline":null];if(!r.some(d=>l.includes(d)))return Object(T.b)("image-style-missing-dependency",{style:t,missingPlugins:r.map(d=>d==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}(e,o))},getDefaultStylesConfiguration:function(o,e){return o&&e?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:o?{options:["block","side"]}:e?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(o){return o.has("ImageBlockEditing")&&o.has("ImageInlineEditing")?[...f]:[]},warnInvalidStyle:y,DEFAULT_OPTIONS:s,DEFAULT_ICONS:c,DEFAULT_DROPDOWN_DEFINITIONS:f};function O(o,e){for(const t of e)if(t.name===o)return t}class F extends ve{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[Eo]}init(){const{normalizeStyles:e,getDefaultStylesConfiguration:t}=S,n=this.editor,i=n.plugins.has("ImageBlockEditing"),r=n.plugins.has("ImageInlineEditing");n.config.define("image.styles",t(i,r)),this.normalizedStyles=e({configuredStyles:n.config.get("image.styles"),isBlockPluginLoaded:i,isInlinePluginLoaded:r}),this._setupConversion(i,r),this._setupPostFixer(),n.commands.add("imageStyle",new Gb(n,this.normalizedStyles))}_setupConversion(e,t){const n=this.editor,i=n.model.schema,r=(a=this.normalizedStyles,(d,h,p)=>{if(!p.consumable.consume(h.item,d.name))return;const b=O(h.attributeNewValue,a),x=O(h.attributeOldValue,a),E=p.mapper.toViewElement(h.item),P=p.writer;x&&P.removeClass(x.className,E),b&&P.addClass(b.className,E)});var a;const l=function(d){const h={imageInline:d.filter(p=>!p.isDefault&&p.modelElements.includes("imageInline")),imageBlock:d.filter(p=>!p.isDefault&&p.modelElements.includes("imageBlock"))};return(p,b,x)=>{if(!b.modelRange)return;const E=b.viewItem,P=ti(b.modelRange.getItems());if(P&&x.schema.checkAttribute(P,"imageStyle"))for(const D of h[P.name])x.consumable.consume(E,{classes:D.className})&&x.writer.setAttribute("imageStyle",D.name,P)}}(this.normalizedStyles);n.editing.downcastDispatcher.on("attribute:imageStyle",r),n.data.downcastDispatcher.on("attribute:imageStyle",r),e&&(i.extend("imageBlock",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:figure",l,{priority:"low"})),t&&(i.extend("imageInline",{allowAttributes:"imageStyle"}),n.data.upcastDispatcher.on("element:img",l,{priority:"low"}))}_setupPostFixer(){const e=this.editor,t=e.model.document,n=e.plugins.get(Eo),i=new Map(this.normalizedStyles.map(r=>[r.name,r]));t.registerPostFixer(r=>{let a=!1;for(const l of t.differ.getChanges())if(l.type=="insert"||l.type=="attribute"&&l.attributeKey=="imageStyle"){let d=l.type=="insert"?l.position.nodeAfter:l.range.start.nodeAfter;if(d&&d.is("element","paragraph")&&d.childCount>0&&(d=d.getChild(0)),!n.isImage(d))continue;const h=d.getAttribute("imageStyle");if(!h)continue;const p=i.get(h);p&&p.modelElements.includes(d.name)||(r.removeAttribute("imageStyle",d),a=!0)}return a})}}w(80);class W extends ve{static get requires(){return[F]}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=q(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const r of n)this._createButton(r);const i=q([...t.filter(ne),...S.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(const r of i)this._createDropdown(r,n)}_createDropdown(e,t){const n=this.editor.ui.componentFactory;n.add(e.name,i=>{let r;const{defaultItem:a,items:l,title:d}=e,h=l.filter(x=>t.find(({name:E})=>de(E)===x)).map(x=>{const E=n.create(x);return x===a&&(r=E),E});l.length!==h.length&&S.warnInvalidStyle({dropdown:e});const p=Jr(i,zf),b=p.buttonView;return qf(p,h),b.set({label:he(d,r.label),class:null,tooltip:!0}),b.bind("icon").toMany(h,"isOn",(...x)=>{const E=x.findIndex(Nt);return E<0?r.icon:h[E].icon}),b.bind("label").toMany(h,"isOn",(...x)=>{const E=x.findIndex(Nt);return he(d,E<0?r.label:h[E].label)}),b.bind("isOn").toMany(h,"isOn",(...x)=>x.some(Nt)),b.bind("class").toMany(h,"isOn",(...x)=>x.some(Nt)?"ck-splitbutton_flatten":null),b.on("execute",()=>{h.some(({isOn:x})=>x)?p.isOpen=!p.isOpen:r.fire("execute")}),p.bind("isEnabled").toMany(h,"isEnabled",(...x)=>x.some(Nt)),p})}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(de(t),n=>{const i=this.editor.commands.get("imageStyle"),r=new Xt(n);return r.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),r.bind("isEnabled").to(i,"isEnabled"),r.bind("isOn").to(i,"value",a=>a===t),r.on("execute",this._executeCommand.bind(this,t)),r})}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function q(o,e){for(const t of o)e[t.title]&&(t.title=e[t.title]);return o}function de(o){return"imageStyle:"+o}function he(o,e){return(o?o+": ":"")+e}function ge(o){const e=o.map(t=>t.replace("+","\\+"));return new RegExp(`^image\\/(${e.join("|")})$`)}function Ee(o){return new Promise((e,t)=>{const n=o.getAttribute("src");fetch(n).then(i=>i.blob()).then(i=>{const r=Re(i,n),a=r.replace("image/",""),l=new File([i],"image."+a,{type:r});e(l)}).catch(i=>i&&i.name==="TypeError"?function(r){return function(a){return new Promise((l,d)=>{const h=Ft.document.createElement("img");h.addEventListener("load",()=>{const p=Ft.document.createElement("canvas");p.width=h.width,p.height=h.height,p.getContext("2d").drawImage(h,0,0),p.toBlob(b=>b?l(b):d())}),h.addEventListener("error",()=>d()),h.src=a})}(r).then(a=>{const l=Re(a,r),d=l.replace("image/","");return new File([a],"image."+d,{type:l})})}(n).then(e).catch(t):t(i))})}function Re(o,e){return o.type?o.type:e.match(/data:(image\/\w+);base64/)?e.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class Qe extends ve{static get pluginName(){return"ImageUploadUI"}init(){const e=this.editor,t=e.t,n=i=>{const r=new bb(i),a=e.commands.get("uploadImage"),l=e.config.get("image.upload.types"),d=ge(l);return r.set({acceptedType:l.map(h=>"image/"+h).join(","),allowMultipleFiles:!0}),r.buttonView.set({label:t("Insert image"),icon:_i.image,tooltip:!0}),r.buttonView.bind("isEnabled").to(a),r.on("done",(h,p)=>{const b=Array.from(p).filter(x=>d.test(x.type));b.length&&e.execute("uploadImage",{file:b})}),r};e.ui.componentFactory.add("uploadImage",n),e.ui.componentFactory.add("imageUpload",n)}}w(82),w(84),w(86);class mt 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 i=this.editor,r=t.item,a=r.getAttribute("uploadId");if(!n.consumable.consume(t.item,e.name))return;const l=i.plugins.get("ImageUtils"),d=i.plugins.get(Ji),h=a?t.attributeNewValue:null,p=this.placeholder,b=i.editing.mapper.toViewElement(r),x=n.writer;if(h=="reading")return Ge(b,x),void bt(l,p,b,x);if(h=="uploading"){const E=d.loaders.get(a);return Ge(b,x),void(E?(wt(b,x),function(P,D,R,H){const Q=function(ae){const ye=ae.createUIElement("div",{class:"ck-progress-bar"});return ae.setCustomProperty("progressBar",!0,ye),ye}(D);D.insert(D.createPositionAt(P,"end"),Q),R.on("change:uploadedPercent",(ae,ye,Be)=>{H.change(Kt=>{Kt.setStyle("width",Be+"%",Q)})})}(b,x,E,i.editing.view),function(P,D,R,H){if(H.data){const Q=P.findViewImgElement(D);R.setAttribute("src",H.data,Q)}}(l,b,x,E)):bt(l,p,b,x))}h=="complete"&&d.loaders.get(a)&&function(E,P,D){const R=P.createUIElement("div",{class:"ck-image-upload-complete-icon"});P.insert(P.createPositionAt(E,"end"),R),setTimeout(()=>{D.change(H=>H.remove(H.createRangeOn(R)))},3e3)}(b,x,i.editing.view),function(E,P){Fn(E,P,"progressBar")}(b,x),wt(b,x),function(E,P){P.removeClass("ck-appear",E)}(b,x)}}function Ge(o,e){o.hasClass("ck-appear")||e.addClass("ck-appear",o)}function bt(o,e,t,n){t.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",t);const i=o.findViewImgElement(t);i.getAttribute("src")!==e&&n.setAttribute("src",e,i),ri(t,"placeholder")||n.insert(n.createPositionAfter(i),function(r){const a=r.createUIElement("div",{class:"ck-upload-placeholder-loader"});return r.setCustomProperty("placeholder",!0,a),a}(n))}function wt(o,e){o.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",o),Fn(o,e,"placeholder")}function ri(o,e){for(const t of o.getChildren())if(t.getCustomProperty(e))return t}function Fn(o,e,t){const n=ri(o,t);n&&e.remove(e.createRangeOn(n))}class Ci extends pt{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=Tt(e.file),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(n.getAttributes());t.forEach((a,l)=>{const d=n.getSelectedElement();if(l&&d&&i.isImage(d)){const h=this.editor.model.createPositionAfter(d);this._uploadImage(a,r,h)}else this._uploadImage(a,r)})}_uploadImage(e,t,n){const i=this.editor,r=i.plugins.get(Ji).createLoader(e),a=i.plugins.get("ImageUtils");r&&a.insertImage({...t,uploadId:r.id},n)}}class hn extends ve{static get requires(){return[Ji,Ad,nn,Eo]}static get pluginName(){return"ImageUploadEditing"}constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){const e=this.editor,t=e.model.document,n=e.conversion,i=e.plugins.get(Ji),r=e.plugins.get("ImageUtils"),a=ge(e.config.get("image.upload.types")),l=new Ci(e);e.commands.add("uploadImage",l),e.commands.add("imageUpload",l),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",(d,h)=>{if(p=h.dataTransfer,Array.from(p.types).includes("text/html")&&p.getData("text/html")!=="")return;var p;const b=Array.from(h.dataTransfer.files).filter(x=>!!x&&a.test(x.type));b.length&&(d.stop(),e.model.change(x=>{h.targetRanges&&x.setSelection(h.targetRanges.map(E=>e.editing.mapper.toModelRange(E))),e.model.enqueueChange("default",()=>{e.execute("uploadImage",{file:b})})}))}),this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(d,h)=>{const p=Array.from(e.editing.view.createRangeIn(h.content)).filter(x=>function(E,P){return!(!E.isInlineImageView(P)||!P.getAttribute("src"))&&(P.getAttribute("src").match(/^data:image\/\w+;base64,/g)||P.getAttribute("src").match(/^blob:/g))}(r,x.item)&&!x.item.getAttribute("uploadProcessed")).map(x=>({promise:Ee(x.item),imageElement:x.item}));if(!p.length)return;const b=new Ms(e.editing.view.document);for(const x of p){b.setAttribute("uploadProcessed",!0,x.imageElement);const E=i.createLoader(x.promise);E&&(b.setAttribute("src","",x.imageElement),b.setAttribute("uploadId",E.id,x.imageElement))}}),e.editing.view.document.on("dragover",(d,h)=>{h.preventDefault()}),t.on("change",()=>{const d=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),h=new Set;for(const p of d)if(p.type=="insert"&&p.name!="$text"){const b=p.position.nodeAfter,x=p.position.root.rootName=="$graveyard";for(const E of Zi(e,b)){const P=E.getAttribute("uploadId");if(!P)continue;const D=i.loaders.get(P);D&&(x?h.has(P)||D.abort():(h.add(P),this._uploadImageElements.set(P,E),D.status=="idle"&&this._readAndUpload(D)))}}}),this.on("uploadComplete",(d,{imageElement:h,data:p})=>{const b=p.urls?p.urls:p;this.editor.model.change(x=>{x.setAttribute("src",b.default,h),this._parseAndSetSrcsetAttributeOnImage(b,h,x)})},{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(e){const t=this.editor,n=t.model,i=t.locale.t,r=t.plugins.get(Ji),a=t.plugins.get(Ad),l=t.plugins.get("ImageUtils"),d=this._uploadImageElements;return n.enqueueChange("transparent",p=>{p.setAttribute("uploadStatus","reading",d.get(e.id))}),e.read().then(()=>{const p=e.upload(),b=d.get(e.id);if(yn.isSafari){const x=t.editing.mapper.toViewElement(b),E=l.findViewImgElement(x);t.editing.view.once("render",()=>{if(!E.parent)return;const P=t.editing.view.domConverter.mapViewToDom(E.parent);if(!P)return;const D=P.style.display;P.style.display="none",P._ckHack=P.offsetHeight,P.style.display=D})}return n.enqueueChange("transparent",x=>{x.setAttribute("uploadStatus","uploading",b)}),p}).then(p=>{n.enqueueChange("transparent",b=>{const x=d.get(e.id);b.setAttribute("uploadStatus","complete",x),this.fire("uploadComplete",{data:p,imageElement:x})}),h()}).catch(p=>{if(e.status!=="error"&&e.status!=="aborted")throw p;e.status=="error"&&p&&a.showWarning(p,{title:i("Upload failed"),namespace:"upload"}),n.enqueueChange("transparent",b=>{b.remove(d.get(e.id))}),h()});function h(){n.enqueueChange("transparent",p=>{const b=d.get(e.id);p.removeAttribute("uploadId",b),p.removeAttribute("uploadStatus",b),d.delete(e.id)}),r.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let i=0;const r=Object.keys(e).filter(a=>{const l=parseInt(a,10);if(!isNaN(l))return i=Math.max(i,l),!0}).map(a=>`${e[a]} ${a}w`).join(", ");r!=""&&n.setAttribute("srcset",{data:r,width:i},t)}}function Zi(o,e){const t=o.plugins.get("ImageUtils");return Array.from(o.model.createRangeOn(e)).filter(n=>t.isImage(n.item)).map(n=>n.item)}class Yo extends ve{static get pluginName(){return"IndentEditing"}init(){const e=this.editor;e.commands.add("indent",new Js(e)),e.commands.add("outdent",new Js(e))}}var Zd='<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>',Vw='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zm1.618-9.55L.98 9.358a.4.4 0 0 0 .013.661l3.39 2.207A.4.4 0 0 0 5 11.892V7.275a.4.4 0 0 0-.632-.326z"/></svg>';class ey extends ve{static get pluginName(){return"IndentUI"}init(){const e=this.editor,t=e.locale,n=e.t,i=t.uiLanguageDirection=="ltr"?Zd:Vw,r=t.uiLanguageDirection=="ltr"?Vw:Zd;this._defineButton("indent",n("Increase indent"),i),this._defineButton("outdent",n("Decrease indent"),r)}_defineButton(e,t,n){const i=this.editor;i.ui.componentFactory.add(e,r=>{const a=i.commands.get(e),l=new Xt(r);return l.set({label:t,icon:n,tooltip:!0}),l.bind("isOn","isEnabled").to(a,"value","isEnabled"),this.listenTo(l,"execute",()=>{i.execute(e),i.editing.view.focus()}),l})}}class ty{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach(t=>this._definitions.add(t)):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",(t,n,i)=>{if(!i.consumable.test(n.item,"attribute:linkHref"))return;const r=i.writer,a=r.document.selection;for(const l of this._definitions){const d=r.createAttributeElement("a",l.attributes,{priority:5});l.classes&&r.addClass(l.classes,d);for(const h in l.styles)r.setStyle(h,l.styles[h],d);r.setCustomProperty("link",!0,d),l.callback(n.attributeNewValue)?n.item.is("selection")?r.wrap(a.getFirstRange(),d):r.wrap(i.mapper.toViewRange(n.range),d):r.unwrap(i.mapper.toViewRange(n.range),d)}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",(t,n,{writer:i,mapper:r})=>{const a=r.toViewElement(n.item),l=Array.from(a.getChildren()).find(d=>d.name==="a");for(const d of this._definitions){const h=Ke(d.attributes);if(d.callback(n.attributeNewValue)){for(const[p,b]of h)p==="class"?i.addClass(b,l):i.setAttribute(p,b,l);d.classes&&i.addClass(d.classes,l);for(const p in d.styles)i.setStyle(p,d.styles[p],l)}else{for(const[p,b]of h)p==="class"?i.removeClass(b,l):i.removeAttribute(p,l);d.classes&&i.removeClass(d.classes,l);for(const p in d.styles)i.removeStyle(p,l)}}})}}}var ny=function(o,e,t){var n=o.length;return t=t===void 0?n:t,!e&&t>=n?o:Aa(o,e,t)},iy=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),zw=function(o){return iy.test(o)},oy=function(o){return o.split("")},ry="[\\ud800-\\udfff]",Yb="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Jb="\\ud83c[\\udffb-\\udfff]",Fw="[^\\ud800-\\udfff]",Bw="(?:\\ud83c[\\udde6-\\uddff]){2}",Hw="[\\ud800-\\udbff][\\udc00-\\udfff]",$w="(?:"+Yb+"|"+Jb+")?",sy="[\\ufe0e\\ufe0f]?"+$w+("(?:\\u200d(?:"+[Fw,Bw,Hw].join("|")+")[\\ufe0e\\ufe0f]?"+$w+")*"),ay="(?:"+[Fw+Yb+"?",Yb,Bw,Hw,ry].join("|")+")",ly=RegExp(Jb+"(?="+Jb+")|"+ay+sy,"g"),cy=function(o){return o.match(ly)||[]},uy=function(o){return zw(o)?cy(o):oy(o)},dy=function(o){return function(e){e=ei(e);var t=zw(e)?uy(e):void 0,n=t?t[0]:e.charAt(0),i=t?ny(t,1).join(""):e.slice(1);return n[o]()+i}}("toUpperCase");const hy=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,fy=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,py=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,gy=/^((\w+:(\/{2,})?)|(\W))/i;function Uw(o,{writer:e}){const t=e.createAttributeElement("a",{href:o},{priority:5});return e.setCustomProperty("link",!0,t),t}function Ww(o){return function(e){return e.replace(hy,"").match(fy)}(o=String(o))?o:"#"}function Zb(o,e){return!!o&&e.checkAttribute(o.name,"linkHref")}function Kw(o,e){const t=(n=o,py.test(n)?"mailto:":e);var n;const i=!!t&&!gy.test(o);return o&&i?t+o:o}class my extends pt{constructor(e){super(e),this.manualDecorators=new Xn,this.automaticDecorators=new ty}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()||ti(t.getSelectedBlocks());Zb(n,e.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(n,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const i of this.manualDecorators)i.value=this._getDecoratorStateFromModel(i.id)}execute(e,t={}){const n=this.editor.model,i=n.document.selection,r=[],a=[];for(const l in t)t[l]?r.push(l):a.push(l);n.change(l=>{if(i.isCollapsed){const d=i.getFirstPosition();if(i.hasAttribute("linkHref")){const h=ts(d,"linkHref",i.getAttribute("linkHref"),n);l.setAttribute("linkHref",e,h),r.forEach(p=>{l.setAttribute(p,!0,h)}),a.forEach(p=>{l.removeAttribute(p,h)}),l.setSelection(l.createPositionAfter(h.end.nodeBefore))}else if(e!==""){const h=Ke(i.getAttributes());h.set("linkHref",e),r.forEach(b=>{h.set(b,!0)});const{end:p}=n.insertContent(l.createText(e,h),d);l.setSelection(p)}["linkHref",...r,...a].forEach(h=>{l.removeSelectionAttribute(h)})}else{const d=n.schema.getValidRanges(i.getRanges(),"linkHref"),h=[];for(const b of i.getSelectedBlocks())n.schema.checkAttribute(b,"linkHref")&&h.push(l.createRangeOn(b));const p=h.slice();for(const b of d)this._isRangeToUpdate(b,h)&&p.push(b);for(const b of p)l.setAttribute("linkHref",e,b),r.forEach(x=>{l.setAttribute(x,!0,b)}),a.forEach(x=>{l.removeAttribute(x,b)})}})}_getDecoratorStateFromModel(e){const t=this.editor.model,n=t.document.selection,i=n.getSelectedElement();return Zb(i,t.schema)?i.getAttribute(e):n.getAttribute(e)}_isRangeToUpdate(e,t){for(const n of t)if(n.containsRange(e))return!1;return!0}}class by extends pt{refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement();Zb(n,e.schema)?this.isEnabled=e.schema.checkAttribute(n,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,n=t.document.selection,i=e.commands.get("link");t.change(r=>{const a=n.isCollapsed?[ts(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),t)]:t.schema.getValidRanges(n.getRanges(),"linkHref");for(const l of a)if(r.removeAttribute("linkHref",l),i)for(const d of i.manualDecorators)r.removeAttribute(d.id,l)})}}class qw{constructor({id:e,label:t,attributes:n,classes:i,styles:r,defaultValue:a}){this.id=e,this.set("value"),this.defaultValue=a,this.label=t,this.attributes=n,this.classes=i,this.styles=r}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}ze(qw,$t),w(88);const vy=/^(https?:)?\/\//;class wy extends ve{static get pluginName(){return"LinkEditing"}static get requires(){return[yp,Fc,nn]}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:Uw}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(n,i)=>Uw(Ww(n),i)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:n=>n.getAttribute("href")}}),e.commands.add("link",new my(e)),e.commands.add("unlink",new by(e));const t=function(n,i){const r={"Open in a new tab":n("Open in a new tab"),Downloadable:n("Downloadable")};return i.forEach(a=>(a.label&&r[a.label]&&(a.label=r[a.label]),a)),i}(e.t,function(n){const i=[];if(n)for(const[r,a]of Object.entries(n)){const l=Object.assign({},a,{id:"link"+dy(r)});i.push(l)}return i}(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter(n=>n.mode==="automatic")),this._enableManualDecorators(t.filter(n=>n.mode==="manual")),e.plugins.get(yp).registerAttribute("linkHref"),function(n,i,r,a){const l=n.editing.view,d=new Set;l.document.registerPostFixer(h=>{const p=n.model.document.selection;let b=!1;if(p.hasAttribute(i)){const x=ts(p.getFirstPosition(),i,p.getAttribute(i),n.model),E=n.editing.mapper.toViewRange(x);for(const P of E.getItems())P.is("element",r)&&!P.hasClass(a)&&(h.addClass(a,P),d.add(P),b=!0)}return b}),n.conversion.for("editingDowncast").add(h=>{function p(){l.change(b=>{for(const x of d.values())b.removeClass(a,x),d.delete(x)})}h.on("insert",p,{priority:"highest"}),h.on("remove",p,{priority:"highest"}),h.on("attribute",p,{priority:"highest"}),h.on("selection",p,{priority:"highest"})})}(e,"linkHref","a","ck-link_selected"),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(e){const t=this.editor,n=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:"automatic",callback:i=>vy.test(i),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(e),n.length&&t.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,n=t.commands.get("link").manualDecorators;e.forEach(i=>{t.model.schema.extend("$text",{allowAttributes:i.id}),i=new qw(i),n.add(i),t.conversion.for("downcast").attributeToElement({model:i.id,view:(r,{writer:a})=>{if(r){const l=a.createAttributeElement("a",i.attributes,{priority:5});i.classes&&a.addClass(i.classes,l);for(const d in i.styles)a.setStyle(d,i.styles[d],l);return a.setCustomProperty("link",!0,l),l}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...i._createPattern()},model:{key:i.id}})})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(e,"insertContent",()=>{const n=t.anchor.nodeBefore,i=t.anchor.nodeAfter;t.hasAttribute("linkHref")&&n&&n.hasAttribute("linkHref")&&(i&&i.hasAttribute("linkHref")||e.change(r=>{Xb(r,ev(e.schema))}))},{priority:"low"})}_enableClickingAfterLink(){const e=this.editor,t=e.model;e.editing.view.addObserver(Lc);let n=!1;this.listenTo(e.editing.view.document,"mousedown",()=>{n=!0}),this.listenTo(e.editing.view.document,"selectionChange",()=>{if(!n)return;n=!1;const i=t.document.selection;if(!i.isCollapsed||!i.hasAttribute("linkHref"))return;const r=i.getFirstPosition(),a=ts(r,"linkHref",i.getAttribute("linkHref"),t);(r.isTouching(a.start)||r.isTouching(a.end))&&t.change(l=>{Xb(l,ev(t.schema))})})}_enableTypingOverLink(){const e=this.editor,t=e.editing.view;let n,i;this.listenTo(t.document,"delete",()=>{i=!0},{priority:"high"}),this.listenTo(e.model,"deleteContent",()=>{const r=e.model.document.selection;r.isCollapsed||(i?i=!1:Gw(e)&&function(a){const l=a.document.selection,d=l.getFirstPosition(),h=l.getLastPosition(),p=d.nodeAfter;if(!p||!p.is("$text")||!p.hasAttribute("linkHref"))return!1;const b=h.textNode||h.nodeBefore;return p===b?!0:ts(d,"linkHref",p.getAttribute("linkHref"),a).containsRange(a.createRange(d,h),!0)}(e.model)&&(n=r.getAttributes()))},{priority:"high"}),this.listenTo(e.model,"insertContent",(r,[a])=>{i=!1,Gw(e)&&n&&(e.model.change(l=>{for(const[d,h]of n)l.setAttribute(d,h,a)}),n=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const e=this.editor,t=e.model,n=t.document.selection,i=e.editing.view;let r=!1,a=!1;this.listenTo(i.document,"delete",(l,d)=>{a=d.domEvent.keyCode===ct.backspace},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{r=!1;const l=n.getFirstPosition(),d=n.getAttribute("linkHref");if(!d)return;const h=ts(l,"linkHref",d,t);r=h.containsPosition(l)||h.end.isEqual(l)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{a&&(a=!1,r||e.model.enqueueChange(l=>{Xb(l,ev(t.schema))}))},{priority:"low"})}}function Xb(o,e){o.removeSelectionAttribute("linkHref");for(const t of e)o.removeSelectionAttribute(t)}function Gw(o){return o.plugins.get("Input").isInput(o.model.change(e=>e.batch))}function ev(o){return o.getDefinition("$text").allowAttributes.filter(e=>e.startsWith("link"))}w(90);class _y extends gt{constructor(e,t){super(e);const n=e.t;this.focusTracker=new Mi,this.keystrokes=new mi,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),_i.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),_i.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusables=new Qr,this._focusCycler=new Es({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&i.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children}),_d(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>(e[t.name]=t.isOn,e),{})}render(){super.render(),kd({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 Ed(this.locale,Sd);return t.label=e("Link URL"),t}_createButton(e,t,n,i){const r=new Xt(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const n of e.manualDecorators){const i=new Dc(this.locale);i.set({name:n.id,label:n.label,withText:!0}),i.bind("isOn").toMany([n,e],"value",(r,a)=>a===void 0&&r===void 0?n.defaultValue:r),i.on("execute",()=>{n.set("value",!i.isOn)}),t.add(i)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const n=new gt;n.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(i=>({tag:"li",children:[i],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(n)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}}w(92);class ky extends gt{constructor(e){super(e);const t=e.t;this.focusTracker=new Mi,this.keystrokes=new mi,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"),_i.pencil,"edit"),this.set("href"),this._focusables=new Qr,this._focusCycler=new Es({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(e,t,n){const i=new Xt(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.delegate("execute").to(this,n),i}_createPreviewButton(){const e=new Xt(this.locale),t=this.bindTemplate,n=this.t;return e.set({withText:!0,tooltip:n("Open link in new tab")}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",i=>i&&Ww(i)),target:"_blank",rel:"noopener noreferrer"}}),e.bind("label").to(this,"href",i=>i||n("This link has no URL")),e.bind("isEnabled").to(this,"href",i=>!!i),e.template.tag="a",e.template.eventListeners={},e}}class yy extends ve{static get requires(){return[tl]}static get pluginName(){return"LinkUI"}init(){const e=this.editor;e.editing.view.addObserver(Fm),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=e.plugins.get(tl),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 ky(e.locale),n=e.commands.get("link"),i=e.commands.get("unlink");return t.bind("href").to(n,"value"),t.editButtonView.bind("isEnabled").to(n),t.unlinkButtonView.bind("isEnabled").to(i),this.listenTo(t,"edit",()=>{this._addFormView()}),this.listenTo(t,"unlink",()=>{e.execute("unlink"),this._hideUI()}),t.keystrokes.set("Esc",(r,a)=>{this._hideUI(),a()}),t.keystrokes.set("Ctrl+K",(r,a)=>{this._addFormView(),a()}),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),n=e.config.get("link.defaultProtocol"),i=new _y(e.locale,t);return i.urlInputView.fieldView.bind("value").to(t,"value"),i.urlInputView.bind("isReadOnly").to(t,"isEnabled",r=>!r),i.saveButtonView.bind("isEnabled").to(t),this.listenTo(i,"submit",()=>{const{value:r}=i.urlInputView.fieldView.element,a=Kw(r,n);e.execute("link",a,i.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(i,"cancel",()=>{this._closeFormView()}),i.keystrokes.set("Esc",(r,a)=>{this._closeFormView(),a()}),i}_createToolbarLinkButton(){const e=this.editor,t=e.commands.get("link"),n=e.t;e.keystrokes.set("Ctrl+K",(i,r)=>{r(),t.isEnabled&&this._showUI(!0)}),e.ui.componentFactory.add("link",i=>{const r=new Xt(i);return r.isEnabled=!0,r.label=n("Link"),r.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>',r.keystroke="Ctrl+K",r.tooltip=!0,r.isToggleable=!0,r.bind("isEnabled").to(t,"isEnabled"),r.bind("isOn").to(t,"value",a=>!!a),this.listenTo(r,"execute",()=>this._showUI(!0)),r})}_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())}),wd({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=e.value||""}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),e.value!==void 0?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const e=this.editor;this.stopListening(e.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let n=this._getSelectedLinkElement(),i=a();const r=()=>{const l=this._getSelectedLinkElement(),d=a();n&&!l||!n&&d!==i?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=l,i=d};function a(){return t.selection.focus.getAncestors().reverse().find(l=>l.is("element"))}this.listenTo(e.ui,"update",r),this.listenTo(this._balloon,"change:visibleView",r)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,n=e.document;let i=null;if(t.markers.has("link-ui")){const r=Array.from(this.editor.editing.mapper.markerNameToElements("link-ui")),a=e.createRange(e.createPositionBefore(r[0]),e.createPositionAfter(r[r.length-1]));i=e.domConverter.viewRangeToDom(a)}else i=()=>{const r=this._getSelectedLinkElement();return r?e.domConverter.mapViewToDom(r):e.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:i}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,n=t.getSelectedElement();if(t.isCollapsed||n&&it(n))return tv(t.getFirstPosition());{const i=t.getFirstRange().getTrimmed(),r=tv(i.start),a=tv(i.end);return r&&r==a&&e.createRangeIn(r).getTrimmed().isEqual(i)?r:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{const n=e.document.selection.getFirstRange();if(e.markers.has("link-ui"))t.updateMarker("link-ui",{range:n});else if(n.start.isAtEnd){const i=n.start.getLastMatchingPosition(({item:r})=>!e.schema.isContent(r),{boundaries:n});t.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:t.createRange(i,n.end)})}else t.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:n})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has("link-ui")&&e.change(t=>{t.removeMarker("link-ui")})}}function tv(o){return o.getAncestors().find(e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t})}const xy=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class Cy 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 Vd(e.model,i=>{if(!function(a){return a.length>4&&a[a.length-1]===" "&&a[a.length-2]!==" "}(i))return;const r=Qw(i.substr(0,i.length-1));return r?{url:r}:void 0}),n=e.plugins.get("Input");t.on("matched:data",(i,r)=>{const{batch:a,range:l,url:d}=r;if(!n.isInput(a))return;const h=l.end.getShiftedBy(-1),p=h.getShiftedBy(-d.length),b=e.model.createRange(p,h);this._applyAutoLink(d,b)}),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("enter");n&&n.on("execute",()=>{const i=t.document.selection.getFirstPosition();if(!i.parent.previousSibling)return;const r=t.createRangeIn(i.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(r)})}_enableShiftEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("shiftEnter");n&&n.on("execute",()=>{const i=t.document.selection.getFirstPosition(),r=t.createRange(t.createPositionAt(i.parent,0),i.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(r)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:n,range:i}=Bc(e,t),r=Qw(n);if(r){const a=t.createRange(i.end.getShiftedBy(-r.length),i.end);this._applyAutoLink(r,a)}}_applyAutoLink(e,t){const n=this.editor.model;this.isEnabled&&function(i,r){return r.schema.checkAttributeInSelection(r.createSelection(i),"linkHref")}(t,n)&&n.enqueueChange(i=>{const r=this.editor.config.get("link.defaultProtocol"),a=Kw(e,r);i.setAttribute("linkHref",a,t)})}}function Qw(o){const e=xy.exec(o);return e?e[2]:null}class Yw extends pt{constructor(e,t){super(e),this.type=t}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.document,i=Array.from(n.selection.getSelectedBlocks()).filter(a=>Zw(a,t.schema)),r=e.forceValue!==void 0?!e.forceValue:this.value;t.change(a=>{if(r){let l=i[i.length-1].nextSibling,d=Number.POSITIVE_INFINITY,h=[];for(;l&&l.name=="listItem"&&l.getAttribute("listIndent")!==0;){const p=l.getAttribute("listIndent");p<d&&(d=p);const b=p-d;h.push({element:l,listIndent:b}),l=l.nextSibling}h=h.reverse();for(const p of h)a.setAttribute("listIndent",p.listIndent,p.element)}if(!r){let l=Number.POSITIVE_INFINITY;for(const d of i)d.is("element","listItem")&&d.getAttribute("listIndent")<l&&(l=d.getAttribute("listIndent"));l=l===0?1:l,Jw(i,!0,l),Jw(i,!1,l)}for(const l of i.reverse())r&&l.name=="listItem"?a.rename(l,"paragraph"):r||l.name=="listItem"?r||l.name!="listItem"||l.getAttribute("listType")==this.type||a.setAttribute("listType",this.type,l):(a.setAttributes({listType:this.type,listIndent:0},l),a.rename(l,"listItem"));this.fire("_executeCleanup",i)})}_getValue(){const e=ti(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=ti(e.getSelectedBlocks());return!!n&&Zw(n,t)}}function Jw(o,e,t){const n=e?o[0]:o[o.length-1];if(n.is("element","listItem")){let i=n[e?"previousSibling":"nextSibling"],r=n.getAttribute("listIndent");for(;i&&i.is("element","listItem")&&i.getAttribute("listIndent")>=t;)r>i.getAttribute("listIndent")&&(r=i.getAttribute("listIndent")),i.getAttribute("listIndent")==r&&o[e?"unshift":"push"](i),i=i[e?"previousSibling":"nextSibling"]}}function Zw(o,e){return e.checkChild(o.parent,"listItem")&&!e.isObject(o)}class Xw extends pt{constructor(e,t){super(e),this._indentBy=t=="forward"?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=e.document;let n=Array.from(t.selection.getSelectedBlocks());e.change(i=>{const r=n[n.length-1];let a=r.nextSibling;for(;a&&a.name=="listItem"&&a.getAttribute("listIndent")>r.getAttribute("listIndent");)n.push(a),a=a.nextSibling;this._indentBy<0&&(n=n.reverse());for(const l of n){const d=l.getAttribute("listIndent")+this._indentBy;d<0?i.rename(l,"paragraph"):i.setAttribute("listIndent",d,l)}this.fire("_executeCleanup",n)})}_checkEnabled(){const e=ti(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is("element","listItem"))return!1;if(this._indentBy>0){const t=e.getAttribute("listIndent"),n=e.getAttribute("listType");let i=e.previousSibling;for(;i&&i.is("element","listItem")&&i.getAttribute("listIndent")>=t;){if(i.getAttribute("listIndent")==t)return i.getAttribute("listType")==n;i=i.previousSibling}return!1}return!0}}function Ty(o,e){const t=e.mapper,n=e.writer,i=o.getAttribute("listType")=="numbered"?"ol":"ul",r=function(l){const d=l.createContainerElement("li");return d.getFillerOffset=Ey,d}(n),a=n.createContainerElement(i,null);return n.insert(n.createPositionAt(a,0),r),t.bindElements(o,r),r}function e_(o,e,t,n){const i=e.parent,r=t.mapper,a=t.writer;let l=r.toViewPosition(n.createPositionBefore(o));const d=n_(o.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:o.getAttribute("listIndent")}),h=o.previousSibling;if(d&&d.getAttribute("listIndent")==o.getAttribute("listIndent")){const p=r.toViewElement(d);l=a.breakContainer(a.createPositionAfter(p))}else if(h&&h.name=="listItem"){l=r.toViewPosition(n.createPositionAt(h,"end"));const p=r.findMappedViewAncestor(l),b=function(x){for(const E of x.getChildren())if(E.name=="ul"||E.name=="ol")return E;return null}(p);l=b?a.createPositionBefore(b):a.createPositionAt(p,"end")}else l=r.toViewPosition(n.createPositionBefore(o));if(l=t_(l),a.insert(l,i),h&&h.name=="listItem"){const p=r.toViewElement(h),b=a.createRange(a.createPositionAt(p,0),l).getWalker({ignoreElementEnd:!0});for(const x of b)if(x.item.is("element","li")){const E=a.breakContainer(a.createPositionBefore(x.item)),P=x.item.parent,D=a.createPositionAt(e,"end");So(a,D.nodeBefore,D.nodeAfter),a.move(a.createRangeOn(P),D),b.position=E}}else{const p=i.nextSibling;if(p&&(p.is("element","ul")||p.is("element","ol"))){let b=null;for(const x of p.getChildren()){const E=r.toModelElement(x);if(!(E&&E.getAttribute("listIndent")>o.getAttribute("listIndent")))break;b=x}b&&(a.breakContainer(a.createPositionAfter(b)),a.move(a.createRangeOn(b.parent),a.createPositionAt(e,"end")))}}So(a,i,i.nextSibling),So(a,i.previousSibling,i)}function So(o,e,t){return!e||!t||e.name!="ul"&&e.name!="ol"||e.name!=t.name||e.getAttribute("class")!==t.getAttribute("class")?null:o.mergeContainers(o.createPositionAfter(e))}function t_(o){return o.getLastMatchingPosition(e=>e.item.is("uiElement"))}function n_(o,e){const t=!!e.sameIndent,n=!!e.smallerIndent,i=e.listIndent;let r=o;for(;r&&r.name=="listItem";){const a=r.getAttribute("listIndent");if(t&&i==a||n&&i>a)return r;r=e.direction==="forward"?r.nextSibling:r.previousSibling}return null}function i_(o,e,t,n){o.ui.componentFactory.add(e,i=>{const r=o.commands.get(e),a=new Xt(i);return a.set({label:t,icon:n,tooltip:!0,isToggleable:!0}),a.bind("isOn","isEnabled").to(r,"value","isEnabled"),a.on("execute",()=>{o.execute(e),o.editing.view.focus()}),a})}function Ey(){const o=!this.isEmpty&&(this.getChild(0).name=="ul"||this.getChild(0).name=="ol");return this.isEmpty||o?0:Eh.call(this)}function o_(o){return(e,t,n)=>{const i=n.consumable;if(!i.test(t.item,"insert")||!i.test(t.item,"attribute:listType")||!i.test(t.item,"attribute:listIndent"))return;i.consume(t.item,"insert"),i.consume(t.item,"attribute:listType"),i.consume(t.item,"attribute:listIndent");const r=t.item;e_(r,Ty(r,n),n,o)}}function Sy(o,e,t){if(!t.consumable.consume(e.item,"attribute:listType"))return;const n=t.mapper.toViewElement(e.item),i=t.writer;i.breakContainer(i.createPositionBefore(n)),i.breakContainer(i.createPositionAfter(n));const r=n.parent,a=e.attributeNewValue=="numbered"?"ol":"ul";i.rename(a,r)}function Ay(o,e,t){const n=t.mapper.toViewElement(e.item).parent,i=t.writer;So(i,n,n.nextSibling),So(i,n.previousSibling,n);for(const r of e.item.getChildren())t.consumable.consume(r,"insert")}function r_(o,e,t){if(e.item.name!="listItem"){let n=t.mapper.toViewPosition(e.range.start);const i=t.writer,r=[];for(;(n.parent.name=="ul"||n.parent.name=="ol")&&(n=i.breakContainer(n),n.parent.name=="li");){const a=n,l=i.createPositionAt(n.parent,"end");if(!a.isEqual(l)){const d=i.remove(i.createRange(a,l));r.push(d)}n=i.createPositionAfter(n.parent)}if(r.length>0){for(let a=0;a<r.length;a++){const l=n.nodeBefore;if(n=i.insert(n,r[a]).end,a>0){const d=So(i,l,l.nextSibling);d&&d.parent==l&&n.offset--}}So(i,n.nodeBefore,n.nodeAfter)}}}function Ny(o,e,t){const n=t.mapper.toViewPosition(e.position),i=n.nodeBefore,r=n.nodeAfter;So(t.writer,i,r)}function Py(o,e,t){if(t.consumable.consume(e.viewItem,{name:!0})){const n=t.writer,i=n.createElement("listItem"),r=function(d){let h=0,p=d.parent;for(;p;){if(p.is("element","li"))h++;else{const b=p.previousSibling;b&&b.is("element","li")&&h++}p=p.parent}return h}(e.viewItem);n.setAttribute("listIndent",r,i);const a=e.viewItem.parent&&e.viewItem.parent.name=="ol"?"numbered":"bulleted";if(n.setAttribute("listType",a,i),!t.safeInsert(i,e.modelCursor))return;const l=function(d,h,p){const{writer:b,schema:x}=p;let E=b.createPositionAfter(d);for(const P of h)if(P.name=="ul"||P.name=="ol")E=p.convertItem(P,E).modelCursor;else{const D=p.convertItem(P,b.createPositionAt(d,"end")),R=D.modelRange.start.nodeAfter;R&&R.is("element")&&!x.checkChild(d,R.name)&&(d=D.modelCursor.parent.is("element","listItem")?D.modelCursor.parent:Dy(D.modelCursor),E=b.createPositionAfter(d))}return E}(i,e.viewItem.getChildren(),t);e.modelRange=n.createRange(e.modelCursor,l),t.updateConversionResult(i,e)}}function s_(o,e,t){if(t.consumable.test(e.viewItem,{name:!0})){const n=Array.from(e.viewItem.getChildren());for(const i of n)!(i.is("element","li")||ul(i))&&i._remove()}}function Iy(o,e,t){if(t.consumable.test(e.viewItem,{name:!0})){if(e.viewItem.childCount===0)return;const n=[...e.viewItem.getChildren()];let i=!1,r=!0;for(const a of n)i&&!ul(a)&&a._remove(),a.is("$text")?(r&&(a._data=a.data.trimStart()),a.nextSibling&&!ul(a.nextSibling)||(a._data=a.data.trimEnd())):ul(a)&&(i=!0),r=!1}}function a_(o){return(e,t)=>{if(t.isPhantom)return;const n=t.modelPosition.nodeBefore;if(n&&n.is("element","listItem")){const i=t.mapper.toViewElement(n),r=i.getAncestors().find(ul),a=o.createPositionAt(i,0).getWalker();for(const l of a){if(l.type=="elementStart"&&l.item.is("element","li")){t.viewPosition=l.previousPosition;break}if(l.type=="elementEnd"&&l.item==r){t.viewPosition=l.nextPosition;break}}}}}function My(o,[e,t]){let n,i=e.is("documentFragment")?e.getChild(0):e;if(n=t?this.createSelection(t):this.document.selection,i&&i.is("element","listItem")){const r=n.getFirstPosition();let a=null;if(r.parent.is("element","listItem")?a=r.parent:r.nodeBefore&&r.nodeBefore.is("element","listItem")&&(a=r.nodeBefore),a){const l=a.getAttribute("listIndent");if(l>0)for(;i&&i.is("element","listItem");)i._setAttribute("listIndent",i.getAttribute("listIndent")+l),i=i.nextSibling}}}function Dy(o){const e=new Ki({startPosition:o});let t;do t=e.next();while(!t.value.item.is("element","listItem"));return t.value.item}function l_(o,e,t,n,i,r){const a=n_(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:o,foo:"b"}),l=i.mapper,d=i.writer,h=a?a.getAttribute("listIndent"):null;let p;if(a)if(h==o){const b=l.toViewElement(a).parent;p=d.createPositionAfter(b)}else{const b=r.createPositionAt(a,"end");p=l.toViewPosition(b)}else p=t;p=t_(p);for(const b of[...n.getChildren()])ul(b)&&(p=d.move(d.createRangeOn(b),p).end,So(d,b,b.nextSibling),So(d,b.previousSibling,b))}function ul(o){return o.is("element","ol")||o.is("element","ul")}class Oy extends ve{static get pluginName(){return"ListEditing"}static get requires(){return[Vc,Xr]}init(){const e=this.editor;e.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const t=e.data,n=e.editing;var i;e.model.document.registerPostFixer(l=>function(d,h){const p=d.document.differ.getChanges(),b=new Map;let x=!1;for(const R of p)if(R.type=="insert"&&R.name=="listItem")E(R.position);else if(R.type=="insert"&&R.name!="listItem"){if(R.name!="$text"){const H=R.position.nodeAfter;H.hasAttribute("listIndent")&&(h.removeAttribute("listIndent",H),x=!0),H.hasAttribute("listType")&&(h.removeAttribute("listType",H),x=!0),H.hasAttribute("listStyle")&&(h.removeAttribute("listStyle",H),x=!0);for(const Q of Array.from(d.createRangeIn(H)).filter(ae=>ae.item.is("element","listItem")))E(Q.previousPosition)}E(R.position.getShiftedBy(R.length))}else R.type=="remove"&&R.name=="listItem"?E(R.position):(R.type=="attribute"&&R.attributeKey=="listIndent"||R.type=="attribute"&&R.attributeKey=="listType")&&E(R.range.start);for(const R of b.values())P(R),D(R);return x;function E(R){const H=R.nodeBefore;if(H&&H.is("element","listItem")){let Q=H;if(b.has(Q))return;for(let ae=Q.previousSibling;ae&&ae.is("element","listItem");ae=Q.previousSibling)if(Q=ae,b.has(Q))return;b.set(H,Q)}else{const Q=R.nodeAfter;Q&&Q.is("element","listItem")&&b.set(Q,Q)}}function P(R){let H=0,Q=null;for(;R&&R.is("element","listItem");){const ae=R.getAttribute("listIndent");if(ae>H){let ye;Q===null?(Q=ae-H,ye=H):(Q>ae&&(Q=ae),ye=ae-Q),h.setAttribute("listIndent",ye,R),x=!0}else Q=null,H=R.getAttribute("listIndent")+1;R=R.nextSibling}}function D(R){let H=[],Q=null;for(;R&&R.is("element","listItem");){const ae=R.getAttribute("listIndent");if(Q&&Q.getAttribute("listIndent")>ae&&(H=H.slice(0,ae+1)),ae!=0)if(H[ae]){const ye=H[ae];R.getAttribute("listType")!=ye&&(h.setAttribute("listType",ye,R),x=!0)}else H[ae]=R.getAttribute("listType");Q=R,R=R.nextSibling}}}(e.model,l)),n.mapper.registerViewToModelLength("li",nv),t.mapper.registerViewToModelLength("li",nv),n.mapper.on("modelToViewPosition",a_(n.view)),n.mapper.on("viewToModelPosition",(i=e.model,(l,d)=>{const h=d.viewPosition,p=h.parent,b=d.mapper;if(p.name=="ul"||p.name=="ol"){if(h.isAtEnd){const x=b.toModelElement(h.nodeBefore),E=b.getModelLength(h.nodeBefore);d.modelPosition=i.createPositionBefore(x).getShiftedBy(E)}else{const x=b.toModelElement(h.nodeAfter);d.modelPosition=i.createPositionBefore(x)}l.stop()}else if(p.name=="li"&&h.nodeBefore&&(h.nodeBefore.name=="ul"||h.nodeBefore.name=="ol")){const x=b.toModelElement(p);let E=1,P=h.nodeBefore;for(;P&&ul(P);)E+=b.getModelLength(P),P=P.previousSibling;d.modelPosition=i.createPositionBefore(x).getShiftedBy(E),l.stop()}})),t.mapper.on("modelToViewPosition",a_(n.view)),e.conversion.for("editingDowncast").add(l=>{l.on("insert",r_,{priority:"high"}),l.on("insert:listItem",o_(e.model)),l.on("attribute:listType:listItem",Sy,{priority:"high"}),l.on("attribute:listType:listItem",Ay,{priority:"low"}),l.on("attribute:listIndent:listItem",function(d){return(h,p,b)=>{if(!b.consumable.consume(p.item,"attribute:listIndent"))return;const x=b.mapper.toViewElement(p.item),E=b.writer;E.breakContainer(E.createPositionBefore(x)),E.breakContainer(E.createPositionAfter(x));const P=x.parent,D=P.previousSibling,R=E.createRangeOn(P);E.remove(R),D&&D.nextSibling&&So(E,D,D.nextSibling),l_(p.attributeOldValue+1,p.range.start,R.start,x,b,d),e_(p.item,x,b,d);for(const H of p.item.getChildren())b.consumable.consume(H,"insert")}}(e.model)),l.on("remove:listItem",function(d){return(h,p,b)=>{const x=b.mapper.toViewPosition(p.position).getLastMatchingPosition(Q=>!Q.item.is("element","li")).nodeAfter,E=b.writer;E.breakContainer(E.createPositionBefore(x)),E.breakContainer(E.createPositionAfter(x));const P=x.parent,D=P.previousSibling,R=E.createRangeOn(P),H=E.remove(R);D&&D.nextSibling&&So(E,D,D.nextSibling),l_(b.mapper.toModelElement(x).getAttribute("listIndent")+1,p.position,R.start,x,b,d);for(const Q of E.createRangeIn(H).getItems())b.mapper.unbindViewElement(Q);h.stop()}}(e.model)),l.on("remove",Ny,{priority:"low"})}),e.conversion.for("dataDowncast").add(l=>{l.on("insert",r_,{priority:"high"}),l.on("insert:listItem",o_(e.model))}),e.conversion.for("upcast").add(l=>{l.on("element:ul",s_,{priority:"high"}),l.on("element:ol",s_,{priority:"high"}),l.on("element:li",Iy,{priority:"high"}),l.on("element:li",Py)}),e.model.on("insertContent",My,{priority:"high"}),e.commands.add("numberedList",new Yw(e,"numbered")),e.commands.add("bulletedList",new Yw(e,"bulleted")),e.commands.add("indentList",new Xw(e,"forward")),e.commands.add("outdentList",new Xw(e,"backward"));const r=n.view.document;this.listenTo(r,"enter",(l,d)=>{const h=this.editor.model.document,p=h.selection.getLastPosition().parent;h.selection.isCollapsed&&p.name=="listItem"&&p.isEmpty&&(this.editor.execute("outdentList"),d.preventDefault(),l.stop())},{context:"li"}),this.listenTo(r,"delete",(l,d)=>{if(d.direction!=="backward")return;const h=this.editor.model.document.selection;if(!h.isCollapsed)return;const p=h.getFirstPosition();if(!p.isAtStart)return;const b=p.parent;b.name==="listItem"&&(b.previousSibling&&b.previousSibling.name==="listItem"||(this.editor.execute("outdentList"),d.preventDefault(),l.stop()))},{context:"li"});const a=l=>(d,h)=>{this.editor.commands.get(l).isEnabled&&(this.editor.execute(l),h())};e.keystrokes.set("Tab",a("indentList")),e.keystrokes.set("Shift+Tab",a("outdentList"))}afterInit(){const e=this.editor.commands,t=e.get("indent"),n=e.get("outdent");t&&t.registerChildCommand(e.get("indentList")),n&&n.registerChildCommand(e.get("outdentList"))}}function nv(o){let e=1;for(const t of o.getChildren())if(t.name=="ul"||t.name=="ol")for(const n of t.getChildren())e+=nv(n);return e}class jy extends ve{static get pluginName(){return"ListUI"}init(){const e=this.editor.t;i_(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>'),i_(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 c_(o,e){return n=>{n.on("attribute:url:media",t)};function t(n,i,r){if(!r.consumable.consume(i.item,n.name))return;const a=i.attributeNewValue,l=r.writer,d=r.mapper.toViewElement(i.item),h=[...d.getChildren()].find(b=>b.getCustomProperty("media-content"));l.remove(h);const p=o.getMediaViewElement(l,a,e);l.insert(l.createPositionAt(d,0),p)}}function u_(o,e,t,n){const i=o.createContainerElement("figure",{class:"media"});return o.insert(o.createPositionAt(i,0),e.getMediaViewElement(o,t,n)),i}function d_(o){const e=o.getSelectedElement();return e&&e.is("element","media")?e:null}function h_(o,e,t){o.change(n=>{const i=n.createElement("media",{url:e});o.insertContent(i,t),n.setSelection(i,"on")})}class Ry extends pt{refresh(){const e=this.editor.model,t=e.document.selection,n=d_(t);this.value=n?n.getAttribute("url"):null,this.isEnabled=function(i){const r=i.getSelectedElement();return!!r&&r.name==="media"}(t)||function(i,r){let a=ol(i,r).start.parent;return a.isEmpty&&!r.schema.isLimit(a)&&(a=a.parent),r.schema.checkChild(a,"media")}(t,e)}execute(e){const t=this.editor.model,n=t.document.selection,i=d_(n);i?t.change(r=>{r.setAttribute("url",e,i)}):h_(t,e,ol(n,t))}}class Ly{constructor(e,t){const n=t.providers,i=t.extraProviders||[],r=new Set(t.removeProviders),a=n.concat(i).filter(l=>{const d=l.name;return d?!r.has(d):(Object(T.b)("media-embed-no-provider-name",{provider:l}),!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 f_(this.locale);e=e.trim();for(const t of this.providerDefinitions){const n=t.html,i=Tt(t.url);for(const r of i){const a=this._getUrlMatches(e,r);if(a)return new f_(this.locale,e,a,n)}}return null}_getUrlMatches(e,t){let n=e.match(t);if(n)return n;let i=e.replace(/^https?:\/\//,"");return n=i.match(t),n||(i=i.replace(/^www\./,""),n=i.match(t),n||null)}}class f_{constructor(e,t,n,i){this.url=this._getValidUrl(t),this._t=e.t,this._match=n,this._previewRenderer=i}getViewElement(e,t){const n={};let i;if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(n["data-oembed-url"]=this.url),t.renderForEditingView&&(n.class="ck-media__wrapper");const r=this._getPreviewHtml(t);i=e.createRawElement("div",n,function(a){a.innerHTML=r})}else this.url&&(n.url=this.url),i=e.createEmptyElement(t.elementName,n);return e.setCustomProperty("media-content",!0,i),i}_getPreviewHtml(e){return this._previewRenderer?this._previewRenderer(this._match):this.url&&e.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const e=new Rf,t=new Mc;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 ki({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}}w(94);class Yp 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 Ly(e.locale,e.config.get("mediaEmbed"))}init(){const e=this.editor,t=e.model.schema,n=e.t,i=e.conversion,r=e.config.get("mediaEmbed.previewsInData"),a=e.config.get("mediaEmbed.elementName"),l=this.registry;e.commands.add("mediaEmbed",new Ry(e)),t.register("media",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["url"]}),i.for("dataDowncast").elementToElement({model:"media",view:(d,{writer:h})=>{const p=d.getAttribute("url");return u_(h,l,p,{elementName:a,renderMediaPreview:p&&r})}}),i.for("dataDowncast").add(c_(l,{elementName:a,renderMediaPreview:r})),i.for("editingDowncast").elementToElement({model:"media",view:(d,{writer:h})=>{const p=d.getAttribute("url");return function(b,x,E){return x.setCustomProperty("media",!0,b),en(b,x,{label:E})}(u_(h,l,p,{elementName:a,renderForEditingView:!0}),h,n("media widget"))}}),i.for("editingDowncast").add(c_(l,{elementName:a,renderForEditingView:!0})),i.for("upcast").elementToElement({view:d=>["oembed",a].includes(d.name)&&d.getAttribute("url")?{name:!0}:null,model:(d,{writer:h})=>{const p=d.getAttribute("url");if(l.hasMedia(p))return h.createElement("media",{url:p})}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(d,{writer:h})=>{const p=d.getAttribute("data-oembed-url");if(l.hasMedia(p))return h.createElement("media",{url:p})}})}}const Vy=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class zy extends ve{static get requires(){return[It,Pp]}static get pluginName(){return"AutoMediaEmbed"}constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}init(){const e=this.editor,t=e.model.document;this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",()=>{const n=t.selection.getFirstRange(),i=On.fromPosition(n.start);i.stickiness="toPrevious";const r=On.fromPosition(n.end);r.stickiness="toNext",t.once("change:data",()=>{this._embedMediaBetweenPositions(i,r),i.detach(),r.detach()},{priority:"high"})}),e.commands.get("undo").on("execute",()=>{this._timeoutId&&(Ft.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(e,t){const n=this.editor,i=n.plugins.get(Yp).registry,r=new ko(e,t),a=r.getWalker({ignoreElementEnd:!0});let l="";for(const d of a)d.item.is("$textProxy")&&(l+=d.item.data);if(l=l.trim(),!l.match(Vy)||!i.hasMedia(l))return void r.detach();n.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=On.fromPosition(e),this._timeoutId=Ft.window.setTimeout(()=>{n.model.change(d=>{let h;this._timeoutId=null,d.remove(r),r.detach(),this._positionToInsert.root.rootName!=="$graveyard"&&(h=this._positionToInsert),h_(n.model,l,h),this._positionToInsert.detach(),this._positionToInsert=null})},100)):r.detach()}}w(96);class Fy extends gt{constructor(e,t){super(t);const n=t.t;this.focusTracker=new Mi,this.keystrokes=new mi,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),_i.check,"ck-button-save"),this.saveButtonView.type="submit",this.saveButtonView.bind("isEnabled").to(this,"mediaURLInputValue",i=>!!i),this.cancelButtonView=this._createButton(n("Cancel"),_i.cancel,"ck-button-cancel","cancel"),this._focusables=new Qr,this._focusCycler=new Es({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]}),_d(this)}render(){super.render(),kd({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 Ed(this.locale,Sd),n=t.fieldView;return this._urlInputViewInfoDefault=e("Paste the media URL in the input."),this._urlInputViewInfoTip=e("Tip: Paste the URL into the content to embed faster."),t.label=e("Media URL"),t.infoText=this._urlInputViewInfoDefault,n.on("input",()=>{t.infoText=n.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=n.element.value.trim()}),t}_createButton(e,t,n,i){const r=new Xt(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:n}}),i&&r.delegate("execute").to(this,i),r}}class By extends ve{static get requires(){return[Yp]}static get pluginName(){return"MediaEmbedUI"}init(){const e=this.editor,t=e.commands.get("mediaEmbed"),n=e.plugins.get(Yp).registry;e.ui.componentFactory.add("mediaEmbed",i=>{const r=Jr(i),a=new Fy(function(l,d){return[h=>{if(!h.url.length)return l("The URL must not be empty.")},h=>{if(!d.hasMedia(h.url))return l("This media URL is not supported.")}]}(e.t,n),e.locale);return this._setUpDropdown(r,a,t,e),this._setUpForm(r,a,t),r})}_setUpDropdown(e,t,n){const i=this.editor,r=i.t,a=e.buttonView;function l(){i.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),a.set({label:r("Insert media"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M18.68 3.03c.6 0 .59-.03.59.55v12.84c0 .59.01.56-.59.56H1.29c-.6 0-.59.03-.59-.56V3.58c0-.58-.01-.55.6-.55h17.38zM15.77 15V5H4.2v10h11.57zM2 4v1h1V4H2zm0 2v1h1V6H2zm0 2v1h1V8H2zm0 2v1h1v-1H2zm0 2v1h1v-1H2zm0 2v1h1v-1H2zM17 4v1h1V4h-1zm0 2v1h1V6h-1zm0 2v1h1V8h-1zm0 2v1h1v-1h-1zm0 2v1h1v-1h-1zm0 2v1h1v-1h-1zM7.5 7.177a.4.4 0 0 1 .593-.351l5.133 2.824a.4.4 0 0 1 0 .7l-5.133 2.824a.4.4 0 0 1-.593-.35V7.176v.001z"/></svg>',tooltip:!0}),a.on("open",()=>{t.disableCssTransitions(),t.url=n.value||"",t.urlInputView.fieldView.select(),t.focus(),t.enableCssTransitions()},{priority:"low"}),e.on("submit",()=>{t.isValid()&&(i.execute("mediaEmbed",t.url),l())}),e.on("change:isOpen",()=>t.resetFormStatus()),e.on("cancel",()=>l())}_setUpForm(e,t,n){t.delegate("submit","cancel").to(e),t.urlInputView.bind("value").to(n,"value"),t.urlInputView.bind("isReadOnly").to(n,"isEnabled",i=>!i)}}w(98);function Hy(o,e){if(!o.childCount)return;const t=new Ms(o.document),n=function(a,l){const d=l.createRangeIn(a),h=new Et({name:/^p|h\d+$/,styles:{"mso-list":/.*/}}),p=[];for(const b of d)if(b.type==="elementStart"&&h.match(b.item)){const x=Uy(b.item);p.push({element:b.item,id:x.id,order:x.order,indent:x.indent})}return p}(o,t);if(!n.length)return;let i=null,r=1;n.forEach((a,l)=>{const d=function(P,D){if(!P)return!0;if(P.id!==D.id)return D.indent-P.indent!=1;const R=D.element.previousSibling;if(!R)return!0;return H=R,!(H.is("element","ol")||H.is("element","ul"));var H}(n[l-1],a),h=d?null:n[l-1],p=(x=a,(b=h)?x.indent-b.indent:x.indent-1);var b,x;if(d&&(i=null,r=1),!i||p!==0){const P=function(D,R){const H=new RegExp(`@list l${D.id}:level${D.indent}\\s*({[^}]*)`,"gi"),Q=/mso-level-number-format:([^;]{0,100});/gi,ae=H.exec(R);let ye="decimal",Be="ol";if(ae&&ae[1]){const Kt=Q.exec(ae[1]);if(Kt&&Kt[1]&&(ye=Kt[1].trim(),Be=ye!=="bullet"&&ye!=="image"?"ol":"ul"),ye==="bullet"){const _t=function(Bn){const Jn=function(ji){if(ji.getChild(0).is("$text"))return null;for(const si of ji.getChildren()){if(!si.is("element","span"))continue;const Ti=si.getChild(0);return Ti.is("$text")?Ti:Ti.getChild(0)}}(Bn);if(!Jn)return null;const Hn=Jn._data;return Hn==="o"?"circle":Hn==="·"?"disc":Hn==="§"?"square":null}(D.element);_t&&(ye=_t)}}return{type:Be,style:$y(ye)}}(a,e);if(i){if(a.indent>r){const D=i.getChild(i.childCount-1),R=D.getChild(D.childCount-1);i=p_(P,R,t),r+=1}else if(a.indent<r){const D=r-a.indent;i=function(R,H){const Q=R.getAncestors({parentFirst:!0});let ae=null,ye=0;for(const Be of Q)if(Be.name!=="ul"&&Be.name!=="ol"||ye++,ye===H){ae=Be;break}return ae}(i,D),r=parseInt(a.indent)}}else i=p_(P,a.element,t);a.indent<=r&&(i.is("element",P.type)||(i=t.rename(P.type,i)))}const E=function(P,D){return function(R,H){const Q=new Et({name:"span",styles:{"mso-list":"Ignore"}}),ae=H.createRangeIn(R);for(const ye of ae)ye.type==="elementStart"&&Q.match(ye.item)&&H.remove(ye.item)}(P,D),D.rename("li",P)}(a.element,t);t.appendChild(E,i)})}function $y(o){switch(o){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 o;default:return null}}function p_(o,e,t){const n=e.parent,i=t.createElement(o.type),r=n.getChildIndex(e)+1;return t.insertChild(r,i,n),o.style&&t.setStyle("list-style-type",o.style,i),i}function Uy(o){const e={},t=o.getStyle("mso-list");if(t){const n=t.match(/(^|\s{1,100})l(\d+)/i),i=t.match(/\s{0,100}lfo(\d+)/i),r=t.match(/\s{0,100}level(\d+)/i);n&&i&&r&&(e.id=n[2],e.order=i[1],e.indent=r[1])}return e}const Wy=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class Ky{constructor(e){this.document=e}isActive(e){return Wy.test(e)}execute(e){const t=new Ms(this.document),{body:n}=e._parsedData;(function(i,r){for(const a of i.getChildren())if(a.is("element","b")&&a.getStyle("font-weight")==="normal"){const l=i.getChildIndex(a);r.remove(a),r.insertChild(l,a.getChildren(),i)}})(n,t),function(i,r){for(const a of r.createRangeIn(i)){const l=a.item;if(l.is("element","li")){const d=l.getChild(0);d&&d.is("element","p")&&r.unwrapElement(d)}}}(n,t),e.content=n}}function qy(o,e){if(!o.childCount)return;const t=new Ms;(function(i,r,a){const l=a.createRangeIn(r),d=new Et({name:"img"}),h=[];for(const p of l)if(d.match(p.item)){const b=p.item,x=b.getAttribute("v:shapes")?b.getAttribute("v:shapes").split(" "):[];x.length&&x.every(E=>i.indexOf(E)>-1)?h.push(b):b.getAttribute("src")||h.push(b)}for(const p of h)a.remove(p)})(function(i,r){const a=r.createRangeIn(i),l=new Et({name:/v:(.+)/}),d=[];for(const h of a){const p=h.item,b=p.previousSibling&&p.previousSibling.name||null;l.match(p)&&p.getAttribute("o:gfxdata")&&b!=="v:shapetype"&&d.push(h.item.getAttribute("id"))}return d}(o,t),o,t),function(i,r){const a=r.createRangeIn(i),l=new Et({name:/v:(.+)/}),d=[];for(const h of a)l.match(h.item)&&d.push(h.item);for(const h of d)r.remove(h)}(o,t);const n=function(i,r){const a=r.createRangeIn(i),l=new Et({name:"img"}),d=[];for(const h of a)l.match(h.item)&&h.item.getAttribute("src").startsWith("file://")&&d.push(h.item);return d}(o,t);n.length&&function(i,r,a){if(i.length===r.length)for(let d=0;d<i.length;d++){const h=`data:${r[d].type};base64,${l=r[d].hex,btoa(l.match(/\w{2}/g).map(p=>String.fromCharCode(parseInt(p,16))).join(""))}`;a.setAttribute("src",h,i[d])}var l}(n,function(i){if(!i)return[];const r=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,a=new RegExp("(?:("+r.source+"))([\\da-fA-F\\s]+)\\}","g"),l=i.match(a),d=[];if(l)for(const h of l){let p=!1;h.includes("\\pngblip")?p="image/png":h.includes("\\jpegblip")&&(p="image/jpeg"),p&&d.push({hex:h.replace(r,"").replace(/[^\da-fA-F]/g,""),type:p})}return d}(e),t)}const Gy=/<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i,Qy=/xmlns:o="urn:schemas-microsoft-com/i;class Yy{constructor(e){this.document=e}isActive(e){return Gy.test(e)||Qy.test(e)}execute(e){const{body:t,stylesString:n}=e._parsedData;Hy(t,n),qy(t,e.dataTransfer.getData("text/rtf")),e.content=t}}function g_(o){return o.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(e,t)=>t.length===1?" ":Array(t.length+1).join(" ").substr(0,t.length))}function Jy(o,e){const t=new DOMParser,n=function(d){return g_(g_(d)).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(d){const h=d.indexOf("</body>");if(h<0)return d;const p=d.indexOf("</html>",h+7);return d.substring(0,h+7)+(p>=0?d.substring(p):"")}(o=o.replace(/<!--\[if gte vml 1]>/g,""))),i=t.parseFromString(n,"text/html");(function(d){d.querySelectorAll("span[style*=spacerun]").forEach(h=>{const p=h.innerText.length||0;h.innerHTML=Array(p+1).join(" ").substr(0,p)})})(i);const r=i.body.innerHTML,a=function(d,h){const p=new zo(h),b=new mo(p,{blockFillerMode:"nbsp"}),x=d.createDocumentFragment(),E=d.body.childNodes;for(;E.length>0;)x.appendChild(E[0]);return b.domToView(x,{skipComments:!0})}(i,e),l=function(d){const h=[],p=[],b=Array.from(d.getElementsByTagName("style"));for(const x of b)x.sheet&&x.sheet.cssRules&&x.sheet.cssRules.length&&(h.push(x.sheet),p.push(x.innerHTML));return{styles:h,stylesString:p.join(" ")}}(i);return{body:a,bodyString:r,styles:l.styles,stylesString:l.stylesString}}function vn(o,e,t,n,i=1){e>i?n.setAttribute(o,e,t):n.removeAttribute(o,t)}function dl(o,e,t={}){const n=o.createElement("tableCell",t);return o.insertElement("paragraph",n),o.insert(n,e),n}function iv(o,e){const t=e.parent.parent,n=parseInt(t.getAttribute("headingColumns")||0),{column:i}=o.getCellLocation(e);return!!n&&i<n}function Zy(){return o=>{o.on("element:table",(e,t,n)=>{const i=t.viewItem;if(!n.consumable.test(i,{name:!0}))return;const{rows:r,headingRows:a,headingColumns:l}=function(p){const b={headingRows:0,headingColumns:0},x=[],E=[];let P;for(const D of Array.from(p.getChildren()))if(D.name==="tbody"||D.name==="thead"||D.name==="tfoot"){D.name!=="thead"||P||(P=D);const R=Array.from(D.getChildren()).filter(H=>H.is("element","tr"));for(const H of R)if(H.parent.name==="thead"&&H.parent===P)b.headingRows++,x.push(H);else{E.push(H);const Q=Xy(H);Q>b.headingColumns&&(b.headingColumns=Q)}}return b.rows=[...x,...E],b}(i),d={};l&&(d.headingColumns=l),a&&(d.headingRows=a);const h=n.writer.createElement("table",d);if(n.safeInsert(h,t.modelCursor)){if(n.consumable.consume(i,{name:!0}),r.forEach(p=>n.convertItem(p,n.writer.createPositionAt(h,"end"))),n.convertChildren(i,n.writer.createPositionAt(h,"end")),h.isEmpty){const p=n.writer.createElement("tableRow");n.writer.insert(p,n.writer.createPositionAt(h,"end")),dl(n.writer,n.writer.createPositionAt(p,"end"))}n.updateConversionResult(h,t)}})}}function m_(o){return e=>{e.on("element:"+o,(t,n,i)=>{if(n.modelRange&&n.viewItem.isEmpty){const r=n.modelRange.start.nodeAfter,a=i.writer.createPositionAt(r,0);i.writer.insertElement("paragraph",a)}},{priority:"low"})}}function Xy(o){let e=0,t=0;const n=Array.from(o.getChildren()).filter(i=>i.name==="th"||i.name==="td");for(;t<n.length&&n[t].name==="th";){const i=n[t];e+=parseInt(i.getAttribute("colspan")||1),t++}return e}class Ht{constructor(e,t={}){this._table=e,this._startRow=t.row!==void 0?t.row:t.startRow||0,this._endRow=t.row!==void 0?t.row:t.endRow,this._startColumn=t.column!==void 0?t.column:t.startColumn||0,this._endColumn=t.column!==void 0?t.column:t.endColumn,this._includeAllSlots=!!t.includeAllSlots,this._skipRows=new Set,this._row=0,this._rowIndex=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}[Symbol.iterator](){return this}next(){const e=this._table.getChild(this._rowIndex);if(!e||this._isOverEndRow())return{done:!0};if(!e.is("element","tableRow"))return this._rowIndex++,this.next();if(this._isOverEndColumn())return this._advanceToNextRow();let t=null;const n=this._getSpanned();if(n)this._includeAllSlots&&!this._shouldSkipSlot()&&(t=this._formatOutValue(n.cell,n.row,n.column));else{const i=e.getChild(this._cellIndex);if(!i)return this._advanceToNextRow();const r=parseInt(i.getAttribute("colspan")||1),a=parseInt(i.getAttribute("rowspan")||1);(r>1||a>1)&&this._recordSpans(i,a,r),this._shouldSkipSlot()||(t=this._formatOutValue(i)),this._nextCellAtColumn=this._column+r}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}skipRow(e){this._skipRows.add(e)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return this._endRow!==void 0&&this._row>this._endRow}_isOverEndColumn(){return this._endColumn!==void 0&&this._column>this._endColumn}_formatOutValue(e,t=this._row,n=this._column){return{done:!1,value:new e1(this,e,t,n)}}_shouldSkipSlot(){const e=this._skipRows.has(this._row),t=this._row<this._startRow,n=this._column<this._startColumn,i=this._endColumn!==void 0&&this._column>this._endColumn;return e||t||n||i}_getSpanned(){const e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,n){const i={cell:e,row:this._row,column:this._column};for(let r=this._row;r<this._row+t;r++)for(let a=this._column;a<this._column+n;a++)r==this._row&&a==this._column||this._markSpannedCell(r,a,i)}_markSpannedCell(e,t,n){this._spannedCells.has(e)||this._spannedCells.set(e,new Map),this._spannedCells.get(e).set(t,n)}}class e1{constructor(e,t,n,i){this.cell=t,this.row=e._row,this.column=e._column,this.cellAnchorRow=n,this.cellAnchorColumn=i,this._cellIndex=e._cellIndex,this._rowIndex=e._rowIndex,this._table=e._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||1)}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||1)}get rowIndex(){return this._rowIndex}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}}function b_(o={}){return e=>e.on("insert:table",(t,n,i)=>{const r=n.item;if(!i.consumable.consume(r,"insert"))return;i.consumable.consume(r,"attribute:headingRows:table"),i.consumable.consume(r,"attribute:headingColumns:table");const a=o&&o.asWidget,l=i.writer.createContainerElement("figure",{class:"table"}),d=i.writer.createContainerElement("table");let h;var p,b;i.writer.insert(i.writer.createPositionAt(l,0),d),a&&(p=l,(b=i.writer).setCustomProperty("table",!0,p),h=en(p,b,{hasSelectionHandle:!0}));const x=new Ht(r),E={headingRows:r.getAttribute("headingRows")||0,headingColumns:r.getAttribute("headingColumns")||0},P=new Map;for(const R of x){const{row:H,cell:Q}=R,ae=r.getChild(H),ye=P.get(H)||rv(d,ae,H,E,i);P.set(H,ye),i.consumable.consume(Q,"insert"),ov(R,E,i.writer.createPositionAt(ye,"end"),i,o)}for(const R of r.getChildren()){const H=R.index;R.is("element","tableRow")&&!P.has(H)&&P.set(H,rv(d,R,H,E,i))}const D=i.mapper.toViewPosition(n.range.start);i.mapper.bindElements(r,a?h:l),i.writer.insert(D,a?h:l)})}function t1(o,e){const{writer:t}=e;if(o.parent.is("element","tableCell"))return v_(o)?t.createContainerElement("span",{class:"ck-table-bogus-paragraph"}):t.createContainerElement("p")}function v_(o){return o.parent.childCount===1&&!y_(o)}function n1(o,e,t){const{cell:n}=o,i=w_(o,e),r=t.mapper.toViewElement(n);r&&r.name!==i&&function(a,l,d){const h=d.writer,p=d.mapper.toViewElement(a),b=Md(h.createEditableElement(l,p.getAttributes()),h);zc(b,h,(x,E,P)=>P.addClass(Tt(E.classes),x),(x,E,P)=>P.removeClass(Tt(E.classes),x)),h.insert(h.createPositionAfter(p),b),h.move(h.createRangeIn(p),h.createPositionAt(b,0)),h.remove(h.createRangeOn(p)),d.mapper.unbindViewElement(p),d.mapper.bindElements(a,b)}(n,i,t)}function ov(o,e,t,n,i){const r=i&&i.asWidget,a=w_(o,e),l=r?Md(n.writer.createEditableElement(a),n.writer):n.writer.createContainerElement(a);r&&zc(l,n.writer,(b,x,E)=>E.addClass(Tt(x.classes),b),(b,x,E)=>E.removeClass(Tt(x.classes),b));const d=o.cell,h=d.getChild(0),p=d.childCount===1&&h.name==="paragraph";if(n.writer.insert(t,l),n.mapper.bindElements(d,l),!r&&p&&!y_(h)){const b=d.getChild(0);n.consumable.consume(b,"insert"),n.mapper.bindElements(b,l)}}function rv(o,e,t,n,i){i.consumable.consume(e,"insert");const r=e.isEmpty?i.writer.createEmptyElement("tr"):i.writer.createContainerElement("tr");i.mapper.bindElements(e,r);const a=n.headingRows,l=function(p,b,x){return __(p,b)||function(P,D,R){const H=R.writer.createContainerElement(P),Q=R.writer.createPositionAt(D,P=="tbody"?"end":0);return R.writer.insert(Q,H),H}(p,b,x)}(function(p,b){return p<b.headingRows?"thead":"tbody"}(t,n),o,i),d=a>0&&t>=a?t-a:t,h=i.writer.createPositionAt(l,d);return i.writer.insert(h,r),r}function w_(o,e){const{row:t,column:n}=o,{headingColumns:i,headingRows:r}=e;return r&&r>t||i&&i>n?"th":"td"}function __(o,e){for(const t of e.getChildren())if(t.name==o)return t}function k_(o,e,t){const n=__(o,e);n&&n.childCount===0&&t.writer.remove(t.writer.createRangeOn(n))}function y_(o){return!![...o.getAttributeKeys()].length}class i1 extends pt{refresh(){const e=this.editor.model,t=e.document.selection,n=e.schema;this.isEnabled=function(i,r){const a=i.getFirstPosition().parent,l=a===a.root?a:a.parent;return r.checkChild(l,"table")}(t,n)}execute(e={}){const t=this.editor.model,n=t.document.selection,i=this.editor.plugins.get("TableUtils"),r=this.editor.config.get("table"),a=ol(n,t),l=r.defaultHeadings.rows,d=r.defaultHeadings.columns;e.headingRows===void 0&&l&&(e.headingRows=l),e.headingColumns===void 0&&d&&(e.headingColumns=d),t.change(h=>{const p=i.createTable(h,e);t.insertContent(p,a),h.setSelection(h.createPositionAt(p.getNodeByPath([0,0,0]),0))})}}function Gc(o){const e=[];for(const t of x_(o.getRanges())){const n=t.getContainedElement();n&&n.is("element","tableCell")&&e.push(n)}return e}function Xd(o){const e=[];for(const t of o.getRanges()){const n=t.start.findAncestor("tableCell");n&&e.push(n)}return e}function Rn(o){const e=Gc(o);return e.length?e:Xd(o)}function zs(o){return C_(o.map(e=>e.parent.index))}function Qc(o){const e=o[0].findAncestor("table");return C_([...new Ht(e)].filter(t=>o.includes(t.cell)).map(t=>t.column))}function sv(o,e){if(o.length<2||!function(r){const a=r[0].findAncestor("table"),l=zs(r),d=parseInt(a.getAttribute("headingRows")||0);if(!T_(l,d))return!1;const h=parseInt(a.getAttribute("headingColumns")||0);return T_(Qc(r),h)}(o))return!1;const t=new Set,n=new Set;let i=0;for(const r of o){const{row:a,column:l}=e.getCellLocation(r),d=parseInt(r.getAttribute("rowspan")||1),h=parseInt(r.getAttribute("colspan")||1);t.add(a),n.add(l),d>1&&t.add(a+d-1),h>1&&n.add(l+h-1),i+=d*h}return function(r,a){const l=Array.from(r.values()),d=Array.from(a.values()),h=Math.max(...l),p=Math.min(...l),b=Math.max(...d),x=Math.min(...d);return(h-p+1)*(b-x+1)}(t,n)==i}function x_(o){return Array.from(o).sort(o1)}function C_(o){const e=o.sort((t,n)=>t-n);return{first:e[0],last:e[e.length-1]}}function o1(o,e){const t=o.start,n=e.start;return t.isBefore(n)?-1:1}function T_({first:o,last:e},t){return o<t==e<t}class E_ extends pt{constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){const e=!!Rn(this.editor.model.document.selection).length;this.isEnabled=e}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),i=this.order==="above",r=Rn(t),a=zs(r),l=i?a.first:a.last,d=r[0].findAncestor("table");n.insertRows(d,{at:i?l:l+1,copyStructureFromAbove:!i})}}class S_ extends pt{constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){const e=!!Rn(this.editor.model.document.selection).length;this.isEnabled=e}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),i=this.order==="left",r=Rn(t),a=Qc(r),l=i?a.first:a.last,d=r[0].findAncestor("table");n.insertColumns(d,{columns:1,at:i?l:l+1})}}class A_ extends pt{constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){const e=Rn(this.editor.model.document.selection);this.isEnabled=e.length===1}execute(){const e=Rn(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 N_(o,e,t){const{startRow:n,startColumn:i,endRow:r,endColumn:a}=e,l=t.createElement("table"),d=r-n+1;for(let p=0;p<d;p++)t.insertElement("tableRow",l,"end");const h=[...new Ht(o,{startRow:n,endRow:r,startColumn:i,endColumn:a,includeAllSlots:!0})];for(const{row:p,column:b,cell:x,isAnchor:E,cellAnchorRow:P,cellAnchorColumn:D}of h){const R=p-n,H=l.getChild(R);if(E){const Q=t.cloneElement(x);t.append(Q,H),O_(Q,p,b,r,a,t)}else(P<n||D<i)&&dl(t,t.createPositionAt(H,"end"))}return function(p,b,x,E,P){const D=parseInt(b.getAttribute("headingRows")||0);D>0&&vn("headingRows",D-x,p,P,0);const R=parseInt(b.getAttribute("headingColumns")||0);R>0&&vn("headingColumns",R-E,p,P,0)}(l,o,n,i,t),l}function P_(o,e,t=0){const n=[],i=new Ht(o,{startRow:t,endRow:e-1});for(const r of i){const{row:a,cellHeight:l}=r,d=a+l-1;a<e&&e<=d&&n.push(r)}return n}function I_(o,e,t){const n=o.parent,i=n.parent,r=n.index,a=e-r,l={},d=parseInt(o.getAttribute("rowspan"))-a;d>1&&(l.rowspan=d);const h=parseInt(o.getAttribute("colspan")||1);h>1&&(l.colspan=h);const p=r+a,b=[...new Ht(i,{startRow:r,endRow:p,includeAllSlots:!0})];let x,E=null;for(const P of b){const{row:D,column:R,cell:H}=P;H===o&&x===void 0&&(x=R),x!==void 0&&x===R&&D===p&&(E=dl(t,P.getPositionBefore(),l))}return vn("rowspan",a,o,t),E}function M_(o,e){const t=[],n=new Ht(o);for(const i of n){const{column:r,cellWidth:a}=i,l=r+a-1;r<e&&e<=l&&t.push(i)}return t}function D_(o,e,t,n){const i=t-e,r={},a=parseInt(o.getAttribute("colspan"))-i;a>1&&(r.colspan=a);const l=parseInt(o.getAttribute("rowspan")||1);l>1&&(r.rowspan=l);const d=dl(n,n.createPositionAfter(o),r);return vn("colspan",i,o,n),d}function O_(o,e,t,n,i,r){const a=parseInt(o.getAttribute("colspan")||1),l=parseInt(o.getAttribute("rowspan")||1);t+a-1>i&&vn("colspan",i-t+1,o,r,1),e+l-1>n&&vn("rowspan",n-e+1,o,r,1)}function av(o,e){const t=e.getColumns(o),n=new Array(t).fill(0);for(const{column:r}of new Ht(o))n[r]++;const i=n.reduce((r,a,l)=>a?r:[...r,l],[]);if(i.length>0){const r=i[i.length-1];return e.removeColumns(o,{at:r}),!0}return!1}function lv(o,e){const t=[],n=e.getRows(o);for(let i=0;i<n;i++)o.getChild(i).isEmpty&&t.push(i);if(t.length>0){const i=t[t.length-1];return e.removeRows(o,{at:i}),!0}return!1}function cv(o,e){av(o,e)||lv(o,e)}function j_(o,e){const t=Array.from(new Ht(o,{startColumn:e.firstColumn,endColumn:e.lastColumn,row:e.lastRow}));if(t.every(({cellHeight:i})=>i===1))return e.lastRow;const n=t[0].cellHeight-1;return e.lastRow+n}function R_(o,e){const t=Array.from(new Ht(o,{startRow:e.firstRow,endRow:e.lastRow,column:e.lastColumn}));if(t.every(({cellWidth:i})=>i===1))return e.lastColumn;const n=t[0].cellWidth-1;return e.lastColumn+n}class Jp extends pt{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=Xd(e.document.selection)[0],n=this.value,i=this.direction;e.change(r=>{const a=i=="right"||i=="down",l=a?t:n,d=a?n:t,h=d.parent;(function(P,D,R){L_(P)||(L_(D)&&R.remove(R.createRangeIn(D)),R.move(R.createRangeIn(P),R.createPositionAt(D,"end"))),R.remove(P)})(d,l,r);const p=this.isHorizontal?"colspan":"rowspan",b=parseInt(t.getAttribute(p)||1),x=parseInt(n.getAttribute(p)||1);r.setAttribute(p,b+x,l),r.setSelection(r.createRangeIn(l));const E=this.editor.plugins.get("TableUtils");cv(h.findAncestor("table"),E)})}_getMergeableCell(){const e=Xd(this.editor.model.document.selection)[0];if(!e)return;const t=this.editor.plugins.get("TableUtils"),n=this.isHorizontal?function(a,l,d){const h=a.parent.parent,p=l=="right"?a.nextSibling:a.previousSibling,b=(h.getAttribute("headingColumns")||0)>0;if(!p)return;const x=l=="right"?a:p,E=l=="right"?p:a,{column:P}=d.getCellLocation(x),{column:D}=d.getCellLocation(E),R=parseInt(x.getAttribute("colspan")||1),H=iv(d,x),Q=iv(d,E);if(!(b&&H!=Q))return P+R===D?p:void 0}(e,this.direction,t):function(a,l,d){const h=a.parent,p=h.parent,b=p.getChildIndex(h);if(l=="down"&&b===d.getRows(p)-1||l=="up"&&b===0)return;const x=parseInt(a.getAttribute("rowspan")||1),E=p.getAttribute("headingRows")||0,P=l=="down"&&b+x===E,D=l=="up"&&b===E;if(E&&(P||D))return;const R=parseInt(a.getAttribute("rowspan")||1),H=l=="down"?b+R:b,Q=[...new Ht(p,{endRow:H})],ae=Q.find(Be=>Be.cell===a).column,ye=Q.find(({row:Be,cellHeight:Kt,column:_t})=>_t===ae&&(l=="down"?Be===H:H===Be+Kt));return ye&&ye.cell}(e,this.direction,t);if(!n)return;const i=this.isHorizontal?"rowspan":"colspan",r=parseInt(e.getAttribute(i)||1);return parseInt(n.getAttribute(i)||1)===r?n:void 0}}function L_(o){return o.childCount==1&&o.getChild(0).is("element","paragraph")&&o.getChild(0).isEmpty}class r1 extends pt{refresh(){const e=Rn(this.editor.model.document.selection),t=e[0];if(t){const n=t.findAncestor("table"),i=this.editor.plugins.get("TableUtils").getRows(n)-1,r=zs(e),a=r.first===0&&r.last===i;this.isEnabled=!a}else this.isEnabled=!1}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),n=Rn(e.document.selection),i=zs(n),r=n[0],a=r.findAncestor("table"),l=t.getCellLocation(r).column;e.change(d=>{const h=i.last-i.first+1;t.removeRows(a,{at:i.first,rows:h});const p=function(b,x,E,P){const D=b.getChild(Math.min(x,P-1));let R=D.getChild(0),H=0;for(const Q of D.getChildren()){if(H>E)return R;R=Q,H+=parseInt(Q.getAttribute("colspan")||1)}return R}(a,i.first,l,t.getRows(a));d.setSelection(d.createPositionAt(p,0))})}}class s1 extends pt{refresh(){const e=Rn(this.editor.model.document.selection),t=e[0];if(t){const n=t.findAncestor("table"),i=this.editor.plugins.get("TableUtils").getColumns(n),{first:r,last:a}=Qc(e);this.isEnabled=a-r<i-1}else this.isEnabled=!1}execute(){const[e,t]=function(l){const d=Rn(l),h=d[0],p=d.pop(),b=[h,p];return h.isBefore(p)?b:b.reverse()}(this.editor.model.document.selection),n=e.parent.parent,i=[...new Ht(n)],r={first:i.find(l=>l.cell===e).column,last:i.find(l=>l.cell===t).column},a=function(l,d,h,p){return parseInt(h.getAttribute("colspan")||1)>1?h:d.previousSibling||h.nextSibling?h.nextSibling||d.previousSibling:p.first?l.reverse().find(({column:b})=>b<p.first).cell:l.reverse().find(({column:b})=>b>p.last).cell}(i,e,t,r);this.editor.model.change(l=>{const d=r.last-r.first+1;this.editor.plugins.get("TableUtils").removeColumns(n,{at:r.first,columns:d}),l.setSelection(l.createPositionAt(a,0))})}}class a1 extends pt{refresh(){const e=Rn(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=Rn(t.document.selection),i=n[0].findAncestor("table"),{first:r,last:a}=zs(n),l=this.value?r:a+1,d=i.getAttribute("headingRows")||0;t.change(h=>{if(l){const p=P_(i,l,l>d?d:0);for(const{cell:b}of p)I_(b,l,h)}vn("headingRows",l,i,h,0)})}_isInHeading(e,t){const n=parseInt(t.getAttribute("headingRows")||0);return!!n&&e.parent.index<n}}class l1 extends pt{refresh(){const e=Rn(this.editor.model.document.selection),t=this.editor.plugins.get("TableUtils"),n=e.length>0;this.isEnabled=n,this.value=n&&e.every(i=>iv(t,i))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.model,n=Rn(t.document.selection),i=n[0].findAncestor("table"),{first:r,last:a}=Qc(n),l=this.value?r:a+1;t.change(d=>{if(l){const h=M_(i,l);for(const{cell:p,column:b}of h)D_(p,b,l,d)}vn("headingColumns",l,i,d,0)})}}class Yc extends ve{static get pluginName(){return"TableUtils"}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(e){const t=e.parent,n=t.parent,i=n.getChildIndex(t),r=new Ht(n,{row:i});for(const{cell:a,row:l,column:d}of r)if(a===e)return{row:l,column:d}}createTable(e,t){const n=e.createElement("table"),i=parseInt(t.rows)||2,r=parseInt(t.columns)||2;return uv(e,n,0,i,r),t.headingRows&&vn("headingRows",Math.min(t.headingRows,i),n,e,0),t.headingColumns&&vn("headingColumns",Math.min(t.headingColumns,r),n,e,0),n}insertRows(e,t={}){const n=this.editor.model,i=t.at||0,r=t.rows||1,a=t.copyStructureFromAbove!==void 0,l=t.copyStructureFromAbove?i-1:i,d=this.getRows(e),h=this.getColumns(e);if(i>d)throw new T.a("tableutils-insertrows-insert-out-of-range",this,{options:t});n.change(p=>{const b=e.getAttribute("headingRows")||0;if(b>i&&vn("headingRows",b+r,e,p,0),!a&&(i===0||i===d))return void uv(p,e,i,r,h);const x=a?Math.max(i,l):i,E=new Ht(e,{endRow:x}),P=new Array(h).fill(1);for(const{row:D,column:R,cellHeight:H,cellWidth:Q,cell:ae}of E){const ye=D+H-1,Be=D<=l&&l<=ye;D<i&&i<=ye?(p.setAttribute("rowspan",H+r,ae),P[R]=-Q):a&&Be&&(P[R]=Q)}for(let D=0;D<r;D++){const R=p.createElement("tableRow");p.insert(R,e,i);for(let H=0;H<P.length;H++){const Q=P[H],ae=p.createPositionAt(R,"end");Q>0&&dl(p,ae,Q>1?{colspan:Q}:null),H+=Math.abs(Q)-1}}})}insertColumns(e,t={}){const n=this.editor.model,i=t.at||0,r=t.columns||1;n.change(a=>{const l=e.getAttribute("headingColumns");i<l&&a.setAttribute("headingColumns",l+r,e);const d=this.getColumns(e);if(i===0||d===i){for(const p of e.getChildren())p.is("element","tableRow")&&Jc(r,a,a.createPositionAt(p,i?"end":0));return}const h=new Ht(e,{column:i,includeAllSlots:!0});for(const p of h){const{row:b,cell:x,cellAnchorColumn:E,cellAnchorRow:P,cellWidth:D,cellHeight:R}=p;if(E<i){a.setAttribute("colspan",D+r,x);const H=P+R-1;for(let Q=b;Q<=H;Q++)h.skipRow(Q)}else Jc(r,a,p.getPositionBefore())}})}removeRows(e,t){const n=this.editor.model,i=t.rows||1,r=this.getRows(e),a=t.at,l=a+i-1;if(l>r-1)throw new T.a("tableutils-removerows-row-index-out-of-range",this,{table:e,options:t});n.change(d=>{const{cellsToMove:h,cellsToTrim:p}=function(b,x,E){const P=new Map,D=[];for(const{row:R,column:H,cellHeight:Q,cell:ae}of new Ht(b,{endRow:E})){const ye=R+Q-1;if(R>=x&&R<=E&&ye>E){const Be=Q-(E-R+1);P.set(H,{cell:ae,rowspan:Be})}if(R<x&&ye>=x){let Be;Be=ye>=E?E-x+1:ye-x+1,D.push({cell:ae,rowspan:Q-Be})}}return{cellsToMove:P,cellsToTrim:D}}(e,a,l);h.size&&function(b,x,E,P){const D=[...new Ht(b,{includeAllSlots:!0,row:x})],R=b.getChild(x);let H;for(const{column:Q,cell:ae,isAnchor:ye}of D)if(E.has(Q)){const{cell:Be,rowspan:Kt}=E.get(Q),_t=H?P.createPositionAfter(H):P.createPositionAt(R,0);P.move(P.createRangeOn(Be),_t),vn("rowspan",Kt,Be,P),H=Be}else ye&&(H=ae)}(e,l+1,h,d);for(let b=l;b>=a;b--)d.remove(e.getChild(b));for(const{rowspan:b,cell:x}of p)vn("rowspan",b,x,d);(function(b,x,E,P){const D=b.getAttribute("headingRows")||0;x<D&&vn("headingRows",E<D?D-(E-x+1):x,b,P,0)})(e,a,l,d),av(e,this)||lv(e,this)})}removeColumns(e,t){const n=this.editor.model,i=t.at,r=t.columns||1,a=t.at+r-1;n.change(l=>{(function(d,h,p){const b=d.getAttribute("headingColumns")||0;if(b&&h.first<b){const x=Math.min(b-1,h.last)-h.first+1;p.setAttribute("headingColumns",b-x,d)}})(e,{first:i,last:a},l);for(let d=a;d>=i;d--)for(const{cell:h,column:p,cellWidth:b}of[...new Ht(e)])p<=d&&b>1&&p+b>d?vn("colspan",b-1,h,l):p===d&&l.remove(h);lv(e,this)||av(e,this)})}splitCellVertically(e,t=2){const n=this.editor.model,i=e.parent.parent,r=parseInt(e.getAttribute("rowspan")||1),a=parseInt(e.getAttribute("colspan")||1);n.change(l=>{if(a>1){const{newCellsSpan:d,updatedSpan:h}=V_(a,t);vn("colspan",h,e,l);const p={};d>1&&(p.colspan=d),r>1&&(p.rowspan=r),Jc(a>t?t-1:a-1,l,l.createPositionAfter(e),p)}if(a<t){const d=t-a,h=[...new Ht(i)],{column:p}=h.find(({cell:P})=>P===e),b=h.filter(({cell:P,cellWidth:D,column:R})=>P!==e&&R===p||R<p&&R+D>p);for(const{cell:P,cellWidth:D}of b)l.setAttribute("colspan",D+d,P);const x={};r>1&&(x.rowspan=r),Jc(d,l,l.createPositionAfter(e),x);const E=i.getAttribute("headingColumns")||0;E>p&&vn("headingColumns",E+d,i,l)}})}splitCellHorizontally(e,t=2){const n=this.editor.model,i=e.parent,r=i.parent,a=r.getChildIndex(i),l=parseInt(e.getAttribute("rowspan")||1),d=parseInt(e.getAttribute("colspan")||1);n.change(h=>{if(l>1){const p=[...new Ht(r,{startRow:a,endRow:a+l-1,includeAllSlots:!0})],{newCellsSpan:b,updatedSpan:x}=V_(l,t);vn("rowspan",x,e,h);const{column:E}=p.find(({cell:D})=>D===e),P={};b>1&&(P.rowspan=b),d>1&&(P.colspan=d);for(const D of p){const{column:R,row:H}=D,Q=R===E,ae=(H+a+x)%b==0;H>=a+x&&Q&&ae&&Jc(1,h,D.getPositionBefore(),P)}}if(l<t){const p=t-l,b=[...new Ht(r,{startRow:0,endRow:a})];for(const{cell:P,cellHeight:D,row:R}of b)if(P!==e&&R+D>a){const H=D+p;h.setAttribute("rowspan",H,P)}const x={};d>1&&(x.colspan=d),uv(h,r,a+1,p,1,x);const E=r.getAttribute("headingRows")||0;E>a&&vn("headingRows",E+p,r,h)}})}getColumns(e){return[...e.getChild(0).getChildren()].reduce((t,n)=>t+parseInt(n.getAttribute("colspan")||1),0)}getRows(e){return Array.from(e.getChildren()).reduce((t,n)=>n.is("element","tableRow")?t+1:t,0)}}function uv(o,e,t,n,i,r={}){for(let a=0;a<n;a++){const l=o.createElement("tableRow");o.insert(l,e,t),Jc(i,o,o.createPositionAt(l,"end"),r)}}function Jc(o,e,t,n={}){for(let i=0;i<o;i++)dl(e,t,n)}function V_(o,e){if(o<e)return{newCellsSpan:1,updatedSpan:1};const t=Math.floor(o/e);return{newCellsSpan:t,updatedSpan:o-t*e+t}}class c1 extends pt{refresh(){const e=Gc(this.editor.model.document.selection);this.isEnabled=sv(e,this.editor.plugins.get(Yc))}execute(){const e=this.editor.model,t=this.editor.plugins.get(Yc);e.change(n=>{const i=Gc(e.document.selection),r=i.shift(),{mergeWidth:a,mergeHeight:l}=function(d,h,p){let b=0,x=0;for(const D of h){const{row:R,column:H}=p.getCellLocation(D);b=F_(D,H,b,"colspan"),x=F_(D,R,x,"rowspan")}const{row:E,column:P}=p.getCellLocation(d);return{mergeWidth:b-P,mergeHeight:x-E}}(r,i,t);vn("colspan",a,r,n),vn("rowspan",l,r,n);for(const d of i)u1(d,r,n);cv(r.findAncestor("table"),t),n.setSelection(r,"in")})}}function u1(o,e,t){z_(o)||(z_(e)&&t.remove(t.createRangeIn(e)),t.move(t.createRangeIn(o),t.createPositionAt(e,"end"))),t.remove(o)}function z_(o){return o.childCount==1&&o.getChild(0).is("element","paragraph")&&o.getChild(0).isEmpty}function F_(o,e,t,n){const i=parseInt(o.getAttribute(n)||1);return Math.max(t,e+i)}class d1 extends pt{refresh(){const e=Rn(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=Rn(e.document.selection),n=zs(t),i=t[0].findAncestor("table"),r=[];for(let a=n.first;a<=n.last;a++)for(const l of i.getChild(a).getChildren())r.push(e.createRangeOn(l));e.change(a=>{a.setSelection(r)})}}class h1 extends pt{refresh(){const e=Rn(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=Rn(e.document.selection),n=t[0],i=t.pop(),r=n.findAncestor("table"),a=this.editor.plugins.get("TableUtils"),l=a.getCellLocation(n),d=a.getCellLocation(i),h=Math.min(l.column,d.column),p=Math.max(l.column,d.column),b=[];for(const x of new Ht(r,{startColumn:h,endColumn:p}))b.push(e.createRangeOn(x.cell));e.change(x=>{x.setSelection(b)})}}function f1(o){o.document.registerPostFixer(e=>function(t,n){const i=n.document.differ.getChanges();let r=!1;const a=new Set;for(const l of i){let d;l.name=="table"&&l.type=="insert"&&(d=l.position.nodeAfter),l.name!="tableRow"&&l.name!="tableCell"||(d=l.position.findAncestor("table")),m1(l)&&(d=l.range.start.findAncestor("table")),d&&!a.has(d)&&(r=p1(d,t)||r,r=g1(d,t)||r,a.add(d))}return r}(e,o))}function p1(o,e){let t=!1;const n=function(i){const r=parseInt(i.getAttribute("headingRows")||0),a=Array.from(i.getChildren()).reduce((d,h)=>h.is("element","tableRow")?d+1:d,0),l=[];for(const{row:d,cell:h,cellHeight:p}of new Ht(i)){if(p<2)continue;const b=d<r?r:a;if(d+p>b){const x=b-d;l.push({cell:h,rowspan:x})}}return l}(o);if(n.length){t=!0;for(const i of n)vn("rowspan",i.rowspan,i.cell,e,1)}return t}function g1(o,e){let t=!1;const n=function(l){const d=new Array(l.childCount).fill(0);for(const{rowIndex:h}of new Ht(l,{includeAllSlots:!0}))d[h]++;return d}(o),i=[];for(const[l,d]of n.entries())!d&&o.getChild(l).is("element","tableRow")&&i.push(l);if(i.length){t=!0;for(const l of i.reverse())e.remove(o.getChild(l)),n.splice(l,1)}const r=n.filter((l,d)=>o.getChild(d).is("element","tableRow")),a=r[0];if(!r.every(l=>l===a)){const l=r.reduce((d,h)=>h>d?h:d,0);for(const[d,h]of r.entries()){const p=l-h;if(p){for(let b=0;b<p;b++)dl(e,e.createPositionAt(o.getChild(d),"end"));t=!0}}}return t}function m1(o){const e=o.type==="attribute",t=o.attributeKey;return e&&(t==="headingRows"||t==="colspan"||t==="rowspan")}function b1(o){o.document.registerPostFixer(e=>function(t,n){const i=n.document.differ.getChanges();let r=!1;for(const a of i)a.type=="insert"&&a.name=="table"&&(r=v1(a.position.nodeAfter,t)||r),a.type=="insert"&&a.name=="tableRow"&&(r=B_(a.position.nodeAfter,t)||r),a.type=="insert"&&a.name=="tableCell"&&(r=dv(a.position.nodeAfter,t)||r),w1(a)&&(r=dv(a.position.parent,t)||r);return r}(e,o))}function v1(o,e){let t=!1;for(const n of o.getChildren())n.is("element","tableRow")&&(t=B_(n,e)||t);return t}function B_(o,e){let t=!1;for(const n of o.getChildren())t=dv(n,e)||t;return t}function dv(o,e){if(o.childCount==0)return e.insertElement("paragraph",o),!0;const t=Array.from(o.getChildren()).filter(n=>n.is("$text"));for(const n of t)e.wrap(e.createRangeOn(n),"paragraph");return!!t.length}function w1(o){return!(!o.position||!o.position.parent.is("element","tableCell"))&&(o.type=="insert"&&o.name=="$text"||o.type=="remove")}function _1(o,e){o.document.registerPostFixer(()=>function(t,n){const i=new Set;for(const r of t.getChanges()){const a=r.type=="attribute"?r.range.start.parent:r.position.parent;a.is("element","tableCell")&&i.add(a)}for(const r of i.values())for(const a of[...r.getChildren()].filter(l=>k1(l,n)))t.refreshItem(a);return!1}(o.document.differ,e))}function k1(o,e){if(!o.is("element","paragraph"))return!1;const t=e.toViewElement(o);return!!t&&v_(o)!==t.is("element","span")}function y1(o){o.document.registerPostFixer(()=>function(e){const t=e.document.differ,n=new Set;for(const i of t.getChanges()){if(i.type!="attribute")continue;const r=i.range.start.nodeAfter;r&&r.is("element","table")&&i.attributeKey=="headingRows"&&n.add(r)}if(n.size){for(const i of n.values())t.refreshItem(i);return!0}return!1}(o))}w(100);class x1 extends ve{static get pluginName(){return"TableEditing"}init(){const e=this.editor,t=e.model,n=t.schema,i=e.conversion;n.register("table",{allowWhere:"$block",allowAttributes:["headingRows","headingColumns"],isObject:!0,isBlock:!0}),n.register("tableRow",{allowIn:"table",isLimit:!0}),n.register("tableCell",{allowIn:"tableRow",allowChildren:"$block",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),i.for("upcast").add(r=>{r.on("element:figure",(a,l,d)=>{if(!d.consumable.test(l.viewItem,{name:!0,classes:"table"}))return;const h=function(b){for(const x of b.getChildren())if(x.is("element","table"))return x}(l.viewItem);if(!h||!d.consumable.test(h,{name:!0}))return;const p=ti(d.convertItem(h,l.modelCursor).modelRange.getItems());p&&(d.convertChildren(l.viewItem,d.writer.createPositionAt(p,"end")),d.updateConversionResult(p,l))})}),i.for("upcast").add(Zy()),i.for("editingDowncast").add(b_({asWidget:!0})),i.for("dataDowncast").add(b_()),i.for("upcast").elementToElement({model:"tableRow",view:"tr"}),i.for("upcast").add(r=>{r.on("element:tr",(a,l)=>{l.viewItem.isEmpty&&l.modelCursor.index==0&&a.stop()},{priority:"high"})}),i.for("editingDowncast").add(r=>r.on("insert:tableRow",(a,l,d)=>{const h=l.item;if(!d.consumable.consume(h,"insert"))return;const p=h.parent,b=function(R){for(const H of R.getChildren())if(H.name==="table")return H}(d.mapper.toViewElement(p)),x=p.getChildIndex(h),E=new Ht(p,{row:x}),P={headingRows:p.getAttribute("headingRows")||0,headingColumns:p.getAttribute("headingColumns")||0},D=new Map;for(const R of E){const H=D.get(x)||rv(b,h,x,P,d);D.set(x,H),d.consumable.consume(R.cell,"insert"),ov(R,P,d.writer.createPositionAt(H,"end"),d,{asWidget:!0})}})),i.for("editingDowncast").add(r=>r.on("remove:tableRow",(a,l,d)=>{a.stop();const h=d.writer,p=d.mapper,b=p.toViewPosition(l.position).getLastMatchingPosition(D=>!D.item.is("element","tr")).nodeAfter,x=b.parent.parent,E=h.createRangeOn(b),P=h.remove(E);for(const D of h.createRangeIn(P).getItems())p.unbindViewElement(D);k_("thead",x,d),k_("tbody",x,d)},{priority:"higher"})),i.for("upcast").elementToElement({model:"tableCell",view:"td"}),i.for("upcast").elementToElement({model:"tableCell",view:"th"}),i.for("upcast").add(m_("td")),i.for("upcast").add(m_("th")),i.for("editingDowncast").add(r=>r.on("insert:tableCell",(a,l,d)=>{const h=l.item;if(!d.consumable.consume(h,"insert"))return;const p=h.parent,b=p.parent,x=b.getChildIndex(p),E=new Ht(b,{row:x}),P={headingRows:b.getAttribute("headingRows")||0,headingColumns:b.getAttribute("headingColumns")||0};for(const D of E)if(D.cell===h){const R=d.mapper.toViewElement(p);return void ov(D,P,d.writer.createPositionAt(R,p.getChildIndex(h)),d,{asWidget:!0})}})),i.for("editingDowncast").elementToElement({model:"paragraph",view:t1,converterPriority:"high"}),i.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),i.for("upcast").attributeToAttribute({model:{key:"colspan",value:H_("colspan")},view:"colspan"}),i.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),i.for("upcast").attributeToAttribute({model:{key:"rowspan",value:H_("rowspan")},view:"rowspan"}),i.for("editingDowncast").add(r=>r.on("attribute:headingColumns:table",(a,l,d)=>{const h=l.item;if(!d.consumable.consume(l.item,a.name))return;const p={headingRows:h.getAttribute("headingRows")||0,headingColumns:h.getAttribute("headingColumns")||0},b=l.attributeOldValue,x=l.attributeNewValue,E=(b>x?b:x)-1;for(const P of new Ht(h,{endColumn:E}))n1(P,p,d)})),e.data.mapper.on("modelToViewPosition",(r,a)=>{const l=a.modelPosition.parent,d=a.modelPosition.nodeBefore;if(!l.is("element","tableCell")||!d||!d.is("element","paragraph"))return;const h=a.mapper.toViewElement(d),p=a.mapper.toViewElement(l);h===p&&(a.viewPosition=a.mapper.findPositionIn(p,d.maxOffset))}),e.config.define("table.defaultHeadings.rows",0),e.config.define("table.defaultHeadings.columns",0),e.commands.add("insertTable",new i1(e)),e.commands.add("insertTableRowAbove",new E_(e,{order:"above"})),e.commands.add("insertTableRowBelow",new E_(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new S_(e,{order:"left"})),e.commands.add("insertTableColumnRight",new S_(e,{order:"right"})),e.commands.add("removeTableRow",new r1(e)),e.commands.add("removeTableColumn",new s1(e)),e.commands.add("splitTableCellVertically",new A_(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new A_(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new c1(e)),e.commands.add("mergeTableCellRight",new Jp(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new Jp(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new Jp(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new Jp(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new l1(e)),e.commands.add("setTableRowHeader",new a1(e)),e.commands.add("selectTableRow",new d1(e)),e.commands.add("selectTableColumn",new h1(e)),y1(t),f1(t),_1(t,e.editing.mapper),b1(t)}static get requires(){return[Yc]}}function H_(o){return e=>{const t=parseInt(e.getAttribute(o));return Number.isNaN(t)||t<=0?null:t}}w(102);class C1 extends gt{constructor(e){super(e);const t=this.bindTemplate;this.items=this._createGridCollection(),this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",(n,i)=>`${i} × ${n}`),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":t.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck-insert-table-dropdown__label"]},children:[{text:t.to("label")}]}],on:{mousedown:t.to(n=>{n.preventDefault()}),click:t.to(()=>{this.fire("execute")})}}),this.on("boxover",(n,i)=>{const{row:r,column:a}=i.target.dataset;this.set({rows:parseInt(r),columns:parseInt(a)})}),this.on("change:columns",()=>{this._highlightGridBoxes()}),this.on("change:rows",()=>{this._highlightGridBoxes()})}focus(){}focusLast(){}_highlightGridBoxes(){const e=this.rows,t=this.columns;this.items.map((n,i)=>{const r=Math.floor(i/10)<e&&i%10<t;n.set("isOn",r)})}_createGridCollection(){const e=[];for(let t=0;t<100;t++){const n=Math.floor(t/10),i=t%10;e.push(new T1(this.locale,n+1,i+1))}return this.createCollection(e)}}class T1 extends gt{constructor(e,t,n){super(e);const i=this.bindTemplate;this.set("isOn",!1),this.setTemplate({tag:"div",attributes:{class:["ck-insert-table-dropdown-grid-box",i.if("isOn","ck-on")],"data-row":t,"data-column":n}})}}class E1 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",i=>{const r=e.commands.get("insertTable"),a=Jr(i);let l;return a.bind("isEnabled").to(r),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",()=>{l||(l=new C1(i),a.panelView.children.add(l),l.delegate("execute").to(a),a.buttonView.on("open",()=>{l.rows=0,l.columns=0}),a.on("execute",()=>{e.execute("insertTable",{rows:l.rows,columns:l.columns}),e.editing.view.focus()}))}),a}),e.ui.componentFactory.add("tableColumn",i=>{const r=[{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>',r,i)}),e.ui.componentFactory.add("tableRow",i=>{const r=[{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>',r,i)}),e.ui.componentFactory.add("mergeTableCells",i=>{const r=[{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>',r,i)})}_prepareDropdown(e,t,n,i){const r=this.editor,a=Jr(i),l=this._fillDropdownWithListOptions(a,n);return a.buttonView.set({label:e,icon:t,tooltip:!0}),a.bind("isEnabled").toMany(l,"isEnabled",(...d)=>d.some(h=>h)),this.listenTo(a,"execute",d=>{r.execute(d.source.commandName),r.editing.view.focus()}),a}_prepareMergeSplitButtonDropdown(e,t,n,i){const r=this.editor,a=Jr(i,zf),l=r.commands.get("mergeTableCells"),d=this._fillDropdownWithListOptions(a,n);return a.buttonView.set({label:e,icon:t,tooltip:!0,isEnabled:!0}),a.bind("isEnabled").toMany([l,...d],"isEnabled",(...h)=>h.some(p=>p)),this.listenTo(a.buttonView,"execute",()=>{r.execute("mergeTableCells"),r.editing.view.focus()}),this.listenTo(a,"execute",h=>{r.execute(h.source.commandName),r.editing.view.focus()}),a}_fillDropdownWithListOptions(e,t){const n=this.editor,i=[],r=new Xn;for(const a of t)S1(a,n,i,r);return Gf(e,r,n.ui.componentFactory),i}}function S1(o,e,t,n){const i=o.model=new Nd(o.model),{commandName:r,bindIsOn:a}=o.model;if(o.type==="button"||o.type==="switchbutton"){const l=e.commands.get(r);t.push(l),i.set({commandName:r}),i.bind("isEnabled").to(l),a&&i.bind("isOn").to(l,"value")}i.set({withText:!0}),n.add(o)}w(104);class hl extends ve{static get pluginName(){return"TableSelection"}static get requires(){return[Yc]}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=Gc(this.editor.model.document.selection);return e.length==0?null:e}getSelectionAsFragment(){const e=this.getSelectedTableCells();return e?this.editor.model.change(t=>{const n=t.createDocumentFragment(),i=this.editor.plugins.get("TableUtils"),{first:r,last:a}=Qc(e),{first:l,last:d}=zs(e),h=e[0].findAncestor("table");let p=d,b=a;if(sv(e,i)){const E={firstColumn:r,lastColumn:a,firstRow:l,lastRow:d};p=j_(h,E),b=R_(h,E)}const x=N_(h,{startRow:l,startColumn:r,endRow:p,endColumn:b},t);return t.insert(x,n,0),n}):null}setCellSelection(e,t){const n=this._getCellsToSelect(e,t);this.editor.model.change(i=>{i.setSelection(n.cells.map(r=>i.createRangeOn(r)),{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=ti(this.editor.model.document.selection.getRanges()).getContainedElement();return e&&e.is("element","tableCell")?e:null}_defineSelectionConverter(){const e=this.editor,t=new Set;e.conversion.for("editingDowncast").add(n=>n.on("selection",(i,r,a)=>{const l=a.writer;(function(p){for(const b of t)p.removeClass("ck-editor__editable_selected",b);t.clear()})(l);const d=this.getSelectedTableCells();if(!d)return;for(const p of d){const b=a.mapper.toViewElement(p);l.addClass("ck-editor__editable_selected",b),t.add(b)}const h=a.mapper.toViewElement(d[d.length-1]);l.setSelection(h,0)},{priority:"lowest"}))}_enablePluginDisabling(){const e=this.editor;this.on("change:isEnabled",()=>{if(!this.isEnabled){const t=this.getSelectedTableCells();if(!t)return;e.model.change(n=>{const i=n.createPositionAt(t[0],0),r=e.model.schema.getNearestSelectionRange(i);n.setSelection(r)})}})}_handleDeleteContent(e,t){const[n,i]=t,r=this.editor.model,a=!i||i.direction=="backward",l=Gc(n);l.length&&(e.stop(),r.change(d=>{const h=l[a?l.length-1:0];r.change(b=>{for(const x of l)r.deleteContent(b.createSelection(x,"in"))});const p=r.schema.getNearestSelectionRange(d.createPositionAt(h,0));n.is("documentSelection")?d.setSelection(p):n.setTo(p)}))}_getCellsToSelect(e,t){const n=this.editor.plugins.get("TableUtils"),i=n.getCellLocation(e),r=n.getCellLocation(t),a=Math.min(i.row,r.row),l=Math.max(i.row,r.row),d=Math.min(i.column,r.column),h=Math.max(i.column,r.column),p=new Array(l-a+1).fill(null).map(()=>[]),b={startRow:a,endRow:l,startColumn:d,endColumn:h};for(const{row:P,cell:D}of new Ht(e.findAncestor("table"),b))p[P-a].push(D);const x=r.row<i.row,E=r.column<i.column;return x&&p.reverse(),E&&p.forEach(P=>P.reverse()),{cells:p.flat(),backward:x||E}}}class A1 extends ve{static get pluginName(){return"TableClipboard"}static get requires(){return[hl,Yc]}init(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"copy",(n,i)=>this._onCopyCut(n,i)),this.listenTo(t,"cut",(n,i)=>this._onCopyCut(n,i)),this.listenTo(e.model,"insertContent",(n,i)=>this._onInsertContent(n,...i),{priority:"high"}),this.decorate("_replaceTableSlotCell")}_onCopyCut(e,t){const n=this.editor.plugins.get(hl);if(!n.getSelectedTableCells()||e.name=="cut"&&this.editor.isReadOnly)return;t.preventDefault(),e.stop();const i=this.editor.data,r=this.editor.editing.view.document,a=i.toView(n.getSelectionAsFragment());r.fire("clipboardOutput",{dataTransfer:t.dataTransfer,content:a,method:e.name})}_onInsertContent(e,t,n){if(n&&!n.is("documentSelection"))return;const i=this.editor.model,r=this.editor.plugins.get(Yc);let a=function(d,h){if(!d.is("documentFragment")&&!d.is("element"))return null;if(d.is("element","table"))return d;if(d.childCount==1&&d.getChild(0).is("element","table"))return d.getChild(0);const p=h.createRangeIn(d);for(const b of p.getItems())if(b.is("element","table")){const x=h.createRange(p.start,h.createPositionBefore(b));if(h.hasContent(x,{ignoreWhitespaces:!0}))return null;const E=h.createRange(h.createPositionAfter(b),p.end);return h.hasContent(E,{ignoreWhitespaces:!0})?null:b}return null}(t,i);if(!a)return;const l=Rn(i.document.selection);l.length?(e.stop(),i.change(d=>{const h={width:r.getColumns(a),height:r.getRows(a)},p=function(R,H,Q,ae){const ye=R[0].findAncestor("table"),Be=Qc(R),Kt=zs(R),_t={firstColumn:Be.first,lastColumn:Be.last,firstRow:Kt.first,lastRow:Kt.last},Bn=R.length===1;return Bn&&(_t.lastRow+=H.height-1,_t.lastColumn+=H.width-1,function(Jn,Hn,ji,si){const Ti=si.getColumns(Jn),ns=si.getRows(Jn);ji>Ti&&si.insertColumns(Jn,{at:Ti,columns:ji-Ti}),Hn>ns&&si.insertRows(Jn,{at:ns,rows:Hn-ns})}(ye,_t.lastRow+1,_t.lastColumn+1,ae)),Bn||!sv(R,ae)?function(Jn,Hn,ji){const{firstRow:si,lastRow:Ti,firstColumn:ns,lastColumn:eh}=Hn,th={first:si,last:Ti},q_={first:ns,last:eh};fv(Jn,ns,th,ji),fv(Jn,eh+1,th,ji),hv(Jn,si,q_,ji),hv(Jn,Ti+1,q_,ji,si)}(ye,_t,Q):(_t.lastRow=j_(ye,_t),_t.lastColumn=R_(ye,_t)),_t}(l,h,d,r),b=p.lastRow-p.firstRow+1,x=p.lastColumn-p.firstColumn+1,E={startRow:0,startColumn:0,endRow:Math.min(b,h.height)-1,endColumn:Math.min(x,h.width)-1};a=N_(a,E,d);const P=l[0].findAncestor("table"),D=this._replaceSelectedCellsWithPasted(a,h,P,p,d);if(this.editor.plugins.get("TableSelection").isEnabled){const R=x_(D.map(H=>d.createRangeOn(H)));d.setSelection(R)}else d.setSelection(D[0],0)})):cv(a,r)}_replaceSelectedCellsWithPasted(e,t,n,i,r){const{width:a,height:l}=t,d=function(R,H,Q){const ae=new Array(Q).fill(null).map(()=>new Array(H).fill(null));for(const{column:ye,row:Be,cell:Kt}of new Ht(R))ae[Be][ye]=Kt;return ae}(e,a,l),h=[...new Ht(n,{startRow:i.firstRow,endRow:i.lastRow,startColumn:i.firstColumn,endColumn:i.lastColumn,includeAllSlots:!0})],p=[];let b;for(const R of h){const{row:H,column:Q}=R;Q===i.firstColumn&&(b=R.getPositionBefore());const ae=H-i.firstRow,ye=Q-i.firstColumn,Be=d[ae%l][ye%a],Kt=Be?r.cloneElement(Be):null,_t=this._replaceTableSlotCell(R,Kt,b,r);_t&&(O_(_t,H,Q,i.lastRow,i.lastColumn,r),p.push(_t),b=r.createPositionAfter(_t))}const x=parseInt(n.getAttribute("headingRows")||0),E=parseInt(n.getAttribute("headingColumns")||0),P=i.firstRow<x&&x<=i.lastRow,D=i.firstColumn<E&&E<=i.lastColumn;if(P){const R=hv(n,x,{first:i.firstColumn,last:i.lastColumn},r,i.firstRow);p.push(...R)}if(D){const R=fv(n,E,{first:i.firstRow,last:i.lastRow},r);p.push(...R)}return p}_replaceTableSlotCell(e,t,n,i){const{cell:r,isAnchor:a}=e;return a&&i.remove(r),t?(i.insert(t,n),t):null}}function hv(o,e,t,n,i=0){if(!(e<1))return P_(o,e,i).filter(({column:r,cellWidth:a})=>$_(r,a,t)).map(({cell:r})=>I_(r,e,n))}function fv(o,e,t,n){if(!(e<1))return M_(o,e).filter(({row:i,cellHeight:r})=>$_(i,r,t)).map(({cell:i,column:r})=>D_(i,r,e,n))}function $_(o,e,t){const n=o+e-1,{first:i,last:r}=t;return o>=i&&o<=r||o<i&&n>=i}class N1 extends ve{static get pluginName(){return"TableKeyboard"}static get requires(){return[hl]}init(){const e=this.editor.editing.view.document;this.editor.keystrokes.set("Tab",(...t)=>this._handleTabOnSelectedTable(...t),{priority:"low"}),this.editor.keystrokes.set("Tab",this._getTabHandler(!0),{priority:"low"}),this.editor.keystrokes.set("Shift+Tab",this._getTabHandler(!1),{priority:"low"}),this.listenTo(e,"arrowKey",(...t)=>this._onArrowKey(...t),{context:"table"})}_handleTabOnSelectedTable(e,t){const n=this.editor,i=n.model.document.selection.getSelectedElement();i&&i.is("element","table")&&(t(),n.model.change(r=>{r.setSelection(r.createRangeIn(i.getChild(0).getChild(0)))}))}_getTabHandler(e){const t=this.editor;return(n,i)=>{let r=Xd(t.model.document.selection)[0];if(r||(r=this.editor.plugins.get("TableSelection").getFocusCell()),!r)return;i();const a=r.parent,l=a.parent,d=l.getChildIndex(a),h=a.getChildIndex(r),p=h===0;if(!e&&p&&d===0)return void t.model.change(D=>{D.setSelection(D.createRangeOn(l))});const b=this.editor.plugins.get("TableUtils"),x=h===a.childCount-1,E=d===b.getRows(l)-1;if(e&&E&&x&&(t.execute("insertTableRowBelow"),d===b.getRows(l)-1))return void t.model.change(D=>{D.setSelection(D.createRangeOn(l))});let P;if(e&&x)P=l.getChild(d+1).getChild(0);else if(!e&&p){const D=l.getChild(d-1);P=D.getChild(D.childCount-1)}else P=a.getChild(h+(e?1:-1));t.model.change(D=>{D.setSelection(D.createRangeIn(P))})}}_onArrowKey(e,t){const n=this.editor,i=pi(t.keyCode,n.locale.contentLanguageDirection);this._handleArrowKeys(i,t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),e.stop())}_handleArrowKeys(e,t){const n=this.editor.model.document.selection,i=["right","down"].includes(e),r=Gc(n);if(r.length){let l;return l=t?this.editor.plugins.get("TableSelection").getFocusCell():i?r[r.length-1]:r[0],this._navigateFromCellInDirection(l,e,t),!0}const a=n.focus.findAncestor("tableCell");return!!a&&!(t&&!n.isCollapsed&&n.isBackward==i)&&!!this._isSelectionAtCellEdge(n,a,i)&&(this._navigateFromCellInDirection(a,e,t),!0)}_isSelectionAtCellEdge(e,t,n){const i=this.editor.model,r=this.editor.model.schema,a=n?e.getLastPosition():e.getFirstPosition();if(!r.getLimitElement(a).is("element","tableCell"))return i.createPositionAt(t,n?"end":0).isTouching(a);const l=i.createSelection(a);return i.modifySelection(l,{direction:n?"forward":"backward"}),a.isEqual(l.focus)}_navigateFromCellInDirection(e,t,n=!1){const i=this.editor.model,r=e.findAncestor("table"),a=[...new Ht(r,{includeAllSlots:!0})],{row:l,column:d}=a[a.length-1],h=a.find(({cell:D})=>D==e);let{row:p,column:b}=h;switch(t){case"left":b--;break;case"up":p--;break;case"right":b+=h.cellWidth;break;case"down":p+=h.cellHeight}if(p<0||p>l||b<0&&p<=0||b>d&&p>=l)return void i.change(D=>{D.setSelection(D.createRangeOn(r))});b<0?(b=n?0:d,p--):b>d&&(b=n?d:0,p++);const x=a.find(D=>D.row==p&&D.column==b).cell,E=["right","down"].includes(t),P=this.editor.plugins.get("TableSelection");if(n&&P.isEnabled){const D=P.getAnchorCell()||e;P.setCellSelection(D,x)}else{const D=i.createPositionAt(x,E?0:"end");i.change(R=>{R.setSelection(D)})}}}class P1 extends $o{constructor(e){super(e),this.domEventType=["mousemove","mouseleave"]}onDomEvent(e){this.fire(e.type,e)}}class I1 extends ve{static get pluginName(){return"TableMouse"}static get requires(){return[hl]}init(){this.editor.editing.view.addObserver(P1),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const e=this.editor;let t=!1;const n=e.plugins.get(hl);this.listenTo(e.editing.view.document,"mousedown",(i,r)=>{if(!this.isEnabled||!n.isEnabled||!r.domEvent.shiftKey)return;const a=n.getAnchorCell()||Xd(e.model.document.selection)[0];if(!a)return;const l=this._getModelTableCellFromDomEvent(r);l&&U_(a,l)&&(t=!0,n.setCellSelection(a,l),r.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{t=!1}),this.listenTo(e.editing.view.document,"selectionChange",i=>{t&&i.stop()},{priority:"highest"})}_enableMouseDragSelection(){const e=this.editor;let t,n,i=!1,r=!1;const a=e.plugins.get(hl);this.listenTo(e.editing.view.document,"mousedown",(l,d)=>{this.isEnabled&&a.isEnabled&&(d.domEvent.shiftKey||d.domEvent.ctrlKey||d.domEvent.altKey||(t=this._getModelTableCellFromDomEvent(d)))}),this.listenTo(e.editing.view.document,"mousemove",(l,d)=>{if(!d.domEvent.buttons||!t)return;const h=this._getModelTableCellFromDomEvent(d);h&&U_(t,h)&&(n=h,i||n==t||(i=!0)),i&&(r=!0,a.setCellSelection(t,n),d.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{i=!1,r=!1,t=null,n=null}),this.listenTo(e.editing.view.document,"selectionChange",l=>{r&&l.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 U_(o,e){return o.parent.parent==e.parent.parent}w(106);function M1(o){const e=o.getSelectedElement();return e&&W_(e)?e:null}function D1(o){let e=o.getFirstPosition().parent;for(;e;){if(e.is("element")&&W_(e))return e;e=e.parent}return null}function W_(o){return!!o.getCustomProperty("table")&&it(o)}const pv={autoRefresh:!0};class Zp{constructor(e,t=pv){if(!e)throw new T.a("token-missing-token-url",this);t.initValue&&this._validateTokenValue(t.initValue),this.set("value",t.initValue),this._refresh=typeof e=="function"?e:()=>{return n=e,new Promise((i,r)=>{const a=new XMLHttpRequest;a.open("GET",n),a.addEventListener("load",()=>{const l=a.status,d=a.response;return l<200||l>299?r(new T.a("token-cannot-download-new-token",null)):i(d)}),a.addEventListener("error",()=>r(new Error("Network Error"))),a.addEventListener("abort",()=>r(new Error("Abort"))),a.send()});var n},this._options=Object.assign({},pv,t)}init(){return new Promise((e,t)=>{this.value?(this._options.autoRefresh&&this._registerRefreshTokenTimeout(),e(this)):this.refreshToken().then(e).catch(t)})}refreshToken(){return this._refresh().then(e=>{this._validateTokenValue(e),this.set("value",e),this._options.autoRefresh&&this._registerRefreshTokenTimeout()}).then(()=>this)}destroy(){clearTimeout(this._tokenRefreshTimeout)}_validateTokenValue(e){const t=typeof e=="string",n=!/^".*"$/.test(e),i=t&&e.split(".").length===3;if(!n||!i)throw new T.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=pv){return new Zp(e,t).init()}}ze(Zp,$t);var O1=Zp;const gv=/^data:(\S*?);base64,/;class K_{constructor(e,t,n){if(!e)throw new T.a("fileuploader-missing-file",null);if(!t)throw new T.a("fileuploader-missing-token",null);if(!n)throw new T.a("fileuploader-missing-api-address",null);this.file=function(i){if(typeof i!="string")return!1;const r=i.match(gv);return!(!r||!r.length)}(e)?function(i,r=512){try{const a=i.match(gv)[1],l=atob(i.replace(gv,"")),d=[];for(let h=0;h<l.length;h+=r){const p=l.slice(h,h+r),b=new Array(p.length);for(let x=0;x<p.length;x++)b[x]=p.charCodeAt(x);d.push(new Uint8Array(b))}return new Blob(d,{type:a})}catch{throw new T.a("fileuploader-decoding-image-data-error",null)}}(e):e,this._token=t,this._apiAddress=n}onProgress(e){return this.on("progress",(t,n)=>e(n)),this}onError(e){return this.once("error",(t,n)=>e(n)),this}abort(){this.xhr.abort()}send(){return this._prepareRequest(),this._attachXHRListeners(),this._sendRequest()}_prepareRequest(){const e=new XMLHttpRequest;e.open("POST",this._apiAddress),e.setRequestHeader("Authorization",this._token.value),e.responseType="json",this.xhr=e}_attachXHRListeners(){const e=this,t=this.xhr;function n(i){return()=>e.fire("error",i)}t.addEventListener("error",n("Network Error")),t.addEventListener("abort",n("Abort")),t.upload&&t.upload.addEventListener("progress",i=>{i.lengthComputable&&this.fire("progress",{total:i.total,uploaded:i.loaded})}),t.addEventListener("load",()=>{const i=t.status,r=t.response;if(i<200||i>299)return this.fire("error",r.message||r.error)})}_sendRequest(){const e=new FormData,t=this.xhr;return e.append("file",this.file),new Promise((n,i)=>{t.addEventListener("load",()=>{const r=t.status,a=t.response;return r<200||r>299?a.message?i(new T.a("fileuploader-uploading-data-failed",this,{message:a.message})):i(a.error):n(a)}),t.addEventListener("error",()=>i(new Error("Network Error"))),t.addEventListener("abort",()=>i(new Error("Abort"))),t.send(e)})}}ze(K_,j);class j1{constructor(e,t){if(!e)throw new T.a("uploadgateway-missing-token",null);if(!t)throw new T.a("uploadgateway-missing-api-address",null);this._token=e,this._apiAddress=t}upload(e){return new K_(e,this._token,this._apiAddress)}}class R1 extends N{static get pluginName(){return"CloudServicesCore"}createToken(e,t){return new O1(e,t)}createUploadGateway(e,t){return new j1(e,t)}}class mv extends Id{}mv.builtinPlugins=[class extends ve{static get requires(){return[It,Vc,nb,Jm,sb,Pp]}static get pluginName(){return"Essentials"}},class extends ve{static get requires(){return[Ji]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const o=this.editor.config.get("ckfinder.uploadUrl");o&&(this.editor.plugins.get(Ji).createUploadAdapter=e=>new _b(e,o,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 o=this.editor.commands;o.get("bulletedList")&&wr(this.editor,this,/^[*-]\s$/,"bulletedList"),o.get("numberedList")&&wr(this.editor,this,/^1[.|)]\s$/,"numberedList"),o.get("todoList")&&wr(this.editor,this,/^\[\s?\]\s$/,"todoList"),o.get("checkTodoList")&&wr(this.editor,this,/^\[\s?x\s?\]\s$/,()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")})}_addBasicStylesAutoformats(){const o=this.editor.commands;if(o.get("bold")){const e=$c(this.editor,"bold");Ls(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,e),Ls(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,e)}if(o.get("italic")){const e=$c(this.editor,"italic");Ls(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,e),Ls(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,e)}if(o.get("code")){const e=$c(this.editor,"code");Ls(this.editor,this,/(`)([^`]+)(`)$/g,e)}if(o.get("strikethrough")){const e=$c(this.editor,"strikethrough");Ls(this.editor,this,/(~~)([^~]+)(~~)$/g,e)}}_addHeadingAutoformats(){const o=this.editor.commands.get("heading");o&&o.modelElements.filter(e=>e.match(/^heading[1-6]$/)).forEach(e=>{const t=e[7],n=new RegExp(`^(#{${t}})\\s$`);wr(this.editor,this,n,()=>{if(!o.isEnabled||o.value===e)return!1;this.editor.execute("heading",{value:e})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&wr(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){const o=this.editor,e=o.model.document.selection;o.commands.get("codeBlock")&&wr(o,this,/^```$/,()=>{if(e.getFirstPosition().parent.is("element","listItem"))return!1;this.editor.execute("codeBlock",{usePreviousLanguageChoice:!0})})}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&wr(this.editor,this,/^---$/,"horizontalLine")}},class extends ve{static get requires(){return[kb,yb]}static get pluginName(){return"Bold"}},class extends ve{static get requires(){return[xb,Cb]}static get pluginName(){return"Italic"}},class extends ve{static get requires(){return[Eb,Sb]}static get pluginName(){return"BlockQuote"}},class extends ve{static get pluginName(){return"CKFinder"}static get requires(){return["Link","CKFinderUploadAdapter",Pb,Ab]}},class extends N{static get pluginName(){return"CloudServices"}static get requires(){return[R1]}init(){const o=this.context.config.get("cloudServices")||{};for(const e in o)this[e]=o[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(o){if(this._tokens.has(o))return Promise.resolve(this.getTokenFor(o));const e=this.context.plugins.get("CloudServicesCore").createToken(o);return this._tokens.set(o,e),e.init()}getTokenFor(o){const e=this._tokens.get(o);if(!e)throw new T.a("cloudservices-token-not-registered",this);return e}destroy(){super.destroy();for(const o of this._tokens.values())o.destroy()}},class extends ve{static get requires(){return[Ib,"ImageUpload"]}init(){const o=this.editor;o.plugins.has("ImageBlockEditing")||o.plugins.has("ImageInlineEditing")||Object(T.b)("easy-image-image-feature-missing",o)}static get pluginName(){return"EasyImage"}},class extends ve{static get requires(){return[Ob,jb]}static get pluginName(){return"Heading"}},class extends ve{static get requires(){return[Hb,Ub]}static get pluginName(){return"Image"}},class extends ve{static get requires(){return[Kb,qb]}static get pluginName(){return"ImageCaption"}},class extends ve{static get requires(){return[F,W]}static get pluginName(){return"ImageStyle"}},class extends ve{static get requires(){return[Kc,Eo]}static get pluginName(){return"ImageToolbar"}afterInit(){const o=this.editor,e=o.t,t=o.plugins.get(Kc),n=o.plugins.get("ImageUtils");var i;t.register("image",{ariaLabel:e("Image toolbar"),items:(i=o.config.get("image.toolbar")||[],i.map(r=>ne(r)?r.name:r)),getRelatedElement:r=>n.getClosestSelectedImageWidget(r)})}},class extends ve{static get pluginName(){return"ImageUpload"}static get requires(){return[hn,Qe,mt]}},class extends ve{static get pluginName(){return"Indent"}static get requires(){return[Yo,ey]}},class extends ve{static get requires(){return[wy,yy,Cy]}static get pluginName(){return"Link"}},class extends ve{static get requires(){return[Oy,jy]}static get pluginName(){return"List"}},class extends ve{static get requires(){return[Yp,By,zy,sl]}static get pluginName(){return"MediaEmbed"}},al,class extends ve{static get pluginName(){return"PasteFromOffice"}static get requires(){return[nn]}init(){const o=this.editor,e=o.editing.view.document,t=[];t.push(new Yy(e)),t.push(new Ky(e)),o.plugins.get("ClipboardPipeline").on("inputTransformation",(n,i)=>{if(i._isTransformedWithPasteFromOffice)return;const r=i.dataTransfer.getData("text/html"),a=t.find(l=>l.isActive(r));a&&(i._parsedData=Jy(r,e.stylesProcessor),a.execute(i),i._isTransformedWithPasteFromOffice=!0)},{priority:"high"})}},class extends ve{static get requires(){return[x1,E1,hl,I1,N1,A1,sl]}static get pluginName(){return"Table"}},class extends ve{static get requires(){return[Kc]}static get pluginName(){return"TableToolbar"}afterInit(){const o=this.editor,e=o.t,t=o.plugins.get(Kc),n=o.config.get("table.contentToolbar"),i=o.config.get("table.tableToolbar");n&&t.register("tableContent",{ariaLabel:e("Table toolbar"),items:n,getRelatedElement:D1}),i&&t.register("table",{ariaLabel:e("Table toolbar"),items:i,getRelatedElement:M1})}},class extends ve{static get pluginName(){return"TextTransformation"}constructor(o){super(o),o.config.define("typing",{transformations:{include:cb}})}init(){const o=this.editor.model.document.selection;o.on("change:range",()=>{this.isEnabled=!o.anchor.parent.is("element","codeBlock")}),this._enableTransformationWatchers()}_enableTransformationWatchers(){const o=this.editor,e=o.model,t=o.plugins.get("Input"),n=function(r){const a=r.extra||[],l=r.remove||[],d=h=>!l.includes(h);return function(h){const p=new Set;for(const b of h)if(Tp[b])for(const x of Tp[b])p.add(x);else p.add(b);return Array.from(p)}(r.include.concat(a).filter(d)).filter(d).map(h=>lb[h]||h).map(h=>({from:Ep(h.from),to:ub(h.to)}))}(o.config.get("typing.transformations")),i=new Vd(o.model,r=>{for(const a of n)if(a.from.test(r))return{normalizedTransformation:a}});i.on("matched:data",(r,a)=>{if(!t.isInput(a.batch))return;const{from:l,to:d}=a.normalizedTransformation,h=l.exec(a.text),p=d(h.slice(1)),b=a.range;let x=h.index;e.enqueueChange(E=>{for(let P=1;P<h.length;P++){const D=h[P],R=p[P-1];if(R==null){x+=D.length;continue}const H=b.start.getShiftedBy(x),Q=e.createRange(H,H.getShiftedBy(D.length)),ae=db(H);e.insertContent(E.createText(R,ae),Q),x+=R.length}})}),i.bind("isEnabled").to(this)}}],mv.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})})($v,$v.exports);var aC=$v.exports;const lC=mg(aC);function ru(v){var _=[];return kr.Children.forEach(v,function(u){u!=null&&(Array.isArray(u)?_=_.concat(ru(u)):H1.isFragment(u)&&u.props?_=_.concat(ru(u.props.children)):_.push(u))}),_}function a0(){var v=this.constructor.getDerivedStateFromProps(this.props,this.state);v!=null&&this.setState(v)}function l0(v){function _(u){var g=this.constructor.getDerivedStateFromProps(v,u);return g??null}this.setState(_.bind(this))}function c0(v,_){try{var u=this.props,g=this.state;this.props=v,this.state=_,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(u,g)}finally{this.props=u,this.state=g}}a0.__suppressDeprecationWarning=!0;l0.__suppressDeprecationWarning=!0;c0.__suppressDeprecationWarning=!0;function hw(v){var _=v.prototype;if(!_||!_.isReactComponent)throw new Error("Can only polyfill class components");if(typeof v.getDerivedStateFromProps!="function"&&typeof _.getSnapshotBeforeUpdate!="function")return v;var u=null,g=null,w=null;if(typeof _.componentWillMount=="function"?u="componentWillMount":typeof _.UNSAFE_componentWillMount=="function"&&(u="UNSAFE_componentWillMount"),typeof _.componentWillReceiveProps=="function"?g="componentWillReceiveProps":typeof _.UNSAFE_componentWillReceiveProps=="function"&&(g="UNSAFE_componentWillReceiveProps"),typeof _.componentWillUpdate=="function"?w="componentWillUpdate":typeof _.UNSAFE_componentWillUpdate=="function"&&(w="UNSAFE_componentWillUpdate"),u!==null||g!==null||w!==null){var k=v.displayName||v.name,m=typeof v.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. `+k+" uses "+m+" but also contains the following legacy lifecycles:"+(u!==null?` `+u:"")+(g!==null?` `+g:"")+(w!==null?` `+w:"")+` The above lifecycles should be removed. Learn more about this warning here: https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof v.getDerivedStateFromProps=="function"&&(_.componentWillMount=a0,_.componentWillReceiveProps=l0),typeof _.getSnapshotBeforeUpdate=="function"){if(typeof _.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");_.componentWillUpdate=c0;var C=_.componentDidUpdate;_.componentDidUpdate=function(B,T,L){var U=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:L;C.call(this,B,T,U)}}return v}var Uv={exports:{}},Wv={exports:{}};(function(v,_){_.__esModule=!0;var u=J;B(u);var g=$1,w=B(g),k=rx,m=B(k),C=Y1,M=B(C);function B(le){return le&&le.__esModule?le:{default:le}}function T(le,G){if(!(le instanceof G))throw new TypeError("Cannot call a class as a function")}function L(le,G){if(!le)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return G&&(typeof G=="object"||typeof G=="function")?G:le}function U(le,G){if(typeof G!="function"&&G!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof G);le.prototype=Object.create(G&&G.prototype,{constructor:{value:le,enumerable:!1,writable:!0,configurable:!0}}),G&&(Object.setPrototypeOf?Object.setPrototypeOf(le,G):le.__proto__=G)}var j=1073741823;function $(le,G){return le===G?le!==0||1/le===1/G:le!==le&&G!==G}function Z(le){var G=[];return{on:function(ie){G.push(ie)},off:function(ie){G=G.filter(function(me){return me!==ie})},get:function(){return le},set:function(ie,me){le=ie,G.forEach(function(pe){return pe(le,me)})}}}function se(le){return Array.isArray(le)?le[0]:le}function ue(le,G){var ne,ie,me="__create-react-context-"+(0,m.default)()+"__",pe=function(Ie){U(Me,Ie);function Me(){var Ue,te,ce;T(this,Me);for(var be=arguments.length,ke=Array(be),Ne=0;Ne<be;Ne++)ke[Ne]=arguments[Ne];return ce=(Ue=(te=L(this,Ie.call.apply(Ie,[this].concat(ke))),te),te.emitter=Z(te.props.value),Ue),L(te,ce)}return Me.prototype.getChildContext=function(){var te;return te={},te[me]=this.emitter,te},Me.prototype.componentWillReceiveProps=function(te){if(this.props.value!==te.value){var ce=this.props.value,be=te.value,ke=void 0;$(ce,be)?ke=0:(ke=typeof G=="function"?G(ce,be):j,(0,M.default)((ke&j)===ke,"calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: %s",ke),ke|=0,ke!==0&&this.emitter.set(te.value,ke))}},Me.prototype.render=function(){return this.props.children},Me}(u.Component);pe.childContextTypes=(ne={},ne[me]=w.default.object.isRequired,ne);var De=function(Ie){U(Me,Ie);function Me(){var Ue,te,ce;T(this,Me);for(var be=arguments.length,ke=Array(be),Ne=0;Ne<be;Ne++)ke[Ne]=arguments[Ne];return ce=(Ue=(te=L(this,Ie.call.apply(Ie,[this].concat(ke))),te),te.state={value:te.getValue()},te.onUpdate=function(xe,Le){var Fe=te.observedBits|0;Fe&Le&&te.setState({value:te.getValue()})},Ue),L(te,ce)}return Me.prototype.componentWillReceiveProps=function(te){var ce=te.observedBits;this.observedBits=ce??j},Me.prototype.componentDidMount=function(){this.context[me]&&this.context[me].on(this.onUpdate);var te=this.props.observedBits;this.observedBits=te??j},Me.prototype.componentWillUnmount=function(){this.context[me]&&this.context[me].off(this.onUpdate)},Me.prototype.getValue=function(){return this.context[me]?this.context[me].get():le},Me.prototype.render=function(){return se(this.props.children)(this.state.value)},Me}(u.Component);return De.contextTypes=(ie={},ie[me]=w.default.object,ie),{Provider:pe,Consumer:De}}_.default=ue,v.exports=_.default})(Wv,Wv.exports);var cC=Wv.exports;(function(v,_){_.__esModule=!0;var u=J,g=m(u),w=cC,k=m(w);function m(C){return C&&C.__esModule?C:{default:C}}_.default=g.default.createContext||k.default,v.exports=_.default})(Uv,Uv.exports);var uC=Uv.exports;const dC=mg(uC);var u0=dC(null),d0={exports:{}},hC=d0.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=hC);var wl=d0.exports,h0={exports:{}},fC=h0.exports={version:"2.6.12"};typeof __e=="number"&&(__e=fC);var $s=h0.exports,pC=function(v){if(typeof v!="function")throw TypeError(v+" is not a function!");return v},gC=pC,f0=function(v,_,u){if(gC(v),_===void 0)return v;switch(u){case 1:return function(g){return v.call(_,g)};case 2:return function(g,w){return v.call(_,g,w)};case 3:return function(g,w,k){return v.call(_,g,w,k)}}return function(){return v.apply(_,arguments)}},Us={},au=function(v){return typeof v=="object"?v!==null:typeof v=="function"},mC=au,gh=function(v){if(!mC(v))throw TypeError(v+" is not an object!");return v},mh=function(v){try{return!!v()}catch{return!0}},Ws=!mh(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),_v,Z_;function p0(){if(Z_)return _v;Z_=1;var v=au,_=wl.document,u=v(_)&&v(_.createElement);return _v=function(g){return u?_.createElement(g):{}},_v}var g0=!Ws&&!mh(function(){return Object.defineProperty(p0()("div"),"a",{get:function(){return 7}}).a!=7}),Xp=au,fw=function(v,_){if(!Xp(v))return v;var u,g;if(_&&typeof(u=v.toString)=="function"&&!Xp(g=u.call(v))||typeof(u=v.valueOf)=="function"&&!Xp(g=u.call(v))||!_&&typeof(u=v.toString)=="function"&&!Xp(g=u.call(v)))return g;throw TypeError("Can't convert object to primitive value")},X_=gh,bC=g0,vC=fw,wC=Object.defineProperty;Us.f=Ws?Object.defineProperty:function(_,u,g){if(X_(_),u=vC(u,!0),X_(g),bC)try{return wC(_,u,g)}catch{}if("get"in g||"set"in g)throw TypeError("Accessors not supported!");return"value"in g&&(_[u]=g.value),_};var vg=function(v,_){return{enumerable:!(v&1),configurable:!(v&2),writable:!(v&4),value:_}},_C=Us,kC=vg,lu=Ws?function(v,_,u){return _C.f(v,_,kC(1,u))}:function(v,_,u){return v[_]=u,v},yC={}.hasOwnProperty,_l=function(v,_){return yC.call(v,_)},eg=wl,kv=$s,ek=f0,xC=lu,CC=_l,tg="prototype",li=function(v,_,u){var g=v&li.F,w=v&li.G,k=v&li.S,m=v&li.P,C=v&li.B,M=v&li.W,B=w?kv:kv[_]||(kv[_]={}),T=B[tg],L=w?eg:k?eg[_]:(eg[_]||{})[tg],U,j,$;w&&(u=_);for(U in u)j=!g&&L&&L[U]!==void 0,!(j&&CC(B,U))&&($=j?L[U]:u[U],B[U]=w&&typeof L[U]!="function"?u[U]:C&&j?ek($,eg):M&&L[U]==$?function(Z){var se=function(ue,le,G){if(this instanceof Z){switch(arguments.length){case 0:return new Z;case 1:return new Z(ue);case 2:return new Z(ue,le)}return new Z(ue,le,G)}return Z.apply(this,arguments)};return se[tg]=Z[tg],se}($):m&&typeof $=="function"?ek(Function.call,$):$,m&&((B.virtual||(B.virtual={}))[U]=$,v&li.R&&T&&!T[U]&&xC(T,U,$)))};li.F=1;li.G=2;li.S=4;li.P=8;li.B=16;li.W=32;li.U=64;li.R=128;var cu=li,yv=cu;yv(yv.S+yv.F*!Ws,"Object",{defineProperty:Us.f});var TC=$s.Object,EC=function(_,u,g){return TC.defineProperty(_,u,g)},m0={default:EC,__esModule:!0},SC=m0,AC=NC(SC);function NC(v){return v&&v.__esModule?v:{default:v}}var xv=function(v,_,u){return _ in v?(0,AC.default)(v,_,{value:u,enumerable:!0,configurable:!0,writable:!0}):v[_]=u,v},PC={}.toString,b0=function(v){return PC.call(v).slice(8,-1)},IC=b0,v0=Object("z").propertyIsEnumerable(0)?Object:function(v){return IC(v)=="String"?v.split(""):Object(v)},pw=function(v){if(v==null)throw TypeError("Can't call method on "+v);return v},MC=v0,DC=pw,uu=function(v){return MC(DC(v))},OC=Math.ceil,jC=Math.floor,gw=function(v){return isNaN(v=+v)?0:(v>0?jC:OC)(v)},RC=gw,LC=Math.min,VC=function(v){return v>0?LC(RC(v),9007199254740991):0},zC=gw,FC=Math.max,BC=Math.min,HC=function(v,_){return v=zC(v),v<0?FC(v+_,0):BC(v,_)},$C=uu,UC=VC,WC=HC,KC=function(v){return function(_,u,g){var w=$C(_),k=UC(w.length),m=WC(g,k),C;if(v&&u!=u){for(;k>m;)if(C=w[m++],C!=C)return!0}else for(;k>m;m++)if((v||m in w)&&w[m]===u)return v||m||0;return!v&&-1}},w0={exports:{}},qC=!0,GC=$s,tk=wl,nk="__core-js_shared__",ik=tk[nk]||(tk[nk]={});(w0.exports=function(v,_){return ik[v]||(ik[v]=_!==void 0?_:{})})("versions",[]).push({version:GC.version,mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});var mw=w0.exports,QC=0,YC=Math.random(),wg=function(v){return"Symbol(".concat(v===void 0?"":v,")_",(++QC+YC).toString(36))},ok=mw("keys"),JC=wg,bw=function(v){return ok[v]||(ok[v]=JC(v))},rk=_l,ZC=uu,XC=KC(!1),eT=bw("IE_PROTO"),_0=function(v,_){var u=ZC(v),g=0,w=[],k;for(k in u)k!=eT&&rk(u,k)&&w.push(k);for(;_.length>g;)rk(u,k=_[g++])&&(~XC(w,k)||w.push(k));return w},vw="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),tT=_0,nT=vw,_g=Object.keys||function(_){return tT(_,nT)},kg={};kg.f=Object.getOwnPropertySymbols;var bh={};bh.f={}.propertyIsEnumerable;var iT=pw,ww=function(v){return Object(iT(v))},Cv,sk;function oT(){if(sk)return Cv;sk=1;var v=Ws,_=_g,u=kg,g=bh,w=ww,k=v0,m=Object.assign;return Cv=!m||mh(function(){var C={},M={},B=Symbol(),T="abcdefghijklmnopqrst";return C[B]=7,T.split("").forEach(function(L){M[L]=L}),m({},C)[B]!=7||Object.keys(m({},M)).join("")!=T})?function(M,B){for(var T=w(M),L=arguments.length,U=1,j=u.f,$=g.f;L>U;)for(var Z=k(arguments[U++]),se=j?_(Z).concat(j(Z)):_(Z),ue=se.length,le=0,G;ue>le;)G=se[le++],(!v||$.call(Z,G))&&(T[G]=Z[G]);return T}:m,Cv}var Tv=cu;Tv(Tv.S+Tv.F,"Object",{assign:oT()});var rT=$s.Object.assign,sT={default:rT,__esModule:!0},aT=sT,lT=cT(aT);function cT(v){return v&&v.__esModule?v:{default:v}}var Zc=lT.default||function(v){for(var _=1;_<arguments.length;_++){var u=arguments[_];for(var g in u)Object.prototype.hasOwnProperty.call(u,g)&&(v[g]=u[g])}return v},uT=function(v,_){if(!(v instanceof _))throw new TypeError("Cannot call a class as a function")},dT=m0,hT=fT(dT);function fT(v){return v&&v.__esModule?v:{default:v}}var pT=function(){function v(_,u){for(var g=0;g<u.length;g++){var w=u[g];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),(0,hT.default)(_,w.key,w)}}return function(_,u,g){return u&&v(_.prototype,u),g&&v(_,g),_}}(),yg={},gT=gw,mT=pw,bT=function(v){return function(_,u){var g=String(mT(_)),w=gT(u),k=g.length,m,C;return w<0||w>=k?v?"":void 0:(m=g.charCodeAt(w),m<55296||m>56319||w+1===k||(C=g.charCodeAt(w+1))<56320||C>57343?v?g.charAt(w):m:v?g.slice(w,w+2):(m-55296<<10)+(C-56320)+65536)}},k0=lu,_w={},vT=Us,wT=gh,_T=_g,kT=Ws?Object.defineProperties:function(_,u){wT(_);for(var g=_T(u),w=g.length,k=0,m;w>k;)vT.f(_,m=g[k++],u[m]);return _},Ev,ak;function yT(){if(ak)return Ev;ak=1;var v=wl.document;return Ev=v&&v.documentElement,Ev}var xT=gh,CT=kT,lk=vw,TT=bw("IE_PROTO"),Sv=function(){},Kv="prototype",cg=function(){var v=p0()("iframe"),_=lk.length,u="<",g=">",w;for(v.style.display="none",yT().appendChild(v),v.src="javascript:",w=v.contentWindow.document,w.open(),w.write(u+"script"+g+"document.F=Object"+u+"/script"+g),w.close(),cg=w.F;_--;)delete cg[Kv][lk[_]];return cg()},kw=Object.create||function(_,u){var g;return _!==null?(Sv[Kv]=xT(_),g=new Sv,Sv[Kv]=null,g[TT]=_):g=cg(),u===void 0?g:CT(g,u)},y0={exports:{}},qv=mw("wks"),ET=wg,Gv=wl.Symbol,ck=typeof Gv=="function",ST=y0.exports=function(v){return qv[v]||(qv[v]=ck&&Gv[v]||(ck?Gv:ET)("Symbol."+v))};ST.store=qv;var du=y0.exports,AT=Us.f,NT=_l,uk=du("toStringTag"),yw=function(v,_,u){v&&!NT(v=u?v:v.prototype,uk)&&AT(v,uk,{configurable:!0,value:_})},PT=kw,IT=vg,MT=yw,x0={};lu(x0,du("iterator"),function(){return this});var DT=function(v,_,u){v.prototype=PT(x0,{next:IT(1,u)}),MT(v,_+" Iterator")},OT=_l,jT=ww,dk=bw("IE_PROTO"),RT=Object.prototype,LT=Object.getPrototypeOf||function(v){return v=jT(v),OT(v,dk)?v[dk]:typeof v.constructor=="function"&&v instanceof v.constructor?v.constructor.prototype:v instanceof Object?RT:null},Av=cu,VT=k0,zT=lu,hk=_w,FT=DT,BT=yw,HT=LT,Nv=du("iterator"),Pv=!([].keys&&"next"in[].keys()),$T="@@iterator",fk="keys",ng="values",UT=function(){return this},C0=function(v,_,u,g,w,k,m){FT(u,_,g);var C=function(G){if(!Pv&&G in L)return L[G];switch(G){case fk:return function(){return new u(this,G)};case ng:return function(){return new u(this,G)}}return function(){return new u(this,G)}},M=_+" Iterator",B=w==ng,T=!1,L=v.prototype,U=L[Nv]||L[$T]||w&&L[w],j=U||C(w),$=w?B?C("entries"):j:void 0,Z=_=="Array"&&L.entries||U,se,ue,le;if(Z&&(le=HT(Z.call(new v)),le!==Object.prototype&&le.next&&BT(le,M,!0)),B&&U&&U.name!==ng&&(T=!0,j=function(){return U.call(this)}),m&&(Pv||T||!L[Nv])&&zT(L,Nv,j),hk[_]=j,hk[M]=UT,w)if(se={values:B?j:C(ng),keys:k?j:C(fk),entries:$},m)for(ue in se)ue in L||VT(L,ue,se[ue]);else Av(Av.P+Av.F*(Pv||T),_,se);return se},WT=bT(!0);C0(String,"String",function(v){this._t=String(v),this._i=0},function(){var v=this._t,_=this._i,u;return _>=v.length?{value:void 0,done:!0}:(u=WT(v,_),this._i+=u.length,{value:u,done:!1})});var KT=function(v,_){return{value:_,done:!!v}},ig=KT,pk=_w,qT=uu;C0(Array,"Array",function(v,_){this._t=qT(v),this._i=0,this._k=_},function(){var v=this._t,_=this._k,u=this._i++;return!v||u>=v.length?(this._t=void 0,ig(1)):_=="keys"?ig(0,u):_=="values"?ig(0,v[u]):ig(0,[u,v[u]])},"values");pk.Arguments=pk.Array;var GT=wl,QT=lu,gk=_w,mk=du("toStringTag"),bk="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 Iv=0;Iv<bk.length;Iv++){var Mv=bk[Iv],vk=GT[Mv],Dv=vk&&vk.prototype;Dv&&!Dv[mk]&&QT(Dv,mk,Mv),gk[Mv]=gk.Array}var xg={};xg.f=du;var YT=xg.f("iterator"),JT={default:YT,__esModule:!0},T0={exports:{}},vl=wg("meta"),ZT=au,xw=_l,XT=Us.f,eE=0,Cg=Object.isExtensible||function(){return!0},tE=!mh(function(){return Cg(Object.preventExtensions({}))}),Cw=function(v){XT(v,vl,{value:{i:"O"+ ++eE,w:{}}})},nE=function(v,_){if(!ZT(v))return typeof v=="symbol"?v:(typeof v=="string"?"S":"P")+v;if(!xw(v,vl)){if(!Cg(v))return"F";if(!_)return"E";Cw(v)}return v[vl].i},iE=function(v,_){if(!xw(v,vl)){if(!Cg(v))return!0;if(!_)return!1;Cw(v)}return v[vl].w},oE=function(v){return tE&&rE.NEED&&Cg(v)&&!xw(v,vl)&&Cw(v),v},rE=T0.exports={KEY:vl,NEED:!1,fastKey:nE,getWeak:iE,onFreeze:oE},sE=T0.exports,wk=$s,aE=xg,lE=Us.f,Tw=function(v){var _=wk.Symbol||(wk.Symbol={});v.charAt(0)!="_"&&!(v in _)&&lE(_,v,{value:aE.f(v)})},cE=_g,uE=kg,dE=bh,hE=function(v){var _=cE(v),u=uE.f;if(u)for(var g=u(v),w=dE.f,k=0,m;g.length>k;)w.call(v,m=g[k++])&&_.push(m);return _},fE=b0,pE=Array.isArray||function(_){return fE(_)=="Array"},E0={},Ew={},gE=_0,mE=vw.concat("length","prototype");Ew.f=Object.getOwnPropertyNames||function(_){return gE(_,mE)};var bE=uu,S0=Ew.f,vE={}.toString,A0=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],wE=function(v){try{return S0(v)}catch{return A0.slice()}};E0.f=function(_){return A0&&vE.call(_)=="[object Window]"?wE(_):S0(bE(_))};var Sw={},_E=bh,kE=vg,yE=uu,xE=fw,CE=_l,TE=g0,_k=Object.getOwnPropertyDescriptor;Sw.f=Ws?_k:function(_,u){if(_=yE(_),u=xE(u,!0),TE)try{return _k(_,u)}catch{}if(CE(_,u))return kE(!_E.f.call(_,u),_[u])};var Tg=wl,$n=_l,Qv=Ws,ci=cu,kk=k0,EE=sE.KEY,Aw=mh,Nw=mw,Pw=yw,SE=wg,vh=du,AE=xg,NE=Tw,PE=hE,IE=pE,Yv=gh,ME=au,DE=ww,Eg=uu,Iw=fw,Jv=vg,fh=kw,N0=E0,P0=Sw,Sg=kg,I0=Us,OE=_g,M0=P0.f,pl=I0.f,D0=N0.f,zi=Tg.Symbol,pg=Tg.JSON,og=pg&&pg.stringify,Hs="prototype",Vi=vh("_hidden"),yk=vh("toPrimitive"),jE={}.propertyIsEnumerable,nh=Nw("symbol-registry"),os=Nw("symbols"),wh=Nw("op-symbols"),Ao=Object[Hs],hu=typeof zi=="function"&&!!Sg.f,Ov=Tg.QObject,Zv=!Ov||!Ov[Hs]||!Ov[Hs].findChild,Xv=Qv&&Aw(function(){return fh(pl({},"a",{get:function(){return pl(this,"a",{value:7}).a}})).a!=7})?function(v,_,u){var g=M0(Ao,_);g&&delete Ao[_],pl(v,_,u),g&&v!==Ao&&pl(Ao,_,g)}:pl,xk=function(v){var _=os[v]=fh(zi[Hs]);return _._k=v,_},ew=hu&&typeof zi.iterator=="symbol"?function(v){return typeof v=="symbol"}:function(v){return v instanceof zi},Ag=function(_,u,g){return _===Ao&&Ag(wh,u,g),Yv(_),u=Iw(u,!0),Yv(g),$n(os,u)?(g.enumerable?($n(_,Vi)&&_[Vi][u]&&(_[Vi][u]=!1),g=fh(g,{enumerable:Jv(0,!1)})):($n(_,Vi)||pl(_,Vi,Jv(1,{})),_[Vi][u]=!0),Xv(_,u,g)):pl(_,u,g)},O0=function(_,u){Yv(_);for(var g=PE(u=Eg(u)),w=0,k=g.length,m;k>w;)Ag(_,m=g[w++],u[m]);return _},RE=function(_,u){return u===void 0?fh(_):O0(fh(_),u)},Ck=function(_){var u=jE.call(this,_=Iw(_,!0));return this===Ao&&$n(os,_)&&!$n(wh,_)?!1:u||!$n(this,_)||!$n(os,_)||$n(this,Vi)&&this[Vi][_]?u:!0},j0=function(_,u){if(_=Eg(_),u=Iw(u,!0),!(_===Ao&&$n(os,u)&&!$n(wh,u))){var g=M0(_,u);return g&&$n(os,u)&&!($n(_,Vi)&&_[Vi][u])&&(g.enumerable=!0),g}},R0=function(_){for(var u=D0(Eg(_)),g=[],w=0,k;u.length>w;)!$n(os,k=u[w++])&&k!=Vi&&k!=EE&&g.push(k);return g},L0=function(_){for(var u=_===Ao,g=D0(u?wh:Eg(_)),w=[],k=0,m;g.length>k;)$n(os,m=g[k++])&&(!u||$n(Ao,m))&&w.push(os[m]);return w};hu||(zi=function(){if(this instanceof zi)throw TypeError("Symbol is not a constructor!");var _=SE(arguments.length>0?arguments[0]:void 0),u=function(g){this===Ao&&u.call(wh,g),$n(this,Vi)&&$n(this[Vi],_)&&(this[Vi][_]=!1),Xv(this,_,Jv(1,g))};return Qv&&Zv&&Xv(Ao,_,{configurable:!0,set:u}),xk(_)},kk(zi[Hs],"toString",function(){return this._k}),P0.f=j0,I0.f=Ag,Ew.f=N0.f=R0,bh.f=Ck,Sg.f=L0,Qv&&!qC&&kk(Ao,"propertyIsEnumerable",Ck),AE.f=function(v){return xk(vh(v))});ci(ci.G+ci.W+ci.F*!hu,{Symbol:zi});for(var Tk="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Ek=0;Tk.length>Ek;)vh(Tk[Ek++]);for(var Sk=OE(vh.store),Ak=0;Sk.length>Ak;)NE(Sk[Ak++]);ci(ci.S+ci.F*!hu,"Symbol",{for:function(v){return $n(nh,v+="")?nh[v]:nh[v]=zi(v)},keyFor:function(_){if(!ew(_))throw TypeError(_+" is not a symbol!");for(var u in nh)if(nh[u]===_)return u},useSetter:function(){Zv=!0},useSimple:function(){Zv=!1}});ci(ci.S+ci.F*!hu,"Object",{create:RE,defineProperty:Ag,defineProperties:O0,getOwnPropertyDescriptor:j0,getOwnPropertyNames:R0,getOwnPropertySymbols:L0});var LE=Aw(function(){Sg.f(1)});ci(ci.S+ci.F*LE,"Object",{getOwnPropertySymbols:function(_){return Sg.f(DE(_))}});pg&&ci(ci.S+ci.F*(!hu||Aw(function(){var v=zi();return og([v])!="[null]"||og({a:v})!="{}"||og(Object(v))!="{}"})),"JSON",{stringify:function(_){for(var u=[_],g=1,w,k;arguments.length>g;)u.push(arguments[g++]);if(k=w=u[1],!(!ME(w)&&_===void 0||ew(_)))return IE(w)||(w=function(m,C){if(typeof k=="function"&&(C=k.call(this,m,C)),!ew(C))return C}),u[1]=w,og.apply(pg,u)}});zi[Hs][yk]||lu(zi[Hs],yk,zi[Hs].valueOf);Pw(zi,"Symbol");Pw(Math,"Math",!0);Pw(Tg.JSON,"JSON",!0);Tw("asyncIterator");Tw("observable");var VE=$s.Symbol,zE={default:VE,__esModule:!0};yg.__esModule=!0;var FE=JT,V0=z0(FE),BE=zE,Bs=z0(BE),jv=typeof Bs.default=="function"&&typeof V0.default=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Bs.default=="function"&&v.constructor===Bs.default&&v!==Bs.default.prototype?"symbol":typeof v};function z0(v){return v&&v.__esModule?v:{default:v}}yg.default=typeof Bs.default=="function"&&jv(V0.default)==="symbol"?function(v){return typeof v>"u"?"undefined":jv(v)}:function(v){return v&&typeof Bs.default=="function"&&v.constructor===Bs.default&&v!==Bs.default.prototype?"symbol":typeof v>"u"?"undefined":jv(v)};var HE=yg,$E=UE(HE);function UE(v){return v&&v.__esModule?v:{default:v}}var WE=function(v,_){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&((typeof _>"u"?"undefined":(0,$E.default)(_))==="object"||typeof _=="function")?_:v},Rv,Nk;function KE(){if(Nk)return Rv;Nk=1;var v=au,_=gh,u=function(g,w){if(_(g),!v(w)&&w!==null)throw TypeError(w+": can't set as prototype!")};return Rv={set:Object.setPrototypeOf||("__proto__"in{}?function(g,w,k){try{k=f0(Function.call,Sw.f(Object.prototype,"__proto__").set,2),k(g,[]),w=!(g instanceof Array)}catch{w=!0}return function(C,M){return u(C,M),w?C.__proto__=M:k(C,M),C}}({},!1):void 0),check:u},Rv}var Pk=cu;Pk(Pk.S,"Object",{setPrototypeOf:KE().set});var qE=$s.Object.setPrototypeOf,GE={default:qE,__esModule:!0},Ik=cu;Ik(Ik.S,"Object",{create:kw});var QE=$s.Object,YE=function(_,u){return QE.create(_,u)},JE={default:YE,__esModule:!0},ZE=GE,Mk=Mw(ZE),XE=JE,eS=Mw(XE),tS=yg,nS=Mw(tS);function Mw(v){return v&&v.__esModule?v:{default:v}}var iS=function(v,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+(typeof _>"u"?"undefined":(0,nS.default)(_)));v.prototype=(0,eS.default)(_&&_.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),_&&(Mk.default?(0,Mk.default)(v,_):v.__proto__=_)};function oS(v){return v instanceof HTMLElement?v:U1.findDOMNode(v)}var Ng={exports:{}},ch={exports:{}};(function(){var v,_,u,g,w,k;typeof performance<"u"&&performance!==null&&performance.now?ch.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(ch.exports=function(){return(v()-w)/1e6},_=process.hrtime,v=function(){var m;return m=_(),m[0]*1e9+m[1]},g=v(),k=process.uptime()*1e9,w=g-k):Date.now?(ch.exports=function(){return Date.now()-u},u=Date.now()):(ch.exports=function(){return new Date().getTime()-u},u=new Date().getTime())}).call(on);var rS=ch.exports,sS=rS,is=typeof window>"u"?on:window,rg=["moz","webkit"],nu="AnimationFrame",su=is["request"+nu],ph=is["cancel"+nu]||is["cancelRequest"+nu];for(var ih=0;!su&&ih<rg.length;ih++)su=is[rg[ih]+"Request"+nu],ph=is[rg[ih]+"Cancel"+nu]||is[rg[ih]+"CancelRequest"+nu];if(!su||!ph){var Lv=0,Dk=0,fl=[],aS=1e3/60;su=function(v){if(fl.length===0){var _=sS(),u=Math.max(0,aS-(_-Lv));Lv=u+_,setTimeout(function(){var g=fl.slice(0);fl.length=0;for(var w=0;w<g.length;w++)if(!g[w].cancelled)try{g[w].callback(Lv)}catch(k){setTimeout(function(){throw k},0)}},Math.round(u))}return fl.push({handle:++Dk,callback:v,cancelled:!1}),Dk},ph=function(v){for(var _=0;_<fl.length;_++)fl[_].handle===v&&(fl[_].cancelled=!0)}}Ng.exports=function(v){return su.call(is,v)};Ng.exports.cancel=function(){ph.apply(is,arguments)};Ng.exports.polyfill=function(v){v||(v=is),v.requestAnimationFrame=su,v.cancelAnimationFrame=ph};var lS=Ng.exports;const Ok=mg(lS);var F0=!!(typeof window<"u"&&window.document&&window.document.createElement);function jk(v,_){var u={};return u[v.toLowerCase()]=_.toLowerCase(),u["Webkit"+v]="webkit"+_,u["Moz"+v]="moz"+_,u["ms"+v]="MS"+_,u["O"+v]="o"+_.toLowerCase(),u}function cS(v,_){var u={animationend:jk("Animation","AnimationEnd"),transitionend:jk("Transition","TransitionEnd")};return v&&("AnimationEvent"in _||delete u.animationend.animation,"TransitionEvent"in _||delete u.transitionend.transition),u}var uS=cS(F0,typeof window<"u"?window:{}),B0={};F0&&(B0=document.createElement("div").style);var sg={};function H0(v){if(sg[v])return sg[v];var _=uS[v];if(_)for(var u=Object.keys(_),g=u.length,w=0;w<g;w+=1){var k=u[w];if(Object.prototype.hasOwnProperty.call(_,k)&&k in B0)return sg[v]=_[k],sg[v]}return""}var tw=H0("animationend"),nw=H0("transitionend"),dS=!!(tw&&nw);function Rk(v,_){if(!v)return null;if(typeof v=="object"){var u=_.replace(/-\w/g,function(g){return g[1].toUpperCase()});return v[u]}return v+"-"+_}var Fs="none",oh="appear",rh="enter",sh="leave",hS={eventProps:ee.object,visible:ee.bool,children:ee.func,motionName:ee.oneOfType([ee.string,ee.object]),motionAppear:ee.bool,motionEnter:ee.bool,motionLeave:ee.bool,motionLeaveImmediately:ee.bool,motionDeadline:ee.number,removeOnLeave:ee.bool,leavedClassName:ee.string,onAppearStart:ee.func,onAppearActive:ee.func,onAppearEnd:ee.func,onEnterStart:ee.func,onEnterActive:ee.func,onEnterEnd:ee.func,onLeaveStart:ee.func,onLeaveActive:ee.func,onLeaveEnd:ee.func};function fS(v){var _=v,u=!!kr.forwardRef;typeof v=="object"&&(_=v.transitionSupport,u="forwardRef"in v?v.forwardRef:u);function g(k){return!!(k.motionName&&_)}var w=function(k){iS(m,k);function m(){uT(this,m);var C=WE(this,(m.__proto__||Object.getPrototypeOf(m)).call(this));return C.onDomUpdate=function(){var M=C.state,B=M.status,T=M.newStatus,L=C.props,U=L.onAppearStart,j=L.onEnterStart,$=L.onLeaveStart,Z=L.onAppearActive,se=L.onEnterActive,ue=L.onLeaveActive,le=L.motionAppear,G=L.motionEnter,ne=L.motionLeave;if(g(C.props)){var ie=C.getElement();C.$cacheEle!==ie&&(C.removeEventListener(C.$cacheEle),C.addEventListener(ie),C.$cacheEle=ie),T&&B===oh&&le?C.updateStatus(U,null,null,function(){C.updateActiveStatus(Z,oh)}):T&&B===rh&&G?C.updateStatus(j,null,null,function(){C.updateActiveStatus(se,rh)}):T&&B===sh&&ne&&C.updateStatus($,null,null,function(){C.updateActiveStatus(ue,sh)})}},C.onMotionEnd=function(M){var B=C.state,T=B.status,L=B.statusActive,U=C.props,j=U.onAppearEnd,$=U.onEnterEnd,Z=U.onLeaveEnd;T===oh&&L?C.updateStatus(j,{status:Fs},M):T===rh&&L?C.updateStatus($,{status:Fs},M):T===sh&&L&&C.updateStatus(Z,{status:Fs},M)},C.setNodeRef=function(M){var B=C.props.internalRef;C.node=M,typeof B=="function"?B(M):B&&"current"in B&&(B.current=M)},C.getElement=function(){try{return oS(C.node||C)}catch{return C.$cacheEle}},C.addEventListener=function(M){M&&(M.addEventListener(nw,C.onMotionEnd),M.addEventListener(tw,C.onMotionEnd))},C.removeEventListener=function(M){M&&(M.removeEventListener(nw,C.onMotionEnd),M.removeEventListener(tw,C.onMotionEnd))},C.updateStatus=function(M,B,T,L){var U=M?M(C.getElement(),T):null;if(!(U===!1||C._destroyed)){var j=void 0;L&&(j=function(){C.nextFrame(L)}),C.setState(Zc({statusStyle:typeof U=="object"?U:null,newStatus:!1},B),j)}},C.updateActiveStatus=function(M,B){C.nextFrame(function(){var T=C.state.status;if(T===B){var L=C.props.motionDeadline;C.updateStatus(M,{statusActive:!0}),L>0&&setTimeout(function(){C.onMotionEnd({deadline:!0})},L)}})},C.nextFrame=function(M){C.cancelNextFrame(),C.raf=Ok(M)},C.cancelNextFrame=function(){C.raf&&(Ok.cancel(C.raf),C.raf=null)},C.state={status:Fs,statusActive:!1,newStatus:!1,statusStyle:null},C.$cacheEle=null,C.node=null,C.raf=null,C}return pT(m,[{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 M,B=this.state,T=B.status,L=B.statusActive,U=B.statusStyle,j=this.props,$=j.children,Z=j.motionName,se=j.visible,ue=j.removeOnLeave,le=j.leavedClassName,G=j.eventProps;return $?T===Fs||!g(this.props)?se?$(Zc({},G),this.setNodeRef):ue?null:$(Zc({},G,{className:le}),this.setNodeRef):$(Zc({},G,{className:_r((M={},xv(M,Rk(Z,T),T!==Fs),xv(M,Rk(Z,T+"-active"),T!==Fs&&L),xv(M,Z,typeof Z=="string"),M)),style:U}),this.setNodeRef):null}}],[{key:"getDerivedStateFromProps",value:function(M,B){var T=B.prevProps,L=B.status;if(!g(M))return{};var U=M.visible,j=M.motionAppear,$=M.motionEnter,Z=M.motionLeave,se=M.motionLeaveImmediately,ue={prevProps:M};return(L===oh&&!j||L===rh&&!$||L===sh&&!Z)&&(ue.status=Fs,ue.statusActive=!1,ue.newStatus=!1),!T&&U&&j&&(ue.status=oh,ue.statusActive=!1,ue.newStatus=!0),T&&!T.visible&&U&&$&&(ue.status=rh,ue.statusActive=!1,ue.newStatus=!0),(T&&T.visible&&!U&&Z||!T&&se&&!U&&Z)&&(ue.status=sh,ue.statusActive=!1,ue.newStatus=!0),ue}}]),m}(kr.Component);return w.propTypes=Zc({},hS,{internalRef:ee.oneOfType([ee.object,ee.func])}),w.defaultProps={visible:!0,motionEnter:!0,motionAppear:!0,motionLeave:!0,removeOnLeave:!0},hw(w),u?kr.forwardRef(function(k,m){return kr.createElement(w,Zc({internalRef:m},k))}):w}const pS=fS(dS);function ug(v){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ug=function(u){return typeof u}:ug=function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},ug(v)}function gS(v,_){if(v==null)return{};var u=mS(v,_),g,w;if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(v);for(w=0;w<k.length;w++)g=k[w],!(_.indexOf(g)>=0)&&Object.prototype.propertyIsEnumerable.call(v,g)&&(u[g]=v[g])}return u}function mS(v,_){if(v==null)return{};var u={},g=Object.keys(v),w,k;for(k=0;k<g.length;k++)w=g[k],!(_.indexOf(w)>=0)&&(u[w]=v[w]);return u}function Lk(v,_){var u=Object.keys(v);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(v);_&&(g=g.filter(function(w){return Object.getOwnPropertyDescriptor(v,w).enumerable})),u.push.apply(u,g)}return u}function Vk(v){for(var _=1;_<arguments.length;_++){var u=arguments[_]!=null?arguments[_]:{};_%2?Lk(u,!0).forEach(function(g){Jo(v,g,u[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(u)):Lk(u).forEach(function(g){Object.defineProperty(v,g,Object.getOwnPropertyDescriptor(u,g))})}return v}function Jo(v,_,u){return _ in v?Object.defineProperty(v,_,{value:u,enumerable:!0,configurable:!0,writable:!0}):v[_]=u,v}function bS(v,_){if(!(v instanceof _))throw new TypeError("Cannot call a class as a function")}function zk(v,_){for(var u=0;u<_.length;u++){var g=_[u];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}function vS(v,_,u){return _&&zk(v.prototype,_),u&&zk(v,u),v}function wS(v,_){return _&&(ug(_)==="object"||typeof _=="function")?_:ai(v)}function iw(v){return iw=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},iw(v)}function ai(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function _S(v,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(_&&_.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),_&&ow(v,_)}function ow(v,_){return ow=Object.setPrototypeOf||function(g,w){return g.__proto__=w,g},ow(v,_)}var Fk="open",Bk="close",kS="---",Dw=function(v){_S(_,v);function _(){var u;return bS(this,_),u=wS(this,iw(_).apply(this,arguments)),u.state={dragNodeHighlight:!1},u.onSelectorClick=function(g){var w=u.props.context.onNodeClick;w(g,ai(u)),u.isSelectable()?u.onSelect(g):u.onCheck(g)},u.onSelectorDoubleClick=function(g){var w=u.props.context.onNodeDoubleClick;w(g,ai(u))},u.onSelect=function(g){if(!u.isDisabled()){var w=u.props.context.onNodeSelect;g.preventDefault(),w(g,ai(u))}},u.onCheck=function(g){if(!u.isDisabled()){var w=u.props,k=w.disableCheckbox,m=w.checked,C=u.props.context.onNodeCheck;if(!(!u.isCheckable()||k)){g.preventDefault();var M=!m;C(g,ai(u),M)}}},u.onMouseEnter=function(g){var w=u.props.context.onNodeMouseEnter;w(g,ai(u))},u.onMouseLeave=function(g){var w=u.props.context.onNodeMouseLeave;w(g,ai(u))},u.onContextMenu=function(g){var w=u.props.context.onNodeContextMenu;w(g,ai(u))},u.onDragStart=function(g){var w=u.props.context.onNodeDragStart;g.stopPropagation(),u.setState({dragNodeHighlight:!0}),w(g,ai(u));try{g.dataTransfer.setData("text/plain","")}catch{}},u.onDragEnter=function(g){var w=u.props.context.onNodeDragEnter;g.preventDefault(),g.stopPropagation(),w(g,ai(u))},u.onDragOver=function(g){var w=u.props.context.onNodeDragOver;g.preventDefault(),g.stopPropagation(),w(g,ai(u))},u.onDragLeave=function(g){var w=u.props.context.onNodeDragLeave;g.stopPropagation(),w(g,ai(u))},u.onDragEnd=function(g){var w=u.props.context.onNodeDragEnd;g.stopPropagation(),u.setState({dragNodeHighlight:!1}),w(g,ai(u))},u.onDrop=function(g){var w=u.props.context.onNodeDrop;g.preventDefault(),g.stopPropagation(),u.setState({dragNodeHighlight:!1}),w(g,ai(u))},u.onExpand=function(g){var w=u.props.context.onNodeExpand;w(g,ai(u))},u.setSelectHandle=function(g){u.selectHandle=g},u.getNodeChildren=function(){var g=u.props.children,w=ru(g).filter(function(m){return m}),k=W0(w);return w.length!==k.length&&$0(),k},u.getNodeState=function(){var g=u.props.expanded;return u.isLeaf()?null:g?Fk:Bk},u.isLeaf=function(){var g=u.props,w=g.isLeaf,k=g.loaded,m=u.props.context.loadData,C=u.getNodeChildren().length!==0;return w===!1?!1:w||!m&&!C||m&&k&&!C},u.isDisabled=function(){var g=u.props.disabled,w=u.props.context.disabled;return g===!1?!1:!!(w||g)},u.isCheckable=function(){var g=u.props.checkable,w=u.props.context.checkable;return!w||g===!1?!1:w},u.syncLoadData=function(g){var w=g.expanded,k=g.loading,m=g.loaded,C=u.props.context,M=C.loadData,B=C.onNodeLoad;if(!k&&M&&w&&!u.isLeaf()){var T=u.getNodeChildren().length!==0;!T&&!m&&B(ai(u))}},u.renderSwitcher=function(){var g=u.props,w=g.expanded,k=g.switcherIcon,m=u.props.context,C=m.prefixCls,M=m.switcherIcon,B=k||M;if(u.isLeaf())return J.createElement("span",{className:_r("".concat(C,"-switcher"),"".concat(C,"-switcher-noop"))},typeof B=="function"?B(Vk({},u.props,{isLeaf:!0})):B);var T=_r("".concat(C,"-switcher"),"".concat(C,"-switcher_").concat(w?Fk:Bk));return J.createElement("span",{onClick:u.onExpand,className:T},typeof B=="function"?B(Vk({},u.props,{isLeaf:!1})):B)},u.renderCheckbox=function(){var g=u.props,w=g.checked,k=g.halfChecked,m=g.disableCheckbox,C=u.props.context.prefixCls,M=u.isDisabled(),B=u.isCheckable();if(!B)return null;var T=typeof B!="boolean"?B:null;return J.createElement("span",{className:_r("".concat(C,"-checkbox"),w&&"".concat(C,"-checkbox-checked"),!w&&k&&"".concat(C,"-checkbox-indeterminate"),(M||m)&&"".concat(C,"-checkbox-disabled")),onClick:u.onCheck},T)},u.renderIcon=function(){var g=u.props.loading,w=u.props.context.prefixCls;return J.createElement("span",{className:_r("".concat(w,"-iconEle"),"".concat(w,"-icon__").concat(u.getNodeState()||"docu"),g&&"".concat(w,"-icon_loading"))})},u.renderSelector=function(){var g=u.state.dragNodeHighlight,w=u.props,k=w.title,m=w.selected,C=w.icon,M=w.loading,B=u.props.context,T=B.prefixCls,L=B.showIcon,U=B.icon,j=B.draggable,$=B.loadData,Z=u.isDisabled(),se="".concat(T,"-node-content-wrapper"),ue;if(L){var le=C||U;ue=le?J.createElement("span",{className:_r("".concat(T,"-iconEle"),"".concat(T,"-icon__customize"))},typeof le=="function"?le(u.props):le):u.renderIcon()}else $&&M&&(ue=u.renderIcon());var G=J.createElement("span",{className:"".concat(T,"-title")},k);return J.createElement("span",{ref:u.setSelectHandle,title:typeof k=="string"?k:"",className:_r("".concat(se),"".concat(se,"-").concat(u.getNodeState()||"normal"),!Z&&(m||g)&&"".concat(T,"-node-selected"),!Z&&j&&"draggable"),draggable:!Z&&j||void 0,"aria-grabbed":!Z&&j||void 0,onMouseEnter:u.onMouseEnter,onMouseLeave:u.onMouseLeave,onContextMenu:u.onContextMenu,onClick:u.onSelectorClick,onDoubleClick:u.onSelectorDoubleClick,onDragStart:j?u.onDragStart:void 0},ue,G)},u.renderChildren=function(){var g=u.props,w=g.expanded,k=g.pos,m=u.props.context,C=m.prefixCls,M=m.motion,B=m.renderTreeNode,T=u.getNodeChildren();return T.length===0?null:J.createElement(pS,Object.assign({visible:w},M),function(L){var U=L.style,j=L.className;return J.createElement("ul",{className:_r(j,"".concat(C,"-child-tree"),w&&"".concat(C,"-child-tree-open")),style:U,"data-expanded":w,role:"group"},q0(T,function($,Z){return B($,Z,k)}))})},u}return vS(_,[{key:"componentDidMount",value:function(){var g=this.props,w=g.eventKey,k=g.context.registerTreeNode;this.syncLoadData(this.props),k(w,this)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"componentWillUnmount",value:function(){var g=this.props,w=g.eventKey,k=g.context.registerTreeNode;k(w,null)}},{key:"isSelectable",value:function(){var g=this.props.selectable,w=this.props.context.selectable;return typeof g=="boolean"?g:w}},{key:"render",value:function(){var g,w=this.props.loading,k=this.props,m=k.className,C=k.style,M=k.dragOver,B=k.dragOverGapTop,T=k.dragOverGapBottom,L=k.isLeaf,U=k.expanded,j=k.selected,$=k.checked,Z=k.halfChecked,se=gS(k,["className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","expanded","selected","checked","halfChecked"]),ue=this.props.context,le=ue.prefixCls,G=ue.filterTreeNode,ne=ue.draggable,ie=this.isDisabled(),me=Q0(se);return J.createElement("li",Object.assign({className:_r(m,(g={},Jo(g,"".concat(le,"-treenode-disabled"),ie),Jo(g,"".concat(le,"-treenode-switcher-").concat(U?"open":"close"),!L),Jo(g,"".concat(le,"-treenode-checkbox-checked"),$),Jo(g,"".concat(le,"-treenode-checkbox-indeterminate"),Z),Jo(g,"".concat(le,"-treenode-selected"),j),Jo(g,"".concat(le,"-treenode-loading"),w),Jo(g,"drag-over",!ie&&M),Jo(g,"drag-over-gap-top",!ie&&B),Jo(g,"drag-over-gap-bottom",!ie&&T),Jo(g,"filter-node",G&&G(this)),g)),style:C,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},me),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector(),this.renderChildren())}}]),_}(J.Component);Dw.propTypes={eventKey:ee.string,prefixCls:ee.string,className:ee.string,style:ee.object,onSelect:ee.func,expanded:ee.bool,selected:ee.bool,checked:ee.bool,loaded:ee.bool,loading:ee.bool,halfChecked:ee.bool,children:ee.node,title:ee.node,pos:ee.string,dragOver:ee.bool,dragOverGapTop:ee.bool,dragOverGapBottom:ee.bool,isLeaf:ee.bool,checkable:ee.bool,selectable:ee.bool,disabled:ee.bool,disableCheckbox:ee.bool,icon:ee.oneOfType([ee.node,ee.func]),switcherIcon:ee.oneOfType([ee.node,ee.func])};hw(Dw);var Ow=function(_){return J.createElement(u0.Consumer,null,function(u){return J.createElement(Dw,Object.assign({},_,{context:u}))})};Ow.defaultProps={title:kS};Ow.isTreeNode=1;const Pg=Ow;function dg(v){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?dg=function(u){return typeof u}:dg=function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},dg(v)}function yS(v,_){if(v==null)return{};var u=xS(v,_),g,w;if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(v);for(w=0;w<k.length;w++)g=k[w],!(_.indexOf(g)>=0)&&Object.prototype.propertyIsEnumerable.call(v,g)&&(u[g]=v[g])}return u}function xS(v,_){if(v==null)return{};var u={},g=Object.keys(v),w,k;for(k=0;k<g.length;k++)w=g[k],!(_.indexOf(w)>=0)&&(u[w]=v[w]);return u}var CS=.25,TS=2,Hk=!1;function $0(){Hk||(Hk=!0,hh(!1,"Tree only accept TreeNode as children."))}function Xc(v,_){var u=v.slice(),g=u.indexOf(_);return g>=0&&u.splice(g,1),u}function eu(v,_){var u=v.slice();return u.indexOf(_)===-1&&u.push(_),u}function ES(v){return v.split("-")}function U0(v,_){return"".concat(v,"-").concat(_)}function SS(v){return v&&v.type&&v.type.isTreeNode}function W0(v){return ru(v).filter(SS)}function ah(v){var _=v.props||{},u=_.disabled,g=_.disableCheckbox,w=_.checkable;return!!(u||g)||w===!1}function K0(v,_){function u(g,w,k){var m=g?g.props.children:v,C=g?U0(k.pos,w):0,M=W0(m);if(g){var B={node:g,index:w,pos:C,key:g.key||C,parentPos:k.node?k.pos:null};_(B)}J.Children.forEach(M,function(T,L){u(T,L,{node:g,pos:C})})}u(null)}function q0(v,_){var u=ru(v).map(_);return u.length===1?u[0]:u}function AS(v,_){var u=_.props,g=u.eventKey,w=u.pos,k=[];return K0(v,function(m){var C=m.key;k.push(C)}),k.push(g||w),k}function $k(v,_){var u=v.clientY,g=_.selectHandle.getBoundingClientRect(),w=g.top,k=g.bottom,m=g.height,C=Math.max(m*CS,TS);return u<=w+C?-1:u>=k-C?1:0}function Uk(v,_){if(v){var u=_.multiple;return u?v.slice():v.length?[v[0]]:v}}function Wk(v){return v&&v.map(function(_){return String(_)})}var NS=function(_){return _};function G0(v,_){if(!v)return[];var u=_||{},g=u.processProps,w=g===void 0?NS:g,k=Array.isArray(v)?v:[v];return k.map(function(m){var C=m.children,M=yS(m,["children"]),B=G0(C,_);return kr.createElement(Pg,Object.assign({},w(M)),B)})}function PS(v){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=_.initWrapper,g=_.processEntity,w=_.onProcessFinished,k={},m={},C={posEntities:k,keyEntities:m};return u&&(C=u(C)||C),K0(v,function(M){var B=M.node,T=M.index,L=M.pos,U=M.key,j=M.parentPos,$={node:B,index:T,key:U,pos:L};k[L]=$,m[U]=$,$.parent=k[j],$.parent&&($.parent.children=$.parent.children||[],$.parent.children.push($)),g&&g($,C)}),w&&w(C),C}function Vv(v){if(!v)return null;var _;if(Array.isArray(v))_={checkedKeys:v,halfCheckedKeys:void 0};else if(dg(v)==="object")_={checkedKeys:v.checked||void 0,halfCheckedKeys:v.halfChecked||void 0};else return hh(!1,"`checkedKeys` is not an array or an object"),null;return _.checkedKeys=Wk(_.checkedKeys),_.halfCheckedKeys=Wk(_.halfCheckedKeys),_}function Kk(v,_,u){var g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},w={},k={};(g.checkedKeys||[]).forEach(function(L){w[L]=!0}),(g.halfCheckedKeys||[]).forEach(function(L){k[L]=!0});function m(L){if(w[L]!==_){var U=u[L];if(U){var j=U.children,$=U.parent,Z=U.node;if(!ah(Z)){var se=!0,ue=!1;(j||[]).filter(function(le){return!ah(le.node)}).forEach(function(le){var G=le.key,ne=w[G],ie=k[G];(ne||ie)&&(ue=!0),ne||(se=!1)}),_?w[L]=se:w[L]=!1,k[L]=ue,$&&m($.key)}}}}function C(L){if(w[L]!==_){var U=u[L];if(U){var j=U.children,$=U.node;ah($)||(w[L]=_,(j||[]).forEach(function(Z){C(Z.key)}))}}}function M(L){var U=u[L];if(!U){hh(!1,"'".concat(L,"' does not exist in the tree."));return}var j=U.children,$=U.parent,Z=U.node;w[L]=_,!ah(Z)&&((j||[]).filter(function(se){return!ah(se.node)}).forEach(function(se){C(se.key)}),$&&m($.key))}(v||[]).forEach(function(L){M(L)});var B=[],T=[];return Object.keys(w).forEach(function(L){w[L]&&B.push(L)}),Object.keys(k).forEach(function(L){!w[L]&&k[L]&&T.push(L)}),{checkedKeys:B,halfCheckedKeys:T}}function qk(v,_){var u={};function g(w){if(!u[w]){var k=_[w];if(k){u[w]=!0;var m=k.parent,C=k.node;C.props&&C.props.disabled||m&&g(m.key)}}}return(v||[]).forEach(function(w){g(w)}),Object.keys(u)}function Q0(v){return Object.keys(v).reduce(function(_,u){return(u.substr(0,5)==="data-"||u.substr(0,5)==="aria-")&&(_[u]=v[u]),_},{})}function hg(v){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?hg=function(u){return typeof u}:hg=function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},hg(v)}function IS(v,_,u){return _ in v?Object.defineProperty(v,_,{value:u,enumerable:!0,configurable:!0,writable:!0}):v[_]=u,v}function MS(v,_){if(!(v instanceof _))throw new TypeError("Cannot call a class as a function")}function Gk(v,_){for(var u=0;u<_.length;u++){var g=_[u];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(v,g.key,g)}}function DS(v,_,u){return _&&Gk(v.prototype,_),u&&Gk(v,u),v}function OS(v,_){return _&&(hg(_)==="object"||typeof _=="function")?_:jS(v)}function jS(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function rw(v){return rw=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},rw(v)}function RS(v,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(_&&_.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),_&&sw(v,_)}function sw(v,_){return sw=Object.setPrototypeOf||function(g,w){return g.__proto__=w,g},sw(v,_)}var Ig=function(v){RS(_,v);function _(){var u;return MS(this,_),u=OS(this,rw(_).apply(this,arguments)),u.domTreeNodes={},u.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeNode:[],prevProps:null},u.onNodeDragStart=function(g,w){var k=u.state.expandedKeys,m=u.props.onDragStart,C=w.props,M=C.eventKey,B=C.children;u.dragNode=w,u.setState({dragNodesKeys:AS(B,w),expandedKeys:Xc(k,M)}),m&&m({event:g,node:w})},u.onNodeDragEnter=function(g,w){var k=u.state.expandedKeys,m=u.props.onDragEnter,C=w.props,M=C.pos,B=C.eventKey;if(u.dragNode){var T=$k(g,w);if(u.dragNode.props.eventKey===B&&T===0){u.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){u.setState({dragOverNodeKey:B,dropPosition:T}),u.delayedDragEnterLogic||(u.delayedDragEnterLogic={}),Object.keys(u.delayedDragEnterLogic).forEach(function(L){clearTimeout(u.delayedDragEnterLogic[L])}),u.delayedDragEnterLogic[M]=window.setTimeout(function(){var L=eu(k,B);"expandedKeys"in u.props||u.setState({expandedKeys:L}),m&&m({event:g,node:w,expandedKeys:L})},400)},0)}},u.onNodeDragOver=function(g,w){var k=u.props.onDragOver,m=w.props.eventKey;if(u.dragNode&&m===u.state.dragOverNodeKey){var C=$k(g,w);if(C===u.state.dropPosition)return;u.setState({dropPosition:C})}k&&k({event:g,node:w})},u.onNodeDragLeave=function(g,w){var k=u.props.onDragLeave;u.setState({dragOverNodeKey:""}),k&&k({event:g,node:w})},u.onNodeDragEnd=function(g,w){var k=u.props.onDragEnd;u.setState({dragOverNodeKey:""}),k&&k({event:g,node:w}),u.dragNode=null},u.onNodeDrop=function(g,w){var k=u.state,m=k.dragNodesKeys,C=m===void 0?[]:m,M=k.dropPosition,B=u.props.onDrop,T=w.props,L=T.eventKey,U=T.pos;if(u.setState({dragOverNodeKey:""}),C.indexOf(L)!==-1){hh(!1,"Can not drop to dragNode(include it's children node)");return}var j=ES(U),$={event:g,node:w,dragNode:u.dragNode,dragNodesKeys:C.slice(),dropPosition:M+Number(j[j.length-1]),dropToGap:!1};M!==0&&($.dropToGap=!0),B&&B($),u.dragNode=null},u.onNodeClick=function(g,w){var k=u.props.onClick;k&&k(g,w)},u.onNodeDoubleClick=function(g,w){var k=u.props.onDoubleClick;k&&k(g,w)},u.onNodeSelect=function(g,w){var k=u.state.selectedKeys,m=u.state.keyEntities,C=u.props,M=C.onSelect,B=C.multiple,T=w.props,L=T.selected,U=T.eventKey,j=!L;j?B?k=eu(k,U):k=[U]:k=Xc(k,U);var $=k.map(function(Z){var se=m[Z];return se?se.node:null}).filter(function(Z){return Z});u.setUncontrolledState({selectedKeys:k}),M&&M(k,{event:"select",selected:j,node:w,selectedNodes:$,nativeEvent:g.nativeEvent})},u.onNodeCheck=function(g,w,k){var m=u.state,C=m.keyEntities,M=m.checkedKeys,B=m.halfCheckedKeys,T=u.props,L=T.checkStrictly,U=T.onCheck,j=w.props.eventKey,$,Z={event:"check",node:w,checked:k,nativeEvent:g.nativeEvent};if(L){var se=k?eu(M,j):Xc(M,j),ue=Xc(B,j);$={checked:se,halfChecked:ue},Z.checkedNodes=se.map(function(ie){return C[ie]}).filter(function(ie){return ie}).map(function(ie){return ie.node}),u.setUncontrolledState({checkedKeys:se})}else{var le=Kk([j],k,C,{checkedKeys:M,halfCheckedKeys:B}),G=le.checkedKeys,ne=le.halfCheckedKeys;$=G,Z.checkedNodes=[],Z.checkedNodesPositions=[],Z.halfCheckedKeys=ne,G.forEach(function(ie){var me=C[ie];if(me){var pe=me.node,De=me.pos;Z.checkedNodes.push(pe),Z.checkedNodesPositions.push({node:pe,pos:De})}}),u.setUncontrolledState({checkedKeys:G,halfCheckedKeys:ne})}U&&U($,Z)},u.onNodeLoad=function(g){return new Promise(function(w){u.setState(function(k){var m=k.loadedKeys,C=m===void 0?[]:m,M=k.loadingKeys,B=M===void 0?[]:M,T=u.props,L=T.loadData,U=T.onLoad,j=g.props.eventKey;if(!L||C.indexOf(j)!==-1||B.indexOf(j)!==-1)return{};var $=L(g);return $.then(function(){var Z=u.state,se=Z.loadedKeys,ue=Z.loadingKeys,le=eu(se,j),G=Xc(ue,j);U&&U(le,{event:"load",node:g}),u.setUncontrolledState({loadedKeys:le}),u.setState({loadingKeys:G}),w()}),{loadingKeys:eu(B,j)}})})},u.onNodeExpand=function(g,w){var k=u.state.expandedKeys,m=u.props,C=m.onExpand,M=m.loadData,B=w.props,T=B.eventKey,L=B.expanded,U=k.indexOf(T),j=!L;if(hh(L&&U!==-1||!L&&U===-1,"Expand state not sync with index check"),j?k=eu(k,T):k=Xc(k,T),u.setUncontrolledState({expandedKeys:k}),C&&C(k,{node:w,expanded:j,nativeEvent:g.nativeEvent}),j&&M){var $=u.onNodeLoad(w);return $?$.then(function(){u.setUncontrolledState({expandedKeys:k})}):null}return null},u.onNodeMouseEnter=function(g,w){var k=u.props.onMouseEnter;k&&k({event:g,node:w})},u.onNodeMouseLeave=function(g,w){var k=u.props.onMouseLeave;k&&k({event:g,node:w})},u.onNodeContextMenu=function(g,w){var k=u.props.onRightClick;k&&(g.preventDefault(),k({event:g,node:w}))},u.setUncontrolledState=function(g){var w=!1,k={};Object.keys(g).forEach(function(m){m in u.props||(w=!0,k[m]=g[m])}),w&&u.setState(k)},u.registerTreeNode=function(g,w){w?u.domTreeNodes[g]=w:delete u.domTreeNodes[g]},u.isKeyChecked=function(g){var w=u.state.checkedKeys,k=w===void 0?[]:w;return k.indexOf(g)!==-1},u.renderTreeNode=function(g,w){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,m=u.state,C=m.keyEntities,M=m.expandedKeys,B=M===void 0?[]:M,T=m.selectedKeys,L=T===void 0?[]:T,U=m.halfCheckedKeys,j=U===void 0?[]:U,$=m.loadedKeys,Z=$===void 0?[]:$,se=m.loadingKeys,ue=se===void 0?[]:se,le=m.dragOverNodeKey,G=m.dropPosition,ne=U0(k,w),ie=g.key||ne;return C[ie]?J.cloneElement(g,{key:ie,eventKey:ie,expanded:B.indexOf(ie)!==-1,selected:L.indexOf(ie)!==-1,loaded:Z.indexOf(ie)!==-1,loading:ue.indexOf(ie)!==-1,checked:u.isKeyChecked(ie),halfChecked:j.indexOf(ie)!==-1,pos:ne,dragOver:le===ie&&G===0,dragOverGapTop:le===ie&&G===-1,dragOverGapBottom:le===ie&&G===1}):($0(),null)},u}return DS(_,[{key:"render",value:function(){var g=this,w=this.state.treeNode,k=this.props,m=k.prefixCls,C=k.className,M=k.focusable,B=k.style,T=k.showLine,L=k.tabIndex,U=L===void 0?0:L,j=k.selectable,$=k.showIcon,Z=k.icon,se=k.switcherIcon,ue=k.draggable,le=k.checkable,G=k.checkStrictly,ne=k.disabled,ie=k.motion,me=k.loadData,pe=k.filterTreeNode,De=Q0(this.props);return M&&(De.tabIndex=U),J.createElement(u0.Provider,{value:{prefixCls:m,selectable:j,showIcon:$,icon:Z,switcherIcon:se,draggable:ue,checkable:le,checkStrictly:G,disabled:ne,motion:ie,loadData:me,filterTreeNode:pe,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}},J.createElement("ul",Object.assign({},De,{className:_r(m,C,IS({},"".concat(m,"-show-line"),T)),style:B,role:"tree",unselectable:"on"}),q0(w,function(Ie,Me){return g.renderTreeNode(Ie,Me)})))}}],[{key:"getDerivedStateFromProps",value:function(g,w){var k=w.prevProps,m={prevProps:g};function C(le){return!k&&le in g||k&&k[le]!==g[le]}var M=null;if(C("treeData")?M=G0(g.treeData):C("children")&&(M=ru(g.children)),M){m.treeNode=M;var B=PS(M);m.keyEntities=B.keyEntities}var T=m.keyEntities||w.keyEntities;if(C("expandedKeys")||k&&C("autoExpandParent")?m.expandedKeys=g.autoExpandParent||!k&&g.defaultExpandParent?qk(g.expandedKeys,T):g.expandedKeys:!k&&g.defaultExpandAll?m.expandedKeys=Object.keys(T):!k&&g.defaultExpandedKeys&&(m.expandedKeys=g.autoExpandParent||g.defaultExpandParent?qk(g.defaultExpandedKeys,T):g.defaultExpandedKeys),g.selectable&&(C("selectedKeys")?m.selectedKeys=Uk(g.selectedKeys,g):!k&&g.defaultSelectedKeys&&(m.selectedKeys=Uk(g.defaultSelectedKeys,g))),g.checkable){var L;if(C("checkedKeys")?L=Vv(g.checkedKeys)||{}:!k&&g.defaultCheckedKeys?L=Vv(g.defaultCheckedKeys)||{}:M&&(L=Vv(g.checkedKeys)||{checkedKeys:w.checkedKeys,halfCheckedKeys:w.halfCheckedKeys}),L){var U=L,j=U.checkedKeys,$=j===void 0?[]:j,Z=U.halfCheckedKeys,se=Z===void 0?[]:Z;if(!g.checkStrictly){var ue=Kk($,!0,T);$=ue.checkedKeys,se=ue.halfCheckedKeys}m.checkedKeys=$,m.halfCheckedKeys=se}}return C("loadedKeys")&&(m.loadedKeys=g.loadedKeys),m}}]),_}(J.Component);Ig.propTypes={prefixCls:ee.string,className:ee.string,style:ee.object,tabIndex:ee.oneOfType([ee.string,ee.number]),children:ee.any,treeData:ee.array,showLine:ee.bool,showIcon:ee.bool,icon:ee.oneOfType([ee.node,ee.func]),focusable:ee.bool,selectable:ee.bool,disabled:ee.bool,multiple:ee.bool,checkable:ee.oneOfType([ee.bool,ee.node]),checkStrictly:ee.bool,draggable:ee.bool,defaultExpandParent:ee.bool,autoExpandParent:ee.bool,defaultExpandAll:ee.bool,defaultExpandedKeys:ee.arrayOf(ee.string),expandedKeys:ee.arrayOf(ee.string),defaultCheckedKeys:ee.arrayOf(ee.string),checkedKeys:ee.oneOfType([ee.arrayOf(ee.oneOfType([ee.string,ee.number])),ee.object]),defaultSelectedKeys:ee.arrayOf(ee.string),selectedKeys:ee.arrayOf(ee.string),onClick:ee.func,onDoubleClick:ee.func,onExpand:ee.func,onCheck:ee.func,onSelect:ee.func,onLoad:ee.func,loadData:ee.func,loadedKeys:ee.arrayOf(ee.string),onMouseEnter:ee.func,onMouseLeave:ee.func,onRightClick:ee.func,onDragStart:ee.func,onDragEnter:ee.func,onDragOver:ee.func,onDragLeave:ee.func,onDragEnd:ee.func,onDrop:ee.func,filterTreeNode:ee.func,motion:ee.object,switcherIcon:ee.oneOfType([ee.node,ee.func])};Ig.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:[]};hw(Ig);var Y0=Ig;Y0.TreeNode=Pg;const LS=Y0;const zv=No.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; } } `,Qk={Name:{field_name:"Name",title:"Tên",type:"textbox",required:!0},MaKiHieu:{field_name:"MaKiHieu",title:"Mã kí hiệu",type:"textbox"}},VS=No(Pg)` .rc-tree-node-content-wrapper { white-space: nowrap; width: 780px; overflow: hidden; text-overflow: ellipsis; } `;function zS(v){const{dataSelect:_,valueDisplay:u,onClickButton:g,onCallback:w,Id:k,EndPoint_Tree:m,EndPoint_Odata:C,isDieu18:M}=v,{placeholder:B}=_,[T,L]=J.useState(!1),[U,j]=J.useState([]),[$,Z]=J.useState({value:null,label:""}),[se,ue]=J.useState(!1),[le,G]=J.useState(!1),[ne,ie]=J.useState(!0),[me,pe]=J.useState(!0),[De,Ie]=J.useState(!0),[Me,Ue]=J.useState(!0),[te,ce]=J.useState([]),[be,ke]=J.useState({}),[Ne,xe]=J.useState({valueFake:null,labelFake:"",isFake:!0}),[Le,Fe]=J.useState({});J.useEffect(()=>Fe({label:u}),[u]),J.useEffect(()=>{k&&Z(we=>({...we,value:[`${k}`]}))},[k]);const Ye=J.useCallback(()=>{eo(m,"GET",null,!1).then(Ae=>j(Ae)).catch(Ae=>tu("Không thể tải dữ liệu danh mục nội dung","Thông báo"))},[m]);J.useEffect(()=>{Ye()},[Ye]);const Ve=J.useCallback(we=>{g&&g(),T?!k&&!we.isValue&&(Z({}),ie(!0),pe(!0),Ie(!0)):(j(U),ce([])),L(!T)},[k,U,T,g]),yt=J.useMemo(()=>{const{label:we}=Le;return V.jsxDEV(lw,{children:[V.jsxDEV(uh,{readOnly:!0,placeholder:B,value:we||""},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:148,columnNumber:9},this),V.jsxDEV(Li,{color:"primary",onClick:Ve,children:"Chọn"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:149,columnNumber:9},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:147,columnNumber:7},this)},[Ve,Le,B]),Se=J.useCallback((we,Ae)=>{const{node:{props:{title:lt,isChildren:rt}}}=Ae;we.length!==0&&(G(Ae.selected),ie(!Ae.selected),pe(!Ae.selected),Ie(!Ae.selected),Z({value:we,label:we.length?lt:""}),xe({isFake:!1}),Ue(rt))},[]),We=J.useCallback(()=>{Fe({value:$.value[0],label:$.label}),w({value:$.value[0],label:$.label}),Ve({isValue:$.value[0]})},[Ve,w,$]),Oe=J.useCallback(we=>{we&&eo(`${C}(${we})`).then(Ae=>ke(Ae))},[C]),He=J.useCallback(()=>{ue(!1),ke({}),xe({})},[]),ht=J.useCallback(we=>{aw("Bạn có muốn xóa nguồn vốn này không").then(Ae=>{Ae&&Ae.isConfirmed&&eo(`${C}(${we})`,"DELETE",null).then(()=>{Ye(),gl("Xóa thành công","Thông báo"),He(),w({})})})},[C,Ye,He,w]);J.useCallback(we=>{const Ae=bv.IDDonVi==="bccb8adf-7788-4ddc-9376-640a7f90cd29";return V.jsxDEV(J.Fragment,{children:[V.jsxDEV("span",{children:we.title},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:215,columnNumber:11},this),V.jsxDEV("span",{children:Ae&&Ex&&V.jsxDEV(V.Fragment,{children:[V.jsxDEV(zv,{id:"add",onClick:()=>{ue("addChildren"),xe(lt=>({...lt,valueFake:we.key,labelFake:we.title,isFake:!0}))},className:"ms-3",children:[V.jsxDEV(to,{fa:"plus-circle"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:227,columnNumber:19},this),V.jsxDEV("span",{className:"ms-1",children:"Thêm danh mục con"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:228,columnNumber:19},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:219,columnNumber:17},this),V.jsxDEV(zv,{id:"update",onClick:()=>{ue("update"),xe(lt=>({...lt,valueFake:we.key,labelFake:we.title,isFake:!0})),Oe(we.key)},className:"ms-3",children:[V.jsxDEV(to,{fa:"pencil-square-o"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:239,columnNumber:19},this),V.jsxDEV("span",{className:"ms-1",children:"Cập nhật"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:240,columnNumber:19},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:230,columnNumber:17},this),we.children.length===0&&V.jsxDEV(zv,{id:"delete",onClick:()=>{ht(we.key)},className:"ms-2",children:[V.jsxDEV(to,{fa:"times"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:250,columnNumber:21},this),V.jsxDEV("span",{className:"ms-1",children:"Xóa"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:251,columnNumber:21},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:243,columnNumber:19},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:218,columnNumber:15},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:216,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:214,columnNumber:9},this)},[Oe,ht]);const ot=J.useCallback(we=>we.map(Ae=>Ae.children&&Ae.children.length?V.jsxDEV(Pg,{className:"parent",isChildren:!0,title:Ae.title,children:ot(Ae.children)},Ae.key,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:268,columnNumber:13},this):V.jsxDEV(VS,{className:"children",isChildren:!1,title:Ae.title},Ae.key,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:273,columnNumber:16},this)),[]),tt=J.useCallback(we=>{let Ae=document.getElementById("value").value;we.type==="click"&&eo(`Dieu18Ext/GetTree_NguonVon?search=${Ae}`,"GET",null,!1).then(lt=>{ce(lt)}),we.key==="Enter"||we.type==="click"?we.target.value?eo(`Dieu18Ext/GetTree_NguonVon?search=${we.target.value}`,"GET",null,!1).then(lt=>{ce(lt)}):ce(U):we.target.value||ce(U)},[U]),$e=J.useMemo(()=>{const{value:we}=$;bv.IDDonVi;let Ae=te.length===0?U:te;return V.jsxDEV(ou,{size:"xl",isOpen:T,toggle:Ve,zIndex:1301,children:[V.jsxDEV(dh,{className:"align-items-center pb-0",style:{borderBottom:"none"},children:V.jsxDEV("span",{children:"Thêm mới"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:311,columnNumber:11},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:310,columnNumber:9},this),V.jsxDEV(iu,{children:V.jsxDEV("div",{className:"module-tree h-100",children:[V.jsxDEV("div",{className:"module-tree-header",style:{border:"1px solid #ccc"},children:V.jsxDEV("div",{className:"d-flex justify-content-between align-items-center",children:[V.jsxDEV(V.Fragment,{children:V.jsxDEV("div",{children:[V.jsxDEV(Li,{color:"link",disabled:ne,onClick:()=>ue("addChildren"),children:"Thêm danh mục con"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:321,columnNumber:23},this),V.jsxDEV(Li,{color:"link",disabled:me,onClick:()=>{ue("update"),Oe(we[0])},children:"Cập nhật"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:328,columnNumber:23},this),V.jsxDEV(Li,{color:"link",disabled:De,onClick:()=>ht(we[0]),style:{color:"red"},children:"Xóa"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:339,columnNumber:25},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:319,columnNumber:21},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:318,columnNumber:19},this),V.jsxDEV("div",{className:"me-1",children:V.jsxDEV(Li,{onClick:We,disabled:!we||!we.length||Me,size:"sm",color:"primary",children:[V.jsxDEV(to,{fa:"save"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:364,columnNumber:21},this),V.jsxDEV("span",{className:"ms-1",children:"Chọn"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:365,columnNumber:21},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:358,columnNumber:19},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:357,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:316,columnNumber:15},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:315,columnNumber:13},this),V.jsxDEV("div",{className:"module-tree-body pt-2 pb-2",style:{overflow:"auto",border:"1px solid #ccc",borderTop:0,height:"calc(100vh - 170px)"},children:[V.jsxDEV("div",{className:"pl-2 pr-2 d-flex align-items-center",children:[V.jsxDEV(uh,{onKeyPress:tt,onChange:tt,placeholder:"Tìm tên nguồn vốn...",id:"value"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:380,columnNumber:17},this),V.jsxDEV(FS,{onClick:lt=>tt(lt),className:"w-25",children:"Tìm kiếm"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:386,columnNumber:17},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:379,columnNumber:15},this),V.jsxDEV(LS,{className:"myCls",showLine:!0,selectedKeys:we,onSelect:Se,defaultExpandAll:!!k,defaultExpandedKeys:M&&["A","B"],children:ot(Ae)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:390,columnNumber:15},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:370,columnNumber:13},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:314,columnNumber:11},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:313,columnNumber:9},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:309,columnNumber:7},this)},[$,te,U,T,Ve,ne,me,De,We,Me,tt,Se,k,M,ot,Oe,ht]),Je=J.useCallback((we,Ae)=>{ke(lt=>({...lt,[we]:Ae}))},[]),qt=J.useCallback((we,Ae)=>{const{Name:lt,MaKiHieu:rt}=be;if(lt&&rt){let Nt=Ae&&we==="update"?`${C}(${Ae})`:C,wn=Ae&&we==="update"?"PATCH":"POST",rn=Ae&&we==="update"?"Cập nhật":"Thêm mới",Mt={...be,IsDM:!0};Ae&&we==="addChildren"&&(Mt={...Mt,Parent_Id:Ae,Created_By:bv.MaTaiKhoan}),!Ae&&we==="add"&&(Mt={...Mt,IsFixed:!0}),Ae&&we==="update"&&(Mt={Name:be.Name,MaKiHieu:be.MaKiHieu}),eo(Nt,wn,JSON.stringify(Mt),!0).then(Fi=>{Ye(),gl(`${rn} thành công`,"Thông báo"),He()}).catch(Fi=>tu(`${rn} không thành công`,"Thông báo"))}else ml("Vui lòng nhập đầy đủ vào thông tin có dấu sao đỏ")},[C,be,Ye,He]),Qt=J.useMemo(()=>{const{valueFake:we,labelFake:Ae,isFake:lt}=Ne,rt=se,Nt=lt?we:$&&$.value&&$.value.length?$.value[0]:null,wn=lt?Ae:$?$.label:"";return V.jsxDEV(ou,{isOpen:!!se,toggle:()=>He(),size:"lg",zIndex:"1302",children:[V.jsxDEV(dh,{children:V.jsxDEV("b",{children:Nt?"Cập nhật danh mục":"Thêm mới danh mục"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:479,columnNumber:11},this)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:478,columnNumber:9},this),V.jsxDEV(iu,{children:[Nt&&rt==="addChildren"&&V.jsxDEV("h5",{children:['Thuộc danh mục "',wn,'"']},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:482,columnNumber:44},this),V.jsxDEV(cn,{data:Qk.Name,value:be.Name,onChange:Je},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:483,columnNumber:11},this),V.jsxDEV(cn,{data:Qk.MaKiHieu,value:be.MaKiHieu,onChange:Je},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:488,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:481,columnNumber:9},this),V.jsxDEV(J1,{children:[V.jsxDEV(gx,{onClick:()=>qt(rt,Nt),children:"Lưu"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:495,columnNumber:11},this)," ",V.jsxDEV(Li,{onClick:He,children:"Hủy"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:496,columnNumber:11},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:494,columnNumber:9},this)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:477,columnNumber:7},this)},[se,$,be,Je,He,qt,Ne]);return V.jsxDEV(J.Fragment,{children:[yt,$e,Qt]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Popup/PopupSelectTree.jsx",lineNumber:511,columnNumber:5},this)}const FS=No.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; `;/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var tn=function(){return tn=Object.assign||function(_){for(var u,g=1,w=arguments.length;g<w;g++){u=arguments[g];for(var k in u)Object.prototype.hasOwnProperty.call(u,k)&&(_[k]=u[k])}return _},tn.apply(this,arguments)};function BS(v,_){var u={};for(var g in v)Object.prototype.hasOwnProperty.call(v,g)&&_.indexOf(g)<0&&(u[g]=v[g]);if(v!=null&&typeof Object.getOwnPropertySymbols=="function")for(var w=0,g=Object.getOwnPropertySymbols(v);w<g.length;w++)_.indexOf(g[w])<0&&Object.prototype.propertyIsEnumerable.call(v,g[w])&&(u[g[w]]=v[g[w]]);return u}function Xi(v,_,u){if(u||arguments.length===2)for(var g=0,w=_.length,k;g<w;g++)(k||!(g in _))&&(k||(k=Array.prototype.slice.call(_,0,g)),k[g]=_[g]);return v.concat(k||_)}var yr=function(v){return v.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},HS={k:1e3,m:1e6,b:1e9},$S=function(v,_){_===void 0&&(_=".");var u=new RegExp("(\\d+("+yr(_)+"\\d*)?)([kmb])$","i"),g=v.match(u);if(g){var w=g[1],k=g[3],m=HS[k.toLowerCase()];return Number(w.replace(_,"."))*m}},US=function(v,_){_===void 0&&(_=",");var u=new RegExp(yr(_),"g");return v.replace(u,"")},WS=function(v,_){var u=yr(_.join("")),g=new RegExp("[^\\d"+u+"]","gi");return v.replace(g,"")},Fv=function(v){var _=v.value,u=v.groupSeparator,g=u===void 0?",":u,w=v.decimalSeparator,k=w===void 0?".":w,m=v.allowDecimals,C=m===void 0?!0:m,M=v.decimalsLimit,B=M===void 0?2:M,T=v.allowNegativeValue,L=T===void 0?!0:T,U=v.disableAbbreviations,j=U===void 0?!1:U,$=v.prefix,Z=$===void 0?"":$,se=v.transformRawValue,ue=se===void 0?function(Ye){return Ye}:se,le=ue(_);if(le==="-")return le;var G=j?[]:["k","m","b"],ne=new RegExp("((^|\\D)-\\d)|(-"+yr(Z)+")"),ie=ne.test(le),me=RegExp("(\\d+)-?"+yr(Z)).exec(_)||[],pe=me[0],De=me[1],Ie=Z?pe?le.replace(pe,"").concat(De):le.replace(Z,""):le,Me=US(Ie,g),Ue=WS(Me,Xi([g,k],G)),te=Ue;if(!j){if(G.some(function(Ye){return Ye===Ue.toLowerCase()}))return"";var ce=$S(Ue,k);ce&&(te=String(ce))}var be=ie&&L?"-":"";if(k&&te.includes(k)){var ke=Ue.split(k),Ne=ke[0],xe=ke[1],Le=B&&xe?xe.slice(0,B):xe,Fe=C?""+k+Le:"";return""+be+Ne+Fe}return""+be+te},KS=function(v,_,u){if(u&&v.length>1){if(v.includes(_)){var g=v.split(_),w=g[0],k=g[1];if(k.length>u)return""+w+_+k.slice(0,u)}var m=v.length>u?new RegExp("(\\d+)(\\d{"+u+"})"):new RegExp("(\\d)(\\d+)"),C=v.match(m);if(C){var w=C[1],k=C[2];return""+w+_+k}}return v},J0=function(v,_){var u=_.groupSeparator,g=u===void 0?",":u,w=_.decimalSeparator,k=w===void 0?".":w,m=new RegExp("\\d([^"+yr(g)+yr(k)+"0-9]+)"),C=v.match(m);return C?C[1]:void 0},lh=function(v){var _=v.value,u=v.decimalSeparator,g=v.intlConfig,w=v.decimalScale,k=v.prefix,m=k===void 0?"":k,C=v.suffix,M=C===void 0?"":C;if(_===""||_===void 0)return"";if(_==="-")return"-";var B=new RegExp("^\\d?-"+(m?yr(m)+"?":"")+"\\d").test(_),T=u!=="."?qS(_,u,B):_,L=g?new Intl.NumberFormat(g.locale,g.currency?{style:"currency",currency:g.currency,minimumFractionDigits:w||0,maximumFractionDigits:20}:void 0):new Intl.NumberFormat(void 0,{minimumFractionDigits:w||0,maximumFractionDigits:20}),U=L.formatToParts(Number(T)),j=GS(U,v),$=J0(j,tn({},v)),Z=_.slice(-1)===u?u:"",se=T.match(RegExp("\\d+\\.(\\d+)"))||[],ue=se[1];return w===void 0&&ue&&u&&(j.includes(u)?j=j.replace(RegExp("(\\d+)("+yr(u)+")(\\d+)","g"),"$1$2"+ue):$&&!M?j=j.replace($,""+u+ue+$):j=""+j+u+ue),M&&Z?""+j+Z+M:$&&Z?j.replace($,""+Z+$):$&&M?j.replace($,""+Z+M):[j,Z,M].join("")},qS=function(v,_,u){var g=v;return _&&_!=="."&&(g=g.replace(RegExp(yr(_),"g"),"."),u&&_==="-"&&(g="-"+g.slice(1))),g},GS=function(v,_){var u=_.prefix,g=_.groupSeparator,w=_.decimalSeparator,k=_.decimalScale,m=_.disableGroupSeparators,C=m===void 0?!1:m;return v.reduce(function(M,B,T){var L=B.type,U=B.value;return T===0&&u?L==="minusSign"?[U,u]:L==="currency"?Xi(Xi([],M),[u]):[u,U]:L==="currency"?u?M:Xi(Xi([],M),[U]):L==="group"?C?M:Xi(Xi([],M),[g!==void 0?g:U]):L==="decimal"?k!==void 0&&k===0?M:Xi(Xi([],M),[w!==void 0?w:U]):L==="fraction"?Xi(Xi([],M),[k!==void 0?U.slice(0,k):U]):Xi(Xi([],M),[U])},[""]).join("")},QS={currencySymbol:"",groupSeparator:"",decimalSeparator:"",prefix:"",suffix:""},YS=function(v){var _=v||{},u=_.locale,g=_.currency,w=u?new Intl.NumberFormat(u,g?{currency:g,style:"currency"}:void 0):new Intl.NumberFormat;return w.formatToParts(1000.1).reduce(function(k,m,C){return m.type==="currency"?C===0?tn(tn({},k),{currencySymbol:m.value,prefix:m.value}):tn(tn({},k),{currencySymbol:m.value,suffix:m.value}):m.type==="group"?tn(tn({},k),{groupSeparator:m.value}):m.type==="decimal"?tn(tn({},k),{decimalSeparator:m.value}):k},QS)},Yk=function(v){return RegExp(/\d/,"gi").test(v)},JS=function(v,_,u){if(_===void 0&&(_="."),u===void 0||v===""||v===void 0)return v;if(!v.match(/\d/g))return"";var g=v.split(_),w=g[0],k=g[1];if(u===0)return w;var m=k||"";if(m.length<u)for(;m.length<u;)m+="0";else m=m.slice(0,u);return""+w+_+m},ZS=function(v){var _=v.selectionStart,u=v.value,g=v.lastKeyStroke,w=v.stateValue,k=v.groupSeparator,m=_,C=u;if(w&&m){var M=u.split("");return g==="Backspace"&&w[m]===k&&(M.splice(m-1,1),m-=1),g==="Delete"&&w[m]===k&&(M.splice(m,1),m+=1),C=M.join(""),{modifiedValue:C,cursorPosition:m}}return{modifiedValue:C,cursorPosition:_}},Z0=J.forwardRef(function(v,_){var u=v.allowDecimals,g=u===void 0?!0:u,w=v.allowNegativeValue,k=w===void 0?!0:w,m=v.id,C=v.name,M=v.className,B=v.customInput,T=v.decimalsLimit,L=v.defaultValue,U=v.disabled,j=U===void 0?!1:U,$=v.maxLength,Z=v.value,se=v.onValueChange,ue=v.fixedDecimalLength,le=v.placeholder,G=v.decimalScale,ne=v.prefix,ie=v.suffix,me=v.intlConfig,pe=v.step,De=v.min,Ie=v.max,Me=v.disableGroupSeparators,Ue=Me===void 0?!1:Me,te=v.disableAbbreviations,ce=te===void 0?!1:te,be=v.decimalSeparator,ke=v.groupSeparator,Ne=v.onChange,xe=v.onFocus,Le=v.onBlur,Fe=v.onKeyDown,Ye=v.onKeyUp,Ve=v.transformRawValue,yt=BS(v,["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"]);if(be&&Yk(be))throw new Error("decimalSeparator cannot be a number");if(ke&&Yk(ke))throw new Error("groupSeparator cannot be a number");var Se=J.useMemo(function(){return YS(me)},[me]),We=be||Se.decimalSeparator||"",Oe=ke||Se.groupSeparator||"";if(We&&Oe&&We===Oe&&Ue===!1)throw new Error("decimalSeparator cannot be the same as groupSeparator");var He={decimalSeparator:We,groupSeparator:Oe,disableGroupSeparators:Ue,intlConfig:me,prefix:ne||Se.prefix,suffix:ie},ht={decimalSeparator:We,groupSeparator:Oe,allowDecimals:g,decimalsLimit:T||ue||2,allowNegativeValue:k,disableAbbreviations:ce,prefix:ne||Se.prefix,transformRawValue:Ve},ot=L!=null?lh(tn(tn({},He),{decimalScale:G,value:String(L)})):Z!=null?lh(tn(tn({},He),{decimalScale:G,value:String(Z)})):"",tt=J.useState(ot),$e=tt[0],Je=tt[1],qt=J.useState(!1),Qt=qt[0],we=qt[1],Ae=J.useState(0),lt=Ae[0],rt=Ae[1],Nt=J.useState(0),wn=Nt[0],rn=Nt[1],Mt=J.useState(null),Fi=Mt[0],Zo=Mt[1],fn=_||J.useRef(null),no=function(ft,Yt){we(!0);var un=ZS({selectionStart:Yt,value:ft,lastKeyStroke:Fi,stateValue:$e,groupSeparator:Oe}),pn=un.modifiedValue,Cn=un.cursorPosition,Sn=Fv(tn({value:pn},ht));if(!($&&Sn.replace(/-/g,"").length>$)){if(Sn===""||Sn==="-"||Sn===We){se&&se(void 0,C,{float:null,formatted:"",value:""}),Je(Sn);return}var sn=parseFloat(Sn.replace(We,".")),Ei=lh(tn({value:Sn},He));if(Cn!=null){var xt=Cn+(Ei.length-ft.length);xt=xt<=0?ne?ne.length:0:xt,rt(xt),rn(wn+1)}if(Je(Ei),se){var oo={float:sn,formatted:Ei,value:Sn};se(Sn,C,oo)}}},Ks=function(ft){var Yt=ft.target,un=Yt.value,pn=Yt.selectionStart;no(un,pn),Ne&&Ne(ft)},io=function(ft){return xe&&xe(ft),$e?$e.length:0},ui=function(ft){var Yt=ft.target.value,un=Fv(tn({value:Yt},ht));if(un==="-"||!un){Je(""),Le&&Le(ft);return}var pn=KS(un,We,ue),Cn=JS(pn,We,G!==void 0?G:ue),Sn=parseFloat(Cn.replace(We,".")),sn=lh(tn(tn({},He),{value:Cn}));se&&se(Cn,C,{float:Sn,formatted:sn,value:Cn}),Je(sn),Le&&Le(ft)},xr=function(ft){var Yt=ft.key;if(Zo(Yt),pe&&(Yt==="ArrowUp"||Yt==="ArrowDown")){ft.preventDefault(),rt($e.length);var un=parseFloat(Z!=null?String(Z).replace(We,"."):Fv(tn({value:$e},ht)))||0,pn=Yt==="ArrowUp"?un+pe:un-pe;if(De!==void 0&&pn<De||Ie!==void 0&&pn>Ie)return;var Cn=String(pe).includes(".")?Number(String(pe).split(".")[1].length):void 0;no(String(Cn?pn.toFixed(Cn):pn).replace(".",We))}Fe&&Fe(ft)},Po=function(ft){var Yt=ft.key,un=ft.currentTarget.selectionStart;if(Yt!=="ArrowUp"&&Yt!=="ArrowDown"&&$e!=="-"){var pn=J0($e,{groupSeparator:Oe,decimalSeparator:We});if(pn&&un&&un>$e.length-pn.length&&fn&&typeof fn=="object"&&fn.current){var Cn=$e.length-pn.length;fn.current.setSelectionRange(Cn,Cn)}}Ye&&Ye(ft)};J.useEffect(function(){Qt&&$e!=="-"&&fn&&typeof fn=="object"&&fn.current&&fn.current.setSelectionRange(lt,lt)},[$e,lt,fn,Qt,wn]);var Cr=function(){return Z!=null&&$e!=="-"&&(!We||$e!==We)?lh(tn(tn({},He),{decimalScale:Qt?void 0:G,value:String(Z)})):$e},Io=tn({type:"text",inputMode:"decimal",id:m,name:C,className:M,onChange:Ks,onBlur:ui,onFocus:io,onKeyDown:xr,onKeyUp:Po,placeholder:le,disabled:j,value:Cr(),ref:fn},yt);if(B){var di=B;return kr.createElement(di,tn({},Io))}return kr.createElement("input",tn({},Io))});Z0.displayName="CurrencyInput";var X0={},jw={},Rw={},fu={};Object.defineProperty(fu,"__esModule",{value:!0});fu.Direction=void 0;var Jk;(function(v){v.Right="to right",v.Left="to left",v.Down="to bottom",v.Up="to top"})(Jk||(fu.Direction=Jk={}));(function(v){var _=on&&on.__spreadArray||function(te,ce,be){if(be||arguments.length===2)for(var ke=0,Ne=ce.length,xe;ke<Ne;ke++)(xe||!(ke in ce))&&(xe||(xe=Array.prototype.slice.call(ce,0,ke)),xe[ke]=ce[ke]);return te.concat(xe||Array.prototype.slice.call(ce))};Object.defineProperty(v,"__esModule",{value:!0}),v.isIOS=v.useThumbOverlap=v.assertUnreachable=v.voidFn=v.getTrackBackground=v.replaceAt=v.schd=v.translate=v.getClosestThumbIndex=v.translateThumbs=v.getPaddingAndBorder=v.getMargin=v.checkInitialOverlap=v.checkValuesAgainstBoundaries=v.checkBoundaries=v.isVertical=v.relativeValue=v.normalizeValue=v.isStepDivisible=v.isTouchEvent=v.getStepDecimals=void 0;var u=J,g=fu,w=function(te){var ce=te.toString().split(".")[1];return ce?ce.length:0};v.getStepDecimals=w;function k(te){return te.touches&&te.touches.length||te.changedTouches&&te.changedTouches.length}v.isTouchEvent=k;function m(te,ce,be){var ke=(ce-te)/be,Ne=8,xe=Number(ke.toFixed(Ne));return parseInt(xe.toString(),10)===xe}v.isStepDivisible=m;function C(te,ce,be,ke,Ne,xe,Le){var Fe=1e11;if(te=Math.round(te*Fe)/Fe,!xe){var Ye=Le[ce-1],Ve=Le[ce+1];if(Ye&&Ye>te)return Ye;if(Ve&&Ve<te)return Ve}if(te>ke)return ke;if(te<be)return be;var yt=Math.floor(te*Fe-be*Fe)%Math.floor(Ne*Fe),Se=Math.floor(te*Fe-Math.abs(yt)),We=yt===0?te:Se/Fe,Oe=Math.abs(yt/Fe)<Ne/2?We:We+Ne,He=(0,v.getStepDecimals)(Ne);return parseFloat(Oe.toFixed(He))}v.normalizeValue=C;function M(te,ce,be){return(te-ce)/(be-ce)}v.relativeValue=M;function B(te){return te===g.Direction.Up||te===g.Direction.Down}v.isVertical=B;function T(te,ce,be){if(ce>=be)throw new RangeError("min (".concat(ce,") is equal/bigger than max (").concat(be,")"));if(te<ce)throw new RangeError("value (".concat(te,") is smaller than min (").concat(ce,")"));if(te>be)throw new RangeError("value (".concat(te,") is bigger than max (").concat(be,")"))}v.checkBoundaries=T;function L(te,ce,be){return te<ce?ce:te>be?be:te}v.checkValuesAgainstBoundaries=L;function U(te){if(!(te.length<2)&&!te.slice(1).every(function(ce,be){return te[be]<=ce}))throw new RangeError("values={[".concat(te,"]} needs to be sorted when allowOverlap={false}"))}v.checkInitialOverlap=U;function j(te){var ce=window.getComputedStyle(te);return{top:parseInt(ce["margin-top"],10),bottom:parseInt(ce["margin-bottom"],10),left:parseInt(ce["margin-left"],10),right:parseInt(ce["margin-right"],10)}}v.getMargin=j;function $(te){var ce=window.getComputedStyle(te);return{top:parseInt(ce["padding-top"],10)+parseInt(ce["border-top-width"],10),bottom:parseInt(ce["padding-bottom"],10)+parseInt(ce["border-bottom-width"],10),left:parseInt(ce["padding-left"],10)+parseInt(ce["border-left-width"],10),right:parseInt(ce["padding-right"],10)+parseInt(ce["border-right-width"],10)}}v.getPaddingAndBorder=$;function Z(te,ce,be){var ke=be?-1:1;te.forEach(function(Ne,xe){return ue(Ne,ke*ce[xe].x,ce[xe].y)})}v.translateThumbs=Z;function se(te,ce,be,ke){for(var Ne=0,xe=Me(te[0],ce,be,ke),Le=1;Le<te.length;Le++){var Fe=Me(te[Le],ce,be,ke);Fe<xe&&(xe=Fe,Ne=Le)}return Ne}v.getClosestThumbIndex=se;function ue(te,ce,be){te.style.transform="translate(".concat(ce,"px, ").concat(be,"px)")}v.translate=ue;var le=function(te){var ce=[],be=null,ke=function(){for(var Ne=[],xe=0;xe<arguments.length;xe++)Ne[xe]=arguments[xe];ce=Ne,!be&&(be=requestAnimationFrame(function(){be=null,te.apply(void 0,ce)}))};return ke};v.schd=le;function G(te,ce,be){var ke=te.slice(0);return ke[ce]=be,ke}v.replaceAt=G;function ne(te){var ce=te.values,be=te.colors,ke=te.min,Ne=te.max,xe=te.direction,Le=xe===void 0?g.Direction.Right:xe,Fe=te.rtl,Ye=Fe===void 0?!1:Fe;Ye&&Le===g.Direction.Right?Le=g.Direction.Left:Ye&&g.Direction.Left&&(Le=g.Direction.Right);var Ve=ce.slice(0).sort(function(Se,We){return Se-We}).map(function(Se){return(Se-ke)/(Ne-ke)*100}),yt=Ve.reduce(function(Se,We,Oe){return"".concat(Se,", ").concat(be[Oe]," ").concat(We,"%, ").concat(be[Oe+1]," ").concat(We,"%")},"");return"linear-gradient(".concat(Le,", ").concat(be[0]," 0%").concat(yt,", ").concat(be[be.length-1]," 100%)")}v.getTrackBackground=ne;function ie(){}v.voidFn=ie;function me(te){throw new Error("Didn't expect to get here")}v.assertUnreachable=me;var pe=function(te,ce,be,ke,Ne){Ne===void 0&&(Ne=function(Le){return Le});var xe=Math.ceil(_([te],Array.from(te.children),!0).reduce(function(Le,Fe){var Ye=Math.ceil(Fe.getBoundingClientRect().width);if(Fe.innerText&&Fe.innerText.includes(be)&&Fe.childElementCount===0){var Ve=Fe.cloneNode(!0);Ve.innerHTML=Ne(ce.toFixed(ke)),Ve.style.visibility="hidden",document.body.appendChild(Ve),Ye=Math.ceil(Ve.getBoundingClientRect().width),document.body.removeChild(Ve)}return Ye>Le?Ye:Le},te.getBoundingClientRect().width));return xe},De=function(te,ce,be,ke,Ne,xe,Le){Le===void 0&&(Le=function(Ve){return Ve});var Fe=[],Ye=function(Ve){var yt=pe(be[Ve],ke[Ve],Ne,xe,Le),Se=ce[Ve].x;ce.forEach(function(We,Oe){var He=We.x,ht=pe(be[Oe],ke[Oe],Ne,xe,Le);Ve!==Oe&&(Se>=He&&Se<=He+ht||Se+yt>=He&&Se+yt<=He+ht)&&(Fe.includes(Oe)||(Fe.push(Ve),Fe.push(Oe),Fe=_(_([],Fe,!0),[Ve,Oe],!1),Ye(Oe)))})};return Ye(te),Array.from(new Set(Fe.sort()))},Ie=function(te,ce,be,ke,Ne,xe){ke===void 0&&(ke=.1),Ne===void 0&&(Ne=" - "),xe===void 0&&(xe=function(Oe){return Oe});var Le=(0,v.getStepDecimals)(ke),Fe=(0,u.useState)({}),Ye=Fe[0],Ve=Fe[1],yt=(0,u.useState)(xe(ce[be].toFixed(Le))),Se=yt[0],We=yt[1];return(0,u.useEffect)(function(){if(te){var Oe=te.getThumbs();if(Oe.length<1)return;var He={},ht=te.getOffsets(),ot=De(be,ht,Oe,ce,Ne,Le,xe),tt=xe(ce[be].toFixed(Le));if(ot.length){var $e=ot.reduce(function(Ae,lt,rt,Nt){return Ae.length?_(_([],Ae,!0),[ht[Nt[rt]].x],!1):[ht[Nt[rt]].x]},[]);if(Math.min.apply(Math,$e)===ht[be].x){var Je=[];ot.forEach(function(Ae){Je.push(ce[Ae].toFixed(Le))}),tt=Array.from(new Set(Je.sort(function(Ae,lt){return parseFloat(Ae)-parseFloat(lt)}))).map(xe).join(Ne);var qt=Math.min.apply(Math,$e),Qt=Math.max.apply(Math,$e),we=Oe[ot[$e.indexOf(Qt)]].getBoundingClientRect().width;He.left="".concat(Math.abs(qt-(Qt+we))/2,"px"),He.transform="translate(-50%, 0)"}else He.visibility="hidden"}We(tt),Ve(He)}},[te,ce]),[Se,Ye]};v.useThumbOverlap=Ie;function Me(te,ce,be,ke){var Ne=te.getBoundingClientRect(),xe=Ne.left,Le=Ne.top,Fe=Ne.width,Ye=Ne.height;return B(ke)?Math.abs(be-(Le+Ye/2)):Math.abs(ce-(xe+Fe/2))}var Ue=function(){var te,ce=((te=navigator.userAgentData)===null||te===void 0?void 0:te.platform)||navigator.platform;return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(ce)||navigator.userAgent.includes("Mac")&&"ontouchend"in document};v.isIOS=Ue})(Rw);var XS=on&&on.__extends||function(){var v=function(_,u){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,w){g.__proto__=w}||function(g,w){for(var k in w)Object.prototype.hasOwnProperty.call(w,k)&&(g[k]=w[k])},v(_,u)};return function(_,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");v(_,u);function g(){this.constructor=_}_.prototype=u===null?Object.create(u):(g.prototype=u.prototype,new g)}}(),eA=on&&on.__createBinding||(Object.create?function(v,_,u,g){g===void 0&&(g=u);var w=Object.getOwnPropertyDescriptor(_,u);(!w||("get"in w?!_.__esModule:w.writable||w.configurable))&&(w={enumerable:!0,get:function(){return _[u]}}),Object.defineProperty(v,g,w)}:function(v,_,u,g){g===void 0&&(g=u),v[g]=_[u]}),tA=on&&on.__setModuleDefault||(Object.create?function(v,_){Object.defineProperty(v,"default",{enumerable:!0,value:_})}:function(v,_){v.default=_}),nA=on&&on.__importStar||function(v){if(v&&v.__esModule)return v;var _={};if(v!=null)for(var u in v)u!=="default"&&Object.prototype.hasOwnProperty.call(v,u)&&eA(_,v,u);return tA(_,v),_},Zk=on&&on.__spreadArray||function(v,_,u){if(u||arguments.length===2)for(var g=0,w=_.length,k;g<w;g++)(k||!(g in _))&&(k||(k=Array.prototype.slice.call(_,0,g)),k[g]=_[g]);return v.concat(k||Array.prototype.slice.call(_))};Object.defineProperty(jw,"__esModule",{value:!0});var ag=nA(J),At=Rw,Ln=fu,iA=["ArrowRight","ArrowUp","k","PageUp"],oA=["ArrowLeft","ArrowDown","j","PageDown"],rA=function(v){XS(_,v);function _(u){var g=v.call(this,u)||this;if(g.trackRef=ag.createRef(),g.thumbRefs=[],g.state={draggedTrackPos:[-1,-1],draggedThumbIndex:-1,thumbZIndexes:new Array(g.props.values.length).fill(0).map(function(w,k){return k}),isChanged:!1,markOffsets:[]},g.getOffsets=function(){var w=g.props,k=w.direction,m=w.values,C=w.min,M=w.max,B=g.trackRef.current;if(!B)return console.warn("No track element found."),[];var T=B.getBoundingClientRect(),L=(0,At.getPaddingAndBorder)(B);return g.getThumbs().map(function(U,j){var $={x:0,y:0},Z=U.getBoundingClientRect(),se=(0,At.getMargin)(U);switch(k){case Ln.Direction.Right:return $.x=(se.left+L.left)*-1,$.y=((Z.height-T.height)/2+L.top)*-1,$.x+=T.width*(0,At.relativeValue)(m[j],C,M)-Z.width/2,$;case Ln.Direction.Left:return $.x=(se.right+L.right)*-1,$.y=((Z.height-T.height)/2+L.top)*-1,$.x+=T.width-T.width*(0,At.relativeValue)(m[j],C,M)-Z.width/2,$;case Ln.Direction.Up:return $.x=((Z.width-T.width)/2+se.left+L.left)*-1,$.y=-L.left,$.y+=T.height-T.height*(0,At.relativeValue)(m[j],C,M)-Z.height/2,$;case Ln.Direction.Down:return $.x=((Z.width-T.width)/2+se.left+L.left)*-1,$.y=-L.left,$.y+=T.height*(0,At.relativeValue)(m[j],C,M)-Z.height/2,$;default:return(0,At.assertUnreachable)(k)}})},g.getThumbs=function(){return g.trackRef&&g.trackRef.current?Array.from(g.trackRef.current.children).filter(function(w){return w.hasAttribute("aria-valuenow")}):(console.warn("No thumbs found in the track container. Did you forget to pass & spread the `props` param in renderTrack?"),[])},g.getTargetIndex=function(w){return g.getThumbs().findIndex(function(k){return k===w.target||k.contains(w.target)})},g.addTouchEvents=function(w){document.addEventListener("touchmove",g.schdOnTouchMove,{passive:!1}),document.addEventListener("touchend",g.schdOnEnd,{passive:!1}),document.addEventListener("touchcancel",g.schdOnEnd,{passive:!1})},g.addMouseEvents=function(w){document.addEventListener("mousemove",g.schdOnMouseMove),document.addEventListener("mouseup",g.schdOnEnd)},g.onMouseDownTrack=function(w){var k;if(!(w.button!==0||(0,At.isIOS)()))if(w.persist(),w.preventDefault(),g.addMouseEvents(w.nativeEvent),g.props.values.length>1&&g.props.draggableTrack){if(g.thumbRefs.some(function(C){var M;return(M=C.current)===null||M===void 0?void 0:M.contains(w.target)}))return;g.setState({draggedTrackPos:[w.clientX,w.clientY]},function(){return g.onMove(w.clientX,w.clientY)})}else{var m=(0,At.getClosestThumbIndex)(g.thumbRefs.map(function(C){return C.current}),w.clientX,w.clientY,g.props.direction);(k=g.thumbRefs[m].current)===null||k===void 0||k.focus(),g.setState({draggedThumbIndex:m},function(){return g.onMove(w.clientX,w.clientY)})}},g.onResize=function(){(0,At.translateThumbs)(g.getThumbs(),g.getOffsets(),g.props.rtl),g.calculateMarkOffsets()},g.onTouchStartTrack=function(w){var k;if(w.persist(),g.addTouchEvents(w.nativeEvent),g.props.values.length>1&&g.props.draggableTrack){if(g.thumbRefs.some(function(C){var M;return(M=C.current)===null||M===void 0?void 0:M.contains(w.target)}))return;g.setState({draggedTrackPos:[w.touches[0].clientX,w.touches[0].clientY]},function(){return g.onMove(w.touches[0].clientX,w.touches[0].clientY)})}else{var m=(0,At.getClosestThumbIndex)(g.thumbRefs.map(function(C){return C.current}),w.touches[0].clientX,w.touches[0].clientY,g.props.direction);(k=g.thumbRefs[m].current)===null||k===void 0||k.focus(),g.setState({draggedThumbIndex:m},function(){return g.onMove(w.touches[0].clientX,w.touches[0].clientY)})}},g.onMouseOrTouchStart=function(w){if(!g.props.disabled){var k=(0,At.isTouchEvent)(w);if(!(!k&&w.button!==0)){var m=g.getTargetIndex(w);m!==-1&&(k?g.addTouchEvents(w):g.addMouseEvents(w),g.setState({draggedThumbIndex:m,thumbZIndexes:g.state.thumbZIndexes.map(function(C,M){return M===m?Math.max.apply(Math,g.state.thumbZIndexes):C<=g.state.thumbZIndexes[m]?C:C-1})}))}}},g.onMouseMove=function(w){w.preventDefault(),g.onMove(w.clientX,w.clientY)},g.onTouchMove=function(w){w.preventDefault(),g.onMove(w.touches[0].clientX,w.touches[0].clientY)},g.onKeyDown=function(w){var k=g.props,m=k.values,C=k.onChange,M=k.step,B=k.rtl,T=k.direction,L=g.state.isChanged,U=g.getTargetIndex(w.nativeEvent),j=B||T===Ln.Direction.Left||T===Ln.Direction.Down?-1:1;U!==-1&&(iA.includes(w.key)?(w.preventDefault(),g.setState({draggedThumbIndex:U,isChanged:!0}),C((0,At.replaceAt)(m,U,g.normalizeValue(m[U]+j*(w.key==="PageUp"?M*10:M),U)))):oA.includes(w.key)?(w.preventDefault(),g.setState({draggedThumbIndex:U,isChanged:!0}),C((0,At.replaceAt)(m,U,g.normalizeValue(m[U]-j*(w.key==="PageDown"?M*10:M),U)))):w.key==="Tab"?g.setState({draggedThumbIndex:-1},function(){L&&g.fireOnFinalChange()}):L&&g.fireOnFinalChange())},g.onKeyUp=function(w){var k=g.state.isChanged;g.setState({draggedThumbIndex:-1},function(){k&&g.fireOnFinalChange()})},g.onMove=function(w,k){var m=g.state,C=m.draggedThumbIndex,M=m.draggedTrackPos,B=g.props,T=B.direction,L=B.min,U=B.max,j=B.onChange,$=B.values,Z=B.step,se=B.rtl;if(C===-1&&M[0]===-1&&M[1]===-1)return null;var ue=g.trackRef.current;if(!ue)return null;var le=ue.getBoundingClientRect(),G=(0,At.isVertical)(T)?le.height:le.width;if(M[0]!==-1&&M[1]!==-1){var ne=w-M[0],ie=k-M[1],me=0;switch(T){case Ln.Direction.Right:case Ln.Direction.Left:me=ne/G*(U-L);break;case Ln.Direction.Down:case Ln.Direction.Up:me=ie/G*(U-L);break;default:(0,At.assertUnreachable)(T)}if(se&&(me*=-1),Math.abs(me)>=Z/2){for(var pe=0;pe<g.thumbRefs.length;pe++){if($[pe]===U&&Math.sign(me)===1||$[pe]===L&&Math.sign(me)===-1)return;var De=$[pe]+me;De>U?me=U-$[pe]:De<L&&(me=L-$[pe])}for(var Ie=$.slice(0),pe=0;pe<g.thumbRefs.length;pe++)Ie=(0,At.replaceAt)(Ie,pe,g.normalizeValue($[pe]+me,pe));g.setState({draggedTrackPos:[w,k]}),j(Ie)}}else{var Me=0;switch(T){case Ln.Direction.Right:Me=(w-le.left)/G*(U-L)+L;break;case Ln.Direction.Left:Me=(G-(w-le.left))/G*(U-L)+L;break;case Ln.Direction.Down:Me=(k-le.top)/G*(U-L)+L;break;case Ln.Direction.Up:Me=(G-(k-le.top))/G*(U-L)+L;break;default:(0,At.assertUnreachable)(T)}se&&(Me=U+L-Me),Math.abs($[C]-Me)>=Z/2&&j((0,At.replaceAt)($,C,g.normalizeValue(Me,C)))}},g.normalizeValue=function(w,k){var m=g.props,C=m.min,M=m.max,B=m.step,T=m.allowOverlap,L=m.values;return(0,At.normalizeValue)(w,k,C,M,B,T,L)},g.onEnd=function(w){if(w.preventDefault(),document.removeEventListener("mousemove",g.schdOnMouseMove),document.removeEventListener("touchmove",g.schdOnTouchMove),document.removeEventListener("mouseup",g.schdOnEnd),document.removeEventListener("touchend",g.schdOnEnd),document.removeEventListener("touchcancel",g.schdOnEnd),g.state.draggedThumbIndex===-1&&g.state.draggedTrackPos[0]===-1&&g.state.draggedTrackPos[1]===-1)return null;g.setState({draggedThumbIndex:-1,draggedTrackPos:[-1,-1]},function(){g.fireOnFinalChange()})},g.fireOnFinalChange=function(){g.setState({isChanged:!1});var w=g.props,k=w.onFinalChange,m=w.values;k&&k(m)},g.updateMarkRefs=function(w){if(!w.renderMark){g.numOfMarks=void 0,g.markRefs=void 0;return}g.numOfMarks=(w.max-w.min)/g.props.step,g.markRefs=[];for(var k=0;k<g.numOfMarks+1;k++)g.markRefs[k]=ag.createRef()},g.calculateMarkOffsets=function(){if(!(!g.props.renderMark||!g.trackRef||!g.numOfMarks||!g.markRefs||g.trackRef.current===null)){for(var w=window.getComputedStyle(g.trackRef.current),k=parseInt(w.width,10),m=parseInt(w.height,10),C=parseInt(w.paddingLeft,10),M=parseInt(w.paddingTop,10),B=[],T=0;T<g.numOfMarks+1;T++){var L=9999,U=9999;if(g.markRefs[T].current){var j=g.markRefs[T].current.getBoundingClientRect();L=j.height,U=j.width}g.props.direction===Ln.Direction.Left||g.props.direction===Ln.Direction.Right?B.push([Math.round(k/g.numOfMarks*T+C-U/2),-Math.round((L-m)/2)]):B.push([Math.round(m/g.numOfMarks*T+M-L/2),-Math.round((U-k)/2)])}g.setState({markOffsets:B})}},u.step===0)throw new Error('"step" property should be a positive number');return g.schdOnMouseMove=(0,At.schd)(g.onMouseMove),g.schdOnTouchMove=(0,At.schd)(g.onTouchMove),g.schdOnEnd=(0,At.schd)(g.onEnd),g.thumbRefs=u.values.map(function(){return ag.createRef()}),g.updateMarkRefs(u),g}return _.prototype.componentDidMount=function(){var u=this,g=this.props,w=g.values,k=g.min,m=g.step;this.resizeObserver=window.ResizeObserver?new window.ResizeObserver(this.onResize):{observe:function(){return window.addEventListener("resize",u.onResize)},unobserve:function(){return window.removeEventListener("resize",u.onResize)}},document.addEventListener("touchstart",this.onMouseOrTouchStart,{passive:!1}),document.addEventListener("mousedown",this.onMouseOrTouchStart,{passive:!1}),!this.props.allowOverlap&&(0,At.checkInitialOverlap)(this.props.values),this.props.values.forEach(function(C){return(0,At.checkBoundaries)(C,u.props.min,u.props.max)}),this.resizeObserver.observe(this.trackRef.current),(0,At.translateThumbs)(this.getThumbs(),this.getOffsets(),this.props.rtl),this.calculateMarkOffsets(),w.forEach(function(C){(0,At.isStepDivisible)(k,C,m)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")})},_.prototype.componentDidUpdate=function(u,g){var w=this.props,k=w.max,m=w.min,C=w.step,M=w.values,B=w.rtl;(u.max!==k||u.min!==m||u.step!==C)&&this.updateMarkRefs(this.props),(0,At.translateThumbs)(this.getThumbs(),this.getOffsets(),B),(u.max!==k||u.min!==m||u.step!==C||g.markOffsets.length!==this.state.markOffsets.length)&&(this.calculateMarkOffsets(),M.forEach(function(T){(0,At.isStepDivisible)(m,T,C)||console.warn("The `values` property is in conflict with the current `step`, `min`, and `max` properties. Please provide values that are accessible using the min, max, and step values.")}))},_.prototype.componentWillUnmount=function(){var u={passive:!1};document.removeEventListener("mousedown",this.onMouseOrTouchStart,u),document.removeEventListener("mousemove",this.schdOnMouseMove),document.removeEventListener("touchmove",this.schdOnTouchMove),document.removeEventListener("touchstart",this.onMouseOrTouchStart),document.removeEventListener("mouseup",this.schdOnEnd),document.removeEventListener("touchend",this.schdOnEnd),this.resizeObserver.unobserve(this.trackRef.current)},_.prototype.render=function(){var u=this,g=this.props,w=g.label,k=g.labelledBy,m=g.renderTrack,C=g.renderThumb,M=g.renderMark,B=M===void 0?function(){return null}:M,T=g.values,L=g.min,U=g.max,j=g.allowOverlap,$=g.disabled,Z=this.state,se=Z.draggedThumbIndex,ue=Z.thumbZIndexes,le=Z.markOffsets;return m({props:{style:{transform:"scale(1)",cursor:se>-1?"grabbing":this.props.draggableTrack?(0,At.isVertical)(this.props.direction)?"ns-resize":"ew-resize":T.length===1&&!$?"pointer":"inherit"},onMouseDown:$?At.voidFn:this.onMouseDownTrack,onTouchStart:$?At.voidFn:this.onTouchStartTrack,ref:this.trackRef},isDragged:this.state.draggedThumbIndex>-1,disabled:$,children:Zk(Zk([],le.map(function(G,ne,ie){return B({props:{style:u.props.direction===Ln.Direction.Left||u.props.direction===Ln.Direction.Right?{position:"absolute",left:"".concat(G[0],"px"),marginTop:"".concat(G[1],"px")}:{position:"absolute",top:"".concat(G[0],"px"),marginLeft:"".concat(G[1],"px")},key:"mark".concat(ne),ref:u.markRefs[ne]},index:ne})}),!0),T.map(function(G,ne){var ie=u.state.draggedThumbIndex===ne;return C({index:ne,value:G,isDragged:ie,props:{style:{position:"absolute",zIndex:ue[ne],cursor:$?"inherit":ie?"grabbing":"grab",userSelect:"none",touchAction:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},key:ne,tabIndex:$?void 0:0,"aria-valuemax":j?U:T[ne+1]||U,"aria-valuemin":j?L:T[ne-1]||L,"aria-valuenow":G,draggable:!1,ref:u.thumbRefs[ne],"aria-label":w,"aria-labelledby":k,role:"slider",onKeyDown:$?At.voidFn:u.onKeyDown,onKeyUp:$?At.voidFn:u.onKeyUp}})}),!0)})},_.defaultProps={label:"Accessibility label",labelledBy:null,step:1,direction:Ln.Direction.Right,rtl:!1,disabled:!1,allowOverlap:!1,draggableTrack:!1,min:0,max:100},_}(ag.Component);jw.default=rA;(function(v){var _=on&&on.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};Object.defineProperty(v,"__esModule",{value:!0}),v.checkValuesAgainstBoundaries=v.relativeValue=v.useThumbOverlap=v.Direction=v.getTrackBackground=v.Range=void 0;var u=_(jw);v.Range=u.default;var g=Rw;Object.defineProperty(v,"getTrackBackground",{enumerable:!0,get:function(){return g.getTrackBackground}}),Object.defineProperty(v,"useThumbOverlap",{enumerable:!0,get:function(){return g.useThumbOverlap}}),Object.defineProperty(v,"relativeValue",{enumerable:!0,get:function(){return g.relativeValue}}),Object.defineProperty(v,"checkValuesAgainstBoundaries",{enumerable:!0,get:function(){return g.checkValuesAgainstBoundaries}});var w=fu;Object.defineProperty(v,"Direction",{enumerable:!0,get:function(){return w.Direction}})})(X0);const sA=1,Xk=15,e0=100;function aA({values:v,colors:_,min:u,max:g,direction:w="to right",rtl:k=!1}){k&&w==="to right"?w="to left":k&&(w="to right");const C=v.slice(0).sort((M,B)=>M-B).map(M=>(M-u)/(g-u)*100).reduce((M,B,T)=>`${M}, ${_[T]} ${B}%, ${_[T+1]} ${B}%`,"");return`linear-gradient(${w}, ${_[0]} 0%${C}, ${_[_.length-1]} 100%)`}const lA=({rtl:v,value:_,onChange:u})=>{const[g,w]=J.useState([15,15]);return J.useEffect(()=>{_&&w(_)},[_]),V.jsxDEV("div",{style:{display:"flex",justifyContent:"center",flexWrap:"wrap"},children:V.jsxDEV(X0.Range,{values:g,step:sA,min:Xk,max:e0,rtl:v,onChange:k=>u(k),renderTrack:({props:k,children:m})=>V.jsxDEV("div",{onMouseDown:k.onMouseDown,onTouchStart:k.onTouchStart,style:{...k.style,height:"36px",display:"flex",width:"100%"},children:V.jsxDEV("div",{ref:k.ref,style:{height:"5px",width:"100%",borderRadius:"4px",background:aA({values:g,colors:["#ccc","#548BF4","#ccc"],min:Xk,max:e0,rtl:v}),alignSelf:"center"},children:m},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Ranger/index.jsx",lineNumber:57,columnNumber:13},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Ranger/index.jsx",lineNumber:47,columnNumber:11},globalThis),renderThumb:({index:k,props:m,isDragged:C})=>V.jsxDEV("div",{...m,style:{...m.style,height:"1.5rem",width:"1.5rem",borderRadius:"4px",backgroundColor:"#FFF",display:"flex",justifyContent:"center",alignItems:"center",boxShadow:"0px 2px 6px #AAA"},children:[V.jsxDEV("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:g[k]},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Ranger/index.jsx",lineNumber:92,columnNumber:13},globalThis),V.jsxDEV("div",{style:{height:"16px",width:"5px",backgroundColor:C?"#548BF4":"#CCC"}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Ranger/index.jsx",lineNumber:108,columnNumber:13},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Ranger/index.jsx",lineNumber:78,columnNumber:11},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Ranger/index.jsx",lineNumber:39,columnNumber:7},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Ranger/index.jsx",lineNumber:32,columnNumber:5},globalThis)};var gg={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 */gg.exports;(function(v,_){(function(){var u,g="4.17.21",w=200,k="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",m="Expected a function",C="Invalid `variable` option passed into `_.template`",M="__lodash_hash_undefined__",B=500,T="__lodash_placeholder__",L=1,U=2,j=4,$=1,Z=2,se=1,ue=2,le=4,G=8,ne=16,ie=32,me=64,pe=128,De=256,Ie=512,Me=30,Ue="...",te=800,ce=16,be=1,ke=2,Ne=3,xe=1/0,Le=9007199254740991,Fe=17976931348623157e292,Ye=0/0,Ve=4294967295,yt=Ve-1,Se=Ve>>>1,We=[["ary",pe],["bind",se],["bindKey",ue],["curry",G],["curryRight",ne],["flip",Ie],["partial",ie],["partialRight",me],["rearg",De]],Oe="[object Arguments]",He="[object Array]",ht="[object AsyncFunction]",ot="[object Boolean]",tt="[object Date]",$e="[object DOMException]",Je="[object Error]",qt="[object Function]",Qt="[object GeneratorFunction]",we="[object Map]",Ae="[object Number]",lt="[object Null]",rt="[object Object]",Nt="[object Promise]",wn="[object Proxy]",rn="[object RegExp]",Mt="[object Set]",Fi="[object String]",Zo="[object Symbol]",fn="[object Undefined]",no="[object WeakMap]",Ks="[object WeakSet]",io="[object ArrayBuffer]",ui="[object DataView]",xr="[object Float32Array]",Po="[object Float64Array]",Cr="[object Int8Array]",Io="[object Int16Array]",di="[object Int32Array]",ft="[object Uint8Array]",Yt="[object Uint8ClampedArray]",un="[object Uint16Array]",pn="[object Uint32Array]",Cn=/\b__p \+= '';/g,Sn=/\b(__p \+=) '' \+/g,sn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ei=/&(?:amp|lt|gt|quot|#39);/g,xt=/[&<>"']/g,oo=RegExp(Ei.source),rs=RegExp(xt.source),Xo=/<%-([\s\S]+?)%>/g,kl=/<%([\s\S]+?)%>/g,Mo=/<%=([\s\S]+?)%>/g,pu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yl=/^\w*$/,gu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Tr=/[\\^$.*+?()[\]{}|]/g,er=RegExp(Tr.source),qs=/^\s+/,mu=/\s/,hi=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Er=/\{\n\/\* \[wrapped with (.+)\] \*/,ss=/,? & /,Sr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ar=/[()=,{}\[\]\/\s]/,tr=/\\(\\)?/g,Gs=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Do=/\w*$/,$t=/^[-+]0x[0-9a-f]+$/i,Qs=/^0b[01]+$/i,xl=/^\[object .+?Constructor\]$/,bu=/^0o[0-7]+$/i,Cl=/^(?:0|[1-9]\d*)$/,Tl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ze=/($^)/,ve=/['\n\r\u2028\u2029\\]/g,nr="\\ud800-\\udfff",pt="\\u0300-\\u036f",Ys="\\ufe20-\\ufe2f",Js="\\u20d0-\\u20ff",Zs=pt+Ys+Js,as="\\u2700-\\u27bf",Xs="a-z\\xdf-\\xf6\\xf8-\\xff",Ut="\\xac\\xb1\\xd7\\xf7",El="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ea="\\u2000-\\u206f",Sl=" \\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",_n="A-Z\\xc0-\\xd6\\xd8-\\xde",ls="\\ufe0e\\ufe0f",Si=Ut+El+ea+Sl,cs="['’]",vu="["+nr+"]",Al="["+Si+"]",Nr="["+Zs+"]",Nl="\\d+",ro="["+as+"]",ir="["+Xs+"]",Pl="[^"+nr+Si+Nl+as+Xs+_n+"]",ta="\\ud83c[\\udffb-\\udfff]",wu="(?:"+Nr+"|"+ta+")",na="[^"+nr+"]",Bi="(?:\\ud83c[\\udde6-\\uddff]){2}",Oo="[\\ud800-\\udbff][\\udc00-\\udfff]",or="["+_n+"]",Il="\\u200d",Ml="(?:"+ir+"|"+Pl+")",ia="(?:"+or+"|"+Pl+")",Dl="(?:"+cs+"(?:d|ll|m|re|s|t|ve))?",oa="(?:"+cs+"(?:D|LL|M|RE|S|T|VE))?",ra=wu+"?",so="["+ls+"]?",sa="(?:"+Il+"(?:"+[na,Bi,Oo].join("|")+")"+so+ra+")*",_u="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ku="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Pr=so+ra+sa,Ol="(?:"+[ro,Bi,Oo].join("|")+")"+Pr,yu="(?:"+[na+Nr+"?",Nr,Bi,Oo,vu].join("|")+")",jl=RegExp(cs,"g"),aa=RegExp(Nr,"g"),ao=RegExp(ta+"(?="+ta+")|"+yu+Pr,"g"),Ir=RegExp([or+"?"+ir+"+"+Dl+"(?="+[Al,or,"$"].join("|")+")",ia+"+"+oa+"(?="+[Al,or+Ml,"$"].join("|")+")",or+"?"+Ml+"+"+Dl,or+"+"+oa,ku,_u,Nl,Ol].join("|"),"g"),la=RegExp("["+Il+nr+Zs+ls+"]"),jo=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Mr=["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"],Rl=-1,Wt={};Wt[xr]=Wt[Po]=Wt[Cr]=Wt[Io]=Wt[di]=Wt[ft]=Wt[Yt]=Wt[un]=Wt[pn]=!0,Wt[Oe]=Wt[He]=Wt[io]=Wt[ot]=Wt[ui]=Wt[tt]=Wt[Je]=Wt[qt]=Wt[we]=Wt[Ae]=Wt[rt]=Wt[rn]=Wt[Mt]=Wt[Fi]=Wt[no]=!1;var zt={};zt[Oe]=zt[He]=zt[io]=zt[ui]=zt[ot]=zt[tt]=zt[xr]=zt[Po]=zt[Cr]=zt[Io]=zt[di]=zt[we]=zt[Ae]=zt[rt]=zt[rn]=zt[Mt]=zt[Fi]=zt[Zo]=zt[ft]=zt[Yt]=zt[un]=zt[pn]=!0,zt[Je]=zt[qt]=zt[no]=!1;var ca={À:"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"},Dr={"&":"&","<":"<",">":">",'"':""","'":"'"},ua={"&":"&","<":"<",">":">",""":'"',"'":"'"},da={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ha=parseFloat,fa=parseInt,pa=typeof on=="object"&&on&&on.Object===Object&&on,ga=typeof self=="object"&&self&&self.Object===Object&&self,gn=pa||ga||Function("return this")(),us=_&&!_.nodeType&&_,Hi=us&&!0&&v&&!v.nodeType&&v,Ll=Hi&&Hi.exports===us,ds=Ll&&pa.process,Un=function(){try{var K=Hi&&Hi.require&&Hi.require("util").types;return K||ds&&ds.binding&&ds.binding("util")}catch{}}(),lo=Un&&Un.isArrayBuffer,Or=Un&&Un.isDate,hs=Un&&Un.isMap,Vl=Un&&Un.isRegExp,jr=Un&&Un.isSet,rr=Un&&Un.isTypedArray;function An(K,oe,Y){switch(Y.length){case 0:return K.call(oe);case 1:return K.call(oe,Y[0]);case 2:return K.call(oe,Y[0],Y[1]);case 3:return K.call(oe,Y[0],Y[1],Y[2])}return K.apply(oe,Y)}function ma(K,oe,Y,Te){for(var Ze=-1,Xe=K==null?0:K.length;++Ze<Xe;){var Rt=K[Ze];oe(Te,Rt,Y(Rt),K)}return Te}function Zn(K,oe){for(var Y=-1,Te=K==null?0:K.length;++Y<Te&&oe(K[Y],Y,K)!==!1;);return K}function zl(K,oe){for(var Y=K==null?0:K.length;Y--&&oe(K[Y],Y,K)!==!1;);return K}function ba(K,oe){for(var Y=-1,Te=K==null?0:K.length;++Y<Te;)if(!oe(K[Y],Y,K))return!1;return!0}function co(K,oe){for(var Y=-1,Te=K==null?0:K.length,Ze=0,Xe=[];++Y<Te;){var Rt=K[Y];oe(Rt,Y,K)&&(Xe[Ze++]=Rt)}return Xe}function fs(K,oe){var Y=K==null?0:K.length;return!!Y&&Ro(K,oe,0)>-1}function $i(K,oe,Y){for(var Te=-1,Ze=K==null?0:K.length;++Te<Ze;)if(Y(oe,K[Te]))return!0;return!1}function Pt(K,oe){for(var Y=-1,Te=K==null?0:K.length,Ze=Array(Te);++Y<Te;)Ze[Y]=oe(K[Y],Y,K);return Ze}function uo(K,oe){for(var Y=-1,Te=oe.length,Ze=K.length;++Y<Te;)K[Ze+Y]=oe[Y];return K}function va(K,oe,Y,Te){var Ze=-1,Xe=K==null?0:K.length;for(Te&&Xe&&(Y=K[++Ze]);++Ze<Xe;)Y=oe(Y,K[Ze],Ze,K);return Y}function ps(K,oe,Y,Te){var Ze=K==null?0:K.length;for(Te&&Ze&&(Y=K[--Ze]);Ze--;)Y=oe(Y,K[Ze],Ze,K);return Y}function sr(K,oe){for(var Y=-1,Te=K==null?0:K.length;++Y<Te;)if(oe(K[Y],Y,K))return!0;return!1}var xu=ka("length");function Cu(K){return K.split("")}function Fl(K){return K.match(Sr)||[]}function wa(K,oe,Y){var Te;return Y(K,function(Ze,Xe,Rt){if(oe(Ze,Xe,Rt))return Te=Xe,!1}),Te}function ar(K,oe,Y,Te){for(var Ze=K.length,Xe=Y+(Te?1:-1);Te?Xe--:++Xe<Ze;)if(oe(K[Xe],Xe,K))return Xe;return-1}function Ro(K,oe,Y){return oe===oe?X(K,oe,Y):ar(K,jt,Y)}function Bl(K,oe,Y,Te){for(var Ze=Y-1,Xe=K.length;++Ze<Xe;)if(Te(K[Ze],oe))return Ze;return-1}function jt(K){return K!==K}function _a(K,oe){var Y=K==null?0:K.length;return Y?xa(K,oe)/Y:Ye}function ka(K){return function(oe){return oe==null?u:oe[K]}}function gs(K){return function(oe){return K==null?u:K[oe]}}function Hl(K,oe,Y,Te,Ze){return Ze(K,function(Xe,Rt,Ct){Y=Te?(Te=!1,Xe):oe(Y,Xe,Rt,Ct)}),Y}function ya(K,oe){var Y=K.length;for(K.sort(oe);Y--;)K[Y]=K[Y].value;return K}function xa(K,oe){for(var Y,Te=-1,Ze=K.length;++Te<Ze;){var Xe=oe(K[Te]);Xe!==u&&(Y=Y===u?Xe:Y+Xe)}return Y}function Ca(K,oe){for(var Y=-1,Te=Array(K);++Y<K;)Te[Y]=oe(Y);return Te}function $l(K,oe){return Pt(oe,function(Y){return[Y,K[Y]]})}function Ul(K){return K&&K.slice(0,Ke(K)+1).replace(qs,"")}function st(K){return function(oe){return K(oe)}}function Rr(K,oe){return Pt(oe,function(Y){return K[Y]})}function Lo(K,oe){return K.has(oe)}function Ai(K,oe){for(var Y=-1,Te=K.length;++Y<Te&&Ro(oe,K[Y],0)>-1;);return Y}function ms(K,oe){for(var Y=K.length;Y--&&Ro(oe,K[Y],0)>-1;);return Y}function kn(K,oe){for(var Y=K.length,Te=0;Y--;)K[Y]===oe&&++Te;return Te}var Lr=gs(ca),Wn=gs(Dr);function Xn(K){return"\\"+da[K]}function bs(K,oe){return K==null?u:K[oe]}function Tt(K){return la.test(K)}function Ta(K){return jo.test(K)}function Ea(K){for(var oe,Y=[];!(oe=K.next()).done;)Y.push(oe.value);return Y}function Ni(K){var oe=-1,Y=Array(K.size);return K.forEach(function(Te,Ze){Y[++oe]=[Ze,Te]}),Y}function Wl(K,oe){return function(Y){return K(oe(Y))}}function A(K,oe){for(var Y=-1,Te=K.length,Ze=0,Xe=[];++Y<Te;){var Rt=K[Y];(Rt===oe||Rt===T)&&(K[Y]=T,Xe[Ze++]=Y)}return Xe}function N(K){var oe=-1,Y=Array(K.size);return K.forEach(function(Te){Y[++oe]=Te}),Y}function z(K){var oe=-1,Y=Array(K.size);return K.forEach(function(Te){Y[++oe]=[Te,Te]}),Y}function X(K,oe,Y){for(var Te=Y-1,Ze=K.length;++Te<Ze;)if(K[Te]===oe)return Te;return-1}function Pe(K,oe,Y){for(var Te=Y+1;Te--;)if(K[Te]===oe)return Te;return Te}function Ce(K){return Tt(K)?Jt(K):xu(K)}function je(K){return Tt(K)?lr(K):Cu(K)}function Ke(K){for(var oe=K.length;oe--&&mu.test(K.charAt(oe)););return oe}var Et=gs(ua);function Jt(K){for(var oe=ao.lastIndex=0;ao.test(K);)++oe;return oe}function lr(K){return K.match(ao)||[]}function Pi(K){return K.match(Ir)||[]}var Ii=function K(oe){oe=oe==null?gn:fi.defaults(gn.Object(),oe,fi.pick(gn,Mr));var Y=oe.Array,Te=oe.Date,Ze=oe.Error,Xe=oe.Function,Rt=oe.Math,Ct=oe.Object,Kl=oe.RegExp,Mg=oe.String,ei=oe.TypeError,vs=Y.prototype,Dg=Xe.prototype,cr=Ct.prototype,Sa=oe["__core-js_shared__"],Aa=Dg.toString,Lt=cr.hasOwnProperty,Og=0,_h=function(){var s=/[^.]+$/.exec(Sa&&Sa.keys&&Sa.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""}(),Vr=cr.toString,Tu=Aa.call(Ct),jg=gn._,Rg=Kl("^"+Aa.call(Lt).replace(Tr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ws=Ll?oe.Buffer:u,ur=oe.Symbol,ql=oe.Uint8Array,kh=ws?ws.allocUnsafe:u,Na=Wl(Ct.getPrototypeOf,Ct),yh=Ct.create,xh=cr.propertyIsEnumerable,Gl=vs.splice,Ch=ur?ur.isConcatSpreadable:u,zr=ur?ur.iterator:u,Vo=ur?ur.toStringTag:u,Kn=function(){try{var s=vi(Ct,"defineProperty");return s({},"",{}),s}catch{}}(),Th=oe.clearTimeout!==gn.clearTimeout&&oe.clearTimeout,Ql=Te&&Te.now!==gn.Date.now&&Te.now,Eh=oe.setTimeout!==gn.setTimeout&&oe.setTimeout,Fr=Rt.ceil,Pa=Rt.floor,Eu=Ct.getOwnPropertySymbols,Br=ws?ws.isBuffer:u,_e=oe.isFinite,et=vs.join,Yl=Wl(Ct.keys,Ct),dn=Rt.max,Gt=Rt.min,Su=Te.now,Jl=oe.parseInt,Zl=Rt.random,Lg=vs.reverse,Hr=vi(oe,"DataView"),ho=vi(oe,"Map"),Xl=vi(oe,"Promise"),dr=vi(oe,"Set"),zo=vi(oe,"WeakMap"),fo=vi(Ct,"create"),ec=zo&&new zo,hr={},Sh=vr(Hr),Vg=vr(ho),Ia=vr(Xl),yn=vr(dr),zg=vr(zo),tc=ur?ur.prototype:u,ct=tc?tc.valueOf:u,Ah=tc?tc.toString:u;function I(s){if(en(s)&&!nt(s)&&!(s instanceof vt)){if(s instanceof pi)return s;if(Lt.call(s,"__wrapped__"))return hf(s)}return new pi(s)}var fr=function(){function s(){}return function(c){if(!it(c))return{};if(yh)return yh(c);s.prototype=c;var f=new s;return s.prototype=u,f}}();function Ma(){}function pi(s,c){this.__wrapped__=s,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=u}I.templateSettings={escape:Xo,evaluate:kl,interpolate:Mo,variable:"",imports:{_:I}},I.prototype=Ma.prototype,I.prototype.constructor=I,pi.prototype=fr(Ma.prototype),pi.prototype.constructor=pi;function vt(s){this.__wrapped__=s,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ve,this.__views__=[]}function Au(){var s=new vt(this.__wrapped__);return s.__actions__=ii(this.__actions__),s.__dir__=this.__dir__,s.__filtered__=this.__filtered__,s.__iteratees__=ii(this.__iteratees__),s.__takeCount__=this.__takeCount__,s.__views__=ii(this.__views__),s}function Fg(){if(this.__filtered__){var s=new vt(this);s.__dir__=-1,s.__filtered__=!0}else s=this.clone(),s.__dir__*=-1;return s}function Bg(){var s=this.__wrapped__.value(),c=this.__dir__,f=nt(s),y=c<0,S=f?s.length:0,O=rm(0,S,this.__views__),F=O.start,W=O.end,q=W-F,de=y?W:F-1,he=this.__iteratees__,ge=he.length,Ee=0,Re=Gt(q,this.__takeCount__);if(!f||!y&&S==q&&Re==q)return Wi(s,this.__actions__);var Qe=[];e:for(;q--&&Ee<Re;){de+=c;for(var mt=-1,Ge=s[de];++mt<ge;){var bt=he[mt],wt=bt.iteratee,ri=bt.type,Fn=wt(Ge);if(ri==ke)Ge=Fn;else if(!Fn){if(ri==be)continue e;break e}}Qe[Ee++]=Ge}return Qe}vt.prototype=fr(Ma.prototype),vt.prototype.constructor=vt;function pr(s){var c=-1,f=s==null?0:s.length;for(this.clear();++c<f;){var y=s[c];this.set(y[0],y[1])}}function Hg(){this.__data__=fo?fo(null):{},this.size=0}function $r(s){var c=this.has(s)&&delete this.__data__[s];return this.size-=c?1:0,c}function Nh(s){var c=this.__data__;if(fo){var f=c[s];return f===M?u:f}return Lt.call(c,s)?c[s]:u}function Nu(s){var c=this.__data__;return fo?c[s]!==u:Lt.call(c,s)}function $g(s,c){var f=this.__data__;return this.size+=this.has(s)?0:1,f[s]=fo&&c===u?M:c,this}pr.prototype.clear=Hg,pr.prototype.delete=$r,pr.prototype.get=Nh,pr.prototype.has=Nu,pr.prototype.set=$g;function po(s){var c=-1,f=s==null?0:s.length;for(this.clear();++c<f;){var y=s[c];this.set(y[0],y[1])}}function Pu(){this.__data__=[],this.size=0}function Ph(s){var c=this.__data__,f=Ft(c,s);if(f<0)return!1;var y=c.length-1;return f==y?c.pop():Gl.call(c,f,1),--this.size,!0}function Ug(s){var c=this.__data__,f=Ft(c,s);return f<0?u:c[f][1]}function Iu(s){return Ft(this.__data__,s)>-1}function Da(s,c){var f=this.__data__,y=Ft(f,s);return y<0?(++this.size,f.push([s,c])):f[y][1]=c,this}po.prototype.clear=Pu,po.prototype.delete=Ph,po.prototype.get=Ug,po.prototype.has=Iu,po.prototype.set=Da;function go(s){var c=-1,f=s==null?0:s.length;for(this.clear();++c<f;){var y=s[c];this.set(y[0],y[1])}}function Nn(){this.size=0,this.__data__={hash:new pr,map:new(ho||po),string:new pr}}function Ih(s){var c=kc(this,s).delete(s);return this.size-=c?1:0,c}function Mh(s){return kc(this,s).get(s)}function Dh(s){return kc(this,s).has(s)}function nc(s,c){var f=kc(this,s),y=f.size;return f.set(s,c),this.size+=f.size==y?0:1,this}go.prototype.clear=Nn,go.prototype.delete=Ih,go.prototype.get=Mh,go.prototype.has=Dh,go.prototype.set=nc;function xn(s){var c=-1,f=s==null?0:s.length;for(this.__data__=new go;++c<f;)this.add(s[c])}function ic(s){return this.__data__.set(s,M),this}function Mu(s){return this.__data__.has(s)}xn.prototype.add=xn.prototype.push=ic,xn.prototype.has=Mu;function Ui(s){var c=this.__data__=new po(s);this.size=c.size}function Oh(){this.__data__=new po,this.size=0}function jh(s){var c=this.__data__,f=c.delete(s);return this.size=c.size,f}function Rh(s){return this.__data__.get(s)}function gr(s){return this.__data__.has(s)}function Lh(s,c){var f=this.__data__;if(f instanceof po){var y=f.__data__;if(!ho||y.length<w-1)return y.push([s,c]),this.size=++f.size,this;f=this.__data__=new go(y)}return f.set(s,c),this.size=f.size,this}Ui.prototype.clear=Oh,Ui.prototype.delete=jh,Ui.prototype.get=Rh,Ui.prototype.has=gr,Ui.prototype.set=Lh;function Du(s,c){var f=nt(s),y=!f&&Zr(s),S=!f&&!y&&qo(s),O=!f&&!y&&!S&&Ds(s),F=f||y||S||O,W=F?Ca(s.length,Mg):[],q=W.length;for(var de in s)(c||Lt.call(s,de))&&!(F&&(de=="length"||S&&(de=="offset"||de=="parent")||O&&(de=="buffer"||de=="byteLength"||de=="byteOffset")||Mn(de,q)))&&W.push(de);return W}function Ur(s){var c=s.length;return c?s[cc(0,c-1)]:u}function Vh(s,c){return Ac(ii(s),mo(c,0,s.length))}function zh(s){return Ac(ii(s))}function oc(s,c,f){(f!==u&&!Qi(s[c],f)||f===u&&!(c in s))&&Fo(s,c,f)}function Oa(s,c,f){var y=s[c];(!(Lt.call(s,c)&&Qi(y,f))||f===u&&!(c in s))&&Fo(s,c,f)}function Ft(s,c){for(var f=s.length;f--;)if(Qi(s[f][0],c))return f;return-1}function Ou(s,c,f,y){return Bo(s,function(S,O,F){c(y,S,f(S),F)}),y}function ju(s,c){return s&&qi(c,bn(c),s)}function Wg(s,c){return s&&qi(c,jn(c),s)}function Fo(s,c,f){c=="__proto__"&&Kn?Kn(s,c,{configurable:!0,enumerable:!0,value:f,writable:!0}):s[c]=f}function Ru(s,c){for(var f=-1,y=c.length,S=Y(y),O=s==null;++f<y;)S[f]=O?u:Fc(s,c[f]);return S}function mo(s,c,f){return s===s&&(f!==u&&(s=s<=f?s:f),c!==u&&(s=s>=c?s:c)),s}function gi(s,c,f,y,S,O){var F,W=c&L,q=c&U,de=c&j;if(f&&(F=S?f(s,y,S,O):f(s)),F!==u)return F;if(!it(s))return s;var he=nt(s);if(he){if(F=am(s),!W)return ii(s,F)}else{var ge=In(s),Ee=ge==qt||ge==Qt;if(qo(s))return re(s,W);if(ge==rt||ge==Oe||Ee&&!S){if(F=q||Ee?{}:yc(s),!W)return q?ko(s,Wg(F,s)):Xu(s,ju(F,s))}else{if(!zt[ge])return S?s:{};F=df(s,ge,W)}}O||(O=new Ui);var Re=O.get(s);if(Re)return Re;O.set(s,F),Dd(s)?s.forEach(function(Ge){F.add(gi(Ge,c,f,Ge,s,O))}):fp(s)&&s.forEach(function(Ge,bt){F.set(bt,gi(Ge,c,f,bt,s,O))});var Qe=de?q?sd:rd:q?jn:bn,mt=he?u:Qe(s);return Zn(mt||s,function(Ge,bt){mt&&(bt=Ge,Ge=s[bt]),Oa(F,bt,gi(Ge,c,f,bt,s,O))}),F}function Fh(s){var c=bn(s);return function(f){return ja(f,s,c)}}function ja(s,c,f){var y=f.length;if(s==null)return!y;for(s=Ct(s);y--;){var S=f[y],O=c[S],F=s[S];if(F===u&&!(S in s)||!O(F))return!1}return!0}function Wr(s,c,f){if(typeof s!="function")throw new ei(m);return Za(function(){s.apply(u,f)},c)}function Kr(s,c,f,y){var S=-1,O=fs,F=!0,W=s.length,q=[],de=c.length;if(!W)return q;f&&(c=Pt(c,st(f))),y?(O=$i,F=!1):c.length>=w&&(O=Lo,F=!1,c=new xn(c));e:for(;++S<W;){var he=s[S],ge=f==null?he:f(he);if(he=y||he!==0?he:0,F&&ge===ge){for(var Ee=de;Ee--;)if(c[Ee]===ge)continue e;q.push(he)}else O(c,ge,y)||q.push(he)}return q}var Bo=Di(vo),bo=Di(zu,!0);function Kg(s,c){var f=!0;return Bo(s,function(y,S,O){return f=!!c(y,S,O),f}),f}function rc(s,c,f){for(var y=-1,S=s.length;++y<S;){var O=s[y],F=c(O);if(F!=null&&(W===u?F===F&&!yi(F):f(F,W)))var W=F,q=O}return q}function sc(s,c,f,y){var S=s.length;for(f=at(f),f<0&&(f=-f>S?0:S+f),y=y===u||y>S?S:at(y),y<0&&(y+=S),y=f>y?0:jd(y);f<y;)s[f++]=c;return s}function Bh(s,c){var f=[];return Bo(s,function(y,S,O){c(y,S,O)&&f.push(y)}),f}function Pn(s,c,f,y,S){var O=-1,F=s.length;for(f||(f=Oi),S||(S=[]);++O<F;){var W=s[O];c>0&&f(W)?c>1?Pn(W,c-1,f,y,S):uo(S,W):y||(S[S.length]=W)}return S}var Lu=nf(),Vu=nf(!0);function vo(s,c){return s&&Lu(s,c,bn)}function zu(s,c){return s&&Vu(s,c,bn)}function Ra(s,c){return co(c,function(f){return Yi(s[f])})}function Ho(s,c){c=fe(c,s);for(var f=0,y=c.length;s!=null&&f<y;)s=s[Co(c[f++])];return f&&f==y?s:u}function Hh(s,c,f){var y=c(s);return nt(s)?y:uo(y,f(s))}function qn(s){return s==null?s===u?fn:lt:Vo&&Vo in Ct(s)?om(s):oi(s)}function Fu(s,c){return s>c}function $h(s,c){return s!=null&&Lt.call(s,c)}function qg(s,c){return s!=null&&c in Ct(s)}function Uh(s,c,f){return s>=Gt(c,f)&&s<dn(c,f)}function Bu(s,c,f){for(var y=f?$i:fs,S=s[0].length,O=s.length,F=O,W=Y(O),q=1/0,de=[];F--;){var he=s[F];F&&c&&(he=Pt(he,st(c))),q=Gt(he.length,q),W[F]=!f&&(c||S>=120&&he.length>=120)?new xn(F&&he):u}he=s[0];var ge=-1,Ee=W[0];e:for(;++ge<S&&de.length<q;){var Re=he[ge],Qe=c?c(Re):Re;if(Re=f||Re!==0?Re:0,!(Ee?Lo(Ee,Qe):y(de,Qe,f))){for(F=O;--F;){var mt=W[F];if(!(mt?Lo(mt,Qe):y(s[F],Qe,f)))continue e}Ee&&Ee.push(Qe),de.push(Re)}}return de}function Wh(s,c,f,y){return vo(s,function(S,O,F){c(y,f(S),O,F)}),y}function qr(s,c,f){c=fe(c,s),s=xo(s,c);var y=s==null?s:s[Co(wi(c))];return y==null?u:An(y,s,f)}function $o(s){return en(s)&&qn(s)==Oe}function Gg(s){return en(s)&&qn(s)==io}function Hu(s){return en(s)&&qn(s)==tt}function La(s,c,f,y,S){return s===c?!0:s==null||c==null||!en(s)&&!en(c)?s!==s&&c!==c:Qg(s,c,f,y,La,S)}function Qg(s,c,f,y,S,O){var F=nt(s),W=nt(c),q=F?He:In(s),de=W?He:In(c);q=q==Oe?rt:q,de=de==Oe?rt:de;var he=q==rt,ge=de==rt,Ee=q==de;if(Ee&&qo(s)){if(!qo(c))return!1;F=!0,he=!1}if(Ee&&!he)return O||(O=new Ui),F||Ds(s)?cf(s,c,f,y,S,O):uf(s,c,q,f,y,S,O);if(!(f&$)){var Re=he&&Lt.call(s,"__wrapped__"),Qe=ge&&Lt.call(c,"__wrapped__");if(Re||Qe){var mt=Re?s.value():s,Ge=Qe?c.value():c;return O||(O=new Ui),S(mt,Ge,f,y,O)}}return Ee?(O||(O=new Ui),Gr(s,c,f,y,S,O)):!1}function Yg(s){return en(s)&&In(s)==we}function $u(s,c,f,y){var S=f.length,O=S,F=!y;if(s==null)return!O;for(s=Ct(s);S--;){var W=f[S];if(F&&W[2]?W[1]!==s[W[0]]:!(W[0]in s))return!1}for(;++S<O;){W=f[S];var q=W[0],de=s[q],he=W[1];if(F&&W[2]){if(de===u&&!(q in s))return!1}else{var ge=new Ui;if(y)var Ee=y(de,he,q,s,c,ge);if(!(Ee===u?La(he,de,$|Z,y,ge):Ee))return!1}}return!0}function Kh(s){if(!it(s)||Ya(s))return!1;var c=Yi(s)?Rg:xl;return c.test(vr(s))}function Jg(s){return en(s)&&qn(s)==rn}function Zg(s){return en(s)&&In(s)==Mt}function Xg(s){return en(s)&&es(s.length)&&!!Wt[qn(s)]}function Uu(s){return typeof s=="function"?s:s==null?Yn:typeof s=="object"?nt(s)?Qh(s[0],s[1]):Gh(s):Kd(s)}function Wu(s){if(!Cs(s))return Yl(s);var c=[];for(var f in Ct(s))Lt.call(s,f)&&f!="constructor"&&c.push(f);return c}function em(s){if(!it(s))return Tn(s);var c=Cs(s),f=[];for(var y in s)y=="constructor"&&(c||!Lt.call(s,y))||f.push(y);return f}function Va(s,c){return s<c}function qh(s,c){var f=-1,y=nn(s)?Y(s.length):[];return Bo(s,function(S,O,F){y[++f]=c(S,O,F)}),y}function Gh(s){var c=ld(s);return c.length==1&&c[0][2]?an(c[0][0],c[0][1]):function(f){return f===s||$u(f,s,c)}}function Qh(s,c){return Cc(s)&&hd(c)?an(Co(s),c):function(f){var y=Fc(f,s);return y===u&&y===c?Bc(f,s):La(c,y,$|Z)}}function ac(s,c,f,y,S){s!==c&&Lu(c,function(O,F){if(S||(S=new Ui),it(O))tm(s,c,F,f,ac,y,S);else{var W=y?y(Bt(s,F),O,F+"",s,c,S):u;W===u&&(W=O),oc(s,F,W)}},jn)}function tm(s,c,f,y,S,O,F){var W=Bt(s,f),q=Bt(c,f),de=F.get(q);if(de){oc(s,f,de);return}var he=O?O(W,q,f+"",s,c,F):u,ge=he===u;if(ge){var Ee=nt(q),Re=!Ee&&qo(q),Qe=!Ee&&!Re&&Ds(q);he=q,Ee||Re||Qe?nt(W)?he=W:ln(W)?he=ii(W):Re?(ge=!1,he=re(q,!0)):Qe?(ge=!1,he=tf(q,!0)):he=[]:To(q)||Zr(q)?(he=W,Zr(W)?he=Rd(W):(!it(W)||Yi(W))&&(he=yc(q))):ge=!1}ge&&(F.set(q,he),S(he,q,y,O,F),F.delete(q)),oc(s,f,he)}function Yh(s,c){var f=s.length;if(f)return c+=c<0?f:0,Mn(c,f)?s[c]:u}function Ku(s,c,f){c.length?c=Pt(c,function(O){return nt(O)?function(F){return Ho(F,O.length===1?O[0]:O)}:O}):c=[Yn];var y=-1;c=Pt(c,st(qe()));var S=qh(s,function(O,F,W){var q=Pt(c,function(de){return de(O)});return{criteria:q,index:++y,value:O}});return ya(S,function(O,F){return im(O,F,f)})}function lc(s,c){return qu(s,c,function(f,y){return Bc(s,y)})}function qu(s,c,f){for(var y=-1,S=c.length,O={};++y<S;){var F=c[y],W=Ho(s,F);f(W,F)&&mi(O,fe(F,s),W)}return O}function Jh(s){return function(c){return Ho(c,s)}}function St(s,c,f,y){var S=y?Bl:Ro,O=-1,F=c.length,W=s;for(s===c&&(c=ii(c)),f&&(W=Pt(s,st(f)));++O<F;)for(var q=0,de=c[O],he=f?f(de):de;(q=S(W,he,q,y))>-1;)W!==s&&Gl.call(W,q,1),Gl.call(s,q,1);return s}function za(s,c){for(var f=s?c.length:0,y=f-1;f--;){var S=c[f];if(f==y||S!==O){var O=S;Mn(S)?Gl.call(s,S,1):fc(s,S)}}return s}function cc(s,c){return s+Pa(Zl()*(c-s+1))}function Zt(s,c,f,y){for(var S=-1,O=dn(Fr((c-s)/(f||1)),0),F=Y(O);O--;)F[y?O:++S]=s,s+=f;return F}function uc(s,c){var f="";if(!s||c<1||c>Le)return f;do c%2&&(f+=s),c=Pa(c/2),c&&(s+=s);while(c);return f}function ut(s,c){return Sc(Qn(s,c,Yn),s+"")}function ti(s){return Ur(Rs(s))}function Mi(s,c){var f=Rs(s);return Ac(f,mo(c,0,f.length))}function mi(s,c,f,y){if(!it(s))return s;c=fe(c,s);for(var S=-1,O=c.length,F=O-1,W=s;W!=null&&++S<O;){var q=Co(c[S]),de=f;if(q==="__proto__"||q==="constructor"||q==="prototype")return s;if(S!=F){var he=W[q];de=y?y(he,q,W):u,de===u&&(de=it(he)?he:Mn(c[S+1])?[]:{})}Oa(W,q,de),W=W[q]}return s}var Zh=ec?function(s,c){return ec.set(s,c),s}:Yn,Xh=Kn?function(s,c){return Kn(s,"toString",{configurable:!0,enumerable:!1,value:Wc(c),writable:!0})}:Yn;function nm(s){return Ac(Rs(s))}function bi(s,c,f){var y=-1,S=s.length;c<0&&(c=-c>S?0:S+c),f=f>S?S:f,f<0&&(f+=S),S=c>f?0:f-c>>>0,c>>>=0;for(var O=Y(S);++y<S;)O[y]=s[y+c];return O}function ef(s,c){var f;return Bo(s,function(y,S,O){return f=c(y,S,O),!f}),!!f}function Fa(s,c,f){var y=0,S=s==null?y:s.length;if(typeof c=="number"&&c===c&&S<=Se){for(;y<S;){var O=y+S>>>1,F=s[O];F!==null&&!yi(F)&&(f?F<=c:F<c)?y=O+1:S=O}return S}return dc(s,c,Yn,f)}function dc(s,c,f,y){var S=0,O=s==null?0:s.length;if(O===0)return 0;c=f(c);for(var F=c!==c,W=c===null,q=yi(c),de=c===u;S<O;){var he=Pa((S+O)/2),ge=f(s[he]),Ee=ge!==u,Re=ge===null,Qe=ge===ge,mt=yi(ge);if(F)var Ge=y||Qe;else de?Ge=Qe&&(y||Ee):W?Ge=Qe&&Ee&&(y||!Re):q?Ge=Qe&&Ee&&!Re&&(y||!mt):Re||mt?Ge=!1:Ge=y?ge<=c:ge<c;Ge?S=he+1:O=he}return Gt(O,yt)}function Gu(s,c){for(var f=-1,y=s.length,S=0,O=[];++f<y;){var F=s[f],W=c?c(F):F;if(!f||!Qi(W,q)){var q=W;O[S++]=F===0?0:F}}return O}function hc(s){return typeof s=="number"?s:yi(s)?Ye:+s}function ni(s){if(typeof s=="string")return s;if(nt(s))return Pt(s,ni)+"";if(yi(s))return Ah?Ah.call(s):"";var c=s+"";return c=="0"&&1/s==-xe?"-0":c}function Uo(s,c,f){var y=-1,S=fs,O=s.length,F=!0,W=[],q=W;if(f)F=!1,S=$i;else if(O>=w){var de=c?null:af(s);if(de)return N(de);F=!1,S=Lo,q=new xn}else q=c?[]:W;e:for(;++y<O;){var he=s[y],ge=c?c(he):he;if(he=f||he!==0?he:0,F&&ge===ge){for(var Ee=q.length;Ee--;)if(q[Ee]===ge)continue e;c&&q.push(ge),W.push(he)}else S(q,ge,f)||(q!==W&&q.push(ge),W.push(he))}return W}function fc(s,c){return c=fe(c,s),s=xo(s,c),s==null||delete s[Co(wi(c))]}function mr(s,c,f,y){return mi(s,c,f(Ho(s,c)),y)}function Dt(s,c,f,y){for(var S=s.length,O=y?S:-1;(y?O--:++O<S)&&c(s[O],O,s););return f?bi(s,y?0:O,y?O+1:S):bi(s,y?O+1:0,y?S:O)}function Wi(s,c){var f=s;return f instanceof vt&&(f=f.value()),va(c,function(y,S){return S.func.apply(S.thisArg,uo([y],S.args))},f)}function br(s,c,f){var y=s.length;if(y<2)return y?Uo(s[0]):[];for(var S=-1,O=Y(y);++S<y;)for(var F=s[S],W=-1;++W<y;)W!=S&&(O[S]=Kr(O[S]||F,s[W],c,f));return Uo(Pn(O,1),c,f)}function Ot(s,c,f){for(var y=-1,S=s.length,O=c.length,F={};++y<S;){var W=y<O?c[y]:u;f(F,s[y],W)}return F}function Ki(s){return ln(s)?s:[]}function Wo(s){return typeof s=="function"?s:Yn}function fe(s,c){return nt(s)?s:Cc(s,c)?[s]:pd(It(s))}var _s=ut;function wo(s,c,f){var y=s.length;return f=f===u?y:f,!c&&f>=y?s:bi(s,c,f)}var Qu=Th||function(s){return gn.clearTimeout(s)};function re(s,c){if(c)return s.slice();var f=s.length,y=kh?kh(f):new s.constructor(f);return s.copy(y),y}function Ba(s){var c=new s.constructor(s.byteLength);return new ql(c).set(new ql(s)),c}function pc(s,c){var f=c?Ba(s.buffer):s.buffer;return new s.constructor(f,s.byteOffset,s.byteLength)}function gc(s){var c=new s.constructor(s.source,Do.exec(s));return c.lastIndex=s.lastIndex,c}function Yu(s){return ct?Ct(ct.call(s)):{}}function tf(s,c){var f=c?Ba(s.buffer):s.buffer;return new s.constructor(f,s.byteOffset,s.length)}function Ju(s,c){if(s!==c){var f=s!==u,y=s===null,S=s===s,O=yi(s),F=c!==u,W=c===null,q=c===c,de=yi(c);if(!W&&!de&&!O&&s>c||O&&F&&q&&!W&&!de||y&&F&&q||!f&&q||!S)return 1;if(!y&&!O&&!de&&s<c||de&&f&&S&&!y&&!O||W&&f&&S||!F&&S||!q)return-1}return 0}function im(s,c,f){for(var y=-1,S=s.criteria,O=c.criteria,F=S.length,W=f.length;++y<F;){var q=Ju(S[y],O[y]);if(q){if(y>=W)return q;var de=f[y];return q*(de=="desc"?-1:1)}}return s.index-c.index}function _o(s,c,f,y){for(var S=-1,O=s.length,F=f.length,W=-1,q=c.length,de=dn(O-F,0),he=Y(q+de),ge=!y;++W<q;)he[W]=c[W];for(;++S<F;)(ge||S<O)&&(he[f[S]]=s[S]);for(;de--;)he[W++]=s[S++];return he}function Zu(s,c,f,y){for(var S=-1,O=s.length,F=-1,W=f.length,q=-1,de=c.length,he=dn(O-W,0),ge=Y(he+de),Ee=!y;++S<he;)ge[S]=s[S];for(var Re=S;++q<de;)ge[Re+q]=c[q];for(;++F<W;)(Ee||S<O)&&(ge[Re+f[F]]=s[S++]);return ge}function ii(s,c){var f=-1,y=s.length;for(c||(c=Y(y));++f<y;)c[f]=s[f];return c}function qi(s,c,f,y){var S=!f;f||(f={});for(var O=-1,F=c.length;++O<F;){var W=c[O],q=y?y(f[W],s[W],W,f,s):u;q===u&&(q=s[W]),S?Fo(f,W,q):Oa(f,W,q)}return f}function Xu(s,c){return qi(s,cd(s),c)}function ko(s,c){return qi(s,ud(s),c)}function mc(s,c){return function(f,y){var S=nt(f)?ma:Ou,O=c?c():{};return S(f,s,qe(y,2),O)}}function ks(s){return ut(function(c,f){var y=-1,S=f.length,O=S>1?f[S-1]:u,F=S>2?f[2]:u;for(O=s.length>3&&typeof O=="function"?(S--,O):u,F&&Dn(f[0],f[1],F)&&(O=S<3?u:O,S=1),c=Ct(c);++y<S;){var W=f[y];W&&s(c,W,y,O)}return c})}function Di(s,c){return function(f,y){if(f==null)return f;if(!nn(f))return s(f,y);for(var S=f.length,O=c?S:-1,F=Ct(f);(c?O--:++O<S)&&y(F[O],O,F)!==!1;);return f}}function nf(s){return function(c,f,y){for(var S=-1,O=Ct(c),F=y(c),W=F.length;W--;){var q=F[s?W:++S];if(f(O[q],q,O)===!1)break}return c}}function bc(s,c,f){var y=c&se,S=Ha(s);function O(){var F=this&&this!==gn&&this instanceof O?S:s;return F.apply(y?f:this,arguments)}return O}function ed(s){return function(c){c=It(c);var f=Tt(c)?je(c):u,y=f?f[0]:c.charAt(0),S=f?wo(f,1).join(""):c.slice(1);return y[s]()+S}}function Gn(s){return function(c){return va(Rp(Ji(c).replace(jl,"")),s,"")}}function Ha(s){return function(){var c=arguments;switch(c.length){case 0:return new s;case 1:return new s(c[0]);case 2:return new s(c[0],c[1]);case 3:return new s(c[0],c[1],c[2]);case 4:return new s(c[0],c[1],c[2],c[3]);case 5:return new s(c[0],c[1],c[2],c[3],c[4]);case 6:return new s(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new s(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var f=fr(s.prototype),y=s.apply(f,c);return it(y)?y:f}}function of(s,c,f){var y=Ha(s);function S(){for(var O=arguments.length,F=Y(O),W=O,q=xs(S);W--;)F[W]=arguments[W];var de=O<3&&F[0]!==q&&F[O-1]!==q?[]:A(F,q);if(O-=de.length,O<f)return wc(s,c,Ua,S.placeholder,u,F,de,u,u,f-O);var he=this&&this!==gn&&this instanceof S?y:s;return An(he,this,F)}return S}function td(s){return function(c,f,y){var S=Ct(c);if(!nn(c)){var O=qe(f,3);c=bn(c),f=function(W){return O(S[W],W,S)}}var F=s(c,f,y);return F>-1?S[O?c[F]:F]:u}}function $a(s){return Ko(function(c){var f=c.length,y=f,S=pi.prototype.thru;for(s&&c.reverse();y--;){var O=c[y];if(typeof O!="function")throw new ei(m);if(S&&!F&&_c(O)=="wrapper")var F=new pi([],!0)}for(y=F?y:f;++y<f;){O=c[y];var W=_c(O),q=W=="wrapper"?ad(O):u;q&&Tc(q[0])&&q[1]==(pe|G|ie|De)&&!q[4].length&&q[9]==1?F=F[_c(q[0])].apply(F,q[3]):F=O.length==1&&Tc(O)?F[W]():F.thru(O)}return function(){var de=arguments,he=de[0];if(F&&de.length==1&&nt(he))return F.plant(he).value();for(var ge=0,Ee=f?c[ge].apply(this,de):he;++ge<f;)Ee=c[ge].call(this,Ee);return Ee}})}function Ua(s,c,f,y,S,O,F,W,q,de){var he=c&pe,ge=c&se,Ee=c&ue,Re=c&(G|ne),Qe=c&Ie,mt=Ee?u:Ha(s);function Ge(){for(var bt=arguments.length,wt=Y(bt),ri=bt;ri--;)wt[ri]=arguments[ri];if(Re)var Fn=xs(Ge),Ci=kn(wt,Fn);if(y&&(wt=_o(wt,y,S,Re)),O&&(wt=Zu(wt,O,F,Re)),bt-=Ci,Re&&bt<de){var hn=A(wt,Fn);return wc(s,c,Ua,Ge.placeholder,f,wt,hn,W,q,de-bt)}var Zi=ge?f:this,Yo=Ee?Zi[s]:s;return bt=wt.length,W?wt=mn(wt,W):Qe&&bt>1&&wt.reverse(),he&&q<bt&&(wt.length=q),this&&this!==gn&&this instanceof Ge&&(Yo=mt||Ha(Yo)),Yo.apply(Zi,wt)}return Ge}function nd(s,c){return function(f,y){return Wh(f,s,c(y),{})}}function ys(s,c){return function(f,y){var S;if(f===u&&y===u)return c;if(f!==u&&(S=f),y!==u){if(S===u)return y;typeof f=="string"||typeof y=="string"?(f=ni(f),y=ni(y)):(f=hc(f),y=hc(y)),S=s(f,y)}return S}}function vc(s){return Ko(function(c){return c=Pt(c,st(qe())),ut(function(f){var y=this;return s(c,function(S){return An(S,y,f)})})})}function Wa(s,c){c=c===u?" ":ni(c);var f=c.length;if(f<2)return f?uc(c,s):c;var y=uc(c,Fr(s/Ce(c)));return Tt(c)?wo(je(y),0,s).join(""):y.slice(0,s)}function rf(s,c,f,y){var S=c&se,O=Ha(s);function F(){for(var W=-1,q=arguments.length,de=-1,he=y.length,ge=Y(he+q),Ee=this&&this!==gn&&this instanceof F?O:s;++de<he;)ge[de]=y[de];for(;q--;)ge[de++]=arguments[++W];return An(Ee,S?f:this,ge)}return F}function sf(s){return function(c,f,y){return y&&typeof y!="number"&&Dn(c,f,y)&&(f=y=u),c=Qo(c),f===u?(f=c,c=0):f=Qo(f),y=y===u?c<f?1:-1:Qo(y),Zt(c,f,y,s)}}function Ka(s){return function(c,f){return typeof c=="string"&&typeof f=="string"||(c=xi(c),f=xi(f)),s(c,f)}}function wc(s,c,f,y,S,O,F,W,q,de){var he=c&G,ge=he?F:u,Ee=he?u:F,Re=he?O:u,Qe=he?u:O;c|=he?ie:me,c&=~(he?me:ie),c&le||(c&=~(se|ue));var mt=[s,c,S,Re,ge,Qe,Ee,W,q,de],Ge=f.apply(u,mt);return Tc(s)&&Ec(Ge,mt),Ge.placeholder=y,fd(Ge,s,c)}function qa(s){var c=Rt[s];return function(f,y){if(f=xi(f),y=y==null?0:Gt(at(y),292),y&&_e(f)){var S=(It(f)+"e").split("e"),O=c(S[0]+"e"+(+S[1]+y));return S=(It(O)+"e").split("e"),+(S[0]+"e"+(+S[1]-y))}return c(f)}}var af=dr&&1/N(new dr([,-0]))[1]==xe?function(s){return new dr(s)}:cl;function id(s){return function(c){var f=In(c);return f==we?Ni(c):f==Mt?z(c):$l(c,s(c))}}function yo(s,c,f,y,S,O,F,W){var q=c&ue;if(!q&&typeof s!="function")throw new ei(m);var de=y?y.length:0;if(de||(c&=~(ie|me),y=S=u),F=F===u?F:dn(at(F),0),W=W===u?W:at(W),de-=S?S.length:0,c&me){var he=y,ge=S;y=S=u}var Ee=q?u:ad(s),Re=[s,c,f,y,S,he,ge,O,F,W];if(Ee&&Vt(Re,Ee),s=Re[0],c=Re[1],f=Re[2],y=Re[3],S=Re[4],W=Re[9]=Re[9]===u?q?0:s.length:dn(Re[9]-de,0),!W&&c&(G|ne)&&(c&=~(G|ne)),!c||c==se)var Qe=bc(s,c,f);else c==G||c==ne?Qe=of(s,c,W):(c==ie||c==(se|ie))&&!S.length?Qe=rf(s,c,f,y):Qe=Ua.apply(u,Re);var mt=Ee?Zh:Ec;return fd(mt(Qe,Re),s,c)}function od(s,c,f,y){return s===u||Qi(s,cr[f])&&!Lt.call(y,f)?c:s}function lf(s,c,f,y,S,O){return it(s)&&it(c)&&(O.set(c,s),ac(s,c,u,lf,O),O.delete(c)),s}function Ga(s){return To(s)?u:s}function cf(s,c,f,y,S,O){var F=f&$,W=s.length,q=c.length;if(W!=q&&!(F&&q>W))return!1;var de=O.get(s),he=O.get(c);if(de&&he)return de==c&&he==s;var ge=-1,Ee=!0,Re=f&Z?new xn:u;for(O.set(s,c),O.set(c,s);++ge<W;){var Qe=s[ge],mt=c[ge];if(y)var Ge=F?y(mt,Qe,ge,c,s,O):y(Qe,mt,ge,s,c,O);if(Ge!==u){if(Ge)continue;Ee=!1;break}if(Re){if(!sr(c,function(bt,wt){if(!Lo(Re,wt)&&(Qe===bt||S(Qe,bt,f,y,O)))return Re.push(wt)})){Ee=!1;break}}else if(!(Qe===mt||S(Qe,mt,f,y,O))){Ee=!1;break}}return O.delete(s),O.delete(c),Ee}function uf(s,c,f,y,S,O,F){switch(f){case ui:if(s.byteLength!=c.byteLength||s.byteOffset!=c.byteOffset)return!1;s=s.buffer,c=c.buffer;case io:return!(s.byteLength!=c.byteLength||!O(new ql(s),new ql(c)));case ot:case tt:case Ae:return Qi(+s,+c);case Je:return s.name==c.name&&s.message==c.message;case rn:case Fi:return s==c+"";case we:var W=Ni;case Mt:var q=y&$;if(W||(W=N),s.size!=c.size&&!q)return!1;var de=F.get(s);if(de)return de==c;y|=Z,F.set(s,c);var he=cf(W(s),W(c),y,S,O,F);return F.delete(s),he;case Zo:if(ct)return ct.call(s)==ct.call(c)}return!1}function Gr(s,c,f,y,S,O){var F=f&$,W=rd(s),q=W.length,de=rd(c),he=de.length;if(q!=he&&!F)return!1;for(var ge=q;ge--;){var Ee=W[ge];if(!(F?Ee in c:Lt.call(c,Ee)))return!1}var Re=O.get(s),Qe=O.get(c);if(Re&&Qe)return Re==c&&Qe==s;var mt=!0;O.set(s,c),O.set(c,s);for(var Ge=F;++ge<q;){Ee=W[ge];var bt=s[Ee],wt=c[Ee];if(y)var ri=F?y(wt,bt,Ee,c,s,O):y(bt,wt,Ee,s,c,O);if(!(ri===u?bt===wt||S(bt,wt,f,y,O):ri)){mt=!1;break}Ge||(Ge=Ee=="constructor")}if(mt&&!Ge){var Fn=s.constructor,Ci=c.constructor;Fn!=Ci&&"constructor"in s&&"constructor"in c&&!(typeof Fn=="function"&&Fn instanceof Fn&&typeof Ci=="function"&&Ci instanceof Ci)&&(mt=!1)}return O.delete(s),O.delete(c),mt}function Ko(s){return Sc(Qn(s,u,_f),s+"")}function rd(s){return Hh(s,bn,cd)}function sd(s){return Hh(s,jn,ud)}var ad=ec?function(s){return ec.get(s)}:cl;function _c(s){for(var c=s.name+"",f=hr[c],y=Lt.call(hr,c)?f.length:0;y--;){var S=f[y],O=S.func;if(O==null||O==s)return S.name}return c}function xs(s){var c=Lt.call(I,"placeholder")?I:s;return c.placeholder}function qe(){var s=I.iteratee||qc;return s=s===qc?Uu:s,arguments.length?s(arguments[0],arguments[1]):s}function kc(s,c){var f=s.__data__;return Qa(c)?f[typeof c=="string"?"string":"hash"]:f.map}function ld(s){for(var c=bn(s),f=c.length;f--;){var y=c[f],S=s[y];c[f]=[y,S,hd(S)]}return c}function vi(s,c){var f=bs(s,c);return Kh(f)?f:u}function om(s){var c=Lt.call(s,Vo),f=s[Vo];try{s[Vo]=u;var y=!0}catch{}var S=Vr.call(s);return y&&(c?s[Vo]=f:delete s[Vo]),S}var cd=Eu?function(s){return s==null?[]:(s=Ct(s),co(Eu(s),function(c){return xh.call(s,c)}))}:Vs,ud=Eu?function(s){for(var c=[];s;)uo(c,cd(s)),s=Na(s);return c}:Vs,In=qn;(Hr&&In(new Hr(new ArrayBuffer(1)))!=ui||ho&&In(new ho)!=we||Xl&&In(Xl.resolve())!=Nt||dr&&In(new dr)!=Mt||zo&&In(new zo)!=no)&&(In=function(s){var c=qn(s),f=c==rt?s.constructor:u,y=f?vr(f):"";if(y)switch(y){case Sh:return ui;case Vg:return we;case Ia:return Nt;case yn:return Mt;case zg:return no}return c});function rm(s,c,f){for(var y=-1,S=f.length;++y<S;){var O=f[y],F=O.size;switch(O.type){case"drop":s+=F;break;case"dropRight":c-=F;break;case"take":c=Gt(c,s+F);break;case"takeRight":s=dn(s,c-F);break}}return{start:s,end:c}}function sm(s){var c=s.match(Er);return c?c[1].split(ss):[]}function dd(s,c,f){c=fe(c,s);for(var y=-1,S=c.length,O=!1;++y<S;){var F=Co(c[y]);if(!(O=s!=null&&f(s,F)))break;s=s[F]}return O||++y!=S?O:(S=s==null?0:s.length,!!S&&es(S)&&Mn(F,S)&&(nt(s)||Zr(s)))}function am(s){var c=s.length,f=new s.constructor(c);return c&&typeof s[0]=="string"&&Lt.call(s,"index")&&(f.index=s.index,f.input=s.input),f}function yc(s){return typeof s.constructor=="function"&&!Cs(s)?fr(Na(s)):{}}function df(s,c,f){var y=s.constructor;switch(c){case io:return Ba(s);case ot:case tt:return new y(+s);case ui:return pc(s,f);case xr:case Po:case Cr:case Io:case di:case ft:case Yt:case un:case pn:return tf(s,f);case we:return new y;case Ae:case Fi:return new y(s);case rn:return gc(s);case Mt:return new y;case Zo:return Yu(s)}}function xc(s,c){var f=c.length;if(!f)return s;var y=f-1;return c[y]=(f>1?"& ":"")+c[y],c=c.join(f>2?", ":" "),s.replace(hi,`{ /* [wrapped with `+c+`] */ `)}function Oi(s){return nt(s)||Zr(s)||!!(Ch&&s&&s[Ch])}function Mn(s,c){var f=typeof s;return c=c??Le,!!c&&(f=="number"||f!="symbol"&&Cl.test(s))&&s>-1&&s%1==0&&s<c}function Dn(s,c,f){if(!it(f))return!1;var y=typeof c;return(y=="number"?nn(f)&&Mn(c,f.length):y=="string"&&c in f)?Qi(f[c],s):!1}function Cc(s,c){if(nt(s))return!1;var f=typeof s;return f=="number"||f=="symbol"||f=="boolean"||s==null||yi(s)?!0:yl.test(s)||!pu.test(s)||c!=null&&s in Ct(c)}function Qa(s){var c=typeof s;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?s!=="__proto__":s===null}function Tc(s){var c=_c(s),f=I[c];if(typeof f!="function"||!(c in vt.prototype))return!1;if(s===f)return!0;var y=ad(f);return!!y&&s===y[0]}function Ya(s){return!!_h&&_h in s}var Ja=Sa?Yi:qd;function Cs(s){var c=s&&s.constructor,f=typeof c=="function"&&c.prototype||cr;return s===f}function hd(s){return s===s&&!it(s)}function an(s,c){return function(f){return f==null?!1:f[s]===c&&(c!==u||s in Ct(f))}}function lm(s){var c=Rc(s,function(y){return f.size===B&&f.clear(),y}),f=c.cache;return c}function Vt(s,c){var f=s[1],y=c[1],S=f|y,O=S<(se|ue|pe),F=y==pe&&f==G||y==pe&&f==De&&s[7].length<=c[8]||y==(pe|De)&&c[7].length<=c[8]&&f==G;if(!(O||F))return s;y&se&&(s[2]=c[2],S|=f&se?0:le);var W=c[3];if(W){var q=s[3];s[3]=q?_o(q,W,c[4]):W,s[4]=q?A(s[3],T):c[4]}return W=c[5],W&&(q=s[5],s[5]=q?Zu(q,W,c[6]):W,s[6]=q?A(s[5],T):c[6]),W=c[7],W&&(s[7]=W),y&pe&&(s[8]=s[8]==null?c[8]:Gt(s[8],c[8])),s[9]==null&&(s[9]=c[9]),s[0]=c[0],s[1]=S,s}function Tn(s){var c=[];if(s!=null)for(var f in Ct(s))c.push(f);return c}function oi(s){return Vr.call(s)}function Qn(s,c,f){return c=dn(c===u?s.length-1:c,0),function(){for(var y=arguments,S=-1,O=dn(y.length-c,0),F=Y(O);++S<O;)F[S]=y[c+S];S=-1;for(var W=Y(c+1);++S<c;)W[S]=y[S];return W[c]=f(F),An(s,this,W)}}function xo(s,c){return c.length<2?s:Ho(s,bi(c,0,-1))}function mn(s,c){for(var f=s.length,y=Gt(c.length,f),S=ii(s);y--;){var O=c[y];s[y]=Mn(O,f)?S[O]:u}return s}function Bt(s,c){if(!(c==="constructor"&&typeof s[c]=="function")&&c!="__proto__")return s[c]}var Ec=Ts(Zh),Za=Eh||function(s,c){return gn.setTimeout(s,c)},Sc=Ts(Xh);function fd(s,c,f){var y=c+"";return Sc(s,xc(y,cm(sm(y),f)))}function Ts(s){var c=0,f=0;return function(){var y=Su(),S=ce-(y-f);if(f=y,S>0){if(++c>=te)return arguments[0]}else c=0;return s.apply(u,arguments)}}function Ac(s,c){var f=-1,y=s.length,S=y-1;for(c=c===u?y:c;++f<c;){var O=cc(f,S),F=s[O];s[O]=s[f],s[f]=F}return s.length=c,s}var pd=lm(function(s){var c=[];return s.charCodeAt(0)===46&&c.push(""),s.replace(gu,function(f,y,S,O){c.push(S?O.replace(tr,"$1"):y||f)}),c});function Co(s){if(typeof s=="string"||yi(s))return s;var c=s+"";return c=="0"&&1/s==-xe?"-0":c}function vr(s){if(s!=null){try{return Aa.call(s)}catch{}try{return s+""}catch{}}return""}function cm(s,c){return Zn(We,function(f){var y="_."+f[0];c&f[1]&&!fs(s,y)&&s.push(y)}),s.sort()}function hf(s){if(s instanceof vt)return s.clone();var c=new pi(s.__wrapped__,s.__chain__);return c.__actions__=ii(s.__actions__),c.__index__=s.__index__,c.__values__=s.__values__,c}function um(s,c,f){(f?Dn(s,c,f):c===u)?c=1:c=dn(at(c),0);var y=s==null?0:s.length;if(!y||c<1)return[];for(var S=0,O=0,F=Y(Fr(y/c));S<y;)F[O++]=bi(s,S,S+=c);return F}function ff(s){for(var c=-1,f=s==null?0:s.length,y=0,S=[];++c<f;){var O=s[c];O&&(S[y++]=O)}return S}function pf(){var s=arguments.length;if(!s)return[];for(var c=Y(s-1),f=arguments[0],y=s;y--;)c[y-1]=arguments[y];return uo(nt(f)?ii(f):[f],Pn(c,1))}var gf=ut(function(s,c){return ln(s)?Kr(s,Pn(c,1,ln,!0)):[]}),mf=ut(function(s,c){var f=wi(c);return ln(f)&&(f=u),ln(s)?Kr(s,Pn(c,1,ln,!0),qe(f,2)):[]}),bf=ut(function(s,c){var f=wi(c);return ln(f)&&(f=u),ln(s)?Kr(s,Pn(c,1,ln,!0),u,f):[]});function Xa(s,c,f){var y=s==null?0:s.length;return y?(c=f||c===u?1:at(c),bi(s,c<0?0:c,y)):[]}function En(s,c,f){var y=s==null?0:s.length;return y?(c=f||c===u?1:at(c),c=y-c,bi(s,0,c<0?0:c)):[]}function Gi(s,c){return s&&s.length?Dt(s,qe(c,3),!0,!0):[]}function On(s,c){return s&&s.length?Dt(s,qe(c,3),!0):[]}function dm(s,c,f,y){var S=s==null?0:s.length;return S?(f&&typeof f!="number"&&Dn(s,c,f)&&(f=0,y=S),sc(s,c,f,y)):[]}function vf(s,c,f){var y=s==null?0:s.length;if(!y)return-1;var S=f==null?0:at(f);return S<0&&(S=dn(y+S,0)),ar(s,qe(c,3),S)}function wf(s,c,f){var y=s==null?0:s.length;if(!y)return-1;var S=y-1;return f!==u&&(S=at(f),S=f<0?dn(y+S,0):Gt(S,y-1)),ar(s,qe(c,3),S,!0)}function _f(s){var c=s==null?0:s.length;return c?Pn(s,1):[]}function gd(s){var c=s==null?0:s.length;return c?Pn(s,xe):[]}function kf(s,c){var f=s==null?0:s.length;return f?(c=c===u?1:at(c),Pn(s,c)):[]}function yf(s){for(var c=-1,f=s==null?0:s.length,y={};++c<f;){var S=s[c];y[S[0]]=S[1]}return y}function xf(s){return s&&s.length?s[0]:u}function hm(s,c,f){var y=s==null?0:s.length;if(!y)return-1;var S=f==null?0:at(f);return S<0&&(S=dn(y+S,0)),Ro(s,c,S)}function fm(s){var c=s==null?0:s.length;return c?bi(s,0,-1):[]}var pm=ut(function(s){var c=Pt(s,Ki);return c.length&&c[0]===s[0]?Bu(c):[]}),Cf=ut(function(s){var c=wi(s),f=Pt(s,Ki);return c===wi(f)?c=u:f.pop(),f.length&&f[0]===s[0]?Bu(f,qe(c,2)):[]}),gm=ut(function(s){var c=wi(s),f=Pt(s,Ki);return c=typeof c=="function"?c:u,c&&f.pop(),f.length&&f[0]===s[0]?Bu(f,u,c):[]});function mm(s,c){return s==null?"":et.call(s,c)}function wi(s){var c=s==null?0:s.length;return c?s[c-1]:u}function Tf(s,c,f){var y=s==null?0:s.length;if(!y)return-1;var S=y;return f!==u&&(S=at(f),S=S<0?dn(y+S,0):Gt(S,y-1)),c===c?Pe(s,c,S):ar(s,jt,S,!0)}function Ef(s,c){return s&&s.length?Yh(s,at(c)):u}var bm=ut(md);function md(s,c){return s&&s.length&&c&&c.length?St(s,c):s}function vm(s,c,f){return s&&s.length&&c&&c.length?St(s,c,qe(f,2)):s}function bd(s,c,f){return s&&s.length&&c&&c.length?St(s,c,u,f):s}var Sf=Ko(function(s,c){var f=s==null?0:s.length,y=Ru(s,c);return za(s,Pt(c,function(S){return Mn(S,f)?+S:S}).sort(Ju)),y});function wm(s,c){var f=[];if(!(s&&s.length))return f;var y=-1,S=[],O=s.length;for(c=qe(c,3);++y<O;){var F=s[y];c(F,y,s)&&(f.push(F),S.push(y))}return za(s,S),f}function vd(s){return s==null?s:Lg.call(s)}function Af(s,c,f){var y=s==null?0:s.length;return y?(f&&typeof f!="number"&&Dn(s,c,f)?(c=0,f=y):(c=c==null?0:at(c),f=f===u?y:at(f)),bi(s,c,f)):[]}function _i(s,c){return Fa(s,c)}function wd(s,c,f){return dc(s,c,qe(f,2))}function _d(s,c){var f=s==null?0:s.length;if(f){var y=Fa(s,c);if(y<f&&Qi(s[y],c))return y}return-1}function kd(s,c){return Fa(s,c,!0)}function Qr(s,c,f){return dc(s,c,qe(f,2),!0)}function gt(s,c){var f=s==null?0:s.length;if(f){var y=Fa(s,c,!0)-1;if(Qi(s[y],c))return y}return-1}function ki(s){return s&&s.length?Gu(s):[]}function el(s,c){return s&&s.length?Gu(s,qe(c,2)):[]}function _m(s){var c=s==null?0:s.length;return c?bi(s,1,c):[]}function Nf(s,c,f){return s&&s.length?(c=f||c===u?1:at(c),bi(s,0,c<0?0:c)):[]}function Nc(s,c,f){var y=s==null?0:s.length;return y?(c=f||c===u?1:at(c),c=y-c,bi(s,c<0?0:c,y)):[]}function Pf(s,c){return s&&s.length?Dt(s,qe(c,3),!1,!0):[]}function km(s,c){return s&&s.length?Dt(s,qe(c,3)):[]}var ym=ut(function(s){return Uo(Pn(s,1,ln,!0))}),xm=ut(function(s){var c=wi(s);return ln(c)&&(c=u),Uo(Pn(s,1,ln,!0),qe(c,2))}),If=ut(function(s){var c=wi(s);return c=typeof c=="function"?c:u,Uo(Pn(s,1,ln,!0),u,c)});function Mf(s){return s&&s.length?Uo(s):[]}function Df(s,c){return s&&s.length?Uo(s,qe(c,2)):[]}function Of(s,c){return c=typeof c=="function"?c:u,s&&s.length?Uo(s,u,c):[]}function Pc(s){if(!(s&&s.length))return[];var c=0;return s=co(s,function(f){if(ln(f))return c=dn(f.length,c),!0}),Ca(c,function(f){return Pt(s,ka(f))})}function Yr(s,c){if(!(s&&s.length))return[];var f=Pc(s);return c==null?f:Pt(f,function(y){return An(c,u,y)})}var Ic=ut(function(s,c){return ln(s)?Kr(s,c):[]}),yd=ut(function(s){return br(co(s,ln))}),xd=ut(function(s){var c=wi(s);return ln(c)&&(c=u),br(co(s,ln),qe(c,2))}),jf=ut(function(s){var c=wi(s);return c=typeof c=="function"?c:u,br(co(s,ln),u,c)}),Cm=ut(Pc);function Mc(s,c){return Ot(s||[],c||[],Oa)}function Rf(s,c){return Ot(s||[],c||[],mi)}var Xt=ut(function(s){var c=s.length,f=c>1?s[c-1]:u;return f=typeof f=="function"?(s.pop(),f):u,Yr(s,f)});function Dc(s){var c=I(s);return c.__chain__=!0,c}function Es(s,c){return c(s),s}function Ss(s,c){return c(s)}var Lf=Ko(function(s){var c=s.length,f=c?s[0]:0,y=this.__wrapped__,S=function(O){return Ru(O,s)};return c>1||this.__actions__.length||!(y instanceof vt)||!Mn(f)?this.thru(S):(y=y.slice(f,+f+(c?1:0)),y.__actions__.push({func:Ss,args:[S],thisArg:u}),new pi(y,this.__chain__).thru(function(O){return c&&!O.length&&O.push(u),O}))});function Vf(){return Dc(this)}function zf(){return new pi(this.value(),this.__chain__)}function Tm(){this.__values__===u&&(this.__values__=Od(this.value()));var s=this.__index__>=this.__values__.length,c=s?u:this.__values__[this.__index__++];return{done:s,value:c}}function Ff(){return this}function Cd(s){for(var c,f=this;f instanceof Ma;){var y=hf(f);y.__index__=0,y.__values__=u,c?S.__wrapped__=y:c=y;var S=y;f=f.__wrapped__}return S.__wrapped__=s,c}function Bf(){var s=this.__wrapped__;if(s instanceof vt){var c=s;return this.__actions__.length&&(c=new vt(this)),c=c.reverse(),c.__actions__.push({func:Ss,args:[vd],thisArg:u}),new pi(c,this.__chain__)}return this.thru(vd)}function Hf(){return Wi(this.__wrapped__,this.__actions__)}var As=mc(function(s,c,f){Lt.call(s,f)?++s[f]:Fo(s,f,1)});function $f(s,c,f){var y=nt(s)?ba:Kg;return f&&Dn(s,c,f)&&(c=u),y(s,qe(c,3))}function Em(s,c){var f=nt(s)?co:Bh;return f(s,qe(c,3))}var Uf=td(vf),Td=td(wf);function Sm(s,c){return Pn(Oc(s,c),1)}function Am(s,c){return Pn(Oc(s,c),xe)}function Nm(s,c,f){return f=f===u?1:at(f),Pn(Oc(s,c),f)}function Wf(s,c){var f=nt(s)?Zn:Bo;return f(s,qe(c,3))}function Kf(s,c){var f=nt(s)?zl:bo;return f(s,qe(c,3))}var Pm=mc(function(s,c,f){Lt.call(s,f)?s[f].push(c):Fo(s,f,[c])});function Jr(s,c,f,y){s=nn(s)?s:Rs(s),f=f&&!y?at(f):0;var S=s.length;return f<0&&(f=dn(S+f,0)),rl(s)?f<=S&&s.indexOf(c,f)>-1:!!S&&Ro(s,c,f)>-1}var qf=ut(function(s,c,f){var y=-1,S=typeof c=="function",O=nn(s)?Y(s.length):[];return Bo(s,function(F){O[++y]=S?An(c,F,f):qr(F,c,f)}),O}),Gf=mc(function(s,c,f){Fo(s,f,c)});function Oc(s,c){var f=nt(s)?Pt:qh;return f(s,qe(c,3))}function Qf(s,c,f,y){return s==null?[]:(nt(c)||(c=c==null?[]:[c]),f=y?u:f,nt(f)||(f=f==null?[]:[f]),Ku(s,c,f))}var Im=mc(function(s,c,f){s[f?0:1].push(c)},function(){return[[],[]]});function Mm(s,c,f){var y=nt(s)?va:Hl,S=arguments.length<3;return y(s,qe(c,4),f,S,Bo)}function Dm(s,c,f){var y=nt(s)?ps:Hl,S=arguments.length<3;return y(s,qe(c,4),f,S,bo)}function Om(s,c){var f=nt(s)?co:Bh;return f(s,nl(qe(c,3)))}function Ed(s){var c=nt(s)?Ur:ti;return c(s)}function Sd(s,c,f){(f?Dn(s,c,f):c===u)?c=1:c=at(c);var y=nt(s)?Vh:Mi;return y(s,c)}function Ad(s){var c=nt(s)?zh:nm;return c(s)}function Nd(s){if(s==null)return 0;if(nn(s))return rl(s)?Ce(s):s.length;var c=In(s);return c==we||c==Mt?s.size:Wu(s).length}function Yf(s,c,f){var y=nt(s)?sr:ef;return f&&Dn(s,c,f)&&(c=u),y(s,qe(c,3))}var Jf=ut(function(s,c){if(s==null)return[];var f=c.length;return f>1&&Dn(s,c[0],c[1])?c=[]:f>2&&Dn(c[0],c[1],c[2])&&(c=[c[0]]),Ku(s,Pn(c,1),[])}),dt=Ql||function(){return gn.Date.now()};function Pd(s,c){if(typeof c!="function")throw new ei(m);return s=at(s),function(){if(--s<1)return c.apply(this,arguments)}}function Vn(s,c,f){return c=f?u:c,c=s&&c==null?s.length:c,yo(s,pe,u,u,u,u,c)}function zn(s,c){var f;if(typeof c!="function")throw new ei(m);return s=at(s),function(){return--s>0&&(f=c.apply(this,arguments)),s<=1&&(c=u),f}}var Ns=ut(function(s,c,f){var y=se;if(f.length){var S=A(f,xs(Ns));y|=ie}return yo(s,y,c,f,S)}),tl=ut(function(s,c,f){var y=se|ue;if(f.length){var S=A(f,xs(tl));y|=ie}return yo(c,y,s,f,S)});function Zf(s,c,f){c=f?u:c;var y=yo(s,G,u,u,u,u,u,c);return y.placeholder=Zf.placeholder,y}function Xf(s,c,f){c=f?u:c;var y=yo(s,ne,u,u,u,u,u,c);return y.placeholder=Xf.placeholder,y}function Ps(s,c,f){var y,S,O,F,W,q,de=0,he=!1,ge=!1,Ee=!0;if(typeof s!="function")throw new ei(m);c=xi(c)||0,it(f)&&(he=!!f.leading,ge="maxWait"in f,O=ge?dn(xi(f.maxWait)||0,c):O,Ee="trailing"in f?!!f.trailing:Ee);function Re(hn){var Zi=y,Yo=S;return y=S=u,de=hn,F=s.apply(Yo,Zi),F}function Qe(hn){return de=hn,W=Za(bt,c),he?Re(hn):F}function mt(hn){var Zi=hn-q,Yo=hn-de,Zd=c-Zi;return ge?Gt(Zd,O-Yo):Zd}function Ge(hn){var Zi=hn-q,Yo=hn-de;return q===u||Zi>=c||Zi<0||ge&&Yo>=O}function bt(){var hn=dt();if(Ge(hn))return wt(hn);W=Za(bt,mt(hn))}function wt(hn){return W=u,Ee&&y?Re(hn):(y=S=u,F)}function ri(){W!==u&&Qu(W),de=0,y=q=S=W=u}function Fn(){return W===u?F:wt(dt())}function Ci(){var hn=dt(),Zi=Ge(hn);if(y=arguments,S=this,q=hn,Zi){if(W===u)return Qe(q);if(ge)return Qu(W),W=Za(bt,c),Re(q)}return W===u&&(W=Za(bt,c)),F}return Ci.cancel=ri,Ci.flush=Fn,Ci}var jm=ut(function(s,c){return Wr(s,1,c)}),jc=ut(function(s,c,f){return Wr(s,xi(c)||0,f)});function ep(s){return yo(s,Ie)}function Rc(s,c){if(typeof s!="function"||c!=null&&typeof c!="function")throw new ei(m);var f=function(){var y=arguments,S=c?c.apply(this,y):y[0],O=f.cache;if(O.has(S))return O.get(S);var F=s.apply(this,y);return f.cache=O.set(S,F)||O,F};return f.cache=new(Rc.Cache||go),f}Rc.Cache=go;function nl(s){if(typeof s!="function")throw new ei(m);return function(){var c=arguments;switch(c.length){case 0:return!s.call(this);case 1:return!s.call(this,c[0]);case 2:return!s.call(this,c[0],c[1]);case 3:return!s.call(this,c[0],c[1],c[2])}return!s.apply(this,c)}}function tp(s){return zn(2,s)}var Rm=_s(function(s,c){c=c.length==1&&nt(c[0])?Pt(c[0],st(qe())):Pt(Pn(c,1),st(qe()));var f=c.length;return ut(function(y){for(var S=-1,O=Gt(y.length,f);++S<O;)y[S]=c[S].call(this,y[S]);return An(s,this,y)})}),il=ut(function(s,c){var f=A(c,xs(il));return yo(s,ie,u,c,f)}),kt=ut(function(s,c){var f=A(c,xs(kt));return yo(s,me,u,c,f)}),Lm=Ko(function(s,c){return yo(s,De,u,u,u,c)});function np(s,c){if(typeof s!="function")throw new ei(m);return c=c===u?c:at(c),ut(s,c)}function Vm(s,c){if(typeof s!="function")throw new ei(m);return c=c==null?0:dn(at(c),0),ut(function(f){var y=f[c],S=wo(f,0,c);return y&&uo(S,y),An(s,this,S)})}function zm(s,c,f){var y=!0,S=!0;if(typeof s!="function")throw new ei(m);return it(f)&&(y="leading"in f?!!f.leading:y,S="trailing"in f?!!f.trailing:S),Ps(s,c,{leading:y,maxWait:c,trailing:S})}function ip(s){return Vn(s,1)}function op(s,c){return il(Wo(c),s)}function rp(){if(!arguments.length)return[];var s=arguments[0];return nt(s)?s:[s]}function sp(s){return gi(s,j)}function Is(s,c){return c=typeof c=="function"?c:u,gi(s,j,c)}function Fm(s){return gi(s,L|j)}function Lc(s,c){return c=typeof c=="function"?c:u,gi(s,L|j,c)}function Ms(s,c){return c==null||ja(s,c,bn(c))}function Qi(s,c){return s===c||s!==s&&c!==c}var Bm=Ka(Fu),Id=Ka(function(s,c){return s>=c}),Zr=$o(function(){return arguments}())?$o:function(s){return en(s)&&Lt.call(s,"callee")&&!xh.call(s,"callee")},nt=Y.isArray,ap=lo?st(lo):Gg;function nn(s){return s!=null&&es(s.length)&&!Yi(s)}function ln(s){return en(s)&&nn(s)}function Hm(s){return s===!0||s===!1||en(s)&&qn(s)==ot}var qo=Br||qd,lp=Or?st(Or):Hu;function Vc(s){return en(s)&&s.nodeType===1&&!To(s)}function cp(s){if(s==null)return!0;if(nn(s)&&(nt(s)||typeof s=="string"||typeof s.splice=="function"||qo(s)||Ds(s)||Zr(s)))return!s.length;var c=In(s);if(c==we||c==Mt)return!s.size;if(Cs(s))return!Wu(s).length;for(var f in s)if(Lt.call(s,f))return!1;return!0}function up(s,c){return La(s,c)}function $m(s,c,f){f=typeof f=="function"?f:u;var y=f?f(s,c):u;return y===u?La(s,c,u,f):!!y}function Xr(s){if(!en(s))return!1;var c=qn(s);return c==Je||c==$e||typeof s.message=="string"&&typeof s.name=="string"&&!To(s)}function dp(s){return typeof s=="number"&&_e(s)}function Yi(s){if(!it(s))return!1;var c=qn(s);return c==qt||c==Qt||c==ht||c==wn}function hp(s){return typeof s=="number"&&s==at(s)}function es(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=Le}function it(s){var c=typeof s;return s!=null&&(c=="object"||c=="function")}function en(s){return s!=null&&typeof s=="object"}var fp=hs?st(hs):Yg;function Um(s,c){return s===c||$u(s,c,ld(c))}function zc(s,c,f){return f=typeof f=="function"?f:u,$u(s,c,ld(c),f)}function Wm(s){return pp(s)&&s!=+s}function Md(s){if(Ja(s))throw new Ze(k);return Kh(s)}function ol(s){return s===null}function Km(s){return s==null}function pp(s){return typeof s=="number"||en(s)&&qn(s)==Ae}function To(s){if(!en(s)||qn(s)!=rt)return!1;var c=Na(s);if(c===null)return!0;var f=Lt.call(c,"constructor")&&c.constructor;return typeof f=="function"&&f instanceof f&&Aa.call(f)==Tu}var Go=Vl?st(Vl):Jg;function gp(s){return hp(s)&&s>=-Le&&s<=Le}var Dd=jr?st(jr):Zg;function rl(s){return typeof s=="string"||!nt(s)&&en(s)&&qn(s)==Fi}function yi(s){return typeof s=="symbol"||en(s)&&qn(s)==Zo}var Ds=rr?st(rr):Xg;function qm(s){return s===u}function mp(s){return en(s)&&In(s)==no}function bp(s){return en(s)&&qn(s)==Ks}var sl=Ka(Va),Gm=Ka(function(s,c){return s<=c});function Od(s){if(!s)return[];if(nn(s))return rl(s)?je(s):ii(s);if(zr&&s[zr])return Ea(s[zr]());var c=In(s),f=c==we?Ni:c==Mt?N:Rs;return f(s)}function Qo(s){if(!s)return s===0?s:0;if(s=xi(s),s===xe||s===-xe){var c=s<0?-1:1;return c*Fe}return s===s?s:0}function at(s){var c=Qo(s),f=c%1;return c===c?f?c-f:c:0}function jd(s){return s?mo(at(s),0,Ve):0}function xi(s){if(typeof s=="number")return s;if(yi(s))return Ye;if(it(s)){var c=typeof s.valueOf=="function"?s.valueOf():s;s=it(c)?c+"":c}if(typeof s!="string")return s===0?s:+s;s=Ul(s);var f=Qs.test(s);return f||bu.test(s)?fa(s.slice(2),f?2:8):$t.test(s)?Ye:+s}function Rd(s){return qi(s,jn(s))}function Qm(s){return s?mo(at(s),-Le,Le):s===0?s:0}function It(s){return s==null?"":ni(s)}var Ym=ks(function(s,c){if(Cs(c)||nn(c)){qi(c,bn(c),s);return}for(var f in c)Lt.call(c,f)&&Oa(s,f,c[f])}),Ld=ks(function(s,c){qi(c,jn(c),s)}),Os=ks(function(s,c,f,y){qi(c,jn(c),s,y)}),Jm=ks(function(s,c,f,y){qi(c,bn(c),s,y)}),Zm=Ko(Ru);function vp(s,c){var f=fr(s);return c==null?f:ju(f,c)}var Xm=ut(function(s,c){s=Ct(s);var f=-1,y=c.length,S=y>2?c[2]:u;for(S&&Dn(c[0],c[1],S)&&(y=1);++f<y;)for(var O=c[f],F=jn(O),W=-1,q=F.length;++W<q;){var de=F[W],he=s[de];(he===u||Qi(he,cr[de])&&!Lt.call(s,de))&&(s[de]=O[de])}return s}),eb=ut(function(s){return s.push(u,lf),An(Cp,u,s)});function tb(s,c){return wa(s,qe(c,3),vo)}function nb(s,c){return wa(s,qe(c,3),zu)}function ib(s,c){return s==null?s:Lu(s,qe(c,3),jn)}function wp(s,c){return s==null?s:Vu(s,qe(c,3),jn)}function ob(s,c){return s&&vo(s,qe(c,3))}function rb(s,c){return s&&zu(s,qe(c,3))}function _p(s){return s==null?[]:Ra(s,bn(s))}function kp(s){return s==null?[]:Ra(s,jn(s))}function Fc(s,c,f){var y=s==null?u:Ho(s,c);return y===u?f:y}function sb(s,c){return s!=null&&dd(s,c,$h)}function Bc(s,c){return s!=null&&dd(s,c,qg)}var Vd=nd(function(s,c,f){c!=null&&typeof c.toString!="function"&&(c=Vr.call(c)),s[c]=f},Wc(Yn)),yp=nd(function(s,c,f){c!=null&&typeof c.toString!="function"&&(c=Vr.call(c)),Lt.call(s,c)?s[c].push(f):s[c]=[f]},qe),zd=ut(qr);function bn(s){return nn(s)?Du(s):Wu(s)}function jn(s){return nn(s)?Du(s,!0):em(s)}function Hc(s,c){var f={};return c=qe(c,3),vo(s,function(y,S,O){Fo(f,c(y,S,O),y)}),f}function xp(s,c){var f={};return c=qe(c,3),vo(s,function(y,S,O){Fo(f,S,c(y,S,O))}),f}var ab=ks(function(s,c,f){ac(s,c,f)}),Cp=ks(function(s,c,f,y){ac(s,c,f,y)}),lb=Ko(function(s,c){var f={};if(s==null)return f;var y=!1;c=Pt(c,function(O){return O=fe(O,s),y||(y=O.length>1),O}),qi(s,sd(s),f),y&&(f=gi(f,L|U|j,Ga));for(var S=c.length;S--;)fc(f,c[S]);return f});function Tp(s,c){return Ep(s,nl(qe(c)))}var cb=Ko(function(s,c){return s==null?{}:lc(s,c)});function Ep(s,c){if(s==null)return{};var f=Pt(sd(s),function(y){return[y]});return c=qe(c),qu(s,f,function(y,S){return c(y,S[0])})}function ub(s,c,f){c=fe(c,s);var y=-1,S=c.length;for(S||(S=1,s=u);++y<S;){var O=s==null?u:s[Co(c[y])];O===u&&(y=S,O=f),s=Yi(O)?O.call(s):O}return s}function db(s,c,f){return s==null?s:mi(s,c,f)}function js(s,c,f,y){return y=typeof y=="function"?y:u,s==null?s:mi(s,c,f,y)}var ts=id(bn),Fd=id(jn);function Sp(s,c,f){var y=nt(s),S=y||qo(s)||Ds(s);if(c=qe(c,4),f==null){var O=s&&s.constructor;S?f=y?new O:[]:it(s)?f=Yi(O)?fr(Na(s)):{}:f={}}return(S?Zn:vo)(s,function(F,W,q){return c(f,F,W,q)}),f}function hb(s,c){return s==null?!0:fc(s,c)}function fb(s,c,f){return s==null?s:mr(s,c,Wo(f))}function pb(s,c,f,y){return y=typeof y=="function"?y:u,s==null?s:mr(s,c,Wo(f),y)}function Rs(s){return s==null?[]:Rr(s,bn(s))}function gb(s){return s==null?[]:Rr(s,jn(s))}function Ap(s,c,f){return f===u&&(f=c,c=u),f!==u&&(f=xi(f),f=f===f?f:0),c!==u&&(c=xi(c),c=c===c?c:0),mo(xi(s),c,f)}function Np(s,c,f){return c=Qo(c),f===u?(f=c,c=0):f=Qo(f),s=xi(s),Uh(s,c,f)}function mb(s,c,f){if(f&&typeof f!="boolean"&&Dn(s,c,f)&&(c=f=u),f===u&&(typeof c=="boolean"?(f=c,c=u):typeof s=="boolean"&&(f=s,s=u)),s===u&&c===u?(s=0,c=1):(s=Qo(s),c===u?(c=s,s=0):c=Qo(c)),s>c){var y=s;s=c,c=y}if(f||s%1||c%1){var S=Zl();return Gt(s+S*(c-s+ha("1e-"+((S+"").length-1))),c)}return cc(s,c)}var Pp=Gn(function(s,c,f){return c=c.toLowerCase(),s+(f?Bd(c):c)});function Bd(s){return $d(It(s).toLowerCase())}function Ji(s){return s=It(s),s&&s.replace(Tl,Lr).replace(aa,"")}function Hd(s,c,f){s=It(s),c=ni(c);var y=s.length;f=f===u?y:mo(at(f),0,y);var S=f;return f-=c.length,f>=0&&s.slice(f,S)==c}function bb(s){return s=It(s),s&&rs.test(s)?s.replace(xt,Wn):s}function vb(s){return s=It(s),s&&er.test(s)?s.replace(Tr,"\\$&"):s}var wb=Gn(function(s,c,f){return s+(f?"-":"")+c.toLowerCase()}),_b=Gn(function(s,c,f){return s+(f?" ":"")+c.toLowerCase()}),wr=ed("toLowerCase");function Ls(s,c,f){s=It(s),c=at(c);var y=c?Ce(s):0;if(!c||y>=c)return s;var S=(c-y)/2;return Wa(Pa(S),f)+s+Wa(Fr(S),f)}function Ip(s,c,f){s=It(s),c=at(c);var y=c?Ce(s):0;return c&&y<c?s+Wa(c-y,f):s}function $c(s,c,f){s=It(s),c=at(c);var y=c?Ce(s):0;return c&&y<c?Wa(c-y,f)+s:s}function Mp(s,c,f){return f||c==null?c=0:c&&(c=+c),Jl(It(s).replace(qs,""),c||0)}function kb(s,c,f){return(f?Dn(s,c,f):c===u)?c=1:c=at(c),uc(It(s),c)}function yb(){var s=arguments,c=It(s[0]);return s.length<3?c:c.replace(s[1],s[2])}var xb=Gn(function(s,c,f){return s+(f?"_":"")+c.toLowerCase()});function Cb(s,c,f){return f&&typeof f!="number"&&Dn(s,c,f)&&(c=f=u),f=f===u?Ve:f>>>0,f?(s=It(s),s&&(typeof c=="string"||c!=null&&!Go(c))&&(c=ni(c),!c&&Tt(s))?wo(je(s),0,f):s.split(c,f)):[]}var Tb=Gn(function(s,c,f){return s+(f?" ":"")+$d(c)});function Uc(s,c,f){return s=It(s),f=f==null?0:mo(at(f),0,s.length),c=ni(c),s.slice(f,f+c.length)==c}function Dp(s,c,f){var y=I.templateSettings;f&&Dn(s,c,f)&&(c=u),s=It(s),c=Os({},c,y,od);var S=Os({},c.imports,y.imports,od),O=bn(S),F=Rr(S,O),W,q,de=0,he=c.interpolate||ze,ge="__p += '",Ee=Kl((c.escape||ze).source+"|"+he.source+"|"+(he===Mo?Gs:ze).source+"|"+(c.evaluate||ze).source+"|$","g"),Re="//# sourceURL="+(Lt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Rl+"]")+` `;s.replace(Ee,function(Ge,bt,wt,ri,Fn,Ci){return wt||(wt=ri),ge+=s.slice(de,Ci).replace(ve,Xn),bt&&(W=!0,ge+=`' + __e(`+bt+`) + '`),Fn&&(q=!0,ge+=`'; `+Fn+`; __p += '`),wt&&(ge+=`' + ((__t = (`+wt+`)) == null ? '' : __t) + '`),de=Ci+Ge.length,Ge}),ge+=`'; `;var Qe=Lt.call(c,"variable")&&c.variable;if(!Qe)ge=`with (obj) { `+ge+` } `;else if(Ar.test(Qe))throw new Ze(C);ge=(q?ge.replace(Cn,""):ge).replace(Sn,"$1").replace(sn,"$1;"),ge="function("+(Qe||"obj")+`) { `+(Qe?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(W?", __e = _.escape":"")+(q?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+ge+`return __p }`;var mt=Ud(function(){return Xe(O,Re+"return "+ge).apply(u,F)});if(mt.source=ge,Xr(mt))throw mt;return mt}function Op(s){return It(s).toLowerCase()}function Eb(s){return It(s).toUpperCase()}function Sb(s,c,f){if(s=It(s),s&&(f||c===u))return Ul(s);if(!s||!(c=ni(c)))return s;var y=je(s),S=je(c),O=Ai(y,S),F=ms(y,S)+1;return wo(y,O,F).join("")}function Ab(s,c,f){if(s=It(s),s&&(f||c===u))return s.slice(0,Ke(s)+1);if(!s||!(c=ni(c)))return s;var y=je(s),S=ms(y,je(c))+1;return wo(y,0,S).join("")}function Nb(s,c,f){if(s=It(s),s&&(f||c===u))return s.replace(qs,"");if(!s||!(c=ni(c)))return s;var y=je(s),S=Ai(y,je(c));return wo(y,S).join("")}function jp(s,c){var f=Me,y=Ue;if(it(c)){var S="separator"in c?c.separator:S;f="length"in c?at(c.length):f,y="omission"in c?ni(c.omission):y}s=It(s);var O=s.length;if(Tt(s)){var F=je(s);O=F.length}if(f>=O)return s;var W=f-Ce(y);if(W<1)return y;var q=F?wo(F,0,W).join(""):s.slice(0,W);if(S===u)return q+y;if(F&&(W+=q.length-W),Go(S)){if(s.slice(W).search(S)){var de,he=q;for(S.global||(S=Kl(S.source,It(Do.exec(S))+"g")),S.lastIndex=0;de=S.exec(he);)var ge=de.index;q=q.slice(0,ge===u?W:ge)}}else if(s.indexOf(ni(S),W)!=W){var Ee=q.lastIndexOf(S);Ee>-1&&(q=q.slice(0,Ee))}return q+y}function Pb(s){return s=It(s),s&&oo.test(s)?s.replace(Ei,Et):s}var Ib=Gn(function(s,c,f){return s+(f?" ":"")+c.toUpperCase()}),$d=ed("toUpperCase");function Rp(s,c,f){return s=It(s),c=f?u:c,c===u?Ta(s)?Pi(s):Fl(s):s.match(c)||[]}var Ud=ut(function(s,c){try{return An(s,u,c)}catch(f){return Xr(f)?f:new Ze(f)}}),Mb=Ko(function(s,c){return Zn(c,function(f){f=Co(f),Fo(s,f,Ns(s[f],s))}),s});function al(s){var c=s==null?0:s.length,f=qe();return s=c?Pt(s,function(y){if(typeof y[1]!="function")throw new ei(m);return[f(y[0]),y[1]]}):[],ut(function(y){for(var S=-1;++S<c;){var O=s[S];if(An(O[0],this,y))return An(O[1],this,y)}})}function Db(s){return Fh(gi(s,L))}function Wc(s){return function(){return s}}function Ob(s,c){return s==null||s!==s?c:s}var jb=$a(),Kc=$a(!0);function Yn(s){return s}function qc(s){return Uu(typeof s=="function"?s:gi(s,L))}function Lp(s){return Gh(gi(s,L))}function Rb(s,c){return Qh(s,gi(c,L))}var Wd=ut(function(s,c){return function(f){return qr(f,s,c)}}),Lb=ut(function(s,c){return function(f){return qr(s,f,c)}});function ll(s,c,f){var y=bn(c),S=Ra(c,y);f==null&&!(it(c)&&(S.length||!y.length))&&(f=c,c=s,s=this,S=Ra(c,bn(c)));var O=!(it(f)&&"chain"in f)||!!f.chain,F=Yi(s);return Zn(S,function(W){var q=c[W];s[W]=q,F&&(s.prototype[W]=function(){var de=this.__chain__;if(O||de){var he=s(this.__wrapped__),ge=he.__actions__=ii(this.__actions__);return ge.push({func:q,args:arguments,thisArg:s}),he.__chain__=de,he}return q.apply(s,uo([this.value()],arguments))})}),s}function Vp(){return gn._===this&&(gn._=jg),this}function cl(){}function Eo(s){return s=at(s),ut(function(c){return Yh(c,s)})}var zp=vc(Pt),Vb=vc(ba),zb=vc(sr);function Kd(s){return Cc(s)?ka(Co(s)):Jh(s)}function Fb(s){return function(c){return s==null?u:Ho(s,c)}}var Fp=sf(),Bp=sf(!0);function Vs(){return[]}function qd(){return!1}function Bb(){return{}}function Hp(){return""}function $p(){return!0}function Up(s,c){if(s=at(s),s<1||s>Le)return[];var f=Ve,y=Gt(s,Ve);c=qe(c),s-=Ve;for(var S=Ca(y,c);++f<s;)c(f);return S}function Hb(s){return nt(s)?Pt(s,Co):yi(s)?[s]:ii(pd(It(s)))}function $b(s){var c=++Og;return It(s)+c}var Ub=ys(function(s,c){return s+c},0),Gd=qa("ceil"),Qd=ys(function(s,c){return s/c},1),Wb=qa("floor");function Kb(s){return s&&s.length?rc(s,Yn,Fu):u}function Wp(s,c){return s&&s.length?rc(s,qe(c,2),Fu):u}function qb(s){return _a(s,Yn)}function Gb(s,c){return _a(s,qe(c,2))}function Qb(s){return s&&s.length?rc(s,Yn,Va):u}function Kp(s,c){return s&&s.length?rc(s,qe(c,2),Va):u}var qp=ys(function(s,c){return s*c},1),Yd=qa("round"),Jd=ys(function(s,c){return s-c},0);function Gp(s){return s&&s.length?xa(s,Yn):0}function Qp(s,c){return s&&s.length?xa(s,qe(c,2)):0}return I.after=Pd,I.ary=Vn,I.assign=Ym,I.assignIn=Ld,I.assignInWith=Os,I.assignWith=Jm,I.at=Zm,I.before=zn,I.bind=Ns,I.bindAll=Mb,I.bindKey=tl,I.castArray=rp,I.chain=Dc,I.chunk=um,I.compact=ff,I.concat=pf,I.cond=al,I.conforms=Db,I.constant=Wc,I.countBy=As,I.create=vp,I.curry=Zf,I.curryRight=Xf,I.debounce=Ps,I.defaults=Xm,I.defaultsDeep=eb,I.defer=jm,I.delay=jc,I.difference=gf,I.differenceBy=mf,I.differenceWith=bf,I.drop=Xa,I.dropRight=En,I.dropRightWhile=Gi,I.dropWhile=On,I.fill=dm,I.filter=Em,I.flatMap=Sm,I.flatMapDeep=Am,I.flatMapDepth=Nm,I.flatten=_f,I.flattenDeep=gd,I.flattenDepth=kf,I.flip=ep,I.flow=jb,I.flowRight=Kc,I.fromPairs=yf,I.functions=_p,I.functionsIn=kp,I.groupBy=Pm,I.initial=fm,I.intersection=pm,I.intersectionBy=Cf,I.intersectionWith=gm,I.invert=Vd,I.invertBy=yp,I.invokeMap=qf,I.iteratee=qc,I.keyBy=Gf,I.keys=bn,I.keysIn=jn,I.map=Oc,I.mapKeys=Hc,I.mapValues=xp,I.matches=Lp,I.matchesProperty=Rb,I.memoize=Rc,I.merge=ab,I.mergeWith=Cp,I.method=Wd,I.methodOf=Lb,I.mixin=ll,I.negate=nl,I.nthArg=Eo,I.omit=lb,I.omitBy=Tp,I.once=tp,I.orderBy=Qf,I.over=zp,I.overArgs=Rm,I.overEvery=Vb,I.overSome=zb,I.partial=il,I.partialRight=kt,I.partition=Im,I.pick=cb,I.pickBy=Ep,I.property=Kd,I.propertyOf=Fb,I.pull=bm,I.pullAll=md,I.pullAllBy=vm,I.pullAllWith=bd,I.pullAt=Sf,I.range=Fp,I.rangeRight=Bp,I.rearg=Lm,I.reject=Om,I.remove=wm,I.rest=np,I.reverse=vd,I.sampleSize=Sd,I.set=db,I.setWith=js,I.shuffle=Ad,I.slice=Af,I.sortBy=Jf,I.sortedUniq=ki,I.sortedUniqBy=el,I.split=Cb,I.spread=Vm,I.tail=_m,I.take=Nf,I.takeRight=Nc,I.takeRightWhile=Pf,I.takeWhile=km,I.tap=Es,I.throttle=zm,I.thru=Ss,I.toArray=Od,I.toPairs=ts,I.toPairsIn=Fd,I.toPath=Hb,I.toPlainObject=Rd,I.transform=Sp,I.unary=ip,I.union=ym,I.unionBy=xm,I.unionWith=If,I.uniq=Mf,I.uniqBy=Df,I.uniqWith=Of,I.unset=hb,I.unzip=Pc,I.unzipWith=Yr,I.update=fb,I.updateWith=pb,I.values=Rs,I.valuesIn=gb,I.without=Ic,I.words=Rp,I.wrap=op,I.xor=yd,I.xorBy=xd,I.xorWith=jf,I.zip=Cm,I.zipObject=Mc,I.zipObjectDeep=Rf,I.zipWith=Xt,I.entries=ts,I.entriesIn=Fd,I.extend=Ld,I.extendWith=Os,ll(I,I),I.add=Ub,I.attempt=Ud,I.camelCase=Pp,I.capitalize=Bd,I.ceil=Gd,I.clamp=Ap,I.clone=sp,I.cloneDeep=Fm,I.cloneDeepWith=Lc,I.cloneWith=Is,I.conformsTo=Ms,I.deburr=Ji,I.defaultTo=Ob,I.divide=Qd,I.endsWith=Hd,I.eq=Qi,I.escape=bb,I.escapeRegExp=vb,I.every=$f,I.find=Uf,I.findIndex=vf,I.findKey=tb,I.findLast=Td,I.findLastIndex=wf,I.findLastKey=nb,I.floor=Wb,I.forEach=Wf,I.forEachRight=Kf,I.forIn=ib,I.forInRight=wp,I.forOwn=ob,I.forOwnRight=rb,I.get=Fc,I.gt=Bm,I.gte=Id,I.has=sb,I.hasIn=Bc,I.head=xf,I.identity=Yn,I.includes=Jr,I.indexOf=hm,I.inRange=Np,I.invoke=zd,I.isArguments=Zr,I.isArray=nt,I.isArrayBuffer=ap,I.isArrayLike=nn,I.isArrayLikeObject=ln,I.isBoolean=Hm,I.isBuffer=qo,I.isDate=lp,I.isElement=Vc,I.isEmpty=cp,I.isEqual=up,I.isEqualWith=$m,I.isError=Xr,I.isFinite=dp,I.isFunction=Yi,I.isInteger=hp,I.isLength=es,I.isMap=fp,I.isMatch=Um,I.isMatchWith=zc,I.isNaN=Wm,I.isNative=Md,I.isNil=Km,I.isNull=ol,I.isNumber=pp,I.isObject=it,I.isObjectLike=en,I.isPlainObject=To,I.isRegExp=Go,I.isSafeInteger=gp,I.isSet=Dd,I.isString=rl,I.isSymbol=yi,I.isTypedArray=Ds,I.isUndefined=qm,I.isWeakMap=mp,I.isWeakSet=bp,I.join=mm,I.kebabCase=wb,I.last=wi,I.lastIndexOf=Tf,I.lowerCase=_b,I.lowerFirst=wr,I.lt=sl,I.lte=Gm,I.max=Kb,I.maxBy=Wp,I.mean=qb,I.meanBy=Gb,I.min=Qb,I.minBy=Kp,I.stubArray=Vs,I.stubFalse=qd,I.stubObject=Bb,I.stubString=Hp,I.stubTrue=$p,I.multiply=qp,I.nth=Ef,I.noConflict=Vp,I.noop=cl,I.now=dt,I.pad=Ls,I.padEnd=Ip,I.padStart=$c,I.parseInt=Mp,I.random=mb,I.reduce=Mm,I.reduceRight=Dm,I.repeat=kb,I.replace=yb,I.result=ub,I.round=Yd,I.runInContext=K,I.sample=Ed,I.size=Nd,I.snakeCase=xb,I.some=Yf,I.sortedIndex=_i,I.sortedIndexBy=wd,I.sortedIndexOf=_d,I.sortedLastIndex=kd,I.sortedLastIndexBy=Qr,I.sortedLastIndexOf=gt,I.startCase=Tb,I.startsWith=Uc,I.subtract=Jd,I.sum=Gp,I.sumBy=Qp,I.template=Dp,I.times=Up,I.toFinite=Qo,I.toInteger=at,I.toLength=jd,I.toLower=Op,I.toNumber=xi,I.toSafeInteger=Qm,I.toString=It,I.toUpper=Eb,I.trim=Sb,I.trimEnd=Ab,I.trimStart=Nb,I.truncate=jp,I.unescape=Pb,I.uniqueId=$b,I.upperCase=Ib,I.upperFirst=$d,I.each=Wf,I.eachRight=Kf,I.first=xf,ll(I,function(){var s={};return vo(I,function(c,f){Lt.call(I.prototype,f)||(s[f]=c)}),s}(),{chain:!1}),I.VERSION=g,Zn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(s){I[s].placeholder=I}),Zn(["drop","take"],function(s,c){vt.prototype[s]=function(f){f=f===u?1:dn(at(f),0);var y=this.__filtered__&&!c?new vt(this):this.clone();return y.__filtered__?y.__takeCount__=Gt(f,y.__takeCount__):y.__views__.push({size:Gt(f,Ve),type:s+(y.__dir__<0?"Right":"")}),y},vt.prototype[s+"Right"]=function(f){return this.reverse()[s](f).reverse()}}),Zn(["filter","map","takeWhile"],function(s,c){var f=c+1,y=f==be||f==Ne;vt.prototype[s]=function(S){var O=this.clone();return O.__iteratees__.push({iteratee:qe(S,3),type:f}),O.__filtered__=O.__filtered__||y,O}}),Zn(["head","last"],function(s,c){var f="take"+(c?"Right":"");vt.prototype[s]=function(){return this[f](1).value()[0]}}),Zn(["initial","tail"],function(s,c){var f="drop"+(c?"":"Right");vt.prototype[s]=function(){return this.__filtered__?new vt(this):this[f](1)}}),vt.prototype.compact=function(){return this.filter(Yn)},vt.prototype.find=function(s){return this.filter(s).head()},vt.prototype.findLast=function(s){return this.reverse().find(s)},vt.prototype.invokeMap=ut(function(s,c){return typeof s=="function"?new vt(this):this.map(function(f){return qr(f,s,c)})}),vt.prototype.reject=function(s){return this.filter(nl(qe(s)))},vt.prototype.slice=function(s,c){s=at(s);var f=this;return f.__filtered__&&(s>0||c<0)?new vt(f):(s<0?f=f.takeRight(-s):s&&(f=f.drop(s)),c!==u&&(c=at(c),f=c<0?f.dropRight(-c):f.take(c-s)),f)},vt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},vt.prototype.toArray=function(){return this.take(Ve)},vo(vt.prototype,function(s,c){var f=/^(?:filter|find|map|reject)|While$/.test(c),y=/^(?:head|last)$/.test(c),S=I[y?"take"+(c=="last"?"Right":""):c],O=y||/^find/.test(c);S&&(I.prototype[c]=function(){var F=this.__wrapped__,W=y?[1]:arguments,q=F instanceof vt,de=W[0],he=q||nt(F),ge=function(bt){var wt=S.apply(I,uo([bt],W));return y&&Ee?wt[0]:wt};he&&f&&typeof de=="function"&&de.length!=1&&(q=he=!1);var Ee=this.__chain__,Re=!!this.__actions__.length,Qe=O&&!Ee,mt=q&&!Re;if(!O&&he){F=mt?F:new vt(this);var Ge=s.apply(F,W);return Ge.__actions__.push({func:Ss,args:[ge],thisArg:u}),new pi(Ge,Ee)}return Qe&&mt?s.apply(this,W):(Ge=this.thru(ge),Qe?y?Ge.value()[0]:Ge.value():Ge)})}),Zn(["pop","push","shift","sort","splice","unshift"],function(s){var c=vs[s],f=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",y=/^(?:pop|shift)$/.test(s);I.prototype[s]=function(){var S=arguments;if(y&&!this.__chain__){var O=this.value();return c.apply(nt(O)?O:[],S)}return this[f](function(F){return c.apply(nt(F)?F:[],S)})}}),vo(vt.prototype,function(s,c){var f=I[c];if(f){var y=f.name+"";Lt.call(hr,y)||(hr[y]=[]),hr[y].push({name:c,func:f})}}),hr[Ua(u,ue).name]=[{name:"wrapper",func:u}],vt.prototype.clone=Au,vt.prototype.reverse=Fg,vt.prototype.value=Bg,I.prototype.at=Lf,I.prototype.chain=Vf,I.prototype.commit=zf,I.prototype.next=Tm,I.prototype.plant=Cd,I.prototype.reverse=Bf,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=Hf,I.prototype.first=I.prototype.head,zr&&(I.prototype[zr]=Ff),I},fi=Ii();Hi?((Hi.exports=fi)._=fi,us._=fi):gn._=fi}).call(on)})(gg,gg.exports);var cA=gg.exports;const uA=mg(cA),dA=(v,_=!0)=>{const[u,g]=J.useState("idle"),[w,k]=J.useState(void 0),[m,C]=J.useState(void 0),M=J.useRef(!1),B=J.useCallback(T=>(g("pending"),C(null),v(T).then(L=>{M.current&&(k(L),g("success"))}).catch(L=>{M.current&&(C(L),g("error"))})),[v]);return J.useEffect(()=>{_&&B()},[B,_]),J.useEffect(()=>(M.current=!0,()=>{M.current=!1}),[]),{execute:B,status:u,value:w,error:m,setValue:k,setStatus:g}},t0={noOptionsMessage:()=>"Không có lựa chọn",placeholder:"Nhấp để chọn",loadingMessage:()=>"Đang tìm kiếm",menuPosition:"fixed"},lg=10,hA={display:"flex",alignItems:"center",justifyContent:"space-between"},fA={backgroundColor:"#EBECF0",borderRadius:"2em",color:"#172B4D",display:"inline-block",fontSize:12,fontWeight:"normal",lineHeight:"1",minWidth:1,padding:"0.16em 0.5em",textAlign:"center"},pA=J.forwardRef(({onChange:v,id:_,name:u,placeholder:g,getOptionLabel:w,getOptionValue:k,onAdd:m,value:C,disabled:M,endPoint:B,fieldLabel:T,fieldValue:L,isClearable:U,isGroup:j,conditions:$,keySearch:Z,...se},ue)=>{const[le,G]=J.useState(null),[ne,ie]=J.useState([]),[me,pe]=J.useState([]),[De,Ie]=J.useState(null),Me=J.useRef(),Ue=J.useRef(),te=J.useRef(null);g&&(t0.placeholder=g),J.useEffect(()=>{$&&(ie([]),pe([]),Me.current={top:lg,skip:0},Ue.current={top:lg,skip:0},te.current=$)},[$]),J.useEffect(()=>(Me.current={top:lg,skip:0},Ue.current={top:lg,skip:0},()=>{te.current=null}),[]);const ce=(Se,We,Oe)=>{let He="";if(We){const{top:ht,skip:ot}=Ue.current;Oe?He+=`&$top=${ht}&$skip=${ot}&$inlinecount=allpages`:(Ue.current.skip=0,He+=`&$top=${ht}&$skip=0&$inlinecount=allpages`)}else{const{top:ht,skip:ot}=Me.current;He+=`&$top=${ht}&$skip=${ot}&$inlinecount=allpages`}return Se.length>0&&(He+=Se.reduce((ht,ot,tt)=>{const $e=tt===Se.length-1?"":",";return ht+=`${ot}${$e}`,ht},"&$select=")),He},be=J.useCallback(async(Se,We)=>{if(B){let Oe=ce([T,L],Se,We),He=[];($&&$.length>0||te.current&&te.current.length>0)&&(($.length>0?$:te.current).map((Je,qt)=>Je.expression==="in"?He.push(`${Je.field} ${Je.expression} (${Je.value})`):He.push(`${Je.field} ${Je.expression} ${Je.value}`)),He=He.join(" or "),Oe=`${Oe}&$filter=${He}`),Se&&(Oe.indexOf("$filter")>-1?Oe+=` and substringof('${Se}',${T})`:Oe+=`&$filter=substringof('${Se}',${T})`);const{value:ht,...ot}=await B(`${Oe}`),tt=$e=>{let Je=[...$e];return We?Je=[...Je,...ht]:Je=ht,Je};return Se?(Ue.current.count=parseInt(ot["odata.count"]),pe(tt)):(Me.current.count=parseInt(ot["odata.count"]),ie(tt)),ht}return[]},[$,B,T,L]),ke=J.useCallback(({curSearch:Se,preSearch:We,isScroll:Oe}={})=>{if(Se){if(Se!=="")return Ie(Se),new Promise(He=>{setTimeout(()=>He(be(Se,Oe)),1e3)})}else return Se!==""?(Ie(null),pe([]),Ue.current.count=0,new Promise(He=>{setTimeout(()=>He(be(null,Oe)),1e3)})):(Ue.current.count=0,Promise.resolve([]))},[be]),{execute:Ne,status:xe}=dA(ke,!1);J.useEffect(()=>{C&&G(C)},[C]),J.useCallback(async Se=>{const We=await ke(),[Oe]=We.filter(He=>He[k||"value"]===Se);return Oe||null},[k,ke]);const Le=J.useCallback((Se,We)=>{const{count:Oe}=Me.current;Me.current.skip+=We,Me.current.skip<=Oe&&Ne({curSearch:Se,preSearch:Se,isScroll:!0})},[Ne]),Fe=J.useCallback(Se=>{v(Se||[])},[v]),Ye=J.useCallback(uA.debounce(Ne,1e3),[]),Ve=J.useCallback((Se,We)=>{Ye({curSearch:Se,preSearch:We})},[Ye]),yt=Se=>V.jsxDEV("div",{style:hA,children:[V.jsxDEV("span",{children:Se.label},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:230,columnNumber:9},globalThis),V.jsxDEV("span",{style:fA,children:Se.options.length},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:231,columnNumber:9},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:229,columnNumber:7},globalThis);return V.jsxDEV(Jx,{children:V.jsxDEV(Hv,{className:m&&"d-flex justify-content-between basic-single",children:[V.jsxDEV(bl,{className:"pr-0",children:V.jsxDEV(Cx,{...se,style:{control:Se=>({...Se,lineHeight:"1.5",cursor:"pointer",borderRadius:"0.2rem"}),option:Se=>({...Se,fontSize:"0.76563rem",cursor:"pointer"}),input:Se=>({...Se,position:"unset"})},isMulti:!0,onMenuScrollToBottom:()=>Le(De,10),options:De?me:ne,isLoading:xe==="pending",isDisabled:M,defaultOptions:!0,value:le,name:u,onChange:Fe,onInputChange:Se=>Ve(Se,De),getOptionValue:k,getOptionLabel:w,inputId:u,id:_,instanceId:u,onMenuClose:()=>{Ie(null),pe([])},onMenuOpen:()=>ne.length===0&&Ne({curSearch:null,preSearch:null,isScroll:!1}),...t0,isClearable:U,formatGroupLabel:j?yt:{}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:238,columnNumber:13},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:237,columnNumber:11},globalThis),m&&V.jsxDEV(bl,{md:"1",className:"pl-0",children:V.jsxDEV(mx,{className:"h-100",onClick:m},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:277,columnNumber:15},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:276,columnNumber:13},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:236,columnNumber:9},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/select/SelectAsyncMulti.jsx",lineNumber:235,columnNumber:7},globalThis)}),gA=J.memo(pA),mA=(v,_)=>{let{data:u,onChange:g,onKeyDown:w,onKeyPress:k,value:m,isDetail:C,onBlur:M,donVi:B,valueId:T}=v;const L=j=>`Nhập ${j==null?void 0:j.toLowerCase()}`;switch(C&&u.type!=="data-select"?"label":u.type){case"number_current":return V.jsxDEV(Z0,{disabled:u.disabled,id:u.field_name,name:u.field_name,placeholder:"0",defaultValue:m,decimalsLimit:0,decimalScale:0,value:m,onValueChange:(j,$)=>{g&&g(u.field_name,parseFloat(j))},className:"number-format form-control-sm form-control text-right"},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:45,columnNumber:9},globalThis);case"label":return V.jsxDEV("span",{style:u.style,children:u.type==="datetime"?W1(m):u.type==="date"?K1(m):u.type==="radio-list"?m===2?m="Thông báo giá":m="Kê khai giá":u.type==="numeric"?Bv(m):m},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:62,columnNumber:9},globalThis);case"textbox":return V.jsxDEV(ox,{style:{background:u.disabled?"#dedede":"inherit",textAlign:u.textAlign?u.textAlign:"left"},autoFocus:u.autoFocus,disabled:_||(u.disabled?u.disabled:!1),plaintext:u.plaintext||!1,name:u.field_name,value:m??"",onChange:j=>g&&g(j.target.name,j.target.value),onBlur:j=>M&&M(j.target.name,j.target.value),placeholder:u.placeholder?u.placeholder:L(u.title),onKeyPress:j=>j.charCode===13&&k&&k(j.target.name,j.target.value)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:78,columnNumber:9},globalThis);case"password":return V.jsxDEV(lx,{style:{background:u.disabled?"#dedede":"inherit"},autoFocus:u.autoFocus,name:u.field_name,value:m??"",onChange:j=>g&&g(j.target.name,j.target.value),onBlur:j=>M&&M(j.target.name,j.target.value),placeholder:L(u.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"}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:98,columnNumber:9},globalThis);case"textarea":return V.jsxDEV(ix,{style:{background:u.disabled?"#dedede":"inherit"},autoFocus:u.autoFocus,rows:u.rows,disabled:u.disabled?u.disabled:!1,name:u.field_name,value:m??"",onChange:j=>g&&g(j.target.name,j.target.value),onBlur:j=>M&&M(j.target.name,j.target.value),onKeyDown:w,placeholder:L(u.title)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:115,columnNumber:9},globalThis);case"checkbox":return V.jsxDEV(r0,{autoFocus:u.autoFocus,disabled:u.disabled?u.disabled:!1,name:u.field_name,checked:m||!1,onChange:j=>g&&g(u.field_name,j),placeholder:L(u.title)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:131,columnNumber:9},globalThis);case"datetime":return V.jsxDEV(ax,{style:{background:u.disabled?"#dedede":"inherit"},autoFocus:u.autoFocus,disabled:u.disabled?u.disabled:!1,name:u.field_name,value:m,onChange:j=>g&&g(u.field_name,j),placeholderText:L(u.title)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:142,columnNumber:9},globalThis);case"date":return V.jsxDEV(sx,{style:{background:u.disabled?"#dedede":"inherit"},autoFocus:u.autoFocus,disabled:u.disabled?u.disabled:!1,name:u.field_name,value:m,onChange:j=>g&&g(u.field_name,j),placeholderText:L(u.title),notFormat:u.notFormat},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:154,columnNumber:9},globalThis);case"data-select":return u.dataSelect&&V.jsxDEV(cx,{menuPosition:u.menuPosition,autoFocus:u.dataSelect.autoFocus,isDetail:C,isMulti:u.dataSelect.isMulti?u.dataSelect.isMulti:!1,isClearable:u.dataSelect.isClearable,disabled:u.disabled?u.disabled:!1,url:u.dataSelect.url,odata:u.dataSelect.odata,where:u.dataSelect.where,group_by:u.dataSelect.group_by,columns:u.dataSelect.columns,valueField:u.dataSelect.value_field,textField:u.dataSelect.text_field,textFieldSub:u.dataSelect.text_field_sub,options:u.dataSelect.options,value:m,placeholder:u.dataSelect.placeholder,onChange:(j,$)=>{g&&g(u.field_name,j,$)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:168,columnNumber:11},globalThis);case"data-select-async":return u.dataSelect&&V.jsxDEV(Sx,{disabled:_,value:m||"",url:u.dataSelect.url,column:u.dataSelect.column,options:u.dataSelect.options,whereOne:u.dataSelect.whereOne,where:u.dataSelect.where,onChange:j=>{j?g(u.field_name,j.value):g(null)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:195,columnNumber:11},globalThis);case"numeric":case"currency":return V.jsxDEV(Y_,{style:{background:u.disabled||_?"#dedede":"inherit"},autoFocus:u.autoFocus,isDetail:C,decimalScale:u.decimalScale,className:"number-format",disabled:_||(u.disabled?u.disabled:!1),value:Bv(m),placeholder:u.placeholder||u.placeholder===null?u.placeholder:"0",onValueChange:j=>{g&&g(u.field_name,parseFloat(j.value))},onBlur:j=>M&&M(u.field_name,j),onKeyDown:w,onFocus:j=>u.onFocus&&j.target.select()},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:225,columnNumber:9},globalThis);case"number":return V.jsxDEV("div",{className:"row m-0 justify-content-center align-items-baseline",children:[V.jsxDEV(Y_,{style:{background:u.disabled?"#dedede":"inherit"},autoFocus:u.autoFocus,isDetail:C,className:"number-format ms-3 me-3",disabled:u.disabled?u.disabled:!1,value:m,placeholder:"0",onValueChange:j=>{g&&g(u.field_name,j.value)},onBlur:j=>M&&M(u.field_name,j),onFocus:j=>u.onFocus&&j.target.select()},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:246,columnNumber:11},globalThis)," ",V.jsxDEV("p",{className:"col-2 mb-0 justify-content-center",children:B},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:260,columnNumber:11},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:245,columnNumber:9},globalThis);case"number-not-seperator":return V.jsxDEV("div",{style:{padding:"0 13px"},className:"row justify-content-center align-items-baseline",children:V.jsxDEV(cw,{style:{background:u.disabled?"#dedede":"inherit"},autoFocus:u.autoFocus,isDetail:C,className:"number-format ms-3 me-3",disabled:u.disabled?u.disabled:!1,value:m,placeholder:"0",onValueChange:j=>{g&&g(u.field_name,j.value)},onBlur:j=>M&&M(u.field_name,j)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:266,columnNumber:11},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:265,columnNumber:9},globalThis);case"radio-list":return V.jsxDEV(Ox,{name:u.field_name,disabled:u.disabled?u.disabled:!1,data:u.data,value:m,onChange:j=>g&&v.onChange(u.field_name,j)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:283,columnNumber:9},globalThis);case"radio":return V.jsxDEV(bg,{name:u.field_name,disabled:u.disabled,value:m,label:u.title,hidden_label:u.hidden_label,checked:m===u.valueCompare&&!u.disabled,onChange:j=>{u.valueCompare!==m&&v.onChange(j.target.value)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:293,columnNumber:9},globalThis);case"checkbox-list":return V.jsxDEV(jx,{name:u.field_name,disabled:u.disabled?u.disabled:!1,data:u.data,value:m,onChange:j=>g&&v.onChange(u.field_name,j)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:321,columnNumber:9},globalThis);case"select-year":return V.jsxDEV(fx,{disabled:u.disabled?u.disabled:!1,value:m,onChange:j=>{g&&v.onChange(u.field_name,j&&j.value)},placeholder:L(u.title)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:333,columnNumber:9},globalThis);case"select-custom":return V.jsxDEV(dx,{value:m,onChange:j=>{g&&v.onChange(u.field_name,j&&j.value)},options:v.data.options},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:344,columnNumber:9},globalThis);case"select-multi":return V.jsxDEV(Hx,{isSearchable:!1,cacheOptions:!0,isDisabled:u.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:j=>v.onChange&&v.onChange(u.field_name,j),value:m,getOptionValue:j=>j.Id,getOptionLabel:j=>j.Name,defaultOptions:!0,loadOptions:u.loadOptions},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:354,columnNumber:9},globalThis);case"select-month":return V.jsxDEV(uw,{value:m,onChange:j=>{g&&v.onChange(u.field_name,j&&j.value)}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:386,columnNumber:9},globalThis);case"popup-select":return V.jsxDEV(dw,{ableCRUD:u.popupSelect.ableCRUD,isModal:u.popupSelect.isModal,isComponent:u.popupSelect.isComponent,isCheck:u.popupSelect.isCheck,isImport:u.popupSelect.isImport,label:u.popupSelect.label,dataSelect:{url:u.popupSelect.url,isFormSearch:u.popupSelect.isFormSearch,selectColumn:u.popupSelect.selectColumn,columns:u.popupSelect.columns,formAddModal:u.popupSelect.formAddModal,where:u.popupSelect.where,title:u.popupSelect.title,disableSelect:u.disabled,defaultValues:u.popupSelect.defaultValues,defaultValuesEdit:u.popupSelect.defaultValuesEdit,zIndex:u.popupSelect.zIndex,theadTableImport:u.popupSelect.theadTableImport,urlImport:u.popupSelect.urlImport,urlPreImport:u.popupSelect.urlPreImport,urldownload:u.popupSelect.urldownload,columnsImport:u.popupSelect.columnsImport,isNew:u.popupSelect.isNew,keyComponent:u.popupSelect.keyComponent},keyComponent:u.popupSelect.keyComponent,componentOnRowSelect:u.popupSelect.componentOnRowSelect,isOnRowSelect:u.popupSelect.isOnRowSelect,maxWidth:u.popupSelect.maxWidth,valueDisplay:m,onDelete:u.popupSelect.onDelete,onClickButton:u.popupSelect.onClickButton,onCallback:j=>g&&v.onChange(u.field_name,j&&(u.popupSelect.isGetItem?j:j.Id||j.MaChuong))},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:395,columnNumber:9},globalThis);case"popup-select-tree":return V.jsxDEV(zS,{isDieu18:u.isDieu18,dataSelect:{disableSelect:u.disabled,endPoint:u.popupSelect.endPoint,template:u.popupSelect.template,label:u.popupSelect.label,placeholder:u.popupSelect.placeholder},EndPoint_Tree:u.popupSelect.EndPoint_Tree,EndPoint_Odata:u.popupSelect.EndPoint_Odata,valueDisplay:m,Id:T,onClickButton:u.popupSelect.onClickButton,onCallback:j=>g&&v.onChange(u.field_name,j&&j.value)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:442,columnNumber:9},globalThis);case"chkeditor":return V.jsxDEV(sC.CKEditor,{editor:lC,data:m||"",disabled:u.disabled,config:{toolbar:["heading","|","bold","italic","bulletedList","numberedList","|","outdent","indent","|","undo","redo"]},onReady:j=>{},onChange:(j,$)=>{},onBlur:(j,$)=>{let Z=$.getData();g&&v.onChange(u.field_name,Z)},onFocus:(j,$)=>{}},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:461,columnNumber:9},globalThis);case"ranger":return V.jsxDEV(lA,{value:m,rtl:!1,onChange:j=>v.onChange(u.field_name,j)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:494,columnNumber:14},globalThis);case"select-async-multi":return V.jsxDEV(gA,{name:u.field_name,onChange:j=>v.onChange(u.field_name,j),placeholder:u.dataSelect.placeholder||"Chọn",endPoint:u.dataSelect.endpoint,fieldValue:u.dataSelect.value_field,fieldLabel:u.dataSelect.text_field,getOptionValue:j=>j[u.dataSelect.value_field],getOptionLabel:j=>j[u.dataSelect.text_field],value:m,disabled:!1,conditions:u.dataSelect.conditions},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:497,columnNumber:9},globalThis)}},Lw=v=>{const{data:_,value:u,colLabel:g,colValue:w,onChange:k,onBlur:m,onKeyDown:C,onChangeRender:M,inline_equal:B,inline:T,style:L,styleRow:U,disabled:j,error:$,invalid:Z}=v,se=ue=>`Nhập ${ue==null?void 0:ue.toLowerCase()}`;return _&&_.type!=="hidden"&&V.jsxDEV(Z1,{row:!0,className:`form-control-${_.field_name}`,style:U,children:[!(_!=null&&_.hidden_label)&&V.jsxDEV(bl,{md:g||(T===!1?"12":"6"),children:_.required?V.jsxDEV(ex,{children:_.title},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:544,columnNumber:15},globalThis):V.jsxDEV("strong",{style:{fontSize:"12px"},children:_.title},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:546,columnNumber:15},globalThis)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:542,columnNumber:11},globalThis),V.jsxDEV(bl,{md:w||(T===!1||_.hidden_label===!0?"12":"6"),style:L,children:[V.jsxDEV("div",{className:`form-control-value ${Z?"is-invalid":""}`,style:_.width&&{maxWidth:_.width},children:_.render?_.render(u,M):_.lookup?V.jsxDEV(nx,{style:{background:_.disabled?"#dedede":"inherit"},name:_.field_name,value:u,onChange:ue=>k&&k(ue.target.name,ue.target.value),onBlur:ue=>m&&m(ue.target.name,ue.target.value),onKeyDown:C,placeholder:se(_.title),children:Object.keys(_.lookup).map((ue,le)=>V.jsxDEV("option",{value:ue,children:_.lookup[ue]},le,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:571,columnNumber:19},globalThis))},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:561,columnNumber:15},globalThis):mA(v,j)},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:554,columnNumber:11},globalThis),V.jsxDEV(X1,{children:$==null?void 0:$.message},void 0,!1,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:580,columnNumber:11},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:550,columnNumber:9},globalThis)]},void 0,!0,{fileName:"/home/jenkins/agent/workspace/gdnn.gdtsolutions.vn/src/childcomp/base/Form/FormControl.jsx",lineNumber:540,columnNumber:7},globalThis)};Lw.propTypes={data:ee.object.isRequired};Lw.defaultProps={};const cn=Lw;export{Xx as D,cn as F,dw as P,gA as S,LS as T,Pg as a,Qx as b,$x as u};