From 062611e45d50b9668bac8b0b7db67943ced82182 Mon Sep 17 00:00:00 2001 From: qq <2233547477@qq.com> Date: Tue, 21 Apr 2026 23:35:18 +0800 Subject: [PATCH] m --- dist/assets/index.DW8mEr1H.js | 72 +++++++++++++++++++++++++++++++++++ dist/index.html | 2 +- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 dist/assets/index.DW8mEr1H.js diff --git a/dist/assets/index.DW8mEr1H.js b/dist/assets/index.DW8mEr1H.js new file mode 100644 index 0000000..2709411 --- /dev/null +++ b/dist/assets/index.DW8mEr1H.js @@ -0,0 +1,72 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();function pI(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const xn={},nm=[],tn=()=>{},E9=()=>!1,oC=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),vI=t=>t.startsWith("onUpdate:"),Ri=Object.assign,bI=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},lne=Object.prototype.hasOwnProperty,Jt=(t,e)=>lne.call(t,e),Pe=Array.isArray,im=t=>Fb(t)==="[object Map]",sC=t=>Fb(t)==="[object Set]",__=t=>Fb(t)==="[object Date]",Xe=t=>typeof t=="function",ot=t=>typeof t=="string",ua=t=>typeof t=="symbol",_t=t=>t!==null&&typeof t=="object",_v=t=>(_t(t)||Xe(t))&&Xe(t.then)&&Xe(t.catch),x9=Object.prototype.toString,Fb=t=>x9.call(t),une=t=>Fb(t).slice(8,-1),Cv=t=>Fb(t)==="[object Object]",aC=t=>ot(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ip=pI(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),lC=t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))},cne=/-\w/g,Oo=lC(t=>t.replace(cne,e=>e.slice(1).toUpperCase())),dne=/\B([A-Z])/g,bl=lC(t=>t.replace(dne,"-$1").toLowerCase()),$b=lC(t=>t.charAt(0).toUpperCase()+t.slice(1)),Rp=lC(t=>t?`on${$b(t)}`:""),bo=(t,e)=>!Object.is(t,e),gw=(t,...e)=>{for(let n=0;n{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:i,value:n})},yI=t=>{const e=parseFloat(t);return isNaN(e)?t:e},fne=t=>{const e=ot(t)?Number(t):NaN;return isNaN(e)?t:e};let GL;const uC=()=>GL||(GL=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function mt(t){if(Pe(t)){const e={};for(let n=0;n{if(n){const i=n.split(mne);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function $(t){let e="";if(ot(t))e=t;else if(Pe(t))for(let n=0;nmf(n,e))}const R9=t=>!!(t&&t.__v_isRef===!0),We=t=>ot(t)?t:t==null?"":Pe(t)||_t(t)&&(t.toString===x9||!Xe(t.toString))?R9(t)?We(t.value):JSON.stringify(t,M9,2):String(t),M9=(t,e)=>R9(e)?M9(t,e.value):im(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[i,r],o)=>(n[tk(i,o)+" =>"]=r,n),{})}:sC(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>tk(n))}:ua(e)?tk(e):_t(e)&&!Pe(e)&&!Cv(e)?String(e):e,tk=(t,e="")=>{var n;return ua(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};let Mr;class O9{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Mr,!e&&Mr&&(this.index=(Mr.scopes||(Mr.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e0&&--this._on===0&&(Mr=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,i;for(n=0,i=this.effects.length;n0)return;if(Op){let e=Op;for(Op=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;Mp;){let e=Mp;for(Mp=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){t||(t=i)}e=n}}if(t)throw t}function N9(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function B9(t){let e,n=t.depsTail,i=n;for(;i;){const r=i.prevDep;i.version===-1?(i===n&&(n=r),CI(i),wne(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=r}t.deps=e,t.depsTail=n}function zx(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(V9(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function V9(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Sv)||(t.globalVersion=Sv,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!zx(t))))return;t.flags|=2;const e=t.dep,n=ei,i=ta;ei=t,ta=!0;try{N9(t);const r=t.fn(t._value);(e.version===0||bo(r,t._value))&&(t.flags|=128,t._value=r,e.version++)}catch(r){throw e.version++,r}finally{ei=n,ta=i,B9(t),t.flags&=-3}}function CI(t,e=!1){const{dep:n,prevSub:i,nextSub:r}=t;if(i&&(i.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=i,t.nextSub=void 0),n.subs===t&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)CI(o,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function wne(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}function _ne(t,e){t.effect instanceof C_&&(t=t.effect.fn);const n=new C_(t);e&&Ri(n,e);try{n.run()}catch(r){throw n.stop(),r}const i=n.run.bind(n);return i.effect=n,i}let ta=!0;const F9=[];function du(){F9.push(ta),ta=!1}function fu(){const t=F9.pop();ta=t===void 0?!0:t}function YL(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=ei;ei=void 0;try{e()}finally{ei=n}}}let Sv=0,Cne=class{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};class fC{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!ei||!ta||ei===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ei)n=this.activeLink=new Cne(ei,this),ei.deps?(n.prevDep=ei.depsTail,ei.depsTail.nextDep=n,ei.depsTail=n):ei.deps=ei.depsTail=n,$9(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const i=n.nextDep;i.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=i),n.prevDep=ei.depsTail,n.nextDep=void 0,ei.depsTail.nextDep=n,ei.depsTail=n,ei.deps===n&&(ei.deps=i)}return n}trigger(e){this.version++,Sv++,this.notify(e)}notify(e){wI();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{_I()}}}function $9(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)$9(i)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const S_=new WeakMap,tf=Symbol(""),Hx=Symbol(""),kv=Symbol("");function Dr(t,e,n){if(ta&&ei){let i=S_.get(t);i||S_.set(t,i=new Map);let r=i.get(n);r||(i.set(n,r=new fC),r.map=i,r.key=n),r.track()}}function Kl(t,e,n,i,r,o){const s=S_.get(t);if(!s){Sv++;return}const a=l=>{l&&l.trigger()};if(wI(),e==="clear")s.forEach(a);else{const l=Pe(t),u=l&&aC(n);if(l&&n==="length"){const c=Number(i);s.forEach((d,f)=>{(f==="length"||f===kv||!ua(f)&&f>=c)&&a(d)})}else switch((n!==void 0||s.has(void 0))&&a(s.get(n)),u&&a(s.get(kv)),e){case"add":l?u&&a(s.get("length")):(a(s.get(tf)),im(t)&&a(s.get(Hx)));break;case"delete":l||(a(s.get(tf)),im(t)&&a(s.get(Hx)));break;case"set":im(t)&&a(s.get(tf));break}}_I()}function Sne(t,e){const n=S_.get(t);return n&&n.get(e)}function Qf(t){const e=ln(t);return e===t?e:(Dr(e,"iterate",kv),is(t)?e:e.map(da))}function hC(t){return Dr(t=ln(t),"iterate",kv),t}function tc(t,e){return hu(t)?Cm(na(t)?da(e):e):da(e)}const kne={__proto__:null,[Symbol.iterator](){return ik(this,Symbol.iterator,t=>tc(this,t))},concat(...t){return Qf(this).concat(...t.map(e=>Pe(e)?Qf(e):e))},entries(){return ik(this,"entries",t=>(t[1]=tc(this,t[1]),t))},every(t,e){return xl(this,"every",t,e,void 0,arguments)},filter(t,e){return xl(this,"filter",t,e,n=>n.map(i=>tc(this,i)),arguments)},find(t,e){return xl(this,"find",t,e,n=>tc(this,n),arguments)},findIndex(t,e){return xl(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return xl(this,"findLast",t,e,n=>tc(this,n),arguments)},findLastIndex(t,e){return xl(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return xl(this,"forEach",t,e,void 0,arguments)},includes(...t){return rk(this,"includes",t)},indexOf(...t){return rk(this,"indexOf",t)},join(t){return Qf(this).join(t)},lastIndexOf(...t){return rk(this,"lastIndexOf",t)},map(t,e){return xl(this,"map",t,e,void 0,arguments)},pop(){return Eg(this,"pop")},push(...t){return Eg(this,"push",t)},reduce(t,...e){return XL(this,"reduce",t,e)},reduceRight(t,...e){return XL(this,"reduceRight",t,e)},shift(){return Eg(this,"shift")},some(t,e){return xl(this,"some",t,e,void 0,arguments)},splice(...t){return Eg(this,"splice",t)},toReversed(){return Qf(this).toReversed()},toSorted(t){return Qf(this).toSorted(t)},toSpliced(...t){return Qf(this).toSpliced(...t)},unshift(...t){return Eg(this,"unshift",t)},values(){return ik(this,"values",t=>tc(this,t))}};function ik(t,e,n){const i=hC(t),r=i[e]();return i!==t&&!is(t)&&(r._next=r.next,r.next=()=>{const o=r._next();return o.done||(o.value=n(o.value)),o}),r}const Tne=Array.prototype;function xl(t,e,n,i,r,o){const s=hC(t),a=s!==t&&!is(t),l=s[e];if(l!==Tne[e]){const d=l.apply(t,o);return a?da(d):d}let u=n;s!==t&&(a?u=function(d,f){return n.call(this,tc(t,d),f,t)}:n.length>2&&(u=function(d,f){return n.call(this,d,f,t)}));const c=l.call(s,u,i);return a&&r?r(c):c}function XL(t,e,n,i){const r=hC(t);let o=n;return r!==t&&(is(t)?n.length>3&&(o=function(s,a,l){return n.call(this,s,a,l,t)}):o=function(s,a,l){return n.call(this,s,tc(t,a),l,t)}),r[e](o,...i)}function rk(t,e,n){const i=ln(t);Dr(i,"iterate",kv);const r=i[e](...n);return(r===-1||r===!1)&&mC(n[0])?(n[0]=ln(n[0]),i[e](...n)):r}function Eg(t,e,n=[]){du(),wI();const i=ln(t)[e].apply(t,n);return _I(),fu(),i}const Ene=pI("__proto__,__v_isRef,__isVue"),z9=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(ua));function xne(t){ua(t)||(t=String(t));const e=ln(this);return Dr(e,"has",t),e.hasOwnProperty(t)}class H9{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,i){if(n==="__v_skip")return e.__v_skip;const r=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return o;if(n==="__v_raw")return i===(r?o?Bne:j9:o?q9:W9).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const s=Pe(e);if(!r){let l;if(s&&(l=kne[n]))return l;if(n==="hasOwnProperty")return xne}const a=Reflect.get(e,n,rn(e)?e:i);if((ua(n)?z9.has(n):Ene(n))||(r||Dr(e,"get",n),o))return a;if(rn(a)){const l=s&&aC(n)?a:a.value;return r&&_t(l)?gf(l):l}return _t(a)?r?gf(a):on(a):a}}class U9 extends H9{constructor(e=!1){super(!1,e)}set(e,n,i,r){let o=e[n];const s=Pe(e)&&aC(n);if(!this._isShallow){const u=hu(o);if(!is(i)&&!hu(i)&&(o=ln(o),i=ln(i)),!s&&rn(o)&&!rn(i))return u||(o.value=i),!0}const a=s?Number(n)t,A0=t=>Reflect.getPrototypeOf(t);function Mne(t,e,n){return function(...i){const r=this.__v_raw,o=ln(r),s=im(o),a=t==="entries"||t===Symbol.iterator&&s,l=t==="keys"&&s,u=r[t](...i),c=n?Ux:e?Cm:da;return!e&&Dr(o,"iterate",l?Hx:tf),Ri(Object.create(u),{next(){const{value:d,done:f}=u.next();return f?{value:d,done:f}:{value:a?[c(d[0]),c(d[1])]:c(d),done:f}}})}}function P0(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function One(t,e){const n={get(r){const o=this.__v_raw,s=ln(o),a=ln(r);t||(bo(r,a)&&Dr(s,"get",r),Dr(s,"get",a));const{has:l}=A0(s),u=e?Ux:t?Cm:da;if(l.call(s,r))return u(o.get(r));if(l.call(s,a))return u(o.get(a));o!==s&&o.get(r)},get size(){const r=this.__v_raw;return!t&&Dr(ln(r),"iterate",tf),r.size},has(r){const o=this.__v_raw,s=ln(o),a=ln(r);return t||(bo(r,a)&&Dr(s,"has",r),Dr(s,"has",a)),r===a?o.has(r):o.has(r)||o.has(a)},forEach(r,o){const s=this,a=s.__v_raw,l=ln(a),u=e?Ux:t?Cm:da;return!t&&Dr(l,"iterate",tf),a.forEach((c,d)=>r.call(o,u(c),u(d),s))}};return Ri(n,t?{add:P0("add"),set:P0("set"),delete:P0("delete"),clear:P0("clear")}:{add(r){!e&&!is(r)&&!hu(r)&&(r=ln(r));const o=ln(this);return A0(o).has.call(o,r)||(o.add(r),Kl(o,"add",r,r)),this},set(r,o){!e&&!is(o)&&!hu(o)&&(o=ln(o));const s=ln(this),{has:a,get:l}=A0(s);let u=a.call(s,r);u||(r=ln(r),u=a.call(s,r));const c=l.call(s,r);return s.set(r,o),u?bo(o,c)&&Kl(s,"set",r,o):Kl(s,"add",r,o),this},delete(r){const o=ln(this),{has:s,get:a}=A0(o);let l=s.call(o,r);l||(r=ln(r),l=s.call(o,r)),a&&a.call(o,r);const u=o.delete(r);return l&&Kl(o,"delete",r,void 0),u},clear(){const r=ln(this),o=r.size!==0,s=r.clear();return o&&Kl(r,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=Mne(r,t,e)}),n}function SI(t,e){const n=One(t,e);return(i,r,o)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?i:Reflect.get(Jt(n,r)&&r in i?n:i,r,o)}const Lne={get:SI(!1,!1)},Dne={get:SI(!1,!0)},Nne={get:SI(!0,!1)};const W9=new WeakMap,q9=new WeakMap,j9=new WeakMap,Bne=new WeakMap;function Vne(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Fne(t){return t.__v_skip||!Object.isExtensible(t)?0:Vne(une(t))}function on(t){return hu(t)?t:kI(t,!1,Pne,Lne,W9)}function Lp(t){return kI(t,!1,Rne,Dne,q9)}function gf(t){return kI(t,!0,Ine,Nne,j9)}function kI(t,e,n,i,r){if(!_t(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const o=Fne(t);if(o===0)return t;const s=r.get(t);if(s)return s;const a=new Proxy(t,o===2?i:n);return r.set(t,a),a}function na(t){return hu(t)?na(t.__v_raw):!!(t&&t.__v_isReactive)}function hu(t){return!!(t&&t.__v_isReadonly)}function is(t){return!!(t&&t.__v_isShallow)}function mC(t){return t?!!t.__v_raw:!1}function ln(t){const e=t&&t.__v_raw;return e?ln(e):t}function ca(t){return!Jt(t,"__v_skip")&&Object.isExtensible(t)&&A9(t,"__v_skip",!0),t}const da=t=>_t(t)?on(t):t,Cm=t=>_t(t)?gf(t):t;function rn(t){return t?t.__v_isRef===!0:!1}function H(t){return K9(t,!1)}function bi(t){return K9(t,!0)}function K9(t,e){return rn(t)?t:new $ne(t,e)}class $ne{constructor(e,n){this.dep=new fC,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:ln(e),this._value=n?e:da(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,i=this.__v_isShallow||is(e)||hu(e);e=i?e:ln(e),bo(e,n)&&(this._rawValue=e,this._value=i?e:da(e),this.dep.trigger())}}function vw(t){t.dep&&t.dep.trigger()}function w(t){return rn(t)?t.value:t}function bw(t){return Xe(t)?t():w(t)}const zne={get:(t,e,n)=>e==="__v_raw"?t:w(Reflect.get(t,e,n)),set:(t,e,n,i)=>{const r=t[e];return rn(r)&&!rn(n)?(r.value=n,!0):Reflect.set(t,e,n,i)}};function G9(t){return na(t)?t:new Proxy(t,zne)}class Hne{constructor(e){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new fC,{get:i,set:r}=e(n.track.bind(n),n.trigger.bind(n));this._get=i,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function Une(t){return new Hne(t)}function Sr(t){const e=Pe(t)?new Array(t.length):{};for(const n in t)e[n]=Y9(t,n);return e}class Wne{constructor(e,n,i){this._object=e,this._key=n,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._raw=ln(e);let r=!0,o=e;if(!Pe(e)||!aC(String(n)))do r=!mC(o)||is(o);while(r&&(o=o.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=w(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&rn(this._raw[this._key])){const n=this._object[this._key];if(rn(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return Sne(this._raw,this._key)}}class qne{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function An(t,e,n){return rn(t)?t:Xe(t)?new qne(t):_t(t)&&arguments.length>1?Y9(t,e,n):H(t)}function Y9(t,e,n){return new Wne(t,e,n)}class jne{constructor(e,n,i){this.fn=e,this.setter=n,this._value=void 0,this.dep=new fC(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Sv-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&ei!==this)return D9(this,!0),!0}get value(){const e=this.dep.track();return V9(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function Kne(t,e,n=!1){let i,r;return Xe(t)?i=t:(i=t.get,r=t.set),new jne(i,r,n)}const I0={},k_=new WeakMap;let Dd;function Gne(t,e=!1,n=Dd){if(n){let i=k_.get(n);i||k_.set(n,i=[]),i.push(t)}}function Yne(t,e,n=xn){const{immediate:i,deep:r,once:o,scheduler:s,augmentJob:a,call:l}=n,u=_=>r?_:is(_)||r===!1||r===0?Gl(_,1):Gl(_);let c,d,f,h,m=!1,g=!1;if(rn(t)?(d=()=>t.value,m=is(t)):na(t)?(d=()=>u(t),m=!0):Pe(t)?(g=!0,m=t.some(_=>na(_)||is(_)),d=()=>t.map(_=>{if(rn(_))return _.value;if(na(_))return u(_);if(Xe(_))return l?l(_,2):_()})):Xe(t)?e?d=l?()=>l(t,2):t:d=()=>{if(f){du();try{f()}finally{fu()}}const _=Dd;Dd=c;try{return l?l(t,3,[h]):t(h)}finally{Dd=_}}:d=tn,e&&r){const _=d,C=r===!0?1/0:r;d=()=>Gl(_(),C)}const v=cC(),p=()=>{c.stop(),v&&v.active&&bI(v.effects,c)};if(o&&e){const _=e;e=(...C)=>{_(...C),p()}}let b=g?new Array(t.length).fill(I0):I0;const y=_=>{if(!(!(c.flags&1)||!c.dirty&&!_))if(e){const C=c.run();if(r||m||(g?C.some((S,k)=>bo(S,b[k])):bo(C,b))){f&&f();const S=Dd;Dd=c;try{const k=[C,b===I0?void 0:g&&b[0]===I0?[]:b,h];b=C,l?l(e,3,k):e(...k)}finally{Dd=S}}}else c.run()};return a&&a(y),c=new C_(d),c.scheduler=s?()=>s(y,!1):y,h=_=>Gne(_,!1,c),f=c.onStop=()=>{const _=k_.get(c);if(_){if(l)l(_,4);else for(const C of _)C();k_.delete(c)}},e?i?y(!0):b=c.run():s?s(y.bind(null,!0),!0):c.run(),p.pause=c.pause.bind(c),p.resume=c.resume.bind(c),p.stop=p,p}function Gl(t,e=1/0,n){if(e<=0||!_t(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,rn(t))Gl(t.value,e,n);else if(Pe(t))for(let i=0;i{Gl(i,e,n)});else if(Cv(t)){for(const i in t)Gl(t[i],e,n);for(const i of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,i)&&Gl(t[i],e,n)}return t}function Hb(t,e,n,i){try{return i?t(...i):t()}catch(r){gC(r,e,n)}}function fa(t,e,n,i){if(Xe(t)){const r=Hb(t,e,n,i);return r&&_v(r)&&r.catch(o=>{gC(o,e,n)}),r}if(Pe(t)){const r=[];for(let o=0;o>>1,r=Zr[i],o=Tv(r);o=Tv(n)?Zr.push(t):Zr.splice(Jne(e),0,t),t.flags|=1,J9()}}function J9(){T_||(T_=X9.then(Q9))}function Zne(t){Pe(t)?rm.push(...t):nc&&t.id===-1?nc.splice(Mh+1,0,t):t.flags&1||(rm.push(t),t.flags|=1),J9()}function JL(t,e,n=Fa+1){for(;nTv(n)-Tv(i));if(rm.length=0,nc){nc.push(...e);return}for(nc=e,Mh=0;Mht.id==null?t.flags&2?-1:1/0:t.id;function Q9(t){try{for(Fa=0;Fa{i._d&&I_(-1);const o=E_(e);let s;try{s=t(...r)}finally{E_(o),i._d&&I_(1)}return s};return i._n=!0,i._c=!0,i._d=!0,i}function Vt(t,e){if(br===null)return t;const n=_C(br),i=t.dirs||(t.dirs=[]);for(let r=0;r1)return n&&Xe(e)?e.call(i&&i.proxy):e}}function tz(){return!!(Ct()||nf)}const Qne=Symbol.for("v-scx"),eie=()=>Ne(Qne);function sl(t,e){return pC(t,null,e)}function tie(t,e){return pC(t,null,{flush:"sync"})}function Se(t,e,n){return pC(t,e,n)}function pC(t,e,n=xn){const{immediate:i,deep:r,flush:o,once:s}=n,a=Ri({},n),l=e&&i||!e&&o!=="post";let u;if(Av){if(o==="sync"){const h=eie();u=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=tn,h.resume=tn,h.pause=tn,h}}const c=Nr;a.call=(h,m,g)=>fa(h,c,m,g);let d=!1;o==="post"?a.scheduler=h=>{Ir(h,c&&c.suspense)}:o!=="sync"&&(d=!0,a.scheduler=(h,m)=>{m?h():TI(h)}),a.augmentJob=h=>{e&&(h.flags|=4),d&&(h.flags|=2,c&&(h.id=c.uid,h.i=c))};const f=Yne(t,e,a);return Av&&(u?u.push(f):l&&f()),f}function nie(t,e,n){const i=this.proxy,r=ot(t)?t.includes(".")?nz(i,t):()=>i[t]:t.bind(i,i);let o;Xe(e)?o=e:(o=e.handler,n=e);const s=Ub(this),a=pC(r,o.bind(i),n);return s(),a}function nz(t,e){const n=e.split(".");return()=>{let i=t;for(let r=0;rt.__isTeleport,Dp=t=>t&&(t.disabled||t.disabled===""),ZL=t=>t&&(t.defer||t.defer===""),QL=t=>typeof SVGElement<"u"&&t instanceof SVGElement,e5=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Wx=(t,e)=>{const n=t&&t.to;return ot(n)?e?e(n):null:n},oz={name:"Teleport",__isTeleport:!0,process(t,e,n,i,r,o,s,a,l,u){const{mc:c,pc:d,pbc:f,o:{insert:h,querySelector:m,createText:g,createComment:v}}=u,p=Dp(e.props);let{shapeFlag:b,children:y,dynamicChildren:_}=e;if(t==null){const C=e.el=g(""),S=e.anchor=g("");h(C,n,i),h(S,n,i);const k=(E,x)=>{b&16&&c(y,E,x,r,o,s,a,l)},T=()=>{const E=e.target=Wx(e.props,m),x=qx(E,e,g,h);E&&(s!=="svg"&&QL(E)?s="svg":s!=="mathml"&&e5(E)&&(s="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(E),p||(k(E,x),yw(e,!1)))};p&&(k(n,S),yw(e,!0)),ZL(e.props)?(e.el.__isMounted=!1,Ir(()=>{T(),delete e.el.__isMounted},o)):T()}else{if(ZL(e.props)&&t.el.__isMounted===!1){Ir(()=>{oz.process(t,e,n,i,r,o,s,a,l,u)},o);return}e.el=t.el,e.targetStart=t.targetStart;const C=e.anchor=t.anchor,S=e.target=t.target,k=e.targetAnchor=t.targetAnchor,T=Dp(t.props),E=T?n:S,x=T?C:k;if(s==="svg"||QL(S)?s="svg":(s==="mathml"||e5(S))&&(s="mathml"),_?(f(t.dynamicChildren,_,E,r,o,s,a),MI(t,e,!0)):l||d(t,e,E,x,r,o,s,a,!1),p)T?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):R0(e,n,C,u,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const P=e.target=Wx(e.props,m);P&&R0(e,P,null,u,0)}else T&&R0(e,S,k,u,1);yw(e,p)}},remove(t,e,n,{um:i,o:{remove:r}},o){const{shapeFlag:s,children:a,anchor:l,targetStart:u,targetAnchor:c,target:d,props:f}=t;if(d&&(r(u),r(c)),o&&r(l),s&16){const h=o||!Dp(f);for(let m=0;m{t.isMounted=!0}),Sn(()=>{t.isUnmounting=!0}),t}const gs=[Function,Array],lz={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:gs,onEnter:gs,onAfterEnter:gs,onEnterCancelled:gs,onBeforeLeave:gs,onLeave:gs,onAfterLeave:gs,onLeaveCancelled:gs,onBeforeAppear:gs,onAppear:gs,onAfterAppear:gs,onAppearCancelled:gs},uz=t=>{const e=t.subTree;return e.component?uz(e.component):e},rie={name:"BaseTransition",props:lz,setup(t,{slots:e}){const n=Ct(),i=az();return()=>{const r=e.default&&EI(e.default(),!0);if(!r||!r.length)return;const o=cz(r),s=ln(t),{mode:a}=s;if(i.isLeaving)return ok(o);const l=t5(o);if(!l)return ok(o);let u=Ev(l,s,i,n,d=>u=d);l.type!==xi&&pf(l,u);let c=n.subTree&&t5(n.subTree);if(c&&c.type!==xi&&!Bd(c,l)&&uz(n).type!==xi){let d=Ev(c,s,i,n);if(pf(c,d),a==="out-in"&&l.type!==xi)return i.isLeaving=!0,d.afterLeave=()=>{i.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,c=void 0},ok(o);a==="in-out"&&l.type!==xi?d.delayLeave=(f,h,m)=>{const g=dz(i,c);g[String(c.key)]=c,f[$a]=()=>{h(),f[$a]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{m(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function cz(t){let e=t[0];if(t.length>1){for(const n of t)if(n.type!==xi){e=n;break}}return e}const oie=rie;function dz(t,e){const{leavingVNodes:n}=t;let i=n.get(e.type);return i||(i=Object.create(null),n.set(e.type,i)),i}function Ev(t,e,n,i,r){const{appear:o,mode:s,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:m,onLeaveCancelled:g,onBeforeAppear:v,onAppear:p,onAfterAppear:b,onAppearCancelled:y}=e,_=String(t.key),C=dz(n,t),S=(E,x)=>{E&&fa(E,i,9,x)},k=(E,x)=>{const P=x[1];S(E,x),Pe(E)?E.every(A=>A.length<=1)&&P():E.length<=1&&P()},T={mode:s,persisted:a,beforeEnter(E){let x=l;if(!n.isMounted)if(o)x=v||l;else return;E[$a]&&E[$a](!0);const P=C[_];P&&Bd(t,P)&&P.el[$a]&&P.el[$a](),S(x,[E])},enter(E){if(C[_]===t)return;let x=u,P=c,A=d;if(!n.isMounted)if(o)x=p||u,P=b||c,A=y||d;else return;let I=!1;E[xg]=q=>{I||(I=!0,q?S(A,[E]):S(P,[E]),T.delayedLeave&&T.delayedLeave(),E[xg]=void 0)};const D=E[xg].bind(null,!1);x?k(x,[E,D]):D()},leave(E,x){const P=String(t.key);if(E[xg]&&E[xg](!0),n.isUnmounting)return x();S(f,[E]);let A=!1;E[$a]=D=>{A||(A=!0,x(),D?S(g,[E]):S(m,[E]),E[$a]=void 0,C[P]===t&&delete C[P])};const I=E[$a].bind(null,!1);C[P]=t,h?k(h,[E,I]):I()},clone(E){const x=Ev(E,e,n,i,r);return r&&r(x),x}};return T}function ok(t){if(vC(t))return t=al(t),t.children=null,t}function t5(t){if(!vC(t))return rz(t.type)&&t.children?cz(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&Xe(n.default))return n.default()}}function pf(t,e){t.shapeFlag&6&&t.component?(t.transition=e,pf(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function EI(t,e=!1,n){let i=[],r=0;for(let o=0;o1)for(let o=0;oNp(g,e&&(Pe(e)?e[v]:e),n,i,r));return}if(om(i)&&!r){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Np(t,e,n,i.component.subTree);return}const o=i.shapeFlag&4?_C(i.component):i.el,s=r?null:o,{i:a,r:l}=t,u=e&&e.r,c=a.refs===xn?a.refs={}:a.refs,d=a.setupState,f=ln(d),h=d===xn?E9:g=>n5(c,g)?!1:Jt(f,g),m=(g,v)=>!(v&&n5(c,v));if(u!=null&&u!==l){if(i5(e),ot(u))c[u]=null,h(u)&&(d[u]=null);else if(rn(u)){const g=e;m(u,g.k)&&(u.value=null),g.k&&(c[g.k]=null)}}if(Xe(l))Hb(l,a,12,[s,c]);else{const g=ot(l),v=rn(l);if(g||v){const p=()=>{if(t.f){const b=g?h(l)?d[l]:c[l]:m()||!t.k?l.value:c[t.k];if(r)Pe(b)&&bI(b,o);else if(Pe(b))b.includes(o)||b.push(o);else if(g)c[l]=[o],h(l)&&(d[l]=c[l]);else{const y=[o];m(l,t.k)&&(l.value=y),t.k&&(c[t.k]=y)}}else g?(c[l]=s,h(l)&&(d[l]=s)):v&&(m(l,t.k)&&(l.value=s),t.k&&(c[t.k]=s))};if(s){const b=()=>{p(),x_.delete(t)};b.id=-1,x_.set(t,b),Ir(b,n)}else i5(t),p()}}}function i5(t){const e=x_.get(t);e&&(e.flags|=8,x_.delete(t))}uC().requestIdleCallback;uC().cancelIdleCallback;const om=t=>!!t.type.__asyncLoader,vC=t=>t.type.__isKeepAlive;function hz(t,e){gz(t,"a",e)}function mz(t,e){gz(t,"da",e)}function gz(t,e,n=Nr){const i=t.__wdc||(t.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return t()});if(bC(e,i,n),n){let r=n.parent;for(;r&&r.parent;)vC(r.parent.vnode)&&sie(i,e,n,r),r=r.parent}}function sie(t,e,n,i){const r=bC(e,t,i,!0);Fc(()=>{bI(i[e],r)},n)}function bC(t,e,n=Nr,i=!1){if(n){const r=n[t]||(n[t]=[]),o=e.__weh||(e.__weh=(...s)=>{du();const a=Ub(n),l=fa(e,n,t,s);return a(),fu(),l});return i?r.unshift(o):r.push(o),o}}const Su=t=>(e,n=Nr)=>{(!Av||t==="sp")&&bC(t,(...i)=>e(...i),n)},yC=Su("bm"),Pt=Su("m"),xI=Su("bu"),ku=Su("u"),Sn=Su("bum"),Fc=Su("um"),aie=Su("sp"),lie=Su("rtg"),uie=Su("rtc");function cie(t,e=Nr){bC("ec",t,e)}const AI="components",die="directives";function Bt(t,e){return PI(AI,t,!0,e)||t}const pz=Symbol.for("v-ndc");function Gt(t){return ot(t)?PI(AI,t,!1)||t:t||pz}function vz(t){return PI(die,t)}function PI(t,e,n=!0,i=!1){const r=br||Nr;if(r){const o=r.type;if(t===AI){const a=Kie(o,!1);if(a&&(a===e||a===Oo(e)||a===$b(Oo(e))))return o}const s=r5(r[t]||o[t],e)||r5(r.appContext[t],e);return!s&&i?o:s}}function r5(t,e){return t&&(t[e]||t[Oo(e)]||t[$b(Oo(e))])}function gn(t,e,n,i){let r;const o=n&&n[i],s=Pe(t);if(s||ot(t)){const a=s&&na(t);let l=!1,u=!1;a&&(l=!is(t),u=hu(t),t=hC(t)),r=new Array(t.length);for(let c=0,d=t.length;ce(a,l,void 0,o&&o[l]));else{const a=Object.keys(t);r=new Array(a.length);for(let l=0,u=a.length;l{const o=i.fn(...r);return o&&(o.key=i.key),o}:i.fn)}return t}function we(t,e,n={},i,r){if(br.ce||br.parent&&om(br.parent)&&br.parent.ce){const u=Object.keys(n).length>0;return e!=="default"&&(n.name=e),B(),_e(rt,null,[L("slot",n,i&&i())],u?-2:64)}let o=t[e];o&&o._c&&(o._d=!1),B();const s=o&&bz(o(n)),a=n.key||s&&s.key,l=_e(rt,{key:(a&&!ua(a)?a:`_${e}`)+(!s&&i?"_fb":"")},s||(i?i():[]),s&&t._===1?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),o&&o._c&&(o._d=!0),l}function bz(t){return t.some(e=>yi(e)?!(e.type===xi||e.type===rt&&!bz(e.children)):!0)?t:null}function fie(t,e){const n={};for(const i in t)n[e&&/[A-Z]/.test(i)?`on:${i}`:Rp(i)]=t[i];return n}const jx=t=>t?Fz(t)?_C(t):jx(t.parent):null,Bp=Ri(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>jx(t.parent),$root:t=>jx(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>_z(t),$forceUpdate:t=>t.f||(t.f=()=>{TI(t.update)}),$nextTick:t=>t.n||(t.n=Ye.bind(t.proxy)),$watch:t=>nie.bind(t)}),sk=(t,e)=>t!==xn&&!t.__isScriptSetup&&Jt(t,e),hie={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:i,data:r,props:o,accessCache:s,type:a,appContext:l}=t;if(e[0]!=="$"){const f=s[e];if(f!==void 0)switch(f){case 1:return i[e];case 2:return r[e];case 4:return n[e];case 3:return o[e]}else{if(sk(i,e))return s[e]=1,i[e];if(r!==xn&&Jt(r,e))return s[e]=2,r[e];if(Jt(o,e))return s[e]=3,o[e];if(n!==xn&&Jt(n,e))return s[e]=4,n[e];Kx&&(s[e]=0)}}const u=Bp[e];let c,d;if(u)return e==="$attrs"&&Dr(t.attrs,"get",""),u(t);if((c=a.__cssModules)&&(c=c[e]))return c;if(n!==xn&&Jt(n,e))return s[e]=4,n[e];if(d=l.config.globalProperties,Jt(d,e))return d[e]},set({_:t},e,n){const{data:i,setupState:r,ctx:o}=t;return sk(r,e)?(r[e]=n,!0):i!==xn&&Jt(i,e)?(i[e]=n,!0):Jt(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(o[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:i,appContext:r,props:o,type:s}},a){let l;return!!(n[a]||t!==xn&&a[0]!=="$"&&Jt(t,a)||sk(e,a)||Jt(o,a)||Jt(i,a)||Jt(Bp,a)||Jt(r.config.globalProperties,a)||(l=s.__cssModules)&&l[a])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Jt(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function $o(){return yz().slots}function Rf(){return yz().attrs}function yz(t){const e=Ct();return e.setupContext||(e.setupContext=zz(e))}function A_(t){return Pe(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function o5(t,e){return!t||!e?t||e:Pe(t)&&Pe(e)?t.concat(e):Ri({},A_(t),A_(e))}let Kx=!0;function mie(t){const e=_z(t),n=t.proxy,i=t.ctx;Kx=!1,e.beforeCreate&&s5(e.beforeCreate,t,"bc");const{data:r,computed:o,methods:s,watch:a,provide:l,inject:u,created:c,beforeMount:d,mounted:f,beforeUpdate:h,updated:m,activated:g,deactivated:v,beforeDestroy:p,beforeUnmount:b,destroyed:y,unmounted:_,render:C,renderTracked:S,renderTriggered:k,errorCaptured:T,serverPrefetch:E,expose:x,inheritAttrs:P,components:A,directives:I,filters:D}=e;if(u&&gie(u,i,null),s)for(const R in s){const O=s[R];Xe(O)&&(i[R]=O.bind(n))}if(r){const R=r.call(n,n);_t(R)&&(t.data=on(R))}if(Kx=!0,o)for(const R in o){const O=o[R],N=Xe(O)?O.bind(n,n):Xe(O.get)?O.get.bind(n,n):tn,F=!Xe(O)&&Xe(O.set)?O.set.bind(n):tn,j=M({get:N,set:F});Object.defineProperty(i,R,{enumerable:!0,configurable:!0,get:()=>j.value,set:U=>j.value=U})}if(a)for(const R in a)wz(a[R],i,n,R);if(l){const R=Xe(l)?l.call(n):l;Reflect.ownKeys(R).forEach(O=>{qt(O,R[O])})}c&&s5(c,t,"c");function z(R,O){Pe(O)?O.forEach(N=>R(N.bind(n))):O&&R(O.bind(n))}if(z(yC,d),z(Pt,f),z(xI,h),z(ku,m),z(hz,g),z(mz,v),z(cie,T),z(uie,S),z(lie,k),z(Sn,b),z(Fc,_),z(aie,E),Pe(x))if(x.length){const R=t.exposed||(t.exposed={});x.forEach(O=>{Object.defineProperty(R,O,{get:()=>n[O],set:N=>n[O]=N,enumerable:!0})})}else t.exposed||(t.exposed={});C&&t.render===tn&&(t.render=C),P!=null&&(t.inheritAttrs=P),A&&(t.components=A),I&&(t.directives=I),E&&fz(t)}function gie(t,e,n=tn){Pe(t)&&(t=Gx(t));for(const i in t){const r=t[i];let o;_t(r)?"default"in r?o=Ne(r.from||i,r.default,!0):o=Ne(r.from||i):o=Ne(r),rn(o)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>o.value,set:s=>o.value=s}):e[i]=o}}function s5(t,e,n){fa(Pe(t)?t.map(i=>i.bind(e.proxy)):t.bind(e.proxy),e,n)}function wz(t,e,n,i){let r=i.includes(".")?nz(n,i):()=>n[i];if(ot(t)){const o=e[t];Xe(o)&&Se(r,o)}else if(Xe(t))Se(r,t.bind(n));else if(_t(t))if(Pe(t))t.forEach(o=>wz(o,e,n,i));else{const o=Xe(t.handler)?t.handler.bind(n):e[t.handler];Xe(o)&&Se(r,o,t)}}function _z(t){const e=t.type,{mixins:n,extends:i}=e,{mixins:r,optionsCache:o,config:{optionMergeStrategies:s}}=t.appContext,a=o.get(e);let l;return a?l=a:!r.length&&!n&&!i?l=e:(l={},r.length&&r.forEach(u=>P_(l,u,s,!0)),P_(l,e,s)),_t(e)&&o.set(e,l),l}function P_(t,e,n,i=!1){const{mixins:r,extends:o}=e;o&&P_(t,o,n,!0),r&&r.forEach(s=>P_(t,s,n,!0));for(const s in e)if(!(i&&s==="expose")){const a=pie[s]||n&&n[s];t[s]=a?a(t[s],e[s]):e[s]}return t}const pie={data:a5,props:l5,emits:l5,methods:pp,computed:pp,beforeCreate:Gr,created:Gr,beforeMount:Gr,mounted:Gr,beforeUpdate:Gr,updated:Gr,beforeDestroy:Gr,beforeUnmount:Gr,destroyed:Gr,unmounted:Gr,activated:Gr,deactivated:Gr,errorCaptured:Gr,serverPrefetch:Gr,components:pp,directives:pp,watch:bie,provide:a5,inject:vie};function a5(t,e){return e?t?function(){return Ri(Xe(t)?t.call(this,this):t,Xe(e)?e.call(this,this):e)}:e:t}function vie(t,e){return pp(Gx(t),Gx(e))}function Gx(t){if(Pe(t)){const e={};for(let n=0;n{let c,d=xn,f;return tie(()=>{const h=t[r];bo(c,h)&&(c=h,u())}),{get(){return l(),n.get?n.get(c):c},set(h){const m=n.set?n.set(h):h;if(!bo(m,c)&&!(d!==xn&&bo(h,d)))return;const g=i.vnode.props;g&&(e in g||r in g||o in g)&&(`onUpdate:${e}`in g||`onUpdate:${r}`in g||`onUpdate:${o}`in g)||(c=h,u()),i.emit(`update:${e}`,m),bo(h,m)&&bo(h,d)&&!bo(m,f)&&u(),d=h,f=m}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?s||xn:a,done:!1}:{done:!0}}}},a}const Sz=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Oo(e)}Modifiers`]||t[`${bl(e)}Modifiers`];function Cie(t,e,...n){if(t.isUnmounted)return;const i=t.vnode.props||xn;let r=n;const o=e.startsWith("update:"),s=o&&Sz(i,e.slice(7));s&&(s.trim&&(r=n.map(c=>ot(c)?c.trim():c)),s.number&&(r=n.map(yI)));let a,l=i[a=Rp(e)]||i[a=Rp(Oo(e))];!l&&o&&(l=i[a=Rp(bl(e))]),l&&fa(l,t,6,r);const u=i[a+"Once"];if(u){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,fa(u,t,6,r)}}const Sie=new WeakMap;function kz(t,e,n=!1){const i=n?Sie:e.emitsCache,r=i.get(t);if(r!==void 0)return r;const o=t.emits;let s={},a=!1;if(!Xe(t)){const l=u=>{const c=kz(u,e,!0);c&&(a=!0,Ri(s,c))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!o&&!a?(_t(t)&&i.set(t,null),null):(Pe(o)?o.forEach(l=>s[l]=null):Ri(s,o),_t(t)&&i.set(t,s),s)}function wC(t,e){return!t||!oC(e)?!1:(e=e.slice(2).replace(/Once$/,""),Jt(t,e[0].toLowerCase()+e.slice(1))||Jt(t,bl(e))||Jt(t,e))}function u5(t){const{type:e,vnode:n,proxy:i,withProxy:r,propsOptions:[o],slots:s,attrs:a,emit:l,render:u,renderCache:c,props:d,data:f,setupState:h,ctx:m,inheritAttrs:g}=t,v=E_(t);let p,b;try{if(n.shapeFlag&4){const _=r||i,C=_;p=Ua(u.call(C,_,c,d,h,f,m)),b=a}else{const _=e;p=Ua(_.length>1?_(d,{attrs:a,slots:s,emit:l}):_(d,null)),b=e.props?a:kie(a)}}catch(_){Vp.length=0,gC(_,t,1),p=L(xi)}let y=p;if(b&&g!==!1){const _=Object.keys(b),{shapeFlag:C}=y;_.length&&C&7&&(o&&_.some(vI)&&(b=Tie(b,o)),y=al(y,b,!1,!0))}return n.dirs&&(y=al(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&pf(y,n.transition),p=y,E_(v),p}const kie=t=>{let e;for(const n in t)(n==="class"||n==="style"||oC(n))&&((e||(e={}))[n]=t[n]);return e},Tie=(t,e)=>{const n={};for(const i in t)(!vI(i)||!(i.slice(9)in e))&&(n[i]=t[i]);return n};function Eie(t,e,n){const{props:i,children:r,component:o}=t,{props:s,children:a,patchFlag:l}=e,u=o.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return i?c5(i,s,u):!!s;if(l&8){const c=e.dynamicProps;for(let d=0;dObject.create(Ez),Az=t=>Object.getPrototypeOf(t)===Ez;function Aie(t,e,n,i=!1){const r={},o=xz();t.propsDefaults=Object.create(null),Pz(t,e,r,o);for(const s in t.propsOptions[0])s in r||(r[s]=void 0);n?t.props=i?r:Lp(r):t.type.props?t.props=r:t.props=o,t.attrs=o}function Pie(t,e,n,i){const{props:r,attrs:o,vnode:{patchFlag:s}}=t,a=ln(r),[l]=t.propsOptions;let u=!1;if((i||s>0)&&!(s&16)){if(s&8){const c=t.vnode.dynamicProps;for(let d=0;d{l=!0;const[f,h]=Iz(d,e,!0);Ri(s,f),h&&a.push(...h)};!n&&e.mixins.length&&e.mixins.forEach(c),t.extends&&c(t.extends),t.mixins&&t.mixins.forEach(c)}if(!o&&!l)return _t(t)&&i.set(t,nm),nm;if(Pe(o))for(let c=0;ct==="_"||t==="_ctx"||t==="$stable",RI=t=>Pe(t)?t.map(Ua):[Ua(t)],Rie=(t,e,n)=>{if(e._n)return e;const i=ce((...r)=>RI(e(...r)),n);return i._c=!1,i},Rz=(t,e,n)=>{const i=t._ctx;for(const r in t){if(II(r))continue;const o=t[r];if(Xe(o))e[r]=Rie(r,o,i);else if(o!=null){const s=RI(o);e[r]=()=>s}}},Mz=(t,e)=>{const n=RI(e);t.slots.default=()=>n},Oz=(t,e,n)=>{for(const i in e)(n||!II(i))&&(t[i]=e[i])},Mie=(t,e,n)=>{const i=t.slots=xz();if(t.vnode.shapeFlag&32){const r=e._;r?(Oz(i,e,n),n&&A9(i,"_",r,!0)):Rz(e,i)}else e&&Mz(t,e)},Oie=(t,e,n)=>{const{vnode:i,slots:r}=t;let o=!0,s=xn;if(i.shapeFlag&32){const a=e._;a?n&&a===1?o=!1:Oz(r,e,n):(o=!e.$stable,Rz(e,r)),s=e}else e&&(Mz(t,e),s={default:1});if(o)for(const a in r)!II(a)&&s[a]==null&&delete r[a]},Ir=Vie;function Lie(t){return Die(t)}function Die(t,e){const n=uC();n.__VUE__=!0;const{insert:i,remove:r,patchProp:o,createElement:s,createText:a,createComment:l,setText:u,setElementText:c,parentNode:d,nextSibling:f,setScopeId:h=tn,insertStaticContent:m}=t,g=(V,K,G,ye=null,be=null,Ce=null,Y=void 0,Z=null,ae=!!K.dynamicChildren)=>{if(V===K)return;V&&!Bd(V,K)&&(ye=X(V),U(V,be,Ce,!0),V=null),K.patchFlag===-2&&(ae=!1,K.dynamicChildren=null);const{type:pe,ref:je,shapeFlag:Ie}=K;switch(pe){case Mf:v(V,K,G,ye);break;case xi:p(V,K,G,ye);break;case lk:V==null&&b(K,G,ye,Y);break;case rt:A(V,K,G,ye,be,Ce,Y,Z,ae);break;default:Ie&1?C(V,K,G,ye,be,Ce,Y,Z,ae):Ie&6?I(V,K,G,ye,be,Ce,Y,Z,ae):(Ie&64||Ie&128)&&pe.process(V,K,G,ye,be,Ce,Y,Z,ae,ee)}je!=null&&be?Np(je,V&&V.ref,Ce,K||V,!K):je==null&&V&&V.ref!=null&&Np(V.ref,null,Ce,V,!0)},v=(V,K,G,ye)=>{if(V==null)i(K.el=a(K.children),G,ye);else{const be=K.el=V.el;K.children!==V.children&&u(be,K.children)}},p=(V,K,G,ye)=>{V==null?i(K.el=l(K.children||""),G,ye):K.el=V.el},b=(V,K,G,ye)=>{[V.el,V.anchor]=m(V.children,K,G,ye,V.el,V.anchor)},y=({el:V,anchor:K},G,ye)=>{let be;for(;V&&V!==K;)be=f(V),i(V,G,ye),V=be;i(K,G,ye)},_=({el:V,anchor:K})=>{let G;for(;V&&V!==K;)G=f(V),r(V),V=G;r(K)},C=(V,K,G,ye,be,Ce,Y,Z,ae)=>{if(K.type==="svg"?Y="svg":K.type==="math"&&(Y="mathml"),V==null)S(K,G,ye,be,Ce,Y,Z,ae);else{const pe=V.el&&V.el._isVueCE?V.el:null;try{pe&&pe._beginPatch(),E(V,K,be,Ce,Y,Z,ae)}finally{pe&&pe._endPatch()}}},S=(V,K,G,ye,be,Ce,Y,Z)=>{let ae,pe;const{props:je,shapeFlag:Ie,transition:fe,dirs:Te}=V;if(ae=V.el=s(V.type,Ce,je&&je.is,je),Ie&8?c(ae,V.children):Ie&16&&T(V.children,ae,null,ye,be,ak(V,Ce),Y,Z),Te&&ed(V,null,ye,"created"),k(ae,V,V.scopeId,Y,ye),je){for(const Re in je)Re!=="value"&&!Ip(Re)&&o(ae,Re,null,je[Re],Ce,ye);"value"in je&&o(ae,"value",null,je.value,Ce),(pe=je.onVnodeBeforeMount)&&Ea(pe,ye,V)}Te&&ed(V,null,ye,"beforeMount");const et=Nie(be,fe);et&&fe.beforeEnter(ae),i(ae,K,G),((pe=je&&je.onVnodeMounted)||et||Te)&&Ir(()=>{pe&&Ea(pe,ye,V),et&&fe.enter(ae),Te&&ed(V,null,ye,"mounted")},be)},k=(V,K,G,ye,be)=>{if(G&&h(V,G),ye)for(let Ce=0;Ce{for(let pe=ae;pe{const Z=K.el=V.el;let{patchFlag:ae,dynamicChildren:pe,dirs:je}=K;ae|=V.patchFlag&16;const Ie=V.props||xn,fe=K.props||xn;let Te;if(G&&td(G,!1),(Te=fe.onVnodeBeforeUpdate)&&Ea(Te,G,K,V),je&&ed(K,V,G,"beforeUpdate"),G&&td(G,!0),(Ie.innerHTML&&fe.innerHTML==null||Ie.textContent&&fe.textContent==null)&&c(Z,""),pe?x(V.dynamicChildren,pe,Z,G,ye,ak(K,be),Ce):Y||O(V,K,Z,null,G,ye,ak(K,be),Ce,!1),ae>0){if(ae&16)P(Z,Ie,fe,G,be);else if(ae&2&&Ie.class!==fe.class&&o(Z,"class",null,fe.class,be),ae&4&&o(Z,"style",Ie.style,fe.style,be),ae&8){const et=K.dynamicProps;for(let Re=0;Re{Te&&Ea(Te,G,K,V),je&&ed(K,V,G,"updated")},ye)},x=(V,K,G,ye,be,Ce,Y)=>{for(let Z=0;Z{if(K!==G){if(K!==xn)for(const Ce in K)!Ip(Ce)&&!(Ce in G)&&o(V,Ce,K[Ce],null,be,ye);for(const Ce in G){if(Ip(Ce))continue;const Y=G[Ce],Z=K[Ce];Y!==Z&&Ce!=="value"&&o(V,Ce,Z,Y,be,ye)}"value"in G&&o(V,"value",K.value,G.value,be)}},A=(V,K,G,ye,be,Ce,Y,Z,ae)=>{const pe=K.el=V?V.el:a(""),je=K.anchor=V?V.anchor:a("");let{patchFlag:Ie,dynamicChildren:fe,slotScopeIds:Te}=K;Te&&(Z=Z?Z.concat(Te):Te),V==null?(i(pe,G,ye),i(je,G,ye),T(K.children||[],G,je,be,Ce,Y,Z,ae)):Ie>0&&Ie&64&&fe&&V.dynamicChildren&&V.dynamicChildren.length===fe.length?(x(V.dynamicChildren,fe,G,be,Ce,Y,Z),(K.key!=null||be&&K===be.subTree)&&MI(V,K,!0)):O(V,K,G,je,be,Ce,Y,Z,ae)},I=(V,K,G,ye,be,Ce,Y,Z,ae)=>{K.slotScopeIds=Z,V==null?K.shapeFlag&512?be.ctx.activate(K,G,ye,Y,ae):D(K,G,ye,be,Ce,Y,ae):q(V,K,ae)},D=(V,K,G,ye,be,Ce,Y)=>{const Z=V.component=Uie(V,ye,be);if(vC(V)&&(Z.ctx.renderer=ee),Wie(Z,!1,Y),Z.asyncDep){if(be&&be.registerDep(Z,z,Y),!V.el){const ae=Z.subTree=L(xi);p(null,ae,K,G),V.placeholder=ae.el}}else z(Z,V,K,G,be,Ce,Y)},q=(V,K,G)=>{const ye=K.component=V.component;if(Eie(V,K,G))if(ye.asyncDep&&!ye.asyncResolved){R(ye,K,G);return}else ye.next=K,ye.update();else K.el=V.el,ye.vnode=K},z=(V,K,G,ye,be,Ce,Y)=>{const Z=()=>{if(V.isMounted){let{next:Ie,bu:fe,u:Te,parent:et,vnode:Re}=V;{const Je=Lz(V);if(Je){Ie&&(Ie.el=Re.el,R(V,Ie,Y)),Je.asyncDep.then(()=>{Ir(()=>{V.isUnmounted||pe()},be)});return}}let ze=Ie,Ke;td(V,!1),Ie?(Ie.el=Re.el,R(V,Ie,Y)):Ie=Re,fe&&gw(fe),(Ke=Ie.props&&Ie.props.onVnodeBeforeUpdate)&&Ea(Ke,et,Ie,Re),td(V,!0);const Dt=u5(V),Cn=V.subTree;V.subTree=Dt,g(Cn,Dt,d(Cn.el),X(Cn),V,be,Ce),Ie.el=Dt.el,ze===null&&xie(V,Dt.el),Te&&Ir(Te,be),(Ke=Ie.props&&Ie.props.onVnodeUpdated)&&Ir(()=>Ea(Ke,et,Ie,Re),be)}else{let Ie;const{el:fe,props:Te}=K,{bm:et,m:Re,parent:ze,root:Ke,type:Dt}=V,Cn=om(K);td(V,!1),et&&gw(et),!Cn&&(Ie=Te&&Te.onVnodeBeforeMount)&&Ea(Ie,ze,K),td(V,!0);{Ke.ce&&Ke.ce._hasShadowRoot()&&Ke.ce._injectChildStyle(Dt);const Je=V.subTree=u5(V);g(null,Je,G,ye,V,be,Ce),K.el=Je.el}if(Re&&Ir(Re,be),!Cn&&(Ie=Te&&Te.onVnodeMounted)){const Je=K;Ir(()=>Ea(Ie,ze,Je),be)}(K.shapeFlag&256||ze&&om(ze.vnode)&&ze.vnode.shapeFlag&256)&&V.a&&Ir(V.a,be),V.isMounted=!0,K=G=ye=null}};V.scope.on();const ae=V.effect=new C_(Z);V.scope.off();const pe=V.update=ae.run.bind(ae),je=V.job=ae.runIfDirty.bind(ae);je.i=V,je.id=V.uid,ae.scheduler=()=>TI(je),td(V,!0),pe()},R=(V,K,G)=>{K.component=V;const ye=V.vnode.props;V.vnode=K,V.next=null,Pie(V,K.props,ye,G),Oie(V,K.children,G),du(),JL(V),fu()},O=(V,K,G,ye,be,Ce,Y,Z,ae=!1)=>{const pe=V&&V.children,je=V?V.shapeFlag:0,Ie=K.children,{patchFlag:fe,shapeFlag:Te}=K;if(fe>0){if(fe&128){F(pe,Ie,G,ye,be,Ce,Y,Z,ae);return}else if(fe&256){N(pe,Ie,G,ye,be,Ce,Y,Z,ae);return}}Te&8?(je&16&&he(pe,be,Ce),Ie!==pe&&c(G,Ie)):je&16?Te&16?F(pe,Ie,G,ye,be,Ce,Y,Z,ae):he(pe,be,Ce,!0):(je&8&&c(G,""),Te&16&&T(Ie,G,ye,be,Ce,Y,Z,ae))},N=(V,K,G,ye,be,Ce,Y,Z,ae)=>{V=V||nm,K=K||nm;const pe=V.length,je=K.length,Ie=Math.min(pe,je);let fe;for(fe=0;feje?he(V,be,Ce,!0,!1,Ie):T(K,G,ye,be,Ce,Y,Z,ae,Ie)},F=(V,K,G,ye,be,Ce,Y,Z,ae)=>{let pe=0;const je=K.length;let Ie=V.length-1,fe=je-1;for(;pe<=Ie&&pe<=fe;){const Te=V[pe],et=K[pe]=ae?Ul(K[pe]):Ua(K[pe]);if(Bd(Te,et))g(Te,et,G,null,be,Ce,Y,Z,ae);else break;pe++}for(;pe<=Ie&&pe<=fe;){const Te=V[Ie],et=K[fe]=ae?Ul(K[fe]):Ua(K[fe]);if(Bd(Te,et))g(Te,et,G,null,be,Ce,Y,Z,ae);else break;Ie--,fe--}if(pe>Ie){if(pe<=fe){const Te=fe+1,et=Tefe)for(;pe<=Ie;)U(V[pe],be,Ce,!0),pe++;else{const Te=pe,et=pe,Re=new Map;for(pe=et;pe<=fe;pe++){const ge=K[pe]=ae?Ul(K[pe]):Ua(K[pe]);ge.key!=null&&Re.set(ge.key,pe)}let ze,Ke=0;const Dt=fe-et+1;let Cn=!1,Je=0;const kt=new Array(Dt);for(pe=0;pe=Dt){U(ge,be,Ce,!0);continue}let Le;if(ge.key!=null)Le=Re.get(ge.key);else for(ze=et;ze<=fe;ze++)if(kt[ze-et]===0&&Bd(ge,K[ze])){Le=ze;break}Le===void 0?U(ge,be,Ce,!0):(kt[Le-et]=pe+1,Le>=Je?Je=Le:Cn=!0,g(ge,K[Le],G,null,be,Ce,Y,Z,ae),Ke++)}const Et=Cn?Bie(kt):nm;for(ze=Et.length-1,pe=Dt-1;pe>=0;pe--){const ge=et+pe,Le=K[ge],de=K[ge+1],Ve=ge+1{const{el:Ce,type:Y,transition:Z,children:ae,shapeFlag:pe}=V;if(pe&6){j(V.component.subTree,K,G,ye);return}if(pe&128){V.suspense.move(K,G,ye);return}if(pe&64){Y.move(V,K,G,ee);return}if(Y===rt){i(Ce,K,G);for(let Ie=0;IeZ.enter(Ce),be);else{const{leave:Ie,delayLeave:fe,afterLeave:Te}=Z,et=()=>{V.ctx.isUnmounted?r(Ce):i(Ce,K,G)},Re=()=>{Ce._isLeaving&&Ce[$a](!0),Ie(Ce,()=>{et(),Te&&Te()})};fe?fe(Ce,et,Re):Re()}else i(Ce,K,G)},U=(V,K,G,ye=!1,be=!1)=>{const{type:Ce,props:Y,ref:Z,children:ae,dynamicChildren:pe,shapeFlag:je,patchFlag:Ie,dirs:fe,cacheIndex:Te}=V;if(Ie===-2&&(be=!1),Z!=null&&(du(),Np(Z,null,G,V,!0),fu()),Te!=null&&(K.renderCache[Te]=void 0),je&256){K.ctx.deactivate(V);return}const et=je&1&&fe,Re=!om(V);let ze;if(Re&&(ze=Y&&Y.onVnodeBeforeUnmount)&&Ea(ze,K,V),je&6)ne(V.component,G,ye);else{if(je&128){V.suspense.unmount(G,ye);return}et&&ed(V,null,K,"beforeUnmount"),je&64?V.type.remove(V,K,G,ee,ye):pe&&!pe.hasOnce&&(Ce!==rt||Ie>0&&Ie&64)?he(pe,K,G,!1,!0):(Ce===rt&&Ie&384||!be&&je&16)&&he(ae,K,G),ye&&W(V)}(Re&&(ze=Y&&Y.onVnodeUnmounted)||et)&&Ir(()=>{ze&&Ea(ze,K,V),et&&ed(V,null,K,"unmounted")},G)},W=V=>{const{type:K,el:G,anchor:ye,transition:be}=V;if(K===rt){J(G,ye);return}if(K===lk){_(V);return}const Ce=()=>{r(G),be&&!be.persisted&&be.afterLeave&&be.afterLeave()};if(V.shapeFlag&1&&be&&!be.persisted){const{leave:Y,delayLeave:Z}=be,ae=()=>Y(G,Ce);Z?Z(V.el,Ce,ae):ae()}else Ce()},J=(V,K)=>{let G;for(;V!==K;)G=f(V),r(V),V=G;r(K)},ne=(V,K,G)=>{const{bum:ye,scope:be,job:Ce,subTree:Y,um:Z,m:ae,a:pe}=V;f5(ae),f5(pe),ye&&gw(ye),be.stop(),Ce&&(Ce.flags|=8,U(Y,V,K,G)),Z&&Ir(Z,K),Ir(()=>{V.isUnmounted=!0},K)},he=(V,K,G,ye=!1,be=!1,Ce=0)=>{for(let Y=Ce;Y{if(V.shapeFlag&6)return X(V.component.subTree);if(V.shapeFlag&128)return V.suspense.next();const K=f(V.anchor||V.el),G=K&&K[iz];return G?f(G):K};let se=!1;const re=(V,K,G)=>{let ye;V==null?K._vnode&&(U(K._vnode,null,null,!0),ye=K._vnode.component):g(K._vnode||null,V,K,null,null,null,G),K._vnode=V,se||(se=!0,JL(ye),Z9(),se=!1)},ee={p:g,um:U,m:j,r:W,mt:D,mc:T,pc:O,pbc:x,n:X,o:t};return{render:re,hydrate:void 0,createApp:wie(re)}}function ak({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function td({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function Nie(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function MI(t,e,n=!1){const i=t.children,r=e.children;if(Pe(i)&&Pe(r))for(let o=0;o>1,t[n[a]]0&&(e[i]=n[o-1]),n[o]=i)}}for(o=n.length,s=n[o-1];o-- >0;)n[o]=s,s=e[s];return n}function Lz(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Lz(e)}function f5(t){if(t)for(let e=0;et.__isSuspense;function Vie(t,e){e&&e.pendingBranch?Pe(t)?e.effects.push(...t):e.effects.push(t):Zne(t)}const rt=Symbol.for("v-fgt"),Mf=Symbol.for("v-txt"),xi=Symbol.for("v-cmt"),lk=Symbol.for("v-stc"),Vp=[];let Zo=null;function B(t=!1){Vp.push(Zo=t?null:[])}function Fie(){Vp.pop(),Zo=Vp[Vp.length-1]||null}let xv=1;function I_(t,e=!1){xv+=t,t<0&&Zo&&e&&(Zo.hasOnce=!0)}function Bz(t){return t.dynamicChildren=xv>0?Zo||nm:null,Fie(),xv>0&&Zo&&Zo.push(t),t}function Q(t,e,n,i,r,o){return Bz(ie(t,e,n,i,r,o,!0))}function _e(t,e,n,i,r){return Bz(L(t,e,n,i,r,!0))}function yi(t){return t?t.__v_isVNode===!0:!1}function Bd(t,e){return t.type===e.type&&t.key===e.key}const Vz=({key:t})=>t??null,ww=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?ot(t)||rn(t)||Xe(t)?{i:br,r:t,k:e,f:!!n}:t:null);function ie(t,e=null,n=null,i=0,r=null,o=t===rt?0:1,s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Vz(e),ref:e&&ww(e),scopeId:ez,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:br};return a?(OI(l,n),o&128&&t.normalize(l)):n&&(l.shapeFlag|=ot(n)?8:16),xv>0&&!s&&Zo&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Zo.push(l),l}const L=$ie;function $ie(t,e=null,n=null,i=0,r=null,o=!1){if((!t||t===pz)&&(t=xi),yi(t)){const a=al(t,e,!0);return n&&OI(a,n),xv>0&&!o&&Zo&&(a.shapeFlag&6?Zo[Zo.indexOf(t)]=a:Zo.push(a)),a.patchFlag=-2,a}if(Gie(t)&&(t=t.__vccOpts),e){e=Fp(e);let{class:a,style:l}=e;a&&!ot(a)&&(e.class=$(a)),_t(l)&&(mC(l)&&!Pe(l)&&(l=Ri({},l)),e.style=mt(l))}const s=ot(t)?1:Nz(t)?128:rz(t)?64:_t(t)?4:Xe(t)?2:0;return ie(t,e,n,i,r,s,o,!0)}function Fp(t){return t?mC(t)||Az(t)?Ri({},t):t:null}function al(t,e,n=!1,i=!1){const{props:r,ref:o,patchFlag:s,children:a,transition:l}=t,u=e?Lt(r||{},e):r,c={__v_isVNode:!0,__v_skip:!0,type:t.type,props:u,key:u&&Vz(u),ref:e&&e.ref?n&&o?Pe(o)?o.concat(ww(e)):[o,ww(e)]:ww(e):o,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==rt?s===-1?16:s|16:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&al(t.ssContent),ssFallback:t.ssFallback&&al(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&i&&pf(c,l.clone(c)),c}function dt(t=" ",e=0){return L(Mf,null,t,e)}function ve(t="",e=!1){return e?(B(),_e(xi,null,t)):L(xi,null,t)}function Ua(t){return t==null||typeof t=="boolean"?L(xi):Pe(t)?L(rt,null,t.slice()):yi(t)?Ul(t):L(Mf,null,String(t))}function Ul(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:al(t)}function OI(t,e){let n=0;const{shapeFlag:i}=t;if(e==null)e=null;else if(Pe(e))n=16;else if(typeof e=="object")if(i&65){const r=e.default;r&&(r._c&&(r._d=!1),OI(t,r()),r._c&&(r._d=!0));return}else{n=32;const r=e._;!r&&!Az(e)?e._ctx=br:r===3&&br&&(br.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else Xe(e)?(e={default:e,_ctx:br},n=32):(e=String(e),i&64?(n=16,e=[dt(e)]):n=8);t.children=e,t.shapeFlag|=n}function Lt(...t){const e={};for(let n=0;nNr||br;let R_,Xx;{const t=uC(),e=(n,i)=>{let r;return(r=t[n])||(r=t[n]=[]),r.push(i),o=>{r.length>1?r.forEach(s=>s(o)):r[0](o)}};R_=e("__VUE_INSTANCE_SETTERS__",n=>Nr=n),Xx=e("__VUE_SSR_SETTERS__",n=>Av=n)}const Ub=t=>{const e=Nr;return R_(t),t.scope.on(),()=>{t.scope.off(),R_(e)}},h5=()=>{Nr&&Nr.scope.off(),R_(null)};function Fz(t){return t.vnode.shapeFlag&4}let Av=!1;function Wie(t,e=!1,n=!1){e&&Xx(e);const{props:i,children:r}=t.vnode,o=Fz(t);Aie(t,i,o,e),Mie(t,r,n||e);const s=o?qie(t,e):void 0;return e&&Xx(!1),s}function qie(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,hie);const{setup:i}=n;if(i){du();const r=t.setupContext=i.length>1?zz(t):null,o=Ub(t),s=Hb(i,t,0,[t.props,r]),a=_v(s);if(fu(),o(),(a||t.sp)&&!om(t)&&fz(t),a){if(s.then(h5,h5),e)return s.then(l=>{m5(t,l)}).catch(l=>{gC(l,t,0)});t.asyncDep=s}else m5(t,s)}else $z(t)}function m5(t,e,n){Xe(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:_t(e)&&(t.setupState=G9(e)),$z(t)}function $z(t,e,n){const i=t.type;t.render||(t.render=i.render||tn);{const r=Ub(t);du();try{mie(t)}finally{fu(),r()}}}const jie={get(t,e){return Dr(t,"get",""),t[e]}};function zz(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,jie),slots:t.slots,emit:t.emit,expose:e}}function _C(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(G9(ca(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in Bp)return Bp[n](t)},has(e,n){return n in e||n in Bp}})):t.proxy}function Kie(t,e=!0){return Xe(t)?t.displayName||t.name:t.name||e&&t.__name}function Gie(t){return Xe(t)&&"__vccOpts"in t}const M=(t,e)=>Kne(t,e,Av);function nt(t,e,n){try{I_(-1);const i=arguments.length;return i===2?_t(e)&&!Pe(e)?yi(e)?L(t,null,[e]):L(t,e):L(t,null,e):(i>3?n=Array.prototype.slice.call(arguments,2):i===3&&yi(n)&&(n=[n]),L(t,e,n))}finally{I_(1)}}const LI="3.5.29",Yie=tn;let Jx;const g5=typeof window<"u"&&window.trustedTypes;if(g5)try{Jx=g5.createPolicy("vue",{createHTML:t=>t})}catch{}const Hz=Jx?t=>Jx.createHTML(t):t=>t,Xie="http://www.w3.org/2000/svg",Jie="http://www.w3.org/1998/Math/MathML",$l=typeof document<"u"?document:null,p5=$l&&$l.createElement("template"),Zie={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,i)=>{const r=e==="svg"?$l.createElementNS(Xie,t):e==="mathml"?$l.createElementNS(Jie,t):n?$l.createElement(t,{is:n}):$l.createElement(t);return t==="select"&&i&&i.multiple!=null&&r.setAttribute("multiple",i.multiple),r},createText:t=>$l.createTextNode(t),createComment:t=>$l.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>$l.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,i,r,o){const s=n?n.previousSibling:e.lastChild;if(r&&(r===o||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),n),!(r===o||!(r=r.nextSibling)););else{p5.innerHTML=Hz(i==="svg"?`${t}`:i==="mathml"?`${t}`:t);const a=p5.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,n)}return[s?s.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},Ru="transition",Ag="animation",Sm=Symbol("_vtc"),Uz={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Wz=Ri({},lz,Uz),Qie=t=>(t.displayName="Transition",t.props=Wz,t),ya=Qie((t,{slots:e})=>nt(oie,qz(t),e)),nd=(t,e=[])=>{Pe(t)?t.forEach(n=>n(...e)):t&&t(...e)},v5=t=>t?Pe(t)?t.some(e=>e.length>1):t.length>1:!1;function qz(t){const e={};for(const A in t)A in Uz||(e[A]=t[A]);if(t.css===!1)return e;const{name:n="v",type:i,duration:r,enterFromClass:o=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=o,appearActiveClass:u=s,appearToClass:c=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=t,m=ere(r),g=m&&m[0],v=m&&m[1],{onBeforeEnter:p,onEnter:b,onEnterCancelled:y,onLeave:_,onLeaveCancelled:C,onBeforeAppear:S=p,onAppear:k=b,onAppearCancelled:T=y}=e,E=(A,I,D,q)=>{A._enterCancelled=q,Ku(A,I?c:a),Ku(A,I?u:s),D&&D()},x=(A,I)=>{A._isLeaving=!1,Ku(A,d),Ku(A,h),Ku(A,f),I&&I()},P=A=>(I,D)=>{const q=A?k:b,z=()=>E(I,A,D);nd(q,[I,z]),b5(()=>{Ku(I,A?l:o),Va(I,A?c:a),v5(q)||y5(I,i,g,z)})};return Ri(e,{onBeforeEnter(A){nd(p,[A]),Va(A,o),Va(A,s)},onBeforeAppear(A){nd(S,[A]),Va(A,l),Va(A,u)},onEnter:P(!1),onAppear:P(!0),onLeave(A,I){A._isLeaving=!0;const D=()=>x(A,I);Va(A,d),A._enterCancelled?(Va(A,f),Zx(A)):(Zx(A),Va(A,f)),b5(()=>{A._isLeaving&&(Ku(A,d),Va(A,h),v5(_)||y5(A,i,v,D))}),nd(_,[A,D])},onEnterCancelled(A){E(A,!1,void 0,!0),nd(y,[A])},onAppearCancelled(A){E(A,!0,void 0,!0),nd(T,[A])},onLeaveCancelled(A){x(A),nd(C,[A])}})}function ere(t){if(t==null)return null;if(_t(t))return[uk(t.enter),uk(t.leave)];{const e=uk(t);return[e,e]}}function uk(t){return fne(t)}function Va(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[Sm]||(t[Sm]=new Set)).add(e)}function Ku(t,e){e.split(/\s+/).forEach(i=>i&&t.classList.remove(i));const n=t[Sm];n&&(n.delete(e),n.size||(t[Sm]=void 0))}function b5(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let tre=0;function y5(t,e,n,i){const r=t._endId=++tre,o=()=>{r===t._endId&&i()};if(n!=null)return setTimeout(o,n);const{type:s,timeout:a,propCount:l}=jz(t,e);if(!s)return i();const u=s+"end";let c=0;const d=()=>{t.removeEventListener(u,f),o()},f=h=>{h.target===t&&++c>=l&&d()};setTimeout(()=>{c(n[m]||"").split(", "),r=i(`${Ru}Delay`),o=i(`${Ru}Duration`),s=w5(r,o),a=i(`${Ag}Delay`),l=i(`${Ag}Duration`),u=w5(a,l);let c=null,d=0,f=0;e===Ru?s>0&&(c=Ru,d=s,f=o.length):e===Ag?u>0&&(c=Ag,d=u,f=l.length):(d=Math.max(s,u),c=d>0?s>u?Ru:Ag:null,f=c?c===Ru?o.length:l.length:0);const h=c===Ru&&/\b(?:transform|all)(?:,|$)/.test(i(`${Ru}Property`).toString());return{type:c,timeout:d,propCount:f,hasTransform:h}}function w5(t,e){for(;t.length_5(n)+_5(t[i])))}function _5(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function Zx(t){return(t?t.ownerDocument:document).body.offsetHeight}function nre(t,e,n){const i=t[Sm];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const M_=Symbol("_vod"),Kz=Symbol("_vsh"),On={name:"show",beforeMount(t,{value:e},{transition:n}){t[M_]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):Pg(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:i}){!e!=!n&&(i?e?(i.beforeEnter(t),Pg(t,!0),i.enter(t)):i.leave(t,()=>{Pg(t,!1)}):Pg(t,e))},beforeUnmount(t,{value:e}){Pg(t,e)}};function Pg(t,e){t.style.display=e?t[M_]:"none",t[Kz]=!e}const ire=Symbol(""),rre=/(?:^|;)\s*display\s*:/;function ore(t,e,n){const i=t.style,r=ot(n);let o=!1;if(n&&!r){if(e)if(ot(e))for(const s of e.split(";")){const a=s.slice(0,s.indexOf(":")).trim();n[a]==null&&_w(i,a,"")}else for(const s in e)n[s]==null&&_w(i,s,"");for(const s in n)s==="display"&&(o=!0),_w(i,s,n[s])}else if(r){if(e!==n){const s=i[ire];s&&(n+=";"+s),i.cssText=n,o=rre.test(n)}}else e&&t.removeAttribute("style");M_ in t&&(t[M_]=o?i.display:"",t[Kz]&&(i.display="none"))}const C5=/\s*!important$/;function _w(t,e,n){if(Pe(n))n.forEach(i=>_w(t,e,i));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const i=sre(t,e);C5.test(n)?t.setProperty(bl(i),n.replace(C5,""),"important"):t[i]=n}}const S5=["Webkit","Moz","ms"],ck={};function sre(t,e){const n=ck[e];if(n)return n;let i=Oo(e);if(i!=="filter"&&i in t)return ck[e]=i;i=$b(i);for(let r=0;rdk||(cre.then(()=>dk=0),dk=Date.now());function fre(t,e){const n=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=n.attached)return;fa(hre(i,n.value),e,5,[i])};return n.value=t,n.attached=dre(),n}function hre(t,e){if(Pe(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(i=>r=>!r._stopped&&i&&i(r))}else return e}const P5=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,mre=(t,e,n,i,r,o)=>{const s=r==="svg";e==="class"?nre(t,i,s):e==="style"?ore(t,n,i):oC(e)?vI(e)||lre(t,e,n,i,o):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):gre(t,e,i,s))?(E5(t,e,i),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&T5(t,e,i,s,o,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!ot(i))?E5(t,Oo(e),i,o,e):(e==="true-value"?t._trueValue=i:e==="false-value"&&(t._falseValue=i),T5(t,e,i,s))};function gre(t,e,n,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in t&&P5(e)&&Xe(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=t.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return P5(e)&&ot(n)?!1:e in t}const Gz=new WeakMap,Yz=new WeakMap,O_=Symbol("_moveCb"),I5=Symbol("_enterCb"),pre=t=>(delete t.props.mode,t),vre=pre({name:"TransitionGroup",props:Ri({},Wz,{tag:String,moveClass:String}),setup(t,{slots:e}){const n=Ct(),i=az();let r,o;return ku(()=>{if(!r.length)return;const s=t.moveClass||`${t.name||"v"}-move`;if(!_re(r[0].el,n.vnode.el,s)){r=[];return}r.forEach(bre),r.forEach(yre);const a=r.filter(wre);Zx(n.vnode.el),a.forEach(l=>{const u=l.el,c=u.style;Va(u,s),c.transform=c.webkitTransform=c.transitionDuration="";const d=u[O_]=f=>{f&&f.target!==u||(!f||f.propertyName.endsWith("transform"))&&(u.removeEventListener("transitionend",d),u[O_]=null,Ku(u,s))};u.addEventListener("transitionend",d)}),r=[]}),()=>{const s=ln(t),a=qz(s);let l=s.tag||rt;if(r=[],o)for(let u=0;u{a.split(/\s+/).forEach(l=>l&&i.classList.remove(l))}),n.split(/\s+/).forEach(a=>a&&i.classList.add(a)),i.style.display="none";const o=e.nodeType===1?e:e.parentNode;o.appendChild(i);const{hasTransform:s}=jz(i);return o.removeChild(i),s}const km=t=>{const e=t.props["onUpdate:modelValue"]||!1;return Pe(e)?n=>gw(e,n):e};function Cre(t){t.target.composing=!0}function R5(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const ru=Symbol("_assign");function M5(t,e,n){return e&&(t=t.trim()),n&&(t=yI(t)),t}const Sre={created(t,{modifiers:{lazy:e,trim:n,number:i}},r){t[ru]=km(r);const o=i||r.props&&r.props.type==="number";oc(t,e?"change":"input",s=>{s.target.composing||t[ru](M5(t.value,n,o))}),(n||o)&&oc(t,"change",()=>{t.value=M5(t.value,n,o)}),e||(oc(t,"compositionstart",Cre),oc(t,"compositionend",R5),oc(t,"change",R5))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:i,trim:r,number:o}},s){if(t[ru]=km(s),t.composing)return;const a=(o||t.type==="number")&&!/^0\d/.test(t.value)?yI(t.value):t.value,l=e??"";a!==l&&(document.activeElement===t&&t.type!=="range"&&(i&&e===n||r&&t.value.trim()===l)||(t.value=l))}},Zz={deep:!0,created(t,e,n){t[ru]=km(n),oc(t,"change",()=>{const i=t._modelValue,r=eH(t),o=t.checked,s=t[ru];if(Pe(i)){const a=I9(i,r),l=a!==-1;if(o&&!l)s(i.concat(r));else if(!o&&l){const u=[...i];u.splice(a,1),s(u)}}else if(sC(i)){const a=new Set(i);o?a.add(r):a.delete(r),s(a)}else s(tH(t,o))})},mounted:O5,beforeUpdate(t,e,n){t[ru]=km(n),O5(t,e,n)}};function O5(t,{value:e,oldValue:n},i){t._modelValue=e;let r;if(Pe(e))r=I9(e,i.props.value)>-1;else if(sC(e))r=e.has(i.props.value);else{if(e===n)return;r=mf(e,tH(t,!0))}t.checked!==r&&(t.checked=r)}const Qz={created(t,{value:e},n){t.checked=mf(e,n.props.value),t[ru]=km(n),oc(t,"change",()=>{t[ru](eH(t))})},beforeUpdate(t,{value:e,oldValue:n},i){t[ru]=km(i),e!==n&&(t.checked=mf(e,i.props.value))}};function eH(t){return"_value"in t?t._value:t.value}function tH(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}const kre=["ctrl","shift","alt","meta"],Tre={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>kre.some(n=>t[`${n}Key`]&&!e.includes(n))},Ot=(t,e)=>{if(!t)return t;const n=t._withMods||(t._withMods={}),i=e.join(".");return n[i]||(n[i]=((r,...o)=>{for(let s=0;s{const n=t._withKeys||(t._withKeys={}),i=e.join(".");return n[i]||(n[i]=(r=>{if(!("key"in r))return;const o=bl(r.key);if(e.some(s=>s===o||Ere[s]===o))return t(r)}))},xre=Ri({patchProp:mre},Zie);let L5;function nH(){return L5||(L5=Lie(xre))}const Tm=((...t)=>{nH().render(...t)}),L_=((...t)=>{const e=nH().createApp(...t),{mount:n}=e;return e.mount=i=>{const r=Pre(i);if(!r)return;const o=e._component;!Xe(o)&&!o.render&&!o.template&&(o.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const s=n(r,!1,Are(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),s},e});function Are(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Pre(t){return ot(t)?document.querySelector(t):t}let iH;const CC=t=>iH=t,rH=Symbol();function Qx(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var $p;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})($p||($p={}));function Ire(){const t=zb(!0),e=t.run(()=>H({}));let n=[],i=[];const r=ca({install(o){CC(r),r._a=o,o.provide(rH,r),o.config.globalProperties.$pinia=r,i.forEach(s=>n.push(s)),i=[]},use(o){return this._a?n.push(o):i.push(o),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return r}const oH=()=>{};function D5(t,e,n,i=oH){t.add(e);const r=()=>{t.delete(e)&&i()};return!n&&cC()&&dC(r),r}function eh(t,...e){t.forEach(n=>{n(...e)})}const Rre=t=>t(),N5=Symbol(),fk=Symbol();function e2(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,i)=>t.set(i,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const i=e[n],r=t[n];Qx(r)&&Qx(i)&&t.hasOwnProperty(n)&&!rn(i)&&!na(i)?t[n]=e2(r,i):t[n]=i}return t}const Mre=Symbol();function Ore(t){return!Qx(t)||!Object.prototype.hasOwnProperty.call(t,Mre)}const{assign:Gu}=Object;function Lre(t){return!!(rn(t)&&t.effect)}function Dre(t,e,n,i){const{state:r,actions:o,getters:s}=e,a=n.state.value[t];let l;function u(){a||(n.state.value[t]=r?r():{});const c=Sr(n.state.value[t]);return Gu(c,o,Object.keys(s||{}).reduce((d,f)=>(d[f]=ca(M(()=>{CC(n);const h=n._s.get(t);return s[f].call(h,h)})),d),{}))}return l=sH(t,u,e,n,i,!0),l}function sH(t,e,n={},i,r,o){let s;const a=Gu({actions:{}},n),l={deep:!0};let u,c,d=new Set,f=new Set,h;const m=i.state.value[t];!o&&!m&&(i.state.value[t]={});let g;function v(T){let E;u=c=!1,typeof T=="function"?(T(i.state.value[t]),E={type:$p.patchFunction,storeId:t,events:h}):(e2(i.state.value[t],T),E={type:$p.patchObject,payload:T,storeId:t,events:h});const x=g=Symbol();Ye().then(()=>{g===x&&(u=!0)}),c=!0,eh(d,E,i.state.value[t])}const p=o?function(){const{state:E}=n,x=E?E():{};this.$patch(P=>{Gu(P,x)})}:oH;function b(){s.stop(),d.clear(),f.clear(),i._s.delete(t)}const y=(T,E="")=>{if(N5 in T)return T[fk]=E,T;const x=function(){CC(i);const P=Array.from(arguments),A=new Set,I=new Set;function D(R){A.add(R)}function q(R){I.add(R)}eh(f,{args:P,name:x[fk],store:C,after:D,onError:q});let z;try{z=T.apply(this&&this.$id===t?this:C,P)}catch(R){throw eh(I,R),R}return z instanceof Promise?z.then(R=>(eh(A,R),R)).catch(R=>(eh(I,R),Promise.reject(R))):(eh(A,z),z)};return x[N5]=!0,x[fk]=E,x},_={_p:i,$id:t,$onAction:D5.bind(null,f),$patch:v,$reset:p,$subscribe(T,E={}){const x=D5(d,T,E.detached,()=>P()),P=s.run(()=>Se(()=>i.state.value[t],A=>{(E.flush==="sync"?c:u)&&T({storeId:t,type:$p.direct,events:h},A)},Gu({},l,E)));return x},$dispose:b},C=on(_);i._s.set(t,C);const k=(i._a&&i._a.runWithContext||Rre)(()=>i._e.run(()=>(s=zb()).run(()=>e({action:y}))));for(const T in k){const E=k[T];if(rn(E)&&!Lre(E)||na(E))o||(m&&Ore(E)&&(rn(E)?E.value=m[T]:e2(E,m[T])),i.state.value[t][T]=E);else if(typeof E=="function"){const x=y(E,T);k[T]=x,a.actions[T]=E}}return Gu(C,k),Gu(ln(C),k),Object.defineProperty(C,"$state",{get:()=>i.state.value[t],set:T=>{v(E=>{Gu(E,T)})}}),i._p.forEach(T=>{Gu(C,s.run(()=>T({store:C,app:i._a,pinia:i,options:a})))}),m&&o&&n.hydrate&&n.hydrate(C.$state,m),u=!0,c=!0,C}function Nre(t,e,n){let i;const r=typeof e=="function";i=r?n:e;function o(s,a){const l=tz();return s=s||(l?Ne(rH,null):null),s&&CC(s),s=iH,s._s.has(t)||(r?sH(t,e,i,s):Dre(t,i,s)),s._s.get(t)}return o.$id=t,o}const Bre="modulepreload",Vre=function(t,e){return new URL(t,e).href},B5={},mn=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){let u=function(c){return Promise.all(c.map(d=>Promise.resolve(d).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const s=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");r=u(n.map(c=>{if(c=Vre(c,i),c in B5)return;B5[c]=!0;const d=c.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(i)for(let m=s.length-1;m>=0;m--){const g=s[m];if(g.href===c&&(!d||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${f}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":Bre,d||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),d)return new Promise((m,g)=>{h.addEventListener("load",m),h.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return r.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})},aH=Symbol();var lH=typeof global=="object"&&global&&global.Object===Object&&global,Fre=typeof self=="object"&&self&&self.Object===Object&&self,wa=lH||Fre||Function("return this")(),Ns=wa.Symbol,uH=Object.prototype,$re=uH.hasOwnProperty,zre=uH.toString,Ig=Ns?Ns.toStringTag:void 0;function Hre(t){var e=$re.call(t,Ig),n=t[Ig];try{t[Ig]=void 0;var i=!0}catch{}var r=zre.call(t);return i&&(e?t[Ig]=n:delete t[Ig]),r}var Ure=Object.prototype,Wre=Ure.toString;function qre(t){return Wre.call(t)}var jre="[object Null]",Kre="[object Undefined]",V5=Ns?Ns.toStringTag:void 0;function Of(t){return t==null?t===void 0?Kre:jre:V5&&V5 in Object(t)?Hre(t):qre(t)}function ll(t){return t!=null&&typeof t=="object"}var Gre="[object Symbol]";function SC(t){return typeof t=="symbol"||ll(t)&&Of(t)==Gre}function DI(t,e){for(var n=-1,i=t==null?0:t.length,r=Array(i);++n0){if(++e>=Coe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Eoe(t){return function(){return t}}var D_=(function(){try{var t=Df(Object,"defineProperty");return t({},"",{}),t}catch{}})(),xoe=D_?function(t,e){return D_(t,"toString",{configurable:!0,enumerable:!1,value:Eoe(e),writable:!0})}:NI,fH=Toe(xoe);function Aoe(t,e){for(var n=-1,i=t==null?0:t.length;++n-1}var Ooe=9007199254740991,Loe=/^(?:0|[1-9]\d*)$/;function kC(t,e){var n=typeof t;return e=e??Ooe,!!e&&(n=="number"||n!="symbol"&&Loe.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=Boe}function ag(t){return t!=null&&$I(t.length)&&!BI(t)}function Voe(t,e,n){if(!oo(n))return!1;var i=typeof e;return(i=="number"?ag(n)&&kC(e,n.length):i=="string"&&e in n)?Wb(n[e],t):!1}function Foe(t){return gH(function(e,n){var i=-1,r=n.length,o=r>1?n[r-1]:void 0,s=r>2?n[2]:void 0;for(o=t.length>3&&typeof o=="function"?(r--,o):void 0,s&&Voe(n[0],n[1],s)&&(o=r<3?void 0:o,r=1),e=Object(e);++i-1}function Yse(t,e){var n=this.__data__,i=TC(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}function Tu(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0&&n(a)?e>1?Kb(a,e-1,n,i,r):jI(r,a):i||(r[r.length]=a)}return r}function N_(t){var e=t==null?0:t.length;return e?Kb(t,1):[]}function _H(t){return fH(mH(t,void 0,N_),t+"")}var KI=wH(Object.getPrototypeOf,Object),cae="[object Object]",dae=Function.prototype,fae=Object.prototype,CH=dae.toString,hae=fae.hasOwnProperty,mae=CH.call(Object);function SH(t){if(!ll(t)||Of(t)!=cae)return!1;var e=KI(t);if(e===null)return!0;var n=hae.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&CH.call(n)==mae}function gae(t,e,n){var i=-1,r=t.length;e<0&&(e=-e>r?0:r+e),n=n>r?r:n,n<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(r);++i=e?t:e)),t}function GI(t,e,n){return n===void 0&&(n=e,e=void 0),n!==void 0&&(n=zp(n),n=n===n?n:0),e!==void 0&&(e=zp(e),e=e===e?e:0),pae(zp(t),e,n)}function vae(){this.__data__=new Tu,this.size=0}function bae(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function yae(t){return this.__data__.get(t)}function wae(t){return this.__data__.has(t)}var _ae=200;function Cae(t,e){var n=this.__data__;if(n instanceof Tu){var i=n.__data__;if(!Mv||i.length<_ae-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Eu(i)}return n.set(t,e),this.size=n.size,this}function ia(t){var e=this.__data__=new Tu(t);this.size=e.size}ia.prototype.clear=vae;ia.prototype.delete=bae;ia.prototype.get=yae;ia.prototype.has=wae;ia.prototype.set=Cae;function Sae(t,e){return t&&sg(e,qb(e),t)}function kae(t,e){return t&&sg(e,jb(e),t)}var kH=typeof exports=="object"&&exports&&!exports.nodeType&&exports,X5=kH&&typeof module=="object"&&module&&!module.nodeType&&module,Tae=X5&&X5.exports===kH,J5=Tae?wa.Buffer:void 0,Z5=J5?J5.allocUnsafe:void 0;function TH(t,e){if(e)return t.slice();var n=t.length,i=Z5?Z5(n):new t.constructor(n);return t.copy(i),i}function Eae(t,e){for(var n=-1,i=t==null?0:t.length,r=0,o=[];++na))return!1;var u=o.get(t),c=o.get(e);if(u&&c)return u==e&&c==t;var d=-1,f=!0,h=n&Jle?new Ov:void 0;for(o.set(t,e),o.set(e,t);++d=e||k<0||d&&T>=o}function p(){var S=vk();if(v(S))return b(S);a=setTimeout(p,g(S))}function b(S){return a=void 0,f&&i?h(S):(i=r=void 0,s)}function y(){a!==void 0&&clearTimeout(a),u=0,i=l=r=a=void 0}function _(){return a===void 0?s:b(vk())}function C(){var S=vk(),k=v(S);if(i=arguments,r=this,l=S,k){if(a===void 0)return m(l);if(d)return clearTimeout(a),a=setTimeout(p,e),h(l)}return a===void 0&&(a=setTimeout(p,e)),s}return C.cancel=y,C.flush=_,C}function o2(t,e,n){(n!==void 0&&!Wb(t[e],n)||n===void 0&&!(e in t))&&VI(t,e,n)}function UH(t){return ll(t)&&ag(t)}function s2(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Fue(t){return sg(t,jb(t))}function $ue(t,e,n,i,r,o,s){var a=s2(t,n),l=s2(e,n),u=s.get(l);if(u){o2(t,n,u);return}var c=o?o(a,l,n+"",t,e,s):void 0,d=c===void 0;if(d){var f=ro(l),h=!f&&Iv(l),m=!f&&!h&&UI(l);c=l,f||h||m?ro(a)?c=a:UH(a)?c=dH(a):h?(d=!1,c=TH(l,!0)):m?(d=!1,c=IH(l,!0)):c=[]:SH(l)||Pv(l)?(c=a,Pv(a)?c=Fue(a):(!oo(a)||BI(a))&&(c=RH(l))):d=!1}d&&(s.set(l,c),r(c,l,i,o,s),s.delete(l)),o2(t,n,c)}function WH(t,e,n,i,r){t!==e&&HH(e,function(o,s){if(r||(r=new ia),oo(o))$ue(t,e,s,n,WH,i,r);else{var a=i?i(s2(t,s),o,s+"",t,e,r):void 0;a===void 0&&(a=o),o2(t,s,a)}},jb)}function zue(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Hue(t,e,n){var i=t==null?0:t.length;if(!i)return-1;var r=i-1;return hH(t,zH(e),r,!0)}function Uue(t,e){var n=-1,i=ag(t)?Array(t.length):[];return Due(t,function(r,o,s){i[++n]=e(r,o,s)}),i}function Wue(t,e){var n=ro(t)?DI:Uue;return n(t,zH(e))}function qH(t,e){return Kb(Wue(t,e),1)}var que=1/0;function jue(t){var e=t==null?0:t.length;return e?Kb(t,que):[]}function Lv(t){for(var e=-1,n=t==null?0:t.length,i={};++e1),o}),sg(t,PH(t),n),i&&(n=am(n,ice|rce|oce,nce));for(var r=e.length;r--;)tce(n,e[r]);return n});function KH(t,e,n,i){if(!oo(t))return t;e=lg(e,t);for(var r=-1,o=e.length,s=o-1,a=t;a!=null&&++r=fce){var u=dce(t);if(u)return JI(u);s=!1,r=DH,l=new Ov}else l=a;e:for(;++i(e,n)=>pce(e,n,w(t)),pce=(t,e,n)=>to(n,t,t).replace(/\{(\w+)\}/g,(i,r)=>{var o;return`${(o=e?.[r])!=null?o:`{${r}}`}`}),vce=t=>({lang:M(()=>w(t).name),locale:rn(t)?t:H(t),t:gce(t)}),GH=Symbol("localeContextKey"),Qt=t=>{const e=t||Ne(GH,H());return vce(M(()=>e.value||mce))},Up="el",bce="is-",id=(t,e,n,i,r)=>{let o=`${t}-${e}`;return n&&(o+=`-${n}`),i&&(o+=`__${i}`),r&&(o+=`--${r}`),o},YH=Symbol("namespaceContextKey"),QI=t=>{const e=t||(Ct()?Ne(YH,H(Up)):H(Up));return M(()=>w(e)||Up)},De=(t,e)=>{const n=QI(e);return{namespace:n,b:(g="")=>id(n.value,t,g,"",""),e:g=>g?id(n.value,t,"",g,""):"",m:g=>g?id(n.value,t,"","",g):"",be:(g,v)=>g&&v?id(n.value,t,g,v,""):"",em:(g,v)=>g&&v?id(n.value,t,"",g,v):"",bm:(g,v)=>g&&v?id(n.value,t,g,"",v):"",bem:(g,v,p)=>g&&v&&p?id(n.value,t,g,v,p):"",is:(g,...v)=>{const p=v.length>=1?v[0]:!0;return g&&p?`${bce}${g}`:""},cssVar:g=>{const v={};for(const p in g)g[p]&&(v[`--${n.value}-${p}`]=g[p]);return v},cssVarName:g=>`--${n.value}-${g}`,cssVarBlock:g=>{const v={};for(const p in g)g[p]&&(v[`--${n.value}-${t}-${p}`]=g[p]);return v},cssVarBlockName:g=>`--${n.value}-${t}-${g}`}},pn=t=>t===void 0,vi=t=>typeof t=="boolean",St=t=>typeof t=="number",xm=t=>!t&&t!==0||Pe(t)&&t.length===0||_t(t)&&!Object.keys(t).length,Qo=t=>typeof Element>"u"?!1:t instanceof Element,Is=t=>ir(t),yce=t=>ot(t)?!Number.isNaN(Number(t)):!1,wce=t=>t===window;function XH(t,e){var n;const i=bi();return sl(()=>{i.value=t()},{...e,flush:(n=void 0)!=null?n:"sync"}),gf(i)}function cg(t){return cC()?(dC(t),!0):!1}function Rs(t){return typeof t=="function"?t():w(t)}function _ce(t){if(!rn(t))return on(t);const e=new Proxy({},{get(n,i,r){return w(Reflect.get(t.value,i,r))},set(n,i,r){return rn(t.value[i])&&!rn(r)?t.value[i].value=r:t.value[i]=r,!0},deleteProperty(n,i){return Reflect.deleteProperty(t.value,i)},has(n,i){return Reflect.has(t.value,i)},ownKeys(){return Object.keys(t.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return on(e)}function Cce(t){return _ce(M(t))}const Zt=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Sce=t=>typeof t<"u",JH=t=>t!=null,kce=Object.prototype.toString,Tce=t=>kce.call(t)==="[object Object]",Ece=(t,e,n)=>Math.min(n,Math.max(e,t)),ra=()=>{},a2=xce();function xce(){var t,e;return Zt&&((t=window?.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window?.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function ZH(t,e){function n(...i){return new Promise((r,o)=>{Promise.resolve(t(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(r).catch(o)})}return n}function Ace(t,e={}){let n,i,r=ra;const o=a=>{clearTimeout(a),r(),r=ra};return a=>{const l=Rs(t),u=Rs(e.maxWait);return n&&o(n),l<=0||u!==void 0&&u<=0?(i&&(o(i),i=null),Promise.resolve(a())):new Promise((c,d)=>{r=e.rejectOnCancel?d:c,u&&!i&&(i=setTimeout(()=>{n&&o(n),i=null,c(a())},u)),n=setTimeout(()=>{i&&o(i),i=null,c(a())},l)})}}function Pce(...t){let e=0,n,i=!0,r=ra,o,s,a,l,u;!rn(t[0])&&typeof t[0]=="object"?{delay:s,trailing:a=!0,leading:l=!0,rejectOnCancel:u=!1}=t[0]:[s,a=!0,l=!0,u=!1]=t;const c=()=>{n&&(clearTimeout(n),n=void 0,r(),r=ra)};return f=>{const h=Rs(s),m=Date.now()-e,g=()=>o=f();return c(),h<=0?(e=Date.now(),g()):(m>h&&(l||!i)?(e=Date.now(),g()):a&&(o=new Promise((v,p)=>{r=u?p:v,n=setTimeout(()=>{e=Date.now(),i=!0,v(g()),c()},Math.max(0,h-m))})),!l&&!n&&(n=setTimeout(()=>i=!0,h)),i=!1,o)}}function Ice(t){return Ct()}function eR(t,e=200,n={}){return ZH(Ace(e,n),t)}function Rce(t,e=200,n={}){const i=H(t.value),r=eR(()=>{i.value=t.value},e,n);return Se(t,()=>r()),i}function Mce(t,e=200,n=!1,i=!0,r=!1){return ZH(Pce(e,n,i,r),t)}function Oce(t,e=!0,n){Ice()?Pt(t,n):e?t():Ye(t)}function Dv(t,e,n={}){const{immediate:i=!0}=n,r=H(!1);let o=null;function s(){o&&(clearTimeout(o),o=null)}function a(){r.value=!1,s()}function l(...u){s(),r.value=!0,o=setTimeout(()=>{r.value=!1,o=null,t(...u)},Rs(e))}return i&&(r.value=!0,Zt&&l()),cg(a),{isPending:gf(r),start:l,stop:a}}function Yi(t){var e;const n=Rs(t);return(e=n?.$el)!=null?e:n}const $c=Zt?window:void 0,Lce=Zt?window.document:void 0;function Kn(...t){let e,n,i,r;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,i,r]=t,e=$c):[e,n,i,r]=t,!e)return ra;Array.isArray(n)||(n=[n]),Array.isArray(i)||(i=[i]);const o=[],s=()=>{o.forEach(c=>c()),o.length=0},a=(c,d,f,h)=>(c.addEventListener(d,f,h),()=>c.removeEventListener(d,f,h)),l=Se(()=>[Yi(e),Rs(r)],([c,d])=>{if(s(),!c)return;const f=Tce(d)?{...d}:d;o.push(...n.flatMap(h=>i.map(m=>a(c,h,m,f))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return cg(u),u}let hD=!1;function QH(t,e,n={}){const{window:i=$c,ignore:r=[],capture:o=!0,detectIframe:s=!1}=n;if(!i)return ra;a2&&!hD&&(hD=!0,Array.from(i.document.body.children).forEach(f=>f.addEventListener("click",ra)),i.document.documentElement.addEventListener("click",ra));let a=!0;const l=f=>r.some(h=>{if(typeof h=="string")return Array.from(i.document.querySelectorAll(h)).some(m=>m===f.target||f.composedPath().includes(m));{const m=Yi(h);return m&&(f.target===m||f.composedPath().includes(m))}}),c=[Kn(i,"click",f=>{const h=Yi(t);if(!(!h||h===f.target||f.composedPath().includes(h))){if(f.detail===0&&(a=!l(f)),!a){a=!0;return}e(f)}},{passive:!0,capture:o}),Kn(i,"pointerdown",f=>{const h=Yi(t);a=!l(f)&&!!(h&&!f.composedPath().includes(h))},{passive:!0}),s&&Kn(i,"blur",f=>{setTimeout(()=>{var h;const m=Yi(t);((h=i.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!m?.contains(i.document.activeElement)&&e(f)},0)})].filter(Boolean);return()=>c.forEach(f=>f())}function Dce(){const t=H(!1),e=Ct();return e&&Pt(()=>{t.value=!0},e),t}function tR(t){const e=Dce();return M(()=>(e.value,!!t()))}function eU(t,e,n={}){const{window:i=$c,...r}=n;let o;const s=tR(()=>i&&"MutationObserver"in i),a=()=>{o&&(o.disconnect(),o=void 0)},l=M(()=>{const f=Rs(t),h=(Array.isArray(f)?f:[f]).map(Yi).filter(JH);return new Set(h)}),u=Se(()=>l.value,f=>{a(),s.value&&f.size&&(o=new MutationObserver(e),f.forEach(h=>o.observe(h,r)))},{immediate:!0,flush:"post"}),c=()=>o?.takeRecords(),d=()=>{a(),u()};return cg(d),{isSupported:s,stop:d,takeRecords:c}}function Nce(t){return JSON.parse(JSON.stringify(t))}function Bce(t,e,n={}){const{window:i=$c,initialValue:r="",observe:o=!1}=n,s=H(r),a=M(()=>{var u;return Yi(e)||((u=i?.document)==null?void 0:u.documentElement)});function l(){var u;const c=Rs(t),d=Rs(a);if(d&&i){const f=(u=i.getComputedStyle(d).getPropertyValue(c))==null?void 0:u.trim();s.value=f||r}}return o&&eU(a,l,{attributeFilter:["style","class"],window:i}),Se([a,()=>Rs(t)],l,{immediate:!0}),Se(s,u=>{var c;(c=a.value)!=null&&c.style&&a.value.style.setProperty(Rs(t),u)}),s}function Vce(t={}){const{document:e=Lce}=t;if(!e)return H("visible");const n=H(e.visibilityState);return Kn(e,"visibilitychange",()=>{n.value=e.visibilityState}),n}function nr(t,e,n={}){const{window:i=$c,...r}=n;let o;const s=tR(()=>i&&"ResizeObserver"in i),a=()=>{o&&(o.disconnect(),o=void 0)},l=M(()=>Array.isArray(t)?t.map(d=>Yi(d)):[Yi(t)]),u=Se(l,d=>{if(a(),s.value&&i){o=new ResizeObserver(e);for(const f of d)f&&o.observe(f,r)}},{immediate:!0,flush:"post"}),c=()=>{a(),u()};return cg(c),{isSupported:s,stop:c}}function mD(t,e={width:0,height:0},n={}){const{window:i=$c,box:r="content-box"}=n,o=M(()=>{var d,f;return(f=(d=Yi(t))==null?void 0:d.namespaceURI)==null?void 0:f.includes("svg")}),s=H(e.width),a=H(e.height),{stop:l}=nr(t,([d])=>{const f=r==="border-box"?d.borderBoxSize:r==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(i&&o.value){const h=Yi(t);if(h){const m=h.getBoundingClientRect();s.value=m.width,a.value=m.height}}else if(f){const h=Array.isArray(f)?f:[f];s.value=h.reduce((m,{inlineSize:g})=>m+g,0),a.value=h.reduce((m,{blockSize:g})=>m+g,0)}else s.value=d.contentRect.width,a.value=d.contentRect.height},n);Oce(()=>{const d=Yi(t);d&&(s.value="offsetWidth"in d?d.offsetWidth:e.width,a.value="offsetHeight"in d?d.offsetHeight:e.height)});const u=Se(()=>Yi(t),d=>{s.value=d?e.width:0,a.value=d?e.height:0});function c(){l(),u()}return{width:s,height:a,stop:c}}function Fce(t,e,n={}){const{root:i,rootMargin:r="0px",threshold:o=.1,window:s=$c,immediate:a=!0}=n,l=tR(()=>s&&"IntersectionObserver"in s),u=M(()=>{const m=Rs(t);return(Array.isArray(m)?m:[m]).map(Yi).filter(JH)});let c=ra;const d=H(a),f=l.value?Se(()=>[u.value,Yi(i),d.value],([m,g])=>{if(c(),!d.value||!m.length)return;const v=new IntersectionObserver(e,{root:Yi(g),rootMargin:r,threshold:o});m.forEach(p=>p&&v.observe(p)),c=()=>{v.disconnect(),c=ra}},{immediate:a,flush:"post"}):ra,h=()=>{c(),f(),d.value=!1};return cg(h),{isSupported:l,isActive:d,pause(){c(),d.value=!1},resume(){d.value=!0},stop:h}}function $ce(t,e,n,i={}){var r,o,s;const{clone:a=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:d,shouldEmit:f}=i,h=Ct(),m=h?.emit||((r=h?.$emit)==null?void 0:r.bind(h))||((s=(o=h?.proxy)==null?void 0:o.$emit)==null?void 0:s.bind(h?.proxy));let g=u;g=g||`update:${e.toString()}`;const v=y=>a?typeof a=="function"?a(y):Nce(y):y,p=()=>Sce(t[e])?v(t[e]):d,b=y=>{f?f(y)&&m(g,y):m(g,y)};if(l){const y=p(),_=H(y);let C=!1;return Se(()=>t[e],S=>{C||(C=!0,_.value=v(S),Ye(()=>C=!1))}),Se(_,S=>{!C&&(S!==t[e]||c)&&b(S)},{deep:c}),_}else return M({get(){return p()},set(y){b(y)}})}function zce(t={}){const{window:e=$c}=t;if(!e)return H(!1);const n=H(e.document.hasFocus());return Kn(e,"blur",()=>{n.value=!1}),Kn(e,"focus",()=>{n.value=!0}),n}class Hce extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function dr(t,e){throw new Hce(`[${t}] ${e}`)}const gD={current:0},pD=H(0),tU=2e3,vD=Symbol("elZIndexContextKey"),nU=Symbol("zIndexContextKey"),RC=t=>{const e=Ct()?Ne(vD,gD):gD,n=t||(Ct()?Ne(nU,void 0):void 0),i=M(()=>{const s=w(n);return St(s)?s:tU}),r=M(()=>i.value+pD.value),o=()=>(e.current++,pD.value=e.current,r.value);return!Zt&&Ne(vD),{initialZIndex:i,currentZIndex:r,nextZIndex:o}},iU="__epPropKey",me=t=>t,Uce=t=>_t(t)&&!!t[iU],MC=(t,e)=>{if(!_t(t)||Uce(t))return t;const{values:n,required:i,default:r,type:o,validator:s}=t,l={type:o,required:!!i,validator:n||s?u=>{let c=!1,d=[];if(n&&(d=Array.from(n),Jt(t,"default")&&d.push(r),c||(c=d.includes(u))),s&&(c||(c=s(u))),!c&&d.length>0){const f=[...new Set(d)].map(h=>JSON.stringify(h)).join(", ");Yie(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${f}], got value ${JSON.stringify(u)}.`)}return c}:void 0,[iU]:!0};return Jt(t,"default")&&(l.default=r),l},qe=t=>Lv(Object.entries(t).map(([e,n])=>[e,MC(n,e)])),yl=["","default","small","large"],$r=MC({type:String,values:yl,required:!1}),rU=Symbol("size"),oU=()=>{const t=Ne(rU,{});return M(()=>w(t.size)||"")},sU=Symbol("emptyValuesContextKey"),Wce=["",void 0,null],qce=void 0,Gb=qe({emptyValues:Array,valueOnClear:{type:me([String,Number,Boolean,Function]),default:void 0,validator:t=>(t=Xe(t)?t():t,Pe(t)?t.every(e=>!e):!t)}}),OC=(t,e)=>{const n=Ct()?Ne(sU,H({})):H({}),i=M(()=>t.emptyValues||n.value.emptyValues||Wce),r=M(()=>Xe(t.valueOnClear)?t.valueOnClear():t.valueOnClear!==void 0?t.valueOnClear:Xe(n.value.valueOnClear)?n.value.valueOnClear():n.value.valueOnClear!==void 0?n.value.valueOnClear:e!==void 0?e:qce),o=s=>{let a=!0;return Pe(s)?a=i.value.some(l=>$i(s,l)):a=i.value.includes(s),a};return o(r.value),{emptyValues:i,valueOnClear:r,isEmptyValue:o}},l2=t=>Object.keys(t),jce=t=>Object.entries(t),lm=(t,e,n)=>({get value(){return to(t,e,n)},set value(i){lce(t,e,i)}}),F_=H();function Yb(t,e=void 0){const n=Ct()?Ne(aH,F_):F_;return t?M(()=>{var i,r;return(r=(i=n.value)==null?void 0:i[t])!=null?r:e}):n}function nR(t,e){const n=Yb(),i=De(t,M(()=>{var a;return((a=n.value)==null?void 0:a.namespace)||Up})),r=Qt(M(()=>{var a;return(a=n.value)==null?void 0:a.locale})),o=RC(M(()=>{var a;return((a=n.value)==null?void 0:a.zIndex)||tU})),s=M(()=>{var a;return w(e)||((a=n.value)==null?void 0:a.size)||""});return aU(M(()=>w(n)||{})),{ns:i,locale:r,zIndex:o,size:s}}const aU=(t,e,n=!1)=>{var i;const r=!!Ct(),o=r?Yb():void 0,s=(i=void 0)!=null?i:r?qt:void 0;if(!s)return;const a=M(()=>{const l=w(t);return o?.value?Kce(o.value,l):l});return s(aH,a),s(GH,M(()=>a.value.locale)),s(YH,M(()=>a.value.namespace)),s(nU,M(()=>a.value.zIndex)),s(rU,{size:M(()=>a.value.size||"")}),s(sU,M(()=>({emptyValues:a.value.emptyValues,valueOnClear:a.value.valueOnClear}))),(n||!F_.value)&&(F_.value=a.value),a},Kce=(t,e)=>{const n=[...new Set([...l2(t),...l2(e)])],i={};for(const r of n)i[r]=e[r]!==void 0?e[r]:t[r];return i},iR=qe({to:{type:me([String,Object]),required:!0},disabled:Boolean}),It="update:modelValue",En="change",rs="input";var Gce=le({__name:"teleport",props:iR,setup(t){return(e,n)=>e.disabled?we(e.$slots,"default",{key:0}):(B(),_e(sz,{key:1,to:e.to},[we(e.$slots,"default")],8,["to"]))}});const sn=(t,e)=>{if(t.install=n=>{for(const i of[t,...Object.values(e??{})])n.component(i.name,i)},e)for(const[n,i]of Object.entries(e))t[n]=i;return t},Yce=(t,e)=>(t.install=n=>{t._context=n._context,n.config.globalProperties[e]=t},t),Xce=(t,e)=>(t.install=n=>{n.directive(e,t)},t),Zi=t=>(t.install=tn,t),rR=sn(Gce),oR=t=>Zt?window.requestAnimationFrame(t):setTimeout(t,16),Jce=t=>Zt?window.cancelAnimationFrame(t):clearTimeout(t),lU=(t="")=>t.split(" ").filter(e=>!!e.trim()),Xa=(t,e)=>{if(!t||!e)return!1;if(e.includes(" "))throw new Error("className should not contain space.");return t.classList.contains(e)},Qs=(t,e)=>{!t||!e.trim()||t.classList.add(...lU(e))},os=(t,e)=>{!t||!e.trim()||t.classList.remove(...lU(e))},sc=(t,e)=>{var n;if(!Zt||!t||!e)return"";let i=Oo(e);i==="float"&&(i="cssFloat");try{const r=t.style[i];if(r)return r;const o=(n=document.defaultView)==null?void 0:n.getComputedStyle(t,"");return o?o[i]:""}catch{return t.style[i]}};function zr(t,e="px"){if(!t&&t!==0)return"";if(St(t)||yce(t))return`${t}${e}`;if(ot(t))return t}const Zce=(t,e)=>{if(!Zt)return!1;const n={undefined:"overflow",true:"overflow-y",false:"overflow-x"}[String(e)],i=sc(t,n);return["scroll","auto","overlay"].some(r=>i.includes(r))},Qce=(t,e)=>{if(!Zt)return;let n=t;for(;n;){if([window,document,document.documentElement].includes(n))return window;if(Zce(n,e))return n;n=n.parentNode}return n};let L0;const ede=t=>{var e;if(!Zt)return 0;if(L0!==void 0)return L0;const n=document.createElement("div");n.className=`${t}-scrollbar__wrap`,n.style.visibility="hidden",n.style.width="100px",n.style.position="absolute",n.style.top="-9999px",document.body.appendChild(n);const i=n.offsetWidth;n.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",n.appendChild(r);const o=r.offsetWidth;return(e=n.parentNode)==null||e.removeChild(n),L0=i-o,L0};function uU(t,e){if(!Zt)return;if(!e){t.scrollTop=0;return}const n=[];let i=e.offsetParent;for(;i!==null&&t!==i&&t.contains(i);)n.push(i),i=i.offsetParent;const r=e.offsetTop+n.reduce((l,u)=>l+u.offsetTop,0),o=r+e.offsetHeight,s=t.scrollTop,a=s+t.clientHeight;ra&&(t.scrollTop=o-t.clientHeight)}var tde=le({name:"ArrowDown",__name:"arrow-down",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"})]))}}),zc=tde,nde=le({name:"ArrowLeft",__name:"arrow-left",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0"})]))}}),Am=nde,ide=le({name:"ArrowRight",__name:"arrow-right",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}}),oa=ide,rde=le({name:"ArrowUp",__name:"arrow-up",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),sR=rde,ode=le({name:"Calendar",__name:"calendar",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M128 384v512h768V192H768v32a32 32 0 1 1-64 0v-32H320v32a32 32 0 0 1-64 0v-32H128v128h768v64zm192-256h384V96a32 32 0 1 1 64 0v32h160a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h160V96a32 32 0 0 1 64 0zm-32 384h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64"})]))}}),cU=ode,sde=le({name:"Cellphone",__name:"cellphone",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M256 128a64 64 0 0 0-64 64v640a64 64 0 0 0 64 64h512a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h512a128 128 0 0 1 128 128v640a128 128 0 0 1-128 128H256a128 128 0 0 1-128-128V192A128 128 0 0 1 256 64m128 128h256a32 32 0 1 1 0 64H384a32 32 0 0 1 0-64m128 640a64 64 0 1 1 0-128 64 64 0 0 1 0 128"})]))}}),ade=sde,lde=le({name:"Check",__name:"check",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"})]))}}),LC=lde,ude=le({name:"CircleCheck",__name:"circle-check",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),ie("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752z"})]))}}),DC=ude,cde=le({name:"CircleCloseFilled",__name:"circle-close-filled",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),dU=cde,dde=le({name:"CircleClose",__name:"circle-close",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),ie("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),Nf=dde,fde=le({name:"Clock",__name:"clock",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),ie("path",{fill:"currentColor",d:"M480 256a32 32 0 0 1 32 32v256a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"}),ie("path",{fill:"currentColor",d:"M480 512h256q32 0 32 32t-32 32H480q-32 0-32-32t32-32"})]))}}),hde=fde,mde=le({name:"Close",__name:"close",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),cl=mde,gde=le({name:"DArrowLeft",__name:"d-arrow-left",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M529.408 149.376a29.12 29.12 0 0 1 41.728 0 30.59 30.59 0 0 1 0 42.688L259.264 511.936l311.872 319.936a30.59 30.59 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L197.76 534.272a32 32 0 0 1 0-44.672zm256 0a29.12 29.12 0 0 1 41.728 0 30.59 30.59 0 0 1 0 42.688L515.264 511.936l311.872 319.936a30.59 30.59 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L453.76 534.272a32 32 0 0 1 0-44.672z"})]))}}),Tc=gde,pde=le({name:"DArrowRight",__name:"d-arrow-right",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M452.864 149.312a29.12 29.12 0 0 1 41.728.064L826.24 489.664a32 32 0 0 1 0 44.672L494.592 874.624a29.12 29.12 0 0 1-41.728 0 30.59 30.59 0 0 1 0-42.752L764.736 512 452.864 192a30.59 30.59 0 0 1 0-42.688m-256 0a29.12 29.12 0 0 1 41.728.064L570.24 489.664a32 32 0 0 1 0 44.672L238.592 874.624a29.12 29.12 0 0 1-41.728 0 30.59 30.59 0 0 1 0-42.752L508.736 512 196.864 192a30.59 30.59 0 0 1 0-42.688"})]))}}),Ec=pde,vde=le({name:"Delete",__name:"delete",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),bde=vde,yde=le({name:"Document",__name:"document",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}}),wde=yde,_de=le({name:"FullScreen",__name:"full-screen",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"})]))}}),Cde=_de,Sde=le({name:"Hide",__name:"hide",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176"}),ie("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48"})]))}}),kde=Sde,Tde=le({name:"InfoFilled",__name:"info-filled",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.99 12.99 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}}),u2=Tde,Ede=le({name:"Loading",__name:"loading",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"})]))}}),xc=Ede,xde=le({name:"Lock",__name:"lock",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),ie("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"})]))}}),Ade=xde,Pde=le({name:"Minus",__name:"minus",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"})]))}}),Ide=Pde,Rde=le({name:"Monitor",__name:"monitor",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M544 768v128h192a32 32 0 1 1 0 64H288a32 32 0 1 1 0-64h192V768H192A128 128 0 0 1 64 640V256a128 128 0 0 1 128-128h640a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128zM192 192a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h640a64 64 0 0 0 64-64V256a64 64 0 0 0-64-64z"})]))}}),Mde=Rde,Ode=le({name:"MoreFilled",__name:"more-filled",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M176 416a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224"})]))}}),bD=Ode,Lde=le({name:"More",__name:"more",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M176 416a112 112 0 1 0 0 224 112 112 0 0 0 0-224m0 64a48 48 0 1 1 0 96 48 48 0 0 1 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96"})]))}}),Dde=Lde,Nde=le({name:"Plus",__name:"plus",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),fU=Nde,Bde=le({name:"RefreshLeft",__name:"refresh-left",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"})]))}}),Vde=Bde,Fde=le({name:"RefreshRight",__name:"refresh-right",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88"})]))}}),$de=Fde,zde=le({name:"Refresh",__name:"refresh",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"})]))}}),Hde=zde,Ude=le({name:"ScaleToOriginal",__name:"scale-to-original",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M813.176 180.706a60.235 60.235 0 0 1 60.236 60.235v481.883a60.235 60.235 0 0 1-60.236 60.235H210.824a60.235 60.235 0 0 1-60.236-60.235V240.94a60.235 60.235 0 0 1 60.236-60.235h602.352zm0-60.235H210.824A120.47 120.47 0 0 0 90.353 240.94v481.883a120.47 120.47 0 0 0 120.47 120.47h602.353a120.47 120.47 0 0 0 120.471-120.47V240.94a120.47 120.47 0 0 0-120.47-120.47zm-120.47 180.705a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 0 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118m-361.412 0a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 1 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118M512 361.412a30.12 30.12 0 0 0-30.118 30.117v30.118a30.118 30.118 0 0 0 60.236 0V391.53A30.12 30.12 0 0 0 512 361.412M512 512a30.12 30.12 0 0 0-30.118 30.118v30.117a30.118 30.118 0 0 0 60.236 0v-30.117A30.12 30.12 0 0 0 512 512"})]))}}),Wde=Ude,qde=le({name:"Setting",__name:"setting",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357 357 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a352 352 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357 357 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296l112.32 24.256c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088-24.512 11.968a294 294 0 0 0-34.816 20.096l-22.656 15.36-116.224-25.088-65.28 113.152 79.68 88.192-1.92 27.136a293 293 0 0 0 0 40.192l1.92 27.136-79.808 88.192 65.344 113.152 116.224-25.024 22.656 15.296a294 294 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152 24.448-11.904a288 288 0 0 0 34.752-20.096l22.592-15.296 116.288 25.024 65.28-113.152-79.744-88.192 1.92-27.136a293 293 0 0 0 0-40.256l-1.92-27.136 79.808-88.128-65.344-113.152-116.288 24.96-22.592-15.232a288 288 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384 192 192 0 0 1 0-384m0 64a128 128 0 1 0 0 256 128 128 0 0 0 0-256"})]))}}),jde=qde,Kde=le({name:"SuccessFilled",__name:"success-filled",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),aR=Kde,Gde=le({name:"Switch",__name:"switch",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M118.656 438.656a32 32 0 0 1 0-45.248L416 96l4.48-3.776A32 32 0 0 1 461.248 96l3.712 4.48a32.064 32.064 0 0 1-3.712 40.832L218.56 384H928a32 32 0 1 1 0 64H141.248a32 32 0 0 1-22.592-9.344M64 608a32 32 0 0 1 32-32h786.752a32 32 0 0 1 22.656 54.592L608 928l-4.48 3.776a32.064 32.064 0 0 1-40.832-49.024L805.632 640H96a32 32 0 0 1-32-32"})]))}}),Yde=Gde,Xde=le({name:"UserFilled",__name:"user-filled",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M288 320a224 224 0 1 0 448 0 224 224 0 1 0-448 0m544 608H160a32 32 0 0 1-32-32v-96a160 160 0 0 1 160-160h448a160 160 0 0 1 160 160v96a32 32 0 0 1-32 32z"})]))}}),Jde=Xde,Zde=le({name:"User",__name:"user",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M512 512a192 192 0 1 0 0-384 192 192 0 0 0 0 384m0 64a256 256 0 1 1 0-512 256 256 0 0 1 0 512m320 320v-96a96 96 0 0 0-96-96H288a96 96 0 0 0-96 96v96a32 32 0 1 1-64 0v-96a160 160 0 0 1 160-160h448a160 160 0 0 1 160 160v96a32 32 0 1 1-64 0"})]))}}),hU=Zde,Qde=le({name:"VideoCamera",__name:"video-camera",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M704 768V256H128v512zm64-416 192-96v512l-192-96v128a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32zm0 71.552v176.896l128 64V359.552zM192 320h192v64H192z"})]))}}),efe=Qde,tfe=le({name:"View",__name:"view",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),nfe=tfe,ife=le({name:"WarningFilled",__name:"warning-filled",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.43 58.43 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.43 58.43 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),lR=ife,rfe=le({name:"ZoomIn",__name:"zoom-in",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"})]))}}),mU=rfe,ofe=le({name:"ZoomOut",__name:"zoom-out",setup(t){return(e,n)=>(B(),Q("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[ie("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"})]))}}),sfe=ofe;const ri=me([String,Object,Function]),afe={Close:cl},lfe={Close:cl,SuccessFilled:aR,InfoFilled:u2,WarningFilled:lR,CircleCloseFilled:dU},$_={primary:u2,success:aR,warning:lR,error:dU,info:u2},gU={validating:xc,success:DC,error:Nf},ufe=qe({size:{type:me([Number,String])},color:{type:String}});var cfe=le({name:"ElIcon",inheritAttrs:!1,__name:"icon",props:ufe,setup(t){const e=t,n=De("icon"),i=M(()=>{const{size:r,color:o}=e,s=zr(r);return!s&&!o?{}:{fontSize:s,"--color":o}});return(r,o)=>(B(),Q("i",Lt({class:w(n).b(),style:i.value},r.$attrs),[we(r.$slots,"default")],16))}});const He=sn(cfe);var Cw=(t=>(t[t.TEXT=1]="TEXT",t[t.CLASS=2]="CLASS",t[t.STYLE=4]="STYLE",t[t.PROPS=8]="PROPS",t[t.FULL_PROPS=16]="FULL_PROPS",t[t.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",t[t.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",t[t.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",t[t.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",t[t.NEED_PATCH=512]="NEED_PATCH",t[t.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",t[t.HOISTED=-1]="HOISTED",t[t.BAIL=-2]="BAIL",t))(Cw||{});const cc=t=>{const e=Pe(t)?t:[t],n=[];return e.forEach(i=>{var r;Pe(i)?n.push(...cc(i)):yi(i)&&((r=i.component)!=null&&r.subTree)?n.push(i,...cc(i.component.subTree)):yi(i)&&Pe(i.children)?n.push(...cc(i.children)):yi(i)&&i.shapeFlag===2?n.push(...cc(i.type())):n.push(i)}),n};var To="top",Bs="bottom",Vs="right",Eo="left",uR="auto",Xb=[To,Bs,Vs,Eo],Pm="start",Nv="end",dfe="clippingParents",pU="viewport",Rg="popper",ffe="reference",yD=Xb.reduce(function(t,e){return t.concat([e+"-"+Pm,e+"-"+Nv])},[]),xu=[].concat(Xb,[uR]).reduce(function(t,e){return t.concat([e,e+"-"+Pm,e+"-"+Nv])},[]),hfe="beforeRead",mfe="read",gfe="afterRead",pfe="beforeMain",vfe="main",bfe="afterMain",yfe="beforeWrite",wfe="write",_fe="afterWrite",Cfe=[hfe,mfe,gfe,pfe,vfe,bfe,yfe,wfe,_fe];function dl(t){return t?(t.nodeName||"").toLowerCase():null}function ss(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function bf(t){var e=ss(t).Element;return t instanceof e||t instanceof Element}function Os(t){var e=ss(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function cR(t){if(typeof ShadowRoot>"u")return!1;var e=ss(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Sfe(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var i=e.styles[n]||{},r=e.attributes[n]||{},o=e.elements[n];!Os(o)||!dl(o)||(Object.assign(o.style,i),Object.keys(r).forEach(function(s){var a=r[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function kfe(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],o=e.attributes[i]||{},s=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:n[i]),a=s.reduce(function(l,u){return l[u]="",l},{});!Os(r)||!dl(r)||(Object.assign(r.style,a),Object.keys(o).forEach(function(l){r.removeAttribute(l)}))})}}var vU={name:"applyStyles",enabled:!0,phase:"write",fn:Sfe,effect:kfe,requires:["computeStyles"]};function Ja(t){return t.split("-")[0]}var rf=Math.max,z_=Math.min,Im=Math.round;function c2(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function bU(){return!/^((?!chrome|android).)*safari/i.test(c2())}function Rm(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var i=t.getBoundingClientRect(),r=1,o=1;e&&Os(t)&&(r=t.offsetWidth>0&&Im(i.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Im(i.height)/t.offsetHeight||1);var s=bf(t)?ss(t):window,a=s.visualViewport,l=!bU()&&n,u=(i.left+(l&&a?a.offsetLeft:0))/r,c=(i.top+(l&&a?a.offsetTop:0))/o,d=i.width/r,f=i.height/o;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function dR(t){var e=Rm(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function yU(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&cR(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function mu(t){return ss(t).getComputedStyle(t)}function Tfe(t){return["table","td","th"].indexOf(dl(t))>=0}function Hc(t){return((bf(t)?t.ownerDocument:t.document)||window.document).documentElement}function NC(t){return dl(t)==="html"?t:t.assignedSlot||t.parentNode||(cR(t)?t.host:null)||Hc(t)}function wD(t){return!Os(t)||mu(t).position==="fixed"?null:t.offsetParent}function Efe(t){var e=/firefox/i.test(c2()),n=/Trident/i.test(c2());if(n&&Os(t)){var i=mu(t);if(i.position==="fixed")return null}var r=NC(t);for(cR(r)&&(r=r.host);Os(r)&&["html","body"].indexOf(dl(r))<0;){var o=mu(r);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return r;r=r.parentNode}return null}function Jb(t){for(var e=ss(t),n=wD(t);n&&Tfe(n)&&mu(n).position==="static";)n=wD(n);return n&&(dl(n)==="html"||dl(n)==="body"&&mu(n).position==="static")?e:n||Efe(t)||e}function fR(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Wp(t,e,n){return rf(t,z_(e,n))}function xfe(t,e,n){var i=Wp(t,e,n);return i>n?n:i}function wU(){return{top:0,right:0,bottom:0,left:0}}function _U(t){return Object.assign({},wU(),t)}function CU(t,e){return e.reduce(function(n,i){return n[i]=t,n},{})}var Afe=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,_U(typeof t!="number"?t:CU(t,Xb))};function Pfe(t){var e,n=t.state,i=t.name,r=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ja(n.placement),l=fR(a),u=[Eo,Vs].indexOf(a)>=0,c=u?"height":"width";if(!(!o||!s)){var d=Afe(r.padding,n),f=dR(o),h=l==="y"?To:Eo,m=l==="y"?Bs:Vs,g=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],v=s[l]-n.rects.reference[l],p=Jb(o),b=p?l==="y"?p.clientHeight||0:p.clientWidth||0:0,y=g/2-v/2,_=d[h],C=b-f[c]-d[m],S=b/2-f[c]/2+y,k=Wp(_,S,C),T=l;n.modifiersData[i]=(e={},e[T]=k,e.centerOffset=k-S,e)}}function Ife(t){var e=t.state,n=t.options,i=n.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||yU(e.elements.popper,r)&&(e.elements.arrow=r))}var Rfe={name:"arrow",enabled:!0,phase:"main",fn:Pfe,effect:Ife,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Mm(t){return t.split("-")[1]}var Mfe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ofe(t,e){var n=t.x,i=t.y,r=e.devicePixelRatio||1;return{x:Im(n*r)/r||0,y:Im(i*r)/r||0}}function _D(t){var e,n=t.popper,i=t.popperRect,r=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,u=t.adaptive,c=t.roundOffsets,d=t.isFixed,f=s.x,h=f===void 0?0:f,m=s.y,g=m===void 0?0:m,v=typeof c=="function"?c({x:h,y:g}):{x:h,y:g};h=v.x,g=v.y;var p=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),y=Eo,_=To,C=window;if(u){var S=Jb(n),k="clientHeight",T="clientWidth";if(S===ss(n)&&(S=Hc(n),mu(S).position!=="static"&&a==="absolute"&&(k="scrollHeight",T="scrollWidth")),S=S,r===To||(r===Eo||r===Vs)&&o===Nv){_=Bs;var E=d&&S===C&&C.visualViewport?C.visualViewport.height:S[k];g-=E-i.height,g*=l?1:-1}if(r===Eo||(r===To||r===Bs)&&o===Nv){y=Vs;var x=d&&S===C&&C.visualViewport?C.visualViewport.width:S[T];h-=x-i.width,h*=l?1:-1}}var P=Object.assign({position:a},u&&Mfe),A=c===!0?Ofe({x:h,y:g},ss(n)):{x:h,y:g};if(h=A.x,g=A.y,l){var I;return Object.assign({},P,(I={},I[_]=b?"0":"",I[y]=p?"0":"",I.transform=(C.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",I))}return Object.assign({},P,(e={},e[_]=b?g+"px":"",e[y]=p?h+"px":"",e.transform="",e))}function Lfe(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=i===void 0?!0:i,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,u={placement:Ja(e.placement),variation:Mm(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,_D(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,_D(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var SU={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Lfe,data:{}},D0={passive:!0};function Dfe(t){var e=t.state,n=t.instance,i=t.options,r=i.scroll,o=r===void 0?!0:r,s=i.resize,a=s===void 0?!0:s,l=ss(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,D0)}),a&&l.addEventListener("resize",n.update,D0),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,D0)}),a&&l.removeEventListener("resize",n.update,D0)}}var kU={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Dfe,data:{}},Nfe={left:"right",right:"left",bottom:"top",top:"bottom"};function Sw(t){return t.replace(/left|right|bottom|top/g,function(e){return Nfe[e]})}var Bfe={start:"end",end:"start"};function CD(t){return t.replace(/start|end/g,function(e){return Bfe[e]})}function hR(t){var e=ss(t),n=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:n,scrollTop:i}}function mR(t){return Rm(Hc(t)).left+hR(t).scrollLeft}function Vfe(t,e){var n=ss(t),i=Hc(t),r=n.visualViewport,o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var u=bU();(u||!u&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+mR(t),y:l}}function Ffe(t){var e,n=Hc(t),i=hR(t),r=(e=t.ownerDocument)==null?void 0:e.body,o=rf(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=rf(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+mR(t),l=-i.scrollTop;return mu(r||n).direction==="rtl"&&(a+=rf(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function gR(t){var e=mu(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function TU(t){return["html","body","#document"].indexOf(dl(t))>=0?t.ownerDocument.body:Os(t)&&gR(t)?t:TU(NC(t))}function qp(t,e){var n;e===void 0&&(e=[]);var i=TU(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),o=ss(i),s=r?[o].concat(o.visualViewport||[],gR(i)?i:[]):i,a=e.concat(s);return r?a:a.concat(qp(NC(s)))}function d2(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function $fe(t,e){var n=Rm(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function SD(t,e,n){return e===pU?d2(Vfe(t,n)):bf(e)?$fe(e,n):d2(Ffe(Hc(t)))}function zfe(t){var e=qp(NC(t)),n=["absolute","fixed"].indexOf(mu(t).position)>=0,i=n&&Os(t)?Jb(t):t;return bf(i)?e.filter(function(r){return bf(r)&&yU(r,i)&&dl(r)!=="body"}):[]}function Hfe(t,e,n,i){var r=e==="clippingParents"?zfe(t):[].concat(e),o=[].concat(r,[n]),s=o[0],a=o.reduce(function(l,u){var c=SD(t,u,i);return l.top=rf(c.top,l.top),l.right=z_(c.right,l.right),l.bottom=z_(c.bottom,l.bottom),l.left=rf(c.left,l.left),l},SD(t,s,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function EU(t){var e=t.reference,n=t.element,i=t.placement,r=i?Ja(i):null,o=i?Mm(i):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(r){case To:l={x:s,y:e.y-n.height};break;case Bs:l={x:s,y:e.y+e.height};break;case Vs:l={x:e.x+e.width,y:a};break;case Eo:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var u=r?fR(r):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case Pm:l[u]=l[u]-(e[c]/2-n[c]/2);break;case Nv:l[u]=l[u]+(e[c]/2-n[c]/2);break}}return l}function Bv(t,e){e===void 0&&(e={});var n=e,i=n.placement,r=i===void 0?t.placement:i,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?dfe:a,u=n.rootBoundary,c=u===void 0?pU:u,d=n.elementContext,f=d===void 0?Rg:d,h=n.altBoundary,m=h===void 0?!1:h,g=n.padding,v=g===void 0?0:g,p=_U(typeof v!="number"?v:CU(v,Xb)),b=f===Rg?ffe:Rg,y=t.rects.popper,_=t.elements[m?b:f],C=Hfe(bf(_)?_:_.contextElement||Hc(t.elements.popper),l,c,s),S=Rm(t.elements.reference),k=EU({reference:S,element:y,placement:r}),T=d2(Object.assign({},y,k)),E=f===Rg?T:S,x={top:C.top-E.top+p.top,bottom:E.bottom-C.bottom+p.bottom,left:C.left-E.left+p.left,right:E.right-C.right+p.right},P=t.modifiersData.offset;if(f===Rg&&P){var A=P[r];Object.keys(x).forEach(function(I){var D=[Vs,Bs].indexOf(I)>=0?1:-1,q=[To,Bs].indexOf(I)>=0?"y":"x";x[I]+=A[q]*D})}return x}function Ufe(t,e){e===void 0&&(e={});var n=e,i=n.placement,r=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?xu:l,c=Mm(i),d=c?a?yD:yD.filter(function(m){return Mm(m)===c}):Xb,f=d.filter(function(m){return u.indexOf(m)>=0});f.length===0&&(f=d);var h=f.reduce(function(m,g){return m[g]=Bv(t,{placement:g,boundary:r,rootBoundary:o,padding:s})[Ja(g)],m},{});return Object.keys(h).sort(function(m,g){return h[m]-h[g]})}function Wfe(t){if(Ja(t)===uR)return[];var e=Sw(t);return[CD(t),e,CD(e)]}function qfe(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var r=n.mainAxis,o=r===void 0?!0:r,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,m=h===void 0?!0:h,g=n.allowedAutoPlacements,v=e.options.placement,p=Ja(v),b=p===v,y=l||(b||!m?[Sw(v)]:Wfe(v)),_=[v].concat(y).reduce(function(J,ne){return J.concat(Ja(ne)===uR?Ufe(e,{placement:ne,boundary:c,rootBoundary:d,padding:u,flipVariations:m,allowedAutoPlacements:g}):ne)},[]),C=e.rects.reference,S=e.rects.popper,k=new Map,T=!0,E=_[0],x=0;x<_.length;x++){var P=_[x],A=Ja(P),I=Mm(P)===Pm,D=[To,Bs].indexOf(A)>=0,q=D?"width":"height",z=Bv(e,{placement:P,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),R=D?I?Vs:Eo:I?Bs:To;C[q]>S[q]&&(R=Sw(R));var O=Sw(R),N=[];if(o&&N.push(z[A]<=0),a&&N.push(z[R]<=0,z[O]<=0),N.every(function(J){return J})){E=P,T=!1;break}k.set(P,N)}if(T)for(var F=m?3:1,j=function(J){var ne=_.find(function(he){var X=k.get(he);if(X)return X.slice(0,J).every(function(se){return se})});if(ne)return E=ne,"break"},U=F;U>0;U--){var W=j(U);if(W==="break")break}e.placement!==E&&(e.modifiersData[i]._skip=!0,e.placement=E,e.reset=!0)}}var jfe={name:"flip",enabled:!0,phase:"main",fn:qfe,requiresIfExists:["offset"],data:{_skip:!1}};function kD(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function TD(t){return[To,Vs,Bs,Eo].some(function(e){return t[e]>=0})}function Kfe(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=Bv(e,{elementContext:"reference"}),a=Bv(e,{altBoundary:!0}),l=kD(s,i),u=kD(a,r,o),c=TD(l),d=TD(u);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}var Gfe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Kfe};function Yfe(t,e,n){var i=Ja(t),r=[Eo,To].indexOf(i)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,[Eo,Vs].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}function Xfe(t){var e=t.state,n=t.options,i=t.name,r=n.offset,o=r===void 0?[0,0]:r,s=xu.reduce(function(c,d){return c[d]=Yfe(d,e.rects,o),c},{}),a=s[e.placement],l=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[i]=s}var Jfe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Xfe};function Zfe(t){var e=t.state,n=t.name;e.modifiersData[n]=EU({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}var xU={name:"popperOffsets",enabled:!0,phase:"read",fn:Zfe,data:{}};function Qfe(t){return t==="x"?"y":"x"}function ehe(t){var e=t.state,n=t.options,i=t.name,r=n.mainAxis,o=r===void 0?!0:r,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,h=f===void 0?!0:f,m=n.tetherOffset,g=m===void 0?0:m,v=Bv(e,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),p=Ja(e.placement),b=Mm(e.placement),y=!b,_=fR(p),C=Qfe(_),S=e.modifiersData.popperOffsets,k=e.rects.reference,T=e.rects.popper,E=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,x=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,A={x:0,y:0};if(S){if(o){var I,D=_==="y"?To:Eo,q=_==="y"?Bs:Vs,z=_==="y"?"height":"width",R=S[_],O=R+v[D],N=R-v[q],F=h?-T[z]/2:0,j=b===Pm?k[z]:T[z],U=b===Pm?-T[z]:-k[z],W=e.elements.arrow,J=h&&W?dR(W):{width:0,height:0},ne=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:wU(),he=ne[D],X=ne[q],se=Wp(0,k[z],J[z]),re=y?k[z]/2-F-se-he-x.mainAxis:j-se-he-x.mainAxis,ee=y?-k[z]/2+F+se+X+x.mainAxis:U+se+X+x.mainAxis,te=e.elements.arrow&&Jb(e.elements.arrow),V=te?_==="y"?te.clientTop||0:te.clientLeft||0:0,K=(I=P?.[_])!=null?I:0,G=R+re-K-V,ye=R+ee-K,be=Wp(h?z_(O,G):O,R,h?rf(N,ye):N);S[_]=be,A[_]=be-R}if(a){var Ce,Y=_==="x"?To:Eo,Z=_==="x"?Bs:Vs,ae=S[C],pe=C==="y"?"height":"width",je=ae+v[Y],Ie=ae-v[Z],fe=[To,Eo].indexOf(p)!==-1,Te=(Ce=P?.[C])!=null?Ce:0,et=fe?je:ae-k[pe]-T[pe]-Te+x.altAxis,Re=fe?ae+k[pe]+T[pe]-Te-x.altAxis:Ie,ze=h&&fe?xfe(et,ae,Re):Wp(h?et:je,ae,h?Re:Ie);S[C]=ze,A[C]=ze-ae}e.modifiersData[i]=A}}var the={name:"preventOverflow",enabled:!0,phase:"main",fn:ehe,requiresIfExists:["offset"]};function nhe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function ihe(t){return t===ss(t)||!Os(t)?hR(t):nhe(t)}function rhe(t){var e=t.getBoundingClientRect(),n=Im(e.width)/t.offsetWidth||1,i=Im(e.height)/t.offsetHeight||1;return n!==1||i!==1}function ohe(t,e,n){n===void 0&&(n=!1);var i=Os(e),r=Os(e)&&rhe(e),o=Hc(e),s=Rm(t,r,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&((dl(e)!=="body"||gR(o))&&(a=ihe(e)),Os(e)?(l=Rm(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=mR(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function she(t){var e=new Map,n=new Set,i=[];t.forEach(function(o){e.set(o.name,o)});function r(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&r(l)}}),i.push(o)}return t.forEach(function(o){n.has(o.name)||r(o)}),i}function ahe(t){var e=she(t);return Cfe.reduce(function(n,i){return n.concat(e.filter(function(r){return r.phase===i}))},[])}function lhe(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function uhe(t){var e=t.reduce(function(n,i){var r=n[i.name];return n[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,n},{});return Object.keys(e).map(function(n){return e[n]})}var ED={placement:"bottom",modifiers:[],strategy:"absolute"};function xD(){for(var t=arguments.length,e=new Array(t),n=0;nZI(hhe,t),mhe=["fixed","absolute"],ghe=qe({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:me(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:xu,default:"bottom"},popperOptions:{type:me(Object),default:()=>({})},strategy:{type:String,values:mhe,default:"absolute"}}),PU=qe({...ghe,...AU,id:String,style:{type:me([String,Array,Object])},className:{type:me([String,Array,Object])},effect:{type:me(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:Boolean,trapping:Boolean,popperClass:{type:me([String,Array,Object])},popperStyle:{type:me([String,Array,Object])},referenceEl:{type:me(Object)},triggerTargetEl:{type:me(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...hs(["ariaLabel"]),loop:Boolean}),phe={mouseenter:t=>t instanceof MouseEvent,mouseleave:t=>t instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0};function AD(){let t;const e=(i,r)=>{n(),t=window.setTimeout(i,r)},n=()=>window.clearTimeout(t);return cg(()=>n()),{registerTimeout:e,cancelTimeout:n}}const vhe=qe({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),bhe=({showAfter:t,hideAfter:e,autoClose:n,open:i,close:r})=>{const{registerTimeout:o}=AD(),{registerTimeout:s,cancelTimeout:a}=AD();return{onOpen:(c,d=w(t))=>{o(()=>{i(c);const f=w(n);St(f)&&f>0&&s(()=>{r(c)},f)},d)},onClose:(c,d=w(e))=>{a(),o(()=>{r(c)},d)}}},Mn=qe({...vhe,...PU,appendTo:{type:iR.to.type},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:me(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...hs(["ariaLabel"])}),Fs=t=>t,yhe=qe({id:{type:String,default:void 0},size:$r,disabled:{type:Boolean,default:void 0},modelValue:{type:me([String,Number,Object]),default:""},modelModifiers:{type:me(Object),default:()=>({})},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:me(String),default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:me([Boolean,Object]),default:!1},autocomplete:{type:me(String),default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,clearIcon:{type:ri,default:Nf},showPassword:Boolean,showWordLimit:Boolean,wordLimitPosition:{type:String,values:["inside","outside"],default:"inside"},suffixIcon:{type:ri},prefixIcon:{type:ri},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:me([Object,Array,String]),default:()=>Fs({})},autofocus:Boolean,rows:{type:Number,default:2},...hs(["ariaLabel"]),inputmode:{type:me(String),default:void 0},name:String}),whe={[It]:t=>ot(t),input:t=>ot(t),change:(t,e)=>ot(t)&&(e instanceof Event||e===void 0),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,mouseleave:t=>t instanceof MouseEvent,mouseenter:t=>t instanceof MouseEvent,keydown:t=>t instanceof Event,compositionstart:t=>t instanceof CompositionEvent,compositionupdate:t=>t instanceof CompositionEvent,compositionend:t=>t instanceof CompositionEvent};ca(Nf);const IU=()=>Zt&&/firefox/i.test(window.navigator.userAgent),_he=()=>Zt&&/android/i.test(window.navigator.userAgent);let fo;const Che={height:"0",visibility:"hidden",overflow:IU()?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},She=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],PD=t=>{const e=Number.parseFloat(t);return Number.isNaN(e)?t:e};function khe(t){const e=window.getComputedStyle(t),n=e.getPropertyValue("box-sizing"),i=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),r=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:She.map(s=>[s,e.getPropertyValue(s)]),paddingSize:i,borderSize:r,boxSizing:n}}function ID(t,e=1,n){var i,r;fo||(fo=document.createElement("textarea"),((i=t.parentNode)!=null?i:document.body).appendChild(fo));const{paddingSize:o,borderSize:s,boxSizing:a,contextStyle:l}=khe(t);l.forEach(([f,h])=>fo?.style.setProperty(f,h)),Object.entries(Che).forEach(([f,h])=>fo?.style.setProperty(f,h,"important")),fo.value=t.value||t.placeholder||"";let u=fo.scrollHeight;const c={};a==="border-box"?u=u+s:a==="content-box"&&(u=u-o),fo.value="";const d=fo.scrollHeight-o;if(St(e)){let f=d*e;a==="border-box"&&(f=f+o+s),u=Math.max(f,u),c.minHeight=`${f}px`}if(St(n)){let f=d*n;a==="border-box"&&(f=f+o+s),u=Math.min(f,u)}return c.height=`${u}px`,(r=fo.parentNode)==null||r.removeChild(fo),fo=void 0,c}const The=["class","style"],Ehe=/^on[A-Z]/,vR=(t={})=>{const{excludeListeners:e=!1,excludeKeys:n}=t,i=M(()=>(n?.value||[]).concat(The)),r=Ct();return M(r?()=>{var o;return Lv(Object.entries((o=r.proxy)==null?void 0:o.$attrs).filter(([s])=>!i.value.includes(s)&&!(e&&Ehe.test(s))))}:()=>({}))},RU=t=>{const e=Ct();return M(()=>{var n,i;return(i=(n=e?.proxy)==null?void 0:n.$props)==null?void 0:i[t]})},Bf=Symbol("formContextKey"),yf=Symbol("formItemContextKey"),fr=(t,e={})=>{const n=H(void 0),i=e.prop?n:RU("size"),r=e.global?n:oU(),o=e.form?{size:void 0}:Ne(Bf,void 0),s=e.formItem?{size:void 0}:Ne(yf,void 0);return M(()=>i.value||w(t)||s?.size||o?.size||r.value||"")},Oi=t=>{const e=RU("disabled"),n=Ne(Bf,void 0);return M(()=>{var i,r,o;return(o=(r=(i=e.value)!=null?i:w(t))!=null?r:n?.disabled)!=null?o:!1})},xhe='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',RD=t=>typeof Element>"u"?!1:t instanceof Element,Ahe=t=>getComputedStyle(t).position==="fixed"?!1:t.offsetParent!==null,MD=t=>Array.from(t.querySelectorAll(xhe)).filter(e=>Vv(e)&&Ahe(e)),Vv=t=>{if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.tabIndex<0||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true")return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return!(t.type==="hidden"||t.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},kw=function(t,e,...n){let i;e.includes("mouse")||e.includes("click")?i="MouseEvents":e.includes("key")?i="KeyboardEvent":i="HTMLEvents";const r=document.createEvent(i);return r.initEvent(e,...n),t.dispatchEvent(r),t},MU=t=>!t.getAttribute("aria-owns"),OU=(t,e,n)=>{const{parentNode:i}=t;if(!i)return null;const r=i.querySelectorAll(n),o=Array.prototype.indexOf.call(r,t);return r[o+e]||null},Zb=(t,e)=>{if(!t||!t.focus)return;let n=!1;RD(t)&&!Vv(t)&&!t.getAttribute("tabindex")&&(t.setAttribute("tabindex","-1"),n=!0),t.focus(e),RD(t)&&n&&t.removeAttribute("tabindex")},Tw=t=>{t&&(Zb(t),!MU(t)&&t.click())};function dg(t,{disabled:e,beforeFocus:n,afterFocus:i,beforeBlur:r,afterBlur:o}={}){const s=Ct(),{emit:a}=s,l=bi(),u=H(!1),c=h=>{const m=Xe(n)?n(h):!1;w(e)||u.value||m||(u.value=!0,a("focus",h),i?.())},d=h=>{var m;const g=Xe(r)?r(h):!1;w(e)||h.relatedTarget&&((m=l.value)!=null&&m.contains(h.relatedTarget))||g||(u.value=!1,a("blur",h),o?.())},f=h=>{var m,g;w(e)||Vv(h.target)||(m=l.value)!=null&&m.contains(document.activeElement)&&l.value!==document.activeElement||(g=t.value)==null||g.focus()};return Se([l,()=>w(e)],([h,m])=>{h&&(m?h.removeAttribute("tabindex"):h.setAttribute("tabindex","-1"))}),Kn(l,"focus",c,!0),Kn(l,"blur",d,!0),Kn(l,"click",f,!0),{isFocused:u,wrapperRef:l,handleFocus:c,handleBlur:d}}const OD={prefix:Math.floor(Math.random()*1e4),current:0},Phe=Symbol("elIdInjection"),LU=()=>Ct()?Ne(Phe,OD):OD,as=t=>{const e=LU(),n=QI();return XH(()=>w(t)||`${n.value}-id-${e.prefix}-${e.current++}`)},lo=()=>{const t=Ne(Bf,void 0),e=Ne(yf,void 0);return{form:t,formItem:e}},Au=(t,{formItemContext:e,disableIdGeneration:n,disableIdManagement:i})=>{n||(n=H(!1)),i||(i=H(!1));const r=Ct(),o=()=>{let u=r?.parent;for(;u;){if(u.type.name==="ElFormItem")return!1;if(u.type.name==="ElLabelWrap")return!0;u=u.parent}return!1},s=H();let a;const l=M(()=>{var u;return!!(!(t.label||t.ariaLabel)&&e&&e.inputIds&&((u=e.inputIds)==null?void 0:u.length)<=1)});return Pt(()=>{a=Se([An(t,"id"),n],([u,c])=>{const d=u??(c?void 0:as().value);d!==s.value&&(e?.removeInputId&&!o()&&(s.value&&e.removeInputId(s.value),!i?.value&&!c&&d&&e.addInputId(d)),s.value=d)},{immediate:!0})}),Fc(()=>{a&&a(),e?.removeInputId&&s.value&&e.removeInputId(s.value)}),{isLabeledByFormItem:l,inputId:s}},Ihe=t=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t);function bR({afterComposition:t,emit:e}){const n=H(!1),i=a=>{e?.("compositionstart",a),n.value=!0},r=a=>{var l;e?.("compositionupdate",a);const u=(l=a.target)==null?void 0:l.value,c=u[u.length-1]||"";n.value=!Ihe(c)},o=a=>{e?.("compositionend",a),n.value&&(n.value=!1,Ye(()=>t(a)))};return{isComposing:n,handleComposition:a=>{a.type==="compositionend"?o(a):r(a)},handleCompositionStart:i,handleCompositionUpdate:r,handleCompositionEnd:o}}function Rhe(t){let e;function n(){if(t.value==null)return;const{selectionStart:r,selectionEnd:o,value:s}=t.value;if(r==null||o==null)return;const a=s.slice(0,Math.max(0,r)),l=s.slice(Math.max(0,o));e={selectionStart:r,selectionEnd:o,value:s,beforeTxt:a,afterTxt:l}}function i(){if(t.value==null||e==null)return;const{value:r}=t.value,{beforeTxt:o,afterTxt:s,selectionStart:a}=e;if(o==null||s==null||a==null)return;let l=r.length;if(r.endsWith(s))l=r.length-s.length;else if(r.startsWith(o))l=o.length;else{const u=o[a-1],c=r.indexOf(u,a-1);c!==-1&&(l=c+1)}t.value.setSelectionRange(l,l)}return[n,i]}const Mhe=["id","name","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","inputmode"],Ohe=["id","name","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role"],Lhe="ElInput";var Dhe=le({name:Lhe,inheritAttrs:!1,__name:"input",props:yhe,emits:whe,setup(t,{expose:e,emit:n}){const i=t,r=n,o=Rf(),s=vR(),a=$o(),l=M(()=>[i.type==="textarea"?v.b():g.b(),g.m(h.value),g.is("disabled",m.value),g.is("exceed",W.value),{[g.b("group")]:a.prepend||a.append,[g.m("prefix")]:a.prefix||i.prefixIcon,[g.m("suffix")]:a.suffix||i.suffixIcon||i.clearable||i.showPassword,[g.bm("suffix","password-clear")]:N.value&&F.value,[g.b("hidden")]:i.type==="hidden"},o.class]),u=M(()=>[g.e("wrapper"),g.is("focus",E.value)]),{form:c,formItem:d}=lo(),{inputId:f}=Au(i,{formItemContext:d}),h=fr(),m=Oi(),g=De("input"),v=De("textarea"),p=bi(),b=bi(),y=H(!1),_=H(!1),C=H(),S=bi(i.inputStyle),k=M(()=>p.value||b.value),{wrapperRef:T,isFocused:E,handleFocus:x,handleBlur:P}=dg(k,{disabled:m,afterBlur(){var Re;i.validateEvent&&((Re=d?.validate)==null||Re.call(d,"blur").catch(ze=>void 0))}}),A=M(()=>{var Re;return(Re=c?.statusIcon)!=null?Re:!1}),I=M(()=>d?.validateState||""),D=M(()=>I.value&&gU[I.value]),q=M(()=>_.value?nfe:kde),z=M(()=>[o.style]),R=M(()=>[i.inputStyle,S.value,{resize:i.resize}]),O=M(()=>ir(i.modelValue)?"":String(i.modelValue)),N=M(()=>i.clearable&&!m.value&&!i.readonly&&!!O.value&&(E.value||y.value)),F=M(()=>i.showPassword&&!m.value&&!!O.value),j=M(()=>i.showWordLimit&&!!i.maxlength&&(i.type==="text"||i.type==="textarea")&&!m.value&&!i.readonly&&!i.showPassword),U=M(()=>O.value.length),W=M(()=>!!j.value&&U.value>Number(i.maxlength)),J=M(()=>!!a.suffix||!!i.suffixIcon||N.value||i.showPassword||j.value||!!I.value&&A.value),ne=M(()=>!!Object.keys(i.modelModifiers).length),[he,X]=Rhe(p);nr(b,Re=>{if(ee(),!j.value||i.resize!=="both"&&i.resize!=="horizontal")return;const ze=Re[0],{width:Ke}=ze.contentRect;C.value={right:`calc(100% - ${Ke+22-10}px)`}});const se=()=>{const{type:Re,autosize:ze}=i;if(!(!Zt||Re!=="textarea"||!b.value))if(ze){const Ke=_t(ze)?ze.minRows:void 0,Dt=_t(ze)?ze.maxRows:void 0,Cn=ID(b.value,Ke,Dt);S.value={overflowY:"hidden",...Cn},Ye(()=>{b.value.offsetHeight,S.value=Cn})}else S.value={minHeight:ID(b.value).minHeight}},ee=(Re=>{let ze=!1;return()=>{var Ke;if(ze||!i.autosize)return;((Ke=b.value)==null?void 0:Ke.offsetParent)===null||(setTimeout(Re),ze=!0)}})(se),te=()=>{const Re=k.value,ze=i.formatter?i.formatter(O.value):O.value;!Re||Re.value===ze||i.type==="file"||(Re.value=ze)},V=Re=>{const{trim:ze,number:Ke}=i.modelModifiers;return ze&&(Re=Re.trim()),Ke&&(Re=`${PD(Re)}`),i.formatter&&i.parser&&(Re=i.parser(Re)),Re},K=async Re=>{if(ye.value)return;const{lazy:ze}=i.modelModifiers;let{value:Ke}=Re.target;if(ze){r(rs,Ke);return}if(Ke=V(Ke),String(Ke)===O.value){i.formatter&&te();return}he(),r(It,Ke),r(rs,Ke),await Ye(),(i.formatter&&i.parser||!ne.value)&&te(),X()},G=async Re=>{let{value:ze}=Re.target;ze=V(ze),i.modelModifiers.lazy&&r(It,ze),r(En,ze,Re),await Ye(),te()},{isComposing:ye,handleCompositionStart:be,handleCompositionUpdate:Ce,handleCompositionEnd:Y}=bR({emit:r,afterComposition:K}),Z=()=>{_.value=!_.value},ae=()=>{var Re;return(Re=k.value)==null?void 0:Re.focus()},pe=()=>{var Re;return(Re=k.value)==null?void 0:Re.blur()},je=Re=>{y.value=!1,r("mouseleave",Re)},Ie=Re=>{y.value=!0,r("mouseenter",Re)},fe=Re=>{r("keydown",Re)},Te=()=>{var Re;(Re=k.value)==null||Re.select()},et=()=>{r(It,""),r(En,""),r("clear"),r(rs,"")};return Se(()=>i.modelValue,()=>{var Re;Ye(()=>se()),i.validateEvent&&((Re=d?.validate)==null||Re.call(d,"change").catch(ze=>void 0))}),Se(O,Re=>{if(!k.value)return;const{trim:ze,number:Ke}=i.modelModifiers,Dt=k.value.value,Cn=(Ke||i.type==="number")&&!/^0\d/.test(Dt)?`${PD(Dt)}`:Dt;Cn!==Re&&(document.activeElement===k.value&&k.value.type!=="range"&&ze&&Cn.trim()===Re||te())}),Se(()=>i.type,async()=>{await Ye(),te(),se()}),Pt(()=>{!i.formatter&&i.parser,te(),Ye(se)}),e({input:p,textarea:b,ref:k,textareaStyle:R,autosize:An(i,"autosize"),isComposing:ye,focus:ae,blur:pe,select:Te,clear:et,resizeTextarea:se}),(Re,ze)=>(B(),Q("div",{class:$([l.value,{[w(g).bm("group","append")]:Re.$slots.append,[w(g).bm("group","prepend")]:Re.$slots.prepend}]),style:mt(z.value),onMouseenter:Ie,onMouseleave:je},[ve(" input "),t.type!=="textarea"?(B(),Q(rt,{key:0},[ve(" prepend slot "),Re.$slots.prepend?(B(),Q("div",{key:0,class:$(w(g).be("group","prepend"))},[we(Re.$slots,"prepend")],2)):ve("v-if",!0),ie("div",{ref_key:"wrapperRef",ref:T,class:$(u.value)},[ve(" prefix slot "),Re.$slots.prefix||t.prefixIcon?(B(),Q("span",{key:0,class:$(w(g).e("prefix"))},[ie("span",{class:$(w(g).e("prefix-inner"))},[we(Re.$slots,"prefix"),t.prefixIcon?(B(),_e(w(He),{key:0,class:$(w(g).e("icon"))},{default:ce(()=>[(B(),_e(Gt(t.prefixIcon)))]),_:1},8,["class"])):ve("v-if",!0)],2)],2)):ve("v-if",!0),ie("input",Lt({id:w(f),ref_key:"input",ref:p,class:w(g).e("inner")},w(s),{name:t.name,minlength:t.minlength,maxlength:t.maxlength,type:t.showPassword?_.value?"text":"password":t.type,disabled:w(m),readonly:t.readonly,autocomplete:t.autocomplete,tabindex:t.tabindex,"aria-label":t.ariaLabel,placeholder:t.placeholder,style:t.inputStyle,form:t.form,autofocus:t.autofocus,role:t.containerRole,inputmode:t.inputmode,onCompositionstart:ze[0]||(ze[0]=(...Ke)=>w(be)&&w(be)(...Ke)),onCompositionupdate:ze[1]||(ze[1]=(...Ke)=>w(Ce)&&w(Ce)(...Ke)),onCompositionend:ze[2]||(ze[2]=(...Ke)=>w(Y)&&w(Y)(...Ke)),onInput:K,onChange:G,onKeydown:fe}),null,16,Mhe),ve(" suffix slot "),J.value?(B(),Q("span",{key:1,class:$(w(g).e("suffix"))},[ie("span",{class:$(w(g).e("suffix-inner"))},[!N.value||!F.value||!j.value?(B(),Q(rt,{key:0},[we(Re.$slots,"suffix"),t.suffixIcon?(B(),_e(w(He),{key:0,class:$(w(g).e("icon"))},{default:ce(()=>[(B(),_e(Gt(t.suffixIcon)))]),_:1},8,["class"])):ve("v-if",!0)],64)):ve("v-if",!0),N.value?(B(),_e(w(He),{key:1,class:$([w(g).e("icon"),w(g).e("clear")]),onMousedown:Ot(w(tn),["prevent"]),onClick:et},{default:ce(()=>[(B(),_e(Gt(t.clearIcon)))]),_:1},8,["class","onMousedown"])):ve("v-if",!0),F.value?(B(),_e(w(He),{key:2,class:$([w(g).e("icon"),w(g).e("password")]),onClick:Z,onMousedown:Ot(w(tn),["prevent"]),onMouseup:Ot(w(tn),["prevent"])},{default:ce(()=>[(B(),_e(Gt(q.value)))]),_:1},8,["class","onMousedown","onMouseup"])):ve("v-if",!0),j.value?(B(),Q("span",{key:3,class:$([w(g).e("count"),w(g).is("outside",t.wordLimitPosition==="outside")])},[ie("span",{class:$(w(g).e("count-inner"))},We(U.value)+" / "+We(t.maxlength),3)],2)):ve("v-if",!0),I.value&&D.value&&A.value?(B(),_e(w(He),{key:4,class:$([w(g).e("icon"),w(g).e("validateIcon"),w(g).is("loading",I.value==="validating")])},{default:ce(()=>[(B(),_e(Gt(D.value)))]),_:1},8,["class"])):ve("v-if",!0)],2)],2)):ve("v-if",!0)],2),ve(" append slot "),Re.$slots.append?(B(),Q("div",{key:1,class:$(w(g).be("group","append"))},[we(Re.$slots,"append")],2)):ve("v-if",!0)],64)):(B(),Q(rt,{key:1},[ve(" textarea "),ie("textarea",Lt({id:w(f),ref_key:"textarea",ref:b,class:[w(v).e("inner"),w(g).is("focus",w(E))]},w(s),{name:t.name,minlength:t.minlength,maxlength:t.maxlength,tabindex:t.tabindex,disabled:w(m),readonly:t.readonly,autocomplete:t.autocomplete,style:R.value,"aria-label":t.ariaLabel,placeholder:t.placeholder,form:t.form,autofocus:t.autofocus,rows:t.rows,role:t.containerRole,onCompositionstart:ze[3]||(ze[3]=(...Ke)=>w(be)&&w(be)(...Ke)),onCompositionupdate:ze[4]||(ze[4]=(...Ke)=>w(Ce)&&w(Ce)(...Ke)),onCompositionend:ze[5]||(ze[5]=(...Ke)=>w(Y)&&w(Y)(...Ke)),onInput:K,onFocus:ze[6]||(ze[6]=(...Ke)=>w(x)&&w(x)(...Ke)),onBlur:ze[7]||(ze[7]=(...Ke)=>w(P)&&w(P)(...Ke)),onChange:G,onKeydown:fe}),null,16,Ohe),j.value?(B(),Q("span",{key:0,style:mt(C.value),class:$([w(g).e("count"),w(g).is("outside",t.wordLimitPosition==="outside")])},We(U.value)+" / "+We(t.maxlength),7)):ve("v-if",!0)],64))],38))}});const cr=sn(Dhe),Nhe=qe({distance:{type:Number,default:0},height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:Boolean,wrapStyle:{type:me([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...hs(["ariaLabel","ariaOrientation"])}),DU={"end-reached":t=>["left","right","top","bottom"].includes(t),scroll:({scrollTop:t,scrollLeft:e})=>[t,e].every(St)},Bhe=qe({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}}),th=4,Vhe={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},Fhe=({move:t,size:e,bar:n})=>({[n.size]:e,transform:`translate${n.axis}(${t}%)`}),$he=qe({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),yR=Symbol("scrollbarContextKey"),zhe="Thumb";var LD=le({__name:"thumb",props:$he,setup(t){const e=t,n=Ne(yR),i=De("scrollbar");n||dr(zhe,"can not inject scrollbar context");const r=H(),o=H(),s=H({}),a=H(!1);let l=!1,u=!1,c=0,d=0,f=Zt?document.onselectstart:null;const h=M(()=>Vhe[e.vertical?"vertical":"horizontal"]),m=M(()=>Fhe({size:e.size,move:e.move,bar:h.value})),g=M(()=>r.value[h.value.offset]**2/n.wrapElement[h.value.scrollSize]/e.ratio/o.value[h.value.offset]),v=T=>{var E;if(T.stopPropagation(),T.ctrlKey||[1,2].includes(T.button))return;(E=window.getSelection())==null||E.removeAllRanges(),b(T);const x=T.currentTarget;x&&(s.value[h.value.axis]=x[h.value.offset]-(T[h.value.client]-x.getBoundingClientRect()[h.value.direction]))},p=T=>{if(!o.value||!r.value||!n.wrapElement)return;const E=Math.abs(T.target.getBoundingClientRect()[h.value.direction]-T[h.value.client]),x=o.value[h.value.offset]/2,P=(E-x)*100*g.value/r.value[h.value.offset];n.wrapElement[h.value.scroll]=P*n.wrapElement[h.value.scrollSize]/100},b=T=>{T.stopImmediatePropagation(),l=!0,c=n.wrapElement.scrollHeight,d=n.wrapElement.scrollWidth,document.addEventListener("mousemove",y),document.addEventListener("mouseup",_),f=document.onselectstart,document.onselectstart=()=>!1},y=T=>{if(!r.value||!o.value||l===!1)return;const E=s.value[h.value.axis];if(!E)return;const x=(r.value.getBoundingClientRect()[h.value.direction]-T[h.value.client])*-1,P=o.value[h.value.offset]-E,A=(x-P)*100*g.value/r.value[h.value.offset];h.value.scroll==="scrollLeft"?n.wrapElement[h.value.scroll]=A*d/100:n.wrapElement[h.value.scroll]=A*c/100},_=()=>{l=!1,s.value[h.value.axis]=0,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",_),k(),u&&(a.value=!1)},C=()=>{u=!1,a.value=!!e.size},S=()=>{u=!0,a.value=l};Sn(()=>{k(),document.removeEventListener("mouseup",_)});const k=()=>{document.onselectstart!==f&&(document.onselectstart=f)};return Kn(An(n,"scrollbarElement"),"mousemove",C),Kn(An(n,"scrollbarElement"),"mouseleave",S),(T,E)=>(B(),_e(ya,{name:w(i).b("fade"),persisted:""},{default:ce(()=>[Vt(ie("div",{ref_key:"instance",ref:r,class:$([w(i).e("bar"),w(i).is(h.value.key)]),onMousedown:p,onClick:E[0]||(E[0]=Ot(()=>{},["stop"]))},[ie("div",{ref_key:"thumb",ref:o,class:$(w(i).e("thumb")),style:mt(m.value),onMousedown:v},null,38)],34),[[On,t.always||a.value]])]),_:1},8,["name"]))}}),Hhe=le({__name:"bar",props:Bhe,setup(t,{expose:e}){const n=t,i=Ne(yR),r=H(0),o=H(0),s=H(""),a=H(""),l=H(1),u=H(1);return e({handleScroll:f=>{if(f){const h=f.offsetHeight-th,m=f.offsetWidth-th;o.value=f.scrollTop*100/h*l.value,r.value=f.scrollLeft*100/m*u.value}},update:()=>{const f=i?.wrapElement;if(!f)return;const h=f.offsetHeight-th,m=f.offsetWidth-th,g=h**2/f.scrollHeight,v=m**2/f.scrollWidth,p=Math.max(g,n.minSize),b=Math.max(v,n.minSize);l.value=g/(h-g)/(p/(h-p)),u.value=v/(m-v)/(b/(m-b)),a.value=p+th(B(),Q(rt,null,[L(LD,{move:r.value,ratio:u.value,size:s.value,always:t.always},null,8,["move","ratio","size","always"]),L(LD,{move:o.value,ratio:l.value,size:a.value,vertical:"",always:t.always},null,8,["move","ratio","size","always"])],64))}});const Uhe=["tabindex"],Whe="ElScrollbar";var qhe=le({name:Whe,__name:"scrollbar",props:Nhe,emits:DU,setup(t,{expose:e,emit:n}){const i=t,r=n,o=De("scrollbar");let s,a,l,u=0,c=0,d="";const f={bottom:!1,top:!1,right:!1,left:!1},h=H(),m=H(),g=H(),v=H(),p=M(()=>{const A={},I=zr(i.height),D=zr(i.maxHeight);return I&&(A.height=I),D&&(A.maxHeight=D),[i.wrapStyle,A]}),b=M(()=>[i.wrapClass,o.e("wrap"),{[o.em("wrap","hidden-default")]:!i.native}]),y=M(()=>[o.e("view"),i.viewClass]),_=A=>{var I;return(I=f[A])!=null?I:!1},C={top:"bottom",bottom:"top",left:"right",right:"left"},S=A=>{const I=C[d];if(!I)return;const D=A[d],q=A[I];D&&!f[d]&&(f[d]=!0),!q&&f[I]&&(f[I]=!1)},k=()=>{var A;if(m.value){(A=v.value)==null||A.handleScroll(m.value);const I=u,D=c;u=m.value.scrollTop,c=m.value.scrollLeft;const q={bottom:u+m.value.clientHeight>=m.value.scrollHeight-i.distance,top:u<=i.distance&&I!==0,right:c+m.value.clientWidth>=m.value.scrollWidth-i.distance&&D!==c,left:c<=i.distance&&D!==0};if(r("scroll",{scrollTop:u,scrollLeft:c}),I!==u&&(d=u>I?"bottom":"top"),D!==c&&(d=c>D?"right":"left"),i.distance>0){if(_(d))return;S(q)}q[d]&&r("end-reached",d)}};function T(A,I){_t(A)?m.value.scrollTo(A):St(A)&&St(I)&&m.value.scrollTo(A,I)}const E=A=>{St(A)&&(m.value.scrollTop=A)},x=A=>{St(A)&&(m.value.scrollLeft=A)},P=()=>{var A;(A=v.value)==null||A.update(),f[d]=!1};return Se(()=>i.noresize,A=>{A?(s?.(),a?.(),l?.()):({stop:s}=nr(g,P),{stop:a}=nr(m,P),l=Kn("resize",P))},{immediate:!0}),Se(()=>[i.maxHeight,i.height],()=>{i.native||Ye(()=>{var A;P(),m.value&&((A=v.value)==null||A.handleScroll(m.value))})}),qt(yR,on({scrollbarElement:h,wrapElement:m})),hz(()=>{m.value&&(m.value.scrollTop=u,m.value.scrollLeft=c)}),Pt(()=>{i.native||Ye(()=>{P()})}),ku(()=>P()),e({wrapRef:m,update:P,scrollTo:T,setScrollTop:E,setScrollLeft:x,handleScroll:k}),(A,I)=>(B(),Q("div",{ref_key:"scrollbarRef",ref:h,class:$(w(o).b())},[ie("div",{ref_key:"wrapRef",ref:m,class:$(b.value),style:mt(p.value),tabindex:t.tabindex,onScroll:k},[(B(),_e(Gt(t.tag),{id:t.id,ref_key:"resizeRef",ref:g,class:$(y.value),style:mt(t.viewStyle),role:t.role,"aria-label":t.ariaLabel,"aria-orientation":t.ariaOrientation},{default:ce(()=>[we(A.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,Uhe),t.native?ve("v-if",!0):(B(),_e(Hhe,{key:0,ref_key:"barRef",ref:v,always:t.always,"min-size":t.minSize},null,8,["always","min-size"]))],2))}});const gu=sn(qhe),NU=qe({virtualRef:{type:me(Object)},virtualTriggering:Boolean,onMouseenter:{type:me(Function)},onMouseleave:{type:me(Function)},onClick:{type:me(Function)},onKeydown:{type:me(Function)},onFocus:{type:me(Function)},onBlur:{type:me(Function)},onContextmenu:{type:me(Function)},id:String,open:Boolean}),Me={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},vc=qe({...NU,disabled:Boolean,trigger:{type:me([String,Array]),default:"hover"},triggerKeys:{type:me(Array),default:()=>[Me.enter,Me.numpadEnter,Me.space]},focusOnTarget:Boolean}),jhe=MC({type:me(Boolean),default:null}),Khe=MC({type:me(Function)}),Ghe=t=>{const e=`update:${t}`,n=`onUpdate:${t}`,i=[e],r={[t]:jhe,[n]:Khe};return{useModelToggle:({indicator:s,toggleReason:a,shouldHideWhenRouteChanges:l,shouldProceed:u,onShow:c,onHide:d})=>{const f=Ct(),{emit:h}=f,m=f.props,g=M(()=>Xe(m[n])),v=M(()=>m[t]===null),p=k=>{s.value!==!0&&(s.value=!0,a&&(a.value=k),Xe(c)&&c(k))},b=k=>{s.value!==!1&&(s.value=!1,a&&(a.value=k),Xe(d)&&d(k))},y=k=>{if(m.disabled===!0||Xe(u)&&!u())return;const T=g.value&&Zt;T&&h(e,!0),(v.value||!T)&&p(k)},_=k=>{if(m.disabled===!0||!Zt)return;const T=g.value&&Zt;T&&h(e,!1),(v.value||!T)&&b(k)},C=k=>{vi(k)&&(m.disabled&&k?g.value&&h(e,!1):s.value!==k&&(k?p():b()))},S=()=>{s.value?_():y()};return Se(()=>m[t],C),l&&f.appContext.config.globalProperties.$route!==void 0&&Se(()=>({...f.proxy.$route}),()=>{l.value&&s.value&&_()}),Pt(()=>{C(m[t])}),{hide:_,show:y,toggle:S,hasUpdateHandler:g}},useModelToggleProps:r,useModelToggleEmits:i}},BU=["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],VU=qe({role:{type:String,values:BU,default:"tooltip"}}),{useModelToggleProps:Yhe,useModelToggleEmits:Xhe,useModelToggle:Jhe}=Ghe("visible"),Zhe=qe({...VU,...Yhe,...Mn,...vc,...AU,showArrow:{type:Boolean,default:!0}}),Qhe=[...Xhe,"before-show","before-hide","show","hide","open","close"],wR=Symbol("popper"),FU=Symbol("popperContent");var eme=le({name:"ElPopper",inheritAttrs:!1,__name:"popper",props:VU,setup(t,{expose:e}){const n=t,i=H(),r=H(),o=H(),s=H(),a=M(()=>n.role),l={triggerRef:i,popperInstanceRef:r,contentRef:o,referenceRef:s,role:a};return e(l),qt(wR,l),(u,c)=>we(u.$slots,"default")}}),tme=le({name:"ElPopperArrow",inheritAttrs:!1,__name:"arrow",setup(t,{expose:e}){const n=De("popper"),{arrowRef:i,arrowStyle:r}=Ne(FU,void 0);return Sn(()=>{i.value=void 0}),e({arrowRef:i}),(o,s)=>(B(),Q("span",{ref_key:"arrowRef",ref:i,class:$(w(n).e("arrow")),style:mt(w(r)),"data-popper-arrow":""},null,6))}});const $U=Symbol("elForwardRef"),nme=t=>{qt($U,{setForwardRef:(n=>{t.value=n})})},ime=t=>({mounted(e){t(e)},updated(e){t(e)},unmounted(){t(null)}}),rme="ElOnlyChild",zU=le({name:rme,setup(t,{slots:e,attrs:n}){var i;const r=Ne($U),o=ime((i=r?.setForwardRef)!=null?i:tn);return()=>{var s;const a=(s=e.default)==null?void 0:s.call(e,n);if(!a)return null;const[l,u]=HU(a);return l?Vt(al(l,n),[[o]]):null}}});function HU(t){if(!t)return[null,0];const e=t,n=e.filter(i=>i.type!==xi).length;for(const i of e){if(_t(i))switch(i.type){case xi:continue;case Mf:case"svg":return[DD(i),n];case rt:return HU(i.children);default:return[i,n]}return[DD(i),n]}return[null,0]}function DD(t){const e=De("only-child");return L("span",{class:e.e("content")},[t])}var ome=le({name:"ElPopperTrigger",inheritAttrs:!1,__name:"trigger",props:NU,setup(t,{expose:e}){const n=t,{role:i,triggerRef:r}=Ne(wR,void 0);nme(r);const o=M(()=>a.value?n.id:void 0),s=M(()=>{if(i&&i.value==="tooltip")return n.open&&n.id?n.id:void 0}),a=M(()=>{if(i&&i.value!=="tooltip")return i.value}),l=M(()=>a.value?`${n.open}`:void 0);let u;const c=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return Pt(()=>{Se(()=>n.virtualRef,d=>{d&&(r.value=Yi(d))},{immediate:!0}),Se(r,(d,f)=>{u?.(),u=void 0,Qo(f)&&c.forEach(h=>{const m=n[h];m&&f.removeEventListener(h.slice(2).toLowerCase(),m,["onFocus","onBlur"].includes(h))}),Qo(d)&&(c.forEach(h=>{const m=n[h];m&&d.addEventListener(h.slice(2).toLowerCase(),m,["onFocus","onBlur"].includes(h))}),Vv(d)&&(u=Se([o,s,a,l],h=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((m,g)=>{ir(h[g])?d.removeAttribute(m):d.setAttribute(m,h[g])})},{immediate:!0}))),Qo(f)&&Vv(f)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(h=>f.removeAttribute(h))},{immediate:!0})}),Sn(()=>{if(u?.(),u=void 0,r.value&&Qo(r.value)){const d=r.value;c.forEach(f=>{const h=n[f];h&&d.removeEventListener(f.slice(2).toLowerCase(),h,["onFocus","onBlur"].includes(f))}),r.value=void 0}}),e({triggerRef:r}),(d,f)=>t.virtualTriggering?ve("v-if",!0):(B(),_e(w(zU),Lt({key:0},d.$attrs,{"aria-controls":o.value,"aria-describedby":s.value,"aria-expanded":l.value,"aria-haspopup":a.value}),{default:ce(()=>[we(d.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});const yk="focus-trap.focus-after-trapped",wk="focus-trap.focus-after-released",sme="focus-trap.focusout-prevented",ND={cancelable:!0,bubbles:!1},ame={cancelable:!0,bubbles:!1},BD="focusAfterTrapped",VD="focusAfterReleased",UU=Symbol("elFocusTrap"),_R=H(),BC=H(0),CR=H(0);let N0=0;const WU=t=>{const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0||i===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e},FD=(t,e)=>{for(const n of t)if(!lme(n,e))return n},lme=(t,e)=>{if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1},ume=t=>{const e=WU(t),n=FD(e,t),i=FD(e.reverse(),t);return[n,i]},cme=t=>t instanceof HTMLInputElement&&"select"in t,Yu=(t,e)=>{if(t){const n=document.activeElement;Zb(t,{preventScroll:!0}),CR.value=window.performance.now(),t!==n&&cme(t)&&e&&t.select()}};function $D(t,e){const n=[...t],i=t.indexOf(e);return i!==-1&&n.splice(i,1),n}const dme=()=>{let t=[];return{push:i=>{const r=t[0];r&&i!==r&&r.pause(),t=$D(t,i),t.unshift(i)},remove:i=>{var r,o;t=$D(t,i),(o=(r=t[0])==null?void 0:r.resume)==null||o.call(r)}}},fme=(t,e=!1)=>{const n=document.activeElement;for(const i of t)if(Yu(i,e),document.activeElement!==n)return},zD=dme(),hme=()=>BC.value>CR.value,B0=()=>{_R.value="pointer",BC.value=window.performance.now()},HD=()=>{_R.value="keyboard",BC.value=window.performance.now()},mme=()=>(Pt(()=>{N0===0&&(document.addEventListener("mousedown",B0),document.addEventListener("touchstart",B0),document.addEventListener("keydown",HD)),N0++}),Sn(()=>{N0--,N0<=0&&(document.removeEventListener("mousedown",B0),document.removeEventListener("touchstart",B0),document.removeEventListener("keydown",HD))}),{focusReason:_R,lastUserFocusTimestamp:BC,lastAutomatedFocusTimestamp:CR}),V0=t=>new CustomEvent(sme,{...ame,detail:t}),ji=(t,e,{checkForDefaultPrevented:n=!0}={})=>r=>{const o=t?.(r);if(n===!1||!o)return e?.(r)},UD=t=>e=>e.pointerType==="mouse"?t(e):void 0,Bn=t=>{if(t.code&&t.code!=="Unidentified")return t.code;const e=qU(t);return e?Object.values(Me).includes(e)?e:e===" "?Me.space:"":""},qU=t=>{let e=t.key&&t.key!=="Unidentified"?t.key:"";if(!e&&t.type==="keyup"&&_he()){const n=t.target;e=n.value.charAt(n.selectionStart-1)}return e};let Oh=[];const WD=t=>{Bn(t)===Me.esc&&Oh.forEach(n=>n(t))},gme=t=>{Pt(()=>{Oh.length===0&&document.addEventListener("keydown",WD),Zt&&Oh.push(t)}),Sn(()=>{Oh=Oh.filter(e=>e!==t),Oh.length===0&&Zt&&document.removeEventListener("keydown",WD)})};var pme=le({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[BD,VD,"focusin","focusout","focusout-prevented","release-requested"],setup(t,{emit:e}){const n=H();let i,r;const{focusReason:o}=mme();gme(m=>{t.trapped&&!s.paused&&e("release-requested",m)});const s={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},a=m=>{if(!t.loop&&!t.trapped||s.paused)return;const{altKey:g,ctrlKey:v,metaKey:p,currentTarget:b,shiftKey:y}=m,{loop:_}=t,S=Bn(m)===Me.tab&&!g&&!v&&!p,k=document.activeElement;if(S&&k){const T=b,[E,x]=ume(T);if(E&&x){if(!y&&k===x){const A=V0({focusReason:o.value});e("focusout-prevented",A),A.defaultPrevented||(m.preventDefault(),_&&Yu(E,!0))}else if(y&&[E,T].includes(k)){const A=V0({focusReason:o.value});e("focusout-prevented",A),A.defaultPrevented||(m.preventDefault(),_&&Yu(x,!0))}}else if(k===T){const A=V0({focusReason:o.value});e("focusout-prevented",A),A.defaultPrevented||m.preventDefault()}}};qt(UU,{focusTrapRef:n,onKeydown:a}),Se(()=>t.focusTrapEl,m=>{m&&(n.value=m)},{immediate:!0}),Se([n],([m],[g])=>{m&&(m.addEventListener("keydown",a),m.addEventListener("focusin",c),m.addEventListener("focusout",d)),g&&(g.removeEventListener("keydown",a),g.removeEventListener("focusin",c),g.removeEventListener("focusout",d))});const l=m=>{e(BD,m)},u=m=>e(VD,m),c=m=>{const g=w(n);if(!g)return;const v=m.target,p=m.relatedTarget,b=v&&g.contains(v);t.trapped||p&&g.contains(p)||(i=p),b&&e("focusin",m),!s.paused&&t.trapped&&(b?r=v:Yu(r,!0))},d=m=>{const g=w(n);if(!(s.paused||!g))if(t.trapped){const v=m.relatedTarget;!ir(v)&&!g.contains(v)&&setTimeout(()=>{if(!s.paused&&t.trapped){const p=V0({focusReason:o.value});e("focusout-prevented",p),p.defaultPrevented||Yu(r,!0)}},0)}else{const v=m.target;v&&g.contains(v)||e("focusout",m)}};async function f(){await Ye();const m=w(n);if(m){zD.push(s);const g=m.contains(document.activeElement)?i:document.activeElement;if(i=g,!m.contains(g)){const p=new Event(yk,ND);m.addEventListener(yk,l),m.dispatchEvent(p),p.defaultPrevented||Ye(()=>{let b=t.focusStartEl;ot(b)||(Yu(b),document.activeElement!==b&&(b="first")),b==="first"&&fme(WU(m),!0),(document.activeElement===g||b==="container")&&Yu(m)})}}}function h(){const m=w(n);if(m){m.removeEventListener(yk,l);const g=new CustomEvent(wk,{...ND,detail:{focusReason:o.value}});m.addEventListener(wk,u),m.dispatchEvent(g),!g.defaultPrevented&&(o.value=="keyboard"||!hme()||m.contains(document.activeElement))&&Yu(i??document.body),m.removeEventListener(wk,u),zD.remove(s),i=null,r=null}}return Pt(()=>{t.trapped&&f(),Se(()=>t.trapped,m=>{m?f():h()})}),Sn(()=>{t.trapped&&h(),n.value&&(n.value.removeEventListener("keydown",a),n.value.removeEventListener("focusin",c),n.value.removeEventListener("focusout",d),n.value=void 0),i=null,r=null}),{onKeydown:a}}}),Tr=(t,e)=>{const n=t.__vccOpts||t;for(const[i,r]of e)n[i]=r;return n};function vme(t,e,n,i,r,o){return we(t.$slots,"default",{handleKeydown:t.onKeydown})}var VC=Tr(pme,[["render",vme]]);const bme=(t,e)=>{const n=H(!1),i=H(),r=()=>{e("focus")},o=u=>{var c;((c=u.detail)==null?void 0:c.focusReason)!=="pointer"&&(i.value="first",e("blur"))},s=u=>{t.visible&&!n.value&&(u.target&&(i.value=u.target),n.value=!0)},a=u=>{t.trapping||(u.detail.focusReason==="pointer"&&u.preventDefault(),n.value=!1)},l=()=>{n.value=!1,e("close")};return Sn(()=>{i.value=void 0}),{focusStartRef:i,trapped:n,onFocusAfterReleased:o,onFocusAfterTrapped:r,onFocusInTrap:s,onFocusoutPrevented:a,onReleaseRequested:l}},yme=(t,e=[])=>{const{placement:n,strategy:i,popperOptions:r}=t,o={placement:n,strategy:i,...r,modifiers:[..._me(t),...e]};return Cme(o,r?.modifiers),o},wme=t=>{if(Zt)return Yi(t)};function _me(t){const{offset:e,gpuAcceleration:n,fallbackPlacements:i}=t;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:0,bottom:0,left:0,right:0}}},{name:"flip",options:{padding:5,fallbackPlacements:i}},{name:"computeStyles",options:{gpuAcceleration:n}}]}function Cme(t,e){e&&(t.modifiers=[...t.modifiers,...e??[]])}const Sme=(t,e,n={})=>{const i={name:"updateState",enabled:!0,phase:"write",fn:({state:l})=>{const u=kme(l);Object.assign(s.value,u)},requires:["computeStyles"]},r=M(()=>{const{onFirstUpdate:l,placement:u,strategy:c,modifiers:d}=w(n);return{onFirstUpdate:l,placement:u||"bottom",strategy:c||"absolute",modifiers:[...d||[],i,{name:"applyStyles",enabled:!1}]}}),o=bi(),s=H({styles:{popper:{position:w(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=()=>{o.value&&(o.value.destroy(),o.value=void 0)};return Se(r,l=>{const u=w(o);u&&u.setOptions(l)},{deep:!0}),Se([t,e],([l,u])=>{a(),!(!l||!u)&&(o.value=fhe(l,u,w(r)))}),Sn(()=>{a()}),{state:M(()=>{var l;return{...((l=w(o))==null?void 0:l.state)||{}}}),styles:M(()=>w(s).styles),attributes:M(()=>w(s).attributes),update:()=>{var l;return(l=w(o))==null?void 0:l.update()},forceUpdate:()=>{var l;return(l=w(o))==null?void 0:l.forceUpdate()},instanceRef:M(()=>w(o))}};function kme(t){const e=Object.keys(t.elements),n=Lv(e.map(r=>[r,t.styles[r]||{}])),i=Lv(e.map(r=>[r,t.attributes[r]]));return{styles:n,attributes:i}}const Tme=0,Eme=t=>{const{popperInstanceRef:e,contentRef:n,triggerRef:i,role:r}=Ne(wR,void 0),o=H(),s=M(()=>t.arrowOffset),a=M(()=>({name:"eventListeners",enabled:!!t.visible})),l=M(()=>{var p;const b=w(o),y=(p=w(s))!=null?p:Tme;return{name:"arrow",enabled:!Zue(b),options:{element:b,padding:y}}}),u=M(()=>({onFirstUpdate:()=>{m()},...yme(t,[w(l),w(a)])})),c=M(()=>wme(t.referenceEl)||w(i)),{attributes:d,state:f,styles:h,update:m,forceUpdate:g,instanceRef:v}=Sme(c,n,u);return Se(v,p=>e.value=p,{flush:"sync"}),Pt(()=>{Se(()=>{var p,b;return(b=(p=w(c))==null?void 0:p.getBoundingClientRect)==null?void 0:b.call(p)},()=>{m()})}),Sn(()=>{e.value=void 0}),{attributes:d,arrowRef:o,contentRef:n,instanceRef:v,state:f,styles:h,role:r,forceUpdate:g,update:m}},xme=(t,{attributes:e,styles:n,role:i})=>{const{nextZIndex:r}=RC(),o=De("popper"),s=M(()=>w(e).popper),a=H(St(t.zIndex)?t.zIndex:r()),l=M(()=>[o.b(),o.is("pure",t.pure),o.is(t.effect),t.popperClass]),u=M(()=>[{zIndex:w(a)},w(n).popper,t.popperStyle||{}]),c=M(()=>i.value==="dialog"?"false":void 0),d=M(()=>w(n).arrow||{});return{ariaModal:c,arrowStyle:d,contentAttrs:s,contentClass:l,contentStyle:u,contentZIndex:a,updateZIndex:()=>{a.value=St(t.zIndex)?t.zIndex:r()}}};var Ame=le({name:"ElPopperContent",__name:"content",props:PU,emits:phe,setup(t,{expose:e,emit:n}){const i=n,r=t,{focusStartRef:o,trapped:s,onFocusAfterReleased:a,onFocusAfterTrapped:l,onFocusInTrap:u,onFocusoutPrevented:c,onReleaseRequested:d}=bme(r,i),{attributes:f,arrowRef:h,contentRef:m,styles:g,instanceRef:v,role:p,update:b}=Eme(r),{ariaModal:y,arrowStyle:_,contentAttrs:C,contentClass:S,contentStyle:k,updateZIndex:T}=xme(r,{styles:g,attributes:f,role:p}),E=Ne(yf,void 0);qt(FU,{arrowStyle:_,arrowRef:h}),E&&qt(yf,{...E,addInputId:tn,removeInputId:tn});let x;const P=(I=!0)=>{b(),I&&T()},A=()=>{P(!1),r.visible&&r.focusOnShow?s.value=!0:r.visible===!1&&(s.value=!1)};return Pt(()=>{Se(()=>r.triggerTargetEl,(I,D)=>{x?.(),x=void 0;const q=w(I||m.value),z=w(D||m.value);Qo(q)&&(x=Se([p,()=>r.ariaLabel,y,()=>r.id],R=>{["role","aria-label","aria-modal","id"].forEach((O,N)=>{ir(R[N])?q.removeAttribute(O):q.setAttribute(O,R[N])})},{immediate:!0})),z!==q&&Qo(z)&&["role","aria-label","aria-modal","id"].forEach(R=>{z.removeAttribute(R)})},{immediate:!0}),Se(()=>r.visible,A,{immediate:!0})}),Sn(()=>{x?.(),x=void 0,m.value=void 0}),e({popperContentRef:m,popperInstanceRef:v,updatePopper:P,contentStyle:k}),(I,D)=>(B(),Q("div",Lt({ref_key:"contentRef",ref:m},w(C),{style:w(k),class:w(S),tabindex:"-1",onMouseenter:D[0]||(D[0]=q=>I.$emit("mouseenter",q)),onMouseleave:D[1]||(D[1]=q=>I.$emit("mouseleave",q))}),[L(w(VC),{loop:t.loop,trapped:w(s),"trap-on-focus-in":!0,"focus-trap-el":w(m),"focus-start-el":w(o),onFocusAfterTrapped:w(l),onFocusAfterReleased:w(a),onFocusin:w(u),onFocusoutPrevented:w(c),onReleaseRequested:w(d)},{default:ce(()=>[we(I.$slots,"default")]),_:3},8,["loop","trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16))}});const Pme=sn(eme),SR=Symbol("elTooltip"),f2=(t,e)=>Pe(t)?t.includes(e):t===e,nh=(t,e,n)=>i=>{f2(w(t),e)&&n(i)};var Ime=le({name:"ElTooltipTrigger",__name:"trigger",props:vc,setup(t,{expose:e}){const n=t,i=De("tooltip"),{controlled:r,id:o,open:s,onOpen:a,onClose:l,onToggle:u}=Ne(SR,void 0),c=H(null),d=()=>{if(w(r)||n.disabled)return!0},f=An(n,"trigger"),h=ji(d,nh(f,"hover",_=>{a(_),n.focusOnTarget&&_.target&&Ye(()=>{Zb(_.target,{preventScroll:!0})})})),m=ji(d,nh(f,"hover",l)),g=ji(d,nh(f,"click",_=>{_.button===0&&u(_)})),v=ji(d,nh(f,"focus",a)),p=ji(d,nh(f,"focus",l)),b=ji(d,nh(f,"contextmenu",_=>{_.preventDefault(),u(_)})),y=ji(d,_=>{const C=Bn(_);n.triggerKeys.includes(C)&&(_.preventDefault(),u(_))});return e({triggerRef:c}),(_,C)=>(B(),_e(w(ome),{id:w(o),"virtual-ref":t.virtualRef,open:w(s),"virtual-triggering":t.virtualTriggering,class:$(w(i).e("trigger")),onBlur:w(p),onClick:w(g),onContextmenu:w(b),onFocus:w(v),onMouseenter:w(h),onMouseleave:w(m),onKeydown:w(y)},{default:ce(()=>[we(_.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});const jU=()=>{const t=QI(),e=LU(),n=M(()=>`${t.value}-popper-container-${e.prefix}`),i=M(()=>`#${n.value}`);return{id:n,selector:i}},Rme=t=>{const e=document.createElement("div");return e.id=t,document.body.appendChild(e),e},Mme=()=>{const{id:t,selector:e}=jU();return yC(()=>{Zt&&(document.body.querySelector(e.value)||Rme(t.value))}),{id:t,selector:e}},qD=t=>[...new Set(t)],Mg=t=>Pe(t)?t[0]:t,Br=t=>!t&&t!==0?[]:Pe(t)?t:[t];var Ome=le({name:"ElTooltipContent",inheritAttrs:!1,__name:"content",props:Mn,setup(t,{expose:e}){const n=t,{selector:i}=jU(),r=De("tooltip"),o=H(),s=XH(()=>{var O;return(O=o.value)==null?void 0:O.popperContentRef});let a;const{controlled:l,id:u,open:c,trigger:d,onClose:f,onOpen:h,onShow:m,onHide:g,onBeforeShow:v,onBeforeHide:p}=Ne(SR,void 0),b=M(()=>n.transition||`${r.namespace.value}-fade-in-linear`),y=M(()=>n.persistent);Sn(()=>{a?.()});const _=M(()=>w(y)?!0:w(c)),C=M(()=>n.disabled?!1:w(c)),S=M(()=>n.appendTo||i.value),k=M(()=>{var O;return(O=n.style)!=null?O:{}}),T=H(!0),E=()=>{g(),R()&&Zb(document.body,{preventScroll:!0}),T.value=!0},x=()=>{if(w(l))return!0},P=ji(x,()=>{n.enterable&&f2(w(d),"hover")&&h()}),A=ji(x,()=>{f2(w(d),"hover")&&f()}),I=()=>{var O,N;(N=(O=o.value)==null?void 0:O.updatePopper)==null||N.call(O),v?.()},D=()=>{p?.()},q=()=>{m()},z=()=>{n.virtualTriggering||f()},R=O=>{var N;const F=(N=o.value)==null?void 0:N.popperContentRef,j=O?.relatedTarget||document.activeElement;return F?.contains(j)};return Se(()=>w(c),O=>{O?(T.value=!1,a=QH(s,()=>{if(w(l))return;Br(w(d)).every(F=>F!=="hover"&&F!=="focus")&&f()},{detectIframe:!0})):a?.()},{flush:"post"}),Se(()=>n.content,()=>{var O,N;(N=(O=o.value)==null?void 0:O.updatePopper)==null||N.call(O)}),e({contentRef:o,isFocusInsideContent:R}),(O,N)=>(B(),_e(w(rR),{disabled:!t.teleported,to:S.value},{default:ce(()=>[_.value||!T.value?(B(),_e(ya,{key:0,name:b.value,appear:!y.value,onAfterLeave:E,onBeforeEnter:I,onAfterEnter:q,onBeforeLeave:D,persisted:""},{default:ce(()=>[Vt(L(w(Ame),Lt({id:w(u),ref_key:"contentRef",ref:o},O.$attrs,{"aria-label":t.ariaLabel,"aria-hidden":T.value,"boundaries-padding":t.boundariesPadding,"fallback-placements":t.fallbackPlacements,"gpu-acceleration":t.gpuAcceleration,offset:t.offset,placement:t.placement,"popper-options":t.popperOptions,"arrow-offset":t.arrowOffset,strategy:t.strategy,effect:t.effect,enterable:t.enterable,pure:t.pure,"popper-class":t.popperClass,"popper-style":[t.popperStyle,k.value],"reference-el":t.referenceEl,"trigger-target-el":t.triggerTargetEl,visible:C.value,"z-index":t.zIndex,loop:t.loop,onMouseenter:w(P),onMouseleave:w(A),onBlur:z,onClose:w(f)}),{default:ce(()=>[we(O.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","arrow-offset","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","loop","onMouseenter","onMouseleave","onClose"]),[[On,C.value]])]),_:3},8,["name","appear"])):ve("v-if",!0)]),_:3},8,["disabled","to"]))}});const Lme=["innerHTML"],Dme={key:1};var Nme=le({name:"ElTooltip",__name:"tooltip",props:Zhe,emits:Qhe,setup(t,{expose:e,emit:n}){const i=t,r=n;Mme();const o=De("tooltip"),s=as(),a=H(),l=H(),u=()=>{var _;const C=w(a);C&&((_=C.popperInstanceRef)==null||_.update())},c=H(!1),d=H(),{show:f,hide:h,hasUpdateHandler:m}=Jhe({indicator:c,toggleReason:d}),{onOpen:g,onClose:v}=bhe({showAfter:An(i,"showAfter"),hideAfter:An(i,"hideAfter"),autoClose:An(i,"autoClose"),open:f,close:h}),p=M(()=>vi(i.visible)&&!m.value),b=M(()=>[o.b(),i.popperClass]);qt(SR,{controlled:p,id:s,open:gf(c),trigger:An(i,"trigger"),onOpen:g,onClose:v,onToggle:_=>{w(c)?v(_):g(_)},onShow:()=>{r("show",d.value)},onHide:()=>{r("hide",d.value)},onBeforeShow:()=>{r("before-show",d.value)},onBeforeHide:()=>{r("before-hide",d.value)},updatePopper:u}),Se(()=>i.disabled,_=>{_&&c.value&&(c.value=!1)});const y=_=>{var C;return(C=l.value)==null?void 0:C.isFocusInsideContent(_)};return mz(()=>c.value&&h()),Sn(()=>{d.value=void 0}),e({popperRef:a,contentRef:l,isFocusInsideContent:y,updatePopper:u,onOpen:g,onClose:v,hide:h}),(_,C)=>(B(),_e(w(Pme),{ref_key:"popperRef",ref:a,role:t.role},{default:ce(()=>[L(Ime,{disabled:t.disabled,trigger:t.trigger,"trigger-keys":t.triggerKeys,"virtual-ref":t.virtualRef,"virtual-triggering":t.virtualTriggering,"focus-on-target":t.focusOnTarget},{default:ce(()=>[_.$slots.default?we(_.$slots,"default",{key:0}):ve("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering","focus-on-target"]),L(Ome,{ref_key:"contentRef",ref:l,"aria-label":t.ariaLabel,"boundaries-padding":t.boundariesPadding,content:t.content,disabled:t.disabled,effect:t.effect,enterable:t.enterable,"fallback-placements":t.fallbackPlacements,"hide-after":t.hideAfter,"gpu-acceleration":t.gpuAcceleration,offset:t.offset,persistent:t.persistent,"popper-class":b.value,"popper-style":t.popperStyle,placement:t.placement,"popper-options":t.popperOptions,"arrow-offset":t.arrowOffset,pure:t.pure,"raw-content":t.rawContent,"reference-el":t.referenceEl,"trigger-target-el":t.triggerTargetEl,"show-after":t.showAfter,strategy:t.strategy,teleported:t.teleported,transition:t.transition,"virtual-triggering":t.virtualTriggering,"z-index":t.zIndex,"append-to":t.appendTo,loop:t.loop},{default:ce(()=>[we(_.$slots,"content",{},()=>[t.rawContent?(B(),Q("span",{key:0,innerHTML:t.content},null,8,Lme)):(B(),Q("span",Dme,We(t.content),1))]),t.showArrow?(B(),_e(w(tme),{key:0})):ve("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","arrow-offset","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to","loop"])]),_:3},8,["role"]))}});const Lo=sn(Nme),Bme=qe({size:{type:[Number,String],values:yl,validator:t=>St(t)},shape:{type:String,values:["circle","square"]},icon:{type:ri},src:{type:String,default:""},alt:String,srcSet:String,fit:{type:me(String),default:"cover"}}),Vme={error:t=>t instanceof Event},KU=Symbol("avatarGroupContextKey"),Fme=["src","alt","srcset"];var GU=le({name:"ElAvatar",__name:"avatar",props:Bme,emits:Vme,setup(t,{emit:e}){const n=t,i=e,r=Ne(KU,void 0),o=De("avatar"),s=H(!1),a=M(()=>{var h;return(h=n.size)!=null?h:r?.size}),l=M(()=>{var h,m;return(m=(h=n.shape)!=null?h:r?.shape)!=null?m:"circle"}),u=M(()=>{const{icon:h}=n,m=[o.b()];return ot(a.value)&&m.push(o.m(a.value)),h&&m.push(o.m("icon")),l.value&&m.push(o.m(l.value)),m}),c=M(()=>St(a.value)?o.cssVarBlock({size:zr(a.value)}):void 0),d=M(()=>({objectFit:n.fit}));Se(()=>[n.src,n.srcSet],()=>s.value=!1);function f(h){s.value=!0,i("error",h)}return(h,m)=>(B(),Q("span",{class:$(u.value),style:mt(c.value)},[(t.src||t.srcSet)&&!s.value?(B(),Q("img",{key:0,src:t.src,alt:t.alt,srcset:t.srcSet,style:mt(d.value),onError:f},null,44,Fme)):t.icon?(B(),_e(w(He),{key:1},{default:ce(()=>[(B(),_e(Gt(t.icon)))]),_:1})):we(h.$slots,"default",{key:2})],6))}});const $me={size:{type:me([Number,String]),values:yl,validator:t=>St(t)},shape:{type:me(String),values:["circle","square"]},collapseAvatars:Boolean,collapseAvatarsTooltip:Boolean,maxCollapseAvatars:{type:Number,default:1},effect:{type:me(String),default:"light"},placement:{type:me(String),values:xu,default:"top"},popperClass:Mn.popperClass,popperStyle:Mn.popperStyle,collapseClass:String,collapseStyle:{type:me([String,Array,Object])}};var YU=le({name:"ElAvatarGroup",props:$me,setup(t,{slots:e}){const n=De("avatar-group");return qt(KU,on({size:An(t,"size"),shape:An(t,"shape")})),()=>{var i,r;const o=cc((r=(i=e.default)==null?void 0:i.call(e))!=null?r:[]);let s=o;if(t.collapseAvatars&&o.length>t.maxCollapseAvatars){s=o.slice(0,t.maxCollapseAvatars);const l=o.slice(t.maxCollapseAvatars);s.push(L(Lo,{popperClass:t.popperClass,popperStyle:t.popperStyle,placement:t.placement,effect:t.effect,disabled:!t.collapseAvatarsTooltip},{default:()=>L(GU,{size:t.size,shape:t.shape,class:t.collapseClass,style:t.collapseStyle},{default:()=>[dt("+ "),l.length]}),content:()=>L("div",{class:n.e("collapse-avatars")},[l.map((u,c)=>{var d;return yi(u)?al(u,{key:(d=u.key)!=null?d:c}):u})])}))}return L("div",{class:n.b()},[s])}}});const zme=sn(GU,{AvatarGroup:YU});Zi(YU);const Hme=["default","primary","success","warning","info","danger","text",""],Ume=["button","submit","reset"],h2=qe({size:$r,disabled:{type:Boolean,default:void 0},type:{type:String,values:Hme,default:""},icon:{type:ri},nativeType:{type:String,values:Ume,default:"button"},loading:Boolean,loadingIcon:{type:ri,default:()=>xc},plain:{type:Boolean,default:void 0},text:{type:Boolean,default:void 0},link:Boolean,bg:Boolean,autofocus:Boolean,round:{type:Boolean,default:void 0},circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:me([String,Object]),default:"button"}}),Wme={click:t=>t instanceof MouseEvent},XU=Symbol("buttonGroupContextKey"),of=({from:t,replacement:e,scope:n,version:i,ref:r,type:o="API"},s)=>{Se(()=>w(s),a=>{},{immediate:!0})},qme=(t,e)=>{of({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},M(()=>t.type==="text"));const n=Ne(XU,void 0),i=Yb("button"),{form:r}=lo(),o=fr(M(()=>n?.size)),s=Oi(),a=H(),l=$o(),u=M(()=>{var p;return t.type||n?.type||((p=i.value)==null?void 0:p.type)||""}),c=M(()=>{var p,b,y;return(y=(b=t.autoInsertSpace)!=null?b:(p=i.value)==null?void 0:p.autoInsertSpace)!=null?y:!1}),d=M(()=>{var p,b,y;return(y=(b=t.plain)!=null?b:(p=i.value)==null?void 0:p.plain)!=null?y:!1}),f=M(()=>{var p,b,y;return(y=(b=t.round)!=null?b:(p=i.value)==null?void 0:p.round)!=null?y:!1}),h=M(()=>{var p,b,y;return(y=(b=t.text)!=null?b:(p=i.value)==null?void 0:p.text)!=null?y:!1}),m=M(()=>t.tag==="button"?{ariaDisabled:s.value||t.loading,disabled:s.value||t.loading,autofocus:t.autofocus,type:t.nativeType}:{}),g=M(()=>{var p;const b=(p=l.default)==null?void 0:p.call(l);if(c.value&&b?.length===1){const y=b[0];if(y?.type===Mf){const _=y.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(_.trim())}}return!1});return{_disabled:s,_size:o,_type:u,_ref:a,_props:m,_plain:d,_round:f,_text:h,shouldAddSpace:g,handleClick:p=>{if(s.value||t.loading){p.stopPropagation();return}t.nativeType==="reset"&&r?.resetFields(),e("click",p)}}};function Cr(t,e){jme(t)&&(t="100%");var n=Kme(t);return t=e===360?t:Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:(e===360?t=(t<0?t%e+e:t%e)/parseFloat(String(e)):t=t%e/parseFloat(String(e)),t)}function F0(t){return Math.min(1,Math.max(0,t))}function jme(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function Kme(t){return typeof t=="string"&&t.indexOf("%")!==-1}function JU(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function $0(t){return t<=1?"".concat(Number(t)*100,"%"):t}function Ud(t){return t.length===1?"0"+t:String(t)}function Gme(t,e,n){return{r:Cr(t,255)*255,g:Cr(e,255)*255,b:Cr(n,255)*255}}function jD(t,e,n){t=Cr(t,255),e=Cr(e,255),n=Cr(n,255);var i=Math.max(t,e,n),r=Math.min(t,e,n),o=0,s=0,a=(i+r)/2;if(i===r)s=0,o=0;else{var l=i-r;switch(s=a>.5?l/(2-i-r):l/(i+r),i){case t:o=(e-n)/l+(e1&&(n-=1),n<1/6?t+(e-t)*(6*n):n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Yme(t,e,n){var i,r,o;if(t=Cr(t,360),e=Cr(e,100),n=Cr(n,100),e===0)r=n,o=n,i=n;else{var s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=_k(a,s,t+1/3),r=_k(a,s,t),o=_k(a,s,t-1/3)}return{r:i*255,g:r*255,b:o*255}}function KD(t,e,n){t=Cr(t,255),e=Cr(e,255),n=Cr(n,255);var i=Math.max(t,e,n),r=Math.min(t,e,n),o=0,s=i,a=i-r,l=i===0?0:a/i;if(i===r)o=0;else{switch(i){case t:o=(e-n)/a+(e>16,g:(t&65280)>>8,b:t&255}}var m2={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function ege(t){var e={r:0,g:0,b:0},n=1,i=null,r=null,o=null,s=!1,a=!1;return typeof t=="string"&&(t=ige(t)),typeof t=="object"&&(Al(t.r)&&Al(t.g)&&Al(t.b)?(e=Gme(t.r,t.g,t.b),s=!0,a=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Al(t.h)&&Al(t.s)&&Al(t.v)?(i=$0(t.s),r=$0(t.v),e=Xme(t.h,i,r),s=!0,a="hsv"):Al(t.h)&&Al(t.s)&&Al(t.l)&&(i=$0(t.s),o=$0(t.l),e=Yme(t.h,i,o),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(n=t.a)),n=JU(n),{ok:s,format:t.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}var tge="[-\\+]?\\d+%?",nge="[-\\+]?\\d*\\.\\d+%?",dc="(?:".concat(nge,")|(?:").concat(tge,")"),Ck="[\\s|\\(]+(".concat(dc,")[,|\\s]+(").concat(dc,")[,|\\s]+(").concat(dc,")\\s*\\)?"),Sk="[\\s|\\(]+(".concat(dc,")[,|\\s]+(").concat(dc,")[,|\\s]+(").concat(dc,")[,|\\s]+(").concat(dc,")\\s*\\)?"),Ws={CSS_UNIT:new RegExp(dc),rgb:new RegExp("rgb"+Ck),rgba:new RegExp("rgba"+Sk),hsl:new RegExp("hsl"+Ck),hsla:new RegExp("hsla"+Sk),hsv:new RegExp("hsv"+Ck),hsva:new RegExp("hsva"+Sk),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function ige(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(m2[t])t=m2[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=Ws.rgb.exec(t);return n?{r:n[1],g:n[2],b:n[3]}:(n=Ws.rgba.exec(t),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Ws.hsl.exec(t),n?{h:n[1],s:n[2],l:n[3]}:(n=Ws.hsla.exec(t),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Ws.hsv.exec(t),n?{h:n[1],s:n[2],v:n[3]}:(n=Ws.hsva.exec(t),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Ws.hex8.exec(t),n?{r:qo(n[1]),g:qo(n[2]),b:qo(n[3]),a:YD(n[4]),format:e?"name":"hex8"}:(n=Ws.hex6.exec(t),n?{r:qo(n[1]),g:qo(n[2]),b:qo(n[3]),format:e?"name":"hex"}:(n=Ws.hex4.exec(t),n?{r:qo(n[1]+n[1]),g:qo(n[2]+n[2]),b:qo(n[3]+n[3]),a:YD(n[4]+n[4]),format:e?"name":"hex8"}:(n=Ws.hex3.exec(t),n?{r:qo(n[1]+n[1]),g:qo(n[2]+n[2]),b:qo(n[3]+n[3]),format:e?"name":"hex"}:!1)))))))))}function Al(t){return!!Ws.CSS_UNIT.exec(String(t))}var Uh=(function(){function t(e,n){e===void 0&&(e=""),n===void 0&&(n={});var i;if(e instanceof t)return e;typeof e=="number"&&(e=Qme(e)),this.originalInput=e;var r=ege(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(i=n.format)!==null&&i!==void 0?i:r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},t.prototype.getLuminance=function(){var e=this.toRgb(),n,i,r,o=e.r/255,s=e.g/255,a=e.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),s<=.03928?i=s/12.92:i=Math.pow((s+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),.2126*n+.7152*i+.0722*r},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(e){return this.a=JU(e),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},t.prototype.toHsv=function(){var e=KD(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},t.prototype.toHsvString=function(){var e=KD(this.r,this.g,this.b),n=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(n,", ").concat(i,"%, ").concat(r,"%)"):"hsva(".concat(n,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var e=jD(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},t.prototype.toHslString=function(){var e=jD(this.r,this.g,this.b),n=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(n,", ").concat(i,"%, ").concat(r,"%)"):"hsla(".concat(n,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(e){return e===void 0&&(e=!1),GD(this.r,this.g,this.b,e)},t.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},t.prototype.toHex8=function(e){return e===void 0&&(e=!1),Jme(this.r,this.g,this.b,this.a,e)},t.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},t.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var e=Math.round(this.r),n=Math.round(this.g),i=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(n,", ").concat(i,")"):"rgba(".concat(e,", ").concat(n,", ").concat(i,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var e=function(n){return"".concat(Math.round(Cr(n,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var e=function(n){return Math.round(Cr(n,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+GD(this.r,this.g,this.b,!1),n=0,i=Object.entries(m2);n=0,o=!n&&r&&(e.startsWith("hex")||e==="name");return o?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l+=e/100,n.l=F0(n.l),new t(n)},t.prototype.brighten=function(e){e===void 0&&(e=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(e/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(e/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(e/100)))),new t(n)},t.prototype.darken=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l-=e/100,n.l=F0(n.l),new t(n)},t.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},t.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},t.prototype.desaturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s-=e/100,n.s=F0(n.s),new t(n)},t.prototype.saturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s+=e/100,n.s=F0(n.s),new t(n)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var n=this.toHsl(),i=(n.h+e)%360;return n.h=i<0?360+i:i,new t(n)},t.prototype.mix=function(e,n){n===void 0&&(n=50);var i=this.toRgb(),r=new t(e).toRgb(),o=n/100,s={r:(r.r-i.r)*o+i.r,g:(r.g-i.g)*o+i.g,b:(r.b-i.b)*o+i.b,a:(r.a-i.a)*o+i.a};return new t(s)},t.prototype.analogous=function(e,n){e===void 0&&(e=6),n===void 0&&(n=30);var i=this.toHsl(),r=360/n,o=[this];for(i.h=(i.h-(r*e>>1)+720)%360;--e;)i.h=(i.h+r)%360,o.push(new t(i));return o},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var n=this.toHsv(),i=n.h,r=n.s,o=n.v,s=[],a=1/e;e--;)s.push(new t({h:i,s:r,v:o})),o=(o+a)%1;return s},t.prototype.splitcomplement=function(){var e=this.toHsl(),n=e.h;return[this,new t({h:(n+72)%360,s:e.s,l:e.l}),new t({h:(n+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var n=this.toRgb(),i=new t(e).toRgb(),r=n.a+i.a*(1-n.a);return new t({r:(n.r*n.a+i.r*i.a*(1-n.a))/r,g:(n.g*n.a+i.g*i.a*(1-n.a))/r,b:(n.b*n.a+i.b*i.a*(1-n.a))/r,a:r})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var n=this.toHsl(),i=n.h,r=[this],o=360/e,s=1;s{let i={},r=t.color;if(r){const o=r.match(/var\((.*?)\)/);o&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(o[1]));const s=new Uh(r),a=t.dark?s.tint(20).toString():Mu(s,20);if(t.plain)i=n.cssVarBlock({"bg-color":t.dark?Mu(s,90):s.tint(90).toString(),"text-color":r,"border-color":t.dark?Mu(s,50):s.tint(50).toString(),"hover-text-color":`var(${n.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":a,"active-text-color":`var(${n.cssVarName("color-white")})`,"active-border-color":a}),e.value&&(i[n.cssVarBlockName("disabled-bg-color")]=t.dark?Mu(s,90):s.tint(90).toString(),i[n.cssVarBlockName("disabled-text-color")]=t.dark?Mu(s,50):s.tint(50).toString(),i[n.cssVarBlockName("disabled-border-color")]=t.dark?Mu(s,80):s.tint(80).toString());else{const l=t.dark?Mu(s,30):s.tint(30).toString(),u=s.isDark()?`var(${n.cssVarName("color-white")})`:`var(${n.cssVarName("color-black")})`;if(i=n.cssVarBlock({"bg-color":r,"text-color":u,"border-color":r,"hover-bg-color":l,"hover-text-color":u,"hover-border-color":l,"active-bg-color":a,"active-border-color":a}),e.value){const c=t.dark?Mu(s,50):s.tint(50).toString();i[n.cssVarBlockName("disabled-bg-color")]=c,i[n.cssVarBlockName("disabled-text-color")]=t.dark?"rgba(255, 255, 255, 0.5)":`var(${n.cssVarName("color-white")})`,i[n.cssVarBlockName("disabled-border-color")]=c}}}return i})}var oge=le({name:"ElButton",__name:"button",props:h2,emits:Wme,setup(t,{expose:e,emit:n}){const i=t,r=n,o=rge(i),s=De("button"),{_ref:a,_size:l,_type:u,_disabled:c,_props:d,_plain:f,_round:h,_text:m,shouldAddSpace:g,handleClick:v}=qme(i,r),p=M(()=>[s.b(),s.m(u.value),s.m(l.value),s.is("disabled",c.value),s.is("loading",i.loading),s.is("plain",f.value),s.is("round",h.value),s.is("circle",i.circle),s.is("text",m.value),s.is("link",i.link),s.is("has-bg",i.bg)]);return e({ref:a,size:l,type:u,disabled:c,shouldAddSpace:g}),(b,y)=>(B(),_e(Gt(t.tag),Lt({ref_key:"_ref",ref:a},w(d),{class:p.value,style:w(o),onClick:w(v)}),{default:ce(()=>[t.loading?(B(),Q(rt,{key:0},[b.$slots.loading?we(b.$slots,"loading",{key:0}):(B(),_e(w(He),{key:1,class:$(w(s).is("loading"))},{default:ce(()=>[(B(),_e(Gt(t.loadingIcon)))]),_:1},8,["class"]))],64)):t.icon||b.$slots.icon?(B(),_e(w(He),{key:1},{default:ce(()=>[t.icon?(B(),_e(Gt(t.icon),{key:0})):we(b.$slots,"icon",{key:1})]),_:3})):ve("v-if",!0),b.$slots.default?(B(),Q("span",{key:2,class:$({[w(s).em("text","expand")]:w(g)})},[we(b.$slots,"default")],2)):ve("v-if",!0)]),_:3},16,["class","style","onClick"]))}});const sge={size:h2.size,type:h2.type,direction:{type:me(String),values:["horizontal","vertical"],default:"horizontal"}};var ZU=le({name:"ElButtonGroup",__name:"button-group",props:sge,setup(t){const e=t;qt(XU,on({size:An(e,"size"),type:An(e,"type")}));const n=De("button");return(i,r)=>(B(),Q("div",{class:$([w(n).b("group"),w(n).bm("group",e.direction)])},[we(i.$slots,"default")],2))}});const Hi=sn(oge,{ButtonGroup:ZU});Zi(ZU);function wl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ew={exports:{}},age=Ew.exports,XD;function lge(){return XD||(XD=1,(function(t,e){(function(n,i){t.exports=i()})(age,(function(){var n=1e3,i=6e4,r=36e5,o="millisecond",s="second",a="minute",l="hour",u="day",c="week",d="month",f="quarter",h="year",m="date",g="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(D){var q=["th","st","nd","rd"],z=D%100;return"["+D+(q[(z-20)%10]||q[z]||q[0])+"]"}},y=function(D,q,z){var R=String(D);return!R||R.length>=q?D:""+Array(q+1-R.length).join(z)+D},_={s:y,z:function(D){var q=-D.utcOffset(),z=Math.abs(q),R=Math.floor(z/60),O=z%60;return(q<=0?"+":"-")+y(R,2,"0")+":"+y(O,2,"0")},m:function D(q,z){if(q.date()1)return D(F[0])}else{var j=q.name;S[j]=q,O=j}return!R&&O&&(C=O),O||!R&&C},x=function(D,q){if(T(D))return D.clone();var z=typeof q=="object"?q:{};return z.date=D,z.args=arguments,new A(z)},P=_;P.l=E,P.i=T,P.w=function(D,q){return x(D,{locale:q.$L,utc:q.$u,x:q.$x,$offset:q.$offset})};var A=(function(){function D(z){this.$L=E(z.locale,null,!0),this.parse(z),this.$x=this.$x||z.x||{},this[k]=!0}var q=D.prototype;return q.parse=function(z){this.$d=(function(R){var O=R.date,N=R.utc;if(O===null)return new Date(NaN);if(P.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var F=O.match(v);if(F){var j=F[2]-1||0,U=(F[7]||"0").substring(0,3);return N?new Date(Date.UTC(F[1],j,F[3]||1,F[4]||0,F[5]||0,F[6]||0,U)):new Date(F[1],j,F[3]||1,F[4]||0,F[5]||0,F[6]||0,U)}}return new Date(O)})(z),this.init()},q.init=function(){var z=this.$d;this.$y=z.getFullYear(),this.$M=z.getMonth(),this.$D=z.getDate(),this.$W=z.getDay(),this.$H=z.getHours(),this.$m=z.getMinutes(),this.$s=z.getSeconds(),this.$ms=z.getMilliseconds()},q.$utils=function(){return P},q.isValid=function(){return this.$d.toString()!==g},q.isSame=function(z,R){var O=x(z);return this.startOf(R)<=O&&O<=this.endOf(R)},q.isAfter=function(z,R){return x(z)[t>0?t-1:void 0,t,tArray.from(Array.from({length:t}).keys()),eW=t=>t.replace(/\W?m{1,2}|\W?ZZ/g,"").replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi,"").trim(),tW=t=>t.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?Y{2,4}/g,"").trim(),JD=function(t,e){const n=__(t),i=__(e);return n&&i?t.getTime()===e.getTime():!n&&!i?t===e:!1},nW=function(t,e){const n=Pe(t),i=Pe(e);return n&&i?t.length!==e.length?!1:t.every((r,o)=>JD(r,e[o])):!n&&!i?JD(t,e):!1},ZD=function(t,e,n){const i=xm(e)||e==="x"?ft(t).locale(n):ft(t,e).locale(n);return i.isValid()?i:void 0},QD=function(t,e,n){return xm(e)?t:e==="x"?+t:ft(t).locale(n).format(e)},Tk=(t,e)=>{var n;const i=[],r=e?.();for(let o=0;oPe(t)?t.map(e=>e.toDate()):t.toDate();var Aw={exports:{}},cge=Aw.exports,eN;function dge(){return eN||(eN=1,(function(t,e){(function(n,i){t.exports=i()})(cge,(function(){return function(n,i,r){var o=i.prototype,s=function(d){return d&&(d.indexOf?d:d.s)},a=function(d,f,h,m,g){var v=d.name?d:d.$locale(),p=s(v[f]),b=s(v[h]),y=p||b.map((function(C){return C.slice(0,m)}));if(!g)return y;var _=v.weekStart;return y.map((function(C,S){return y[(S+(_||0))%7]}))},l=function(){return r.Ls[r.locale()]},u=function(d,f){return d.formats[f]||(function(h){return h.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(m,g,v){return g||v.slice(1)}))})(d.formats[f.toUpperCase()])},c=function(){var d=this;return{months:function(f){return f?f.format("MMMM"):a(d,"months")},monthsShort:function(f){return f?f.format("MMM"):a(d,"monthsShort","months",3)},firstDayOfWeek:function(){return d.$locale().weekStart||0},weekdays:function(f){return f?f.format("dddd"):a(d,"weekdays")},weekdaysMin:function(f){return f?f.format("dd"):a(d,"weekdaysMin","weekdays",2)},weekdaysShort:function(f){return f?f.format("ddd"):a(d,"weekdaysShort","weekdays",3)},longDateFormat:function(f){return u(d.$locale(),f)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};o.localeData=function(){return c.bind(this)()},r.localeData=function(){var d=l();return{firstDayOfWeek:function(){return d.weekStart||0},weekdays:function(){return r.weekdays()},weekdaysShort:function(){return r.weekdaysShort()},weekdaysMin:function(){return r.weekdaysMin()},months:function(){return r.months()},monthsShort:function(){return r.monthsShort()},longDateFormat:function(f){return u(d,f)},meridiem:d.meridiem,ordinal:d.ordinal}},r.months=function(){return a(l(),"months")},r.monthsShort=function(){return a(l(),"monthsShort","months",3)},r.weekdays=function(d){return a(l(),"weekdays",null,null,d)},r.weekdaysShort=function(d){return a(l(),"weekdaysShort","weekdays",3,d)},r.weekdaysMin=function(d){return a(l(),"weekdaysMin","weekdays",2,d)}}}))})(Aw)),Aw.exports}var fge=dge();const hge=wl(fge),mge=["year","years","month","months","date","dates","week","datetime","datetimerange","daterange","monthrange","yearrange"],Fv=qe({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:yl},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),gge={close:t=>t instanceof MouseEvent,click:t=>t instanceof MouseEvent},pge=["aria-label"],vge=["aria-label"];var bge=le({name:"ElTag",__name:"tag",props:Fv,emits:gge,setup(t,{emit:e}){const n=t,i=e,r=fr(),{t:o}=Qt(),s=De("tag"),a=M(()=>{const{type:d,hit:f,effect:h,closable:m,round:g}=n;return[s.b(),s.is("closable",m),s.m(d||"primary"),s.m(r.value),s.m(h),s.is("hit",f),s.is("round",g)]}),l=d=>{i("close",d)},u=d=>{i("click",d)},c=d=>{var f,h,m;(m=(h=(f=d?.component)==null?void 0:f.subTree)==null?void 0:h.component)!=null&&m.bum&&(d.component.subTree.component.bum=null)};return(d,f)=>t.disableTransitions?(B(),Q("span",{key:0,class:$(a.value),style:mt({backgroundColor:t.color}),onClick:u},[ie("span",{class:$(w(s).e("content"))},[we(d.$slots,"default")],2),t.closable?(B(),Q("button",{key:0,"aria-label":w(o)("el.tag.close"),class:$(w(s).e("close")),type:"button",onClick:Ot(l,["stop"])},[L(w(He),null,{default:ce(()=>[L(w(cl))]),_:1})],10,pge)):ve("v-if",!0)],6)):(B(),_e(ya,{key:1,name:`${w(s).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:c},{default:ce(()=>[ie("span",{class:$(a.value),style:mt({backgroundColor:t.color}),onClick:u},[ie("span",{class:$(w(s).e("content"))},[we(d.$slots,"default")],2),t.closable?(B(),Q("button",{key:0,"aria-label":w(o)("el.tag.close"),class:$(w(s).e("close")),type:"button",onClick:Ot(l,["stop"])},[L(w(He),null,{default:ce(()=>[L(w(cl))]),_:1})],10,vge)):ve("v-if",!0)],6)]),_:3},8,["name"]))}});const jp=sn(bge),g2={label:"label",value:"value",disabled:"disabled",options:"options"};function yge(t){const e=H({...g2,...t.props});let n={...t.props};return Se(()=>t.props,a=>{$i(a,n)||(e.value={...g2,...a},n={...a})},{deep:!0}),{aliasProps:e,getLabel:a=>to(a,e.value.label),getValue:a=>to(a,e.value.value),getDisabled:a=>to(a,e.value.disabled),getOptions:a=>to(a,e.value.options)}}const iW=Symbol("ElSelectGroup"),FC=Symbol("ElSelect"),p2="ElOption",wge=qe({value:{type:[String,Number,Boolean,Object],required:!0},label:{type:[String,Number]},created:Boolean,disabled:Boolean}),_ge=(t="")=>t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),ac=t=>$b(t);function Cge(t,e){const n=Ne(FC);n||dr(p2,"usage: ");const i=Ne(iW,{disabled:!1}),r=M(()=>c(Co(n.props.modelValue),t.value)),o=M(()=>{var h;if(n.props.multiple){const m=Co((h=n.props.modelValue)!=null?h:[]);return!r.value&&m.length>=n.props.multipleLimit&&n.props.multipleLimit>0}else return!1}),s=M(()=>{var h;return(h=t.label)!=null?h:_t(t.value)?"":t.value}),a=M(()=>t.value||t.label||""),l=M(()=>t.disabled||e.groupDisabled||o.value),u=Ct(),c=(h=[],m)=>{if(_t(t.value)){const g=n.props.valueKey;return h&&h.some(v=>ln(to(v,g))===to(m,g))}else return h&&h.includes(m)},d=()=>{l.value||(n.states.hoveringIndex=n.optionsArray.indexOf(u.proxy))},f=h=>{const m=new RegExp(_ge(h),"i");e.visible=m.test(String(s.value))||t.created};return Se(()=>s.value,()=>{!t.created&&!n.props.remote&&n.setSelected()}),Se(()=>t.value,(h,m)=>{const{remote:g,valueKey:v}=n.props;if((g?h!==m:!$i(h,m))&&(n.onOptionDestroy(m,u.proxy),n.onOptionCreate(u.proxy)),!t.created&&!g){if(v&&_t(h)&&_t(m)&&h[v]===m[v])return;n.setSelected()}}),Se(()=>i.disabled,()=>{e.groupDisabled=i.disabled},{immediate:!0}),{select:n,currentLabel:s,currentValue:a,itemSelected:r,isDisabled:l,hoverItem:d,updateOption:f}}var Sge=le({name:p2,componentName:p2,props:wge,setup(t){const e=De("select"),n=as(),i=M(()=>[e.be("dropdown","item"),e.is("disabled",w(a)),e.is("selected",w(s)),e.is("hovering",w(f))]),r=on({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:o,itemSelected:s,isDisabled:a,select:l,hoverItem:u,updateOption:c}=Cge(t,r),{visible:d,hover:f}=Sr(r),h=Ct().proxy;l.onOptionCreate(h),Sn(()=>{const g=h.value;Ye(()=>{const{selected:v}=l.states,p=v.some(b=>b.value===h.value);l.states.cachedOptions.get(g)===h&&!p&&l.states.cachedOptions.delete(g)}),l.onOptionDestroy(g,h)});function m(){a.value||l.handleOptionSelect(h)}return{ns:e,id:n,containerKls:i,currentLabel:o,itemSelected:s,isDisabled:a,select:l,visible:d,hover:f,states:r,hoverItem:u,updateOption:c,selectOptionClick:m}}});const kge=["id","aria-disabled","aria-selected"];function Tge(t,e,n,i,r,o){return Vt((B(),Q("li",{id:t.id,class:$(t.containerKls),role:"option","aria-disabled":t.isDisabled||void 0,"aria-selected":t.itemSelected,onMousemove:e[0]||(e[0]=(...s)=>t.hoverItem&&t.hoverItem(...s)),onClick:e[1]||(e[1]=Ot((...s)=>t.selectOptionClick&&t.selectOptionClick(...s),["stop"]))},[we(t.$slots,"default",{},()=>[ie("span",null,We(t.currentLabel),1)])],42,kge)),[[On,t.visible]])}var kR=Tr(Sge,[["render",Tge]]);const rW=11,Ege=2;var xge=le({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const t=Ne(FC),e=De("select"),n=M(()=>t.props.popperClass),i=M(()=>t.props.multiple),r=M(()=>t.props.fitInputWidth),o=H("");function s(){var a;const l=(a=t.selectRef)==null?void 0:a.offsetWidth;l?o.value=`${l-Ege}px`:o.value=""}return Pt(()=>{s(),nr(t.selectRef,s)}),{ns:e,minWidth:o,popperClass:n,isMultiple:i,isFitInputWidth:r}}});function Age(t,e,n,i,r,o){return B(),Q("div",{class:$([t.ns.b("dropdown"),t.ns.is("multiple",t.isMultiple),t.popperClass]),style:mt({[t.isFitInputWidth?"width":"minWidth"]:t.minWidth})},[t.$slots.header?(B(),Q("div",{key:0,class:$(t.ns.be("dropdown","header"))},[we(t.$slots,"header")],2)):ve("v-if",!0),we(t.$slots,"default"),t.$slots.footer?(B(),Q("div",{key:1,class:$(t.ns.be("dropdown","footer"))},[we(t.$slots,"footer")],2)):ve("v-if",!0)],6)}var Pge=Tr(xge,[["render",Age]]);const Ige=(t,e)=>{const{t:n}=Qt(),i=$o(),r=as(),o=De("select"),s=De("input"),a=on({inputValue:"",options:new Map,cachedOptions:new Map,optionValues:[],selected:[],selectionWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),l=H(),u=H(),c=H(),d=H(),f=H(),h=H(),m=H(),g=H(),v=H(),p=H(),b=H(),y=H(!1),_=H(),C=H(!1),{form:S,formItem:k}=lo(),{inputId:T}=Au(t,{formItemContext:k}),{valueOnClear:E,isEmptyValue:x}=OC(t),{isComposing:P,handleCompositionStart:A,handleCompositionUpdate:I,handleCompositionEnd:D}=bR({afterComposition:ke=>Dt(ke)}),q=Oi(),{wrapperRef:z,isFocused:R,handleBlur:O}=dg(f,{disabled:q,afterFocus(){t.automaticDropdown&&!y.value&&(y.value=!0,a.menuVisibleOnFocus=!0)},beforeBlur(ke){var Ze,xt;return((Ze=c.value)==null?void 0:Ze.isFocusInsideContent(ke))||((xt=d.value)==null?void 0:xt.isFocusInsideContent(ke))},afterBlur(){var ke;y.value=!1,a.menuVisibleOnFocus=!1,t.validateEvent&&((ke=k?.validate)==null||ke.call(k,"blur").catch(Ze=>void 0))}}),N=M(()=>Pe(t.modelValue)?t.modelValue.length>0:!x(t.modelValue)),F=M(()=>{var ke;return(ke=S?.statusIcon)!=null?ke:!1}),j=M(()=>t.clearable&&!q.value&&N.value&&(R.value||a.inputHovering)),U=M(()=>t.remote&&t.filterable&&!t.remoteShowSuffix?"":t.suffixIcon),W=M(()=>o.is("reverse",!!(U.value&&y.value))),J=M(()=>k?.validateState||""),ne=M(()=>J.value&&gU[J.value]),he=M(()=>t.remote?t.debounce:0),X=M(()=>t.remote&&!a.inputValue&&a.options.size===0),se=M(()=>t.loading?t.loadingText||n("el.select.loading"):t.filterable&&a.inputValue&&a.options.size>0&&re.value===0?t.noMatchText||n("el.select.noMatch"):a.options.size===0?t.noDataText||n("el.select.noData"):null),re=M(()=>ee.value.filter(ke=>ke.visible).length),ee=M(()=>{const ke=Array.from(a.options.values()),Ze=[];return a.optionValues.forEach(xt=>{const $n=ke.findIndex(ui=>ui.value===xt);$n>-1&&Ze.push(ke[$n])}),Ze.length>=ke.length?Ze:ke}),te=M(()=>Array.from(a.cachedOptions.values())),V=M(()=>{const ke=ee.value.filter(Ze=>!Ze.created).some(Ze=>Ze.currentLabel===a.inputValue);return t.filterable&&t.allowCreate&&a.inputValue!==""&&!ke}),K=()=>{t.filterable&&Xe(t.filterMethod)||t.filterable&&t.remote&&Xe(t.remoteMethod)||ee.value.forEach(ke=>{var Ze;(Ze=ke.updateOption)==null||Ze.call(ke,a.inputValue)})},G=fr(),ye=M(()=>["small"].includes(G.value)?"small":"default"),be=M({get(){return y.value&&(t.loading||!X.value||t.remote&&!!i.empty)&&(!C.value||!xm(a.previousQuery))},set(ke){y.value=ke}}),Ce=M(()=>{if(t.multiple&&!pn(t.modelValue))return Co(t.modelValue).length===0&&!a.inputValue;const ke=Pe(t.modelValue)?t.modelValue[0]:t.modelValue;return t.filterable||pn(ke)?!a.inputValue:!0}),Y=M(()=>{var ke;const Ze=(ke=t.placeholder)!=null?ke:n("el.select.placeholder");return t.multiple||!N.value?Ze:a.selectedLabel}),Z=M(()=>a2?null:"mouseenter");Se(()=>t.modelValue,(ke,Ze)=>{t.multiple&&t.filterable&&!t.reserveKeyword&&(a.inputValue="",ae("")),je(),!$i(ke,Ze)&&t.validateEvent&&k?.validate("change").catch(xt=>void 0)},{flush:"post",deep:!0}),Se(()=>y.value,ke=>{ke?ae(a.inputValue):(a.inputValue="",a.previousQuery=null,a.isBeforeHide=!0,a.menuVisibleOnFocus=!1)}),Se(()=>a.options.entries(),()=>{Zt&&(je(),t.defaultFirstOption&&(t.filterable||t.remote)&&re.value&&pe())},{flush:"post"}),Se([()=>a.hoveringIndex,ee],([ke])=>{St(ke)&&ke>-1?_.value=ee.value[ke]||{}:_.value={},ee.value.forEach(Ze=>{Ze.hover=_.value===Ze})}),sl(()=>{a.isBeforeHide||K()});const ae=ke=>{a.previousQuery===ke||P.value||(a.previousQuery=ke,t.filterable&&Xe(t.filterMethod)?t.filterMethod(ke):t.filterable&&t.remote&&Xe(t.remoteMethod)&&t.remoteMethod(ke),t.defaultFirstOption&&(t.filterable||t.remote)&&re.value?Ye(pe):Ye(fe))},pe=()=>{const ke=ee.value.filter(ui=>ui.visible&&!ui.disabled&&!ui.states.groupDisabled),Ze=ke.find(ui=>ui.created),xt=ke[0],$n=ee.value.map(ui=>ui.value);a.hoveringIndex=Ve($n,Ze||xt)},je=()=>{if(t.multiple)a.selectedLabel="";else{const Ze=Pe(t.modelValue)?t.modelValue[0]:t.modelValue,xt=Ie(Ze);a.selectedLabel=xt.currentLabel,a.selected=[xt];return}const ke=[];pn(t.modelValue)||Co(t.modelValue).forEach(Ze=>{ke.push(Ie(Ze))}),a.selected=ke},Ie=ke=>{let Ze;const xt=Cv(ke);for(let co=a.cachedOptions.size-1;co>=0;co--){const Wo=te.value[co];if(xt?to(Wo.value,t.valueKey)===to(ke,t.valueKey):Wo.value===ke){Ze={index:ee.value.filter(Qc=>!Qc.created).indexOf(Wo),value:ke,currentLabel:Wo.currentLabel,get isDisabled(){return Wo.isDisabled}};break}}if(Ze)return Ze;const $n=xt?ke.label:ke??"";return{index:-1,value:ke,currentLabel:$n}},fe=()=>{const ke=a.selected.length;if(ke>0){const Ze=a.selected[ke-1];a.hoveringIndex=ee.value.findIndex(xt=>jr(Ze)===jr(xt))}else a.hoveringIndex=-1},Te=()=>{a.selectionWidth=Number.parseFloat(window.getComputedStyle(u.value).width)},et=()=>{a.collapseItemWidth=p.value.getBoundingClientRect().width},Re=()=>{var ke,Ze;(Ze=(ke=c.value)==null?void 0:ke.updatePopper)==null||Ze.call(ke)},ze=()=>{var ke,Ze;(Ze=(ke=d.value)==null?void 0:ke.updatePopper)==null||Ze.call(ke)},Ke=()=>{a.inputValue.length>0&&!y.value&&(y.value=!0),ae(a.inputValue)},Dt=ke=>{if(a.inputValue=ke.target.value,t.remote)C.value=!0,Cn();else return Ke()},Cn=eR(()=>{Ke(),C.value=!1},he),Je=ke=>{$i(t.modelValue,ke)||e(En,ke)},kt=ke=>Hue(ke,Ze=>{const xt=a.cachedOptions.get(Ze);return!xt?.disabled&&!xt?.states.groupDisabled}),Et=ke=>{const Ze=Bn(ke);if(t.multiple&&Ze!==Me.delete&&ke.target.value.length<=0){const xt=Co(t.modelValue).slice(),$n=kt(xt);if($n<0)return;const ui=xt[$n];xt.splice($n,1),e(It,xt),Je(xt),e("remove-tag",ui)}},ge=(ke,Ze)=>{const xt=a.selected.indexOf(Ze);if(xt>-1&&!q.value){const $n=Co(t.modelValue).slice();$n.splice(xt,1),e(It,$n),Je($n),e("remove-tag",Ze.value)}ke.stopPropagation(),Fe()},Le=ke=>{ke.stopPropagation();const Ze=t.multiple?[]:E.value;if(t.multiple)for(const xt of a.selected)xt.isDisabled&&Ze.push(xt.value);e(It,Ze),Je(Ze),a.hoveringIndex=-1,y.value=!1,e("clear"),Fe()},de=ke=>{var Ze;if(t.multiple){const xt=Co((Ze=t.modelValue)!=null?Ze:[]).slice(),$n=Ve(xt,ke);$n>-1?xt.splice($n,1):(t.multipleLimit<=0||xt.length{gt(ke)})},Ve=(ke,Ze)=>pn(Ze)?-1:_t(Ze.value)?ke.findIndex(xt=>$i(to(xt,t.valueKey),jr(Ze))):ke.indexOf(Ze.value),gt=ke=>{var Ze,xt,$n,ui,co;const Wo=Pe(ke)?ke[ke.length-1]:ke;let Zc=null;if(!ir(Wo?.value)){const Qc=ee.value.filter(ane=>ane.value===Wo.value);Qc.length>0&&(Zc=Qc[0].$el)}if(c.value&&Zc){const Qc=(ui=($n=(xt=(Ze=c.value)==null?void 0:Ze.popperRef)==null?void 0:xt.contentRef)==null?void 0:$n.querySelector)==null?void 0:ui.call($n,`.${o.be("dropdown","wrap")}`);Qc&&uU(Qc,Zc)}(co=b.value)==null||co.handleScroll()},an=ke=>{a.options.set(ke.value,ke),a.cachedOptions.set(ke.value,ke)},Si=(ke,Ze)=>{a.options.get(ke)===Ze&&a.options.delete(ke)},uo=M(()=>{var ke,Ze;return(Ze=(ke=c.value)==null?void 0:ke.popperRef)==null?void 0:Ze.contentRef}),Oe=()=>{a.isBeforeHide=!1,Ye(()=>{var ke;(ke=b.value)==null||ke.update(),gt(a.selected)})},Fe=()=>{var ke;(ke=f.value)==null||ke.focus()},st=()=>{var ke;if(y.value){y.value=!1,Ye(()=>{var Ze;return(Ze=f.value)==null?void 0:Ze.blur()});return}(ke=f.value)==null||ke.blur()},Vn=ke=>{Le(ke)},en=ke=>{if(y.value=!1,R.value){const Ze=new FocusEvent("blur",ke);Ye(()=>O(Ze))}},Ue=()=>{a.inputValue.length>0?a.inputValue="":y.value=!1},tt=ke=>{var Ze;q.value||t.filterable&&y.value&&ke&&!((Ze=m.value)!=null&&Ze.contains(ke.target))||(a2&&(a.inputHovering=!0),a.menuVisibleOnFocus?a.menuVisibleOnFocus=!1:y.value=!y.value)},pt=()=>{if(!y.value)tt();else{const ke=ee.value[a.hoveringIndex];ke&&!ke.isDisabled&&de(ke)}},jr=ke=>_t(ke.value)?to(ke.value,t.valueKey):ke.value,Uo=M(()=>ee.value.filter(ke=>ke.visible).every(ke=>ke.isDisabled)),Jc=M(()=>t.multiple?t.collapseTags?a.selected.slice(0,t.maxCollapseTags):a.selected:[]),tne=M(()=>t.multiple?t.collapseTags?a.selected.slice(t.maxCollapseTags):[]:[]),T0=ke=>{if(!y.value){y.value=!0;return}if(!(a.options.size===0||re.value===0||P.value)&&!Uo.value){ke==="next"?(a.hoveringIndex++,a.hoveringIndex===a.options.size&&(a.hoveringIndex=0)):ke==="prev"&&(a.hoveringIndex--,a.hoveringIndex<0&&(a.hoveringIndex=a.options.size-1));const Ze=ee.value[a.hoveringIndex];(Ze.isDisabled||!Ze.visible)&&T0(ke),Ye(()=>gt(_.value))}},KL=(ke,Ze,xt,$n)=>{for(let ui=Ze;ui>=0&&ui<$n;ui+=xt){const co=ke[ui];if(!co?.isDisabled&&co?.visible)return ui}return null},E0=(ke,Ze)=>{var xt;const $n=a.options.size;if($n===0)return;const ui=GI(ke,0,$n-1),co=ee.value,Wo=Ze==="up"?-1:1,Zc=(xt=KL(co,ui,Wo,$n))!=null?xt:KL(co,ui-Wo,-Wo,$n);Zc!=null&&(a.hoveringIndex=Zc,Ye(()=>gt(_.value)))},nne=ke=>{const Ze=Bn(ke);let xt=!0;switch(Ze){case Me.up:T0("prev");break;case Me.down:T0("next");break;case Me.enter:case Me.numpadEnter:P.value||pt();break;case Me.esc:Ue();break;case Me.backspace:xt=!1,Et(ke);return;case Me.home:if(!y.value)return;E0(0,"down");break;case Me.end:if(!y.value)return;E0(a.options.size-1,"up");break;case Me.pageUp:if(!y.value)return;E0(a.hoveringIndex-10,"up");break;case Me.pageDown:if(!y.value)return;E0(a.hoveringIndex+10,"down");break;default:xt=!1;break}xt&&(ke.preventDefault(),ke.stopPropagation())},ine=()=>{if(!u.value)return 0;const ke=window.getComputedStyle(u.value);return Number.parseFloat(ke.gap||"6px")},rne=M(()=>{const ke=ine(),Ze=t.filterable?ke+rW:0;return{maxWidth:`${p.value&&t.maxCollapseTags===1?a.selectionWidth-a.collapseItemWidth-ke-Ze:a.selectionWidth-Ze}px`}}),one=M(()=>({maxWidth:`${a.selectionWidth}px`})),sne=ke=>{e("popup-scroll",ke)};nr(u,Te),nr(z,Re),nr(v,ze),nr(p,et);let x0;return Se(()=>be.value,ke=>{ke?x0=nr(g,Re).stop:(x0?.(),x0=void 0),e("visible-change",ke)}),Pt(()=>{je()}),{inputId:T,contentId:r,nsSelect:o,nsInput:s,states:a,isFocused:R,expanded:y,optionsArray:ee,hoverOption:_,selectSize:G,filteredOptionsCount:re,updateTooltip:Re,updateTagTooltip:ze,debouncedOnInputChange:Cn,onInput:Dt,deletePrevTag:Et,deleteTag:ge,deleteSelected:Le,handleOptionSelect:de,scrollToOption:gt,hasModelValue:N,shouldShowPlaceholder:Ce,currentPlaceholder:Y,mouseEnterEventName:Z,needStatusIcon:F,showClearBtn:j,iconComponent:U,iconReverse:W,validateState:J,validateIcon:ne,showNewOption:V,updateOptions:K,collapseTagSize:ye,setSelected:je,selectDisabled:q,emptyText:se,handleCompositionStart:A,handleCompositionUpdate:I,handleCompositionEnd:D,handleKeydown:nne,onOptionCreate:an,onOptionDestroy:Si,handleMenuEnter:Oe,focus:Fe,blur:st,handleClearClick:Vn,handleClickOutside:en,handleEsc:Ue,toggleMenu:tt,selectOption:pt,getValueKey:jr,navigateOptions:T0,dropdownMenuVisible:be,showTagList:Jc,collapseTagList:tne,popupScroll:sne,getOption:Ie,tagStyle:rne,collapseTagStyle:one,popperRef:uo,inputRef:f,tooltipRef:c,tagTooltipRef:d,prefixRef:h,suffixRef:m,selectRef:l,wrapperRef:z,selectionRef:u,scrollbarRef:b,menuRef:g,tagMenuRef:v,collapseItemRef:p}};var Rge=le({name:"ElOptions",setup(t,{slots:e}){const n=Ne(FC);let i=[];return()=>{var r,o;const s=(r=e.default)==null?void 0:r.call(e),a=[];function l(u){Pe(u)&&u.forEach(c=>{var d,f,h,m;const g=(d=c?.type||{})==null?void 0:d.name;g==="ElOptionGroup"?l(!ot(c.children)&&!Pe(c.children)&&Xe((f=c.children)==null?void 0:f.default)?(h=c.children)==null?void 0:h.default():c.children):g==="ElOption"?a.push((m=c.props)==null?void 0:m.value):Pe(c.children)&&l(c.children)})}return s.length&&l((o=s[0])==null?void 0:o.children),$i(a,i)||(i=a,n&&(n.states.optionValues=a)),s}}});const Mge=qe({name:String,id:String,modelValue:{type:me([Array,String,Number,Boolean,Object]),default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:$r,effect:{type:me(String),default:"light"},disabled:{type:Boolean,default:void 0},clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperStyle:{type:me([String,Object])},popperOptions:{type:me(Object),default:()=>({})},remote:Boolean,debounce:{type:Number,default:300},loadingText:String,noMatchText:String,noDataText:String,remoteMethod:{type:me(Function)},filterMethod:{type:me(Function)},multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:Mn.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:ri,default:Nf},fitInputWidth:Boolean,suffixIcon:{type:ri,default:zc},tagType:{...Fv.type,default:"info"},tagEffect:{...Fv.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,showArrow:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:me(String),values:xu,default:"bottom-start"},fallbackPlacements:{type:me(Array),default:["bottom-start","top-start","right","left"]},tabindex:{type:[String,Number],default:0},appendTo:Mn.appendTo,options:{type:me(Array)},props:{type:me(Object),default:()=>g2},...Gb,...hs(["ariaLabel"])});DU.scroll;var Oge=le({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(t){const e=De("select"),n=H(),i=Ct(),r=H([]);qt(iW,on({...Sr(t)}));const o=M(()=>r.value.some(u=>u.visible===!0)),s=u=>{var c;return u.type.name==="ElOption"&&!!((c=u.component)!=null&&c.proxy)},a=u=>{const c=Co(u),d=[];return c.forEach(f=>{var h;yi(f)&&(s(f)?d.push(f.component.proxy):Pe(f.children)&&f.children.length?d.push(...a(f.children)):(h=f.component)!=null&&h.subTree&&d.push(...a(f.component.subTree)))}),d},l=()=>{r.value=a(i.subTree)};return Pt(()=>{l()}),eU(n,l,{attributes:!0,subtree:!0,childList:!0}),{groupRef:n,visible:o,ns:e}}});function Lge(t,e,n,i,r,o){return Vt((B(),Q("ul",{ref:"groupRef",class:$(t.ns.be("group","wrap"))},[ie("li",{class:$(t.ns.be("group","title"))},We(t.label),3),ie("li",null,[ie("ul",{class:$(t.ns.b("group"))},[we(t.$slots,"default")],2)])],2)),[[On,t.visible]])}var TR=Tr(Oge,[["render",Lge]]);const Xu=new Map;if(Zt){let t;document.addEventListener("mousedown",e=>t=e),document.addEventListener("mouseup",e=>{if(t){for(const n of Xu.values())for(const{documentHandler:i}of n)i(e,t);t=void 0}})}function tN(t,e){let n=[];return Pe(e.arg)?n=e.arg:Qo(e.arg)&&n.push(e.arg),function(i,r){const o=e.instance.popperRef,s=i.target,a=r?.target,l=!e||!e.instance,u=!s||!a,c=t.contains(s)||t.contains(a),d=t===s,f=n.length&&n.some(m=>m?.contains(s))||n.length&&n.includes(a),h=o&&(o.contains(s)||o.contains(a));l||u||c||d||f||h||e.value(i,r)}}const wf={beforeMount(t,e){Xu.has(t)||Xu.set(t,[]),Xu.get(t).push({documentHandler:tN(t,e),bindingFn:e.value})},updated(t,e){Xu.has(t)||Xu.set(t,[]);const n=Xu.get(t),i=n.findIndex(o=>o.bindingFn===e.oldValue),r={documentHandler:tN(t,e),bindingFn:e.value};i>=0?n.splice(i,1,r):n.push(r)},unmounted(t){Xu.delete(t)}};function Dge(){const t=bi(),e=H(0),n=M(()=>({minWidth:`${Math.max(e.value,rW)}px`}));return nr(t,()=>{var r,o;e.value=(o=(r=t.value)==null?void 0:r.getBoundingClientRect().width)!=null?o:0}),{calculatorRef:t,calculatorWidth:e,inputStyle:n}}const nN="ElSelect",$v=new WeakMap,Nge=t=>(...e)=>{var n,i;const r=e[0];if(!r||r.includes('Slot "default" invoked outside of the render function')&&((n=e[2])!=null&&n.includes("ElTreeSelect")))return;const o=(i=$v.get(t))==null?void 0:i.originalWarnHandler;if(o){o(...e);return}console.warn(...e)},Bge=t=>{let e=$v.get(t);return e||(e={originalWarnHandler:t.config.warnHandler,handler:Nge(t),count:0},$v.set(t,e)),e};var Vge=le({name:nN,componentName:nN,components:{ElSelectMenu:Pge,ElOption:kR,ElOptions:Rge,ElOptionGroup:TR,ElTag:jp,ElScrollbar:gu,ElTooltip:Lo,ElIcon:He},directives:{ClickOutside:wf},props:Mge,emits:[It,En,"remove-tag","clear","visible-change","focus","blur","popup-scroll"],setup(t,{emit:e,slots:n}){const i=Ct(),r=Bge(i.appContext);r.count+=1,i.appContext.config.warnHandler=r.handler;const o=M(()=>{const{modelValue:b,multiple:y}=t,_=y?[]:void 0;return Pe(b)?y?b:_:y?_:b}),s=on({...Sr(t),modelValue:o}),a=Ige(s,e),{calculatorRef:l,inputStyle:u}=Dge(),{getLabel:c,getValue:d,getOptions:f,getDisabled:h}=yge(t),m=b=>({label:c(b),value:d(b),disabled:h(b)}),g=b=>b.reduce((y,_)=>(y.push(_),_.children&&_.children.length>0&&y.push(...g(_.children)),y),[]),v=b=>{cc(b||[]).forEach(_=>{var C;if(_t(_)&&(_.type.name==="ElOption"||_.type.name==="ElTree")){const S=_.type.name;if(S==="ElTree"){const k=((C=_.props)==null?void 0:C.data)||[];g(k).forEach(E=>{E.currentLabel=E.label||(_t(E.value)?"":E.value),a.onOptionCreate(E)})}else if(S==="ElOption"){const k={..._.props};k.currentLabel=k.label||(_t(k.value)?"":k.value),a.onOptionCreate(k)}}})};Se(()=>{var b;return[(b=n.default)==null?void 0:b.call(n),o.value]},()=>{var b;t.persistent||a.expanded.value||(a.states.options.clear(),v((b=n.default)==null?void 0:b.call(n)))},{immediate:!0}),qt(FC,on({props:s,states:a.states,selectRef:a.selectRef,optionsArray:a.optionsArray,setSelected:a.setSelected,handleOptionSelect:a.handleOptionSelect,onOptionCreate:a.onOptionCreate,onOptionDestroy:a.onOptionDestroy}));const p=M(()=>t.multiple?a.states.selected.map(b=>b.currentLabel):a.states.selectedLabel);return Sn(()=>{const b=$v.get(i.appContext);b&&(b.count-=1,b.count<=0&&(i.appContext.config.warnHandler=b.originalWarnHandler,$v.delete(i.appContext)))}),{...a,modelValue:o,selectedLabel:p,calculatorRef:l,inputStyle:u,getLabel:c,getValue:d,getOptions:f,getDisabled:h,getOptionProps:m}}});const Fge=["id","value","name","disabled","autocomplete","tabindex","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label"],$ge=["textContent"],zge={key:1};function Hge(t,e,n,i,r,o){const s=Bt("el-tag"),a=Bt("el-tooltip"),l=Bt("el-icon"),u=Bt("el-option"),c=Bt("el-option-group"),d=Bt("el-options"),f=Bt("el-scrollbar"),h=Bt("el-select-menu"),m=vz("click-outside");return Vt((B(),Q("div",Lt({ref:"selectRef",class:[t.nsSelect.b(),t.nsSelect.m(t.selectSize)]},{[Rp(t.mouseEnterEventName)]:e[10]||(e[10]=g=>t.states.inputHovering=!0)},{onMouseleave:e[11]||(e[11]=g=>t.states.inputHovering=!1)}),[L(a,{ref:"tooltipRef",visible:t.dropdownMenuVisible,placement:t.placement,teleported:t.teleported,"popper-class":[t.nsSelect.e("popper"),t.popperClass],"popper-style":t.popperStyle,"popper-options":t.popperOptions,"fallback-placements":t.fallbackPlacements,effect:t.effect,pure:"",trigger:"click",transition:`${t.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:t.persistent,"append-to":t.appendTo,"show-arrow":t.showArrow,offset:t.offset,onBeforeShow:t.handleMenuEnter,onHide:e[9]||(e[9]=g=>t.states.isBeforeHide=!1)},{default:ce(()=>{var g;return[ie("div",{ref:"wrapperRef",class:$([t.nsSelect.e("wrapper"),t.nsSelect.is("focused",t.isFocused),t.nsSelect.is("hovering",t.states.inputHovering),t.nsSelect.is("filterable",t.filterable),t.nsSelect.is("disabled",t.selectDisabled)]),onClick:e[6]||(e[6]=Ot((...v)=>t.toggleMenu&&t.toggleMenu(...v),["prevent"]))},[t.$slots.prefix?(B(),Q("div",{key:0,ref:"prefixRef",class:$(t.nsSelect.e("prefix"))},[we(t.$slots,"prefix")],2)):ve("v-if",!0),ie("div",{ref:"selectionRef",class:$([t.nsSelect.e("selection"),t.nsSelect.is("near",t.multiple&&!t.$slots.prefix&&!!t.states.selected.length)])},[t.multiple?we(t.$slots,"tag",{key:0,data:t.states.selected,deleteTag:t.deleteTag,selectDisabled:t.selectDisabled},()=>[(B(!0),Q(rt,null,gn(t.showTagList,v=>(B(),Q("div",{key:t.getValueKey(v),class:$(t.nsSelect.e("selected-item"))},[L(s,{closable:!t.selectDisabled&&!v.isDisabled,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:mt(t.tagStyle),onClose:p=>t.deleteTag(p,v)},{default:ce(()=>[ie("span",{class:$(t.nsSelect.e("tags-text"))},[we(t.$slots,"label",{index:v.index,label:v.currentLabel,value:v.value},()=>[dt(We(v.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),t.collapseTags&&t.states.selected.length>t.maxCollapseTags?(B(),_e(a,{key:0,ref:"tagTooltipRef",disabled:t.dropdownMenuVisible||!t.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:t.effect,placement:"bottom","popper-class":t.popperClass,"popper-style":t.popperStyle,teleported:t.teleported,"popper-options":t.popperOptions},{default:ce(()=>[ie("div",{ref:"collapseItemRef",class:$(t.nsSelect.e("selected-item"))},[L(s,{closable:!1,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:mt(t.collapseTagStyle)},{default:ce(()=>[ie("span",{class:$(t.nsSelect.e("tags-text"))}," + "+We(t.states.selected.length-t.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:ce(()=>[ie("div",{ref:"tagMenuRef",class:$(t.nsSelect.e("selection"))},[(B(!0),Q(rt,null,gn(t.collapseTagList,v=>(B(),Q("div",{key:t.getValueKey(v),class:$(t.nsSelect.e("selected-item"))},[L(s,{class:"in-tooltip",closable:!t.selectDisabled&&!v.isDisabled,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",onClose:p=>t.deleteTag(p,v)},{default:ce(()=>[ie("span",{class:$(t.nsSelect.e("tags-text"))},[we(t.$slots,"label",{index:v.index,label:v.currentLabel,value:v.value},()=>[dt(We(v.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","popper-class","popper-style","teleported","popper-options"])):ve("v-if",!0)]):ve("v-if",!0),ie("div",{class:$([t.nsSelect.e("selected-item"),t.nsSelect.e("input-wrapper"),t.nsSelect.is("hidden",!t.filterable||t.selectDisabled)])},[ie("input",{id:t.inputId,ref:"inputRef",value:t.states.inputValue,type:"text",name:t.name,class:$([t.nsSelect.e("input"),t.nsSelect.is(t.selectSize)]),disabled:t.selectDisabled,autocomplete:t.autocomplete,style:mt(t.inputStyle),tabindex:t.tabindex,role:"combobox",readonly:!t.filterable,spellcheck:"false","aria-activedescendant":((g=t.hoverOption)==null?void 0:g.id)||"","aria-controls":t.contentId,"aria-expanded":t.dropdownMenuVisible,"aria-label":t.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:e[0]||(e[0]=(...v)=>t.handleKeydown&&t.handleKeydown(...v)),onCompositionstart:e[1]||(e[1]=(...v)=>t.handleCompositionStart&&t.handleCompositionStart(...v)),onCompositionupdate:e[2]||(e[2]=(...v)=>t.handleCompositionUpdate&&t.handleCompositionUpdate(...v)),onCompositionend:e[3]||(e[3]=(...v)=>t.handleCompositionEnd&&t.handleCompositionEnd(...v)),onInput:e[4]||(e[4]=(...v)=>t.onInput&&t.onInput(...v)),onClick:e[5]||(e[5]=Ot((...v)=>t.toggleMenu&&t.toggleMenu(...v),["stop"]))},null,46,Fge),t.filterable?(B(),Q("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:$(t.nsSelect.e("input-calculator")),textContent:We(t.states.inputValue)},null,10,$ge)):ve("v-if",!0)],2),t.shouldShowPlaceholder?(B(),Q("div",{key:1,class:$([t.nsSelect.e("selected-item"),t.nsSelect.e("placeholder"),t.nsSelect.is("transparent",!t.hasModelValue||t.expanded&&!t.states.inputValue)])},[t.hasModelValue?we(t.$slots,"label",{key:0,index:t.getOption(t.modelValue).index,label:t.currentPlaceholder,value:t.modelValue},()=>[ie("span",null,We(t.currentPlaceholder),1)]):(B(),Q("span",zge,We(t.currentPlaceholder),1))],2)):ve("v-if",!0)],2),ie("div",{ref:"suffixRef",class:$(t.nsSelect.e("suffix"))},[t.iconComponent&&!t.showClearBtn?(B(),_e(l,{key:0,class:$([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.iconReverse])},{default:ce(()=>[(B(),_e(Gt(t.iconComponent)))]),_:1},8,["class"])):ve("v-if",!0),t.showClearBtn&&t.clearIcon?(B(),_e(l,{key:1,class:$([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.nsSelect.e("clear")]),onClick:t.handleClearClick},{default:ce(()=>[(B(),_e(Gt(t.clearIcon)))]),_:1},8,["class","onClick"])):ve("v-if",!0),t.validateState&&t.validateIcon&&t.needStatusIcon?(B(),_e(l,{key:2,class:$([t.nsInput.e("icon"),t.nsInput.e("validateIcon"),t.nsInput.is("loading",t.validateState==="validating")])},{default:ce(()=>[(B(),_e(Gt(t.validateIcon)))]),_:1},8,["class"])):ve("v-if",!0)],2)],2)]}),content:ce(()=>[L(h,{ref:"menuRef"},{default:ce(()=>[t.$slots.header?(B(),Q("div",{key:0,class:$(t.nsSelect.be("dropdown","header")),onClick:e[7]||(e[7]=Ot(()=>{},["stop"]))},[we(t.$slots,"header")],2)):ve("v-if",!0),Vt(L(f,{id:t.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":t.nsSelect.be("dropdown","wrap"),"view-class":t.nsSelect.be("dropdown","list"),class:$([t.nsSelect.is("empty",t.filteredOptionsCount===0)]),role:"listbox","aria-label":t.ariaLabel,"aria-orientation":"vertical",onScroll:t.popupScroll},{default:ce(()=>[t.showNewOption?(B(),_e(u,{key:0,value:t.states.inputValue,created:!0},null,8,["value"])):ve("v-if",!0),L(d,null,{default:ce(()=>[we(t.$slots,"default",{},()=>[(B(!0),Q(rt,null,gn(t.options,(g,v)=>{var p;return B(),Q(rt,{key:v},[(p=t.getOptions(g))!=null&&p.length?(B(),_e(c,{key:0,label:t.getLabel(g),disabled:t.getDisabled(g)},{default:ce(()=>[(B(!0),Q(rt,null,gn(t.getOptions(g),b=>(B(),_e(u,Lt({key:t.getValue(b)},{ref_for:!0},t.getOptionProps(b)),null,16))),128))]),_:2},1032,["label","disabled"])):(B(),_e(u,Lt({key:1,ref_for:!0},t.getOptionProps(g)),null,16))],64)}),128))])]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label","onScroll"]),[[On,t.states.options.size>0&&!t.loading]]),t.$slots.loading&&t.loading?(B(),Q("div",{key:1,class:$(t.nsSelect.be("dropdown","loading"))},[we(t.$slots,"loading")],2)):t.loading||t.filteredOptionsCount===0?(B(),Q("div",{key:2,class:$(t.nsSelect.be("dropdown","empty"))},[we(t.$slots,"empty",{},()=>[ie("span",null,We(t.emptyText),1)])],2)):ve("v-if",!0),t.$slots.footer?(B(),Q("div",{key:3,class:$(t.nsSelect.be("dropdown","footer")),onClick:e[8]||(e[8]=Ot(()=>{},["stop"]))},[we(t.$slots,"footer")],2)):ve("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-style","popper-options","fallback-placements","effect","transition","persistent","append-to","show-arrow","offset","onBeforeShow"])],16)),[[m,t.handleClickOutside,t.popperRef]])}var Uge=Tr(Vge,[["render",Hge]]);const oW=sn(Uge,{Option:kR,OptionGroup:TR}),sW=Zi(kR);Zi(TR);const Wge=qe({header:{type:String,default:""},footer:{type:String,default:""},bodyStyle:{type:me([String,Object,Array]),default:""},headerClass:String,bodyClass:String,footerClass:String,shadow:{type:String,values:["always","hover","never"],default:void 0}});var qge=le({name:"ElCard",__name:"card",props:Wge,setup(t){const e=Yb("card"),n=De("card");return(i,r)=>{var o;return B(),Q("div",{class:$([w(n).b(),w(n).is(`${t.shadow||((o=w(e))==null?void 0:o.shadow)||"always"}-shadow`)])},[i.$slots.header||t.header?(B(),Q("div",{key:0,class:$([w(n).e("header"),t.headerClass])},[we(i.$slots,"header",{},()=>[dt(We(t.header),1)])],2)):ve("v-if",!0),ie("div",{class:$([w(n).e("body"),t.bodyClass]),style:mt(t.bodyStyle)},[we(i.$slots,"default")],6),i.$slots.footer||t.footer?(B(),Q("div",{key:1,class:$([w(n).e("footer"),t.footerClass])},[we(i.$slots,"footer",{},()=>[dt(We(t.footer),1)])],2)):ve("v-if",!0)],2)}}});const aW=sn(qge),jge=(t,e,n)=>cc(t.subTree).filter(o=>{var s;return yi(o)&&((s=o.type)==null?void 0:s.name)===e&&!!o.component}).map(o=>o.component.uid).map(o=>n[o]).filter(o=>!!o),Kge=(t,e)=>{const n=bi({}),i=bi([]),r=new WeakMap,o=c=>{n.value[c.uid]=c,vw(n),Pt(()=>{const d=c.getVnode().el,f=d.parentNode;if(!r.has(f)){r.set(f,[]);const h=f.insertBefore.bind(f);f.insertBefore=(m,g)=>(r.get(f).some(p=>m===p||g===p)&&vw(n),h(m,g))}r.get(f).push(d)})},s=c=>{delete n.value[c.uid],vw(n);const d=c.getVnode().el,f=d.parentNode,h=r.get(f),m=h.indexOf(d);h.splice(m,1)},a=()=>{i.value=jge(t,e,n.value)},l=c=>c.render();return{children:i,addChild:o,removeChild:s,ChildrenSorter:le({setup(c,{slots:d}){return()=>(a(),d.default?nt(l,{render:d.default}):null)}})}},lW=qe({modelValue:{type:me([Number,String,Array,Object])},options:{type:me(Array),default:()=>[]},props:{type:me(Object),default:()=>({})}}),Gge={expandTrigger:"click",multiple:!1,checkStrictly:!1,emitPath:!0,lazy:!1,lazyLoad:tn,value:"value",label:"label",children:"children",leaf:"leaf",disabled:"disabled",hoverThreshold:500,checkOnClickNode:!1,checkOnClickLeaf:!0,showPrefix:!0},Yge=qe({...lW,border:{type:Boolean,default:!0},renderLabel:{type:Function}}),iN=t=>!0,Xge={[It]:iN,[En]:iN,close:()=>!0,"expand-change":t=>t},Jge=t=>M(()=>({...Gge,...t.props})),Zge=qe({...lW,size:$r,placeholder:String,disabled:{type:Boolean,default:void 0},clearable:Boolean,clearIcon:{type:ri,default:Nf},filterable:Boolean,filterMethod:{type:me(Function),default:(t,e)=>t.text.includes(e)},separator:{type:String,default:" / "},showAllLevels:{type:Boolean,default:!0},collapseTags:Boolean,maxCollapseTags:{type:Number,default:1},collapseTagsTooltip:Boolean,maxCollapseTagsTooltipHeight:{type:[String,Number]},debounce:{type:Number,default:300},beforeFilter:{type:me(Function),default:()=>!0},placement:{type:me(String),values:xu,default:"bottom-start"},fallbackPlacements:{type:me(Array),default:["bottom-start","bottom","top-start","top","right","left"]},popperClass:Mn.popperClass,popperStyle:Mn.popperStyle,teleported:Mn.teleported,effect:{type:me(String),default:"light"},tagType:{...Fv.type,default:"info"},tagEffect:{...Fv.effect,default:"light"},validateEvent:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},showCheckedStrategy:{type:String,values:["parent","child"],default:"child"},checkOnClickNode:Boolean,showPrefix:{type:Boolean,default:!0},...Gb}),rN=t=>!0,Qge={[It]:rN,[En]:rN,focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,visibleChange:t=>vi(t),expandChange:t=>!!t,removeTag:t=>!!t},uW={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},value:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:{type:Boolean,default:void 0},checked:Boolean,name:{type:String,default:void 0},trueValue:{type:[String,Number],default:void 0},falseValue:{type:[String,Number],default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},border:Boolean,size:$r,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},ariaLabel:String,...hs(["ariaControls"])},cW={[It]:t=>ot(t)||St(t)||vi(t),change:t=>ot(t)||St(t)||vi(t)},fg=Symbol("checkboxGroupContextKey"),epe=({model:t,isChecked:e})=>{const n=Ne(fg,void 0),i=Ne(Bf,void 0),r=M(()=>{var s,a;const l=(s=n?.max)==null?void 0:s.value,u=(a=n?.min)==null?void 0:a.value;return!pn(l)&&t.value.length>=l&&!e.value||!pn(u)&&t.value.length<=u&&e.value});return{isDisabled:Oi(M(()=>{var s,a;return n===void 0?(s=i?.disabled)!=null?s:r.value:((a=n.disabled)==null?void 0:a.value)||r.value})),isLimitDisabled:r}},tpe=(t,{model:e,isLimitExceeded:n,hasOwnLabel:i,isDisabled:r,isLabeledByFormItem:o})=>{const s=Ne(fg,void 0),{formItem:a}=lo(),{emit:l}=Ct();function u(m){var g,v,p,b;return[!0,t.trueValue,t.trueLabel].includes(m)?(v=(g=t.trueValue)!=null?g:t.trueLabel)!=null?v:!0:(b=(p=t.falseValue)!=null?p:t.falseLabel)!=null?b:!1}function c(m,g){l(En,u(m),g)}function d(m){if(n.value)return;const g=m.target;l(En,u(g.checked),m)}async function f(m){n.value||!i.value&&!r.value&&o.value&&(m.composedPath().some(p=>p.tagName==="LABEL")||(e.value=u([!1,t.falseValue,t.falseLabel].includes(e.value)),await Ye(),c(e.value,m)))}const h=M(()=>s?.validateEvent||t.validateEvent);return Se(()=>t.modelValue,()=>{h.value&&a?.validate("change").catch(m=>void 0)}),{handleChange:d,onClickRoot:f}},npe=t=>{const e=H(!1),{emit:n}=Ct(),i=Ne(fg,void 0),r=M(()=>pn(i)===!1),o=H(!1),s=M({get(){var a,l;return r.value?(a=i?.modelValue)==null?void 0:a.value:(l=t.modelValue)!=null?l:e.value},set(a){var l,u;r.value&&Pe(a)?(o.value=((l=i?.max)==null?void 0:l.value)!==void 0&&a.length>i?.max.value&&a.length>s.value.length,o.value===!1&&((u=i?.changeEvent)==null||u.call(i,a))):(n(It,a),e.value=a)}});return{model:s,isGroup:r,isLimitExceeded:o}},ipe=(t,e,{model:n})=>{const i=Ne(fg,void 0),r=H(!1),o=M(()=>Is(t.value)?t.label:t.value),s=M(()=>{const c=n.value;return vi(c)?c:Pe(c)?_t(o.value)?c.map(ln).some(d=>$i(d,o.value)):c.map(ln).includes(o.value):c!=null?c===t.trueValue||c===t.trueLabel:!!c}),a=fr(M(()=>{var c;return(c=i?.size)==null?void 0:c.value}),{prop:!0}),l=fr(M(()=>{var c;return(c=i?.size)==null?void 0:c.value})),u=M(()=>!!e.default||!Is(o.value));return{checkboxButtonSize:a,isChecked:s,isFocused:r,checkboxSize:l,hasOwnLabel:u,actualValue:o}},dW=(t,e)=>{const{formItem:n}=lo(),{model:i,isGroup:r,isLimitExceeded:o}=npe(t),{isFocused:s,isChecked:a,checkboxButtonSize:l,checkboxSize:u,hasOwnLabel:c,actualValue:d}=ipe(t,e,{model:i}),{isDisabled:f}=epe({model:i,isChecked:a}),{inputId:h,isLabeledByFormItem:m}=Au(t,{formItemContext:n,disableIdGeneration:c,disableIdManagement:r}),{handleChange:g,onClickRoot:v}=tpe(t,{model:i,isLimitExceeded:o,hasOwnLabel:c,isDisabled:f,isLabeledByFormItem:m});return(()=>{function b(){var y,_;Pe(i.value)&&!i.value.includes(d.value)?i.value.push(d.value):i.value=(_=(y=t.trueValue)!=null?y:t.trueLabel)!=null?_:!0}t.checked&&b()})(),of({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},M(()=>r.value&&Is(t.value))),of({from:"true-label",replacement:"true-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},M(()=>!!t.trueLabel)),of({from:"false-label",replacement:"false-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},M(()=>!!t.falseLabel)),{inputId:h,isLabeledByFormItem:m,isChecked:a,isDisabled:f,isFocused:s,checkboxButtonSize:l,checkboxSize:u,hasOwnLabel:c,model:i,actualValue:d,handleChange:g,onClickRoot:v}},rpe=["id","indeterminate","name","tabindex","disabled"];var fW=le({name:"ElCheckbox",__name:"checkbox",props:uW,emits:cW,setup(t){const e=t,n=$o(),{inputId:i,isLabeledByFormItem:r,isChecked:o,isDisabled:s,isFocused:a,checkboxSize:l,hasOwnLabel:u,model:c,actualValue:d,handleChange:f,onClickRoot:h}=dW(e,n),m=M(()=>{var b,y,_,C;return e.trueValue||e.falseValue||e.trueLabel||e.falseLabel?{"true-value":(y=(b=e.trueValue)!=null?b:e.trueLabel)!=null?y:!0,"false-value":(C=(_=e.falseValue)!=null?_:e.falseLabel)!=null?C:!1}:{value:d.value}}),g=De("checkbox"),v=M(()=>[g.b(),g.m(l.value),g.is("disabled",s.value),g.is("bordered",e.border),g.is("checked",o.value)]),p=M(()=>[g.e("input"),g.is("disabled",s.value),g.is("checked",o.value),g.is("indeterminate",e.indeterminate),g.is("focus",a.value)]);return(b,y)=>(B(),_e(Gt(!w(u)&&w(r)?"span":"label"),{for:!w(u)&&w(r)?null:w(i),class:$(v.value),"aria-controls":t.indeterminate?t.ariaControls:null,"aria-checked":t.indeterminate?"mixed":void 0,"aria-label":t.ariaLabel,onClick:w(h)},{default:ce(()=>[ie("span",{class:$(p.value)},[Vt(ie("input",Lt({id:w(i),"onUpdate:modelValue":y[0]||(y[0]=_=>rn(c)?c.value=_:null),class:w(g).e("original"),type:"checkbox",indeterminate:t.indeterminate,name:t.name,tabindex:t.tabindex,disabled:w(s)},m.value,{onChange:y[1]||(y[1]=(..._)=>w(f)&&w(f)(..._)),onFocus:y[2]||(y[2]=_=>a.value=!0),onBlur:y[3]||(y[3]=_=>a.value=!1),onClick:y[4]||(y[4]=Ot(()=>{},["stop"]))}),null,16,rpe),[[Zz,w(c)]]),ie("span",{class:$(w(g).e("inner"))},null,2)],2),w(u)?(B(),Q("span",{key:0,class:$(w(g).e("label"))},[we(b.$slots,"default"),b.$slots.default?ve("v-if",!0):(B(),Q(rt,{key:0},[dt(We(t.label),1)],64))],2)):ve("v-if",!0)]),_:3},8,["for","class","aria-controls","aria-checked","aria-label","onClick"]))}});const ope=["name","tabindex","disabled"];var ER=le({name:"ElCheckboxButton",__name:"checkbox-button",props:uW,emits:cW,setup(t){const e=t,n=$o(),{isFocused:i,isChecked:r,isDisabled:o,checkboxButtonSize:s,model:a,actualValue:l,handleChange:u}=dW(e,n),c=M(()=>{var g,v,p,b;return e.trueValue||e.falseValue||e.trueLabel||e.falseLabel?{"true-value":(v=(g=e.trueValue)!=null?g:e.trueLabel)!=null?v:!0,"false-value":(b=(p=e.falseValue)!=null?p:e.falseLabel)!=null?b:!1}:{value:l.value}}),d=Ne(fg,void 0),f=De("checkbox"),h=M(()=>{var g,v,p,b;const y=(v=(g=d?.fill)==null?void 0:g.value)!=null?v:"";return{backgroundColor:y,borderColor:y,color:(b=(p=d?.textColor)==null?void 0:p.value)!=null?b:"",boxShadow:y?`-1px 0 0 0 ${y}`:void 0}}),m=M(()=>[f.b("button"),f.bm("button",s.value),f.is("disabled",o.value),f.is("checked",r.value),f.is("focus",i.value)]);return(g,v)=>(B(),Q("label",{class:$(m.value)},[Vt(ie("input",Lt({"onUpdate:modelValue":v[0]||(v[0]=p=>rn(a)?a.value=p:null),class:w(f).be("button","original"),type:"checkbox",name:t.name,tabindex:t.tabindex,disabled:w(o)},c.value,{onChange:v[1]||(v[1]=(...p)=>w(u)&&w(u)(...p)),onFocus:v[2]||(v[2]=p=>i.value=!0),onBlur:v[3]||(v[3]=p=>i.value=!1),onClick:v[4]||(v[4]=Ot(()=>{},["stop"]))}),null,16,ope),[[Zz,w(a)]]),g.$slots.default||t.label?(B(),Q("span",{key:0,class:$(w(f).be("button","inner")),style:mt(w(r)?h.value:void 0)},[we(g.$slots,"default",{},()=>[dt(We(t.label),1)])],6)):ve("v-if",!0)],2))}});const spe=qe({modelValue:{type:me(Array),default:()=>[]},disabled:{type:Boolean,default:void 0},min:Number,max:Number,size:$r,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},options:{type:me(Array)},props:{type:me(Object),default:()=>hW},type:{type:String,values:["checkbox","button"],default:"checkbox"},...hs(["ariaLabel"])}),ape={[It]:t=>Pe(t),change:t=>Pe(t)},hW={label:"label",value:"value",disabled:"disabled"};var mW=le({name:"ElCheckboxGroup",__name:"checkbox-group",props:spe,emits:ape,setup(t,{emit:e}){const n=t,i=e,r=De("checkbox"),o=Oi(),{formItem:s}=lo(),{inputId:a,isLabeledByFormItem:l}=Au(n,{formItemContext:s}),u=async m=>{i(It,m),await Ye(),i(En,m)},c=M({get(){return n.modelValue},set(m){u(m)}}),d=M(()=>({...hW,...n.props})),f=m=>{const{label:g,value:v,disabled:p}=d.value,b={label:m[g],value:m[v],disabled:m[p]};return{...IC(m,[g,v,p]),...b}},h=M(()=>n.type==="button"?ER:fW);return qt(fg,{...ZI(Sr(n),["size","min","max","validateEvent","fill","textColor"]),disabled:o,modelValue:c,changeEvent:u}),Se(()=>n.modelValue,(m,g)=>{n.validateEvent&&!$i(m,g)&&s?.validate("change").catch(v=>void 0)}),(m,g)=>{var v;return B(),_e(Gt(t.tag),{id:w(a),class:$(w(r).b("group")),role:"group","aria-label":w(l)?void 0:t.ariaLabel||"checkbox-group","aria-labelledby":w(l)?(v=w(s))==null?void 0:v.labelId:void 0},{default:ce(()=>[we(m.$slots,"default",{},()=>[(B(!0),Q(rt,null,gn(t.options,(p,b)=>(B(),_e(Gt(h.value),Lt({key:b},{ref_for:!0},f(p)),null,16))),128))])]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});const Ac=sn(fW,{CheckboxButton:ER,CheckboxGroup:mW});Zi(ER);const gW=Zi(mW),pW=qe({modelValue:{type:[String,Number,Boolean],default:void 0},size:$r,disabled:{type:Boolean,default:void 0},label:{type:[String,Number,Boolean],default:void 0},value:{type:[String,Number,Boolean],default:void 0},name:{type:String,default:void 0}}),lpe=qe({...pW,border:Boolean}),vW={[It]:t=>ot(t)||St(t)||vi(t),[En]:t=>ot(t)||St(t)||vi(t)},bW=Symbol("radioGroupKey"),yW=(t,e)=>{const n=H(),i=Ne(bW,void 0),r=M(()=>!!i),o=M(()=>Is(t.value)?t.label:t.value),s=M({get(){return r.value?i.modelValue:t.modelValue},set(d){r.value?i.changeEvent(d):e&&e(It,d),n.value.checked=t.modelValue===o.value}}),a=fr(M(()=>i?.size)),l=Oi(M(()=>i?.disabled)),u=H(!1),c=M(()=>l.value||r.value&&s.value!==o.value?-1:0);return of({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-radio",ref:"https://element-plus.org/en-US/component/radio.html"},M(()=>r.value&&Is(t.value))),{radioRef:n,isGroup:r,radioGroup:i,focus:u,size:a,disabled:l,tabIndex:c,modelValue:s,actualValue:o}},upe=["value","name","disabled","checked"];var wW=le({name:"ElRadio",__name:"radio",props:lpe,emits:vW,setup(t,{emit:e}){const n=t,i=e,r=De("radio"),{radioRef:o,radioGroup:s,focus:a,size:l,disabled:u,modelValue:c,actualValue:d}=yW(n,i);function f(){Ye(()=>i(En,c.value))}return(h,m)=>{var g;return B(),Q("label",{class:$([w(r).b(),w(r).is("disabled",w(u)),w(r).is("focus",w(a)),w(r).is("bordered",t.border),w(r).is("checked",w(c)===w(d)),w(r).m(w(l))])},[ie("span",{class:$([w(r).e("input"),w(r).is("disabled",w(u)),w(r).is("checked",w(c)===w(d))])},[Vt(ie("input",{ref_key:"radioRef",ref:o,"onUpdate:modelValue":m[0]||(m[0]=v=>rn(c)?c.value=v:null),class:$(w(r).e("original")),value:w(d),name:t.name||((g=w(s))==null?void 0:g.name),disabled:w(u),checked:w(c)===w(d),type:"radio",onFocus:m[1]||(m[1]=v=>a.value=!0),onBlur:m[2]||(m[2]=v=>a.value=!1),onChange:f,onClick:m[3]||(m[3]=Ot(()=>{},["stop"]))},null,42,upe),[[Qz,w(c)]]),ie("span",{class:$(w(r).e("inner"))},null,2)],2),ie("span",{class:$(w(r).e("label")),onKeydown:m[4]||(m[4]=Ot(()=>{},["stop"]))},[we(h.$slots,"default",{},()=>[dt(We(t.label),1)])],34)],2)}}});const cpe=qe({...pW}),dpe=["value","name","disabled"];var xR=le({name:"ElRadioButton",__name:"radio-button",props:cpe,setup(t){const e=t,n=De("radio"),{radioRef:i,focus:r,size:o,disabled:s,modelValue:a,radioGroup:l,actualValue:u}=yW(e),c=M(()=>({backgroundColor:l?.fill||"",borderColor:l?.fill||"",boxShadow:l?.fill?`-1px 0 0 0 ${l.fill}`:"",color:l?.textColor||""}));return(d,f)=>{var h;return B(),Q("label",{class:$([w(n).b("button"),w(n).is("active",w(a)===w(u)),w(n).is("disabled",w(s)),w(n).is("focus",w(r)),w(n).bm("button",w(o))])},[Vt(ie("input",{ref_key:"radioRef",ref:i,"onUpdate:modelValue":f[0]||(f[0]=m=>rn(a)?a.value=m:null),class:$(w(n).be("button","original-radio")),value:w(u),type:"radio",name:t.name||((h=w(l))==null?void 0:h.name),disabled:w(s),onFocus:f[1]||(f[1]=m=>r.value=!0),onBlur:f[2]||(f[2]=m=>r.value=!1),onClick:f[3]||(f[3]=Ot(()=>{},["stop"]))},null,42,dpe),[[Qz,w(a)]]),ie("span",{class:$(w(n).be("button","inner")),style:mt(w(a)===w(u)?c.value:{}),onKeydown:f[4]||(f[4]=Ot(()=>{},["stop"]))},[we(d.$slots,"default",{},()=>[dt(We(t.label),1)])],38)],2)}}});const _W={label:"label",value:"value",disabled:"disabled"},fpe=qe({id:{type:String,default:void 0},size:$r,disabled:{type:Boolean,default:void 0},modelValue:{type:[String,Number,Boolean],default:void 0},fill:{type:String,default:""},textColor:{type:String,default:""},name:{type:String,default:void 0},validateEvent:{type:Boolean,default:!0},options:{type:me(Array)},props:{type:me(Object),default:()=>_W},type:{type:String,values:["radio","button"],default:"radio"},...hs(["ariaLabel"])}),hpe=vW,mpe=["id","aria-label","aria-labelledby"];var CW=le({name:"ElRadioGroup",__name:"radio-group",props:fpe,emits:hpe,setup(t,{emit:e}){const n=t,i=e,r=De("radio"),o=as(),s=H(),{formItem:a}=lo(),{inputId:l,isLabeledByFormItem:u}=Au(n,{formItemContext:a}),c=g=>{i(It,g),Ye(()=>i(En,g))};Pt(()=>{const g=s.value.querySelectorAll("[type=radio]"),v=g[0];!Array.from(g).some(p=>p.checked)&&v&&(v.tabIndex=0)});const d=M(()=>n.name||o.value),f=M(()=>({..._W,...n.props})),h=g=>{const{label:v,value:p,disabled:b}=f.value,y={label:g[v],value:g[p],disabled:g[b]};return{...IC(g,[v,p,b]),...y}},m=M(()=>n.type==="button"?xR:wW);return qt(bW,on({...Sr(n),changeEvent:c,name:d})),Se(()=>n.modelValue,(g,v)=>{n.validateEvent&&!$i(g,v)&&a?.validate("change").catch(p=>void 0)}),(g,v)=>(B(),Q("div",{id:w(l),ref_key:"radioGroupRef",ref:s,class:$(w(r).b("group")),role:"radiogroup","aria-label":w(u)?void 0:t.ariaLabel||"radio-group","aria-labelledby":w(u)?w(a).labelId:void 0},[we(g.$slots,"default",{},()=>[(B(!0),Q(rt,null,gn(t.options,(p,b)=>(B(),_e(Gt(m.value),Lt({key:b},{ref_for:!0},h(p)),null,16))),128))])],10,mpe))}});const SW=sn(wW,{RadioButton:xR,RadioGroup:CW}),gpe=Zi(CW);Zi(xR);const $C=Symbol();function ppe(t){return!!(Pe(t)?t.every(({type:e})=>e===xi):t?.type===xi)}var vpe=le({name:"NodeContent",props:{node:{type:Object,required:!0}},setup(t){const e=De("cascader-node"),{renderLabelFn:n}=Ne($C),{node:i}=t,{data:r,label:o}=i,s=()=>{const a=n?.({node:i,data:r});return ppe(a)?o:a??o};return()=>L("span",{class:e.e("label")},[s()])}});const bpe=["id","aria-haspopup","aria-owns","aria-expanded","tabindex"];var ype=le({name:"ElCascaderNode",__name:"node",props:{node:{type:Object,required:!0},menuId:String},emits:["expand"],setup(t,{emit:e}){const n=t,i=e,r=Ne($C),o=De("cascader-node"),s=M(()=>r.isHoverMenu),a=M(()=>r.config.multiple),l=M(()=>r.config.checkStrictly),u=M(()=>r.config.showPrefix),c=M(()=>{var E;return(E=r.checkedNodes[0])==null?void 0:E.uid}),d=M(()=>n.node.isDisabled),f=M(()=>n.node.isLeaf),h=M(()=>l.value&&!f.value||!d.value),m=M(()=>v(r.expandingNode)),g=M(()=>l.value&&r.checkedNodes.some(v)),v=E=>{var x;const{level:P,uid:A}=n.node;return((x=E?.pathNodes[P-1])==null?void 0:x.uid)===A},p=()=>{m.value||r.expandNode(n.node)},b=E=>{const{node:x}=n;E!==x.checked&&r.handleCheckChange(x,E)},y=()=>{r.lazyLoad(n.node,()=>{f.value||p()})},_=E=>{s.value&&(C(),!f.value&&i("expand",E))},C=()=>{const{node:E}=n;!h.value||E.loading||(E.loaded?p():y())},S=()=>{f.value&&!d.value&&!l.value&&!a.value?T(!0):(r.config.checkOnClickNode&&(a.value||l.value)||f.value&&r.config.checkOnClickLeaf)&&!d.value?k(!n.node.checked):s.value||C()},k=E=>{l.value?(b(E),n.node.loaded&&p()):T(E)},T=E=>{n.node.loaded?(b(E),!l.value&&p()):y()};return(E,x)=>(B(),Q("li",{id:`${t.menuId}-${t.node.uid}`,role:"menuitem","aria-haspopup":!f.value,"aria-owns":f.value?void 0:t.menuId,"aria-expanded":m.value,tabindex:h.value?-1:void 0,class:$([w(o).b(),w(o).is("selectable",l.value),w(o).is("active",t.node.checked),w(o).is("disabled",!h.value),m.value&&"in-active-path",g.value&&"in-checked-path"]),onMouseenter:_,onFocus:_,onClick:S},[ve(" prefix "),a.value&&u.value?(B(),_e(w(Ac),{key:0,"model-value":t.node.checked,indeterminate:t.node.indeterminate,disabled:d.value,onClick:x[0]||(x[0]=Ot(()=>{},["stop"])),"onUpdate:modelValue":k},null,8,["model-value","indeterminate","disabled"])):l.value&&u.value?(B(),_e(w(SW),{key:1,"model-value":c.value,label:t.node.uid,disabled:d.value,"onUpdate:modelValue":k,onClick:x[1]||(x[1]=Ot(()=>{},["stop"]))},{default:ce(()=>[ve(` + Add an empty element to avoid render label, + do not use empty fragment here for https://github.com/vuejs/vue-next/pull/2485 + `),x[2]||(x[2]=ie("span",null,null,-1))]),_:1},8,["model-value","label","disabled"])):f.value&&t.node.checked?(B(),_e(w(He),{key:2,class:$(w(o).e("prefix"))},{default:ce(()=>[L(w(LC))]),_:1},8,["class"])):ve("v-if",!0),ve(" content "),L(w(vpe),{node:t.node},null,8,["node"]),ve(" postfix "),f.value?ve("v-if",!0):(B(),Q(rt,{key:3},[t.node.loading?(B(),_e(w(He),{key:0,class:$([w(o).is("loading"),w(o).e("postfix")])},{default:ce(()=>[L(w(xc))]),_:1},8,["class"])):(B(),_e(w(He),{key:1,class:$(["arrow-right",w(o).e("postfix")])},{default:ce(()=>[L(w(oa))]),_:1},8,["class"]))],64))],42,bpe))}}),wpe=le({name:"ElCascaderMenu",__name:"menu",props:{nodes:{type:Array,required:!0},index:{type:Number,required:!0}},setup(t){const e=t,n=Ct(),i=De("cascader-menu"),{t:r}=Qt(),o=as();let s,a;const l=Ne($C),u=H(),c=M(()=>!e.nodes.length),d=M(()=>!l.initialLoaded),f=M(()=>`${o.value}-${e.index}`),h=p=>{s=p.target},m=p=>{var b;if(!(!l.isHoverMenu||!s||!u.value))if(s.contains(p.target)){g();const y=n.vnode.el,{left:_}=y.getBoundingClientRect(),{offsetWidth:C,offsetHeight:S}=y,k=p.clientX-_,T=s.offsetTop,E=T+s.offsetHeight,x=((b=y.querySelector(`.${i.e("wrap")}`))==null?void 0:b.scrollTop)||0;u.value.innerHTML=` + + + `}else a||(a=window.setTimeout(v,l.config.hoverThreshold))},g=()=>{a&&(clearTimeout(a),a=void 0)},v=()=>{u.value&&(u.value.innerHTML="",g())};return(p,b)=>(B(),_e(w(gu),{key:f.value,tag:"ul",role:"menu",class:$(w(i).b()),"wrap-class":w(i).e("wrap"),"view-class":[w(i).e("list"),w(i).is("empty",c.value)],onMousemove:m,onMouseleave:v},{default:ce(()=>{var y;return[(B(!0),Q(rt,null,gn(t.nodes,_=>(B(),_e(ype,{key:_.uid,node:_,"menu-id":f.value,onExpand:h},null,8,["node","menu-id"]))),128)),d.value?(B(),Q("div",{key:0,class:$(w(i).e("empty-text"))},[L(w(He),{size:"14",class:$(w(i).is("loading"))},{default:ce(()=>[L(w(xc))]),_:1},8,["class"]),dt(" "+We(w(r)("el.cascader.loading")),1)],2)):c.value?(B(),Q("div",{key:1,class:$(w(i).e("empty-text"))},[we(p.$slots,"empty",{},()=>[dt(We(w(r)("el.cascader.noData")),1)])],2)):(y=w(l))!=null&&y.isHoverMenu?(B(),Q(rt,{key:2},[ve(" eslint-disable vue/html-self-closing "),(B(),Q("svg",{ref_key:"hoverZone",ref:u,class:$(w(i).e("hover-zone"))},null,2))],2112)):ve("v-if",!0),ve(" eslint-enable vue/html-self-closing ")]}),_:3},8,["class","wrap-class","view-class"]))}}),_pe=Object.defineProperty,Cpe=(t,e,n)=>e in t?_pe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ho=(t,e,n)=>Cpe(t,typeof e!="symbol"?e+"":e,n);let Spe=0;const kpe=t=>{const e=[t];let{parent:n}=t;for(;n;)e.unshift(n),n=n.parent;return e};let v2=class b2{constructor(e,n,i,r=!1){this.data=e,this.config=n,this.parent=i,this.root=r,ho(this,"uid",Spe++),ho(this,"level"),ho(this,"value"),ho(this,"label"),ho(this,"pathNodes"),ho(this,"pathValues"),ho(this,"pathLabels"),ho(this,"childrenData"),ho(this,"children"),ho(this,"text"),ho(this,"loaded"),ho(this,"checked",!1),ho(this,"indeterminate",!1),ho(this,"loading",!1);const{value:o,label:s,children:a}=n,l=e[a],u=kpe(this);this.level=r?0:i?i.level+1:1,this.value=e[o],this.label=e[s],this.pathNodes=u,this.pathValues=u.map(c=>c.value),this.pathLabels=u.map(c=>c.label),this.childrenData=l,this.children=(l||[]).map(c=>new b2(c,n,this)),this.loaded=!n.lazy||this.isLeaf||!xm(l),this.text=""}get isDisabled(){const{data:e,parent:n,config:i}=this,{disabled:r,checkStrictly:o}=i;return(Xe(r)?r(e,this):!!e[r])||!o&&!!n?.isDisabled}get isLeaf(){const{data:e,config:n,childrenData:i,loaded:r}=this,{lazy:o,leaf:s}=n,a=Xe(s)?s(e,this):e[s];return pn(a)?o&&!r?!1:!(Pe(i)&&i.length):!!a}get valueByOption(){return this.config.emitPath?this.pathValues:this.value}appendChild(e){const{childrenData:n,children:i}=this,r=new b2(e,this.config,this);return Pe(n)?n.push(e):this.childrenData=[e],i.push(r),r}calcText(e,n){const i=e?this.pathLabels.join(n):this.label;return this.text=i,i}broadcast(e){this.children.forEach(n=>{var i;n&&(n.broadcast(e),(i=n.onParentCheck)==null||i.call(n,e))})}emit(){var e;const{parent:n}=this;n&&((e=n.onChildCheck)==null||e.call(n),n.emit())}onParentCheck(e){this.isDisabled||this.setCheckState(e)}onChildCheck(){const{children:e}=this,n=e.filter(r=>!r.isDisabled),i=n.length?n.every(r=>r.checked):!1;this.setCheckState(i)}setCheckState(e){const n=this.children.length,i=this.children.reduce((r,o)=>{const s=o.checked?1:o.indeterminate?.5:0;return r+s},0);this.checked=this.loaded&&this.children.filter(r=>!r.isDisabled).every(r=>r.loaded&&r.checked)&&e,this.indeterminate=this.loaded&&i!==n&&i>0}doCheck(e){if(this.checked===e)return;const{checkStrictly:n,multiple:i}=this.config;n||!i?this.checked=e:(this.broadcast(e),this.setCheckState(e),this.emit())}};var Tpe=Object.defineProperty,Epe=(t,e,n)=>e in t?Tpe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ek=(t,e,n)=>Epe(t,typeof e!="symbol"?e+"":e,n);const y2=(t,e)=>t.reduce((n,i)=>(i.isLeaf?n.push(i):(!e&&n.push(i),n=n.concat(y2(i.children,e))),n),[]);class oN{constructor(e,n){this.config=n,Ek(this,"nodes"),Ek(this,"allNodes"),Ek(this,"leafNodes");const i=(e||[]).map(r=>new v2(r,this.config));this.nodes=i,this.allNodes=y2(i,!1),this.leafNodes=y2(i,!0)}getNodes(){return this.nodes}getFlattedNodes(e){return e?this.leafNodes:this.allNodes}appendNode(e,n){const i=n?n.appendChild(e):new v2(e,this.config);n||this.nodes.push(i),this.appendAllNodesAndLeafNodes(i)}appendNodes(e,n){e.length>0?e.forEach(i=>this.appendNode(i,n)):n&&n.isLeaf&&this.leafNodes.push(n)}appendAllNodesAndLeafNodes(e){this.allNodes.push(e),e.isLeaf&&this.leafNodes.push(e),e.children&&e.children.forEach(n=>{this.appendAllNodesAndLeafNodes(n)})}getNodeByValue(e,n=!1){return Is(e)?null:this.getFlattedNodes(n).find(r=>$i(r.value,e)||$i(r.pathValues,e))||null}getSameNode(e){return e&&this.getFlattedNodes(!1).find(({value:i,level:r})=>$i(e.value,i)&&e.level===r)||null}}const sN=t=>{if(!t)return 0;const e=t.id.split("-");return Number(e[e.length-2])},xpe=t=>{if(!t)return;const e=t.querySelector("input");e?e.click():MU(t)&&t.click()},Ape=(t,e)=>{const n=e.slice(0),i=n.map(o=>o.uid),r=t.reduce((o,s)=>{const a=i.indexOf(s.uid);return a>-1&&(o.push(s),n.splice(a,1),i.splice(a,1)),o},[]);return r.push(...n),r};var Ppe=le({name:"ElCascaderPanel",__name:"index",props:Yge,emits:Xge,setup(t,{expose:e,emit:n}){const i=t,r=n;let o=!1;const s=De("cascader"),a=Jge(i),l=$o();let u;const c=H(!0),d=H(!1),f=H([]),h=H(),m=H([]),g=H(),v=H([]),p=M(()=>a.value.expandTrigger==="hover"),b=M(()=>i.renderLabel||l.default),y=()=>{const{options:R}=i,O=a.value;o=!1,u=new oN(R,O),m.value=[u.getNodes()],O.lazy&&xm(i.options)?(c.value=!1,_(void 0,N=>{N&&(u=new oN(N,O),m.value=[u.getNodes()]),c.value=!0,A(!1,!0)})):A(!1,!0)},_=(R,O)=>{const N=a.value;R=R||new v2({},N,void 0,!0),R.loading=!0;const F=U=>{const W=R,J=W.root?null:W;W.loading=!1,W.loaded=!0,W.childrenData=W.childrenData||[],U&&u?.appendNodes(U,J),U&&O?.(U),R.level===0&&(d.value=!0)},j=()=>{R.loading=!1,R.loaded=!1,R.level===0&&(c.value=!0)};N.lazyLoad(R,F,j)},C=(R,O)=>{var N;const{level:F}=R,j=m.value.slice(0,F);let U;R.isLeaf?U=R.pathNodes[F-2]:(U=R,j.push(R.children)),((N=g.value)==null?void 0:N.uid)!==U?.uid&&(g.value=R,m.value=j,!O&&r("expand-change",R?.pathValues||[]))},S=(R,O,N=!0)=>{const{checkStrictly:F,multiple:j}=a.value,U=v.value[0];o=!0,!j&&U?.doCheck(!1),R.doCheck(O),P(),N&&!j&&!F&&r("close"),!N&&!j&&k(R)},k=R=>{R&&(R=R.parent,k(R),R&&C(R))},T=R=>u?.getFlattedNodes(R),E=R=>{var O;return(O=T(R))==null?void 0:O.filter(({checked:N})=>N!==!1)},x=()=>{v.value.forEach(R=>R.doCheck(!1)),P(),m.value=m.value.slice(0,1),g.value=void 0,r("expand-change",[])},P=()=>{var R;const{checkStrictly:O,multiple:N}=a.value,F=v.value,j=E(!O),U=Ape(F,j),W=U.map(J=>J.valueByOption);v.value=U,h.value=N?W:(R=W[0])!=null?R:null},A=(R=!1,O=!1)=>{const{modelValue:N}=i,{lazy:F,multiple:j,checkStrictly:U}=a.value,W=!U;if(!(!c.value||o||!O&&$i(N,h.value)))if(F&&!R){const ne=qD(jue(Br(N))).map(he=>u?.getNodeByValue(he)).filter(he=>!!he&&!he.loaded&&!he.loading);ne.length?ne.forEach(he=>{_(he,()=>A(!1,O))}):A(!0,O)}else{const J=j?Br(N):[N],ne=qD(J.map(he=>u?.getNodeByValue(he,W)));I(ne,O),h.value=V_(N??void 0)}},I=(R,O=!0)=>{const{checkStrictly:N}=a.value,F=v.value,j=R.filter(J=>!!J&&(N||J.isLeaf)),U=u?.getSameNode(g.value),W=O&&U||j[0];W?W.pathNodes.forEach(J=>C(J,!0)):g.value=void 0,F.forEach(J=>J.doCheck(!1)),on(j).forEach(J=>J.doCheck(!0)),v.value=j,Ye(D)},D=()=>{Zt&&f.value.forEach(R=>{const O=R?.$el;if(O){const N=O.querySelector(`.${s.namespace.value}-scrollbar__wrap`);let F=O.querySelector(`.${s.b("node")}.in-active-path`);if(!F){const j=O.querySelectorAll(`.${s.b("node")}.${s.is("active")}`);F=j[j.length-1]}uU(N,F)}})},q=R=>{const O=R.target,N=Bn(R);switch(N){case Me.up:case Me.down:{R.preventDefault();const F=N===Me.up?-1:1;Tw(OU(O,F,`.${s.b("node")}[tabindex="-1"]`));break}case Me.left:{R.preventDefault();const F=f.value[sN(O)-1],j=F?.$el.querySelector(`.${s.b("node")}[aria-expanded="true"]`);Tw(j);break}case Me.right:{R.preventDefault();const F=f.value[sN(O)+1],j=F?.$el.querySelector(`.${s.b("node")}[tabindex="-1"]`);Tw(j);break}case Me.enter:case Me.numpadEnter:xpe(O);break}};qt($C,on({config:a,expandingNode:g,checkedNodes:v,isHoverMenu:p,initialLoaded:c,renderLabelFn:b,lazyLoad:_,expandNode:C,handleCheckChange:S})),Se(a,(R,O)=>{$i(R,O)||y()},{immediate:!0}),Se(()=>i.options,y,{deep:!0}),Se(()=>i.modelValue,()=>{o=!1,A()},{deep:!0}),Se(()=>h.value,R=>{$i(R,i.modelValue)||(r(It,R),r(En,R))});const z=()=>{d.value||y()};return xI(()=>f.value=[]),Pt(()=>!xm(i.modelValue)&&A()),e({menuList:f,menus:m,checkedNodes:v,handleKeyDown:q,handleCheckChange:S,getFlattedNodes:T,getCheckedNodes:E,clearCheckedNodes:x,calculateCheckedValue:P,scrollToExpandingNode:D,loadLazyRootNodes:z}),(R,O)=>(B(),Q("div",{class:$([w(s).b("panel"),w(s).is("bordered",t.border)]),onKeydown:q},[(B(!0),Q(rt,null,gn(m.value,(N,F)=>(B(),_e(wpe,{key:F,ref_for:!0,ref:j=>f.value[F]=j,index:F,nodes:[...N]},{empty:ce(()=>[we(R.$slots,"empty")]),_:3},8,["index","nodes"]))),128))],34))}});const Ipe=sn(Ppe),Rpe=["placeholder"],Mpe=["onClick"];var Ope=le({name:"ElCascader",__name:"cascader",props:Zge,emits:Qge,setup(t,{expose:e,emit:n}){const i={modifiers:[{name:"arrowPosition",enabled:!0,phase:"main",fn:({state:Oe})=>{const{modifiersData:Fe,placement:st}=Oe;["right","left","bottom","top"].includes(st)||Fe.arrow&&(Fe.arrow.x=35)},requires:["arrow"]}]},r=t,o=n,s=Rf(),a=$o();let l=0,u=0;const c=De("cascader"),d=De("input"),f={small:7,default:11,large:15},{t:h}=Qt(),{formItem:m}=lo(),g=Oi(),{valueOnClear:v}=OC(r),{isComposing:p,handleComposition:b}=bR({afterComposition(Oe){var Fe;const st=(Fe=Oe.target)==null?void 0:Fe.value;gt(st)}}),y=H(),_=H(),C=H(),S=H(),k=H(),T=H(),E=H(!1),x=H(!1),P=H(!1),A=H(""),I=H(""),D=H([]),q=H([]),z=M(()=>r.props.multiple?r.collapseTags?D.value.slice(0,r.maxCollapseTags):D.value:[]),R=M(()=>r.props.multiple?r.collapseTags?D.value.slice(r.maxCollapseTags):[]:[]),O=M(()=>s.style),N=M(()=>{var Oe;return(Oe=r.placeholder)!=null?Oe:h("el.cascader.placeholder")}),F=M(()=>I.value||D.value.length>0||p.value?"":N.value),j=fr(),U=M(()=>j.value==="small"?"small":"default"),W=M(()=>!!r.props.multiple),J=M(()=>!r.filterable||W.value),ne=M(()=>W.value?I.value:A.value),he=M(()=>{var Oe;return((Oe=k.value)==null?void 0:Oe.checkedNodes)||[]}),{wrapperRef:X,isFocused:se,handleBlur:re}=dg(C,{disabled:g,beforeBlur(Oe){var Fe,st;return((Fe=y.value)==null?void 0:Fe.isFocusInsideContent(Oe))||((st=_.value)==null?void 0:st.isFocusInsideContent(Oe))},afterBlur(){var Oe;r.validateEvent&&((Oe=m?.validate)==null||Oe.call(m,"blur").catch(Fe=>void 0))}}),ee=M(()=>!r.clearable||g.value||P.value||!x.value&&!se.value?!1:!!he.value.length),te=M(()=>{const{showAllLevels:Oe,separator:Fe}=r,st=he.value;return st.length?W.value?"":st[0].calcText(Oe,Fe):""}),V=M(()=>m?.validateState||""),K=M({get(){return V_(r.modelValue)},set(Oe){const Fe=Oe??v.value;o(It,Fe),o(En,Fe),r.validateEvent&&m?.validate("change").catch(st=>void 0)}}),G=M(()=>[c.b(),c.m(j.value),c.is("disabled",g.value),s.class]),ye=M(()=>[d.e("icon"),"icon-arrow-down",c.is("reverse",E.value)]),be=M(()=>c.is("focus",se.value)),Ce=M(()=>{var Oe,Fe;return(Fe=(Oe=y.value)==null?void 0:Oe.popperRef)==null?void 0:Fe.contentRef}),Y=Oe=>{if(se.value){const Fe=new FocusEvent("blur",Oe);re(Fe)}Z(!1)},Z=Oe=>{var Fe,st;g.value||(Oe=Oe??!E.value,Oe!==E.value&&(E.value=Oe,(st=(Fe=C.value)==null?void 0:Fe.input)==null||st.setAttribute("aria-expanded",`${Oe}`),Oe?(ae(),k.value&&Ye(k.value.scrollToExpandingNode)):r.filterable&&kt(),o("visibleChange",Oe)))},ae=()=>{Ye(()=>{var Oe;(Oe=y.value)==null||Oe.updatePopper()})},pe=()=>{P.value=!1},je=Oe=>{const{showAllLevels:Fe,separator:st}=r;return{node:Oe,key:Oe.uid,text:Oe.calcText(Fe,st),hitState:!1,closable:!g.value&&!Oe.isDisabled}},Ie=Oe=>{var Fe;const st=Oe.node;st.doCheck(!1),(Fe=k.value)==null||Fe.calculateCheckedValue(),o("removeTag",st.valueByOption)},fe=()=>{switch(r.showCheckedStrategy){case"child":return he.value;case"parent":{const Oe=Ke(!1),Fe=Oe.map(Vn=>Vn.value);return Oe.filter(Vn=>!Vn.parent||!Fe.includes(Vn.parent.value))}default:return[]}},Te=()=>{if(!W.value)return;const Oe=fe(),Fe=[];Oe.forEach(st=>Fe.push(je(st))),D.value=Fe},et=()=>{var Oe,Fe;const{filterMethod:st,showAllLevels:Vn,separator:en}=r,Ue=(Fe=(Oe=k.value)==null?void 0:Oe.getFlattedNodes(!r.props.checkStrictly))==null?void 0:Fe.filter(tt=>tt.isDisabled?!1:(tt.calcText(Vn,en),st(tt,ne.value)));W.value&&D.value.forEach(tt=>{tt.hitState=!1}),P.value=!0,q.value=Ue,ae()},Re=()=>{var Oe;let Fe;P.value&&T.value?Fe=T.value.$el.querySelector(`.${c.e("suggestion-item")}`):Fe=(Oe=k.value)==null?void 0:Oe.$el.querySelector(`.${c.b("node")}[tabindex="-1"]`),Fe&&(Fe.focus(),!P.value&&Fe.click())},ze=()=>{var Oe,Fe,st;const Vn=(Oe=C.value)==null?void 0:Oe.input,en=S.value,Ue=(Fe=T.value)==null?void 0:Fe.$el;if(!(!Zt||!Vn)){if(Ue){const tt=Ue.querySelector(`.${c.e("suggestion-list")}`);tt.style.minWidth=`${Vn.offsetWidth}px`}if(en){const{offsetHeight:tt}=en,pt=D.value.length>0?`${Math.max(tt,l)-2}px`:`${l}px`;if(Vn.style.height=pt,a.prefix){const jr=(st=C.value)==null?void 0:st.$el.querySelector(`.${d.e("prefix")}`);let Uo=0;jr&&(Uo=jr.offsetWidth,Uo>0&&(Uo+=f[j.value||"default"])),en.style.left=`${Uo}px`}else en.style.left="0";ae()}}},Ke=Oe=>{var Fe;return(Fe=k.value)==null?void 0:Fe.getCheckedNodes(Oe)},Dt=Oe=>{ae(),o("expandChange",Oe)},Cn=Oe=>{if(p.value)return;switch(Bn(Oe)){case Me.enter:case Me.numpadEnter:Z();break;case Me.down:Z(!0),Ye(Re),Oe.preventDefault();break;case Me.esc:E.value===!0&&(Oe.preventDefault(),Oe.stopPropagation(),Z(!1));break;case Me.tab:Z(!1);break}},Je=()=>{var Oe;(Oe=k.value)==null||Oe.clearCheckedNodes(),!E.value&&r.filterable&&kt(),Z(!1),o("clear")},kt=()=>{const{value:Oe}=te;A.value=Oe,I.value=Oe},Et=Oe=>{var Fe,st;const{checked:Vn}=Oe;W.value?(Fe=k.value)==null||Fe.handleCheckChange(Oe,!Vn,!1):(!Vn&&((st=k.value)==null||st.handleCheckChange(Oe,!0,!1)),Z(!1))},ge=Oe=>{const Fe=Oe.target,st=Bn(Oe);switch(st){case Me.up:case Me.down:{Oe.preventDefault();const Vn=st===Me.up?-1:1;Tw(OU(Fe,Vn,`.${c.e("suggestion-item")}[tabindex="-1"]`));break}case Me.enter:case Me.numpadEnter:Fe.click();break}},Le=()=>{const Oe=D.value[D.value.length-1];u=I.value?0:u+1,!(!Oe||!u||r.collapseTags&&D.value.length>1)&&(Oe.hitState?Ie(Oe):Oe.hitState=!0)},de=M(()=>r.debounce),Ve=eR(()=>{const{value:Oe}=ne;if(!Oe)return;const Fe=r.beforeFilter(Oe);_v(Fe)?Fe.then(et).catch(()=>{}):Fe!==!1?et():pe()},de),gt=(Oe,Fe)=>{!E.value&&Z(!0),!Fe?.isComposing&&(Oe?Ve():pe())},an=Oe=>Number.parseFloat(Bce(d.cssVarName("input-height"),Oe).value)-2,Si=()=>{var Oe;(Oe=C.value)==null||Oe.focus()},uo=()=>{var Oe;(Oe=C.value)==null||Oe.blur()};return Se(P,ae),Se([he,g,()=>r.collapseTags,()=>r.maxCollapseTags],Te),Se(D,()=>{Ye(()=>ze())}),Se(j,async()=>{await Ye();const Oe=C.value.input;l=an(Oe)||l,ze()}),Se(te,kt,{immediate:!0}),Se(()=>E.value,Oe=>{var Fe;Oe&&r.props.lazy&&r.props.lazyLoad&&((Fe=k.value)==null||Fe.loadLazyRootNodes())}),Pt(()=>{const Oe=C.value.input,Fe=an(Oe);l=Oe.offsetHeight||Fe,nr(Oe,ze)}),e({getCheckedNodes:Ke,cascaderPanelRef:k,togglePopperVisible:Z,contentRef:Ce,presentText:te,focus:Si,blur:uo}),(Oe,Fe)=>(B(),_e(w(Lo),{ref_key:"tooltipRef",ref:y,visible:E.value,teleported:t.teleported,"popper-class":[w(c).e("dropdown"),t.popperClass],"popper-style":t.popperStyle,"popper-options":i,"fallback-placements":t.fallbackPlacements,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,placement:t.placement,transition:`${w(c).namespace.value}-zoom-in-top`,effect:t.effect,pure:"",persistent:t.persistent,onHide:pe},{default:ce(()=>[Vt((B(),Q("div",{ref_key:"wrapperRef",ref:X,class:$(G.value),style:mt(O.value),onClick:Fe[8]||(Fe[8]=()=>Z(J.value?void 0:!0)),onKeydown:Cn,onMouseenter:Fe[9]||(Fe[9]=st=>x.value=!0),onMouseleave:Fe[10]||(Fe[10]=st=>x.value=!1)},[L(w(cr),{ref_key:"inputRef",ref:C,modelValue:A.value,"onUpdate:modelValue":Fe[1]||(Fe[1]=st=>A.value=st),placeholder:F.value,readonly:J.value,disabled:w(g),"validate-event":!1,size:w(j),class:$(be.value),tabindex:W.value&&t.filterable&&!w(g)?-1:void 0,onCompositionstart:w(b),onCompositionupdate:w(b),onCompositionend:w(b),onInput:gt},kc({suffix:ce(()=>[ee.value?(B(),_e(w(He),{key:"clear",class:$([w(d).e("icon"),"icon-circle-close"]),onClick:Ot(Je,["stop"])},{default:ce(()=>[(B(),_e(Gt(t.clearIcon)))]),_:1},8,["class"])):(B(),_e(w(He),{key:"arrow-down",class:$(ye.value),onClick:Fe[0]||(Fe[0]=Ot(st=>Z(),["stop"]))},{default:ce(()=>[L(w(zc))]),_:1},8,["class"]))]),_:2},[Oe.$slots.prefix?{name:"prefix",fn:ce(()=>[we(Oe.$slots,"prefix")]),key:"0"}:void 0]),1032,["modelValue","placeholder","readonly","disabled","size","class","tabindex","onCompositionstart","onCompositionupdate","onCompositionend"]),W.value?(B(),Q("div",{key:0,ref_key:"tagWrapper",ref:S,class:$([w(c).e("tags"),w(c).is("validate",!!V.value)])},[we(Oe.$slots,"tag",{data:D.value,deleteTag:Ie},()=>[(B(!0),Q(rt,null,gn(z.value,st=>(B(),_e(w(jp),{key:st.key,type:t.tagType,size:U.value,effect:t.tagEffect,hit:st.hitState,closable:st.closable,"disable-transitions":"",onClose:Vn=>Ie(st)},{default:ce(()=>[ie("span",null,We(st.text),1)]),_:2},1032,["type","size","effect","hit","closable","onClose"]))),128))]),t.collapseTags&&D.value.length>t.maxCollapseTags?(B(),_e(w(Lo),{key:0,ref_key:"tagTooltipRef",ref:_,disabled:E.value||!t.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],placement:"bottom","popper-class":t.popperClass,"popper-style":t.popperStyle,effect:t.effect,persistent:t.persistent},{default:ce(()=>[L(w(jp),{closable:!1,size:U.value,type:t.tagType,effect:t.tagEffect,"disable-transitions":""},{default:ce(()=>[ie("span",{class:$(w(c).e("tags-text"))}," + "+We(D.value.length-t.maxCollapseTags),3)]),_:1},8,["size","type","effect"])]),content:ce(()=>[L(w(gu),{"max-height":t.maxCollapseTagsTooltipHeight},{default:ce(()=>[ie("div",{class:$(w(c).e("collapse-tags"))},[(B(!0),Q(rt,null,gn(R.value,(st,Vn)=>(B(),Q("div",{key:Vn,class:$(w(c).e("collapse-tag"))},[(B(),_e(w(jp),{key:st.key,class:"in-tooltip",type:t.tagType,size:U.value,effect:t.tagEffect,hit:st.hitState,closable:st.closable,"disable-transitions":"",onClose:en=>Ie(st)},{default:ce(()=>[ie("span",null,We(st.text),1)]),_:2},1032,["type","size","effect","hit","closable","onClose"]))],2))),128))],2)]),_:1},8,["max-height"])]),_:1},8,["disabled","popper-class","popper-style","effect","persistent"])):ve("v-if",!0),t.filterable&&!w(g)?Vt((B(),Q("input",{key:1,"onUpdate:modelValue":Fe[2]||(Fe[2]=st=>I.value=st),type:"text",class:$(w(c).e("search-input")),placeholder:te.value?"":N.value,onInput:Fe[3]||(Fe[3]=st=>gt(I.value,st)),onClick:Fe[4]||(Fe[4]=Ot(st=>Z(!0),["stop"])),onKeydown:Pi(Le,["delete"]),onCompositionstart:Fe[5]||(Fe[5]=(...st)=>w(b)&&w(b)(...st)),onCompositionupdate:Fe[6]||(Fe[6]=(...st)=>w(b)&&w(b)(...st)),onCompositionend:Fe[7]||(Fe[7]=(...st)=>w(b)&&w(b)(...st))},null,42,Rpe)),[[Sre,I.value]]):ve("v-if",!0)],2)):ve("v-if",!0)],38)),[[w(wf),Y,Ce.value]])]),content:ce(()=>[Oe.$slots.header?(B(),Q("div",{key:0,class:$(w(c).e("header")),onClick:Fe[11]||(Fe[11]=Ot(()=>{},["stop"]))},[we(Oe.$slots,"header")],2)):ve("v-if",!0),Vt(L(w(Ipe),{ref_key:"cascaderPanelRef",ref:k,modelValue:K.value,"onUpdate:modelValue":Fe[12]||(Fe[12]=st=>K.value=st),options:t.options,props:r.props,border:!1,"render-label":Oe.$slots.default,onExpandChange:Dt,onClose:Fe[13]||(Fe[13]=st=>Oe.$nextTick(()=>Z(!1)))},{empty:ce(()=>[we(Oe.$slots,"empty")]),_:3},8,["modelValue","options","props","render-label"]),[[On,!P.value]]),t.filterable?Vt((B(),_e(w(gu),{key:1,ref_key:"suggestionPanel",ref:T,tag:"ul",class:$(w(c).e("suggestion-panel")),"view-class":w(c).e("suggestion-list"),onKeydown:ge},{default:ce(()=>[q.value.length?(B(!0),Q(rt,{key:0},gn(q.value,st=>(B(),Q("li",{key:st.uid,class:$([w(c).e("suggestion-item"),w(c).is("checked",st.checked)]),tabindex:-1,onClick:Vn=>Et(st)},[we(Oe.$slots,"suggestion-item",{item:st},()=>[ie("span",null,We(st.text),1),st.checked?(B(),_e(w(He),{key:0},{default:ce(()=>[L(w(LC))]),_:1})):ve("v-if",!0)])],10,Mpe))),128)):we(Oe.$slots,"empty",{key:1},()=>[ie("li",{class:$(w(c).e("empty-text"))},We(w(h)("el.cascader.noMatch")),3)])]),_:3},8,["class","view-class"])),[[On,P.value]]):ve("v-if",!0),Oe.$slots.footer?(B(),Q("div",{key:2,class:$(w(c).e("footer")),onClick:Fe[14]||(Fe[14]=Ot(()=>{},["stop"]))},[we(Oe.$slots,"footer")],2)):ve("v-if",!0)]),_:3},8,["visible","teleported","popper-class","popper-style","fallback-placements","placement","transition","effect","persistent"]))}});const Lpe=sn(Ope);var Dpe=le({name:"ElCollapseTransition",__name:"collapse-transition",setup(t){const e=De("collapse-transition"),n=r=>{r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom},i={beforeEnter(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.style.height&&(r.dataset.elExistsHeight=r.style.height),r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0},enter(r){requestAnimationFrame(()=>{r.dataset.oldOverflow=r.style.overflow,r.dataset.elExistsHeight?r.style.maxHeight=r.dataset.elExistsHeight:r.scrollHeight!==0?r.style.maxHeight=`${r.scrollHeight}px`:r.style.maxHeight=0,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom,r.style.overflow="hidden"})},afterEnter(r){r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow},enterCancelled(r){n(r)},beforeLeave(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.dataset.oldOverflow=r.style.overflow,r.style.maxHeight=`${r.scrollHeight}px`,r.style.overflow="hidden"},leave(r){r.scrollHeight!==0&&(r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0)},afterLeave(r){n(r)},leaveCancelled(r){n(r)}};return(r,o)=>(B(),_e(ya,Lt({name:w(e).b()},fie(i)),{default:ce(()=>[we(r.$slots,"default")]),_:3},16,["name"]))}});const Npe=sn(Dpe),kW=qe({modelValue:{type:me(String),default:void 0},border:{type:Boolean,default:!0},showAlpha:Boolean,colorFormat:String,disabled:Boolean,predefine:{type:me(Array)},validateEvent:{type:Boolean,default:!0}}),Bpe={[It]:t=>ot(t)||ir(t)},TW=Symbol("colorCommonPickerKey"),EW=Symbol("colorPickerPanelContextKey"),xW=qe({color:{type:me(Object),required:!0},vertical:Boolean,disabled:Boolean}),Vpe=xW;let xk=!1;function w2(t,e){if(!Zt)return;const n=function(o){var s;(s=e.drag)==null||s.call(e,o)},i=function(o){var s;document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",i),document.removeEventListener("touchmove",n),document.removeEventListener("touchend",i),document.onselectstart=null,document.ondragstart=null,xk=!1,(s=e.end)==null||s.call(e,o)},r=function(o){var s;xk||(document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",n),document.addEventListener("mouseup",i),document.addEventListener("touchmove",n),document.addEventListener("touchend",i),xk=!0,(s=e.start)==null||s.call(e,o))};t.addEventListener("mousedown",r),t.addEventListener("touchstart",r,{passive:!1})}const AW=t=>{let e,n;return t.type==="touchend"?(n=t.changedTouches[0].clientY,e=t.changedTouches[0].clientX):t.type.startsWith("touch")?(n=t.touches[0].clientY,e=t.touches[0].clientX):(n=t.clientY,e=t.clientX),{clientX:e,clientY:n}},PW=(t,{key:e,minValue:n,maxValue:i})=>{const r=Ct(),o=bi(),s=bi(),a=M(()=>t.color.get(e));function l(f){var h;if(t.disabled)return;f.target!==o.value&&u(f),(h=o.value)==null||h.focus()}function u(f){if(!s.value||!o.value||t.disabled)return;const m=r.vnode.el.getBoundingClientRect(),{clientX:g,clientY:v}=AW(f);let p;if(t.vertical){let b=v-m.top;b=Math.max(o.value.offsetHeight/2,b),b=Math.min(b,m.height-o.value.offsetHeight/2),p=Math.round((b-o.value.offsetHeight/2)/(m.height-o.value.offsetHeight)*i)}else{let b=g-m.left;b=Math.max(o.value.offsetWidth/2,b),b=Math.min(b,m.width-o.value.offsetWidth/2),p=Math.round((b-o.value.offsetWidth/2)/(m.width-o.value.offsetWidth)*i)}t.color.set(e,p)}function c(f){if(t.disabled)return;const{shiftKey:h}=f,m=Bn(f),g=h?10:1,v=e==="hue"?-1:1;let p=!0;switch(m){case Me.left:case Me.down:d(-g*v);break;case Me.right:case Me.up:d(g*v);break;case Me.home:t.color.set(e,e==="hue"?i:n);break;case Me.end:t.color.set(e,e==="hue"?n:i);break;case Me.pageDown:d(-4*v);break;case Me.pageUp:d(4*v);break;default:p=!1;break}p&&f.preventDefault()}function d(f){let h=a.value+f;h=hi?i:h,t.color.set(e,h)}return{thumb:o,bar:s,currentValue:a,handleDrag:u,handleClick:l,handleKeydown:c}},IW=(t,{namespace:e,maxValue:n,bar:i,thumb:r,currentValue:o,handleDrag:s,getBackground:a})=>{const l=Ct(),u=De(e),c=H(0),d=H(0),f=H();function h(){if(!r.value||t.vertical)return 0;const C=l.vnode.el,S=o.value;return C?Math.round(S*(C.offsetWidth-r.value.offsetWidth/2)/n):0}function m(){if(!r.value)return 0;const C=l.vnode.el;if(!t.vertical)return 0;const S=o.value;return C?Math.round(S*(C.offsetHeight-r.value.offsetHeight/2)/n):0}function g(){c.value=h(),d.value=m(),f.value=a?.()}Pt(()=>{if(!i.value||!r.value)return;const C={drag:S=>{s(S)},end:S=>{s(S)}};w2(i.value,C),w2(r.value,C),g()}),Se(o,()=>g()),Se(()=>t.color.value,()=>g());const v=M(()=>[u.b(),u.is("vertical",t.vertical),u.is("disabled",t.disabled)]),p=M(()=>u.e("bar")),b=M(()=>u.e("thumb")),y=M(()=>({background:f.value})),_=M(()=>({left:zr(c.value),top:zr(d.value)}));return{rootKls:v,barKls:p,barStyle:y,thumbKls:b,thumbStyle:_,thumbLeft:c,thumbTop:d,update:g}},Fpe=["aria-label","aria-valuenow","aria-valuetext","aria-orientation","tabindex","aria-disabled"],aN=0,Ak=100;var $pe=le({name:"ElColorAlphaSlider",__name:"alpha-slider",props:xW,setup(t,{expose:e}){const n=t,{currentValue:i,bar:r,thumb:o,handleDrag:s,handleClick:a,handleKeydown:l}=PW(n,{key:"alpha",minValue:aN,maxValue:Ak}),{rootKls:u,barKls:c,barStyle:d,thumbKls:f,thumbStyle:h,update:m}=IW(n,{namespace:"color-alpha-slider",maxValue:Ak,currentValue:i,bar:r,thumb:o,handleDrag:s,getBackground:b}),{t:g}=Qt(),v=M(()=>g("el.colorpicker.alphaLabel")),p=M(()=>g("el.colorpicker.alphaDescription",{alpha:i.value,color:n.color.value}));function b(){if(n.color&&n.color.value){const{r:y,g:_,b:C}=n.color.toRgb();return`linear-gradient(to right, rgba(${y}, ${_}, ${C}, 0) 0%, rgba(${y}, ${_}, ${C}, 1) 100%)`}return""}return e({update:m,bar:r,thumb:o}),(y,_)=>(B(),Q("div",{class:$(w(u))},[ie("div",{ref_key:"bar",ref:r,class:$(w(c)),style:mt(w(d)),onClick:_[0]||(_[0]=(...C)=>w(a)&&w(a)(...C))},null,6),ie("div",{ref_key:"thumb",ref:o,class:$(w(f)),style:mt(w(h)),"aria-label":v.value,"aria-valuenow":w(i),"aria-valuetext":p.value,"aria-orientation":t.vertical?"vertical":"horizontal","aria-valuemin":aN,"aria-valuemax":Ak,role:"slider",tabindex:t.disabled?void 0:0,"aria-disabled":t.disabled,onKeydown:_[1]||(_[1]=(...C)=>w(l)&&w(l)(...C))},null,46,Fpe)],2))}});const zpe=["aria-label","aria-valuenow","aria-valuetext","aria-orientation","tabindex","aria-disabled"],lN=0,Pk=360;var Hpe=le({name:"ElColorHueSlider",__name:"hue-slider",props:Vpe,setup(t,{expose:e}){const n=t,{currentValue:i,bar:r,thumb:o,handleDrag:s,handleClick:a,handleKeydown:l}=PW(n,{key:"hue",minValue:lN,maxValue:Pk}),{rootKls:u,barKls:c,thumbKls:d,thumbStyle:f,thumbTop:h,update:m}=IW(n,{namespace:"color-hue-slider",maxValue:Pk,currentValue:i,bar:r,thumb:o,handleDrag:s}),{t:g}=Qt(),v=M(()=>g("el.colorpicker.hueLabel")),p=M(()=>g("el.colorpicker.hueDescription",{hue:i.value,color:n.color.value}));return e({bar:r,thumb:o,thumbTop:h,update:m}),(b,y)=>(B(),Q("div",{class:$(w(u))},[ie("div",{ref_key:"bar",ref:r,class:$(w(c)),onClick:y[0]||(y[0]=(..._)=>w(a)&&w(a)(..._))},null,2),ie("div",{ref_key:"thumb",ref:o,class:$(w(d)),style:mt(w(f)),"aria-label":v.value,"aria-valuenow":w(i),"aria-valuetext":p.value,"aria-orientation":t.vertical?"vertical":"horizontal","aria-valuemin":lN,"aria-valuemax":Pk,role:"slider",tabindex:t.disabled?void 0:0,"aria-disabled":t.disabled,onKeydown:y[1]||(y[1]=(..._)=>w(l)&&w(l)(..._))},null,46,zpe)],2))}});const Upe=qe({colors:{type:me(Array),required:!0},color:{type:me(Object),required:!0},enableAlpha:{type:Boolean,required:!0},disabled:Boolean});var Wpe=Object.defineProperty,qpe=(t,e,n)=>e in t?Wpe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,xa=(t,e,n)=>qpe(t,typeof e!="symbol"?e+"":e,n);class H_{constructor(e={}){xa(this,"_hue",0),xa(this,"_saturation",100),xa(this,"_value",100),xa(this,"_alpha",100),xa(this,"_tiny",new Uh),xa(this,"_isValid",!1),xa(this,"enableAlpha",!1),xa(this,"format",""),xa(this,"value",""),xa(this,"selected");for(const n in e)Jt(e,n)&&(this[n]=e[n]);e.value?this.fromString(e.value):this.doOnChange()}set(e,n){if(arguments.length===1&&typeof e=="object"){for(const i in e)Jt(e,i)&&this.set(i,e[i]);return}this[`_${e}`]=n,this._isValid=!0,this.doOnChange()}get(e){return["hue","saturation","value","alpha"].includes(e)?Math.round(this[`_${e}`]):this[`_${e}`]}toRgb(){return this._isValid?this._tiny.toRgb():{r:255,g:255,b:255,a:0}}fromString(e){const n=new Uh(e);if(this._isValid=n.isValid,n.isValid){const{h:i,s:r,v:o,a:s}=n.toHsv();this._hue=i,this._saturation=r*100,this._value=o*100,this._alpha=s*100}else this._hue=0,this._saturation=100,this._value=100,this._alpha=100;this.doOnChange()}clear(){this._isValid=!1,this.value="",this._hue=0,this._saturation=100,this._value=100,this._alpha=100}compare(e){const n=new Uh({h:e._hue,s:e._saturation/100,v:e._value/100,a:e._alpha/100});return this._tiny.equals(n)}doOnChange(){const{_hue:e,_saturation:n,_value:i,_alpha:r,format:o,enableAlpha:s}=this;let a=o||(s?"rgb":"hex");o==="hex"&&s&&(a="hex8"),this._tiny=new Uh({h:e,s:n/100,v:i/100,a:r/100}),this.value=this._isValid?this._tiny.toString(a):""}}const jpe=t=>{const{currentColor:e}=Ne(EW),n=H(r(t.colors,t.color));Se(()=>e.value,o=>{const s=new H_({value:o,enableAlpha:t.enableAlpha});n.value.forEach(a=>{a.selected=s.compare(a)})}),sl(()=>{n.value=r(t.colors,t.color)});function i(o){t.color.fromString(t.colors[o])}function r(o,s){return o.map(a=>{const l=new H_({value:a,enableAlpha:t.enableAlpha});return l.selected=l.compare(s),l})}return{rgbaColors:n,handleSelect:i}},Kpe=t=>{const e=De("color-predefine"),n=M(()=>[e.b(),e.is("disabled",t.disabled)]),i=M(()=>e.e("colors"));function r(o){return[e.e("color-selector"),e.is("alpha",o.get("alpha")<100),{selected:o.selected}]}return{rootKls:n,colorsKls:i,colorSelectorKls:r}},Gpe=["disabled","aria-label","onClick"];var Ype=le({name:"ElColorPredefine",__name:"predefine",props:Upe,setup(t){const e=t,{rgbaColors:n,handleSelect:i}=jpe(e),{rootKls:r,colorsKls:o,colorSelectorKls:s}=Kpe(e),{t:a}=Qt(),l=u=>a("el.colorpicker.predefineDescription",{value:u});return(u,c)=>(B(),Q("div",{class:$(w(r))},[ie("div",{class:$(w(o))},[(B(!0),Q(rt,null,gn(w(n),(d,f)=>(B(),Q("button",{key:t.colors[f],type:"button",disabled:t.disabled,"aria-label":l(d.value),class:$(w(s)(d)),onClick:h=>w(i)(f)},[ie("div",{style:mt({backgroundColor:d.value})},null,4)],10,Gpe))),128))],2)],2))}});const Xpe=qe({color:{type:me(Object),required:!0},disabled:Boolean}),Jpe=t=>{const e=Ct(),n=H(),i=H(0),r=H(0),o=H("hsl(0, 100%, 50%)"),s=M(()=>t.color.get("saturation")),a=M(()=>t.color.get("value")),l=M(()=>t.color.get("hue"));function u(m){var g;if(t.disabled)return;m.target!==n.value&&c(m),(g=n.value)==null||g.focus({preventScroll:!0})}function c(m){if(t.disabled)return;const v=e.vnode.el.getBoundingClientRect(),{clientX:p,clientY:b}=AW(m);let y=p-v.left,_=b-v.top;y=Math.max(0,y),y=Math.min(y,v.width),_=Math.max(0,_),_=Math.min(_,v.height),r.value=y,i.value=_,t.color.set({saturation:y/v.width*100,value:100-_/v.height*100})}function d(m){if(t.disabled)return;const{shiftKey:g}=m,v=Bn(m),p=g?10:1;let b=!0;switch(v){case Me.left:f(-p);break;case Me.right:f(p);break;case Me.up:h(p);break;case Me.down:h(-p);break;default:b=!1;break}b&&m.preventDefault()}function f(m){let g=s.value+m;g=g<0?0:g>100?100:g,t.color.set("saturation",g)}function h(m){let g=a.value+m;g=g<0?0:g>100?100:g,t.color.set("value",g)}return{cursorRef:n,cursorTop:i,cursorLeft:r,background:o,saturation:s,brightness:a,hue:l,handleClick:u,handleDrag:c,handleKeydown:d}},Zpe=(t,{cursorTop:e,cursorLeft:n,background:i,handleDrag:r})=>{const o=Ct(),s=De("color-svpanel");function a(){const f=t.color.get("saturation"),h=t.color.get("value"),m=o.vnode.el,{clientWidth:g,clientHeight:v}=m;n.value=f*g/100,e.value=(100-h)*v/100,i.value=`hsl(${t.color.get("hue")}, 100%, 50%)`}Pt(()=>{w2(o.vnode.el,{drag:f=>{r(f)},end:f=>{r(f)}}),a()}),Se([()=>t.color.get("hue"),()=>t.color.get("value"),()=>t.color.value],()=>a());const l=M(()=>s.b()),u=M(()=>s.e("cursor")),c=M(()=>({backgroundColor:i.value})),d=M(()=>({top:zr(e.value),left:zr(n.value)}));return{rootKls:l,cursorKls:u,rootStyle:c,cursorStyle:d,update:a}},Qpe=["tabindex","aria-disabled","aria-label","aria-valuenow","aria-valuetext"];var eve=le({name:"ElSvPanel",__name:"sv-panel",props:Xpe,setup(t,{expose:e}){const n=t,{cursorRef:i,cursorTop:r,cursorLeft:o,background:s,saturation:a,brightness:l,handleClick:u,handleDrag:c,handleKeydown:d}=Jpe(n),{rootKls:f,cursorKls:h,rootStyle:m,cursorStyle:g,update:v}=Zpe(n,{cursorTop:r,cursorLeft:o,background:s,handleDrag:c}),{t:p}=Qt(),b=M(()=>p("el.colorpicker.svLabel")),y=M(()=>p("el.colorpicker.svDescription",{saturation:a.value,brightness:l.value,color:n.color.value}));return e({update:v}),(_,C)=>(B(),Q("div",{class:$(w(f)),style:mt(w(m)),onClick:C[1]||(C[1]=(...S)=>w(u)&&w(u)(...S))},[ie("div",{ref_key:"cursorRef",ref:i,class:$(w(h)),style:mt(w(g)),tabindex:t.disabled?void 0:0,"aria-disabled":t.disabled,role:"slider","aria-valuemin":"0,0","aria-valuemax":"100,100","aria-label":b.value,"aria-valuenow":`${w(a)},${w(l)}`,"aria-valuetext":y.value,onKeydown:C[0]||(C[0]=(...S)=>w(d)&&w(d)(...S))},null,46,Qpe)],6))}});const RW=(t,e)=>{const n=on(new H_({enableAlpha:t.showAlpha,format:t.colorFormat||"",value:t.modelValue}));return Se(()=>[t.colorFormat,t.showAlpha],()=>{n.enableAlpha=t.showAlpha,n.format=t.colorFormat||n.format,n.doOnChange(),e(It,n.value)}),{color:n}};var tve=le({name:"ElColorPickerPanel",__name:"color-picker-panel",props:kW,emits:Bpe,setup(t,{expose:e,emit:n}){const i=t,r=n,o=De("color-picker-panel"),{formItem:s}=lo(),a=Oi(),l=H(),u=H(),c=H(),d=H(),f=H(""),{color:h}=Ne(TW,()=>RW(i,r),!0);function m(){h.fromString(f.value),h.value!==f.value&&(f.value=h.value)}function g(){var p;i.validateEvent&&((p=s?.validate)==null||p.call(s,"blur").catch(b=>void 0))}function v(){var p,b,y;(p=l.value)==null||p.update(),(b=u.value)==null||b.update(),(y=c.value)==null||y.update()}return Pt(()=>{i.modelValue&&(f.value=h.value),Ye(v)}),Se(()=>i.modelValue,p=>{p!==h.value&&(p?h.fromString(p):h.clear())}),Se(()=>h.value,p=>{r(It,p),f.value=p,i.validateEvent&&s?.validate("change").catch(b=>void 0)}),qt(EW,{currentColor:M(()=>h.value)}),e({color:h,inputRef:d,update:v}),(p,b)=>(B(),Q("div",{class:$([w(o).b(),w(o).is("disabled",w(a)),w(o).is("border",t.border)]),onFocusout:g},[ie("div",{class:$(w(o).e("wrapper"))},[L(Hpe,{ref_key:"hueRef",ref:l,class:"hue-slider",color:w(h),vertical:"",disabled:w(a)},null,8,["color","disabled"]),L(eve,{ref_key:"svRef",ref:u,color:w(h),disabled:w(a)},null,8,["color","disabled"])],2),t.showAlpha?(B(),_e($pe,{key:0,ref_key:"alphaRef",ref:c,color:w(h),disabled:w(a)},null,8,["color","disabled"])):ve("v-if",!0),t.predefine?(B(),_e(Ype,{key:1,ref:"predefine","enable-alpha":t.showAlpha,color:w(h),colors:t.predefine,disabled:w(a)},null,8,["enable-alpha","color","colors","disabled"])):ve("v-if",!0),ie("div",{class:$(w(o).e("footer"))},[L(w(cr),{ref_key:"inputRef",ref:d,modelValue:f.value,"onUpdate:modelValue":b[0]||(b[0]=y=>f.value=y),"validate-event":!1,size:"small",disabled:w(a),onChange:m},null,8,["modelValue","disabled"]),we(p.$slots,"footer")],2)],34))}});const nve=sn(tve),ive=qe({persistent:{type:Boolean,default:!0},modelValue:{type:me(String),default:void 0},id:String,showAlpha:Boolean,colorFormat:String,disabled:{type:Boolean,default:void 0},clearable:{type:Boolean,default:!0},size:$r,popperClass:Mn.popperClass,popperStyle:Mn.popperStyle,tabindex:{type:[String,Number],default:0},teleported:Mn.teleported,appendTo:Mn.appendTo,predefine:{type:me(Array)},validateEvent:{type:Boolean,default:!0},...Gb,...hs(["ariaLabel"])}),rve={[It]:t=>ot(t)||ir(t),[En]:t=>ot(t)||ir(t),activeChange:t=>ot(t)||ir(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0},ove=["id","aria-label","aria-labelledby","aria-description","aria-disabled","tabindex"];var sve=le({name:"ElColorPicker",__name:"color-picker",props:ive,emits:rve,setup(t,{expose:e,emit:n}){const i=t,r=n,{t:o}=Qt(),s=De("color"),{formItem:a}=lo(),l=fr(),u=Oi(),{valueOnClear:c,isEmptyValue:d}=OC(i,null),f=RW(i,r),{inputId:h,isLabeledByFormItem:m}=Au(i,{formItemContext:a}),g=H(),v=H(),p=H(),b=H(!1),y=H(!1);let _=!0;const{isFocused:C,handleFocus:S,handleBlur:k}=dg(v,{disabled:u,beforeBlur(ee){var te;return(te=g.value)==null?void 0:te.isFocusInsideContent(ee)},afterBlur(){var ee;z(!1),F(),i.validateEvent&&((ee=a?.validate)==null||ee.call(a,"blur").catch(te=>void 0))}}),T=Cce(()=>{var ee,te;return(te=(ee=p.value)==null?void 0:ee.color)!=null?te:f.color}),E=M(()=>ZI(i,Object.keys(kW))),x=M(()=>!i.modelValue&&!y.value?"transparent":q(T,i.showAlpha)),P=M(()=>!i.modelValue&&!y.value?"":T.value),A=M(()=>m.value?void 0:i.ariaLabel||o("el.colorpicker.defaultLabel")),I=M(()=>m.value?a?.labelId:void 0),D=M(()=>[s.b("picker"),s.is("disabled",u.value),s.bm("picker",l.value),s.is("focused",C.value)]);function q(ee,te){const{r:V,g:K,b:G,a:ye}=ee.toRgb();return te?`rgba(${V}, ${K}, ${G}, ${ye})`:`rgb(${V}, ${K}, ${G})`}function z(ee){b.value=ee}const R=ul(z,100,{leading:!0});function O(){u.value||z(!0)}function N(){R(!1),F()}function F(){Ye(()=>{i.modelValue?T.fromString(i.modelValue):(T.value="",Ye(()=>{y.value=!1}))})}function j(){u.value||(b.value&&F(),R(!b.value))}function U(){const ee=d(T.value)?c.value:T.value;r(It,ee),r(En,ee),i.validateEvent&&a?.validate("change").catch(te=>void 0),R(!1),Ye(()=>{const te=new H_({enableAlpha:i.showAlpha,format:i.colorFormat||"",value:i.modelValue});T.compare(te)||F()})}function W(){R(!1),r(It,c.value),r(En,c.value),i.modelValue!==c.value&&i.validateEvent&&a?.validate("change").catch(ee=>void 0),F(),r("clear")}function J(){var ee,te;(te=(ee=p?.value)==null?void 0:ee.inputRef)==null||te.focus()}function ne(){b.value&&(N(),C.value&&se())}function he(ee){ee.preventDefault(),ee.stopPropagation(),z(!1),F()}function X(ee){switch(Bn(ee)){case Me.enter:case Me.numpadEnter:case Me.space:ee.preventDefault(),ee.stopPropagation(),O();break;case Me.esc:he(ee);break}}function se(){v.value.focus()}function re(){v.value.blur()}return Se(()=>P.value,ee=>{_&&r("activeChange",ee),_=!0}),Se(()=>T.value,()=>{!i.modelValue&&!y.value&&(y.value=!0)}),Se(()=>i.modelValue,ee=>{ee?ee&&ee!==T.value&&(_=!1,T.fromString(ee)):y.value=!1}),Se(()=>b.value,()=>{p.value&&Ye(p.value.update)}),qt(TW,f),e({color:T,show:O,hide:N,focus:se,blur:re}),(ee,te)=>(B(),_e(w(Lo),{ref_key:"popper",ref:g,visible:b.value,"show-arrow":!1,"fallback-placements":["bottom","top","right","left"],offset:0,"gpu-acceleration":!1,"popper-class":[w(s).be("picker","panel"),t.popperClass],"popper-style":t.popperStyle,"stop-popper-mouse-event":!1,pure:"",loop:"",role:"dialog",effect:"light",trigger:"click",teleported:t.teleported,transition:`${w(s).namespace.value}-zoom-in-top`,persistent:t.persistent,"append-to":t.appendTo,onShow:J,onHide:te[2]||(te[2]=V=>z(!1))},{content:ce(()=>[Vt((B(),_e(w(nve),Lt({ref_key:"pickerPanelRef",ref:p},E.value,{border:!1,"validate-event":!1,onKeydown:Pi(he,["esc"])}),{footer:ce(()=>[ie("div",null,[t.clearable?(B(),_e(w(Hi),{key:0,class:$(w(s).be("footer","link-btn")),text:"",size:"small",onClick:W},{default:ce(()=>[dt(We(w(o)("el.colorpicker.clear")),1)]),_:1},8,["class"])):ve("v-if",!0),L(w(Hi),{plain:"",size:"small",class:$(w(s).be("footer","btn")),onClick:U},{default:ce(()=>[dt(We(w(o)("el.colorpicker.confirm")),1)]),_:1},8,["class"])])]),_:1},16)),[[w(wf),ne,v.value]])]),default:ce(()=>[ie("div",Lt({id:w(h),ref_key:"triggerRef",ref:v},ee.$attrs,{class:D.value,role:"button","aria-label":A.value,"aria-labelledby":I.value,"aria-description":w(o)("el.colorpicker.description",{color:t.modelValue||""}),"aria-disabled":w(u),tabindex:w(u)?void 0:t.tabindex,onKeydown:X,onFocus:te[0]||(te[0]=(...V)=>w(S)&&w(S)(...V)),onBlur:te[1]||(te[1]=(...V)=>w(k)&&w(k)(...V))}),[ie("div",{class:$(w(s).be("picker","trigger")),onClick:j},[ie("span",{class:$([w(s).be("picker","color"),w(s).is("alpha",t.showAlpha)])},[ie("span",{class:$(w(s).be("picker","color-inner")),style:mt({backgroundColor:x.value})},[Vt(L(w(He),{class:$([w(s).be("picker","icon"),w(s).is("icon-arrow-down")])},{default:ce(()=>[L(w(zc))]),_:1},8,["class"]),[[On,t.modelValue||y.value]]),Vt(L(w(He),{class:$([w(s).be("picker","empty"),w(s).is("icon-close")])},{default:ce(()=>[L(w(cl))]),_:1},8,["class"]),[[On,!t.modelValue&&!y.value]])],6)],2)],2)],16,ove)]),_:1},8,["visible","popper-class","popper-style","teleported","transition","persistent","append-to"]))}});const ave=sn(sve),lve=qe({a11y:{type:Boolean,default:!0},locale:{type:me(Object)},size:$r,button:{type:me(Object)},card:{type:me(Object)},dialog:{type:me(Object)},link:{type:me(Object)},experimentalFeatures:{type:me(Object)},keyboardNavigation:{type:Boolean,default:!0},message:{type:me(Object)},zIndex:Number,namespace:{type:String,default:"el"},...Gb}),uve={placement:"top"},cve=le({name:"ElConfigProvider",props:lve,setup(t,{slots:e}){const n=aU(t);return Se(()=>t.message,i=>{var r,o;Object.assign(uve,(o=(r=n?.value)==null?void 0:r.message)!=null?o:{},i??{})},{immediate:!0,deep:!0}),()=>we(e,"default",{config:n?.value})}}),MW=sn(cve);var dve=le({name:"ElContainer",__name:"container",props:{direction:{type:String,required:!1}},setup(t){const e=t,n=$o(),i=De("container"),r=M(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:n&&n.default?n.default().some(s=>{const a=s.type.name;return a==="ElHeader"||a==="ElFooter"}):!1);return(o,s)=>(B(),Q("section",{class:$([w(i).b(),w(i).is("vertical",r.value)])},[we(o.$slots,"default")],2))}}),OW=le({name:"ElAside",__name:"aside",props:{width:{type:[String,null],required:!1,default:null}},setup(t){const e=t,n=De("aside"),i=M(()=>e.width?n.cssVarBlock({width:e.width}):{});return(r,o)=>(B(),Q("aside",{class:$(w(n).b()),style:mt(i.value)},[we(r.$slots,"default")],6))}}),LW=le({name:"ElFooter",__name:"footer",props:{height:{type:[String,null],required:!1,default:null}},setup(t){const e=t,n=De("footer"),i=M(()=>e.height?n.cssVarBlock({height:e.height}):{});return(r,o)=>(B(),Q("footer",{class:$(w(n).b()),style:mt(i.value)},[we(r.$slots,"default")],6))}}),DW=le({name:"ElHeader",__name:"header",props:{height:{type:[String,null],required:!1,default:null}},setup(t){const e=t,n=De("header"),i=M(()=>e.height?n.cssVarBlock({height:e.height}):{});return(r,o)=>(B(),Q("header",{class:$(w(n).b()),style:mt(i.value)},[we(r.$slots,"default")],6))}}),NW=le({name:"ElMain",__name:"main",setup(t){const e=De("main");return(n,i)=>(B(),Q("main",{class:$(w(e).b())},[we(n.$slots,"default")],2))}});const uN=sn(dve,{Aside:OW,Footer:LW,Header:DW,Main:NW}),fve=Zi(OW);Zi(LW);const hve=Zi(DW),mve=Zi(NW);var Pw={exports:{}},gve=Pw.exports,cN;function pve(){return cN||(cN=1,(function(t,e){(function(n,i){t.exports=i()})(gve,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},i=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,o=/\d\d/,s=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},u=function(v){return(v=+v)+(v>68?1900:2e3)},c=function(v){return function(p){this[v]=+p}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(p){if(!p||p==="Z")return 0;var b=p.match(/([+-]|\d\d)/g),y=60*b[1]+(+b[2]||0);return y===0?0:b[0]==="+"?-y:y})(v)}],f=function(v){var p=l[v];return p&&(p.indexOf?p:p.s.concat(p.f))},h=function(v,p){var b,y=l.meridiem;if(y){for(var _=1;_<=24;_+=1)if(v.indexOf(y(_,0,p))>-1){b=_>12;break}}else b=v===(p?"pm":"PM");return b},m={A:[a,function(v){this.afternoon=h(v,!1)}],a:[a,function(v){this.afternoon=h(v,!0)}],Q:[r,function(v){this.month=3*(v-1)+1}],S:[r,function(v){this.milliseconds=100*+v}],SS:[o,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[s,c("seconds")],ss:[s,c("seconds")],m:[s,c("minutes")],mm:[s,c("minutes")],H:[s,c("hours")],h:[s,c("hours")],HH:[s,c("hours")],hh:[s,c("hours")],D:[s,c("day")],DD:[o,c("day")],Do:[a,function(v){var p=l.ordinal,b=v.match(/\d+/);if(this.day=b[0],p)for(var y=1;y<=31;y+=1)p(y).replace(/\[|\]/g,"")===v&&(this.day=y)}],w:[s,c("week")],ww:[o,c("week")],M:[s,c("month")],MM:[o,c("month")],MMM:[a,function(v){var p=f("months"),b=(f("monthsShort")||p.map((function(y){return y.slice(0,3)}))).indexOf(v)+1;if(b<1)throw new Error;this.month=b%12||b}],MMMM:[a,function(v){var p=f("months").indexOf(v)+1;if(p<1)throw new Error;this.month=p%12||p}],Y:[/[+-]?\d+/,c("year")],YY:[o,function(v){this.year=u(v)}],YYYY:[/\d{4}/,c("year")],Z:d,ZZ:d};function g(v){var p,b;p=v,b=l&&l.formats;for(var y=(v=p.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,P,A){var I=A&&A.toUpperCase();return P||b[A]||n[A]||b[I].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(D,q,z){return q||z.slice(1)}))}))).match(i),_=y.length,C=0;C<_;C+=1){var S=y[C],k=m[S],T=k&&k[0],E=k&&k[1];y[C]=E?{regex:T,parser:E}:S.replace(/^\[|\]$/g,"")}return function(x){for(var P={},A=0,I=0;A<_;A+=1){var D=y[A];if(typeof D=="string")I+=D.length;else{var q=D.regex,z=D.parser,R=x.slice(I),O=q.exec(R)[0];z.call(P,O),x=x.replace(O,"")}}return(function(N){var F=N.afternoon;if(F!==void 0){var j=N.hours;F?j<12&&(N.hours+=12):j===12&&(N.hours=0),delete N.afternoon}})(P),P}}return function(v,p,b){b.p.customParseFormat=!0,v&&v.parseTwoDigitYear&&(u=v.parseTwoDigitYear);var y=p.prototype,_=y.parse;y.parse=function(C){var S=C.date,k=C.utc,T=C.args;this.$u=k;var E=T[1];if(typeof E=="string"){var x=T[2]===!0,P=T[3]===!0,A=x||P,I=T[2];P&&(I=T[2]),l=this.$locale(),!x&&I&&(l=b.Ls[I]),this.$d=(function(R,O,N,F){try{if(["x","X"].indexOf(O)>-1)return new Date((O==="X"?1e3:1)*R);var j=g(O)(R),U=j.year,W=j.month,J=j.day,ne=j.hours,he=j.minutes,X=j.seconds,se=j.milliseconds,re=j.zone,ee=j.week,te=new Date,V=J||(U||W?1:te.getDate()),K=U||te.getFullYear(),G=0;U&&!W||(G=W>0?W-1:te.getMonth());var ye,be=ne||0,Ce=he||0,Y=X||0,Z=se||0;return re?new Date(Date.UTC(K,G,V,be,Ce,Y,Z+60*re.offset*1e3)):N?new Date(Date.UTC(K,G,V,be,Ce,Y,Z)):(ye=new Date(K,G,V,be,Ce,Y,Z),ee&&(ye=F(ye).week(ee).toDate()),ye)}catch{return new Date("")}})(S,E,k,b),this.init(),I&&I!==!0&&(this.$L=this.locale(I).$L),A&&S!=this.format(E)&&(this.$d=new Date("")),l={}}else if(E instanceof Array)for(var D=E.length,q=1;q<=D;q+=1){T[1]=E[q-1];var z=b.apply(this,T);if(z.isValid()){this.$d=z.$d,this.$L=z.$L,this.init();break}q===D&&(this.$d=new Date(""))}else _.call(this,C)}}}))})(Pw)),Pw.exports}var vve=pve();const BW=wl(vve),dN=["hours","minutes","seconds"],ha="EP_PICKER_BASE",AR="ElPopperOptions",VW=Symbol("commonPickerContextKey"),Om="HH:mm:ss",lc="YYYY-MM-DD",bve={date:lc,dates:lc,week:"gggg[w]ww",year:"YYYY",years:"YYYY",month:"YYYY-MM",months:"YYYY-MM",datetime:`${lc} ${Om}`,monthrange:"YYYY-MM",yearrange:"YYYY",daterange:lc,datetimerange:`${lc} ${Om}`},FW=(t,e)=>{const{lang:n}=Qt(),i=H(!1),r=H(!1),o=H(null),s=M(()=>{const{modelValue:m}=t;return!m||Pe(m)&&!m.filter(Boolean).length}),a=m=>{if(!nW(t.modelValue,m)){let g;Pe(m)?g=m.map(p=>QD(p,t.valueFormat,n.value)):m&&(g=QD(m,t.valueFormat,n.value)),e(It,m&&g,n.value)}},l=M(()=>{var m;let g;if(s.value?u.value.getDefaultValue&&(g=u.value.getDefaultValue()):Pe(t.modelValue)?g=t.modelValue.map(v=>ZD(v,t.valueFormat,n.value)):g=ZD((m=t.modelValue)!=null?m:"",t.valueFormat,n.value),u.value.getRangeAvailableTime){const v=u.value.getRangeAvailableTime(g);$i(v,g)||(g=v,s.value||a(xw(g)))}return Pe(g)&&g.some(v=>!v)&&(g=[]),g}),u=H({});return{parsedValue:l,pickerActualVisible:r,pickerOptions:u,pickerVisible:i,userInput:o,valueIsEmpty:s,emitInput:a,onCalendarChange:m=>{e("calendar-change",m)},onPanelChange:(m,g,v)=>{e("panel-change",m,g,v)},onPick:(m="",g=!1)=>{i.value=g;let v;Pe(m)?v=m.map(p=>p.toDate()):v=m&&m.toDate(),o.value=null,a(v)},onSetPickerOption:m=>{u.value[m[0]]=m[1],u.value.panelReady=!0}}},PR=qe({disabledHours:{type:me(Function)},disabledMinutes:{type:me(Function)},disabledSeconds:{type:me(Function)}}),$W=qe({visible:Boolean,actualVisible:{type:Boolean,default:void 0},format:{type:String,default:""}}),IR=qe({automaticDropdown:{type:Boolean,default:!0},id:{type:me([Array,String])},name:{type:me([Array,String])},popperClass:Mn.popperClass,popperStyle:Mn.popperStyle,format:String,valueFormat:String,dateFormat:String,timeFormat:String,type:{type:String,default:""},clearable:{type:Boolean,default:!0},clearIcon:{type:me([String,Object]),default:Nf},editable:{type:Boolean,default:!0},prefixIcon:{type:me([String,Object]),default:""},size:$r,readonly:Boolean,disabled:{type:Boolean,default:void 0},placeholder:{type:String,default:""},popperOptions:{type:me(Object),default:()=>({})},modelValue:{type:me([Date,Array,String,Number]),default:""},rangeSeparator:{type:String,default:"-"},startPlaceholder:String,endPlaceholder:String,defaultValue:{type:me([Date,Array])},defaultTime:{type:me([Date,Array])},isRange:Boolean,...PR,disabledDate:{type:Function},cellClassName:{type:Function},shortcuts:{type:Array,default:()=>[]},arrowControl:Boolean,tabindex:{type:me([String,Number]),default:0},validateEvent:{type:Boolean,default:!0},unlinkPanels:Boolean,placement:{type:me(String),values:xu,default:"bottom"},fallbackPlacements:{type:me(Array),default:["bottom","top","right","left"]},...Gb,...hs(["ariaLabel"]),showNow:{type:Boolean,default:!0},showConfirm:{type:Boolean,default:!0},showFooter:{type:Boolean,default:!0},showWeekNumber:Boolean}),yve=qe({id:{type:me(Array)},name:{type:me(Array)},modelValue:{type:me([Array,String])},startPlaceholder:String,endPlaceholder:String,disabled:Boolean}),wve=["id","name","placeholder","value","disabled"],_ve=["id","name","placeholder","value","disabled"];var Cve=le({name:"PickerRangeTrigger",inheritAttrs:!1,__name:"picker-range-trigger",props:yve,emits:["mouseenter","mouseleave","click","touchstart","focus","blur","startInput","endInput","startChange","endChange"],setup(t,{expose:e,emit:n}){const i=t,r=n,{formItem:o}=lo(),{inputId:s}=Au(on({id:M(()=>{var T;return(T=i.id)==null?void 0:T[0]})}),{formItemContext:o}),a=vR(),l=De("date"),u=De("range"),c=H(),d=H(),{wrapperRef:f,isFocused:h}=dg(c,{disabled:M(()=>i.disabled)}),m=T=>{r("click",T)},g=T=>{r("mouseenter",T)},v=T=>{r("mouseleave",T)},p=T=>{r("touchstart",T)},b=T=>{r("startInput",T)},y=T=>{r("endInput",T)},_=T=>{r("startChange",T)},C=T=>{r("endChange",T)};return e({focus:()=>{var T;(T=c.value)==null||T.focus()},blur:()=>{var T,E;(T=c.value)==null||T.blur(),(E=d.value)==null||E.blur()}}),(T,E)=>(B(),Q("div",{ref_key:"wrapperRef",ref:f,class:$([w(l).is("active",w(h)),T.$attrs.class]),style:mt(T.$attrs.style),onClick:m,onMouseenter:g,onMouseleave:v,onTouchstartPassive:p},[we(T.$slots,"prefix"),ie("input",Lt(w(a),{id:w(s),ref_key:"inputRef",ref:c,name:T.name&&T.name[0],placeholder:T.startPlaceholder,value:T.modelValue&&T.modelValue[0],class:w(u).b("input"),disabled:T.disabled,onInput:b,onChange:_}),null,16,wve),we(T.$slots,"range-separator"),ie("input",Lt(w(a),{id:T.id&&T.id[1],ref_key:"endInputRef",ref:d,name:T.name&&T.name[1],placeholder:T.endPlaceholder,value:T.modelValue&&T.modelValue[1],class:w(u).b("input"),disabled:T.disabled,onInput:y,onChange:C}),null,16,_ve),we(T.$slots,"suffix")],38))}}),zW=le({name:"Picker",__name:"picker",props:IR,emits:[It,En,"focus","blur","clear","calendar-change","panel-change","visible-change","keydown"],setup(t,{expose:e,emit:n}){const i=t,r=n,o=Rf(),s=De("date"),a=De("input"),l=De("range"),{formItem:u}=lo(),c=Ne(AR,{}),d=OC(i,null),f=H(),h=H(),m=H(null);let g=!1;const v=Oi(),p=FW(i,r),{parsedValue:b,pickerActualVisible:y,userInput:_,pickerVisible:C,pickerOptions:S,valueIsEmpty:k,emitInput:T,onPick:E,onSetPickerOption:x,onCalendarChange:P,onPanelChange:A}=p,{isFocused:I,handleFocus:D,handleBlur:q}=dg(h,{disabled:v,beforeFocus(){return i.readonly},afterFocus(){i.automaticDropdown&&(C.value=!0)},beforeBlur(de){var Ve;return!g&&((Ve=f.value)==null?void 0:Ve.isFocusInsideContent(de))},afterBlur(){Te(),C.value=!1,g=!1,i.validateEvent&&u?.validate("blur").catch(de=>void 0)}}),z=H(!1),R=M(()=>[s.b("editor"),s.bm("editor",i.type),a.e("wrapper"),s.is("disabled",v.value),s.is("active",C.value),l.b("editor"),je?l.bm("editor",je.value):"",o.class]),O=M(()=>[a.e("icon"),l.e("close-icon"),ye.value?"":l.em("close-icon","hidden")]);Se(C,de=>{de?Ye(()=>{de&&(m.value=i.modelValue)}):(_.value=null,Ye(()=>{N(i.modelValue)}))});const N=(de,Ve)=>{(Ve||!nW(de,m.value))&&(r(En,de),Ve&&(m.value=de),i.validateEvent&&u?.validate("change").catch(gt=>void 0))},F=de=>{r("keydown",de)},j=M(()=>h.value?Array.from(h.value.$el.querySelectorAll("input")):[]),U=(de,Ve,gt)=>{const an=j.value;an.length&&(!gt||gt==="min"?(an[0].setSelectionRange(de,Ve),an[0].focus()):gt==="max"&&(an[1].setSelectionRange(de,Ve),an[1].focus()))},W=()=>{y.value=!0},J=()=>{r("visible-change",!0)},ne=()=>{y.value=!1,C.value=!1,r("visible-change",!1)},he=()=>{C.value=!0},X=()=>{C.value=!1},se=M(()=>{const de=Re(b.value);return Pe(_.value)?[_.value[0]||de&&de[0]||"",_.value[1]||de&&de[1]||""]:_.value!==null?_.value:!ee.value&&k.value||!C.value&&k.value?"":de?te.value||V.value||K.value?de.join(", "):de:""}),re=M(()=>i.type.includes("time")),ee=M(()=>i.type.startsWith("time")),te=M(()=>i.type==="dates"),V=M(()=>i.type==="months"),K=M(()=>i.type==="years"),G=M(()=>i.prefixIcon||(re.value?hde:cU)),ye=M(()=>i.clearable&&!v.value&&!i.readonly&&!k.value&&(z.value||I.value)),be=de=>{i.readonly||v.value||(ye.value&&(de?.stopPropagation(),S.value.handleClear?S.value.handleClear():T(d.valueOnClear.value),N(d.valueOnClear.value,!0),ne()),r("clear"))},Ce=async de=>{var Ve;i.readonly||v.value||(((Ve=de.target)==null?void 0:Ve.tagName)!=="INPUT"||I.value||!i.automaticDropdown)&&(C.value=!0)},Y=()=>{i.readonly||v.value||!k.value&&i.clearable&&(z.value=!0)},Z=()=>{z.value=!1},ae=de=>{var Ve;i.readonly||v.value||(((Ve=de.touches[0].target)==null?void 0:Ve.tagName)!=="INPUT"||I.value||!i.automaticDropdown)&&(C.value=!0)},pe=M(()=>i.type.includes("range")),je=fr(),Ie=M(()=>{var de,Ve;return(Ve=(de=w(f))==null?void 0:de.popperRef)==null?void 0:Ve.contentRef}),fe=QH(h,de=>{const Ve=w(Ie),gt=Yi(h);Ve&&(de.target===Ve||de.composedPath().includes(Ve))||de.target===gt||gt&&de.composedPath().includes(gt)||(C.value=!1)});Sn(()=>{fe?.()});const Te=()=>{if(_.value){const de=et(se.value);de&&(ze(de)&&T(xw(de)),_.value=null)}_.value===""&&(T(d.valueOnClear.value),N(d.valueOnClear.value,!0),_.value=null)},et=de=>de?S.value.parseUserInput(de):null,Re=de=>de?Pe(de)?de.map(gt=>gt.format(i.format)):de.format(i.format):null,ze=de=>S.value.isValidValue(de),Ke=async de=>{if(i.readonly||v.value)return;const Ve=Bn(de);if(F(de),Ve===Me.esc){C.value===!0&&(C.value=!1,de.preventDefault(),de.stopPropagation());return}if(Ve===Me.down&&(S.value.handleFocusPicker&&(de.preventDefault(),de.stopPropagation()),C.value===!1&&(C.value=!0,await Ye()),S.value.handleFocusPicker)){S.value.handleFocusPicker();return}if(Ve===Me.tab){g=!0;return}if(Ve===Me.enter||Ve===Me.numpadEnter){C.value?(_.value===null||_.value===""||ze(et(se.value)))&&(Te(),C.value=!1):C.value=!0,de.preventDefault(),de.stopPropagation();return}if(_.value){de.stopPropagation();return}S.value.handleKeydownInput&&S.value.handleKeydownInput(de)},Dt=de=>{_.value=de,C.value||(C.value=!0)},Cn=de=>{const Ve=de.target;_.value?_.value=[Ve.value,_.value[1]]:_.value=[Ve.value,null]},Je=de=>{const Ve=de.target;_.value?_.value=[_.value[0],Ve.value]:_.value=[null,Ve.value]},kt=()=>{var de;const Ve=_.value,gt=et(Ve&&Ve[0]),an=w(b);if(gt&>.isValid()){_.value=[Re(gt),((de=se.value)==null?void 0:de[1])||null];const Si=[gt,an&&(an[1]||null)];ze(Si)&&(T(xw(Si)),_.value=null)}},Et=()=>{var de;const Ve=w(_),gt=et(Ve&&Ve[1]),an=w(b);if(gt&>.isValid()){_.value=[((de=w(se))==null?void 0:de[0])||null,Re(gt)];const Si=[an&&an[0],gt];ze(Si)&&(T(xw(Si)),_.value=null)}},ge=()=>{var de;(de=h.value)==null||de.focus()},Le=()=>{var de;(de=h.value)==null||de.blur()};return qt(ha,{props:i,emptyValues:d}),qt(VW,p),e({focus:ge,blur:Le,handleOpen:he,handleClose:X,onPick:E}),(de,Ve)=>(B(),_e(w(Lo),Lt({ref_key:"refPopper",ref:f,visible:w(C),effect:"light",pure:"",trigger:"click"},de.$attrs,{role:"dialog",teleported:"",transition:`${w(s).namespace.value}-zoom-in-top`,"popper-class":[`${w(s).namespace.value}-picker__popper`,de.popperClass],"popper-style":de.popperStyle,"popper-options":w(c),"fallback-placements":de.fallbackPlacements,"gpu-acceleration":!1,placement:de.placement,"stop-popper-mouse-event":!1,"hide-after":0,persistent:"",onBeforeShow:W,onShow:J,onHide:ne}),{default:ce(()=>[pe.value?(B(),_e(Cve,{key:1,id:de.id,ref_key:"inputRef",ref:h,"model-value":se.value,name:de.name,disabled:w(v),readonly:!de.editable||de.readonly,"start-placeholder":de.startPlaceholder,"end-placeholder":de.endPlaceholder,class:$(R.value),style:mt(de.$attrs.style),"aria-label":de.ariaLabel,tabindex:de.tabindex,autocomplete:"off",role:"combobox",onClick:Ce,onFocus:w(D),onBlur:w(q),onStartInput:Cn,onStartChange:kt,onEndInput:Je,onEndChange:Et,onMousedown:Ce,onMouseenter:Y,onMouseleave:Z,onTouchstartPassive:ae,onKeydown:Ke},{prefix:ce(()=>[G.value?(B(),_e(w(He),{key:0,class:$([w(a).e("icon"),w(l).e("icon")])},{default:ce(()=>[(B(),_e(Gt(G.value)))]),_:1},8,["class"])):ve("v-if",!0)]),"range-separator":ce(()=>[we(de.$slots,"range-separator",{},()=>[ie("span",{class:$(w(l).b("separator"))},We(de.rangeSeparator),3)])]),suffix:ce(()=>[de.clearIcon?(B(),_e(w(He),{key:0,class:$(O.value),onMousedown:Ot(w(tn),["prevent"]),onClick:be},{default:ce(()=>[(B(),_e(Gt(de.clearIcon)))]),_:1},8,["class","onMousedown"])):ve("v-if",!0)]),_:3},8,["id","model-value","name","disabled","readonly","start-placeholder","end-placeholder","class","style","aria-label","tabindex","onFocus","onBlur"])):(B(),_e(w(cr),{key:0,id:de.id,ref_key:"inputRef",ref:h,"container-role":"combobox","model-value":se.value,name:de.name,size:w(je),disabled:w(v),placeholder:de.placeholder,class:$([w(s).b("editor"),w(s).bm("editor",de.type),w(s).is("focus",w(C)),de.$attrs.class]),style:mt(de.$attrs.style),readonly:!de.editable||de.readonly||te.value||V.value||K.value||de.type==="week","aria-label":de.ariaLabel,tabindex:de.tabindex,"validate-event":!1,onInput:Dt,onFocus:w(D),onBlur:w(q),onKeydown:Ke,onChange:Te,onMousedown:Ce,onMouseenter:Y,onMouseleave:Z,onTouchstartPassive:ae,onClick:Ve[0]||(Ve[0]=Ot(()=>{},["stop"]))},{prefix:ce(()=>[G.value?(B(),_e(w(He),{key:0,class:$(w(a).e("icon")),onMousedown:Ot(Ce,["prevent"]),onTouchstartPassive:ae},{default:ce(()=>[(B(),_e(Gt(G.value)))]),_:1},8,["class"])):ve("v-if",!0)]),suffix:ce(()=>[ye.value&&de.clearIcon?(B(),_e(w(He),{key:0,class:$(`${w(a).e("icon")} clear-icon`),onMousedown:Ot(w(tn),["prevent"]),onClick:be},{default:ce(()=>[(B(),_e(Gt(de.clearIcon)))]),_:1},8,["class","onMousedown"])):ve("v-if",!0)]),_:1},8,["id","model-value","name","size","disabled","placeholder","class","style","readonly","aria-label","tabindex","onFocus","onBlur"]))]),content:ce(()=>[we(de.$slots,"default",{visible:w(C),actualVisible:w(y),parsedValue:w(b),format:de.format,dateFormat:de.dateFormat,timeFormat:de.timeFormat,unlinkPanels:de.unlinkPanels,type:de.type,defaultValue:de.defaultValue,showNow:de.showNow,showConfirm:de.showConfirm,showFooter:de.showFooter,showWeekNumber:de.showWeekNumber,onPick:Ve[1]||(Ve[1]=(...gt)=>w(E)&&w(E)(...gt)),onSelectRange:U,onSetPickerOption:Ve[2]||(Ve[2]=(...gt)=>w(x)&&w(x)(...gt)),onCalendarChange:Ve[3]||(Ve[3]=(...gt)=>w(P)&&w(P)(...gt)),onClear:be,onPanelChange:Ve[4]||(Ve[4]=(...gt)=>w(A)&&w(A)(...gt)),onMousedown:Ve[5]||(Ve[5]=Ot(()=>{},["stop"]))})]),_:3},16,["visible","transition","popper-class","popper-style","popper-options","fallback-placements","placement"]))}});const Sve=qe({...$W,datetimeRole:String,parsedValue:{type:me(Object)}}),HW=({getAvailableHours:t,getAvailableMinutes:e,getAvailableSeconds:n})=>{const i=(s,a,l,u)=>{const c={hour:t,minute:e,second:n};let d=s;return["hour","minute","second"].forEach(f=>{if(c[f]){let h;const m=c[f];switch(f){case"minute":{h=m(d.hour(),a,u);break}case"second":{h=m(d.hour(),d.minute(),a,u);break}default:{h=m(a,u);break}}if(h?.length&&!h.includes(d[f]())){const g=l?0:h.length-1;d=d[f](h[g])}}}),d},r={};return{timePickerOptions:r,getAvailableTime:i,onSetOption:([s,a])=>{r[s]=a}}},Ik=t=>{const e=(i,r)=>i||r,n=i=>i!==!0;return t.map(e).filter(n)},UW=(t,e,n)=>({getHoursList:(s,a)=>Tk(24,t&&(()=>t?.(s,a))),getMinutesList:(s,a,l)=>Tk(60,e&&(()=>e?.(s,a,l))),getSecondsList:(s,a,l,u)=>Tk(60,n&&(()=>n?.(s,a,l,u)))}),WW=(t,e,n)=>{const{getHoursList:i,getMinutesList:r,getSecondsList:o}=UW(t,e,n);return{getAvailableHours:(u,c)=>Ik(i(u,c)),getAvailableMinutes:(u,c,d)=>Ik(r(u,c,d)),getAvailableSeconds:(u,c,d,f)=>Ik(o(u,c,d,f))}},qW=t=>{const e=H(t.parsedValue);return Se(()=>t.visible,n=>{n||(e.value=t.parsedValue)}),e},kve=qe({role:{type:String,required:!0},spinnerDate:{type:me(Object),required:!0},showSeconds:{type:Boolean,default:!0},arrowControl:Boolean,amPmMode:{type:me(String),default:""},...PR}),Tve=100,Eve=600,z0="_RepeatClick",U_={beforeMount(t,e){const n=e.value,{interval:i=Tve,delay:r=Eve}=Xe(n)?{}:n;let o,s;const a=()=>Xe(n)?n():n.handler(),l=()=>{s&&(clearTimeout(s),s=void 0),o&&(clearInterval(o),o=void 0)},u=c=>{c.button===0&&(l(),a(),document.addEventListener("mouseup",l,{once:!0}),s=setTimeout(()=>{o=setInterval(()=>{a()},i)},r))};t[z0]={start:u,clear:l},t.addEventListener("mousedown",u)},unmounted(t){if(!t[z0])return;const{start:e,clear:n}=t[z0];e&&t.removeEventListener("mousedown",e),n&&(n(),document.removeEventListener("mouseup",n)),t[z0]=null}},xve=["onClick"],Ave=["onMouseenter"];var _2=le({__name:"basic-time-spinner",props:kve,emits:[En,"select-range","set-option"],setup(t,{emit:e}){const n=t,i=Ne(ha),{isRange:r,format:o}=i.props,s=e,a=De("time"),{getHoursList:l,getMinutesList:u,getSecondsList:c}=UW(n.disabledHours,n.disabledMinutes,n.disabledSeconds);let d=!1;const f=H(),v={hours:H(),minutes:H(),seconds:H()},p=M(()=>n.showSeconds?dN:dN.slice(0,2)),b=M(()=>{const{spinnerDate:W}=n,J=W.hour(),ne=W.minute(),he=W.second();return{hours:J,minutes:ne,seconds:he}}),y=M(()=>{const{hours:W,minutes:J}=w(b),{role:ne,spinnerDate:he}=n,X=r?void 0:he;return{hours:l(ne,X),minutes:u(W,ne,X),seconds:c(W,J,ne,X)}}),_=M(()=>{const{hours:W,minutes:J,seconds:ne}=w(b);return{hours:kk(W,23),minutes:kk(J,59),seconds:kk(ne,59)}}),C=ul(W=>{d=!1,T(W)},200),S=W=>{if(!!!n.amPmMode)return"";const ne=n.amPmMode==="A";let he=W<12?" am":" pm";return ne&&(he=he.toUpperCase()),he},k=W=>{let J=[0,0];const ne=o||Om,he=ne.indexOf("HH"),X=ne.indexOf("mm"),se=ne.indexOf("ss");switch(W){case"hours":he!==-1&&(J=[he,he+2]);break;case"minutes":X!==-1&&(J=[X,X+2]);break;case"seconds":se!==-1&&(J=[se,se+2]);break}const[re,ee]=J;s("select-range",re,ee),f.value=W},T=W=>{P(W,w(b)[W])},E=()=>{T("hours"),T("minutes"),T("seconds")},x=W=>W.querySelector(`.${a.namespace.value}-scrollbar__wrap`),P=(W,J)=>{if(n.arrowControl)return;const ne=w(v[W]);ne&&ne.$el&&(x(ne.$el).scrollTop=Math.max(0,J*A(W)))},A=W=>{const J=w(v[W]),ne=J?.$el.querySelector("li");return ne&&Number.parseFloat(sc(ne,"height"))||0},I=()=>{q(1)},D=()=>{q(-1)},q=W=>{f.value||k("hours");const J=f.value,ne=w(b)[J],he=f.value==="hours"?24:60,X=z(J,ne,W,he);R(J,X),P(J,X),Ye(()=>k(J))},z=(W,J,ne,he)=>{let X=(J+ne+he)%he;const se=w(y)[W];for(;se[X]&&X!==J;)X=(X+ne+he)%he;return X},R=(W,J)=>{if(w(y)[W][J])return;const{hours:X,minutes:se,seconds:re}=w(b);let ee;switch(W){case"hours":ee=n.spinnerDate.hour(J).minute(se).second(re);break;case"minutes":ee=n.spinnerDate.hour(X).minute(J).second(re);break;case"seconds":ee=n.spinnerDate.hour(X).minute(se).second(J);break}s(En,ee)},O=(W,{value:J,disabled:ne})=>{ne||(R(W,J),k(W),P(W,J))},N=W=>{const J=w(v[W]);if(!J)return;d=!0,C(W);const ne=Math.min(Math.round((x(J.$el).scrollTop-(F(W)*.5-10)/A(W)+3)/A(W)),W==="hours"?23:59);R(W,ne)},F=W=>w(v[W]).$el.offsetHeight,j=()=>{const W=J=>{const ne=w(v[J]);ne&&ne.$el&&(x(ne.$el).onscroll=()=>{N(J)})};W("hours"),W("minutes"),W("seconds")};Pt(()=>{Ye(()=>{!n.arrowControl&&j(),E(),n.role==="start"&&k("hours")})});const U=(W,J)=>{v[J].value=W??void 0};return s("set-option",[`${n.role}_scrollDown`,q]),s("set-option",[`${n.role}_emitSelectRange`,k]),Se(()=>n.spinnerDate,()=>{d||E()}),(W,J)=>(B(),Q("div",{class:$([w(a).b("spinner"),{"has-seconds":W.showSeconds}])},[W.arrowControl?ve("v-if",!0):(B(!0),Q(rt,{key:0},gn(p.value,ne=>(B(),_e(w(gu),{key:ne,ref_for:!0,ref:he=>U(he,ne),class:$(w(a).be("spinner","wrapper")),"wrap-style":"max-height: inherit;","view-class":w(a).be("spinner","list"),noresize:"",tag:"ul",onMouseenter:he=>k(ne),onMousemove:he=>T(ne)},{default:ce(()=>[(B(!0),Q(rt,null,gn(y.value[ne],(he,X)=>(B(),Q("li",{key:X,class:$([w(a).be("spinner","item"),w(a).is("active",X===b.value[ne]),w(a).is("disabled",he)]),onClick:se=>O(ne,{value:X,disabled:he})},[ne==="hours"?(B(),Q(rt,{key:0},[dt(We(("0"+(W.amPmMode?X%12||12:X)).slice(-2))+We(S(X)),1)],64)):(B(),Q(rt,{key:1},[dt(We(("0"+X).slice(-2)),1)],64))],10,xve))),128))]),_:2},1032,["class","view-class","onMouseenter","onMousemove"]))),128)),W.arrowControl?(B(!0),Q(rt,{key:1},gn(p.value,ne=>(B(),Q("div",{key:ne,class:$([w(a).be("spinner","wrapper"),w(a).is("arrow")]),onMouseenter:he=>k(ne)},[Vt((B(),_e(w(He),{class:$(["arrow-up",w(a).be("spinner","arrow")])},{default:ce(()=>[L(w(sR))]),_:1},8,["class"])),[[w(U_),D]]),Vt((B(),_e(w(He),{class:$(["arrow-down",w(a).be("spinner","arrow")])},{default:ce(()=>[L(w(zc))]),_:1},8,["class"])),[[w(U_),I]]),ie("ul",{class:$(w(a).be("spinner","list"))},[(B(!0),Q(rt,null,gn(_.value[ne],(he,X)=>(B(),Q("li",{key:X,class:$([w(a).be("spinner","item"),w(a).is("active",he===b.value[ne]),w(a).is("disabled",y.value[ne][he])])},[w(St)(he)?(B(),Q(rt,{key:0},[ne==="hours"?(B(),Q(rt,{key:0},[dt(We(("0"+(W.amPmMode?he%12||12:he)).slice(-2))+We(S(he)),1)],64)):(B(),Q(rt,{key:1},[dt(We(("0"+he).slice(-2)),1)],64))],64)):ve("v-if",!0)],2))),128))],2)],42,Ave))),128)):ve("v-if",!0)],2))}}),W_=le({__name:"panel-time-pick",props:Sve,emits:["pick","select-range","set-picker-option"],setup(t,{emit:e}){const n=t,i=e,r=Ne(ha),{arrowControl:o,disabledHours:s,disabledMinutes:a,disabledSeconds:l,defaultValue:u}=r.props,{getAvailableHours:c,getAvailableMinutes:d,getAvailableSeconds:f}=WW(s,a,l),h=De("time"),{t:m,lang:g}=Qt(),v=H([0,2]),p=qW(n),b=M(()=>pn(n.actualVisible)?`${h.namespace.value}-zoom-in-top`:""),y=M(()=>n.format.includes("ss")),_=M(()=>n.format.includes("A")?"A":n.format.includes("a")?"a":""),C=O=>{const N=ft(O).locale(g.value),F=q(N);return N.isSame(F)},S=()=>{const O=p.value;i("pick",O,!1),Ye(()=>{p.value=O})},k=(O=!1,N=!1)=>{N||i("pick",n.parsedValue,O)},T=O=>{if(!n.visible)return;const N=q(O).millisecond(0);i("pick",N,!0)},E=(O,N)=>{i("select-range",O,N),v.value=[O,N]},x=O=>{const N=n.format,F=N.indexOf("HH"),j=N.indexOf("mm"),U=N.indexOf("ss"),W=[],J=[];F!==-1&&(W.push(F),J.push("hours")),j!==-1&&(W.push(j),J.push("minutes")),U!==-1&&y.value&&(W.push(U),J.push("seconds"));const he=(W.indexOf(v.value[0])+O+W.length)%W.length;A.start_emitSelectRange(J[he])},P=O=>{const N=Bn(O),{left:F,right:j,up:U,down:W}=Me;if([F,j].includes(N)){x(N===F?-1:1),O.preventDefault();return}if([U,W].includes(N)){const J=N===U?-1:1;A.start_scrollDown(J),O.preventDefault();return}},{timePickerOptions:A,onSetOption:I,getAvailableTime:D}=HW({getAvailableHours:c,getAvailableMinutes:d,getAvailableSeconds:f}),q=O=>D(O,n.datetimeRole||"",!0),z=O=>O?ft(O,n.format).locale(g.value):null,R=()=>ft(u).locale(g.value);return i("set-picker-option",["isValidValue",C]),i("set-picker-option",["parseUserInput",z]),i("set-picker-option",["handleKeydownInput",P]),i("set-picker-option",["getRangeAvailableTime",q]),i("set-picker-option",["getDefaultValue",R]),(O,N)=>(B(),_e(ya,{name:b.value},{default:ce(()=>[O.actualVisible||O.visible?(B(),Q("div",{key:0,class:$(w(h).b("panel"))},[ie("div",{class:$([w(h).be("panel","content"),{"has-seconds":y.value}])},[L(_2,{ref:"spinner",role:O.datetimeRole||"start","arrow-control":w(o),"show-seconds":y.value,"am-pm-mode":_.value,"spinner-date":O.parsedValue,"disabled-hours":w(s),"disabled-minutes":w(a),"disabled-seconds":w(l),onChange:T,onSetOption:w(I),onSelectRange:E},null,8,["role","arrow-control","show-seconds","am-pm-mode","spinner-date","disabled-hours","disabled-minutes","disabled-seconds","onSetOption"])],2),ie("div",{class:$(w(h).be("panel","footer"))},[ie("button",{type:"button",class:$([w(h).be("panel","btn"),"cancel"]),onClick:S},We(w(m)("el.datepicker.cancel")),3),ie("button",{type:"button",class:$([w(h).be("panel","btn"),"confirm"]),onClick:N[0]||(N[0]=F=>k())},We(w(m)("el.datepicker.confirm")),3)],2)],2)):ve("v-if",!0)]),_:1},8,["name"]))}});const Pve=qe({...$W,parsedValue:{type:me(Array)}}),Ive=["disabled"];var Rve=le({__name:"panel-time-range",props:Pve,emits:["pick","select-range","set-picker-option"],setup(t,{emit:e}){const n=t,i=e,r=(te,V)=>{const K=[];for(let G=te;G<=V;G++)K.push(G);return K},{t:o,lang:s}=Qt(),a=De("time"),l=De("picker"),u=Ne(ha),{arrowControl:c,disabledHours:d,disabledMinutes:f,disabledSeconds:h,defaultValue:m}=u.props,g=M(()=>[a.be("range-picker","body"),a.be("panel","content"),a.is("arrow",c),C.value?"has-seconds":""]),v=M(()=>[a.be("range-picker","body"),a.be("panel","content"),a.is("arrow",c),C.value?"has-seconds":""]),p=M(()=>n.parsedValue[0]),b=M(()=>n.parsedValue[1]),y=qW(n),_=()=>{const te=y.value;i("pick",te,!1),Ye(()=>{y.value=te})},C=M(()=>n.format.includes("ss")),S=M(()=>n.format.includes("A")?"A":n.format.includes("a")?"a":""),k=(te=!1)=>{i("pick",[p.value,b.value],te)},T=te=>{P(te.millisecond(0),b.value)},E=te=>{P(p.value,te.millisecond(0))},x=te=>{const V=te.map(G=>ft(G).locale(s.value)),K=U(V);return V[0].isSame(K[0])&&V[1].isSame(K[1])},P=(te,V)=>{n.visible&&i("pick",[te,V],!0)},A=M(()=>p.value>b.value),I=H([0,2]),D=(te,V)=>{i("select-range",te,V,"min"),I.value=[te,V]},q=M(()=>C.value?11:8),z=(te,V)=>{i("select-range",te,V,"max");const K=w(q);I.value=[te+K,V+K]},R=te=>{const V=C.value?[0,3,6,11,14,17]:[0,3,8,11],K=["hours","minutes"].concat(C.value?["seconds"]:[]),ye=(V.indexOf(I.value[0])+te+V.length)%V.length,be=V.length/2;ye{const V=Bn(te),{left:K,right:G,up:ye,down:be}=Me;if([K,G].includes(V)){R(V===K?-1:1),te.preventDefault();return}if([ye,be].includes(V)){const Ce=V===ye?-1:1,Y=I.value[0]{const K=d?d(te):[],G=te==="start",be=(V||(G?b.value:p.value)).hour(),Ce=G?r(be+1,23):r(0,be-1);return bk(K,Ce)},F=(te,V,K)=>{const G=f?f(te,V):[],ye=V==="start",be=K||(ye?b.value:p.value),Ce=be.hour();if(te!==Ce)return G;const Y=be.minute(),Z=ye?r(Y+1,59):r(0,Y-1);return bk(G,Z)},j=(te,V,K,G)=>{const ye=h?h(te,V,K):[],be=K==="start",Ce=G||(be?b.value:p.value),Y=Ce.hour(),Z=Ce.minute();if(te!==Y||V!==Z)return ye;const ae=Ce.second(),pe=be?r(ae+1,59):r(0,ae-1);return bk(ye,pe)},U=([te,V])=>[X(te,"start",!0,V),X(V,"end",!1,te)],{getAvailableHours:W,getAvailableMinutes:J,getAvailableSeconds:ne}=WW(N,F,j),{timePickerOptions:he,getAvailableTime:X,onSetOption:se}=HW({getAvailableHours:W,getAvailableMinutes:J,getAvailableSeconds:ne}),re=te=>te?Pe(te)?te.map(V=>ft(V,n.format).locale(s.value)):ft(te,n.format).locale(s.value):null,ee=()=>{if(Pe(m))return m.map(V=>ft(V).locale(s.value));const te=ft(m).locale(s.value);return[te,te.add(60,"m")]};return i("set-picker-option",["parseUserInput",re]),i("set-picker-option",["isValidValue",x]),i("set-picker-option",["handleKeydownInput",O]),i("set-picker-option",["getDefaultValue",ee]),i("set-picker-option",["getRangeAvailableTime",U]),(te,V)=>te.actualVisible?(B(),Q("div",{key:0,class:$([w(a).b("range-picker"),w(l).b("panel")])},[ie("div",{class:$(w(a).be("range-picker","content"))},[ie("div",{class:$(w(a).be("range-picker","cell"))},[ie("div",{class:$(w(a).be("range-picker","header"))},We(w(o)("el.datepicker.startTime")),3),ie("div",{class:$(g.value)},[L(_2,{ref:"minSpinner",role:"start","show-seconds":C.value,"am-pm-mode":S.value,"arrow-control":w(c),"spinner-date":p.value,"disabled-hours":N,"disabled-minutes":F,"disabled-seconds":j,onChange:T,onSetOption:w(se),onSelectRange:D},null,8,["show-seconds","am-pm-mode","arrow-control","spinner-date","onSetOption"])],2)],2),ie("div",{class:$(w(a).be("range-picker","cell"))},[ie("div",{class:$(w(a).be("range-picker","header"))},We(w(o)("el.datepicker.endTime")),3),ie("div",{class:$(v.value)},[L(_2,{ref:"maxSpinner",role:"end","show-seconds":C.value,"am-pm-mode":S.value,"arrow-control":w(c),"spinner-date":b.value,"disabled-hours":N,"disabled-minutes":F,"disabled-seconds":j,onChange:E,onSetOption:w(se),onSelectRange:z},null,8,["show-seconds","am-pm-mode","arrow-control","spinner-date","onSetOption"])],2)],2)],2),ie("div",{class:$(w(a).be("panel","footer"))},[ie("button",{type:"button",class:$([w(a).be("panel","btn"),"cancel"]),onClick:V[0]||(V[0]=K=>_())},We(w(o)("el.datepicker.cancel")),3),ie("button",{type:"button",class:$([w(a).be("panel","btn"),"confirm"]),disabled:A.value,onClick:V[1]||(V[1]=K=>k())},We(w(o)("el.datepicker.confirm")),11,Ive)],2)],2)):ve("v-if",!0)}});ft.extend(BW);var Mve=le({name:"ElTimePicker",install:null,props:{...IR,isRange:Boolean},emits:[It],setup(t,e){const n=H(),[i,r]=t.isRange?["timerange",Rve]:["time",W_],o=s=>e.emit(It,s);return qt(AR,t.popperOptions),e.expose({focus:()=>{var s;(s=n.value)==null||s.focus()},blur:()=>{var s;(s=n.value)==null||s.blur()},handleOpen:()=>{var s;(s=n.value)==null||s.handleOpen()},handleClose:()=>{var s;(s=n.value)==null||s.handleClose()}}),()=>{var s;const a=(s=t.format)!=null?s:Om;return L(zW,Lt(t,{ref:n,type:i,format:a,"onUpdate:modelValue":o}),{default:l=>L(r,l,null)})}}});const Ove=sn(Mve);var Iw={exports:{}},Lve=Iw.exports,fN;function Dve(){return fN||(fN=1,(function(t,e){(function(n,i){t.exports=i()})(Lve,(function(){return function(n,i){var r=i.prototype,o=r.format;r.format=function(s){var a=this,l=this.$locale();if(!this.isValid())return o.bind(this)(s);var u=this.$utils(),c=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(d){switch(d){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return l.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return l.ordinal(a.week(),"W");case"w":case"ww":return u.s(a.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(a.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(a.$H===0?24:a.$H),d==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return d}}));return o.bind(this)(c)}}}))})(Iw)),Iw.exports}var Nve=Dve();const Bve=wl(Nve);var Rw={exports:{}},Vve=Rw.exports,hN;function Fve(){return hN||(hN=1,(function(t,e){(function(n,i){t.exports=i()})(Vve,(function(){var n="week",i="year";return function(r,o,s){var a=o.prototype;a.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var u=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var c=s(this).startOf(i).add(1,i).date(u),d=s(this).endOf(n);if(c.isBefore(d))return 1}var f=s(this).startOf(i).date(u).startOf(n).subtract(1,"millisecond"),h=this.diff(f,n,!0);return h<0?s(this).startOf("week").week():Math.ceil(h)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}}))})(Rw)),Rw.exports}var $ve=Fve();const zve=wl($ve);var Mw={exports:{}},Hve=Mw.exports,mN;function Uve(){return mN||(mN=1,(function(t,e){(function(n,i){t.exports=i()})(Hve,(function(){return function(n,i){i.prototype.weekYear=function(){var r=this.month(),o=this.week(),s=this.year();return o===1&&r===11?s+1:r===0&&o>=52?s-1:s}}}))})(Mw)),Mw.exports}var Wve=Uve();const qve=wl(Wve);var Ow={exports:{}},jve=Ow.exports,gN;function Kve(){return gN||(gN=1,(function(t,e){(function(n,i){t.exports=i()})(jve,(function(){return function(n,i,r){i.prototype.dayOfYear=function(o){var s=Math.round((r(this).startOf("day")-r(this).startOf("year"))/864e5)+1;return o==null?s:this.add(o-s,"day")}}}))})(Ow)),Ow.exports}var Gve=Kve();const Yve=wl(Gve);var Lw={exports:{}},Xve=Lw.exports,pN;function Jve(){return pN||(pN=1,(function(t,e){(function(n,i){t.exports=i()})(Xve,(function(){return function(n,i){i.prototype.isSameOrAfter=function(r,o){return this.isSame(r,o)||this.isAfter(r,o)}}}))})(Lw)),Lw.exports}var Zve=Jve();const Qve=wl(Zve);var Dw={exports:{}},ebe=Dw.exports,vN;function tbe(){return vN||(vN=1,(function(t,e){(function(n,i){t.exports=i()})(ebe,(function(){return function(n,i){i.prototype.isSameOrBefore=function(r,o){return this.isSame(r,o)||this.isBefore(r,o)}}}))})(Dw)),Dw.exports}var nbe=tbe();const ibe=wl(nbe),rbe=qe({valueFormat:String,dateFormat:String,timeFormat:String,disabled:{type:Boolean,default:void 0},modelValue:{type:me([Date,Array,String,Number]),default:""},defaultValue:{type:me([Date,Array])},defaultTime:{type:me([Date,Array])},isRange:Boolean,...PR,disabledDate:{type:Function},cellClassName:{type:Function},shortcuts:{type:Array,default:()=>[]},arrowControl:Boolean,unlinkPanels:Boolean,showNow:{type:Boolean,default:!0},showConfirm:Boolean,showFooter:Boolean,showWeekNumber:Boolean,type:{type:me(String),default:"date"},clearable:{type:Boolean,default:!0},border:{type:Boolean,default:!0},editable:{type:Boolean,default:!0}}),RR=Symbol("rootPickerContextKey"),Qb="ElIsDefaultFormat",obe=["date","dates","year","years","month","months","week","range"],MR=qe({cellClassName:{type:me(Function)},disabledDate:{type:me(Function)},date:{type:me(Object),required:!0},minDate:{type:me(Object)},maxDate:{type:me(Object)},parsedValue:{type:me([Object,Array])},rangeState:{type:me(Object),default:()=>({endDate:null,selecting:!1})},disabled:Boolean}),jW=qe({type:{type:me(String),required:!0,values:mge},dateFormat:String,timeFormat:String,showNow:{type:Boolean,default:!0},showConfirm:Boolean,showFooter:{type:Boolean,default:!0},showWeekNumber:Boolean,border:Boolean,disabled:Boolean,editable:{type:Boolean,default:!0}}),OR=qe({unlinkPanels:Boolean,visible:{type:Boolean,default:!0},showConfirm:Boolean,showFooter:{type:Boolean,default:!0},border:Boolean,disabled:Boolean,parsedValue:{type:me(Array)}}),LR=t=>({type:String,values:obe,default:t}),sbe=qe({...jW,parsedValue:{type:me([Object,Array])},visible:{type:Boolean,default:!0},format:{type:String,default:""}}),zv=t=>{if(!Pe(t))return!1;const[e,n]=t;return ft.isDayjs(e)&&ft.isDayjs(n)&&ft(e).isValid()&&ft(n).isValid()&&e.isSameOrBefore(n)},zC=(t,{lang:e,step:n=1,unit:i,unlinkPanels:r})=>{let o;if(Pe(t)){let[s,a]=t.map(l=>ft(l).locale(e));return r||(a=s.add(n,i)),[s,a]}else t?o=ft(t):o=ft();return o=o.locale(e),[o,o.add(n,i)]},abe=(t,e,{columnIndexOffset:n,startDate:i,nextEndDate:r,now:o,unit:s,relativeDateGetter:a,setCellMetadata:l,setRowMetadata:u})=>{for(let c=0;c{const r=ft().locale(i).startOf("month").month(n).year(e).hour(t.hour()).minute(t.minute()).second(t.second()),o=r.daysInMonth();return QU(o).map(s=>r.add(s,"day").toDate())},Lm=(t,e,n,i,r)=>{const o=ft().year(e).month(n).startOf("month").hour(t.hour()).minute(t.minute()).second(t.second()),s=q_(t,e,n,i).find(a=>!r?.(a));return s?ft(s).locale(i):o.locale(i)},j_=(t,e,n)=>{const i=t.year();if(!n?.(t.toDate()))return t.locale(e);const r=t.month();if(!q_(t,i,r,e).every(n))return Lm(t,i,r,e,n);for(let o=0;o<12;o++)if(!q_(t,i,o,e).every(n))return Lm(t,i,o,e,n);return t},Dm=(t,e,n,i)=>{if(Pe(t))return t.map(r=>Dm(r,e,n,i));if(ot(t)){const r=i?.value?ft(t):ft(t,e);if(!r.isValid())return r}return ft(t,e).locale(n)},lbe=qe({...MR,showWeekNumber:Boolean,selectionMode:LR("date")}),ube=["changerange","pick","select"],K_=(t="")=>["normal","today"].includes(t),cbe=(t,e)=>{const{lang:n}=Qt(),i=H(),r=H(),o=H(),s=H(),a=H([[],[],[],[],[],[]]);let l=!1;const u=t.date.$locale().weekStart||7,c=t.date.locale("en").localeData().weekdaysShort().map(N=>N.toLowerCase()),d=M(()=>u>3?7-u:-u),f=M(()=>{const N=t.date.startOf("month");return N.subtract(N.day()||7,"day")}),h=M(()=>c.concat(c).slice(u,u+7)),m=M(()=>N_(w(_)).some(N=>N.isCurrent)),g=M(()=>{const N=t.date.startOf("month"),F=N.day()||7,j=N.daysInMonth(),U=N.subtract(1,"month").daysInMonth();return{startOfMonthDay:F,dateCountOfMonth:j,dateCountOfLastMonth:U}}),v=M(()=>t.selectionMode==="dates"?Br(t.parsedValue):[]),p=(N,{count:F,rowIndex:j,columnIndex:U})=>{const{startOfMonthDay:W,dateCountOfMonth:J,dateCountOfLastMonth:ne}=w(g),he=w(d);if(j>=0&&j<=1){const X=W+he<0?7+W+he:W+he;if(U+j*7>=X)return N.text=F,!0;N.text=ne-(X-U%7)+1+j*7,N.type="prev-month"}else return F<=J?N.text=F:(N.text=F-J,N.type="next-month"),!0;return!1},b=(N,{columnIndex:F,rowIndex:j},U)=>{const{disabledDate:W,cellClassName:J}=t,ne=w(v),he=p(N,{count:U,rowIndex:j,columnIndex:F}),X=N.dayjs.toDate();return N.selected=ne.find(se=>se.isSame(N.dayjs,"day")),N.isSelected=!!N.selected,N.isCurrent=S(N),N.disabled=W?.(X),N.customClass=J?.(X),he},y=N=>{if(t.selectionMode==="week"){const[F,j]=t.showWeekNumber?[1,7]:[0,6],U=O(N[F+1]);N[F].inRange=U,N[F].start=U,N[j].inRange=U,N[j].end=U}},_=M(()=>{const{minDate:N,maxDate:F,rangeState:j,showWeekNumber:U}=t,W=w(d),J=w(a),ne="day";let he=1;if(abe({row:6,column:7},J,{startDate:N,columnIndexOffset:U?1:0,nextEndDate:j.endDate||F||j.selecting&&N||null,now:ft().locale(w(n)).startOf(ne),unit:ne,relativeDateGetter:X=>w(f).add(X-W,ne),setCellMetadata:(...X)=>{b(...X,he)&&(he+=1)},setRowMetadata:y}),U)for(let X=0;X<6;X++)J[X][1].dayjs&&(J[X][0]={type:"week",text:J[X][1].dayjs.week()});return J});Se(()=>t.date,async()=>{var N;(N=w(i))!=null&&N.contains(document.activeElement)&&(await Ye(),await C())});const C=async()=>{var N;return(N=w(r))==null?void 0:N.focus()},S=N=>t.selectionMode==="date"&&K_(N.type)&&k(N,t.parsedValue),k=(N,F)=>F?ft(F).locale(w(n)).isSame(t.date.date(Number(N.text)),"day"):!1,T=(N,F)=>{const j=w(g).startOfMonthDay,U=w(d),W=j+U<0?7+j+U:j+U,J=N*7+(F-(t.showWeekNumber?1:0));return t.date.startOf("month").subtract(W,"day").add(J,"day")},E=N=>{var F;if(!t.rangeState.selecting)return;let j=N.target;if(j.tagName==="SPAN"&&(j=(F=j.parentNode)==null?void 0:F.parentNode),j.tagName==="DIV"&&(j=j.parentNode),j.tagName!=="TD")return;const U=j.parentNode.rowIndex-1,W=j.cellIndex;w(_)[U][W].disabled||(U!==w(o)||W!==w(s))&&(o.value=U,s.value=W,e("changerange",{selecting:!0,endDate:T(U,W)}))},x=N=>!w(m)&&N?.text===1&&K_(N.type)||N.isCurrent,P=N=>{l||w(m)||t.selectionMode!=="date"||R(N,!0)},A=N=>{N.target.closest("td")&&(l=!0)},I=N=>{N.target.closest("td")&&(l=!1)},D=N=>{!t.rangeState.selecting||!t.minDate?(e("pick",{minDate:N,maxDate:null}),e("select",!0)):(N>=t.minDate?e("pick",{minDate:t.minDate,maxDate:N}):e("pick",{minDate:N,maxDate:t.minDate}),e("select",!1))},q=N=>{const F=N.week(),j=`${N.year()}w${F}`;e("pick",{year:N.year(),week:F,value:j,date:N.startOf("week")})},z=(N,F)=>{const j=F?Br(t.parsedValue).filter(U=>U?.valueOf()!==N.valueOf()):Br(t.parsedValue).concat([N]);e("pick",j)},R=(N,F=!1)=>{if(t.disabled)return;const j=N.target.closest("td");if(!j)return;const U=j.parentNode.rowIndex-1,W=j.cellIndex,J=w(_)[U][W];if(J.disabled||J.type==="week")return;const ne=T(U,W);switch(t.selectionMode){case"range":{D(ne);break}case"date":{e("pick",ne,F);break}case"week":{q(ne);break}case"dates":{z(ne,!!J.selected);break}}},O=N=>{if(t.selectionMode!=="week")return!1;let F=t.date.startOf("day");if(N.type==="prev-month"&&(F=F.subtract(1,"month")),N.type==="next-month"&&(F=F.add(1,"month")),F=F.date(Number.parseInt(N.text,10)),t.parsedValue&&!Pe(t.parsedValue)){const j=(t.parsedValue.day()-u+7)%7-1;return t.parsedValue.subtract(j,"day").isSame(F,"day")}return!1};return{WEEKS:h,rows:_,tbodyRef:i,currentCellRef:r,focus:C,isCurrent:S,isWeekActive:O,isSelectedCell:x,handlePickDate:R,handleMouseUp:I,handleMouseDown:A,handleMouseMove:E,handleFocus:P}},dbe=(t,{isCurrent:e,isWeekActive:n})=>{const i=De("date-table"),{t:r}=Qt(),o=M(()=>[i.b(),i.is("week-mode",t.selectionMode==="week"&&!t.disabled)]),s=M(()=>r("el.datepicker.dateTablePrompt")),a=u=>{const c=[];return K_(u.type)&&!u.disabled?(c.push("available"),u.type==="today"&&c.push("today")):c.push(u.type),e(u)&&c.push("current"),u.inRange&&(K_(u.type)||t.selectionMode==="week")&&(c.push("in-range"),u.start&&c.push("start-date"),u.end&&c.push("end-date")),(u.disabled||t.disabled)&&c.push("disabled"),u.selected&&c.push("selected"),u.customClass&&c.push(u.customClass),c.join(" ")},l=u=>[i.e("row"),{current:n(u)}];return{tableKls:o,tableLabel:s,weekHeaderClass:i.e("week-header"),getCellClasses:a,getRowKls:l,t:r}},fbe=qe({cell:{type:me(Object)}});var DR=le({name:"ElDatePickerCell",props:fbe,setup(t){const e=De("date-table-cell"),{slots:n}=Ne(RR);return()=>{const{cell:i}=t;return we(n,"default",{...i},()=>{var r;return[L("div",{class:e.b()},[L("span",{class:e.e("text")},[(r=i?.renderText)!=null?r:i?.text])])]})}}});const hbe=["aria-label"],mbe=["aria-label"],gbe=["aria-current","aria-selected","tabindex","aria-disabled"];var C2=le({__name:"basic-date-table",props:lbe,emits:ube,setup(t,{expose:e,emit:n}){const i=t,r=n,{WEEKS:o,rows:s,tbodyRef:a,currentCellRef:l,focus:u,isCurrent:c,isWeekActive:d,isSelectedCell:f,handlePickDate:h,handleMouseUp:m,handleMouseDown:g,handleMouseMove:v,handleFocus:p}=cbe(i,r),{tableLabel:b,tableKls:y,getCellClasses:_,getRowKls:C,weekHeaderClass:S,t:k}=dbe(i,{isCurrent:c,isWeekActive:d});let T=!1;return Sn(()=>{T=!0}),e({focus:u}),(E,x)=>(B(),Q("table",{"aria-label":w(b),class:$(w(y)),cellspacing:"0",cellpadding:"0",role:"grid",onClick:x[1]||(x[1]=(...P)=>w(h)&&w(h)(...P)),onMousemove:x[2]||(x[2]=(...P)=>w(v)&&w(v)(...P)),onMousedown:x[3]||(x[3]=(...P)=>w(g)&&w(g)(...P)),onMouseup:x[4]||(x[4]=(...P)=>w(m)&&w(m)(...P))},[ie("tbody",{ref_key:"tbodyRef",ref:a},[ie("tr",null,[E.showWeekNumber?(B(),Q("th",{key:0,scope:"col",class:$(w(S))},null,2)):ve("v-if",!0),(B(!0),Q(rt,null,gn(w(o),(P,A)=>(B(),Q("th",{key:A,"aria-label":w(k)("el.datepicker.weeksFull."+P),scope:"col"},We(w(k)("el.datepicker.weeks."+P)),9,mbe))),128))]),(B(!0),Q(rt,null,gn(w(s),(P,A)=>(B(),Q("tr",{key:A,class:$(w(C)(E.showWeekNumber?P[2]:P[1]))},[(B(!0),Q(rt,null,gn(P,(I,D)=>(B(),Q("td",{key:`${A}.${D}`,ref_for:!0,ref:q=>!w(T)&&w(f)(I)&&(l.value=q),class:$(w(_)(I)),"aria-current":I.isCurrent?"date":void 0,"aria-selected":I.isCurrent,tabindex:E.disabled?void 0:w(f)(I)?0:-1,"aria-disabled":E.disabled,onFocus:x[0]||(x[0]=(...q)=>w(p)&&w(p)(...q))},[L(w(DR),{cell:I},null,8,["cell"])],42,gbe))),128))],2))),128))],512)],42,hbe))}});const pbe=qe({...MR,selectionMode:LR("month")}),vbe=["aria-label"],bbe=["aria-selected","aria-label","tabindex","onKeydown"];var Hv=le({__name:"basic-month-table",props:pbe,emits:["changerange","pick","select"],setup(t,{expose:e,emit:n}){const i=t,r=n,o=De("month-table"),{t:s,lang:a}=Qt(),l=H(),u=H(),c=H(i.date.locale("en").localeData().monthsShort().map(_=>_.toLowerCase())),d=H([[],[],[]]),f=H(),h=H(),m=M(()=>{var _,C,S;const k=d.value,T=ft().locale(a.value).startOf("month");for(let E=0;E<3;E++){const x=k[E];for(let P=0;P<4;P++){const A=x[P]||(x[P]={row:E,column:P,type:"normal",inRange:!1,start:!1,end:!1,text:-1,disabled:!1,isSelected:!1,customClass:void 0,date:void 0,dayjs:void 0,isCurrent:void 0,selected:void 0,renderText:void 0,timestamp:void 0});A.type="normal";const I=E*4+P,D=i.date.startOf("year").month(I),q=i.rangeState.endDate||i.maxDate||i.rangeState.selecting&&i.minDate||null;A.inRange=!!(i.minDate&&D.isSameOrAfter(i.minDate,"month")&&q&&D.isSameOrBefore(q,"month"))||!!(i.minDate&&D.isSameOrBefore(i.minDate,"month")&&q&&D.isSameOrAfter(q,"month")),(_=i.minDate)!=null&&_.isSameOrAfter(q)?(A.start=!!(q&&D.isSame(q,"month")),A.end=i.minDate&&D.isSame(i.minDate,"month")):(A.start=!!(i.minDate&&D.isSame(i.minDate,"month")),A.end=!!(q&&D.isSame(q,"month"))),T.isSame(D)&&(A.type="today");const R=D.toDate();A.text=I,A.disabled=((C=i.disabledDate)==null?void 0:C.call(i,R))||!1,A.date=R,A.customClass=(S=i.cellClassName)==null?void 0:S.call(i,R),A.dayjs=D,A.timestamp=D.valueOf(),A.isSelected=p(A)}}return k}),g=()=>{var _;(_=u.value)==null||_.focus()},v=_=>{const C={},S=i.date.year(),k=new Date,T=_.text;return C.disabled=i.disabled||(i.disabledDate?q_(i.date,S,T,a.value).every(i.disabledDate):!1),C.current=Br(i.parsedValue).some(E=>ft.isDayjs(E)&&E.year()===S&&E.month()===T),C.today=k.getFullYear()===S&&k.getMonth()===T,_.customClass&&(C[_.customClass]=!0),_.inRange&&(C["in-range"]=!0,_.start&&(C["start-date"]=!0),_.end&&(C["end-date"]=!0)),C},p=_=>{const C=i.date.year(),S=_.text;return Br(i.date).some(k=>k.year()===C&&k.month()===S)},b=_=>{var C;if(!i.rangeState.selecting)return;let S=_.target;if(S.tagName==="SPAN"&&(S=(C=S.parentNode)==null?void 0:C.parentNode),S.tagName==="DIV"&&(S=S.parentNode),S.tagName!=="TD")return;const k=S.parentNode.rowIndex,T=S.cellIndex;m.value[k][T].disabled||(k!==f.value||T!==h.value)&&(f.value=k,h.value=T,r("changerange",{selecting:!0,endDate:i.date.startOf("year").month(k*4+T)}))},y=_=>{var C;if(i.disabled)return;const S=(C=_.target)==null?void 0:C.closest("td");if(S?.tagName!=="TD"||Xa(S,"disabled"))return;const k=S.cellIndex,E=S.parentNode.rowIndex*4+k,x=i.date.startOf("year").month(E);if(i.selectionMode==="months"){if(_.type==="keydown"){r("pick",Br(i.parsedValue),!1);return}const P=Lm(i.date,i.date.year(),E,a.value,i.disabledDate),A=Xa(S,"current")?Br(i.parsedValue).filter(I=>I?.year()!==P.year()||I?.month()!==P.month()):Br(i.parsedValue).concat([ft(P)]);r("pick",A)}else i.selectionMode==="range"?i.rangeState.selecting?(i.minDate&&x>=i.minDate?r("pick",{minDate:i.minDate,maxDate:x}):r("pick",{minDate:x,maxDate:i.minDate}),r("select",!1)):(r("pick",{minDate:x,maxDate:null}),r("select",!0)):r("pick",E)};return Se(()=>i.date,async()=>{var _,C;(_=l.value)!=null&&_.contains(document.activeElement)&&(await Ye(),(C=u.value)==null||C.focus())}),e({focus:g}),(_,C)=>(B(),Q("table",{role:"grid","aria-label":w(s)("el.datepicker.monthTablePrompt"),class:$(w(o).b()),onClick:y,onMousemove:b},[ie("tbody",{ref_key:"tbodyRef",ref:l},[(B(!0),Q(rt,null,gn(m.value,(S,k)=>(B(),Q("tr",{key:k},[(B(!0),Q(rt,null,gn(S,(T,E)=>(B(),Q("td",{key:E,ref_for:!0,ref:x=>T.isSelected&&(u.value=x),class:$(v(T)),"aria-selected":!!T.isSelected,"aria-label":w(s)(`el.datepicker.month${+T.text+1}`),tabindex:T.isSelected?0:-1,onKeydown:[Pi(Ot(y,["prevent","stop"]),["space"]),Pi(Ot(y,["prevent","stop"]),["enter"])]},[L(w(DR),{cell:{...T,renderText:w(s)("el.datepicker.months."+c.value[T.text])}},null,8,["cell"])],42,bbe))),128))]))),128))],512)],42,vbe))}});const ybe=qe({...MR,selectionMode:LR("year")}),wbe=["aria-label"],_be=["aria-selected","aria-label","tabindex","onKeydown"];var Uv=le({__name:"basic-year-table",props:ybe,emits:["changerange","pick","select"],setup(t,{expose:e,emit:n}){const i=(C,S)=>{const k=ft(String(C)).locale(S).startOf("year"),E=k.endOf("year").dayOfYear();return QU(E).map(x=>k.add(x,"day").toDate())},r=t,o=n,s=De("year-table"),{t:a,lang:l}=Qt(),u=H(),c=H(),d=M(()=>Math.floor(r.date.year()/10)*10),f=H([[],[],[]]),h=H(),m=H(),g=M(()=>{var C,S,k;const T=f.value,E=ft().locale(l.value).startOf("year");for(let x=0;x<3;x++){const P=T[x];for(let A=0;A<4&&!(x*4+A>=10);A++){let I=P[A];I||(I={row:x,column:A,type:"normal",inRange:!1,start:!1,end:!1,text:-1,disabled:!1,isSelected:!1,customClass:void 0,date:void 0,dayjs:void 0,isCurrent:void 0,selected:void 0,renderText:void 0,timestamp:void 0}),I.type="normal";const D=x*4+A+d.value,q=ft().year(D),z=r.rangeState.endDate||r.maxDate||r.rangeState.selecting&&r.minDate||null;I.inRange=!!(r.minDate&&q.isSameOrAfter(r.minDate,"year")&&z&&q.isSameOrBefore(z,"year"))||!!(r.minDate&&q.isSameOrBefore(r.minDate,"year")&&z&&q.isSameOrAfter(z,"year")),(C=r.minDate)!=null&&C.isSameOrAfter(z)?(I.start=!!(z&&q.isSame(z,"year")),I.end=!!(r.minDate&&q.isSame(r.minDate,"year"))):(I.start=!!(r.minDate&&q.isSame(r.minDate,"year")),I.end=!!(z&&q.isSame(z,"year"))),E.isSame(q)&&(I.type="today"),I.text=D;const O=q.toDate();I.disabled=((S=r.disabledDate)==null?void 0:S.call(r,O))||!1,I.date=O,I.customClass=(k=r.cellClassName)==null?void 0:k.call(r,O),I.dayjs=q,I.timestamp=q.valueOf(),I.isSelected=b(I),P[A]=I}}return T}),v=()=>{var C;(C=c.value)==null||C.focus()},p=C=>{const S={},k=ft().locale(l.value),T=C.text;return S.disabled=r.disabled||(r.disabledDate?i(T,l.value).every(r.disabledDate):!1),S.today=k.year()===T,S.current=Br(r.parsedValue).some(E=>E.year()===T),C.customClass&&(S[C.customClass]=!0),C.inRange&&(S["in-range"]=!0,C.start&&(S["start-date"]=!0),C.end&&(S["end-date"]=!0)),S},b=C=>{const S=C.text;return Br(r.date).some(k=>k.year()===S)},y=C=>{var S;if(r.disabled)return;const k=(S=C.target)==null?void 0:S.closest("td");if(!k||!k.textContent||Xa(k,"disabled"))return;const T=k.cellIndex,x=k.parentNode.rowIndex*4+T+d.value,P=ft().year(x);if(r.selectionMode==="range")r.rangeState.selecting?(r.minDate&&P>=r.minDate?o("pick",{minDate:r.minDate,maxDate:P}):o("pick",{minDate:P,maxDate:r.minDate}),o("select",!1)):(o("pick",{minDate:P,maxDate:null}),o("select",!0));else if(r.selectionMode==="years"){if(C.type==="keydown"){o("pick",Br(r.parsedValue),!1);return}const A=j_(P.startOf("year"),l.value,r.disabledDate),I=Xa(k,"current")?Br(r.parsedValue).filter(D=>D?.year()!==x):Br(r.parsedValue).concat([A]);o("pick",I)}else o("pick",x)},_=C=>{var S;if(!r.rangeState.selecting)return;const k=(S=C.target)==null?void 0:S.closest("td");if(!k)return;const T=k.parentNode.rowIndex,E=k.cellIndex;g.value[T][E].disabled||(T!==h.value||E!==m.value)&&(h.value=T,m.value=E,o("changerange",{selecting:!0,endDate:ft().year(d.value).add(T*4+E,"year")}))};return Se(()=>r.date,async()=>{var C,S;(C=u.value)!=null&&C.contains(document.activeElement)&&(await Ye(),(S=c.value)==null||S.focus())}),e({focus:v}),(C,S)=>(B(),Q("table",{role:"grid","aria-label":w(a)("el.datepicker.yearTablePrompt"),class:$(w(s).b()),onClick:y,onMousemove:_},[ie("tbody",{ref_key:"tbodyRef",ref:u},[(B(!0),Q(rt,null,gn(g.value,(k,T)=>(B(),Q("tr",{key:T},[(B(!0),Q(rt,null,gn(k,(E,x)=>(B(),Q("td",{key:`${T}_${x}`,ref_for:!0,ref:P=>E.isSelected&&(c.value=P),class:$(["available",p(E)]),"aria-selected":E.isSelected,"aria-label":String(E.text),tabindex:E.isSelected?0:-1,onKeydown:[Pi(Ot(y,["prevent","stop"]),["space"]),Pi(Ot(y,["prevent","stop"]),["enter"])]},[L(w(DR),{cell:E},null,8,["cell"])],42,_be))),128))]))),128))],512)],42,wbe))}});const Cbe=["disabled","onClick"],Sbe=["aria-label","disabled"],kbe=["aria-label","disabled"],Tbe=["tabindex","aria-disabled"],Ebe=["tabindex","aria-disabled"],xbe=["aria-label","disabled"],Abe=["aria-label","disabled"];var Pbe=le({__name:"panel-date-pick",props:sbe,emits:["pick","set-picker-option","panel-change"],setup(t,{emit:e}){const n=(ge,Le,de)=>!0,i=t,r=e,o=De("picker-panel"),s=De("date-picker"),a=Rf(),l=$o(),{t:u,lang:c}=Qt(),d=Ne(ha),f=Ne(Qb,void 0),{shortcuts:h,disabledDate:m,cellClassName:g,defaultTime:v}=d.props,p=An(d.props,"defaultValue"),b=H(),y=H(ft().locale(c.value)),_=H(!1);let C=!1;const S=M(()=>ft(v).locale(c.value)),k=M(()=>y.value.month()),T=M(()=>y.value.year()),E=H([]),x=H(null),P=H(null),A=ge=>E.value.length>0?n(ge,E.value,i.format||"HH:mm:ss"):!0,I=ge=>v&&!Y.value&&!_.value&&!C?S.value.year(ge.year()).month(ge.month()).date(ge.date()):re.value?ge.millisecond(0):ge.startOf("day"),D=(ge,...Le)=>{if(!ge)r("pick",ge,...Le);else if(Pe(ge)){const de=ge.map(I);r("pick",de,...Le)}else r("pick",I(ge),...Le);x.value=null,P.value=null,_.value=!1,C=!1},q=async(ge,Le)=>{if(j.value==="date"&&ft.isDayjs(ge)){const de=Mg(i.parsedValue);let Ve=de?de.year(ge.year()).month(ge.month()).date(ge.date()):ge;A(Ve),y.value=Ve,D(Ve,re.value||Le)}else j.value==="week"?D(ge.date):j.value==="dates"&&D(ge,!0)},z=ge=>{const Le=ge?"add":"subtract";y.value=y.value[Le](1,"month"),Et("month")},R=ge=>{const Le=y.value,de=ge?"add":"subtract";y.value=O.value==="year"?Le[de](10,"year"):Le[de](1,"year"),Et("year")},O=H("date"),N=M(()=>{const ge=u("el.datepicker.year");if(O.value==="year"){const Le=Math.floor(T.value/10)*10;return ge?`${Le} ${ge} - ${Le+9} ${ge}`:`${Le} - ${Le+9}`}return`${T.value} ${ge}`}),F=ge=>{const Le=Xe(ge.value)?ge.value():ge.value;if(Le){C=!0,D(ft(Le).locale(c.value));return}ge.onClick&&ge.onClick({attrs:a,slots:l,emit:r})},j=M(()=>{const{type:ge}=i;return["week","month","months","year","years","dates"].includes(ge)?ge:"date"}),U=M(()=>j.value==="dates"||j.value==="months"||j.value==="years"),W=M(()=>j.value==="date"?O.value:j.value),J=M(()=>!!h.length),ne=async(ge,Le)=>{j.value==="month"?(y.value=Lm(y.value,y.value.year(),ge,c.value,m),D(y.value,!1)):j.value==="months"?D(ge,Le??!0):(y.value=Lm(y.value,y.value.year(),ge,c.value,m),O.value="date",["month","year","date","week"].includes(j.value)&&(D(y.value,!0),await Ye(),Dt())),Et("month")},he=async(ge,Le)=>{if(j.value==="year"){const de=y.value.startOf("year").year(ge);y.value=j_(de,c.value,m),D(y.value,!1)}else if(j.value==="years")D(ge,Le??!0);else{const de=y.value.year(ge);y.value=j_(de,c.value,m),O.value="month",["month","year","date","week"].includes(j.value)&&(D(y.value,!0),await Ye(),Dt())}Et("year")},X=Oi(),se=async ge=>{X.value||(O.value=ge,await Ye(),Dt())},re=M(()=>i.type==="datetime"||i.type==="datetimerange"),ee=M(()=>{const ge=re.value||j.value==="dates",Le=j.value==="years",de=j.value==="months",Ve=O.value==="date",gt=O.value==="year",an=O.value==="month";return ge&&Ve||Le&>||de&&an}),te=M(()=>!U.value&&i.showNow||i.showConfirm),V=M(()=>m?i.parsedValue?Pe(i.parsedValue)?m(i.parsedValue[0].toDate()):m(i.parsedValue.toDate()):!0:!1),K=()=>{if(U.value)D(i.parsedValue);else{let ge=Mg(i.parsedValue);if(!ge){const Le=ft(v).locale(c.value),de=Ke();ge=Le.year(de.year()).month(de.month()).date(de.date())}y.value=ge,D(ge)}},G=M(()=>m?m(ft().locale(c.value).toDate()):!1),ye=()=>{const Le=ft().locale(c.value).toDate();_.value=!0,(!m||!m(Le))&&A(Le)&&(y.value=ft().locale(c.value),D(y.value))},be=M(()=>i.timeFormat||tW(i.format)||Om),Ce=M(()=>i.dateFormat||eW(i.format)||lc),Y=M(()=>P.value?P.value:!i.parsedValue&&!p.value?void 0:(Mg(i.parsedValue)||y.value).format(be.value)),Z=M(()=>x.value?x.value:!i.parsedValue&&!p.value?void 0:(Mg(i.parsedValue)||y.value).format(Ce.value)),ae=H(!1),pe=()=>{ae.value=!0},je=()=>{ae.value=!1},Ie=ge=>({hour:ge.hour(),minute:ge.minute(),second:ge.second(),year:ge.year(),month:ge.month(),date:ge.date()}),fe=(ge,Le,de)=>{const{hour:Ve,minute:gt,second:an}=Ie(ge),Si=Mg(i.parsedValue),uo=Si?Si.hour(Ve).minute(gt).second(an):ge;y.value=uo,D(y.value,!0),de||(ae.value=Le)},Te=ge=>{const Le=ft(ge,be.value).locale(c.value);if(Le.isValid()&&A(Le)){const{year:de,month:Ve,date:gt}=Ie(y.value);y.value=Le.year(de).month(Ve).date(gt),P.value=null,ae.value=!1,D(y.value,!0)}},et=ge=>{const Le=Dm(ge,Ce.value,c.value,f);if(Le.isValid()){if(m&&m(Le.toDate()))return;const{hour:de,minute:Ve,second:gt}=Ie(y.value);y.value=Le.hour(de).minute(Ve).second(gt),x.value=null,D(y.value,!0)}},Re=ge=>ft.isDayjs(ge)&&ge.isValid()&&(m?!m(ge.toDate()):!0),ze=ge=>Dm(ge,i.format,c.value,f),Ke=()=>{const ge=ft(p.value).locale(c.value);if(!p.value){const Le=S.value;return ft().hour(Le.hour()).minute(Le.minute()).second(Le.second()).locale(c.value)}return ge},Dt=()=>{var ge;["week","month","year","date"].includes(j.value)&&((ge=b.value)==null||ge.focus())},Cn=()=>{Dt(),j.value==="week"&&kt(Me.down)},Je=ge=>{const Le=Bn(ge);[Me.up,Me.down,Me.left,Me.right,Me.home,Me.end,Me.pageUp,Me.pageDown].includes(Le)&&(kt(Le),ge.stopPropagation(),ge.preventDefault()),[Me.enter,Me.space,Me.numpadEnter].includes(Le)&&x.value===null&&P.value===null&&(ge.preventDefault(),D(y.value,!1))},kt=ge=>{var Le;const{up:de,down:Ve,left:gt,right:an,home:Si,end:uo,pageUp:Oe,pageDown:Fe}=Me,st={year:{[de]:-4,[Ve]:4,[gt]:-1,[an]:1,offset:(en,Ue)=>en.setFullYear(en.getFullYear()+Ue)},month:{[de]:-4,[Ve]:4,[gt]:-1,[an]:1,offset:(en,Ue)=>en.setMonth(en.getMonth()+Ue)},week:{[de]:-1,[Ve]:1,[gt]:-1,[an]:1,offset:(en,Ue)=>en.setDate(en.getDate()+Ue*7)},date:{[de]:-7,[Ve]:7,[gt]:-1,[an]:1,[Si]:en=>-en.getDay(),[uo]:en=>-en.getDay()+6,[Oe]:en=>-new Date(en.getFullYear(),en.getMonth(),0).getDate(),[Fe]:en=>new Date(en.getFullYear(),en.getMonth()+1,0).getDate(),offset:(en,Ue)=>en.setDate(en.getDate()+Ue)}},Vn=y.value.toDate();for(;Math.abs(y.value.diff(Vn,"year",!0))<1;){const en=st[W.value];if(!en)return;if(en.offset(Vn,Xe(en[ge])?en[ge](Vn):(Le=en[ge])!=null?Le:0),m&&m(Vn))break;const Ue=ft(Vn).locale(c.value);y.value=Ue,r("pick",Ue,!0);break}},Et=ge=>{r("panel-change",y.value.toDate(),ge,O.value)};return Se(()=>j.value,ge=>{if(["month","year"].includes(ge)){O.value=ge;return}else if(ge==="years"){O.value="year";return}else if(ge==="months"){O.value="month";return}O.value="date"},{immediate:!0}),Se(()=>p.value,ge=>{ge&&(y.value=Ke())},{immediate:!0}),Se(()=>i.parsedValue,ge=>{if(ge){if(U.value||Pe(ge))return;y.value=ge}else y.value=Ke()},{immediate:!0}),r("set-picker-option",["isValidValue",Re]),r("set-picker-option",["parseUserInput",ze]),r("set-picker-option",["handleFocusPicker",Cn]),(ge,Le)=>(B(),Q("div",{class:$([w(o).b(),w(s).b(),w(o).is("border",ge.border),w(o).is("disabled",w(X)),{"has-sidebar":ge.$slots.sidebar||J.value,"has-time":re.value}])},[ie("div",{class:$(w(o).e("body-wrapper"))},[we(ge.$slots,"sidebar",{class:$(w(o).e("sidebar"))}),J.value?(B(),Q("div",{key:0,class:$(w(o).e("sidebar"))},[(B(!0),Q(rt,null,gn(w(h),(de,Ve)=>(B(),Q("button",{key:Ve,type:"button",disabled:w(X),class:$(w(o).e("shortcut")),onClick:gt=>F(de)},We(de.text),11,Cbe))),128))],2)):ve("v-if",!0),ie("div",{class:$(w(o).e("body"))},[re.value?(B(),Q("div",{key:0,class:$(w(s).e("time-header"))},[ie("span",{class:$(w(s).e("editor-wrap"))},[L(w(cr),{placeholder:w(u)("el.datepicker.selectDate"),"model-value":Z.value,size:"small","validate-event":!1,disabled:w(X),readonly:!ge.editable,onInput:Le[0]||(Le[0]=de=>x.value=de),onChange:et},null,8,["placeholder","model-value","disabled","readonly"])],2),Vt((B(),Q("span",{class:$(w(s).e("editor-wrap"))},[L(w(cr),{placeholder:w(u)("el.datepicker.selectTime"),"model-value":Y.value,size:"small","validate-event":!1,disabled:w(X),readonly:!ge.editable,onFocus:pe,onInput:Le[1]||(Le[1]=de=>P.value=de),onChange:Te},null,8,["placeholder","model-value","disabled","readonly"]),L(w(W_),{visible:ae.value,format:be.value,"parsed-value":y.value,onPick:fe},null,8,["visible","format","parsed-value"])],2)),[[w(wf),je]])],2)):ve("v-if",!0),Vt(ie("div",{class:$([w(s).e("header"),(O.value==="year"||O.value==="month")&&w(s).em("header","bordered")])},[ie("span",{class:$(w(s).e("prev-btn"))},[ie("button",{type:"button","aria-label":w(u)("el.datepicker.prevYear"),class:$(["d-arrow-left",w(o).e("icon-btn")]),disabled:w(X),onClick:Le[2]||(Le[2]=de=>R(!1))},[we(ge.$slots,"prev-year",{},()=>[L(w(He),null,{default:ce(()=>[L(w(Tc))]),_:1})])],10,Sbe),Vt(ie("button",{type:"button","aria-label":w(u)("el.datepicker.prevMonth"),class:$([w(o).e("icon-btn"),"arrow-left"]),disabled:w(X),onClick:Le[3]||(Le[3]=de=>z(!1))},[we(ge.$slots,"prev-month",{},()=>[L(w(He),null,{default:ce(()=>[L(w(Am))]),_:1})])],10,kbe),[[On,O.value==="date"]])],2),ie("span",{role:"button",class:$(w(s).e("header-label")),"aria-live":"polite",tabindex:ge.disabled?void 0:0,"aria-disabled":ge.disabled,onKeydown:Le[4]||(Le[4]=Pi(de=>se("year"),["enter"])),onClick:Le[5]||(Le[5]=de=>se("year"))},We(N.value),43,Tbe),Vt(ie("span",{role:"button","aria-live":"polite",tabindex:ge.disabled?void 0:0,"aria-disabled":ge.disabled,class:$([w(s).e("header-label"),{active:O.value==="month"}]),onKeydown:Le[6]||(Le[6]=Pi(de=>se("month"),["enter"])),onClick:Le[7]||(Le[7]=de=>se("month"))},We(w(u)(`el.datepicker.month${k.value+1}`)),43,Ebe),[[On,O.value==="date"]]),ie("span",{class:$(w(s).e("next-btn"))},[Vt(ie("button",{type:"button","aria-label":w(u)("el.datepicker.nextMonth"),class:$([w(o).e("icon-btn"),"arrow-right"]),disabled:w(X),onClick:Le[8]||(Le[8]=de=>z(!0))},[we(ge.$slots,"next-month",{},()=>[L(w(He),null,{default:ce(()=>[L(w(oa))]),_:1})])],10,xbe),[[On,O.value==="date"]]),ie("button",{type:"button","aria-label":w(u)("el.datepicker.nextYear"),class:$([w(o).e("icon-btn"),"d-arrow-right"]),disabled:w(X),onClick:Le[9]||(Le[9]=de=>R(!0))},[we(ge.$slots,"next-year",{},()=>[L(w(He),null,{default:ce(()=>[L(w(Ec))]),_:1})])],10,Abe)],2)],2),[[On,O.value!=="time"]]),ie("div",{class:$(w(o).e("content")),onKeydown:Je},[O.value==="date"?(B(),_e(C2,{key:0,ref_key:"currentViewRef",ref:b,"selection-mode":j.value,date:y.value,"parsed-value":ge.parsedValue,"disabled-date":w(m),disabled:w(X),"cell-class-name":w(g),"show-week-number":ge.showWeekNumber,onPick:q},null,8,["selection-mode","date","parsed-value","disabled-date","disabled","cell-class-name","show-week-number"])):ve("v-if",!0),O.value==="year"?(B(),_e(Uv,{key:1,ref_key:"currentViewRef",ref:b,"selection-mode":j.value,date:y.value,"disabled-date":w(m),disabled:w(X),"parsed-value":ge.parsedValue,"cell-class-name":w(g),onPick:he},null,8,["selection-mode","date","disabled-date","disabled","parsed-value","cell-class-name"])):ve("v-if",!0),O.value==="month"?(B(),_e(Hv,{key:2,ref_key:"currentViewRef",ref:b,"selection-mode":j.value,date:y.value,"parsed-value":ge.parsedValue,"disabled-date":w(m),disabled:w(X),"cell-class-name":w(g),onPick:ne},null,8,["selection-mode","date","parsed-value","disabled-date","disabled","cell-class-name"])):ve("v-if",!0)],34)],2)],2),ge.showFooter&&ee.value&&te.value?(B(),Q("div",{key:0,class:$(w(o).e("footer"))},[Vt(L(w(Hi),{text:"",size:"small",class:$(w(o).e("link-btn")),disabled:G.value,onClick:ye},{default:ce(()=>[dt(We(w(u)("el.datepicker.now")),1)]),_:1},8,["class","disabled"]),[[On,!U.value&&ge.showNow]]),ge.showConfirm?(B(),_e(w(Hi),{key:0,plain:"",size:"small",class:$(w(o).e("link-btn")),disabled:V.value,onClick:K},{default:ce(()=>[dt(We(w(u)("el.datepicker.confirm")),1)]),_:1},8,["class","disabled"])):ve("v-if",!0)],2)):ve("v-if",!0)],2))}});const Ibe=qe({...jW,...OR}),Rbe=t=>{const{emit:e}=Ct(),n=Rf(),i=$o();return o=>{const s=Xe(o.value)?o.value():o.value;if(s){e("pick",[ft(s[0]).locale(t.value),ft(s[1]).locale(t.value)]);return}o.onClick&&o.onClick({attrs:n,slots:i,emit:e})}},NR=(t,{defaultValue:e,defaultTime:n,leftDate:i,rightDate:r,step:o,unit:s,sortDates:a})=>{const{emit:l}=Ct(),{pickerNs:u}=Ne(RR),c=De("date-range-picker"),{t:d,lang:f}=Qt(),h=Rbe(f),m=H(),g=H(),v=H({endDate:null,selecting:!1}),p=S=>{v.value=S},b=(S=!1)=>{const k=w(m),T=w(g);zv([k,T])&&l("pick",[k,T],S)},y=S=>{v.value.selecting=S,S||(v.value.endDate=null)},_=S=>{if(Pe(S)&&S.length===2){const[k,T]=S;m.value=k,i.value=k,g.value=T,a(w(m),w(g))}else C()},C=()=>{let[S,k]=zC(w(e),{lang:w(f),step:o,unit:s,unlinkPanels:t.unlinkPanels});const T=x=>x.diff(x.startOf("d"),"ms"),E=w(n);if(E){let x=0,P=0;if(Pe(E)){const[A,I]=E.map(ft);x=T(A),P=T(I)}else{const A=T(ft(E));x=A,P=A}S=S.startOf("d").add(x,"ms"),k=k.startOf("d").add(P,"ms")}m.value=void 0,g.value=void 0,i.value=S,r.value=k};return Se(e,S=>{S&&C()},{immediate:!0}),Se(()=>t.parsedValue,S=>{(!S?.length||!$i(S,[m.value,g.value]))&&_(S)},{immediate:!0}),Se(()=>t.visible,()=>{t.visible&&_(t.parsedValue)},{immediate:!0}),{minDate:m,maxDate:g,rangeState:v,lang:f,ppNs:u,drpNs:c,handleChangeRange:p,handleRangeConfirm:b,handleShortcutClick:h,onSelect:y,parseValue:_,t:d}},Mbe=(t,e,n,i)=>{const r=H("date"),o=H(),s=H("date"),a=H(),l=Ne(ha),{disabledDate:u}=l.props,{t:c,lang:d}=Qt(),f=M(()=>n.value.year()),h=M(()=>n.value.month()),m=M(()=>i.value.year()),g=M(()=>i.value.month());function v(S,k){const T=c("el.datepicker.year");if(S.value==="year"){const E=Math.floor(k.value/10)*10;return T?`${E} ${T} - ${E+9} ${T}`:`${E} - ${E+9}`}return`${k.value} ${T}`}function p(S){S?.focus()}async function b(S,k){if(t.disabled)return;const T=S==="left"?r:s,E=S==="left"?o:a;T.value=k,await Ye(),p(E.value)}async function y(S,k,T){if(t.disabled)return;const E=k==="left",x=E?n:i,P=E?i:n,A=E?r:s,I=E?o:a;if(S==="year"){const D=x.value.year(T);x.value=j_(D,d.value,u)}S==="month"&&(x.value=Lm(x.value,x.value.year(),T,d.value,u)),t.unlinkPanels||(P.value=k==="left"?x.value.add(1,"month"):x.value.subtract(1,"month")),A.value=S==="year"?"month":"date",await Ye(),p(I.value),_(S)}function _(S){e("panel-change",[n.value.toDate(),i.value.toDate()],S)}function C(S,k,T){const E=T?"add":"subtract";return S==="year"?k[E](10,"year"):k[E](1,"year")}return{leftCurrentView:r,rightCurrentView:s,leftCurrentViewRef:o,rightCurrentViewRef:a,leftYear:f,rightYear:m,leftMonth:h,rightMonth:g,leftYearLabel:M(()=>v(r,f)),rightYearLabel:M(()=>v(s,m)),showLeftPicker:S=>b("left",S),showRightPicker:S=>b("right",S),handleLeftYearPick:S=>y("year","left",S),handleRightYearPick:S=>y("year","right",S),handleLeftMonthPick:S=>y("month","left",S),handleRightMonthPick:S=>y("month","right",S),handlePanelChange:_,adjustDateByView:C}},Obe=["disabled","onClick"],Lbe=["aria-label","disabled"],Dbe=["aria-label","disabled"],Nbe=["disabled","aria-label"],Bbe=["disabled","aria-label"],Vbe=["tabindex","aria-disabled"],Fbe=["tabindex","aria-disabled"],$be=["disabled","aria-label"],zbe=["disabled","aria-label"],Hbe=["aria-label","disabled"],Ube=["disabled","aria-label"],Wbe=["tabindex","aria-disabled"],qbe=["tabindex","aria-disabled"],H0="month";var jbe=le({__name:"panel-date-range",props:Ibe,emits:["pick","set-picker-option","calendar-change","panel-change","clear"],setup(t,{emit:e}){const n=t,i=e,r=Ne(ha),o=Ne(Qb,void 0),{disabledDate:s,cellClassName:a,defaultTime:l,clearable:u}=r.props,c=An(r.props,"format"),d=An(r.props,"shortcuts"),f=An(r.props,"defaultValue"),{lang:h}=Qt(),m=H(ft().locale(h.value)),g=H(ft().locale(h.value).add(1,H0)),{minDate:v,maxDate:p,rangeState:b,ppNs:y,drpNs:_,handleChangeRange:C,handleRangeConfirm:S,handleShortcutClick:k,onSelect:T,parseValue:E,t:x}=NR(n,{defaultValue:f,defaultTime:l,leftDate:m,rightDate:g,unit:H0,sortDates:en});Se(()=>n.visible,Ue=>{!Ue&&b.value.selecting&&(E(n.parsedValue),T(!1))});const P=H({min:null,max:null}),A=H({min:null,max:null}),{leftCurrentView:I,rightCurrentView:D,leftCurrentViewRef:q,rightCurrentViewRef:z,leftYear:R,rightYear:O,leftMonth:N,rightMonth:F,leftYearLabel:j,rightYearLabel:U,showLeftPicker:W,showRightPicker:J,handleLeftYearPick:ne,handleRightYearPick:he,handleLeftMonthPick:X,handleRightMonthPick:se,handlePanelChange:re,adjustDateByView:ee}=Mbe(n,i,m,g),te=M(()=>!!d.value.length),V=M(()=>P.value.min!==null?P.value.min:v.value?v.value.format(Ce.value):""),K=M(()=>P.value.max!==null?P.value.max:p.value||v.value?(p.value||v.value).format(Ce.value):""),G=M(()=>A.value.min!==null?A.value.min:v.value?v.value.format(be.value):""),ye=M(()=>A.value.max!==null?A.value.max:p.value||v.value?(p.value||v.value).format(be.value):""),be=M(()=>n.timeFormat||tW(c.value||"")||Om),Ce=M(()=>n.dateFormat||eW(c.value||"")||lc),Y=Ue=>zv(Ue)&&(s?!s(Ue[0].toDate())&&!s(Ue[1].toDate()):!0),Z=()=>{m.value=ee(I.value,m.value,!1),n.unlinkPanels||(g.value=m.value.add(1,"month")),re("year")},ae=()=>{m.value=m.value.subtract(1,"month"),n.unlinkPanels||(g.value=m.value.add(1,"month")),re("month")},pe=()=>{n.unlinkPanels?g.value=ee(D.value,g.value,!0):(m.value=ee(D.value,m.value,!0),g.value=m.value.add(1,"month")),re("year")},je=()=>{n.unlinkPanels?g.value=g.value.add(1,"month"):(m.value=m.value.add(1,"month"),g.value=m.value.add(1,"month")),re("month")},Ie=()=>{m.value=ee(I.value,m.value,!0),re("year")},fe=()=>{m.value=m.value.add(1,"month"),re("month")},Te=()=>{g.value=ee(D.value,g.value,!1),re("year")},et=()=>{g.value=g.value.subtract(1,"month"),re("month")},Re=M(()=>{const Ue=(N.value+1)%12,tt=N.value+1>=12?1:0;return n.unlinkPanels&&new Date(R.value+tt,Ue)n.unlinkPanels&&O.value*12+F.value-(R.value*12+N.value+1)>=12),Ke=Oi(),Dt=M(()=>!(v.value&&p.value&&!b.value.selecting&&zv([v.value,p.value])&&!Ke.value)),Cn=M(()=>n.type==="datetime"||n.type==="datetimerange"),Je=(Ue,tt)=>{if(Ue)return l?ft(l[tt]||l).locale(h.value).year(Ue.year()).month(Ue.month()).date(Ue.date()):Ue},kt=(Ue,tt=!0)=>{const pt=Ue.minDate,jr=Ue.maxDate,Uo=Je(pt,0),Jc=Je(jr,1);p.value===Jc&&v.value===Uo||(i("calendar-change",[pt.toDate(),jr&&jr.toDate()]),p.value=Jc,v.value=Uo,!Cn.value&&tt&&(tt=!Uo||!Jc),S(tt))},Et=H(!1),ge=H(!1),Le=()=>{Et.value=!1},de=()=>{ge.value=!1},Ve=(Ue,tt)=>{P.value[tt]=Ue;const pt=ft(Ue,Ce.value).locale(h.value);if(pt.isValid()){if(s&&s(pt.toDate()))return;tt==="min"?(m.value=pt,v.value=(v.value||m.value).year(pt.year()).month(pt.month()).date(pt.date()),!n.unlinkPanels&&(!p.value||p.value.isBefore(v.value))&&(g.value=pt.add(1,"month"),p.value=v.value.add(1,"month"))):(g.value=pt,p.value=(p.value||g.value).year(pt.year()).month(pt.month()).date(pt.date()),!n.unlinkPanels&&(!v.value||v.value.isAfter(p.value))&&(m.value=pt.subtract(1,"month"),v.value=p.value.subtract(1,"month"))),en(v.value,p.value),S(!0)}},gt=(Ue,tt)=>{P.value[tt]=null},an=(Ue,tt)=>{A.value[tt]=Ue;const pt=ft(Ue,be.value).locale(h.value);pt.isValid()&&(tt==="min"?(Et.value=!0,v.value=(v.value||m.value).hour(pt.hour()).minute(pt.minute()).second(pt.second()),m.value=v.value):(ge.value=!0,p.value=(p.value||g.value).hour(pt.hour()).minute(pt.minute()).second(pt.second()),g.value=p.value))},Si=(Ue,tt)=>{A.value[tt]=null,tt==="min"?(m.value=v.value,Et.value=!1,(!p.value||p.value.isBefore(v.value))&&(p.value=v.value)):(g.value=p.value,ge.value=!1,p.value&&p.value.isBefore(v.value)&&(v.value=p.value)),S(!0)},uo=(Ue,tt,pt)=>{A.value.min||(Ue&&(v.value=(v.value||m.value).hour(Ue.hour()).minute(Ue.minute()).second(Ue.second())),pt||(Et.value=tt),(!p.value||p.value.isBefore(v.value))&&(p.value=v.value,g.value=Ue,Ye(()=>{E(n.parsedValue)})),S(!0))},Oe=(Ue,tt,pt)=>{A.value.max||(Ue&&(p.value=(p.value||g.value).hour(Ue.hour()).minute(Ue.minute()).second(Ue.second())),pt||(ge.value=tt),p.value&&p.value.isBefore(v.value)&&(v.value=p.value),S(!0))},Fe=()=>{st(),i("clear")},st=()=>{let Ue=null;r?.emptyValues&&(Ue=r.emptyValues.valueOnClear.value),m.value=zC(w(f),{lang:w(h),unit:"month",unlinkPanels:n.unlinkPanels})[0],g.value=m.value.add(1,"month"),p.value=void 0,v.value=void 0,S(!0),i("pick",Ue)},Vn=Ue=>Dm(Ue,c.value||"",h.value,o);function en(Ue,tt){if(n.unlinkPanels&&tt){const pt=Ue?.year()||0,jr=Ue?.month()||0,Uo=tt.year(),Jc=tt.month();g.value=pt===Uo&&jr===Jc?tt.add(1,H0):tt}else g.value=m.value.add(1,H0),tt&&(g.value=g.value.hour(tt.hour()).minute(tt.minute()).second(tt.second()))}return i("set-picker-option",["isValidValue",Y]),i("set-picker-option",["parseUserInput",Vn]),i("set-picker-option",["handleClear",st]),(Ue,tt)=>(B(),Q("div",{class:$([w(y).b(),w(_).b(),w(y).is("border",Ue.border),w(y).is("disabled",w(Ke)),{"has-sidebar":Ue.$slots.sidebar||te.value,"has-time":Cn.value}])},[ie("div",{class:$(w(y).e("body-wrapper"))},[we(Ue.$slots,"sidebar",{class:$(w(y).e("sidebar"))}),te.value?(B(),Q("div",{key:0,class:$(w(y).e("sidebar"))},[(B(!0),Q(rt,null,gn(d.value,(pt,jr)=>(B(),Q("button",{key:jr,type:"button",disabled:w(Ke),class:$(w(y).e("shortcut")),onClick:Uo=>w(k)(pt)},We(pt.text),11,Obe))),128))],2)):ve("v-if",!0),ie("div",{class:$(w(y).e("body"))},[Cn.value?(B(),Q("div",{key:0,class:$(w(_).e("time-header"))},[ie("span",{class:$(w(_).e("editors-wrap"))},[ie("span",{class:$(w(_).e("time-picker-wrap"))},[L(w(cr),{size:"small",disabled:w(b).selecting||w(Ke),placeholder:w(x)("el.datepicker.startDate"),class:$(w(_).e("editor")),"model-value":V.value,"validate-event":!1,readonly:!Ue.editable,onInput:tt[0]||(tt[0]=pt=>Ve(pt,"min")),onChange:tt[1]||(tt[1]=pt=>gt(pt,"min"))},null,8,["disabled","placeholder","class","model-value","readonly"])],2),Vt((B(),Q("span",{class:$(w(_).e("time-picker-wrap"))},[L(w(cr),{size:"small",class:$(w(_).e("editor")),disabled:w(b).selecting||w(Ke),placeholder:w(x)("el.datepicker.startTime"),"model-value":G.value,"validate-event":!1,readonly:!Ue.editable,onFocus:tt[2]||(tt[2]=pt=>Et.value=!0),onInput:tt[3]||(tt[3]=pt=>an(pt,"min")),onChange:tt[4]||(tt[4]=pt=>Si(pt,"min"))},null,8,["class","disabled","placeholder","model-value","readonly"]),L(w(W_),{visible:Et.value,format:be.value,"datetime-role":"start","parsed-value":w(v)||m.value,onPick:uo},null,8,["visible","format","parsed-value"])],2)),[[w(wf),Le]])],2),ie("span",null,[L(w(He),null,{default:ce(()=>[L(w(oa))]),_:1})]),ie("span",{class:$([w(_).e("editors-wrap"),"is-right"])},[ie("span",{class:$(w(_).e("time-picker-wrap"))},[L(w(cr),{size:"small",class:$(w(_).e("editor")),disabled:w(b).selecting||w(Ke),placeholder:w(x)("el.datepicker.endDate"),"model-value":K.value,readonly:!w(v)||!Ue.editable,"validate-event":!1,onInput:tt[5]||(tt[5]=pt=>Ve(pt,"max")),onChange:tt[6]||(tt[6]=pt=>gt(pt,"max"))},null,8,["class","disabled","placeholder","model-value","readonly"])],2),Vt((B(),Q("span",{class:$(w(_).e("time-picker-wrap"))},[L(w(cr),{size:"small",class:$(w(_).e("editor")),disabled:w(b).selecting||w(Ke),placeholder:w(x)("el.datepicker.endTime"),"model-value":ye.value,readonly:!w(v)||!Ue.editable,"validate-event":!1,onFocus:tt[7]||(tt[7]=pt=>w(v)&&(ge.value=!0)),onInput:tt[8]||(tt[8]=pt=>an(pt,"max")),onChange:tt[9]||(tt[9]=pt=>Si(pt,"max"))},null,8,["class","disabled","placeholder","model-value","readonly"]),L(w(W_),{"datetime-role":"end",visible:ge.value,format:be.value,"parsed-value":w(p)||g.value,onPick:Oe},null,8,["visible","format","parsed-value"])],2)),[[w(wf),de]])],2)],2)):ve("v-if",!0),ie("div",{class:$([[w(y).e("content"),w(_).e("content")],"is-left"])},[ie("div",{class:$(w(_).e("header"))},[ie("button",{type:"button",class:$([w(y).e("icon-btn"),"d-arrow-left"]),"aria-label":w(x)("el.datepicker.prevYear"),disabled:w(Ke),onClick:Z},[we(Ue.$slots,"prev-year",{},()=>[L(w(He),null,{default:ce(()=>[L(w(Tc))]),_:1})])],10,Lbe),Vt(ie("button",{type:"button",class:$([w(y).e("icon-btn"),"arrow-left"]),"aria-label":w(x)("el.datepicker.prevMonth"),disabled:w(Ke),onClick:ae},[we(Ue.$slots,"prev-month",{},()=>[L(w(He),null,{default:ce(()=>[L(w(Am))]),_:1})])],10,Dbe),[[On,w(I)==="date"]]),Ue.unlinkPanels?(B(),Q("button",{key:0,type:"button",disabled:!ze.value||w(Ke),class:$([[w(y).e("icon-btn"),w(y).is("disabled",!ze.value||w(Ke))],"d-arrow-right"]),"aria-label":w(x)("el.datepicker.nextYear"),onClick:Ie},[we(Ue.$slots,"next-year",{},()=>[L(w(He),null,{default:ce(()=>[L(w(Ec))]),_:1})])],10,Nbe)):ve("v-if",!0),Ue.unlinkPanels&&w(I)==="date"?(B(),Q("button",{key:1,type:"button",disabled:!Re.value||w(Ke),class:$([[w(y).e("icon-btn"),w(y).is("disabled",!Re.value||w(Ke))],"arrow-right"]),"aria-label":w(x)("el.datepicker.nextMonth"),onClick:fe},[we(Ue.$slots,"next-month",{},()=>[L(w(He),null,{default:ce(()=>[L(w(oa))]),_:1})])],10,Bbe)):ve("v-if",!0),ie("div",null,[ie("span",{role:"button",class:$(w(_).e("header-label")),"aria-live":"polite",tabindex:Ue.disabled?void 0:0,"aria-disabled":Ue.disabled,onKeydown:tt[10]||(tt[10]=Pi(pt=>w(W)("year"),["enter"])),onClick:tt[11]||(tt[11]=pt=>w(W)("year"))},We(w(j)),43,Vbe),Vt(ie("span",{role:"button","aria-live":"polite",tabindex:Ue.disabled?void 0:0,"aria-disabled":Ue.disabled,class:$([w(_).e("header-label"),{active:w(I)==="month"}]),onKeydown:tt[12]||(tt[12]=Pi(pt=>w(W)("month"),["enter"])),onClick:tt[13]||(tt[13]=pt=>w(W)("month"))},We(w(x)(`el.datepicker.month${m.value.month()+1}`)),43,Fbe),[[On,w(I)==="date"]])])],2),w(I)==="date"?(B(),_e(C2,{key:0,ref_key:"leftCurrentViewRef",ref:q,"selection-mode":"range",date:m.value,"min-date":w(v),"max-date":w(p),"range-state":w(b),"disabled-date":w(s),"cell-class-name":w(a),"show-week-number":Ue.showWeekNumber,disabled:w(Ke),onChangerange:w(C),onPick:kt,onSelect:w(T)},null,8,["date","min-date","max-date","range-state","disabled-date","cell-class-name","show-week-number","disabled","onChangerange","onSelect"])):ve("v-if",!0),w(I)==="year"?(B(),_e(Uv,{key:1,ref_key:"leftCurrentViewRef",ref:q,"selection-mode":"year",date:m.value,"disabled-date":w(s),"parsed-value":Ue.parsedValue,disabled:w(Ke),onPick:w(ne)},null,8,["date","disabled-date","parsed-value","disabled","onPick"])):ve("v-if",!0),w(I)==="month"?(B(),_e(Hv,{key:2,ref_key:"leftCurrentViewRef",ref:q,"selection-mode":"month",date:m.value,"parsed-value":Ue.parsedValue,"disabled-date":w(s),disabled:w(Ke),onPick:w(X)},null,8,["date","parsed-value","disabled-date","disabled","onPick"])):ve("v-if",!0)],2),ie("div",{class:$([[w(y).e("content"),w(_).e("content")],"is-right"])},[ie("div",{class:$(w(_).e("header"))},[Ue.unlinkPanels?(B(),Q("button",{key:0,type:"button",disabled:!ze.value||w(Ke),class:$([[w(y).e("icon-btn"),w(y).is("disabled",!ze.value||w(Ke))],"d-arrow-left"]),"aria-label":w(x)("el.datepicker.prevYear"),onClick:Te},[we(Ue.$slots,"prev-year",{},()=>[L(w(He),null,{default:ce(()=>[L(w(Tc))]),_:1})])],10,$be)):ve("v-if",!0),Ue.unlinkPanels&&w(D)==="date"?(B(),Q("button",{key:1,type:"button",disabled:!Re.value||w(Ke),class:$([[w(y).e("icon-btn"),w(y).is("disabled",!Re.value||w(Ke))],"arrow-left"]),"aria-label":w(x)("el.datepicker.prevMonth"),onClick:et},[we(Ue.$slots,"prev-month",{},()=>[L(w(He),null,{default:ce(()=>[L(w(Am))]),_:1})])],10,zbe)):ve("v-if",!0),ie("button",{type:"button","aria-label":w(x)("el.datepicker.nextYear"),class:$([w(y).e("icon-btn"),"d-arrow-right"]),disabled:w(Ke),onClick:pe},[we(Ue.$slots,"next-year",{},()=>[L(w(He),null,{default:ce(()=>[L(w(Ec))]),_:1})])],10,Hbe),Vt(ie("button",{type:"button",class:$([w(y).e("icon-btn"),"arrow-right"]),disabled:w(Ke),"aria-label":w(x)("el.datepicker.nextMonth"),onClick:je},[we(Ue.$slots,"next-month",{},()=>[L(w(He),null,{default:ce(()=>[L(w(oa))]),_:1})])],10,Ube),[[On,w(D)==="date"]]),ie("div",null,[ie("span",{role:"button",class:$(w(_).e("header-label")),"aria-live":"polite",tabindex:Ue.disabled?void 0:0,"aria-disabled":Ue.disabled,onKeydown:tt[14]||(tt[14]=Pi(pt=>w(J)("year"),["enter"])),onClick:tt[15]||(tt[15]=pt=>w(J)("year"))},We(w(U)),43,Wbe),Vt(ie("span",{role:"button","aria-live":"polite",tabindex:Ue.disabled?void 0:0,"aria-disabled":Ue.disabled,class:$([w(_).e("header-label"),{active:w(D)==="month"}]),onKeydown:tt[16]||(tt[16]=Pi(pt=>w(J)("month"),["enter"])),onClick:tt[17]||(tt[17]=pt=>w(J)("month"))},We(w(x)(`el.datepicker.month${g.value.month()+1}`)),43,qbe),[[On,w(D)==="date"]])])],2),w(D)==="date"?(B(),_e(C2,{key:0,ref_key:"rightCurrentViewRef",ref:z,"selection-mode":"range",date:g.value,"min-date":w(v),"max-date":w(p),"range-state":w(b),"disabled-date":w(s),"cell-class-name":w(a),"show-week-number":Ue.showWeekNumber,disabled:w(Ke),onChangerange:w(C),onPick:kt,onSelect:w(T)},null,8,["date","min-date","max-date","range-state","disabled-date","cell-class-name","show-week-number","disabled","onChangerange","onSelect"])):ve("v-if",!0),w(D)==="year"?(B(),_e(Uv,{key:1,ref_key:"rightCurrentViewRef",ref:z,"selection-mode":"year",date:g.value,"disabled-date":w(s),"parsed-value":Ue.parsedValue,disabled:w(Ke),onPick:w(he)},null,8,["date","disabled-date","parsed-value","disabled","onPick"])):ve("v-if",!0),w(D)==="month"?(B(),_e(Hv,{key:2,ref_key:"rightCurrentViewRef",ref:z,"selection-mode":"month",date:g.value,"parsed-value":Ue.parsedValue,"disabled-date":w(s),disabled:w(Ke),onPick:w(se)},null,8,["date","parsed-value","disabled-date","disabled","onPick"])):ve("v-if",!0)],2)],2)],2),Ue.showFooter&&Cn.value&&(Ue.showConfirm||w(u))?(B(),Q("div",{key:0,class:$(w(y).e("footer"))},[w(u)?(B(),_e(w(Hi),{key:0,text:"",size:"small",class:$(w(y).e("link-btn")),onClick:Fe},{default:ce(()=>[dt(We(w(x)("el.datepicker.clear")),1)]),_:1},8,["class"])):ve("v-if",!0),Ue.showConfirm?(B(),_e(w(Hi),{key:1,plain:"",size:"small",class:$(w(y).e("link-btn")),disabled:Dt.value,onClick:tt[18]||(tt[18]=pt=>w(S)(!1))},{default:ce(()=>[dt(We(w(x)("el.datepicker.confirm")),1)]),_:1},8,["class","disabled"])):ve("v-if",!0)],2)):ve("v-if",!0)],2))}});const Kbe=qe({...OR}),Gbe=["pick","set-picker-option","calendar-change"],Ybe=({unlinkPanels:t,leftDate:e,rightDate:n})=>{const{t:i}=Qt(),r=()=>{e.value=e.value.subtract(1,"year"),t.value||(n.value=n.value.subtract(1,"year"))},o=()=>{t.value||(e.value=e.value.add(1,"year")),n.value=n.value.add(1,"year")},s=()=>{e.value=e.value.add(1,"year")},a=()=>{n.value=n.value.subtract(1,"year")},l=M(()=>`${e.value.year()} ${i("el.datepicker.year")}`),u=M(()=>`${n.value.year()} ${i("el.datepicker.year")}`),c=M(()=>e.value.year()),d=M(()=>n.value.year()===e.value.year()?e.value.year()+1:n.value.year());return{leftPrevYear:r,rightNextYear:o,leftNextYear:s,rightPrevYear:a,leftLabel:l,rightLabel:u,leftYear:c,rightYear:d}},Xbe=["disabled","onClick"],Jbe=["disabled"],Zbe=["disabled"],Qbe=["disabled"],e0e=["disabled"],U0="year";var t0e=le({name:"DatePickerMonthRange",__name:"panel-month-range",props:Kbe,emits:Gbe,setup(t,{emit:e}){const n=t,i=e,{lang:r}=Qt(),o=Ne(ha),s=Ne(Qb,void 0),{shortcuts:a,disabledDate:l,cellClassName:u}=o.props,c=An(o.props,"format"),d=An(o.props,"defaultValue"),f=H(ft().locale(r.value)),h=H(ft().locale(r.value).add(1,U0)),{minDate:m,maxDate:g,rangeState:v,ppNs:p,drpNs:b,handleChangeRange:y,handleRangeConfirm:_,handleShortcutClick:C,onSelect:S,parseValue:k}=NR(n,{defaultValue:d,leftDate:f,rightDate:h,unit:U0,sortDates:j}),T=M(()=>!!a.length),{leftPrevYear:E,rightNextYear:x,leftNextYear:P,rightPrevYear:A,leftLabel:I,rightLabel:D,leftYear:q,rightYear:z}=Ybe({unlinkPanels:An(n,"unlinkPanels"),leftDate:f,rightDate:h}),R=M(()=>n.unlinkPanels&&z.value>q.value+1),O=(W,J=!0)=>{const ne=W.minDate,he=W.maxDate;g.value===he&&m.value===ne||(i("calendar-change",[ne.toDate(),he&&he.toDate()]),g.value=he,m.value=ne,J&&_())},N=()=>{let W=null;o?.emptyValues&&(W=o.emptyValues.valueOnClear.value),f.value=zC(w(d),{lang:w(r),unit:"year",unlinkPanels:n.unlinkPanels})[0],h.value=f.value.add(1,"year"),i("pick",W)},F=W=>Dm(W,c.value,r.value,s);function j(W,J){if(n.unlinkPanels&&J){const ne=W?.year()||0,he=J.year();h.value=ne===he?J.add(1,U0):J}else h.value=f.value.add(1,U0)}const U=Oi();return Se(()=>n.visible,W=>{!W&&v.value.selecting&&(k(n.parsedValue),S(!1))}),i("set-picker-option",["isValidValue",zv]),i("set-picker-option",["parseUserInput",F]),i("set-picker-option",["handleClear",N]),(W,J)=>(B(),Q("div",{class:$([w(p).b(),w(b).b(),w(p).is("border",W.border),w(p).is("disabled",w(U)),{"has-sidebar":!!W.$slots.sidebar||T.value}])},[ie("div",{class:$(w(p).e("body-wrapper"))},[we(W.$slots,"sidebar",{class:$(w(p).e("sidebar"))}),T.value?(B(),Q("div",{key:0,class:$(w(p).e("sidebar"))},[(B(!0),Q(rt,null,gn(w(a),(ne,he)=>(B(),Q("button",{key:he,type:"button",class:$(w(p).e("shortcut")),disabled:w(U),onClick:X=>w(C)(ne)},We(ne.text),11,Xbe))),128))],2)):ve("v-if",!0),ie("div",{class:$(w(p).e("body"))},[ie("div",{class:$([[w(p).e("content"),w(b).e("content")],"is-left"])},[ie("div",{class:$(w(b).e("header"))},[ie("button",{type:"button",class:$([w(p).e("icon-btn"),"d-arrow-left"]),disabled:w(U),onClick:J[0]||(J[0]=(...ne)=>w(E)&&w(E)(...ne))},[we(W.$slots,"prev-year",{},()=>[L(w(He),null,{default:ce(()=>[L(w(Tc))]),_:1})])],10,Jbe),W.unlinkPanels?(B(),Q("button",{key:0,type:"button",disabled:!R.value||w(U),class:$([[w(p).e("icon-btn"),w(p).is("disabled",!R.value||w(U))],"d-arrow-right"]),onClick:J[1]||(J[1]=(...ne)=>w(P)&&w(P)(...ne))},[we(W.$slots,"next-year",{},()=>[L(w(He),null,{default:ce(()=>[L(w(Ec))]),_:1})])],10,Zbe)):ve("v-if",!0),ie("div",null,We(w(I)),1)],2),L(Hv,{"selection-mode":"range",date:f.value,"min-date":w(m),"max-date":w(g),"range-state":w(v),"disabled-date":w(l),disabled:w(U),"cell-class-name":w(u),onChangerange:w(y),onPick:O,onSelect:w(S)},null,8,["date","min-date","max-date","range-state","disabled-date","disabled","cell-class-name","onChangerange","onSelect"])],2),ie("div",{class:$([[w(p).e("content"),w(b).e("content")],"is-right"])},[ie("div",{class:$(w(b).e("header"))},[W.unlinkPanels?(B(),Q("button",{key:0,type:"button",disabled:!R.value||w(U),class:$([[w(p).e("icon-btn"),w(p).is("disabled",!R.value||w(U))],"d-arrow-left"]),onClick:J[2]||(J[2]=(...ne)=>w(A)&&w(A)(...ne))},[we(W.$slots,"prev-year",{},()=>[L(w(He),null,{default:ce(()=>[L(w(Tc))]),_:1})])],10,Qbe)):ve("v-if",!0),ie("button",{type:"button",class:$([w(p).e("icon-btn"),"d-arrow-right"]),disabled:w(U),onClick:J[3]||(J[3]=(...ne)=>w(x)&&w(x)(...ne))},[we(W.$slots,"next-year",{},()=>[L(w(He),null,{default:ce(()=>[L(w(Ec))]),_:1})])],10,e0e),ie("div",null,We(w(D)),1)],2),L(Hv,{"selection-mode":"range",date:h.value,"min-date":w(m),"max-date":w(g),"range-state":w(v),"disabled-date":w(l),disabled:w(U),"cell-class-name":w(u),onChangerange:w(y),onPick:O,onSelect:w(S)},null,8,["date","min-date","max-date","range-state","disabled-date","disabled","cell-class-name","onChangerange","onSelect"])],2)],2)],2)],2))}});const n0e=qe({...OR}),i0e=["pick","set-picker-option","calendar-change"],r0e=({unlinkPanels:t,leftDate:e,rightDate:n})=>{const i=()=>{e.value=e.value.subtract(10,"year"),t.value||(n.value=n.value.subtract(10,"year"))},r=()=>{t.value||(e.value=e.value.add(10,"year")),n.value=n.value.add(10,"year")},o=()=>{e.value=e.value.add(10,"year")},s=()=>{n.value=n.value.subtract(10,"year")},a=M(()=>{const d=Math.floor(e.value.year()/10)*10;return`${d}-${d+9}`}),l=M(()=>{const d=Math.floor(n.value.year()/10)*10;return`${d}-${d+9}`}),u=M(()=>Math.floor(e.value.year()/10)*10+9),c=M(()=>Math.floor(n.value.year()/10)*10);return{leftPrevYear:i,rightNextYear:r,leftNextYear:o,rightPrevYear:s,leftLabel:a,rightLabel:l,leftYear:u,rightYear:c}},o0e=["disabled","onClick"],s0e=["disabled"],a0e=["disabled"],l0e=["disabled"],u0e=["disabled"],ih=10,Og="year";var c0e=le({name:"DatePickerYearRange",__name:"panel-year-range",props:n0e,emits:i0e,setup(t,{emit:e}){const n=t,i=e,{lang:r}=Qt(),o=H(ft().locale(r.value)),s=H(ft().locale(r.value).add(ih,Og)),a=Ne(Qb,void 0),l=Ne(ha),{shortcuts:u,disabledDate:c,cellClassName:d}=l.props,f=An(l.props,"format"),h=An(l.props,"defaultValue"),{minDate:m,maxDate:g,rangeState:v,ppNs:p,drpNs:b,handleChangeRange:y,handleRangeConfirm:_,handleShortcutClick:C,onSelect:S,parseValue:k}=NR(n,{defaultValue:h,leftDate:o,rightDate:s,step:ih,unit:Og,sortDates:he}),{leftPrevYear:T,rightNextYear:E,leftNextYear:x,rightPrevYear:P,leftLabel:A,rightLabel:I,leftYear:D,rightYear:q}=r0e({unlinkPanels:An(n,"unlinkPanels"),leftDate:o,rightDate:s}),z=Oi(),R=M(()=>!!u.length),O=M(()=>[p.b(),b.b(),p.is("border",n.border),p.is("disabled",z.value),{"has-sidebar":!!$o().sidebar||R.value}]),N=M(()=>({content:[p.e("content"),b.e("content"),"is-left"],arrowLeftBtn:[p.e("icon-btn"),"d-arrow-left"],arrowRightBtn:[p.e("icon-btn"),p.is("disabled",!j.value||z.value),"d-arrow-right"]})),F=M(()=>({content:[p.e("content"),b.e("content"),"is-right"],arrowLeftBtn:[p.e("icon-btn"),p.is("disabled",!j.value||z.value),"d-arrow-left"],arrowRightBtn:[p.e("icon-btn"),"d-arrow-right"]})),j=M(()=>n.unlinkPanels&&q.value>D.value+1),U=(X,se=!0)=>{const re=X.minDate,ee=X.maxDate;g.value===ee&&m.value===re||(i("calendar-change",[re.toDate(),ee&&ee.toDate()]),g.value=ee,m.value=re,se&&_())},W=X=>Dm(X,f.value,r.value,a),J=X=>zv(X)&&(c?!c(X[0].toDate())&&!c(X[1].toDate()):!0),ne=()=>{let X=null;l?.emptyValues&&(X=l.emptyValues.valueOnClear.value);const se=zC(w(h),{lang:w(r),step:ih,unit:Og,unlinkPanels:n.unlinkPanels});o.value=se[0],s.value=se[1],i("pick",X)};function he(X,se){if(n.unlinkPanels&&se){const re=X?.year()||0,ee=se.year();s.value=re+ih>ee?se.add(ih,Og):se}else s.value=o.value.add(ih,Og)}return Se(()=>n.visible,X=>{!X&&v.value.selecting&&(k(n.parsedValue),S(!1))}),i("set-picker-option",["isValidValue",J]),i("set-picker-option",["parseUserInput",W]),i("set-picker-option",["handleClear",ne]),(X,se)=>(B(),Q("div",{class:$(O.value)},[ie("div",{class:$(w(p).e("body-wrapper"))},[we(X.$slots,"sidebar",{class:$(w(p).e("sidebar"))}),R.value?(B(),Q("div",{key:0,class:$(w(p).e("sidebar"))},[(B(!0),Q(rt,null,gn(w(u),(re,ee)=>(B(),Q("button",{key:ee,type:"button",class:$(w(p).e("shortcut")),disabled:w(z),onClick:te=>w(C)(re)},We(re.text),11,o0e))),128))],2)):ve("v-if",!0),ie("div",{class:$(w(p).e("body"))},[ie("div",{class:$(N.value.content)},[ie("div",{class:$(w(b).e("header"))},[ie("button",{type:"button",class:$(N.value.arrowLeftBtn),disabled:w(z),onClick:se[0]||(se[0]=(...re)=>w(T)&&w(T)(...re))},[we(X.$slots,"prev-year",{},()=>[L(w(He),null,{default:ce(()=>[L(w(Tc))]),_:1})])],10,s0e),X.unlinkPanels?(B(),Q("button",{key:0,type:"button",disabled:!j.value||w(z),class:$(N.value.arrowRightBtn),onClick:se[1]||(se[1]=(...re)=>w(x)&&w(x)(...re))},[we(X.$slots,"next-year",{},()=>[L(w(He),null,{default:ce(()=>[L(w(Ec))]),_:1})])],10,a0e)):ve("v-if",!0),ie("div",null,We(w(A)),1)],2),L(Uv,{"selection-mode":"range",date:o.value,"min-date":w(m),"max-date":w(g),"range-state":w(v),"disabled-date":w(c),disabled:w(z),"cell-class-name":w(d),onChangerange:w(y),onPick:U,onSelect:w(S)},null,8,["date","min-date","max-date","range-state","disabled-date","disabled","cell-class-name","onChangerange","onSelect"])],2),ie("div",{class:$(F.value.content)},[ie("div",{class:$(w(b).e("header"))},[X.unlinkPanels?(B(),Q("button",{key:0,type:"button",disabled:!j.value||w(z),class:$(F.value.arrowLeftBtn),onClick:se[2]||(se[2]=(...re)=>w(P)&&w(P)(...re))},[we(X.$slots,"prev-year",{},()=>[L(w(He),null,{default:ce(()=>[L(w(Tc))]),_:1})])],10,l0e)):ve("v-if",!0),ie("button",{type:"button",class:$(F.value.arrowRightBtn),disabled:w(z),onClick:se[3]||(se[3]=(...re)=>w(E)&&w(E)(...re))},[we(X.$slots,"next-year",{},()=>[L(w(He),null,{default:ce(()=>[L(w(Ec))]),_:1})])],10,u0e),ie("div",null,We(w(I)),1)],2),L(Uv,{"selection-mode":"range",date:s.value,"min-date":w(m),"max-date":w(g),"range-state":w(v),"disabled-date":w(c),disabled:w(z),"cell-class-name":w(d),onChangerange:w(y),onPick:U,onSelect:w(S)},null,8,["date","min-date","max-date","range-state","disabled-date","disabled","cell-class-name","onChangerange","onSelect"])],2)],2)],2)],2))}});const d0e=function(t){switch(t){case"daterange":case"datetimerange":return jbe;case"monthrange":return t0e;case"yearrange":return c0e;default:return Pbe}};function f0e(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!yi(t)}ft.extend(hge);ft.extend(Bve);ft.extend(BW);ft.extend(zve);ft.extend(qve);ft.extend(Yve);ft.extend(Qve);ft.extend(ibe);var h0e=le({name:"ElDatePickerPanel",install:null,inheritAttrs:!1,props:rbe,emits:[It,"calendar-change","panel-change","visible-change","clear"],setup(t,{slots:e,emit:n,attrs:i}){const r=De("picker-panel"),o=Ne(ha,void 0);if(pn(o)){const d=on({...Sr(t)});qt(ha,{props:d})}qt(RR,{slots:e,pickerNs:r});const{parsedValue:s,onCalendarChange:a,onPanelChange:l,onSetPickerOption:u,onPick:c}=Ne(VW,()=>FW(t,n),!0);return()=>{const d=d0e(t.type);return L(d,Lt(IC(i,"onPick"),t,{parsedValue:s.value,"onSet-picker-option":u,"onCalendar-change":a,"onPanel-change":l,onClear:()=>n("clear"),onPick:c}),f0e(e)?e:{default:()=>[e]})}}});const m0e=sn(h0e),g0e=qe({...IR,type:{type:me(String),default:"date"}});function p0e(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!yi(t)}var v0e=le({name:"ElDatePicker",install:null,props:g0e,emits:[It],setup(t,{expose:e,emit:n,slots:i}){const r=M(()=>!t.format);qt(Qb,r),qt(AR,on(An(t,"popperOptions")));const o=H();e({focus:()=>{var l;(l=o.value)==null||l.focus()},blur:()=>{var l;(l=o.value)==null||l.blur()},handleOpen:()=>{var l;(l=o.value)==null||l.handleOpen()},handleClose:()=>{var l;(l=o.value)==null||l.handleClose()}});const a=l=>{n(It,l)};return()=>{var l;const u=(l=t.format)!=null?l:bve[t.type]||lc;return L(zW,Lt(t,{format:u,type:t.type,ref:o,"onUpdate:modelValue":a}),{default:c=>L(m0e,Lt({disabled:t.disabled,editable:t.editable,border:!1},c),p0e(i)?i:{default:()=>[i]}),"range-separator":i["range-separator"]})}}});const W0=sn(v0e),KW=qe({center:Boolean,alignCenter:{type:Boolean,default:void 0},closeIcon:{type:ri},draggable:{type:Boolean,default:void 0},overflow:{type:Boolean,default:void 0},fullscreen:Boolean,headerClass:String,bodyClass:String,footerClass:String,showClose:{type:Boolean,default:!0},title:{type:String,default:""},ariaLevel:{type:String,default:"2"}}),b0e={close:()=>!0},y0e=qe({...KW,appendToBody:Boolean,appendTo:{type:iR.to.type,default:"body"},beforeClose:{type:me(Function)},destroyOnClose:Boolean,closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},modalPenetrable:Boolean,openDelay:{type:Number,default:0},closeDelay:{type:Number,default:0},top:{type:String},modelValue:Boolean,modalClass:String,headerClass:String,bodyClass:String,footerClass:String,width:{type:[String,Number]},zIndex:{type:Number},trapFocus:Boolean,headerAriaLevel:{type:String,default:"2"},transition:{type:me([String,Object]),default:void 0}}),w0e={open:()=>!0,opened:()=>!0,close:()=>!0,closed:()=>!0,[It]:t=>vi(t),openAutoFocus:()=>!0,closeAutoFocus:()=>!0},BR=t=>{if(!t)return{onClick:tn,onMousedown:tn,onMouseup:tn};let e=!1,n=!1;return{onClick:s=>{e&&n&&t(s),e=n=!1},onMousedown:s=>{e=s.target===s.currentTarget},onMouseup:s=>{n=s.target===s.currentTarget}}},_0e=qe({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:me([String,Array,Object])},zIndex:{type:me([String,Number])}}),C0e={click:t=>t instanceof MouseEvent},S0e="overlay";var k0e=le({name:"ElOverlay",props:_0e,emits:C0e,setup(t,{slots:e,emit:n}){const i=De(S0e),r=l=>{n("click",l)},{onClick:o,onMousedown:s,onMouseup:a}=BR(t.customMaskEvent?void 0:r);return()=>t.mask?L("div",{class:[i.b(),t.overlayClass],style:{zIndex:t.zIndex},onClick:o,onMousedown:s,onMouseup:a},[we(e,"default")],Cw.STYLE|Cw.CLASS|Cw.PROPS,["onClick","onMouseup","onMousedown"]):nt("div",{class:t.overlayClass,style:{zIndex:t.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[we(e,"default")])}});const GW=k0e,YW=Symbol("dialogInjectionKey"),bN="dialog-fade",VR=(...t)=>e=>{t.forEach(n=>{n.value=e})},XW=(t,e,n,i)=>{const r={offsetX:0,offsetY:0},o=H(!1),s=(f,h)=>{if(t.value){const{offsetX:m,offsetY:g}=r,v=t.value.getBoundingClientRect(),p=v.left,b=v.top,y=v.width,_=v.height,C=document.documentElement.clientWidth,S=document.documentElement.clientHeight,k=-p+m,T=-b+g,E=C-p-y+m,x=S-b-(_{const h=f.clientX,m=f.clientY,{offsetX:g,offsetY:v}=r,p=y=>{o.value||(o.value=!0);const _=g+y.clientX-h,C=v+y.clientY-m;s(_,C)},b=()=>{o.value=!1,document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",b)};document.addEventListener("mousemove",p),document.addEventListener("mouseup",b)},l=()=>{e.value&&t.value&&(e.value.addEventListener("mousedown",a),window.addEventListener("resize",d))},u=()=>{e.value&&t.value&&(e.value.removeEventListener("mousedown",a),window.removeEventListener("resize",d))},c=()=>{r.offsetX=0,r.offsetY=0,t.value&&(t.value.style.transform="")},d=()=>{const{offsetX:f,offsetY:h}=r;s(f,h)};return Pt(()=>{sl(()=>{n.value?l():u()})}),Sn(()=>{u()}),{isDragging:o,resetPosition:c,updatePosition:d}},T0e=["aria-level"],E0e=["aria-label"],x0e=["id"];var A0e=le({name:"ElDialogContent",__name:"dialog-content",props:KW,emits:b0e,setup(t,{expose:e}){const{t:n}=Qt(),{Close:i}=afe,r=t,{dialogRef:o,headerRef:s,bodyId:a,ns:l,style:u}=Ne(YW),{focusTrapRef:c}=Ne(UU),d=VR(c,o),f=M(()=>!!r.draggable),h=M(()=>!!r.overflow),{resetPosition:m,updatePosition:g,isDragging:v}=XW(o,s,f,h),p=M(()=>[l.b(),l.is("fullscreen",r.fullscreen),l.is("draggable",f.value),l.is("dragging",v.value),l.is("align-center",!!r.alignCenter),{[l.m("center")]:r.center}]);return e({resetPosition:m,updatePosition:g}),(b,y)=>(B(),Q("div",{ref:w(d),class:$(p.value),style:mt(w(u)),tabindex:"-1"},[ie("header",{ref_key:"headerRef",ref:s,class:$([w(l).e("header"),t.headerClass,{"show-close":t.showClose}])},[we(b.$slots,"header",{},()=>[ie("span",{role:"heading","aria-level":t.ariaLevel,class:$(w(l).e("title"))},We(t.title),11,T0e)]),t.showClose?(B(),Q("button",{key:0,"aria-label":w(n)("el.dialog.close"),class:$(w(l).e("headerbtn")),type:"button",onClick:y[0]||(y[0]=_=>b.$emit("close"))},[L(w(He),{class:$(w(l).e("close"))},{default:ce(()=>[(B(),_e(Gt(t.closeIcon||w(i))))]),_:1},8,["class"])],10,E0e)):ve("v-if",!0)],2),ie("div",{id:w(a),class:$([w(l).e("body"),t.bodyClass])},[we(b.$slots,"default")],10,x0e),b.$slots.footer?(B(),Q("footer",{key:0,class:$([w(l).e("footer"),t.footerClass])},[we(b.$slots,"footer")],2)):ve("v-if",!0)],6))}});const FR=(t,e={})=>{rn(t)||dr("[useLockscreen]","You need to pass a ref param to this function");const n=e.ns||De("popup"),i=M(()=>n.bm("parent","hidden"));let r=0,o=!1,s="0",a=!1;const l=()=>{a||(a=!0,setTimeout(()=>{typeof document>"u"||o&&document&&(document.body.style.width=s,os(document.body,i.value))},200))};Se(t,u=>{if(!u){l();return}a=!1,o=!Xa(document.body,i.value),o&&(s=document.body.style.width,Qs(document.body,i.value)),r=ede(n.namespace.value);const c=document.documentElement.clientHeight0&&(c||d==="scroll")&&o&&(document.body.style.width=`calc(100% - ${r}px)`)}),dC(()=>l())},P0e=(t,e)=>{var n;const r=Ct().emit,{nextZIndex:o}=RC();let s="";const a=as(),l=as(),u=H(!1),c=H(!1),d=H(!1),f=H((n=t.zIndex)!=null?n:o()),h=H(!1);let m,g;const v=Yb(),p=M(()=>{var U,W;return(W=(U=v.value)==null?void 0:U.namespace)!=null?W:Up}),b=M(()=>{var U;return(U=v.value)==null?void 0:U.dialog}),y=M(()=>{const U={},W=`--${p.value}-dialog`;if(!t.fullscreen){t.top&&(U[`${W}-margin-top`]=t.top);const J=zr(t.width);J&&(U[`${W}-width`]=J)}return U}),_=M(()=>{var U,W,J;return((J=(W=t.draggable)!=null?W:(U=b.value)==null?void 0:U.draggable)!=null?J:!1)&&!t.fullscreen}),C=M(()=>{var U,W,J;return(J=(W=t.alignCenter)!=null?W:(U=b.value)==null?void 0:U.alignCenter)!=null?J:!1}),S=M(()=>{var U,W,J;return(J=(W=t.overflow)!=null?W:(U=b.value)==null?void 0:U.overflow)!=null?J:!1}),k=M(()=>C.value?{display:"flex"}:{}),T=M(()=>{var U,W,J;const ne=(J=(W=t.transition)!=null?W:(U=b.value)==null?void 0:U.transition)!=null?J:bN,he={name:ne,onAfterEnter:E,onBeforeLeave:P,onAfterLeave:x};if(_t(ne)){const X={...ne},se=(re,ee)=>te=>{Pe(re)?re.forEach(V=>{Xe(V)&&V(te)}):Xe(re)&&re(te),ee()};return X.onAfterEnter=se(X.onAfterEnter,E),X.onBeforeLeave=se(X.onBeforeLeave,P),X.onAfterLeave=se(X.onAfterLeave,x),X.name||(X.name=bN),X}return he});function E(){r("opened")}function x(){r("closed"),r(It,!1),t.destroyOnClose&&(d.value=!1),h.value=!1}function P(){h.value=!0,r("close")}function A(){g?.(),m?.(),t.openDelay&&t.openDelay>0?{stop:m}=Dv(()=>z(),t.openDelay):z()}function I(){m?.(),g?.(),t.closeDelay&&t.closeDelay>0?{stop:g}=Dv(()=>R(),t.closeDelay):R()}function D(){function U(W){W||(c.value=!0,u.value=!1)}t.beforeClose?t.beforeClose(U):I()}function q(){t.closeOnClickModal&&D()}function z(){Zt&&(u.value=!0)}function R(){u.value=!1}function O(){r("openAutoFocus")}function N(){r("closeAutoFocus")}function F(U){var W;((W=U.detail)==null?void 0:W.focusReason)==="pointer"&&U.preventDefault()}t.lockScroll&&FR(u);function j(){t.closeOnPressEscape&&D()}return Se(()=>t.zIndex,()=>{var U;f.value=(U=t.zIndex)!=null?U:o()}),Se(()=>t.modelValue,U=>{var W;U?(c.value=!1,h.value=!1,A(),d.value=!0,f.value=(W=t.zIndex)!=null?W:o(),Ye(()=>{r("open"),e.value&&(e.value.parentElement.scrollTop=0,e.value.parentElement.scrollLeft=0,e.value.scrollTop=0)})):u.value&&I()}),Se(()=>t.fullscreen,U=>{e.value&&(U?(s=e.value.style.transform,e.value.style.transform=""):e.value.style.transform=s)}),Pt(()=>{t.modelValue&&(u.value=!0,d.value=!0,A())}),{afterEnter:E,afterLeave:x,beforeLeave:P,handleClose:D,onModalClick:q,close:I,doClose:R,onOpenAutoFocus:O,onCloseAutoFocus:N,onCloseRequested:j,onFocusoutPrevented:F,titleId:a,bodyId:l,closed:c,style:y,overlayDialogStyle:k,rendered:d,visible:u,zIndex:f,transitionConfig:T,_draggable:_,_alignCenter:C,_overflow:S,closing:h}},I0e=["aria-label","aria-labelledby","aria-describedby"];var R0e=le({name:"ElDialog",inheritAttrs:!1,__name:"dialog",props:y0e,emits:w0e,setup(t,{expose:e}){const n=t,i=$o();of({scope:"el-dialog",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/dialog.html#slots"},M(()=>!!i.title));const r=De("dialog"),o=H(),s=H(),a=H(),{visible:l,titleId:u,bodyId:c,style:d,overlayDialogStyle:f,rendered:h,transitionConfig:m,zIndex:g,_draggable:v,_alignCenter:p,_overflow:b,handleClose:y,onModalClick:_,onOpenAutoFocus:C,onCloseAutoFocus:S,onCloseRequested:k,onFocusoutPrevented:T,closing:E}=P0e(n,o);qt(YW,{dialogRef:o,headerRef:s,bodyId:c,ns:r,rendered:h,style:d});const x=BR(_),P=M(()=>n.modalPenetrable&&!n.modal&&!n.fullscreen);return e({visible:l,dialogContentRef:a,resetPosition:()=>{var I;(I=a.value)==null||I.resetPosition()},handleClose:y}),(I,D)=>(B(),_e(w(rR),{to:t.appendTo,disabled:t.appendTo!=="body"?!1:!t.appendToBody},{default:ce(()=>[L(ya,Lt(w(m),{persisted:""}),{default:ce(()=>{var q;return[Vt(L(w(GW),{"custom-mask-event":"",mask:t.modal,"overlay-class":[(q=t.modalClass)!=null?q:"",`${w(r).namespace.value}-modal-dialog`,w(r).is("penetrable",P.value)],"z-index":w(g)},{default:ce(()=>[ie("div",{role:"dialog","aria-modal":"true","aria-label":t.title||void 0,"aria-labelledby":t.title?void 0:w(u),"aria-describedby":w(c),class:$([`${w(r).namespace.value}-overlay-dialog`,w(r).is("closing",w(E))]),style:mt(w(f)),onClick:D[0]||(D[0]=(...z)=>w(x).onClick&&w(x).onClick(...z)),onMousedown:D[1]||(D[1]=(...z)=>w(x).onMousedown&&w(x).onMousedown(...z)),onMouseup:D[2]||(D[2]=(...z)=>w(x).onMouseup&&w(x).onMouseup(...z))},[L(w(VC),{loop:"",trapped:w(l),"focus-start-el":"container",onFocusAfterTrapped:w(C),onFocusAfterReleased:w(S),onFocusoutPrevented:w(T),onReleaseRequested:w(k)},{default:ce(()=>[w(h)?(B(),_e(A0e,Lt({key:0,ref_key:"dialogContentRef",ref:a},I.$attrs,{center:t.center,"align-center":w(p),"close-icon":t.closeIcon,draggable:w(v),overflow:w(b),fullscreen:t.fullscreen,"header-class":t.headerClass,"body-class":t.bodyClass,"footer-class":t.footerClass,"show-close":t.showClose,title:t.title,"aria-level":t.headerAriaLevel,onClose:w(y)}),kc({header:ce(()=>[I.$slots.title?we(I.$slots,"title",{key:1}):we(I.$slots,"header",{key:0,close:w(y),titleId:w(u),titleClass:w(r).e("title")})]),default:ce(()=>[we(I.$slots,"default")]),_:2},[I.$slots.footer?{name:"footer",fn:ce(()=>[we(I.$slots,"footer")]),key:"0"}:void 0]),1040,["center","align-center","close-icon","draggable","overflow","fullscreen","header-class","body-class","footer-class","show-close","title","aria-level","onClose"])):ve("v-if",!0)]),_:3},8,["trapped","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])],46,I0e)]),_:3},8,["mask","overlay-class","z-index"]),[[On,w(l)]])]}),_:3},16)]),_:3},8,["to","disabled"]))}});const M0e=sn(R0e),O0e=qe({direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},contentPosition:{type:String,values:["left","center","right"],default:"center"},borderStyle:{type:me(String),default:"solid"}});var L0e=le({name:"ElDivider",__name:"divider",props:O0e,setup(t){const e=t,n=De("divider"),i=M(()=>n.cssVar({"border-style":e.borderStyle}));return(r,o)=>(B(),Q("div",{class:$([w(n).b(),w(n).m(t.direction)]),style:mt(i.value),role:"separator"},[r.$slots.default&&t.direction!=="vertical"?(B(),Q("div",{key:0,class:$([w(n).e("text"),w(n).is(t.contentPosition)])},[we(r.$slots,"default")],2)):ve("v-if",!0)],6))}});const yN=sn(L0e);var D0e=le({inheritAttrs:!1});function N0e(t,e,n,i,r,o){return we(t.$slots,"default")}var B0e=Tr(D0e,[["render",N0e]]),V0e=le({name:"ElCollectionItem",inheritAttrs:!1});function F0e(t,e,n,i,r,o){return we(t.$slots,"default")}var $0e=Tr(V0e,[["render",F0e]]);const JW="data-el-collection-item",z0e=t=>{const e=`El${t}Collection`,n=`${e}Item`,i=Symbol(e),r=Symbol(n),o=Object.assign({},B0e,{name:e,setup(){const a=H(),l=new Map;qt(i,{itemMap:l,getItems:(()=>{const c=w(a);if(!c)return[];const d=Array.from(c.querySelectorAll(`[${JW}]`));return[...l.values()].sort((h,m)=>d.indexOf(h.ref)-d.indexOf(m.ref))}),collectionRef:a})}}),s=Object.assign({},$0e,{name:n,setup(a,{attrs:l}){const u=H(),c=Ne(i,void 0);qt(r,{collectionItemRef:u}),Pt(()=>{const d=w(u);d&&c.itemMap.set(d,{ref:d,...l})}),Sn(()=>{const d=w(u);c.itemMap.delete(d)})}});return{COLLECTION_INJECTION_KEY:i,COLLECTION_ITEM_INJECTION_KEY:r,ElCollection:o,ElCollectionItem:s}},H0e=qe({style:{type:me([String,Array,Object])},currentTabId:{type:me(String)},defaultCurrentTabId:String,loop:Boolean,dir:{type:String,values:["ltr","rtl"],default:"ltr"},orientation:{type:me(String)},onBlur:Function,onFocus:Function,onMousedown:Function}),{ElCollection:U0e,ElCollectionItem:W0e,COLLECTION_INJECTION_KEY:ZW,COLLECTION_ITEM_INJECTION_KEY:q0e}=z0e("RovingFocusGroup"),$R=Symbol("elRovingFocusGroup"),QW=Symbol("elRovingFocusGroupItem"),j0e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"},K0e=(t,e)=>t,G0e=(t,e,n)=>{const i=Bn(t),r=K0e(i);return j0e[r]},Y0e=(t,e)=>t.map((n,i)=>t[(i+e)%t.length]),wN=t=>{const{activeElement:e}=document;for(const n of t)if(n===e||(n.focus(),e!==document.activeElement))return},_N="currentTabIdChange",CN="rovingFocusGroup.entryFocus",X0e={bubbles:!1,cancelable:!0};var J0e=le({name:"ElRovingFocusGroupImpl",inheritAttrs:!1,props:H0e,emits:[_N,"entryFocus"],setup(t,{emit:e}){var n;const i=H((n=t.currentTabId||t.defaultCurrentTabId)!=null?n:null),r=H(!1),o=H(!1),s=H(),{getItems:a}=Ne(ZW,void 0),l=M(()=>[{outline:"none"},t.style]),u=v=>{e(_N,v)},c=()=>{r.value=!0},d=ji(v=>{var p;(p=t.onMousedown)==null||p.call(t,v)},()=>{o.value=!0}),f=ji(v=>{var p;(p=t.onFocus)==null||p.call(t,v)},v=>{const p=!w(o),{target:b,currentTarget:y}=v;if(b===y&&p&&!w(r)){const _=new Event(CN,X0e);if(y?.dispatchEvent(_),!_.defaultPrevented){const C=a().filter(x=>x.focusable),S=C.find(x=>x.active),k=C.find(x=>x.id===w(i)),E=[S,k,...C].filter(Boolean).map(x=>x.ref);wN(E)}}o.value=!1}),h=ji(v=>{var p;(p=t.onBlur)==null||p.call(t,v)},()=>{r.value=!1}),m=(...v)=>{e("entryFocus",...v)},g=v=>{const p=G0e(v);if(p){v.preventDefault();let y=a().filter(_=>_.focusable).map(_=>_.ref);switch(p){case"last":{y.reverse();break}case"prev":case"next":{p==="prev"&&y.reverse();const _=y.indexOf(v.currentTarget);y=t.loop?Y0e(y,_+1):y.slice(_+1);break}}Ye(()=>{wN(y)})}};qt($R,{currentTabbedId:gf(i),loop:An(t,"loop"),tabIndex:M(()=>w(r)?-1:0),rovingFocusGroupRef:s,rovingFocusGroupRootStyle:l,orientation:An(t,"orientation"),dir:An(t,"dir"),onItemFocus:u,onItemShiftTab:c,onBlur:h,onFocus:f,onMousedown:d,onKeydown:g}),Se(()=>t.currentTabId,v=>{i.value=v??null}),Kn(s,CN,m)}});function Z0e(t,e,n,i,r,o){return we(t.$slots,"default")}var Q0e=Tr(J0e,[["render",Z0e]]),eye=le({name:"ElRovingFocusGroup",components:{ElFocusGroupCollection:U0e,ElRovingFocusGroupImpl:Q0e}});function tye(t,e,n,i,r,o){const s=Bt("el-roving-focus-group-impl"),a=Bt("el-focus-group-collection");return B(),_e(a,null,{default:ce(()=>[L(s,pw(Fp(t.$attrs)),{default:ce(()=>[we(t.$slots,"default")]),_:3},16)]),_:3})}var nye=Tr(eye,[["render",tye]]);const Nw=qe({trigger:{...vc.trigger,type:me([String,Array])},triggerKeys:{type:me(Array),default:()=>[Me.enter,Me.numpadEnter,Me.space,Me.down]},virtualTriggering:vc.virtualTriggering,virtualRef:vc.virtualRef,effect:{...Mn.effect,default:"light"},type:{type:me(String)},placement:{type:me(String),default:"bottom"},popperOptions:{type:me(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showArrow:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:me([Number,String]),default:0},maxHeight:{type:me([Number,String]),default:""},popperClass:Mn.popperClass,popperStyle:Mn.popperStyle,disabled:Boolean,role:{type:String,values:BU,default:"menu"},buttonProps:{type:me(Object)},teleported:Mn.teleported,appendTo:Mn.appendTo,persistent:{type:Boolean,default:!0}}),eq=qe({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:ri}}),iye=qe({onKeydown:{type:me(Function)}}),HC=Symbol("elDropdown"),tq="elDropdown",{ButtonGroup:rye}=Hi;var oye=le({name:"ElDropdown",components:{ElButton:Hi,ElButtonGroup:rye,ElScrollbar:gu,ElTooltip:Lo,ElRovingFocusGroup:nye,ElOnlyChild:zU,ElIcon:He,ArrowDown:zc},props:Nw,emits:["visible-change","click","command"],setup(t,{emit:e}){const n=Ct(),i=De("dropdown"),{t:r}=Qt(),o=H(),s=H(),a=H(),l=H(),u=H(null),c=H(null),d=H(!1),f=M(()=>({maxHeight:zr(t.maxHeight)})),h=M(()=>[i.m(_.value)]),m=M(()=>Co(t.trigger)),g=as().value,v=M(()=>t.id||g);function p(){var I;(I=a.value)==null||I.onClose(void 0,0)}function b(){var I;(I=a.value)==null||I.onClose()}function y(){var I;(I=a.value)==null||I.onOpen()}const _=fr();function C(...I){e("command",...I)}function S(){}function k(){const I=w(l);m.value.includes("hover")&&I?.focus({preventScroll:!0}),c.value=null}function T(I){c.value=I}function E(){e("visible-change",!0)}function x(I){var D;d.value=I?.type==="keydown",(D=l.value)==null||D.focus()}function P(){e("visible-change",!1)}return qt(HC,{contentRef:l,role:M(()=>t.role),triggerId:v,isUsingKeyboard:d,onItemEnter:S,onItemLeave:k,handleClose:b}),qt(tq,{instance:n,dropdownSize:_,handleClick:p,commandHandler:C,trigger:An(t,"trigger"),hideOnClick:An(t,"hideOnClick")}),{t:r,ns:i,scrollbar:u,wrapStyle:f,dropdownTriggerKls:h,dropdownSize:_,triggerId:v,currentTabId:c,handleCurrentTabIdChange:T,handlerMainButtonClick:I=>{e("click",I)},handleClose:b,handleOpen:y,handleBeforeShowTooltip:E,handleShowTooltip:x,handleBeforeHideTooltip:P,popperRef:a,contentRef:l,triggeringElementRef:o,referenceElementRef:s}}});function sye(t,e,n,i,r,o){var s;const a=Bt("el-roving-focus-group"),l=Bt("el-scrollbar"),u=Bt("el-only-child"),c=Bt("el-tooltip"),d=Bt("el-button"),f=Bt("arrow-down"),h=Bt("el-icon"),m=Bt("el-button-group");return B(),Q("div",{class:$([t.ns.b(),t.ns.is("disabled",t.disabled)])},[L(c,{ref:"popperRef",role:t.role,effect:t.effect,"fallback-placements":["bottom","top"],"popper-options":t.popperOptions,"gpu-acceleration":!1,placement:t.placement,"popper-class":[t.ns.e("popper"),t.popperClass],"popper-style":t.popperStyle,trigger:t.trigger,"trigger-keys":t.triggerKeys,"trigger-target-el":t.contentRef,"show-arrow":t.showArrow,"show-after":t.trigger==="hover"?t.showTimeout:0,"hide-after":t.trigger==="hover"?t.hideTimeout:0,"virtual-ref":(s=t.virtualRef)!=null?s:t.triggeringElementRef,"virtual-triggering":t.virtualTriggering||t.splitButton,disabled:t.disabled,transition:`${t.ns.namespace.value}-zoom-in-top`,teleported:t.teleported,"append-to":t.appendTo,pure:"","focus-on-target":"",persistent:t.persistent,onBeforeShow:t.handleBeforeShowTooltip,onShow:t.handleShowTooltip,onBeforeHide:t.handleBeforeHideTooltip},kc({content:ce(()=>[L(l,{ref:"scrollbar","wrap-style":t.wrapStyle,tag:"div","view-class":t.ns.e("list")},{default:ce(()=>[L(a,{loop:t.loop,"current-tab-id":t.currentTabId,orientation:"horizontal",onCurrentTabIdChange:t.handleCurrentTabIdChange},{default:ce(()=>[we(t.$slots,"dropdown")]),_:3},8,["loop","current-tab-id","onCurrentTabIdChange"])]),_:3},8,["wrap-style","view-class"])]),_:2},[t.splitButton?void 0:{name:"default",fn:ce(()=>[L(u,{id:t.triggerId,ref:"triggeringElementRef",role:"button",tabindex:t.tabindex},{default:ce(()=>[we(t.$slots,"default")]),_:3},8,["id","tabindex"])]),key:"0"}]),1032,["role","effect","popper-options","placement","popper-class","popper-style","trigger","trigger-keys","trigger-target-el","show-arrow","show-after","hide-after","virtual-ref","virtual-triggering","disabled","transition","teleported","append-to","persistent","onBeforeShow","onShow","onBeforeHide"]),t.splitButton?(B(),_e(m,{key:0},{default:ce(()=>[L(d,Lt({ref:"referenceElementRef"},t.buttonProps,{size:t.dropdownSize,type:t.type,disabled:t.disabled,tabindex:t.tabindex,onClick:t.handlerMainButtonClick}),{default:ce(()=>[we(t.$slots,"default")]),_:3},16,["size","type","disabled","tabindex","onClick"]),L(d,Lt({id:t.triggerId,ref:"triggeringElementRef"},t.buttonProps,{role:"button",size:t.dropdownSize,type:t.type,class:t.ns.e("caret-button"),disabled:t.disabled,tabindex:t.tabindex,"aria-label":t.t("el.dropdown.toggleDropdown")}),{default:ce(()=>[L(h,{class:$(t.ns.e("icon"))},{default:ce(()=>[L(f)]),_:1},8,["class"])]),_:1},16,["id","size","type","class","disabled","tabindex","aria-label"])]),_:3})):ve("v-if",!0)],2)}var aye=Tr(oye,[["render",sye]]),lye=le({components:{ElRovingFocusCollectionItem:W0e},props:{focusable:{type:Boolean,default:!0},active:Boolean},emits:["mousedown","focus","keydown"],setup(t,{emit:e}){const{currentTabbedId:n,onItemFocus:i,onItemShiftTab:r,onKeydown:o}=Ne($R,void 0),s=as(),a=H(),l=ji(f=>{e("mousedown",f)},f=>{t.focusable?i(w(s)):f.preventDefault()}),u=ji(f=>{e("focus",f)},()=>{i(w(s))}),c=ji(f=>{e("keydown",f)},f=>{const{shiftKey:h,target:m,currentTarget:g}=f;if(Bn(f)===Me.tab&&h){r();return}m===g&&o(f)}),d=M(()=>n.value===w(s));return qt(QW,{rovingFocusGroupItemRef:a,tabIndex:M(()=>w(d)?0:-1),handleMousedown:l,handleFocus:u,handleKeydown:c}),{id:s,handleKeydown:c,handleFocus:u,handleMousedown:l}}});function uye(t,e,n,i,r,o){const s=Bt("el-roving-focus-collection-item");return B(),_e(s,{id:t.id,focusable:t.focusable,active:t.active},{default:ce(()=>[we(t.$slots,"default")]),_:3},8,["id","focusable","active"])}var cye=Tr(lye,[["render",uye]]),dye=le({name:"DropdownItemImpl",components:{ElIcon:He},props:eq,emits:["pointermove","pointerleave","click","clickimpl"],setup(t,{emit:e}){const n=De("dropdown"),{role:i}=Ne(HC,void 0),{collectionItemRef:r}=Ne(q0e,void 0),{rovingFocusGroupItemRef:o,tabIndex:s,handleFocus:a,handleKeydown:l,handleMousedown:u}=Ne(QW,void 0),c=VR(r,o),d=M(()=>i.value==="menu"?"menuitem":i.value==="navigation"?"link":"button"),f=ji(h=>{const m=Bn(h);if([Me.enter,Me.numpadEnter,Me.space].includes(m))return h.preventDefault(),h.stopImmediatePropagation(),e("clickimpl",h),!0},l);return{ns:n,itemRef:c,dataset:{[JW]:""},role:d,tabIndex:s,handleFocus:a,handleKeydown:f,handleMousedown:u}}});const fye=["aria-disabled","tabindex","role"];function hye(t,e,n,i,r,o){const s=Bt("el-icon");return B(),Q(rt,null,[t.divided?(B(),Q("li",{key:0,role:"separator",class:$(t.ns.bem("menu","item","divided"))},null,2)):ve("v-if",!0),ie("li",Lt({ref:t.itemRef},{...t.dataset,...t.$attrs},{"aria-disabled":t.disabled,class:[t.ns.be("menu","item"),t.ns.is("disabled",t.disabled)],tabindex:t.tabIndex,role:t.role,onClick:e[0]||(e[0]=a=>t.$emit("clickimpl",a)),onFocus:e[1]||(e[1]=(...a)=>t.handleFocus&&t.handleFocus(...a)),onKeydown:e[2]||(e[2]=Ot((...a)=>t.handleKeydown&&t.handleKeydown(...a),["self"])),onMousedown:e[3]||(e[3]=(...a)=>t.handleMousedown&&t.handleMousedown(...a)),onPointermove:e[4]||(e[4]=a=>t.$emit("pointermove",a)),onPointerleave:e[5]||(e[5]=a=>t.$emit("pointerleave",a))}),[t.icon||t.$slots.icon?(B(),_e(s,{key:0},{default:ce(()=>[we(t.$slots,"icon",{},()=>[(B(),_e(Gt(t.icon)))])]),_:3})):ve("v-if",!0),we(t.$slots,"default")],16,fye)],64)}var mye=Tr(dye,[["render",hye]]);const nq=()=>{const t=Ne(tq,{}),e=M(()=>t?.dropdownSize);return{elDropdown:t,_elDropdownSize:e}};var gye=le({name:"ElDropdownItem",components:{ElRovingFocusItem:cye,ElDropdownItemImpl:mye},inheritAttrs:!1,props:eq,emits:["pointermove","pointerleave","click"],setup(t,{emit:e,attrs:n}){const{elDropdown:i}=nq(),r=Ct(),{onItemEnter:o,onItemLeave:s}=Ne(HC,void 0),a=ji(d=>(e("pointermove",d),d.defaultPrevented),UD(d=>{if(t.disabled){s(d);return}const f=d.currentTarget;f===document.activeElement||f.contains(document.activeElement)||(o(d),d.defaultPrevented||f?.focus({preventScroll:!0}))})),l=ji(d=>(e("pointerleave",d),d.defaultPrevented),UD(s)),u=ji(d=>{if(!t.disabled)return e("click",d),d.type!=="keydown"&&d.defaultPrevented},d=>{var f,h,m;if(t.disabled){d.stopImmediatePropagation();return}(f=i?.hideOnClick)!=null&&f.value&&((h=i.handleClick)==null||h.call(i)),(m=i.commandHandler)==null||m.call(i,t.command,r,d)}),c=M(()=>({...t,...n}));return{handleClick:u,handlePointerMove:a,handlePointerLeave:l,propsAndAttrs:c}}});function pye(t,e,n,i,r,o){const s=Bt("el-dropdown-item-impl"),a=Bt("el-roving-focus-item");return B(),_e(a,{focusable:!t.disabled},{default:ce(()=>[L(s,Lt(t.propsAndAttrs,{onPointerleave:t.handlePointerLeave,onPointermove:t.handlePointerMove,onClickimpl:t.handleClick}),kc({default:ce(()=>[we(t.$slots,"default")]),_:2},[t.$slots.icon?{name:"icon",fn:ce(()=>[we(t.$slots,"icon")]),key:"0"}:void 0]),1040,["onPointerleave","onPointermove","onClickimpl"])]),_:3},8,["focusable"])}var iq=Tr(gye,[["render",pye]]),vye=le({name:"ElDropdownMenu",props:iye,setup(t){const e=De("dropdown"),{_elDropdownSize:n}=nq(),i=n.value,{contentRef:r,role:o,triggerId:s,isUsingKeyboard:a,handleClose:l}=Ne(HC,void 0),{rovingFocusGroupRef:u,rovingFocusGroupRootStyle:c,onBlur:d,onFocus:f,onKeydown:h,onMousedown:m}=Ne($R,void 0),{collectionRef:g}=Ne(ZW,void 0),v=M(()=>[e.b("menu"),e.bm("menu",i?.value)]),p=VR(r,u,g),b=ji(_=>{var C;(C=t.onKeydown)==null||C.call(t,_)},_=>{const{currentTarget:C,target:S}=_,k=Bn(_);if(C.contains(S),Me.tab===k)return l();h(_)});function y(_){a.value&&f(_)}return{size:i,rovingFocusGroupRootStyle:c,dropdownKls:v,role:o,triggerId:s,dropdownListWrapperRef:p,handleKeydown:b,onBlur:d,handleFocus:y,onMousedown:m}}});const bye=["role","aria-labelledby"];function yye(t,e,n,i,r,o){return B(),Q("ul",{ref:t.dropdownListWrapperRef,class:$(t.dropdownKls),style:mt(t.rovingFocusGroupRootStyle),tabindex:-1,role:t.role,"aria-labelledby":t.triggerId,onFocusin:e[0]||(e[0]=(...s)=>t.handleFocus&&t.handleFocus(...s)),onFocusout:e[1]||(e[1]=(...s)=>t.onBlur&&t.onBlur(...s)),onKeydown:e[2]||(e[2]=Ot((...s)=>t.handleKeydown&&t.handleKeydown(...s),["self"])),onMousedown:e[3]||(e[3]=Ot((...s)=>t.onMousedown&&t.onMousedown(...s),["self"]))},[we(t.$slots,"default")],46,bye)}var rq=Tr(vye,[["render",yye]]);const wye=sn(aye,{DropdownItem:iq,DropdownMenu:rq}),_ye=Zi(iq),Cye=Zi(rq),Sye=qe({size:{type:String,values:yl},disabled:Boolean}),kye=qe({...Sye,model:Object,rules:{type:me(Object)},labelPosition:{type:String,values:["left","right","top"],default:"right"},requireAsteriskPosition:{type:String,values:["left","right"],default:"left"},labelWidth:{type:[String,Number],default:""},labelSuffix:{type:String,default:""},inline:Boolean,inlineMessage:Boolean,statusIcon:Boolean,showMessage:{type:Boolean,default:!0},validateOnRuleChange:{type:Boolean,default:!0},hideRequiredAsterisk:Boolean,scrollToError:Boolean,scrollIntoViewOptions:{type:me([Object,Boolean]),default:!0}}),Tye={validate:(t,e,n)=>(Pe(t)||ot(t))&&vi(e)&&ot(n)};function Eye(){const t=H([]),e=M(()=>{if(!t.value.length)return"0";const o=Math.max(...t.value);return o?`${o}px`:""});function n(o){const s=t.value.indexOf(o);return s===-1&&e.value,s}function i(o,s){if(o&&s){const a=n(s);t.value.splice(a,1,o)}else o&&t.value.push(o)}function r(o){const s=n(o);s>-1&&t.value.splice(s,1)}return{autoLabelWidth:e,registerLabelWidth:i,deregisterLabelWidth:r}}const q0=(t,e)=>{const n=Co(e).map(i=>Pe(i)?i.join("."):i);return n.length>0?t.filter(i=>i.propString&&n.includes(i.propString)):t},xye="ElForm";var Aye=le({name:xye,__name:"form",props:kye,emits:Tye,setup(t,{expose:e,emit:n}){const i=t,r=n,o=H(),s=on([]),a=fr(),l=De("form"),u=M(()=>{const{labelPosition:S,inline:k}=i;return[l.b(),l.m(a.value||"default"),{[l.m(`label-${S}`)]:S,[l.m("inline")]:k}]}),c=S=>q0(s,[S])[0],d=S=>{s.push(S)},f=S=>{S.prop&&s.splice(s.indexOf(S),1)},h=S=>{i.model&&S&&s.forEach(k=>{if(k.prop&&Xue(S,k.prop)){const T=lm(S,k.prop).value;k.setInitialValue(T)}})},m=(S=[])=>{i.model&&q0(s,S).forEach(k=>k.resetField())},g=(S=[])=>{q0(s,S).forEach(k=>k.clearValidate())},v=M(()=>!!i.model),p=S=>{if(s.length===0)return[];const k=q0(s,S);return k.length?k:[]},b=async S=>_(void 0,S),y=async(S=[])=>{if(!v.value)return!1;const k=p(S);if(k.length===0)return!0;let T={};for(const E of k)try{await E.validate(""),E.validateState==="error"&&!E.error&&E.resetField()}catch(x){T={...T,...x}}return Object.keys(T).length===0?!0:Promise.reject(T)},_=async(S=[],k)=>{let T=!1;const E=!Xe(k);try{return T=await y(S),T===!0&&await k?.(T),T}catch(x){if(x instanceof Error)throw x;const P=x;if(i.scrollToError&&o.value){const A=o.value.querySelector(`.${l.b()}-item.is-error`);A?.scrollIntoView(i.scrollIntoViewOptions)}return!T&&await k?.(!1,P),E&&Promise.reject(P)}},C=S=>{var k;const T=c(S);T&&((k=T.$el)==null||k.scrollIntoView(i.scrollIntoViewOptions))};return Se(()=>i.rules,()=>{i.validateOnRuleChange&&b().catch(S=>void 0)},{deep:!0,flush:"post"}),qt(Bf,on({...Sr(i),emit:r,resetFields:m,clearValidate:g,validateField:_,getField:c,addField:d,removeField:f,setInitialValues:h,...Eye()})),e({validate:b,validateField:_,resetFields:m,clearValidate:g,scrollToField:C,getField:c,fields:s,setInitialValues:h}),(S,k)=>(B(),Q("form",{ref_key:"formRef",ref:o,class:$(u.value)},[we(S.$slots,"default")],2))}});const Pye=["","error","validating","success"],Iye=qe({label:String,labelWidth:{type:[String,Number]},labelPosition:{type:String,values:["left","right","top",""],default:""},prop:{type:me([String,Array])},required:{type:Boolean,default:void 0},rules:{type:me([Object,Array])},error:String,validateStatus:{type:String,values:Pye},for:String,inlineMessage:{type:Boolean,default:void 0},showMessage:{type:Boolean,default:!0},size:{type:String,values:yl}});function Wd(){return Wd=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Bw(t,e,n){return Mye()?Bw=Reflect.construct.bind():Bw=function(r,o,s){var a=[null];a.push.apply(a,o);var l=Function.bind.apply(r,a),u=new l;return s&&Wv(u,s.prototype),u},Bw.apply(null,arguments)}function Oye(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function k2(t){var e=typeof Map=="function"?new Map:void 0;return k2=function(i){if(i===null||!Oye(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(i))return e.get(i);e.set(i,r)}function r(){return Bw(i,arguments,S2(this).constructor)}return r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Wv(r,i)},k2(t)}var Lye=/%[sdj%]/g,Dye=function(){};function T2(t){if(!t||!t.length)return null;var e={};return t.forEach(function(n){var i=n.field;e[i]=e[i]||[],e[i].push(n)}),e}function es(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i=o)return a;switch(a){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}break;default:return a}});return s}return t}function Nye(t){return t==="string"||t==="url"||t==="hex"||t==="email"||t==="date"||t==="pattern"}function sr(t,e){return!!(t==null||e==="array"&&Array.isArray(t)&&!t.length||Nye(e)&&typeof t=="string"&&!t)}function Bye(t,e,n){var i=[],r=0,o=t.length;function s(a){i.push.apply(i,a||[]),r++,r===o&&n(i)}t.forEach(function(a){e(a,s)})}function SN(t,e,n){var i=0,r=t.length;function o(s){if(s&&s.length){n(s);return}var a=i;i=i+1,a()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},vp={integer:function(e){return vp.number(e)&&parseInt(e,10)===e},float:function(e){return vp.number(e)&&!vp.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!vp.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(xN.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(Uye())},hex:function(e){return typeof e=="string"&&!!e.match(xN.hex)}},Wye=function(e,n,i,r,o){if(e.required&&n===void 0){oq(e,n,i,r,o);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=e.type;s.indexOf(a)>-1?vp[a](n)||r.push(es(o.messages.types[a],e.fullField,e.type)):a&&typeof n!==e.type&&r.push(es(o.messages.types[a],e.fullField,e.type))},qye=function(e,n,i,r,o){var s=typeof e.len=="number",a=typeof e.min=="number",l=typeof e.max=="number",u=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=n,d=null,f=typeof n=="number",h=typeof n=="string",m=Array.isArray(n);if(f?d="number":h?d="string":m&&(d="array"),!d)return!1;m&&(c=n.length),h&&(c=n.replace(u,"_").length),s?c!==e.len&&r.push(es(o.messages[d].len,e.fullField,e.len)):a&&!l&&ce.max?r.push(es(o.messages[d].max,e.fullField,e.max)):a&&l&&(ce.max)&&r.push(es(o.messages[d].range,e.fullField,e.min,e.max))},rh="enum",jye=function(e,n,i,r,o){e[rh]=Array.isArray(e[rh])?e[rh]:[],e[rh].indexOf(n)===-1&&r.push(es(o.messages[rh],e.fullField,e[rh].join(", ")))},Kye=function(e,n,i,r,o){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(n)||r.push(es(o.messages.pattern.mismatch,e.fullField,n,e.pattern));else if(typeof e.pattern=="string"){var s=new RegExp(e.pattern);s.test(n)||r.push(es(o.messages.pattern.mismatch,e.fullField,n,e.pattern))}}},fn={required:oq,whitespace:Hye,type:Wye,range:qye,enum:jye,pattern:Kye},Gye=function(e,n,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(sr(n,"string")&&!e.required)return i();fn.required(e,n,r,s,o,"string"),sr(n,"string")||(fn.type(e,n,r,s,o),fn.range(e,n,r,s,o),fn.pattern(e,n,r,s,o),e.whitespace===!0&&fn.whitespace(e,n,r,s,o))}i(s)},Yye=function(e,n,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(sr(n)&&!e.required)return i();fn.required(e,n,r,s,o),n!==void 0&&fn.type(e,n,r,s,o)}i(s)},Xye=function(e,n,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(n===""&&(n=void 0),sr(n)&&!e.required)return i();fn.required(e,n,r,s,o),n!==void 0&&(fn.type(e,n,r,s,o),fn.range(e,n,r,s,o))}i(s)},Jye=function(e,n,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(sr(n)&&!e.required)return i();fn.required(e,n,r,s,o),n!==void 0&&fn.type(e,n,r,s,o)}i(s)},Zye=function(e,n,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(sr(n)&&!e.required)return i();fn.required(e,n,r,s,o),sr(n)||fn.type(e,n,r,s,o)}i(s)},Qye=function(e,n,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(sr(n)&&!e.required)return i();fn.required(e,n,r,s,o),n!==void 0&&(fn.type(e,n,r,s,o),fn.range(e,n,r,s,o))}i(s)},ewe=function(e,n,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(sr(n)&&!e.required)return i();fn.required(e,n,r,s,o),n!==void 0&&(fn.type(e,n,r,s,o),fn.range(e,n,r,s,o))}i(s)},twe=function(e,n,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(n==null&&!e.required)return i();fn.required(e,n,r,s,o,"array"),n!=null&&(fn.type(e,n,r,s,o),fn.range(e,n,r,s,o))}i(s)},nwe=function(e,n,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(sr(n)&&!e.required)return i();fn.required(e,n,r,s,o),n!==void 0&&fn.type(e,n,r,s,o)}i(s)},iwe="enum",rwe=function(e,n,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(sr(n)&&!e.required)return i();fn.required(e,n,r,s,o),n!==void 0&&fn[iwe](e,n,r,s,o)}i(s)},owe=function(e,n,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(sr(n,"string")&&!e.required)return i();fn.required(e,n,r,s,o),sr(n,"string")||fn.pattern(e,n,r,s,o)}i(s)},swe=function(e,n,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(sr(n,"date")&&!e.required)return i();if(fn.required(e,n,r,s,o),!sr(n,"date")){var l;n instanceof Date?l=n:l=new Date(n),fn.type(e,l,r,s,o),l&&fn.range(e,l.getTime(),r,s,o)}}i(s)},awe=function(e,n,i,r,o){var s=[],a=Array.isArray(n)?"array":typeof n;fn.required(e,n,r,s,o,a),i(s)},Rk=function(e,n,i,r,o){var s=e.type,a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(sr(n,s)&&!e.required)return i();fn.required(e,n,r,a,o,s),sr(n,s)||fn.type(e,n,r,a,o)}i(a)},lwe=function(e,n,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(sr(n)&&!e.required)return i();fn.required(e,n,r,s,o)}i(s)},Kp={string:Gye,method:Yye,number:Xye,boolean:Jye,regexp:Zye,integer:Qye,float:ewe,array:twe,object:nwe,enum:rwe,pattern:owe,date:swe,url:Rk,hex:Rk,email:Rk,required:awe,any:lwe};function E2(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var x2=E2(),e0=(function(){function t(n){this.rules=null,this._messages=x2,this.define(n)}var e=t.prototype;return e.define=function(i){var r=this;if(!i)throw new Error("Cannot configure a schema with no rules");if(typeof i!="object"||Array.isArray(i))throw new Error("Rules must be an object");this.rules={},Object.keys(i).forEach(function(o){var s=i[o];r.rules[o]=Array.isArray(s)?s:[s]})},e.messages=function(i){return i&&(this._messages=EN(E2(),i)),this._messages},e.validate=function(i,r,o){var s=this;r===void 0&&(r={}),o===void 0&&(o=function(){});var a=i,l=r,u=o;if(typeof l=="function"&&(u=l,l={}),!this.rules||Object.keys(this.rules).length===0)return u&&u(null,a),Promise.resolve(a);function c(g){var v=[],p={};function b(_){if(Array.isArray(_)){var C;v=(C=v).concat.apply(C,_)}else v.push(_)}for(var y=0;y");const r=De("form"),o=H(),s=H(0),a=()=>{var c;if((c=o.value)!=null&&c.firstElementChild){const d=window.getComputedStyle(o.value.firstElementChild).width;return Math.ceil(Number.parseFloat(d))}else return 0},l=(c="update")=>{Ye(()=>{e.default&&t.isAutoWidth&&(c==="update"?s.value=a():c==="remove"&&n?.deregisterLabelWidth(s.value))})},u=()=>l("update");return Pt(()=>{u()}),Sn(()=>{l("remove")}),ku(()=>u()),Se(s,(c,d)=>{t.updateAll&&n?.registerLabelWidth(c,d)}),nr(M(()=>{var c,d;return(d=(c=o.value)==null?void 0:c.firstElementChild)!=null?d:null}),u),()=>{var c,d;if(!e)return null;const{isAutoWidth:f}=t;if(f){const h=n?.autoLabelWidth,m=i?.hasLabel,g={};if(m&&h&&h!=="auto"){const v=Math.max(0,Number.parseInt(h,10)-s.value),b=(i.labelPosition||n.labelPosition)==="left"?"marginRight":"marginLeft";v&&(g[b]=`${v}px`)}return L("div",{ref:o,class:[r.be("item","label-wrap")],style:g},[(c=e.default)==null?void 0:c.call(e)])}else return L(rt,{ref:o},[(d=e.default)==null?void 0:d.call(e)])}}});const cwe=["role","aria-labelledby"];var sq=le({name:"ElFormItem",__name:"form-item",props:Iye,setup(t,{expose:e}){const n=t,i=$o(),r=Ne(Bf,void 0),o=Ne(yf,void 0),s=fr(void 0,{formItem:!1}),a=De("form-item"),l=as().value,u=H([]),c=H(""),d=Rce(c,100),f=H(""),h=H();let m,g=!1;const v=M(()=>n.labelPosition||r?.labelPosition),p=M(()=>{var re;return v.value==="top"?{}:{width:zr((re=n.labelWidth)!=null?re:r?.labelWidth)}}),b=M(()=>{var re;if(v.value==="top"||r?.inline)return{};if(!n.label&&!n.labelWidth&&x)return{};const ee=zr((re=n.labelWidth)!=null?re:r?.labelWidth);return!n.label&&!i.label?{marginLeft:ee}:{}}),y=M(()=>[a.b(),a.m(s.value),a.is("error",c.value==="error"),a.is("validating",c.value==="validating"),a.is("success",c.value==="success"),a.is("required",q.value||n.required),a.is("no-asterisk",r?.hideRequiredAsterisk),r?.requireAsteriskPosition==="right"?"asterisk-right":"asterisk-left",{[a.m("feedback")]:r?.statusIcon,[a.m(`label-${v.value}`)]:v.value}]),_=M(()=>vi(n.inlineMessage)?n.inlineMessage:r?.inlineMessage||!1),C=M(()=>[a.e("error"),{[a.em("error","inline")]:_.value}]),S=M(()=>n.prop?Pe(n.prop)?n.prop.join("."):n.prop:""),k=M(()=>!!(n.label||i.label)),T=M(()=>{var re;return(re=n.for)!=null?re:u.value.length===1?u.value[0]:void 0}),E=M(()=>!T.value&&k.value),x=!!o,P=M(()=>{const re=r?.model;if(!(!re||!n.prop))return lm(re,n.prop).value}),A=M(()=>{const{required:re}=n,ee=[];n.rules&&ee.push(...Co(n.rules));const te=r?.rules;if(te&&n.prop){const V=lm(te,n.prop).value;V&&ee.push(...Co(V))}if(re!==void 0){const V=ee.map((K,G)=>[K,G]).filter(([K])=>"required"in K);if(V.length>0)for(const[K,G]of V)K.required!==re&&(ee[G]={...K,required:re});else ee.push({required:re})}return ee}),I=M(()=>A.value.length>0),D=re=>A.value.filter(te=>!te.trigger||!re?!0:Pe(te.trigger)?te.trigger.includes(re):te.trigger===re).map(({trigger:te,...V})=>V),q=M(()=>A.value.some(re=>re.required)),z=M(()=>{var re;return d.value==="error"&&n.showMessage&&((re=r?.showMessage)!=null?re:!0)}),R=M(()=>`${n.label||""}${r?.labelSuffix||""}`),O=re=>{c.value=re},N=re=>{var ee,te;const{errors:V,fields:K}=re;(!V||!K)&&console.error(re),O("error"),f.value=V?(te=(ee=V?.[0])==null?void 0:ee.message)!=null?te:`${n.prop} is required`:"",r?.emit("validate",n.prop,!1,f.value)},F=()=>{O("success"),r?.emit("validate",n.prop,!0,"")},j=async re=>{const ee=S.value;return new e0({[ee]:re}).validate({[ee]:P.value},{firstFields:!0}).then(()=>(F(),!0)).catch(V=>(N(V),Promise.reject(V)))},U=async(re,ee)=>{if(g||!n.prop)return!1;const te=Xe(ee);if(!I.value)return ee?.(!1),!1;const V=D(re);return V.length===0?(ee?.(!0),!0):(O("validating"),j(V).then(()=>(ee?.(!0),!0)).catch(K=>{const{fields:G}=K;return ee?.(!1,G),te?!1:Promise.reject(G)}))},W=()=>{O(""),f.value="",g=!1},J=async()=>{const re=r?.model;if(!re||!n.prop)return;const ee=lm(re,n.prop);g=!0,ee.value=gk(m),await Ye(),W(),g=!1},ne=re=>{u.value.includes(re)||u.value.push(re)},he=re=>{u.value=u.value.filter(ee=>ee!==re)},X=re=>{m=gk(re)};Se(()=>n.error,re=>{f.value=re||"",O(re?"error":"")},{immediate:!0}),Se(()=>n.validateStatus,re=>O(re||""));const se=on({...Sr(n),$el:h,size:s,validateMessage:f,validateState:c,labelId:l,inputIds:u,isGroup:E,hasLabel:k,fieldValue:P,addInputId:ne,removeInputId:he,resetField:J,clearValidate:W,validate:U,propString:S,setInitialValue:X});return qt(yf,se),Pt(()=>{n.prop&&(r?.addField(se),m=gk(P.value))}),Sn(()=>{r?.removeField(se)}),e({size:s,validateMessage:f,validateState:c,validate:U,clearValidate:W,resetField:J,setInitialValue:X}),(re,ee)=>{var te;return B(),Q("div",{ref_key:"formItemRef",ref:h,class:$(y.value),role:E.value?"group":void 0,"aria-labelledby":E.value?w(l):void 0},[L(w(uwe),{"is-auto-width":p.value.width==="auto","update-all":((te=w(r))==null?void 0:te.labelWidth)==="auto"},{default:ce(()=>[t.label||re.$slots.label?(B(),_e(Gt(T.value?"label":"div"),{key:0,id:w(l),for:T.value,class:$(w(a).e("label")),style:mt(p.value)},{default:ce(()=>[we(re.$slots,"label",{label:R.value},()=>[dt(We(R.value),1)])]),_:3},8,["id","for","class","style"])):ve("v-if",!0)]),_:3},8,["is-auto-width","update-all"]),ie("div",{class:$(w(a).e("content")),style:mt(b.value)},[we(re.$slots,"default"),L(Xz,{name:`${w(a).namespace.value}-zoom-in-top`},{default:ce(()=>[z.value?we(re.$slots,"error",{key:0,error:f.value},()=>[ie("div",{class:$(C.value)},We(f.value),3)]):ve("v-if",!0)]),_:3},8,["name"])],6)],10,cwe)}}});const aq=sn(Aye,{FormItem:sq}),Wh=Zi(sq),dwe=qe({hideOnClickModal:Boolean,src:{type:String,default:""},fit:{type:String,values:["","contain","cover","fill","none","scale-down"],default:""},loading:{type:String,values:["eager","lazy"]},lazy:Boolean,scrollContainer:{type:me([String,Object])},previewSrcList:{type:me(Array),default:()=>Fs([])},previewTeleported:Boolean,zIndex:{type:Number},initialIndex:{type:Number,default:0},infinite:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},zoomRate:{type:Number,default:1.2},scale:{type:Number,default:1},minScale:{type:Number,default:.2},maxScale:{type:Number,default:7},showProgress:Boolean,crossorigin:{type:me(String)}}),fwe={load:t=>t instanceof Event,error:t=>t instanceof Event,switch:t=>St(t),close:()=>!0,show:()=>!0},hwe=qe({urlList:{type:me(Array),default:()=>Fs([])},zIndex:{type:Number},initialIndex:{type:Number,default:0},infinite:{type:Boolean,default:!0},hideOnClickModal:Boolean,teleported:Boolean,closeOnPressEscape:{type:Boolean,default:!0},zoomRate:{type:Number,default:1.2},scale:{type:Number,default:1},minScale:{type:Number,default:.2},maxScale:{type:Number,default:7},showProgress:Boolean,crossorigin:{type:me(String)}}),mwe={close:()=>!0,error:t=>t instanceof Event,switch:t=>St(t),rotate:t=>St(t)},gwe=["src","crossorigin"];var pwe=le({name:"ElImageViewer",__name:"image-viewer",props:hwe,emits:mwe,setup(t,{expose:e,emit:n}){var i;const r={CONTAIN:{name:"contain",icon:ca(Cde)},ORIGINAL:{name:"original",icon:ca(Wde)}},o=t,s=n;let a;const{t:l}=Qt(),u=De("image-viewer"),{nextZIndex:c}=RC(),d=H(),f=H(),h=zb(),m=M(()=>{const{scale:ee,minScale:te,maxScale:V}=o;return Ece(ee,te,V)}),g=H(!0),v=H(!1),p=H(!1),b=H(o.initialIndex),y=bi(r.CONTAIN),_=H({scale:m.value,deg:0,offsetX:0,offsetY:0,enableTransition:!1}),C=H((i=o.zIndex)!=null?i:c());FR(p,{ns:u});const S=M(()=>{const{urlList:ee}=o;return ee.length<=1}),k=M(()=>b.value===0),T=M(()=>b.value===o.urlList.length-1),E=M(()=>o.urlList[b.value]),x=M(()=>[u.e("btn"),u.e("prev"),u.is("disabled",!o.infinite&&k.value)]),P=M(()=>[u.e("btn"),u.e("next"),u.is("disabled",!o.infinite&&T.value)]),A=M(()=>{const{scale:ee,deg:te,offsetX:V,offsetY:K,enableTransition:G}=_.value;let ye=V/ee,be=K/ee;const Ce=te*Math.PI/180,Y=Math.cos(Ce),Z=Math.sin(Ce);ye=ye*Y+be*Z,be=be*Y-V/ee*Z;const ae={transform:`scale(${ee}) rotate(${te}deg) translate(${ye}px, ${be}px)`,transition:G?"transform .3s":""};return y.value.name===r.CONTAIN.name&&(ae.maxWidth=ae.maxHeight="100%"),ae}),I=M(()=>`${b.value+1} / ${o.urlList.length}`);function D(){z(),a?.(),p.value=!1,s("close")}function q(){const ee=O0(V=>{switch(Bn(V)){case Me.esc:o.closeOnPressEscape&&D();break;case Me.space:U();break;case Me.left:J();break;case Me.up:he("zoomIn");break;case Me.right:ne();break;case Me.down:he("zoomOut");break}}),te=O0(V=>{const K=V.deltaY||V.deltaX;he(K<0?"zoomIn":"zoomOut",{zoomRate:o.zoomRate,enableTransition:!1})});h.run(()=>{Kn(document,"keydown",ee),Kn(d,"wheel",te)})}function z(){h.stop()}function R(){g.value=!1}function O(ee){v.value=!0,g.value=!1,s("error",ee),ee.target.alt=l("el.image.error")}function N(ee){if(g.value||ee.button!==0||!d.value)return;_.value.enableTransition=!1;const{offsetX:te,offsetY:V}=_.value,K=ee.pageX,G=ee.pageY,ye=O0(Y=>{_.value={..._.value,offsetX:te+Y.pageX-K,offsetY:V+Y.pageY-G}}),be=Kn(document,"mousemove",ye),Ce=Kn(document,"mouseup",()=>{be(),Ce()});ee.preventDefault()}function F(ee){if(g.value||!d.value||ee.touches.length!==1)return;_.value.enableTransition=!1;const{offsetX:te,offsetY:V}=_.value,{pageX:K,pageY:G}=ee.touches[0],ye=O0(Y=>{const Z=Y.touches[0];_.value={..._.value,offsetX:te+Z.pageX-K,offsetY:V+Z.pageY-G}}),be=Kn(document,"touchmove",ye),Ce=Kn(document,"touchend",()=>{be(),Ce()});ee.preventDefault()}function j(){_.value={scale:m.value,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}function U(){if(g.value||v.value)return;const ee=l2(r),te=Object.values(r),V=y.value.name,G=(te.findIndex(ye=>ye.name===V)+1)%ee.length;y.value=r[ee[G]],j()}function W(ee){v.value=!1;const te=o.urlList.length;b.value=(ee+te)%te}function J(){k.value&&!o.infinite||W(b.value-1)}function ne(){T.value&&!o.infinite||W(b.value+1)}function he(ee,te={}){if(g.value||v.value)return;const{minScale:V,maxScale:K}=o,{zoomRate:G,rotateDeg:ye,enableTransition:be}={zoomRate:o.zoomRate,rotateDeg:90,enableTransition:!0,...te};switch(ee){case"zoomOut":_.value.scale>V&&(_.value.scale=Number.parseFloat((_.value.scale/G).toFixed(3)));break;case"zoomIn":_.value.scale0)return ee.preventDefault(),!1}}return Se(()=>m.value,ee=>{_.value.scale=ee}),Se(E,()=>{Ye(()=>{const ee=f.value;ee?.complete||(g.value=!0)})}),Se(b,ee=>{j(),s("switch",ee)}),Pt(()=>{p.value=!0,q(),a=Kn("wheel",re,{passive:!1})}),e({setActiveItem:W}),(ee,te)=>(B(),_e(w(rR),{to:"body",disabled:!t.teleported},{default:ce(()=>[L(ya,{name:"viewer-fade",appear:""},{default:ce(()=>[ie("div",{ref_key:"wrapper",ref:d,tabindex:-1,class:$(w(u).e("wrapper")),style:mt({zIndex:C.value})},[L(w(VC),{loop:"",trapped:"","focus-trap-el":d.value,"focus-start-el":"container",onFocusoutPrevented:X,onReleaseRequested:se},{default:ce(()=>[ie("div",{class:$(w(u).e("mask")),onClick:te[0]||(te[0]=Ot(V=>t.hideOnClickModal&&D(),["self"]))},null,2),ve(" CLOSE "),ie("span",{class:$([w(u).e("btn"),w(u).e("close")]),onClick:D},[L(w(He),null,{default:ce(()=>[L(w(cl))]),_:1})],2),ve(" ARROW "),S.value?ve("v-if",!0):(B(),Q(rt,{key:0},[ie("span",{class:$(x.value),onClick:J},[L(w(He),null,{default:ce(()=>[L(w(Am))]),_:1})],2),ie("span",{class:$(P.value),onClick:ne},[L(w(He),null,{default:ce(()=>[L(w(oa))]),_:1})],2)],64)),ee.$slots.progress||t.showProgress?(B(),Q("div",{key:1,class:$([w(u).e("btn"),w(u).e("progress")])},[we(ee.$slots,"progress",{activeIndex:b.value,total:t.urlList.length},()=>[dt(We(I.value),1)])],2)):ve("v-if",!0),ve(" ACTIONS "),ie("div",{class:$([w(u).e("btn"),w(u).e("actions")])},[ie("div",{class:$(w(u).e("actions__inner"))},[we(ee.$slots,"toolbar",{actions:he,prev:J,next:ne,reset:U,activeIndex:b.value,setActiveItem:W},()=>[L(w(He),{onClick:te[1]||(te[1]=V=>he("zoomOut"))},{default:ce(()=>[L(w(sfe))]),_:1}),L(w(He),{onClick:te[2]||(te[2]=V=>he("zoomIn"))},{default:ce(()=>[L(w(mU))]),_:1}),ie("i",{class:$(w(u).e("actions__divider"))},null,2),L(w(He),{onClick:U},{default:ce(()=>[(B(),_e(Gt(y.value.icon)))]),_:1}),ie("i",{class:$(w(u).e("actions__divider"))},null,2),L(w(He),{onClick:te[3]||(te[3]=V=>he("anticlockwise"))},{default:ce(()=>[L(w(Vde))]),_:1}),L(w(He),{onClick:te[4]||(te[4]=V=>he("clockwise"))},{default:ce(()=>[L(w($de))]),_:1})])],2)],2),ve(" CANVAS "),ie("div",{class:$(w(u).e("canvas"))},[v.value&&ee.$slots["viewer-error"]?we(ee.$slots,"viewer-error",{key:0,activeIndex:b.value,src:E.value}):(B(),Q("img",{ref_key:"imgRef",ref:f,key:E.value,src:E.value,style:mt(A.value),class:$(w(u).e("img")),crossorigin:t.crossorigin,onLoad:R,onError:O,onMousedown:N,onTouchstart:F},null,46,gwe))],2),we(ee.$slots,"default")]),_:3},8,["focus-trap-el"])],6)]),_:3})]),_:3},8,["disabled"]))}});const lq=sn(pwe),vwe=["src","loading","crossorigin"],bwe={key:0};var ywe=le({name:"ElImage",inheritAttrs:!1,__name:"image",props:dwe,emits:fwe,setup(t,{expose:e,emit:n}){const i=t,r=n,{t:o}=Qt(),s=De("image"),a=Rf(),l=M(()=>Lv(Object.entries(a).filter(([R])=>/^(data-|on[A-Z])/i.test(R)||["id","style"].includes(R)))),u=vR({excludeListeners:!0,excludeKeys:M(()=>Object.keys(l.value))}),c=H(),d=H(!1),f=H(!0),h=H(!1),m=H(),g=H(),v=Zt&&"loading"in HTMLImageElement.prototype;let p;const b=M(()=>[s.e("inner"),_.value&&s.e("preview"),f.value&&s.is("loading")]),y=M(()=>{const{fit:R}=i;return Zt&&R?{objectFit:R}:{}}),_=M(()=>{const{previewSrcList:R}=i;return Pe(R)&&R.length>0}),C=M(()=>{const{previewSrcList:R,initialIndex:O}=i;let N=O;return O>R.length-1&&(N=0),N}),S=M(()=>i.loading==="eager"?!1:!v&&i.loading==="lazy"||i.lazy),k=()=>{Zt&&(f.value=!0,d.value=!1,c.value=i.src)};function T(R){f.value=!1,d.value=!1,r("load",R)}function E(R){f.value=!1,d.value=!0,r("error",R)}function x(R){R&&(k(),I())}const P=Mce(x,200,!0);async function A(){var R;if(!Zt)return;await Ye();const{scrollContainer:O}=i;if(Qo(O))g.value=O;else if(ot(O)&&O!=="")g.value=(R=document.querySelector(O))!=null?R:void 0;else if(m.value){const F=Qce(m.value);g.value=wce(F)?void 0:F}const{stop:N}=Fce(m,([F])=>{P(F.isIntersecting)},{root:g});p=N}function I(){!Zt||!P||(p?.(),g.value=void 0,p=void 0)}function D(){_.value&&(h.value=!0,r("show"))}function q(){h.value=!1,r("close")}function z(R){r("switch",R)}return Se(()=>i.src,()=>{S.value?(f.value=!0,d.value=!1,I(),A()):k()}),Pt(()=>{S.value?A():k()}),e({showPreview:D}),(R,O)=>(B(),Q("div",Lt({ref_key:"container",ref:m},l.value,{class:[w(s).b(),R.$attrs.class]}),[d.value?we(R.$slots,"error",{key:0},()=>[ie("div",{class:$(w(s).e("error"))},We(w(o)("el.image.error")),3)]):(B(),Q(rt,{key:1},[c.value!==void 0?(B(),Q("img",Lt({key:0},w(u),{src:c.value,loading:t.loading,style:y.value,class:b.value,crossorigin:t.crossorigin,onClick:D,onLoad:T,onError:E}),null,16,vwe)):ve("v-if",!0),f.value?(B(),Q("div",{key:1,class:$(w(s).e("wrapper"))},[we(R.$slots,"placeholder",{},()=>[ie("div",{class:$(w(s).e("placeholder"))},null,2)])],2)):ve("v-if",!0)],64)),_.value?(B(),Q(rt,{key:2},[h.value?(B(),_e(w(lq),{key:0,"z-index":t.zIndex,"initial-index":C.value,infinite:t.infinite,"zoom-rate":t.zoomRate,"min-scale":t.minScale,"max-scale":t.maxScale,"show-progress":t.showProgress,"url-list":t.previewSrcList,scale:t.scale,crossorigin:t.crossorigin,"hide-on-click-modal":t.hideOnClickModal,teleported:t.previewTeleported,"close-on-press-escape":t.closeOnPressEscape,onClose:q,onSwitch:z},kc({toolbar:ce(N=>[we(R.$slots,"toolbar",pw(Fp(N)))]),default:ce(()=>[R.$slots.viewer?(B(),Q("div",bwe,[we(R.$slots,"viewer")])):ve("v-if",!0)]),_:2},[R.$slots.progress?{name:"progress",fn:ce(N=>[we(R.$slots,"progress",pw(Fp(N)))]),key:"0"}:void 0,R.$slots["viewer-error"]?{name:"viewer-error",fn:ce(N=>[we(R.$slots,"viewer-error",pw(Fp(N)))]),key:"1"}:void 0]),1032,["z-index","initial-index","infinite","zoom-rate","min-scale","max-scale","show-progress","url-list","scale","crossorigin","hide-on-click-modal","teleported","close-on-press-escape"])):ve("v-if",!0)],64)):ve("v-if",!0)],16))}});const wwe=sn(ywe),_we=qe({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.MAX_SAFE_INTEGER},min:{type:Number,default:Number.MIN_SAFE_INTEGER},modelValue:{type:[Number,null]},readonly:Boolean,disabled:{type:Boolean,default:void 0},size:$r,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:me([String,Number,null]),validator:t=>t===null||St(t)||["min","max"].includes(t),default:null},name:String,placeholder:String,precision:{type:Number,validator:t=>t>=0&&t===Number.parseInt(`${t}`,10)},validateEvent:{type:Boolean,default:!0},...hs(["ariaLabel"]),inputmode:{type:me(String),default:void 0},align:{type:me(String),default:"center"},disabledScientific:Boolean}),Cwe={[En]:(t,e)=>e!==t,blur:t=>t instanceof FocusEvent,focus:t=>t instanceof FocusEvent,[rs]:t=>St(t)||ir(t),[It]:t=>St(t)||ir(t)},Swe=["aria-label"],kwe=["aria-label"];var Twe=le({name:"ElInputNumber",__name:"input-number",props:_we,emits:Cwe,setup(t,{expose:e,emit:n}){const i=t,r=n,{t:o}=Qt(),s=De("input-number"),a=H(),l=on({currentValue:i.modelValue,userInput:null}),{formItem:u}=lo(),c=M(()=>St(i.modelValue)&&i.modelValue<=i.min),d=M(()=>St(i.modelValue)&&i.modelValue>=i.max),f=M(()=>{const R=b(i.step);return pn(i.precision)?Math.max(b(i.modelValue),R):(R>i.precision,i.precision)}),h=M(()=>i.controls&&i.controlsPosition==="right"),m=fr(),g=Oi(),v=M(()=>{if(l.userInput!==null)return l.userInput;let R=l.currentValue;if(ir(R))return"";if(St(R)){if(Number.isNaN(R))return"";pn(i.precision)||(R=R.toFixed(i.precision))}return R}),p=(R,O)=>{if(pn(O)&&(O=f.value),O===0)return Math.round(R);let N=String(R);const F=N.indexOf(".");if(F===-1||!N.replace(".","").split("")[F+O])return R;const W=N.length;return N.charAt(W-1)==="5"&&(N=`${N.slice(0,Math.max(0,W-1))}6`),Number.parseFloat(Number(N).toFixed(O))},b=R=>{if(ir(R))return 0;const O=R.toString(),N=O.indexOf(".");let F=0;return N!==-1&&(F=O.length-N-1),F},y=(R,O=1)=>St(R)?R>=Number.MAX_SAFE_INTEGER&&O===1||R<=Number.MIN_SAFE_INTEGER&&O===-1?R:p(R+i.step*O):l.currentValue,_=R=>{const O=Bn(R),N=qU(R);if(i.disabledScientific&&["e","E"].includes(N)){R.preventDefault();return}switch(O){case Me.up:{R.preventDefault(),C();break}case Me.down:{R.preventDefault(),S();break}}},C=()=>{if(i.readonly||g.value||d.value)return;const R=Number(v.value)||0,O=y(R);T(O),r(rs,l.currentValue),q()},S=()=>{if(i.readonly||g.value||c.value)return;const R=Number(v.value)||0,O=y(R,-1);T(O),r(rs,l.currentValue),q()},k=(R,O)=>{const{max:N,min:F,step:j,precision:U,stepStrictly:W,valueOnClear:J}=i;NN||neN?N:F,O&&r(It,ne)),ne},T=(R,O=!0)=>{var N;const F=l.currentValue,j=k(R);if(!O){r(It,j);return}l.userInput=null,!(F===j&&R)&&(r(It,j),F!==j&&r(En,j,F),i.validateEvent&&((N=u?.validate)==null||N.call(u,"change").catch(U=>void 0)),l.currentValue=j)},E=R=>{l.userInput=R;const O=R===""?null:Number(R);r(rs,O),T(O,!1)},x=R=>{const O=R!==""?Number(R):"";(St(O)&&!Number.isNaN(O)||R==="")&&T(O),q(),l.userInput=null},P=()=>{var R,O;(O=(R=a.value)==null?void 0:R.focus)==null||O.call(R)},A=()=>{var R,O;(O=(R=a.value)==null?void 0:R.blur)==null||O.call(R)},I=R=>{r("focus",R)},D=R=>{var O,N;l.userInput=null,l.currentValue===null&&((O=a.value)!=null&&O.input)&&(a.value.input.value=""),r("blur",R),i.validateEvent&&((N=u?.validate)==null||N.call(u,"blur").catch(F=>void 0))},q=()=>{l.currentValue!==i.modelValue&&(l.currentValue=i.modelValue)},z=R=>{document.activeElement===R.target&&R.preventDefault()};return Se(()=>i.modelValue,(R,O)=>{const N=k(R,!0);l.userInput===null&&N!==O&&(l.currentValue=N)},{immediate:!0}),Se(()=>i.precision,()=>{l.currentValue=k(i.modelValue)}),Pt(()=>{var R;const{min:O,max:N,modelValue:F}=i,j=(R=a.value)==null?void 0:R.input;if(j.setAttribute("role","spinbutton"),Number.isFinite(N)?j.setAttribute("aria-valuemax",String(N)):j.removeAttribute("aria-valuemax"),Number.isFinite(O)?j.setAttribute("aria-valuemin",String(O)):j.removeAttribute("aria-valuemin"),j.setAttribute("aria-valuenow",l.currentValue||l.currentValue===0?String(l.currentValue):""),j.setAttribute("aria-disabled",String(g.value)),!St(F)&&F!=null){let U=Number(F);Number.isNaN(U)&&(U=null),r(It,U)}j.addEventListener("wheel",z,{passive:!1})}),ku(()=>{var R,O;const N=(R=a.value)==null?void 0:R.input;N?.setAttribute("aria-valuenow",`${(O=l.currentValue)!=null?O:""}`)}),e({focus:P,blur:A}),(R,O)=>(B(),Q("div",{class:$([w(s).b(),w(s).m(w(m)),w(s).is("disabled",w(g)),w(s).is("without-controls",!t.controls),w(s).is("controls-right",h.value),w(s).is(t.align,!!t.align)]),onDragstart:O[0]||(O[0]=Ot(()=>{},["prevent"]))},[t.controls?Vt((B(),Q("span",{key:0,role:"button","aria-label":w(o)("el.inputNumber.decrease"),class:$([w(s).e("decrease"),w(s).is("disabled",c.value)]),onKeydown:Pi(S,["enter"])},[we(R.$slots,"decrease-icon",{},()=>[L(w(He),null,{default:ce(()=>[h.value?(B(),_e(w(zc),{key:0})):(B(),_e(w(Ide),{key:1}))]),_:1})])],42,Swe)),[[w(U_),S]]):ve("v-if",!0),t.controls?Vt((B(),Q("span",{key:1,role:"button","aria-label":w(o)("el.inputNumber.increase"),class:$([w(s).e("increase"),w(s).is("disabled",d.value)]),onKeydown:Pi(C,["enter"])},[we(R.$slots,"increase-icon",{},()=>[L(w(He),null,{default:ce(()=>[h.value?(B(),_e(w(sR),{key:0})):(B(),_e(w(fU),{key:1}))]),_:1})])],42,kwe)),[[w(U_),C]]):ve("v-if",!0),L(w(cr),{id:t.id,ref_key:"input",ref:a,type:"number",step:t.step,"model-value":v.value,placeholder:t.placeholder,readonly:t.readonly,disabled:w(g),size:w(m),max:t.max,min:t.min,name:t.name,"aria-label":t.ariaLabel,"validate-event":!1,inputmode:t.inputmode,onKeydown:_,onBlur:D,onFocus:I,onInput:E,onChange:x},kc({_:2},[R.$slots.prefix?{name:"prefix",fn:ce(()=>[we(R.$slots,"prefix")]),key:"0"}:void 0,R.$slots.suffix?{name:"suffix",fn:ce(()=>[we(R.$slots,"suffix")]),key:"1"}:void 0]),1032,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","inputmode"])],34))}});const uq=sn(Twe);var Ewe=Object.defineProperty,xwe=(t,e,n)=>e in t?Ewe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,PN=(t,e,n)=>xwe(t,typeof e!="symbol"?e+"":e,n);let Awe=class{constructor(e,n){this.parent=e,this.domNode=n,PN(this,"subMenuItems"),PN(this,"subIndex",0),this.subIndex=0,this.init()}init(){this.subMenuItems=this.domNode.querySelectorAll("li"),this.addListeners()}gotoSubIndex(e){e===this.subMenuItems.length?e=0:e<0&&(e=this.subMenuItems.length-1),this.subMenuItems[e].focus(),this.subIndex=e}addListeners(){const e=this.parent.domNode;Array.prototype.forEach.call(this.subMenuItems,n=>{n.addEventListener("keydown",i=>{const r=Bn(i);let o=!1;switch(r){case Me.down:{this.gotoSubIndex(this.subIndex+1),o=!0;break}case Me.up:{this.gotoSubIndex(this.subIndex-1),o=!0;break}case Me.tab:{kw(e,"mouseleave");break}case Me.enter:case Me.numpadEnter:case Me.space:{o=!0,i.currentTarget.click();break}}return o&&(i.preventDefault(),i.stopPropagation()),!1})})}};var Pwe=Object.defineProperty,Iwe=(t,e,n)=>e in t?Pwe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Rwe=(t,e,n)=>Iwe(t,e+"",n);class Mwe{constructor(e,n){this.domNode=e,Rwe(this,"submenu",null),this.submenu=null,this.init(n)}init(e){this.domNode.setAttribute("tabindex","0");const n=this.domNode.querySelector(`.${e}-menu`);n&&(this.submenu=new Awe(this,n)),this.addListeners()}addListeners(){this.domNode.addEventListener("keydown",e=>{const n=Bn(e);let i=!1;switch(n){case Me.down:{kw(e.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(0),i=!0;break}case Me.up:{kw(e.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(this.submenu.subMenuItems.length-1),i=!0;break}case Me.tab:{kw(e.currentTarget,"mouseleave");break}case Me.enter:case Me.numpadEnter:case Me.space:{i=!0,e.currentTarget.click();break}}i&&e.preventDefault()})}}let Owe=class{constructor(e,n){this.domNode=e,this.init(n)}init(e){const n=this.domNode.childNodes;Array.from(n).forEach(i=>{i.nodeType===1&&new Mwe(i,e)})}};var Lwe=le({name:"ElMenuCollapseTransition",__name:"menu-collapse-transition",setup(t){const e=De("menu"),n={onBeforeEnter:i=>i.style.opacity="0.2",onEnter(i,r){Qs(i,`${e.namespace.value}-opacity-transition`),i.style.opacity="1",r()},onAfterEnter(i){os(i,`${e.namespace.value}-opacity-transition`),i.style.opacity=""},onBeforeLeave(i){i.dataset||(i.dataset={}),Xa(i,e.m("collapse"))?(os(i,e.m("collapse")),i.dataset.oldOverflow=i.style.overflow,i.dataset.scrollWidth=i.clientWidth.toString(),Qs(i,e.m("collapse"))):(Qs(i,e.m("collapse")),i.dataset.oldOverflow=i.style.overflow,i.dataset.scrollWidth=i.clientWidth.toString(),os(i,e.m("collapse"))),i.style.width=`${i.scrollWidth}px`,i.style.overflow="hidden"},onLeave(i){Qs(i,"horizontal-collapse-transition"),i.style.width=`${i.dataset.scrollWidth}px`}};return(i,r)=>(B(),_e(ya,Lt({mode:"out-in"},n),{default:ce(()=>[we(i.$slots,"default")]),_:3},16))}});function cq(t,e){const n=M(()=>{let r=t.parent;const o=[e.value];for(;r.type.name!=="ElMenu";)r.props.index&&o.unshift(r.props.index),r=r.parent;return o});return{parentMenu:M(()=>{let r=t.parent;for(;r&&!["ElMenu","ElSubMenu"].includes(r.type.name);)r=r.parent;return r}),indexPath:n}}function Dwe(t){return M(()=>{const n=t.backgroundColor;return n?new Uh(n).shade(20).toString():""})}const dq=(t,e)=>{const n=De("menu");return M(()=>n.cssVarBlock({"text-color":t.textColor||"","hover-text-color":t.textColor||"","bg-color":t.backgroundColor||"","hover-bg-color":Dwe(t).value||"","active-color":t.activeTextColor||"",level:`${e}`}))},zR="rootMenu",G_="subMenu:",Nwe=qe({index:{type:String,required:!0},showTimeout:Number,hideTimeout:Number,popperClass:String,popperStyle:{type:me([String,Object])},disabled:Boolean,teleported:{type:Boolean,default:void 0},popperOffset:Number,expandCloseIcon:{type:ri},expandOpenIcon:{type:ri},collapseCloseIcon:{type:ri},collapseOpenIcon:{type:ri}}),Mk="ElSubMenu";var HR=le({name:Mk,props:Nwe,setup(t,{slots:e,expose:n}){const i=Ct(),{indexPath:r,parentMenu:o}=cq(i,M(()=>t.index)),s=De("menu"),a=De("sub-menu"),l=Ne(zR);l||dr(Mk,"can not inject root menu");const u=Ne(`${G_}${o.value.uid}`);u||dr(Mk,"can not inject sub menu");const c=H({}),d=H({});let f;const h=H(!1),m=H(),g=H(),v=M(()=>u.level===0),p=M(()=>T.value==="horizontal"&&v.value?"bottom-start":"right-start"),b=M(()=>T.value==="horizontal"&&v.value||T.value==="vertical"&&!l.props.collapse?t.expandCloseIcon&&t.expandOpenIcon?S.value?t.expandOpenIcon:t.expandCloseIcon:zc:t.collapseCloseIcon&&t.collapseOpenIcon?S.value?t.collapseOpenIcon:t.collapseCloseIcon:oa),y=M(()=>{const U=t.teleported;return pn(U)?v.value:U}),_=M(()=>l.props.collapse?`${s.namespace.value}-zoom-in-left`:`${s.namespace.value}-zoom-in-top`),C=M(()=>T.value==="horizontal"&&v.value?["bottom-start","bottom-end","top-start","top-end","right-start","left-start"]:["right-start","right","right-end","left-start","bottom-start","bottom-end","top-start","top-end"]),S=M(()=>l.openedMenus.includes(t.index)),k=M(()=>[...Object.values(c.value),...Object.values(d.value)].some(({active:U})=>U)),T=M(()=>l.props.mode),E=M(()=>l.props.persistent),x=on({index:t.index,indexPath:r,active:k}),P=dq(l.props,u.level+1),A=M(()=>{var U;return(U=t.popperOffset)!=null?U:l.props.popperOffset}),I=M(()=>{var U;return(U=t.popperClass)!=null?U:l.props.popperClass}),D=M(()=>{var U;return(U=t.popperStyle)!=null?U:l.props.popperStyle}),q=M(()=>{var U;return(U=t.showTimeout)!=null?U:l.props.showTimeout}),z=M(()=>{var U;return(U=t.hideTimeout)!=null?U:l.props.hideTimeout}),R=()=>{var U,W,J;return(J=(W=(U=g.value)==null?void 0:U.popperRef)==null?void 0:W.popperInstanceRef)==null?void 0:J.destroy()},O=U=>{U||R()},N=()=>{l.props.menuTrigger==="hover"&&l.props.mode==="horizontal"||l.props.collapse&&l.props.mode==="vertical"||t.disabled||l.handleSubMenuClick({index:t.index,indexPath:r.value,active:k.value})},F=(U,W=q.value)=>{var J;if(U.type!=="focus"){if(l.props.menuTrigger==="click"&&l.props.mode==="horizontal"||!l.props.collapse&&l.props.mode==="vertical"||t.disabled){u.mouseInChild.value=!0;return}u.mouseInChild.value=!0,f?.(),{stop:f}=Dv(()=>{l.openMenu(t.index,r.value)},W),y.value&&((J=o.value.vnode.el)==null||J.dispatchEvent(new MouseEvent("mouseenter"))),U.type==="mouseenter"&&U.target&&Ye(()=>{Zb(U.target,{preventScroll:!0})})}},j=(U=!1)=>{var W;if(l.props.menuTrigger==="click"&&l.props.mode==="horizontal"||!l.props.collapse&&l.props.mode==="vertical"){u.mouseInChild.value=!1;return}f?.(),u.mouseInChild.value=!1,{stop:f}=Dv(()=>!h.value&&l.closeMenu(t.index,r.value),z.value),y.value&&U&&((W=u.handleMouseleave)==null||W.call(u,!0))};Se(()=>l.props.collapse,U=>O(!!U));{const U=J=>{d.value[J.index]=J},W=J=>{delete d.value[J.index]};qt(`${G_}${i.uid}`,{addSubMenu:U,removeSubMenu:W,handleMouseleave:j,mouseInChild:h,level:u.level+1})}return n({opened:S}),Pt(()=>{l.addSubMenu(x),u.addSubMenu(x)}),Sn(()=>{u.removeSubMenu(x),l.removeSubMenu(x)}),()=>{var U;const W=[(U=e.title)==null?void 0:U.call(e),nt(He,{class:a.e("icon-arrow"),style:{transform:S.value?t.expandCloseIcon&&t.expandOpenIcon||t.collapseCloseIcon&&t.collapseOpenIcon&&l.props.collapse?"none":"rotateZ(180deg)":"none"}},{default:()=>ot(b.value)?nt(i.appContext.components[b.value]):nt(b.value)})],J=l.isMenuPopup?nt(Lo,{ref:g,visible:S.value,effect:"light",pure:!0,offset:A.value,showArrow:!1,persistent:E.value,popperClass:I.value,popperStyle:D.value,placement:p.value,teleported:y.value,fallbackPlacements:C.value,transition:_.value,gpuAcceleration:!1},{content:()=>{var ne;return nt("div",{class:[s.m(T.value),s.m("popup-container"),I.value],onMouseenter:he=>F(he,100),onMouseleave:()=>j(!0),onFocus:he=>F(he,100)},[nt("ul",{class:[s.b(),s.m("popup"),s.m(`popup-${p.value}`)],style:P.value},[(ne=e.default)==null?void 0:ne.call(e)])])},default:()=>nt("div",{class:a.e("title"),onClick:N},W)}):nt(rt,{},[nt("div",{class:a.e("title"),ref:m,onClick:N},W),nt(Npe,{},{default:()=>{var ne;return Vt(nt("ul",{role:"menu",class:[s.b(),s.m("inline")],style:P.value},[(ne=e.default)==null?void 0:ne.call(e)]),[[On,S.value]])}})]);return nt("li",{class:[a.b(),a.is("active",k.value),a.is("opened",S.value),a.is("disabled",t.disabled)],role:"menuitem",ariaHaspopup:!0,ariaExpanded:S.value,onMouseenter:F,onMouseleave:()=>j(),onFocus:F},[J])}}});const Bwe=qe({mode:{type:String,values:["horizontal","vertical"],default:"vertical"},defaultActive:{type:String,default:""},defaultOpeneds:{type:me(Array),default:()=>Fs([])},uniqueOpened:Boolean,router:Boolean,menuTrigger:{type:String,values:["hover","click"],default:"hover"},collapse:Boolean,backgroundColor:String,textColor:String,activeTextColor:String,closeOnClickOutside:Boolean,collapseTransition:{type:Boolean,default:!0},ellipsis:{type:Boolean,default:!0},popperOffset:{type:Number,default:6},ellipsisIcon:{type:ri,default:()=>Dde},popperEffect:{type:me(String),default:"dark"},popperClass:String,popperStyle:{type:me([String,Object])},showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300},persistent:{type:Boolean,default:!0}}),Ok=t=>Pe(t)&&t.every(e=>ot(e)),Vwe={close:(t,e)=>ot(t)&&Ok(e),open:(t,e)=>ot(t)&&Ok(e),select:(t,e,n,i)=>ot(t)&&Ok(e)&&_t(n)&&(pn(i)||i instanceof Promise)},IN=64;var Fwe=le({name:"ElMenu",props:Bwe,emits:Vwe,setup(t,{emit:e,slots:n,expose:i}){const r=Ct(),o=r.appContext.config.globalProperties.$router,s=H(),a=H(),l=De("menu"),u=De("sub-menu");let c=IN;const d=H(-1),f=H(t.defaultOpeneds&&!t.collapse?t.defaultOpeneds.slice(0):[]),h=H(t.defaultActive),m=H({}),g=H({}),v=M(()=>t.mode==="horizontal"||t.mode==="vertical"&&t.collapse),p=()=>{const R=h.value&&m.value[h.value];if(!R||t.mode==="horizontal"||t.collapse)return;R.indexPath.forEach(N=>{const F=g.value[N];F&&b(N,F.indexPath)})},b=(R,O)=>{f.value.includes(R)||(t.uniqueOpened&&(f.value=f.value.filter(N=>O.includes(N))),f.value.push(R),e("open",R,O))},y=R=>{const O=f.value.indexOf(R);O!==-1&&f.value.splice(O,1)},_=(R,O)=>{y(R),e("close",R,O)},C=({index:R,indexPath:O})=>{f.value.includes(R)?_(R,O):b(R,O)},S=R=>{(t.mode==="horizontal"||t.collapse)&&(f.value=[]);const{index:O,indexPath:N}=R;if(!(ir(O)||ir(N)))if(t.router&&o){const F=R.route||O,j=o.push(F).then(U=>(U||(h.value=O),U));e("select",O,N,{index:O,indexPath:N,route:F},j)}else h.value=O,e("select",O,N,{index:O,indexPath:N})},k=R=>{var O;const N=m.value,F=N[R]||h.value&&N[h.value]||N[t.defaultActive];h.value=(O=F?.index)!=null?O:R},T=R=>{const O=getComputedStyle(R),N=Number.parseInt(O.marginLeft,10),F=Number.parseInt(O.marginRight,10);return R.offsetWidth+N+F||0},E=()=>{if(!s.value)return-1;const R=Array.from(s.value.childNodes).filter(J=>J.nodeName!=="#comment"&&(J.nodeName!=="#text"||J.nodeValue)),O=getComputedStyle(s.value),N=Number.parseInt(O.paddingLeft,10),F=Number.parseInt(O.paddingRight,10),j=s.value.clientWidth-N-F;let U=0,W=0;return R.forEach((J,ne)=>{U+=T(J),U<=j-c&&(W=ne+1)}),W===R.length?-1:W},x=R=>g.value[R].indexPath,P=(R,O=33.34)=>{let N;return()=>{N&&clearTimeout(N),N=setTimeout(()=>{R()},O)}};let A=!0;const I=()=>{const R=Yi(a);if(R&&(c=T(R)||IN),d.value===E())return;const O=()=>{d.value=-1,Ye(()=>{d.value=E()})};A?O():P(O)(),A=!1};Se(()=>t.defaultActive,R=>{m.value[R]||(h.value=""),k(R)}),Se(()=>t.collapse,R=>{R&&(f.value=[])}),Se(m.value,p);let D;sl(()=>{t.mode==="horizontal"&&t.ellipsis?D=nr(s,I).stop:D?.()});const q=H(!1);{const R=j=>{g.value[j.index]=j},O=j=>{delete g.value[j.index]};qt(zR,on({props:t,openedMenus:f,items:m,subMenus:g,activeIndex:h,isMenuPopup:v,addMenuItem:j=>{m.value[j.index]=j},removeMenuItem:j=>{delete m.value[j.index]},addSubMenu:R,removeSubMenu:O,openMenu:b,closeMenu:_,handleMenuItemClick:S,handleSubMenuClick:C})),qt(`${G_}${r.uid}`,{addSubMenu:R,removeSubMenu:O,mouseInChild:q,level:0})}Pt(()=>{t.mode==="horizontal"&&new Owe(r.vnode.el,l.namespace.value)}),i({open:O=>{const{indexPath:N}=g.value[O];N.forEach(F=>b(F,N))},close:y,updateActiveIndex:k,handleResize:I});const z=dq(t,0);return()=>{var R,O;let N=(O=(R=n.default)==null?void 0:R.call(n))!=null?O:[];const F=[];if(t.mode==="horizontal"&&s.value){const W=cc(N).filter(he=>he?.shapeFlag!==8),J=d.value===-1?W:W.slice(0,d.value),ne=d.value===-1?[]:W.slice(d.value);ne?.length&&t.ellipsis&&(N=J,F.push(nt(HR,{ref:a,index:"sub-menu-more",class:u.e("hide-arrow"),popperOffset:t.popperOffset},{title:()=>nt(He,{class:u.e("icon-more")},{default:()=>nt(t.ellipsisIcon)}),default:()=>ne})))}const j=t.closeOnClickOutside?[[wf,()=>{f.value.length&&(q.value||(f.value.forEach(W=>e("close",W,x(W))),f.value=[]))}]]:[],U=Vt(nt("ul",{key:String(t.collapse),role:"menubar",ref:s,style:z.value,class:{[l.b()]:!0,[l.m(t.mode)]:!0,[l.m("collapse")]:t.collapse}},[...N,...F]),j);return t.collapseTransition&&t.mode==="vertical"?nt(Lwe,()=>U):U}}});const $we=qe({index:{type:me([String,null]),default:null},route:{type:me([String,Object])},disabled:Boolean}),zwe={click:t=>ot(t.index)&&Pe(t.indexPath)},Lk="ElMenuItem";var fq=le({name:Lk,__name:"menu-item",props:$we,emits:zwe,setup(t,{expose:e,emit:n}){const i=t,r=n;Is(i.index)&&void 0;const o=Ct(),s=Ne(zR),a=De("menu"),l=De("menu-item");s||dr(Lk,"can not inject root menu");const{parentMenu:u,indexPath:c}=cq(o,An(i,"index")),d=Ne(`${G_}${u.value.uid}`);d||dr(Lk,"can not inject sub menu");const f=M(()=>i.index===s.activeIndex),h=on({index:i.index,indexPath:c,active:f}),m=()=>{i.disabled||(s.handleMenuItemClick({index:i.index,indexPath:c.value,route:i.route}),r("click",h))};return Pt(()=>{d.addSubMenu(h),s.addMenuItem(h)}),Sn(()=>{d.removeSubMenu(h),s.removeMenuItem(h)}),e({parentMenu:u,rootMenu:s,active:f,nsMenu:a,nsMenuItem:l,handleClick:m}),(g,v)=>(B(),Q("li",{class:$([w(l).b(),w(l).is("active",f.value),w(l).is("disabled",t.disabled)]),role:"menuitem",tabindex:"-1",onClick:m},[w(u).type.name==="ElMenu"&&w(s).props.collapse&&g.$slots.title?(B(),_e(w(Lo),{key:0,effect:w(s).props.popperEffect,placement:"right","fallback-placements":["left"],"popper-class":w(s).props.popperClass,"popper-style":w(s).props.popperStyle,persistent:w(s).props.persistent,"focus-on-target":""},{content:ce(()=>[we(g.$slots,"title")]),default:ce(()=>[ie("div",{class:$(w(a).be("tooltip","trigger"))},[we(g.$slots,"default")],2)]),_:3},8,["effect","popper-class","popper-style","persistent"])):(B(),Q(rt,{key:1},[we(g.$slots,"default"),we(g.$slots,"title")],64))],2))}});const Hwe={title:String};var hq=le({name:"ElMenuItemGroup",__name:"menu-item-group",props:Hwe,setup(t){const e=De("menu-item-group");return(n,i)=>(B(),Q("li",{class:$(w(e).b())},[ie("div",{class:$(w(e).e("title"))},[n.$slots.title?we(n.$slots,"title",{key:1}):(B(),Q(rt,{key:0},[dt(We(t.title),1)],64))],2),ie("ul",null,[we(n.$slots,"default")])],2))}});const Uwe=sn(Fwe,{MenuItem:fq,MenuItemGroup:hq,SubMenu:HR}),Wwe=Zi(fq);Zi(hq);const qwe=Zi(HR),mq=Symbol("elPaginationKey"),jwe=qe({disabled:Boolean,currentPage:{type:Number,default:1},prevText:{type:String},prevIcon:{type:ri}}),Kwe={click:t=>t instanceof MouseEvent},Gwe=["disabled","aria-label","aria-disabled"],Ywe={key:0};var Xwe=le({name:"ElPaginationPrev",__name:"prev",props:jwe,emits:Kwe,setup(t){const e=t,{t:n}=Qt(),i=M(()=>e.disabled||e.currentPage<=1);return(r,o)=>(B(),Q("button",{type:"button",class:"btn-prev",disabled:i.value,"aria-label":r.prevText||w(n)("el.pagination.prev"),"aria-disabled":i.value,onClick:o[0]||(o[0]=s=>r.$emit("click",s))},[r.prevText?(B(),Q("span",Ywe,We(r.prevText),1)):(B(),_e(w(He),{key:1},{default:ce(()=>[(B(),_e(Gt(r.prevIcon)))]),_:1}))],8,Gwe))}});const Jwe=qe({disabled:Boolean,currentPage:{type:Number,default:1},pageCount:{type:Number,default:50},nextText:{type:String},nextIcon:{type:ri}}),Zwe=["disabled","aria-label","aria-disabled"],Qwe={key:0};var e_e=le({name:"ElPaginationNext",__name:"next",props:Jwe,emits:["click"],setup(t){const e=t,{t:n}=Qt(),i=M(()=>e.disabled||e.currentPage===e.pageCount||e.pageCount===0);return(r,o)=>(B(),Q("button",{type:"button",class:"btn-next",disabled:i.value,"aria-label":r.nextText||w(n)("el.pagination.next"),"aria-disabled":i.value,onClick:o[0]||(o[0]=s=>r.$emit("click",s))},[r.nextText?(B(),Q("span",Qwe,We(r.nextText),1)):(B(),_e(w(He),{key:1},{default:ce(()=>[(B(),_e(Gt(r.nextIcon)))]),_:1}))],8,Zwe))}});const UR=()=>Ne(mq,{}),t_e=qe({pageSize:{type:Number,required:!0},pageSizes:{type:me(Array),default:()=>Fs([10,20,30,40,50,100])},popperClass:{type:String},popperStyle:{type:me([String,Object])},disabled:Boolean,teleported:Boolean,size:{type:String,values:yl},appendSizeTo:String});var n_e=le({name:"ElPaginationSizes",__name:"sizes",props:t_e,emits:["page-size-change"],setup(t,{emit:e}){const n=t,i=e,{t:r}=Qt(),o=De("pagination"),s=UR(),a=H(n.pageSize);Se(()=>n.pageSizes,(c,d)=>{if(!$i(c,d)&&Pe(c)){const f=c.includes(n.pageSize)?n.pageSize:n.pageSizes[0];i("page-size-change",f)}}),Se(()=>n.pageSize,c=>{a.value=c});const l=M(()=>n.pageSizes);function u(c){var d;c!==a.value&&(a.value=c,(d=s.handleSizeChange)==null||d.call(s,Number(c)))}return(c,d)=>(B(),Q("span",{class:$(w(o).e("sizes"))},[L(w(oW),{"model-value":a.value,disabled:c.disabled,"popper-class":c.popperClass,"popper-style":c.popperStyle,size:c.size,teleported:c.teleported,"validate-event":!1,"append-to":c.appendSizeTo,onChange:u},{default:ce(()=>[(B(!0),Q(rt,null,gn(l.value,f=>(B(),_e(w(sW),{key:f,value:f,label:f+w(r)("el.pagination.pagesize")},null,8,["value","label"]))),128))]),_:1},8,["model-value","disabled","popper-class","popper-style","size","teleported","append-to"])],2))}});const i_e=qe({size:{type:String,values:yl}}),r_e=["disabled"];var o_e=le({name:"ElPaginationJumper",__name:"jumper",props:i_e,setup(t){const{t:e}=Qt(),n=De("pagination"),{pageCount:i,disabled:r,currentPage:o,changeEvent:s}=UR(),a=H(),l=M(()=>{var d;return(d=a.value)!=null?d:o?.value});function u(d){a.value=d?+d:""}function c(d){d=Math.trunc(+d),s?.(d),a.value=void 0}return(d,f)=>(B(),Q("span",{class:$(w(n).e("jump")),disabled:w(r)},[ie("span",{class:$([w(n).e("goto")])},We(w(e)("el.pagination.goto")),3),L(w(cr),{size:d.size,class:$([w(n).e("editor"),w(n).is("in-pagination")]),min:1,max:w(i),disabled:w(r),"model-value":l.value,"validate-event":!1,"aria-label":w(e)("el.pagination.page"),type:"number","onUpdate:modelValue":u,onChange:c},null,8,["size","class","max","disabled","model-value","aria-label"]),ie("span",{class:$([w(n).e("classifier")])},We(w(e)("el.pagination.pageClassifier")),3)],10,r_e))}});const s_e=qe({total:{type:Number,default:1e3}}),a_e=["disabled"];var l_e=le({name:"ElPaginationTotal",__name:"total",props:s_e,setup(t){const{t:e}=Qt(),n=De("pagination"),{disabled:i}=UR();return(r,o)=>(B(),Q("span",{class:$(w(n).e("total")),disabled:w(i)},We(w(e)("el.pagination.total",{total:r.total})),11,a_e))}});const u_e=qe({currentPage:{type:Number,default:1},pageCount:{type:Number,required:!0},pagerCount:{type:Number,default:7},disabled:Boolean}),c_e=["aria-current","aria-label","tabindex"],d_e=["tabindex","aria-label"],f_e=["aria-current","aria-label","tabindex"],h_e=["tabindex","aria-label"],m_e=["aria-current","aria-label","tabindex"];var g_e=le({name:"ElPaginationPager",__name:"pager",props:u_e,emits:[En],setup(t,{emit:e}){const n=t,i=e,r=De("pager"),o=De("icon"),{t:s}=Qt(),a=H(!1),l=H(!1),u=H(!1),c=H(!1),d=H(!1),f=H(!1),h=M(()=>{const C=n.pagerCount,S=(C-1)/2,k=Number(n.currentPage),T=Number(n.pageCount);let E=!1,x=!1;T>C&&(k>C-S&&(E=!0),k["more","btn-quickprev",o.b(),r.is("disabled",n.disabled)]),g=M(()=>["more","btn-quicknext",o.b(),r.is("disabled",n.disabled)]),v=M(()=>n.disabled?-1:0);Se(()=>[n.pageCount,n.pagerCount,n.currentPage],([C,S,k])=>{const T=(S-1)/2;let E=!1,x=!1;C>S&&(E=k>S-T,x=kT&&(k=T)),k!==E&&i(En,k)}return(C,S)=>(B(),Q("ul",{class:$(w(r).b()),onClick:_,onKeyup:Pi(y,["enter"])},[C.pageCount>0?(B(),Q("li",{key:0,class:$([[w(r).is("active",C.currentPage===1),w(r).is("disabled",C.disabled)],"number"]),"aria-current":C.currentPage===1,"aria-label":w(s)("el.pagination.currentPage",{pager:1}),tabindex:v.value}," 1 ",10,c_e)):ve("v-if",!0),a.value?(B(),Q("li",{key:1,class:$(m.value),tabindex:v.value,"aria-label":w(s)("el.pagination.prevPages",{pager:C.pagerCount-2}),onMouseenter:S[0]||(S[0]=k=>p(!0)),onMouseleave:S[1]||(S[1]=k=>u.value=!1),onFocus:S[2]||(S[2]=k=>b(!0)),onBlur:S[3]||(S[3]=k=>d.value=!1)},[(u.value||d.value)&&!C.disabled?(B(),_e(w(Tc),{key:0})):(B(),_e(w(bD),{key:1}))],42,d_e)):ve("v-if",!0),(B(!0),Q(rt,null,gn(h.value,k=>(B(),Q("li",{key:k,class:$([[w(r).is("active",C.currentPage===k),w(r).is("disabled",C.disabled)],"number"]),"aria-current":C.currentPage===k,"aria-label":w(s)("el.pagination.currentPage",{pager:k}),tabindex:v.value},We(k),11,f_e))),128)),l.value?(B(),Q("li",{key:2,class:$(g.value),tabindex:v.value,"aria-label":w(s)("el.pagination.nextPages",{pager:C.pagerCount-2}),onMouseenter:S[4]||(S[4]=k=>p()),onMouseleave:S[5]||(S[5]=k=>c.value=!1),onFocus:S[6]||(S[6]=k=>b()),onBlur:S[7]||(S[7]=k=>f.value=!1)},[(c.value||f.value)&&!C.disabled?(B(),_e(w(Ec),{key:0})):(B(),_e(w(bD),{key:1}))],42,h_e)):ve("v-if",!0),C.pageCount>1?(B(),Q("li",{key:3,class:$([[w(r).is("active",C.currentPage===C.pageCount),w(r).is("disabled",C.disabled)],"number"]),"aria-current":C.currentPage===C.pageCount,"aria-label":w(s)("el.pagination.currentPage",{pager:C.pageCount}),tabindex:v.value},We(C.pageCount),11,m_e)):ve("v-if",!0)],34))}});const Kr=t=>typeof t!="number",p_e=qe({pageSize:Number,defaultPageSize:Number,total:Number,pageCount:Number,pagerCount:{type:Number,validator:t=>St(t)&&Math.trunc(t)===t&&t>4&&t<22&&t%2===1,default:7},currentPage:Number,defaultCurrentPage:Number,layout:{type:String,default:["prev","pager","next","jumper","->","total"].join(", ")},pageSizes:{type:me(Array),default:()=>Fs([10,20,30,40,50,100])},popperClass:{type:String,default:""},popperStyle:{type:me([String,Object])},prevText:{type:String,default:""},prevIcon:{type:ri,default:()=>Am},nextText:{type:String,default:""},nextIcon:{type:ri,default:()=>oa},teleported:{type:Boolean,default:!0},small:Boolean,size:$r,background:Boolean,disabled:Boolean,hideOnSinglePage:Boolean,appendSizeTo:String}),v_e={"update:current-page":t=>St(t),"update:page-size":t=>St(t),"size-change":t=>St(t),change:(t,e)=>St(t)&&St(e),"current-change":t=>St(t),"prev-click":t=>St(t),"next-click":t=>St(t)},RN="ElPagination";var b_e=le({name:RN,props:p_e,emits:v_e,setup(t,{emit:e,slots:n}){const{t:i}=Qt(),r=De("pagination"),o=Ct().vnode.props||{},s=oU(),a=M(()=>{var C;return t.small?"small":(C=t.size)!=null?C:s.value});of({from:"small",replacement:"size",version:"3.0.0",scope:"el-pagination",ref:"https://element-plus.org/zh-CN/component/pagination.html"},M(()=>!!t.small));const l="onUpdate:currentPage"in o||"onUpdate:current-page"in o||"onCurrentChange"in o,u="onUpdate:pageSize"in o||"onUpdate:page-size"in o||"onSizeChange"in o,c=M(()=>{if(Kr(t.total)&&Kr(t.pageCount)||!Kr(t.currentPage)&&!l)return!1;if(t.layout.includes("sizes")){if(Kr(t.pageCount)){if(!Kr(t.total)&&!Kr(t.pageSize)&&!u)return!1}else if(!u)return!1}return!0}),d=H(Kr(t.defaultPageSize)?10:t.defaultPageSize),f=H(Kr(t.defaultCurrentPage)?1:t.defaultCurrentPage),h=M({get(){return Kr(t.pageSize)?d.value:t.pageSize},set(C){Kr(t.pageSize)&&(d.value=C),u&&(e("update:page-size",C),e("size-change",C))}}),m=M(()=>{let C=0;return Kr(t.pageCount)?Kr(t.total)||(C=Math.max(1,Math.ceil(t.total/h.value))):C=t.pageCount,C}),g=M({get(){return Kr(t.currentPage)?f.value:t.currentPage},set(C){let S=C;C<1?S=1:C>m.value&&(S=m.value),Kr(t.currentPage)&&(f.value=S),l&&(e("update:current-page",S),e("current-change",S))}});Se(m,C=>{g.value>C&&(g.value=C)}),Se([g,h],C=>{e(En,...C)},{flush:"post"});function v(C){g.value=C}function p(C){h.value=C;const S=m.value;g.value>S&&(g.value=S)}function b(){t.disabled||(g.value-=1,e("prev-click",g.value))}function y(){t.disabled||(g.value+=1,e("next-click",g.value))}function _(C,S){C&&(C.props||(C.props={}),C.props.class=[C.props.class,S].join(" "))}return qt(mq,{pageCount:m,disabled:M(()=>t.disabled),currentPage:g,changeEvent:v,handleSizeChange:p}),()=>{var C,S;if(!c.value)return i("el.pagination.deprecationWarning"),null;if(!t.layout||t.hideOnSinglePage&&m.value<=1)return null;const k=[],T=[],E=nt("div",{class:r.e("rightwrapper")},T),x={prev:nt(Xwe,{disabled:t.disabled,currentPage:g.value,prevText:t.prevText,prevIcon:t.prevIcon,onClick:b}),jumper:nt(o_e,{size:a.value}),pager:nt(g_e,{currentPage:g.value,pageCount:m.value,pagerCount:t.pagerCount,onChange:v,disabled:t.disabled}),next:nt(e_e,{disabled:t.disabled,currentPage:g.value,pageCount:m.value,nextText:t.nextText,nextIcon:t.nextIcon,onClick:y}),sizes:nt(n_e,{pageSize:h.value,pageSizes:t.pageSizes,popperClass:t.popperClass,popperStyle:t.popperStyle,disabled:t.disabled,teleported:t.teleported,size:a.value,appendSizeTo:t.appendSizeTo}),slot:(S=(C=n?.default)==null?void 0:C.call(n))!=null?S:null,total:nt(l_e,{total:Kr(t.total)?0:t.total})},P=t.layout.split(",").map(I=>I.trim());let A=!1;return P.forEach(I=>{if(I==="->"){A=!0;return}A?T.push(x[I]):k.push(x[I])}),_(k[0],r.is("first")),_(k[k.length-1],r.is("last")),A&&T.length>0&&(_(T[0],r.is("first")),_(T[T.length-1],r.is("last")),k.push(E)),nt("div",{class:[r.b(),r.is("background",t.background),r.m(a.value)]},k)}}});const y_e=sn(b_e),w_e=qe({trigger:vc.trigger,triggerKeys:vc.triggerKeys,placement:Nw.placement,disabled:vc.disabled,visible:Mn.visible,transition:Mn.transition,popperOptions:Nw.popperOptions,tabindex:Nw.tabindex,content:Mn.content,popperStyle:Mn.popperStyle,popperClass:Mn.popperClass,enterable:{...Mn.enterable,default:!0},effect:{...Mn.effect,default:"light"},teleported:Mn.teleported,appendTo:Mn.appendTo,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),__e={"update:visible":t=>vi(t),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},C_e="onUpdate:visible";var S_e=le({name:"ElPopover",__name:"popover",props:w_e,emits:__e,setup(t,{expose:e,emit:n}){const i=t,r=n,o=M(()=>i[C_e]),s=De("popover"),a=H(),l=M(()=>{var p;return(p=w(a))==null?void 0:p.popperRef}),u=M(()=>[{width:zr(i.width)},i.popperStyle]),c=M(()=>[s.b(),i.popperClass,{[s.m("plain")]:!!i.content}]),d=M(()=>i.transition===`${s.namespace.value}-fade-in-linear`),f=()=>{var p;(p=a.value)==null||p.hide()},h=()=>{r("before-enter")},m=()=>{r("before-leave")},g=()=>{r("after-enter")},v=()=>{r("update:visible",!1),r("after-leave")};return e({popperRef:l,hide:f}),(p,b)=>(B(),_e(w(Lo),Lt({ref_key:"tooltipRef",ref:a},p.$attrs,{trigger:t.trigger,"trigger-keys":t.triggerKeys,placement:t.placement,disabled:t.disabled,visible:t.visible,transition:t.transition,"popper-options":t.popperOptions,tabindex:t.tabindex,content:t.content,offset:t.offset,"show-after":t.showAfter,"hide-after":t.hideAfter,"auto-close":t.autoClose,"show-arrow":t.showArrow,"aria-label":t.title,effect:t.effect,enterable:t.enterable,"popper-class":c.value,"popper-style":u.value,teleported:t.teleported,"append-to":t.appendTo,persistent:t.persistent,"gpu-acceleration":d.value,"onUpdate:visible":o.value,onBeforeShow:h,onBeforeHide:m,onShow:g,onHide:v}),{content:ce(()=>[t.title?(B(),Q("div",{key:0,class:$(w(s).e("title")),role:"title"},We(t.title),3)):ve("v-if",!0),we(p.$slots,"default",{},()=>[dt(We(t.content),1)])]),default:ce(()=>[p.$slots.reference?we(p.$slots,"reference",{key:0}):ve("v-if",!0)]),_:3},16,["trigger","trigger-keys","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","append-to","persistent","gpu-acceleration","onUpdate:visible"]))}});const MN=(t,e)=>{const n=e.arg||e.value,i=n?.popperRef;i&&(i.triggerRef=t)};var k_e={mounted(t,e){MN(t,e)},updated(t,e){MN(t,e)}};const T_e="popover",E_e=Xce(k_e,T_e),x_e=sn(S_e,{directive:E_e}),A_e=qe({type:{type:String,default:"line",values:["line","circle","dashboard"]},percentage:{type:Number,default:0,validator:t=>t>=0&&t<=100},status:{type:String,default:"",values:["","success","exception","warning"]},indeterminate:Boolean,duration:{type:Number,default:3},strokeWidth:{type:Number,default:6},strokeLinecap:{type:me(String),default:"round"},textInside:Boolean,width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:me([String,Array,Function]),default:""},striped:Boolean,stripedFlow:Boolean,format:{type:me(Function),default:t=>`${t}%`}}),P_e=["aria-valuenow"],I_e={viewBox:"0 0 100 100"},R_e=["d","stroke","stroke-linecap","stroke-width"],M_e=["d","stroke","opacity","stroke-linecap","stroke-width"],O_e={key:0};var L_e=le({name:"ElProgress",__name:"progress",props:A_e,setup(t){const e={success:"#13ce66",exception:"#ff4949",warning:"#e6a23c",default:"#20a0ff"},n=t,i=De("progress"),r=M(()=>{const y={width:`${n.percentage}%`,animationDuration:`${n.duration}s`},_=b(n.percentage);return _.includes("gradient")?y.background=_:y.backgroundColor=_,y}),o=M(()=>(n.strokeWidth/n.width*100).toFixed(1)),s=M(()=>["circle","dashboard"].includes(n.type)?Number.parseInt(`${50-Number.parseFloat(o.value)/2}`,10):0),a=M(()=>{const y=s.value,_=n.type==="dashboard";return` + M 50 50 + m 0 ${_?"":"-"}${y} + a ${y} ${y} 0 1 1 0 ${_?"-":""}${y*2} + a ${y} ${y} 0 1 1 0 ${_?"":"-"}${y*2} + `}),l=M(()=>2*Math.PI*s.value),u=M(()=>n.type==="dashboard"?.75:1),c=M(()=>`${-1*l.value*(1-u.value)/2}px`),d=M(()=>({strokeDasharray:`${l.value*u.value}px, ${l.value}px`,strokeDashoffset:c.value})),f=M(()=>({strokeDasharray:`${l.value*u.value*(n.percentage/100)}px, ${l.value}px`,strokeDashoffset:c.value,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"})),h=M(()=>{let y;return n.color?y=b(n.percentage):y=e[n.status]||e.default,y}),m=M(()=>n.status==="warning"?lR:n.type==="line"?n.status==="success"?DC:Nf:n.status==="success"?LC:cl),g=M(()=>n.type==="line"?12+n.strokeWidth*.4:n.width*.111111+2),v=M(()=>n.format(n.percentage));function p(y){const _=100/y.length;return y.map((S,k)=>ot(S)?{color:S,percentage:(k+1)*_}:S).sort((S,k)=>S.percentage-k.percentage)}const b=y=>{var _;const{color:C}=n;if(Xe(C))return C(y);if(ot(C))return C;{const S=p(C);for(const k of S)if(k.percentage>y)return k.color;return(_=S[S.length-1])==null?void 0:_.color}};return(y,_)=>(B(),Q("div",{class:$([w(i).b(),w(i).m(t.type),w(i).is(t.status),{[w(i).m("without-text")]:!t.showText,[w(i).m("text-inside")]:t.textInside}]),role:"progressbar","aria-valuenow":t.percentage,"aria-valuemin":"0","aria-valuemax":"100"},[t.type==="line"?(B(),Q("div",{key:0,class:$(w(i).b("bar"))},[ie("div",{class:$(w(i).be("bar","outer")),style:mt({height:`${t.strokeWidth}px`})},[ie("div",{class:$([w(i).be("bar","inner"),{[w(i).bem("bar","inner","indeterminate")]:t.indeterminate},{[w(i).bem("bar","inner","striped")]:t.striped},{[w(i).bem("bar","inner","striped-flow")]:t.stripedFlow}]),style:mt(r.value)},[(t.showText||y.$slots.default)&&t.textInside?(B(),Q("div",{key:0,class:$(w(i).be("bar","innerText"))},[we(y.$slots,"default",{percentage:t.percentage},()=>[ie("span",null,We(v.value),1)])],2)):ve("v-if",!0)],6)],6)],2)):(B(),Q("div",{key:1,class:$(w(i).b("circle")),style:mt({height:`${t.width}px`,width:`${t.width}px`})},[(B(),Q("svg",I_e,[ie("path",{class:$(w(i).be("circle","track")),d:a.value,stroke:`var(${w(i).cssVarName("fill-color-light")}, #e5e9f2)`,"stroke-linecap":t.strokeLinecap,"stroke-width":o.value,fill:"none",style:mt(d.value)},null,14,R_e),ie("path",{class:$(w(i).be("circle","path")),d:a.value,stroke:h.value,fill:"none",opacity:t.percentage?1:0,"stroke-linecap":t.strokeLinecap,"stroke-width":o.value,style:mt(f.value)},null,14,M_e)]))],6)),(t.showText||y.$slots.default)&&!t.textInside?(B(),Q("div",{key:2,class:$(w(i).e("text")),style:mt({fontSize:`${g.value}px`})},[we(y.$slots,"default",{percentage:t.percentage},()=>[t.status?(B(),_e(w(He),{key:1},{default:ce(()=>[(B(),_e(Gt(m.value)))]),_:1})):(B(),Q("span",O_e,We(v.value),1))])],6)):ve("v-if",!0)],10,P_e))}});const D_e=sn(L_e),N_e="horizontal",B_e=({atEndEdge:t,atStartEdge:e,layout:n},i)=>{let r,o=0;const s=l=>l<0&&e.value||l>0&&t.value;return{hasReachedEdge:s,onWheel:l=>{Jce(r);let{deltaX:u,deltaY:c}=l;l.shiftKey&&c!==0&&(u=c,c=0);const d=n.value===N_e?u:c;s(d)||(o+=d,!IU()&&d!==0&&l.preventDefault(),r=oR(()=>{i(o),o=0}))}}},gq=Symbol("sliderContextKey"),V_e=qe({modelValue:{type:me([Number,Array]),default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:$r,inputSize:$r,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:me(Function),default:void 0},disabled:{type:Boolean,default:void 0},range:Boolean,vertical:Boolean,height:String,rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:me(Function),default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:xu,default:"top"},marks:{type:me(Object)},validateEvent:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},...hs(["ariaLabel"])}),Dk=t=>St(t)||Pe(t)&&t.every(St),F_e={[It]:Dk,[rs]:Dk,[En]:Dk},$_e=qe({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:xu,default:"top"}}),z_e={[It]:t=>St(t)},H_e=(t,e,n)=>{const i=H(),r=H(!1),o=M(()=>e.value instanceof Function),s=M(()=>o.value&&e.value(t.modelValue)||t.modelValue),a=ul(()=>{n.value&&(r.value=!0)},50),l=ul(()=>{n.value&&(r.value=!1)},50);return{tooltip:i,tooltipVisible:r,formatValue:s,displayTooltip:a,hideTooltip:l}},U_e=(t,e,n)=>{const{disabled:i,min:r,max:o,step:s,showTooltip:a,persistent:l,precision:u,sliderSize:c,formatTooltip:d,emitChange:f,resetSize:h,updateDragging:m}=Ne(gq),{tooltip:g,tooltipVisible:v,formatValue:p,displayTooltip:b,hideTooltip:y}=H_e(t,d,a),_=H(),C=M(()=>`${(t.modelValue-r.value)/(o.value-r.value)*100}%`),S=M(()=>t.vertical?{bottom:C.value}:{left:C.value}),k=()=>{e.hovering=!0,b()},T=()=>{e.hovering=!1,e.dragging||y()},E=W=>{i.value||(W.preventDefault(),N(W),window.addEventListener("mousemove",F),window.addEventListener("touchmove",F),window.addEventListener("mouseup",j),window.addEventListener("touchend",j),window.addEventListener("contextmenu",j),_.value.focus())},x=W=>{i.value||(e.newPosition=Number.parseFloat(C.value)+W/(o.value-r.value)*100,U(e.newPosition),f())},P=()=>{x(-s.value)},A=()=>{x(s.value)},I=()=>{x(-s.value*4)},D=()=>{x(s.value*4)},q=()=>{i.value||(U(0),f())},z=()=>{i.value||(U(100),f())},R=W=>{const J=Bn(W);let ne=!0;switch(J){case Me.left:case Me.down:P();break;case Me.right:case Me.up:A();break;case Me.home:q();break;case Me.end:z();break;case Me.pageDown:I();break;case Me.pageUp:D();break;default:ne=!1;break}ne&&W.preventDefault()},O=W=>{let J,ne;return W.type.startsWith("touch")?(ne=W.touches[0].clientY,J=W.touches[0].clientX):(ne=W.clientY,J=W.clientX),{clientX:J,clientY:ne}},N=W=>{e.dragging=!0,e.isClick=!0;const{clientX:J,clientY:ne}=O(W);t.vertical?e.startY=ne:e.startX=J,e.startPosition=Number.parseFloat(C.value),e.newPosition=e.startPosition},F=W=>{if(e.dragging){e.isClick=!1,b(),h();let J;const{clientX:ne,clientY:he}=O(W);t.vertical?(e.currentY=he,J=(e.startY-e.currentY)/c.value*100):(e.currentX=ne,J=(e.currentX-e.startX)/c.value*100),e.newPosition=e.startPosition+J,U(e.newPosition)}},j=()=>{e.dragging&&(setTimeout(()=>{e.dragging=!1,e.hovering||y(),e.isClick||U(e.newPosition),f()},0),window.removeEventListener("mousemove",F),window.removeEventListener("touchmove",F),window.removeEventListener("mouseup",j),window.removeEventListener("touchend",j),window.removeEventListener("contextmenu",j))},U=async W=>{if(W===null||Number.isNaN(+W))return;W=GI(W,0,100);const J=Math.floor((o.value-r.value)/s.value),ne=J*s.value/(o.value-r.value)*100,he=ne+(100-ne)/2;let X;if(We.dragging,W=>{m(W)}),Kn(_,"touchstart",E,{passive:!1}),{disabled:i,button:_,tooltip:g,tooltipVisible:v,showTooltip:a,persistent:l,wrapperStyle:S,formatValue:p,handleMouseEnter:k,handleMouseLeave:T,onButtonDown:E,onKeyDown:R,setPosition:U}},W_e=["tabindex"];var ON=le({name:"ElSliderButton",__name:"button",props:$_e,emits:z_e,setup(t,{expose:e,emit:n}){const i=t,r=n,o=De("slider"),s=on({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:i.modelValue}),a=M(()=>d.value?f.value:!1),{disabled:l,button:u,tooltip:c,showTooltip:d,persistent:f,tooltipVisible:h,wrapperStyle:m,formatValue:g,handleMouseEnter:v,handleMouseLeave:p,onButtonDown:b,onKeyDown:y,setPosition:_}=U_e(i,s,r),{hovering:C,dragging:S}=Sr(s);return e({onButtonDown:b,onKeyDown:y,setPosition:_,hovering:C,dragging:S}),(k,T)=>(B(),Q("div",{ref_key:"button",ref:u,class:$([w(o).e("button-wrapper"),{hover:w(C),dragging:w(S)}]),style:mt(w(m)),tabindex:w(l)?void 0:0,onMouseenter:T[0]||(T[0]=(...E)=>w(v)&&w(v)(...E)),onMouseleave:T[1]||(T[1]=(...E)=>w(p)&&w(p)(...E)),onMousedown:T[2]||(T[2]=(...E)=>w(b)&&w(b)(...E)),onFocus:T[3]||(T[3]=(...E)=>w(v)&&w(v)(...E)),onBlur:T[4]||(T[4]=(...E)=>w(p)&&w(p)(...E)),onKeydown:T[5]||(T[5]=(...E)=>w(y)&&w(y)(...E))},[L(w(Lo),{ref_key:"tooltip",ref:c,visible:w(h),placement:k.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":k.tooltipClass,disabled:!w(d),persistent:a.value},{content:ce(()=>[ie("span",null,We(w(g)),1)]),default:ce(()=>[ie("div",{class:$([w(o).e("button"),{hover:w(C),dragging:w(S)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled","persistent"])],46,W_e))}});const q_e=qe({mark:{type:me([String,Object]),default:void 0}});var j_e=le({name:"ElSliderMarker",props:q_e,setup(t){const e=De("slider"),n=M(()=>ot(t.mark)?t.mark:t.mark.label),i=M(()=>ot(t.mark)?void 0:t.mark.style);return()=>nt("div",{class:e.e("marks-text"),style:i.value},n.value)}});const K_e=(t,e,n)=>{const{formItem:i}=lo(),r=bi(),o=H(),s=H(),a={firstButton:o,secondButton:s},l=Oi(),u=M(()=>Math.min(e.firstValue,e.secondValue)),c=M(()=>Math.max(e.firstValue,e.secondValue)),d=M(()=>t.range?`${100*(c.value-u.value)/(t.max-t.min)}%`:`${100*(e.firstValue-t.min)/(t.max-t.min)}%`),f=M(()=>t.range?`${100*(u.value-t.min)/(t.max-t.min)}%`:"0%"),h=M(()=>t.vertical?{height:t.height}:{}),m=M(()=>t.vertical?{height:d.value,bottom:f.value}:{width:d.value,left:f.value}),g=()=>{if(r.value){const P=r.value.getBoundingClientRect();e.sliderSize=P[t.vertical?"height":"width"]}},v=P=>{const A=t.min+P*(t.max-t.min)/100;if(!t.range)return o;let I;return Math.abs(u.value-A)e.secondValue?"firstButton":"secondButton",a[I]},p=P=>{const A=v(P);return A.value.setPosition(P),A},b=P=>{e.firstValue=P??t.min,_(t.range?[u.value,c.value]:P??t.min)},y=P=>{e.secondValue=P,t.range&&_([u.value,c.value])},_=P=>{n(It,P),n(rs,P)},C=async()=>{await Ye(),n(En,t.range?[u.value,c.value]:t.modelValue)},S=P=>{var A,I,D,q,z,R;if(l.value||e.dragging)return;g();let O=0;if(t.vertical){const N=(D=(I=(A=P.touches)==null?void 0:A.item(0))==null?void 0:I.clientY)!=null?D:P.clientY;O=(r.value.getBoundingClientRect().bottom-N)/e.sliderSize*100}else{const N=(R=(z=(q=P.touches)==null?void 0:q.item(0))==null?void 0:z.clientX)!=null?R:P.clientX,F=r.value.getBoundingClientRect().left;O=(N-F)/e.sliderSize*100}if(!(O<0||O>100))return p(O)};return{elFormItem:i,slider:r,firstButton:o,secondButton:s,sliderDisabled:l,minValue:u,maxValue:c,runwayStyle:h,barStyle:m,resetSize:g,setPosition:p,emitChange:C,onSliderWrapperPrevent:P=>{var A,I;((A=a.firstButton.value)!=null&&A.dragging||(I=a.secondButton.value)!=null&&I.dragging)&&P.preventDefault()},onSliderClick:P=>{S(P)&&C()},onSliderDown:async P=>{const A=S(P);A&&(await Ye(),A.value.onButtonDown(P))},onSliderMarkerDown:P=>{if(l.value||e.dragging)return;p(P)&&C()},setFirstValue:b,setSecondValue:y}},G_e=(t,e,n,i)=>({stops:M(()=>{if(!t.showStops||t.min>t.max)return[];if(t.step===0)return[];const s=Math.ceil((t.max-t.min)/t.step),a=100*t.step/(t.max-t.min),l=Array.from({length:s-1}).map((u,c)=>(c+1)*a);return t.range?l.filter(u=>u<100*(n.value-t.min)/(t.max-t.min)||u>100*(i.value-t.min)/(t.max-t.min)):l.filter(u=>u>100*(e.firstValue-t.min)/(t.max-t.min))}),getStopStyle:s=>t.vertical?{bottom:`${s}%`}:{left:`${s}%`}}),Y_e=t=>M(()=>t.marks?Object.keys(t.marks).map(Number.parseFloat).sort((n,i)=>n-i).filter(n=>n<=t.max&&n>=t.min).map(n=>({point:n,position:(n-t.min)*100/(t.max-t.min),mark:t.marks[n]})):[]),X_e=(t,e,n,i,r,o)=>{const s=u=>{r(It,u),r(rs,u)},a=()=>t.range?![n.value,i.value].every((u,c)=>u===e.oldValue[c]):t.modelValue!==e.oldValue,l=()=>{var u,c;t.min>t.max&&dr("Slider","min should not be greater than max.");const d=t.modelValue;t.range&&Pe(d)?d[1]t.max?s([t.max,t.max]):d[0]t.max?s([d[0],t.max]):(e.firstValue=d[0],e.secondValue=d[1],a()&&(t.validateEvent&&((u=o?.validate)==null||u.call(o,"change").catch(f=>void 0)),e.oldValue=d.slice())):!t.range&&St(d)&&!Number.isNaN(d)&&(dt.max?s(t.max):(e.firstValue=d,a()&&(t.validateEvent&&((c=o?.validate)==null||c.call(o,"change").catch(f=>void 0)),e.oldValue=d)))};l(),Se(()=>e.dragging,u=>{u||l()}),Se(()=>t.modelValue,(u,c)=>{e.dragging||Pe(u)&&Pe(c)&&u.every((d,f)=>d===c[f])&&e.firstValue===u[0]&&e.secondValue===u[1]||l()},{deep:!0}),Se(()=>[t.min,t.max],()=>{l()})},J_e=(t,e,n)=>{const i=H();return Pt(async()=>{t.range?(Pe(t.modelValue)?(e.firstValue=Math.max(t.min,t.modelValue[0]),e.secondValue=Math.min(t.max,t.modelValue[1])):(e.firstValue=t.min,e.secondValue=t.max),e.oldValue=[e.firstValue,e.secondValue]):(!St(t.modelValue)||Number.isNaN(t.modelValue)?e.firstValue=t.min:e.firstValue=Math.min(t.max,Math.max(t.min,t.modelValue)),e.oldValue=e.firstValue),Kn(window,"resize",n),await Ye(),n()}),{sliderWrapper:i}},Z_e=["id","role","aria-label","aria-labelledby"],Q_e={key:1};var e1e=le({name:"ElSlider",__name:"slider",props:V_e,emits:F_e,setup(t,{expose:e,emit:n}){const i=t,r=n,o=De("slider"),{t:s}=Qt(),a=on({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:l,slider:u,firstButton:c,secondButton:d,sliderDisabled:f,minValue:h,maxValue:m,runwayStyle:g,barStyle:v,resetSize:p,emitChange:b,onSliderWrapperPrevent:y,onSliderClick:_,onSliderDown:C,onSliderMarkerDown:S,setFirstValue:k,setSecondValue:T}=K_e(i,a,r),{stops:E,getStopStyle:x}=G_e(i,a,h,m),{inputId:P,isLabeledByFormItem:A}=Au(i,{formItemContext:l}),I=fr(),D=M(()=>i.inputSize||I.value),q=M(()=>i.ariaLabel||s("el.slider.defaultLabel",{min:i.min,max:i.max})),z=M(()=>i.range?i.rangeStartLabel||s("el.slider.defaultRangeStartLabel"):q.value),R=M(()=>i.formatValueText?i.formatValueText(J.value):`${J.value}`),O=M(()=>i.rangeEndLabel||s("el.slider.defaultRangeEndLabel")),N=M(()=>i.formatValueText?i.formatValueText(ne.value):`${ne.value}`),F=M(()=>[o.b(),o.m(I.value),o.is("vertical",i.vertical),{[o.m("with-input")]:i.showInput}]),j=Y_e(i);X_e(i,a,h,m,r,l);const U=M(()=>{const se=[i.min,i.max,i.step].map(re=>{const ee=`${re}`.split(".")[1];return ee?ee.length:0});return Math.max.apply(null,se)}),{sliderWrapper:W}=J_e(i,a,p),{firstValue:J,secondValue:ne,sliderSize:he}=Sr(a),X=se=>{a.dragging=se};return Kn(W,"touchstart",y,{passive:!1}),Kn(W,"touchmove",y,{passive:!1}),qt(gq,{...Sr(i),sliderSize:he,disabled:f,precision:U,emitChange:b,resetSize:p,updateDragging:X}),e({onSliderClick:_}),(se,re)=>{var ee,te;return B(),Q("div",{id:se.range?w(P):void 0,ref_key:"sliderWrapper",ref:W,class:$(F.value),role:se.range?"group":void 0,"aria-label":se.range&&!w(A)?q.value:void 0,"aria-labelledby":se.range&&w(A)?(ee=w(l))==null?void 0:ee.labelId:void 0},[ie("div",{ref_key:"slider",ref:u,class:$([w(o).e("runway"),{"show-input":se.showInput&&!se.range},w(o).is("disabled",w(f))]),style:mt(w(g)),onMousedown:re[0]||(re[0]=(...V)=>w(C)&&w(C)(...V)),onTouchstartPassive:re[1]||(re[1]=(...V)=>w(C)&&w(C)(...V))},[ie("div",{class:$(w(o).e("bar")),style:mt(w(v))},null,6),L(ON,{id:se.range?void 0:w(P),ref_key:"firstButton",ref:c,"model-value":w(J),vertical:se.vertical,"tooltip-class":se.tooltipClass,placement:se.placement,role:"slider","aria-label":se.range||!w(A)?z.value:void 0,"aria-labelledby":!se.range&&w(A)?(te=w(l))==null?void 0:te.labelId:void 0,"aria-valuemin":se.min,"aria-valuemax":se.range?w(ne):se.max,"aria-valuenow":w(J),"aria-valuetext":R.value,"aria-orientation":se.vertical?"vertical":"horizontal","aria-disabled":w(f),"onUpdate:modelValue":w(k)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),se.range?(B(),_e(ON,{key:0,ref_key:"secondButton",ref:d,"model-value":w(ne),vertical:se.vertical,"tooltip-class":se.tooltipClass,placement:se.placement,role:"slider","aria-label":O.value,"aria-valuemin":w(J),"aria-valuemax":se.max,"aria-valuenow":w(ne),"aria-valuetext":N.value,"aria-orientation":se.vertical?"vertical":"horizontal","aria-disabled":w(f),"onUpdate:modelValue":w(T)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):ve("v-if",!0),se.showStops?(B(),Q("div",Q_e,[(B(!0),Q(rt,null,gn(w(E),(V,K)=>(B(),Q("div",{key:K,class:$(w(o).e("stop")),style:mt(w(x)(V))},null,6))),128))])):ve("v-if",!0),w(j).length>0?(B(),Q(rt,{key:2},[ie("div",null,[(B(!0),Q(rt,null,gn(w(j),(V,K)=>(B(),Q("div",{key:K,style:mt(w(x)(V.position)),class:$([w(o).e("stop"),w(o).e("marks-stop")])},null,6))),128))]),ie("div",{class:$(w(o).e("marks"))},[(B(!0),Q(rt,null,gn(w(j),(V,K)=>(B(),_e(w(j_e),{key:K,mark:V.mark,style:mt(w(x)(V.position)),onMousedown:Ot(G=>w(S)(V.position),["stop"])},null,8,["mark","style","onMousedown"]))),128))],2)],64)):ve("v-if",!0)],38),se.showInput&&!se.range?(B(),_e(w(uq),{key:0,ref:"input","model-value":w(J),class:$(w(o).e("input")),step:se.step,disabled:w(f),controls:se.showInputControls,min:se.min,max:se.max,precision:U.value,size:D.value,"onUpdate:modelValue":w(k),onChange:w(b)},null,8,["model-value","class","step","disabled","controls","min","max","precision","size","onUpdate:modelValue","onChange"])):ve("v-if",!0)],10,Z_e)}}});const t1e=sn(e1e),pq=t=>["",...yl].includes(t),n1e=qe({modelValue:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:void 0},loading:Boolean,size:{type:String,validator:pq},width:{type:[String,Number],default:""},inlinePrompt:Boolean,inactiveActionIcon:{type:ri},activeActionIcon:{type:ri},activeIcon:{type:ri},inactiveIcon:{type:ri},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},beforeChange:{type:me(Function)},id:String,tabindex:{type:[String,Number]},...hs(["ariaLabel"])}),i1e={[It]:t=>vi(t)||ot(t)||St(t),[En]:t=>vi(t)||ot(t)||St(t),[rs]:t=>vi(t)||ot(t)||St(t)},r1e=["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex"],o1e=["aria-hidden"],s1e={key:1},a1e={key:1},l1e=["aria-hidden"],LN="ElSwitch";var u1e=le({name:LN,__name:"switch",props:n1e,emits:i1e,setup(t,{expose:e,emit:n}){const i=t,r=n,{formItem:o}=lo(),s=fr(),a=De("switch"),{inputId:l}=Au(i,{formItemContext:o}),u=Oi(M(()=>{if(i.loading)return!0})),c=H(i.modelValue!==!1),d=bi(),f=M(()=>[a.b(),a.m(s.value),a.is("disabled",u.value),a.is("checked",p.value)]),h=M(()=>[a.e("label"),a.em("label","left"),a.is("active",!p.value)]),m=M(()=>[a.e("label"),a.em("label","right"),a.is("active",p.value)]),g=M(()=>({width:zr(i.width)}));Se(()=>i.modelValue,()=>{c.value=!0});const v=M(()=>c.value?i.modelValue:!1),p=M(()=>v.value===i.activeValue);[i.activeValue,i.inactiveValue].includes(v.value)||(r(It,i.inactiveValue),r(En,i.inactiveValue),r(rs,i.inactiveValue)),Se(p,C=>{var S;d.value.checked=C,i.validateEvent&&((S=o?.validate)==null||S.call(o,"change").catch(k=>void 0))});const b=()=>{const C=p.value?i.inactiveValue:i.activeValue;r(It,C),r(En,C),r(rs,C),Ye(()=>{d.value.checked=p.value})},y=()=>{if(u.value)return;const{beforeChange:C}=i;if(!C){b();return}const S=C();[_v(S),vi(S)].includes(!0)||dr(LN,"beforeChange must return type `Promise` or `boolean`"),_v(S)?S.then(T=>{T&&b()}).catch(T=>{}):S&&b()},_=()=>{var C,S;(S=(C=d.value)==null?void 0:C.focus)==null||S.call(C)};return Pt(()=>{d.value.checked=p.value}),e({focus:_,checked:p}),(C,S)=>(B(),Q("div",{class:$(f.value),onClick:Ot(y,["prevent"])},[ie("input",{id:w(l),ref_key:"input",ref:d,class:$(w(a).e("input")),type:"checkbox",role:"switch","aria-checked":p.value,"aria-disabled":w(u),"aria-label":t.ariaLabel,name:t.name,"true-value":t.activeValue,"false-value":t.inactiveValue,disabled:w(u),tabindex:t.tabindex,onChange:b,onKeydown:Pi(y,["enter"])},null,42,r1e),!t.inlinePrompt&&(t.inactiveIcon||t.inactiveText||C.$slots.inactive)?(B(),Q("span",{key:0,class:$(h.value)},[we(C.$slots,"inactive",{},()=>[t.inactiveIcon?(B(),_e(w(He),{key:0},{default:ce(()=>[(B(),_e(Gt(t.inactiveIcon)))]),_:1})):ve("v-if",!0),!t.inactiveIcon&&t.inactiveText?(B(),Q("span",{key:1,"aria-hidden":p.value},We(t.inactiveText),9,o1e)):ve("v-if",!0)])],2)):ve("v-if",!0),ie("span",{class:$(w(a).e("core")),style:mt(g.value)},[t.inlinePrompt?(B(),Q("div",{key:0,class:$(w(a).e("inner"))},[p.value?(B(),Q("div",{key:1,class:$(w(a).e("inner-wrapper"))},[we(C.$slots,"active",{},()=>[t.activeIcon?(B(),_e(w(He),{key:0},{default:ce(()=>[(B(),_e(Gt(t.activeIcon)))]),_:1})):ve("v-if",!0),!t.activeIcon&&t.activeText?(B(),Q("span",a1e,We(t.activeText),1)):ve("v-if",!0)])],2)):(B(),Q("div",{key:0,class:$(w(a).e("inner-wrapper"))},[we(C.$slots,"inactive",{},()=>[t.inactiveIcon?(B(),_e(w(He),{key:0},{default:ce(()=>[(B(),_e(Gt(t.inactiveIcon)))]),_:1})):ve("v-if",!0),!t.inactiveIcon&&t.inactiveText?(B(),Q("span",s1e,We(t.inactiveText),1)):ve("v-if",!0)])],2))],2)):ve("v-if",!0),ie("div",{class:$(w(a).e("action"))},[t.loading?(B(),_e(w(He),{key:0,class:$(w(a).is("loading"))},{default:ce(()=>[L(w(xc))]),_:1},8,["class"])):p.value?we(C.$slots,"active-action",{key:1},()=>[t.activeActionIcon?(B(),_e(w(He),{key:0},{default:ce(()=>[(B(),_e(Gt(t.activeActionIcon)))]),_:1})):ve("v-if",!0)]):p.value?ve("v-if",!0):we(C.$slots,"inactive-action",{key:2},()=>[t.inactiveActionIcon?(B(),_e(w(He),{key:0},{default:ce(()=>[(B(),_e(Gt(t.inactiveActionIcon)))]),_:1})):ve("v-if",!0)])],2)],6),!t.inlinePrompt&&(t.activeIcon||t.activeText||C.$slots.active)?(B(),Q("span",{key:1,class:$(m.value)},[we(C.$slots,"active",{},()=>[t.activeIcon?(B(),_e(w(He),{key:0},{default:ce(()=>[(B(),_e(Gt(t.activeIcon)))]),_:1})):ve("v-if",!0),!t.activeIcon&&t.activeText?(B(),Q("span",{key:1,"aria-hidden":!p.value},We(t.activeText),9,l1e)):ve("v-if",!0)])],2)):ve("v-if",!0)],2))}});const vq=sn(u1e),Nk=function(t){var e;return(e=t.target)==null?void 0:e.closest("td")},c1e=function(t,e,n,i,r){if(!e&&!i&&(!r||Pe(r)&&!r.length))return t;ot(n)?n=n==="descending"?-1:1:n=n&&n<0?-1:1;const o=i?null:function(a,l){return r?qH(Co(r),u=>ot(u)?to(a,u):u(a,l,t)):(e!=="$key"&&_t(a)&&"$value"in a&&(a=a.$value),[_t(a)?e?to(a,e):null:a])},s=function(a,l){var u,c,d,f,h,m;if(i)return i(a.value,l.value);for(let g=0,v=(c=(u=a.key)==null?void 0:u.length)!=null?c:0;g((m=l.key)==null?void 0:m[g]))return 1}return 0};return t.map((a,l)=>({value:a,index:l,key:o?o(a,l):null})).sort((a,l)=>{let u=s(a,l);return u||(u=a.index-l.index),u*+n}).map(a=>a.value)},bq=function(t,e){let n=null;return t.columns.forEach(i=>{i.id===e&&(n=i)}),n},d1e=function(t,e){let n=null;for(let i=0;i{if(!t)throw new Error("Row is required when get row identity");if(ot(e)){if(!e.includes("."))return`${t[e]}`;const n=e.split(".");let i=t;for(const r of n)i=i[r];return`${i}`}else if(Xe(e))return e.call(null,t);return""},um=function(t,e,n=!1,i="children"){const r=t||[],o={};return r.forEach((s,a)=>{if(o[vr(s,e)]={row:s,index:a},n){const l=s[i];Pe(l)&&Object.assign(o,um(l,e,!0,i))}}),o};function f1e(t,e){const n={};let i;for(i in t)n[i]=t[i];for(i in e)if(Jt(e,i)){const r=e[i];pn(r)||(n[i]=r)}return n}function WR(t){return t===""||pn(t)||(t=Number.parseInt(t,10),Number.isNaN(t)&&(t="")),t}function yq(t){return t===""||pn(t)||(t=WR(t),Number.isNaN(t)&&(t=80)),t}function h1e(t){return St(t)?t:ot(t)?/^\d+(?:px)?$/.test(t)?Number.parseInt(t,10):t:null}function m1e(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,n)=>(...i)=>e(n(...i)))}function Y_(t,e,n,i,r,o,s){let a=o??0,l=!1;const c=(()=>{if(!s)return t.indexOf(e);const g=vr(e,s);return t.findIndex(v=>vr(v,s)===g)})(),d=c!==-1,f=r?.call(null,e,a),h=g=>{g==="add"?t.push(e):t.splice(c,1),l=!0},m=g=>{let v=0;const p=i?.children&&g[i.children];return p&&Pe(p)&&(v+=p.length,p.forEach(b=>{v+=m(b)})),v};return(!r||f)&&(vi(n)?n&&!d?h("add"):!n&&d&&h("remove"):h(d?"remove":"add")),!i?.checkStrictly&&i?.children&&Pe(e[i.children])&&e[i.children].forEach(g=>{const v=Y_(t,g,n??!d,i,r,a+1,s);a+=m(g)+1,v&&(l=v)}),l}function g1e(t,e,n="children",i="hasChildren",r=!1){const o=a=>!(Pe(a)&&a.length);function s(a,l,u){e(a,l,u),l.forEach(c=>{if(c[i]&&r){e(c,null,u+1);return}const d=c[n];o(d)||s(c,d,u+1)})}t.forEach(a=>{if(a[i]&&r){e(a,null,0);return}const l=a[n];o(l)||s(a,l,0)})}const p1e=(t,e,n,i)=>{const r={strategy:"fixed",...t.popperOptions},o=Xe(i?.tooltipFormatter)?i.tooltipFormatter({row:n,column:i,cellValue:lm(n,i.property).value}):void 0;return yi(o)?{slotContent:o,content:null,...t,popperOptions:r}:{slotContent:null,content:o??e,...t,popperOptions:r}};let Rr=null;function v1e(t,e,n,i,r,o){var s;const a=p1e(t,e,n,i),l={...a,slotContent:void 0};if(Rr?.trigger===r){const m=(s=Rr.vm)==null?void 0:s.component;jH(m?.props,l),m&&a.slotContent&&(m.slots.content=()=>[a.slotContent]);return}Rr?.();const u=o?.refs.tableWrapper,c=u?.dataset.prefix,d=L(Lo,{virtualTriggering:!0,virtualRef:r,appendTo:u,placement:"top",transition:"none",offset:0,hideAfter:0,...l},a.slotContent?{content:()=>a.slotContent}:void 0);d.appContext={...o.appContext,...o};const f=document.createElement("div");Tm(d,f),d.component.exposed.onOpen();const h=u?.querySelector(`.${c}-scrollbar__wrap`);Rr=()=>{var m,g;(g=(m=d.component)==null?void 0:m.exposed)!=null&&g.onClose&&d.component.exposed.onClose(),Tm(null,f);const v=Rr;h?.removeEventListener("scroll",v),v.trigger=void 0,v.vm=void 0,Rr=null},Rr.trigger=r??void 0,Rr.vm=d,h?.addEventListener("scroll",Rr)}function wq(t){return t.children?qH(t.children,wq):[t]}function NN(t,e){return t+e.colSpan}const _q=(t,e,n,i)=>{let r=0,o=t;const s=n.states.columns.value;if(i){const l=wq(i[t]);r=s.slice(0,s.indexOf(l[0])).reduce(NN,0),o=r+l.reduce(NN,0)-1}else r=t;let a;switch(e){case"left":o=s.length-n.states.rightFixedLeafColumnsLength.value&&(a="right");break;default:o=s.length-n.states.rightFixedLeafColumnsLength.value&&(a="right")}return a?{direction:a,start:r,after:o}:{}},qR=(t,e,n,i,r,o=0)=>{const s=[],{direction:a,start:l,after:u}=_q(e,n,i,r);if(a){const c=a==="left";s.push(`${t}-fixed-column--${a}`),c&&u+o===i.states.fixedLeafColumnsLength.value-1?s.push("is-last-column"):!c&&l-o===i.states.columns.value.length-i.states.rightFixedLeafColumnsLength.value&&s.push("is-first-column")}return s};function BN(t,e){return t+(PC(e.realWidth)||Number.isNaN(e.realWidth)?Number(e.width):e.realWidth)}const jR=(t,e,n,i)=>{const{direction:r,start:o=0,after:s=0}=_q(t,e,n,i);if(!r)return;const a={},l=r==="left",u=n.states.columns.value;return l?a.left=u.slice(0,o).reduce(BN,0):a.right=u.slice(s+1).reverse().reduce(BN,0),a},Nm=(t,e)=>{t&&(Number.isNaN(t[e])||(t[e]=`${t[e]}px`))};function Cq(t){return t.some(e=>yi(e)?!(e.type===xi||e.type===rt&&!Cq(e.children)):!0)?t:null}function b1e(t){const e=Ct(),n=H(!1),i=H([]),r=(u,c)=>{var d;const f=e.store.states.rowExpandable.value;return(d=f?.(u,c))!=null?d:!0};return{updateExpandRows:()=>{const u=t.data.value||[],c=t.rowKey.value;if(n.value)i.value=e.store.states.rowExpandable.value?u.filter(r):u.slice();else if(c){const d=um(i.value,c);i.value=u.filter((f,h)=>{const m=vr(f,c);return!!d[m]&&r(f,h)})}else i.value=[]},toggleRowExpansion:(u,c)=>{const f=(t.data.value||[]).indexOf(u);if(f>-1&&!r(u,f))return;Y_(i.value,u,c,void 0,void 0,void 0,t.rowKey.value)&&e.emit("expand-change",u,i.value.slice())},setExpandRowKeys:u=>{e.store.assertRowKey();const c=t.data.value||[],d=t.rowKey.value,f=um(c,d);i.value=u.reduce((h,m)=>{const g=f[m];return g&&r(g.row,g.index)&&h.push(g.row),h},[])},isRowExpanded:u=>{const c=t.rowKey.value;return c?!!um(i.value,c)[vr(u,c)]:i.value.includes(u)},states:{expandRows:i,defaultExpandAll:n}}}function y1e(t){const e=Ct(),n=H(null),i=H(null),r=u=>{e.store.assertRowKey(),n.value=u,s(u)},o=()=>{n.value=null},s=u=>{var c;const{data:d,rowKey:f}=t,h=i.value;let m=null;f.value&&(m=(c=(w(d)||[]).find(g=>vr(g,f.value)===u))!=null?c:null),i.value=m??null,e.emit("current-change",i.value,h)};return{setCurrentRowKey:r,restoreCurrentRowKey:o,setCurrentRowByKey:s,updateCurrentRow:u=>{const c=i.value;if(u&&u!==c){i.value=u,e.emit("current-change",i.value,c);return}!u&&c&&(i.value=null,e.emit("current-change",null,c))},updateCurrentRowData:()=>{const u=t.rowKey.value,c=t.data.value||[],d=i.value;if(d&&!c.includes(d))if(u){const f=vr(d,u);s(f)}else i.value=null,e.emit("current-change",null,d);else n.value&&(s(n.value),o())},states:{_currentRowKey:n,currentRow:i}}}function w1e(t){const e=H([]),n=H({}),i=H(16),r=H(!1),o=H({}),s=H("hasChildren"),a=H("children"),l=H(!1),u=Ct(),c=M(()=>{if(!t.rowKey.value)return{};const _=t.data.value||[];return f(_)}),d=M(()=>{const _=t.rowKey.value,C=Object.keys(o.value),S={};return C.length&&C.forEach(k=>{if(o.value[k].length){const T={children:[]};o.value[k].forEach(E=>{const x=vr(E,_);T.children.push(x),E[s.value]&&!S[x]&&(S[x]={children:[]})}),S[k]=T}}),S}),f=_=>{const C=t.rowKey.value,S={};return g1e(_,(k,T,E)=>{const x=vr(k,C);Pe(T)?S[x]={children:T.map(P=>vr(P,C)),level:E}:r.value&&(S[x]={children:[],lazy:!0,level:E})},a.value,s.value,r.value),S},h=(_=!1,C)=>{var S,k;C||(C=(S=u.store)==null?void 0:S.states.defaultExpandAll.value);const T=c.value,E=d.value,x=Object.keys(T),P={};if(x.length){const A=w(n),I=[],D=(z,R)=>{if(_)return e.value?C||e.value.includes(R):!!(C||z?.expanded);{const O=C||e.value&&e.value.includes(R);return!!(z?.expanded||O)}};x.forEach(z=>{const R=A[z],O={...T[z]};if(O.expanded=D(R,z),O.lazy){const{loaded:N=!1,loading:F=!1}=R||{};O.loaded=!!N,O.loading=!!F,I.push(z)}P[z]=O});const q=Object.keys(E);r.value&&q.length&&I.length&&q.forEach(z=>{var R;const O=A[z],N=E[z].children;if(I.includes(z)){if(((R=P[z].children)==null?void 0:R.length)!==0)throw new Error("[ElTable]children must be an empty array.");P[z].children=N}else{const{loaded:F=!1,loading:j=!1}=O||{};P[z]={lazy:!0,loaded:!!F,loading:!!j,expanded:D(O,z),children:N,level:void 0}}})}n.value=P,(k=u.store)==null||k.updateTableScrollY()};Se(()=>e.value,()=>{h(!0)}),Se(()=>c.value,()=>{h()}),Se(()=>d.value,()=>{h()});const m=_=>{e.value=_,h()},g=_=>r.value&&_&&"loaded"in _&&!_.loaded,v=(_,C)=>{u.store.assertRowKey();const S=t.rowKey.value,k=vr(_,S),T=k&&n.value[k];if(k&&T&&"expanded"in T){const E=T.expanded;C=pn(C)?!T.expanded:C,n.value[k].expanded=C,E!==C&&u.emit("expand-change",_,C),C&&g(T)&&b(_,k,T),u.store.updateTableScrollY()}},p=_=>{u.store.assertRowKey();const C=t.rowKey.value,S=vr(_,C),k=n.value[S];g(k)?b(_,S,k):v(_,void 0)},b=(_,C,S)=>{const{load:k}=u.props;k&&!n.value[C].loaded&&(n.value[C].loading=!0,k(_,S,T=>{if(!Pe(T))throw new TypeError("[ElTable] data must be an array");n.value[C].loading=!1,n.value[C].loaded=!0,n.value[C].expanded=!0,T.length&&(o.value[C]=T),u.emit("expand-change",_,!0)}))};return{loadData:b,loadOrToggle:p,toggleTreeExpansion:v,updateTreeExpandKeys:m,updateTreeData:h,updateKeyChildren:(_,C)=>{const{lazy:S,rowKey:k}=u.props;if(S){if(!k)throw new Error("[Table] rowKey is required in updateKeyChild");o.value[_]&&(o.value[_]=C)}},normalize:f,states:{expandRowKeys:e,treeData:n,indent:i,lazy:r,lazyTreeNodeMap:o,lazyColumnIdentifier:s,childrenColumnName:a,checkStrictly:l}}}const _1e=(t,e)=>{const n=e.sortingColumn;return!n||ot(n.sortable)?t:c1e(t,e.sortProp,e.sortOrder,n.sortMethod,n.sortBy)},Vw=t=>{const e=[];return t.forEach(n=>{n.children&&n.children.length>0?e.push.apply(e,Vw(n.children)):e.push(n)}),e};function C1e(){var t;const e=Ct(),{size:n}=Sr((t=e.proxy)==null?void 0:t.$props),i=H(null),r=H([]),o=H([]),s=H(!1),a=H([]),l=H([]),u=H([]),c=H([]),d=H([]),f=H([]),h=H([]),m=H([]),g=[],v=H(0),p=H(0),b=H(0),y=H(!1),_=H([]),C=H(!1),S=H(!1),k=H(null),T=H(null),E=H({}),x=H(null),P=H(null),A=H(null),I=H(null),D=H(null),q=M(()=>i.value?um(_.value,i.value):void 0);Se(r,()=>{var Je;e.state&&(N(!1),e.props.tableLayout==="auto"&&((Je=e.refs.tableHeaderRef)==null||Je.updateFixedColumnStyle()))},{deep:!0});const z=()=>{if(!i.value)throw new Error("[ElTable] prop row-key is required")},R=Je=>{var kt;(kt=Je.children)==null||kt.forEach(Et=>{Et.fixed=Je.fixed,R(Et)})},O=()=>{a.value.forEach(Ve=>{R(Ve)}),c.value=a.value.filter(Ve=>[!0,"left"].includes(Ve.fixed));const Je=a.value.find(Ve=>Ve.type==="selection");let kt;Je&&Je.fixed!=="right"&&!c.value.includes(Je)&&a.value.indexOf(Je)===0&&c.value.length&&(c.value.unshift(Je),kt=!0),d.value=a.value.filter(Ve=>Ve.fixed==="right");const Et=a.value.filter(Ve=>(kt?Ve.type!=="selection":!0)&&!Ve.fixed);l.value=Array.from(c.value).concat(Et).concat(d.value);const ge=Vw(Et),Le=Vw(c.value),de=Vw(d.value);v.value=ge.length,p.value=Le.length,b.value=de.length,u.value=Array.from(Le).concat(ge).concat(de),s.value=c.value.length>0||d.value.length>0},N=(Je,kt=!1)=>{Je&&O(),kt?e.state.doLayout():e.state.debouncedUpdateLayout()},F=Je=>q.value?!!q.value[vr(Je,i.value)]:_.value.includes(Je),j=()=>{y.value=!1;const Je=_.value;_.value=[],Je.length&&e.emit("selection-change",[])},U=()=>{var Je,kt;let Et;if(i.value){Et=[];const ge=(kt=(Je=e?.store)==null?void 0:Je.states)==null?void 0:kt.childrenColumnName.value,Le=um(r.value,i.value,!0,ge);for(const de in q.value)Jt(q.value,de)&&!Le[de]&&Et.push(q.value[de].row)}else Et=_.value.filter(ge=>!r.value.includes(ge));if(Et.length){const ge=_.value.filter(Le=>!Et.includes(Le));_.value=ge,e.emit("selection-change",ge.slice())}},W=()=>(_.value||[]).slice(),J=(Je,kt,Et=!0,ge=!1)=>{var Le,de,Ve,gt;const an={children:(de=(Le=e?.store)==null?void 0:Le.states)==null?void 0:de.childrenColumnName.value,checkStrictly:(gt=(Ve=e?.store)==null?void 0:Ve.states)==null?void 0:gt.checkStrictly.value};if(Y_(_.value,Je,kt,an,ge?void 0:k.value,r.value.indexOf(Je),i.value)){const uo=(_.value||[]).slice();Et&&e.emit("select",uo,Je),e.emit("selection-change",uo)}},ne=()=>{var Je,kt;const Et=S.value?!y.value:!(y.value||_.value.length);y.value=Et;let ge=!1,Le=0;const de=(kt=(Je=e?.store)==null?void 0:Je.states)==null?void 0:kt.rowKey.value,{childrenColumnName:Ve}=e.store.states,gt={children:Ve.value,checkStrictly:!1};r.value.forEach((an,Si)=>{const uo=Si+Le;Y_(_.value,an,Et,gt,k.value,uo,de)&&(ge=!0),Le+=X(vr(an,de))}),ge&&e.emit("selection-change",_.value?_.value.slice():[]),e.emit("select-all",(_.value||[]).slice())},he=()=>{var Je;if(((Je=r.value)==null?void 0:Je.length)===0){y.value=!1;return}const{childrenColumnName:kt}=e.store.states;let Et=0,ge=0;const Le=Ve=>{var gt;for(const an of Ve){const Si=k.value&&k.value.call(null,an,Et);if(F(an))ge++;else if(!k.value||Si)return!1;if(Et++,(gt=an[kt.value])!=null&>.length&&!Le(an[kt.value]))return!1}return!0},de=Le(r.value||[]);y.value=ge===0?!1:de},X=Je=>{var kt;if(!e||!e.store)return 0;const{treeData:Et}=e.store.states;let ge=0;const Le=(kt=Et.value[Je])==null?void 0:kt.children;return Le&&(ge+=Le.length,Le.forEach(de=>{ge+=X(de)})),ge},se=(Je,kt)=>{const Et={};return Co(Je).forEach(ge=>{E.value[ge.id]=kt,Et[ge.columnKey||ge.id]=kt}),Et},re=(Je,kt,Et)=>{P.value&&P.value!==Je&&(P.value.order=null),P.value=Je,A.value=kt,I.value=Et},ee=()=>{let Je=w(o);Object.keys(E.value).forEach(kt=>{const Et=E.value[kt];if(!Et||Et.length===0)return;const ge=bq({columns:u.value},kt);ge&&ge.filterMethod&&(Je=Je.filter(Le=>Et.some(de=>ge.filterMethod.call(null,de,Le,ge))))}),x.value=Je},te=()=>{var Je;r.value=_1e((Je=x.value)!=null?Je:[],{sortingColumn:P.value,sortProp:A.value,sortOrder:I.value})},V=(Je=void 0)=>{Je?.filter||ee(),te()},K=Je=>{const{tableHeaderRef:kt}=e.refs;if(!kt)return;const Et=Object.assign({},kt.filterPanels),ge=Object.keys(Et);if(ge.length)if(ot(Je)&&(Je=[Je]),Pe(Je)){const Le=Je.map(de=>d1e({columns:u.value},de));ge.forEach(de=>{const Ve=Le.find(gt=>gt.id===de);Ve&&(Ve.filteredValue=[])}),e.store.commit("filterChange",{column:Le,values:[],silent:!0,multi:!0})}else ge.forEach(Le=>{const de=u.value.find(Ve=>Ve.id===Le);de&&(de.filteredValue=[])}),E.value={},e.store.commit("filterChange",{column:{},values:[],silent:!0})},G=()=>{P.value&&(re(null,null,null),e.store.commit("changeSortCondition",{silent:!0}))},{setExpandRowKeys:ye,toggleRowExpansion:be,updateExpandRows:Ce,states:Y,isRowExpanded:Z}=b1e({data:r,rowKey:i}),{updateTreeExpandKeys:ae,toggleTreeExpansion:pe,updateTreeData:je,updateKeyChildren:Ie,loadOrToggle:fe,states:Te}=w1e({data:r,rowKey:i}),{updateCurrentRowData:et,updateCurrentRow:Re,setCurrentRowKey:ze,states:Ke}=y1e({data:r,rowKey:i});return{assertRowKey:z,updateColumns:O,scheduleLayout:N,isSelected:F,clearSelection:j,cleanSelection:U,getSelectionRows:W,toggleRowSelection:J,_toggleAllSelection:ne,toggleAllSelection:null,updateAllSelected:he,updateFilters:se,updateCurrentRow:Re,updateSort:re,execFilter:ee,execSort:te,execQuery:V,clearFilter:K,clearSort:G,toggleRowExpansion:be,setExpandRowKeysAdapter:Je=>{ye(Je),ae(Je)},setCurrentRowKey:ze,toggleRowExpansionAdapter:(Je,kt)=>{u.value.some(({type:ge})=>ge==="expand")?be(Je,kt):pe(Je,kt)},isRowExpanded:Z,updateExpandRows:Ce,updateCurrentRowData:et,loadOrToggle:fe,updateTreeData:je,updateKeyChildren:Ie,states:{tableSize:n,rowKey:i,data:r,_data:o,isComplex:s,_columns:a,originColumns:l,columns:u,fixedColumns:c,rightFixedColumns:d,leafColumns:f,fixedLeafColumns:h,rightFixedLeafColumns:m,updateOrderFns:g,leafColumnsLength:v,fixedLeafColumnsLength:p,rightFixedLeafColumnsLength:b,isAllSelected:y,selection:_,reserveSelection:C,selectOnIndeterminate:S,selectable:k,rowExpandable:T,filters:E,filteredData:x,sortingColumn:P,sortProp:A,sortOrder:I,hoverRow:D,...Y,...Te,...Ke}}}function A2(t,e){return t.map(n=>{var i;return n.id===e.id?e:((i=n.children)!=null&&i.length&&(n.children=A2(n.children,e)),n)})}function P2(t){t.forEach(e=>{var n,i;e.no=(n=e.getColumnIndex)==null?void 0:n.call(e),(i=e.children)!=null&&i.length&&P2(e.children)}),t.sort((e,n)=>e.no-n.no)}function S1e(){const t=Ct(),e=C1e(),n=De("table"),{t:i}=Qt();return{ns:n,t:i,...e,mutations:{setData(a,l){const u=w(a._data)!==l;a.data.value=l,a._data.value=l,t.store.execQuery(),t.store.updateCurrentRowData(),t.store.updateExpandRows(),t.store.updateTreeData(t.store.states.defaultExpandAll.value),w(a.reserveSelection)?t.store.assertRowKey():u?t.store.clearSelection():t.store.cleanSelection(),t.store.updateAllSelected(),t.$ready&&t.store.scheduleLayout()},insertColumn(a,l,u,c){var d;const f=w(a._columns);let h=[];u?(u&&!u.children&&(u.children=[]),(d=u.children)==null||d.push(l),h=A2(f,u)):(f.push(l),h=f),P2(h),a._columns.value=h,a.updateOrderFns.push(c),l.type==="selection"&&(a.selectable.value=l.selectable,a.reserveSelection.value=l.reserveSelection),t.$ready&&(t.store.updateColumns(),t.store.scheduleLayout())},updateColumnOrder(a,l){var u;((u=l.getColumnIndex)==null?void 0:u.call(l))!==l.no&&(P2(a._columns.value),t.$ready&&t.store.updateColumns())},removeColumn(a,l,u,c){var d;const f=w(a._columns)||[];if(u)(d=u.children)==null||d.splice(u.children.findIndex(m=>m.id===l.id),1),Ye(()=>{var m;((m=u.children)==null?void 0:m.length)===0&&delete u.children}),a._columns.value=A2(f,u);else{const m=f.indexOf(l);m>-1&&(f.splice(m,1),a._columns.value=f)}const h=a.updateOrderFns.indexOf(c);h>-1&&a.updateOrderFns.splice(h,1),t.$ready&&(t.store.updateColumns(),t.store.scheduleLayout())},sort(a,l){const{prop:u,order:c,init:d}=l;if(u){const f=w(a.columns).find(h=>h.property===u);f&&(f.order=c,t.store.updateSort(f,u,c),t.store.commit("changeSortCondition",{init:d}))}},changeSortCondition(a,l){const{sortingColumn:u,sortProp:c,sortOrder:d}=a,f=w(u),h=w(c),m=w(d);PC(m)&&(a.sortingColumn.value=null,a.sortProp.value=null);const g={filter:!0};t.store.execQuery(g),(!l||!(l.silent||l.init))&&t.emit("sort-change",{column:f,prop:h,order:m}),t.store.updateTableScrollY()},filterChange(a,l){const{column:u,values:c,silent:d}=l,f=t.store.updateFilters(u,c);t.store.execQuery(),d||t.emit("filter-change",f),t.store.updateTableScrollY()},toggleAllSelection(){var a,l;(l=(a=t.store).toggleAllSelection)==null||l.call(a)},rowSelectedChanged(a,l){t.store.toggleRowSelection(l),t.store.updateAllSelected()},setHoverRow(a,l){a.hoverRow.value=l},setCurrentRow(a,l){t.store.updateCurrentRow(l)}},commit:function(a,...l){const u=t.store.mutations;if(u[a])u[a].apply(t,[t.store.states,...l]);else throw new Error(`Action not found: ${a}`)},updateTableScrollY:function(){Ye(()=>t.layout.updateScrollY.apply(t.layout))}}}const KR={rowKey:"rowKey",defaultExpandAll:"defaultExpandAll",rowExpandable:"rowExpandable",selectOnIndeterminate:"selectOnIndeterminate",indent:"indent",lazy:"lazy","treeProps.hasChildren":{key:"lazyColumnIdentifier",default:"hasChildren"},"treeProps.children":{key:"childrenColumnName",default:"children"},"treeProps.checkStrictly":{key:"checkStrictly",default:!1}};function k1e(t,e){if(!t)throw new Error("Table is required.");const n=S1e();return n.toggleAllSelection=ul(n._toggleAllSelection,10),Object.keys(KR).forEach(i=>{Sq(kq(e,i),i,n)}),T1e(n,e),n}function T1e(t,e){Object.keys(KR).forEach(n=>{Se(()=>kq(e,n),i=>{Sq(i,n,t)})})}function Sq(t,e,n){let i=t,r=KR[e];_t(r)&&(i=i||r.default,r=r.key),n.states[r].value=i}function kq(t,e){if(e.includes(".")){const n=e.split(".");let i=t;return n.forEach(r=>{i=i[r]}),i}else return t[e]}var E1e=Object.defineProperty,x1e=(t,e,n)=>e in t?E1e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,mr=(t,e,n)=>x1e(t,typeof e!="symbol"?e+"":e,n);class A1e{constructor(e){mr(this,"observers"),mr(this,"table"),mr(this,"store"),mr(this,"columns"),mr(this,"fit"),mr(this,"showHeader"),mr(this,"height"),mr(this,"scrollX"),mr(this,"scrollY"),mr(this,"bodyWidth"),mr(this,"fixedWidth"),mr(this,"rightFixedWidth"),mr(this,"tableHeight"),mr(this,"headerHeight"),mr(this,"appendHeight"),mr(this,"footerHeight"),mr(this,"gutterWidth"),this.observers=[],this.table=null,this.store=null,this.columns=[],this.fit=!0,this.showHeader=!0,this.height=H(null),this.scrollX=H(!1),this.scrollY=H(!1),this.bodyWidth=H(null),this.fixedWidth=H(null),this.rightFixedWidth=H(null),this.gutterWidth=0;for(const n in e)Jt(e,n)&&(rn(this[n])?this[n].value=e[n]:this[n]=e[n]);if(!this.table)throw new Error("Table is required for Table Layout");if(!this.store)throw new Error("Store is required for Table Layout")}updateScrollY(){const e=this.height.value;if(PC(e))return!1;const n=this.table.refs.scrollBarRef;if(this.table.vnode.el&&n?.wrapRef){let i=!0;const r=this.scrollY.value;return i=n.wrapRef.scrollHeight>n.wrapRef.clientHeight,this.scrollY.value=i,r!==i}return!1}setHeight(e,n="height"){if(!Zt)return;const i=this.table.vnode.el;if(e=h1e(e),this.height.value=Number(e),!i&&(e||e===0)){Ye(()=>this.setHeight(e,n));return}i&&St(e)?(i.style[n]=`${e}px`,this.updateElsHeight()):i&&ot(e)&&(i.style[n]=e,this.updateElsHeight())}setMaxHeight(e){this.setHeight(e,"max-height")}getFlattenColumns(){const e=[];return this.table.store.states.columns.value.forEach(i=>{i.isColumnGroup?e.push.apply(e,i.columns):e.push(i)}),e}updateElsHeight(){this.updateScrollY(),this.notifyObservers("scrollable")}headerDisplayNone(e){if(!e)return!0;let n=e;for(;n.tagName!=="DIV";){if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}updateColumnsWidth(){var e;if(!Zt)return;const n=this.fit,i=(e=this.table.vnode.el)==null?void 0:e.clientWidth;let r=0;const o=this.getFlattenColumns(),s=o.filter(u=>!St(u.width));if(o.forEach(u=>{St(u.width)&&u.realWidth&&(u.realWidth=null)}),s.length>0&&n){if(o.forEach(u=>{r+=Number(u.width||u.minWidth||80)}),r<=i){this.scrollX.value=!1;const u=i-r;if(s.length===1)s[0].realWidth=Number(s[0].minWidth||80)+u;else{const c=s.reduce((h,m)=>h+Number(m.minWidth||80),0),d=u/c;let f=0;s.forEach((h,m)=>{if(m===0)return;const g=Math.floor(Number(h.minWidth||80)*d);f+=g,h.realWidth=Number(h.minWidth||80)+g}),s[0].realWidth=Number(s[0].minWidth||80)+u-f}}else this.scrollX.value=!0,s.forEach(u=>{u.realWidth=Number(u.minWidth)});this.bodyWidth.value=Math.max(r,i),this.table.state.resizeState.value.width=this.bodyWidth.value}else o.forEach(u=>{!u.width&&!u.minWidth?u.realWidth=80:u.realWidth=Number(u.width||u.minWidth),r+=u.realWidth}),this.scrollX.value=r>i,this.bodyWidth.value=r;const a=this.store.states.fixedColumns.value;if(a.length>0){let u=0;a.forEach(c=>{u+=Number(c.realWidth||c.width)}),this.fixedWidth.value=u}const l=this.store.states.rightFixedColumns.value;if(l.length>0){let u=0;l.forEach(c=>{u+=Number(c.realWidth||c.width)}),this.rightFixedWidth.value=u}this.notifyObservers("columns")}addObserver(e){this.observers.push(e)}removeObserver(e){const n=this.observers.indexOf(e);n!==-1&&this.observers.splice(n,1)}notifyObservers(e){this.observers.forEach(i=>{var r,o;switch(e){case"columns":(r=i.state)==null||r.onColumnsChange(this);break;case"scrollable":(o=i.state)==null||o.onScrollableChange(this);break;default:throw new Error(`Table Layout don't have event ${e}.`)}})}}var P1e=le({name:"ElTableFilterPanel",components:{ElCheckbox:Ac,ElCheckboxGroup:gW,ElScrollbar:gu,ElTooltip:Lo,ElIcon:He,ArrowDown:zc,ArrowUp:sR},props:{placement:{type:String,default:"bottom-start"},store:{type:Object},column:{type:Object},upDataColumn:{type:Function},appendTo:Mn.appendTo},setup(t){const e=Ct(),{t:n}=Qt(),i=De("table-filter"),r=e?.parent;t.column&&!r.filterPanels.value[t.column.id]&&(r.filterPanels.value[t.column.id]=e);const o=H(null),s=H(null),a=H(0),l=M(()=>t.column&&t.column.filters),u=M(()=>t.column&&t.column.filterClassName?`${i.b()} ${t.column.filterClassName}`:i.b()),c=M({get:()=>{var k;return(((k=t.column)==null?void 0:k.filteredValue)||[])[0]},set:k=>{d.value&&(Is(k)?d.value.splice(0,1):d.value.splice(0,1,k))}}),d=M({get(){return t.column?t.column.filteredValue||[]:[]},set(k){var T;t.column&&((T=t.upDataColumn)==null||T.call(t,"filteredValue",k))}}),f=M(()=>t.column?t.column.filterMultiple:!0),h=k=>k.value===c.value,m=()=>{var k;(k=o.value)==null||k.onClose()},g=()=>{b(d.value),m()},v=()=>{d.value=[],b(d.value),m()},p=(k,T)=>{c.value=k,a.value=T,Is(k)?b([]):b(d.value),m()},b=k=>{var T,E;(T=t.store)==null||T.commit("filterChange",{column:t.column,values:k}),(E=t.store)==null||E.updateAllSelected()},y=()=>{var k,T;(k=s.value)==null||k.focus(),!f.value&&C(),t.column&&((T=t.upDataColumn)==null||T.call(t,"filterOpened",!0))},_=()=>{var k;t.column&&((k=t.upDataColumn)==null||k.call(t,"filterOpened",!1))},C=()=>{if(Is(c)){a.value=0;return}const k=(l.value||[]).findIndex(T=>T.value===c.value);a.value=k>=0?k+1:0};return{multiple:f,filterClassName:u,filteredValue:d,filterValue:c,filters:l,handleConfirm:g,handleReset:v,handleSelect:p,isPropAbsent:Is,isActive:h,t:n,ns:i,tooltipRef:o,rootRef:s,checkedIndex:a,handleShowTooltip:y,handleHideTooltip:_,handleKeydown:k=>{var T,E;const x=Bn(k),P=(l.value?l.value.length:0)+1;let A=a.value,I=!0;switch(x){case Me.down:case Me.right:A=(A+1)%P;break;case Me.up:case Me.left:A=(A-1+P)%P;break;case Me.tab:m(),I=!1;break;case Me.enter:case Me.space:if(A===0)p(null,0);else{const D=(l.value||[])[A-1];D.value&&p(D.value,A)}break;default:I=!1;break}I&&k.preventDefault(),a.value=A,(E=(T=s.value)==null?void 0:T.querySelector(`.${i.e("list-item")}:nth-child(${A+1})`))==null||E.focus()}}}});const I1e=["disabled"],R1e=["tabindex","aria-checked"],M1e=["tabindex","aria-checked","onClick"],O1e=["aria-label"];function L1e(t,e,n,i,r,o){const s=Bt("el-checkbox"),a=Bt("el-checkbox-group"),l=Bt("el-scrollbar"),u=Bt("arrow-up"),c=Bt("arrow-down"),d=Bt("el-icon"),f=Bt("el-tooltip");return B(),_e(f,{ref:"tooltipRef",offset:0,placement:t.placement,"show-arrow":!1,trigger:"click",role:"dialog",teleported:"",effect:"light",pure:"",loop:"","popper-class":t.filterClassName,persistent:"","append-to":t.appendTo,onShow:t.handleShowTooltip,onHide:t.handleHideTooltip},{content:ce(()=>[t.multiple?(B(),Q("div",{key:0,ref:"rootRef",tabindex:"-1",class:$(t.ns.e("multiple"))},[ie("div",{class:$(t.ns.e("content"))},[L(l,{"wrap-class":t.ns.e("wrap")},{default:ce(()=>[L(a,{modelValue:t.filteredValue,"onUpdate:modelValue":e[0]||(e[0]=h=>t.filteredValue=h),class:$(t.ns.e("checkbox-group"))},{default:ce(()=>[(B(!0),Q(rt,null,gn(t.filters,h=>(B(),_e(s,{key:h.value,value:h.value},{default:ce(()=>[dt(We(h.text),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue","class"])]),_:1},8,["wrap-class"])],2),ie("div",{class:$(t.ns.e("bottom"))},[ie("button",{class:$(t.ns.is("disabled",t.filteredValue.length===0)),disabled:t.filteredValue.length===0,type:"button",onClick:e[1]||(e[1]=(...h)=>t.handleConfirm&&t.handleConfirm(...h))},We(t.t("el.table.confirmFilter")),11,I1e),ie("button",{type:"button",onClick:e[2]||(e[2]=(...h)=>t.handleReset&&t.handleReset(...h))},We(t.t("el.table.resetFilter")),1)],2)],2)):(B(),Q("ul",{key:1,ref:"rootRef",tabindex:"-1",role:"radiogroup",class:$(t.ns.e("list")),onKeydown:e[4]||(e[4]=(...h)=>t.handleKeydown&&t.handleKeydown(...h))},[ie("li",{role:"radio",class:$([t.ns.e("list-item"),t.ns.is("active",t.isPropAbsent(t.filterValue))]),tabindex:t.checkedIndex===0?0:-1,"aria-checked":t.isPropAbsent(t.filterValue),onClick:e[3]||(e[3]=h=>t.handleSelect(null,0))},We(t.t("el.table.clearFilter")),11,R1e),(B(!0),Q(rt,null,gn(t.filters,(h,m)=>(B(),Q("li",{key:h.value,role:"radio",class:$([t.ns.e("list-item"),t.ns.is("active",t.isActive(h))]),tabindex:t.checkedIndex===m+1?0:-1,"aria-checked":t.isActive(h),onClick:g=>t.handleSelect(h.value,m+1)},We(h.text),11,M1e))),128))],34))]),default:ce(()=>{var h;return[ie("button",{type:"button",class:$(`${t.ns.namespace.value}-table__column-filter-trigger`),"aria-label":t.t("el.table.filterLabel",{column:((h=t.column)==null?void 0:h.label)||""})},[L(d,null,{default:ce(()=>[we(t.$slots,"filter-icon",{},()=>{var m;return[(m=t.column)!=null&&m.filterOpened?(B(),_e(u,{key:0})):(B(),_e(c,{key:1}))]})]),_:3})],10,O1e)]}),_:3},8,["placement","popper-class","append-to","onShow","onHide"])}var D1e=Tr(P1e,[["render",L1e]]);function GR(t){const e=Ct();yC(()=>{n.value.addObserver(e)}),Pt(()=>{i(n.value),r(n.value)}),ku(()=>{i(n.value),r(n.value)}),Fc(()=>{n.value.removeObserver(e)});const n=M(()=>{const o=t.layout;if(!o)throw new Error("Can not find table layout.");return o}),i=o=>{var s;const a=((s=t.vnode.el)==null?void 0:s.querySelectorAll("colgroup > col"))||[];if(!a.length)return;const l=o.getFlattenColumns(),u={};l.forEach(c=>{u[c.id]=c});for(let c=0,d=a.length;c{var s,a;const l=((s=t.vnode.el)==null?void 0:s.querySelectorAll("colgroup > col[name=gutter]"))||[];for(let c=0,d=l.length;c{g.stopPropagation()},o=(g,v)=>{!v.filters&&v.sortable?m(g,v,!1):v.filterable&&!v.sortable&&r(g),i?.emit("header-click",v,g)},s=(g,v)=>{i?.emit("header-contextmenu",v,g)},a=H(null),l=H(!1),u=H(),c=(g,v)=>{var p,b;if(Zt&&!(v.children&&v.children.length>0)&&a.value&&t.border&&a.value.id===v.id){l.value=!0;const y=i;e("set-drag-visible",!0);const _=y?.vnode.el,C=_?.getBoundingClientRect().left,S=(b=(p=n?.vnode)==null?void 0:p.el)==null?void 0:b.querySelector(`th.${v.id}`),k=S.getBoundingClientRect(),T=k.left-C+30;Qs(S,"noclick"),u.value={startMouseLeft:g.clientX,startLeft:k.right-C,startColumnLeft:k.left-C,tableLeft:C};const E=y?.refs.resizeProxy;E.style.left=`${u.value.startLeft}px`,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};const x=A=>{const I=A.clientX-u.value.startMouseLeft,D=u.value.startLeft+I;E.style.left=`${Math.max(T,D)}px`},P=()=>{if(l.value){const{startColumnLeft:A,startLeft:I}=u.value,q=Number.parseInt(E.style.left,10)-A;v.width=v.realWidth=q,y?.emit("header-dragend",v.width,I-A,v,g),requestAnimationFrame(()=>{t.store.scheduleLayout(!1,!0)}),document.body.style.cursor="",l.value=!1,a.value=null,u.value=void 0,e("set-drag-visible",!1)}document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",P),document.onselectstart=null,document.ondragstart=null,setTimeout(()=>{os(S,"noclick")},0)};document.addEventListener("mousemove",x),document.addEventListener("mouseup",P)}},d=(g,v)=>{var p;if(!t.border||v.children&&v.children.length>0)return;const b=g.target,y=Qo(b)?b.closest("th"):null;if(!y)return;const _=Xa(y,"is-sortable");if(_){const x=l.value?"col-resize":"";y.style.cursor=x;const P=y.querySelector(".caret-wrapper");P&&(P.style.cursor=x)}if(!v.resizable||l.value){a.value=null;return}const C=y.getBoundingClientRect(),S=((p=y.parentNode)==null?void 0:p.lastElementChild)===y,k=t.allowDragLastColumn||!S,T=C.width>12&&C.right-g.clientX<8&&k,E=T?"col-resize":"";document.body.style.cursor=E,a.value=T?v:null,_&&(y.style.cursor=E)},f=()=>{!Zt||l.value||(document.body.style.cursor="")},h=({order:g,sortOrders:v})=>{if(g==="")return v[0];const p=v.indexOf(g||null);return v[p>v.length-2?0:p+1]},m=(g,v,p)=>{var b;g.stopPropagation();const y=v.order===p?null:p||h(v),_=(b=g.target)==null?void 0:b.closest("th");if(_&&Xa(_,"noclick")){os(_,"noclick");return}if(!v.sortable)return;const C=g.currentTarget;if(["ascending","descending"].some(x=>Xa(C,x)&&!v.sortOrders.includes(x)))return;const S=t.store.states;let k=S.sortProp.value,T;const E=S.sortingColumn.value;(E!==v||E===v&&PC(E.order))&&(E&&(E.order=null),S.sortingColumn.value=v,k=v.property),y?T=v.order=y:T=v.order=null,S.sortProp.value=k,S.sortOrder.value=T,i?.store.commit("changeSortCondition")};return{handleHeaderClick:o,handleHeaderContextMenu:s,handleMouseDown:c,handleMouseMove:d,handleMouseOut:f,handleSortClick:m,handleFilterClick:r}}function B1e(t){const e=Ne(_a),n=De("table");return{getHeaderRowStyle:a=>{const l=e?.props.headerRowStyle;return Xe(l)?l.call(null,{rowIndex:a}):l},getHeaderRowClass:a=>{const l=[],u=e?.props.headerRowClassName;return ot(u)?l.push(u):Xe(u)&&l.push(u.call(null,{rowIndex:a})),l.join(" ")},getHeaderCellStyle:(a,l,u,c)=>{var d;let f=(d=e?.props.headerCellStyle)!=null?d:{};Xe(f)&&(f=f.call(null,{rowIndex:a,columnIndex:l,row:u,column:c}));const h=jR(l,c.fixed,t.store,u);return Nm(h,"left"),Nm(h,"right"),Object.assign({},f,h)},getHeaderCellClass:(a,l,u,c)=>{const d=qR(n.b(),l,c.fixed,t.store,u),f=[c.id,c.order,c.headerAlign,c.className,c.labelClassName,...d];c.children||f.push("is-leaf"),c.sortable&&f.push("is-sortable");const h=e?.props.headerCellClassName;return ot(h)?f.push(h):Xe(h)&&f.push(h.call(null,{rowIndex:a,columnIndex:l,row:u,column:c})),f.push(n.e("cell")),f.filter(m=>!!m).join(" ")}}}const Tq=t=>{const e=[];return t.forEach(n=>{n.children?(e.push(n),e.push.apply(e,Tq(n.children))):e.push(n)}),e},Eq=t=>{let e=1;const n=(o,s)=>{if(s&&(o.level=s.level+1,e{n(l,o),a+=l.colSpan}),o.colSpan=a}else o.colSpan=1};t.forEach(o=>{o.level=1,n(o,void 0)});const i=[];for(let o=0;o{o.children?(o.rowSpan=1,o.children.forEach(s=>s.isSubColumn=!0)):o.rowSpan=e-o.level+1,i[o.level-1].push(o)}),i};function V1e(t){const e=Ne(_a),n=M(()=>Eq(t.store.states.originColumns.value));return{isGroup:M(()=>{const o=n.value.length>1;return o&&e&&(e.state.isGroup.value=!0),o}),toggleAllSelection:o=>{o.stopPropagation(),e?.store.commit("toggleAllSelection")},columnRows:n}}var F1e=le({name:"ElTableHeader",components:{ElCheckbox:Ac},props:{fixed:{type:String,default:""},store:{required:!0,type:Object},border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})},appendFilterPanelTo:{type:String},allowDragLastColumn:{type:Boolean}},setup(t,{emit:e}){const n=Ct(),i=Ne(_a),r=De("table"),o=H({}),{onColumnsChange:s,onScrollableChange:a}=GR(i),l=i?.props.tableLayout==="auto",u=on(new Map),c=H();let d;const f=()=>{d=setTimeout(()=>{u.size>0&&(u.forEach((A,I)=>{const D=c.value.querySelector(`.${I.replace(/\s/g,".")}`);if(D){const q=D.getBoundingClientRect().width;A.width=q||A.width}}),u.clear())})};Se(u,f),Sn(()=>{d&&(clearTimeout(d),d=void 0)}),Pt(async()=>{await Ye(),await Ye();const{prop:A,order:I}=t.defaultSort;i?.store.commit("sort",{prop:A,order:I,init:!0}),f()});const{handleHeaderClick:h,handleHeaderContextMenu:m,handleMouseDown:g,handleMouseMove:v,handleMouseOut:p,handleSortClick:b,handleFilterClick:y}=N1e(t,e),{getHeaderRowStyle:_,getHeaderRowClass:C,getHeaderCellStyle:S,getHeaderCellClass:k}=B1e(t),{isGroup:T,toggleAllSelection:E,columnRows:x}=V1e(t),{t:P}=Qt();return n.state={onColumnsChange:s,onScrollableChange:a},n.filterPanels=o,{ns:r,t:P,filterPanels:o,onColumnsChange:s,onScrollableChange:a,columnRows:x,getHeaderRowClass:C,getHeaderRowStyle:_,getHeaderCellClass:k,getHeaderCellStyle:S,handleHeaderClick:h,handleHeaderContextMenu:m,handleMouseDown:g,handleMouseMove:v,handleMouseOut:p,handleSortClick:b,handleFilterClick:y,isGroup:T,toggleAllSelection:E,saveIndexSelection:u,isTableLayoutAuto:l,theadRef:c,updateFixedColumnStyle:f}},render(){const{ns:t,t:e,isGroup:n,columnRows:i,getHeaderCellStyle:r,getHeaderCellClass:o,getHeaderRowClass:s,getHeaderRowStyle:a,handleHeaderClick:l,handleHeaderContextMenu:u,handleMouseDown:c,handleMouseMove:d,handleSortClick:f,handleMouseOut:h,store:m,$parent:g,saveIndexSelection:v,isTableLayoutAuto:p}=this;let b=1;return nt("thead",{ref:"theadRef",class:t.is("group",n)},i.map((y,_)=>nt("tr",{class:s(_),key:_,style:a(_)},y.map((C,S)=>{C.rowSpan>b&&(b=C.rowSpan);const k=o(_,S,y,C);return p&&C.fixed&&v.set(k,C),nt("th",{class:k,colspan:C.colSpan,key:`${C.id}-thead`,rowspan:C.rowSpan,scope:C.colSpan>1?"colgroup":"col",ariaSort:C.sortable?C.order:void 0,style:r(_,S,y,C),onClick:T=>{var E;(E=T.currentTarget)!=null&&E.classList.contains("noclick")||l(T,C)},onContextmenu:T=>u(T,C),onMousedown:T=>c(T,C),onMousemove:T=>d(T,C),onMouseout:h},[nt("div",{class:["cell",C.filteredValue&&C.filteredValue.length>0?"highlight":""]},[C.renderHeader?C.renderHeader({column:C,$index:S,store:m,_self:g}):C.label,C.sortable&&nt("button",{type:"button",class:"caret-wrapper","aria-label":e("el.table.sortLabel",{column:C.label||""}),onClick:T=>f(T,C)},[nt("i",{onClick:T=>f(T,C,"ascending"),class:"sort-caret ascending"}),nt("i",{onClick:T=>f(T,C,"descending"),class:"sort-caret descending"})]),C.filterable&&nt(D1e,{store:m,placement:C.filterPlacement||"bottom-start",appendTo:g?.appendFilterPanelTo,column:C,upDataColumn:(T,E)=>{C[T]=E}},{"filter-icon":()=>C.renderFilterIcon?C.renderFilterIcon({filterOpened:C.filterOpened}):null})])])}))))}});function Bk(t,e,n=.03){return t-e>n}function $1e(t){const e=Ne(_a),n=H(""),i=H(nt("div")),r=(m,g,v)=>{var p,b,y;const _=e,C=Nk(m);let S=null;const k=(p=_?.vnode.el)==null?void 0:p.dataset.prefix;C&&(S=DN({columns:(y=(b=t.store)==null?void 0:b.states.columns.value)!=null?y:[]},C,k),S&&_?.emit(`cell-${v}`,g,S,C,m)),_?.emit(`row-${v}`,g,S,m)},o=(m,g)=>{r(m,g,"dblclick")},s=(m,g)=>{var v;(v=t.store)==null||v.commit("setCurrentRow",g),r(m,g,"click")},a=(m,g)=>{r(m,g,"contextmenu")},l=ul(m=>{var g;(g=t.store)==null||g.commit("setHoverRow",m)},30),u=ul(()=>{var m;(m=t.store)==null||m.commit("setHoverRow",null)},30),c=m=>{const g=window.getComputedStyle(m,null),v=Number.parseInt(g.paddingLeft,10)||0,p=Number.parseInt(g.paddingRight,10)||0,b=Number.parseInt(g.paddingTop,10)||0,y=Number.parseInt(g.paddingBottom,10)||0;return{left:v,right:p,top:b,bottom:y}},d=(m,g,v)=>{var p;let b=(p=g?.target)==null?void 0:p.parentNode;for(;m>1&&(b=b?.nextSibling,!(!b||b.nodeName!=="TR"));)v(b,"hover-row hover-fixed-row"),m--};return{handleDoubleClick:o,handleClick:s,handleContextMenu:a,handleMouseEnter:l,handleMouseLeave:u,handleCellMouseEnter:(m,g,v)=>{var p,b,y,_,C,S,k,T,E;if(!e)return;const x=e,P=Nk(m),A=(p=x?.vnode.el)==null?void 0:p.dataset.prefix;let I=null;if(P){if(I=DN({columns:(y=(b=t.store)==null?void 0:b.states.columns.value)!=null?y:[]},P,A),!I)return;P.rowSpan>1&&d(P.rowSpan,m,Qs);const he=x.hoverState={cell:P,column:I,row:g};x?.emit("cell-mouse-enter",he.row,he.column,he.cell,m)}if(!v){((_=Rr)==null?void 0:_.trigger)===P&&((C=Rr)==null||C());return}const D=m.target.querySelector(".cell");if(!(Xa(D,`${A}-tooltip`)&&D.childNodes.length&&((S=D.textContent)!=null&&S.trim())))return;const q=document.createRange();q.setStart(D,0),q.setEnd(D,D.childNodes.length);const{width:z,height:R}=q.getBoundingClientRect(),{width:O,height:N}=D.getBoundingClientRect(),{top:F,left:j,right:U,bottom:W}=c(D),J=j+U,ne=F+W;Bk(z+J,O)||Bk(R+ne,N)||Bk(D.scrollWidth,O)?v1e(v,(k=P?.innerText||P?.textContent)!=null?k:"",g,I,P,x):((T=Rr)==null?void 0:T.trigger)===P&&((E=Rr)==null||E())},handleCellMouseLeave:m=>{const g=Nk(m);if(!g)return;g.rowSpan>1&&d(g.rowSpan,m,os);const v=e?.hoverState;e?.emit("cell-mouse-leave",v?.row,v?.column,v?.cell,m)},tooltipContent:n,tooltipTrigger:i}}function z1e(t){const e=Ne(_a),n=De("table");return{getRowStyle:(u,c)=>{const d=e?.props.rowStyle;return Xe(d)?d.call(null,{row:u,rowIndex:c}):d||null},getRowClass:(u,c,d)=>{var f;const h=[n.e("row")];e?.props.highlightCurrentRow&&u===((f=t.store)==null?void 0:f.states.currentRow.value)&&h.push("current-row"),t.stripe&&d%2===1&&h.push(n.em("row","striped"));const m=e?.props.rowClassName;return ot(m)?h.push(m):Xe(m)&&h.push(m.call(null,{row:u,rowIndex:c})),h},getCellStyle:(u,c,d,f)=>{const h=e?.props.cellStyle;let m=h??{};Xe(h)&&(m=h.call(null,{rowIndex:u,columnIndex:c,row:d,column:f}));const g=jR(c,t?.fixed,t.store);return Nm(g,"left"),Nm(g,"right"),Object.assign({},m,g)},getCellClass:(u,c,d,f,h)=>{const m=qR(n.b(),c,t?.fixed,t.store,void 0,h),g=[f.id,f.align,f.className,...m],v=e?.props.cellClassName;return ot(v)?g.push(v):Xe(v)&&g.push(v.call(null,{rowIndex:u,columnIndex:c,row:d,column:f})),g.push(n.e("cell")),g.filter(p=>!!p).join(" ")},getSpan:(u,c,d,f)=>{let h=1,m=1;const g=e?.props.spanMethod;if(Xe(g)){const v=g({row:u,column:c,rowIndex:d,columnIndex:f});Pe(v)?(h=v[0],m=v[1]):_t(v)&&(h=v.rowspan,m=v.colspan)}return{rowspan:h,colspan:m}},getColspanRealWidth:(u,c,d)=>{if(c<1)return u[d].realWidth;const f=u.map(({realWidth:h,width:m})=>h||m).slice(d,d+c);return Number(f.reduce((h,m)=>Number(h)+Number(m),-1))}}}const H1e=["colspan","rowspan"];var U1e=le({name:"TableTdWrapper",__name:"td-wrapper",props:{colspan:{type:Number,default:1},rowspan:{type:Number,default:1}},setup(t){return(e,n)=>(B(),Q("td",{colspan:t.colspan,rowspan:t.rowspan},[we(e.$slots,"default")],8,H1e))}});function W1e(t){const e=Ne(_a),n=De("table"),{handleDoubleClick:i,handleClick:r,handleContextMenu:o,handleMouseEnter:s,handleMouseLeave:a,handleCellMouseEnter:l,handleCellMouseLeave:u,tooltipContent:c,tooltipTrigger:d}=$1e(t),{getRowStyle:f,getRowClass:h,getCellStyle:m,getCellClass:g,getSpan:v,getColspanRealWidth:p}=z1e(t);let b=-1;const y=M(()=>{var T;return(T=t.store)==null?void 0:T.states.columns.value.findIndex(({type:E})=>E==="default")}),_=(T,E)=>{var x;const P=(x=e?.props)==null?void 0:x.rowKey;return P?vr(T,P):E},C=(T,E,x,P=!1)=>{const{tooltipEffect:A,tooltipOptions:I,store:D}=t,{indent:q,columns:z}=D.states,R=[];let O=!0;return x&&(R.push(n.em("row",`level-${x.level}`)),O=!!x.display),E===0&&(b=-1),t.stripe&&O&&b++,R.push(...h(T,E,b)),nt("tr",{style:[O?null:{display:"none"},f(T,E)],class:R,key:_(T,E),onDblclick:F=>i(F,T),onClick:F=>r(F,T),onContextmenu:F=>o(F,T),onMouseenter:()=>s(E),onMouseleave:a},z.value.map((F,j)=>{const{rowspan:U,colspan:W}=v(T,F,E,j);if(!U||!W)return null;const J=Object.assign({},F);J.realWidth=p(z.value,W,j);const ne={store:D,_self:t.context||e,column:J,row:T,$index:E,cellIndex:j,expanded:P};j===y.value&&x&&(ne.treeNode={indent:x.level&&x.level*q.value,level:x.level},vi(x.expanded)&&(ne.treeNode.expanded=x.expanded,"loading"in x&&(ne.treeNode.loading=x.loading),"noLazyChildren"in x&&(ne.treeNode.noLazyChildren=x.noLazyChildren)));const he=`${_(T,E)},${j}`,X=J.columnKey||J.rawColumnKey||"",se=F.showOverflowTooltip&&jH({effect:A},I,F.showOverflowTooltip);return nt(U1e,{style:m(E,j,T,F),class:g(E,j,T,F,W-1),key:`${X}${he}`,rowspan:U,colspan:W,onMouseenter:re=>l(re,T,se),onMouseleave:u},{default:()=>S(j,F,ne)})}))},S=(T,E,x)=>E.renderCell(x);return{wrappedRowRender:(T,E)=>{const x=t.store,{isRowExpanded:P,assertRowKey:A}=x,{treeData:I,lazyTreeNodeMap:D,childrenColumnName:q,rowKey:z}=x.states,R=x.states.columns.value;if(R.some(({type:N})=>N==="expand")){const N=P(T),F=C(T,E,void 0,N),j=e?.renderExpanded;if(!j)return console.error("[Element Error]renderExpanded is required."),F;const U=[[F]];return(e.props.preserveExpandedContent||N)&&U[0].push(nt("tr",{key:`expanded-row__${F.key}`,style:{display:N?"":"none"}},[nt("td",{colspan:R.length,class:`${n.e("cell")} ${n.e("expanded-cell")}`},[j({row:T,$index:E,store:x,expanded:N})])])),U}else if(Object.keys(I.value).length){A();const N=vr(T,z.value);let F=I.value[N],j=null;F&&(j={expanded:F.expanded,level:F.level,display:!0,noLazyChildren:void 0,loading:void 0},vi(F.lazy)&&(j&&vi(F.loaded)&&F.loaded&&(j.noLazyChildren=!(F.children&&F.children.length)),j.loading=F.loading));const U=[C(T,E,j??void 0)];if(F){let W=0;const J=(he,X)=>{he&&he.length&&X&&he.forEach(se=>{const re={display:X.display&&X.expanded,level:X.level+1,expanded:!1,noLazyChildren:!1,loading:!1},ee=vr(se,z.value);if(Is(ee))throw new Error("For nested data item, row-key is required.");if(F={...I.value[ee]},F&&(re.expanded=F.expanded,F.level=F.level||re.level,F.display=!!(F.expanded&&re.display),vi(F.lazy)&&(vi(F.loaded)&&F.loaded&&(re.noLazyChildren=!(F.children&&F.children.length)),re.loading=F.loading)),W++,U.push(C(se,E+W,re)),F){const te=D.value[ee]||se[q.value];J(te,F)}})};F.display=!0;const ne=D.value[N]||T[q.value];J(ne,F)}return U}else return C(T,E,void 0)},tooltipContent:c,tooltipTrigger:d}}const q1e={store:{required:!0,type:Object},stripe:Boolean,tooltipEffect:String,tooltipOptions:{type:Object},context:{default:()=>({}),type:Object},rowClassName:[String,Function],rowStyle:[Object,Function],fixed:{type:String,default:""},highlight:Boolean};var j1e=le({name:"ElTableBody",props:q1e,setup(t){var e;const n=Ct(),i=Ne(_a),r=De("table"),{wrappedRowRender:o,tooltipContent:s,tooltipTrigger:a}=W1e(t),{onColumnsChange:l,onScrollableChange:u}=GR(i),c=[];return Se((e=t.store)==null?void 0:e.states.hoverRow,(d,f)=>{var h,m;const g=n?.vnode.el,v=Array.from(g?.children||[]).filter(y=>y?.classList.contains(`${r.e("row")}`));let p=d;const b=(h=v[p])==null?void 0:h.childNodes;if(b?.length){let y=0;Array.from(b).reduce((C,S,k)=>{var T,E;return((T=b[k])==null?void 0:T.colSpan)>1&&(y=(E=b[k])==null?void 0:E.colSpan),S.nodeName!=="TD"&&y===0&&C.push(k),y>0&&y--,C},[]).forEach(C=>{var S;for(p=d;p>0;){const k=(S=v[p-1])==null?void 0:S.childNodes;if(k[C]&&k[C].nodeName==="TD"&&k[C].rowSpan>1){Qs(k[C],"hover-cell"),c.push(k[C]);break}p--}})}else c.forEach(y=>os(y,"hover-cell")),c.length=0;!((m=t.store)!=null&&m.states.isComplex.value)||!Zt||oR(()=>{const y=v[f],_=v[d];y&&!y.classList.contains("hover-fixed-row")&&os(y,"hover-row"),_&&Qs(_,"hover-row")})}),Fc(()=>{var d;(d=Rr)==null||d()}),{ns:r,onColumnsChange:l,onScrollableChange:u,wrappedRowRender:o,tooltipContent:s,tooltipTrigger:a}},render(){const{wrappedRowRender:t,store:e}=this,n=e?.states.data.value||[];return nt("tbody",{tabIndex:-1},[n.reduce((i,r)=>i.concat(t(r,i.length)),[])])}});function K1e(){const t=Ne(_a),e=t?.store,n=M(()=>{var a;return(a=e?.states.fixedLeafColumnsLength.value)!=null?a:0}),i=M(()=>{var a;return(a=e?.states.rightFixedColumns.value.length)!=null?a:0}),r=M(()=>{var a;return(a=e?.states.columns.value.length)!=null?a:0}),o=M(()=>{var a;return(a=e?.states.fixedColumns.value.length)!=null?a:0}),s=M(()=>{var a;return(a=e?.states.rightFixedColumns.value.length)!=null?a:0});return{leftFixedLeafCount:n,rightFixedLeafCount:i,columnsCount:r,leftFixedCount:o,rightFixedCount:s,columns:M(()=>{var a;return(a=e?.states.columns.value)!=null?a:[]})}}function G1e(t){const{columns:e}=K1e(),n=De("table");return{getCellClasses:(o,s)=>{const a=o[s],l=[n.e("cell"),a.id,a.align,a.labelClassName,...qR(n.b(),s,a.fixed,t.store)];return a.className&&l.push(a.className),a.children||l.push(n.is("leaf")),l},getCellStyles:(o,s)=>{const a=jR(s,o.fixed,t.store);return Nm(a,"left"),Nm(a,"right"),a},columns:e}}var Y1e=le({name:"ElTableFooter",props:{fixed:{type:String,default:""},store:{required:!0,type:Object},summaryMethod:Function,sumText:String,border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(t){const e=Ne(_a),n=De("table"),{getCellClasses:i,getCellStyles:r,columns:o}=G1e(t),{onScrollableChange:s,onColumnsChange:a}=GR(e);return{ns:n,onScrollableChange:s,onColumnsChange:a,getCellClasses:i,getCellStyles:r,columns:o}},render(){const{columns:t,getCellStyles:e,getCellClasses:n,summaryMethod:i,sumText:r}=this,o=this.store.states.data.value;let s=[];return i?s=i({columns:t,data:o}):t.forEach((a,l)=>{if(l===0){s[l]=r;return}const u=o.map(h=>Number(h[a.property])),c=[];let d=!0;u.forEach(h=>{if(!Number.isNaN(+h)){d=!1;const m=`${h}`.split(".")[1];c.push(m?m.length:0)}});const f=Math.max.apply(null,c);d?s[l]="":s[l]=u.reduce((h,m)=>{const g=Number(m);return Number.isNaN(+g)?h:Number.parseFloat((h+m).toFixed(Math.min(f,20)))},0)}),nt(nt("tfoot",[nt("tr",{},[...t.map((a,l)=>nt("td",{key:l,colspan:a.colSpan,rowspan:a.rowSpan,class:n(t,l),style:e(a,l)},[nt("div",{class:["cell",a.labelClassName]},[s[l]])]))])]))}});function X1e(t){return{setCurrentRow:d=>{t.commit("setCurrentRow",d)},getSelectionRows:()=>t.getSelectionRows(),toggleRowSelection:(d,f,h=!0)=>{t.toggleRowSelection(d,f,!1,h),t.updateAllSelected()},clearSelection:()=>{t.clearSelection()},clearFilter:d=>{t.clearFilter(d)},toggleAllSelection:()=>{t.commit("toggleAllSelection")},toggleRowExpansion:(d,f)=>{t.toggleRowExpansionAdapter(d,f)},clearSort:()=>{t.clearSort()},sort:(d,f)=>{t.commit("sort",{prop:d,order:f})},updateKeyChildren:(d,f)=>{t.updateKeyChildren(d,f)}}}function J1e(t,e,n,i){const r=H(!1),o=H(null),s=H(!1),a=R=>{s.value=R},l=H({width:null,height:null,headerHeight:null}),u=H(!1),c={display:"inline-block",verticalAlign:"middle"},d=H(),f=H(0),h=H(0),m=H(0),g=H(0),v=H(0);Se(()=>t.height,R=>{e.setHeight(R??null)},{immediate:!0}),Se(()=>t.maxHeight,R=>{e.setMaxHeight(R??null)},{immediate:!0}),Se(()=>[t.currentRowKey,n.states.rowKey],([R,O])=>{!w(O)||!w(R)||n.setCurrentRowKey(`${R}`)},{immediate:!0}),Se(()=>t.data,R=>{i.store.commit("setData",R)},{immediate:!0,deep:!0}),sl(()=>{t.expandRowKeys&&n.setExpandRowKeysAdapter(t.expandRowKeys)});const p=()=>{i.store.commit("setHoverRow",null),i.hoverState&&(i.hoverState=null)},b=(R,O)=>{const{pixelX:N,pixelY:F}=O;Math.abs(N)>=Math.abs(F)&&(i.refs.bodyWrapper.scrollLeft+=O.pixelX/5)},y=M(()=>t.height||t.maxHeight||n.states.fixedColumns.value.length>0||n.states.rightFixedColumns.value.length>0),_=M(()=>({width:e.bodyWidth.value?`${e.bodyWidth.value}px`:""})),C=()=>{y.value&&e.updateElsHeight(),e.updateColumnsWidth(),!(typeof window>"u")&&requestAnimationFrame(E)};Pt(async()=>{await Ye(),n.updateColumns(),x(),requestAnimationFrame(C);const R=i.vnode.el,O=i.refs.headerWrapper;t.flexible&&R&&R.parentElement&&(R.parentElement.style.minWidth="0"),l.value={width:d.value=R.offsetWidth,height:R.offsetHeight,headerHeight:t.showHeader&&O?O.offsetHeight:null},n.states.columns.value.forEach(N=>{N.filteredValue&&N.filteredValue.length&&i.store.commit("filterChange",{column:N,values:N.filteredValue,silent:!0})}),i.$ready=!0});const S=(R,O)=>{if(!R)return;const N=Array.from(R.classList).filter(F=>!F.startsWith("is-scrolling-"));N.push(e.scrollX.value?O:"is-scrolling-none"),R.className=N.join(" ")},k=R=>{const{tableWrapper:O}=i.refs;S(O,R)},T=R=>{const{tableWrapper:O}=i.refs;return!!(O&&O.classList.contains(R))},E=function(){if(!i.refs.scrollBarRef)return;if(!e.scrollX.value){const J="is-scrolling-none";T(J)||k(J);return}const R=i.refs.scrollBarRef.wrapRef;if(!R)return;const{scrollLeft:O,offsetWidth:N,scrollWidth:F}=R,{headerWrapper:j,footerWrapper:U}=i.refs;j&&(j.scrollLeft=O),U&&(U.scrollLeft=O);const W=F-N-1;O>=W?k("is-scrolling-right"):k(O===0?"is-scrolling-left":"is-scrolling-middle")},x=()=>{i.refs.scrollBarRef&&(i.refs.scrollBarRef.wrapRef&&Kn(i.refs.scrollBarRef.wrapRef,"scroll",E,{passive:!0}),t.fit?nr(i.vnode.el,P):Kn(window,"resize",P),nr(i.refs.tableInnerWrapper,()=>{var R,O;P(),(O=(R=i.refs)==null?void 0:R.scrollBarRef)==null||O.update()}))},P=()=>{var R,O,N,F;const j=i.vnode.el;if(!i.$ready||!j)return;let U=!1;const{width:W,height:J,headerHeight:ne}=l.value,he=d.value=j.offsetWidth;W!==he&&(U=!0);const X=j.offsetHeight;(t.height||y.value)&&J!==X&&(U=!0);const se=t.tableLayout==="fixed"?i.refs.headerWrapper:(R=i.refs.tableHeaderRef)==null?void 0:R.$el;t.showHeader&&se?.offsetHeight!==ne&&(U=!0),f.value=((O=i.refs.tableWrapper)==null?void 0:O.scrollHeight)||0,m.value=se?.scrollHeight||0,g.value=((N=i.refs.footerWrapper)==null?void 0:N.offsetHeight)||0,v.value=((F=i.refs.appendWrapper)==null?void 0:F.offsetHeight)||0,h.value=f.value-m.value-g.value-v.value,U&&(l.value={width:he,height:X,headerHeight:t.showHeader&&se?.offsetHeight||0},C())},A=fr(),I=M(()=>{const{bodyWidth:R,scrollY:O,gutterWidth:N}=e;return R.value?`${R.value-(O.value?N:0)}px`:""}),D=M(()=>t.maxHeight?"fixed":t.tableLayout),q=M(()=>{if(t.data&&t.data.length)return;let R="100%";t.height&&h.value&&(R=`${h.value}px`);const O=d.value;return{width:O?`${O}px`:"",height:R}}),z=M(()=>t.height?{height:"100%"}:t.maxHeight?Number.isNaN(Number(t.maxHeight))?{maxHeight:`calc(${t.maxHeight} - ${m.value+g.value}px)`}:{maxHeight:`${+t.maxHeight-m.value-g.value}px`}:{});return{isHidden:r,renderExpanded:o,setDragVisible:a,isGroup:u,handleMouseLeave:p,handleHeaderFooterMousewheel:b,tableSize:A,emptyBlockStyle:q,resizeProxyVisible:s,bodyWidth:I,resizeState:l,doLayout:C,tableBodyStyles:_,tableLayout:D,scrollbarViewStyle:c,scrollbarStyle:z}}function Z1e(t){let e;const n=()=>{const r=t.vnode.el.querySelector(".hidden-columns"),o={childList:!0,subtree:!0},s=t.store.states.updateOrderFns;e=new MutationObserver(()=>{s.forEach(a=>a())}),e.observe(r,o)};Pt(()=>{n()}),Fc(()=>{e?.disconnect()})}var Q1e={data:{type:Array,default:()=>[]},size:$r,width:[String,Number],height:[String,Number],maxHeight:[String,Number],fit:{type:Boolean,default:!0},stripe:Boolean,border:Boolean,rowKey:[String,Function],showHeader:{type:Boolean,default:!0},showSummary:Boolean,sumText:String,summaryMethod:Function,rowClassName:[String,Function],rowStyle:[Object,Function],cellClassName:[String,Function],cellStyle:[Object,Function],headerRowClassName:[String,Function],headerRowStyle:[Object,Function],headerCellClassName:[String,Function],headerCellStyle:[Object,Function],highlightCurrentRow:Boolean,currentRowKey:[String,Number],emptyText:String,expandRowKeys:Array,defaultExpandAll:Boolean,rowExpandable:{type:Function},defaultSort:Object,tooltipEffect:String,tooltipOptions:Object,spanMethod:Function,selectOnIndeterminate:{type:Boolean,default:!0},indent:{type:Number,default:16},treeProps:{type:Object,default:()=>({hasChildren:"hasChildren",children:"children",checkStrictly:!1})},lazy:Boolean,load:Function,style:{type:[String,Object,Array],default:()=>({})},className:{type:String,default:""},tableLayout:{type:String,default:"fixed"},scrollbarAlwaysOn:Boolean,flexible:Boolean,showOverflowTooltip:[Boolean,Object],tooltipFormatter:Function,appendFilterPanelTo:String,scrollbarTabindex:{type:[Number,String],default:void 0},allowDragLastColumn:{type:Boolean,default:!0},preserveExpandedContent:Boolean,nativeScrollbar:Boolean};function xq(t){const e=t.tableLayout==="auto";let n=t.columns||[];e&&n.every(({width:r})=>pn(r))&&(n=[]);const i=r=>{const o={key:`${t.tableLayout}_${r.id}`,style:{},name:void 0};return e?o.style={width:`${r.width}px`}:o.name=r.id,o};return nt("colgroup",{},n.map(r=>nt("col",i(r))))}xq.props=["columns","tableLayout"];const eCe=()=>{const t=H(),e=(o,s)=>{const a=t.value;a&&a.scrollTo(o,s)},n=(o,s)=>{const a=t.value;a&&St(s)&&["Top","Left"].includes(o)&&a[`setScroll${o}`](s)};return{scrollBarRef:t,scrollTo:e,setScrollTop:o=>n("Top",o),setScrollLeft:o=>n("Left",o)}};var VN=!1,Vd,I2,R2,Fw,$w,Aq,zw,M2,O2,L2,Pq,D2,N2,Iq,Rq;function mo(){if(!VN){VN=!0;var t=navigator.userAgent,e=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(t),n=/(Mac OS X)|(Windows)|(Linux)/.exec(t);if(D2=/\b(iPhone|iP[ao]d)/.exec(t),N2=/\b(iP[ao]d)/.exec(t),L2=/Android/i.exec(t),Iq=/FBAN\/\w+;/i.exec(t),Rq=/Mobile/i.exec(t),Pq=!!/Win64/.exec(t),e){Vd=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,Vd&&document&&document.documentMode&&(Vd=document.documentMode);var i=/(?:Trident\/(\d+.\d+))/.exec(t);Aq=i?parseFloat(i[1])+4:Vd,I2=e[2]?parseFloat(e[2]):NaN,R2=e[3]?parseFloat(e[3]):NaN,Fw=e[4]?parseFloat(e[4]):NaN,Fw?(e=/(?:Chrome\/(\d+\.\d+))/.exec(t),$w=e&&e[1]?parseFloat(e[1]):NaN):$w=NaN}else Vd=I2=R2=$w=Fw=NaN;if(n){if(n[1]){var r=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(t);zw=r?parseFloat(r[1].replace("_",".")):!0}else zw=!1;M2=!!n[2],O2=!!n[3]}else zw=M2=O2=!1}}var B2={ie:function(){return mo()||Vd},ieCompatibilityMode:function(){return mo()||Aq>Vd},ie64:function(){return B2.ie()&&Pq},firefox:function(){return mo()||I2},opera:function(){return mo()||R2},webkit:function(){return mo()||Fw},safari:function(){return B2.webkit()},chrome:function(){return mo()||$w},windows:function(){return mo()||M2},osx:function(){return mo()||zw},linux:function(){return mo()||O2},iphone:function(){return mo()||D2},mobile:function(){return mo()||D2||N2||L2||Rq},nativeApp:function(){return mo()||Iq},android:function(){return mo()||L2},ipad:function(){return mo()||N2}},tCe=B2,nCe=!!(typeof window<"u"&&window.document&&window.document.createElement),iCe={canUseDOM:nCe},Mq=iCe,Oq;Mq.canUseDOM&&(Oq=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);function rCe(t,e){if(!Mq.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,i=n in document;if(!i){var r=document.createElement("div");r.setAttribute(n,"return;"),i=typeof r[n]=="function"}return!i&&Oq&&t==="wheel"&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var oCe=rCe,FN=10,$N=40,zN=800;function Lq(t){var e=0,n=0,i=0,r=0;return"detail"in t&&(n=t.detail),"wheelDelta"in t&&(n=-t.wheelDelta/120),"wheelDeltaY"in t&&(n=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=n,n=0),i=e*FN,r=n*FN,"deltaY"in t&&(r=t.deltaY),"deltaX"in t&&(i=t.deltaX),(i||r)&&t.deltaMode&&(t.deltaMode==1?(i*=$N,r*=$N):(i*=zN,r*=zN)),i&&!e&&(e=i<1?-1:1),r&&!n&&(n=r<1?-1:1),{spinX:e,spinY:n,pixelX:i,pixelY:r}}Lq.getEventType=function(){return tCe.firefox()?"DOMMouseScroll":oCe("wheel")?"wheel":"mousewheel"};var sCe=Lq;const Hw="_Mousewheel",HN=function(t,e){if(t&&t.addEventListener){Dq(t);const n=function(i){const r=sCe(i);e&&Reflect.apply(e,this,[i,r])};t[Hw]={wheelHandler:n},t.addEventListener("wheel",n,{passive:!0})}},Dq=t=>{var e;(e=t[Hw])!=null&&e.wheelHandler&&(t.removeEventListener("wheel",t[Hw].wheelHandler),t[Hw]=null)},aCe={beforeMount(t,e){HN(t,e.value)},unmounted(t){Dq(t)},updated(t,e){e.value!==e.oldValue&&HN(t,e.value)}};let lCe=1;var uCe=le({name:"ElTable",directives:{Mousewheel:aCe},components:{TableHeader:F1e,TableBody:j1e,TableFooter:Y1e,ElScrollbar:gu,hColgroup:xq},props:Q1e,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change","scroll"],setup(t){const{t:e}=Qt(),n=De("table"),i=Ct();qt(_a,i);const r=k1e(i,t);i.store=r;const o=new A1e({store:i.store,table:i,fit:t.fit,showHeader:t.showHeader});i.layout=o;const s=M(()=>(r.states.data.value||[]).length===0),{setCurrentRow:a,getSelectionRows:l,toggleRowSelection:u,clearSelection:c,clearFilter:d,toggleAllSelection:f,toggleRowExpansion:h,clearSort:m,sort:g,updateKeyChildren:v}=X1e(r),{isHidden:p,renderExpanded:b,setDragVisible:y,isGroup:_,handleMouseLeave:C,handleHeaderFooterMousewheel:S,tableSize:k,emptyBlockStyle:T,resizeProxyVisible:E,bodyWidth:x,resizeState:P,doLayout:A,tableBodyStyles:I,tableLayout:D,scrollbarViewStyle:q,scrollbarStyle:z}=J1e(t,o,r,i),{scrollBarRef:R,scrollTo:O,setScrollLeft:N,setScrollTop:F}=eCe(),j=ul(A,50),U=`${n.namespace.value}-table_${lCe++}`;i.tableId=U,i.state={isGroup:_,resizeState:P,doLayout:A,debouncedUpdateLayout:j};const W=M(()=>{var he;return(he=t.sumText)!=null?he:e("el.table.sumText")}),J=M(()=>{var he;return(he=t.emptyText)!=null?he:e("el.table.emptyText")}),ne=M(()=>Eq(r.states.originColumns.value)[0]);return Z1e(i),Sn(()=>{j.cancel()}),{ns:n,layout:o,store:r,columns:ne,handleHeaderFooterMousewheel:S,handleMouseLeave:C,tableId:U,tableSize:k,isHidden:p,isEmpty:s,renderExpanded:b,resizeProxyVisible:E,resizeState:P,isGroup:_,bodyWidth:x,tableBodyStyles:I,emptyBlockStyle:T,debouncedUpdateLayout:j,setCurrentRow:a,getSelectionRows:l,toggleRowSelection:u,clearSelection:c,clearFilter:d,toggleAllSelection:f,toggleRowExpansion:h,clearSort:m,doLayout:A,sort:g,updateKeyChildren:v,t:e,setDragVisible:y,context:i,computedSumText:W,computedEmptyText:J,tableLayout:D,scrollbarViewStyle:q,scrollbarStyle:z,scrollBarRef:R,scrollTo:O,setScrollLeft:N,setScrollTop:F,allowDragLastColumn:t.allowDragLastColumn}}});const cCe=["data-prefix"],dCe={ref:"hiddenColumns",class:"hidden-columns"};function fCe(t,e,n,i,r,o){const s=Bt("hColgroup"),a=Bt("table-header"),l=Bt("table-body"),u=Bt("table-footer"),c=Bt("el-scrollbar"),d=vz("mousewheel");return B(),Q("div",{ref:"tableWrapper",class:$([{[t.ns.m("fit")]:t.fit,[t.ns.m("striped")]:t.stripe,[t.ns.m("border")]:t.border||t.isGroup,[t.ns.m("hidden")]:t.isHidden,[t.ns.m("group")]:t.isGroup,[t.ns.m("fluid-height")]:t.maxHeight,[t.ns.m("scrollable-x")]:t.layout.scrollX.value,[t.ns.m("scrollable-y")]:t.layout.scrollY.value,[t.ns.m("enable-row-hover")]:!t.store.states.isComplex.value,[t.ns.m("enable-row-transition")]:(t.store.states.data.value||[]).length!==0&&(t.store.states.data.value||[]).length<100,"has-footer":t.showSummary},t.ns.m(t.tableSize),t.className,t.ns.b(),t.ns.m(`layout-${t.tableLayout}`)]),style:mt(t.style),"data-prefix":t.ns.namespace.value,onMouseleave:e[1]||(e[1]=(...f)=>t.handleMouseLeave&&t.handleMouseLeave(...f))},[ie("div",{ref:"tableInnerWrapper",class:$(t.ns.e("inner-wrapper"))},[ie("div",dCe,[we(t.$slots,"default")],512),t.showHeader&&t.tableLayout==="fixed"?Vt((B(),Q("div",{key:0,ref:"headerWrapper",class:$(t.ns.e("header-wrapper"))},[ie("table",{ref:"tableHeader",class:$(t.ns.e("header")),style:mt(t.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[L(s,{columns:t.store.states.columns.value,"table-layout":t.tableLayout},null,8,["columns","table-layout"]),L(a,{ref:"tableHeaderRef",border:t.border,"default-sort":t.defaultSort,store:t.store,"append-filter-panel-to":t.appendFilterPanelTo,"allow-drag-last-column":t.allowDragLastColumn,onSetDragVisible:t.setDragVisible},null,8,["border","default-sort","store","append-filter-panel-to","allow-drag-last-column","onSetDragVisible"])],6)],2)),[[d,t.handleHeaderFooterMousewheel]]):ve("v-if",!0),ie("div",{ref:"bodyWrapper",class:$(t.ns.e("body-wrapper"))},[L(c,{ref:"scrollBarRef","view-style":t.scrollbarViewStyle,"wrap-style":t.scrollbarStyle,always:t.scrollbarAlwaysOn,tabindex:t.scrollbarTabindex,native:t.nativeScrollbar,onScroll:e[0]||(e[0]=f=>t.$emit("scroll",f))},{default:ce(()=>[ie("table",{ref:"tableBody",class:$(t.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:mt({width:t.bodyWidth,tableLayout:t.tableLayout})},[L(s,{columns:t.store.states.columns.value,"table-layout":t.tableLayout},null,8,["columns","table-layout"]),t.showHeader&&t.tableLayout==="auto"?(B(),_e(a,{key:0,ref:"tableHeaderRef",class:$(t.ns.e("body-header")),border:t.border,"default-sort":t.defaultSort,store:t.store,"append-filter-panel-to":t.appendFilterPanelTo,onSetDragVisible:t.setDragVisible},null,8,["class","border","default-sort","store","append-filter-panel-to","onSetDragVisible"])):ve("v-if",!0),L(l,{context:t.context,highlight:t.highlightCurrentRow,"row-class-name":t.rowClassName,"tooltip-effect":t.tooltipEffect,"tooltip-options":t.tooltipOptions,"row-style":t.rowStyle,store:t.store,stripe:t.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","tooltip-options","row-style","store","stripe"]),t.showSummary&&t.tableLayout==="auto"?(B(),_e(u,{key:1,class:$(t.ns.e("body-footer")),border:t.border,"default-sort":t.defaultSort,store:t.store,"sum-text":t.computedSumText,"summary-method":t.summaryMethod},null,8,["class","border","default-sort","store","sum-text","summary-method"])):ve("v-if",!0)],6),t.isEmpty?(B(),Q("div",{key:0,ref:"emptyBlock",style:mt(t.emptyBlockStyle),class:$(t.ns.e("empty-block"))},[ie("span",{class:$(t.ns.e("empty-text"))},[we(t.$slots,"empty",{},()=>[dt(We(t.computedEmptyText),1)])],2)],6)):ve("v-if",!0),t.$slots.append?(B(),Q("div",{key:1,ref:"appendWrapper",class:$(t.ns.e("append-wrapper"))},[we(t.$slots,"append")],2)):ve("v-if",!0)]),_:3},8,["view-style","wrap-style","always","tabindex","native"])],2),t.showSummary&&t.tableLayout==="fixed"?Vt((B(),Q("div",{key:1,ref:"footerWrapper",class:$(t.ns.e("footer-wrapper"))},[ie("table",{class:$(t.ns.e("footer")),cellspacing:"0",cellpadding:"0",border:"0",style:mt(t.tableBodyStyles)},[L(s,{columns:t.store.states.columns.value,"table-layout":t.tableLayout},null,8,["columns","table-layout"]),L(u,{border:t.border,"default-sort":t.defaultSort,store:t.store,"sum-text":t.computedSumText,"summary-method":t.summaryMethod},null,8,["border","default-sort","store","sum-text","summary-method"])],6)],2)),[[On,!t.isEmpty],[d,t.handleHeaderFooterMousewheel]]):ve("v-if",!0),t.border||t.isGroup?(B(),Q("div",{key:2,class:$(t.ns.e("border-left-patch"))},null,2)):ve("v-if",!0)],2),Vt(ie("div",{ref:"resizeProxy",class:$(t.ns.e("column-resize-proxy"))},null,2),[[On,t.resizeProxyVisible]])],46,cCe)}var hCe=Tr(uCe,[["render",fCe]]);const mCe={selection:"table-column--selection",expand:"table__expand-column"},gCe={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},pCe=t=>mCe[t]||"",vCe={selection:{renderHeader({store:t}){var e;function n(){return t.states.data.value&&t.states.data.value.length===0}return nt(Ac,{disabled:n(),size:t.states.tableSize.value,indeterminate:t.states.selection.value.length>0&&!t.states.isAllSelected.value,"onUpdate:modelValue":(e=t.toggleAllSelection)!=null?e:void 0,modelValue:t.states.isAllSelected.value,ariaLabel:t.t("el.table.selectAllLabel")})},renderCell({row:t,column:e,store:n,$index:i}){return nt(Ac,{disabled:e.selectable?!e.selectable.call(null,t,i):!1,size:n.states.tableSize.value,onChange:()=>{n.commit("rowSelectedChanged",t)},onClick:r=>r.stopPropagation(),modelValue:n.isSelected(t),ariaLabel:n.t("el.table.selectRowLabel")})},sortable:!1,resizable:!1},index:{renderHeader({column:t}){return t.label||"#"},renderCell({column:t,$index:e}){let n=e+1;const i=t.index;return St(i)?n=e+i:Xe(i)&&(n=i(e)),nt("div",{},[n])},sortable:!1},expand:{renderHeader({column:t}){return t.label||""},renderCell({column:t,row:e,store:n,expanded:i,$index:r}){var o,s,a;const{ns:l}=n,u=[l.e("expand-icon")];!t.renderExpand&&i&&u.push(l.em("expand-icon","expanded"));const c=function(f){f.stopPropagation(),n.toggleRowExpansion(e)},d=(a=(s=(o=n.states.rowExpandable).value)==null?void 0:s.call(o,e,r))!=null?a:!0;return d||u.push(l.is("disabled")),nt("button",{type:"button",disabled:!d,"aria-label":n.t(i?"el.table.collapseRowLabel":"el.table.expandRowLabel"),"aria-expanded":i,class:u,onClick:c},{default:()=>t.renderExpand?[t.renderExpand({expanded:i,expandable:d})]:[nt(He,null,{default:()=>[nt(oa)]})]})},sortable:!1,resizable:!1}};function bCe({row:t,column:e,$index:n}){var i;const r=e.property,o=r&&lm(t,r).value;return e&&e.formatter?e.formatter(t,e,o,n):((i=o?.toString)==null?void 0:i.call(o))||""}function yCe({row:t,treeNode:e,store:n},i=!1){const{ns:r}=n;if(!e)return i?[nt("span",{class:r.e("placeholder")})]:null;const o=[],s=function(a){a.stopPropagation(),!e.loading&&n.loadOrToggle(t)};if(e.indent&&o.push(nt("span",{class:r.e("indent"),style:{"padding-left":`${e.indent}px`}})),vi(e.expanded)&&!e.noLazyChildren){const a=[r.e("expand-icon"),e.expanded?r.em("expand-icon","expanded"):""];let l=oa;e.loading&&(l=xc),o.push(nt("button",{type:"button","aria-label":n.t(e.expanded?"el.table.collapseRowLabel":"el.table.expandRowLabel"),"aria-expanded":e.expanded,class:a,onClick:s},{default:()=>[nt(He,{class:r.is("loading",e.loading)},{default:()=>[nt(l)]})]}))}else o.push(nt("span",{class:r.e("placeholder")}));return o}function UN(t,e){return t.reduce((n,i)=>(n[i]=i,n),e)}function wCe(t,e){const n=Ct();return{registerComplexWatchers:()=>{const o=["fixed"],s={realWidth:"width",realMinWidth:"minWidth"},a=UN(o,s);Object.keys(a).forEach(l=>{const u=s[l];Jt(e,u)&&Se(()=>e[u],c=>{let d=c;u==="width"&&l==="realWidth"&&(d=WR(c)),u==="minWidth"&&l==="realMinWidth"&&(d=yq(c)),n.columnConfig.value[u]=d,n.columnConfig.value[l]=d;const f=u==="fixed";t.value.store.scheduleLayout(f)})})},registerNormalWatchers:()=>{const o=["label","filters","filterMultiple","filteredValue","sortable","index","formatter","className","labelClassName","filterClassName","showOverflowTooltip","tooltipFormatter","resizable"],s=["showOverflowTooltip"],a={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},l=UN(o,a);Object.keys(l).forEach(u=>{const c=a[u];Jt(e,c)&&Se(()=>e[c],d=>{n.columnConfig.value[u]=d,(u==="filters"||u==="filterMethod")&&(n.columnConfig.value.filterable=!!(n.columnConfig.value.filters||n.columnConfig.value.filterMethod))})}),s.forEach(u=>{Jt(t.value.props,u)&&Se(()=>t.value.props[u],c=>{n.columnConfig.value.type!=="selection"&&pn(e[u])&&(n.columnConfig.value[u]=c)})})}}}function _Ce(t,e,n){const i=Ct(),r=H(""),o=H(!1),s=H(),a=H(),l=De("table");sl(()=>{s.value=t.align?`is-${t.align}`:null,s.value}),sl(()=>{a.value=t.headerAlign?`is-${t.headerAlign}`:s.value,a.value});const u=M(()=>{let _=i.vnode.vParent||i.parent;for(;_&&!_.tableId&&!_.columnId;)_=_.vnode.vParent||_.parent;return _}),c=M(()=>{const{store:_}=i.parent;if(!_)return!1;const{treeData:C}=_.states,S=C.value;return S&&Object.keys(S).length>0}),d=H(WR(t.width)),f=H(yq(t.minWidth)),h=_=>(d.value&&(_.width=d.value),f.value&&(_.minWidth=f.value),!d.value&&f.value&&(_.width=void 0),_.minWidth||(_.minWidth=80),_.realWidth=Number(pn(_.width)?_.minWidth:_.width),_),m=_=>{const C=_.type,S=vCe[C]||{};Object.keys(S).forEach(T=>{const E=S[T];T!=="className"&&!pn(E)&&(_[T]=E)});const k=pCe(C);if(k){const T=`${w(l.namespace)}-${k}`;_.className=_.className?`${_.className} ${T}`:T}return _},g=_=>{Pe(_)?_.forEach(S=>C(S)):C(_);function C(S){var k;((k=S?.type)==null?void 0:k.name)==="ElTableColumn"&&(S.vParent=i)}};return{columnId:r,realAlign:s,isSubColumn:o,realHeaderAlign:a,columnOrTableParent:u,setColumnWidth:h,setColumnForcedProps:m,setColumnRenders:_=>{t.renderHeader||_.type!=="selection"&&(_.renderHeader=S=>{if(i.columnConfig.value.label,e.header){const k=e.header(S);if(Cq(k))return nt(rt,k)}return dt(_.label)}),e["filter-icon"]&&(_.renderFilterIcon=S=>we(e,"filter-icon",S)),e.expand&&(_.renderExpand=S=>we(e,"expand",S));let C=_.renderCell;return _.type==="expand"?(_.renderCell=S=>nt("div",{class:"cell"},[C(S)]),n.value.renderExpanded=S=>e.default?e.default(S):e.default):(C=C||bCe,_.renderCell=S=>{let k=null;if(e.default){const I=e.default(S);k=I.some(D=>D.type!==xi)?I:C(S)}else k=C(S);const{columns:T}=n.value.store.states,E=T.value.findIndex(I=>I.type==="default"),x=c.value&&S.cellIndex===E,P=yCe(S,x),A={class:"cell",style:{}};return _.showOverflowTooltip&&(A.class=`${A.class} ${w(l.namespace)}-tooltip`,A.style={width:`${(S.column.realWidth||Number(S.column.width))-1}px`}),g(k),nt("div",A,[P,k])}),_},getPropsData:(..._)=>_.reduce((C,S)=>(Pe(S)&&S.forEach(k=>{C[k]=t[k]}),C),{}),getColumnElIndex:(_,C)=>Array.prototype.indexOf.call(_,C),updateColumnOrder:()=>{n.value.store.commit("updateColumnOrder",i.columnConfig.value)}}}var CCe={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showOverflowTooltip:{type:[Boolean,Object],default:void 0},tooltipFormatter:Function,fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},filterClassName:String,index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:t=>t.every(e=>["ascending","descending",null].includes(e))}};let SCe=1;var Nq=le({name:"ElTableColumn",components:{ElCheckbox:Ac},props:CCe,setup(t,{slots:e}){const n=Ct(),i=H({}),r=M(()=>{let y=n.parent;for(;y&&!y.tableId;)y=y.parent;return y}),{registerNormalWatchers:o,registerComplexWatchers:s}=wCe(r,t),{columnId:a,isSubColumn:l,realHeaderAlign:u,columnOrTableParent:c,setColumnWidth:d,setColumnForcedProps:f,setColumnRenders:h,getPropsData:m,getColumnElIndex:g,realAlign:v,updateColumnOrder:p}=_Ce(t,e,r),b=c.value;a.value=`${"tableId"in b&&b.tableId||"columnId"in b&&b.columnId}_column_${SCe++}`,yC(()=>{l.value=r.value!==b;const y=t.type||"default",_=t.sortable===""?!0:t.sortable,C=y==="selection"?!1:pn(t.showOverflowTooltip)?b.props.showOverflowTooltip:t.showOverflowTooltip,S=pn(t.tooltipFormatter)?b.props.tooltipFormatter:t.tooltipFormatter,k={...gCe[y],id:a.value,type:y,property:t.prop||t.property,align:v,headerAlign:u,showOverflowTooltip:C,tooltipFormatter:S,filterable:t.filters||t.filterMethod,filteredValue:[],filterPlacement:"",filterClassName:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:_,index:t.index,rawColumnKey:n.vnode.key};let A=m(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement","filterClassName"]);A=f1e(k,A),A=m1e(h,d,f)(A),i.value=A,o(),s()}),Pt(()=>{var y,_;const C=c.value,S=l.value?(y=C.vnode.el)==null?void 0:y.children:(_=C.refs.hiddenColumns)==null?void 0:_.children,k=()=>g(S||[],n.vnode.el);i.value.getColumnIndex=k,k()>-1&&r.value.store.commit("insertColumn",i.value,l.value?"columnConfig"in C&&C.columnConfig.value:null,p)}),Sn(()=>{const y=i.value.getColumnIndex;(y?y():-1)>-1&&r.value.store.commit("removeColumn",i.value,l.value?"columnConfig"in b&&b.columnConfig.value:null,p)}),n.columnId=a.value,n.columnConfig=i},render(){var t,e,n;try{const i=(e=(t=this.$slots).default)==null?void 0:e.call(t,{row:{},column:{},$index:-1}),r=[];if(Pe(i))for(const s of i)((n=s.type)==null?void 0:n.name)==="ElTableColumn"||s.shapeFlag&2?r.push(s):s.type===rt&&Pe(s.children)&&s.children.forEach(a=>{a?.patchFlag!==1024&&!ot(a?.children)&&r.push(a)});return nt("div",r)}catch{return nt("div",[])}}});const kCe=sn(hCe,{TableColumn:Nq}),rd=Zi(Nq),UC=Symbol("tabsRootContextKey"),TCe=qe({tabs:{type:me(Array),default:()=>Fs([])},tabRefs:{type:me(Object),default:()=>Fs({})}}),WN="ElTabBar";var ECe=le({name:WN,__name:"tab-bar",props:TCe,setup(t,{expose:e}){const n=t,i=Ne(UC);i||dr(WN,"");const r=De("tabs"),o=H(),s=H(),a=M(()=>{var h;return pn(i.props.defaultValue)||!!((h=s.value)!=null&&h.transform)}),l=()=>{let h=0,m=0;const g=["top","bottom"].includes(i.props.tabPosition)?"width":"height",v=g==="width"?"x":"y",p=v==="x"?"left":"top";return n.tabs.every(b=>{if(pn(b.paneName))return!1;const y=n.tabRefs[b.paneName];if(!y)return!1;if(!b.active)return!0;h=y[`offset${ac(p)}`],m=y[`client${ac(g)}`];const _=window.getComputedStyle(y);return g==="width"&&(m-=Number.parseFloat(_.paddingLeft)+Number.parseFloat(_.paddingRight),h+=Number.parseFloat(_.paddingLeft)),!1}),{[g]:`${m}px`,transform:`translate${ac(v)}(${h}px)`}},u=()=>s.value=l(),c=[],d=()=>{c.forEach(h=>h.stop()),c.length=0,Object.values(n.tabRefs).forEach(h=>{c.push(nr(h,u))})};Se(()=>n.tabs,async()=>{await Ye(),u(),d()},{immediate:!0});const f=nr(o,()=>u());return Sn(()=>{c.forEach(h=>h.stop()),c.length=0,f.stop()}),e({ref:o,update:u}),(h,m)=>a.value?(B(),Q("div",{key:0,ref_key:"barRef",ref:o,class:$([w(r).e("active-bar"),w(r).is(w(i).props.tabPosition)]),style:mt(s.value)},null,6)):ve("v-if",!0)}});const xCe=qe({panes:{type:me(Array),default:()=>Fs([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean,tabindex:{type:[String,Number],default:void 0}}),ACe={tabClick:(t,e,n)=>n instanceof Event,tabRemove:(t,e)=>e instanceof Event},qN="ElTabNav",PCe=le({name:qN,props:xCe,emits:ACe,setup(t,{expose:e,emit:n}){const i=Ne(UC);i||dr(qN,"");const r=De("tabs"),o=Vce(),s=zce(),a=H(),l=H(),u=H(),c=H({}),d=H(),f=H(!1),h=H(0),m=H(!1),g=H(!0),v=bi(),p=M(()=>["top","bottom"].includes(i.props.tabPosition)),b=M(()=>p.value?"width":"height"),y=M(()=>({transform:`translate${b.value==="width"?"X":"Y"}(-${h.value}px)`})),{width:_,height:C}=mD(a),{width:S,height:k}=mD(l,{width:0,height:0},{box:"border-box"}),T=M(()=>p.value?_.value:C.value),E=M(()=>p.value?S.value:k.value),{onWheel:x}=B_e({atStartEdge:M(()=>h.value<=0),atEndEdge:M(()=>E.value-h.value<=T.value),layout:M(()=>p.value?"horizontal":"vertical")},F=>{h.value=GI(h.value+F,0,E.value-T.value)}),P=()=>{if(!a.value)return;const F=a.value[`offset${ac(b.value)}`],j=h.value;if(!j)return;const U=j>F?j-F:0;h.value=U},A=()=>{if(!a.value||!l.value)return;const F=l.value[`offset${ac(b.value)}`],j=a.value[`offset${ac(b.value)}`],U=h.value;if(F-U<=j)return;const W=F-U>j*2?U+j:F-j;h.value=W},I=async()=>{const F=l.value;if(!f.value||!u.value||!a.value||!F)return;await Ye();const j=c.value[t.currentName];if(!j)return;const U=a.value,W=j.getBoundingClientRect(),J=U.getBoundingClientRect(),ne=p.value?F.offsetWidth-J.width:F.offsetHeight-J.height,he=h.value;let X=he;p.value?(W.leftJ.right&&(X=he+W.right-J.right)):(W.topJ.bottom&&(X=he+(W.bottom-J.bottom))),X=Math.max(X,0),h.value=Math.min(X,ne)},D=()=>{var F;if(!l.value||!a.value)return;t.stretch&&((F=d.value)==null||F.update());const j=l.value[`offset${ac(b.value)}`],U=a.value[`offset${ac(b.value)}`],W=h.value;U0&&(h.value=0))},q=F=>{const j=Bn(F);let U=0;switch(j){case Me.left:case Me.up:U=-1;break;case Me.right:case Me.down:U=1;break;default:return}const W=Array.from(F.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)"));let ne=W.indexOf(F.target)+U;ne<0?ne=W.length-1:ne>=W.length&&(ne=0),W[ne].focus({preventScroll:!0}),W[ne].click(),z()},z=()=>{g.value&&(m.value=!0)},R=()=>m.value=!1,O=(F,j)=>{c.value[j]=F},N=async()=>{await Ye();const F=c.value[t.currentName];F?.focus({preventScroll:!0})};return Se(o,F=>{F==="hidden"?g.value=!1:F==="visible"&&setTimeout(()=>g.value=!0,50)}),Se(s,F=>{F?setTimeout(()=>g.value=!0,50):g.value=!1}),nr(u,()=>{oR(D)}),Pt(()=>setTimeout(()=>I(),0)),ku(()=>D()),e({scrollToActiveTab:I,removeFocus:R,focusActiveTab:N,tabListRef:l,tabBarRef:d,scheduleRender:()=>vw(v)}),()=>{const F=f.value?[L("span",{class:[r.e("nav-prev"),r.is("disabled",!f.value.prev)],onClick:P},[L(He,null,{default:()=>[L(Am,null,null)]})]),L("span",{class:[r.e("nav-next"),r.is("disabled",!f.value.next)],onClick:A},[L(He,null,{default:()=>[L(oa,null,null)]})])]:null,j=t.panes.map((U,W)=>{var J,ne,he,X,se;const re=U.uid,ee=U.props.disabled,te=(ne=(J=U.props.name)!=null?J:U.index)!=null?ne:`${W}`,V=!ee&&(U.isClosable||U.props.closable!==!1&&t.editable);U.index=`${W}`;const K=V?L(He,{class:"is-icon-close",onClick:be=>n("tabRemove",U,be)},{default:()=>[L(cl,null,null)]}):null,G=((X=(he=U.slots).label)==null?void 0:X.call(he))||U.props.label,ye=!ee&&U.active?(se=t.tabindex)!=null?se:i.props.tabindex:-1;return L("div",{ref:be=>O(be,te),class:[r.e("item"),r.is(i.props.tabPosition),r.is("active",U.active),r.is("disabled",ee),r.is("closable",V),r.is("focus",m.value)],id:`tab-${te}`,key:`tab-${re}`,"aria-controls":`pane-${te}`,role:"tab","aria-selected":U.active,tabindex:ye,onFocus:()=>z(),onBlur:()=>R(),onClick:be=>{R(),n("tabClick",U,te,be)},onKeydown:be=>{const Ce=Bn(be);V&&(Ce===Me.delete||Ce===Me.backspace)&&n("tabRemove",U,be)}},[G,K])});return v.value,L("div",{ref:u,class:[r.e("nav-wrap"),r.is("scrollable",!!f.value),r.is(i.props.tabPosition)]},[F,L("div",{class:r.e("nav-scroll"),ref:a},[t.panes.length>0?L("div",{class:[r.e("nav"),r.is(i.props.tabPosition),r.is("stretch",t.stretch&&["top","bottom"].includes(i.props.tabPosition))],ref:l,style:y.value,role:"tablist",onKeydown:q,onWheel:x},[t.type?null:L(ECe,{ref:d,tabs:[...t.panes],tabRefs:c.value},null),j]):null])])}}}),ICe=qe({type:{type:String,values:["card","border-card",""],default:""},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},defaultValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:me(Function),default:()=>!0},stretch:Boolean,tabindex:{type:[String,Number],default:0}}),Vk=t=>ot(t)||St(t),RCe={[It]:t=>Vk(t),tabClick:(t,e)=>e instanceof Event,tabChange:t=>Vk(t),edit:(t,e)=>["remove","add"].includes(e),tabRemove:t=>Vk(t),tabAdd:()=>!0},MCe=le({name:"ElTabs",props:ICe,emits:RCe,setup(t,{emit:e,slots:n,expose:i}){var r;const o=De("tabs"),s=M(()=>["left","right"].includes(t.tabPosition)),{children:a,addChild:l,removeChild:u,ChildrenSorter:c}=Kge(Ct(),"ElTabPane"),d=H(),f=H((r=pn(t.modelValue)?t.defaultValue:t.modelValue)!=null?r:"0"),h=async(y,_=!1)=>{var C,S,k,T;if(!(f.value===y||pn(y)))try{let E;if(t.beforeLeave){const x=t.beforeLeave(y,f.value);E=x instanceof Promise?await x:x}else E=!0;if(E!==!1){const x=(C=a.value.find(P=>P.paneName===f.value))==null?void 0:C.isFocusInsidePane();f.value=y,_&&(e(It,y),e("tabChange",y)),(k=(S=d.value)==null?void 0:S.removeFocus)==null||k.call(S),x&&((T=d.value)==null||T.focusActiveTab())}}catch{}},m=(y,_,C)=>{y.props.disabled||(e("tabClick",y,C),h(_,!0))},g=(y,_)=>{y.props.disabled||pn(y.props.name)||(_.stopPropagation(),e("edit",y.props.name,"remove"),e("tabRemove",y.props.name))},v=()=>{e("edit",void 0,"add"),e("tabAdd")},p=y=>{const _=Bn(y);[Me.enter,Me.numpadEnter].includes(_)&&v()},b=y=>{const _=y.el.firstChild,C=["bottom","right"].includes(t.tabPosition)?y.children[0].el:y.children[1].el;_!==C&&_.before(C)};return Se(()=>t.modelValue,y=>h(y)),Se(f,async()=>{var y;await Ye(),(y=d.value)==null||y.scrollToActiveTab()}),qt(UC,{props:t,currentName:f,registerPane:l,unregisterPane:u,nav$:d}),i({currentName:f,get tabNavRef(){return IC(d.value,["scheduleRender"])}}),()=>{const y=n["add-icon"],_=t.editable||t.addable?L("div",{class:[o.e("new-tab"),s.value&&o.e("new-tab-vertical")],tabindex:t.tabindex,onClick:v,onKeydown:p},[y?we(n,"add-icon"):L(He,{class:o.is("icon-plus")},{default:()=>[L(fU,null,null)]})]):null,C=()=>L(PCe,{ref:d,currentName:f.value,editable:t.editable,type:t.type,panes:a.value,stretch:t.stretch,onTabClick:m,onTabRemove:g},null),S=L("div",{class:[o.e("header"),s.value&&o.e("header-vertical"),o.is(t.tabPosition)]},[L(c,null,{default:C,$stable:!0}),_]),k=L("div",{class:o.e("content")},[we(n,"default")]);return L("div",{class:[o.b(),o.m(t.tabPosition),{[o.m("card")]:t.type==="card",[o.m("border-card")]:t.type==="border-card"}],onVnodeMounted:b,onVnodeUpdated:b},[k,S])}}}),OCe=qe({label:{type:String,default:""},name:{type:[String,Number]},closable:{type:Boolean,default:void 0},disabled:Boolean,lazy:Boolean}),LCe=["id","aria-hidden","aria-labelledby"],jN="ElTabPane";var Bq=le({name:jN,__name:"tab-pane",props:OCe,setup(t){const e=t,n=Ct(),i=$o(),r=Ne(UC);r||dr(jN,"usage: ");const o=De("tab-pane"),s=H(),a=H(),l=M(()=>{var g;return(g=e.closable)!=null?g:r.props.closable}),u=M(()=>{var g;return r.currentName.value===((g=e.name)!=null?g:a.value)}),c=H(u.value),d=M(()=>{var g;return(g=e.name)!=null?g:a.value}),f=M(()=>!e.lazy||c.value||u.value),h=()=>{var g;return(g=s.value)==null?void 0:g.contains(document.activeElement)};Se(u,g=>{g&&(c.value=!0)});const m=on({uid:n.uid,getVnode:()=>n.vnode,slots:i,props:e,paneName:d,active:u,index:a,isClosable:l,isFocusInsidePane:h});return r.registerPane(m),Sn(()=>{r.unregisterPane(m)}),xI(()=>{var g;i.label&&((g=r.nav$.value)==null||g.scheduleRender())}),(g,v)=>f.value?Vt((B(),Q("div",{key:0,id:`pane-${d.value}`,ref_key:"paneRef",ref:s,class:$(w(o).b()),role:"tabpanel","aria-hidden":!u.value,"aria-labelledby":`tab-${d.value}`},[we(g.$slots,"default")],10,LCe)),[[On,u.value]]):ve("v-if",!0)}});const DCe=sn(MCe,{TabPane:Bq}),NCe=Zi(Bq),BCe=qe({type:{type:String,values:["primary","success","info","warning","danger",""],default:""},size:{type:String,values:yl,default:""},truncated:Boolean,lineClamp:{type:[String,Number]},tag:{type:String,default:"span"}});var VCe=le({name:"ElText",__name:"text",props:BCe,setup(t){const e=t,n=H(),i=fr(),r=De("text"),o=M(()=>[r.b(),r.m(e.type),r.m(i.value),r.is("truncated",e.truncated),r.is("line-clamp",!pn(e.lineClamp))]),s=()=>{var a,l,u,c,d,f,h;if(Rf().title)return;let g=!1;const v=((a=n.value)==null?void 0:a.textContent)||"";if(e.truncated){const p=(l=n.value)==null?void 0:l.offsetWidth,b=(u=n.value)==null?void 0:u.scrollWidth;p&&b&&b>p&&(g=!0)}else if(!pn(e.lineClamp)){const p=(c=n.value)==null?void 0:c.offsetHeight,b=(d=n.value)==null?void 0:d.scrollHeight;p&&b&&b>p&&(g=!0)}g?(f=n.value)==null||f.setAttribute("title",v):(h=n.value)==null||h.removeAttribute("title")};return Pt(s),ku(s),(a,l)=>(B(),_e(Gt(t.tag),{ref_key:"textRef",ref:n,class:$(o.value),style:mt({"-webkit-line-clamp":t.lineClamp})},{default:ce(()=>[we(a.$slots,"default")]),_:3},8,["class","style"]))}});const V2=sn(VCe);var FCe=Object.defineProperty,$Ce=(t,e,n)=>e in t?FCe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,K0=(t,e,n)=>$Ce(t,typeof e!="symbol"?e+"":e,n);const zCe="ElUpload";class F2 extends Error{constructor(e,n,i,r){super(e),K0(this,"name","UploadAjaxError"),K0(this,"status"),K0(this,"method"),K0(this,"url"),this.status=n,this.method=i,this.url=r}}function KN(t,e,n){let i;return n.response?i=`${n.response.error||n.response}`:n.responseText?i=`${n.responseText}`:i=`fail to ${e.method} ${t} ${n.status}`,new F2(i,n.status,e.method,t)}function HCe(t){const e=t.responseText||t.response;if(!e)return e;try{return JSON.parse(e)}catch{return e}}const UCe=t=>{typeof XMLHttpRequest>"u"&&dr(zCe,"XMLHttpRequest is undefined");const e=new XMLHttpRequest,n=t.action;e.upload&&e.upload.addEventListener("progress",o=>{const s=o;s.percent=o.total>0?o.loaded/o.total*100:0,t.onProgress(s)});const i=new FormData;if(t.data)for(const[o,s]of Object.entries(t.data))Pe(s)&&s.length?i.append(o,...s):i.append(o,s);i.append(t.filename,t.file,t.file.name),e.addEventListener("error",()=>{t.onError(KN(n,t,e))}),e.addEventListener("load",()=>{if(e.status<200||e.status>=300)return t.onError(KN(n,t,e));t.onSuccess(HCe(e))}),e.open(t.method,n,!0),t.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);const r=t.headers||{};if(r instanceof Headers)r.forEach((o,s)=>e.setRequestHeader(s,o));else for(const[o,s]of Object.entries(r))ir(s)||e.setRequestHeader(o,String(s));return e.send(i),e},Vq=["text","picture","picture-card"];let WCe=1;const $2=()=>Date.now()+WCe++,Fq=qe({action:{type:String,default:"#"},headers:{type:me(Object)},method:{type:String,default:"post"},data:{type:me([Object,Function,Promise]),default:()=>Fs({})},multiple:Boolean,name:{type:String,default:"file"},drag:Boolean,withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},fileList:{type:me(Array),default:()=>Fs([])},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:Vq,default:"text"},httpRequest:{type:me(Function),default:UCe},disabled:{type:Boolean,default:void 0},limit:Number,directory:Boolean}),qCe=qe({...Fq,beforeUpload:{type:me(Function),default:tn},beforeRemove:{type:me(Function)},onRemove:{type:me(Function),default:tn},onChange:{type:me(Function),default:tn},onPreview:{type:me(Function),default:tn},onSuccess:{type:me(Function),default:tn},onProgress:{type:me(Function),default:tn},onError:{type:me(Function),default:tn},onExceed:{type:me(Function),default:tn},crossorigin:{type:me(String)}}),$q=Symbol("uploadContextKey"),jCe=qe({files:{type:me(Array),default:()=>Fs([])},disabled:{type:Boolean,default:void 0},handlePreview:{type:me(Function),default:tn},listType:{type:String,values:Vq,default:"text"},crossorigin:{type:me(String)}}),KCe={remove:t=>!!t},GCe=["tabindex","aria-disabled","onKeydown"],YCe=["src","crossorigin"],XCe=["onClick"],JCe=["title"],ZCe=["onClick"],QCe=["onClick"];var GN=le({name:"ElUploadList",__name:"upload-list",props:jCe,emits:KCe,setup(t,{emit:e}){const n=t,i=e,{t:r}=Qt(),o=De("upload"),s=De("icon"),a=De("list"),l=Oi(),u=H(!1),c=M(()=>[o.b("list"),o.bm("list",n.listType),o.is("disabled",l.value)]),d=f=>{i("remove",f)};return(f,h)=>(B(),_e(Xz,{tag:"ul",class:$(c.value),name:w(a).b()},{default:ce(()=>[(B(!0),Q(rt,null,gn(t.files,(m,g)=>(B(),Q("li",{key:m.uid||m.name,class:$([w(o).be("list","item"),w(o).is(m.status),{focusing:u.value}]),tabindex:w(l)?void 0:0,"aria-disabled":w(l),role:"button",onKeydown:Pi(v=>!w(l)&&d(m),["delete"]),onFocus:h[0]||(h[0]=v=>u.value=!0),onBlur:h[1]||(h[1]=v=>u.value=!1),onClick:h[2]||(h[2]=v=>u.value=!1)},[we(f.$slots,"default",{file:m,index:g},()=>[t.listType==="picture"||m.status!=="uploading"&&t.listType==="picture-card"?(B(),Q("img",{key:0,class:$(w(o).be("list","item-thumbnail")),src:m.url,crossorigin:t.crossorigin,alt:""},null,10,YCe)):ve("v-if",!0),m.status==="uploading"||t.listType!=="picture-card"?(B(),Q("div",{key:1,class:$(w(o).be("list","item-info"))},[ie("a",{class:$(w(o).be("list","item-name")),onClick:Ot(v=>t.handlePreview(m),["prevent"])},[L(w(He),{class:$(w(s).m("document"))},{default:ce(()=>[L(w(wde))]),_:1},8,["class"]),ie("span",{class:$(w(o).be("list","item-file-name")),title:m.name},We(m.name),11,JCe)],10,XCe),m.status==="uploading"?(B(),_e(w(D_e),{key:0,type:t.listType==="picture-card"?"circle":"line","stroke-width":t.listType==="picture-card"?6:2,percentage:Number(m.percentage),style:mt(t.listType==="picture-card"?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):ve("v-if",!0)],2)):ve("v-if",!0),ie("label",{class:$(w(o).be("list","item-status-label"))},[t.listType==="text"?(B(),_e(w(He),{key:0,class:$([w(s).m("upload-success"),w(s).m("circle-check")])},{default:ce(()=>[L(w(DC))]),_:1},8,["class"])):["picture-card","picture"].includes(t.listType)?(B(),_e(w(He),{key:1,class:$([w(s).m("upload-success"),w(s).m("check")])},{default:ce(()=>[L(w(LC))]),_:1},8,["class"])):ve("v-if",!0)],2),w(l)?ve("v-if",!0):(B(),_e(w(He),{key:2,class:$(w(s).m("close")),onClick:v=>d(m)},{default:ce(()=>[L(w(cl))]),_:1},8,["class","onClick"])),ve(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),ve(" This is a bug which needs to be fixed "),ve(" TODO: Fix the incorrect navigation interaction "),w(l)?ve("v-if",!0):(B(),Q("i",{key:3,class:$(w(s).m("close-tip"))},We(w(r)("el.upload.deleteTip")),3)),t.listType==="picture-card"?(B(),Q("span",{key:4,class:$(w(o).be("list","item-actions"))},[ie("span",{class:$(w(o).be("list","item-preview")),onClick:v=>t.handlePreview(m)},[L(w(He),{class:$(w(s).m("zoom-in"))},{default:ce(()=>[L(w(mU))]),_:1},8,["class"])],10,ZCe),w(l)?ve("v-if",!0):(B(),Q("span",{key:0,class:$(w(o).be("list","item-delete")),onClick:v=>d(m)},[L(w(He),{class:$(w(s).m("delete"))},{default:ce(()=>[L(w(bde))]),_:1},8,["class"])],10,QCe))],2)):ve("v-if",!0)])],42,GCe))),128)),we(f.$slots,"append")]),_:3},8,["class","name"]))}});const eSe=qe({...Fq,beforeUpload:{type:me(Function),default:tn},onRemove:{type:me(Function),default:tn},onStart:{type:me(Function),default:tn},onSuccess:{type:me(Function),default:tn},onProgress:{type:me(Function),default:tn},onError:{type:me(Function),default:tn},onExceed:{type:me(Function),default:tn}}),tSe=qe({disabled:{type:Boolean,default:void 0},directory:Boolean}),nSe={file:t=>Pe(t)},YN="ElUploadDrag";var iSe=le({name:YN,__name:"upload-dragger",props:tSe,emits:nSe,setup(t,{emit:e}){const n=t,i=e;Ne($q)||dr(YN,"usage: ");const o=De("upload"),s=H(!1),a=Oi(),l=h=>new Promise((m,g)=>h.file(m,g)),u=async h=>{try{if(h.isFile){const m=await l(h);return m.isDirectory=!1,[m]}if(h.isDirectory){const m=h.createReader(),g=()=>new Promise((_,C)=>m.readEntries(_,C)),v=[];let p=await g();for(;p.length>0;)v.push(...p),p=await g();const b=v.map(_=>u(_).catch(()=>[])),y=await Promise.all(b);return N_(y)}}catch{return[]}return[]},c=async h=>{if(a.value)return;s.value=!1,h.stopPropagation();const m=Array.from(h.dataTransfer.files),g=h.dataTransfer.items||[];if(n.directory){const v=Array.from(g).map(b=>{var y;return(y=b?.webkitGetAsEntry)==null?void 0:y.call(b)}).filter(b=>b),p=await Promise.all(v.map(u));i("file",N_(p));return}m.forEach((v,p)=>{var b;const y=g[p],_=(b=y?.webkitGetAsEntry)==null?void 0:b.call(y);_&&(v.isDirectory=_.isDirectory)}),i("file",m)},d=()=>{a.value||(s.value=!0)},f=h=>{h.currentTarget.contains(h.relatedTarget)||(s.value=!1)};return(h,m)=>(B(),Q("div",{class:$([w(o).b("dragger"),w(o).is("dragover",s.value)]),onDrop:Ot(c,["prevent"]),onDragover:Ot(d,["prevent"]),onDragleave:Ot(f,["prevent"])},[we(h.$slots,"default")],34))}});const rSe=["tabindex","aria-disabled","onKeydown"],oSe=["name","disabled","multiple","accept","webkitdirectory"];var XN=le({name:"ElUploadContent",inheritAttrs:!1,__name:"upload-content",props:eSe,setup(t,{expose:e}){const n=t,i=De("upload"),r=Oi(),o=bi({}),s=bi(),a=g=>{if(g.length===0)return;const{autoUpload:v,limit:p,fileList:b,multiple:y,onStart:_,onExceed:C}=n;if(p&&b.length+g.length>p){C(g,b);return}y||(g=g.slice(0,1));for(const S of g){const k=S;k.uid=$2(),_(k),v&&l(k)}},l=async g=>{if(s.value.value="",!n.beforeUpload)return c(g);let v,p={};try{const y=n.data,_=n.beforeUpload(g);p=Cv(n.data)?V_(n.data):n.data,v=await _,Cv(n.data)&&$i(y,p)&&(p=V_(n.data))}catch{v=!1}if(v===!1){n.onRemove(g);return}let b=g;v instanceof Blob&&(v instanceof File?b=v:b=new File([v],g.name,{type:g.type})),c(Object.assign(b,{uid:g.uid}),p)},u=async(g,v)=>Xe(g)?g(v):g,c=async(g,v)=>{const{headers:p,data:b,method:y,withCredentials:_,name:C,action:S,onProgress:k,onSuccess:T,onError:E,httpRequest:x}=n;try{v=await u(v??b,g)}catch{n.onRemove(g);return}const{uid:P}=g,A={headers:p||{},withCredentials:_,file:g,data:v,method:y,filename:C,action:S,onProgress:D=>{k(D,g)},onSuccess:D=>{T(D,g),delete o.value[P]},onError:D=>{E(D,g),delete o.value[P]}},I=x(A);o.value[P]=I,I instanceof Promise&&I.then(A.onSuccess,A.onError)},d=g=>{const v=g.target.files;v&&a(Array.from(v))},f=()=>{r.value||(s.value.value="",s.value.click())},h=()=>{f()};return e({abort:g=>{jce(o.value).filter(g?([p])=>String(g.uid)===p:()=>!0).forEach(([p,b])=>{b instanceof XMLHttpRequest&&b.abort(),delete o.value[p]})},upload:l}),(g,v)=>(B(),Q("div",{class:$([w(i).b(),w(i).m(t.listType),w(i).is("drag",t.drag),w(i).is("disabled",w(r))]),tabindex:w(r)?void 0:0,"aria-disabled":w(r),role:"button",onClick:f,onKeydown:Pi(Ot(h,["self"]),["enter","space"])},[t.drag?(B(),_e(iSe,{key:0,disabled:w(r),directory:t.directory,onFile:a},{default:ce(()=>[we(g.$slots,"default")]),_:3},8,["disabled","directory"])):we(g.$slots,"default",{key:1}),ie("input",{ref_key:"inputRef",ref:s,class:$(w(i).e("input")),name:t.name,disabled:w(r),multiple:t.multiple,accept:t.accept,webkitdirectory:t.directory||void 0,type:"file",onChange:d,onClick:v[0]||(v[0]=Ot(()=>{},["stop"]))},null,42,oSe)],42,rSe))}});const JN="ElUpload",ZN=t=>{var e;(e=t.url)!=null&&e.startsWith("blob:")&&URL.revokeObjectURL(t.url)},sSe=(t,e)=>{const n=$ce(t,"fileList",void 0,{passive:!0}),i=m=>n.value.find(g=>g.uid===m.uid);function r(m){var g;(g=e.value)==null||g.abort(m)}function o(m=["ready","uploading","success","fail"]){n.value=n.value.filter(g=>!m.includes(g.status))}function s(m){n.value=n.value.filter(g=>g.uid!==m.uid)}const a=m=>{Ye(()=>t.onChange(m,n.value))},l=(m,g)=>{const v=i(g);v&&(console.error(m),v.status="fail",s(v),t.onError(m,v,n.value),a(v))},u=(m,g)=>{const v=i(g);v&&(t.onProgress(m,v,n.value),v.status="uploading",v.percentage=Math.round(m.percent))},c=(m,g)=>{const v=i(g);v&&(v.status="success",v.response=m,t.onSuccess(m,v,n.value),a(v))},d=m=>{ir(m.uid)&&(m.uid=$2());const g={name:m.name,percentage:0,status:"ready",size:m.size,raw:m,uid:m.uid};if(t.listType==="picture-card"||t.listType==="picture")try{g.url=URL.createObjectURL(m)}catch(v){v.message,t.onError(v,g,n.value)}n.value=[...n.value,g],a(g)},f=async m=>{const g=m instanceof File?i(m):m;g||dr(JN,"file to be removed not found");const v=p=>{r(p),s(p),t.onRemove(p,n.value),ZN(p)};t.beforeRemove?await t.beforeRemove(g,n.value)!==!1&&v(g):v(g)};function h(){n.value.filter(({status:m})=>m==="ready").forEach(({raw:m})=>{var g;return m&&((g=e.value)==null?void 0:g.upload(m))})}return Se(()=>t.listType,m=>{m!=="picture-card"&&m!=="picture"||(n.value=n.value.map(g=>{const{raw:v,url:p}=g;if(!p&&v)try{g.url=URL.createObjectURL(v)}catch(b){t.onError(b,g,n.value)}return g}))}),Se(n,m=>{for(const g of m)g.uid||(g.uid=$2()),g.status||(g.status="success")},{immediate:!0,deep:!0}),{uploadFiles:n,abort:r,clearFiles:o,handleError:l,handleProgress:u,handleStart:d,handleSuccess:c,handleRemove:f,submit:h,revokeFileObjectURL:ZN}};var aSe=le({name:"ElUpload",__name:"upload",props:qCe,setup(t,{expose:e}){const n=t,i=Oi(),r=bi(),{abort:o,submit:s,clearFiles:a,uploadFiles:l,handleStart:u,handleError:c,handleRemove:d,handleSuccess:f,handleProgress:h,revokeFileObjectURL:m}=sSe(n,r),g=M(()=>n.listType==="picture-card"),v=M(()=>({...n,fileList:l.value,onStart:u,onProgress:h,onSuccess:f,onError:c,onRemove:d}));return Sn(()=>{l.value.forEach(m)}),qt($q,{accept:An(n,"accept")}),e({abort:o,submit:s,clearFiles:a,handleStart:u,handleRemove:d}),(p,b)=>(B(),Q("div",null,[g.value&&t.showFileList?(B(),_e(GN,{key:0,disabled:w(i),"list-type":t.listType,files:w(l),crossorigin:t.crossorigin,"handle-preview":t.onPreview,onRemove:w(d)},kc({append:ce(()=>[L(XN,Lt({ref_key:"uploadRef",ref:r},v.value),{default:ce(()=>[p.$slots.trigger?we(p.$slots,"trigger",{key:0}):ve("v-if",!0),!p.$slots.trigger&&p.$slots.default?we(p.$slots,"default",{key:1}):ve("v-if",!0)]),_:3},16)]),_:2},[p.$slots.file?{name:"default",fn:ce(({file:y,index:_})=>[we(p.$slots,"file",{file:y,index:_})]),key:"0"}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):ve("v-if",!0),!g.value||g.value&&!t.showFileList?(B(),_e(XN,Lt({key:1,ref_key:"uploadRef",ref:r},v.value),{default:ce(()=>[p.$slots.trigger?we(p.$slots,"trigger",{key:0}):ve("v-if",!0),!p.$slots.trigger&&p.$slots.default?we(p.$slots,"default",{key:1}):ve("v-if",!0)]),_:3},16)):ve("v-if",!0),p.$slots.trigger?we(p.$slots,"default",{key:2}):ve("v-if",!0),we(p.$slots,"tip"),!g.value&&t.showFileList?(B(),_e(GN,{key:3,disabled:w(i),"list-type":t.listType,files:w(l),crossorigin:t.crossorigin,"handle-preview":t.onPreview,onRemove:w(d)},kc({_:2},[p.$slots.file?{name:"default",fn:ce(({file:y,index:_})=>[we(p.$slots,"file",{file:y,index:_})]),key:"0"}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):ve("v-if",!0)]))}});const lSe=sn(aSe);function uSe(t,e){let n;const i=H(!1),r=on({...t,originalPosition:"",originalOverflow:"",visible:!1});function o(h){r.text=h}function s(){const h=r.parent,m=f.ns;if(!h.vLoadingAddClassList){let g=h.getAttribute("loading-number");g=Number.parseInt(g)-1,g?h.setAttribute("loading-number",g.toString()):(os(h,m.bm("parent","relative")),h.removeAttribute("loading-number")),os(h,m.bm("parent","hidden"))}a(),d.unmount()}function a(){var h,m;(m=(h=f.$el)==null?void 0:h.parentNode)==null||m.removeChild(f.$el)}function l(){var h;t.beforeClose&&!t.beforeClose()||(i.value=!0,clearTimeout(n),n=setTimeout(u,400),r.visible=!1,(h=t.closed)==null||h.call(t))}function u(){if(!i.value)return;const h=r.parent;i.value=!1,h.vLoadingAddClassList=void 0,s()}const d=L_(le({name:"ElLoading",setup(h,{expose:m}){const{ns:g,zIndex:v}=nR("loading");return m({ns:g,zIndex:v}),()=>{const p=r.spinner||r.svg,b=nt("svg",{class:"circular",viewBox:r.svgViewBox?r.svgViewBox:"0 0 50 50",...p?{innerHTML:p}:{}},[nt("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),y=r.text?nt("p",{class:g.b("text")},[r.text]):void 0;return nt(ya,{name:g.b("fade"),onAfterLeave:u},{default:ce(()=>[Vt(L("div",{style:{backgroundColor:r.background||""},class:[g.b("mask"),r.customClass,g.is("fullscreen",r.fullscreen)]},[nt("div",{class:g.b("spinner")},[b,y])]),[[On,r.visible]])])})}}}));Object.assign(d._context,e??{});const f=d.mount(document.createElement("div"));return{...Sr(r),setText:o,removeElLoadingChild:a,close:l,handleAfterLeave:u,vm:f,get $el(){return f.$el}}}let G0;const cm=function(t={},e){if(!Zt)return;const n=cSe(t);if(n.fullscreen&&G0)return G0;const i=uSe({...n,closed:()=>{var o;(o=n.closed)==null||o.call(n),n.fullscreen&&(G0=void 0)}},e??cm._context);dSe(n,n.parent,i),QN(n,n.parent,i),n.parent.vLoadingAddClassList=()=>QN(n,n.parent,i);let r=n.parent.getAttribute("loading-number");return r?r=`${Number.parseInt(r)+1}`:r="1",n.parent.setAttribute("loading-number",r),n.parent.appendChild(i.$el),Ye(()=>i.visible.value=n.visible),n.fullscreen&&(G0=i),i},cSe=t=>{var e,n,i,r;let o;return ot(t.target)?o=(e=document.querySelector(t.target))!=null?e:document.body:o=t.target||document.body,{parent:o===document.body||t.body?document.body:o,background:t.background||"",svg:t.svg||"",svgViewBox:t.svgViewBox||"",spinner:t.spinner||!1,text:t.text||"",fullscreen:o===document.body&&((n=t.fullscreen)!=null?n:!0),lock:(i=t.lock)!=null?i:!1,customClass:t.customClass||"",visible:(r=t.visible)!=null?r:!0,beforeClose:t.beforeClose,closed:t.closed,target:o}},dSe=async(t,e,n)=>{const{nextZIndex:i}=n.vm.zIndex||n.vm._.exposed.zIndex,r={};if(t.fullscreen)n.originalPosition.value=sc(document.body,"position"),n.originalOverflow.value=sc(document.body,"overflow"),r.zIndex=i();else if(t.parent===document.body){n.originalPosition.value=sc(document.body,"position"),await Ye();for(const o of["top","left"]){const s=o==="top"?"scrollTop":"scrollLeft";r[o]=`${t.target.getBoundingClientRect()[o]+document.body[s]+document.documentElement[s]-Number.parseInt(sc(document.body,`margin-${o}`),10)}px`}for(const o of["height","width"])r[o]=`${t.target.getBoundingClientRect()[o]}px`}else n.originalPosition.value=sc(e,"position");for(const[o,s]of Object.entries(r))n.$el.style[o]=s},QN=(t,e,n)=>{const i=n.vm.ns||n.vm._.exposed.ns;["absolute","fixed","sticky"].includes(n.originalPosition.value)?os(e,i.bm("parent","relative")):Qs(e,i.bm("parent","relative")),t.fullscreen&&t.lock?Qs(e,i.bm("parent","hidden")):os(e,i.bm("parent","hidden"))};cm._context=null;const bp=Symbol("ElLoading"),Nd=t=>`element-loading-${bl(t)}`,e3=(t,e)=>{var n,i,r,o;const s=e.instance,a=h=>_t(e.value)?e.value[h]:void 0,l=h=>{const m=ot(h)&&s?.[h]||h;return H(m)},u=h=>l(a(h)||t.getAttribute(Nd(h))),c=(n=a("fullscreen"))!=null?n:e.modifiers.fullscreen,d={text:u("text"),svg:u("svg"),svgViewBox:u("svgViewBox"),spinner:u("spinner"),background:u("background"),customClass:u("customClass"),fullscreen:c,target:(i=a("target"))!=null?i:c?void 0:t,body:(r=a("body"))!=null?r:e.modifiers.body,lock:(o=a("lock"))!=null?o:e.modifiers.lock},f=cm(d);f._context=dm._context,t[bp]={options:d,instance:f}},fSe=(t,e)=>{for(const n of Object.keys(t))rn(t[n])&&(t[n].value=e[n])},dm={mounted(t,e){e.value&&e3(t,e)},updated(t,e){const n=t[bp];if(!e.value){n?.instance.close(),t[bp]=null;return}n?fSe(n.options,_t(e.value)?e.value:{text:t.getAttribute(Nd("text")),svg:t.getAttribute(Nd("svg")),svgViewBox:t.getAttribute(Nd("svgViewBox")),spinner:t.getAttribute(Nd("spinner")),background:t.getAttribute(Nd("background")),customClass:t.getAttribute(Nd("customClass"))}):e3(t,e)},unmounted(t){var e;(e=t[bp])==null||e.instance.close(),t[bp]=null}};dm._context=null;const hSe={install(t){cm._context=t._context,dm._context=t._context,t.directive("loading",dm),t.config.globalProperties.$loading=cm},directive:dm,service:cm},z2="_trap-focus-children",qd=[],t3=t=>{if(qd.length===0)return;const e=Bn(t),n=qd[qd.length-1][z2];if(n.length>0&&e===Me.tab){if(n.length===1){t.preventDefault(),document.activeElement!==n[0]&&n[0].focus();return}const i=t.shiftKey,r=t.target===n[0],o=t.target===n[n.length-1];r&&i&&(t.preventDefault(),n[n.length-1].focus()),o&&!i&&(t.preventDefault(),n[0].focus())}},mSe={beforeMount(t){t[z2]=MD(t),qd.push(t),qd.length<=1&&document.addEventListener("keydown",t3)},updated(t){Ye(()=>{t[z2]=MD(t)})},unmounted(){qd.shift(),qd.length===0&&document.removeEventListener("keydown",t3)}};var gSe=le({name:"ElMessageBox",directives:{TrapFocus:mSe},components:{ElButton:Hi,ElFocusTrap:VC,ElInput:cr,ElOverlay:GW,ElIcon:He,...lfe},inheritAttrs:!1,props:{buttonSize:{type:String,validator:pq},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:Boolean,container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(t,{emit:e}){const{locale:n,zIndex:i,ns:r,size:o}=nR("message-box",M(()=>t.buttonSize)),{t:s}=n,{nextZIndex:a}=i,l=H(!1),u=on({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",cancelButtonType:"",confirmButtonType:"primary",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",closeIcon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:"",inputValidator:void 0,inputErrorMessage:"",message:"",modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:ca(xc),cancelButtonLoadingIcon:ca(xc),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:a()}),c=M(()=>{const R=u.type;return{[r.bm("icon",R)]:R&&$_[R]}}),d=as(),f=as(),h=M(()=>{const R=u.type;return u.icon||R&&$_[R]||""}),m=M(()=>!!u.message),g=H(),v=H(),p=H(),b=H(),y=H(),_=M(()=>u.confirmButtonClass);Se(()=>u.inputValue,async R=>{await Ye(),t.boxType==="prompt"&&R&&I()},{immediate:!0}),Se(()=>l.value,R=>{var O,N;R&&(t.boxType!=="prompt"&&(u.autofocus?p.value=(N=(O=y.value)==null?void 0:O.$el)!=null?N:g.value:p.value=g.value),u.zIndex=a()),t.boxType==="prompt"&&(R?Ye().then(()=>{var F;b.value&&b.value.$el&&(u.autofocus?p.value=(F=D())!=null?F:g.value:p.value=g.value)}):(u.editorErrorMessage="",u.validateError=!1))});const C=M(()=>t.draggable),S=M(()=>t.overflow),{isDragging:k}=XW(g,v,C,S);Pt(async()=>{await Ye(),t.closeOnHashChange&&window.addEventListener("hashchange",T)}),Sn(()=>{t.closeOnHashChange&&window.removeEventListener("hashchange",T)});function T(){l.value&&(l.value=!1,Ye(()=>{u.action&&e("action",u.action)}))}const E=()=>{t.closeOnClickModal&&A(u.distinguishCancelAndClose?"close":"cancel")},x=BR(E),P=R=>{var O;if(u.inputType!=="textarea"&&!((O=b.value)!=null&&O.isComposing))return R.preventDefault(),A("confirm")},A=R=>{var O;t.boxType==="prompt"&&R==="confirm"&&!I()||(u.action=R,u.beforeClose?(O=u.beforeClose)==null||O.call(u,R,u,T):T())},I=()=>{if(t.boxType==="prompt"){const R=u.inputPattern;if(R&&!R.test(u.inputValue||""))return u.editorErrorMessage=u.inputErrorMessage||s("el.messagebox.error"),u.validateError=!0,!1;const O=u.inputValidator;if(Xe(O)){const N=O(u.inputValue);if(N===!1)return u.editorErrorMessage=u.inputErrorMessage||s("el.messagebox.error"),u.validateError=!0,!1;if(ot(N))return u.editorErrorMessage=N,u.validateError=!0,!1}}return u.editorErrorMessage="",u.validateError=!1,!0},D=()=>{var R,O;const N=(R=b.value)==null?void 0:R.$refs;return(O=N?.input)!=null?O:N?.textarea},q=()=>{A("close")},z=()=>{t.closeOnPressEscape&&q()};return t.lockScroll&&FR(l,{ns:r}),{...Sr(u),ns:r,overlayEvent:x,visible:l,hasMessage:m,typeClass:c,contentId:d,inputId:f,btnSize:o,iconComponent:h,confirmButtonClasses:_,rootRef:g,focusStartRef:p,headerRef:v,inputRef:b,isDragging:k,confirmRef:y,doClose:T,handleClose:q,onCloseRequested:z,handleWrapperClick:E,handleInputEnter:P,handleAction:A,t:s}}});const pSe=["aria-label","aria-describedby"],vSe=["aria-label"],bSe=["id"];function ySe(t,e,n,i,r,o){const s=Bt("el-icon"),a=Bt("el-input"),l=Bt("el-button"),u=Bt("el-focus-trap"),c=Bt("el-overlay");return B(),_e(ya,{name:"fade-in-linear",onAfterLeave:e[11]||(e[11]=d=>t.$emit("vanish")),persisted:""},{default:ce(()=>[Vt(L(c,{"z-index":t.zIndex,"overlay-class":[t.ns.is("message-box"),t.modalClass],mask:t.modal},{default:ce(()=>[ie("div",{role:"dialog","aria-label":t.title,"aria-modal":"true","aria-describedby":t.showInput?void 0:t.contentId,class:$(`${t.ns.namespace.value}-overlay-message-box`),onClick:e[8]||(e[8]=(...d)=>t.overlayEvent.onClick&&t.overlayEvent.onClick(...d)),onMousedown:e[9]||(e[9]=(...d)=>t.overlayEvent.onMousedown&&t.overlayEvent.onMousedown(...d)),onMouseup:e[10]||(e[10]=(...d)=>t.overlayEvent.onMouseup&&t.overlayEvent.onMouseup(...d))},[L(u,{loop:"",trapped:t.visible,"focus-trap-el":t.rootRef,"focus-start-el":t.focusStartRef,onReleaseRequested:t.onCloseRequested},{default:ce(()=>[ie("div",{ref:"rootRef",class:$([t.ns.b(),t.customClass,t.ns.is("draggable",t.draggable),t.ns.is("dragging",t.isDragging),{[t.ns.m("center")]:t.center}]),style:mt(t.customStyle),tabindex:"-1",onClick:e[7]||(e[7]=Ot(()=>{},["stop"]))},[t.title!==null&&t.title!==void 0?(B(),Q("div",{key:0,ref:"headerRef",class:$([t.ns.e("header"),{"show-close":t.showClose}])},[ie("div",{class:$(t.ns.e("title"))},[t.iconComponent&&t.center?(B(),_e(s,{key:0,class:$([t.ns.e("status"),t.typeClass])},{default:ce(()=>[(B(),_e(Gt(t.iconComponent)))]),_:1},8,["class"])):ve("v-if",!0),ie("span",null,We(t.title),1)],2),t.showClose?(B(),Q("button",{key:0,type:"button",class:$(t.ns.e("headerbtn")),"aria-label":t.t("el.messagebox.close"),onClick:e[0]||(e[0]=d=>t.handleAction(t.distinguishCancelAndClose?"close":"cancel")),onKeydown:e[1]||(e[1]=Pi(Ot(d=>t.handleAction(t.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"]))},[L(s,{class:$(t.ns.e("close"))},{default:ce(()=>[(B(),_e(Gt(t.closeIcon||"close")))]),_:1},8,["class"])],42,vSe)):ve("v-if",!0)],2)):ve("v-if",!0),ie("div",{id:t.contentId,class:$(t.ns.e("content"))},[ie("div",{class:$(t.ns.e("container"))},[t.iconComponent&&!t.center&&t.hasMessage?(B(),_e(s,{key:0,class:$([t.ns.e("status"),t.typeClass])},{default:ce(()=>[(B(),_e(Gt(t.iconComponent)))]),_:1},8,["class"])):ve("v-if",!0),t.hasMessage?(B(),Q("div",{key:1,class:$(t.ns.e("message"))},[we(t.$slots,"default",{},()=>[t.dangerouslyUseHTMLString?(B(),_e(Gt(t.showInput?"label":"p"),{key:1,for:t.showInput?t.inputId:void 0,innerHTML:t.message},null,8,["for","innerHTML"])):(B(),_e(Gt(t.showInput?"label":"p"),{key:0,for:t.showInput?t.inputId:void 0,textContent:We(t.message)},null,8,["for","textContent"]))])],2)):ve("v-if",!0)],2),Vt(ie("div",{class:$(t.ns.e("input"))},[L(a,{id:t.inputId,ref:"inputRef",modelValue:t.inputValue,"onUpdate:modelValue":e[2]||(e[2]=d=>t.inputValue=d),type:t.inputType,placeholder:t.inputPlaceholder,"aria-invalid":t.validateError,class:$({invalid:t.validateError}),onKeydown:Pi(t.handleInputEnter,["enter"])},null,8,["id","modelValue","type","placeholder","aria-invalid","class","onKeydown"]),ie("div",{class:$(t.ns.e("errormsg")),style:mt({visibility:t.editorErrorMessage?"visible":"hidden"})},We(t.editorErrorMessage),7)],2),[[On,t.showInput]])],10,bSe),ie("div",{class:$(t.ns.e("btns"))},[t.showCancelButton?(B(),_e(l,{key:0,type:t.cancelButtonType==="text"?"":t.cancelButtonType,text:t.cancelButtonType==="text",loading:t.cancelButtonLoading,"loading-icon":t.cancelButtonLoadingIcon,class:$([t.cancelButtonClass]),round:t.roundButton,size:t.btnSize,onClick:e[3]||(e[3]=d=>t.handleAction("cancel")),onKeydown:e[4]||(e[4]=Pi(Ot(d=>t.handleAction("cancel"),["prevent"]),["enter"]))},{default:ce(()=>[dt(We(t.cancelButtonText||t.t("el.messagebox.cancel")),1)]),_:1},8,["type","text","loading","loading-icon","class","round","size"])):ve("v-if",!0),Vt(L(l,{ref:"confirmRef",type:t.confirmButtonType==="text"?"":t.confirmButtonType,text:t.confirmButtonType==="text",loading:t.confirmButtonLoading,"loading-icon":t.confirmButtonLoadingIcon,class:$([t.confirmButtonClasses]),round:t.roundButton,disabled:t.confirmButtonDisabled,size:t.btnSize,onClick:e[5]||(e[5]=d=>t.handleAction("confirm")),onKeydown:e[6]||(e[6]=Pi(Ot(d=>t.handleAction("confirm"),["prevent"]),["enter"]))},{default:ce(()=>[dt(We(t.confirmButtonText||t.t("el.messagebox.confirm")),1)]),_:1},8,["type","text","loading","loading-icon","class","round","disabled","size"]),[[On,t.showConfirmButton]])],2)],6)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,pSe)]),_:3},8,["z-index","overlay-class","mask"]),[[On,t.visible]])]),_:3})}var wSe=Tr(gSe,[["render",ySe]]);const qv=new Map,_Se=t=>{let e=document.body;return t.appendTo&&(ot(t.appendTo)&&(e=document.querySelector(t.appendTo)),Qo(t.appendTo)&&(e=t.appendTo),Qo(e)||(e=document.body)),e},CSe=(t,e,n=null)=>{const i=L(wSe,t,Xe(t.message)||yi(t.message)?{default:Xe(t.message)?t.message:()=>t.message}:null);return i.appContext=n,Tm(i,e),_Se(t).appendChild(e.firstElementChild),i.component},SSe=()=>document.createElement("div"),kSe=(t,e)=>{const n=SSe();t.onVanish=()=>{Tm(null,n),qv.delete(r)},t.onAction=o=>{const s=qv.get(r);let a;t.showInput?a={value:r.inputValue,action:o}:a=o,t.callback?t.callback(a,i.proxy):o==="cancel"||o==="close"?t.distinguishCancelAndClose&&o!=="cancel"?s.reject("close"):s.reject("cancel"):s.resolve(a)};const i=CSe(t,n,e),r=i.proxy;for(const o in t)Jt(t,o)&&!Jt(r.$props,o)&&(o==="closeIcon"&&_t(t[o])?r[o]=ca(t[o]):r[o]=t[o]);return r.visible=!0,r};function hg(t,e=null){if(!Zt)return Promise.reject();let n;return ot(t)||yi(t)?t={message:t}:n=t.callback,new Promise((i,r)=>{const o=kSe(t,e??hg._context);qv.set(o,{options:t,callback:n,resolve:i,reject:r})})}const TSe=["alert","confirm","prompt"],ESe={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};TSe.forEach(t=>{hg[t]=xSe(t)});function xSe(t){return(e,n,i,r)=>{let o="";return _t(n)?(i=n,o=""):pn(n)?o="":o=n,hg(Object.assign({title:o,message:e,type:"",...ESe[t]},i,{boxType:t}),r)}}hg.close=()=>{qv.forEach((t,e)=>{e.doClose()}),qv.clear()};hg._context=null;const Ju=hg;Ju.install=t=>{Ju._context=t._context,t.config.globalProperties.$msgbox=Ju,t.config.globalProperties.$messageBox=Ju,t.config.globalProperties.$alert=Ju.alert,t.config.globalProperties.$confirm=Ju.confirm,t.config.globalProperties.$prompt=Ju.prompt};const ASe=Ju,zq=["primary","success","info","warning","error"],PSe=qe({customClass:{type:String,default:""},dangerouslyUseHTMLString:Boolean,duration:{type:Number,default:4500},icon:{type:ri},id:{type:String,default:""},message:{type:me([String,Object,Function]),default:""},offset:{type:Number,default:0},onClick:{type:me(Function),default:()=>{}},onClose:{type:me(Function),required:!0},position:{type:String,values:["top-right","top-left","bottom-right","bottom-left"],default:"top-right"},showClose:{type:Boolean,default:!0},title:{type:String,default:""},type:{type:String,values:[...zq,""],default:""},zIndex:Number,closeIcon:{type:ri,default:cl}}),ISe={destroy:()=>!0},RSe=["id"],MSe=["textContent"],OSe={key:0},LSe=["innerHTML"];var DSe=le({name:"ElNotification",__name:"notification",props:PSe,emits:ISe,setup(t,{expose:e}){const n=t,{ns:i,zIndex:r}=nR("notification"),{nextZIndex:o,currentZIndex:s}=r,a=H(!1);let l;const u=M(()=>{const b=n.type;return b&&$_[n.type]?i.m(b):""}),c=M(()=>n.type&&$_[n.type]||n.icon),d=M(()=>n.position.endsWith("right")?"right":"left"),f=M(()=>n.position.startsWith("top")?"top":"bottom"),h=M(()=>{var b;return{[f.value]:`${n.offset}px`,zIndex:(b=n.zIndex)!=null?b:s.value}});function m(){n.duration>0&&({stop:l}=Dv(()=>{a.value&&v()},n.duration))}function g(){l?.()}function v(){a.value=!1}function p(b){switch(Bn(b)){case Me.delete:case Me.backspace:g();break;case Me.esc:a.value&&v();break;default:m();break}}return Pt(()=>{m(),o(),a.value=!0}),Kn(document,"keydown",p),e({visible:a,close:v}),(b,y)=>(B(),_e(ya,{name:w(i).b("fade"),onBeforeLeave:t.onClose,onAfterLeave:y[1]||(y[1]=_=>b.$emit("destroy")),persisted:""},{default:ce(()=>[Vt(ie("div",{id:t.id,class:$([w(i).b(),t.customClass,d.value]),style:mt(h.value),role:"alert",onMouseenter:g,onMouseleave:m,onClick:y[0]||(y[0]=(..._)=>t.onClick&&t.onClick(..._))},[c.value?(B(),_e(w(He),{key:0,class:$([w(i).e("icon"),u.value])},{default:ce(()=>[(B(),_e(Gt(c.value)))]),_:1},8,["class"])):ve("v-if",!0),ie("div",{class:$(w(i).e("group"))},[ie("h2",{class:$(w(i).e("title")),textContent:We(t.title)},null,10,MSe),Vt(ie("div",{class:$(w(i).e("content")),style:mt(t.title?void 0:{margin:0})},[we(b.$slots,"default",{},()=>[t.dangerouslyUseHTMLString?(B(),Q(rt,{key:1},[ve(" Caution here, message could've been compromised, never use user's input as message "),ie("p",{innerHTML:t.message},null,8,LSe)],2112)):(B(),Q("p",OSe,We(t.message),1))])],6),[[On,t.message]]),t.showClose?(B(),_e(w(He),{key:0,class:$(w(i).e("closeBtn")),onClick:Ot(v,["stop"])},{default:ce(()=>[(B(),_e(Gt(t.closeIcon)))]),_:1},8,["class"])):ve("v-if",!0)],2)],46,RSe),[[On,a.value]])]),_:3},8,["name","onBeforeLeave"]))}});const Bm={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]},X_=16;let NSe=1;const _f=function(t={},e){if(!Zt)return{close:()=>{}};(ot(t)||yi(t))&&(t={message:t});const n=t.position||"top-right";let i=t.offset||0;Bm[n].forEach(({vm:c})=>{var d;i+=(((d=c.el)==null?void 0:d.offsetHeight)||0)+X_}),i+=X_;const r=`notification_${NSe++}`,o=t.onClose,s={...t,offset:i,id:r,onClose:()=>{BSe(r,n,o)}};let a=document.body;Qo(t.appendTo)?a=t.appendTo:ot(t.appendTo)&&(a=document.querySelector(t.appendTo)),Qo(a)||(a=document.body);const l=document.createElement("div"),u=L(DSe,s,Xe(s.message)?s.message:yi(s.message)?()=>s.message:null);return u.appContext=pn(e)?_f._context:e,u.props.onDestroy=()=>{Tm(null,l)},Tm(u,l),Bm[n].push({vm:u}),a.appendChild(l.firstElementChild),{close:()=>{u.component.exposed.visible.value=!1}}};zq.forEach(t=>{_f[t]=(e={},n)=>((ot(e)||yi(e))&&(e={message:e}),_f({...e,type:t},n))});function BSe(t,e,n){const i=Bm[e],r=i.findIndex(({vm:u})=>{var c;return((c=u.component)==null?void 0:c.props.id)===t});if(r===-1)return;const{vm:o}=i[r];if(!o)return;n?.(o);const s=o.el.offsetHeight,a=e.split("-")[0];i.splice(r,1);const l=i.length;if(!(l<1))for(let u=r;u{e.component.exposed.visible.value=!1})}function FSe(t="top-right"){var e,n,i,r;let o=((i=(n=(e=Bm[t][0])==null?void 0:e.vm.component)==null?void 0:n.props)==null?void 0:i.offset)||0;for(const{vm:s}of Bm[t])s.component.props.offset=o,o+=(((r=s.el)==null?void 0:r.offsetHeight)||0)+X_}_f.closeAll=VSe;_f.updateOffsets=FSe;_f._context=null;const $Se=Yce(_f,"$notify"),zSe="_login_wrapper_lufec_1",HSe="_particles_lufec_32",USe="_particle_lufec_32",WSe="_container_lufec_120",qSe="_login_cover_lufec_142",jSe="_cube_container_lufec_154",KSe="_cube_lufec_154",GSe="_cube_face_lufec_170",YSe="_cube_front_lufec_184",XSe="_cube_back_lufec_187",JSe="_cube_right_lufec_190",ZSe="_cube_left_lufec_193",QSe="_cube_top_lufec_196",eke="_cube_bottom_lufec_199",tke="_login_title_lufec_202",nke="_login_subtitle_lufec_213",ike="_waves_lufec_221",rke="_wave_lufec_221",oke="_wave_1_lufec_239",ske="_wave_2_lufec_244",ake="_wave_3_lufec_250",lke="_bubbles_lufec_256",uke="_bubble_lufec_256",cke="_login_body_lufec_346",dke="_login_body_title_lufec_352",fke="_remember_wrapper_lufec_392",hke="_login_button_lufec_496",bn={login_wrapper:zSe,particles:HSe,particle:USe,container:WSe,login_cover:qSe,cube_container:jSe,cube:KSe,cube_face:GSe,cube_front:YSe,cube_back:XSe,cube_right:JSe,cube_left:ZSe,cube_top:QSe,cube_bottom:eke,login_title:tke,login_subtitle:nke,waves:ike,wave:rke,wave_1:oke,wave_2:ske,wave_3:ake,bubbles:lke,bubble:uke,login_body:cke,login_body_title:dke,remember_wrapper:fke,login_button:hke};const Lh=typeof document<"u";function Hq(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function mke(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&Hq(t.default)}const In=Object.assign;function Fk(t,e){const n={};for(const i in e){const r=e[i];n[i]=ma(r)?r.map(t):t(r)}return n}const Gp=()=>{},ma=Array.isArray;function n3(t,e){const n={};for(const i in t)n[i]=i in e?e[i]:t[i];return n}let Ti=(function(t){return t[t.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",t[t.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",t[t.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",t[t.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",t[t.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",t})({});const Uq=Symbol("");Ti.MATCHER_NOT_FOUND+"",Ti.NAVIGATION_GUARD_REDIRECT+"",Ti.NAVIGATION_ABORTED+"",Ti.NAVIGATION_CANCELLED+"",Ti.NAVIGATION_DUPLICATED+"";function Vm(t,e){return In(new Error,{type:t,[Uq]:!0},e)}function Pl(t,e){return t instanceof Error&&Uq in t&&(e==null||!!(t.type&e))}const gke=["params","query","hash"];function pke(t){if(typeof t=="string")return t;if(t.path!=null)return t.path;const e={};for(const n of gke)n in t&&(e[n]=t[n]);return JSON.stringify(e,null,2)}const vke=Symbol(""),i3=Symbol(""),WC=Symbol(""),YR=Symbol(""),H2=Symbol("");function XR(){return Ne(WC)}function Wq(t){return Ne(YR)}const qq=/#/g,bke=/&/g,yke=/\//g,wke=/=/g,_ke=/\?/g,jq=/\+/g,Cke=/%5B/g,Ske=/%5D/g,Kq=/%5E/g,kke=/%60/g,Gq=/%7B/g,Tke=/%7C/g,Yq=/%7D/g,Eke=/%20/g;function JR(t){return t==null?"":encodeURI(""+t).replace(Tke,"|").replace(Cke,"[").replace(Ske,"]")}function xke(t){return JR(t).replace(Gq,"{").replace(Yq,"}").replace(Kq,"^")}function U2(t){return JR(t).replace(jq,"%2B").replace(Eke,"+").replace(qq,"%23").replace(bke,"%26").replace(kke,"`").replace(Gq,"{").replace(Yq,"}").replace(Kq,"^")}function Ake(t){return U2(t).replace(wke,"%3D")}function Pke(t){return JR(t).replace(qq,"%23").replace(_ke,"%3F")}function Ike(t){return Pke(t).replace(yke,"%2F")}function jv(t){if(t==null)return null;try{return decodeURIComponent(""+t)}catch{}return""+t}const Rke=/\/$/,Mke=t=>t.replace(Rke,"");function $k(t,e,n="/"){let i,r={},o="",s="";const a=e.indexOf("#");let l=e.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(i=e.slice(0,l),o=e.slice(l,a>0?a:e.length),r=t(o.slice(1))),a>=0&&(i=i||e.slice(0,a),s=e.slice(a,e.length)),i=Nke(i??e,n),{fullPath:i+o+s,path:i,query:r,hash:jv(s)}}function Oke(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function r3(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function Lke(t,e,n){const i=e.matched.length-1,r=n.matched.length-1;return i>-1&&i===r&&Fm(e.matched[i],n.matched[r])&&Xq(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function Fm(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function Xq(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(!Dke(t[n],e[n]))return!1;return!0}function Dke(t,e){return ma(t)?o3(t,e):ma(e)?o3(e,t):(t&&t.valueOf())===(e&&e.valueOf())}function o3(t,e){return ma(e)?t.length===e.length&&t.every((n,i)=>n===e[i]):t.length===1&&t[0]===e}function Nke(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),i=t.split("/"),r=i[i.length-1];(r===".."||r===".")&&i.push("");let o=n.length-1,s,a;for(s=0;s1&&o--;else break;return n.slice(0,o).join("/")+"/"+i.slice(s).join("/")}const Ou={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let W2=(function(t){return t.pop="pop",t.push="push",t})({}),zk=(function(t){return t.back="back",t.forward="forward",t.unknown="",t})({});function Bke(t){if(!t)if(Lh){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),Mke(t)}const Vke=/^[^#]+#/;function Fke(t,e){return t.replace(Vke,"#")+e}function $ke(t,e){const n=document.documentElement.getBoundingClientRect(),i=t.getBoundingClientRect();return{behavior:e.behavior,left:i.left-n.left-(e.left||0),top:i.top-n.top-(e.top||0)}}const qC=()=>({left:window.scrollX,top:window.scrollY});function zke(t){let e;if("el"in t){const n=t.el,i=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?i?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;e=$ke(r,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function s3(t,e){return(history.state?history.state.position-e:-1)+t}const q2=new Map;function Hke(t,e){q2.set(t,e)}function Uke(t){const e=q2.get(t);return q2.delete(t),e}function Wke(t){return typeof t=="string"||t&&typeof t=="object"}function Jq(t){return typeof t=="string"||typeof t=="symbol"}function qke(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let i=0;ir&&U2(r)):[i&&U2(i)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+n,r!=null&&(e+="="+r))})}return e}function jke(t){const e={};for(const n in t){const i=t[n];i!==void 0&&(e[n]=ma(i)?i.map(r=>r==null?null:""+r):i==null?i:""+i)}return e}function Lg(){let t=[];function e(i){return t.push(i),()=>{const r=t.indexOf(i);r>-1&&t.splice(r,1)}}function n(){t=[]}return{add:e,list:()=>t.slice(),reset:n}}function ic(t,e,n,i,r,o=s=>s()){const s=i&&(i.enterCallbacks[r]=i.enterCallbacks[r]||[]);return()=>new Promise((a,l)=>{const u=f=>{f===!1?l(Vm(Ti.NAVIGATION_ABORTED,{from:n,to:e})):f instanceof Error?l(f):Wke(f)?l(Vm(Ti.NAVIGATION_GUARD_REDIRECT,{from:e,to:f})):(s&&i.enterCallbacks[r]===s&&typeof f=="function"&&s.push(f),a())},c=o(()=>t.call(i&&i.instances[r],e,n,u));let d=Promise.resolve(c);t.length<3&&(d=d.then(u)),d.catch(f=>l(f))})}function Hk(t,e,n,i,r=o=>o()){const o=[];for(const s of t)for(const a in s.components){let l=s.components[a];if(!(e!=="beforeRouteEnter"&&!s.instances[a]))if(Hq(l)){const u=(l.__vccOpts||l)[e];u&&o.push(ic(u,n,i,s,a,r))}else{let u=l();o.push(()=>u.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${a}" at "${s.path}"`);const d=mke(c)?c.default:c;s.mods[a]=c,s.components[a]=d;const f=(d.__vccOpts||d)[e];return f&&ic(f,n,i,s,a,r)()}))}}return o}function Kke(t,e){const n=[],i=[],r=[],o=Math.max(e.matched.length,t.matched.length);for(let s=0;sFm(u,a))?i.push(a):n.push(a));const l=t.matched[s];l&&(e.matched.find(u=>Fm(u,l))||r.push(l))}return[n,i,r]}let Gke=()=>location.protocol+"//"+location.host;function Zq(t,e){const{pathname:n,search:i,hash:r}=e,o=t.indexOf("#");if(o>-1){let s=r.includes(t.slice(o))?t.slice(o).length:1,a=r.slice(s);return a[0]!=="/"&&(a="/"+a),r3(a,"")}return r3(n,t)+i+r}function Yke(t,e,n,i){let r=[],o=[],s=null;const a=({state:f})=>{const h=Zq(t,location),m=n.value,g=e.value;let v=0;if(f){if(n.value=h,e.value=f,s&&s===m){s=null;return}v=g?f.position-g.position:0}else i(h);r.forEach(p=>{p(n.value,m,{delta:v,type:W2.pop,direction:v?v>0?zk.forward:zk.back:zk.unknown})})};function l(){s=n.value}function u(f){r.push(f);const h=()=>{const m=r.indexOf(f);m>-1&&r.splice(m,1)};return o.push(h),h}function c(){if(document.visibilityState==="hidden"){const{history:f}=window;if(!f.state)return;f.replaceState(In({},f.state,{scroll:qC()}),"")}}function d(){for(const f of o)f();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:l,listen:u,destroy:d}}function l3(t,e,n,i=!1,r=!1){return{back:t,current:e,forward:n,replaced:i,position:window.history.length,scroll:r?qC():null}}function Xke(t){const{history:e,location:n}=window,i={value:Zq(t,n)},r={value:e.state};r.value||o(i.value,{back:null,current:i.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function o(l,u,c){const d=t.indexOf("#"),f=d>-1?(n.host&&document.querySelector("base")?t:t.slice(d))+l:Gke()+t+l;try{e[c?"replaceState":"pushState"](u,"",f),r.value=u}catch(h){console.error(h),n[c?"replace":"assign"](f)}}function s(l,u){o(l,In({},e.state,l3(r.value.back,l,r.value.forward,!0),u,{position:r.value.position}),!0),i.value=l}function a(l,u){const c=In({},r.value,e.state,{forward:l,scroll:qC()});o(c.current,c,!0),o(l,In({},l3(i.value,l,null),{position:c.position+1},u),!1),i.value=l}return{location:i,state:r,push:a,replace:s}}function Jke(t){t=Bke(t);const e=Xke(t),n=Yke(t,e.state,e.location,e.replace);function i(o,s=!0){s||n.pauseListeners(),history.go(o)}const r=In({location:"",base:t,go:i,createHref:Fke.bind(null,t)},e,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>e.state.value}),r}function Zke(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),Jke(t)}let jd=(function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.Group=2]="Group",t})({});var er=(function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.ParamRegExp=2]="ParamRegExp",t[t.ParamRegExpEnd=3]="ParamRegExpEnd",t[t.EscapeNext=4]="EscapeNext",t})(er||{});const Qke={type:jd.Static,value:""},eTe=/[a-zA-Z0-9_]/;function tTe(t){if(!t)return[[]];if(t==="/")return[[Qke]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(h){throw new Error(`ERR (${n})/"${u}": ${h}`)}let n=er.Static,i=n;const r=[];let o;function s(){o&&r.push(o),o=[]}let a=0,l,u="",c="";function d(){u&&(n===er.Static?o.push({type:jd.Static,value:u}):n===er.Param||n===er.ParamRegExp||n===er.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),o.push({type:jd.Param,value:u,regexp:c,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),u="")}function f(){u+=l}for(;ae.length?e.length===1&&e[0]===Xr.Static+Xr.Segment?1:-1:0}function Qq(t,e){let n=0;const i=t.score,r=e.score;for(;n0&&e[e.length-1]<0}const sTe={strict:!1,end:!0,sensitive:!1};function aTe(t,e,n){const i=rTe(tTe(t.path),n),r=In(i,{record:t,parent:e,children:[],alias:[]});return e&&!r.record.aliasOf==!e.record.aliasOf&&e.children.push(r),r}function lTe(t,e){const n=[],i=new Map;e=n3(sTe,e);function r(d){return i.get(d)}function o(d,f,h){const m=!h,g=f3(d);g.aliasOf=h&&h.record;const v=n3(e,d),p=[g];if("alias"in d){const _=typeof d.alias=="string"?[d.alias]:d.alias;for(const C of _)p.push(f3(In({},g,{components:h?h.record.components:g.components,path:C,aliasOf:h?h.record:g})))}let b,y;for(const _ of p){const{path:C}=_;if(f&&C[0]!=="/"){const S=f.record.path,k=S[S.length-1]==="/"?"":"/";_.path=f.record.path+(C&&k+C)}if(b=aTe(_,f,v),h?h.alias.push(b):(y=y||b,y!==b&&y.alias.push(b),m&&d.name&&!h3(b)&&s(d.name)),ej(b)&&l(b),g.children){const S=g.children;for(let k=0;k{s(y)}:Gp}function s(d){if(Jq(d)){const f=i.get(d);f&&(i.delete(d),n.splice(n.indexOf(f),1),f.children.forEach(s),f.alias.forEach(s))}else{const f=n.indexOf(d);f>-1&&(n.splice(f,1),d.record.name&&i.delete(d.record.name),d.children.forEach(s),d.alias.forEach(s))}}function a(){return n}function l(d){const f=dTe(d,n);n.splice(f,0,d),d.record.name&&!h3(d)&&i.set(d.record.name,d)}function u(d,f){let h,m={},g,v;if("name"in d&&d.name){if(h=i.get(d.name),!h)throw Vm(Ti.MATCHER_NOT_FOUND,{location:d});v=h.record.name,m=In(d3(f.params,h.keys.filter(y=>!y.optional).concat(h.parent?h.parent.keys.filter(y=>y.optional):[]).map(y=>y.name)),d.params&&d3(d.params,h.keys.map(y=>y.name))),g=h.stringify(m)}else if(d.path!=null)g=d.path,h=n.find(y=>y.re.test(g)),h&&(m=h.parse(g),v=h.record.name);else{if(h=f.name?i.get(f.name):n.find(y=>y.re.test(f.path)),!h)throw Vm(Ti.MATCHER_NOT_FOUND,{location:d,currentLocation:f});v=h.record.name,m=In({},f.params,d.params),g=h.stringify(m)}const p=[];let b=h;for(;b;)p.unshift(b.record),b=b.parent;return{name:v,path:g,params:m,matched:p,meta:cTe(p)}}t.forEach(d=>o(d));function c(){n.length=0,i.clear()}return{addRoute:o,resolve:u,removeRoute:s,clearRoutes:c,getRoutes:a,getRecordMatcher:r}}function d3(t,e){const n={};for(const i of e)i in t&&(n[i]=t[i]);return n}function f3(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:uTe(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function uTe(t){const e={},n=t.props||!1;if("component"in t)e.default=n;else for(const i in t.components)e[i]=typeof n=="object"?n[i]:n;return e}function h3(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function cTe(t){return t.reduce((e,n)=>In(e,n.meta),{})}function dTe(t,e){let n=0,i=e.length;for(;n!==i;){const o=n+i>>1;Qq(t,e[o])<0?i=o:n=o+1}const r=fTe(t);return r&&(i=e.lastIndexOf(r,i-1)),i}function fTe(t){let e=t;for(;e=e.parent;)if(ej(e)&&Qq(t,e)===0)return e}function ej({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function m3(t){const e=Ne(WC),n=Ne(YR),i=M(()=>{const l=w(t.to);return e.resolve(l)}),r=M(()=>{const{matched:l}=i.value,{length:u}=l,c=l[u-1],d=n.matched;if(!c||!d.length)return-1;const f=d.findIndex(Fm.bind(null,c));if(f>-1)return f;const h=g3(l[u-2]);return u>1&&g3(c)===h&&d[d.length-1].path!==h?d.findIndex(Fm.bind(null,l[u-2])):f}),o=M(()=>r.value>-1&&vTe(n.params,i.value.params)),s=M(()=>r.value>-1&&r.value===n.matched.length-1&&Xq(n.params,i.value.params));function a(l={}){if(pTe(l)){const u=e[w(t.replace)?"replace":"push"](w(t.to)).catch(Gp);return t.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:i,href:M(()=>i.value.href),isActive:o,isExactActive:s,navigate:a}}function hTe(t){return t.length===1?t[0]:t}const mTe=le({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:m3,setup(t,{slots:e}){const n=on(m3(t)),{options:i}=Ne(WC),r=M(()=>({[p3(t.activeClass,i.linkActiveClass,"router-link-active")]:n.isActive,[p3(t.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=e.default&&hTe(e.default(n));return t.custom?o:nt("a",{"aria-current":n.isExactActive?t.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},o)}}}),gTe=mTe;function pTe(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function vTe(t,e){for(const n in e){const i=e[n],r=t[n];if(typeof i=="string"){if(i!==r)return!1}else if(!ma(r)||r.length!==i.length||i.some((o,s)=>o.valueOf()!==r[s].valueOf()))return!1}return!0}function g3(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const p3=(t,e,n)=>t??e??n,bTe=le({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:n}){const i=Ne(H2),r=M(()=>t.route||i.value),o=Ne(i3,0),s=M(()=>{let u=w(o);const{matched:c}=r.value;let d;for(;(d=c[u])&&!d.components;)u++;return u}),a=M(()=>r.value.matched[s.value]);qt(i3,M(()=>s.value+1)),qt(vke,a),qt(H2,r);const l=H();return Se(()=>[l.value,a.value,t.name],([u,c,d],[f,h,m])=>{c&&(c.instances[d]=u,h&&h!==c&&u&&u===f&&(c.leaveGuards.size||(c.leaveGuards=h.leaveGuards),c.updateGuards.size||(c.updateGuards=h.updateGuards))),u&&c&&(!h||!Fm(c,h)||!f)&&(c.enterCallbacks[d]||[]).forEach(g=>g(u))},{flush:"post"}),()=>{const u=r.value,c=t.name,d=a.value,f=d&&d.components[c];if(!f)return v3(n.default,{Component:f,route:u});const h=d.props[c],m=h?h===!0?u.params:typeof h=="function"?h(u):h:null,v=nt(f,In({},m,e,{onVnodeUnmounted:p=>{p.component.isUnmounted&&(d.instances[c]=null)},ref:l}));return v3(n.default,{Component:v,route:u})||v}}});function v3(t,e){if(!t)return null;const n=t(e);return n.length===1?n[0]:n}const yTe=bTe;function wTe(t){const e=lTe(t.routes,t),n=t.parseQuery||qke,i=t.stringifyQuery||a3,r=t.history,o=Lg(),s=Lg(),a=Lg(),l=bi(Ou);let u=Ou;Lh&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Fk.bind(null,X=>""+X),d=Fk.bind(null,Ike),f=Fk.bind(null,jv);function h(X,se){let re,ee;return Jq(X)?(re=e.getRecordMatcher(X),ee=se):ee=X,e.addRoute(ee,re)}function m(X){const se=e.getRecordMatcher(X);se&&e.removeRoute(se)}function g(){return e.getRoutes().map(X=>X.record)}function v(X){return!!e.getRecordMatcher(X)}function p(X,se){if(se=In({},se||l.value),typeof X=="string"){const G=$k(n,X,se.path),ye=e.resolve({path:G.path},se),be=r.createHref(G.fullPath);return In(G,ye,{params:f(ye.params),hash:jv(G.hash),redirectedFrom:void 0,href:be})}let re;if(X.path!=null)re=In({},X,{path:$k(n,X.path,se.path).path});else{const G=In({},X.params);for(const ye in G)G[ye]==null&&delete G[ye];re=In({},X,{params:d(G)}),se.params=d(se.params)}const ee=e.resolve(re,se),te=X.hash||"";ee.params=c(f(ee.params));const V=Oke(i,In({},X,{hash:xke(te),path:ee.path})),K=r.createHref(V);return In({fullPath:V,hash:te,query:i===a3?jke(X.query):X.query||{}},ee,{redirectedFrom:void 0,href:K})}function b(X){return typeof X=="string"?$k(n,X,l.value.path):In({},X)}function y(X,se){if(u!==X)return Vm(Ti.NAVIGATION_CANCELLED,{from:se,to:X})}function _(X){return k(X)}function C(X){return _(In(b(X),{replace:!0}))}function S(X,se){const re=X.matched[X.matched.length-1];if(re&&re.redirect){const{redirect:ee}=re;let te=typeof ee=="function"?ee(X,se):ee;return typeof te=="string"&&(te=te.includes("?")||te.includes("#")?te=b(te):{path:te},te.params={}),In({query:X.query,hash:X.hash,params:te.path!=null?{}:X.params},te)}}function k(X,se){const re=u=p(X),ee=l.value,te=X.state,V=X.force,K=X.replace===!0,G=S(re,ee);if(G)return k(In(b(G),{state:typeof G=="object"?In({},te,G.state):te,force:V,replace:K}),se||re);const ye=re;ye.redirectedFrom=se;let be;return!V&&Lke(i,ee,re)&&(be=Vm(Ti.NAVIGATION_DUPLICATED,{to:ye,from:ee}),j(ee,ee,!0,!1)),(be?Promise.resolve(be):x(ye,ee)).catch(Ce=>Pl(Ce)?Pl(Ce,Ti.NAVIGATION_GUARD_REDIRECT)?Ce:F(Ce):O(Ce,ye,ee)).then(Ce=>{if(Ce){if(Pl(Ce,Ti.NAVIGATION_GUARD_REDIRECT))return k(In({replace:K},b(Ce.to),{state:typeof Ce.to=="object"?In({},te,Ce.to.state):te,force:V}),se||ye)}else Ce=A(ye,ee,!0,K,te);return P(ye,ee,Ce),Ce})}function T(X,se){const re=y(X,se);return re?Promise.reject(re):Promise.resolve()}function E(X){const se=J.values().next().value;return se&&typeof se.runWithContext=="function"?se.runWithContext(X):X()}function x(X,se){let re;const[ee,te,V]=Kke(X,se);re=Hk(ee.reverse(),"beforeRouteLeave",X,se);for(const G of ee)G.leaveGuards.forEach(ye=>{re.push(ic(ye,X,se))});const K=T.bind(null,X,se);return re.push(K),he(re).then(()=>{re=[];for(const G of o.list())re.push(ic(G,X,se));return re.push(K),he(re)}).then(()=>{re=Hk(te,"beforeRouteUpdate",X,se);for(const G of te)G.updateGuards.forEach(ye=>{re.push(ic(ye,X,se))});return re.push(K),he(re)}).then(()=>{re=[];for(const G of V)if(G.beforeEnter)if(ma(G.beforeEnter))for(const ye of G.beforeEnter)re.push(ic(ye,X,se));else re.push(ic(G.beforeEnter,X,se));return re.push(K),he(re)}).then(()=>(X.matched.forEach(G=>G.enterCallbacks={}),re=Hk(V,"beforeRouteEnter",X,se,E),re.push(K),he(re))).then(()=>{re=[];for(const G of s.list())re.push(ic(G,X,se));return re.push(K),he(re)}).catch(G=>Pl(G,Ti.NAVIGATION_CANCELLED)?G:Promise.reject(G))}function P(X,se,re){a.list().forEach(ee=>E(()=>ee(X,se,re)))}function A(X,se,re,ee,te){const V=y(X,se);if(V)return V;const K=se===Ou,G=Lh?history.state:{};re&&(ee||K?r.replace(X.fullPath,In({scroll:K&&G&&G.scroll},te)):r.push(X.fullPath,te)),l.value=X,j(X,se,re,K),F()}let I;function D(){I||(I=r.listen((X,se,re)=>{if(!ne.listening)return;const ee=p(X),te=S(ee,ne.currentRoute.value);if(te){k(In(te,{replace:!0,force:!0}),ee).catch(Gp);return}u=ee;const V=l.value;Lh&&Hke(s3(V.fullPath,re.delta),qC()),x(ee,V).catch(K=>Pl(K,Ti.NAVIGATION_ABORTED|Ti.NAVIGATION_CANCELLED)?K:Pl(K,Ti.NAVIGATION_GUARD_REDIRECT)?(k(In(b(K.to),{force:!0}),ee).then(G=>{Pl(G,Ti.NAVIGATION_ABORTED|Ti.NAVIGATION_DUPLICATED)&&!re.delta&&re.type===W2.pop&&r.go(-1,!1)}).catch(Gp),Promise.reject()):(re.delta&&r.go(-re.delta,!1),O(K,ee,V))).then(K=>{K=K||A(ee,V,!1),K&&(re.delta&&!Pl(K,Ti.NAVIGATION_CANCELLED)?r.go(-re.delta,!1):re.type===W2.pop&&Pl(K,Ti.NAVIGATION_ABORTED|Ti.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),P(ee,V,K)}).catch(Gp)}))}let q=Lg(),z=Lg(),R;function O(X,se,re){F(X);const ee=z.list();return ee.length?ee.forEach(te=>te(X,se,re)):console.error(X),Promise.reject(X)}function N(){return R&&l.value!==Ou?Promise.resolve():new Promise((X,se)=>{q.add([X,se])})}function F(X){return R||(R=!X,D(),q.list().forEach(([se,re])=>X?re(X):se()),q.reset()),X}function j(X,se,re,ee){const{scrollBehavior:te}=t;if(!Lh||!te)return Promise.resolve();const V=!re&&Uke(s3(X.fullPath,0))||(ee||!re)&&history.state&&history.state.scroll||null;return Ye().then(()=>te(X,se,V)).then(K=>K&&zke(K)).catch(K=>O(K,X,se))}const U=X=>r.go(X);let W;const J=new Set,ne={currentRoute:l,listening:!0,addRoute:h,removeRoute:m,clearRoutes:e.clearRoutes,hasRoute:v,getRoutes:g,resolve:p,options:t,push:_,replace:C,go:U,back:()=>U(-1),forward:()=>U(1),beforeEach:o.add,beforeResolve:s.add,afterEach:a.add,onError:z.add,isReady:N,install(X){X.component("RouterLink",gTe),X.component("RouterView",yTe),X.config.globalProperties.$router=ne,Object.defineProperty(X.config.globalProperties,"$route",{enumerable:!0,get:()=>w(l)}),Lh&&!W&&l.value===Ou&&(W=!0,_(r.location).catch(ee=>{}));const se={};for(const ee in Ou)Object.defineProperty(se,ee,{get:()=>l.value[ee],enumerable:!0});X.provide(WC,ne),X.provide(YR,Lp(se)),X.provide(H2,l);const re=X.unmount;J.add(X),X.unmount=function(){J.delete(X),J.size<1&&(u=Ou,I&&I(),I=null,l.value=Ou,W=!1,R=!1),re()}}};function he(X){return X.reduce((se,re)=>se.then(()=>E(re)),Promise.resolve())}return ne}const _Te=t=>{const e=[...t].sort((r,o)=>{const s=r.path.split("/").filter(l=>l!=="").length,a=o.path.split("/").filter(l=>l!=="").length;return s-a}),n=new Map,i=[];for(const r of e){const o=r.path.split("/").filter(u=>u!==""),s={...r,children:[]};if(n.set(r.path,s),o.length===0){i.push(s);continue}const a="/"+o.slice(0,-1).join("/"),l=n.get(a);l?l.children?.push(s):i.push(s)}return i},vn=t=>t,CTe=(t,e)=>{const n=Object.entries(t).map(([i,r])=>{const o=r||{},s=i.replace("../views","").replace(/View/g,"").replace("/index.tsx","")||"/",a=s.split("/").filter(Boolean).join("-")||"/";return{path:s,name:a,meta:o.meta,redirect:o.redirect,component:e[i]}});return _Te(n)},bc={getStorage(){return window.localStorage},get(t){const e=this.getStorage().getItem(t)||"";try{const n=JSON.parse(e);return n.expire>0&&n.expire<=Date.now()?"":n.value}catch{return""}},set(t,e,n=0){const i=JSON.stringify({value:e,expire:n>0?Date.now()+n*1e3:n});return this.getStorage().setItem(t,i),this},remove(t){this.getStorage().removeItem(t)}};let tj;const ZR=t=>tj=t,STe=Symbol();function j2(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var Yp;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(Yp||(Yp={}));const nj=()=>{};function b3(t,e,n,i=nj){t.add(e);const r=()=>{t.delete(e)&&i()};return!n&&cC()&&dC(r),r}function oh(t,...e){t.forEach(n=>{n(...e)})}const kTe=t=>t(),y3=Symbol(),Uk=Symbol();function K2(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,i)=>t.set(i,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const i=e[n],r=t[n];j2(r)&&j2(i)&&t.hasOwnProperty(n)&&!rn(i)&&!na(i)?t[n]=K2(r,i):t[n]=i}return t}const TTe=Symbol();function ETe(t){return!j2(t)||!Object.prototype.hasOwnProperty.call(t,TTe)}const{assign:Zu}=Object;function xTe(t){return!!(rn(t)&&t.effect)}function ATe(t,e,n,i){const{state:r,actions:o,getters:s}=e,a=n.state.value[t];let l;function u(){a||(n.state.value[t]=r?r():{});const c=Sr(n.state.value[t]);return Zu(c,o,Object.keys(s||{}).reduce((d,f)=>(d[f]=ca(M(()=>{ZR(n);const h=n._s.get(t);return s[f].call(h,h)})),d),{}))}return l=ij(t,u,e,n,i,!0),l}function ij(t,e,n={},i,r,o){let s;const a=Zu({actions:{}},n),l={deep:!0};let u,c,d=new Set,f=new Set,h;const m=i.state.value[t];!o&&!m&&(i.state.value[t]={});let g;function v(T){let E;u=c=!1,typeof T=="function"?(T(i.state.value[t]),E={type:Yp.patchFunction,storeId:t,events:h}):(K2(i.state.value[t],T),E={type:Yp.patchObject,payload:T,storeId:t,events:h});const x=g=Symbol();Ye().then(()=>{g===x&&(u=!0)}),c=!0,oh(d,E,i.state.value[t])}const p=o?function(){const{state:E}=n,x=E?E():{};this.$patch(P=>{Zu(P,x)})}:nj;function b(){s.stop(),d.clear(),f.clear(),i._s.delete(t)}const y=(T,E="")=>{if(y3 in T)return T[Uk]=E,T;const x=function(){ZR(i);const P=Array.from(arguments),A=new Set,I=new Set;function D(R){A.add(R)}function q(R){I.add(R)}oh(f,{args:P,name:x[Uk],store:C,after:D,onError:q});let z;try{z=T.apply(this&&this.$id===t?this:C,P)}catch(R){throw oh(I,R),R}return z instanceof Promise?z.then(R=>(oh(A,R),R)).catch(R=>(oh(I,R),Promise.reject(R))):(oh(A,z),z)};return x[y3]=!0,x[Uk]=E,x},_={_p:i,$id:t,$onAction:b3.bind(null,f),$patch:v,$reset:p,$subscribe(T,E={}){const x=b3(d,T,E.detached,()=>P()),P=s.run(()=>Se(()=>i.state.value[t],A=>{(E.flush==="sync"?c:u)&&T({storeId:t,type:Yp.direct,events:h},A)},Zu({},l,E)));return x},$dispose:b},C=on(_);i._s.set(t,C);const k=(i._a&&i._a.runWithContext||kTe)(()=>i._e.run(()=>(s=zb()).run(()=>e({action:y}))));for(const T in k){const E=k[T];if(rn(E)&&!xTe(E)||na(E))o||(m&&ETe(E)&&(rn(E)?E.value=m[T]:K2(E,m[T])),i.state.value[t][T]=E);else if(typeof E=="function"){const x=y(E,T);k[T]=x,a.actions[T]=E}}return Zu(C,k),Zu(ln(C),k),Object.defineProperty(C,"$state",{get:()=>i.state.value[t],set:T=>{v(E=>{Zu(E,T)})}}),i._p.forEach(T=>{Zu(C,s.run(()=>T({store:C,app:i._a,pinia:i,options:a})))}),m&&o&&n.hydrate&&n.hydrate(C.$state,m),u=!0,c=!0,C}function PTe(t,e,n){let i;const r=typeof e=="function";i=r?n:e;function o(s,a){const l=tz();return s=s||(l?Ne(STe,null):null),s&&ZR(s),s=tj,s._s.has(t)||(r?ij(t,e,i,s):ATe(t,i,s)),s._s.get(t)}return o.$id=t,o}function ITe(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}const J_=typeof window<"u",Uc=(t,e=!1)=>e?Symbol.for(t):Symbol(t),RTe=(t,e,n)=>MTe({l:t,k:e,s:n}),MTe=t=>JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Xi=t=>typeof t=="number"&&isFinite(t),rj=t=>QR(t)==="[object Date]",$m=t=>QR(t)==="[object RegExp]",jC=t=>yn(t)&&Object.keys(t).length===0,rr=Object.assign,OTe=Object.create,Un=(t=null)=>OTe(t);let w3;const Kd=()=>w3||(w3=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Un());function _3(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function C3(t){return t.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function LTe(t){return t=t.replace(/(\w+)\s*=\s*"([^"]*)"/g,(i,r,o)=>`${r}="${C3(o)}"`),t=t.replace(/(\w+)\s*=\s*'([^']*)'/g,(i,r,o)=>`${r}='${C3(o)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(t)&&(t=t.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),[/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach(i=>{t=t.replace(i,"$1javascript:")}),t}const DTe=Object.prototype.hasOwnProperty;function Ms(t,e){return DTe.call(t,e)}const Ei=Array.isArray,di=t=>typeof t=="function",ht=t=>typeof t=="string",kn=t=>typeof t=="boolean",Nn=t=>t!==null&&typeof t=="object",NTe=t=>Nn(t)&&di(t.then)&&di(t.catch),oj=Object.prototype.toString,QR=t=>oj.call(t),yn=t=>QR(t)==="[object Object]",BTe=t=>t==null?"":Ei(t)||yn(t)&&t.toString===oj?JSON.stringify(t,null,2):String(t);function eM(t,e=""){return t.reduce((n,i,r)=>r===0?n+i:n+e+i,"")}const Y0=t=>!Nn(t)||Ei(t);function Uw(t,e){if(Y0(t)||Y0(e))throw new Error("Invalid value");const n=[{src:t,des:e}];for(;n.length;){const{src:i,des:r}=n.pop();Object.keys(i).forEach(o=>{o!=="__proto__"&&(Nn(i[o])&&!Nn(r[o])&&(r[o]=Array.isArray(i[o])?[]:Un()),Y0(r[o])||Y0(i[o])?r[o]=i[o]:n.push({src:i[o],des:r[o]}))})}}function VTe(t,e,n){return{line:t,column:e,offset:n}}function G2(t,e,n){return{start:t,end:e}}const Rn={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},FTe=17;function KC(t,e,n={}){const{domain:i,messages:r,args:o}=n,s=t,a=new SyntaxError(String(s));return a.code=t,e&&(a.location=e),a.domain=i,a}function $Te(t){throw t}const Aa=" ",zTe="\r",Pr=` +`,HTe="\u2028",UTe="\u2029";function WTe(t){const e=t;let n=0,i=1,r=1,o=0;const s=k=>e[k]===zTe&&e[k+1]===Pr,a=k=>e[k]===Pr,l=k=>e[k]===UTe,u=k=>e[k]===HTe,c=k=>s(k)||a(k)||l(k)||u(k),d=()=>n,f=()=>i,h=()=>r,m=()=>o,g=k=>s(k)||l(k)||u(k)?Pr:e[k],v=()=>g(n),p=()=>g(n+o);function b(){return o=0,c(n)&&(i++,r=0),s(n)&&n++,n++,r++,e[n]}function y(){return s(n+o)&&o++,o++,e[n+o]}function _(){n=0,i=1,r=1,o=0}function C(k=0){o=k}function S(){const k=n+o;for(;k!==n;)b();o=0}return{index:d,line:f,column:h,peekOffset:m,charAt:g,currentChar:v,currentPeek:p,next:b,peek:y,reset:_,resetPeek:C,skipToPeek:S}}const Il=void 0,qTe=".",S3="'",jTe="tokenizer";function KTe(t,e={}){const n=e.location!==!1,i=WTe(t),r=()=>i.index(),o=()=>VTe(i.line(),i.column(),i.index()),s=o(),a=r(),l={currentType:13,offset:a,startLoc:s,endLoc:s,lastType:13,lastOffset:a,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},u=()=>l,{onError:c}=e;function d(Y,Z,ae,...pe){const je=u();if(Z.column+=ae,Z.offset+=ae,c){const Ie=n?G2(je.startLoc,Z):null,fe=KC(Y,Ie,{domain:jTe,args:pe});c(fe)}}function f(Y,Z,ae){Y.endLoc=o(),Y.currentType=Z;const pe={type:Z};return n&&(pe.loc=G2(Y.startLoc,Y.endLoc)),ae!=null&&(pe.value=ae),pe}const h=Y=>f(Y,13);function m(Y,Z){return Y.currentChar()===Z?(Y.next(),Z):(d(Rn.EXPECTED_TOKEN,o(),0,Z),"")}function g(Y){let Z="";for(;Y.currentPeek()===Aa||Y.currentPeek()===Pr;)Z+=Y.currentPeek(),Y.peek();return Z}function v(Y){const Z=g(Y);return Y.skipToPeek(),Z}function p(Y){if(Y===Il)return!1;const Z=Y.charCodeAt(0);return Z>=97&&Z<=122||Z>=65&&Z<=90||Z===95}function b(Y){if(Y===Il)return!1;const Z=Y.charCodeAt(0);return Z>=48&&Z<=57}function y(Y,Z){const{currentType:ae}=Z;if(ae!==2)return!1;g(Y);const pe=p(Y.currentPeek());return Y.resetPeek(),pe}function _(Y,Z){const{currentType:ae}=Z;if(ae!==2)return!1;g(Y);const pe=Y.currentPeek()==="-"?Y.peek():Y.currentPeek(),je=b(pe);return Y.resetPeek(),je}function C(Y,Z){const{currentType:ae}=Z;if(ae!==2)return!1;g(Y);const pe=Y.currentPeek()===S3;return Y.resetPeek(),pe}function S(Y,Z){const{currentType:ae}=Z;if(ae!==7)return!1;g(Y);const pe=Y.currentPeek()===".";return Y.resetPeek(),pe}function k(Y,Z){const{currentType:ae}=Z;if(ae!==8)return!1;g(Y);const pe=p(Y.currentPeek());return Y.resetPeek(),pe}function T(Y,Z){const{currentType:ae}=Z;if(!(ae===7||ae===11))return!1;g(Y);const pe=Y.currentPeek()===":";return Y.resetPeek(),pe}function E(Y,Z){const{currentType:ae}=Z;if(ae!==9)return!1;const pe=()=>{const Ie=Y.currentPeek();return Ie==="{"?p(Y.peek()):Ie==="@"||Ie==="|"||Ie===":"||Ie==="."||Ie===Aa||!Ie?!1:Ie===Pr?(Y.peek(),pe()):P(Y,!1)},je=pe();return Y.resetPeek(),je}function x(Y){g(Y);const Z=Y.currentPeek()==="|";return Y.resetPeek(),Z}function P(Y,Z=!0){const ae=(je=!1,Ie="")=>{const fe=Y.currentPeek();return fe==="{"||fe==="@"||!fe?je:fe==="|"?!(Ie===Aa||Ie===Pr):fe===Aa?(Y.peek(),ae(!0,Aa)):fe===Pr?(Y.peek(),ae(!0,Pr)):!0},pe=ae();return Z&&Y.resetPeek(),pe}function A(Y,Z){const ae=Y.currentChar();return ae===Il?Il:Z(ae)?(Y.next(),ae):null}function I(Y){const Z=Y.charCodeAt(0);return Z>=97&&Z<=122||Z>=65&&Z<=90||Z>=48&&Z<=57||Z===95||Z===36}function D(Y){return A(Y,I)}function q(Y){const Z=Y.charCodeAt(0);return Z>=97&&Z<=122||Z>=65&&Z<=90||Z>=48&&Z<=57||Z===95||Z===36||Z===45}function z(Y){return A(Y,q)}function R(Y){const Z=Y.charCodeAt(0);return Z>=48&&Z<=57}function O(Y){return A(Y,R)}function N(Y){const Z=Y.charCodeAt(0);return Z>=48&&Z<=57||Z>=65&&Z<=70||Z>=97&&Z<=102}function F(Y){return A(Y,N)}function j(Y){let Z="",ae="";for(;Z=O(Y);)ae+=Z;return ae}function U(Y){let Z="";for(;;){const ae=Y.currentChar();if(ae==="\\"){const pe=Y.peek();pe==="{"||pe==="}"||pe==="@"||pe==="|"||pe==="\\"?(Z+=ae+pe,Y.next(),Y.next()):(Y.resetPeek(),Z+=ae,Y.next())}else{if(ae==="{"||ae==="}"||ae==="@"||ae==="|"||!ae)break;if(ae===Aa||ae===Pr)if(P(Y))Z+=ae,Y.next();else{if(x(Y))break;Z+=ae,Y.next()}else Z+=ae,Y.next()}}return Z}function W(Y){v(Y);let Z="",ae="";for(;Z=z(Y);)ae+=Z;const pe=Y.currentChar();if(pe&&pe!=="}"&&pe!==Il&&pe!==Aa&&pe!==Pr&&pe!==" "){const je=ee(Y);return d(Rn.INVALID_TOKEN_IN_PLACEHOLDER,o(),0,ae+je),ae+je}return Y.currentChar()===Il&&d(Rn.UNTERMINATED_CLOSING_BRACE,o(),0),ae}function J(Y){v(Y);let Z="";return Y.currentChar()==="-"?(Y.next(),Z+=`-${j(Y)}`):Z+=j(Y),Y.currentChar()===Il&&d(Rn.UNTERMINATED_CLOSING_BRACE,o(),0),Z}function ne(Y){return Y!==S3&&Y!==Pr}function he(Y){v(Y),m(Y,"'");let Z="",ae="";for(;Z=A(Y,ne);)Z==="\\"?ae+=X(Y):ae+=Z;const pe=Y.currentChar();return pe===Pr||pe===Il?(d(Rn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,o(),0),pe===Pr&&(Y.next(),m(Y,"'")),ae):(m(Y,"'"),ae)}function X(Y){const Z=Y.currentChar();switch(Z){case"\\":case"'":return Y.next(),`\\${Z}`;case"u":return se(Y,Z,4);case"U":return se(Y,Z,6);default:return d(Rn.UNKNOWN_ESCAPE_SEQUENCE,o(),0,Z),""}}function se(Y,Z,ae){m(Y,Z);let pe="";for(let je=0;je{const pe=Y.currentChar();return pe==="{"||pe==="@"||pe==="|"||pe==="("||pe===")"||!pe||pe===Aa?ae:(ae+=pe,Y.next(),Z(ae))};return Z("")}function K(Y){v(Y);const Z=m(Y,"|");return v(Y),Z}function G(Y,Z){let ae=null;switch(Y.currentChar()){case"{":return Z.braceNest>=1&&d(Rn.NOT_ALLOW_NEST_PLACEHOLDER,o(),0),Y.next(),ae=f(Z,2,"{"),v(Y),Z.braceNest++,ae;case"}":return Z.braceNest>0&&Z.currentType===2&&d(Rn.EMPTY_PLACEHOLDER,o(),0),Y.next(),ae=f(Z,3,"}"),Z.braceNest--,Z.braceNest>0&&v(Y),Z.inLinked&&Z.braceNest===0&&(Z.inLinked=!1),ae;case"@":return Z.braceNest>0&&d(Rn.UNTERMINATED_CLOSING_BRACE,o(),0),ae=ye(Y,Z)||h(Z),Z.braceNest=0,ae;default:{let je=!0,Ie=!0,fe=!0;if(x(Y))return Z.braceNest>0&&d(Rn.UNTERMINATED_CLOSING_BRACE,o(),0),ae=f(Z,1,K(Y)),Z.braceNest=0,Z.inLinked=!1,ae;if(Z.braceNest>0&&(Z.currentType===4||Z.currentType===5||Z.currentType===6))return d(Rn.UNTERMINATED_CLOSING_BRACE,o(),0),Z.braceNest=0,be(Y,Z);if(je=y(Y,Z))return ae=f(Z,4,W(Y)),v(Y),ae;if(Ie=_(Y,Z))return ae=f(Z,5,J(Y)),v(Y),ae;if(fe=C(Y,Z))return ae=f(Z,6,he(Y)),v(Y),ae;if(!je&&!Ie&&!fe)return ae=f(Z,12,ee(Y)),d(Rn.INVALID_TOKEN_IN_PLACEHOLDER,o(),0,ae.value),v(Y),ae;break}}return ae}function ye(Y,Z){const{currentType:ae}=Z;let pe=null;const je=Y.currentChar();switch((ae===7||ae===8||ae===11||ae===9)&&(je===Pr||je===Aa)&&d(Rn.INVALID_LINKED_FORMAT,o(),0),je){case"@":return Y.next(),pe=f(Z,7,"@"),Z.inLinked=!0,pe;case".":return v(Y),Y.next(),f(Z,8,".");case":":return v(Y),Y.next(),f(Z,9,":");default:return x(Y)?(pe=f(Z,1,K(Y)),Z.braceNest=0,Z.inLinked=!1,pe):S(Y,Z)||T(Y,Z)?(v(Y),ye(Y,Z)):k(Y,Z)?(v(Y),f(Z,11,te(Y))):E(Y,Z)?(v(Y),je==="{"?G(Y,Z)||pe:f(Z,10,V(Y))):(ae===7&&d(Rn.INVALID_LINKED_FORMAT,o(),0),Z.braceNest=0,Z.inLinked=!1,be(Y,Z))}}function be(Y,Z){let ae={type:13};if(Z.braceNest>0)return G(Y,Z)||h(Z);if(Z.inLinked)return ye(Y,Z)||h(Z);switch(Y.currentChar()){case"{":return G(Y,Z)||h(Z);case"}":return d(Rn.UNBALANCED_CLOSING_BRACE,o(),0),Y.next(),f(Z,3,"}");case"@":return ye(Y,Z)||h(Z);default:{if(x(Y))return ae=f(Z,1,K(Y)),Z.braceNest=0,Z.inLinked=!1,ae;if(P(Y))return f(Z,0,U(Y));break}}return ae}function Ce(){const{currentType:Y,offset:Z,startLoc:ae,endLoc:pe}=l;return l.lastType=Y,l.lastOffset=Z,l.lastStartLoc=ae,l.lastEndLoc=pe,l.offset=r(),l.startLoc=o(),i.currentChar()===Il?f(l,13):be(i,l)}return{nextToken:Ce,currentOffset:r,currentPosition:o,context:u}}const GTe="parser",YTe=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,XTe=/\\([\\@{}|])/g;function JTe(t,e){return e}function ZTe(t,e,n){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(e||n,16);return i<=55295||i>=57344?String.fromCodePoint(i):"�"}}}function QTe(t={}){const e=t.location!==!1,{onError:n}=t;function i(p,b,y,_,...C){const S=p.currentPosition();if(S.offset+=_,S.column+=_,n){const k=e?G2(y,S):null,T=KC(b,k,{domain:GTe,args:C});n(T)}}function r(p,b,y){const _={type:p};return e&&(_.start=b,_.end=b,_.loc={start:y,end:y}),_}function o(p,b,y,_){e&&(p.end=b,p.loc&&(p.loc.end=y))}function s(p,b){const y=p.context(),_=r(3,y.offset,y.startLoc);return _.value=b.replace(XTe,JTe),o(_,p.currentOffset(),p.currentPosition()),_}function a(p,b){const y=p.context(),{lastOffset:_,lastStartLoc:C}=y,S=r(5,_,C);return S.index=parseInt(b,10),p.nextToken(),o(S,p.currentOffset(),p.currentPosition()),S}function l(p,b){const y=p.context(),{lastOffset:_,lastStartLoc:C}=y,S=r(4,_,C);return S.key=b,p.nextToken(),o(S,p.currentOffset(),p.currentPosition()),S}function u(p,b){const y=p.context(),{lastOffset:_,lastStartLoc:C}=y,S=r(9,_,C);return S.value=b.replace(YTe,ZTe),p.nextToken(),o(S,p.currentOffset(),p.currentPosition()),S}function c(p){const b=p.nextToken(),y=p.context(),{lastOffset:_,lastStartLoc:C}=y,S=r(8,_,C);return b.type!==11?(i(p,Rn.UNEXPECTED_EMPTY_LINKED_MODIFIER,y.lastStartLoc,0),S.value="",o(S,_,C),{nextConsumeToken:b,node:S}):(b.value==null&&i(p,Rn.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Pa(b)),S.value=b.value||"",o(S,p.currentOffset(),p.currentPosition()),{node:S})}function d(p,b){const y=p.context(),_=r(7,y.offset,y.startLoc);return _.value=b,o(_,p.currentOffset(),p.currentPosition()),_}function f(p){const b=p.context(),y=r(6,b.offset,b.startLoc);let _=p.nextToken();if(_.type===8){const C=c(p);y.modifier=C.node,_=C.nextConsumeToken||p.nextToken()}switch(_.type!==9&&i(p,Rn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Pa(_)),_=p.nextToken(),_.type===2&&(_=p.nextToken()),_.type){case 10:_.value==null&&i(p,Rn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Pa(_)),y.key=d(p,_.value||"");break;case 4:_.value==null&&i(p,Rn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Pa(_)),y.key=l(p,_.value||"");break;case 5:_.value==null&&i(p,Rn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Pa(_)),y.key=a(p,_.value||"");break;case 6:_.value==null&&i(p,Rn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Pa(_)),y.key=u(p,_.value||"");break;default:{i(p,Rn.UNEXPECTED_EMPTY_LINKED_KEY,b.lastStartLoc,0);const C=p.context(),S=r(7,C.offset,C.startLoc);return S.value="",o(S,C.offset,C.startLoc),y.key=S,o(y,C.offset,C.startLoc),{nextConsumeToken:_,node:y}}}return o(y,p.currentOffset(),p.currentPosition()),{node:y}}function h(p){const b=p.context(),y=b.currentType===1?p.currentOffset():b.offset,_=b.currentType===1?b.endLoc:b.startLoc,C=r(2,y,_);C.items=[];let S=null;do{const E=S||p.nextToken();switch(S=null,E.type){case 0:E.value==null&&i(p,Rn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Pa(E)),C.items.push(s(p,E.value||""));break;case 5:E.value==null&&i(p,Rn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Pa(E)),C.items.push(a(p,E.value||""));break;case 4:E.value==null&&i(p,Rn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Pa(E)),C.items.push(l(p,E.value||""));break;case 6:E.value==null&&i(p,Rn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Pa(E)),C.items.push(u(p,E.value||""));break;case 7:{const x=f(p);C.items.push(x.node),S=x.nextConsumeToken||null;break}}}while(b.currentType!==13&&b.currentType!==1);const k=b.currentType===1?b.lastOffset:p.currentOffset(),T=b.currentType===1?b.lastEndLoc:p.currentPosition();return o(C,k,T),C}function m(p,b,y,_){const C=p.context();let S=_.items.length===0;const k=r(1,b,y);k.cases=[],k.cases.push(_);do{const T=h(p);S||(S=T.items.length===0),k.cases.push(T)}while(C.currentType!==13);return S&&i(p,Rn.MUST_HAVE_MESSAGES_IN_PLURAL,y,0),o(k,p.currentOffset(),p.currentPosition()),k}function g(p){const b=p.context(),{offset:y,startLoc:_}=b,C=h(p);return b.currentType===13?C:m(p,y,_,C)}function v(p){const b=KTe(p,rr({},t)),y=b.context(),_=r(0,y.offset,y.startLoc);return e&&_.loc&&(_.loc.source=p),_.body=g(b),t.onCacheKey&&(_.cacheKey=t.onCacheKey(p)),y.currentType!==13&&i(b,Rn.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,p[y.offset]||""),o(_,b.currentOffset(),b.currentPosition()),_}return{parse:v}}function Pa(t){if(t.type===13)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function eEe(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:o=>(n.helpers.add(o),o)}}function k3(t,e){for(let n=0;nT3(n)),t}function T3(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let n=0;ns;function l(g,v){s.code+=g}function u(g,v=!0){const p=v?i:"";l(r?p+" ".repeat(g):p)}function c(g=!0){const v=++s.indentLevel;g&&u(v)}function d(g=!0){const v=--s.indentLevel;g&&u(v)}function f(){u(s.indentLevel)}return{context:a,push:l,indent:c,deindent:d,newline:f,helper:g=>`_${g}`,needIndent:()=>s.needIndent}}function rEe(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),zm(t,e.key),e.modifier?(t.push(", "),zm(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function oEe(t,e){const{helper:n,needIndent:i}=t;t.push(`${n("normalize")}([`),t.indent(i());const r=e.items.length;for(let o=0;o1){t.push(`${n("plural")}([`),t.indent(i());const r=e.cases.length;for(let o=0;o{const n=ht(e.mode)?e.mode:"normal",i=ht(e.filename)?e.filename:"message.intl";e.sourceMap;const r=e.breakLineCode!=null?e.breakLineCode:n==="arrow"?";":` +`,o=e.needIndent?e.needIndent:n!=="arrow",s=t.helpers||[],a=iEe(t,{filename:i,breakLineCode:r,needIndent:o});a.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(o),s.length>0&&(a.push(`const { ${eM(s.map(c=>`${c}: _${c}`),", ")} } = ctx`),a.newline()),a.push("return "),zm(a,t),a.deindent(o),a.push("}"),delete t.helpers;const{code:l,map:u}=a.context();return{ast:t,code:l,map:u?u.toJSON():void 0}};function uEe(t,e={}){const n=rr({},e),i=!!n.jit,r=!!n.minify,o=n.optimize==null?!0:n.optimize,a=QTe(n).parse(t);return i?(o&&nEe(a),r&&Dh(a),{ast:a,code:""}):(tEe(a,n),lEe(a,n))}function cEe(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Kd().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Kd().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Za(t){return Nn(t)&&nM(t)===0&&(Ms(t,"b")||Ms(t,"body"))}const sj=["b","body"];function dEe(t){return Wc(t,sj)}const aj=["c","cases"];function fEe(t){return Wc(t,aj,[])}const lj=["s","static"];function hEe(t){return Wc(t,lj)}const uj=["i","items"];function mEe(t){return Wc(t,uj,[])}const cj=["t","type"];function nM(t){return Wc(t,cj)}const dj=["v","value"];function X0(t,e){const n=Wc(t,dj);if(n!=null)return n;throw Kv(e)}const fj=["m","modifier"];function gEe(t){return Wc(t,fj)}const hj=["k","key"];function pEe(t){const e=Wc(t,hj);if(e)return e;throw Kv(6)}function Wc(t,e,n){for(let i=0;ivEe(n,t)}function vEe(t,e){const n=dEe(e);if(n==null)throw Kv(0);if(nM(n)===1){const o=fEe(n);return t.plural(o.reduce((s,a)=>[...s,E3(t,a)],[]))}else return E3(t,n)}function E3(t,e){const n=hEe(e);if(n!=null)return t.type==="text"?n:t.normalize([n]);{const i=mEe(e).reduce((r,o)=>[...r,Y2(t,o)],[]);return t.normalize(i)}}function Y2(t,e){const n=nM(e);switch(n){case 3:return X0(e,n);case 9:return X0(e,n);case 4:{const i=e;if(Ms(i,"k")&&i.k)return t.interpolate(t.named(i.k));if(Ms(i,"key")&&i.key)return t.interpolate(t.named(i.key));throw Kv(n)}case 5:{const i=e;if(Ms(i,"i")&&Xi(i.i))return t.interpolate(t.list(i.i));if(Ms(i,"index")&&Xi(i.index))return t.interpolate(t.list(i.index));throw Kv(n)}case 6:{const i=e,r=gEe(i),o=pEe(i);return t.linked(Y2(t,o),r?Y2(t,r):void 0,t.type)}case 7:return X0(e,n);case 8:return X0(e,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const bEe=t=>t;let J0=Un();function yEe(t,e={}){let n=!1;const i=e.onError||$Te;return e.onError=r=>{n=!0,i(r)},{...uEe(t,e),detectError:n}}function wEe(t,e){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&ht(t)){kn(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||bEe)(t),r=J0[i];if(r)return r;const{ast:o,detectError:s}=yEe(t,{...e,location:!1,jit:!0}),a=Wk(o);return s?a:J0[i]=a}else{const n=t.cacheKey;if(n){const i=J0[n];return i||(J0[n]=Wk(t))}else return Wk(t)}}let Gv=null;function _Ee(t){Gv=t}function CEe(t,e,n){Gv&&Gv.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:n})}const SEe=kEe("function:translate");function kEe(t){return e=>Gv&&Gv.emit(t,e)}const Xl={INVALID_ARGUMENT:FTe,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},TEe=24;function Jl(t){return KC(t,null,void 0)}function iM(t,e){return e.locale!=null?x3(e.locale):x3(t.locale)}let qk;function x3(t){if(ht(t))return t;if(di(t)){if(t.resolvedOnce&&qk!=null)return qk;if(t.constructor.name==="Function"){const e=t();if(NTe(e))throw Jl(Xl.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return qk=e}else throw Jl(Xl.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Jl(Xl.NOT_SUPPORT_LOCALE_TYPE)}function EEe(t,e,n){return[...new Set([n,...Ei(e)?e:Nn(e)?Object.keys(e):ht(e)?[e]:[n]])]}function X2(t,e,n){const i=ht(n)?n:Yv,r=t;r.__localeChainCache||(r.__localeChainCache=new Map);let o=r.__localeChainCache.get(i);if(!o){o=[];let s=[n];for(;Ei(s);)s=A3(o,s,e);const a=Ei(e)||!yn(e)?e:e.default?e.default:null;s=ht(a)?[a]:a,Ei(s)&&A3(o,s,!1),r.__localeChainCache.set(i,o)}return o}function A3(t,e,n){let i=!0;for(let r=0;r{s===void 0?s=a:s+=a},f[1]=()=>{s!==void 0&&(e.push(s),s=void 0)},f[2]=()=>{f[0](),r++},f[3]=()=>{if(r>0)r--,i=4,f[0]();else{if(r=0,s===void 0||(s=OEe(s),s===!1))return!1;f[1]()}};function h(){const m=t[n+1];if(i===5&&m==="'"||i===6&&m==='"')return n++,a="\\"+m,f[0](),!0}for(;i!==null;)if(n++,o=t[n],!(o==="\\"&&h())){if(l=MEe(o),d=qc[i],u=d[l]||d.l||8,u===8||(i=u[0],u[1]!==void 0&&(c=f[u[1]],c&&(a=o,c()===!1))))return;if(i===7)return e}}const P3=new Map;function DEe(t,e){return Nn(t)?t[e]:null}function NEe(t,e){if(!Nn(t))return null;let n=P3.get(e);if(n||(n=LEe(e),n&&P3.set(e,n)),!n)return null;const i=n.length;let r=t,o=0;for(;o`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function VEe(){return{upper:(t,e)=>e==="text"&&ht(t)?t.toUpperCase():e==="vnode"&&Nn(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&ht(t)?t.toLowerCase():e==="vnode"&&Nn(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&ht(t)?I3(t):e==="vnode"&&Nn(t)&&"__v_isVNode"in t?I3(t.children):t}}let gj;function FEe(t){gj=t}let pj;function $Ee(t){pj=t}let vj;function zEe(t){vj=t}let bj=null;const HEe=t=>{bj=t},UEe=()=>bj;let yj=null;const R3=t=>{yj=t},WEe=()=>yj;let M3=0;function qEe(t={}){const e=di(t.onWarn)?t.onWarn:ITe,n=ht(t.version)?t.version:BEe,i=ht(t.locale)||di(t.locale)?t.locale:Yv,r=di(i)?Yv:i,o=Ei(t.fallbackLocale)||yn(t.fallbackLocale)||ht(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:r,s=yn(t.messages)?t.messages:jk(r),a=yn(t.datetimeFormats)?t.datetimeFormats:jk(r),l=yn(t.numberFormats)?t.numberFormats:jk(r),u=rr(Un(),t.modifiers,VEe()),c=t.pluralRules||Un(),d=di(t.missing)?t.missing:null,f=kn(t.missingWarn)||$m(t.missingWarn)?t.missingWarn:!0,h=kn(t.fallbackWarn)||$m(t.fallbackWarn)?t.fallbackWarn:!0,m=!!t.fallbackFormat,g=!!t.unresolving,v=di(t.postTranslation)?t.postTranslation:null,p=yn(t.processor)?t.processor:null,b=kn(t.warnHtmlMessage)?t.warnHtmlMessage:!0,y=!!t.escapeParameter,_=di(t.messageCompiler)?t.messageCompiler:gj,C=di(t.messageResolver)?t.messageResolver:pj||DEe,S=di(t.localeFallbacker)?t.localeFallbacker:vj||EEe,k=Nn(t.fallbackContext)?t.fallbackContext:void 0,T=t,E=Nn(T.__datetimeFormatters)?T.__datetimeFormatters:new Map,x=Nn(T.__numberFormatters)?T.__numberFormatters:new Map,P=Nn(T.__meta)?T.__meta:{};M3++;const A={version:n,cid:M3,locale:i,fallbackLocale:o,messages:s,modifiers:u,pluralRules:c,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:m,unresolving:g,postTranslation:v,processor:p,warnHtmlMessage:b,escapeParameter:y,messageCompiler:_,messageResolver:C,localeFallbacker:S,fallbackContext:k,onWarn:e,__meta:P};return A.datetimeFormats=a,A.numberFormats=l,A.__datetimeFormatters=E,A.__numberFormatters=x,__INTLIFY_PROD_DEVTOOLS__&&CEe(A,n,P),A}const jk=t=>({[t]:Un()});function rM(t,e,n,i,r){const{missing:o,onWarn:s}=t;if(o!==null){const a=o(t,n,e,r);return ht(a)?a:e}else return e}function Dg(t,e,n){const i=t;i.__localeChainCache=new Map,t.localeFallbacker(t,n,e)}function jEe(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function KEe(t,e){const n=e.indexOf(t);if(n===-1)return!1;for(let i=n+1;i{wj.includes(l)?s[l]=n[l]:o[l]=n[l]}),ht(i)?o.locale=i:yn(i)&&(s=i),yn(r)&&(s=r),[o.key||"",a,o,s]}function L3(t,e,n){const i=t;for(const r in n){const o=`${e}__${r}`;i.__datetimeFormatters.has(o)&&i.__datetimeFormatters.delete(o)}}function D3(t,...e){const{numberFormats:n,unresolving:i,fallbackLocale:r,onWarn:o,localeFallbacker:s}=t,{__numberFormatters:a}=t;if(!Xi(e[0]))return Z_;const[l,u,c,d]=Z2(...e),f=kn(c.missingWarn)?c.missingWarn:t.missingWarn;kn(c.fallbackWarn)?c.fallbackWarn:t.fallbackWarn;const h=!!c.part,m=iM(t,c),g=s(t,r,m);if(!ht(l)||l==="")return new Intl.NumberFormat(m.replace(/!/g,""),d).format(u);let v={},p,b=null;const y="number format";for(let S=0;S{_j.includes(l)?s[l]=n[l]:o[l]=n[l]}),ht(i)?o.locale=i:yn(i)&&(s=i),yn(r)&&(s=r),[o.key||"",a,o,s]}function N3(t,e,n){const i=t;for(const r in n){const o=`${e}__${r}`;i.__numberFormatters.has(o)&&i.__numberFormatters.delete(o)}}const GEe=t=>t,YEe=t=>"",XEe="text",JEe=t=>t.length===0?"":eM(t),ZEe=BTe;function Kk(t,e){return t=Math.abs(t),e===2?t===1?0:1:Math.min(t,2)}function QEe(t){const e=Xi(t.pluralIndex)?t.pluralIndex:-1;return Xi(t.named?.count)?t.named.count:Xi(t.named?.n)?t.named.n:e}function exe(t={}){const e=t.locale,n=QEe(t),i=ht(e)&&di(t.pluralRules?.[e])?t.pluralRules[e]:Kk,r=i===Kk?void 0:Kk,o=p=>p[i(n,p.length,r)],s=t.list||[],a=p=>s[p],l=t.named||Un();Xi(t.pluralIndex)&&(l.count||=t.pluralIndex,l.n||=t.pluralIndex);const u=p=>l[p];function c(p,b){const y=di(t.messages)?t.messages(p,!!b):Nn(t.messages)?t.messages[p]:!1;return y||(t.parent?t.parent.message(p):YEe)}const d=p=>t.modifiers?t.modifiers[p]:GEe,f=di(t.processor?.normalize)?t.processor.normalize:JEe,h=di(t.processor?.interpolate)?t.processor.interpolate:ZEe,m=ht(t.processor?.type)?t.processor.type:XEe,v={list:a,named:u,plural:o,linked:(p,...b)=>{const[y,_]=b;let C="text",S="";b.length===1?Nn(y)?(S=y.modifier||S,C=y.type||C):ht(y)&&(S=y||S):b.length===2&&(ht(y)&&(S=y||S),ht(_)&&(C=_||C));const k=c(p,!0)(v),T=k===""||k===void 0?p:k,E=C==="vnode"&&Ei(T)&&S?T[0]:T;return S?d(S)(E,C):E},message:c,type:m,interpolate:h,normalize:f,values:rr(Un(),s,l)};return v}const B3=()=>"",ks=t=>di(t);function V3(t,...e){const{fallbackFormat:n,postTranslation:i,unresolving:r,messageCompiler:o,fallbackLocale:s,messages:a}=t,[l,u]=Q2(...e),c=kn(u.missingWarn)?u.missingWarn:t.missingWarn,d=kn(u.fallbackWarn)?u.fallbackWarn:t.fallbackWarn,f=kn(u.escapeParameter)?u.escapeParameter:t.escapeParameter,h=!!u.resolvedMessage,m=ht(u.default)||kn(u.default)?kn(u.default)?o?l:()=>l:u.default:n?o?l:()=>l:null,g=n||m!=null&&(ht(m)||di(m)),v=iM(t,u);f&&txe(u);let[p,b,y]=h?[l,v,a[v]||Un()]:Cj(t,l,v,s,d,c),_=p,C=l;if(!h&&!(ht(_)||Za(_)||ks(_))&&g&&(_=m,C=_),!h&&(!(ht(_)||Za(_)||ks(_))||!ht(b)))return r?GC:l;let S=!1;const k=()=>{S=!0},T=ks(_)?_:Sj(t,l,b,_,C,k);if(S)return _;const E=rxe(t,b,y,u),x=exe(E),P=nxe(t,T,x);let A=i?i(P,l):P;if(f&&ht(A)&&(A=LTe(A)),__INTLIFY_PROD_DEVTOOLS__){const I={timestamp:Date.now(),key:ht(l)?l:ks(_)?_.key:"",locale:b||(ks(_)?_.locale:""),format:ht(_)?_:ks(_)?_.source:"",message:A};I.meta=rr({},t.__meta,UEe()||{}),SEe(I)}return A}function txe(t){Ei(t.list)?t.list=t.list.map(e=>ht(e)?_3(e):e):Nn(t.named)&&Object.keys(t.named).forEach(e=>{ht(t.named[e])&&(t.named[e]=_3(t.named[e]))})}function Cj(t,e,n,i,r,o){const{messages:s,onWarn:a,messageResolver:l,localeFallbacker:u}=t,c=u(t,i,n);let d=Un(),f,h=null;const m="translate";for(let g=0;gi);return u.locale=n,u.key=e,u}const l=s(i,ixe(t,n,r,i,a,o));return l.locale=n,l.key=e,l.source=i,l}function nxe(t,e,n){return e(n)}function Q2(...t){const[e,n,i]=t,r=Un();if(!ht(e)&&!Xi(e)&&!ks(e)&&!Za(e))throw Jl(Xl.INVALID_ARGUMENT);const o=Xi(e)?String(e):(ks(e),e);return Xi(n)?r.plural=n:ht(n)?r.default=n:yn(n)&&!jC(n)?r.named=n:Ei(n)&&(r.list=n),Xi(i)?r.plural=i:ht(i)?r.default=i:yn(i)&&rr(r,i),[o,r]}function ixe(t,e,n,i,r,o){return{locale:e,key:n,warnHtmlMessage:r,onError:s=>{throw o&&o(s),s},onCacheKey:s=>RTe(e,n,s)}}function rxe(t,e,n,i){const{modifiers:r,pluralRules:o,messageResolver:s,fallbackLocale:a,fallbackWarn:l,missingWarn:u,fallbackContext:c}=t,f={locale:e,modifiers:r,pluralRules:o,messages:(h,m)=>{let g=s(n,h);if(g==null&&(c||m)){const[,,v]=Cj(c||t,h,e,a,l,u);g=s(v,h)}if(ht(g)||Za(g)){let v=!1;const b=Sj(t,h,e,g,h,()=>{v=!0});return v?B3:b}else return ks(g)?g:B3}};return t.processor&&(f.processor=t.processor),i.list&&(f.list=i.list),i.named&&(f.named=i.named),Xi(i.plural)&&(f.pluralIndex=i.plural),f}cEe();const oxe="11.3.0";function sxe(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Kd().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Kd().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Kd().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Kd().__INTLIFY_PROD_DEVTOOLS__=!1)}const Do={UNEXPECTED_RETURN_TYPE:TEe,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32};function ls(t,...e){return KC(t,null,void 0)}const eA=Uc("__translateVNode"),tA=Uc("__datetimeParts"),nA=Uc("__numberParts"),kj=Uc("__setPluralRules"),Tj=Uc("__injectWithOption"),iA=Uc("__dispose");function Xv(t){if(!Nn(t)||Za(t))return t;for(const e in t)if(Ms(t,e))if(!e.includes("."))Nn(t[e])&&Xv(t[e]);else{const n=e.split("."),i=n.length-1;let r=t,o=!1;for(let s=0;s{if("locale"in a&&"resource"in a){const{locale:l,resource:u}=a;l?(s[l]=s[l]||Un(),Uw(u,s[l])):Uw(u,s)}else ht(a)&&Uw(JSON.parse(a),s)}),r==null&&o)for(const a in s)Ms(s,a)&&Xv(s[a]);return s}function Ej(t){return t.type}function xj(t,e,n){let i=Nn(e.messages)?e.messages:Un();"__i18nGlobal"in n&&(i=oM(t.locale.value,{messages:i,__i18n:n.__i18nGlobal}));const r=Object.keys(i);r.length&&r.forEach(o=>{t.mergeLocaleMessage(o,i[o])});{if(Nn(e.datetimeFormats)){const o=Object.keys(e.datetimeFormats);o.length&&o.forEach(s=>{t.mergeDateTimeFormat(s,e.datetimeFormats[s])})}if(Nn(e.numberFormats)){const o=Object.keys(e.numberFormats);o.length&&o.forEach(s=>{t.mergeNumberFormat(s,e.numberFormats[s])})}}}function F3(t){return L(Mf,null,t,0)}function Jv(){return Ct()}const $3="__INTLIFY_META__",z3=()=>[],axe=()=>!1;let H3=0;function U3(t){return((e,n,i,r)=>t(n,i,Jv()||void 0,r))}const lxe=()=>{const t=Jv();let e=null;return t&&(e=Ej(t)[$3])?{[$3]:e}:null};function sM(t={}){const{__root:e,__injectWithOption:n}=t,i=e===void 0,r=t.flatJson,o=J_?H:bi;let s=kn(t.inheritLocale)?t.inheritLocale:!0;const a=o(e&&s?e.locale.value:ht(t.locale)?t.locale:Yv),l=o(e&&s?e.fallbackLocale.value:ht(t.fallbackLocale)||Ei(t.fallbackLocale)||yn(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:a.value),u=o(oM(a.value,t)),c=o(yn(t.datetimeFormats)?t.datetimeFormats:{[a.value]:{}}),d=o(yn(t.numberFormats)?t.numberFormats:{[a.value]:{}});let f=e?e.missingWarn:kn(t.missingWarn)||$m(t.missingWarn)?t.missingWarn:!0,h=e?e.fallbackWarn:kn(t.fallbackWarn)||$m(t.fallbackWarn)?t.fallbackWarn:!0,m=e?e.fallbackRoot:kn(t.fallbackRoot)?t.fallbackRoot:!0,g=!!t.fallbackFormat,v=di(t.missing)?t.missing:null,p=di(t.missing)?U3(t.missing):null,b=di(t.postTranslation)?t.postTranslation:null,y=e?e.warnHtmlMessage:kn(t.warnHtmlMessage)?t.warnHtmlMessage:!0,_=!!t.escapeParameter;const C=e?e.modifiers:yn(t.modifiers)?t.modifiers:{};let S=t.pluralRules||e&&e.pluralRules,k;k=(()=>{i&&R3(null);const fe={version:oxe,locale:a.value,fallbackLocale:l.value,messages:u.value,modifiers:C,pluralRules:S,missing:p===null?void 0:p,missingWarn:f,fallbackWarn:h,fallbackFormat:g,unresolving:!0,postTranslation:b===null?void 0:b,warnHtmlMessage:y,escapeParameter:_,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};fe.datetimeFormats=c.value,fe.numberFormats=d.value,fe.__datetimeFormatters=yn(k)?k.__datetimeFormatters:void 0,fe.__numberFormatters=yn(k)?k.__numberFormatters:void 0;const Te=qEe(fe);return i&&R3(Te),Te})(),Dg(k,a.value,l.value);function E(){return[a.value,l.value,u.value,c.value,d.value]}const x=M({get:()=>a.value,set:fe=>{k.locale=fe,a.value=fe}}),P=M({get:()=>l.value,set:fe=>{k.fallbackLocale=fe,l.value=fe,Dg(k,a.value,fe)}}),A=M(()=>u.value),I=M(()=>c.value),D=M(()=>d.value);function q(){return di(b)?b:null}function z(fe){b=fe,k.postTranslation=fe}function R(){return v}function O(fe){fe!==null&&(p=U3(fe)),v=fe,k.missing=p}const N=(fe,Te,et,Re,ze,Ke)=>{E();let Dt;try{__INTLIFY_PROD_DEVTOOLS__,i||(k.fallbackContext=e?WEe():void 0),Dt=fe(k)}finally{__INTLIFY_PROD_DEVTOOLS__,i||(k.fallbackContext=void 0)}if(et!=="translate exists"&&Xi(Dt)&&Dt===GC||et==="translate exists"&&!Dt){const[Cn,Je]=Te();return e&&m?Re(e):ze(Cn)}else{if(Ke(Dt))return Dt;throw ls(Do.UNEXPECTED_RETURN_TYPE)}};function F(...fe){return N(Te=>Reflect.apply(V3,null,[Te,...fe]),()=>Q2(...fe),"translate",Te=>Reflect.apply(Te.t,Te,[...fe]),Te=>Te,Te=>ht(Te))}function j(...fe){const[Te,et,Re]=fe;if(Re&&!Nn(Re))throw ls(Do.INVALID_ARGUMENT);return F(Te,et,rr({resolvedMessage:!0},Re||{}))}function U(...fe){return N(Te=>Reflect.apply(O3,null,[Te,...fe]),()=>J2(...fe),"datetime format",Te=>Reflect.apply(Te.d,Te,[...fe]),()=>Z_,Te=>ht(Te)||Ei(Te))}function W(...fe){return N(Te=>Reflect.apply(D3,null,[Te,...fe]),()=>Z2(...fe),"number format",Te=>Reflect.apply(Te.n,Te,[...fe]),()=>Z_,Te=>ht(Te)||Ei(Te))}function J(fe){return fe.map(Te=>ht(Te)||Xi(Te)||kn(Te)?F3(String(Te)):Te)}const he={normalize:J,interpolate:fe=>fe,type:"vnode"};function X(...fe){return N(Te=>{let et;const Re=Te;try{Re.processor=he,et=Reflect.apply(V3,null,[Re,...fe])}finally{Re.processor=null}return et},()=>Q2(...fe),"translate",Te=>Te[eA](...fe),Te=>[F3(Te)],Te=>Ei(Te))}function se(...fe){return N(Te=>Reflect.apply(D3,null,[Te,...fe]),()=>Z2(...fe),"number format",Te=>Te[nA](...fe),z3,Te=>ht(Te)||Ei(Te))}function re(...fe){return N(Te=>Reflect.apply(O3,null,[Te,...fe]),()=>J2(...fe),"datetime format",Te=>Te[tA](...fe),z3,Te=>ht(Te)||Ei(Te))}function ee(fe){S=fe,k.pluralRules=S}function te(fe,Te){return N(()=>{if(!fe)return!1;const et=ht(Te)?Te:a.value,Re=ht(Te)?[et]:X2(k,l.value,et);for(let ze=0;ze[fe],"translate exists",et=>Reflect.apply(et.te,et,[fe,Te]),axe,et=>kn(et))}function V(fe){let Te=null;const et=X2(k,l.value,a.value);for(let Re=0;Re{s&&(a.value=fe,k.locale=fe,Dg(k,a.value,l.value))}),Se(e.fallbackLocale,fe=>{s&&(l.value=fe,k.fallbackLocale=fe,Dg(k,a.value,l.value))}));const Ie={id:H3,locale:x,fallbackLocale:P,get inheritLocale(){return s},set inheritLocale(fe){s=fe,fe&&e&&(a.value=e.locale.value,l.value=e.fallbackLocale.value,Dg(k,a.value,l.value))},get availableLocales(){return Object.keys(u.value).sort()},messages:A,get modifiers(){return C},get pluralRules(){return S||{}},get isGlobal(){return i},get missingWarn(){return f},set missingWarn(fe){f=fe,k.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(fe){h=fe,k.fallbackWarn=h},get fallbackRoot(){return m},set fallbackRoot(fe){m=fe},get fallbackFormat(){return g},set fallbackFormat(fe){g=fe,k.fallbackFormat=g},get warnHtmlMessage(){return y},set warnHtmlMessage(fe){y=fe,k.warnHtmlMessage=fe},get escapeParameter(){return _},set escapeParameter(fe){_=fe,k.escapeParameter=fe},t:F,getLocaleMessage:G,setLocaleMessage:ye,mergeLocaleMessage:be,getPostTranslationHandler:q,setPostTranslationHandler:z,getMissingHandler:R,setMissingHandler:O,[kj]:ee};return Ie.datetimeFormats=I,Ie.numberFormats=D,Ie.rt=j,Ie.te=te,Ie.tm=K,Ie.d=U,Ie.n=W,Ie.getDateTimeFormat=Ce,Ie.setDateTimeFormat=Y,Ie.mergeDateTimeFormat=Z,Ie.getNumberFormat=ae,Ie.setNumberFormat=pe,Ie.mergeNumberFormat=je,Ie[Tj]=n,Ie[eA]=X,Ie[tA]=re,Ie[nA]=se,Ie}function uxe(t){const e=ht(t.locale)?t.locale:Yv,n=ht(t.fallbackLocale)||Ei(t.fallbackLocale)||yn(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:e,i=di(t.missing)?t.missing:void 0,r=kn(t.silentTranslationWarn)||$m(t.silentTranslationWarn)?!t.silentTranslationWarn:!0,o=kn(t.silentFallbackWarn)||$m(t.silentFallbackWarn)?!t.silentFallbackWarn:!0,s=kn(t.fallbackRoot)?t.fallbackRoot:!0,a=!!t.formatFallbackMessages,l=yn(t.modifiers)?t.modifiers:{},u=t.pluralizationRules,c=di(t.postTranslation)?t.postTranslation:void 0,d=ht(t.warnHtmlInMessage)?t.warnHtmlInMessage!=="off":!0,f=!!t.escapeParameterHtml,h=kn(t.sync)?t.sync:!0;let m=t.messages;if(yn(t.sharedMessages)){const C=t.sharedMessages;m=Object.keys(C).reduce((k,T)=>{const E=k[T]||(k[T]={});return rr(E,C[T]),k},m||{})}const{__i18n:g,__root:v,__injectWithOption:p}=t,b=t.datetimeFormats,y=t.numberFormats,_=t.flatJson;return{locale:e,fallbackLocale:n,messages:m,flatJson:_,datetimeFormats:b,numberFormats:y,missing:i,missingWarn:r,fallbackWarn:o,fallbackRoot:s,fallbackFormat:a,modifiers:l,pluralRules:u,postTranslation:c,warnHtmlMessage:d,escapeParameter:f,messageResolver:t.messageResolver,inheritLocale:h,__i18n:g,__root:v,__injectWithOption:p}}function rA(t={}){const e=sM(uxe(t)),{__extender:n}=t,i={id:e.id,get locale(){return e.locale.value},set locale(r){e.locale.value=r},get fallbackLocale(){return e.fallbackLocale.value},set fallbackLocale(r){e.fallbackLocale.value=r},get messages(){return e.messages.value},get datetimeFormats(){return e.datetimeFormats.value},get numberFormats(){return e.numberFormats.value},get availableLocales(){return e.availableLocales},get missing(){return e.getMissingHandler()},set missing(r){e.setMissingHandler(r)},get silentTranslationWarn(){return kn(e.missingWarn)?!e.missingWarn:e.missingWarn},set silentTranslationWarn(r){e.missingWarn=kn(r)?!r:r},get silentFallbackWarn(){return kn(e.fallbackWarn)?!e.fallbackWarn:e.fallbackWarn},set silentFallbackWarn(r){e.fallbackWarn=kn(r)?!r:r},get modifiers(){return e.modifiers},get formatFallbackMessages(){return e.fallbackFormat},set formatFallbackMessages(r){e.fallbackFormat=r},get postTranslation(){return e.getPostTranslationHandler()},set postTranslation(r){e.setPostTranslationHandler(r)},get sync(){return e.inheritLocale},set sync(r){e.inheritLocale=r},get warnHtmlInMessage(){return e.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(r){e.warnHtmlMessage=r!=="off"},get escapeParameterHtml(){return e.escapeParameter},set escapeParameterHtml(r){e.escapeParameter=r},get pluralizationRules(){return e.pluralRules||{}},__composer:e,t(...r){return Reflect.apply(e.t,e,[...r])},rt(...r){return Reflect.apply(e.rt,e,[...r])},te(r,o){return e.te(r,o)},tm(r){return e.tm(r)},getLocaleMessage(r){return e.getLocaleMessage(r)},setLocaleMessage(r,o){e.setLocaleMessage(r,o)},mergeLocaleMessage(r,o){e.mergeLocaleMessage(r,o)},d(...r){return Reflect.apply(e.d,e,[...r])},getDateTimeFormat(r){return e.getDateTimeFormat(r)},setDateTimeFormat(r,o){e.setDateTimeFormat(r,o)},mergeDateTimeFormat(r,o){e.mergeDateTimeFormat(r,o)},n(...r){return Reflect.apply(e.n,e,[...r])},getNumberFormat(r){return e.getNumberFormat(r)},setNumberFormat(r,o){e.setNumberFormat(r,o)},mergeNumberFormat(r,o){e.mergeNumberFormat(r,o)}};return i.__extender=n,i}function cxe(t,e,n){return{beforeCreate(){const i=Jv();if(!i)throw ls(Do.UNEXPECTED_ERROR);const r=this.$options;if(r.i18n){const o=r.i18n;if(r.__i18n&&(o.__i18n=r.__i18n),o.__root=e,this===this.$root)this.$i18n=W3(t,o);else{o.__injectWithOption=!0,o.__extender=n.__vueI18nExtend,this.$i18n=rA(o);const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}}else if(r.__i18n)if(this===this.$root)this.$i18n=W3(t,r);else{this.$i18n=rA({__i18n:r.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:e});const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}else this.$i18n=t;r.__i18nGlobal&&xj(e,r,r),this.$t=(...o)=>this.$i18n.t(...o),this.$rt=(...o)=>this.$i18n.rt(...o),this.$te=(o,s)=>this.$i18n.te(o,s),this.$d=(...o)=>this.$i18n.d(...o),this.$n=(...o)=>this.$i18n.n(...o),this.$tm=o=>this.$i18n.tm(o),n.__setInstance(i,this.$i18n)},mounted(){},unmounted(){const i=Jv();if(!i)throw ls(Do.UNEXPECTED_ERROR);const r=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,r.__disposer&&(r.__disposer(),delete r.__disposer,delete r.__extender),n.__deleteInstance(i),delete this.$i18n}}}function W3(t,e){t.locale=e.locale||t.locale,t.fallbackLocale=e.fallbackLocale||t.fallbackLocale,t.missing=e.missing||t.missing,t.silentTranslationWarn=e.silentTranslationWarn||t.silentFallbackWarn,t.silentFallbackWarn=e.silentFallbackWarn||t.silentFallbackWarn,t.formatFallbackMessages=e.formatFallbackMessages||t.formatFallbackMessages,t.postTranslation=e.postTranslation||t.postTranslation,t.warnHtmlInMessage=e.warnHtmlInMessage||t.warnHtmlInMessage,t.escapeParameterHtml=e.escapeParameterHtml||t.escapeParameterHtml,t.sync=e.sync||t.sync,t.__composer[kj](e.pluralizationRules||t.pluralizationRules);const n=oM(t.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(n).forEach(i=>t.mergeLocaleMessage(i,n[i])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(i=>t.mergeDateTimeFormat(i,e.datetimeFormats[i])),e.numberFormats&&Object.keys(e.numberFormats).forEach(i=>t.mergeNumberFormat(i,e.numberFormats[i])),t}const aM={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function dxe({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((i,r)=>[...i,...r.type===rt?r.children:[r]],[]):e.reduce((n,i)=>{const r=t[i];return r&&(n[i]=r()),n},Un())}function Aj(){return rt}const fxe=le({name:"i18n-t",props:rr({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Xi(t)||!isNaN(t)}},aM),setup(t,e){const{slots:n,attrs:i}=e,r=t.i18n||YC({useScope:t.scope,__useComponent:!0});return()=>{const o=Object.keys(n).filter(d=>d[0]!=="_"),s=Un();t.locale&&(s.locale=t.locale),t.plural!==void 0&&(s.plural=ht(t.plural)?+t.plural:t.plural);const a=dxe(e,o),l=r[eA](t.keypath,a,s),u=rr(Un(),i),c=ht(t.tag)||Nn(t.tag)?t.tag:Aj();return nt(c,u,l)}}}),q3=fxe;function hxe(t){return Ei(t)&&!ht(t[0])}function Pj(t,e,n,i){const{slots:r,attrs:o}=e;return()=>{const s={part:!0};let a=Un();t.locale&&(s.locale=t.locale),ht(t.format)?s.key=t.format:Nn(t.format)&&(ht(t.format.key)&&(s.key=t.format.key),a=Object.keys(t.format).reduce((f,h)=>n.includes(h)?rr(Un(),f,{[h]:t.format[h]}):f,Un()));const l=i(t.value,s,a);let u=[s.key];Ei(l)?u=l.map((f,h)=>{const m=r[f.type],g=m?m({[f.type]:f.value,index:h,parts:l}):[f.value];return hxe(g)&&(g[0].key=`${f.type}-${h}`),g}):ht(l)&&(u=[l]);const c=rr(Un(),o),d=ht(t.tag)||Nn(t.tag)?t.tag:Aj();return nt(d,c,u)}}const mxe=le({name:"i18n-n",props:rr({value:{type:Number,required:!0},format:{type:[String,Object]}},aM),setup(t,e){const n=t.i18n||YC({useScope:t.scope,__useComponent:!0});return Pj(t,e,_j,(...i)=>n[nA](...i))}}),j3=mxe;function gxe(t,e){const n=t;if(t.mode==="composition")return n.__getInstance(e)||t.global;{const i=n.__getInstance(e);return i!=null?i.__composer:t.global.__composer}}function pxe(t){const e=s=>{const{instance:a,value:l}=s;if(!a||!a.$)throw ls(Do.UNEXPECTED_ERROR);const u=gxe(t,a.$),c=K3(l);return[Reflect.apply(u.t,u,[...G3(c)]),u]};return{created:(s,a)=>{const[l,u]=e(a);J_&&(s.__i18nWatcher=Se(u.locale,()=>{a.instance&&a.instance.$forceUpdate()})),s.__composer=u,s.textContent=l},unmounted:s=>{J_&&s.__i18nWatcher&&(s.__i18nWatcher(),s.__i18nWatcher=void 0,delete s.__i18nWatcher),s.__composer&&(s.__composer=void 0,delete s.__composer)},beforeUpdate:(s,{value:a})=>{if(s.__composer){const l=s.__composer,u=K3(a);s.textContent=Reflect.apply(l.t,l,[...G3(u)])}},getSSRProps:s=>{const[a]=e(s);return{textContent:a}}}}function K3(t){if(ht(t))return{path:t};if(yn(t)){if(!("path"in t))throw ls(Do.REQUIRED_VALUE,"path");return t}else throw ls(Do.INVALID_VALUE)}function G3(t){const{path:e,locale:n,args:i,choice:r,plural:o}=t,s={},a=i||{};return ht(n)&&(s.locale=n),Xi(r)&&(s.plural=r),Xi(o)&&(s.plural=o),[e,a,s]}function vxe(t,e,...n){const i=yn(n[0])?n[0]:{};(!kn(i.globalInstall)||i.globalInstall)&&([q3.name,"I18nT"].forEach(o=>t.component(o,q3)),[j3.name,"I18nN"].forEach(o=>t.component(o,j3)),[X3.name,"I18nD"].forEach(o=>t.component(o,X3))),t.directive("t",pxe(e))}const bxe=Uc("global-vue-i18n");function yxe(t={}){const e=__VUE_I18N_LEGACY_API__&&kn(t.legacy)?t.legacy:__VUE_I18N_LEGACY_API__,n=kn(t.globalInjection)?t.globalInjection:!0,i=new Map,[r,o]=wxe(t,e),s=Uc("");function a(d){return i.get(d)||null}function l(d,f){i.set(d,f)}function u(d){i.delete(d)}const c={get mode(){return __VUE_I18N_LEGACY_API__&&e?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=s,d.provide(d.__VUE_I18N_SYMBOL__,c),yn(f[0])){const g=f[0];c.__composerExtend=g.__composerExtend,c.__vueI18nExtend=g.__vueI18nExtend}let h=null;!e&&n&&(h=Axe(d,c.global)),__VUE_I18N_FULL_INSTALL__&&vxe(d,c,...f),__VUE_I18N_LEGACY_API__&&e&&d.mixin(cxe(o,o.__composer,c));const m=d.unmount;d.unmount=()=>{h&&h(),c.dispose(),m()}},get global(){return o},dispose(){r.stop()},__instances:i,__getInstance:a,__setInstance:l,__deleteInstance:u};return c}function YC(t={}){const e=Jv();if(e==null)throw ls(Do.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw ls(Do.NOT_INSTALLED);const n=_xe(e),i=Sxe(n),r=Ej(e),o=Cxe(t,r);if(o==="global")return xj(i,t,r),i;if(o==="parent"){let l=kxe(n,e,t.__useComponent);return l==null&&(l=i),l}const s=n;let a=s.__getInstance(e);if(a==null){const l=rr({},t);"__i18n"in r&&(l.__i18n=r.__i18n),i&&(l.__root=i),a=sM(l),s.__composerExtend&&(a[iA]=s.__composerExtend(a)),Exe(s,e,a),s.__setInstance(e,a)}return a}function wxe(t,e){const n=zb(),i=__VUE_I18N_LEGACY_API__&&e?n.run(()=>rA(t)):n.run(()=>sM(t));if(i==null)throw ls(Do.UNEXPECTED_ERROR);return[n,i]}function _xe(t){const e=Ne(t.isCE?bxe:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw ls(t.isCE?Do.NOT_INSTALLED_WITH_PROVIDE:Do.UNEXPECTED_ERROR);return e}function Cxe(t,e){return jC(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function Sxe(t){return t.mode==="composition"?t.global:t.global.__composer}function kxe(t,e,n=!1){let i=null;const r=e.root;let o=Txe(e,n);for(;o!=null;){const s=t;if(t.mode==="composition")i=s.__getInstance(o);else if(__VUE_I18N_LEGACY_API__){const a=s.__getInstance(o);a!=null&&(i=a.__composer,n&&i&&!i[Tj]&&(i=null))}if(i!=null||r===o)break;o=o.parent}return i}function Txe(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function Exe(t,e,n){Pt(()=>{},e),Fc(()=>{const i=n;t.__deleteInstance(e);const r=i[iA];r&&(r(),delete i[iA])},e)}const xxe=["locale","fallbackLocale","availableLocales"],Y3=["t","rt","d","n","tm","te"];function Axe(t,e){const n=Object.create(null);return xxe.forEach(r=>{const o=Object.getOwnPropertyDescriptor(e,r);if(!o)throw ls(Do.UNEXPECTED_ERROR);const s=rn(o.value)?{get(){return o.value.value},set(a){o.value.value=a}}:{get(){return o.get&&o.get()}};Object.defineProperty(n,r,s)}),t.config.globalProperties.$i18n=n,Y3.forEach(r=>{const o=Object.getOwnPropertyDescriptor(e,r);if(!o||!o.value)throw ls(Do.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${r}`,o)}),()=>{delete t.config.globalProperties.$i18n,Y3.forEach(r=>{delete t.config.globalProperties[`$${r}`]})}}const Pxe=le({name:"i18n-d",props:rr({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},aM),setup(t,e){const n=t.i18n||YC({useScope:t.scope,__useComponent:!0});return Pj(t,e,wj,(...i)=>n[tA](...i))}}),X3=Pxe;sxe();FEe(wEe);$Ee(NEe);zEe(X2);if(__INTLIFY_PROD_DEVTOOLS__){const t=Kd();t.__INTLIFY__=!0,_Ee(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const J3="_I18N_LOCALE_CACHE_KEY_";function Ixe(t){const{storeId:e,messages:n,locale:i="enUS",useCache:r=!0,i18nOptions:o={}}=t,a=(r?bc.get(J3):null)||i,l=yxe({legacy:!1,locale:a,messages:n,...o});return{i18n:l,useI18nStore:PTe(e,()=>{const{t:c,locale:d}=YC();return{locale:d,change:m=>{r&&bc.set(J3,m),d.value=m},t:(m,g={})=>c(m,g),i18n:l}})}}var sh={},Gk,Z3;function Rxe(){return Z3||(Z3=1,Gk=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Gk}var Yk={},Lu={},Q3;function Vf(){if(Q3)return Lu;Q3=1;let t;const e=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return Lu.getSymbolSize=function(i){if(!i)throw new Error('"version" cannot be null or undefined');if(i<1||i>40)throw new Error('"version" should be in range from 1 to 40');return i*4+17},Lu.getSymbolTotalCodewords=function(i){return e[i]},Lu.getBCHDigit=function(n){let i=0;for(;n!==0;)i++,n>>>=1;return i},Lu.setToSJISFunction=function(i){if(typeof i!="function")throw new Error('"toSJISFunc" is not a valid function.');t=i},Lu.isKanjiModeEnabled=function(){return typeof t<"u"},Lu.toSJIS=function(i){return t(i)},Lu}var Xk={},eB;function lM(){return eB||(eB=1,(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}t.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},t.from=function(i,r){if(t.isValid(i))return i;try{return e(i)}catch{return r}}})(Xk)),Xk}var Jk,tB;function Mxe(){if(tB)return Jk;tB=1;function t(){this.buffer=[],this.length=0}return t.prototype={get:function(e){const n=Math.floor(e/8);return(this.buffer[n]>>>7-e%8&1)===1},put:function(e,n){for(let i=0;i>>n-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),e&&(this.buffer[n]|=128>>>this.length%8),this.length++}},Jk=t,Jk}var Zk,nB;function Oxe(){if(nB)return Zk;nB=1;function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return t.prototype.set=function(e,n,i,r){const o=e*this.size+n;this.data[o]=i,r&&(this.reservedBit[o]=!0)},t.prototype.get=function(e,n){return this.data[e*this.size+n]},t.prototype.xor=function(e,n,i){this.data[e*this.size+n]^=i},t.prototype.isReserved=function(e,n){return this.reservedBit[e*this.size+n]},Zk=t,Zk}var Qk={},iB;function Lxe(){return iB||(iB=1,(function(t){const e=Vf().getSymbolSize;t.getRowColCoords=function(i){if(i===1)return[];const r=Math.floor(i/7)+2,o=e(i),s=o===145?26:Math.ceil((o-13)/(2*r-2))*2,a=[o-7];for(let l=1;l=0&&r<=7},t.from=function(r){return t.isValid(r)?parseInt(r,10):void 0},t.getPenaltyN1=function(r){const o=r.size;let s=0,a=0,l=0,u=null,c=null;for(let d=0;d=5&&(s+=e.N1+(a-5)),u=h,a=1),h=r.get(f,d),h===c?l++:(l>=5&&(s+=e.N1+(l-5)),c=h,l=1)}a>=5&&(s+=e.N1+(a-5)),l>=5&&(s+=e.N1+(l-5))}return s},t.getPenaltyN2=function(r){const o=r.size;let s=0;for(let a=0;a=10&&(a===1488||a===93)&&s++,l=l<<1&2047|r.get(c,u),c>=10&&(l===1488||l===93)&&s++}return s*e.N3},t.getPenaltyN4=function(r){let o=0;const s=r.data.length;for(let l=0;l=0;){const s=o[0];for(let l=0;l0){const a=new Uint8Array(this.degree);return a.set(o,s),a}return o},iT=e,iT}var rT={},oT={},sT={},cB;function Rj(){return cB||(cB=1,sT.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),sT}var Ia={},dB;function Mj(){if(dB)return Ia;dB=1;const t="[0-9]+",e="[A-Z $%*+\\-./:]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+`)(?:.|[\r +]))+`;Ia.KANJI=new RegExp(n,"g"),Ia.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Ia.BYTE=new RegExp(i,"g"),Ia.NUMERIC=new RegExp(t,"g"),Ia.ALPHANUMERIC=new RegExp(e,"g");const r=new RegExp("^"+n+"$"),o=new RegExp("^"+t+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Ia.testKanji=function(l){return r.test(l)},Ia.testNumeric=function(l){return o.test(l)},Ia.testAlphanumeric=function(l){return s.test(l)},Ia}var fB;function Ff(){return fB||(fB=1,(function(t){const e=Rj(),n=Mj();t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(o,s){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!e.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?o.ccBits[0]:s<27?o.ccBits[1]:o.ccBits[2]},t.getBestModeForData=function(o){return n.testNumeric(o)?t.NUMERIC:n.testAlphanumeric(o)?t.ALPHANUMERIC:n.testKanji(o)?t.KANJI:t.BYTE},t.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},t.isValid=function(o){return o&&o.bit&&o.ccBits};function i(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+r)}}t.from=function(o,s){if(t.isValid(o))return o;try{return i(o)}catch{return s}}})(oT)),oT}var hB;function $xe(){return hB||(hB=1,(function(t){const e=Vf(),n=Ij(),i=lM(),r=Ff(),o=Rj(),s=7973,a=e.getBCHDigit(s);function l(f,h,m){for(let g=1;g<=40;g++)if(h<=t.getCapacity(g,m,f))return g}function u(f,h){return r.getCharCountIndicator(f,h)+4}function c(f,h){let m=0;return f.forEach(function(g){const v=u(g.mode,h);m+=v+g.getBitsLength()}),m}function d(f,h){for(let m=1;m<=40;m++)if(c(f,m)<=t.getCapacity(m,h,r.MIXED))return m}t.from=function(h,m){return o.isValid(h)?parseInt(h,10):m},t.getCapacity=function(h,m,g){if(!o.isValid(h))throw new Error("Invalid QR Code version");typeof g>"u"&&(g=r.BYTE);const v=e.getSymbolTotalCodewords(h),p=n.getTotalCodewordsCount(h,m),b=(v-p)*8;if(g===r.MIXED)return b;const y=b-u(g,h);switch(g){case r.NUMERIC:return Math.floor(y/10*3);case r.ALPHANUMERIC:return Math.floor(y/11*2);case r.KANJI:return Math.floor(y/13);case r.BYTE:default:return Math.floor(y/8)}},t.getBestVersionForData=function(h,m){let g;const v=i.from(m,i.M);if(Array.isArray(h)){if(h.length>1)return d(h,v);if(h.length===0)return 1;g=h[0]}else g=h;return l(g.mode,g.getLength(),v)},t.getEncodedBits=function(h){if(!o.isValid(h)||h<7)throw new Error("Invalid QR Code version");let m=h<<12;for(;e.getBCHDigit(m)-a>=0;)m^=s<=0;)l^=e<0&&(o=this.data.substr(r),s=parseInt(o,10),i.put(s,a*3+1))},uT=e,uT}var cT,pB;function Uxe(){if(pB)return cT;pB=1;const t=Ff(),e=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function n(i){this.mode=t.ALPHANUMERIC,this.data=i}return n.getBitsLength=function(r){return 11*Math.floor(r/2)+6*(r%2)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(r){let o;for(o=0;o+2<=this.data.length;o+=2){let s=e.indexOf(this.data[o])*45;s+=e.indexOf(this.data[o+1]),r.put(s,11)}this.data.length%2&&r.put(e.indexOf(this.data[o]),6)},cT=n,cT}var dT,vB;function Wxe(){if(vB)return dT;vB=1;const t=Ff();function e(n){this.mode=t.BYTE,typeof n=="string"?this.data=new TextEncoder().encode(n):this.data=new Uint8Array(n)}return e.getBitsLength=function(i){return i*8},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(n){for(let i=0,r=this.data.length;i=33088&&o<=40956)o-=33088;else if(o>=57408&&o<=60351)o-=49472;else throw new Error("Invalid SJIS character: "+this.data[r]+` +Make sure your charset is UTF-8`);o=(o>>>8&255)*192+(o&255),i.put(o,13)}},fT=n,fT}var hT={exports:{}},yB;function jxe(){return yB||(yB=1,(function(t){var e={single_source_shortest_paths:function(n,i,r){var o={},s={};s[i]=0;var a=e.PriorityQueue.make();a.push(i,0);for(var l,u,c,d,f,h,m,g,v;!a.empty();){l=a.pop(),u=l.value,d=l.cost,f=n[u]||{};for(c in f)f.hasOwnProperty(c)&&(h=f[c],m=d+h,g=s[c],v=typeof s[c]>"u",(v||g>m)&&(s[c]=m,a.push(c,m),o[c]=u))}if(typeof r<"u"&&typeof s[r]>"u"){var p=["Could not find a path from ",i," to ",r,"."].join("");throw new Error(p)}return o},extract_shortest_path_from_predecessor_list:function(n,i){for(var r=[],o=i;o;)r.push(o),n[o],o=n[o];return r.reverse(),r},find_path:function(n,i,r){var o=e.single_source_shortest_paths(n,i,r);return e.extract_shortest_path_from_predecessor_list(o,r)},PriorityQueue:{make:function(n){var i=e.PriorityQueue,r={},o;n=n||{};for(o in i)i.hasOwnProperty(o)&&(r[o]=i[o]);return r.queue=[],r.sorter=n.sorter||i.default_sorter,r},default_sorter:function(n,i){return n.cost-i.cost},push:function(n,i){var r={value:n,cost:i};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(hT)),hT.exports}var wB;function Kxe(){return wB||(wB=1,(function(t){const e=Ff(),n=Hxe(),i=Uxe(),r=Wxe(),o=qxe(),s=Mj(),a=Vf(),l=jxe();function u(p){return unescape(encodeURIComponent(p)).length}function c(p,b,y){const _=[];let C;for(;(C=p.exec(y))!==null;)_.push({data:C[0],index:C.index,mode:b,length:C[0].length});return _}function d(p){const b=c(s.NUMERIC,e.NUMERIC,p),y=c(s.ALPHANUMERIC,e.ALPHANUMERIC,p);let _,C;return a.isKanjiModeEnabled()?(_=c(s.BYTE,e.BYTE,p),C=c(s.KANJI,e.KANJI,p)):(_=c(s.BYTE_KANJI,e.BYTE,p),C=[]),b.concat(y,_,C).sort(function(k,T){return k.index-T.index}).map(function(k){return{data:k.data,mode:k.mode,length:k.length}})}function f(p,b){switch(b){case e.NUMERIC:return n.getBitsLength(p);case e.ALPHANUMERIC:return i.getBitsLength(p);case e.KANJI:return o.getBitsLength(p);case e.BYTE:return r.getBitsLength(p)}}function h(p){return p.reduce(function(b,y){const _=b.length-1>=0?b[b.length-1]:null;return _&&_.mode===y.mode?(b[b.length-1].data+=y.data,b):(b.push(y),b)},[])}function m(p){const b=[];for(let y=0;y=0&&I<=6&&(D===0||D===6)||D>=0&&D<=6&&(I===0||I===6)||I>=2&&I<=4&&D>=2&&D<=4?S.set(P+I,A+D,!0,!0):S.set(P+I,A+D,!1,!0))}}function m(S){const k=S.size;for(let T=8;T>I&1)===1,S.set(x,P,A,!0),S.set(P,x,A,!0)}function p(S,k,T){const E=S.size,x=c.getEncodedBits(k,T);let P,A;for(P=0;P<15;P++)A=(x>>P&1)===1,P<6?S.set(P,8,A,!0):P<8?S.set(P+1,8,A,!0):S.set(E-15+P,8,A,!0),P<8?S.set(8,E-P-1,A,!0):P<9?S.set(8,15-P-1+1,A,!0):S.set(8,15-P-1,A,!0);S.set(E-8,8,1,!0)}function b(S,k){const T=S.size;let E=-1,x=T-1,P=7,A=0;for(let I=T-1;I>0;I-=2)for(I===6&&I--;;){for(let D=0;D<2;D++)if(!S.isReserved(x,I-D)){let q=!1;A>>P&1)===1),S.set(x,I-D,q),P--,P===-1&&(A++,P=7)}if(x+=E,x<0||T<=x){x-=E,E=-E;break}}}function y(S,k,T){const E=new n;T.forEach(function(D){E.put(D.mode.bit,4),E.put(D.getLength(),d.getCharCountIndicator(D.mode,S)),D.write(E)});const x=t.getSymbolTotalCodewords(S),P=a.getTotalCodewordsCount(S,k),A=(x-P)*8;for(E.getLengthInBits()+4<=A&&E.put(0,4);E.getLengthInBits()%8!==0;)E.putBit(0);const I=(A-E.getLengthInBits())/8;for(let D=0;D=7&&v(D,k),b(D,A),isNaN(E)&&(E=s.getBestMask(D,p.bind(null,D,T))),s.applyMask(E,D),p(D,T,E),{modules:D,version:k,errorCorrectionLevel:T,maskPattern:E,segments:x}}return Yk.create=function(k,T){if(typeof k>"u"||k==="")throw new Error("No input text");let E=e.M,x,P;return typeof T<"u"&&(E=e.from(T.errorCorrectionLevel,e.M),x=u.from(T.version),P=s.from(T.maskPattern),T.toSJISFunc&&t.setToSJISFunction(T.toSJISFunc)),C(k,x,E,P)},Yk}var mT={},gT={},CB;function Oj(){return CB||(CB=1,(function(t){function e(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let i=n.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+n);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(o){return[o,o]}))),i.length===6&&i.push("F","F");const r=parseInt(i.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+i.slice(0,6).join("")}}t.getOptions=function(i){i||(i={}),i.color||(i.color={});const r=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,o=i.width&&i.width>=21?i.width:void 0,s=i.scale||4;return{width:o,scale:o?4:s,margin:r,color:{dark:e(i.color.dark||"#000000ff"),light:e(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},t.getScale=function(i,r){return r.width&&r.width>=i+r.margin*2?r.width/(i+r.margin*2):r.scale},t.getImageWidth=function(i,r){const o=t.getScale(i,r);return Math.floor((i+r.margin*2)*o)},t.qrToImageData=function(i,r,o){const s=r.modules.size,a=r.modules.data,l=t.getScale(s,o),u=Math.floor((s+o.margin*2)*l),c=o.margin*l,d=[o.color.light,o.color.dark];for(let f=0;f=c&&h>=c&&f"u"&&(!s||!s.getContext)&&(l=s,s=void 0),s||(u=i()),l=e.getOptions(l);const c=e.getImageWidth(o.modules.size,l),d=u.getContext("2d"),f=d.createImageData(c,c);return e.qrToImageData(f.data,o,l),n(d,u,c),d.putImageData(f,0,0),u},t.renderToDataURL=function(o,s,a){let l=a;typeof l>"u"&&(!s||!s.getContext)&&(l=s,s=void 0),l||(l={});const u=t.render(o,s,l),c=l.type||"image/png",d=l.rendererOpts||{};return u.toDataURL(c,d.quality)}})(mT)),mT}var pT={},kB;function Xxe(){if(kB)return pT;kB=1;const t=Oj();function e(r,o){const s=r.a/255,a=o+'="'+r.hex+'"';return s<1?a+" "+o+'-opacity="'+s.toFixed(2).slice(1)+'"':a}function n(r,o,s){let a=r+o;return typeof s<"u"&&(a+=" "+s),a}function i(r,o,s){let a="",l=0,u=!1,c=0;for(let d=0;d0&&f>0&&r[d-1]||(a+=u?n("M",f+s,.5+h+s):n("m",l,0),l=0,u=!1),f+1':"",h="',m='viewBox="0 0 '+d+" "+d+'"',v=''+f+h+` +`;return typeof a=="function"&&a(null,v),v},pT}var TB;function Jxe(){if(TB)return sh;TB=1;const t=Rxe(),e=Gxe(),n=Yxe(),i=Xxe();function r(o,s,a,l,u){const c=[].slice.call(arguments,1),d=c.length,f=typeof c[d-1]=="function";if(!f&&!t())throw new Error("Callback required as last argument");if(f){if(d<2)throw new Error("Too few arguments provided");d===2?(u=a,a=s,s=l=void 0):d===3&&(s.getContext&&typeof u>"u"?(u=l,l=void 0):(u=l,l=a,a=s,s=void 0))}else{if(d<1)throw new Error("Too few arguments provided");return d===1?(a=s,s=l=void 0):d===2&&!s.getContext&&(l=a,a=s,s=void 0),new Promise(function(h,m){try{const g=e.create(a,l);h(o(g,s,l))}catch(g){m(g)}})}try{const h=e.create(a,l);u(null,o(h,s,l))}catch(h){u(h)}}return sh.create=e.create,sh.toCanvas=r.bind(null,n.render),sh.toDataURL=r.bind(null,n.renderToDataURL),sh.toString=r.bind(null,function(o,s,a){return i.render(o,a)}),sh}Jxe();class fl{static showConfirm(e){return ASe.confirm(e,"系统提示",{type:"warning"})}static showNotification(e){$Se({title:"系统提示",message:e,type:"info",duration:1800})}static showLoading(e="请稍后"){return hSe.service({text:e,spinner:"",background:"rgba(255,255,255,0.2)"})}}function Lj(t,e){return function(){return t.apply(e,arguments)}}const{toString:Zxe}=Object.prototype,{getPrototypeOf:uM}=Object,{iterator:XC,toStringTag:Dj}=Symbol,JC=(t=>e=>{const n=Zxe.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ca=t=>(t=t.toLowerCase(),e=>JC(e)===t),ZC=t=>e=>typeof e===t,{isArray:mg}=Array,Hm=ZC("undefined");function t0(t){return t!==null&&!Hm(t)&&t.constructor!==null&&!Hm(t.constructor)&&xo(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Nj=Ca("ArrayBuffer");function Qxe(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Nj(t.buffer),e}const e2e=ZC("string"),xo=ZC("function"),Bj=ZC("number"),n0=t=>t!==null&&typeof t=="object",t2e=t=>t===!0||t===!1,Ww=t=>{if(JC(t)!=="object")return!1;const e=uM(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Dj in t)&&!(XC in t)},n2e=t=>{if(!n0(t)||t0(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},i2e=Ca("Date"),r2e=Ca("File"),o2e=Ca("Blob"),s2e=Ca("FileList"),a2e=t=>n0(t)&&xo(t.pipe),l2e=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||xo(t.append)&&((e=JC(t))==="formdata"||e==="object"&&xo(t.toString)&&t.toString()==="[object FormData]"))},u2e=Ca("URLSearchParams"),[c2e,d2e,f2e,h2e]=["ReadableStream","Request","Response","Headers"].map(Ca),m2e=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function i0(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let i,r;if(typeof t!="object"&&(t=[t]),mg(t))for(i=0,r=t.length;i0;)if(r=n[i],e===r.toLowerCase())return r;return null}const Gd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Fj=t=>!Hm(t)&&t!==Gd;function oA(){const{caseless:t,skipUndefined:e}=Fj(this)&&this||{},n={},i=(r,o)=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;const s=t&&Vj(n,o)||o;Ww(n[s])&&Ww(r)?n[s]=oA(n[s],r):Ww(r)?n[s]=oA({},r):mg(r)?n[s]=r.slice():(!e||!Hm(r))&&(n[s]=r)};for(let r=0,o=arguments.length;r(i0(e,(r,o)=>{n&&xo(r)?Object.defineProperty(t,o,{value:Lj(r,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,o,{value:r,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),t),p2e=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),v2e=(t,e,n,i)=>{t.prototype=Object.create(e.prototype,i),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},b2e=(t,e,n,i)=>{let r,o,s;const a={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),o=r.length;o-- >0;)s=r[o],(!i||i(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&uM(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},y2e=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const i=t.indexOf(e,n);return i!==-1&&i===n},w2e=t=>{if(!t)return null;if(mg(t))return t;let e=t.length;if(!Bj(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},_2e=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&uM(Uint8Array)),C2e=(t,e)=>{const i=(t&&t[XC]).call(t);let r;for(;(r=i.next())&&!r.done;){const o=r.value;e.call(t,o[0],o[1])}},S2e=(t,e)=>{let n;const i=[];for(;(n=t.exec(e))!==null;)i.push(n);return i},k2e=Ca("HTMLFormElement"),T2e=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,r){return i.toUpperCase()+r}),EB=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),E2e=Ca("RegExp"),$j=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),i={};i0(n,(r,o)=>{let s;(s=e(r,o,t))!==!1&&(i[o]=s||r)}),Object.defineProperties(t,i)},x2e=t=>{$j(t,(e,n)=>{if(xo(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=t[n];if(xo(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},A2e=(t,e)=>{const n={},i=r=>{r.forEach(o=>{n[o]=!0})};return mg(t)?i(t):i(String(t).split(e)),n},P2e=()=>{},I2e=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function R2e(t){return!!(t&&xo(t.append)&&t[Dj]==="FormData"&&t[XC])}const M2e=t=>{const e=new Array(10),n=(i,r)=>{if(n0(i)){if(e.indexOf(i)>=0)return;if(t0(i))return i;if(!("toJSON"in i)){e[r]=i;const o=mg(i)?[]:{};return i0(i,(s,a)=>{const l=n(s,r+1);!Hm(l)&&(o[a]=l)}),e[r]=void 0,o}}return i};return n(t,0)},O2e=Ca("AsyncFunction"),L2e=t=>t&&(n0(t)||xo(t))&&xo(t.then)&&xo(t.catch),zj=((t,e)=>t?setImmediate:e?((n,i)=>(Gd.addEventListener("message",({source:r,data:o})=>{r===Gd&&o===n&&i.length&&i.shift()()},!1),r=>{i.push(r),Gd.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",xo(Gd.postMessage)),D2e=typeof queueMicrotask<"u"?queueMicrotask.bind(Gd):typeof process<"u"&&process.nextTick||zj,N2e=t=>t!=null&&xo(t[XC]),Ae={isArray:mg,isArrayBuffer:Nj,isBuffer:t0,isFormData:l2e,isArrayBufferView:Qxe,isString:e2e,isNumber:Bj,isBoolean:t2e,isObject:n0,isPlainObject:Ww,isEmptyObject:n2e,isReadableStream:c2e,isRequest:d2e,isResponse:f2e,isHeaders:h2e,isUndefined:Hm,isDate:i2e,isFile:r2e,isBlob:o2e,isRegExp:E2e,isFunction:xo,isStream:a2e,isURLSearchParams:u2e,isTypedArray:_2e,isFileList:s2e,forEach:i0,merge:oA,extend:g2e,trim:m2e,stripBOM:p2e,inherits:v2e,toFlatObject:b2e,kindOf:JC,kindOfTest:Ca,endsWith:y2e,toArray:w2e,forEachEntry:C2e,matchAll:S2e,isHTMLForm:k2e,hasOwnProperty:EB,hasOwnProp:EB,reduceDescriptors:$j,freezeMethods:x2e,toObjectSet:A2e,toCamelCase:T2e,noop:P2e,toFiniteNumber:I2e,findKey:Vj,global:Gd,isContextDefined:Fj,isSpecCompliantForm:R2e,toJSONObject:M2e,isAsyncFn:O2e,isThenable:L2e,setImmediate:zj,asap:D2e,isIterable:N2e};let Ft=class Hj extends Error{static from(e,n,i,r,o,s){const a=new Hj(e.message,n||e.code,i,r,o);return a.cause=e,a.name=e.name,s&&Object.assign(a,s),a}constructor(e,n,i,r,o){super(e),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),i&&(this.config=i),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ae.toJSONObject(this.config),code:this.code,status:this.status}}};Ft.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Ft.ERR_BAD_OPTION="ERR_BAD_OPTION";Ft.ECONNABORTED="ECONNABORTED";Ft.ETIMEDOUT="ETIMEDOUT";Ft.ERR_NETWORK="ERR_NETWORK";Ft.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Ft.ERR_DEPRECATED="ERR_DEPRECATED";Ft.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Ft.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Ft.ERR_CANCELED="ERR_CANCELED";Ft.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Ft.ERR_INVALID_URL="ERR_INVALID_URL";const B2e=null;function sA(t){return Ae.isPlainObject(t)||Ae.isArray(t)}function Uj(t){return Ae.endsWith(t,"[]")?t.slice(0,-2):t}function xB(t,e,n){return t?t.concat(e).map(function(r,o){return r=Uj(r),!n&&o?"["+r+"]":r}).join(n?".":""):e}function V2e(t){return Ae.isArray(t)&&!t.some(sA)}const F2e=Ae.toFlatObject(Ae,{},null,function(e){return/^is[A-Z]/.test(e)});function QC(t,e,n){if(!Ae.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=Ae.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,v){return!Ae.isUndefined(v[g])});const i=n.metaTokens,r=n.visitor||c,o=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&Ae.isSpecCompliantForm(e);if(!Ae.isFunction(r))throw new TypeError("visitor must be a function");function u(m){if(m===null)return"";if(Ae.isDate(m))return m.toISOString();if(Ae.isBoolean(m))return m.toString();if(!l&&Ae.isBlob(m))throw new Ft("Blob is not supported. Use a Buffer instead.");return Ae.isArrayBuffer(m)||Ae.isTypedArray(m)?l&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function c(m,g,v){let p=m;if(m&&!v&&typeof m=="object"){if(Ae.endsWith(g,"{}"))g=i?g:g.slice(0,-2),m=JSON.stringify(m);else if(Ae.isArray(m)&&V2e(m)||(Ae.isFileList(m)||Ae.endsWith(g,"[]"))&&(p=Ae.toArray(m)))return g=Uj(g),p.forEach(function(y,_){!(Ae.isUndefined(y)||y===null)&&e.append(s===!0?xB([g],_,o):s===null?g:g+"[]",u(y))}),!1}return sA(m)?!0:(e.append(xB(v,g,o),u(m)),!1)}const d=[],f=Object.assign(F2e,{defaultVisitor:c,convertValue:u,isVisitable:sA});function h(m,g){if(!Ae.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(m),Ae.forEach(m,function(p,b){(!(Ae.isUndefined(p)||p===null)&&r.call(e,p,Ae.isString(b)?b.trim():b,g,f))===!0&&h(p,g?g.concat(b):[b])}),d.pop()}}if(!Ae.isObject(t))throw new TypeError("data must be an object");return h(t),e}function AB(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function cM(t,e){this._pairs=[],t&&QC(t,this,e)}const Wj=cM.prototype;Wj.append=function(e,n){this._pairs.push([e,n])};Wj.toString=function(e){const n=e?function(i){return e.call(this,i,AB)}:AB;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function $2e(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function qj(t,e,n){if(!e)return t;const i=n&&n.encode||$2e,r=Ae.isFunction(n)?{serialize:n}:n,o=r&&r.serialize;let s;if(o?s=o(e,r):s=Ae.isURLSearchParams(e)?e.toString():new cM(e,r).toString(i),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class PB{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Ae.forEach(this.handlers,function(i){i!==null&&e(i)})}}const dM={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},z2e=typeof URLSearchParams<"u"?URLSearchParams:cM,H2e=typeof FormData<"u"?FormData:null,U2e=typeof Blob<"u"?Blob:null,W2e={isBrowser:!0,classes:{URLSearchParams:z2e,FormData:H2e,Blob:U2e},protocols:["http","https","file","blob","url","data"]},fM=typeof window<"u"&&typeof document<"u",aA=typeof navigator=="object"&&navigator||void 0,q2e=fM&&(!aA||["ReactNative","NativeScript","NS"].indexOf(aA.product)<0),j2e=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",K2e=fM&&window.location.href||"http://localhost",G2e=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:fM,hasStandardBrowserEnv:q2e,hasStandardBrowserWebWorkerEnv:j2e,navigator:aA,origin:K2e},Symbol.toStringTag,{value:"Module"})),Vr={...G2e,...W2e};function Y2e(t,e){return QC(t,new Vr.classes.URLSearchParams,{visitor:function(n,i,r,o){return Vr.isNode&&Ae.isBuffer(n)?(this.append(i,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...e})}function X2e(t){return Ae.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function J2e(t){const e={},n=Object.keys(t);let i;const r=n.length;let o;for(i=0;i=n.length;return s=!s&&Ae.isArray(r)?r.length:s,l?(Ae.hasOwnProp(r,s)?r[s]=[r[s],i]:r[s]=i,!a):((!r[s]||!Ae.isObject(r[s]))&&(r[s]=[]),e(n,i,r[s],o)&&Ae.isArray(r[s])&&(r[s]=J2e(r[s])),!a)}if(Ae.isFormData(t)&&Ae.isFunction(t.entries)){const n={};return Ae.forEachEntry(t,(i,r)=>{e(X2e(i),r,n,0)}),n}return null}function Z2e(t,e,n){if(Ae.isString(t))try{return(e||JSON.parse)(t),Ae.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(t)}const r0={transitional:dM,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const i=n.getContentType()||"",r=i.indexOf("application/json")>-1,o=Ae.isObject(e);if(o&&Ae.isHTMLForm(e)&&(e=new FormData(e)),Ae.isFormData(e))return r?JSON.stringify(jj(e)):e;if(Ae.isArrayBuffer(e)||Ae.isBuffer(e)||Ae.isStream(e)||Ae.isFile(e)||Ae.isBlob(e)||Ae.isReadableStream(e))return e;if(Ae.isArrayBufferView(e))return e.buffer;if(Ae.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Y2e(e,this.formSerializer).toString();if((a=Ae.isFileList(e))||i.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return QC(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||r?(n.setContentType("application/json",!1),Z2e(e)):e}],transformResponse:[function(e){const n=this.transitional||r0.transitional,i=n&&n.forcedJSONParsing,r=this.responseType==="json";if(Ae.isResponse(e)||Ae.isReadableStream(e))return e;if(e&&Ae.isString(e)&&(i&&!this.responseType||r)){const s=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(a){if(s)throw a.name==="SyntaxError"?Ft.from(a,Ft.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Vr.classes.FormData,Blob:Vr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ae.forEach(["delete","get","head","post","put","patch"],t=>{r0.headers[t]={}});const Q2e=Ae.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),eAe=t=>{const e={};let n,i,r;return t&&t.split(` +`).forEach(function(s){r=s.indexOf(":"),n=s.substring(0,r).trim().toLowerCase(),i=s.substring(r+1).trim(),!(!n||e[n]&&Q2e[n])&&(n==="set-cookie"?e[n]?e[n].push(i):e[n]=[i]:e[n]=e[n]?e[n]+", "+i:i)}),e},IB=Symbol("internals");function Bg(t){return t&&String(t).trim().toLowerCase()}function qw(t){return t===!1||t==null?t:Ae.isArray(t)?t.map(qw):String(t)}function tAe(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(t);)e[i[1]]=i[2];return e}const nAe=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function vT(t,e,n,i,r){if(Ae.isFunction(i))return i.call(this,e,n);if(r&&(e=n),!!Ae.isString(e)){if(Ae.isString(i))return e.indexOf(i)!==-1;if(Ae.isRegExp(i))return i.test(e)}}function iAe(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,i)=>n.toUpperCase()+i)}function rAe(t,e){const n=Ae.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+n,{value:function(r,o,s){return this[i].call(this,e,r,o,s)},configurable:!0})})}let Ao=class{constructor(e){e&&this.set(e)}set(e,n,i){const r=this;function o(a,l,u){const c=Bg(l);if(!c)throw new Error("header name must be a non-empty string");const d=Ae.findKey(r,c);(!d||r[d]===void 0||u===!0||u===void 0&&r[d]!==!1)&&(r[d||l]=qw(a))}const s=(a,l)=>Ae.forEach(a,(u,c)=>o(u,c,l));if(Ae.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(Ae.isString(e)&&(e=e.trim())&&!nAe(e))s(eAe(e),n);else if(Ae.isObject(e)&&Ae.isIterable(e)){let a={},l,u;for(const c of e){if(!Ae.isArray(c))throw TypeError("Object iterator must return a key-value pair");a[u=c[0]]=(l=a[u])?Ae.isArray(l)?[...l,c[1]]:[l,c[1]]:c[1]}s(a,n)}else e!=null&&o(n,e,i);return this}get(e,n){if(e=Bg(e),e){const i=Ae.findKey(this,e);if(i){const r=this[i];if(!n)return r;if(n===!0)return tAe(r);if(Ae.isFunction(n))return n.call(this,r,i);if(Ae.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Bg(e),e){const i=Ae.findKey(this,e);return!!(i&&this[i]!==void 0&&(!n||vT(this,this[i],i,n)))}return!1}delete(e,n){const i=this;let r=!1;function o(s){if(s=Bg(s),s){const a=Ae.findKey(i,s);a&&(!n||vT(i,i[a],a,n))&&(delete i[a],r=!0)}}return Ae.isArray(e)?e.forEach(o):o(e),r}clear(e){const n=Object.keys(this);let i=n.length,r=!1;for(;i--;){const o=n[i];(!e||vT(this,this[o],o,e,!0))&&(delete this[o],r=!0)}return r}normalize(e){const n=this,i={};return Ae.forEach(this,(r,o)=>{const s=Ae.findKey(i,o);if(s){n[s]=qw(r),delete n[o];return}const a=e?iAe(o):String(o).trim();a!==o&&delete n[o],n[a]=qw(r),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return Ae.forEach(this,(i,r)=>{i!=null&&i!==!1&&(n[r]=e&&Ae.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const i=new this(e);return n.forEach(r=>i.set(r)),i}static accessor(e){const i=(this[IB]=this[IB]={accessors:{}}).accessors,r=this.prototype;function o(s){const a=Bg(s);i[a]||(rAe(r,s),i[a]=!0)}return Ae.isArray(e)?e.forEach(o):o(e),this}};Ao.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ae.reduceDescriptors(Ao.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[n]=i}}});Ae.freezeMethods(Ao);function bT(t,e){const n=this||r0,i=e||n,r=Ao.from(i.headers);let o=i.data;return Ae.forEach(t,function(a){o=a.call(n,o,r.normalize(),e?e.status:void 0)}),r.normalize(),o}function Kj(t){return!!(t&&t.__CANCEL__)}let o0=class extends Ft{constructor(e,n,i){super(e??"canceled",Ft.ERR_CANCELED,n,i),this.name="CanceledError",this.__CANCEL__=!0}};function Gj(t,e,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new Ft("Request failed with status code "+n.status,[Ft.ERR_BAD_REQUEST,Ft.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function oAe(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function sAe(t,e){t=t||10;const n=new Array(t),i=new Array(t);let r=0,o=0,s;return e=e!==void 0?e:1e3,function(l){const u=Date.now(),c=i[o];s||(s=u),n[r]=l,i[r]=u;let d=o,f=0;for(;d!==r;)f+=n[d++],d=d%t;if(r=(r+1)%t,r===o&&(o=(o+1)%t),u-s{n=c,r=null,o&&(clearTimeout(o),o=null),t(...u)};return[(...u)=>{const c=Date.now(),d=c-n;d>=i?s(u,c):(r=u,o||(o=setTimeout(()=>{o=null,s(r)},i-d)))},()=>r&&s(r)]}const Q_=(t,e,n=3)=>{let i=0;const r=sAe(50,250);return aAe(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,l=s-i,u=r(l),c=s<=a;i=s;const d={loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&c?(a-s)/u:void 0,event:o,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(d)},n)},RB=(t,e)=>{const n=t!=null;return[i=>e[0]({lengthComputable:n,total:t,loaded:i}),e[1]]},MB=t=>(...e)=>Ae.asap(()=>t(...e)),lAe=Vr.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Vr.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Vr.origin),Vr.navigator&&/(msie|trident)/i.test(Vr.navigator.userAgent)):()=>!0,uAe=Vr.hasStandardBrowserEnv?{write(t,e,n,i,r,o,s){if(typeof document>"u")return;const a=[`${t}=${encodeURIComponent(e)}`];Ae.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Ae.isString(i)&&a.push(`path=${i}`),Ae.isString(r)&&a.push(`domain=${r}`),o===!0&&a.push("secure"),Ae.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function cAe(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function dAe(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Yj(t,e,n){let i=!cAe(e);return t&&(i||n==!1)?dAe(t,e):e}const OB=t=>t instanceof Ao?{...t}:t;function Cf(t,e){e=e||{};const n={};function i(u,c,d,f){return Ae.isPlainObject(u)&&Ae.isPlainObject(c)?Ae.merge.call({caseless:f},u,c):Ae.isPlainObject(c)?Ae.merge({},c):Ae.isArray(c)?c.slice():c}function r(u,c,d,f){if(Ae.isUndefined(c)){if(!Ae.isUndefined(u))return i(void 0,u,d,f)}else return i(u,c,d,f)}function o(u,c){if(!Ae.isUndefined(c))return i(void 0,c)}function s(u,c){if(Ae.isUndefined(c)){if(!Ae.isUndefined(u))return i(void 0,u)}else return i(void 0,c)}function a(u,c,d){if(d in e)return i(u,c);if(d in t)return i(void 0,u)}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(u,c,d)=>r(OB(u),OB(c),d,!0)};return Ae.forEach(Object.keys({...t,...e}),function(c){if(c==="__proto__"||c==="constructor"||c==="prototype")return;const d=Ae.hasOwnProp(l,c)?l[c]:r,f=d(t[c],e[c],c);Ae.isUndefined(f)&&d!==a||(n[c]=f)}),n}const Xj=t=>{const e=Cf({},t);let{data:n,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:o,headers:s,auth:a}=e;if(e.headers=s=Ao.from(s),e.url=qj(Yj(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Ae.isFormData(n)){if(Vr.hasStandardBrowserEnv||Vr.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(Ae.isFunction(n.getHeaders)){const l=n.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([c,d])=>{u.includes(c.toLowerCase())&&s.set(c,d)})}}if(Vr.hasStandardBrowserEnv&&(i&&Ae.isFunction(i)&&(i=i(e)),i||i!==!1&&lAe(e.url))){const l=r&&o&&uAe.read(o);l&&s.set(r,l)}return e},fAe=typeof XMLHttpRequest<"u",hAe=fAe&&function(t){return new Promise(function(n,i){const r=Xj(t);let o=r.data;const s=Ao.from(r.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:u}=r,c,d,f,h,m;function g(){h&&h(),m&&m(),r.cancelToken&&r.cancelToken.unsubscribe(c),r.signal&&r.signal.removeEventListener("abort",c)}let v=new XMLHttpRequest;v.open(r.method.toUpperCase(),r.url,!0),v.timeout=r.timeout;function p(){if(!v)return;const y=Ao.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),C={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:y,config:t,request:v};Gj(function(k){n(k),g()},function(k){i(k),g()},C),v=null}"onloadend"in v?v.onloadend=p:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(p)},v.onabort=function(){v&&(i(new Ft("Request aborted",Ft.ECONNABORTED,t,v)),v=null)},v.onerror=function(_){const C=_&&_.message?_.message:"Network Error",S=new Ft(C,Ft.ERR_NETWORK,t,v);S.event=_||null,i(S),v=null},v.ontimeout=function(){let _=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const C=r.transitional||dM;r.timeoutErrorMessage&&(_=r.timeoutErrorMessage),i(new Ft(_,C.clarifyTimeoutError?Ft.ETIMEDOUT:Ft.ECONNABORTED,t,v)),v=null},o===void 0&&s.setContentType(null),"setRequestHeader"in v&&Ae.forEach(s.toJSON(),function(_,C){v.setRequestHeader(C,_)}),Ae.isUndefined(r.withCredentials)||(v.withCredentials=!!r.withCredentials),a&&a!=="json"&&(v.responseType=r.responseType),u&&([f,m]=Q_(u,!0),v.addEventListener("progress",f)),l&&v.upload&&([d,h]=Q_(l),v.upload.addEventListener("progress",d),v.upload.addEventListener("loadend",h)),(r.cancelToken||r.signal)&&(c=y=>{v&&(i(!y||y.type?new o0(null,t,v):y),v.abort(),v=null)},r.cancelToken&&r.cancelToken.subscribe(c),r.signal&&(r.signal.aborted?c():r.signal.addEventListener("abort",c)));const b=oAe(r.url);if(b&&Vr.protocols.indexOf(b)===-1){i(new Ft("Unsupported protocol "+b+":",Ft.ERR_BAD_REQUEST,t));return}v.send(o||null)})},mAe=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let i=new AbortController,r;const o=function(u){if(!r){r=!0,a();const c=u instanceof Error?u:this.reason;i.abort(c instanceof Ft?c:new o0(c instanceof Error?c.message:c))}};let s=e&&setTimeout(()=>{s=null,o(new Ft(`timeout of ${e}ms exceeded`,Ft.ETIMEDOUT))},e);const a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),t=null)};t.forEach(u=>u.addEventListener("abort",o));const{signal:l}=i;return l.unsubscribe=()=>Ae.asap(a),l}},gAe=function*(t,e){let n=t.byteLength;if(n{const r=pAe(t,e);let o=0,s,a=l=>{s||(s=!0,i&&i(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await r.next();if(u){a(),l.close();return}let d=c.byteLength;if(n){let f=o+=d;n(f)}l.enqueue(new Uint8Array(c))}catch(u){throw a(u),u}},cancel(l){return a(l),r.return()}},{highWaterMark:2})},DB=64*1024,{isFunction:Q0}=Ae,bAe=(({Request:t,Response:e})=>({Request:t,Response:e}))(Ae.global),{ReadableStream:NB,TextEncoder:BB}=Ae.global,VB=(t,...e)=>{try{return!!t(...e)}catch{return!1}},yAe=t=>{t=Ae.merge.call({skipUndefined:!0},bAe,t);const{fetch:e,Request:n,Response:i}=t,r=e?Q0(e):typeof fetch=="function",o=Q0(n),s=Q0(i);if(!r)return!1;const a=r&&Q0(NB),l=r&&(typeof BB=="function"?(m=>g=>m.encode(g))(new BB):async m=>new Uint8Array(await new n(m).arrayBuffer())),u=o&&a&&VB(()=>{let m=!1;const g=new n(Vr.origin,{body:new NB,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!g}),c=s&&a&&VB(()=>Ae.isReadableStream(new i("").body)),d={stream:c&&(m=>m.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!d[m]&&(d[m]=(g,v)=>{let p=g&&g[m];if(p)return p.call(g);throw new Ft(`Response type '${m}' is not supported`,Ft.ERR_NOT_SUPPORT,v)})});const f=async m=>{if(m==null)return 0;if(Ae.isBlob(m))return m.size;if(Ae.isSpecCompliantForm(m))return(await new n(Vr.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(Ae.isArrayBufferView(m)||Ae.isArrayBuffer(m))return m.byteLength;if(Ae.isURLSearchParams(m)&&(m=m+""),Ae.isString(m))return(await l(m)).byteLength},h=async(m,g)=>{const v=Ae.toFiniteNumber(m.getContentLength());return v??f(g)};return async m=>{let{url:g,method:v,data:p,signal:b,cancelToken:y,timeout:_,onDownloadProgress:C,onUploadProgress:S,responseType:k,headers:T,withCredentials:E="same-origin",fetchOptions:x}=Xj(m),P=e||fetch;k=k?(k+"").toLowerCase():"text";let A=mAe([b,y&&y.toAbortSignal()],_),I=null;const D=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let q;try{if(S&&u&&v!=="get"&&v!=="head"&&(q=await h(T,p))!==0){let j=new n(g,{method:"POST",body:p,duplex:"half"}),U;if(Ae.isFormData(p)&&(U=j.headers.get("content-type"))&&T.setContentType(U),j.body){const[W,J]=RB(q,Q_(MB(S)));p=LB(j.body,DB,W,J)}}Ae.isString(E)||(E=E?"include":"omit");const z=o&&"credentials"in n.prototype,R={...x,signal:A,method:v.toUpperCase(),headers:T.normalize().toJSON(),body:p,duplex:"half",credentials:z?E:void 0};I=o&&new n(g,R);let O=await(o?P(I,x):P(g,R));const N=c&&(k==="stream"||k==="response");if(c&&(C||N&&D)){const j={};["status","statusText","headers"].forEach(ne=>{j[ne]=O[ne]});const U=Ae.toFiniteNumber(O.headers.get("content-length")),[W,J]=C&&RB(U,Q_(MB(C),!0))||[];O=new i(LB(O.body,DB,W,()=>{J&&J(),D&&D()}),j)}k=k||"text";let F=await d[Ae.findKey(d,k)||"text"](O,m);return!N&&D&&D(),await new Promise((j,U)=>{Gj(j,U,{data:F,headers:Ao.from(O.headers),status:O.status,statusText:O.statusText,config:m,request:I})})}catch(z){throw D&&D(),z&&z.name==="TypeError"&&/Load failed|fetch/i.test(z.message)?Object.assign(new Ft("Network Error",Ft.ERR_NETWORK,m,I,z&&z.response),{cause:z.cause||z}):Ft.from(z,z&&z.code,m,I,z&&z.response)}}},wAe=new Map,Jj=t=>{let e=t&&t.env||{};const{fetch:n,Request:i,Response:r}=e,o=[i,r,n];let s=o.length,a=s,l,u,c=wAe;for(;a--;)l=o[a],u=c.get(l),u===void 0&&c.set(l,u=a?new Map:yAe(e)),c=u;return u};Jj();const hM={http:B2e,xhr:hAe,fetch:{get:Jj}};Ae.forEach(hM,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const FB=t=>`- ${t}`,_Ae=t=>Ae.isFunction(t)||t===null||t===!1;function CAe(t,e){t=Ae.isArray(t)?t:[t];const{length:n}=t;let i,r;const o={};for(let s=0;s`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=n?s.length>1?`since : +`+s.map(FB).join(` +`):" "+FB(s[0]):"as no adapter specified";throw new Ft("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r}const Zj={getAdapter:CAe,adapters:hM};function yT(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new o0(null,t)}function $B(t){return yT(t),t.headers=Ao.from(t.headers),t.data=bT.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Zj.getAdapter(t.adapter||r0.adapter,t)(t).then(function(i){return yT(t),i.data=bT.call(t,t.transformResponse,i),i.headers=Ao.from(i.headers),i},function(i){return Kj(i)||(yT(t),i&&i.response&&(i.response.data=bT.call(t,t.transformResponse,i.response),i.response.headers=Ao.from(i.response.headers))),Promise.reject(i)})}const Qj="1.13.5",eS={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{eS[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});const zB={};eS.transitional=function(e,n,i){function r(o,s){return"[Axios v"+Qj+"] Transitional option '"+o+"'"+s+(i?". "+i:"")}return(o,s,a)=>{if(e===!1)throw new Ft(r(s," has been removed"+(n?" in "+n:"")),Ft.ERR_DEPRECATED);return n&&!zB[s]&&(zB[s]=!0,console.warn(r(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,s,a):!0}};eS.spelling=function(e){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};function SAe(t,e,n){if(typeof t!="object")throw new Ft("options must be an object",Ft.ERR_BAD_OPTION_VALUE);const i=Object.keys(t);let r=i.length;for(;r-- >0;){const o=i[r],s=e[o];if(s){const a=t[o],l=a===void 0||s(a,o,t);if(l!==!0)throw new Ft("option "+o+" must be "+l,Ft.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ft("Unknown option "+o,Ft.ERR_BAD_OPTION)}}const jw={assertOptions:SAe,validators:eS},ps=jw.validators;let sf=class{constructor(e){this.defaults=e||{},this.interceptors={request:new PB,response:new PB}}async request(e,n){try{return await this._request(e,n)}catch(i){if(i instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const o=r.stack?r.stack.replace(/^.+\n/,""):"";try{i.stack?o&&!String(i.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(i.stack+=` +`+o):i.stack=o}catch{}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Cf(this.defaults,n);const{transitional:i,paramsSerializer:r,headers:o}=n;i!==void 0&&jw.assertOptions(i,{silentJSONParsing:ps.transitional(ps.boolean),forcedJSONParsing:ps.transitional(ps.boolean),clarifyTimeoutError:ps.transitional(ps.boolean),legacyInterceptorReqResOrdering:ps.transitional(ps.boolean)},!1),r!=null&&(Ae.isFunction(r)?n.paramsSerializer={serialize:r}:jw.assertOptions(r,{encode:ps.function,serialize:ps.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),jw.assertOptions(n,{baseUrl:ps.spelling("baseURL"),withXsrfToken:ps.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&Ae.merge(o.common,o[n.method]);o&&Ae.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),n.headers=Ao.concat(s,o);const a=[];let l=!0;this.interceptors.request.forEach(function(g){if(typeof g.runWhen=="function"&&g.runWhen(n)===!1)return;l=l&&g.synchronous;const v=n.transitional||dM;v&&v.legacyInterceptorReqResOrdering?a.unshift(g.fulfilled,g.rejected):a.push(g.fulfilled,g.rejected)});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let c,d=0,f;if(!l){const m=[$B.bind(this),void 0];for(m.unshift(...a),m.push(...u),f=m.length,c=Promise.resolve(n);d{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](r);i._listeners=null}),this.promise.then=r=>{let o;const s=new Promise(a=>{i.subscribe(a),o=a}).then(r);return s.cancel=function(){i.unsubscribe(o)},s},e(function(o,s,a){i.reason||(i.reason=new o0(o,s,a),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new eK(function(r){e=r}),cancel:e}}};function TAe(t){return function(n){return t.apply(null,n)}}function EAe(t){return Ae.isObject(t)&&t.isAxiosError===!0}const lA={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(lA).forEach(([t,e])=>{lA[e]=t});function tK(t){const e=new sf(t),n=Lj(sf.prototype.request,e);return Ae.extend(n,sf.prototype,e,{allOwnKeys:!0}),Ae.extend(n,e,null,{allOwnKeys:!0}),n.create=function(r){return tK(Cf(t,r))},n}const Ui=tK(r0);Ui.Axios=sf;Ui.CanceledError=o0;Ui.CancelToken=kAe;Ui.isCancel=Kj;Ui.VERSION=Qj;Ui.toFormData=QC;Ui.AxiosError=Ft;Ui.Cancel=Ui.CanceledError;Ui.all=function(e){return Promise.all(e)};Ui.spread=TAe;Ui.isAxiosError=EAe;Ui.mergeConfig=Cf;Ui.AxiosHeaders=Ao;Ui.formToJSON=t=>jj(Ae.isHTMLForm(t)?new FormData(t):t);Ui.getAdapter=Zj.getAdapter;Ui.HttpStatusCode=lA;Ui.default=Ui;const{Axios:Ust,AxiosError:Wst,CanceledError:qst,isCancel:jst,CancelToken:Kst,VERSION:Gst,all:Yst,Cancel:Xst,isAxiosError:Jst,spread:Zst,toFormData:Qst,AxiosHeaders:eat,HttpStatusCode:tat,formToJSON:nat,getAdapter:iat,mergeConfig:rat}=Ui;var nK=(t=>(t.Eq="eq",t.Neq="neq",t.Gt="gt",t.Egt="egt",t.Lt="lt",t.Elt="elt",t.Between="between",t.NotBetween="not between",t.In="in",t.NotIn="not in",t.Like="like",t.Slike="slike",t.Elike="elike",t))(nK||{}),iK=(t=>(t.Eq="eq",t.Neq="neq",t.Gt="gt",t.Egt="egt",t.Lt="lt",t.Elt="elt",t.Between="between",t.NotBetween="not between",t.In="in",t.NotIn="not in",t.Like="like",t.Slike="slike",t.Elike="elike",t))(iK||{}),mM=(t=>(t.Eq="eq",t.Neq="neq",t.Gt="gt",t.Egt="egt",t.Lt="lt",t.Elt="elt",t.Between="between",t.NotBetween="not between",t.In="in",t.NotIn="not in",t.Like="like",t.Slike="slike",t.Elike="elike",t))(mM||{}),rK=(t=>(t.Eq="eq",t.Neq="neq",t.Gt="gt",t.Egt="egt",t.Lt="lt",t.Elt="elt",t.Between="between",t.NotBetween="not between",t.In="in",t.NotIn="not in",t.Like="like",t.Slike="slike",t.Elike="elike",t))(rK||{}),oK=(t=>(t.Eq="eq",t.Neq="neq",t.Gt="gt",t.Egt="egt",t.Lt="lt",t.Elt="elt",t.Between="between",t.NotBetween="not between",t.In="in",t.NotIn="not in",t.Like="like",t.Slike="slike",t.Elike="elike",t))(oK||{}),sK=(t=>(t.Eq="eq",t.Neq="neq",t.Gt="gt",t.Egt="egt",t.Lt="lt",t.Elt="elt",t.Between="between",t.NotBetween="not between",t.In="in",t.NotIn="not in",t.Like="like",t.Slike="slike",t.Elike="elike",t))(sK||{}),aK=(t=>(t.Eq="eq",t.Neq="neq",t.Gt="gt",t.Egt="egt",t.Lt="lt",t.Elt="elt",t.Between="between",t.NotBetween="not between",t.In="in",t.NotIn="not in",t.Like="like",t.Slike="slike",t.Elike="elike",t))(aK||{}),gM=(t=>(t.Eq="eq",t.Neq="neq",t.Gt="gt",t.Egt="egt",t.Lt="lt",t.Elt="elt",t.Between="between",t.NotBetween="not between",t.In="in",t.NotIn="not in",t.Like="like",t.Slike="slike",t.Elike="elike",t))(gM||{}),lK=(t=>(t.Eq="eq",t.Neq="neq",t.Gt="gt",t.Egt="egt",t.Lt="lt",t.Elt="elt",t.Between="between",t.NotBetween="not between",t.In="in",t.NotIn="not in",t.Like="like",t.Slike="slike",t.Elike="elike",t))(lK||{}),pM=(t=>(t.Eq="eq",t.Neq="neq",t.Gt="gt",t.Egt="egt",t.Lt="lt",t.Elt="elt",t.Between="between",t.NotBetween="not between",t.In="in",t.NotIn="not in",t.Like="like",t.Slike="slike",t.Elike="elike",t))(pM||{}),uK=(t=>(t.Asc="asc",t.Desc="desc",t))(uK||{}),cK=(t=>(t.Eq="eq",t.Neq="neq",t.Gt="gt",t.Egt="egt",t.Lt="lt",t.Elt="elt",t.Between="between",t.NotBetween="not between",t.In="in",t.NotIn="not in",t.Like="like",t.Slike="slike",t.Elike="elike",t))(cK||{}),dK=(t=>(t.Asc="asc",t.Desc="desc",t))(dK||{}),fK=(t=>(t.Eq="eq",t.Neq="neq",t.Gt="gt",t.Egt="egt",t.Lt="lt",t.Elt="elt",t.Between="between",t.NotBetween="not between",t.In="in",t.NotIn="not in",t.Like="like",t.Slike="slike",t.Elike="elike",t))(fK||{}),hK=(t=>(t.Asc="asc",t.Desc="desc",t))(hK||{});class xAe{instance;securityData=null;securityWorker;secure;format;constructor({securityWorker:e,secure:n,format:i,...r}={}){this.instance=Ui.create({...r,baseURL:r.baseURL||""}),this.secure=n,this.format=i,this.securityWorker=e}setSecurityData=e=>{this.securityData=e};mergeRequestParams(e,n){const i=e.method||n&&n.method;return{...this.instance.defaults,...e,...n||{},headers:{...i&&this.instance.defaults.headers[i.toLowerCase()]||{},...e.headers||{},...n&&n.headers||{}}}}stringifyFormItem(e){return typeof e=="object"&&e!==null?JSON.stringify(e):`${e}`}createFormData(e){return e instanceof FormData?e:Object.keys(e||{}).reduce((n,i)=>{const r=e[i],o=r instanceof Array?r:[r];for(const s of o){const a=s instanceof Blob||s instanceof File;n.append(i,a?s:this.stringifyFormItem(s))}return n},new FormData)}request=async({secure:e,path:n,type:i,query:r,format:o,body:s,...a})=>{const l=(typeof e=="boolean"?e:this.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},u=this.mergeRequestParams(a,l),c=o||this.format||void 0;return i==="multipart/form-data"&&s&&s!==null&&typeof s=="object"&&(s=this.createFormData(s)),i==="text/plain"&&s&&s!==null&&typeof s!="string"&&(s=JSON.stringify(s)),this.instance.request({...u,headers:{...u.headers||{},...i?{"Content-Type":i}:{}},params:r,responseType:c,data:s,url:n})}}class AAe{http;constructor(e){this.http=e}admin={withdrawControllerReview:(e,n={})=>this.http.request({path:"/admin/withdraw/review",method:"POST",body:e,type:"application/json",format:"json",...n}),adminUserControllerList:(e,n={})=>this.http.request({path:"/admin/user/list",method:"GET",query:e,format:"json",...n}),adminUserControllerToggleFreeze:(e,n={})=>this.http.request({path:"/admin/user/toggleFreeze",method:"POST",body:e,type:"application/json",format:"json",...n}),uploadControllerImage:(e,n={})=>this.http.request({path:"/admin/upload/image",method:"POST",body:e,type:"multipart/form-data",format:"json",...n}),uploadControllerVideo:(e,n={})=>this.http.request({path:"/admin/upload/video",method:"POST",body:e,type:"multipart/form-data",format:"json",...n}),teamControllerMembers:(e,n={})=>this.http.request({path:"/admin/team/members",method:"GET",query:e,format:"json",...n}),teamControllerAncestors:(e,n={})=>this.http.request({path:"/admin/team/ancestors",method:"GET",query:e,format:"json",...n}),statsControllerStats:(e={})=>this.http.request({path:"/admin/session/stats",method:"GET",format:"json",...e}),sessionControllerLogin:(e,n={})=>this.http.request({path:"/admin/session/login",method:"POST",body:e,type:"application/json",format:"json",...n}),adminGiftControllerGiftProduct:(e,n={})=>this.http.request({path:"/admin/gift/product",method:"POST",body:e,type:"application/json",format:"json",...n}),configControllerGetSystemConfig:(e={})=>this.http.request({path:"/admin/config/system",method:"GET",format:"json",...e}),configControllerUpdateSystemConfig:(e,n={})=>this.http.request({path:"/admin/config/system",method:"PUT",body:e,type:"application/json",format:"json",...n}),generatedWalletControllerList:(e,n={})=>this.http.request({path:"/admin/generated/wallet/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedWalletControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/wallet/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedWalletControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/wallet",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedWalletControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/wallet/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedWalletControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/wallet/${e}`,method:"DELETE",format:"json",...n}),generatedTeamRelationControllerList:(e,n={})=>this.http.request({path:"/admin/generated/team_relation/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedTeamRelationControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/team_relation/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedTeamRelationControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/team_relation",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedTeamRelationControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/team_relation/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedTeamRelationControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/team_relation/${e}`,method:"DELETE",format:"json",...n}),generatedUserVerifyControllerList:(e,n={})=>this.http.request({path:"/admin/generated/user_verify/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserVerifyControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_verify/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedUserVerifyControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/user_verify",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserVerifyControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_verify/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedUserVerifyControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/user_verify/${e}`,method:"DELETE",format:"json",...n}),generatedRedPacketRecordControllerList:(e,n={})=>this.http.request({path:"/admin/generated/red_packet_record/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedRedPacketRecordControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/red_packet_record/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedRedPacketRecordControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/red_packet_record",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedRedPacketRecordControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/red_packet_record/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedRedPacketRecordControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/red_packet_record/${e}`,method:"DELETE",format:"json",...n}),generatedRedPacketControllerList:(e,n={})=>this.http.request({path:"/admin/generated/red_packet/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedRedPacketControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/red_packet/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedRedPacketControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/red_packet",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedRedPacketControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/red_packet/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedRedPacketControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/red_packet/${e}`,method:"DELETE",format:"json",...n}),generatedUserControllerList:(e,n={})=>this.http.request({path:"/admin/generated/user/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedUserControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/user",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedUserControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/user/${e}`,method:"DELETE",format:"json",...n}),generatedUserBankControllerList:(e,n={})=>this.http.request({path:"/admin/generated/user_bank/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserBankControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_bank/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedUserBankControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/user_bank",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserBankControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_bank/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedUserBankControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/user_bank/${e}`,method:"DELETE",format:"json",...n}),generatedUserAddressControllerList:(e,n={})=>this.http.request({path:"/admin/generated/user_address/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserAddressControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_address/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedUserAddressControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/user_address",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserAddressControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_address/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedUserAddressControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/user_address/${e}`,method:"DELETE",format:"json",...n}),generatedUserMessageControllerList:(e,n={})=>this.http.request({path:"/admin/generated/user_message/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserMessageControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_message/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedUserMessageControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/user_message",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserMessageControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_message/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedUserMessageControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/user_message/${e}`,method:"DELETE",format:"json",...n}),generatedWithdrawControllerList:(e,n={})=>this.http.request({path:"/admin/generated/withdraw/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedWithdrawControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/withdraw/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedWithdrawControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/withdraw",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedWithdrawControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/withdraw/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedWithdrawControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/withdraw/${e}`,method:"DELETE",format:"json",...n}),generatedWalletBillControllerList:(e,n={})=>this.http.request({path:"/admin/generated/wallet_bill/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedWalletBillControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/wallet_bill/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedWalletBillControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/wallet_bill",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedWalletBillControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/wallet_bill/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedWalletBillControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/wallet_bill/${e}`,method:"DELETE",format:"json",...n}),generatedFinancialProductControllerList:(e,n={})=>this.http.request({path:"/admin/generated/financial_product/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedFinancialProductControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/financial_product/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedFinancialProductControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/financial_product",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedFinancialProductControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/financial_product/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedFinancialProductControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/financial_product/${e}`,method:"DELETE",format:"json",...n}),generatedUserFinancialProductControllerList:(e,n={})=>this.http.request({path:"/admin/generated/user_financial_product/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserFinancialProductControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_financial_product/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedUserFinancialProductControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/user_financial_product",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserFinancialProductControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_financial_product/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedUserFinancialProductControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/user_financial_product/${e}`,method:"DELETE",format:"json",...n}),generatedUserSignInTaskRewardControllerList:(e,n={})=>this.http.request({path:"/admin/generated/user_sign_in_task_reward/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserSignInTaskRewardControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_sign_in_task_reward/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedUserSignInTaskRewardControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/user_sign_in_task_reward",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserSignInTaskRewardControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_sign_in_task_reward/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedUserSignInTaskRewardControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/user_sign_in_task_reward/${e}`,method:"DELETE",format:"json",...n}),generatedUserSignInTaskControllerList:(e,n={})=>this.http.request({path:"/admin/generated/user_sign_in_task/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserSignInTaskControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_sign_in_task/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedUserSignInTaskControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/user_sign_in_task",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserSignInTaskControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_sign_in_task/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedUserSignInTaskControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/user_sign_in_task/${e}`,method:"DELETE",format:"json",...n}),generatedUserSignInCalendarControllerList:(e,n={})=>this.http.request({path:"/admin/generated/user_sign_in_calendar/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserSignInCalendarControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_sign_in_calendar/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedUserSignInCalendarControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/user_sign_in_calendar",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserSignInCalendarControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_sign_in_calendar/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedUserSignInCalendarControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/user_sign_in_calendar/${e}`,method:"DELETE",format:"json",...n}),generatedUserLogControllerList:(e,n={})=>this.http.request({path:"/admin/generated/user_log/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserLogControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_log/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedUserLogControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/user_log",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserLogControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_log/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedUserLogControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/user_log/${e}`,method:"DELETE",format:"json",...n}),generatedNewsCategoryControllerList:(e,n={})=>this.http.request({path:"/admin/generated/news_category/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedNewsCategoryControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/news_category/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedNewsCategoryControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/news_category",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedNewsCategoryControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/news_category/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedNewsCategoryControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/news_category/${e}`,method:"DELETE",format:"json",...n}),generatedRechargeControllerList:(e,n={})=>this.http.request({path:"/admin/generated/recharge/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedRechargeControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/recharge/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedRechargeControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/recharge",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedRechargeControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/recharge/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedRechargeControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/recharge/${e}`,method:"DELETE",format:"json",...n}),generatedJobHuntingControllerList:(e,n={})=>this.http.request({path:"/admin/generated/job_hunting/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedJobHuntingControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/job_hunting/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedJobHuntingControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/job_hunting",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedJobHuntingControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/job_hunting/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedJobHuntingControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/job_hunting/${e}`,method:"DELETE",format:"json",...n}),generatedSystemConfigControllerList:(e,n={})=>this.http.request({path:"/admin/generated/system_config/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedSystemConfigControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/system_config/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedSystemConfigControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/system_config",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedSystemConfigControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/system_config/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedSystemConfigControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/system_config/${e}`,method:"DELETE",format:"json",...n}),generatedInviteCodePoolControllerList:(e,n={})=>this.http.request({path:"/admin/generated/invite_code_pool/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedInviteCodePoolControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/invite_code_pool/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedInviteCodePoolControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/invite_code_pool",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedInviteCodePoolControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/invite_code_pool/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedInviteCodePoolControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/invite_code_pool/${e}`,method:"DELETE",format:"json",...n}),generatedNewsControllerList:(e,n={})=>this.http.request({path:"/admin/generated/news/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedNewsControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/news/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedNewsControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/news",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedNewsControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/news/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedNewsControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/news/${e}`,method:"DELETE",format:"json",...n}),generatedDailyMeetingControllerList:(e,n={})=>this.http.request({path:"/admin/generated/daily_meeting/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedDailyMeetingControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/daily_meeting/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedDailyMeetingControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/daily_meeting",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedDailyMeetingControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/daily_meeting/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedDailyMeetingControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/daily_meeting/${e}`,method:"DELETE",format:"json",...n}),generatedDailyMeetingStatsControllerList:(e,n={})=>this.http.request({path:"/admin/generated/daily_meeting_stats/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedDailyMeetingStatsControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/daily_meeting_stats/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedDailyMeetingStatsControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/daily_meeting_stats",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedDailyMeetingStatsControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/daily_meeting_stats/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedDailyMeetingStatsControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/daily_meeting_stats/${e}`,method:"DELETE",format:"json",...n}),generatedAppVersionControllerList:(e,n={})=>this.http.request({path:"/admin/generated/app_version/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedAppVersionControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/app_version/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedAppVersionControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/app_version",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedAppVersionControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/app_version/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedAppVersionControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/app_version/${e}`,method:"DELETE",format:"json",...n}),generatedDocumentControllerList:(e,n={})=>this.http.request({path:"/admin/generated/document/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedDocumentControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/document/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedDocumentControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/document",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedDocumentControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/document/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedDocumentControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/document/${e}`,method:"DELETE",format:"json",...n}),generatedUserSignInControllerList:(e,n={})=>this.http.request({path:"/admin/generated/user_sign_in/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserSignInControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_sign_in/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedUserSignInControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/user_sign_in",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedUserSignInControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/user_sign_in/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedUserSignInControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/user_sign_in/${e}`,method:"DELETE",format:"json",...n}),generatedAdminControllerList:(e,n={})=>this.http.request({path:"/admin/generated/admin/list",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedAdminControllerDetail:({id:e},n,i={})=>this.http.request({path:`/admin/generated/admin/detail/${e}`,method:"POST",body:n,type:"application/json",format:"json",...i}),generatedAdminControllerCreate:(e,n={})=>this.http.request({path:"/admin/generated/admin",method:"POST",body:e,type:"application/json",format:"json",...n}),generatedAdminControllerUpdate:({id:e},n,i={})=>this.http.request({path:`/admin/generated/admin/${e}`,method:"PUT",body:n,type:"application/json",format:"json",...i}),generatedAdminControllerDelete:({ids:e},n={})=>this.http.request({path:`/admin/generated/admin/${e}`,method:"DELETE",format:"json",...n})}}const wT="__ADMIN_LOGIN_INFO_CACHE_KEY__",s0=Nre("session",()=>{const t=H(bc.get(wT)||""),e=M(()=>!!t.value);return{token:t,isLogin:e,login:r=>{t.value=r,bc.set(wT,r)},loginout:()=>{t.value="",bc.remove(wT)}}}),vM=new xAe({headers:{"Content-Type":"application/json;charset=UTF-8"},validateStatus:t=>!0});vM.instance.interceptors.response.use(t=>{const e=s0(),n=t.data||{};return n.code==401&&(e.loginout(),location.href="/"),n.success||fl.showNotification(n.msg),t});vM.instance.interceptors.request.use(t=>{const e=s0();return t.headers.Authorization="Bearer "+e.token,t});const PAe=new AAe(vM),it=PAe.admin,mK=vn({meta:{title:"登录"}}),IAe=le(()=>{const t=s0(),e=async(c,d)=>{const f=await it.sessionControllerLogin({username:c,password:d});return f.data.success&&t.login(f.data.data?.token),f.data.success},n=XR(),i=H(),r=H({username:"",password:""}),o=H(!1),s=H(!1),a=H({username:[{required:!0,message:"请输入账号",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]}),l="login_remember";Pt(()=>{const c=bc.get(l);c&&(r.value.username=c.username,r.value.password=c.password,o.value=!0)});const u=async()=>{if(!i.value||!await i.value.validate().catch(()=>!1))return!1;s.value=!0;try{const{username:d,password:f}=r.value;o.value?bc.set(l,{username:d,password:f}):bc.remove(l);const h=await e(d,f);return s.value=!1,h?(fl.showNotification("登录成功"),n.push("/"),!0):!1}finally{s.value=!1}};return()=>L("div",{class:bn.login_wrapper},[L("div",{class:bn.particles},[[...Array(9)].map((c,d)=>L("div",{key:d,class:bn.particle},null))]),L("div",{class:bn.container},[L("div",{class:bn.login_cover},[L("div",{class:bn.cube_container},[L("div",{class:bn.cube},[L("div",{class:bn.cube_face+" "+bn.cube_front},[dt("📊")]),L("div",{class:bn.cube_face+" "+bn.cube_back},[dt("🔒")]),L("div",{class:bn.cube_face+" "+bn.cube_right},[dt("⚡")]),L("div",{class:bn.cube_face+" "+bn.cube_left},[dt("🚀")]),L("div",{class:bn.cube_face+" "+bn.cube_top},[dt("💡")]),L("div",{class:bn.cube_face+" "+bn.cube_bottom},[dt("🎯")])])]),L("h1",{class:bn.login_title},[dt("后台管理系统")]),L("p",{class:bn.login_subtitle},[dt("让工作更智能,让管理更简单")]),L("div",{class:bn.waves},[L("div",{class:bn.wave+" "+bn.wave_1},null),L("div",{class:bn.wave+" "+bn.wave_2},null),L("div",{class:bn.wave+" "+bn.wave_3},null)]),L("div",{class:bn.bubbles},[[...Array(6)].map((c,d)=>L("div",{key:d,class:bn.bubble,style:{"--delay":d*.5,"--size":20+d*8}},null))])]),L("div",{class:bn.login_body},[L("div",{class:bn.login_body_title},[L("span",null,[dt("密码登录")])]),L(aq,{ref:i,model:r.value,rules:a.value,"label-width":"0"},{default:()=>[L(Wh,{prop:"username"},{default:()=>[L(cr,{modelValue:r.value.username,"onUpdate:modelValue":c=>r.value.username=c,placeholder:"请输入账号",size:"large",clearable:!0,"prefix-icon":L(He,null,{default:()=>[L(hU,null,null)]})},null)]}),L(Wh,{prop:"password"},{default:()=>[L(cr,{modelValue:r.value.password,"onUpdate:modelValue":c=>r.value.password=c,type:"password",placeholder:"请输入密码","show-password":!0,size:"large",clearable:!0,"prefix-icon":L(He,null,{default:()=>[L(Ade,null,null)]})},null)]}),L(Wh,null,{default:()=>[L("div",{class:bn.remember_wrapper},[L(Ac,{modelValue:o.value,"onUpdate:modelValue":c=>o.value=c},{default:()=>[dt("记住账号密码")]})])]}),L(Wh,null,{default:()=>[L(Hi,{type:"primary",class:bn.login_button,onClick:u,size:"large",loading:s.value},{default:()=>[dt("登录")]})]})]})])])])}),RAe=Object.freeze(Object.defineProperty({__proto__:null,default:IAe,meta:mK},Symbol.toStringTag,{value:"Module"}));var qh=9e15,jc=1e9,uA="0123456789abcdef",e1="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",t1="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",cA={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-qh,maxE:qh,crypto:!1},gK,Zl,zt=!0,tS="[DecimalError] ",Pc=tS+"Invalid argument: ",pK=tS+"Precision limit exceeded",vK=tS+"crypto unavailable",bK="[object Decimal]",Hr=Math.floor,tr=Math.pow,MAe=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,OAe=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,LAe=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,yK=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,sa=1e7,Mt=7,DAe=9007199254740991,NAe=e1.length-1,dA=t1.length-1,$e={toStringTag:bK};$e.absoluteValue=$e.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),Tt(t)};$e.ceil=function(){return Tt(new this.constructor(this),this.e+1,2)};$e.clampedTo=$e.clamp=function(t,e){var n,i=this,r=i.constructor;if(t=new r(t),e=new r(e),!t.s||!e.s)return new r(NaN);if(t.gt(e))throw Error(Pc+e);return n=i.cmp(t),n<0?t:i.cmp(e)>0?e:new r(i)};$e.comparedTo=$e.cmp=function(t){var e,n,i,r,o=this,s=o.d,a=(t=new o.constructor(t)).d,l=o.s,u=t.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==t.e)return o.e>t.e^l<0?1:-1;for(i=s.length,r=a.length,e=0,n=ia[e]^l<0?1:-1;return i===r?0:i>r^l<0?1:-1};$e.cosine=$e.cos=function(){var t,e,n=this,i=n.constructor;return n.d?n.d[0]?(t=i.precision,e=i.rounding,i.precision=t+Math.max(n.e,n.sd())+Mt,i.rounding=1,n=BAe(i,kK(i,n)),i.precision=t,i.rounding=e,Tt(Zl==2||Zl==3?n.neg():n,t,e,!0)):new i(1):new i(NaN)};$e.cubeRoot=$e.cbrt=function(){var t,e,n,i,r,o,s,a,l,u,c=this,d=c.constructor;if(!c.isFinite()||c.isZero())return new d(c);for(zt=!1,o=c.s*tr(c.s*c,1/3),!o||Math.abs(o)==1/0?(n=yr(c.d),t=c.e,(o=(t-n.length+1)%3)&&(n+=o==1||o==-2?"0":"00"),o=tr(n,1/3),t=Hr((t+1)/3)-(t%3==(t<0?-1:2)),o==1/0?n="5e"+t:(n=o.toExponential(),n=n.slice(0,n.indexOf("e")+1)+t),i=new d(n),i.s=c.s):i=new d(o.toString()),s=(t=d.precision)+3;;)if(a=i,l=a.times(a).times(a),u=l.plus(c),i=Gn(u.plus(c).times(a),u.plus(l),s+2,1),yr(a.d).slice(0,s)===(n=yr(i.d)).slice(0,s))if(n=n.slice(s-3,s+1),n=="9999"||!r&&n=="4999"){if(!r&&(Tt(a,t+1,0),a.times(a).times(a).eq(c))){i=a;break}s+=4,r=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(Tt(i,t+1,1),e=!i.times(i).times(i).eq(c));break}return zt=!0,Tt(i,t,d.rounding,e)};$e.decimalPlaces=$e.dp=function(){var t,e=this.d,n=NaN;if(e){if(t=e.length-1,n=(t-Hr(this.e/Mt))*Mt,t=e[t],t)for(;t%10==0;t/=10)n--;n<0&&(n=0)}return n};$e.dividedBy=$e.div=function(t){return Gn(this,new this.constructor(t))};$e.dividedToIntegerBy=$e.divToInt=function(t){var e=this,n=e.constructor;return Tt(Gn(e,new n(t),0,1,1),n.precision,n.rounding)};$e.equals=$e.eq=function(t){return this.cmp(t)===0};$e.floor=function(){return Tt(new this.constructor(this),this.e+1,3)};$e.greaterThan=$e.gt=function(t){return this.cmp(t)>0};$e.greaterThanOrEqualTo=$e.gte=function(t){var e=this.cmp(t);return e==1||e===0};$e.hyperbolicCosine=$e.cosh=function(){var t,e,n,i,r,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;n=s.precision,i=s.rounding,s.precision=n+Math.max(o.e,o.sd())+4,s.rounding=1,r=o.d.length,r<32?(t=Math.ceil(r/3),e=(1/iS(4,t)).toString()):(t=16,e="2.3283064365386962890625e-10"),o=Um(s,1,o.times(e),new s(1),!0);for(var l,u=t,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return Tt(o,s.precision=n,s.rounding=i,!0)};$e.hyperbolicSine=$e.sinh=function(){var t,e,n,i,r=this,o=r.constructor;if(!r.isFinite()||r.isZero())return new o(r);if(e=o.precision,n=o.rounding,o.precision=e+Math.max(r.e,r.sd())+4,o.rounding=1,i=r.d.length,i<3)r=Um(o,2,r,r,!0);else{t=1.4*Math.sqrt(i),t=t>16?16:t|0,r=r.times(1/iS(5,t)),r=Um(o,2,r,r,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);t--;)s=r.times(r),r=r.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=e,o.rounding=n,Tt(r,e,n,!0)};$e.hyperbolicTangent=$e.tanh=function(){var t,e,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(t=i.precision,e=i.rounding,i.precision=t+7,i.rounding=1,Gn(n.sinh(),n.cosh(),i.precision=t,i.rounding=e)):new i(n.s)};$e.inverseCosine=$e.acos=function(){var t=this,e=t.constructor,n=t.abs().cmp(1),i=e.precision,r=e.rounding;return n!==-1?n===0?t.isNeg()?ja(e,i,r):new e(0):new e(NaN):t.isZero()?ja(e,i+4,r).times(.5):(e.precision=i+6,e.rounding=1,t=new e(1).minus(t).div(t.plus(1)).sqrt().atan(),e.precision=i,e.rounding=r,t.times(2))};$e.inverseHyperbolicCosine=$e.acosh=function(){var t,e,n=this,i=n.constructor;return n.lte(1)?new i(n.eq(1)?0:NaN):n.isFinite()?(t=i.precision,e=i.rounding,i.precision=t+Math.max(Math.abs(n.e),n.sd())+4,i.rounding=1,zt=!1,n=n.times(n).minus(1).sqrt().plus(n),zt=!0,i.precision=t,i.rounding=e,n.ln()):new i(n)};$e.inverseHyperbolicSine=$e.asinh=function(){var t,e,n=this,i=n.constructor;return!n.isFinite()||n.isZero()?new i(n):(t=i.precision,e=i.rounding,i.precision=t+2*Math.max(Math.abs(n.e),n.sd())+6,i.rounding=1,zt=!1,n=n.times(n).plus(1).sqrt().plus(n),zt=!0,i.precision=t,i.rounding=e,n.ln())};$e.inverseHyperbolicTangent=$e.atanh=function(){var t,e,n,i,r=this,o=r.constructor;return r.isFinite()?r.e>=0?new o(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(t=o.precision,e=o.rounding,i=r.sd(),Math.max(i,t)<2*-r.e-1?Tt(new o(r),t,e,!0):(o.precision=n=i-r.e,r=Gn(r.plus(1),new o(1).minus(r),n+t,1),o.precision=t+4,o.rounding=1,r=r.ln(),o.precision=t,o.rounding=e,r.times(.5))):new o(NaN)};$e.inverseSine=$e.asin=function(){var t,e,n,i,r=this,o=r.constructor;return r.isZero()?new o(r):(e=r.abs().cmp(1),n=o.precision,i=o.rounding,e!==-1?e===0?(t=ja(o,n+4,i).times(.5),t.s=r.s,t):new o(NaN):(o.precision=n+6,o.rounding=1,r=r.div(new o(1).minus(r.times(r)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=i,r.times(2)))};$e.inverseTangent=$e.atan=function(){var t,e,n,i,r,o,s,a,l,u=this,c=u.constructor,d=c.precision,f=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&d+4<=dA)return s=ja(c,d+4,f).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(d+4<=dA)return s=ja(c,d+4,f).times(.5),s.s=u.s,s}for(c.precision=a=d+10,c.rounding=1,n=Math.min(28,a/Mt+2|0),t=n;t;--t)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(zt=!1,e=Math.ceil(a/Mt),i=1,l=u.times(u),s=new c(u),r=u;t!==-1;)if(r=r.times(l),o=s.minus(r.div(i+=2)),r=r.times(l),s=o.plus(r.div(i+=2)),s.d[e]!==void 0)for(t=e;s.d[t]===o.d[t]&&t--;);return n&&(s=s.times(2<this.d.length-2};$e.isNaN=function(){return!this.s};$e.isNegative=$e.isNeg=function(){return this.s<0};$e.isPositive=$e.isPos=function(){return this.s>0};$e.isZero=function(){return!!this.d&&this.d[0]===0};$e.lessThan=$e.lt=function(t){return this.cmp(t)<0};$e.lessThanOrEqualTo=$e.lte=function(t){return this.cmp(t)<1};$e.logarithm=$e.log=function(t){var e,n,i,r,o,s,a,l,u=this,c=u.constructor,d=c.precision,f=c.rounding,h=5;if(t==null)t=new c(10),e=!0;else{if(t=new c(t),n=t.d,t.s<0||!n||!n[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(n=u.d,u.s<0||!n||!n[0]||u.eq(1))return new c(n&&!n[0]?-1/0:u.s!=1?NaN:n?0:1/0);if(e)if(n.length>1)o=!0;else{for(r=n[0];r%10===0;)r/=10;o=r!==1}if(zt=!1,a=d+h,s=fc(u,a),i=e?n1(c,a+10):fc(t,a),l=Gn(s,i,a,1),Zv(l.d,r=d,f))do if(a+=10,s=fc(u,a),i=e?n1(c,a+10):fc(t,a),l=Gn(s,i,a,1),!o){+yr(l.d).slice(r+1,r+15)+1==1e14&&(l=Tt(l,d+1,0));break}while(Zv(l.d,r+=10,f));return zt=!0,Tt(l,d,f)};$e.minus=$e.sub=function(t){var e,n,i,r,o,s,a,l,u,c,d,f,h=this,m=h.constructor;if(t=new m(t),!h.d||!t.d)return!h.s||!t.s?t=new m(NaN):h.d?t.s=-t.s:t=new m(t.d||h.s!==t.s?h:NaN),t;if(h.s!=t.s)return t.s=-t.s,h.plus(t);if(u=h.d,f=t.d,a=m.precision,l=m.rounding,!u[0]||!f[0]){if(f[0])t.s=-t.s;else if(u[0])t=new m(h);else return new m(l===3?-0:0);return zt?Tt(t,a,l):t}if(n=Hr(t.e/Mt),c=Hr(h.e/Mt),u=u.slice(),o=c-n,o){for(d=o<0,d?(e=u,o=-o,s=f.length):(e=f,n=c,s=u.length),i=Math.max(Math.ceil(a/Mt),s)+2,o>i&&(o=i,e.length=1),e.reverse(),i=o;i--;)e.push(0);e.reverse()}else{for(i=u.length,s=f.length,d=i0;--i)u[s++]=0;for(i=f.length;i>o;){if(u[--i]s?o+1:s+1,r>s&&(r=s,n.length=1),n.reverse();r--;)n.push(0);n.reverse()}for(s=u.length,r=c.length,s-r<0&&(r=s,n=c,c=u,u=n),e=0;r;)e=(u[--r]=u[r]+c[r]+e)/sa|0,u[r]%=sa;for(e&&(u.unshift(e),++i),s=u.length;u[--s]==0;)u.pop();return t.d=u,t.e=nS(u,i),zt?Tt(t,a,l):t};$e.precision=$e.sd=function(t){var e,n=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Pc+t);return n.d?(e=wK(n.d),t&&n.e+1>e&&(e=n.e+1)):e=NaN,e};$e.round=function(){var t=this,e=t.constructor;return Tt(new e(t),t.e+1,e.rounding)};$e.sine=$e.sin=function(){var t,e,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(t=i.precision,e=i.rounding,i.precision=t+Math.max(n.e,n.sd())+Mt,i.rounding=1,n=FAe(i,kK(i,n)),i.precision=t,i.rounding=e,Tt(Zl>2?n.neg():n,t,e,!0)):new i(NaN)};$e.squareRoot=$e.sqrt=function(){var t,e,n,i,r,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(zt=!1,u=Math.sqrt(+s),u==0||u==1/0?(e=yr(a),(e.length+l)%2==0&&(e+="0"),u=Math.sqrt(e),l=Hr((l+1)/2)-(l<0||l%2),u==1/0?e="5e"+l:(e=u.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),i=new c(e)):i=new c(u.toString()),n=(l=c.precision)+3;;)if(o=i,i=o.plus(Gn(s,o,n+2,1)).times(.5),yr(o.d).slice(0,n)===(e=yr(i.d)).slice(0,n))if(e=e.slice(n-3,n+1),e=="9999"||!r&&e=="4999"){if(!r&&(Tt(o,l+1,0),o.times(o).eq(s))){i=o;break}n+=4,r=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(Tt(i,l+1,1),t=!i.times(i).eq(s));break}return zt=!0,Tt(i,l,c.rounding,t)};$e.tangent=$e.tan=function(){var t,e,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(t=i.precision,e=i.rounding,i.precision=t+10,i.rounding=1,n=n.sin(),n.s=1,n=Gn(n,new i(1).minus(n.times(n)).sqrt(),t+10,0),i.precision=t,i.rounding=e,Tt(Zl==2||Zl==4?n.neg():n,t,e,!0)):new i(NaN)};$e.times=$e.mul=function(t){var e,n,i,r,o,s,a,l,u,c=this,d=c.constructor,f=c.d,h=(t=new d(t)).d;if(t.s*=c.s,!f||!f[0]||!h||!h[0])return new d(!t.s||f&&!f[0]&&!h||h&&!h[0]&&!f?NaN:!f||!h?t.s/0:t.s*0);for(n=Hr(c.e/Mt)+Hr(t.e/Mt),l=f.length,u=h.length,l=0;){for(e=0,r=l+i;r>i;)a=o[r]+h[i]*f[r-i-1]+e,o[r--]=a%sa|0,e=a/sa|0;o[r]=(o[r]+e)%sa|0}for(;!o[--s];)o.pop();return e?++n:o.shift(),t.d=o,t.e=nS(o,n),zt?Tt(t,d.precision,d.rounding):t};$e.toBinary=function(t,e){return bM(this,2,t,e)};$e.toDecimalPlaces=$e.toDP=function(t,e){var n=this,i=n.constructor;return n=new i(n),t===void 0?n:(No(t,0,jc),e===void 0?e=i.rounding:No(e,0,8),Tt(n,t+n.e+1,e))};$e.toExponential=function(t,e){var n,i=this,r=i.constructor;return t===void 0?n=hl(i,!0):(No(t,0,jc),e===void 0?e=r.rounding:No(e,0,8),i=Tt(new r(i),t+1,e),n=hl(i,!0,t+1)),i.isNeg()&&!i.isZero()?"-"+n:n};$e.toFixed=function(t,e){var n,i,r=this,o=r.constructor;return t===void 0?n=hl(r):(No(t,0,jc),e===void 0?e=o.rounding:No(e,0,8),i=Tt(new o(r),t+r.e+1,e),n=hl(i,!1,t+i.e+1)),r.isNeg()&&!r.isZero()?"-"+n:n};$e.toFraction=function(t){var e,n,i,r,o,s,a,l,u,c,d,f,h=this,m=h.d,g=h.constructor;if(!m)return new g(h);if(u=n=new g(1),i=l=new g(0),e=new g(i),o=e.e=wK(m)-h.e-1,s=o%Mt,e.d[0]=tr(10,s<0?Mt+s:s),t==null)t=o>0?e:u;else{if(a=new g(t),!a.isInt()||a.lt(u))throw Error(Pc+a);t=a.gt(e)?o>0?e:u:a}for(zt=!1,a=new g(yr(m)),c=g.precision,g.precision=o=m.length*Mt*2;d=Gn(a,e,0,1,1),r=n.plus(d.times(i)),r.cmp(t)!=1;)n=i,i=r,r=u,u=l.plus(d.times(r)),l=r,r=e,e=a.minus(d.times(r)),a=r;return r=Gn(t.minus(n),i,0,1,1),l=l.plus(r.times(u)),n=n.plus(r.times(i)),l.s=u.s=h.s,f=Gn(u,i,o,1).minus(h).abs().cmp(Gn(l,n,o,1).minus(h).abs())<1?[u,i]:[l,n],g.precision=c,zt=!0,f};$e.toHexadecimal=$e.toHex=function(t,e){return bM(this,16,t,e)};$e.toNearest=function(t,e){var n=this,i=n.constructor;if(n=new i(n),t==null){if(!n.d)return n;t=new i(1),e=i.rounding}else{if(t=new i(t),e===void 0?e=i.rounding:No(e,0,8),!n.d)return t.s?n:t;if(!t.d)return t.s&&(t.s=n.s),t}return t.d[0]?(zt=!1,n=Gn(n,t,0,e,1).times(t),zt=!0,Tt(n)):(t.s=n.s,n=t),n};$e.toNumber=function(){return+this};$e.toOctal=function(t,e){return bM(this,8,t,e)};$e.toPower=$e.pow=function(t){var e,n,i,r,o,s,a=this,l=a.constructor,u=+(t=new l(t));if(!a.d||!t.d||!a.d[0]||!t.d[0])return new l(tr(+a,u));if(a=new l(a),a.eq(1))return a;if(i=l.precision,o=l.rounding,t.eq(1))return Tt(a,i,o);if(e=Hr(t.e/Mt),e>=t.d.length-1&&(n=u<0?-u:u)<=DAe)return r=_K(l,a,n,i),t.s<0?new l(1).div(r):Tt(r,i,o);if(s=a.s,s<0){if(el.maxE+1||e0?s/0:0):(zt=!1,l.rounding=a.s=1,n=Math.min(12,(e+"").length),r=fA(t.times(fc(a,i+n)),i),r.d&&(r=Tt(r,i+5,1),Zv(r.d,i,o)&&(e=i+10,r=Tt(fA(t.times(fc(a,e+n)),e),e+5,1),+yr(r.d).slice(i+1,i+15)+1==1e14&&(r=Tt(r,i+1,0)))),r.s=s,zt=!0,l.rounding=o,Tt(r,i,o))};$e.toPrecision=function(t,e){var n,i=this,r=i.constructor;return t===void 0?n=hl(i,i.e<=r.toExpNeg||i.e>=r.toExpPos):(No(t,1,jc),e===void 0?e=r.rounding:No(e,0,8),i=Tt(new r(i),t,e),n=hl(i,t<=i.e||i.e<=r.toExpNeg,t)),i.isNeg()&&!i.isZero()?"-"+n:n};$e.toSignificantDigits=$e.toSD=function(t,e){var n=this,i=n.constructor;return t===void 0?(t=i.precision,e=i.rounding):(No(t,1,jc),e===void 0?e=i.rounding:No(e,0,8)),Tt(new i(n),t,e)};$e.toString=function(){var t=this,e=t.constructor,n=hl(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+n:n};$e.truncated=$e.trunc=function(){return Tt(new this.constructor(this),this.e+1,1)};$e.valueOf=$e.toJSON=function(){var t=this,e=t.constructor,n=hl(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+n:n};function yr(t){var e,n,i,r=t.length-1,o="",s=t[0];if(r>0){for(o+=s,e=1;en)throw Error(Pc+t)}function Zv(t,e,n,i){var r,o,s,a;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=Mt,r=0):(r=Math.ceil((e+1)/Mt),e%=Mt),o=tr(10,Mt-e),a=t[r]%o|0,i==null?e<3?(e==0?a=a/100|0:e==1&&(a=a/10|0),s=n<4&&a==99999||n>3&&a==49999||a==5e4||a==0):s=(n<4&&a+1==o||n>3&&a+1==o/2)&&(t[r+1]/o/100|0)==tr(10,e-2)-1||(a==o/2||a==0)&&(t[r+1]/o/100|0)==0:e<4?(e==0?a=a/1e3|0:e==1?a=a/100|0:e==2&&(a=a/10|0),s=(i||n<4)&&a==9999||!i&&n>3&&a==4999):s=((i||n<4)&&a+1==o||!i&&n>3&&a+1==o/2)&&(t[r+1]/o/1e3|0)==tr(10,e-3)-1,s}function Kw(t,e,n){for(var i,r=[0],o,s=0,a=t.length;sn-1&&(r[i+1]===void 0&&(r[i+1]=0),r[i+1]+=r[i]/n|0,r[i]%=n)}return r.reverse()}function BAe(t,e){var n,i,r;if(e.isZero())return e;i=e.d.length,i<32?(n=Math.ceil(i/3),r=(1/iS(4,n)).toString()):(n=16,r="2.3283064365386962890625e-10"),t.precision+=n,e=Um(t,1,e.times(r),new t(1));for(var o=n;o--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=n,e}var Gn=(function(){function t(i,r,o){var s,a=0,l=i.length;for(i=i.slice();l--;)s=i[l]*r+a,i[l]=s%o|0,a=s/o|0;return a&&i.unshift(a),i}function e(i,r,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;ar[a]?1:-1;break}return l}function n(i,r,o,s){for(var a=0;o--;)i[o]-=a,a=i[o]1;)i.shift()}return function(i,r,o,s,a,l){var u,c,d,f,h,m,g,v,p,b,y,_,C,S,k,T,E,x,P,A,I=i.constructor,D=i.s==r.s?1:-1,q=i.d,z=r.d;if(!q||!q[0]||!z||!z[0])return new I(!i.s||!r.s||(q?z&&q[0]==z[0]:!z)?NaN:q&&q[0]==0||!z?D*0:D/0);for(l?(h=1,c=i.e-r.e):(l=sa,h=Mt,c=Hr(i.e/h)-Hr(r.e/h)),P=z.length,E=q.length,p=new I(D),b=p.d=[],d=0;z[d]==(q[d]||0);d++);if(z[d]>(q[d]||0)&&c--,o==null?(S=o=I.precision,s=I.rounding):a?S=o+(i.e-r.e)+1:S=o,S<0)b.push(1),m=!0;else{if(S=S/h+2|0,d=0,P==1){for(f=0,z=z[0],S++;(d1&&(z=t(z,f,l),q=t(q,f,l),P=z.length,E=q.length),T=P,y=q.slice(0,P),_=y.length;_=l/2&&++x;do f=0,u=e(z,y,P,_),u<0?(C=y[0],P!=_&&(C=C*l+(y[1]||0)),f=C/x|0,f>1?(f>=l&&(f=l-1),g=t(z,f,l),v=g.length,_=y.length,u=e(g,y,v,_),u==1&&(f--,n(g,P=10;f/=10)d++;p.e=d+c*h-1,Tt(p,a?o+p.e+1:o,s,m)}return p}})();function Tt(t,e,n,i){var r,o,s,a,l,u,c,d,f,h=t.constructor;e:if(e!=null){if(d=t.d,!d)return t;for(r=1,a=d[0];a>=10;a/=10)r++;if(o=e-r,o<0)o+=Mt,s=e,c=d[f=0],l=c/tr(10,r-s-1)%10|0;else if(f=Math.ceil((o+1)/Mt),a=d.length,f>=a)if(i){for(;a++<=f;)d.push(0);c=l=0,r=1,o%=Mt,s=o-Mt+1}else break e;else{for(c=a=d[f],r=1;a>=10;a/=10)r++;o%=Mt,s=o-Mt+r,l=s<0?0:c/tr(10,r-s-1)%10|0}if(i=i||e<0||d[f+1]!==void 0||(s<0?c:c%tr(10,r-s-1)),u=n<4?(l||i)&&(n==0||n==(t.s<0?3:2)):l>5||l==5&&(n==4||i||n==6&&(o>0?s>0?c/tr(10,r-s):0:d[f-1])%10&1||n==(t.s<0?8:7)),e<1||!d[0])return d.length=0,u?(e-=t.e+1,d[0]=tr(10,(Mt-e%Mt)%Mt),t.e=-e||0):d[0]=t.e=0,t;if(o==0?(d.length=f,a=1,f--):(d.length=f+1,a=tr(10,Mt-o),d[f]=s>0?(c/tr(10,r-s)%tr(10,s)|0)*a:0),u)for(;;)if(f==0){for(o=1,s=d[0];s>=10;s/=10)o++;for(s=d[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(t.e++,d[0]==sa&&(d[0]=1));break}else{if(d[f]+=a,d[f]!=sa)break;d[f--]=0,a=1}for(o=d.length;d[--o]===0;)d.pop()}return zt&&(t.e>h.maxE?(t.d=null,t.e=NaN):t.e0?o=o.charAt(0)+"."+o.slice(1)+rc(i):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):r<0?(o="0."+rc(-r-1)+o,n&&(i=n-s)>0&&(o+=rc(i))):r>=s?(o+=rc(r+1-s),n&&(i=n-r-1)>0&&(o=o+"."+rc(i))):((i=r+1)0&&(r+1===s&&(o+="."),o+=rc(i))),o}function nS(t,e){var n=t[0];for(e*=Mt;n>=10;n/=10)e++;return e}function n1(t,e,n){if(e>NAe)throw zt=!0,n&&(t.precision=n),Error(pK);return Tt(new t(e1),e,1,!0)}function ja(t,e,n){if(e>dA)throw Error(pK);return Tt(new t(t1),e,n,!0)}function wK(t){var e=t.length-1,n=e*Mt+1;if(e=t[e],e){for(;e%10==0;e/=10)n--;for(e=t[0];e>=10;e/=10)n++}return n}function rc(t){for(var e="";t--;)e+="0";return e}function _K(t,e,n,i){var r,o=new t(1),s=Math.ceil(i/Mt+4);for(zt=!1;;){if(n%2&&(o=o.times(e),UB(o.d,s)&&(r=!0)),n=Hr(n/2),n===0){n=o.d.length-1,r&&o.d[n]===0&&++o.d[n];break}e=e.times(e),UB(e.d,s)}return zt=!0,o}function HB(t){return t.d[t.d.length-1]&1}function CK(t,e,n){for(var i,r,o=new t(e[0]),s=0;++s17)return new f(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(e==null?(zt=!1,l=m):l=e,a=new f(.03125);t.e>-2;)t=t.times(a),d+=5;for(i=Math.log(tr(2,d))/Math.LN10*2+5|0,l+=i,n=o=s=new f(1),f.precision=l;;){if(o=Tt(o.times(t),l,1),n=n.times(++c),a=s.plus(Gn(o,n,l,1)),yr(a.d).slice(0,l)===yr(s.d).slice(0,l)){for(r=d;r--;)s=Tt(s.times(s),l,1);if(e==null)if(u<3&&Zv(s.d,l-i,h,u))f.precision=l+=10,n=o=a=new f(1),c=0,u++;else return Tt(s,f.precision=m,h,zt=!0);else return f.precision=m,s}s=a}}function fc(t,e){var n,i,r,o,s,a,l,u,c,d,f,h=1,m=10,g=t,v=g.d,p=g.constructor,b=p.rounding,y=p.precision;if(g.s<0||!v||!v[0]||!g.e&&v[0]==1&&v.length==1)return new p(v&&!v[0]?-1/0:g.s!=1?NaN:v?0:g);if(e==null?(zt=!1,c=y):c=e,p.precision=c+=m,n=yr(v),i=n.charAt(0),Math.abs(o=g.e)<15e14){for(;i<7&&i!=1||i==1&&n.charAt(1)>3;)g=g.times(t),n=yr(g.d),i=n.charAt(0),h++;o=g.e,i>1?(g=new p("0."+n),o++):g=new p(i+"."+n.slice(1))}else return u=n1(p,c+2,y).times(o+""),g=fc(new p(i+"."+n.slice(1)),c-m).plus(u),p.precision=y,e==null?Tt(g,y,b,zt=!0):g;for(d=g,l=s=g=Gn(g.minus(1),g.plus(1),c,1),f=Tt(g.times(g),c,1),r=3;;){if(s=Tt(s.times(f),c,1),u=l.plus(Gn(s,new p(r),c,1)),yr(u.d).slice(0,c)===yr(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(n1(p,c+2,y).times(o+""))),l=Gn(l,new p(h),c,1),e==null)if(Zv(l.d,c-m,b,a))p.precision=c+=m,u=s=g=Gn(d.minus(1),d.plus(1),c,1),f=Tt(g.times(g),c,1),r=a=1;else return Tt(l,p.precision=y,b,zt=!0);else return p.precision=y,l;l=u,r+=2}}function SK(t){return String(t.s*t.s/0)}function Gw(t,e){var n,i,r;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(i=e.search(/e/i))>0?(n<0&&(n=i),n+=+e.slice(i+1),e=e.substring(0,i)):n<0&&(n=e.length),i=0;e.charCodeAt(i)===48;i++);for(r=e.length;e.charCodeAt(r-1)===48;--r);if(e=e.slice(i,r),e){if(r-=i,t.e=n=n-i-1,t.d=[],i=(n+1)%Mt,n<0&&(i+=Mt),it.constructor.maxE?(t.d=null,t.e=NaN):t.e-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),yK.test(e))return Gw(t,e)}else if(e==="Infinity"||e==="NaN")return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(OAe.test(e))n=16,e=e.toLowerCase();else if(MAe.test(e))n=2;else if(LAe.test(e))n=8;else throw Error(Pc+e);for(o=e.search(/p/i),o>0?(l=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),o=e.indexOf("."),s=o>=0,i=t.constructor,s&&(e=e.replace(".",""),a=e.length,o=a-o,r=_K(i,new i(n),o,o*2)),u=Kw(e,n,sa),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new i(t.s*0):(t.e=nS(u,c),t.d=u,zt=!1,s&&(t=Gn(t,r,a*4)),l&&(t=t.times(Math.abs(l)<54?tr(2,l):hc.pow(2,l))),zt=!0,t)}function FAe(t,e){var n,i=e.d.length;if(i<3)return e.isZero()?e:Um(t,2,e,e);n=1.4*Math.sqrt(i),n=n>16?16:n|0,e=e.times(1/iS(5,n)),e=Um(t,2,e,e);for(var r,o=new t(5),s=new t(16),a=new t(20);n--;)r=e.times(e),e=e.times(o.plus(r.times(s.times(r).minus(a))));return e}function Um(t,e,n,i,r){var o,s,a,l,u=t.precision,c=Math.ceil(u/Mt);for(zt=!1,l=n.times(n),a=new t(i);;){if(s=Gn(a.times(l),new t(e++*e++),u,1),a=r?i.plus(s):i.minus(s),i=Gn(s.times(l),new t(e++*e++),u,1),s=a.plus(i),s.d[c]!==void 0){for(o=c;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=i,i=s,s=o}return zt=!0,s.d.length=c+1,s}function iS(t,e){for(var n=t;--e;)n*=t;return n}function kK(t,e){var n,i=e.s<0,r=ja(t,t.precision,1),o=r.times(.5);if(e=e.abs(),e.lte(o))return Zl=i?4:1,e;if(n=e.divToInt(r),n.isZero())Zl=i?3:2;else{if(e=e.minus(n.times(r)),e.lte(o))return Zl=HB(n)?i?2:3:i?4:1,e;Zl=HB(n)?i?1:4:i?3:2}return e.minus(r).abs()}function bM(t,e,n,i){var r,o,s,a,l,u,c,d,f,h=t.constructor,m=n!==void 0;if(m?(No(n,1,jc),i===void 0?i=h.rounding:No(i,0,8)):(n=h.precision,i=h.rounding),!t.isFinite())c=SK(t);else{for(c=hl(t),s=c.indexOf("."),m?(r=2,e==16?n=n*4-3:e==8&&(n=n*3-2)):r=e,s>=0&&(c=c.replace(".",""),f=new h(1),f.e=c.length-s,f.d=Kw(hl(f),10,r),f.e=f.d.length),d=Kw(c,10,r),o=l=d.length;d[--l]==0;)d.pop();if(!d[0])c=m?"0p+0":"0";else{if(s<0?o--:(t=new h(t),t.d=d,t.e=o,t=Gn(t,f,n,i,0,r),d=t.d,o=t.e,u=gK),s=d[n],a=r/2,u=u||d[n+1]!==void 0,u=i<4?(s!==void 0||u)&&(i===0||i===(t.s<0?3:2)):s>a||s===a&&(i===4||u||i===6&&d[n-1]&1||i===(t.s<0?8:7)),d.length=n,u)for(;++d[--n]>r-1;)d[n]=0,n||(++o,d.unshift(1));for(l=d.length;!d[l-1];--l);for(s=0,c="";s1)if(e==16||e==8){for(s=e==16?4:3,--l;l%s;l++)c+="0";for(d=Kw(c,r,e),l=d.length;!d[l-1];--l);for(s=1,c="1.";sl)for(o-=l;o--;)c+="0";else oe)return t.length=e,!0}function $Ae(t){return new this(t).abs()}function zAe(t){return new this(t).acos()}function HAe(t){return new this(t).acosh()}function UAe(t,e){return new this(t).plus(e)}function WAe(t){return new this(t).asin()}function qAe(t){return new this(t).asinh()}function jAe(t){return new this(t).atan()}function KAe(t){return new this(t).atanh()}function GAe(t,e){t=new this(t),e=new this(e);var n,i=this.precision,r=this.rounding,o=i+4;return!t.s||!e.s?n=new this(NaN):!t.d&&!e.d?(n=ja(this,o,1).times(e.s>0?.25:.75),n.s=t.s):!e.d||t.isZero()?(n=e.s<0?ja(this,i,r):new this(0),n.s=t.s):!t.d||e.isZero()?(n=ja(this,o,1).times(.5),n.s=t.s):e.s<0?(this.precision=o,this.rounding=1,n=this.atan(Gn(t,e,o,1)),e=ja(this,o,1),this.precision=i,this.rounding=r,n=t.s<0?n.minus(e):n.plus(e)):n=this.atan(Gn(t,e,o,1)),n}function YAe(t){return new this(t).cbrt()}function XAe(t){return Tt(t=new this(t),t.e+1,2)}function JAe(t,e,n){return new this(t).clamp(e,n)}function ZAe(t){if(!t||typeof t!="object")throw Error(tS+"Object expected");var e,n,i,r=t.defaults===!0,o=["precision",1,jc,"rounding",0,8,"toExpNeg",-qh,0,"toExpPos",0,qh,"maxE",0,qh,"minE",-qh,0,"modulo",0,9];for(e=0;e=o[e+1]&&i<=o[e+2])this[n]=i;else throw Error(Pc+n+": "+i);if(n="crypto",r&&(this[n]=cA[n]),(i=t[n])!==void 0)if(i===!0||i===!1||i===0||i===1)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(vK);else this[n]=!1;else throw Error(Pc+n+": "+i);return this}function QAe(t){return new this(t).cos()}function ePe(t){return new this(t).cosh()}function TK(t){var e,n,i;function r(o){var s,a,l,u=this;if(!(u instanceof r))return new r(o);if(u.constructor=r,WB(o)){u.s=o.s,zt?!o.d||o.e>r.maxE?(u.e=NaN,u.d=null):o.e=10;a/=10)s++;zt?s>r.maxE?(u.e=NaN,u.d=null):s=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=r%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(i*=4);o=214e7?crypto.randomBytes(4).copy(e,o):(a.push(r%1e7),o+=4);o=i/4}else throw Error(vK);else for(;o=10;r/=10)i++;i{e=e.plus(n)}),e.toString()},minus(...t){let e=new hc(t.shift());return t.forEach(n=>{e=e.minus(n)}),e.toString()},times(...t){let e=new hc(t.shift());return t.forEach(n=>{e=e.times(n)}),e.toString()},div(...t){let e=new hc(t.shift());return t.forEach(n=>{e=e.div(n)}),e.toString()}},TPe=le({props:{prefixIcon:{type:Object},suffixIcon:{type:Object},modelValue:{type:String,default:""},clearable:Boolean,placeholder:String,unsigned:{type:Boolean,default:!0},multiplier:{type:Number,default:1}},emits:["update:modelValue","clear","blur"],setup(t,e){const n=H(null),i=c=>c==null||typeof c=="string"&&c.trim()===""?"":qB.times(c,t.multiplier),r=c=>c==null||c.trim()===""||c==="-"?"":qB.div(c,t.multiplier),o=H(i(t.modelValue)),s=M(()=>!t.unsigned),a=c=>{let d=c.replace(/[^\d.\-]/g,"");if(s.value?d.lastIndexOf("-")>0&&(d=d[0]+d.substring(1).replace(/\-/g,"")):d=d.replace(/\-/g,""),(d.match(/\./g)||[]).length>1){const m=d.indexOf(".")+1;d=d.substring(0,m)+d.substring(m).replace(/\./g,"")}d.indexOf(".")===0&&(d=s.value&&d.startsWith("-")?"-0.":"0.");const h=d.indexOf(".");return h>-1&&d.indexOf("-",h)>-1&&(d=d.substring(0,h+1)+d.substring(h+1).replace(/\-/g,"")),d},l=()=>{let c=o.value;if(c==null)return;if(c=a(String(c)),o.value=c,c===""||c==="-"){e.emit("update:modelValue","");return}const d=r(c);Number(d)!==Number(t.modelValue)&&e.emit("update:modelValue",d)},u=()=>{const c=o.value;if(c===""||c==="-"||c===void 0){o.value="",e.emit("update:modelValue",""),e.emit("blur");return}e.emit("blur")};return Se(()=>t.modelValue,c=>{const d=i(c);o.value!==d&&(o.value=d)}),()=>L(cr,{ref:n,type:"text",clearable:t.clearable,prefixIcon:t.prefixIcon,suffixIcon:t.suffixIcon,placeholder:t.placeholder,inputmode:"decimal",modelValue:o.value,"onUpdate:modelValue":c=>o.value=c,onInput:l,onBlur:u,onChange:l,onClear:()=>{e.emit("update:modelValue",""),e.emit("clear")}},null)}}),EPe=le({props:{modelValue:{type:String,default:""},width:Number,accept:{type:Array,default(){return["*/*"]}},errMessage:String,disabled:Boolean,listType:{type:String,default:"picture-card"},limit:{type:Number,default:1},limitSize:{type:Number,default:1024},onUpload:Function},emits:["update:modelValue"],setup(t,e){const n=H(),i=M(()=>t.width?{width:"100%"}:{width:t.width+"px"}),r=H("");return()=>L(xPe,{ref:n,modelValue:t.modelValue,"onUpdate:modelValue":(...o)=>{e.emit("update:modelValue",...o)},style:i.value,limit:t.limit,accept:t.accept.join(","),disabled:t.disabled,listType:t.listType,errMessage:r.value,httpRequest:o=>{if(r.value="",o.file.size/1024>t.limitSize){r.value=`大小不能超过${t.limitSize}KB,请重新上传`,o.onError(new F2("limit",200,"post",""));return}const l=d=>{o.onSuccess(d)},u=d=>{r.value=d,o.onError(new F2(d,200,"post",""))},c=(d,f)=>{const h=new ProgressEvent("upload",{lengthComputable:!1,loaded:f,total:d});h.percent=f,o.onProgress(h)};t.onUpload?.call(this,{success:l,error:u,progress:c,file:o.file})},exceed:(o,s)=>{r.value=`文件数量已达${t.limit}个,想继续上传请先删除旧文件`}},null)}}),xPe=le({props:{accept:String,errMessage:String,disabled:Boolean,listType:String,limit:Number,httpRequest:Function,exceed:Function,modelValue:{type:String,default:""}},emits:["update:modelValue"],setup(t,e){const n=H(t.errMessage),i=H([]),r=M(()=>i.value.map(u=>u.response?u.response:u.url).join(","));e.expose({isUploadEnd:()=>!i.value.find(c=>c.status!="success")}),Se(()=>t.errMessage,()=>{n.value=t.errMessage}),Se(()=>t.modelValue,()=>{if(n.value="",!t.modelValue){i.value=[];return}t.modelValue!=r.value&&(i.value=t.modelValue.split(",").map(u=>({name:u,url:u})))},{immediate:!0});const o=()=>{Ye(()=>{e.emit("update:modelValue",r.value)})},s=(u,c)=>{!c.url&&u&&(c.url=typeof u=="string"?u:u.url||u.data?.url||u.data),o()},a=H(!1),l=H();return()=>L(lSe,{"file-list":i.value,"onUpdate:file-list":u=>i.value=u,limit:t.limit,accept:t.accept,disabled:t.disabled,"list-type":t.listType,action:"upload","on-success":s,"on-remove":o,"http-request":t.httpRequest,"on-exceed":t.exceed,onPreview:u=>{l.value=[u.url],a.value=!0}},{default(){return L(Hi,{type:"primary"},{default:()=>[dt("Click to upload")]})},tip:()=>L("div",{class:"el-upload__tip"},[L(V2,{class:"mx-1",type:"warning"},{default:()=>[dt("只能上传"),t.accept,dt("格式文件  ")]}),Vt(L(V2,{class:"mx-1",type:"danger"},{default:()=>[n.value]}),[[On,n.value]]),a.value&&L(lq,{"url-list":l.value,"show-progress":!0,onClose:()=>{a.value=!1}},null)])})}}),APe="_wrapper_vf2oh_1",jB={wrapper:APe};new Array(256).fill("").map((t,e)=>("0"+e.toString(16)).slice(-2));function PPe(t,e){const n=t.extraPlugins||[];return{...t,extraPlugins:[...n,...e.filter(i=>!n.includes(i))]}}function EK(t){return!!t&&/^\d+\.\d+\.\d+/.test(t)}function xK(t){return t?["nightly","alpha","internal","nightly-","staging"].some(e=>t.includes(e)):!1}function IPe(t){return EK(t)||xK(t)}function RPe(t){if(!EK(t))throw new Error(`Invalid semantic version: ${t||""}.`);const[e,n,i]=t.split(".");return{major:Number.parseInt(e,10),minor:Number.parseInt(n,10),patch:Number.parseInt(i,10)}}function MPe(t){if(xK(t))return 3;const{major:e}=RPe(t);switch(!0){case e>=44:return 3;case e>=38:return 2;default:return 1}}function OPe(){const{CKEDITOR_VERSION:t,CKEDITOR:e}=window;return IPe(t)?{source:e?"cdn":"npm",version:t}:null}function LPe(){const t=OPe();return t?MPe(t.version):null}function AK(t,e){switch(e||=LPe()||void 0,e){case 1:case 2:return t===void 0;case 3:return t==="GPL";default:return!1}}function DPe(t,e){return function(i){AK(i.config.get("licenseKey"))||i.on("collectUsageData",(r,{setUsageData:o})=>{o(`integration.${t}`,e)})}}const NPe=DPe("vue",{version:"7.3.1",frameworkVersion:LI});function BPe(t){return AK(t.licenseKey)?t:PPe(t,[NPe])}const _T="Lock from Vue integration (@ckeditor/ckeditor5-vue)",VPe=300,FPe=le({name:"CKEditor",__name:"ckeditor",props:o5({editor:{},config:{default:()=>({})},tagName:{default:"div"},disabled:{type:Boolean,default:!1},disableTwoWayDataBinding:{type:Boolean,default:!1}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:o5(["ready","destroy","blur","focus","input","update:modelValue"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const i=_ie(t,"modelValue"),r=t,o=n,s=H(),a=H(),l=H();e({instance:a,lastEditorData:l}),Se(i,d=>{a.value&&d!==l.value&&a.value.data.set(d)}),Se(()=>r.disabled,d=>{d?a.value.enableReadOnlyMode(_T):a.value.disableReadOnlyMode(_T)});function u(){const d=window.CKEDITOR_VERSION;if(!d)return console.warn('Cannot find the "CKEDITOR_VERSION" in the "window" scope.');const[f]=d.split(".").map(Number);f>=42||d.startsWith("0.0.0")||console.warn("The component requires using CKEditor 5 in version 42+ or nightly build.")}function c(d){const f=ul(h=>{if(r.disableTwoWayDataBinding)return;const m=l.value=d.data.get();o("update:modelValue",m,h,d),o("input",m,h,d)},VPe,{leading:!0});d.model.document.on("change:data",f),d.editing.view.document.on("focus",h=>{o("focus",h,d)}),d.editing.view.document.on("blur",h=>{o("blur",h,d)})}return u(),Pt(()=>{const d=BPe(Object.assign({},r.config));i.value&&(d.initialData=i.value),r.editor.create(s.value,d).then(f=>{a.value=ca(f),c(f),i.value!==d.initialData&&f.data.set(i.value),r.disabled&&f.enableReadOnlyMode(_T),o("ready",f)}).catch(f=>{console.error(f)})}),Sn(()=>{a.value&&(a.value.destroy(),a.value=void 0),o("destroy")}),(d,f)=>(B(),_e(Gt(t.tagName),{ref_key:"element",ref:s},null,512))}});if(!LI.startsWith("3."))throw new Error("The CKEditor plugin works only with Vue 3+. For more information, please refer to https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/vuejs-v3.html");function $Pe(t){return Number.isSafeInteger(t)&&t>=0}function zPe(t){return t!=null&&typeof t!="function"&&$Pe(t.length)}function PK(t){return t}function Qv(t){return t==="__proto__"}function IK(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return t.includes(".")||t.includes("[")||t.includes("]")}}function yM(t){return typeof t=="string"||typeof t=="symbol"?t:Object.is(t?.valueOf?.(),-0)?"-0":String(t)}function wM(t){const e=[],n=t.length;if(n===0)return e;let i=0,r="",o="",s=!1;for(t.charCodeAt(0)===46&&(e.push(""),i++);i0?hA(t,{...e},n,i):eb(t,e);default:return so(t)?typeof e=="string"?e==="":!0:eb(t,e)}}function qPe(t,e,n,i){if(e==null)return!0;if(Array.isArray(e))return RK(t,e,n,i);if(e instanceof Map)return jPe(t,e,n,i);if(e instanceof Set)return KPe(t,e,n,i);const r=Object.keys(e);if(t==null)return r.length===0;if(r.length===0)return!0;if(i&&i.has(e))return i.get(e)===t;i&&i.set(e,t);try{for(let o=0;o{})}function i1(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Wm(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const rS="[object RegExp]",qm="[object String]",l0="[object Number]",u0="[object Boolean]",jm="[object Arguments]",oS="[object Symbol]",sS="[object Date]",aS="[object Map]",lS="[object Set]",CM="[object Array]",GPe="[object Function]",uS="[object ArrayBuffer]",Xp="[object Object]",YPe="[object Error]",cS="[object DataView]",SM="[object Uint8Array]",kM="[object Uint8ClampedArray]",TM="[object Uint16Array]",EM="[object Uint32Array]",XPe="[object BigUint64Array]",xM="[object Int8Array]",AM="[object Int16Array]",PM="[object Int32Array]",JPe="[object BigInt64Array]",IM="[object Float32Array]",RM="[object Float64Array]";function MM(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ZPe(t,e){return Yd(t,void 0,t,new Map,e)}function Yd(t,e,n,i=new Map,r=void 0){const o=r?.(t,e,n,i);if(o!=null)return o;if(a0(t))return t;if(i.has(t))return i.get(t);if(Array.isArray(t)){const s=new Array(t.length);i.set(t,s);for(let a=0;a_M(e,t)}function dS(t,e){return ZPe(t,(n,i,r,o)=>{const s=e?.(n,i,r,o);if(s!=null)return s;if(typeof t=="object")switch(Object.prototype.toString.call(t)){case l0:case qm:case u0:{const a=new t.constructor(t?.valueOf());return Fd(a,t),a}case jm:{const a={};return Fd(a,t),a.length=t.length,a[Symbol.iterator]=t[Symbol.iterator],a}default:return}})}function Bo(t){return dS(t)}const nIe=/^(?:0|[1-9]\d*)$/;function MK(t,e=Number.MAX_SAFE_INTEGER){switch(typeof t){case"number":return Number.isInteger(t)&&t>=0&&t{const i=t[e];(!(Object.hasOwn(t,e)&&eb(i,n))||n===void 0&&!(e in t))&&(t[e]=n)};function mIe(t,e,n,i){if(t==null&&!so(t))return t;const r=dIe(e,t)?[e]:Array.isArray(e)?e:typeof e=="string"?wM(e):[e];let o=t;for(let s=0;sn,()=>{})}function gIe(t,e,{signal:n,edges:i}={}){let r,o=null;const s=i!=null&&i.includes("leading"),a=i==null||i.includes("trailing"),l=()=>{o!==null&&(t.apply(r,o),r=void 0,o=null)},u=()=>{a&&l(),h()};let c=null;const d=()=>{c!=null&&clearTimeout(c),c=setTimeout(()=>{c=null,u()},e)},f=()=>{c!==null&&(clearTimeout(c),c=null)},h=()=>{f(),r=void 0,o=null},m=()=>{f(),l()},g=function(...v){if(n?.aborted)return;r=this,o=v;const p=c==null;d(),s&&p&&l()};return g.schedule=d,g.cancel=h,g.flush=m,n?.addEventListener("abort",h,{once:!0}),g}function ml(t,e=0,n={}){typeof n!="object"&&(n={});const{leading:i=!1,trailing:r=!0,maxWait:o}=n,s=Array(2);i&&(s[0]="leading"),r&&(s[1]="trailing");let a,l=null;const u=gIe(function(...f){a=t.apply(this,f),l=null},e,{edges:s}),c=function(...f){return o!=null&&(l===null&&(l=Date.now()),Date.now()-l>=o)?(a=t.apply(this,f),l=Date.now(),u.cancel(),u.schedule(),a):(u.apply(this,f),a)},d=()=>(u.flush(),a);return c.cancel=u.cancel,c.flush=d,c}function Km(t,e=0,n={}){typeof n!="object"&&(n={});const{leading:i=!0,trailing:r=!0}=n;return ml(t,e,{leading:i,trailing:r,maxWait:e})}function OM(t){if(t==null)return"";if(typeof t=="string")return t;if(Array.isArray(t))return t.map(OM).join(",");const e=String(t);return e==="0"&&Object.is(Number(t),-0)?"-0":e}function GB(t){if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)==="[object Object]":!1}function DK(t,e,n){return yp(t,e,void 0,void 0,void 0,void 0,n)}function yp(t,e,n,i,r,o,s){const a=s(t,e,n,i,r,o);if(a!==void 0)return a;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return t===e;case"number":return t===e||Object.is(t,e);case"function":return t===e;case"object":return Jp(t,e,o,s)}return Jp(t,e,o,s)}function Jp(t,e,n,i){if(Object.is(t,e))return!0;let r=Wm(t),o=Wm(e);if(r===jm&&(r=Xp),o===jm&&(o=Xp),r!==o)return!1;switch(r){case qm:return t.toString()===e.toString();case l0:{const l=t.valueOf(),u=e.valueOf();return eb(l,u)}case u0:case sS:case oS:return Object.is(t.valueOf(),e.valueOf());case rS:return t.source===e.source&&t.flags===e.flags;case GPe:return t===e}n=n??new Map;const s=n.get(t),a=n.get(e);if(s!=null&&a!=null)return s===e;n.set(t,e),n.set(e,t);try{switch(r){case aS:{if(t.size!==e.size)return!1;for(const[l,u]of t.entries())if(!e.has(l)||!yp(u,e.get(l),l,t,e,n,i))return!1;return!0}case lS:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),u=Array.from(e.values());for(let c=0;cyp(d,h,void 0,t,e,n,i));if(f===-1)return!1;u.splice(f,1)}return!0}case CM:case SM:case kM:case TM:case EM:case XPe:case xM:case AM:case PM:case JPe:case IM:case RM:{if(typeof Buffer<"u"&&Buffer.isBuffer(t)!==Buffer.isBuffer(e)||t.length!==e.length)return!1;for(let l=0;ln!=="constructor")}function _Ie(t){const e=bIe(t.length,i=>`${i}`),n=new Set(e);return pIe(t)&&(n.add("offset"),n.add("parent")),LM(t)&&(n.add("buffer"),n.add("byteLength"),n.add("byteOffset")),[...e,...o1(t).filter(i=>!n.has(i))]}function BK(t,...e){for(let n=0;n0&&typeof t[0]=="string"&&Object.hasOwn(t,"index")&&(i.index=t.index,i.input=t.input),i}if(LM(t)){const i=t,r=i.constructor;return new r(i.buffer,i.byteOffset,i.length)}if(e===uS)return new ArrayBuffer(t.byteLength);if(e===cS){const i=t,r=i.buffer,o=i.byteOffset,s=i.byteLength,a=new ArrayBuffer(s),l=new Uint8Array(r,o,s);return new Uint8Array(a).set(l),new DataView(a)}if(e===u0||e===l0||e===qm){const i=t.constructor,r=new i(t.valueOf());return e===qm?EIe(r,t):CT(r,t),r}if(e===sS)return new Date(Number(t));if(e===rS){const i=t,r=new RegExp(i.source,i.flags);return r.lastIndex=i.lastIndex,r}if(e===oS)return Object(Symbol.prototype.valueOf.call(t));if(e===aS){const i=t,r=new Map;return i.forEach((o,s)=>{r.set(s,o)}),r}if(e===lS){const i=t,r=new Set;return i.forEach(o=>{r.add(o)}),r}if(e===jm){const i=t,r={};return CT(r,i),r.length=i.length,r[Symbol.iterator]=i[Symbol.iterator],r}const n={};return xIe(n,t),CT(n,t),TIe(n,t),n}function kIe(t){switch(Wm(t)){case jm:case CM:case uS:case cS:case u0:case sS:case IM:case RM:case xM:case AM:case PM:case aS:case l0:case Xp:case rS:case lS:case qm:case oS:case SM:case kM:case TM:case EM:return!0;default:return!1}}function CT(t,e){for(const n in e)Object.hasOwn(e,n)&&(t[n]=e[n])}function TIe(t,e){const n=Object.getOwnPropertySymbols(e);for(let i=0;i=n)&&(t[i]=e[i])}function xIe(t,e){const n=Object.getPrototypeOf(e);n!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,n)}function Wa(t){if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!Object.getOwnPropertyDescriptor(t,Symbol.toStringTag)?.writable?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function AIe(t,e){const n={},i=Object.keys(t);for(let r=0;r{if(++n>=t)return e(...i)}}function pA(t,e,n){return typeof n!="function"&&(n=()=>{}),DK(t,e,(...i)=>{const r=n(...i);if(r!==void 0)return!!r;if(t instanceof Map&&e instanceof Map||t instanceof Set&&e instanceof Set)return pA(Array.from(t),Array.from(e),YB(2,n))})}function MIe(t){return t.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}function OIe(t){return MIe(OM(t))}function LIe(t){return t.substring(0,1).toUpperCase()+t.substring(1)}function DIe(t){return LIe(OM(t))}let Qe;try{Qe={window,document}}catch{Qe={window:{},document:{}}}function NIe(){try{return navigator.userAgent.toLowerCase()}catch{return""}}const od=NIe(),vt={isMac:VK(od),isWindows:BIe(od),isGecko:VIe(od),isSafari:FIe(od),isiOS:$Ie(od),isAndroid:zIe(od),isBlink:HIe(od),get isMediaForcedColors(){return WIe()},features:{isRegExpUnicodePropertySupported:UIe()}};function VK(t){return t.indexOf("macintosh")>-1}function BIe(t){return t.indexOf("windows")>-1}function VIe(t){return!!t.match(/gecko\/\d+/)}function FIe(t){return t.indexOf(" applewebkit/")>-1&&t.indexOf("chrome")===-1}function $Ie(t){return!!t.match(/iphone|ipad/i)||VK(t)&&navigator.maxTouchPoints>0}function zIe(t){return t.indexOf("android")>-1}function HIe(t){return t.indexOf("chrome/")>-1&&t.indexOf("edge/")<0}function UIe(){let t=!1;try{t="ć".search(new RegExp("[\\p{L}]","u"))===0}catch{}return t}function WIe(){return Qe.window.matchMedia?Qe.window.matchMedia("(forced-colors: active)").matches:!1}function FK(t,e,n,i){n=n||function(l,u){return l===u};const r=Array.isArray(t)?t:Array.prototype.slice.call(t),o=Array.isArray(e)?e:Array.prototype.slice.call(e),s=qIe(r,o,n);return i?KIe(s,o.length):jIe(o,s)}function qIe(t,e,n){const i=XB(t,e,n);if(i===-1)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const r=JB(t,i),o=JB(e,i),s=XB(r,o,n),a=t.length-s,l=e.length-s;return{firstIndex:i,lastIndexOld:a,lastIndexNew:l}}function XB(t,e,n){for(let i=0;i0&&n.push({index:i,type:"insert",values:t.slice(i,o)}),r-i>0&&n.push({index:i+(o-i),type:"delete",howMany:r-i}),n}function KIe(t,e){const{firstIndex:n,lastIndexOld:i,lastIndexNew:r}=t;if(n===-1)return Array(e).fill("equal");let o=[];return n>0&&(o=o.concat(Array(n).fill("equal"))),r-n>0&&(o=o.concat(Array(r-n).fill("insert"))),i-n>0&&(o=o.concat(Array(i-n).fill("delete"))),r200||r>200||i+r>300)return fm.fastDiff(t,e,n,!0);let o,s;if(rp?-1:1;c[g+b]&&(c[g]=c[g+b].slice(0)),c[g]||(c[g]=[]),c[g].push(v>p?o:s);let y=Math.max(v,p),_=y-g;for(;_u;m--)d[m]=f(m);d[u]=f(u),h++}while(d[u]!==l);return c[u].slice(1)}fm.fastDiff=FK;function ZB(){return function t(){t.called=!0}}class pu{source;name;path;stop;off;return;constructor(e,n){this.source=e,this.name=n,this.path=[],this.stop=ZB(),this.off=ZB()}}const xr=new Array(256).fill("").map((t,e)=>("0"+e.toString(16)).slice(-2));function Ur(){const[t,e,n,i]=crypto.getRandomValues(new Uint32Array(4));return"e"+xr[t>>0&255]+xr[t>>8&255]+xr[t>>16&255]+xr[t>>24&255]+xr[e>>0&255]+xr[e>>8&255]+xr[e>>16&255]+xr[e>>24&255]+xr[n>>0&255]+xr[n>>8&255]+xr[n>>16&255]+xr[n>>24&255]+xr[i>>0&255]+xr[i>>8&255]+xr[i>>16&255]+xr[i>>24&255]}const ou={get(t="normal"){return typeof t!="number"?this[t]||this.normal:t},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function $K(t,e){const n=ou.get(e.priority);let i=0,r=t.length;for(;i>1;ou.get(t[o].priority){if(typeof u=="object"&&u!==null){if(i.has(u))return`[object ${u.constructor.name}]`;i.add(u)}return u})}`:"",s=zK(t),a=n?` +Original error: ${n.name}: ${n.message}`:"";return t+o+s+a}function HK(t,e){const n=zK(t);return e?[t,e,n]:[t,n]}const JIe="47.5.0",ZIe=new Date(2026,1,11);if(globalThis.CKEDITOR_VERSION)throw new oe("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION=JIe;const Nh=Symbol("listeningTo"),vA=Symbol("emitterId"),Rl=Symbol("delegations"),QIe=Fn(Object);function Fn(t){if(!t)return QIe;class e extends t{on(i,r,o){this.listenTo(this,i,r,o)}once(i,r,o){let s=!1;const a=(l,...u)=>{s||(s=!0,l.off(),r.call(this,l,...u))};this.listenTo(this,i,a,o)}off(i,r){this.stopListening(this,i,r)}listenTo(i,r,o,s={}){let a,l;this[Nh]||(this[Nh]={});const u=this[Nh];ST(i)||UK(i);const c=ST(i);(a=u[c])||(a=u[c]={emitter:i,callbacks:{}}),(l=a.callbacks[r])||(l=a.callbacks[r]=[]),l.push(o),rRe(this,i,r,o,s)}stopListening(i,r,o){const s=this[Nh];let a=i&&ST(i);const l=s&&a?s[a]:void 0,u=l&&r?l.callbacks[r]:void 0;if(!(!s||i&&!l||r&&!u))if(o)kT(this,i,r,o),u.indexOf(o)!==-1&&(u.length===1?delete l.callbacks[r]:kT(this,i,r,o));else if(u){for(;o=u.pop();)kT(this,i,r,o);delete l.callbacks[r]}else if(l){for(r in l.callbacks)this.stopListening(i,r);delete s[a]}else{for(a in s)this.stopListening(s[a].emitter);delete this[Nh]}}fire(i,...r){try{const o=i instanceof pu?i:new pu(this,i),s=o.name;let a=iRe(this,s);if(o.path.push(this),a){a=a.slice();for(let u=0;u{this[Rl]||(this[Rl]=new Map),i.forEach(s=>{const a=this[Rl].get(s);a?a.set(r,o):this[Rl].set(s,new Map([[r,o]]))})}}}stopDelegating(i,r){if(this[Rl])if(!i)this[Rl].clear();else if(!r)this[Rl].delete(i);else{const o=this[Rl].get(i);o&&o.delete(r)}}_addEventListener(i,r,o){nRe(this,i);const s=bA(this,i),a=ou.get(o.priority),l={callback:r,priority:a};for(const u of s)$K(u,l)}_removeEventListener(i,r){const o=bA(this,i);for(const s of o)for(let a=0;a-1?n.substring(0,r):""}while(n);return null}function QB(t,e,n){for(let[i,r]of t){r?typeof r=="function"&&(r=r(e.name)):r=e.name;const o=new pu(e.source,r);o.path=[...e.path],i.fire(o,...n)}}function rRe(t,e,n,i,r){e._addEventListener?e._addEventListener(n,i,r):t._addEventListener.call(e,n,i,r)}function kT(t,e,n,i){e._removeEventListener?e._removeEventListener(n,i):t._removeEventListener.call(e,n,i)}const Zp=Symbol("observableProperties"),tb=Symbol("boundObservables"),Qp=Symbol("boundProperties"),sd=Symbol("decoratedMethods"),e4=Symbol("decoratedOriginal"),oRe=Ln(Fn());function Ln(t){if(!t)return oRe;class e extends t{set(i,r){if(so(i)){Object.keys(i).forEach(s=>{this.set(s,i[s])},this);return}TT(this);const o=this[Zp];if(i in this&&!o.has(i))throw new oe("observable-set-cannot-override",this);Object.defineProperty(this,i,{enumerable:!0,configurable:!0,get(){return o.get(i)},set(s){const a=o.get(i);let l=this.fire(`set:${i}`,i,s,a);l===void 0&&(l=s),(a!==l||!o.has(i))&&(o.set(i,l),this.fire(`change:${i}`,i,l,a))}}),this[i]=r}bind(...i){if(!i.length||!t4(i))throw new oe("observable-bind-wrong-properties",this);if(new Set(i).size!==i.length)throw new oe("observable-bind-duplicate-properties",this);TT(this);const r=this[Qp];i.forEach(s=>{if(r.has(s))throw new oe("observable-bind-rebind",this)});const o=new Map;return i.forEach(s=>{const a={property:s,to:[]};r.set(s,a),o.set(s,a)}),{to:sRe,toMany:aRe,_observable:this,_bindProperties:i,_to:[],_bindings:o}}unbind(...i){if(!this[Zp])return;const r=this[Qp],o=this[tb];if(i.length){if(!t4(i))throw new oe("observable-unbind-wrong-properties",this);i.forEach(s=>{const a=r.get(s);a&&(a.to.forEach(([l,u])=>{const c=o.get(l),d=c[u];d.delete(a),d.size||delete c[u],Object.keys(c).length||(o.delete(l),this.stopListening(l,"change"))}),r.delete(s))})}else o.forEach((s,a)=>{this.stopListening(a,"change")}),o.clear(),r.clear()}decorate(i){TT(this);const r=this[i];if(!r)throw new oe("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:i});this.on(i,(o,s)=>{o.return=r.apply(this,s)}),this[i]=function(...o){return this.fire(i,o)},this[i][e4]=r,this[sd]||(this[sd]=[]),this[sd].push(i)}stopListening(i,r,o){if(!i&&this[sd]){for(const s of this[sd])this[s]=this[s][e4];delete this[sd]}super.stopListening(i,r,o)}[Zp];[sd];[Qp];[tb]}return e}function TT(t){t[Zp]||(Object.defineProperty(t,Zp,{value:new Map}),Object.defineProperty(t,tb,{value:new Map}),Object.defineProperty(t,Qp,{value:new Map}))}function sRe(...t){const e=uRe(...t),n=Array.from(this._bindings.keys()),i=n.length;if(!e.callback&&e.to.length>1)throw new oe("observable-bind-to-no-callback",this);if(i>1&&e.callback)throw new oe("observable-bind-to-extra-callback",this);e.to.forEach(r=>{if(r.properties.length&&r.properties.length!==i)throw new oe("observable-bind-to-properties-length",this);r.properties.length||(r.properties=this._bindProperties)}),this._to=e.to,e.callback&&(this._bindings.get(n[0]).callback=e.callback),fRe(this._observable,this._to),dRe(this),this._bindProperties.forEach(r=>{qK(this._observable,r)})}function aRe(t,e,n){if(this._bindings.size>1)throw new oe("observable-bind-to-many-not-one-binding",this);this.to(...lRe(t,e),n)}function lRe(t,e){const n=t.map(i=>[i,e]);return Array.prototype.concat.apply([],n)}function t4(t){return t.every(e=>typeof e=="string")}function uRe(...t){if(!t.length)throw new oe("observable-bind-to-parse-error",null);const e={to:[]};let n;return typeof t[t.length-1]=="function"&&(e.callback=t.pop()),t.forEach(i=>{if(typeof i=="string")n.properties.push(i);else if(typeof i=="object")n={observable:i,properties:[]},e.to.push(n);else throw new oe("observable-bind-to-parse-error",null)}),e}function cRe(t,e,n,i){const r=t[tb],o=r.get(n),s=o||{};s[i]||(s[i]=new Set),s[i].add(e),o||r.set(n,s)}function dRe(t){let e;t._bindings.forEach((n,i)=>{t._to.forEach(r=>{e=r.properties[n.callback?0:t._bindProperties.indexOf(i)],n.to.push([r.observable,e]),cRe(t._observable,n,r.observable,e)})})}function qK(t,e){const i=t[Qp].get(e);let r;i.callback?r=i.callback.apply(t,i.to.map(o=>o[0][o[1]])):(r=i.to[0],r=r[0][r[1]]),Object.prototype.hasOwnProperty.call(t,e)?t[e]=r:t.set(e,r)}function fRe(t,e){e.forEach(n=>{const i=t[tb];let r;i.get(n.observable)||t.listenTo(n.observable,"change",(o,s)=>{r=i.get(n.observable)[s],r&&r.forEach(a=>{qK(t,a.property)})})})}class jK{_replacedElements;constructor(){this._replacedElements=[]}replace(e,n){this._replacedElements.push({element:e,newElement:n}),e.style.display="none",n&&e.parentNode.insertBefore(n,e.nextSibling)}restore(){this._replacedElements.forEach(({element:e,newElement:n})=>{e.style.display="",n&&n.remove()}),this._replacedElements=[]}}function yA(t){let e=0;for(const n of t)e++;return e}function ur(t,e){const n=Math.min(t.length,e.length);for(let i=0;i{this._setToTarget(e,r,n[r],i)})}}function n4(t){return dS(t,hRe)}function hRe(t){return Rc(t)||typeof t=="function"?t:void 0}function Mc(t){if(t){if(t.defaultView)return t instanceof t.defaultView.Document;if(t.ownerDocument&&t.ownerDocument.defaultView)return t instanceof t.ownerDocument.defaultView.Node}return!1}function a1(t){const e=Object.prototype.toString.apply(t);return e=="[object Window]"||e=="[object global]"}const mRe=zo(Fn());function zo(t){if(!t)return mRe;class e extends t{listenTo(i,r,o,s={}){if(Mc(i)||a1(i)||i instanceof Qe.window.EventTarget){const a={capture:!!s.useCapture,passive:!!s.usePassive},l=this._getProxyEmitter(i,a)||new gRe(i,a);this.listenTo(l,r,o,s)}else super.listenTo(i,r,o,s)}stopListening(i,r,o){if(Mc(i)||a1(i)||i instanceof Qe.window.EventTarget){const s=this._getAllProxyEmitters(i);for(const a of s)this.stopListening(a,r,o)}else super.stopListening(i,r,o)}_getProxyEmitter(i,r){return eRe(this,GK(i,r))}_getAllProxyEmitters(i){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map(r=>this._getProxyEmitter(i,r)).filter(r=>!!r)}}return e}class gRe extends Fn(){_domNode;_options;constructor(e,n){super(),UK(this,GK(e,n)),this._domNode=e,this._options=n}_domListeners;attach(e){if(this._domListeners&&this._domListeners[e])return;const n=this._createDomListener(e);this._domNode.addEventListener(e,n,this._options),this._domListeners||(this._domListeners={}),this._domListeners[e]=n}detach(e){let n;this._domListeners[e]&&(!(n=this._events[e])||!n.callbacks.length)&&this._domListeners[e].removeListener()}_addEventListener(e,n,i){this.attach(e),Fn().prototype._addEventListener.call(this,e,n,i)}_removeEventListener(e,n){Fn().prototype._removeEventListener.call(this,e,n),this.detach(e)}_createDomListener(e){const n=i=>{this.fire(e,i)};return n.removeListener=()=>{this._domNode.removeEventListener(e,n,this._options),delete this._domListeners[e]},n}}function pRe(t){return t["data-ck-expando"]||(t["data-ck-expando"]=Ur())}function GK(t,e){let n=pRe(t);for(const i of Object.keys(e).sort())e[i]&&(n+="-"+i);return n}function vRe(t){const e=[];let n=t;for(;n&&n.nodeType!=Node.DOCUMENT_NODE;)e.unshift(n),n=n.parentNode;return e}function bRe(t){return t instanceof HTMLTextAreaElement?t.value:t.innerHTML}function YK(t){const e=t.ownerDocument.defaultView.getComputedStyle(t);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}function XK(t){if(!t.target)return null;const e=t.target.ownerDocument,n=t.clientX,i=t.clientY;let r=null;return e.caretRangeFromPoint&&e.caretRangeFromPoint(n,i)?r=e.caretRangeFromPoint(n,i):t.rangeParent&&(r=e.createRange(),r.setStart(t.rangeParent,t.rangeOffset),r.collapse(!0)),r}function JK(t){return!t||!t.parentNode||t.offsetParent===Qe.document.body?null:t.offsetParent}function fi(t){return Object.prototype.toString.call(t)=="[object Text]"}function fS(t){return Object.prototype.toString.apply(t)=="[object Range]"}const ZK=["top","right","bottom","left","width","height"],yRe=new Set(["relative","absolute","fixed","sticky"]);let Wt=class Bl{top;right;bottom;left;width;height;_source;constructor(e){const n=fS(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),wA(e)||n)if(n){const i=Bl.getDomRangeRects(e);ey(this,Bl.getBoundingRect(i))}else ey(this,e.getBoundingClientRect());else if(a1(e)){const{innerWidth:i,innerHeight:r}=e;ey(this,{top:0,right:i,bottom:r,left:0,width:i,height:r})}else ey(this,e)}clone(){return new Bl(this)}moveTo(e,n){return this.top=n,this.right=e+this.width,this.bottom=n+this.height,this.left=e,this}moveBy(e,n){return this.top+=n,this.right+=e,this.left+=e,this.bottom+=n,this}getIntersection(e){const n={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),width:0,height:0};if(n.width=n.right-n.left,n.height=n.bottom-n.top,n.width<0||n.height<0)return null;{const i=new Bl(n);return i._source=this._source,i}}getIntersectionArea(e){const n=this.getIntersection(e);return n?n.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let n=this.clone();if(i4(e))return n;let i=e,r=e.parentNode||e.commonAncestorContainer,o;for(;r&&!i4(r);){const s=wRe(r)==="visible";if(r4(i)&&(o=i),s||o&&QK(o)==="absolute"&&!r4(r)){i=r,r=r.parentNode;continue}const a=new Bl(r),l=n.getIntersection(a);if(l)l.getArea(){for(const n of e){const i=Ni._getElementCallbacks(n.target);if(i)for(const r of i)r(n)}})}};function o4(t,e){t instanceof HTMLTextAreaElement&&(t.value=e),t.innerHTML=e}function gg(t){return e=>e+t}function jh(t){let e=0;for(;t.previousSibling;)t=t.previousSibling,e++;return e}function eG(t,e,n){t.insertBefore(n,t.childNodes[e]||null)}function ev(t){return t&&t.nodeType===Node.COMMENT_NODE}function CRe(t){try{Qe.document.createAttribute(t)}catch{return!1}return!0}function vu(t){return t?fi(t)?vu(t.parentElement):t.getClientRects?!!t.getClientRects().length:!1:!1}function BM({element:t,target:e,positions:n,limiter:i,fitInViewport:r,viewportOffsetConfig:o}){s1(e)&&(e=e()),s1(i)&&(i=i());const s=JK(t),a=tG(o),l=new Wt(t),u=s4(e,a);let c;if(!u||!a.getIntersection(u))return null;const d={targetRect:u,elementRect:l,positionedElementAncestor:s,viewportRect:a};if(!i&&!r)c=new nG(n[0],d);else{if(i){const f=s4(i,a);f&&(d.limiterRect=f)}c=SRe(n,d)}return c}function s4(t,e){const n=new Wt(t).getVisible();return n?n.getIntersection(e):null}function tG(t){t=Object.assign({top:0,bottom:0,left:0,right:0},t);const e=new Wt(Qe.window);return e.top+=t.top,e.height-=t.top,e.bottom-=t.bottom,e.height-=t.bottom,e.left+=t.left,e.right-=t.right,e.width-=t.left+t.right,e}function SRe(t,e){const{elementRect:n}=e,i=n.getArea(),r=t.map(a=>new nG(a,e)).filter(a=>!!a.name);let o=0,s=null;for(const a of r){const{limiterIntersectionArea:l,viewportIntersectionArea:u}=a;if(l===i)return a;const c=u**2+l**2;c>o&&(o=c,s=a)}return s}class nG{name;config;_positioningFunctionCoordinates;_options;_cachedRect;_cachedAbsoluteRect;constructor(e,n){const i=e(n.targetRect,n.elementRect,n.viewportRect,n.limiterRect);if(!i)return;const{left:r,top:o,name:s,config:a}=i;this.name=s,this.config=a,this._positioningFunctionCoordinates={left:r,top:o},this._options=n}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const e=this._options.limiterRect;return e?e.getIntersectionArea(this._rect):0}get viewportIntersectionArea(){return this._options.viewportRect.getIntersectionArea(this._rect)}get _rect(){return this._cachedRect?this._cachedRect:(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left,this._positioningFunctionCoordinates.top),this._cachedRect)}get _absoluteRect(){return this._cachedAbsoluteRect?this._cachedAbsoluteRect:(this._cachedAbsoluteRect=this._rect.toAbsoluteRect(),this._cachedAbsoluteRect)}}function a4(t){const e=t.parentNode;e&&e.removeChild(t)}function Xw(){const t=Qe.window.visualViewport;if(!t||!(vt.isiOS||vt.isSafari))return{left:0,top:0};const e=Math.max(Math.round(t.offsetLeft),0),n=Math.max(Math.round(t.offsetTop),0);return{left:e,top:n}}function kRe({target:t,viewportOffset:e=0,ancestorOffset:n=0,alignToTop:i,forceScroll:r}){const o=VM(t);let s=o,a=null;for(e=xRe(e);s;){let l;s==o?l=l4(t):l=l4(a),ERe({parent:l,getRect:()=>ET(t,s),alignToTop:i,ancestorOffset:n,forceScroll:r});let u=ET(t,s);const c=ET(l,s);if(u.height>c.height){const d=u.getIntersection(c);d&&(u=d)}if(TRe({window:s,rect:u,viewportOffset:e,alignToTop:i,forceScroll:r}),s.parent!=s){if(a=s.frameElement,s=s.parent,!a)return}else s=null}}function TRe({window:t,rect:e,alignToTop:n,forceScroll:i,viewportOffset:r}){const o=e.clone().moveBy(0,r.bottom),s=e.clone().moveBy(0,-r.top),a=new Wt(t).excludeScrollbarsAndBorders(),l=[s,o],u=n&&i,c=l.every(g=>a.contains(g));let{scrollX:d,scrollY:f}=t;const h=d,m=f;u?f-=a.top-e.top+r.top:c||(rG(s,a)?f-=a.top-e.top+r.top:iG(o,a)&&(n?f+=e.top-a.top-r.top:f+=e.bottom-a.bottom+r.bottom)),c||(oG(e,a)?d-=a.left-e.left+r.left:sG(e,a)&&(d+=e.right-a.right+r.right)),(d!=h||f!==m)&&t.scrollTo(d,f)}function ERe({parent:t,getRect:e,alignToTop:n,forceScroll:i,ancestorOffset:r=0,limiterElement:o}){const s=VM(t),a=n&&i;let l,u,c;const d=o||s.document.body;for(;t!=d;)u=e(),l=new Wt(t).excludeScrollbarsAndBorders(),c=l.contains(u),a?t.scrollTop-=l.top-u.top+r:c||(rG(u,l)?t.scrollTop-=l.top-u.top+r:iG(u,l)&&(n?t.scrollTop+=u.top-l.top-r:t.scrollTop+=u.bottom-l.bottom+r)),c||(oG(u,l)?t.scrollLeft-=l.left-u.left+r:sG(u,l)&&(t.scrollLeft+=u.right-l.right+r)),t=t.parentNode}function iG(t,e){return t.bottom>e.bottom}function rG(t,e){return t.tope.right}function VM(t){return fS(t)?t.startContainer.ownerDocument.defaultView:t.ownerDocument.defaultView}function l4(t){if(fS(t)){let e=t.commonAncestorContainer;return fi(e)&&(e=e.parentNode),e}else return t.parentNode}function ET(t,e){const n=VM(t),i=new Wt(t);if(n===e)return i;{let r=n;for(;r!=e;){const o=r.frameElement,s=new Wt(o).excludeScrollbarsAndBorders();i.moveBy(s.left,s.top),r=r.parent}}return i}function xRe(t){return typeof t=="number"?{top:t,bottom:t,left:t,right:t}:t}const ARe={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},PRe={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},u4={37:"←",38:"↑",39:"→",40:"↓",9:"⇥",33:"Page Up",34:"Page Down"},Yt=LRe(),IRe=Object.fromEntries(Object.entries(Yt).map(([t,e])=>{let n;return e in u4?n=u4[e]:n=t.charAt(0).toUpperCase()+t.slice(1),[e,n]}));function Gm(t){let e;if(typeof t=="string"){if(e=Yt[t.toLowerCase()],!e)throw new oe("keyboard-unknown-key",null,{key:t})}else e=t.keyCode+(t.altKey?Yt.alt:0)+(t.ctrlKey?Yt.ctrl:0)+(t.shiftKey?Yt.shift:0)+(t.metaKey?Yt.cmd:0);return e}function FM(t){return typeof t=="string"&&(t=DRe(t)),t.map(e=>typeof e=="string"?MRe(e):e).reduce((e,n)=>n+e,0)}function l1(t,e){let n=FM(t);const i=vt.isMac||vt.isiOS;return Object.entries(i?ARe:PRe).reduce((s,[a,l])=>((n&Yt[a])!=0&&(n&=~Yt[a],s+=l),s),"")+(n?IRe[n]:"")}function RRe(t){return t==Yt.arrowright||t==Yt.arrowleft||t==Yt.arrowup||t==Yt.arrowdown}function $M(t,e){const n=e==="ltr";switch(t){case Yt.arrowleft:return n?"left":"right";case Yt.arrowright:return n?"right":"left";case Yt.arrowup:return"up";case Yt.arrowdown:return"down"}}function MRe(t){if(t.endsWith("!"))return Gm(t.slice(0,-1));const e=Gm(t);return(vt.isMac||vt.isiOS)&&e==Yt.ctrl?Yt.cmd:e}function ORe(t,e){const n=$M(t,e);return n==="down"||n==="right"}function LRe(){const t={pageup:33,pagedown:34,end:35,home:36,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 n=String.fromCharCode(e);t[n.toLowerCase()]=e}for(let e=48;e<=57;e++)t[e-48]=e;for(let e=112;e<=123;e++)t["f"+(e-111)]=e;return Object.assign(t,{"'":222,",":108,"-":109,".":110,"/":111,";":186,"=":187,"[":219,"\\":220,"]":221,"`":223}),t}function DRe(t){return t.split("+").map(e=>e.trim())}const NRe=["ar","ara","dv","div","fa","per","fas","he","heb","ku","kur","ug","uig","ur","urd"];function c4(t){return NRe.includes(t)?"rtl":"ltr"}function li(t){return Array.isArray(t)?t:[t]}Qe.window.CKEDITOR_TRANSLATIONS||(Qe.window.CKEDITOR_TRANSLATIONS={});function BRe(t,e,n=1,i){if(typeof n!="number")throw new oe("translation-service-quantity-not-a-number",null,{quantity:n});const r=i||Qe.window.CKEDITOR_TRANSLATIONS,o=$Re(r);o===1&&(t=Object.keys(r)[0]);const s=e.id||e.string;if(o===0||!FRe(t,s,r))return n!==1?e.plural:e.string;const a=r[t].dictionary,l=r[t].getPluralForm||(d=>d===1?0:1),u=a[s];if(typeof u=="string")return u;const c=Number(l(n));return u[c]}function VRe(t){return Array.isArray(t)?t.reduce((e,n)=>DM(e,n)):t}function FRe(t,e,n){return!!n[t]&&!!n[t].dictionary[e]}function $Re(t){return Object.keys(t).length}class zRe{uiLanguage;uiLanguageDirection;contentLanguage;contentLanguageDirection;t;translations;constructor({uiLanguage:e="en",contentLanguage:n,translations:i}={}){this.uiLanguage=e,this.contentLanguage=n||this.uiLanguage,this.uiLanguageDirection=c4(this.uiLanguage),this.contentLanguageDirection=c4(this.contentLanguage),this.translations=VRe(i),this.t=(r,o)=>this._t(r,o)}_t(e,n=[]){n=li(n),typeof e=="string"&&(e={string:e});const r=!!e.plural?n[0]:1,o=BRe(this.uiLanguage,e,r,this.translations);return HRe(o,n)}}function HRe(t,e){return t.replace(/%(\d+)/g,(n,i)=>ithis._items.length||n<0)throw new oe("collection-add-item-invalid-index",this);let i=0;for(const r of e){const o=this._getItemIdBeforeAdding(r),s=n+i;this._items.splice(s,0,r),this._itemMap.set(o,r),this.fire("add",r,s),i++}return this.fire("change",{added:e,removed:[],index:n}),this}get(e){let n;if(typeof e=="string")n=this._itemMap.get(e);else if(typeof e=="number")n=this._items[e];else throw new oe("collection-get-invalid-arg",this);return n||null}has(e){if(typeof e=="string")return this._itemMap.has(e);{const n=this._idProperty,i=e[n];return i&&this._itemMap.has(i)}}getIndex(e){let n;return typeof e=="string"?n=this._itemMap.get(e):n=e,n?this._items.indexOf(n):-1}remove(e){const[n,i]=this._remove(e);return this.fire("change",{added:[],removed:[n],index:i}),n}map(e,n){return this._items.map(e,n)}forEach(e,n){this._items.forEach(e,n)}find(e,n){return this._items.find(e,n)}filter(e,n){return this._items.filter(e,n)}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 oe("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:n=>{this._setUpBindToBinding(i=>new n(i))},using:n=>{typeof n=="function"?this._setUpBindToBinding(n):this._setUpBindToBinding(i=>i[n])}}}_setUpBindToBinding(e){const n=this._bindToCollection,i=(r,o,s)=>{const a=n._bindToCollection==this,l=n._bindToInternalToExternalMap.get(o);if(a&&l)this._bindToExternalToInternalMap.set(o,l),this._bindToInternalToExternalMap.set(l,o);else{const u=e(o);if(!u){this._skippedIndexesFromExternal.push(s);return}let c=s;for(const d of this._skippedIndexesFromExternal)s>d&&c--;for(const d of n._skippedIndexesFromExternal)c>=d&&c++;this._bindToExternalToInternalMap.set(o,u),this._bindToInternalToExternalMap.set(u,o),this.add(u,c);for(let d=0;d{const a=this._bindToExternalToInternalMap.get(o);a&&this.remove(a),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((l,u)=>(su&&l.push(u),l),[])})}_getItemIdBeforeAdding(e){const n=this._idProperty;let i;if(n in e){if(i=e[n],typeof i!="string")throw new oe("collection-add-invalid-id",this);if(this.get(i))throw new oe("collection-add-item-already-exists",this)}else e[n]=i=Ur();return i}_remove(e){let n,i,r,o=!1;const s=this._idProperty;if(typeof e=="string"?(i=e,r=this._itemMap.get(i),o=!r,r&&(n=this._items.indexOf(r))):typeof e=="number"?(n=e,r=this._items[n],o=!r,r&&(i=r[s])):(r=e,i=r[s],n=this._items.indexOf(r),o=n==-1||!this._itemMap.get(i)),o)throw new oe("collection-remove-404",this);this._items.splice(n,1),this._itemMap.delete(i);const a=this._bindToInternalToExternalMap.get(r);return this._bindToInternalToExternalMap.delete(r),this._bindToExternalToInternalMap.delete(a),this.fire("remove",r,n),[r,n]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}function Mi(t){const e=t.next();return e.done?null:e.value}class wi extends zo(Ln()){_elements=new Set;_externalViews=new Set;_blurTimeout=null;constructor(){super(),this.set("isFocused",!1),this.set("focusedElement",null)}get elements(){return Array.from(this._elements.values())}get externalViews(){return Array.from(this._externalViews.values())}add(e){if(f4(e))this._addElement(e);else if(d4(e))this._addView(e);else{if(!e.element)throw new oe("focustracker-add-view-missing-element",{focusTracker:this,view:e});this._addElement(e.element)}}remove(e){f4(e)?this._removeElement(e):d4(e)?this._removeView(e):this._removeElement(e.element)}_addElement(e){if(this._elements.has(e))throw new oe("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",()=>{const n=this.externalViews.find(i=>URe(e,i));n?this._focus(n.element):this._focus(e)},{useCapture:!0}),this.listenTo(e,"blur",()=>{this._blur()},{useCapture:!0}),this._elements.add(e)}_removeElement(e){this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e)),e===this.focusedElement&&this._blur()}_addView(e){e.element&&this._addElement(e.element),this.listenTo(e.focusTracker,"change:focusedElement",()=>{e.focusTracker.focusedElement?e.element&&this._focus(e.element):this._blur()}),this._externalViews.add(e)}_removeView(e){e.element&&this._removeElement(e.element),this.stopListening(e.focusTracker),this._externalViews.delete(e)}destroy(){this.stopListening(),this._elements.clear(),this._externalViews.clear(),this.isFocused=!1,this.focusedElement=null}_focus(e){this._clearBlurTimeout(),this.focusedElement=e,this.isFocused=!0}_blur(){this.elements.find(i=>i.contains(document.activeElement))||this.externalViews.find(i=>i.focusTracker.isFocused&&!i.focusTracker._blurTimeout)||(this._clearBlurTimeout(),this._blurTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0))}_clearBlurTimeout(){clearTimeout(this._blurTimeout),this._blurTimeout=null}}function d4(t){return"focusTracker"in t&&t.focusTracker instanceof wi}function f4(t){return Rc(t)}function URe(t,e){return h4(t,e)?!0:!!e.focusTracker.externalViews.find(n=>h4(t,n))}function h4(t,e){return!!e.element&&e.element.contains(document.activeElement)&&t.contains(e.element)}class Qi{_listener;constructor(){this._listener=new(zo())}listenTo(e){this._listener.listenTo(e,"keydown",(n,i)=>{this._listener.fire("_keydown:"+Gm(i),i)})}set(e,n,i={}){const r=FM(e),o=i.priority;this._listener.listenTo(this._listener,"_keydown:"+r,(s,a)=>{i.filter&&!i.filter(a)||(n(a,()=>{a.preventDefault(),a.stopPropagation(),s.stop()}),s.return=!0)},{priority:o})}press(e){return!!this._listener.fire("_keydown:"+Gm(e),e)}stopListening(e){this._listener.stopListening(e)}destroy(){this.stopListening()}}function WRe(t){const e=new Map;for(const n in t)e.set(n,t[n]);return e}function gl(t){return us(t)?new Map(t):WRe(t)}function m4(t,e,n){const i=t.length,r=e.length;for(let o=i-1;o>=n;o--)t[o+r]=t[o];for(let o=0;ot(...r),e)}return i.cancel=()=>{clearTimeout(n)},i}function HM(t){try{if(!t.startsWith("ey"))return null;const e=atob(t.replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(e)}catch{return null}}function qRe(){const t=[];for(let e=0;e<256;e++){let n=e;for(let i=0;i<8;i++)n&1?n=3988292384^n>>>1:n=n>>>1;t[e]=n}return t}function jRe(t){const e=Array.isArray(t)?t:[t],n=qRe();let i=-1;const r=e.map(o=>Array.isArray(o)?o.join(""):String(o)).join("");for(let o=0;o>>8^n[(i^s)&255]}return i=(i^-1)>>>0,i.toString(16).padStart(8,"0")}function KRe(t){const e=[{name:"address",isVoid:!1},{name:"article",isVoid:!1},{name:"aside",isVoid:!1},{name:"blockquote",isVoid:!1},{name:"details",isVoid:!1},{name:"dialog",isVoid:!1},{name:"dd",isVoid:!1},{name:"div",isVoid:!1},{name:"dl",isVoid:!1},{name:"dt",isVoid:!1},{name:"fieldset",isVoid:!1},{name:"figcaption",isVoid:!1},{name:"figure",isVoid:!1},{name:"footer",isVoid:!1},{name:"form",isVoid:!1},{name:"h1",isVoid:!1},{name:"h2",isVoid:!1},{name:"h3",isVoid:!1},{name:"h4",isVoid:!1},{name:"h5",isVoid:!1},{name:"h6",isVoid:!1},{name:"header",isVoid:!1},{name:"hgroup",isVoid:!1},{name:"hr",isVoid:!0},{name:"li",isVoid:!1},{name:"main",isVoid:!1},{name:"nav",isVoid:!1},{name:"ol",isVoid:!1},{name:"p",isVoid:!1},{name:"section",isVoid:!1},{name:"table",isVoid:!1},{name:"tbody",isVoid:!1},{name:"td",isVoid:!1},{name:"th",isVoid:!1},{name:"thead",isVoid:!1},{name:"tr",isVoid:!1},{name:"ul",isVoid:!1}],n=e.map(s=>s.name).join("|"),i=t.replace(new RegExp(``,"g"),` +$& +`).replace(/]*>/g,`$& +`).split(` +`);let r=0,o=!1;return i.map(s=>(o=XRe(s,o),!s.length&&!o?"":GRe(s,e)?ty(s,r++):YRe(s,e)?ty(s,--r):o==="middle"||o==="last"?ty(s,0):ty(s,r))).join("").trimEnd()}function GRe(t,e){return e.some(n=>!(n.isVoid||!new RegExp(`<${n.name}( .*?)?>`).test(t)))}function YRe(t,e){return e.some(n=>new RegExp(``).test(t))}function ty(t,e,n=" "){return`${n.repeat(Math.max(0,e))}${t} +`}function XRe(t,e){const n=//.test(t),i=/<\/pre>/.test(t);return n&&i?!1:n?"first":i?"last":e==="first"||e==="middle"?"middle":!1}function JRe(t){return!!t&&t.length==1&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(t)}function ZRe(t){return!!t&&t.length==1&&/[\ud800-\udbff]/.test(t)}function QRe(t){return!!t&&t.length==1&&/[\udc00-\udfff]/.test(t)}function UM(t,e){return ZRe(t.charAt(e-1))&&QRe(t.charAt(e))}function WM(t,e){return JRe(t.charAt(e))}const eMe=tMe();function aG(t,e){const n=String(t).matchAll(eMe);return Array.from(n).some(i=>i.indexr.source).join("|")+")",i=`${e}|${n}(?:‍${n})*`;return new RegExp(i,"ug")}function g4(t){if(!t)return null;const e=nMe(t);return e?HM(e):null}function nMe(t){const e=t.split(".");return e.length!=3?null:e[1]}function iMe(t,e){return(t.removeFeatures||[]).includes(e)}const Fg=new WeakMap;let p4=!1;function qM({view:t,element:e,text:n,isDirectHost:i=!0,keepOnFocus:r=!1}){const o=t.document;Fg.has(o)||(Fg.set(o,new Map),o.registerPostFixer(a=>xT(Fg.get(o),a)),o.on("change:isComposing",()=>{t.change(a=>xT(Fg.get(o),a))},{priority:"high"})),e.is("editableElement")&&e.on("change:placeholder",(a,l,u)=>s(u)),e.placeholder?s(e.placeholder):n&&s(n),n&&lMe();function s(a){const l={text:a,isDirectHost:i,keepOnFocus:r,hostElement:i?e:null};Fg.get(o).set(e,l),t.change(u=>xT([[e,l]],u))}}function rMe(t,e){return e.hasClass("ck-placeholder")?!1:(t.addClass("ck-placeholder",e),!0)}function lG(t,e){return e.hasClass("ck-placeholder")?(t.removeClass("ck-placeholder",e),!0):!1}function oMe(t,e){if(!t.isAttached()||sMe(t))return!1;const n=t.document,r=n.selection.anchor;return n.isComposing&&r&&r.parent===t?!1:e||!n.isFocused?!0:!!r&&r.parent!==t}function sMe(t){for(const e of t.getChildren())if(!e.is("uiElement"))return!0;return!1}function xT(t,e){const n=[];let i=!1;for(const[r,o]of t)o.isDirectHost&&(n.push(r),v4(e,r,o)&&(i=!0));for(const[r,o]of t){if(o.isDirectHost)continue;const s=aMe(r);s!==o.hostElement&&o.hostElement&&(e.removeAttribute("data-placeholder",o.hostElement),lG(e,o.hostElement),o.hostElement=null,i=!0),s&&(n.includes(s)||(o.hostElement=s,v4(e,r,o)&&(i=!0)))}return i}function v4(t,e,n){const{text:i,isDirectHost:r,hostElement:o}=n;let s=!1;return o.getAttribute("data-placeholder")!==i&&(t.setAttribute("data-placeholder",i,o),s=!0),(r||e.childCount==1)&&oMe(o,n.keepOnFocus)?rMe(t,o)&&(s=!0):lG(t,o)&&(s=!0),s}function aMe(t){if(t.childCount){const e=t.getChild(0);if(e.is("element")&&!e.is("uiElement")&&!e.is("attributeElement"))return e}return null}function lMe(){p4||hn("enableViewPlaceholder-deprecated-text-option"),p4=!0}class $f{is(){throw new Error("is() method is abstract")}}class zf extends Fn($f){document;parent;constructor(e){super(),this.document=e,this.parent=null}get index(){let e;if(!this.parent)return null;if((e=this.parent.getChildIndex(this))==-1)throw new oe("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 n=this;for(;n.parent;)e.unshift(n.index),n=n.parent;return e}getAncestors(e={}){const n=[];let i=e.includeSelf?this:this.parent;for(;i;)n[e.parentFirst?"push":"unshift"](i),i=i.parent;return n}getCommonAncestor(e,n={}){const i=this.getAncestors(n),r=e.getAncestors(n);let o=0;for(;i[o]==r[o]&&i[o];)o++;return o===0?null:i[o-1]}isBefore(e){if(this==e||this.root!==e.root)return!1;const n=this.getPath(),i=e.getPath(),r=ur(n,i);switch(r){case"prefix":return!0;case"extension":return!1;default:return n[r]e.data.length)throw new oe("view-textproxy-wrong-offsetintext",this);if(i<0||n+i>e.data.length)throw new oe("view-textproxy-wrong-length",this);this.data=e.data.substring(n,n+i),this.offsetInText=n}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}getAncestors(e={}){const n=[];let i=e.includeSelf?this.textNode:this.parent;for(;i!==null;)n[e.parentFirst?"push":"unshift"](i),i=i.parent;return n}}Wl.prototype.is=function(t){return t==="$textProxy"||t==="view:$textProxy"||t==="textProxy"||t==="view:textProxy"};class u1{_consumables=new Map;add(e,n){let i;if(e.is("$text")||e.is("documentFragment")){this._consumables.set(e,!0);return}this._consumables.has(e)?i=this._consumables.get(e):(i=new uMe(e),this._consumables.set(e,i)),i.add(n?wp(n):e._getConsumables())}test(e,n){const i=this._consumables.get(e);return i===void 0?null:e.is("$text")||e.is("documentFragment")?i:i.test(wp(n))}consume(e,n){if(e.is("$text")||e.is("documentFragment"))return this.test(e,n)?(this._consumables.set(e,!1),!0):!1;const i=this._consumables.get(e);return i===void 0?!1:i.consume(wp(n))}revert(e,n){const i=this._consumables.get(e);i!==void 0&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):i.revert(wp(n)))}static createFrom(e,n){if(n||(n=new u1),e.is("$text"))n.add(e);else if(e.is("element")||e.is("documentFragment")){n.add(e);for(const i of e.getChildren())u1.createFrom(i,n)}return n}}class uMe{element;_canConsumeName=null;_attributes=new Map;constructor(e){this.element=e}add(e){e.name&&(this._canConsumeName=!0);for(const[n,i]of e.attributes)if(i){let r=this._attributes.get(n);(!r||typeof r=="boolean")&&(r=new Map,this._attributes.set(n,r)),r.set(i,!0)}else{if(n=="style"||n=="class")throw new oe("viewconsumable-invalid-attribute",this);this._attributes.set(n,!0)}}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const[n,i]of e.attributes){const r=this._attributes.get(n);if(r===void 0)return null;if(r===!1)return!1;if(r!==!0){if(i){const o=r.get(i);if(o===void 0)return null;if(!o)return!1}else for(const o of r.values())if(!o)return!1}}return!0}consume(e){if(!this.test(e))return!1;e.name&&(this._canConsumeName=!1);for(const[n,i]of e.attributes){const r=this._attributes.get(n);if(typeof r=="boolean")for(const[o]of this.element._getConsumables(n,i).attributes)this._attributes.set(o,!1);else if(i)for(const[,o]of this.element._getConsumables(n,i).attributes)r.set(o,!1);else for(const o of r.keys())r.set(o,!1)}return!0}revert(e){e.name&&(this._canConsumeName=!0);for(const[n,i]of e.attributes){const r=this._attributes.get(n);if(r===!1){this._attributes.set(n,!0);continue}if(!(r===void 0||r===!0))if(i)r.get(i)===!1&&r.set(i,!0);else for(const o of r.keys())r.set(o,!0)}}}function wp(t){const e=[];return"attributes"in t&&t.attributes&&AT(e,t.attributes),"classes"in t&&t.classes&&AT(e,t.classes,"class"),"styles"in t&&t.styles&&AT(e,t.styles,"style"),{name:t.name||!1,attributes:e}}function AT(t,e,n){if(typeof e=="string"){t.push(n?[n,e]:[e]);return}for(const i of e)Array.isArray(i)?t.push(i):t.push(n?[n,i]:[i])}class pl{_patterns=[];constructor(...e){this.add(...e)}add(...e){for(let n of e)(typeof n=="string"||n instanceof RegExp)&&(n={name:n}),this._patterns.push(n)}match(...e){for(const n of e)for(const i of this._patterns){const r=this._isElementMatching(n,i);if(r)return{element:n,pattern:i,match:r}}return null}matchAll(...e){const n=[];for(const i of e)for(const r of this._patterns){const o=this._isElementMatching(i,r);o&&n.push({element:i,pattern:r,match:o})}return n.length>0?n:null}getElementName(){if(this._patterns.length!==1)return null;const e=this._patterns[0],n=e.name;return typeof e!="function"&&n&&!(n instanceof RegExp)?n:null}_isElementMatching(e,n){if(typeof n=="function"){const o=n(e);return!o||typeof o!="object"?o:wp(o)}const i={};if(n.name&&(i.name=cMe(n.name,e.name),!i.name))return null;const r=[];return n.attributes&&!dMe(n.attributes,e,r)||n.classes&&!fMe(n.classes,e,r)||n.styles&&!hMe(n.styles,e,r)?null:(r.length&&(i.attributes=r),i)}}function c1(t,e){return t===!0||t===e||t instanceof RegExp&&!!String(e).match(t)}function cMe(t,e){return t instanceof RegExp?!!e.match(t):t===e}function jM(t,e){if(Array.isArray(t))return t.map(i=>typeof i!="object"||i instanceof RegExp?e?[e,i,!0]:[i,!0]:((i.key===void 0||i.value===void 0)&&hn("matcher-pattern-missing-key-or-value",i),e?[e,i.key,i.value]:[i.key,i.value]));if(typeof t!="object"||t instanceof RegExp)return[e?[e,t,!0]:[t,!0]];const n=[];for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&n.push(e?[e,i,t[i]]:[i,t[i]]);return n}function dMe(t,e,n){let i;return typeof t=="object"&&!(t instanceof RegExp)&&!Array.isArray(t)?(t.style!==void 0&&hn("matcher-pattern-deprecated-attributes-style-key",t),t.class!==void 0&&hn("matcher-pattern-deprecated-attributes-class-key",t)):i=["class","style"],e._collectAttributesMatch(jM(t),n,i)}function fMe(t,e,n){return e._collectAttributesMatch(jM(t,"class"),n)}function hMe(t,e,n){return e._collectAttributesMatch(jM(t,"style"),n)}class tv{_styles;_cachedStyleNames=null;_cachedExpandedStyleNames=null;_styleProcessor;constructor(e){this._styles={},this._styleProcessor=e}get isEmpty(){return!Object.entries(this._styles).length}get size(){return this.isEmpty?0:this.getStyleNames().length}setTo(e){this.clear();const n=gMe(e);for(const[i,r]of n)this._styleProcessor.toNormalizedForm(i,r,this._styles);return this}has(e){if(this.isEmpty)return!1;const i=this._styleProcessor.getReducedForm(e,this._styles).find(([r])=>r===e);return Array.isArray(i)}set(e,n){if(this._cachedStyleNames=null,this._cachedExpandedStyleNames=null,so(e))for(const[i,r]of Object.entries(e))this._styleProcessor.toNormalizedForm(i,r,this._styles);else this._styleProcessor.toNormalizedForm(e,n,this._styles)}remove(e){const n={};for(const i of li(e)){const r=_A(i),o=Ic(this._styles,r);if(o)Jw(n,r,o);else{const s=this.getAsString(i);s!==void 0&&this._styleProcessor.toNormalizedForm(i,s,n)}}Object.keys(n).length&&(uG(this._styles,n),this._cachedStyleNames=null,this._cachedExpandedStyleNames=null)}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]&&!so(this._styles[e]))return this._styles[e];const i=this._styleProcessor.getReducedForm(e,this._styles).find(([r])=>r===e);if(Array.isArray(i))return i[1]}getStyleNames(e=!1){return this.isEmpty?[]:e?(this._cachedExpandedStyleNames||=this._styleProcessor.getStyleNames(this._styles),this._cachedExpandedStyleNames):(this._cachedStyleNames||=this.getStylesEntries().map(([n])=>n),this._cachedStyleNames)}keys(){return this.getStyleNames()}clear(){this._styles={},this._cachedStyleNames=null,this._cachedExpandedStyleNames=null}isSimilar(e){if(this.size!==e.size)return!1;for(const n of this.getStyleNames())if(!e.has(n)||e.getAsString(n)!==this.getAsString(n))return!1;return!0}getStylesEntries(){const e=[],n=Object.keys(this._styles);for(const i of n)e.push(...this._styleProcessor.getReducedForm(i,this._styles));return e}_clone(){const e=new this.constructor(this._styleProcessor);return e.set(this.getNormalized()),e}_getTokensMatch(e,n){const i=[];for(const r of this.getStyleNames(!0))if(c1(e,r)){if(n===!0){i.push(r);continue}const o=this.getAsString(r);c1(n,o)&&i.push(r)}return i.length?i:void 0}_getConsumables(e){const n=[];if(e){n.push(e);for(const i of this._styleProcessor.getRelatedStyles(e))n.push(i)}else for(const i of this.getStyleNames()){for(const r of this._styleProcessor.getRelatedStyles(i))n.push(r);n.push(i)}return n}_canMergeFrom(e){for(const n of e.getStyleNames())if(this.has(n)&&this.getAsString(n)!==e.getAsString(n))return!1;return!0}_mergeFrom(e){for(const n of e.getStyleNames())this.has(n)||this.set(n,e.getAsString(n))}_isMatching(e){for(const n of e.getStyleNames())if(!this.has(n)||this.getAsString(n)!==e.getAsString(n))return!1;return!0}}class mMe{_normalizers;_extractors;_reducers;_consumables;constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,n,i){if(so(n)){Jw(i,_A(e),n);return}if(this._normalizers.has(e)){const r=this._normalizers.get(e),{path:o,value:s}=r(n);Jw(i,o,s)}else Jw(i,e,n)}getNormalized(e,n){if(!e)return DM({},n);if(n[e]!==void 0)return n[e];if(this._extractors.has(e)){const i=this._extractors.get(e);if(typeof i=="string")return Ic(n,i);const r=i(e,n);if(r)return r}return Ic(n,_A(e))}getReducedForm(e,n){const i=this.getNormalized(e,n);return i===void 0?[]:this._reducers.has(e)?this._reducers.get(e)(i):[[e,i]]}getStyleNames(e){const n=new Set;for(const i of this._consumables.keys()){const r=this.getNormalized(i,e);r&&(typeof r!="object"||Object.keys(r).length)&&n.add(i)}for(const i of Object.keys(e))n.add(i);return Array.from(n)}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,n){this._normalizers.set(e,n)}setExtractor(e,n){this._extractors.set(e,n)}setReducer(e,n){this._reducers.set(e,n)}setStyleRelation(e,n){this._mapStyleNames(e,n);for(const i of n)this._mapStyleNames(i,[e])}_mapStyleNames(e,n){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...n)}}function gMe(t){let e=null,n=0,i=0,r=null;const o=new Map;if(t==="")return o;t.charAt(t.length-1)!=";"&&(t=t+";");for(let s=0;sr!="style"&&r!="class").map(r=>`${r[0]}="${r[1]}"`).sort().join(" ");return this.name+(e==""?"":` class="${e}"`)+(n?` style="${n}"`:"")+(i==""?"":` ${i}`)}shouldRenderUnsafeAttribute(e){return this._unsafeAttributesToRender.includes(e)}toJSON(){const e=super.toJSON();if(e.name=this.name,e.type="Element",this._attrs.size&&(e.attributes=Object.fromEntries(this.getAttributes())),this._children.length>0){e.children=[];for(const n of this._children)e.children.push(n.toJSON())}return e}_clone(e=!1){const n=[];if(e)for(const r of this.getChildren())n.push(r._clone(e));const i=new this.constructor(this.document,this.name,this._attrs,n);return i._customProperties=new Map(this._customProperties),i.getFillerOffset=this.getFillerOffset,i._unsafeAttributesToRender=this._unsafeAttributesToRender,i}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,n){this._fireChange("children",this,{index:e});let i=0;const r=pMe(this.document,n);for(const o of r)o.parent!==null&&o._remove(),o.parent=this,o.document=this.document,this._children.splice(e,0,o),e++,i++;return i}_removeChildren(e,n=1){this._fireChange("children",this,{index:e});for(let i=e;io&&e.selection.editableElement==this),this.listenTo(e.selection,"change",()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}destroy(){this.stopListening()}toJSON(){const e=super.toJSON();return e.type="EditableElement",e.isReadOnly=this.isReadOnly,e.isFocused=this.isFocused,e}}hS.prototype.is=function(t,e){return e?e===this.name&&(t==="editableElement"||t==="view:editableElement"||t==="containerElement"||t==="view:containerElement"||t==="element"||t==="view:element"):t==="editableElement"||t==="view:editableElement"||t==="containerElement"||t==="view:containerElement"||t==="element"||t==="view:element"||t==="node"||t==="view:node"};const b4=Symbol("rootName");class cG extends hS{constructor(e,n){super(e,n),this.rootName="main"}get rootName(){return this.getCustomProperty(b4)}set rootName(e){this._setCustomProperty(b4,e)}toJSON(){return this.rootName}set _name(e){this.name=e}}cG.prototype.is=function(t,e){return e?e===this.name&&(t==="rootElement"||t==="view:rootElement"||t==="editableElement"||t==="view:editableElement"||t==="containerElement"||t==="view:containerElement"||t==="element"||t==="view:element"):t==="rootElement"||t==="view:rootElement"||t==="editableElement"||t==="view:editableElement"||t==="containerElement"||t==="view:containerElement"||t==="element"||t==="view:element"||t==="node"||t==="view:node"};class Xd{direction;boundaries;singleCharacters;shallow;ignoreElementEnd;_position;_boundaryStartParent;_boundaryEndParent;constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new oe("view-tree-walker-no-start-position",null);if(e.direction&&e.direction!="forward"&&e.direction!="backward")throw new oe("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this._position=Ge._createAt(e.startPosition):this._position=Ge._createAt(e.boundaries[e.direction=="backward"?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}get position(){return this._position}skip(e){let n,i;do i=this.position,n=this.next();while(!n.done&&e(n.value));n.done||(this._position=i)}jumpTo(e){this._boundaryStartParent&&e.isBefore(this.boundaries.start)?e=this.boundaries.start:this._boundaryEndParent&&e.isAfter(this.boundaries.end)&&(e=this.boundaries.end),this._position=e.clone()}next(){return this.direction=="forward"?this._next():this._previous()}_next(){let e=this.position.clone();const n=this.position,i=e.parent;if(i.parent===null&&e.offset===i.childCount)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let r;if(i&&i.is("view:$text")){if(e.isAtEnd)return this._position=Ge._createAfter(i),this._next();r=i.data[e.offset]}else r=i.getChild(e.offset);if(typeof r=="string"){let o;this.singleCharacters?o=1:o=(i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length)-e.offset;const s=new Wl(i,e.offset,o);return e.offset+=o,this._position=e,this._formatReturnValue("text",s,n,e,o)}if(r&&r.is("view:element")){if(!this.shallow)e=new Ge(r,0);else{if(this.boundaries&&this.boundaries.end.isBefore(e))return{done:!0,value:void 0};e.offset++}return this._position=e,this._formatReturnValue("elementStart",r,n,e,1)}if(r&&r.is("view:$text")){if(this.singleCharacters)return e=new Ge(r,0),this._position=e,this._next();let o=r.data.length,s;return r==this._boundaryEndParent?(o=this.boundaries.end.offset,s=new Wl(r,0,o),e=Ge._createAfter(s)):(s=new Wl(r,0,r.data.length),e.offset++),this._position=e,this._formatReturnValue("text",s,n,e,o)}return e=Ge._createAfter(i),this._position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",i,n,e)}_previous(){let e=this.position.clone();const n=this.position,i=e.parent;if(i.parent===null&&e.offset===0)return{done:!0,value:void 0};if(i==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0,value:void 0};let r;if(i.is("view:$text")){if(e.isAtStart)return this._position=Ge._createBefore(i),this._previous();r=i.data[e.offset-1]}else r=i.getChild(e.offset-1);if(typeof r=="string"){let o;if(this.singleCharacters)o=1;else{const a=i===this._boundaryStartParent?this.boundaries.start.offset:0;o=e.offset-a}e.offset-=o;const s=new Wl(i,e.offset,o);return this._position=e,this._formatReturnValue("text",s,n,e,o)}if(r&&r.is("view:element"))return this.shallow?(e.offset--,this._position=e,this._formatReturnValue("elementStart",r,n,e,1)):(e=new Ge(r,r.childCount),this._position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",r,n,e));if(r&&r.is("view:$text")){if(this.singleCharacters)return e=new Ge(r,r.data.length),this._position=e,this._previous();let o=r.data.length,s;if(r==this._boundaryStartParent){const a=this.boundaries.start.offset;s=new Wl(r,a,r.data.length-a),o=s.data.length,e=Ge._createBefore(s)}else s=new Wl(r,0,r.data.length),e.offset--;return this._position=e,this._formatReturnValue("text",s,n,e,o)}return e=Ge._createBefore(i),this._position=e,this._formatReturnValue("elementStart",i,n,e,1)}_formatReturnValue(e,n,i,r,o){return n.is("view:$textProxy")&&(n.offsetInText+n.data.length==n.textNode.data.length&&(this.direction=="forward"&&!(this.boundaries&&this.boundaries.end.isEqual(this.position))?(r=Ge._createAfter(n.textNode),this._position=r):i=Ge._createAfter(n.textNode)),n.offsetInText===0&&(this.direction=="backward"&&!(this.boundaries&&this.boundaries.start.isEqual(this.position))?(r=Ge._createBefore(n.textNode),this._position=r):i=Ge._createBefore(n.textNode))),{done:!1,value:{type:e,item:n,previousPosition:i,nextPosition:r,length:o}}}}class Ge extends $f{parent;offset;constructor(e,n){super(),this.parent=e,this.offset=n}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 hS);)if(e.parent)e=e.parent;else return null;return e}getShiftedBy(e){const n=Ge._createAt(this),i=n.offset+e;return n.offset=i<0?0:i,n}getLastMatchingPosition(e,n={}){n.startPosition=this;const i=new Xd(n);return i.skip(e),i.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const n=this.getAncestors(),i=e.getAncestors();let r=0;for(;n[r]==i[r]&&n[r];)r++;return r===0?null:n[r-1]}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 n=this.parent.is("node")?this.parent.getPath():[],i=e.parent.is("node")?e.parent.getPath():[];n.push(this.offset),i.push(e.offset);const r=ur(n,i);switch(r){case"prefix":return"before";case"extension":return"after";default:return n[r]0?new this(i,r):new this(r,i)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const n=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(Ge._createBefore(e),n)}}Nt.prototype.is=function(t){return t==="range"||t==="view:range"};function ny(t){return!!(t.item.is("attributeElement")||t.item.is("uiElement"))}class aa extends Fn($f){_ranges;_lastRangeBackward;_isFake;_fakeSelectionLabel;constructor(...e){super(),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",e.length&&this.setTo(...e)}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 n of this._ranges)(!e||n.start.isBefore(e.start))&&(e=n);return e?e.clone():null}getLastRange(){let e=null;for(const n of this._ranges)(!e||n.end.isAfter(e.end))&&(e=n);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 n of this._ranges){let i=!1;for(const r of e._ranges)if(n.isEqual(r)){i=!0;break}if(!i)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const n=yA(this.getRanges()),i=yA(e.getRanges());if(n!=i)return!1;if(n==0)return!0;for(let r of this.getRanges()){r=r.getTrimmed();let o=!1;for(let s of e.getRanges())if(s=s.getTrimmed(),r.start.isEqual(s.start)&&r.end.isEqual(s.end)){o=!0;break}if(!o)return!1}return!0}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}setTo(...e){let[n,i,r]=e;if(typeof i=="object"&&(r=i,i=void 0),n===null)this._setRanges([]),this._setFakeOptions(r);else if(n instanceof aa||n instanceof KM)this._setRanges(n.getRanges(),n.isBackward),this._setFakeOptions({fake:n.isFake,label:n.fakeSelectionLabel});else if(n instanceof Nt)this._setRanges([n],r&&r.backward),this._setFakeOptions(r);else if(n instanceof Ge)this._setRanges([new Nt(n)]),this._setFakeOptions(r);else if(n instanceof zf){const o=!!r&&!!r.backward;let s;if(i===void 0)throw new oe("view-selection-setto-required-second-parameter",this);i=="in"?s=Nt._createIn(n):i=="on"?s=Nt._createOn(n):s=new Nt(Ge._createAt(n,i)),this._setRanges([s],o),this._setFakeOptions(r)}else if(us(n))this._setRanges(n,r&&r.backward),this._setFakeOptions(r);else throw new oe("view-selection-setto-not-selectable",this);this.fire("change")}setFocus(e,n){if(this.anchor===null)throw new oe("view-selection-setfocus-no-ranges",this);const i=Ge._createAt(e,n);if(i.compareWith(this.focus)=="same")return;const r=this.anchor;this._ranges.pop(),i.compareWith(r)=="before"?this._addRange(new Nt(i,r),!0):this._addRange(new Nt(r,i)),this.fire("change")}toJSON(){const e={ranges:Array.from(this.getRanges()).map(n=>n.toJSON())};return this.isBackward&&(e.isBackward=!0),this.isFake&&(e.isFake=!0),e}_setRanges(e,n=!1){e=Array.from(e),this._ranges=[];for(const i of e)this._addRange(i);this._lastRangeBackward=!!n}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,n=!1){if(!(e instanceof Nt))throw new oe("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!n}_pushRange(e){for(const n of this._ranges)if(e.isIntersecting(n))throw new oe("view-selection-range-intersects",this,{addedRange:e,intersectingRange:n});this._ranges.push(new Nt(e.start,e.end))}}aa.prototype.is=function(t){return t==="selection"||t==="view:selection"};class KM extends Fn($f){_selection;constructor(...e){super(),this._selection=new aa,this._selection.delegate("change").to(this),e.length&&this._selection.setTo(...e)}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)}toJSON(){return this._selection.toJSON()}_setTo(...e){this._selection.setTo(...e)}_setFocus(e,n){this._selection.setFocus(e,n)}}KM.prototype.is=function(t){return t==="selection"||t=="documentSelection"||t=="view:selection"||t=="view:documentSelection"};class Hf extends pu{startRange;_eventPhase;_currentTarget;constructor(e,n,i){super(e,n),this.startRange=i,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const IT=Symbol("bubblingEmitter"),RT=Symbol("bubblingCallbacks"),MT=Symbol("bubblingContexts");function bMe(t){class e extends t{fire(i,...r){try{const o=i instanceof pu?i:new pu(this,i),s=OT(this),a=w4(this);if(zg(o,"capturing",this),iy(s,"$capture",o,...r))return o.return;const l=o.startRange||this.selection.getFirstRange(),u=l?l.getContainedElement():null,c=u?wMe(a,u):!1;let d=u||_Me(l);if(zg(o,"atTarget",d),!c){if(iy(s,"$text",o,...r))return o.return;zg(o,"bubbling",d)}for(;d;){if(d.is("element")&&iy(s,d,o,...r))return o.return;d=d.parent,zg(o,"bubbling",d)}return zg(o,"bubbling",this),iy(s,"$document",o,...r),o.return}catch(o){oe.rethrowUnexpectedError(o,this)}}_addEventListener(i,r,o){const s=li(o.context||"$document"),a=OT(this),l=y4(this);for(const c of s)typeof c=="function"&&w4(this).add(c);const u=yMe(this,s,r);l.set(r,u),this.listenTo(a,i,u,o)}_removeEventListener(i,r){const o=OT(this),s=y4(this),a=s.get(r);a&&(s.delete(r),this.stopListening(o,i,a))}}return e}function zg(t,e,n){t instanceof Hf&&(t._eventPhase=e,t._currentTarget=n)}function iy(t,e,n,...i){return t.fire(n,{currentTarget:e,eventArgs:i}),!!n.stop.called}function yMe(t,e,n){return function(i,r){const{currentTarget:o,eventArgs:s}=r;if(typeof o=="string"){e.includes(o)&&n.call(t,i,...s);return}if(o.is("rootElement")&&e.includes("$root")){n.call(t,i,...s);return}if(e.includes(o.name)){n.call(t,i,...s);return}for(const a of e)if(typeof a=="function"&&a(o)){n.call(t,i,...s);return}}}function OT(t){return t[IT]||(t[IT]=new(Fn())),t[IT]}function y4(t){return t[RT]||(t[RT]=new Map),t[RT]}function w4(t){return t[MT]||(t[MT]=new Set),t[MT]}function wMe(t,e){for(const n of t)if(n(e))return!0;return!1}function _Me(t){if(!t)return null;const e=t.start.parent,n=t.end.parent,i=e.getPath(),r=n.getPath();return i.length>r.length?e:n}class mS extends bMe(Ln()){selection;roots;stylesProcessor;_postFixers=new Set;constructor(e){super(),this.selection=new KM,this.roots=new Er({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1)}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.forEach(e=>e.destroy()),this.stopListening()}_callPostFixers(e){let n=!1;do for(const i of this._postFixers)if(n=i(e),n)break;while(n)}}const _4=10;class hm extends ga{static DEFAULT_PRIORITY=_4;_priority=_4;_id=null;_clonesGroup=null;constructor(e,n,i,r){super(e,n,i,r),this.getFillerOffset=CMe}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(this.id===null)throw new oe("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}isSimilar(e){return this.id!==null||e.id!==null?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}toJSON(){const e=super.toJSON();return e.type="AttributeElement",e}_clone(e=!1){const n=super._clone(e);return n._priority=this._priority,n._id=this._id,n}_canMergeAttributesFrom(e){return this.id!==null||e.id!==null||this.priority!==e.priority?!1:super._canMergeAttributesFrom(e)}_canSubtractAttributesOf(e){return this.id!==null||e.id!==null||this.priority!==e.priority?!1:super._canSubtractAttributesOf(e)}}hm.prototype.is=function(t,e){return e?e===this.name&&(t==="attributeElement"||t==="view:attributeElement"||t==="element"||t==="view:element"):t==="attributeElement"||t==="view:attributeElement"||t==="element"||t==="view:element"||t==="node"||t==="view:node"};function CMe(){if(LT(this))return null;let t=this.parent;for(;t&&t.is("attributeElement");){if(LT(t)>1)return null;t=t.parent}return!t||LT(t)>1?null:this.childCount}function LT(t){return Array.from(t.getChildren()).filter(e=>!e.is("uiElement")).length}class GM extends ga{constructor(e,n,i,r){super(e,n,i,r),this.getFillerOffset=SMe}toJSON(){const e=super.toJSON();return e.type="EmptyElement",e}_insertChild(e,n){if(n&&(n instanceof zf||Array.from(n).length>0))throw new oe("view-emptyelement-cannot-add",[this,n]);return 0}}GM.prototype.is=function(t,e){return e?e===this.name&&(t==="emptyElement"||t==="view:emptyElement"||t==="element"||t==="view:element"):t==="emptyElement"||t==="view:emptyElement"||t==="element"||t==="view:element"||t==="node"||t==="view:node"};function SMe(){return null}class gS extends ga{constructor(e,n,i,r){super(e,n,i,r),this.getFillerOffset=TMe}_insertChild(e,n){if(n&&(n instanceof zf||Array.from(n).length>0))throw new oe("view-uielement-cannot-add",[this,n]);return 0}render(e,n){return this.toDomElement(e)}toDomElement(e){const n=e.createElement(this.name);for(const i of this.getAttributeKeys())n.setAttribute(i,this.getAttribute(i));return n}toJSON(){const e=super.toJSON();return e.type="UIElement",e}}gS.prototype.is=function(t,e){return e?e===this.name&&(t==="uiElement"||t==="view:uiElement"||t==="element"||t==="view:element"):t==="uiElement"||t==="view:uiElement"||t==="element"||t==="view:element"||t==="node"||t==="view:node"};function kMe(t){t.document.on("arrowKey",(e,n)=>EMe(e,n,t.domConverter),{priority:"low"})}function TMe(){return null}function EMe(t,e,n){if(e.keyCode==Yt.arrowright){const i=e.domTarget.ownerDocument.defaultView.getSelection(),r=i.rangeCount==1&&i.getRangeAt(0).collapsed;if(r||e.shiftKey){const o=i.focusNode,s=i.focusOffset,a=n.domPositionToView(o,s);if(a===null)return;let l=!1;const u=a.getLastMatchingPosition(c=>(c.item.is("uiElement")&&(l=!0),!!(c.item.is("uiElement")||c.item.is("attributeElement"))));if(l){const c=n.viewPositionToDom(u);r?i.collapse(c.parent,c.offset):i.extend(c.parent,c.offset)}}}}class YM extends ga{constructor(e,n,i,r){super(e,n,i,r),this.getFillerOffset=xMe}toJSON(){const e=super.toJSON();return e.type="RawElement",e}_insertChild(e,n){if(n&&(n instanceof zf||Array.from(n).length>0))throw new oe("view-rawelement-cannot-add",[this,n]);return 0}render(e,n){}}YM.prototype.is=function(t,e){return e?e===this.name&&(t==="rawElement"||t==="view:rawElement"||t==="element"||t==="view:element"):t==="rawElement"||t==="view:rawElement"||t===this.name||t==="view:"+this.name||t==="element"||t==="view:element"||t==="node"||t==="view:node"};function xMe(){return null}class af extends Fn($f){document;_children=[];_customProperties=new Map;constructor(e,n){super(),this.document=e,n&&this._insertChild(0,n)}[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}get name(){}get getFillerOffset(){}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}toJSON(){const e=[];for(const n of this._children)e.push(n.toJSON());return e}_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,n){this._fireChange("children",this,{index:e});let i=0;const r=AMe(this.document,n);for(const o of r)o.parent!==null&&o._remove(),o.parent=this,this._children.splice(e,0,o),e++,i++;return i}_removeChildren(e,n=1){this._fireChange("children",this,{index:e});for(let i=e;itypeof n=="string"?new Ji(t,n):n instanceof Wl?new Ji(t,n.data):n))}class dG{document;_cloneGroups=new Map;_slotFactory=null;constructor(e){this.document=e}setSelection(...e){this.document.selection._setTo(...e)}setSelectionFocus(e,n){this.document.selection._setFocus(e,n)}createDocumentFragment(e){return new af(this.document,e)}createText(e){return new Ji(this.document,e)}createAttributeElement(e,n,i={}){const r=new hm(this.document,e,n);return typeof i.priority=="number"&&(r._priority=i.priority),i.id&&(r._id=i.id),i.renderUnsafeAttributes&&r._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),r}createContainerElement(e,n,i={},r={}){let o;MMe(i)?r=i:o=i;const s=new nb(this.document,e,n,o);return r.renderUnsafeAttributes&&s._unsafeAttributesToRender.push(...r.renderUnsafeAttributes),s}createEditableElement(e,n,i={}){const r=new hS(this.document,e,n);return i.renderUnsafeAttributes&&r._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),r}createEmptyElement(e,n,i={}){const r=new GM(this.document,e,n);return i.renderUnsafeAttributes&&r._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),r}createUIElement(e,n,i){const r=new gS(this.document,e,n);return i&&(r.render=i),r}createRawElement(e,n,i,r={}){const o=new YM(this.document,e,n);return i&&(o.render=i),r.renderUnsafeAttributes&&o._unsafeAttributesToRender.push(...r.renderUnsafeAttributes),o}setAttribute(e,n,i,r){r!==void 0?r._setAttribute(e,n,i):i._setAttribute(e,n)}removeAttribute(e,n,i){i!==void 0?i._removeAttribute(e,n):n._removeAttribute(e)}addClass(e,n){n._addClass(e)}removeClass(e,n){n._removeClass(e)}setStyle(e,n,i){Wa(e)&&i===void 0?n._setStyle(e):i._setStyle(e,n)}removeStyle(e,n){n._removeStyle(e)}setCustomProperty(e,n,i){i._setCustomProperty(e,n)}removeCustomProperty(e,n){return n._removeCustomProperty(e)}breakAttributes(e){return e instanceof Ge?this._breakAttributes(e):this._breakAttributesRange(e)}breakContainer(e){const n=e.parent;if(!n.is("containerElement"))throw new oe("view-writer-break-non-container-element",this.document);if(!n.parent)throw new oe("view-writer-break-root",this.document);if(e.isAtStart)return Ge._createBefore(n);if(!e.isAtEnd){const i=n._clone(!1);this.insert(Ge._createAfter(n),i);const r=new Nt(e,Ge._createAt(n,"end")),o=new Ge(i,0);this.move(r,o)}return Ge._createAfter(n)}mergeAttributes(e){const n=e.offset,i=e.parent;if(i.is("$text"))return e;if(i.is("attributeElement")&&i.childCount===0){const s=i.parent,a=i.index;return i._remove(),this._removeFromClonedElementsGroup(i),this.mergeAttributes(new Ge(s,a))}const r=i.getChild(n-1),o=i.getChild(n);if(!r||!o)return e;if(r.is("$text")&&o.is("$text"))return S4(r,o);if(r.is("attributeElement")&&o.is("attributeElement")&&r.isSimilar(o)){const s=r.childCount;return r._appendChild(o.getChildren()),o._remove(),this._removeFromClonedElementsGroup(o),this.mergeAttributes(new Ge(r,s))}return e}mergeContainers(e){const n=e.nodeBefore,i=e.nodeAfter;if(!n||!i||!n.is("containerElement")||!i.is("containerElement"))throw new oe("view-writer-merge-containers-invalid-position",this.document);const r=n.getChild(n.childCount-1),o=r instanceof Ji?Ge._createAt(r,"end"):Ge._createAt(n,"end");return this.move(Nt._createIn(i),Ge._createAt(n,"end")),this.remove(Nt._createOn(i)),o}insert(e,n){n=us(n)?[...n]:[n],fG(n,this.document);const i=n.reduce((s,a)=>{const l=s[s.length-1],u=!a.is("uiElement");return!l||l.breakAttributes!=u?s.push({breakAttributes:u,nodes:[a]}):l.nodes.push(a),s},[]);let r=null,o=e;for(const{nodes:s,breakAttributes:a}of i){const l=this._insertNodes(o,s,a);r||(r=l.start),o=l.end}return r?new Nt(r,o):new Nt(e)}remove(e){const n=e instanceof Nt?e:Nt._createOn(e);if(Hg(n,this.document),n.isCollapsed)return new af(this.document);const{start:i,end:r}=this._breakAttributesRange(n,!0),o=i.parent,s=r.offset-i.offset,a=o._removeChildren(i.offset,s);for(const u of a)this._removeFromClonedElementsGroup(u);const l=this.mergeAttributes(i);return n.start=l,n.end=l.clone(),new af(this.document,a)}clear(e,n){Hg(e,this.document);const i=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const r of i){const o=r.item;let s;if(o.is("element")&&n.isSimilar(o))s=Nt._createOn(o);else if(!r.nextPosition.isAfter(e.start)&&o.is("$textProxy")){const a=o.getAncestors().find(l=>l.is("element")&&n.isSimilar(l));a&&(s=Nt._createIn(a))}s&&(s.end.isAfter(e.end)&&(s.end=e.end),s.start.isBefore(e.start)&&(s.start=e.start),this.remove(s))}}move(e,n){let i;if(n.isAfter(e.end)){n=this._breakAttributes(n,!0);const r=n.parent,o=r.childCount;e=this._breakAttributesRange(e,!0),i=this.remove(e),n.offset+=r.childCount-o}else i=this.remove(e);return this.insert(n,i)}wrap(e,n){if(!(n instanceof hm))throw new oe("view-writer-wrap-invalid-attribute",this.document);if(Hg(e,this.document),e.isCollapsed){let i=e.start;i.parent.is("element")&&!PMe(i.parent)&&(i=i.getLastMatchingPosition(o=>o.item.is("uiElement"))),i=this._wrapPosition(i,n);const r=this.document.selection;return r.isCollapsed&&r.getFirstPosition().isEqual(e.start)&&this.setSelection(i),new Nt(i)}else return this._wrapRange(e,n)}unwrap(e,n){if(!(n instanceof hm))throw new oe("view-writer-unwrap-invalid-attribute",this.document);if(Hg(e,this.document),e.isCollapsed)return e;const{start:i,end:r}=this._breakAttributesRange(e,!0),o=i.parent,s=this._unwrapChildren(o,i.offset,r.offset,n),a=this.mergeAttributes(s.start);a.isEqual(s.start)||s.end.offset--;const l=this.mergeAttributes(s.end);return new Nt(a,l)}rename(e,n){const i=new nb(this.document,e,n.getAttributes());return this.insert(Ge._createAfter(n),i),this.move(Nt._createIn(n),Ge._createAt(i,0)),this.remove(Nt._createOn(n)),i}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,n){return Ge._createAt(e,n)}createPositionAfter(e){return Ge._createAfter(e)}createPositionBefore(e){return Ge._createBefore(e)}createRange(e,n){return new Nt(e,n)}createRangeOn(e){return Nt._createOn(e)}createRangeIn(e){return Nt._createIn(e)}createSelection(...e){return new aa(...e)}createSlot(e="children"){if(!this._slotFactory)throw new oe("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,e)}_registerSlotFactory(e){this._slotFactory=e}_clearSlotFactory(){this._slotFactory=null}_insertNodes(e,n,i){let r;if(i?r=CA(e):r=e.parent.is("$text")?e.parent.parent:e.parent,!r)throw new oe("view-writer-invalid-position-container",this.document);let o;i?o=this._breakAttributes(e,!0):o=e.parent.is("$text")?DT(e):e;const s=r._insertChild(o.offset,n);for(const c of n)this._addToClonedElementsGroup(c);const a=o.getShiftedBy(s),l=this.mergeAttributes(o);l.isEqual(o)||a.offset--;const u=this.mergeAttributes(a);return new Nt(l,u)}_wrapChildren(e,n,i,r){let o=n;const s=[];for(;o!1,e.parent._insertChild(e.offset,i);const r=new Nt(e,e.getShiftedBy(1));this.wrap(r,n);const o=new Ge(i.parent,i.index);i._remove();const s=o.nodeBefore,a=o.nodeAfter;return s&&s.is("view:$text")&&a&&a.is("view:$text")?S4(s,a):C4(o)}_breakAttributesRange(e,n=!1){const i=e.start,r=e.end;if(Hg(e,this.document),e.isCollapsed){const l=this._breakAttributes(e.start,n);return new Nt(l,l)}const o=this._breakAttributes(r,n),s=o.parent.childCount,a=this._breakAttributes(i,n);return o.offset+=o.parent.childCount-s,new Nt(a,o)}_breakAttributes(e,n=!1){const i=e.offset,r=e.parent;if(e.parent.is("emptyElement"))throw new oe("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new oe("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new oe("view-writer-cannot-break-raw-element",this.document);if(!n&&r.is("$text")&&SA(r.parent)||SA(r))return e.clone();if(r.is("$text"))return this._breakAttributes(DT(e),n);const o=r.childCount;if(i==o){const s=new Ge(r.parent,r.index+1);return this._breakAttributes(s,n)}else if(i===0){const s=new Ge(r.parent,r.index);return this._breakAttributes(s,n)}else{const s=r.index+1,a=r._clone();r.parent._insertChild(s,a),this._addToClonedElementsGroup(a);const l=r.childCount-i,u=r._removeChildren(i,l);a._appendChild(u);const c=new Ge(r.parent,s);return this._breakAttributes(c,n)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const r of e.getChildren())this._addToClonedElementsGroup(r);const n=e.id;if(!n)return;let i=this._cloneGroups.get(n);i||(i=new Set,this._cloneGroups.set(n,i)),i.add(e),e._clonesGroup=i}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const r of e.getChildren())this._removeFromClonedElementsGroup(r);const n=e.id;if(!n)return;const i=this._cloneGroups.get(n);i&&i.delete(e)}}function PMe(t){return Array.from(t.getChildren()).some(e=>!e.is("uiElement"))}function CA(t){let e=t.parent;for(;!SA(e);){if(!e)return;e=e.parent}return e}function IMe(t,e){return t.prioritye.priority?!1:t.getIdentity()n instanceof i))throw new oe("view-writer-insert-invalid-node-type",e);n.is("$text")||fG(n.getChildren(),e)}}function SA(t){return t&&(t.is("containerElement")||t.is("documentFragment"))}function Hg(t,e){const n=CA(t.start),i=CA(t.end);if(!n||!i||n!==i)throw new oe("view-writer-invalid-range-container",e)}function MMe(t){return Wa(t)}const hG=t=>t.createTextNode(" "),mG=t=>{const e=t.createElement("span");return e.dataset.ckeFiller="true",e.innerText=" ",e},gG=t=>{const e=t.createElement("br");return e.dataset.ckeFiller="true",e},ts=7,ib="⁠".repeat(ts);function Qr(t){return typeof t=="string"?t.substr(0,ts)===ib:fi(t)&&t.data.substr(0,ts)===ib}function Kh(t){return t.data.length==ts&&Qr(t)}function k4(t){const e=typeof t=="string"?t:t.data;return Qr(t)?e.slice(ts):e}function OMe(t){t.document.on("arrowKey",LMe,{priority:"low"})}function LMe(t,e){if(e.keyCode==Yt.arrowleft){const n=e.domTarget.ownerDocument.defaultView.getSelection();if(n.rangeCount==1&&n.getRangeAt(0).collapsed){const i=n.getRangeAt(0).startContainer,r=n.getRangeAt(0).startOffset;Qr(i)&&r<=ts&&n.collapse(i,0)}}}class DMe extends Ln(){domDocuments=new Set;domConverter;markedAttributes=new Set;markedChildren=new Set;markedTexts=new Set;selection;_inlineFiller=null;_fakeSelectionContainer=null;constructor(e,n){super(),this.domConverter=e,this.selection=n,this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1),vt.isBlink&&!vt.isAndroid&&this.on("change:isSelecting",()=>{this.isSelecting||this.render()})}markToSync(e,n){if(e==="text")this.domConverter.mapViewToDom(n.parent)&&this.markedTexts.add(n);else{if(!this.domConverter.mapViewToDom(n))return;if(e==="attributes")this.markedAttributes.add(n);else if(e==="children")this.markedChildren.add(n);else throw new oe("view-renderer-unknown-type",this)}}render(){if(this.isComposing&&!vt.isAndroid)return;let e=null;const n=vt.isBlink&&!vt.isAndroid?!this.isSelecting:!0;for(const i of this.markedChildren)this._updateChildrenMappings(i);n?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent))):this._inlineFiller&&this._inlineFiller.parentNode&&(e=this.domConverter.domPositionToView(this._inlineFiller),e&&e.parent.is("$text")&&(e=Ge._createBefore(e.parent)));for(const i of this.markedAttributes)this._updateAttrs(i);for(const i of this.markedChildren)this._updateChildren(i,{inlineFillerPosition:e});for(const i of this.markedTexts)!this.markedChildren.has(i.parent)&&this.domConverter.mapViewToDom(i.parent)&&this._updateText(i,{inlineFillerPosition:e});if(n)if(e){const i=this.domConverter.viewPositionToDom(e),r=i.parent.ownerDocument;Qr(i.parent)?this._inlineFiller=i.parent:this._inlineFiller=T4(r,i.parent,i.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.domConverter._clearTemporaryCustomProperties(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){const n=this.domConverter.mapViewToDom(e);if(!n)return;const i=Array.from(n.childNodes),r=Array.from(this.domConverter.viewChildrenToDom(e,{withChildren:!1})),o=this._diffNodeLists(i,r),s=this._findUpdateActions(o,i,r,BMe);if(s.indexOf("update")!==-1){const a={equal:0,insert:0,delete:0};for(const l of s)if(l==="update"){const u=a.equal+a.insert,c=a.equal+a.delete,d=e.getChild(u);d&&!d.is("uiElement")&&!d.is("rawElement")&&this._updateElementMappings(d,i[c]),a4(r[u]),a.equal++}else a[l]++}}_updateElementMappings(e,n){this.domConverter.unbindDomElement(n),this.domConverter.bindElements(n,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();return e.parent.is("$text")?Ge._createBefore(e.parent):e}_isSelectionInInlineFiller(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),n=this.domConverter.viewPositionToDom(e);return!!(n&&fi(n.parent)&&Qr(n.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!Qr(e))throw new oe("view-renderer-filler-was-lost",this);Kh(e)?e.remove():e.data=e.data.substr(ts),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),n=e.parent,i=e.offset;if(!this.domConverter.mapViewToDom(n.root)||!n.is("element")||!NMe(n))return!1;const r=e.nodeBefore,o=e.nodeAfter;return!(r instanceof Ji||o instanceof Ji||i===n.getFillerOffset()&&(!r||!r.is("element","br"))||vt.isAndroid&&(r||o))}_updateText(e,n){const i=this.domConverter.findCorrespondingDomText(e);let o=this.domConverter.viewToDom(e).data;const s=n.inlineFillerPosition;s&&s.parent==e.parent&&s.offset==e.index&&(o=ib+o),this._updateTextNode(i,o)}_updateAttrs(e){const n=this.domConverter.mapViewToDom(e);if(n){for(const i of Array.from(n.attributes)){const r=i.name;e.hasAttribute(r)||this.domConverter.removeDomElementAttribute(n,r)}for(const i of e.getAttributeKeys())this.domConverter.setDomElementAttribute(n,i,e.getAttribute(i),e)}}_updateChildren(e,n){const i=this.domConverter.mapViewToDom(e);if(!i)return;if(vt.isAndroid){let d=null;for(const f of Array.from(i.childNodes)){if(d&&fi(d)&&fi(f)){i.normalize();break}d=f}}const r=n.inlineFillerPosition,o=i.childNodes,s=Array.from(this.domConverter.viewChildrenToDom(e,{bind:!0}));r&&r.parent===e&&T4(i.ownerDocument,s,r.offset);const a=this._diffNodeLists(o,s),l=this._findUpdateActions(a,o,s,VMe);let u=0;const c=new Set;for(const d of l)d==="delete"?(c.add(o[u]),a4(o[u])):(d==="equal"||d==="update")&&u++;u=0;for(const d of l)d==="insert"?(eG(i,u,s[u]),u++):d==="update"?(this._updateTextNode(o[u],s[u].data),u++):d==="equal"&&(this._markDescendantTextToSync(this.domConverter.domToView(s[u])),u++);for(const d of c)d.parentNode||this.domConverter.unbindDomElement(d)}_diffNodeLists(e,n){return e=zMe(e,this._fakeSelectionContainer),fm(e,n,FMe.bind(null,this.domConverter))}_findUpdateActions(e,n,i,r){if(e.indexOf("insert")===-1||e.indexOf("delete")===-1)return e;let o=[],s=[],a=[];const l={equal:0,insert:0,delete:0};for(const u of e)u==="insert"?a.push(i[l.equal+l.insert]):u==="delete"?s.push(n[l.equal+l.delete]):(o=o.concat(fm(s,a,r).map(c=>c==="equal"?"update":c)),o.push("equal"),s=[],a=[]),l[u]++;return o.concat(fm(s,a,r).map(u=>u==="equal"?"update":u))}_updateTextNode(e,n){const i=e.data;i!=n&&(vt.isAndroid&&this.isComposing&&i.replace(/\u00A0/g," ")==n.replace(/\u00A0/g," ")||this._updateTextNodeInternal(e,n))}_updateTextNodeInternal(e,n){const i=FK(e.data,n);for(const r of i)r.type==="insert"?e.insertData(r.index,r.values.join("")):e.deleteData(r.index,r.howMany)}_markDescendantTextToSync(e){if(e){if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const n of e.getChildren())this._markDescendantTextToSync(n)}}_updateSelection(){if(vt.isBlink&&!vt.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(this.selection.rangeCount===0){this._removeDomSelection(),this._removeFakeSelection();return}const e=this.domConverter.mapViewToDom(this.selection.editableElement);if(!this.isFocused||!e){!this.selection.isFake&&this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected&&this._removeFakeSelection();return}this.selection.isFake?this._updateFakeSelection(e):this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected?(this._removeFakeSelection(),this._updateDomSelection(e)):this.isComposing&&vt.isAndroid||this._updateDomSelection(e)}_updateFakeSelection(e){const n=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=HMe(n));const i=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(i,this.selection),!this._fakeSelectionNeedsUpdate(e))return;(!i.parentElement||i.parentElement!=e)&&e.appendChild(i),i.textContent=this.selection.fakeSelectionLabel||" ";const r=n.getSelection(),o=n.createRange();r.removeAllRanges(),o.selectNodeContents(i),r.addRange(o)}_updateDomSelection(e){const n=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(n))return;const i=this.domConverter.viewPositionToDom(this.selection.anchor),r=this.domConverter.viewPositionToDom(this.selection.focus);n.setBaseAndExtent(i.parent,i.offset,r.parent,r.offset),vt.isGecko&&$Me(r,n)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const n=e&&this.domConverter.domSelectionToView(e);return!(n&&this.selection.isEqual(n)||!this.selection.isCollapsed&&this.selection.isSimilar(n))}_fakeSelectionNeedsUpdate(e){const n=this._fakeSelectionContainer,i=e.ownerDocument.getSelection();return!n||n.parentElement!==e||i.anchorNode!==n&&!n.contains(i.anchorNode)?!0:n.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const e of this.domDocuments){const n=e.getSelection();if(n.rangeCount){const i=e.activeElement,r=this.domConverter.mapDomToView(i);i&&r&&n.removeAllRanges()}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function NMe(t){if(t.getAttribute("contenteditable")=="false")return!1;const e=t.findAncestor(n=>n.hasAttribute("contenteditable"));return!e||e.getAttribute("contenteditable")=="true"}function T4(t,e,n){const i=e instanceof Array?e:e.childNodes,r=i[n];if(fi(r))return r.data=ib+r.data,r;{const o=t.createTextNode(ib);return Array.isArray(e)?i.splice(n,0,o):eG(e,n,o),o}}function BMe(t,e){return Mc(t)&&Mc(e)&&!fi(t)&&!fi(e)&&!ev(t)&&!ev(e)&&t.tagName.toLowerCase()===e.tagName.toLowerCase()}function VMe(t,e){return Mc(t)&&Mc(e)&&fi(t)&&fi(e)}function FMe(t,e,n){return e===n?!0:fi(e)&&fi(n)?e.data===n.data:!!(t.isBlockFiller(e)&&t.isBlockFiller(n))}function $Me(t,e){let n=t.parent,i=t.offset;if(fi(n)&&Kh(n)&&(i=jh(n)+1,n=n.parentNode),n.nodeType!=Node.ELEMENT_NODE||i!=n.childNodes.length-1)return;const r=n.childNodes[i];r&&r.tagName=="BR"&&e.addRange(e.getRangeAt(0))}function zMe(t,e){const n=Array.from(t);return n.length==0||!e||n[n.length-1]==e&&n.pop(),n}function HMe(t){const e=t.createElement("div");return e.className="ck-fake-selection-container",Object.assign(e.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),e.textContent=" ",e}const UMe=gG(Qe.document),WMe=hG(Qe.document),qMe=mG(Qe.document),ry="data-ck-unsafe-attribute-",E4="data-ck-unsafe-element";class pS{document;renderingMode;blockFillerMode;preElements;blockElements;inlineObjectElements;unsafeElements;_domDocument;_domToViewMapping=new WeakMap;_viewToDomMapping=new WeakMap;_fakeSelectionMapping=new WeakMap;_rawContentElementMatcher=new pl;_inlineObjectElementMatcher=new pl;_elementsWithTemporaryCustomProperties=new Set;constructor(e,{blockFillerMode:n,renderingMode:i="editing"}={}){this.document=e,this.renderingMode=i,this.blockFillerMode=n||(i==="editing"?"br":"nbsp"),this.preElements=["pre","textarea"],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.unsafeElements=["script","style"],this._domDocument=this.renderingMode==="editing"?Qe.document:Qe.document.implementation.createHTMLDocument("")}get domDocument(){return this._domDocument}bindFakeSelection(e,n){this._fakeSelectionMapping.set(e,new aa(n))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,n){this._domToViewMapping.set(e,n),this._viewToDomMapping.set(n,e)}unbindDomElement(e){const n=this._domToViewMapping.get(e);if(n){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(n);for(const i of e.children)this.unbindDomElement(i)}}bindDocumentFragments(e,n){this._domToViewMapping.set(e,n),this._viewToDomMapping.set(n,e)}shouldRenderAttribute(e,n,i){return this.renderingMode==="data"?!0:(e=e.toLowerCase(),e.startsWith("on")||e==="srcdoc"&&n.match(/\bon\S+\s*=|javascript:|<\s*\/*script/i)?!1:i==="img"&&(e==="src"||e==="srcset")||i==="source"&&e==="srcset"?!0:!n.match(/^\s*(javascript:|data:(image\/svg|text\/x?html))/i))}setContentOf(e,n){if(this.renderingMode==="data"){e.innerHTML=n;return}const i=new DOMParser().parseFromString(n,"text/html"),r=i.createDocumentFragment(),o=i.body.childNodes;for(;o.length>0;)r.appendChild(o[0]);const s=i.createTreeWalker(r,NodeFilter.SHOW_ELEMENT),a=[];let l;for(;l=s.nextNode();)a.push(l);for(const u of a){for(const d of u.getAttributeNames())this.setDomElementAttribute(u,d,u.getAttribute(d));const c=u.tagName.toLowerCase();this._shouldRenameElement(c)&&(I4(c),u.replaceWith(this._createReplacementDomElement(c,u)))}for(;e.firstChild;)e.firstChild.remove();e.append(r)}viewToDom(e,n={}){if(e.is("$text")){const i=this._processDataFromViewText(e);return this._domDocument.createTextNode(i)}else{const i=e;if(this.mapViewToDom(i))if(i.getCustomProperty("editingPipeline:doNotReuseOnce"))this._elementsWithTemporaryCustomProperties.add(i);else return this.mapViewToDom(i);let r;if(i.is("documentFragment"))r=this._domDocument.createDocumentFragment(),n.bind&&this.bindDocumentFragments(r,i);else{if(i.is("uiElement"))return i.name==="$comment"?r=this._domDocument.createComment(i.getCustomProperty("$rawContent")):r=i.render(this._domDocument,this),n.bind&&this.bindElements(r,i),r;this._shouldRenameElement(i.name)?(I4(i.name),r=this._createReplacementDomElement(i.name)):i.hasAttribute("xmlns")?r=this._domDocument.createElementNS(i.getAttribute("xmlns"),i.name):r=this._domDocument.createElement(i.name),i.is("rawElement")&&i.render(r,this),n.bind&&this.bindElements(r,i);for(const o of i.getAttributeKeys())this.setDomElementAttribute(r,o,i.getAttribute(o),i)}if(n.withChildren!==!1)for(const o of this.viewChildrenToDom(i,n))r instanceof HTMLTemplateElement?r.content.appendChild(o):r.appendChild(o);return r}}setDomElementAttribute(e,n,i,r){const o=this.shouldRenderAttribute(n,i,e.tagName.toLowerCase())||r&&r.shouldRenderUnsafeAttribute(n);if(o||hn("domconverter-unsafe-attribute-detected",{domElement:e,key:n,value:i}),!CRe(n)){hn("domconverter-invalid-attribute-detected",{domElement:e,key:n,value:i});return}e.hasAttribute(n)&&!o?e.removeAttribute(n):e.hasAttribute(ry+n)&&o&&e.removeAttribute(ry+n),e.setAttribute(o?n:ry+n,i)}removeDomElementAttribute(e,n){n!=E4&&(e.removeAttribute(n),e.removeAttribute(ry+n))}*viewChildrenToDom(e,n={}){const i=e.getFillerOffset&&e.getFillerOffset();let r=0;for(const o of e.getChildren()){i===r&&(yield this._getBlockFiller());const s=o.is("element")&&!!o.getCustomProperty("dataPipeline:transparentRendering")&&!Mi(o.getAttributes());if(s&&this.renderingMode=="data")if(o.is("rawElement")){const a=this._domDocument.createElement(o.name);o.render(a,this),yield*[...a.childNodes]}else yield*this.viewChildrenToDom(o,n);else s&&hn("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:o}),yield this.viewToDom(o,n);r++}i===r&&(yield this._getBlockFiller())}viewRangeToDom(e){const n=this.viewPositionToDom(e.start),i=this.viewPositionToDom(e.end),r=this._domDocument.createRange();return r.setStart(n.parent,n.offset),r.setEnd(i.parent,i.offset),r}viewPositionToDom(e){const n=e.parent;if(n.is("$text")){const i=this.findCorrespondingDomText(n);if(!i)return null;let r=e.offset;return Qr(i)&&(r+=ts),i.data&&r>i.data.length&&(r=i.data.length),{parent:i,offset:r}}else{let i,r,o;if(e.offset===0){if(i=this.mapViewToDom(n),!i)return null;o=i.childNodes[0]}else{const a=e.nodeBefore;if(r=a.is("$text")?this.findCorrespondingDomText(a):this.mapViewToDom(a),!r)return null;i=r.parentNode,o=r.nextSibling}if(fi(o)&&Qr(o))return{parent:o,offset:ts};const s=r?jh(r)+1:0;return{parent:i,offset:s}}}domToView(e,n={}){const i=[],r=this._domToView(e,n,i),o=r.next().value;return!o||(r.next(),this._processDomInlineNodes(null,i,n),this.blockFillerMode=="br"&&A4(o))||o.is("$text")&&o.data.length==0?null:o}*domChildrenToView(e,n={},i=[]){let r=[];e instanceof HTMLTemplateElement?r=[...e.content.childNodes]:r=[...e.childNodes];for(let o=0;o{const{scrollLeft:a,scrollTop:l}=s;o.push([a,l])}),n.focus({preventScroll:!0}),x4(n,s=>{const[a,l]=o.shift();s.scrollLeft=a,s.scrollTop=l}),Qe.window.scrollTo(i,r)}_clearDomSelection(){const e=this.mapViewToDom(this.document.selection.editableElement);if(!e)return;const n=e.ownerDocument.defaultView.getSelection(),i=this.domSelectionToView(n);i&&i.rangeCount>0&&n.removeAllRanges()}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(e){return this.blockFillerMode=="br"?e.isEqualNode(UMe):P4(e,this.blockElements)?!0:e.isEqualNode(qMe)||KMe(e,this.blockElements)}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const n=this._domDocument.createRange();try{n.setStart(e.anchorNode,e.anchorOffset),n.setEnd(e.focusNode,e.focusOffset)}catch{return!1}const i=n.collapsed;return n.detach(),i}getHostViewElement(e){const n=vRe(e);for(n.pop();n.length;){const i=n.pop(),r=this._domToViewMapping.get(i);if(r&&(r.is("uiElement")||r.is("rawElement")))return r}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}registerInlineObjectMatcher(e){this._inlineObjectElementMatcher.add(e)}_clearTemporaryCustomProperties(){for(const e of this._elementsWithTemporaryCustomProperties)e._removeCustomProperty("editingPipeline:doNotReuseOnce");this._elementsWithTemporaryCustomProperties.clear()}_getBlockFiller(){switch(this.blockFillerMode){case"nbsp":return hG(this._domDocument);case"markedNbsp":return mG(this._domDocument);case"br":return gG(this._domDocument)}}_isDomSelectionPositionCorrect(e,n){if(fi(e)&&Qr(e)&&n0?n[o-1]:null,c=o+1n.is("element")&&e.includes(n.name))}function x4(t,e){let n=t;for(;n;)e(n),n=n.parentElement}function KMe(t,e){return t.isEqualNode(WMe)&&pG(t,e)&&t.parentNode.childNodes.length===1}function pG(t,e){const n=t.parentNode;return!!n&&!!n.tagName&&e.includes(n.tagName.toLowerCase())}function GMe(t,e,n){return e==" "&&t&&t.is("element")&&t.childCount==1&&n.includes(t.name)}function YMe(t,e){return e==" "&&t&&t.is("element","span")&&t.childCount==1&&t.hasAttribute("data-cke-filler")}function A4(t){return t.is("element","br")&&t.hasAttribute("data-cke-filler")}function P4(t,e){return t.tagName==="BR"&&pG(t,e)&&t.parentNode.childNodes.length===1}function I4(t){t==="script"&&hn("domconverter-unsafe-script-element-detected"),t==="style"&&hn("domconverter-unsafe-style-element-detected")}function XMe(t){if(!vt.isGecko||!t.rangeCount)return!1;const e=t.getRangeAt(0).startContainer;try{Object.prototype.toString.call(e)}catch{return!0}return!1}class _l extends zo(){view;document;_isEnabled=!1;constructor(e){super(),this.view=e,this.document=e.document}get isEnabled(){return this._isEnabled}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?!1:e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}class Sf{view;document;domEvent;domTarget;constructor(e,n,i){this.view=e,this.document=e.document,this.domEvent=n,this.domTarget=n.target,BK(this,i)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class Cl extends _l{useCapture=!1;usePassive=!1;observe(e){(typeof this.domEventType=="string"?[this.domEventType]:this.domEventType).forEach(i=>{this.listenTo(e,i,(r,o)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(o.target)&&this.onDomEvent(o)},{useCapture:this.useCapture,usePassive:this.usePassive})})}stopObserving(e){this.stopListening(e)}fire(e,n,i){this.isEnabled&&this.document.fire(e,new Sf(this.view,n,i))}}class JMe extends Cl{domEventType=["keydown","keyup"];onDomEvent(e){const n={keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return Gm(this)}};this.fire(e.type,e,n)}}class ZMe extends _l{_fireSelectionChangeDoneDebounced;constructor(e){super(e),this._fireSelectionChangeDoneDebounced=ml(n=>{this.document.fire("selectionChangeDone",n)},200)}observe(){const e=this.document;e.on("arrowKey",(n,i)=>{e.selection.isFake&&this.isEnabled&&i.preventDefault()},{context:"$capture"}),e.on("arrowKey",(n,i)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(i.keyCode)},{priority:"lowest"})}stopObserving(){}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const n=this.document.selection,i=new aa(n.getRanges(),{backward:n.isBackward,fake:!1});(e==Yt.arrowleft||e==Yt.arrowup)&&i.setTo(i.getFirstPosition()),(e==Yt.arrowright||e==Yt.arrowdown)&&i.setTo(i.getLastPosition());const r={oldSelection:n,newSelection:i,domSelection:null};this.document.fire("selectionChange",r),this._fireSelectionChangeDoneDebounced(r)}}let vG=class extends _l{domConverter;_config;_domElements;_mutationObserver;constructor(e){super(e),this._config={childList:!0,characterData:!0,subtree:!0},this.domConverter=e.domConverter,this._domElements=new Set,this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(e){this._domElements.add(e),this.isEnabled&&this._mutationObserver.observe(e,this._config)}stopObserving(e){if(this._domElements.delete(e),this.isEnabled){this._mutationObserver.disconnect();for(const n of this._domElements)this._mutationObserver.observe(n,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 n=this.domConverter,i=new Set,r=new Set;for(const s of e){const a=n.mapDomToView(s.target);a&&(a.is("uiElement")||a.is("rawElement")||s.type==="childList"&&!this._isBogusBrMutation(s)&&r.add(a))}for(const s of e){const a=n.mapDomToView(s.target);if(!(a&&(a.is("uiElement")||a.is("rawElement")))&&s.type==="characterData"){const l=n.findCorrespondingViewText(s.target);l&&!r.has(l.parent)?i.add(l):!l&&Qr(s.target)&&r.add(n.mapDomToView(s.target.parentNode))}}const o=[];for(const s of i)o.push({type:"text",node:s});for(const s of r){const a=n.mapViewToDom(s),l=Array.from(s.getChildren()),u=Array.from(n.domChildrenToView(a,{withChildren:!1}));pA(l,u,QMe)||o.push({type:"children",node:s})}o.length&&this.document.fire("mutations",{mutations:o})}_isBogusBrMutation(e){let n=null;return e.nextSibling===null&&e.removedNodes.length===0&&e.addedNodes.length==1&&(n=this.domConverter.domToView(e.addedNodes[0],{withChildren:!1})),n&&n.is("element","br")}};function QMe(t,e){if(!Array.isArray(t))return t===e?!0:t.is("$text")&&e.is("$text")?t.data===e.data:!1}class d1 extends Cl{_renderTimeoutId=null;_isFocusChanging=!1;domEventType=["focus","blur"];constructor(e){super(e),this.useCapture=!0;const n=this.document;n.on("focus",()=>this._handleFocus()),n.on("blur",(i,r)=>this._handleBlur(r)),n.on("beforeinput",()=>{n.isFocused||this._handleFocus()},{priority:"highest"})}flush(){this._isFocusChanging&&(this._isFocusChanging=!1,this.document.isFocused=!0)}onDomEvent(e){this.fire(e.type,e)}destroy(){this._clearTimeout(),super.destroy()}_handleFocus(){this._clearTimeout(),this._isFocusChanging=!0,this._renderTimeoutId=setTimeout(()=>{this._renderTimeoutId=null,this.flush(),this.view.change(()=>{})},50)}_handleBlur(e){const n=this.document.selection.editableElement;(n===null||n===e.target)&&(this.document.isFocused=!1,this._isFocusChanging=!1,this.view.change(()=>{}))}_clearTimeout(){this._renderTimeoutId&&(clearTimeout(this._renderTimeoutId),this._renderTimeoutId=null)}}class eOe extends _l{mutationObserver;focusObserver;selection;domConverter;_documents=new WeakSet;_fireSelectionChangeDoneDebounced;_clearInfiniteLoopInterval;_documentIsSelectingInactivityTimeoutDebounced;_loopbackCounter=0;_pendingSelectionChange=new Set;constructor(e){super(e),this.mutationObserver=e.getObserver(vG),this.focusObserver=e.getObserver(d1),this.selection=this.document.selection,this.domConverter=e.domConverter,this._fireSelectionChangeDoneDebounced=ml(n=>{this.document.fire("selectionChangeDone",n)},200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._documentIsSelectingInactivityTimeoutDebounced=ml(()=>this.document.isSelecting=!1,5e3),this.view.document.on("change:isFocused",(n,i,r)=>{if(r&&this._pendingSelectionChange.size){for(const o of Array.from(this._pendingSelectionChange))this._handleSelectionChange(o);this._pendingSelectionChange.clear()}})}observe(e){const n=e.ownerDocument,i=()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()},r=()=>{this.document.isSelecting&&(this._handleSelectionChange(n),this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel())};this.listenTo(e,"selectstart",i,{priority:"highest"}),this.listenTo(e,"keydown",r,{priority:"highest",useCapture:!0}),this.listenTo(e,"keyup",r,{priority:"highest",useCapture:!0}),!this._documents.has(n)&&(this.listenTo(n,"mouseup",r,{priority:"highest",useCapture:!0}),this.listenTo(n,"selectionchange",()=>{this.document.isComposing&&!vt.isAndroid||(this._handleSelectionChange(n),this._documentIsSelectingInactivityTimeoutDebounced())}),this.listenTo(this.view.document,"compositionstart",()=>{this._handleSelectionChange(n)},{priority:"lowest"}),this._documents.add(n))}stopObserving(e){this.stopListening(e)}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_reportInfiniteLoop(){}_handleSelectionChange(e){if(!this.isEnabled)return;const n=e.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(n.anchorNode))return;this.mutationObserver.flush();const i=this.domConverter.domSelectionToView(n);if(i.rangeCount==0){this.view.hasDomSelection=!1;return}if(this.view.hasDomSelection=!0,this.focusObserver.flush(),!this.view.document.isFocused&&!this.view.document.isReadOnly){this._pendingSelectionChange.add(e);return}if(this._pendingSelectionChange.delete(e),!(this.selection.isEqual(i)&&this.domConverter.isDomSelectionCorrect(n))){if(++this._loopbackCounter>60){this._reportInfiniteLoop();return}if(!tOe(i))this.view.forceRender();else 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)}}}_clearInfiniteLoop(){this._loopbackCounter=0}}function tOe(t){return Array.from(t.getRanges()).flatMap(e=>[e.start.root,e.end.root]).every(e=>e&&e.is("rootElement"))}class nOe extends Cl{domEventType=["compositionstart","compositionupdate","compositionend"];constructor(e){super(e);const n=this.document;n.on("compositionstart",()=>{n.isComposing=!0}),n.on("compositionend",()=>{n.isComposing=!1})}onDomEvent(e){this.fire(e.type,e,{data:e.data})}}class bG{_files;_native;constructor(e,n={}){this._files=n.cacheFiles?R4(e):null,this._native=e}get files(){return this._files||(this._files=R4(this._native)),this._files}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,n){this._native.setData(e,n)}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}setDragImage(e,n,i){this._native.setDragImage(e,n,i)}get isCanceled(){return this._native.dropEffect=="none"||!!this._native.mozUserCancelled}}function R4(t){const e=Array.from(t.files||[]),n=Array.from(t.items||[]);return e.length?e:n.filter(i=>i.kind==="file").map(i=>i.getAsFile())}class iOe extends Cl{domEventType="beforeinput";onDomEvent(e){const n=e.getTargetRanges(),i=this.view,r=i.document;let o=null,s=null,a=[];if(e.dataTransfer&&(o=new bG(e.dataTransfer)),e.data!==null?s=e.data:o&&(s=o.getData("text/plain")),r.selection.isFake)a=Array.from(r.selection.getRanges()),e.preventDefault();else if(n.length)a=n.map(l=>{let u=i.domConverter.domPositionToView(l.startContainer,l.startOffset);const c=i.domConverter.domPositionToView(l.endContainer,l.endOffset);if(u&&Qr(l.startContainer)&&l.startOffset!!(f.item.is("attributeElement")||f.item.is("uiElement")||f.item.is("$textProxy")&&d--),{direction:"backward",singleCharacters:!0})}if(rOe(l.endContainer,l.endOffset)&&e.preventDefault(),u)return i.createRange(u,c);if(c)return i.createRange(c)}).filter(l=>!!l);else if(vt.isAndroid){const l=e.target.ownerDocument.defaultView.getSelection();a=Array.from(i.domConverter.domSelectionToView(l).getRanges())}if(vt.isAndroid&&e.inputType=="insertCompositionText"&&s&&s.endsWith(` +`)){this.fire(e.type,e,{inputType:"insertParagraph",targetRanges:[i.createRange(a[0].end)]});return}if(["insertText","insertReplacementText"].includes(e.inputType)&&s&&s.includes(` +`)){const l=s.split(/\n{1,2}/g);let u=a;e.preventDefault();for(let c=0;c{if(this.isEnabled&&RRe(i.keyCode)){const r=new Hf(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(r,i),r.stop.called&&n.stop()}})}observe(){}stopObserving(){}}class sOe extends _l{constructor(e){super(e);const n=this.document;n.on("keydown",(i,r)=>{if(!this.isEnabled||r.keyCode!=Yt.tab||r.ctrlKey)return;const o=new Hf(n,"tab",n.selection.getFirstRange());n.fire(o,r),o.stop.called&&i.stop()})}observe(){}stopObserving(){}}class aOe extends Ln(){document;domConverter;domRoots=new Map;_renderer;_initialDomRootAttributes=new WeakMap;_observers=new Map;_writer;_ongoingChange=!1;_postFixersInProgress=!1;_renderingDisabled=!1;_hasChangedSinceTheLastRendering=!1;constructor(e){super(),this.document=new mS(e),this.domConverter=new pS(this.document),this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new DMe(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting","isComposing").to(this.document,"isFocused","isSelecting","isComposing"),this._writer=new dG(this.document),this.addObserver(vG),this.addObserver(d1),this.addObserver(eOe),this.addObserver(JMe),this.addObserver(ZMe),this.addObserver(nOe),this.addObserver(oOe),this.addObserver(iOe),this.addObserver(sOe),OMe(this),kMe(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}),vt.isiOS&&this.listenTo(this.document,"blur",(n,i)=>{this.domConverter.mapDomToView(i.domEvent.relatedTarget)||this.domConverter._clearDomSelection()}),this.listenTo(this.document,"mutations",(n,{mutations:i})=>{i.forEach(r=>this._renderer.markToSync(r.type,r.node))},{priority:"low"}),this.listenTo(this.document,"mutations",()=>{this.forceRender()},{priority:"lowest"})}attachDomRoot(e,n="main"){const i=this.document.getRoot(n);i._name=e.tagName.toLowerCase();const r={};for(const{name:s,value:a}of Array.from(e.attributes))r[s]=a,s==="class"?this._writer.addClass(a.split(" "),i):i.hasAttribute(s)||this._writer.setAttribute(s,a,i);this._initialDomRootAttributes.set(e,r);const o=()=>{this._writer.setAttribute("contenteditable",(!i.isReadOnly).toString(),i),i.isReadOnly?this._writer.addClass("ck-read-only",i):this._writer.removeClass("ck-read-only",i)};o(),this.domRoots.set(n,e),this.domConverter.bindElements(e,i),this._renderer.markToSync("children",i),this._renderer.markToSync("attributes",i),this._renderer.domDocuments.add(e.ownerDocument),i.on("change:children",(s,a)=>this._renderer.markToSync("children",a)),i.on("change:attributes",(s,a)=>this._renderer.markToSync("attributes",a)),i.on("change:text",(s,a)=>this._renderer.markToSync("text",a)),i.on("change:isReadOnly",()=>this.change(o)),i.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const s of this._observers.values())s.observe(e,n)}detachDomRoot(e){const n=this.domRoots.get(e);Array.from(n.attributes).forEach(({name:r})=>n.removeAttribute(r));const i=this._initialDomRootAttributes.get(n);for(const r in i)n.setAttribute(r,i[r]);this.domRoots.delete(e),this.domConverter.unbindDomElement(n);for(const r of this._observers.values())r.stopObserving(n)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let n=this._observers.get(e);if(n)return n;n=new e(this),this._observers.set(e,n);for(const[i,r]of this.domRoots)n.observe(r,i);return n.enable(),n}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({alignToTop:e,forceScroll:n,viewportOffset:i=20,ancestorOffset:r=20}={}){const o=this.document.selection.getFirstRange();if(!o)return;const s=Bo({alignToTop:e,forceScroll:n,viewportOffset:i,ancestorOffset:r});typeof i=="number"&&(i={top:i,bottom:i,left:i,right:i});const a={target:this.domConverter.viewRangeToDom(o),viewportOffset:i,ancestorOffset:r,alignToTop:e,forceScroll:n};this.fire("scrollToTheSelection",a,s),kRe(a)}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 oe("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const n=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")),n}catch(n){oe.rethrowUnexpectedError(n,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.getObserver(d1).flush(),this.change(()=>{})}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,n){return Ge._createAt(e,n)}createPositionAfter(e){return Ge._createAfter(e)}createPositionBefore(e){return Ge._createBefore(e)}createRange(e,n){return new Nt(e,n)}createRangeOn(e){return Nt._createOn(e)}createRangeIn(e){return Nt._createIn(e)}createSelection(...e){return new aa(...e)}_disableRendering(e){this._renderingDisabled=e,e==!1&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}class Kc{is(){throw new Error("is() method is abstract")}}class ea extends Kc{textNode;data;offsetInText;constructor(e,n,i){if(super(),this.textNode=e,n<0||n>e.offsetSize)throw new oe("model-textproxy-wrong-offsetintext",this);if(i<0||n+i>e.offsetSize)throw new oe("model-textproxy-wrong-length",this);this.data=e.data.substring(n,n+i),this.offsetInText=n}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}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={}){const n=[];let i=e.includeSelf?this:this.parent;for(;i;)n[e.parentFirst?"push":"unshift"](i),i=i.parent;return n}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}ea.prototype.is=function(t){return t==="$textProxy"||t==="model:$textProxy"||t==="textProxy"||t==="model:textProxy"};class Ql{direction;boundaries;singleCharacters;shallow;ignoreElementEnd;_position;_boundaryStartParent;_boundaryEndParent;_visitedParent;constructor(e){if(!e||!e.boundaries&&!e.startPosition)throw new oe("model-tree-walker-no-start-position",null);const n=e.direction||"forward";if(n!="forward"&&n!="backward")throw new oe("model-tree-walker-unknown-direction",e,{direction:n});this.direction=n,this.boundaries=e.boundaries||null,e.startPosition?this._position=e.startPosition.clone():this._position=Be._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}get position(){return this._position}skip(e){let n,i,r,o;do r=this.position,o=this._visitedParent,{done:n,value:i}=this.next();while(!n&&e(i));n||(this._position=r,this._visitedParent=o)}jumpTo(e){this._boundaryStartParent&&e.isBefore(this.boundaries.start)?e=this.boundaries.start:this._boundaryEndParent&&e.isAfter(this.boundaries.end)&&(e=this.boundaries.end),this._position=e.clone(),this._visitedParent=e.parent}next(){return this.direction=="forward"?this._next():this._previous()}_next(){const e=this.position,n=this.position.clone(),i=this._visitedParent;if(i.parent===null&&n.offset===i.maxOffset)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&n.offset==this.boundaries.end.offset)return{done:!0,value:void 0};const r=nv(n,i),o=r||yG(n,i,r);if(o&&o.is("model:element")){if(!this.shallow)n.path.push(0),this._visitedParent=o;else{if(this.boundaries&&this.boundaries.end.isBefore(n))return{done:!0,value:void 0};n.offset++}return this._position=n,ad("elementStart",o,e,n,1)}if(o&&o.is("model:$text")){let s;if(this.singleCharacters)s=1;else{let u=o.endOffset;this._boundaryEndParent==i&&this.boundaries.end.offsetc&&(c=this.boundaries.start.offset),a=n.offset-c}const l=n.offset-s.startOffset,u=new ea(s,l-a,a);return n.offset-=a,this._position=n,ad("text",u,e,n,a)}return n.path.pop(),this._position=n,this._visitedParent=i.parent,ad("elementStart",i,e,n,1)}}function ad(t,e,n,i,r){return{done:!1,value:{type:t,item:e,previousPosition:n,nextPosition:i,length:r}}}class Be extends Kc{root;path;stickiness;constructor(e,n,i="toNone"){if(super(),!e.is("element")&&!e.is("documentFragment"))throw new oe("model-position-root-invalid",e);if(!Array.isArray(n)||n.length===0)throw new oe("model-position-path-incorrect-format",e,{path:n});e.is("rootElement")?n=n.slice():(n=[...e.getPath(),...n],e=e.root),this.root=e,this.path=n,this.stickiness=i}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 n=0;n1)return!1;if(r===1)return M4(e,this,i);if(r===-1)return M4(this,e,i)}return this.path.length===e.path.length?!0:this.path.length>e.path.length?kA(this.path,n):kA(e.path,n)}hasSameParentAs(e){if(this.root!==e.root)return!1;const n=this.getParentPath(),i=e.getParentPath();return ur(n,i)=="same"}getTransformedByOperation(e){let n;switch(e.type){case"insert":n=this._getTransformedByInsertOperation(e);break;case"move":case"remove":case"reinsert":n=this._getTransformedByMoveOperation(e);break;case"split":n=this._getTransformedBySplitOperation(e);break;case"merge":n=this._getTransformedByMergeOperation(e);break;default:n=Be._createAt(this);break}return n}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const n=e.movedRange;return n.containsPosition(this)||n.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 n=e.movedRange,i=n.containsPosition(this)||n.start.isEqual(this);let r;return i?(r=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(r=r._getTransformedByDeletion(e.deletionPosition,1))):this.isEqual(e.deletionPosition)?r=Be._createAt(e.deletionPosition):r=this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),r}_getTransformedByDeletion(e,n){const i=Be._createAt(this);if(this.root!=e.root)return i;if(ur(e.getParentPath(),this.getParentPath())=="same"){if(e.offsetthis.offset)return null;i.offset-=n}}else if(ur(e.getParentPath(),this.getParentPath())=="prefix"){const r=e.path.length-1;if(e.offset<=this.path[r]){if(e.offset+n>this.path[r])return null;i.path[r]-=n}}return i}_getTransformedByInsertion(e,n){const i=Be._createAt(this);if(this.root!=e.root)return i;if(ur(e.getParentPath(),this.getParentPath())=="same")(e.offset=e;){if(t.path[i]+r!==n.maxOffset)return!1;r=1,i--,n=n.parent}return!0}class Ee extends Kc{start;end;constructor(e,n){super(),this.start=Be._createAt(e),this.end=n?Be._createAt(n):Be._createAt(e),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}*[Symbol.iterator](){yield*new Ql({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){const e=this.start.getParentPath(),n=this.end.getParentPath();return ur(e,n)=="same"}get root(){return this.start.root}containsPosition(e){return e.isAfter(this.start)&&e.isBefore(this.end)}containsRange(e,n=!1){e.isCollapsed&&(n=!1);const i=this.containsPosition(e.start)||n&&this.start.isEqual(e.start),r=this.containsPosition(e.end)||n&&this.end.isEqual(e.end);return i&&r}containsItem(e){const n=Be._createBefore(e);return this.containsPosition(n)||this.start.isEqual(n)}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 n=[];return this.isIntersecting(e)?(this.containsPosition(e.start)&&n.push(new Ee(this.start,e.start)),this.containsPosition(e.end)&&n.push(new Ee(e.end,this.end))):n.push(new Ee(this.start,this.end)),n}getIntersection(e){if(this.isIntersecting(e)){let n=this.start,i=this.end;return this.containsPosition(e.start)&&(n=e.start),this.containsPosition(e.end)&&(i=e.end),new Ee(n,i)}return null}getJoined(e,n=!1){let i=this.isIntersecting(e);if(i||(this.start.isBefore(e.start)?i=n?this.end.isTouching(e.start):this.end.isEqual(e.start):i=n?e.end.isTouching(this.start):e.end.isEqual(this.start)),!i)return null;let r=this.start,o=this.end;return e.start.isBefore(r)&&(r=e.start),e.end.isAfter(o)&&(o=e.end),new Ee(r,o)}getMinimalFlatRanges(){const e=[],n=this.start.getCommonPath(this.end).length,i=Be._createAt(this.start);let r=i.parent;for(;i.path.length>n+1;){const o=r.maxOffset-i.offset;o!==0&&e.push(new Ee(i,i.getShiftedBy(o))),i.path=i.path.slice(0,-1),i.offset++,r=r.parent}for(;i.path.length<=this.end.path.length;){const o=this.end.path[i.path.length-1],s=o-i.offset;s!==0&&e.push(new Ee(i,i.getShiftedBy(s))),i.offset=o,i.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new Ql(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const n=new Ql(e);for(const i of n)yield i.item}*getPositions(e={}){e.boundaries=this;const n=new Ql(e);yield n.position;for(const i of n)yield i.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 Ee(this.start,this.end)]}getTransformedByOperations(e){const n=[new Ee(this.start,this.end)];for(const i of e)for(let r=0;r0?new this(i,r):new this(r,i)}static _createIn(e){return new this(Be._createAt(e,0),Be._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(Be._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(e.length===0)throw new oe("range-create-from-ranges-empty-array",null);if(e.length==1)return e[0].clone();const n=e[0];e.sort((o,s)=>o.start.isAfter(s.start)?1:-1);const i=e.indexOf(n),r=new this(n.start,n.end);for(let o=i-1;o>=0&&e[o].end.isEqual(r.start);o--)r.start=Be._createAt(e[o].start);for(let o=i+1;o{if(n.viewPosition)return;const i=this._modelToViewMapping.get(n.modelPosition.parent);if(!i)throw new oe("mapping-model-position-view-parent-not-found",this,{modelPosition:n.modelPosition});n.viewPosition=this.findPositionIn(i,n.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(e,n)=>{if(n.modelPosition)return;const i=this.findMappedViewAncestor(n.viewPosition),r=this._viewToModelMapping.get(i),o=this._toModelOffset(n.viewPosition.parent,n.viewPosition.offset,i);n.modelPosition=Be._createAt(r,o)},{priority:"low"})}bindElements(e,n){this._modelToViewMapping.set(e,n),this._viewToModelMapping.set(n,e)}unbindViewElement(e,n={}){const i=this.toModelElement(e);if(this._elementToMarkerNames.has(e))for(const r of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(r);n.defer?this._deferredBindingRemovals.set(e,e.root):(this._viewToModelMapping.delete(e)&&this._cache.stopTracking(e),this._modelToViewMapping.get(i)==e&&this._modelToViewMapping.delete(i))}unbindModelElement(e){const n=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(n)==e&&this._viewToModelMapping.delete(n)&&this._cache.stopTracking(n)}bindElementToMarker(e,n){const i=this._markerNameToElements.get(n)||new Set;i.add(e);const r=this._elementToMarkerNames.get(e)||new Set;r.add(n),this._markerNameToElements.set(n,i),this._elementToMarkerNames.set(e,r)}unbindElementFromMarkerName(e,n){const i=this._markerNameToElements.get(n);i&&(i.delete(e),i.size==0&&this._markerNameToElements.delete(n));const r=this._elementToMarkerNames.get(e);r&&(r.delete(n),r.size==0&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}flushDeferredBindings(){for(const[e,n]of this._deferredBindingRemovals)e.root==n&&this.unbindViewElement(e);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new Ee(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new Nt(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const n={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",n),n.modelPosition}toViewPosition(e,n={}){const i={modelPosition:e,mapper:this,isPhantom:n.isPhantom};return this.fire("modelToViewPosition",i),i.viewPosition}markerNameToElements(e){const n=this._markerNameToElements.get(e);if(!n)return null;const i=new Set;for(const r of n)if(r.is("attributeElement"))for(const o of r.getElementsWithSameId())i.add(o);else i.add(r);return i}registerViewToModelLength(e,n){this._viewToModelLengthCallbacks.set(e,n)}findMappedViewAncestor(e){let n=e.parent;for(;!this._viewToModelMapping.has(n);)n=n.parent;return n}_toModelOffset(e,n,i){if(i!=e){const o=this._toModelOffset(e.parent,e.index,i),s=this._toModelOffset(e,n,e);return o+s}if(e.is("$text"))return n;let r=0;for(let o=0;o0;){const r=n.pop(),o=r.name&&this._viewToModelLengthCallbacks.size>0&&this._viewToModelLengthCallbacks.get(r.name);if(o)i+=o(r);else if(this._viewToModelMapping.has(r))i+=1;else if(r.is("$text"))i+=r.data.length;else{if(r.is("uiElement"))continue;for(const s of r.getChildren())n.push(s)}}return i}findPositionIn(e,n){if(n===0)return this._moveViewPositionToTextNode(new Ge(e,0));if(this._viewToModelLengthCallbacks.size==0&&this._viewToModelMapping.has(e)){const r=this._cache.getClosest(e,n);return this._findPositionStartingFrom(r.viewPosition,r.modelOffset,n,e,!0)}else return this._findPositionStartingFrom(new Ge(e,0),0,n,e,!1)}_findPositionStartingFrom(e,n,i,r,o){let s=e.parent,a=e.offset;if(s.is("$text"))return new Ge(s,i-n);let l,u=n,c=0;for(;u{this._clearCacheInsideParent(n,i.index)};_invalidateOnTextChangeCallback=(e,n)=>{this._clearCacheAfter(n)};save(e,n,i,r){const o=this._cachedMapping.get(i),s=o.cacheMap.get(r);if(s){const c=e.getChild(n-1),d=s.viewPosition.nodeBefore?this._nodeToCacheListIndex.get(s.viewPosition.nodeBefore):0;this._nodeToCacheListIndex.set(c,d);return}const l={viewPosition:new Ge(e,n),modelOffset:r};o.maxModelOffset=r>o.maxModelOffset?r:o.maxModelOffset,o.cacheMap.set(r,l);let u=o.cacheList.length-1;for(;u>=0&&o.cacheList[u].modelOffset>r;)u--;if(o.cacheList.splice(u+1,0,l),n>0){const c=e.getChild(n-1);this._nodeToCacheListIndex.set(c,u+1)}}getClosest(e,n){const i=this._cachedMapping.get(e);let r;if(i)if(n>i.maxModelOffset)r=i.cacheList[i.cacheList.length-1];else{const o=i.cacheMap.get(n);o?r=o:r=this._findInCacheList(i.cacheList,n)}else r=this.startTracking(e);return{modelOffset:r.modelOffset,viewPosition:r.viewPosition.clone()}}startTracking(e){const i={viewPosition:new Ge(e,0),modelOffset:0},r={maxModelOffset:0,cacheList:[i],cacheMap:new Map([[0,i]])};return this._cachedMapping.set(e,r),e.on("change:children",this._invalidateOnChildrenChangeCallback),e.on("change:text",this._invalidateOnTextChangeCallback),i}stopTracking(e){e.off("change:children",this._invalidateOnChildrenChangeCallback),e.off("change:text",this._invalidateOnTextChangeCallback),this._cachedMapping.delete(e)}_clearCacheInsideParent(e,n){if(n==0)this._cachedMapping.has(e)?this._clearCacheAll(e):this._clearCacheInsideParent(e.parent,e.index);else{const i=e.getChild(n-1);this._clearCacheAfter(i)}}_clearCacheAll(e){const n=this._cachedMapping.get(e);n.maxModelOffset>0&&(n.maxModelOffset=0,n.cacheList.length=1,n.cacheMap.clear(),n.cacheMap.set(0,n.cacheList[0]))}_clearCacheAfter(e){const n=this._nodeToCacheListIndex.get(e);if(n===void 0){const r=e.parent;this._cachedMapping.has(r)||this._clearCacheInsideParent(r.parent,r.index);return}let i=e.parent;for(;!this._cachedMapping.has(i);)i=i.parent;this._clearCacheFromCacheIndex(i,n)}_clearCacheFromCacheIndex(e,n){n===0&&(n=1);const i=this._cachedMapping.get(e),r=i.cacheList[n-1];if(!r)return;i.maxModelOffset=r.modelOffset;const o=i.cacheList.splice(n);for(const s of o){i.cacheMap.delete(s.modelOffset);const a=s.viewPosition.nodeBefore;this._nodeToCacheListIndex.delete(a)}}_findInCacheList(e,n){let i=0,r=e.length-1,o=r-i>>1,s=e[o];for(;i>1),s=e[o];return s.modelOffset<=n?s:e[o-1]}}class cOe{_consumable=new Map;_textProxyRegistry=new Map;add(e,n){n=oy(n),e instanceof ea&&(e=this._getSymbolForTextProxy(e)),this._consumable.has(e)||this._consumable.set(e,new Map),this._consumable.get(e).set(n,!0)}consume(e,n){return n=oy(n),e instanceof ea&&(e=this._getSymbolForTextProxy(e)),this.test(e,n)?(this._consumable.get(e).set(n,!1),!0):!1}test(e,n){n=oy(n),e instanceof ea&&(e=this._getSymbolForTextProxy(e));const i=this._consumable.get(e);if(i===void 0)return null;const r=i.get(n);return r===void 0?null:r}revert(e,n){n=oy(n),e instanceof ea&&(e=this._getSymbolForTextProxy(e));const i=this.test(e,n);return i===!1?(this._consumable.get(e).set(n,!0),!0):i===!0?!1:null}verifyAllConsumed(e){const n=[];for(const[i,r]of this._consumable)for(const[o,s]of r){const a=o.split(":")[0];s&&e==a&&n.push({event:o,item:i.name||i.description})}if(n.length)throw new oe("conversion-model-consumable-not-consumed",null,{items:n})}_getSymbolForTextProxy(e){let n=null;const i=this._textProxyRegistry.get(e.startOffset);if(i){const r=i.get(e.endOffset);r&&(n=r.get(e.parent))}return n||(n=this._addSymbolForTextProxy(e)),n}_addSymbolForTextProxy(e){const n=e.startOffset,i=e.endOffset,r=e.parent,o=Symbol("$textProxy:"+e.data);let s,a;return s=this._textProxyRegistry.get(n),s||(s=new Map,this._textProxyRegistry.set(n,s)),a=s.get(i),a||(a=new Map,s.set(i,a)),a.set(r,o),o}}function oy(t){const e=t.split(":");return e[0]=="insert"?e[0]:e[0]=="addMarker"||e[0]=="removeMarker"?t:e.length>1?e[0]+":"+e[1]:e[0]}class CG extends Fn(){_conversionApi;_firedEventsMap;constructor(e){super(),this._conversionApi={dispatcher:this,...e},this._firedEventsMap=new WeakMap}convertChanges(e,n,i){const r=e.getRefreshedItems(),o=this._createConversionApi(i,r);for(const a of e.getMarkersToRemove())this._convertMarkerRemove(a.name,a.range,o);const s=this._reduceChanges(e.getChanges(),r);for(const a of s)a.type==="insert"?this._convertInsert(Ee._createFromPositionAndShift(a.position,a.length),o):a.type==="reinsert"?this._convertReinsert(Ee._createFromPositionAndShift(a.position,a.length),o):a.type==="remove"?this._convertRemove(a.position,a.length,a.name,o):this._convertAttribute(a.range,a.attributeKey,a.attributeOldValue,a.attributeNewValue,o);o.mapper.flushDeferredBindings();for(const a of o.mapper.flushUnboundMarkerNames()){const l=n.get(a).getRange();this._convertMarkerRemove(a,l,o),this._convertMarkerAdd(a,l,o)}for(const a of e.getMarkersToAdd())this._convertMarkerAdd(a.name,a.range,o);o.consumable.verifyAllConsumed("insert")}convert(e,n,i,r={}){const o=this._createConversionApi(i,void 0,r);this._convertInsert(e,o);for(const[s,a]of n)this._convertMarkerAdd(s,a,o);o.consumable.verifyAllConsumed("insert")}convertSelection(e,n,i){const r=this._createConversionApi(i);this.fire("cleanSelection",{selection:e},r);const o=e.getFirstPosition().root;if(!r.mapper.toViewElement(o))return;const s=Array.from(n.getMarkersAtPosition(e.getFirstPosition()));if(this._addConsumablesForSelection(r.consumable,e,s),this.fire("selection",{selection:e},r),!!e.isCollapsed){for(const a of s)if(r.consumable.test(e,"addMarker:"+a.name)){const l=a.getRange();if(!dOe(e.getFirstPosition(),a,r.mapper))continue;const u={item:e,markerName:a.name,markerRange:l};this.fire(`addMarker:${a.name}`,u,r)}for(const a of e.getAttributeKeys())if(r.consumable.test(e,"attribute:"+a)){const l={item:e,range:e.getFirstRange(),attributeKey:a,attributeOldValue:null,attributeNewValue:e.getAttribute(a)};this.fire(`attribute:${a}:$text`,l,r)}}}_convertInsert(e,n,i={}){i.doNotAddConsumables||this._addConsumablesForInsert(n.consumable,e);for(const r of e.getWalker({shallow:!0}))this._testAndFire("insert",O4(r),n)}_convertRemove(e,n,i,r){this.fire(`remove:${i}`,{position:e,length:n},r)}_convertAttribute(e,n,i,r,o){this._addConsumablesForRange(o.consumable,e,`attribute:${n}`);for(const s of e){const a={item:s.item,range:Ee._createFromPositionAndShift(s.previousPosition,s.length),attributeKey:n,attributeOldValue:i,attributeNewValue:r};this._testAndFire(`attribute:${n}`,a,o)}}_convertReinsert(e,n){const i=Array.from(e.getWalker({shallow:!0}));this._addConsumablesForInsert(n.consumable,i);for(const r of i.map(O4))this.fire(`remove:${r.item.is("element")?r.item.name:"$text"}`,{position:r.range.start,length:r.item.offsetSize,reconversion:!0},n),this._testAndFire("insert",{...r,reconversion:!0},n)}_convertMarkerAdd(e,n,i){if(n.root.rootName=="$graveyard")return;const r=`addMarker:${e}`;if(i.consumable.add(n,r),this.fire(r,{markerName:e,markerRange:n},i),!!i.consumable.consume(n,r)){this._addConsumablesForRange(i.consumable,n,r);for(const o of n.getItems()){if(!i.consumable.test(o,r))continue;const s={item:o,range:Ee._createOn(o),markerName:e,markerRange:n};this.fire(r,s,i)}}}_convertMarkerRemove(e,n,i){n.root.rootName!="$graveyard"&&this.fire(`removeMarker:${e}`,{markerName:e,markerRange:n},i)}_reduceChanges(e,n){const i={changes:e,refreshedItems:n};return this.fire("reduceChanges",i),i.changes}_addConsumablesForInsert(e,n){for(const i of n){const r=i.item;if(e.test(r,"insert")===null){e.add(r,"insert");for(const o of r.getAttributeKeys())e.add(r,"attribute:"+o)}}return e}_addConsumablesForRange(e,n,i){for(const r of n.getItems())e.add(r,i);return e}_addConsumablesForSelection(e,n,i){e.add(n,"selection");for(const r of i)e.add(n,"addMarker:"+r.name);for(const r of n.getAttributeKeys())e.add(n,"attribute:"+r);return e}_testAndFire(e,n,i){const r=fOe(e,n),o=n.item.is("$textProxy")?i.consumable._getSymbolForTextProxy(n.item):n.item,s=this._firedEventsMap.get(i),a=s.get(o);if(!a)s.set(o,new Set([r]));else if(!a.has(r))a.add(r);else return;this.fire(r,n,i)}_testAndFireAddAttributes(e,n){const i={item:e,range:Ee._createOn(e)};for(const r of i.item.getAttributeKeys())i.attributeKey=r,i.attributeOldValue=null,i.attributeNewValue=i.item.getAttribute(r),this._testAndFire(`attribute:${r}`,i,n)}_createConversionApi(e,n=new Set,i={}){const r={...this._conversionApi,consumable:new cOe,writer:e,options:i,convertItem:o=>this._convertInsert(Ee._createOn(o),r),convertChildren:o=>this._convertInsert(Ee._createIn(o),r,{doNotAddConsumables:!0}),convertAttributes:o=>this._testAndFireAddAttributes(o,r),canReuseView:o=>!n.has(r.mapper.toModelElement(o))};return this._firedEventsMap.set(r,new Map),r}}function dOe(t,e,n){const i=e.getRange(),r=Array.from(t.getAncestors());return r.shift(),r.reverse(),!r.some(s=>{if(i.containsItem(s))return!!n.toViewElement(s).getCustomProperty("addHighlight")})}function fOe(t,e){const n=e.item.is("element")?e.item.name:"$text";return`${t}:${n}`}function O4(t){return{item:t.item,range:Ee._createFromPositionAndShift(t.previousPosition,t.length)}}class Uf extends Kc{parent=null;_attrs;_index=null;_startOffset=null;constructor(e){super(),this._attrs=gl(e)}get document(){return null}get index(){return this._index}get startOffset(){return this._startOffset}get offsetSize(){return 1}get endOffset(){return this.startOffset===null?null:this.startOffset+this.offsetSize}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.parent===null?!1:this.root.isAttached()}getPath(){const e=[];let n=this;for(;n.parent;)e.unshift(n.startOffset),n=n.parent;return e}getAncestors(e={}){const n=[];let i=e.includeSelf?this:this.parent;for(;i;)n[e.parentFirst?"push":"unshift"](i),i=i.parent;return n}getCommonAncestor(e,n={}){const i=this.getAncestors(n),r=e.getAncestors(n);let o=0;for(;i[o]==r[o]&&i[o];)o++;return o===0?null:i[o-1]}isBefore(e){if(this==e||this.root!==e.root)return!1;const n=this.getPath(),i=e.getPath(),r=ur(n,i);switch(r){case"prefix":return!0;case"extension":return!1;default:return n[r](n[i[0]]=i[1],n),{})),e}_clone(e){return new this.constructor(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,n){this._attrs.set(e,n)}_setAttributesTo(e){this._attrs=gl(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}Uf.prototype.is=function(t){return t==="node"||t==="model:node"};class Xo extends Fn(Kc){_lastRangeBackward=!1;_attrs=new Map;_ranges=[];constructor(...e){super(),e.length&&this.setTo(...e)}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:!1}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 n of this._ranges){let i=!1;for(const r of e._ranges)if(n.isEqual(r)){i=!0;break}if(!i)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new Ee(e.start,e.end)}getFirstRange(){let e=null;for(const n of this._ranges)(!e||n.start.isBefore(e.start))&&(e=n);return e?new Ee(e.start,e.end):null}getLastRange(){let e=null;for(const n of this._ranges)(!e||n.end.isAfter(e.end))&&(e=n);return e?new Ee(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){let[n,i,r]=e;if(typeof i=="object"&&(r=i,i=void 0),n===null)this._setRanges([]);else if(n instanceof Xo)this._setRanges(n.getRanges(),n.isBackward);else if(n&&typeof n.getRanges=="function")this._setRanges(n.getRanges(),n.isBackward);else if(n instanceof Ee)this._setRanges([n],!!r&&!!r.backward);else if(n instanceof Be)this._setRanges([new Ee(n)]);else if(n instanceof Uf){const o=!!r&&!!r.backward;let s;if(i=="in")s=Ee._createIn(n);else if(i=="on")s=Ee._createOn(n);else if(i!==void 0)s=new Ee(Be._createAt(n,i));else throw new oe("model-selection-setto-required-second-parameter",[this,n]);this._setRanges([s],o)}else if(us(n))this._setRanges(n,r&&!!r.backward);else throw new oe("model-selection-setto-not-selectable",[this,n])}_setRanges(e,n=!1){const i=Array.from(e),r=i.some(o=>{if(!(o instanceof Ee))throw new oe("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every(s=>!s.isEqual(o))});i.length===this._ranges.length&&!r||(this._replaceAllRanges(i),this._lastRangeBackward=!!n,this.fire("change:range",{directChange:!0}))}setFocus(e,n){if(this.anchor===null)throw new oe("model-selection-setfocus-no-ranges",[this,e]);const i=Be._createAt(e,n);if(i.compareWith(this.focus)=="same")return;const r=this.anchor;this._ranges.length&&this._popRange(),i.compareWith(r)=="before"?(this._pushRange(new Ee(i,r)),this._lastRangeBackward=!0):(this._pushRange(new Ee(r,i)),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,n){this.getAttribute(e)!==n&&(this._attrs.set(e,n),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}*getSelectedBlocks(){const e=new WeakSet;for(const n of this.getRanges()){const i=L4(n.start,e);mOe(i,n)&&(yield i);const r=n.getWalker();for(const s of r){const a=s.item;s.type=="elementEnd"&&hOe(a,e,n)?yield a:s.type=="elementStart"&&a.is("model:element")&&a.root.document.model.schema.isBlock(a)&&r.jumpTo(Be._createAt(a,"end"))}const o=L4(n.end,e);gOe(o,n)&&(yield o)}}containsEntireContent(e=this.anchor.root){const n=Be._createAt(e,0),i=Be._createAt(e,"end");return n.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}toJSON(){const e={ranges:Array.from(this.getRanges()).map(i=>i.toJSON())},n=Object.fromEntries(this.getAttributes());return Object.keys(n).length&&(e.attributes=n),this.isBackward&&(e.isBackward=!0),e}_pushRange(e){this._checkRange(e),this._ranges.push(new Ee(e.start,e.end))}_checkRange(e){for(let n=0;n0;)this._popRange()}_popRange(){this._ranges.pop()}}Xo.prototype.is=function(t){return t==="selection"||t==="model:selection"};function SG(t,e){return e.has(t)?!1:(e.add(t),t.root.document.model.schema.isBlock(t)&&!!t.parent)}function hOe(t,e,n){return SG(t,e)&&XM(t,n)}function L4(t,e){const i=t.parent.root.document.model.schema,r=t.parent.getAncestors({parentFirst:!0,includeSelf:!0});let o=!1;const s=r.find(a=>o?!1:(o=i.isLimit(a),!o&&SG(a,e)));return r.forEach(a=>e.add(a)),s}function XM(t,e){const n=pOe(t);return n?!e.containsRange(Ee._createOn(n),!0):!0}function mOe(t,e){return t?e.isCollapsed||t.isEmpty?!0:e.start.isTouching(Be._createAt(t,t.maxOffset))?!1:XM(t,e):!1}function gOe(t,e){return t?e.isCollapsed||t.isEmpty?!0:e.end.isTouching(Be._createAt(t,0))?!1:XM(t,e):!1}function pOe(t){const e=t.root.document.model.schema;let n=t.parent;for(;n;){if(e.isBlock(n))return n;n=n.parent}}class ko extends Fn(Ee){constructor(e,n){super(e,n),vOe.call(this)}detach(){this.stopListening()}toRange(){return new Ee(this.start,this.end)}static fromRange(e){return new ko(e.start,e.end)}}ko.prototype.is=function(t){return t==="liveRange"||t==="model:liveRange"||t=="range"||t==="model:range"};function vOe(){this.listenTo(this.root.document.model,"applyOperation",(t,e)=>{const n=e[0];n.isDocumentOperation&&bOe.call(this,n)},{priority:"low"})}function bOe(t){const e=this.getTransformedByOperation(t),n=Ee._createFromRanges(e),i=!n.isEqual(this),r=yOe(this,t);let o=null;if(i){n.root.rootName=="$graveyard"&&(t.type=="remove"?o=t.sourcePosition:o=t.deletionPosition);const s=this.toRange();this.start=n.start,this.end=n.end,this.fire("change:range",s,{deletionPosition:o})}else r&&this.fire("change:content",this.toRange(),{deletionPosition:o})}function yOe(t,e){switch(e.type){case"insert":return t.containsPosition(e.position);case"move":case"remove":case"reinsert":case"merge":return t.containsPosition(e.sourcePosition)||t.start.isEqual(e.sourcePosition)||t.containsPosition(e.targetPosition);case"split":return t.containsPosition(e.splitPosition)||t.containsPosition(e.insertionPosition)}return!1}class ni extends Uf{_data;constructor(e,n){super(n),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new ni(this.data,this.getAttributes())}static fromJSON(e){return new ni(e.data,e.attributes)}}ni.prototype.is=function(t){return t==="$text"||t==="model:$text"||t==="text"||t==="model:text"||t==="node"||t==="model:node"};const rb="selection:";class cs extends Fn(Kc){_selection;constructor(e){super(),this._selection=new wOe(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)}toJSON(){return this._selection.toJSON()}_setFocus(e,n){this._selection.setFocus(e,n)}_setTo(...e){this._selection.setTo(...e)}_setAttribute(e,n){this._selection.setAttribute(e,n)}_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 rb+e}static _isStoreAttributeKey(e){return e.startsWith(rb)}}cs.prototype.is=function(t){return t==="selection"||t=="model:selection"||t=="documentSelection"||t=="model:documentSelection"};class wOe extends Xo{markers=new Er({idProperty:"name"});_model;_document;_attributePriority=new Map;_selectionRestorePosition=null;_hasChangedRange=!1;_overriddenGravityRegister=new Set;_observedMarkers=new Set;constructor(e){super(),this._model=e.model,this._document=e,this.listenTo(this._model,"applyOperation",(n,i)=>{const r=i[0];!r.isDocumentOperation||r.type=="marker"||r.type=="rename"||r.type=="noop"||(this._ranges.length==0&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{this._validateSelectionRanges(this.getRanges())}),this.listenTo(this._model.markers,"update",(n,i,r,o)=>{this._updateMarker(i,o)}),this.listenTo(this._document,"change",(n,i)=>{_Oe(this._model,i)})}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;en.toJSON())),e}_validateSelectionRanges(e){for(const n of e)if(!this._document._validateSelectionRange(n))throw new oe("document-selection-wrong-position",this,{range:n})}_prepareRange(e){if(this._checkRange(e),e.root==this._document.graveyard)return;const n=ko.fromRange(e);return n.on("change:range",(i,r,o)=>{if(this._hasChangedRange=!0,n.root==this._document.graveyard){this._selectionRestorePosition=o.deletionPosition;const s=this._ranges.indexOf(n);this._ranges.splice(s,1),n.detach()}}),n}updateMarkers(){if(!this._observedMarkers.size)return;const e=[];let n=!1;for(const r of this._model.markers){const o=r.name.split(":",1)[0];if(!this._observedMarkers.has(o))continue;const s=r.getRange();for(const a of this.getRanges())s.containsRange(a,!a.isCollapsed)&&e.push(r)}const i=Array.from(this.markers);for(const r of e)this.markers.has(r)||(this.markers.add(r),n=!0);for(const r of Array.from(this.markers))e.includes(r)||(this.markers.remove(r),n=!0);n&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}_updateMarker(e,n){const i=e.name.split(":",1)[0];if(!this._observedMarkers.has(i))return;let r=!1;const o=Array.from(this.markers),s=this.markers.has(e);if(!n)s&&(this.markers.remove(e),r=!0);else{let a=!1;for(const l of this.getRanges())if(n.containsRange(l,!l.isCollapsed)){a=!0;break}a&&!s?(this.markers.add(e),r=!0):!a&&s&&(this.markers.remove(e),r=!0)}r&&this.fire("change:marker",{oldMarkers:o,directChange:!1})}_updateAttributes(e){const n=gl(this._getSurroundingAttributes()),i=gl(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[o,s]of this._attributePriority)s=="low"&&(this._attrs.delete(o),this._attributePriority.delete(o));this._setAttributesTo(n);const r=[];for(const[o,s]of this.getAttributes())(!i.has(o)||i.get(o)!==s)&&r.push(o);for(const[o]of i)this.hasAttribute(o)||r.push(o);r.length>0&&this.fire("change:attribute",{attributeKeys:r,directChange:!1})}_setAttribute(e,n,i=!0){const r=i?"normal":"low";return r=="low"&&this._attributePriority.get(e)=="normal"||super.getAttribute(e)===n?!1:(this._attrs.set(e,n),this._attributePriority.set(e,r),!0)}_removeAttribute(e,n=!0){const i=n?"normal":"low";return i=="low"&&this._attributePriority.get(e)=="normal"||(this._attributePriority.set(e,i),!super.hasAttribute(e))?!1:(this._attrs.delete(e),!0)}_setAttributesTo(e){const n=new Set;for(const[i,r]of this.getAttributes())e.get(i)!==r&&this._removeAttribute(i,!1);for(const[i,r]of e)this._setAttribute(i,r,!1)&&n.add(i);return n}*getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const n of e.getAttributeKeys())n.startsWith(rb)&&(yield[n.substr(rb.length),e.getAttribute(n)])}_getSurroundingAttributes(){const e=this.getFirstPosition(),n=this._model.schema;if(e.root.rootName=="$graveyard")return null;let i=null;if(this.isCollapsed){const r=e.textNode?e.textNode:e.nodeBefore,o=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(i=Ug(r,n)),i||(i=Ug(o,n)),!this.isGravityOverridden&&!i){let s=r;for(;s&&!i;)s=s.previousSibling,i=Ug(s,n)}if(!i){let s=o;for(;s&&!i;)s=s.nextSibling,i=Ug(s,n)}i||(i=this.getStoredAttributes())}else{const r=this.getFirstRange();for(const o of r){if(o.item.is("element")&&n.isObject(o.item)){i=Ug(o.item,n);break}if(o.type=="text"){i=o.item.getAttributes();break}}}return i}_fixGraveyardSelection(e){const n=this._model.schema.getNearestSelectionRange(e);n&&this._pushRange(n)}}function Ug(t,e){if(!t)return null;if(t instanceof ea||t instanceof ni)return t.getAttributes();if(!e.isInline(t))return null;if(!e.isObject(t))return[];const n=[];for(const[i,r]of t.getAttributes())e.checkAttribute("$text",i)&&e.getAttributeProperties(i).copyFromObject!==!1&&n.push([i,r]);return n}function _Oe(t,e){const n=t.document.differ;for(const i of n.getChanges()){if(i.type!="insert")continue;const r=i.position.parent;i.length===r.maxOffset&&t.enqueueChange(e,s=>{const a=Array.from(r.getAttributeKeys()).filter(l=>l.startsWith(rb));for(const l of a)s.removeAttribute(l,r)})}}class iv{_nodes=[];_offsetToNode=[];constructor(e){e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._offsetToNode.length}getNode(e){return this._nodes[e]||null}getNodeAtOffset(e){return this._offsetToNode[e]||null}getNodeIndex(e){return e.index}getNodeStartOffset(e){return e.startOffset}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const n=this._nodes[e];if(!n)throw new oe("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(n)}offsetToIndex(e){if(e==this._offsetToNode.length)return this._nodes.length;const n=this._offsetToNode[e];if(!n)throw new oe("model-nodelist-offset-out-of-bounds",this,{offset:e,nodeList:this});return this.getNodeIndex(n)}_insertNodes(e,n){const i=[];for(const o of n){if(!(o instanceof Uf))throw new oe("model-nodelist-insertnodes-not-node",this);i.push(o)}let r=this.indexToOffset(e);m4(this._nodes,i,e),m4(this._offsetToNode,COe(i),r);for(let o=e;oi.index!==null),this._offsetToNode=this._offsetToNode.filter(i=>i.index!==null);let n=0;for(let i=0;ie.toJSON())}}function COe(t){const e=[];let n=0;for(const i of t)for(let r=0;r0){e.children=[];for(const n of this._children)e.children.push(n.toJSON())}return e}_clone(e=!1){const n=e?kOe(this._children):void 0;return new zn(this.name,this.getAttributes(),n)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,n){const i=SOe(n);for(const r of i)r.parent!==null&&r._remove(),r.parent=this;this._children._insertNodes(e,i)}_removeChildren(e,n=1){const i=this._children._removeNodes(e,n);for(const r of i)r.parent=null;return i}_removeChildrenArray(e){this._children._removeNodesArray(e);for(const n of e)n.parent=null}static fromJSON(e){let n;if(e.children){n=[];for(const i of e.children)i.name?n.push(zn.fromJSON(i)):n.push(ni.fromJSON(i))}return new zn(e.name,e.attributes,n)}}zn.prototype.is=function(t,e){return e?e===this.name&&(t==="element"||t==="model:element"):t==="element"||t==="model:element"||t==="node"||t==="model:node"};function SOe(t){if(typeof t=="string")return[new ni(t)];us(t)||(t=[t]);const e=[];for(const n of t)typeof n=="string"?e.push(new ni(n)):n instanceof ea?e.push(new ni(n.data,n.getAttributes())):e.push(n);return e}function kOe(t){const e=[];for(const n of t)e.push(n._clone(!0));return e}class kG{_dispatchers;constructor(e){this._dispatchers=e}add(e){for(const n of this._dispatchers)e(n);return this}}class TOe extends kG{elementToElement(e){return this.add(UOe(e))}elementToStructure(e){return this.add(WOe(e))}attributeToElement(e){return this.add(qOe(e))}attributeToAttribute(e){return this.add(jOe(e))}markerToElement(e){return this.add(KOe(e))}markerToHighlight(e){return this.add(YOe(e))}markerToData(e){return this.add(GOe(e))}}function TG(){return(t,e,n)=>{if(!n.consumable.consume(e.item,t.name))return;const i=n.writer,r=n.mapper.toViewPosition(e.range.start),o=i.createText(e.item.data);i.insert(r,o)}}function EG(){return(t,e,n)=>{n.convertAttributes(e.item),!e.reconversion&&e.item.is("element")&&!e.item.isEmpty&&n.convertChildren(e.item)}}function EOe(){return(t,e,n)=>{if(e.reconversion)return;const i=n.mapper.toViewPosition(e.position),r=e.position.getShiftedBy(e.length),o=n.mapper.toViewPosition(r,{isPhantom:!0}),s=n.writer.createRange(i,o);AG(s.getTrimmed(),n)}}function xG(t,e){const n=t.createAttributeElement("span",e.attributes);return e.classes&&n._addClass(e.classes),typeof e.priority=="number"&&(n._priority=e.priority),n._id=e.id,n}function xOe(){return(t,e,n)=>{const i=e.selection;if(i.isCollapsed||!n.consumable.consume(i,"selection"))return;const r=[];for(const o of i.getRanges())r.push(n.mapper.toViewRange(o));n.writer.setSelection(r,{backward:i.isBackward})}}function AOe(){return(t,e,n)=>{const i=e.selection;if(!i.isCollapsed||!n.consumable.consume(i,"selection"))return;const r=n.writer,o=i.getFirstPosition(),s=n.mapper.toViewPosition(o),a=r.breakAttributes(s);r.setSelection(a)}}function POe(){return(t,e,n)=>{const i=n.writer,r=i.document.selection;for(const o of r.getRanges())o.isCollapsed&&o.end.parent.isAttached()&&n.writer.mergeAttributes(o.start);i.setSelection(null)}}function IOe(t){return(e,n,i)=>{if(!i.consumable.test(n.item,e.name))return;const r=t(n.attributeOldValue,i,n),o=t(n.attributeNewValue,i,n);if(!r&&!o)return;i.consumable.consume(n.item,e.name);const s=i.writer,a=s.document.selection;if(n.item instanceof Xo||n.item instanceof cs)s.wrap(a.getFirstRange(),o);else{let l=i.mapper.toViewRange(n.range);n.attributeOldValue!==null&&r&&(l=s.unwrap(l,r)),n.attributeNewValue!==null&&o&&s.wrap(l,o)}}}function ROe(t,e=nLe){return(n,i,r)=>{if(!e(i.item,r.consumable,{preflight:!0}))return;const o=t(i.item,r,i);if(!o)return;e(i.item,r.consumable);const s=i.reconversion&&PG(i.item,r)||r.mapper.toViewPosition(i.range.start);r.mapper.bindElements(i.item,o),r.writer.insert(s,o),r.convertAttributes(i.item),LG(o,i.item.getChildren(),r,{reconversion:i.reconversion})}}function MOe(t,e){return(n,i,r)=>{if(!e(i.item,r.consumable,{preflight:!0}))return;const o=new Map;r.writer._registerSlotFactory(ZOe(i.item,o,r));const s=t(i.item,r,i);if(r.writer._clearSlotFactory(),!s)return;QOe(i.item,o,r),e(i.item,r.consumable);const a=i.reconversion&&PG(i.item,r)||r.mapper.toViewPosition(i.range.start);r.mapper.bindElements(i.item,s),r.writer.insert(a,s),r.convertAttributes(i.item),eLe(s,o,r,{reconversion:i.reconversion})}}function OOe(t){return(e,n,i)=>{n.isOpening=!0;const r=t(n,i);n.isOpening=!1;const o=t(n,i);if(!r||!o)return;const s=n.markerRange;if(s.isCollapsed&&!i.consumable.consume(s,e.name))return;for(const u of s)if(!i.consumable.consume(u.item,e.name))return;const a=i.mapper,l=i.writer;l.insert(a.toViewPosition(s.start),r),i.mapper.bindElementToMarker(r,n.markerName),s.isCollapsed||(l.insert(a.toViewPosition(s.end),o),i.mapper.bindElementToMarker(o,n.markerName)),e.stop()}}function AG(t,e){const n=e.writer.remove(t);for(const i of e.writer.createRangeIn(n).getItems())e.mapper.unbindViewElement(i,{defer:!0});return t.start}function PG(t,e){const n=e.mapper.toViewElement(t);return n&&AG(e.writer.createRangeOn(n),e)}function LOe(){return(t,e,n)=>{const i=n.mapper.markerNameToElements(e.markerName);if(i){for(const r of i)n.mapper.unbindElementFromMarkerName(r,e.markerName),n.writer.clear(n.writer.createRangeOn(r),r);n.writer.clearClonedElementsGroup(e.markerName),t.stop()}}}function DOe(t){return(e,n,i)=>{const r=t(n.markerName,i);if(!r)return;const o=n.markerRange;i.consumable.consume(o,e.name)&&(D4(o,!1,i,n,r),D4(o,!0,i,n,r),e.stop())}}function D4(t,e,n,i,r){const o=e?t.start:t.end,s=o.nodeAfter&&o.nodeAfter.is("element")?o.nodeAfter:null,a=o.nodeBefore&&o.nodeBefore.is("element")?o.nodeBefore:null;if(s||a){let u,c;e&&s||!e&&!a?(u=s,c=!0):(u=a,c=!1);const d=n.mapper.toViewElement(u);if(d){NOe(d,e,c,n,i,r);return}}const l=n.mapper.toViewPosition(o);BOe(l,e,n,i,r)}function NOe(t,e,n,i,r,o){const s=`data-${o.group}-${e?"start":"end"}-${n?"before":"after"}`,a=t.hasAttribute(s)?t.getAttribute(s).split(","):[];a.unshift(o.name),i.writer.setAttribute(s,a.join(","),t),i.mapper.bindElementToMarker(t,r.markerName)}function BOe(t,e,n,i,r){const o=`${r.group}-${e?"start":"end"}`,s=r.name?{name:r.name}:null,a=n.writer.createUIElement(o,s);n.writer.insert(t,a),n.mapper.bindElementToMarker(a,i.markerName)}function VOe(t){return(e,n,i)=>{const r=t(n.markerName,i);if(!r)return;const o=i.mapper.markerNameToElements(n.markerName);if(!o)return;for(const a of o)i.mapper.unbindElementFromMarkerName(a,n.markerName),a.is("containerElement")?(s(`data-${r.group}-start-before`,a),s(`data-${r.group}-start-after`,a),s(`data-${r.group}-end-before`,a),s(`data-${r.group}-end-after`,a)):i.writer.clear(i.writer.createRangeOn(a),a);i.writer.clearClonedElementsGroup(n.markerName),e.stop();function s(a,l){if(l.hasAttribute(a)){const u=new Set(l.getAttribute(a).split(","));u.delete(r.name),u.size==0?i.writer.removeAttribute(a,l):i.writer.setAttribute(a,Array.from(u).join(","),l)}}}}function FOe(t){return(e,n,i)=>{if(!i.consumable.test(n.item,e.name))return;const r=t(n.attributeOldValue,i,n),o=t(n.attributeNewValue,i,n);if(!r&&!o)return;i.consumable.consume(n.item,e.name);const s=i.mapper.toViewElement(n.item),a=i.writer;if(!s)throw new oe("conversion-attribute-to-attribute-on-text",i.dispatcher,n);if(n.attributeOldValue!==null&&r){let l=r.value;r.key=="style"&&(typeof r.value=="string"?l=new tv(a.document.stylesProcessor).setTo(r.value).getStylesEntries().map(([u])=>u):l=Object.keys(r.value)),a.removeAttribute(r.key,l,s)}if(n.attributeNewValue!==null&&o){let l=o.value;o.key=="style"&&typeof o.value=="string"&&(l=Object.fromEntries(new tv(a.document.stylesProcessor).setTo(o.value).getStylesEntries())),a.setAttribute(o.key,l,!1,s)}}}function $Oe(t){return(e,n,i)=>{if(!n.item||!(n.item instanceof Xo||n.item instanceof cs)&&!n.item.is("$textProxy"))return;const r=JM(t,n,i);if(!r||!i.consumable.consume(n.item,e.name))return;const o=i.writer,s=xG(o,r),a=o.document.selection;if(n.item instanceof Xo||n.item instanceof cs)o.wrap(a.getFirstRange(),s);else{const l=i.mapper.toViewRange(n.range),u=o.wrap(l,s);for(const c of u.getItems())if(c.is("attributeElement")&&c.isSimilar(s)){i.mapper.bindElementToMarker(c,n.markerName);break}}}}function zOe(t){return(e,n,i)=>{if(!n.item||!(n.item instanceof zn))return;const r=JM(t,n,i);if(!r||!i.consumable.test(n.item,e.name))return;const o=i.mapper.toViewElement(n.item);if(o&&o.getCustomProperty("addHighlight")){i.consumable.consume(n.item,e.name);for(const a of Ee._createIn(n.item))i.consumable.consume(a.item,e.name);o.getCustomProperty("addHighlight")(o,r,i.writer),i.mapper.bindElementToMarker(o,n.markerName)}}}function HOe(t){return(e,n,i)=>{if(n.markerRange.isCollapsed)return;const r=JM(t,n,i);if(!r)return;const o=xG(i.writer,r),s=i.mapper.markerNameToElements(n.markerName);if(s){for(const a of s)i.mapper.unbindElementFromMarkerName(a,n.markerName),a.is("attributeElement")?i.writer.unwrap(i.writer.createRangeOn(a),o):a.getCustomProperty("removeHighlight")(a,r.id,i.writer);i.writer.clearClonedElementsGroup(n.markerName),e.stop()}}}function UOe(t){const e=IG(t.model),n=ob(t.view,"container");return e.attributes.length&&(e.children=!0),i=>{i.on(`insert:${e.name}`,ROe(n,OG(e)),{priority:t.converterPriority||"normal"}),(e.children||e.attributes.length)&&i.on("reduceChanges",MG(e),{priority:"low"})}}function WOe(t){const e=IG(t.model),n=ob(t.view,"container");return e.children=!0,i=>{if(i._conversionApi.schema.checkChild(e.name,"$text"))throw new oe("conversion-element-to-structure-disallowed-text",i,{elementName:e.name});i.on(`insert:${e.name}`,MOe(n,OG(e)),{priority:t.converterPriority||"normal"}),i.on("reduceChanges",MG(e),{priority:"low"})}}function qOe(t){t=Bo(t);let e=t.model;typeof e=="string"&&(e={key:e});let n=`attribute:${e.key}`;if(e.name&&(n+=":"+e.name),e.values)for(const r of e.values)t.view[r]=ob(t.view[r],"attribute");else t.view=ob(t.view,"attribute");const i=RG(t);return r=>{r.on(n,IOe(i),{priority:t.converterPriority||"normal"})}}function jOe(t){t=Bo(t);let e=t.model;typeof e=="string"&&(e={key:e});let n=`attribute:${e.key}`;if(e.name&&(n+=":"+e.name),e.values)for(const r of e.values)t.view[r]=N4(t.view[r]);else t.view=N4(t.view);const i=RG(t);return r=>{r.on(n,FOe(i),{priority:t.converterPriority||"normal"})}}function KOe(t){const e=ob(t.view,"ui");return n=>{n.on(`addMarker:${t.model}`,OOe(e),{priority:t.converterPriority||"normal"}),n.on(`removeMarker:${t.model}`,LOe(),{priority:t.converterPriority||"normal"})}}function GOe(t){t=Bo(t);const e=t.model;let n=t.view;return n||(n=i=>({group:e,name:i.substr(t.model.length+1)})),i=>{i.on(`addMarker:${e}`,DOe(n),{priority:t.converterPriority||"normal"}),i.on(`removeMarker:${e}`,VOe(n),{priority:t.converterPriority||"normal"})}}function YOe(t){return e=>{e.on(`addMarker:${t.model}`,$Oe(t.view),{priority:t.converterPriority||"normal"}),e.on(`addMarker:${t.model}`,zOe(t.view),{priority:t.converterPriority||"normal"}),e.on(`removeMarker:${t.model}`,HOe(t.view),{priority:t.converterPriority||"normal"})}}function IG(t){return typeof t=="string"&&(t={name:t}),{name:t.name,attributes:t.attributes?li(t.attributes):[],children:!!t.children}}function ob(t,e){return typeof t=="function"?t:(n,i)=>XOe(t,i,e)}function XOe(t,e,n){typeof t=="string"&&(t={name:t});let i;const r=e.writer,o=Object.assign({},t.attributes);if(n=="container")i=r.createContainerElement(t.name,o);else if(n=="attribute"){const s={priority:t.priority||hm.DEFAULT_PRIORITY};i=r.createAttributeElement(t.name,o,s)}else i=r.createUIElement(t.name,o);if(t.styles){const s=Object.keys(t.styles);for(const a of s)r.setStyle(a,t.styles[a],i)}if(t.classes){const s=t.classes;if(typeof s=="string")r.addClass(s,i);else for(const a of s)r.addClass(a,i)}return i}function RG(t){return t.model.values?(e,n,i)=>{const r=t.view[e];return r?r(e,n,i):null}:t.view}function N4(t){return typeof t=="string"?e=>({key:t,value:e}):typeof t=="object"?t.value?()=>t:e=>({key:t.key,value:e}):t}function JM(t,e,n){const i=typeof t=="function"?t(e,n):{...t};return i?(i.priority||(i.priority=10),i.id||(i.id=e.markerName),i):null}function JOe(t){return(e,n)=>{if(!e.is("element",t.name))return!1;if(n.type=="attribute"){if(t.attributes.includes(n.attributeKey))return!0}else{if(t.children)return!0}return!1}}function MG(t){const e=JOe(t);return(n,i)=>{const r=[];i.reconvertedElements||(i.reconvertedElements=new Set);for(const o of i.changes){const s=o.type=="attribute"?o.range.start.nodeAfter:o.position.parent;if(!s||!e(s,o)||o.type=="reinsert"){r.push(o);continue}if(o.type=="insert"&&o.action=="rename"&&i.refreshedItems.add(o.position.nodeAfter),!i.reconvertedElements.has(s)){i.reconvertedElements.add(s);const a=Be._createBefore(s);let l=r.length;for(let u=r.length-1;u>=0;u--){const c=r[u],f=(c.type=="attribute"?c.range.start:c.position).compareWith(a);if(f=="before"||c.type=="remove"&&f=="same")break;l=u}r.splice(l,0,{type:"reinsert",name:s.name,position:a,length:1})}}i.changes=r}}function OG(t){return(e,n,i={})=>{const r=["insert"];for(const o of t.attributes)e.hasAttribute(o)&&r.push(`attribute:${o}`);return r.every(o=>n.test(e,o))?(i.preflight||r.forEach(o=>n.consume(e,o)),!0):!1}}function ZOe(t,e,n){return(i,r)=>{const o=i.createContainerElement("$slot");let s=null;if(r==="children")s=Array.from(t.getChildren());else if(typeof r=="function")s=Array.from(t.getChildren()).filter(a=>r(a));else throw new oe("conversion-slot-mode-unknown",n.dispatcher,{modeOrFilter:r});return e.set(o,s),o}}function QOe(t,e,n){const i=Array.from(e.values()).flat(),r=new Set(i);if(r.size!=i.length)throw new oe("conversion-slot-filter-overlap",n.dispatcher,{element:t});if(r.size!=t.childCount)throw new oe("conversion-slot-filter-incomplete",n.dispatcher,{element:t})}function eLe(t,e,n,i){n.mapper.on("modelToViewPosition",s,{priority:"highest"});let r=null,o=null;for([r,o]of e)LG(t,o,n,i),n.writer.setCustomProperty("$structureSlotParent",!0,r.parent),n.writer.move(n.writer.createRangeIn(r),n.writer.createPositionBefore(r)),n.writer.remove(r);n.mapper.off("modelToViewPosition",s);function s(a,l){const u=l.modelPosition.nodeAfter,c=o.indexOf(u);c<0||(l.viewPosition=l.mapper.findPositionIn(r,c))}}function LG(t,e,n,i){for(const r of e)tLe(t.root,r,n,i)||n.convertItem(r)}function tLe(t,e,n,i){const{writer:r,mapper:o}=n;if(!i.reconversion)return!1;const s=o.toViewElement(e);return!s||s.root==t||!n.canReuseView(s)?!1:(r.move(r.createRangeOn(s),o.toViewPosition(Be._createBefore(e))),!0)}function nLe(t,e,{preflight:n}={}){return n?e.test(t,"insert"):e.consume(t,"insert")}function DG(t){const{schema:e,document:n}=t.model;for(const i of n.getRoots())if(i.isEmpty&&!e.checkChild(i,"$text")&&e.checkChild(i,"paragraph"))return t.insertElement("paragraph",i),!0;return!1}function NG(t,e,n){const i=n.createContext(t);return!(!n.checkChild(i,"paragraph")||!n.checkChild(i.push("paragraph"),e))}function BG(t,e){const n=e.createElement("paragraph");return e.insert(n,t),e.createPositionAt(n,0)}class iLe extends kG{elementToElement(e){return this.add(VG(e))}elementToAttribute(e){return this.add(sLe(e))}attributeToAttribute(e){return this.add(aLe(e))}elementToMarker(e){return this.add(lLe(e))}dataToMarker(e){return this.add(uLe(e))}}function B4(){return(t,e,n)=>{if(!e.modelRange&&n.consumable.consume(e.viewItem,{name:!0})){const{modelRange:i,modelCursor:r}=n.convertChildren(e.viewItem,e.modelCursor);e.modelRange=i,e.modelCursor=r}}}function rLe(){return(t,e,{schema:n,consumable:i,writer:r})=>{let o=e.modelCursor;if(!i.test(e.viewItem))return;if(!n.checkChild(o,"$text")){if(!NG(o,"$text",n)||e.viewItem.data.trim().length==0)return;o=BG(o,r)}i.consume(e.viewItem);const s=r.createText(e.viewItem.data);r.insert(s,o),e.modelRange=r.createRange(o,o.getShiftedBy(s.offsetSize)),e.modelCursor=e.modelRange.end}}function oLe(t,e){return(n,i)=>{const r=i.newSelection,o=[];for(const a of r.getRanges())o.push(e.toModelRange(a));const s=t.createSelection(o,{backward:r.isBackward});s.isEqual(t.document.selection)||t.change(a=>{a.setSelection(s)})}}function VG(t){t=Bo(t);const e=TA(t),n=ZM(t.view),i=n?`element:${n}`:"element";return r=>{r.on(i,e,{priority:t.converterPriority||"normal"})}}function sLe(t){t=Bo(t),FG(t);const e=$G(t,!1),n=ZM(t.view),i=n?`element:${n}`:"element";return r=>{r.on(i,e,{priority:t.converterPriority||"low"})}}function aLe(t){t=Bo(t);let e=null;(typeof t.view=="string"||t.view.key)&&(e=fLe(t)),FG(t,e);const n=$G(t,!0);return i=>{i.on("element",n,{priority:t.converterPriority||"low"})}}function lLe(t){const e=gLe(t.model);return VG({...t,model:e})}function uLe(t){t=Bo(t),t.model||(t.model=r=>r?t.view+":"+r:t.view);const e={view:t.view,model:t.model},n=TA(V4(e,"start")),i=TA(V4(e,"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 o=ou.low,s=ou.highest,a=ou.get(t.converterPriority)/s;r.on("element",cLe(e),{priority:o+a})}}function cLe(t){return(e,n,i)=>{const r=`data-${t.view}`;if(!i.consumable.test(n.viewItem,{attributes:r+"-end-after"})&&!i.consumable.test(n.viewItem,{attributes:r+"-start-after"})&&!i.consumable.test(n.viewItem,{attributes:r+"-end-before"})&&!i.consumable.test(n.viewItem,{attributes:r+"-start-before"}))return;n.modelRange||Object.assign(n,i.convertChildren(n.viewItem,n.modelCursor)),i.consumable.consume(n.viewItem,{attributes:r+"-end-after"})&&o(n.modelRange.end,n.viewItem.getAttribute(r+"-end-after").split(",")),i.consumable.consume(n.viewItem,{attributes:r+"-start-after"})&&o(n.modelRange.end,n.viewItem.getAttribute(r+"-start-after").split(",")),i.consumable.consume(n.viewItem,{attributes:r+"-end-before"})&&o(n.modelRange.start,n.viewItem.getAttribute(r+"-end-before").split(",")),i.consumable.consume(n.viewItem,{attributes:r+"-start-before"})&&o(n.modelRange.start,n.viewItem.getAttribute(r+"-start-before").split(","));function o(s,a){for(const l of a){const u=t.model(l,i),c=i.writer.createElement("$marker",{"data-name":u});i.writer.insert(c,s),n.modelCursor.isEqual(s)?n.modelCursor=n.modelCursor.getShiftedBy(1):n.modelCursor=n.modelCursor._getTransformedByInsertion(s,1),n.modelRange=n.modelRange._getTransformedByInsertion(s,1)[0]}}}}function ZM(t){return typeof t=="string"?t:typeof t=="object"&&typeof t.name=="string"?t.name:null}function TA(t){const e=new pl(t.view);return(n,i,r)=>{const o=e.match(i.viewItem);if(!o)return;const s=o.match;if(s.name=!0,!r.consumable.test(i.viewItem,s))return;const a=dLe(t.model,i.viewItem,r);a&&r.safeInsert(a,i.modelCursor)&&(r.consumable.consume(i.viewItem,s),r.convertChildren(i.viewItem,a),r.updateConversionResult(a,i))}}function dLe(t,e,n){return t instanceof Function?t(e,n):n.writer.createElement(t)}function fLe(t){typeof t.view=="string"&&(t.view={key:t.view});const e=t.view.key,n=typeof t.view.value>"u"?/[\s\S]*/:t.view.value;let i;return e=="class"||e=="style"?i={[e=="class"?"classes":"styles"]:n}:i={attributes:{[e]:n}},t.view.name&&(i.name=t.view.name),t.view=i,e}function FG(t,e=null){const n=e===null?!0:o=>o.getAttribute(e),i=typeof t.model!="object"?t.model:t.model.key,r=typeof t.model!="object"||typeof t.model.value>"u"?n:t.model.value;t.model={key:i,value:r}}function $G(t,e){const n=new pl(t.view);return(i,r,o)=>{if(!r.modelRange&&e)return;const s=n.match(r.viewItem);if(!s||(hLe(t.view,r.viewItem)?s.match.name=!0:delete s.match.name,!o.consumable.test(r.viewItem,s.match)))return;const a=t.model.key,l=typeof t.model.value=="function"?t.model.value(r.viewItem,o,r):t.model.value;if(l==null)return;r.modelRange||Object.assign(r,o.convertChildren(r.viewItem,r.modelCursor)),mLe(r.modelRange,{key:a,value:l},e,o)&&(o.consumable.test(r.viewItem,{name:!0})&&(s.match.name=!0),o.consumable.consume(r.viewItem,s.match))}}function hLe(t,e){const n=typeof t=="function"?t(e):t;return typeof n=="object"&&!ZM(n)?!1:!n.classes&&!n.attributes&&!n.styles}function mLe(t,e,n,i){let r=!1;for(const o of Array.from(t.getItems({shallow:n})))i.schema.checkAttribute(o,e.key)&&(r=!0,!o.hasAttribute(e.key)&&i.writer.setAttribute(e.key,e.value,o));return r}function gLe(t){return(e,n)=>{const i=typeof t=="string"?t:t(e,n);return n.writer.createElement("$marker",{"data-name":i})}}function V4(t,e){const n=(i,r)=>{const o=i.getAttribute("name"),s=t.model(o,r);return r.writer.createElement("$marker",{"data-name":s})};return{view:`${t.view}-${e}`,model:n}}class pLe extends Ln(){model;view;mapper;downcastDispatcher;constructor(e,n){super(),this.model=e,this.view=new aOe(n),this.mapper=new _G,this.downcastDispatcher=new CG({mapper:this.mapper,schema:e.schema});const i=this.model.document,r=i.selection,o=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(i,"change",()=>{this.view.change(s=>{this.downcastDispatcher.convertChanges(i.differ,o,s),this.downcastDispatcher.convertSelection(r,o,s)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",oLe(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",TG(),{priority:"lowest"}),this.downcastDispatcher.on("insert",EG(),{priority:"lowest"}),this.downcastDispatcher.on("remove",EOe(),{priority:"low"}),this.downcastDispatcher.on("cleanSelection",POe()),this.downcastDispatcher.on("selection",xOe(),{priority:"low"}),this.downcastDispatcher.on("selection",AOe(),{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(s=>{if(s.rootName=="$graveyard")return null;const a=new cG(this.view.document,s.name);return a.rootName=s.rootName,this.mapper.bindElements(s,a),a})}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(e){const n=typeof e=="string"?e:e.name,i=this.model.markers.get(n);if(!i)throw new oe("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:n});this.model.change(()=>{this.model.markers._refresh(i)})}reconvertItem(e){this.model.change(()=>{this.model.document.differ._refreshItem(e)})}}class vLe extends Ln(){_sourceDefinitions={};_attributeProperties=Object.create(null);_customChildChecks=new Map;_customAttributeChecks=new Map;_genericCheckSymbol=Symbol("$generic");_compiledDefinitions;constructor(){super(),this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(e,n)=>{n[0]=new su(n[0])},{priority:"highest"}),this.on("checkChild",(e,n)=>{n[0]=new su(n[0]),n[1]=this.getDefinition(n[1])},{priority:"highest"})}register(e,n){if(this._sourceDefinitions[e])throw new oe("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},n)],this._clearCache()}extend(e,n){if(!this._sourceDefinitions[e])throw new oe("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},n)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let n;return typeof e=="string"?n=e:"is"in e&&(e.is("$text")||e.is("$textProxy"))?n="$text":n=e.name,this.getDefinitions()[n]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const n=this.getDefinition(e);return!!(n&&n.isBlock)}isLimit(e){const n=this.getDefinition(e);return n?!!(n.isLimit||n.isObject):!1}isObject(e){const n=this.getDefinition(e);return n?!!(n.isObject||n.isLimit&&n.isSelectable&&n.isContent):!1}isInline(e){const n=this.getDefinition(e);return!!(n&&n.isInline)}isSelectable(e){const n=this.getDefinition(e);return n?!!(n.isSelectable||n.isObject):!1}isContent(e){const n=this.getDefinition(e);return n?!!(n.isContent||n.isObject):!1}checkChild(e,n){return n?this._checkContextMatch(e,n):!1}checkAttribute(e,n){const i=this.getDefinition(e.last);if(!i)return!1;const r=this._evaluateAttributeChecks(e,n);return r!==void 0?r:i.allowAttributes.includes(n)}checkMerge(e,n){if(e instanceof Be){const i=e.nodeBefore,r=e.nodeAfter;if(!(i instanceof zn))throw new oe("schema-check-merge-no-element-before",this);if(!(r instanceof zn))throw new oe("schema-check-merge-no-element-after",this);return this.checkMerge(i,r)}if(this.isLimit(e)||this.isLimit(n))return!1;for(const i of n.getChildren())if(!this.checkChild(e,i))return!1;return!0}addChildCheck(e,n){const i=n!==void 0?n:this._genericCheckSymbol,r=this._customChildChecks.get(i)||[];r.push(e),this._customChildChecks.set(i,r)}addAttributeCheck(e,n){const i=n!==void 0?n:this._genericCheckSymbol,r=this._customAttributeChecks.get(i)||[];r.push(e),this._customAttributeChecks.set(i,r)}setAttributeProperties(e,n){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),n)}getAttributeProperties(e){return this._attributeProperties[e]||Object.create(null)}getLimitElement(e){let n;for(e instanceof Be?n=e.parent:n=(e instanceof Ee?[e]:Array.from(e.getRanges())).reduce((r,o)=>{const s=o.getCommonAncestor();return r?r.getCommonAncestor(s,{includeSelf:!0}):s},null);!this.isLimit(n)&&n.parent;)n=n.parent;return n}checkAttributeInSelection(e,n){if(e.isCollapsed){const r=[...e.getFirstPosition().getAncestors(),new ni("",e.getAttributes())];return this.checkAttribute(r,n)}else{const i=e.getRanges();for(const r of i)for(const o of r)if(this.checkAttribute(o.item,n))return!0}return!1}*getValidRanges(e,n,i={}){e=OLe(e);for(const r of e)yield*this._getValidRangesForRange(r,n,i)}getNearestSelectionRange(e,n="both"){if(e.root.rootName=="$graveyard")return null;if(this.checkChild(e,"$text"))return new Ee(e);let i,r;const o=e.getAncestors().reverse().find(s=>this.isLimit(s))||e.root;(n=="both"||n=="backward")&&(i=new Ql({boundaries:Ee._createIn(o),startPosition:e,direction:"backward"})),(n=="both"||n=="forward")&&(r=new Ql({boundaries:Ee._createIn(o),startPosition:e}));for(const s of MLe(i,r)){const a=s.walker==i?"elementEnd":"elementStart",l=s.value;if(l.type==a&&this.isObject(l.item))return Ee._createOn(l.item);if(this.checkChild(l.nextPosition,"$text"))return new Ee(l.nextPosition)}return null}findAllowedParent(e,n){let i=e.parent;for(;i;){if(this.checkChild(i,n))return i;if(this.isLimit(i))return null;i=i.parent}return null}setAllowedAttributes(e,n,i){const r=i.model;for(const[o,s]of Object.entries(n))r.schema.checkAttribute(e,o)&&i.setAttribute(o,s,e)}removeDisallowedAttributes(e,n){for(const i of e)if(i.is("$text"))F4(this,i,n);else{const o=Ee._createIn(i).getPositions();for(const s of o){const a=s.nodeBefore||s.parent;F4(this,a,n)}}}getAttributesWithProperty(e,n,i){const r={};for(const[o,s]of e.getAttributes()){const a=this.getAttributeProperties(o);a[n]!==void 0&&(i===void 0||i===a[n])&&(r[o]=s)}return r}createContext(e){return new su(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},n=this._sourceDefinitions,i=Object.keys(n);for(const o of i)e[o]=bLe(n[o],o);const r=Object.values(e);for(const o of r)yLe(e,o),wLe(e,o),_Le(e,o),CLe(e,o);for(const o of r)SLe(e,o);for(const o of r)kLe(e,o);for(const o of r)TLe(e,o);for(const o of r)xLe(e,o);for(const o of r)ALe(e,o);this._compiledDefinitions=ELe(e)}_checkContextMatch(e,n){const i=e.last;let r=this._evaluateChildChecks(e,n);if(r=r!==void 0?r:n.allowIn.includes(i.name),!r)return!1;const o=this.getDefinition(i),s=e.trimLast();return o?s.length==0?!0:this._checkContextMatch(s,o):!1}_evaluateChildChecks(e,n){const i=this._customChildChecks.get(this._genericCheckSymbol)||[],r=this._customChildChecks.get(n.name)||[];for(const o of[...i,...r]){const s=o(e,n);if(s!==void 0)return s}}_evaluateAttributeChecks(e,n){const i=this._customAttributeChecks.get(this._genericCheckSymbol)||[],r=this._customAttributeChecks.get(n)||[];for(const o of[...i,...r]){const s=o(e,n);if(s!==void 0)return s}}*_getValidRangesForRange(e,n,i){let r=e.start,o=e.start;for(const s of e.getItems({shallow:!0})){if(s.is("element"))if(i.includeEmptyRanges&&s.isEmpty){const a=this.createContext(s);this.checkChild(a,"$text")&&this.checkAttribute(a.push("$text"),n)&&(yield Ee._createIn(s))}else yield*this._getValidRangesForRange(Ee._createIn(s),n,i);this.checkAttribute(s,n)||(r.isEqual(o)||(yield new Ee(r,o)),r=Be._createAfter(s)),o=Be._createAfter(s)}r.isEqual(o)||(yield new Ee(r,o))}findOptimalInsertionRange(e,n){const i=e.getSelectedElement();if(i&&this.isObject(i)&&!this.isInline(i))return n=="before"||n=="after"?new Ee(Be._createAt(i,n)):Ee._createOn(i);const r=Mi(e.getSelectedBlocks());if(!r)return new Ee(e.focus);if(r.isEmpty)return new Ee(Be._createAt(r,0));const o=Be._createAfter(r);return e.focus.isTouching(o)?new Ee(o):new Ee(Be._createBefore(r))}}class su{_items;constructor(e){if(e instanceof su)return e;let n;typeof e=="string"?n=[e]:Array.isArray(e)?n=e:n=e.getAncestors({includeSelf:!0}),this._items=n.map(RLe)}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 n=new su([e]);return n._items=[...this._items,...n._items],n}trimLast(){const e=new su([]);return e._items=this._items.slice(0,-1),e}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 bLe(t,e){const n={name:e,allowIn:new Set,allowChildren:new Set,disallowIn:new Set,disallowChildren:new Set,allowContentOf:new Set,allowWhere:new Set,allowAttributes:new Set,disallowAttributes:new Set,allowAttributesOf:new Set,inheritTypesFrom:new Set};return PLe(t,n),Ra(t,n,"allowIn"),Ra(t,n,"allowChildren"),Ra(t,n,"disallowIn"),Ra(t,n,"disallowChildren"),Ra(t,n,"allowContentOf"),Ra(t,n,"allowWhere"),Ra(t,n,"allowAttributes"),Ra(t,n,"disallowAttributes"),Ra(t,n,"allowAttributesOf"),Ra(t,n,"inheritTypesFrom"),ILe(t,n),n}function yLe(t,e){for(const n of e.allowIn){const i=t[n];i?i.allowChildren.add(e.name):e.allowIn.delete(n)}}function wLe(t,e){for(const n of e.allowChildren){const i=t[n];i?i.allowIn.add(e.name):e.allowChildren.delete(n)}}function _Le(t,e){for(const n of e.disallowIn){const i=t[n];i?i.disallowChildren.add(e.name):e.disallowIn.delete(n)}}function CLe(t,e){for(const n of e.disallowChildren){const i=t[n];i?i.disallowIn.add(e.name):e.disallowChildren.delete(n)}}function SLe(t,e){for(const n of e.disallowChildren)e.allowChildren.delete(n);for(const n of e.disallowIn)e.allowIn.delete(n);for(const n of e.disallowAttributes)e.allowAttributes.delete(n)}function kLe(t,e){for(const n of e.allowContentOf){const i=t[n];i&&(i.disallowChildren.forEach(r=>{e.allowChildren.has(r)||(e.disallowChildren.add(r),t[r].disallowIn.add(e.name))}),i.allowChildren.forEach(r=>{e.disallowChildren.has(r)||(e.allowChildren.add(r),t[r].allowIn.add(e.name))}))}}function TLe(t,e){for(const n of e.allowWhere){const i=t[n];i&&(i.disallowIn.forEach(r=>{e.allowIn.has(r)||(e.disallowIn.add(r),t[r].disallowChildren.add(e.name))}),i.allowIn.forEach(r=>{e.disallowIn.has(r)||(e.allowIn.add(r),t[r].allowChildren.add(e.name))}))}}function ELe(t){const e={};for(const n of Object.values(t))e[n.name]={name:n.name,isBlock:!!n.isBlock,isContent:!!n.isContent,isInline:!!n.isInline,isLimit:!!n.isLimit,isObject:!!n.isObject,isSelectable:!!n.isSelectable,allowIn:Array.from(n.allowIn).filter(i=>!!t[i]),allowChildren:Array.from(n.allowChildren).filter(i=>!!t[i]),allowAttributes:Array.from(n.allowAttributes)};return e}function xLe(t,e){for(const n of e.allowAttributesOf){const i=t[n];if(!i)return;i.allowAttributes.forEach(r=>{e.disallowAttributes.has(r)||e.allowAttributes.add(r)})}}function ALe(t,e){for(const n of e.inheritTypesFrom){const i=t[n];if(i){const r=Object.keys(i).filter(o=>o.startsWith("is"));for(const o of r)o in e||(e[o]=i[o])}}}function PLe(t,e){for(const n of t){const i=Object.keys(n).filter(r=>r.startsWith("is"));for(const r of i)e[r]=!!n[r]}}function Ra(t,e,n){for(const i of t){let r=i[n];typeof r=="string"&&(r=[r]),Array.isArray(r)&&r.forEach(o=>e[n].add(o))}}function ILe(t,e){for(const n of t){const i=n.inheritAllFrom;i&&(e.allowContentOf.add(i),e.allowWhere.add(i),e.allowAttributesOf.add(i),e.inheritTypesFrom.add(i))}}function RLe(t){return typeof t=="string"||t.is("documentFragment")?{name:typeof t=="string"?t:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:t.is("element")?t.name:"$text",*getAttributeKeys(){yield*t.getAttributeKeys()},getAttribute(e){return t.getAttribute(e)}}}function*MLe(t,e){let n=!1;for(;!n;){if(n=!0,t){const i=t.next();i.done||(n=!1,yield{walker:t,value:i.value})}if(e){const i=e.next();i.done||(n=!1,yield{walker:e,value:i.value})}}}function*OLe(t){for(const e of t)yield*e.getMinimalFlatRanges()}function F4(t,e,n){for(const i of e.getAttributeKeys())t.checkAttribute(e,i)||n.removeAttribute(i,e)}class LLe extends Fn(){conversionApi;_splitParts=new Map;_cursorParents=new Map;_modelCursor=null;_emptyElementsToKeep=new Set;constructor(e){super(),this.conversionApi={...e,consumable:null,writer:null,store:null,convertItem:(n,i)=>this._convertItem(n,i),convertChildren:(n,i)=>this._convertChildren(n,i),safeInsert:(n,i)=>this._safeInsert(n,i),updateConversionResult:(n,i)=>this._updateConversionResult(n,i),splitToAllowedParent:(n,i)=>this._splitToAllowedParent(n,i),getSplitParts:n=>this._getSplitParts(n),keepEmptyElement:n=>this._keepEmptyElement(n)}}convert(e,n,i=["$root"]){this.fire("viewCleanup",e),this._modelCursor=NLe(i,n),this.conversionApi.writer=n,this.conversionApi.consumable=u1.createFrom(e),this.conversionApi.store={};const{modelRange:r}=this._convertItem(e,this._modelCursor),o=n.createDocumentFragment();if(r){this._removeEmptyElements();const s=this._modelCursor.parent,a=s._removeChildren(0,s.childCount);o._insertChild(0,a),o.markers=DLe(o,n)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,o}_convertItem(e,n){const i={viewItem:e,modelCursor:n,modelRange:null};if(e.is("element")?this.fire(`element:${e.name}`,i,this.conversionApi):e.is("$text")?this.fire("text",i,this.conversionApi):this.fire("documentFragment",i,this.conversionApi),i.modelRange&&!(i.modelRange instanceof Ee))throw new oe("view-conversion-dispatcher-incorrect-result",this);return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(e,n){let i=n.is("position")?n:Be._createAt(n,0);const r=new Ee(i);for(const o of Array.from(e.getChildren())){const s=this._convertItem(o,i);s.modelRange instanceof Ee&&(r.end=s.modelRange.end,i=s.modelCursor)}return{modelRange:r,modelCursor:i}}_safeInsert(e,n){const i=this._splitToAllowedParent(e,n);return i?(this.conversionApi.writer.insert(e,i.position),!0):!1}_updateConversionResult(e,n){const i=this._getSplitParts(e),r=this.conversionApi.writer;n.modelRange||(n.modelRange=r.createRange(r.createPositionBefore(e),r.createPositionAfter(i[i.length-1])));const o=this._cursorParents.get(e);o?n.modelCursor=r.createPositionAt(o,0):n.modelCursor=n.modelRange.end}_splitToAllowedParent(e,n){const{schema:i,writer:r}=this.conversionApi;let o=i.findAllowedParent(n,e);if(o){if(o===n.parent)return{position:n};this._modelCursor.parent.getAncestors().includes(o)&&(o=null)}if(!o)return NG(n,e,i)?{position:BG(n,r)}:null;const s=this.conversionApi.writer.split(n,o),a=[];for(const u of s.range.getWalker())if(u.type=="elementEnd")a.push(u.item);else{const c=a.pop(),d=u.item;this._registerSplitPair(c,d)}const l=s.range.end.parent;return this._cursorParents.set(e,l),{position:s.position,cursorParent:l}}_registerSplitPair(e,n){this._splitParts.has(e)||this._splitParts.set(e,[e]);const i=this._splitParts.get(e);this._splitParts.set(n,i),i.push(n)}_getSplitParts(e){let n;return this._splitParts.has(e)?n=this._splitParts.get(e):n=[e],n}_keepEmptyElement(e){this._emptyElementsToKeep.add(e)}_removeEmptyElements(){const e=new Map;for(const n of this._splitParts.keys())if(n.isEmpty&&!this._emptyElementsToKeep.has(n)){const i=e.get(n.parent)||[];i.push(n),this._splitParts.delete(n),e.set(n.parent,i)}for(const[n,i]of e)n._removeChildrenArray(i);e.size&&this._removeEmptyElements()}}function DLe(t,e){const n=new Set,i=new Map,r=Ee._createIn(t).getItems();for(const o of r)o.is("element","$marker")&&n.add(o);for(const o of n){const s=o.getAttribute("data-name"),a=e.createPositionBefore(o);i.has(s)?i.get(s).end=a.clone():i.set(s,new Ee(a.clone())),e.remove(o)}return i}function NLe(t,e){let n;for(const i of new su(t)){const r={};for(const s of i.getAttributeKeys())r[s]=i.getAttribute(s);const o=e.createElement(i.name,r);n&&e.insert(o,n),n=Be._createAt(o,0)}return n}class BLe{getHtml(e){const i=Qe.document.implementation.createHTMLDocument("").createElement("div");return i.appendChild(e),i.innerHTML}}class VLe{domParser;domConverter;htmlWriter;skipComments=!0;constructor(e){this.domParser=new DOMParser,this.domConverter=new pS(e,{renderingMode:"data"}),this.htmlWriter=new BLe}toData(e){const n=this.domConverter.viewToDom(e);return this.htmlWriter.getHtml(n)}toView(e){const n=this._toDom(e);return this.domConverter.domToView(n,{skipComments:this.skipComments})}registerRawContentMatcher(e){this.domConverter.registerRawContentMatcher(e)}useFillerType(e){this.domConverter.blockFillerMode=e=="marked"?"markedNbsp":"nbsp"}_toDom(e){/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(e.trim().slice(0,1e4))||(e=`${e}`);const n=this.domParser.parseFromString(e,"text/html"),i=n.createDocumentFragment(),r=n.body.childNodes;for(;r.length>0;)i.appendChild(r[0]);return i}}class FLe extends Fn(){model;mapper;downcastDispatcher;upcastDispatcher;viewDocument;stylesProcessor;htmlProcessor;processor;_viewWriter;constructor(e,n){super(),this.model=e,this.mapper=new _G,this.downcastDispatcher=new CG({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",TG(),{priority:"lowest"}),this.downcastDispatcher.on("insert",EG(),{priority:"lowest"}),this.upcastDispatcher=new LLe({schema:e.schema}),this.viewDocument=new mS(n),this.stylesProcessor=n,this.htmlProcessor=new VLe(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new dG(this.viewDocument),this.upcastDispatcher.on("text",rLe(),{priority:"lowest"}),this.upcastDispatcher.on("element",B4(),{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",B4(),{priority:"lowest"}),Ln().prototype.decorate.call(this,"init"),Ln().prototype.decorate.call(this,"set"),Ln().prototype.decorate.call(this,"get"),Ln().prototype.decorate.call(this,"toView"),Ln().prototype.decorate.call(this,"toModel"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange({isUndoable:!1},DG)},{priority:"lowest"})}get(e={}){const{rootName:n="main",trim:i="empty"}=e;if(!this._checkIfRootsExists([n]))throw new oe("datacontroller-get-non-existent-root",this);const r=this.model.document.getRoot(n);return r.isAttached()||hn("datacontroller-get-detached-root",this),i==="empty"&&!this.model.hasContent(r,{ignoreWhitespaces:!0})?"":this.stringify(r,e)}stringify(e,n={}){const i=this.toView(e,n);return this.processor.toData(i)}toView(e,n={}){const i=this.viewDocument,r=this._viewWriter;this.mapper.clearBindings();const o=Ee._createIn(e),s=new af(i);this.mapper.bindElements(e,s);const a=e.is("documentFragment")?e.markers:$Le(e);return this.downcastDispatcher.convert(o,a,r,n),s}init(e){if(this.model.document.version)throw new oe("datacontroller-init-document-not-empty",this);let n={};if(typeof e=="string"?n.main=e:n=e,!this._checkIfRootsExists(Object.keys(n)))throw new oe("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},i=>{for(const r of Object.keys(n)){const o=this.model.document.getRoot(r);i.insert(this.parse(n[r],o),o,0)}}),Promise.resolve()}set(e,n={}){let i={};if(typeof e=="string"?i.main=e:i=e,!this._checkIfRootsExists(Object.keys(i)))throw new oe("datacontroller-set-non-existent-root",this);this.model.enqueueChange(n.batchType||{},r=>{r.setSelection(null),r.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const o of Object.keys(i)){const s=this.model.document.getRoot(o);r.remove(r.createRangeIn(s)),r.insert(this.parse(i[o],s),s,0)}})}parse(e,n="$root"){const i=this.processor.toView(e);return this.toModel(i,n)}toModel(e,n="$root"){return this.model.change(i=>this.upcastDispatcher.convert(e,i,n))}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 n of e)if(!this.model.document.getRoot(n))return!1;return!0}}function $Le(t){const e=[],n=t.root.document;if(!n)return new Map;const i=Ee._createIn(t);for(const r of n.model.markers){const o=r.getRange(),s=o.isCollapsed,a=o.start.isEqual(i.start)||o.end.isEqual(i.end);if(s&&a)e.push([r.name,o]);else{const l=i.getIntersection(o);l&&e.push([r.name,l])}}return e.sort(([r,o],[s,a])=>{if(o.end.compareWith(a.start)!=="after")return 1;if(o.start.compareWith(a.end)!=="before")return-1;switch(o.start.compareWith(a.start)){case"before":return 1;case"after":return-1;default:switch(o.end.compareWith(a.end)){case"before":return 1;case"after":return-1;default:return s.localeCompare(r)}}}),new Map(e)}class zLe{_helpers=new Map;_downcast;_upcast;constructor(e,n){this._downcast=li(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=li(n),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,n){const i=this._downcast.includes(n);if(!this._upcast.includes(n)&&!i)throw new oe("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[n],isDowncast:i})}for(e){if(!this._helpers.has(e))throw new oe("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:n,view:i}of NT(e))this.for("upcast").elementToElement({model:n,view:i,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:n,view:i}of NT(e))this.for("upcast").elementToAttribute({view:i,model:n,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:n,view:i}of NT(e))this.for("upcast").attributeToAttribute({view:i,model:n})}_createConversionHelpers({name:e,dispatchers:n,isDowncast:i}){if(this._helpers.has(e))throw new oe("conversion-group-exists",this);const r=i?new TOe(n):new iLe(n);this._helpers.set(e,r)}}function*NT(t){if(t.model.values)for(const e of t.model.values){const n={key:t.model.key,value:e},i=t.view[e],r=t.upcastAlso?t.upcastAlso[e]:void 0;yield*$4(n,i,r)}else yield*$4(t.model,t.view,t.upcastAlso)}function*$4(t,e,n){if(yield{model:t,view:e},n)for(const i of li(n))yield{model:t,view:i}}class ds{baseVersion;isDocumentOperation;batch;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,n){return new this(e.baseVersion)}}function QM(t,e){const n=HG(e),i=n.reduce((s,a)=>s+a.offsetSize,0),r=t.parent;lb(t);const o=t.index;return r._insertChild(o,n),ab(r,o+n.length),ab(r,o),new Ee(t,t.getShiftedBy(i))}function zG(t){if(!t.isFlat)throw new oe("operation-utils-remove-range-not-flat",this);const e=t.start.parent;lb(t.start),lb(t.end);const n=e._removeChildren(t.start.index,t.end.index-t.start.index);return ab(e,t.start.index),n}function sb(t,e){if(!t.isFlat)throw new oe("operation-utils-move-range-not-flat",this);const n=zG(t);return e=e._getTransformedByDeletion(t.start,t.end.offset-t.start.offset),QM(e,n)}function HLe(t,e,n){lb(t.start),lb(t.end);for(const i of t.getItems({shallow:!0})){const r=i.is("$textProxy")?i.textNode:i;n!==null?r._setAttribute(e,n):r._removeAttribute(e),ab(r.parent,r.index)}ab(t.end.parent,t.end.index)}function HG(t){const e=[];function n(i){if(typeof i=="string")e.push(new ni(i));else if(i instanceof ea)e.push(new ni(i.data,i.getAttributes()));else if(i instanceof Uf)e.push(i);else if(us(i))for(const r of i)n(r)}n(t);for(let i=1;ie.maxOffset)throw new oe("move-operation-nodes-do-not-exist",this);if(e===n&&i=i&&this.targetPosition.path[o]i._clone(!0))),n=new hr(this.position,e,this.baseVersion);return n.shouldReceiveAttributes=this.shouldReceiveAttributes,n}getReversed(){const e=this.position.root.document.graveyard,n=new Be(e,[0]);return new Tn(this.position,this.nodes.maxOffset,n,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsetn._clone(!0))),QM(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,n){const i=[];for(const o of e.nodes)o.name?i.push(zn.fromJSON(o)):i.push(ni.fromJSON(o));const r=new hr(Be.fromJSON(e.position,n),i,e.baseVersion);return r.shouldReceiveAttributes=e.shouldReceiveAttributes,r}}class Hn extends ds{splitPosition;howMany;insertionPosition;graveyardPosition;constructor(e,n,i,r,o){super(o),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=n,this.insertionPosition=i,this.graveyardPosition=r?r.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new Be(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Ee(this.splitPosition,e)}get affectedSelectable(){const e=[Ee._createFromPositionAndShift(this.splitPosition,0),Ee._createFromPositionAndShift(this.insertionPosition,0)];return this.graveyardPosition&&e.push(Ee._createFromPositionAndShift(this.graveyardPosition,0)),e}clone(){return new Hn(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.splitPosition.root.document.graveyard,n=new Be(e,[0]);return new Ai(this.moveTargetPosition,this.howMany,this.splitPosition,n,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,n=this.splitPosition.offset;if(!e||e.maxOffset1&&e.sourcePosition.isEqual(n.deletionPosition)?this._setRelation(e,n,"firstToMoveMerged"):e.howMany>1&&e.sourcePosition.getShiftedBy(e.howMany-1).isEqual(n.deletionPosition)&&this._setRelation(e,n,"lastToMoveMerged"):n instanceof Tn&&(e.targetPosition.isEqual(n.sourcePosition)||e.targetPosition.isBefore(n.sourcePosition)?this._setRelation(e,n,"insertBefore"):this._setRelation(e,n,"insertAfter"));else if(e instanceof Hn){if(n instanceof Ai)e.splitPosition.isBefore(n.sourcePosition)&&this._setRelation(e,n,"splitBefore");else if(n instanceof Tn)if(e.splitPosition.isEqual(n.sourcePosition)||e.splitPosition.isBefore(n.sourcePosition))this._setRelation(e,n,"splitBefore");else{const i=Ee._createFromPositionAndShift(n.sourcePosition,n.howMany);if(e.splitPosition.hasSameParentAs(n.sourcePosition)&&i.containsPosition(e.splitPosition)){const r=i.end.offset-e.splitPosition.offset,o=e.splitPosition.offset-i.start.offset;this._setRelation(e,n,{howMany:r,offset:o})}}}else if(e instanceof Ai)n instanceof Ai?(e.targetPosition.isEqual(n.sourcePosition)||this._setRelation(e,n,"mergeTargetNotMoved"),e.sourcePosition.isEqual(n.targetPosition)&&this._setRelation(e,n,"mergeSourceNotMoved"),e.sourcePosition.isEqual(n.sourcePosition)&&this._setRelation(e,n,"mergeSameElement")):n instanceof Hn?e.sourcePosition.isEqual(n.splitPosition)&&this._setRelation(e,n,"splitAtSource"):n instanceof Tn&&n.howMany>0&&(e.sourcePosition.isEqual(n.sourcePosition.getShiftedBy(n.howMany))&&this._setRelation(e,n,"mergeSourceAffected"),e.targetPosition.isEqual(n.sourcePosition)&&this._setRelation(e,n,"mergeTargetWasBefore"));else if(e instanceof no){const i=e.newRange;if(!i)return;if(n instanceof Ai){const r=i.start.isEqual(n.targetPosition),o=i.start.isEqual(n.deletionPosition),s=i.end.isEqual(n.deletionPosition),a=i.end.isEqual(n.sourcePosition);(r||o||s||a)&&this._setRelation(e,n,{wasInLeftElement:r,wasStartBeforeMergedElement:o,wasEndBeforeMergedElement:s,wasInRightElement:a})}}}getContext(e,n,i){return{aIsStrong:i,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(n),abRelation:this._useRelations?this._getRelation(e,n):null,baRelation:this._useRelations?this._getRelation(n,e):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(e){const n=this.originalOperations.get(e);return n.wasUndone||this._history.isUndoneOperation(n)}_getRelation(e,n){const i=this.originalOperations.get(n),r=this._history.getUndoneOperation(i);if(!r)return null;const o=this.originalOperations.get(e),s=this._relations.get(o);return s&&s.get(r)||null}_setRelation(e,n,i){const r=this.originalOperations.get(e),o=this.originalOperations.get(n);let s=this._relations.get(r);s||(s=new Map,this._relations.set(r,s)),s.set(o,i)}}function H4(t,e){for(const n of t)n.baseVersion=e++}function U4(t){const e=new Map;for(let n=0;n{if(t.key===e.key&&t.range.start.hasSameParentAs(e.range.start)){const i=t.range.getDifference(e.range).map(o=>new zi(o,t.key,t.oldValue,t.newValue,0)),r=t.range.getIntersection(e.range);return r&&n.aIsStrong&&i.push(new zi(r,e.key,e.newValue,t.newValue,0)),i.length==0?[new or(0)]:i}else return[t]});_n(zi,hr,(t,e)=>{if(t.range.start.hasSameParentAs(e.position)&&t.range.containsPosition(e.position)){const i=t.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes).map(r=>new zi(r,t.key,t.oldValue,t.newValue,t.baseVersion));if(e.shouldReceiveAttributes){const r=WG(e,t.key,t.oldValue);r&&i.unshift(r)}return i}return t.range=t.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[t]});function WG(t,e,n){const r=t.nodes.getNode(0).getAttribute(e);if(r==n)return null;const o=new Ee(t.position,t.position.getShiftedBy(t.howMany));return new zi(o,e,r,n,0)}_n(zi,Ai,(t,e)=>{const n=[];t.range.start.hasSameParentAs(e.deletionPosition)&&(t.range.containsPosition(e.deletionPosition)||t.range.start.isEqual(e.deletionPosition))&&n.push(Ee._createFromPositionAndShift(e.graveyardPosition,1));const i=t.range._getTransformedByMergeOperation(e);return i.isCollapsed||n.push(i),n.map(r=>new zi(r,t.key,t.oldValue,t.newValue,t.baseVersion))});_n(zi,Tn,(t,e)=>GLe(t.range,e).map(i=>new zi(i,t.key,t.oldValue,t.newValue,t.baseVersion)));function GLe(t,e){const n=Ee._createFromPositionAndShift(e.sourcePosition,e.howMany);let i=null,r=[];n.containsRange(t,!0)?i=t:t.start.hasSameParentAs(n.start)?(r=t.getDifference(n),i=t.getIntersection(n)):r=[t];const o=[];for(let s of r){s=s._getTransformedByDeletion(e.sourcePosition,e.howMany);const a=e.getMovedRangeStart(),l=s.start.hasSameParentAs(a),u=s._getTransformedByInsertion(a,e.howMany,l);o.push(...u)}return i&&o.push(i._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,!1)[0]),o}_n(zi,Hn,(t,e)=>{if(t.range.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.range.end.offset++,[t];if(t.range.start.hasSameParentAs(e.splitPosition)&&t.range.containsPosition(e.splitPosition)){const n=t.clone();return n.range=new Ee(e.moveTargetPosition.clone(),t.range.end._getCombined(e.splitPosition,e.moveTargetPosition)),t.range.end=e.splitPosition.clone(),t.range.end.stickiness="toPrevious",[t,n]}return t.range=t.range._getTransformedBySplitOperation(e),[t]});_n(hr,zi,(t,e)=>{const n=[t];if(t.shouldReceiveAttributes&&t.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(t.position)){const i=WG(t,e.key,e.newValue);i&&n.push(i)}return n});_n(hr,hr,(t,e,n)=>t.position.isEqual(e.position)&&n.aIsStrong?[t]:(t.position=t.position._getTransformedByInsertOperation(e),[t]));_n(hr,Tn,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t]));_n(hr,Hn,(t,e)=>(t.position=t.position._getTransformedBySplitOperation(e),[t]));_n(hr,Ai,(t,e)=>(t.position=t.position._getTransformedByMergeOperation(e),[t]));_n(no,hr,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByInsertOperation(e)[0]),t.newRange&&(t.newRange=t.newRange._getTransformedByInsertOperation(e)[0]),[t]));_n(no,no,(t,e,n)=>{if(t.name==e.name)if(n.aIsStrong)t.oldRange=e.newRange?e.newRange.clone():null;else return[new or(0)];return[t]});_n(no,Ai,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByMergeOperation(e)),t.newRange&&(t.newRange=t.newRange._getTransformedByMergeOperation(e)),[t]));_n(no,Tn,(t,e)=>{const n=[t];if(t.oldRange&&(t.oldRange=Ee._createFromRanges(t.oldRange._getTransformedByMoveOperation(e))),t.newRange){const i=t.newRange._getTransformedByMoveOperation(e);t.newRange=i[0];for(let r=1;r{if(t.oldRange&&(t.oldRange=t.oldRange._getTransformedBySplitOperation(e)),t.newRange){if(n.abRelation){const i=t.newRange._getTransformedBySplitOperation(e);return t.newRange.start.isEqual(e.splitPosition)?n.abRelation.wasStartBeforeMergedElement?t.newRange.start=Be._createAt(e.insertionPosition):n.abRelation.wasInLeftElement?t.newRange.start=Be._createAt(t.newRange.start):t.newRange.start=Be._createAt(e.moveTargetPosition):t.newRange.start=i.start,t.newRange.end.isEqual(e.splitPosition)?t.newRange.end.isEqual(e.splitPosition)&&n.abRelation.wasEndBeforeMergedElement?t.newRange.end=Be._createAt(e.insertionPosition):n.abRelation.wasInRightElement?t.newRange.end=Be._createAt(e.moveTargetPosition):t.newRange.end=Be._createAt(t.newRange.end):t.newRange.end=i.end,[t]}t.newRange=t.newRange._getTransformedBySplitOperation(e)}return[t]});_n(Ai,hr,(t,e)=>(t.sourcePosition.hasSameParentAs(e.position)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByInsertOperation(e),t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e),[t]));_n(Ai,Ai,(t,e,n)=>{if(t.sourcePosition.isEqual(e.sourcePosition)&&t.targetPosition.isEqual(e.targetPosition))if(n.bWasUndone){const i=e.graveyardPosition.path.slice();return i.push(0),t.sourcePosition=new Be(e.graveyardPosition.root,i),t.howMany=0,[t]}else return[new or(0)];if(t.sourcePosition.isEqual(e.sourcePosition)&&!t.targetPosition.isEqual(e.targetPosition)&&!n.bWasUndone&&n.abRelation!="splitAtSource"){const i=t.targetPosition.root.rootName=="$graveyard",r=e.targetPosition.root.rootName=="$graveyard";if(r&&!i||!(i&&!r)&&n.aIsStrong){const l=e.targetPosition._getTransformedByMergeOperation(e),u=t.targetPosition._getTransformedByMergeOperation(e);return[new Tn(l,t.howMany,u,0)]}else return[new or(0)]}return t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMergeOperation(e),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),(!t.graveyardPosition.isEqual(e.graveyardPosition)||!n.aIsStrong)&&(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]});_n(Ai,Tn,(t,e,n)=>{const i=Ee._createFromPositionAndShift(e.sourcePosition,e.howMany);return e.type=="remove"&&!n.bWasUndone&&t.deletionPosition.hasSameParentAs(e.sourcePosition)&&i.containsPosition(t.sourcePosition)?[new or(0)]:(e.sourcePosition.getShiftedBy(e.howMany).isEqual(t.sourcePosition)?t.sourcePosition.stickiness="toNone":e.targetPosition.isEqual(t.sourcePosition)&&n.abRelation=="mergeSourceAffected"?t.sourcePosition.stickiness="toNext":e.sourcePosition.isEqual(t.targetPosition)?(t.targetPosition.stickiness="toNone",t.howMany-=e.howMany):e.targetPosition.isEqual(t.targetPosition)&&n.abRelation=="mergeTargetWasBefore"?(t.targetPosition.stickiness="toPrevious",t.howMany+=e.howMany):(t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition.hasSameParentAs(e.sourcePosition)&&(t.howMany-=e.howMany)),t.sourcePosition=t.sourcePosition._getTransformedByMoveOperation(e),t.targetPosition=t.targetPosition._getTransformedByMoveOperation(e),t.sourcePosition.stickiness="toPrevious",t.targetPosition.stickiness="toNext",t.graveyardPosition.isEqual(e.targetPosition)||(t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)),[t])});_n(Ai,Hn,(t,e,n)=>{if(e.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1),t.deletionPosition.isEqual(e.graveyardPosition)&&(t.howMany=e.howMany)),t.targetPosition.isEqual(e.splitPosition)&&(e.graveyardPosition&&t.deletionPosition.isEqual(e.graveyardPosition)||n.abRelation=="mergeTargetNotMoved"))return t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),[t];if(t.sourcePosition.isEqual(e.splitPosition)){if(n.abRelation=="mergeSourceNotMoved")return t.howMany=0,t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t];if(n.abRelation=="mergeSameElement"||t.sourcePosition.offset>0)return t.sourcePosition=e.moveTargetPosition.clone(),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]}return t.sourcePosition.hasSameParentAs(e.splitPosition)&&(t.howMany=e.splitPosition.offset),t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]});_n(Tn,hr,(t,e)=>{const i=Ee._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByInsertOperation(e,!1)[0];return t.sourcePosition=i.start,t.howMany=i.end.offset-i.start.offset,t.targetPosition.isEqual(e.position)||(t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e)),[t]});_n(Tn,Tn,(t,e,n)=>{const i=Ee._createFromPositionAndShift(t.sourcePosition,t.howMany),r=Ee._createFromPositionAndShift(e.sourcePosition,e.howMany);let o=n.aIsStrong,s=!n.aIsStrong;n.abRelation=="insertBefore"||n.baRelation=="insertAfter"?s=!0:(n.abRelation=="insertAfter"||n.baRelation=="insertBefore")&&(s=!1);let a;if(t.targetPosition.isEqual(e.targetPosition)&&s?a=t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):a=t.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),W4(t,e)&&W4(e,t))return[e.getReversed()];if(i.containsPosition(e.targetPosition)&&i.containsRange(r,!0))return i.start=i.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),i.end=i.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Gh([i],a);if(r.containsPosition(t.targetPosition)&&r.containsRange(i,!0))return i.start=i.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),i.end=i.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),Gh([i],a);const c=ur(t.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if(c=="prefix"||c=="extension")return i.start=i.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),i.end=i.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Gh([i],a);t.type=="remove"&&e.type!="remove"&&!n.aWasUndone&&!n.forceWeakRemove?o=!0:t.type!="remove"&&e.type=="remove"&&!n.bWasUndone&&!n.forceWeakRemove&&(o=!1);const d=[],f=i.getDifference(r);for(const m of f){m.start=m.start._getTransformedByDeletion(e.sourcePosition,e.howMany),m.end=m.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const g=ur(m.start.getParentPath(),e.getMovedRangeStart().getParentPath())=="same",v=m._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,g);d.push(...v)}const h=i.getIntersection(r);return h!==null&&o&&(h.start=h.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),h.end=h.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),d.length===0?d.push(h):d.length==1?r.start.isBefore(i.start)||r.start.isEqual(i.start)?d.unshift(h):d.push(h):d.splice(1,0,h)),d.length===0?[new or(t.baseVersion)]:Gh(d,a)});_n(Tn,Hn,(t,e,n)=>{let i=t.targetPosition.clone();if((!t.targetPosition.isEqual(e.insertionPosition)||!e.graveyardPosition||n.abRelation=="moveTargetAfter")&&(i=t.targetPosition._getTransformedBySplitOperation(e)),t.sourcePosition.isEqual(e.insertionPosition)&&n.abRelation=="firstToMoveMerged")return t.howMany++,t.targetPosition=i,[t];const r=Ee._createFromPositionAndShift(t.sourcePosition,t.howMany);if(r.end.isEqual(e.insertionPosition))return(!e.graveyardPosition||n.abRelation=="lastToMoveMerged")&&t.howMany++,t.targetPosition=i,[t];if(r.start.hasSameParentAs(e.splitPosition)&&r.containsPosition(e.splitPosition)){let a=new Ee(e.splitPosition,r.end);a=a._getTransformedBySplitOperation(e);const l=[new Ee(r.start,e.splitPosition),a];return Gh(l,i)}t.targetPosition.isEqual(e.splitPosition)&&n.abRelation=="insertAtSource"&&(i=e.moveTargetPosition),t.targetPosition.isEqual(e.insertionPosition)&&n.abRelation=="insertBetween"&&(i=t.targetPosition);const s=[r._getTransformedBySplitOperation(e)];if(e.graveyardPosition){const a=r.start.isEqual(e.graveyardPosition)||r.containsPosition(e.graveyardPosition);t.howMany>1&&a&&!n.aWasUndone&&s.push(Ee._createFromPositionAndShift(e.insertionPosition,1))}return Gh(s,i)});_n(Tn,Ai,(t,e,n)=>{const i=Ee._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.sourcePosition)){if(t.type=="remove"&&!n.forceWeakRemove){if(!n.aWasUndone){const s=[];let a=e.graveyardPosition.clone(),l=e.targetPosition._getTransformedByMergeOperation(e);const u=t.targetPosition.getTransformedByOperation(e);t.howMany>1&&(s.push(new Tn(t.sourcePosition,t.howMany-1,u,0)),a=a._getTransformedByMove(t.sourcePosition,u,t.howMany-1),l=l._getTransformedByMove(t.sourcePosition,u,t.howMany-1));const c=e.deletionPosition._getCombined(t.sourcePosition,u),d=new Tn(a,1,c,0),f=d.getMovedRangeStart().path.slice();f.push(0);const h=new Be(d.targetPosition.root,f);l=l._getTransformedByMove(a,c,1);const m=new Tn(l,e.howMany,h,0);return s.push(d),s.push(m),s}}else if(t.howMany==1)return n.bWasUndone?(t.sourcePosition=e.graveyardPosition.clone(),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]):[new or(0)]}const o=Ee._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByMergeOperation(e);return t.sourcePosition=o.start,t.howMany=o.end.offset-o.start.offset,t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]});_n(Po,hr,(t,e)=>(t.position=t.position._getTransformedByInsertOperation(e),[t]));_n(Po,Ai,(t,e)=>t.position.isEqual(e.deletionPosition)?(t.position=e.graveyardPosition.clone(),t.position.stickiness="toNext",[t]):(t.position=t.position._getTransformedByMergeOperation(e),[t]));_n(Po,Tn,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t]));_n(Po,Po,(t,e,n)=>{if(t.position.isEqual(e.position))if(n.aIsStrong)t.oldName=e.newName;else return[new or(0)];return[t]});_n(Po,Hn,(t,e)=>{const n=t.position.path,i=e.splitPosition.getParentPath();if(ur(n,i)=="same"&&!e.graveyardPosition){const r=new Po(t.position.getShiftedBy(1),t.oldName,t.newName,0);return[t,r]}return t.position=t.position._getTransformedBySplitOperation(e),[t]});_n(au,au,(t,e,n)=>{if(t.root===e.root&&t.key===e.key)if(n.aIsStrong)t.oldValue=e.newValue;else return[new or(0)];return[t]});_n(Qa,Qa,(t,e)=>t.rootName===e.rootName&&t.isAdd===e.isAdd?[new or(0)]:[t]);_n(Hn,hr,(t,e)=>(t.splitPosition.hasSameParentAs(e.position)&&t.splitPosition.offset{if(!t.graveyardPosition&&!n.bWasUndone&&t.splitPosition.hasSameParentAs(e.sourcePosition)){const i=e.graveyardPosition.path.slice();i.push(0);const r=new Be(e.graveyardPosition.root,i),o=Hn.getInsertionPosition(new Be(e.graveyardPosition.root,i)),s=new Hn(r,0,o,null,0);return t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=Hn.getInsertionPosition(t.splitPosition),t.graveyardPosition=s.insertionPosition.clone(),t.graveyardPosition.stickiness="toNext",[s,t]}return t.splitPosition.hasSameParentAs(e.deletionPosition)&&!t.splitPosition.isAfter(e.deletionPosition)&&t.howMany--,t.splitPosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=Hn.getInsertionPosition(t.splitPosition),t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]});_n(Hn,Tn,(t,e,n)=>{const i=Ee._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.graveyardPosition){const o=i.start.isEqual(t.graveyardPosition)||i.containsPosition(t.graveyardPosition);if(!n.bWasUndone&&o){const s=t.splitPosition._getTransformedByMoveOperation(e),a=t.graveyardPosition._getTransformedByMoveOperation(e),l=a.path.slice();l.push(0);const u=new Be(a.root,l);return[new Tn(s,t.howMany,u,0)]}t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)}const r=t.splitPosition.isEqual(e.targetPosition);if(r&&(n.baRelation=="insertAtSource"||n.abRelation=="splitBefore"))return t.howMany+=e.howMany,t.splitPosition=t.splitPosition._getTransformedByDeletion(e.sourcePosition,e.howMany),t.insertionPosition=Hn.getInsertionPosition(t.splitPosition),[t];if(r&&n.abRelation&&n.abRelation.howMany){const{howMany:o,offset:s}=n.abRelation;return t.howMany+=o,t.splitPosition=t.splitPosition.getShiftedBy(s),[t]}if(t.splitPosition.hasSameParentAs(e.sourcePosition)&&i.containsPosition(t.splitPosition)){const o=e.howMany-(t.splitPosition.offset-e.sourcePosition.offset);return t.howMany-=o,t.splitPosition.hasSameParentAs(e.targetPosition)&&t.splitPosition.offset{if(t.splitPosition.isEqual(e.splitPosition)){if(!t.graveyardPosition&&!e.graveyardPosition)return[new or(0)];if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition))return[new or(0)];if(n.abRelation=="splitBefore")return t.howMany=0,t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e),[t]}if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition)){const i=t.splitPosition.root.rootName=="$graveyard",r=e.splitPosition.root.rootName=="$graveyard";if(r&&!i||!(i&&!r)&&n.aIsStrong){const l=[];return e.howMany&&l.push(new Tn(e.moveTargetPosition,e.howMany,e.splitPosition,0)),t.howMany&&l.push(new Tn(t.splitPosition,t.howMany,t.moveTargetPosition,0)),l}else return[new or(0)]}if(t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e)),t.splitPosition.isEqual(e.insertionPosition)&&n.abRelation=="splitBefore")return t.howMany++,[t];if(e.splitPosition.isEqual(t.insertionPosition)&&n.baRelation=="splitBefore"){const i=e.insertionPosition.path.slice();i.push(0);const r=new Be(e.insertionPosition.root,i),o=new Tn(t.insertionPosition,1,r,0);return[t,o]}return t.splitPosition.hasSameParentAs(e.splitPosition)&&t.splitPosition.offset{const n=e[0];n.isDocumentOperation&&XLe.call(this,n)},{priority:"low"})}function XLe(t){const e=this.getTransformedByOperation(t);if(!this.isEqual(e)){const n=this.toPosition();this.path=e.path,this.root=e.root,this.fire("change",n)}}class lh{operations;isUndoable;isLocal;isUndo;isTyping;constructor(e={}){typeof e=="string"&&(e=e==="transparent"?{isUndoable:!1}:{},hn("batch-constructor-deprecated-string-type"));const{isUndoable:n=!0,isLocal:i=!0,isUndo:r=!1,isTyping:o=!1}=e;this.operations=[],this.isUndoable=n,this.isLocal=i,this.isUndo=r,this.isTyping=o}get baseVersion(){for(const e of this.operations)if(e.baseVersion!==null)return e.baseVersion;return null}addOperation(e){return e.isDocumentOperation&&(e.batch=this,this.operations.push(e)),e}}class f1{static _statesPriority=[void 0,"refresh","rename","move"];_markerCollection;_changesInElement=new Map;_elementsSnapshots=new Map;_elementChildrenSnapshots=new Map;_elementState=new Map;_changedMarkers=new Map;_changedRoots=new Map;_changeCount=0;_cachedChanges=null;_cachedChangesWithGraveyard=null;_refreshedItems=new Set;constructor(e){this._markerCollection=e}get isEmpty(){return this._changesInElement.size==0&&this._changedMarkers.size==0&&this._changedRoots.size==0}bufferOperation(e){const n=e;switch(n.type){case"insert":{if(this._isInInsertedElement(n.position.parent))return;this._markInsert(n.position.parent,n.position.offset,n.nodes.maxOffset);break}case"addAttribute":case"removeAttribute":case"changeAttribute":{for(const i of n.range.getItems({shallow:!0}))this._isInInsertedElement(i.parent)||this._markAttribute(i);break}case"remove":case"move":case"reinsert":{if(n.sourcePosition.isEqual(n.targetPosition)||n.sourcePosition.getShiftedBy(n.howMany).isEqual(n.targetPosition))return;const i=this._isInInsertedElement(n.sourcePosition.parent),r=this._isInInsertedElement(n.targetPosition.parent);i||this._markRemove(n.sourcePosition.parent,n.sourcePosition.offset,n.howMany),r||this._markInsert(n.targetPosition.parent,n.getMovedRangeStart().offset,n.howMany);const o=Ee._createFromPositionAndShift(n.sourcePosition,n.howMany);for(const s of o.getItems({shallow:!0}))this._setElementState(s,"move");break}case"rename":{if(this._isInInsertedElement(n.position.parent))return;this._markRemove(n.position.parent,n.position.offset,1),this._markInsert(n.position.parent,n.position.offset,1);const i=Ee._createFromPositionAndShift(n.position,1);for(const r of this._markerCollection.getMarkersIntersectingRange(i)){const o=r.getData();this.bufferMarkerChange(r.name,o,o)}this._setElementState(n.position.nodeAfter,"rename");break}case"split":{const i=n.splitPosition.parent;if(!this._isInInsertedElement(i)){this._markRemove(i,n.splitPosition.offset,n.howMany);const r=Ee._createFromPositionAndShift(n.splitPosition,n.howMany);for(const o of r.getItems({shallow:!0}))this._setElementState(o,"move")}this._isInInsertedElement(n.insertionPosition.parent)||this._markInsert(n.insertionPosition.parent,n.insertionPosition.offset,1),n.graveyardPosition&&(this._markRemove(n.graveyardPosition.parent,n.graveyardPosition.offset,1),this._setElementState(n.graveyardPosition.nodeAfter,"move"));break}case"merge":{const i=n.sourcePosition.parent;this._isInInsertedElement(i.parent)||this._markRemove(i.parent,i.startOffset,1);const r=n.graveyardPosition.parent;this._markInsert(r,n.graveyardPosition.offset,1),this._setElementState(i,"move");const o=n.targetPosition.parent;if(!this._isInInsertedElement(o)){this._markInsert(o,n.targetPosition.offset,i.maxOffset);const s=Ee._createFromPositionAndShift(n.sourcePosition,n.howMany);for(const a of s.getItems({shallow:!0}))this._setElementState(a,"move")}break}case"detachRoot":case"addRoot":{const i=n.affectedSelectable;if(!i._isLoaded||i.isAttached()==n.isAdd)return;this._bufferRootStateChange(n.rootName,n.isAdd);break}case"addRootAttribute":case"removeRootAttribute":case"changeRootAttribute":{if(!n.root._isLoaded)return;const i=n.root.rootName;this._bufferRootAttributeChange(i,n.key,n.oldValue,n.newValue);break}}this._cachedChanges=null}bufferMarkerChange(e,n,i){n.range&&n.range.root.is("rootElement")&&!n.range.root._isLoaded&&(n.range=null),i.range&&i.range.root.is("rootElement")&&!i.range.root._isLoaded&&(i.range=null);let r=this._changedMarkers.get(e);r?r.newMarkerData=i:(r={newMarkerData:i,oldMarkerData:n},this._changedMarkers.set(e,r)),r.oldMarkerData.range==null&&i.range==null&&this._changedMarkers.delete(e)}getMarkersToRemove(){const e=[];for(const[n,i]of this._changedMarkers)i.oldMarkerData.range!=null&&e.push({name:n,range:i.oldMarkerData.range});return e}getMarkersToAdd(){const e=[];for(const[n,i]of this._changedMarkers)i.newMarkerData.range!=null&&e.push({name:n,range:i.newMarkerData.range});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map(([e,n])=>({name:e,data:{oldRange:n.oldMarkerData.range,newRange:n.newMarkerData.range}}))}hasDataChanges(){if(this.getChanges().length||this._changedRoots.size>0)return!0;for(const{newMarkerData:e,oldMarkerData:n}of this._changedMarkers.values()){if(e.affectsData!==n.affectsData)return!0;if(e.affectsData){const i=e.range&&!n.range,r=!e.range&&n.range,o=e.range&&n.range&&!e.range.isEqual(n.range);if(i||r||o)return!0}}return!1}getChanges(e={}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let n=[];for(const i of this._changesInElement.keys()){const r=this._changesInElement.get(i).sort((c,d)=>c.offset===d.offset?c.type!=d.type?c.type=="remove"?-1:1:0:c.offseti.position.root!=r.position.root?i.position.root.rootNamei);for(const i of n)delete i.changeCount,i.type=="attribute"&&(delete i.position,delete i.length);return this._changeCount=0,this._cachedChangesWithGraveyard=n,this._cachedChanges=n.filter(ZLe),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getChangedRoots(){return Array.from(this._changedRoots.values()).map(e=>{const n={...e};return n.state!==void 0&&delete n.attributes,n})}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementChildrenSnapshots.clear(),this._elementsSnapshots.clear(),this._elementState.clear(),this._changedMarkers.clear(),this._changedRoots.clear(),this._refreshedItems.clear(),this._cachedChanges=null}_refreshItem(e){if(this._isInInsertedElement(e.parent))return;this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize),this._refreshedItems.add(e),this._setElementState(e,"refresh");const n=Ee._createOn(e);for(const i of this._markerCollection.getMarkersIntersectingRange(n)){const r=i.getData();this.bufferMarkerChange(i.name,r,r)}this._cachedChanges=null}_bufferRootLoad(e){if(e.isAttached()){this._bufferRootStateChange(e.rootName,!0),this._markInsert(e,0,e.maxOffset);for(const n of e.getAttributeKeys())this._bufferRootAttributeChange(e.rootName,n,null,e.getAttribute(n));for(const n of this._markerCollection)if(n.getRange().root==e){const i=n.getData();this.bufferMarkerChange(n.name,{...i,range:null},i)}}}_bufferRootStateChange(e,n){if(!this._changedRoots.has(e)){this._changedRoots.set(e,{name:e,state:n?"attached":"detached"});return}const i=this._changedRoots.get(e);i.state!==void 0?(delete i.state,i.attributes===void 0&&this._changedRoots.delete(e)):i.state=n?"attached":"detached"}_bufferRootAttributeChange(e,n,i,r){const o=this._changedRoots.get(e)||{name:e},s=o.attributes||{};if(s[n]){const a=s[n];r===a.oldValue?delete s[n]:a.newValue=r}else s[n]={oldValue:i,newValue:r};Object.entries(s).length===0?(delete o.attributes,o.state===void 0&&this._changedRoots.delete(e)):(o.attributes=s,this._changedRoots.set(e,o))}_markInsert(e,n,i){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const r={type:"insert",offset:n,howMany:i,count:this._changeCount++};this._markChange(e,r)}_markRemove(e,n,i){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const r={type:"remove",offset:n,howMany:i,count:this._changeCount++};this._markChange(e,r),this._removeAllNestedChanges(e,n,i)}_markAttribute(e){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const n={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,n)}_markChange(e,n){this._makeSnapshots(e);const i=this._getChangesForElement(e);this._handleChange(n,i),i.push(n);for(let r=0;ri&&this._elementState.set(e,n)}_getDiffActionForNode(e,n){if(!e.is("element")||!this._elementsSnapshots.has(e))return n;const i=this._elementState.get(e);return!i||i=="move"?n:i}_getChangesForElement(e){let n;return this._changesInElement.has(e)?n=this._changesInElement.get(e):(n=[],this._changesInElement.set(e,n)),n}_makeSnapshots(e){if(this._elementChildrenSnapshots.has(e))return;const n=j4(e.getChildren());this._elementChildrenSnapshots.set(e,n);for(const i of n)this._elementsSnapshots.set(i.node,i)}_handleChange(e,n){e.nodesToHandle=e.howMany;for(const i of n){const r=e.offset+e.howMany,o=i.offset+i.howMany;if(e.type=="insert"&&(i.type=="insert"&&(e.offset<=i.offset?i.offset+=e.howMany:e.offseti.offset){if(r>o){const s={type:"attribute",offset:o,howMany:r-o,count:this._changeCount++};this._handleChange(s,n),n.push(s)}e.nodesToHandle=i.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=i.offset&&e.offseto?(e.nodesToHandle=r-o,e.offset=o):e.nodesToHandle=0);if(i.type=="remove"&&e.offseti.offset){const s={type:"attribute",offset:i.offset,howMany:r-i.offset,count:this._changeCount++};this._handleChange(s,n),n.push(s),e.nodesToHandle=i.offset-e.offset,e.howMany=e.nodesToHandle}i.type=="attribute"&&(e.offset>=i.offset&&r<=o?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=i.offset&&r>=o&&(i.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,n,i,r,o){const s={type:"insert",position:Be._createAt(e,n),name:r.name,attributes:new Map(r.attributes),length:1,changeCount:this._changeCount++,action:i};return i!="insert"&&o&&(s.before={name:o.name,attributes:new Map(o.attributes)}),s}_getRemoveDiff(e,n,i,r){return{type:"remove",action:i,position:Be._createAt(e,n),name:r.name,attributes:new Map(r.attributes),length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,n,i){const r=[];i=new Map(i);for(const[o,s]of n){const a=i.has(o)?i.get(o):null;a!==s&&r.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:o,attributeOldValue:s,attributeNewValue:a,changeCount:this._changeCount++}),i.delete(o)}for(const[o,s]of i)r.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:o,attributeOldValue:null,attributeNewValue:s,changeCount:this._changeCount++});return r}_isInInsertedElement(e){const n=e.parent;if(!n)return!1;const i=this._changesInElement.get(n),r=e.startOffset;if(i){for(const o of i)if(o.type=="insert"&&r>=o.offset&&ri){for(let s=0;s1500)for(let s=0;sthis._version+1&&this._gaps.set(this._version,e),this._version=e}get lastOperation(){return this._operations[this._operations.length-1]}addOperation(e){if(e.baseVersion!==this.version)throw new oe("model-document-history-addoperation-incorrect-version",this,{operation:e,historyVersion:this.version});this._operations.push(e),this._version++,this._baseVersionToOperationIndex.set(e.baseVersion,this._operations.length-1)}getOperations(e,n=this.version){if(!this._operations.length)return[];const i=this._operations[0];e===void 0&&(e=i.baseVersion);let r=n-1;for(const[a,l]of this._gaps)e>a&&ea&&rthis.lastOperation.baseVersion)return[];let o=this._baseVersionToOperationIndex.get(e);o===void 0&&(o=0);let s=this._baseVersionToOperationIndex.get(r);return s===void 0&&(s=this._operations.length-1),this._operations.slice(o,s+1)}getOperation(e){const n=this._baseVersionToOperationIndex.get(e);if(n!==void 0)return this._operations[n]}setOperationAsUndone(e,n){this._undoPairs.set(n,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)}reset(){this._version=0,this._undoPairs=new Map,this._operations=[],this._undoneOperations=new Set,this._gaps=new Map,this._baseVersionToOperationIndex=new Map}}class h1 extends zn{rootName;_document;_isAttached=!0;_isLoaded=!0;constructor(e,n,i="main"){super(n),this._document=e,this.rootName=i}get document(){return this._document}isAttached(){return this._isAttached}toJSON(){return this.rootName}}h1.prototype.is=function(t,e){return e?e===this.name&&(t==="rootElement"||t==="model:rootElement"||t==="element"||t==="model:element"):t==="rootElement"||t==="model:rootElement"||t==="element"||t==="model:element"||t==="node"||t==="model:node"};const K4="$graveyard";class e5e extends Fn(){model;history;selection;roots;differ;isReadOnly;_postFixers;_hasSelectionChangedFromTheLastChangeBlock;constructor(e){super(),this.model=e,this.history=new QLe,this.selection=new cs(this),this.roots=new Er({idProperty:"rootName"}),this.differ=new f1(e.markers),this.isReadOnly=!1,this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",K4),this.listenTo(e,"applyOperation",(n,i)=>{const r=i[0];r.isDocumentOperation&&this.differ.bufferOperation(r)},{priority:"high"}),this.listenTo(e,"applyOperation",(n,i)=>{const r=i[0];r.isDocumentOperation&&this.history.addOperation(r)},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(e.markers,"update",(n,i,r,o,s)=>{const a={...i.getData(),range:o};this.differ.bufferMarkerChange(i.name,s,a),r===null&&i.on("change",(l,u)=>{const c=i.getData();this.differ.bufferMarkerChange(i.name,{...c,range:u},c)})}),this.registerPostFixer(n=>{let i=!1;for(const r of this.roots)!r.isAttached()&&!r.isEmpty&&(n.remove(n.createRangeIn(r)),i=!0);for(const r of this.model.markers)r.getRange().root.isAttached()||(n.removeMarker(r),i=!0);return i})}get version(){return this.history.version}set version(e){this.history.version=e}get graveyard(){return this.getRoot(K4)}createRoot(e="$root",n="main"){if(this.roots.get(n))throw new oe("model-document-createroot-name-exists",this,{name:n});const i=new h1(this,e,n);return this.roots.add(i),i}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(e=!1){return this.getRoots(e).map(n=>n.rootName)}getRoots(e=!1){return this.roots.filter(n=>n!=this.graveyard&&(e||n.isAttached())&&n._isLoaded)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=SIe(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(){const e=this.getRoots();return e.length?e[0]:this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),n=this.model,i=n.schema,r=n.createPositionFromPath(e,[0]);return i.getNearestSelectionRange(r)||n.createRange(r)}_validateSelectionRange(e){return e.start.isValid()&&e.end.isValid()&&G4(e.start)&&G4(e.end)}_callPostFixers(e){let n=!1;do for(const i of this._postFixers)if(this.selection.refresh(),n=i(e),n)break;while(n)}}function G4(t){const e=t.textNode;if(e){const n=e.data,i=t.offset-e.startOffset;return!UM(n,i)&&!WM(n,i)}return!0}class t5e extends Fn(){_markers=new Map;[Symbol.iterator](){return this._markers.values()}has(e){const n=e instanceof Bh?e.name:e;return this._markers.has(n)}get(e){return this._markers.get(e)||null}_set(e,n,i=!1,r=!1){const o=e instanceof Bh?e.name:e;if(o.includes(","))throw new oe("markercollection-incorrect-marker-name",this);const s=this._markers.get(o);if(s){const u=s.getData(),c=s.getRange();let d=!1;return c.isEqual(n)||(s._attachLiveRange(ko.fromRange(n)),d=!0),i!=s.managedUsingOperations&&(s._managedUsingOperations=i,d=!0),typeof r=="boolean"&&r!=s.affectsData&&(s._affectsData=r,d=!0),d&&this.fire(`update:${o}`,s,c,n,u),s}const a=ko.fromRange(n),l=new Bh(o,a,i,r);return this._markers.set(o,l),this.fire(`update:${o}`,l,null,n,{...l.getData(),range:null}),l}_remove(e){const n=e instanceof Bh?e.name:e,i=this._markers.get(n);return i?(this._markers.delete(n),this.fire(`update:${n}`,i,i.getRange(),null,i.getData()),this._destroyMarker(i),!0):!1}_refresh(e){const n=e instanceof Bh?e.name:e,i=this._markers.get(n);if(!i)throw new oe("markercollection-refresh-marker-not-exists",this);const r=i.getRange();this.fire(`update:${n}`,i,r,r,i.getData())}*getMarkersAtPosition(e){for(const n of this)n.getRange().containsPosition(e)&&(yield n)}*getMarkersIntersectingRange(e){for(const n of this)n.getRange().getIntersection(e)!==null&&(yield n)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const n of this._markers.values())n.name.startsWith(e+":")&&(yield n)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}class Bh extends Fn(Kc){name;_managedUsingOperations;_affectsData;_liveRange;constructor(e,n,i,r){super(),this.name=e,this._liveRange=this._attachLiveRange(n),this._managedUsingOperations=i,this._affectsData=r}get managedUsingOperations(){if(!this._liveRange)throw new oe("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new oe("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new oe("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new oe("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new oe("marker-destroyed",this);return this._liveRange.toRange()}toJSON(){return{name:this.name,range:this._liveRange?.toJSON(),usingOperations:this._managedUsingOperations,affectsData:this._affectsData}}_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}}Bh.prototype.is=function(t){return t==="marker"||t==="model:marker"};class n5e extends ds{sourcePosition;howMany;constructor(e,n){super(null),this.sourcePosition=e.clone(),this.howMany=n}get type(){return"detach"}get affectedSelectable(){return null}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new oe("detach-operation-on-document-node",this)}_execute(){zG(Ee._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class za extends Kc{markers=new Map;_children=new iv;constructor(e){super(),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 nextSibling(){return null}get previousSibling(){return null}get root(){return this}get parent(){return null}get document(){return null}isAttached(){return!1}getAncestors(){return[]}getChild(e){return this._children.getNode(e)}getChildAtOffset(e){return this._children.getNodeAtOffset(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 n=this;for(const i of e)n=n.getChildAtOffset(i);return n}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const n of this._children)e.push(n.toJSON());return e}static fromJSON(e){const n=[];for(const i of e)i.name?n.push(zn.fromJSON(i)):n.push(ni.fromJSON(i));return new za(n)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,n){const i=i5e(n);for(const r of i)r.parent!==null&&r._remove(),r.parent=this;this._children._insertNodes(e,i)}_removeChildren(e,n=1){const i=this._children._removeNodes(e,n);for(const r of i)r.parent=null;return i}_removeChildrenArray(e){this._children._removeNodesArray(e);for(const n of e)n.parent=null}}za.prototype.is=function(t){return t==="documentFragment"||t==="model:documentFragment"};function i5e(t){return typeof t=="string"?[new ni(t)]:(us(t)||(t=[t]),Array.from(t).map(e=>typeof e=="string"?new ni(e):e instanceof ea?new ni(e.data,e.getAttributes()):e))}class r5e{model;batch;constructor(e,n){this.model=e,this.batch=n}createText(e,n){return new ni(e,n)}createElement(e,n){return new zn(e,n)}createDocumentFragment(){return new za}cloneElement(e,n=!0){return e._clone(n)}insert(e,n,i=0){if(this._assertWriterUsedCorrectly(),e instanceof ni&&e.data=="")return;const r=Be._createAt(n,i);if(e.parent)if(J4(e.root,r.root)){this.move(Ee._createOn(e),r);return}else{if(e.root.document)throw new oe("model-writer-insert-forbidden-move",this);this.remove(e)}const o=r.root.document?r.root.document.version:null,s=e instanceof za?e._removeChildren(0,e.childCount):e,a=new hr(r,s,o);if(e instanceof ni&&(a.shouldReceiveAttributes=!0),this.batch.addOperation(a),this.model.applyOperation(a),e instanceof za)for(const[l,u]of e.markers){const c=Be._createAt(u.root,0),f={range:new Ee(u.start._getCombined(c,r),u.end._getCombined(c,r)),usingOperation:!0,affectsData:!0};this.model.markers.has(l)?this.updateMarker(l,f):this.addMarker(l,f)}}insertText(e,n,i,r){n instanceof za||n instanceof zn||n instanceof Be?this.insert(this.createText(e),n,i):this.insert(this.createText(e,n),i,r)}insertElement(e,n,i,r){n instanceof za||n instanceof zn||n instanceof Be?this.insert(this.createElement(e),n,i):this.insert(this.createElement(e,n),i,r)}append(e,n){this.insert(e,n,"end")}appendText(e,n,i){n instanceof za||n instanceof zn?this.insert(this.createText(e),n,"end"):this.insert(this.createText(e,n),i,"end")}appendElement(e,n,i){n instanceof za||n instanceof zn?this.insert(this.createElement(e),n,"end"):this.insert(this.createElement(e,n),i,"end")}setAttribute(e,n,i){if(this._assertWriterUsedCorrectly(),i instanceof Ee){const r=i.getMinimalFlatRanges();for(const o of r)Y4(this,e,n,o)}else X4(this,e,n,i)}setAttributes(e,n){for(const[i,r]of gl(e))this.setAttribute(i,r,n)}removeAttribute(e,n){if(this._assertWriterUsedCorrectly(),n instanceof Ee){const i=n.getMinimalFlatRanges();for(const r of i)Y4(this,e,null,r)}else X4(this,e,null,n)}clearAttributes(e){this._assertWriterUsedCorrectly();const n=i=>{for(const r of i.getAttributeKeys())this.removeAttribute(r,i)};if(!(e instanceof Ee))n(e);else for(const i of e.getItems())n(i)}move(e,n,i){if(this._assertWriterUsedCorrectly(),!(e instanceof Ee))throw new oe("writer-move-invalid-range",this);if(!e.isFlat)throw new oe("writer-move-range-not-flat",this);const r=Be._createAt(n,i);if(r.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!J4(e.root,r.root))throw new oe("writer-move-different-document",this);const o=e.root.document?e.root.document.version:null,s=new Tn(e.start,e.end.offset-e.start.offset,r,o);this.batch.addOperation(s),this.model.applyOperation(s)}remove(e){this._assertWriterUsedCorrectly();const i=(e instanceof Ee?e:Ee._createOn(e)).getMinimalFlatRanges().reverse();for(const r of i)this._addOperationForAffectedMarkers("move",r),o5e(r.start,r.end.offset-r.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const n=e.nodeBefore,i=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(n instanceof zn))throw new oe("writer-merge-no-element-before",this);if(!(i instanceof zn))throw new oe("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,n,i){return this.model.createPositionFromPath(e,n,i)}createPositionAt(e,n){return this.model.createPositionAt(e,n)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,n){return this.model.createRange(e,n)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(...e){return this.model.createSelection(...e)}_mergeDetached(e){const n=e.nodeBefore,i=e.nodeAfter;this.move(Ee._createIn(i),Be._createAt(n,"end")),this.remove(i)}_merge(e){const n=Be._createAt(e.nodeBefore,"end"),i=Be._createAt(e.nodeAfter,0),r=e.root.document.graveyard,o=new Be(r,[0]),s=e.root.document.version,a=new Ai(i,e.nodeAfter.maxOffset,n,o,s);this.batch.addOperation(a),this.model.applyOperation(a)}rename(e,n){if(this._assertWriterUsedCorrectly(),!(e instanceof zn))throw new oe("writer-rename-not-element-instance",this);const i=e.root.document?e.root.document.version:null,r=new Po(Be._createBefore(e),e.name,n,i);this.batch.addOperation(r),this.model.applyOperation(r)}split(e,n){this._assertWriterUsedCorrectly();let i=e.parent;if(!i.parent)throw new oe("writer-split-element-no-parent",this);if(n||(n=i.parent),!e.parent.getAncestors({includeSelf:!0}).includes(n))throw new oe("writer-split-invalid-limit-element",this);let r,o;do{const s=i.root.document?i.root.document.version:null,a=i.maxOffset-e.offset,l=Hn.getInsertionPosition(e),u=new Hn(e,a,l,null,s);this.batch.addOperation(u),this.model.applyOperation(u),!r&&!o&&(r=i,o=e.parent.nextSibling),e=this.createPositionAfter(e.parent),i=e.parent}while(i!==n);return{position:e,range:new Ee(Be._createAt(r,"end"),Be._createAt(o,0))}}wrap(e,n){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new oe("writer-wrap-range-not-flat",this);const i=n instanceof zn?n:new zn(n);if(i.childCount>0)throw new oe("writer-wrap-element-not-empty",this);if(i.parent!==null)throw new oe("writer-wrap-element-attached",this);this.insert(i,e.start);const r=new Ee(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(r,Be._createAt(i,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),e.parent===null)throw new oe("writer-unwrap-element-no-parent",this);this.move(Ee._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,n){if(this._assertWriterUsedCorrectly(),!n||typeof n.usingOperation!="boolean")throw new oe("writer-addmarker-no-usingoperation",this);const i=n.usingOperation,r=n.range,o=n.affectsData===void 0?!1:n.affectsData;if(this.model.markers.has(e))throw new oe("writer-addmarker-marker-exists",this);if(!r)throw new oe("writer-addmarker-no-range",this);return i?(Wg(this,e,null,r,o),this.model.markers.get(e)):this.model.markers._set(e,r,i,o)}updateMarker(e,n){this._assertWriterUsedCorrectly();const i=typeof e=="string"?e:e.name,r=this.model.markers.get(i);if(!r)throw new oe("writer-updatemarker-marker-not-exists",this);if(!n){hn("writer-updatemarker-reconvert-using-editingcontroller",{markerName:i}),this.model.markers._refresh(r);return}const o=typeof n.usingOperation=="boolean",s=typeof n.affectsData=="boolean",a=s?n.affectsData:r.affectsData;if(!o&&!n.range&&!s)throw new oe("writer-updatemarker-wrong-options",this);const l=r.getRange(),u=n.range?n.range:l;if(o&&n.usingOperation!==r.managedUsingOperations){n.usingOperation?Wg(this,i,null,u,a):(Wg(this,i,l,null,a),this.model.markers._set(i,u,void 0,a));return}r.managedUsingOperations?Wg(this,i,l,u,a):this.model.markers._set(i,u,void 0,a)}removeMarker(e){this._assertWriterUsedCorrectly();const n=typeof e=="string"?e:e.name;if(!this.model.markers.has(n))throw new oe("writer-removemarker-no-marker",this);const i=this.model.markers.get(n);if(!i.managedUsingOperations){this.model.markers._remove(n);return}const r=i.getRange();Wg(this,n,r,null,i.affectsData)}addRoot(e,n="$root"){this._assertWriterUsedCorrectly();const i=this.model.document.getRoot(e);if(i&&i.isAttached())throw new oe("writer-addroot-root-exists",this);const r=this.model.document,o=new Qa(e,n,!0,r,r.version);return this.batch.addOperation(o),this.model.applyOperation(o),this.model.document.getRoot(e)}detachRoot(e){this._assertWriterUsedCorrectly();const n=typeof e=="string"?this.model.document.getRoot(e):e;if(!n||!n.isAttached())throw new oe("writer-detachroot-no-root",this);for(const o of this.model.markers)o.getRange().root===n&&this.removeMarker(o);for(const o of n.getAttributeKeys())this.removeAttribute(o,n);this.remove(this.createRangeIn(n));const i=this.model.document,r=new Qa(n.rootName,n.name,!1,i,i.version);this.batch.addOperation(r),this.model.applyOperation(r)}setSelection(...e){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(...e)}setSelectionFocus(e,n){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,n)}setSelectionAttribute(e,n){if(this._assertWriterUsedCorrectly(),typeof e=="string")this._setSelectionAttribute(e,n);else for(const[i,r]of gl(e))this._setSelectionAttribute(i,r)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),typeof e=="string")this._removeSelectionAttribute(e);else for(const n of e)this._removeSelectionAttribute(n)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,n){const i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const r=cs._getStoreAttributeKey(e);this.setAttribute(r,n,i.anchor.parent)}i._setAttribute(e,n)}_removeSelectionAttribute(e){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const i=cs._getStoreAttributeKey(e);this.removeAttribute(i,n.anchor.parent)}n._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new oe("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,n){for(const i of this.model.markers){if(!i.managedUsingOperations)continue;const r=i.getRange();let o=!1;if(e==="move"){const s=n;o=s.containsPosition(r.start)||s.start.isEqual(r.start)||s.containsPosition(r.end)||s.end.isEqual(r.end)}else{const s=n,a=s.nodeBefore,l=s.nodeAfter,u=r.start.parent==a&&r.start.isAtEnd,c=r.end.parent==l&&r.end.offset==0,d=r.end.nodeAfter==l,f=r.start.nodeAfter==l;o=u||c||d||f}o&&this.updateMarker(i.name,{range:r})}}}function Y4(t,e,n,i){const r=t.model,o=r.document;let s=i.start,a,l,u;for(const d of i.getWalker({shallow:!0}))u=d.item.getAttribute(e),a&&l!=u&&(l!=n&&c(),s=a),a=d.nextPosition,l=u;a instanceof Be&&a!=s&&l!=n&&c();function c(){const d=new Ee(s,a),f=d.root.document?o.version:null,h=new zi(d,e,l,n,f);t.batch.addOperation(h),r.applyOperation(h)}}function X4(t,e,n,i){const r=t.model,o=r.document,s=i.getAttribute(e);let a,l;if(s!=n){if(i.root===i){const c=i.document?o.version:null;l=new au(i,e,s,n,c)}else{a=new Ee(Be._createBefore(i),t.createPositionAfter(i));const c=a.root.document?o.version:null;l=new zi(a,e,s,n,c)}t.batch.addOperation(l),r.applyOperation(l)}}function Wg(t,e,n,i,r){const o=t.model,s=o.document,a=new no(e,n,i,o.markers,!!r,s.version);t.batch.addOperation(a),o.applyOperation(a)}function o5e(t,e,n,i){let r;if(t.root.document){const o=i.document,s=new Be(o.graveyard,[0]);r=new Tn(t,e,s,o.version)}else r=new n5e(t,e);n.addOperation(r),i.applyOperation(r)}function J4(t,e){return t===e||t instanceof h1&&e instanceof h1}function s5e(t){t.document.registerPostFixer(e=>a5e(e,t))}function a5e(t,e){const n=e.document.selection,i=e.schema,r=[];let o=!1;for(const s of n.getRanges()){const a=eO(s,i);a&&!a.isEqual(s)?(r.push(a),o=!0):r.push(s)}return o&&t.setSelection(d5e(r),{backward:n.isBackward}),!1}function eO(t,e){return t.isCollapsed?l5e(t,e):u5e(t,e)}function l5e(t,e){const n=t.start,i=e.getNearestSelectionRange(n);if(!i){const o=n.getAncestors().reverse().find(s=>e.isObject(s));return o?Ee._createOn(o):null}if(!i.isCollapsed)return i;const r=i.start;return n.isEqual(r)?null:new Ee(r)}function u5e(t,e){const{start:n,end:i}=t,r=e.checkChild(n,"$text"),o=e.checkChild(i,"$text"),s=e.getLimitElement(n),a=e.getLimitElement(i);if(s===a){if(r&&o)return null;if(c5e(n,i,e)){const d=n.nodeAfter&&e.isSelectable(n.nodeAfter)?null:e.getNearestSelectionRange(n,"forward"),h=i.nodeBefore&&e.isSelectable(i.nodeBefore)?null:e.getNearestSelectionRange(i,"backward"),m=d?d.start:n,g=h?h.end:i;return new Ee(m,g)}}const l=s&&!s.is("rootElement"),u=a&&!a.is("rootElement");if(l||u){const c=n.nodeAfter&&i.nodeBefore&&n.nodeAfter.parent===i.nodeBefore.parent,d=l&&(!c||!Q4(n.nodeAfter,e)),f=u&&(!c||!Q4(i.nodeBefore,e));let h=n,m=i;return d&&(h=Be._createBefore(Z4(s,e))),f&&(m=Be._createAfter(Z4(a,e))),new Ee(h,m)}return null}function Z4(t,e){let n=t,i=n;for(;e.isLimit(i)&&i.parent;)n=i,i=i.parent;return n}function c5e(t,e,n){const i=t.nodeAfter&&!n.isLimit(t.nodeAfter)||n.checkChild(t,"$text"),r=e.nodeBefore&&!n.isLimit(e.nodeBefore)||n.checkChild(e,"$text");return i||r}function d5e(t){const e=[...t],n=new Set;let i=1;for(;i!n.has(s))}function Q4(t,e){return t&&e.isSelectable(t)}function f5e(t,e,n={}){if(e.isCollapsed)return;const i=e.getFirstRange();if(i.root.rootName=="$graveyard")return;const r=t.schema;t.change(o=>{if(!n.doNotResetEntireContent&&_5e(r,e)){w5e(o,e);return}const s={};if(!n.doNotAutoparagraph){const u=e.getSelectedElement();u&&Object.assign(s,r.getAttributesWithProperty(u,"copyOnReplace",!0))}let a,l;n.doNotFixSelection?(a=Bi.fromPosition(i.start,"toPrevious"),l=Bi.fromPosition(i.end,"toNext")):[a,l]=h5e(i),a.isTouching(l)||o.remove(o.createRange(a,l)),n.leaveUnmerged||(g5e(o,a,l),r.removeDisallowedAttributes(a.parent.getChildren(),o)),GG(o,e,a),!n.doNotAutoparagraph&&b5e(r,a)&&KG(o,a,e,s),a.detach(),l.detach()})}function h5e(t){const e=t.root.document.model,n=t.start;let i=t.end;if(e.hasContent(t,{ignoreMarkers:!0})){const r=m5e(i);if(r&&i.isTouching(e.createPositionAt(r,0))){const o=e.createSelection(t);e.modifySelection(o,{direction:"backward"});const s=o.getLastPosition(),a=e.createRange(s,i);e.hasContent(a,{ignoreMarkers:!0})||(i=s)}}return[Bi.fromPosition(n,"toPrevious"),Bi.fromPosition(i,"toNext")]}function m5e(t){const e=t.parent,n=e.root.document.model.schema,i=e.getAncestors({parentFirst:!0,includeSelf:!0});for(const r of i){if(n.isLimit(r))return null;if(n.isBlock(r))return r}}function g5e(t,e,n){const i=t.model;if(!tO(t.model.schema,e,n))return;const[r,o]=v5e(e,n);!r||!o||(!i.hasContent(r,{ignoreMarkers:!0})&&i.hasContent(o,{ignoreMarkers:!0})?jG(t,e,n,r.parent):qG(t,e,n,r.parent))}function qG(t,e,n,i){const r=e.parent,o=n.parent;if(!(r==i||o==i)){for(e=t.createPositionAfter(r),n=t.createPositionBefore(o),n.isEqual(e)||t.insert(o,e),t.merge(e);n.parent.isEmpty;){const s=n.parent;n=t.createPositionBefore(s),t.remove(s)}tO(t.model.schema,e,n)&&qG(t,e,n,i)}}function jG(t,e,n,i){const r=e.parent,o=n.parent;if(!(r==i||o==i)){for(e=t.createPositionAfter(r),n=t.createPositionBefore(o),n.isEqual(e)||t.insert(r,n);e.parent.isEmpty;){const s=e.parent;e=t.createPositionBefore(s),t.remove(s)}n=t.createPositionBefore(o),p5e(t,n),tO(t.model.schema,e,n)&&jG(t,e,n,i)}}function p5e(t,e){const n=e.nodeBefore,i=e.nodeAfter;n.name!=i.name&&t.rename(n,i.name),t.clearAttributes(n),t.setAttributes(Object.fromEntries(i.getAttributes()),n),t.merge(e)}function tO(t,e,n){const i=e.parent,r=n.parent;return i==r||t.isLimit(i)||t.isLimit(r)?!1:y5e(e,n,t)}function v5e(t,e){const n=t.getAncestors(),i=e.getAncestors();let r=0;for(;n[r]&&n[r]==i[r];)r++;return[n[r],i[r]]}function b5e(t,e){const n=t.checkChild(e,"$text"),i=t.checkChild(e,"paragraph");return!n&&i}function y5e(t,e,n){const i=new Ee(t,e);for(const r of i.getWalker())if(n.isLimit(r.item))return!1;return!0}function KG(t,e,n,i={}){const r=t.createElement("paragraph");t.model.schema.setAllowedAttributes(r,i,t),t.insert(r,e),GG(t,n,t.createPositionAt(r,0))}function w5e(t,e){const n=t.model.schema.getLimitElement(e);t.remove(t.createRangeIn(n)),KG(t,t.createPositionAt(n,0),e)}function _5e(t,e){const n=t.getLimitElement(e);if(!e.containsEntireContent(n))return!1;const i=e.getFirstRange();return i.start.parent==i.end.parent?!1:t.checkChild(n,"paragraph")}function GG(t,e,n){e instanceof cs?t.setSelection(n):e.setTo(n)}function C5e(t,e){return t.change(n=>{const i=n.createDocumentFragment(),r=e.getFirstRange();if(!r||r.isCollapsed)return i;const o=r.start.root,s=r.start.getCommonPath(r.end),a=o.getNodeByPath(s);let l;r.start.parent==r.end.parent?l=r:l=n.createRange(n.createPositionAt(a,r.start.path[s.length]),n.createPositionAt(a,r.end.path[s.length]+1));const u=l.end.offset-l.start.offset;for(const c of l.getItems({shallow:!0}))c.is("$textProxy")?n.appendText(c.data,c.getAttributes(),i):n.append(n.cloneElement(c,!0),i);if(l!=r){const c=r._getTransformedByMove(l.start,n.createPositionAt(i,0),u)[0],d=n.createRange(n.createPositionAt(i,0),c.start),f=n.createRange(c.end,n.createPositionAt(i,"end"));eV(f,n),eV(d,n)}return i})}function eV(t,e){const n=[];Array.from(t.getItems({direction:"backward"})).map(i=>e.createRangeOn(i)).filter(i=>(i.start.isAfter(t.start)||i.start.isEqual(t.start))&&(i.end.isBefore(t.end)||i.end.isEqual(t.end))).forEach(i=>{n.push(i.start.parent),e.remove(i)}),n.forEach(i=>{let r=i;for(;r.parent&&r.isEmpty;){const o=e.createRangeOn(r);r=r.parent,e.remove(o)}})}function S5e(t,e,n){return t.change(i=>{const r=n||t.document.selection;r.isCollapsed||t.deleteContent(r,{doNotAutoparagraph:!0});const o=new k5e(t,i,r.anchor),s=[];let a;if(e.is("documentFragment")){if(e.markers.size){const c=[];for(const[d,f]of e.markers){const{start:h,end:m}=f,g=h.isEqual(m);c.push({position:h,name:d,isCollapsed:g},{position:m,name:d,isCollapsed:g})}c.sort(({position:d},{position:f})=>d.isBefore(f)?1:-1);for(const{position:d,name:f,isCollapsed:h}of c){let m=null,g=null;const v=d.parent===e&&d.isAtStart,p=d.parent===e&&d.isAtEnd;!v&&!p?(m=i.createElement("$marker"),i.insert(m,d)):h&&(g=v?"start":"end"),s.push({name:f,element:m,collapsed:g})}}a=e.getChildren()}else a=[e];o.handleNodes(a);let l=o.getSelectionRange();if(e.is("documentFragment")&&s.length){const c=l?ko.fromRange(l):null,d={};for(let f=s.length-1;f>=0;f--){const{name:h,element:m,collapsed:g}=s[f],v=!d[h];if(v&&(d[h]=[]),m){const p=i.createPositionAt(m,"before");d[h].push(p),i.remove(m)}else{const p=o.getAffectedRange();if(!p){g&&d[h].push(o.position);continue}g?d[h].push(p[g]):d[h].push(v?p.start:p.end)}}for(const[f,[h,m]]of Object.entries(d))h&&m&&h.root===m.root&&h.root.document&&!i.model.markers.has(f)&&i.addMarker(f,{usingOperation:!0,affectsData:!0,range:new Ee(h,m)});c&&(l=c.toRange(),c.detach())}l&&(r instanceof cs?i.setSelection(l):r.setTo(l));const u=o.getAffectedRange()||t.createRange(r.anchor);return o.destroy(),u})}class k5e{model;writer;position;canMergeWith;schema;_documentFragment;_documentFragmentPosition;_firstNode=null;_lastNode=null;_lastAutoParagraph=null;_filterAttributesAndChildrenOf=[];_affectedStart=null;_affectedEnd=null;_nodeToSelect=null;constructor(e,n,i){this.model=e,this.writer=n,this.position=i,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._documentFragment=n.createDocumentFragment(),this._documentFragmentPosition=n.createPositionAt(this._documentFragment,0)}handleNodes(e){for(const n of Array.from(e))n.offsetSize>0&&this._handleNode(n);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesAndChildrenOf,this.writer),this.model._config?.get("experimentalFlags.modelInsertContentDeepSchemaVerification")&&this._removeDisallowedChildren(this._filterAttributesAndChildrenOf),this._filterAttributesAndChildrenOf=[]}_removeDisallowedChildren(e){const n=Array.from(e);for(const i of n){if(!i.is("element"))continue;const r=[],o=[],s=this.writer.createRangeIn(i).getWalker({ignoreElementEnd:!0});for(const{item:a}of s){const l=a.parent;this.schema.checkChild(l,a)||(a.is("element")&&!this.schema.isObject(a)?(o.push(a),n.push(l)):r.push(a),s.jumpTo(this.writer.createPositionAfter(a)))}for(const a of o)this.writer.unwrap(a);for(const a of r)this.writer.remove(a)}}_updateLastNodeFromAutoParagraph(e){const n=this.writer.createPositionAfter(this._lastNode),i=this.writer.createPositionAfter(e);if(i.isAfter(n)){this._lastNode=e;if(this.position.parent!=e||!this.position.isAtEnd)throw new oe("insertcontent-invalid-insertion-position",this);this.position=i,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this._nodeToSelect?Ee._createOn(this._nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new Ee(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){if(!this._checkAndSplitToAllowedPosition(e)){this.schema.isObject(e)||this._handleDisallowedNode(e);return}e=this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const e=Bi.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()}_handleDisallowedNode(e){e.is("element")&&this.handleNodes(e.getChildren())}_appendToFragment(e){if(!this.schema.checkChild(this.position,e))throw new oe("insertcontent-wrong-position",this,{node:e,position:this.position});return this.writer.insert(e,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(e.offsetSize),e.parent||(e=this._documentFragmentPosition.nodeBefore),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this._nodeToSelect=e:this._nodeToSelect=null,this._filterAttributesAndChildrenOf.push(e),e}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=Bi.fromPosition(e,"toPrevious")),(!this._affectedEnd||this._affectedEnd.isBefore(e))&&(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=Bi.fromPosition(e,"toNext"))}_mergeOnLeft(){const e=this._firstNode;if(!(e instanceof zn)||!this._canMergeLeft(e))return;const n=Bi._createBefore(e);n.stickiness="toNext";const i=Bi.fromPosition(this.position,"toNext");this._affectedStart.isEqual(n)&&(this._affectedStart.detach(),this._affectedStart=Bi._createAt(n.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=n.nodeBefore,this._lastNode=n.nodeBefore),this.writer.merge(n),n.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=Bi._createAt(n.nodeBefore,"end","toNext")),this.position=i.toPosition(),i.detach(),this._filterAttributesAndChildrenOf.push(this.position.parent),n.detach()}_mergeOnRight(){const e=this._lastNode;if(!(e instanceof zn)||!this._canMergeRight(e))return;const n=Bi._createAfter(e);n.stickiness="toNext";if(!this.position.isEqual(n))throw new oe("insertcontent-invalid-insertion-position",this);this.position=Be._createAt(n.nodeBefore,"end");const i=Bi.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(n)&&(this._affectedEnd.detach(),this._affectedEnd=Bi._createAt(n.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=n.nodeBefore,this._lastNode=n.nodeBefore),this.writer.merge(n),n.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=Bi._createAt(n.nodeBefore,0,"toPrevious")),this.position=i.toPosition(),i.detach(),this._filterAttributesAndChildrenOf.push(this.position.parent),n.detach()}_canMergeLeft(e){const n=e.previousSibling;return n instanceof zn&&this.canMergeWith.has(n)&&this.model.schema.checkMerge(n,e)}_canMergeRight(e){const n=e.nextSibling;return n instanceof zn&&this.canMergeWith.has(n)&&this.model.schema.checkMerge(e,n)}_insertAutoParagraph(){this._insertPartialFragment();const e=this.writer.createElement("paragraph");this.writer.insert(e,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=e,this.position=this.writer.createPositionAt(e,0)}_checkAndSplitToAllowedPosition(e){const n=this._getAllowedIn(this.position.parent,e);if(!n)return!1;for(n!=this.position.parent&&this._insertPartialFragment();n!=this.position.parent;)if(this.position.isAtStart){const i=this.position.parent;this.position=this.writer.createPositionBefore(i),i.isEmpty&&i.parent===n&&this.writer.remove(i)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const i=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=i,this.canMergeWith.add(this.position.nodeAfter)}return this.schema.checkChild(this.position.parent,e)||this._insertAutoParagraph(),!0}_getAllowedIn(e,n){const i=this.schema.createContext(e);return this.schema.checkChild(i,n)||this.schema.checkChild(i,"paragraph")&&this.schema.checkChild(i.push("paragraph"),n)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,n)}}function T5e(t,e,n,i={}){if(!t.schema.isObject(e))throw new oe("insertobject-element-not-an-object",t,{object:e});const r=n||t.document.selection;let o=r;i.findOptimalPosition&&t.schema.isBlock(e)&&(o=t.createSelection(t.schema.findOptimalInsertionRange(r,i.findOptimalPosition)));const s=Mi(r.getSelectedBlocks()),a={};return s&&Object.assign(a,t.schema.getAttributesWithProperty(s,"copyOnReplace",!0)),t.change(l=>{o.isCollapsed||t.deleteContent(o,{doNotAutoparagraph:!0});let u=e;const c=o.anchor.parent,d=t.schema.createContext(c);!t.schema.checkChild(d,e)&&t.schema.checkChild(d,"paragraph")&&t.schema.checkChild(d.push("paragraph"),e)&&(u=l.createElement("paragraph"),l.insert(e,u)),t.schema.setAllowedAttributes(u,a,l);const f=t.insertContent(u,o);return f.isCollapsed||i.setSelection&&E5e(l,e,i.setSelection,a),f})}function E5e(t,e,n,i){const r=t.model;if(n=="on"){t.setSelection(e,"on");return}if(n!="after")throw new oe("insertobject-invalid-place-parameter-value",r);let o=e.nextSibling;if(r.schema.isInline(e)){t.setSelection(e,"after");return}!(o&&r.schema.checkChild(o,"$text"))&&r.schema.checkChild(e.parent,"paragraph")&&(o=t.createElement("paragraph"),r.schema.setAllowedAttributes(o,i,t),r.insertContent(o,t.createPositionAfter(e))),o&&t.setSelection(o,0)}const x5e=' ,.?!:;"-()';function A5e(t,e,n={}){const i=t.schema,r=n.direction!="backward",o=n.unit?n.unit:"character",s=!!n.treatEmojiAsSingleUnit,a=e.focus,l=new Ql({boundaries:M5e(a,r),singleCharacters:!0,direction:r?"forward":"backward"}),u={walker:l,schema:i,isForward:r,unit:o,treatEmojiAsSingleUnit:s};let c;for(;c=l.next();){if(c.done)return;const d=P5e(u,c.value);if(d){e instanceof cs?t.change(f=>{f.setSelectionFocus(d)}):e.setFocus(d);return}}}function P5e(t,e){const{isForward:n,walker:i,unit:r,schema:o,treatEmojiAsSingleUnit:s}=t,{type:a,item:l,nextPosition:u}=e;if(a=="text")return t.unit==="word"?R5e(i,n):I5e(i,r,s);if(a==(n?"elementStart":"elementEnd")){if(o.isSelectable(l))return Be._createAt(l,n?"after":"before");if(o.checkChild(u,"$text"))return u}else{if(o.isLimit(l)){i.skip(()=>!0);return}if(o.checkChild(u,"$text"))return u}}function I5e(t,e,n){const i=t.position.textNode;if(i){const r=i.data;let o=t.position.offset-i.startOffset;for(;UM(r,o)||e=="character"&&WM(r,o)||n&&aG(r,o);)t.next(),o=t.position.offset-i.startOffset}return t.position}function R5e(t,e){let n=t.position.textNode;for(n||(n=e?t.position.nodeAfter:t.position.nodeBefore);n&&n.is("$text");){const i=t.position.offset-n.startOffset;if(L5e(n,i,e))n=e?t.position.nodeAfter:t.position.nodeBefore;else{if(O5e(n.data,i,e))break;t.next()}}return t.position}function M5e(t,e){const n=t.root,i=Be._createAt(n,e?"end":0);return e?new Ee(t,i):new Ee(i,t)}function O5e(t,e,n){const i=e+(n?0:-1);return x5e.includes(t.charAt(i))}function L5e(t,e,n){return e===(n?t.offsetSize:0)}let D5e=class extends Ln(){markers;document;schema;_config;_pendingChanges;_currentWriter;constructor(e){super(),this.markers=new t5e,this.document=new e5e(this),this.schema=new vLe,this._config=e,this._pendingChanges=[],this._currentWriter=null,["deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(n=>this.decorate(n)),this.on("applyOperation",(n,i)=>{i[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!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(()=>!0,"$marker"),s5e(this),this.document.registerPostFixer(DG),this.on("insertContent",(n,[i,r])=>{n.return=S5e(this,i,r)}),this.on("insertObject",(n,[i,r,o])=>{n.return=T5e(this,i,r,o)}),this.on("canEditAt",n=>{const i=!this.document.isReadOnly;n.return=i,i||n.stop()})}change(e){try{return this._pendingChanges.length===0?(this._pendingChanges.push({batch:new lh,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(n){oe.rethrowUnexpectedError(n,this)}}enqueueChange(e,n){try{e?typeof e=="function"?(n=e,e=new lh):e instanceof lh||(e=new lh(e)):e=new lh,this._pendingChanges.push({batch:e,callback:n}),this._pendingChanges.length==1&&this._runPendingChanges()}catch(i){oe.rethrowUnexpectedError(i,this)}}applyOperation(e){e._execute()}insertContent(e,n,i,...r){const o=BT(n,i);return this.fire("insertContent",[e,o,i,...r])}insertObject(e,n,i,r,...o){const s=BT(n,i);return this.fire("insertObject",[e,s,r,r,...o])}deleteContent(e,n){f5e(this,e,n)}modifySelection(e,n){A5e(this,e,n)}getSelectedContent(e){return C5e(this,e)}hasContent(e,n={}){const i=e instanceof Ee?e:Ee._createIn(e);if(i.isCollapsed)return!1;const{ignoreWhitespaces:r=!1,ignoreMarkers:o=!1}=n;if(!o){for(const s of this.markers.getMarkersIntersectingRange(i))if(s.affectsData)return!0}for(const s of i.getItems())if(this.schema.isContent(s))if(s.is("$textProxy"))if(r){if(s.data.search(/\S/)!==-1)return!0}else return!0;else return!0;return!1}canEditAt(e){const n=BT(e);return this.fire("canEditAt",[n])}createPositionFromPath(e,n,i){return new Be(e,n,i)}createPositionAt(e,n){return Be._createAt(e,n)}createPositionAfter(e){return Be._createAfter(e)}createPositionBefore(e){return Be._createBefore(e)}createRange(e,n){return new Ee(e,n)}createRangeIn(e){return Ee._createIn(e)}createRangeOn(e){return Ee._createOn(e)}createSelection(...e){return new Xo(...e)}createBatch(e){return new lh(e)}createOperationFromJSON(e){return ULe.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];this.fire("_beforeChanges");try{for(;this._pendingChanges.length;){const n=this._pendingChanges[0].batch;this._currentWriter=new r5e(this,n);const i=this._pendingChanges[0].callback(this._currentWriter);e.push(i),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}}finally{this._pendingChanges.length=0,this._currentWriter=null,this.fire("_afterChanges")}return e}};function BT(t,e){if(t)return t instanceof Xo||t instanceof cs?t:t instanceof Uf?e||e===0?new Xo(t,e):t.is("rootElement")?new Xo(t,"in"):new Xo(t,"on"):new Xo(t)}class N5e extends Cl{domEventType="click";onDomEvent(e){this.fire(e.type,e)}}class nO extends Cl{domEventType=["mousedown","mouseup","mouseover","mouseout"];onDomEvent(e){this.fire(e.type,e)}}class B5e extends Cl{domEventType=["touchstart","touchend","touchmove"];onDomEvent(e){this.fire(e.type,e)}}class YG extends Cl{domEventType=["pointerdown","pointerup","pointermove"];onDomEvent(e){this.fire(e.type,e)}}class Pu{document;constructor(e){this.document=e}createDocumentFragment(e){return new af(this.document,e)}createElement(e,n,i){return new ga(this.document,e,n,i)}createText(e){return new Ji(this.document,e)}clone(e,n=!1){return e._clone(n)}appendChild(e,n){return n._appendChild(e)}insertChild(e,n,i){return i._insertChild(e,n)}removeChildren(e,n,i){return i._removeChildren(e,n)}remove(e){const n=e.parent;return n?this.removeChildren(n.getChildIndex(e),1,n):[]}replace(e,n){const i=e.parent;if(i){const r=i.getChildIndex(e);return this.removeChildren(r,1,i),this.insertChild(r,n,i),!0}return!1}unwrapElement(e){const n=e.parent;if(n){const i=n.getChildIndex(e);this.remove(e),this.insertChild(i,e.getChildren(),n)}}rename(e,n){const i=new ga(this.document,e,n.getAttributes(),n.getChildren());return this.replace(n,i)?i:null}setAttribute(e,n,i){i._setAttribute(e,n)}removeAttribute(e,n){n._removeAttribute(e)}addClass(e,n){n._addClass(e)}removeClass(e,n){n._removeClass(e)}setStyle(e,n,i){Wa(e)&&i===void 0?n._setStyle(e):i._setStyle(e,n)}removeStyle(e,n){n._removeStyle(e)}setCustomProperty(e,n,i){i._setCustomProperty(e,n)}removeCustomProperty(e,n){return n._removeCustomProperty(e)}createPositionAt(e,n){return Ge._createAt(e,n)}createPositionAfter(e){return Ge._createAfter(e)}createPositionBefore(e){return Ge._createBefore(e)}createRange(e,n){return new Nt(e,n)}createRangeOn(e){return Nt._createOn(e)}createRangeIn(e){return Nt._createIn(e)}createSelection(...e){return new aa(...e)}}const V5e=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,F5e=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i,$5e=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,z5e=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i,H5e=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,U5e=/\w+\((?:[^()]|\([^()]*\))*\)|\S+/gi,W5e=new Set(["black","silver","gray","white","maroon","red","purple","fuchsia","green","lime","olive","yellow","navy","blue","teal","aqua","orange","aliceblue","antiquewhite","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","gainsboro","ghostwhite","gold","goldenrod","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","limegreen","linen","magenta","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","oldlace","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen","activeborder","activecaption","appworkspace","background","buttonface","buttonhighlight","buttonshadow","buttontext","captiontext","graytext","highlight","highlighttext","inactiveborder","inactivecaption","inactivecaptiontext","infobackground","infotext","menu","menutext","scrollbar","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","window","windowframe","windowtext","rebeccapurple","currentcolor","transparent"]);function XG(t){return t.startsWith("#")?V5e.test(t):t.startsWith("rgb")?F5e.test(t)||$5e.test(t):t.startsWith("hsl")?z5e.test(t)||H5e.test(t):W5e.has(t.toLowerCase())}const q5e=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset"];function j5e(t){return q5e.includes(t)}const K5e=/^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;function vS(t){return K5e.test(t)}const G5e=/^[+-]?[0-9]*([.][0-9]+)?%$/;function JG(t){return G5e.test(t)}const Y5e=["repeat-x","repeat-y","repeat","space","round","no-repeat"];function X5e(t){return Y5e.includes(t)}const J5e=["center","top","bottom","left","right"];function Z5e(t){return J5e.includes(t)}const Q5e=["fixed","scroll","local"];function eDe(t){return Q5e.includes(t)}const tDe=/^url\(/;function nDe(t){return tDe.test(t)}function rv(t=""){if(t==="")return{top:void 0,right:void 0,bottom:void 0,left:void 0};const e=iO(t),n=e[0],i=e[2]||n,r=e[1]||n,o=e[3]||r;return{top:n,bottom:i,right:r,left:o}}function ov(t){return e=>{const{top:n,right:i,bottom:r,left:o}=e,s=[];return[n,i,o,r].every(a=>!!a)?s.push([t,iDe(e)]):(n&&s.push([t+"-top",n]),i&&s.push([t+"-right",i]),r&&s.push([t+"-bottom",r]),o&&s.push([t+"-left",o])),s}}function iDe({top:t,right:e,bottom:n,left:i}){const r=[];return i!==e?r.push(t,e,n,i):n!==t?r.push(t,e,n):e!==t?r.push(t,e):r.push(t),r.join(" ")}function ZG(t){return e=>({path:t,value:rv(e)})}function iO(t){const e=t.trim().slice(0,1500).matchAll(U5e);return Array.from(e).map(n=>n[0])}function QG(t){t.setNormalizer("background",rDe()),t.setNormalizer("background-color",oDe()),t.setReducer("background",sDe()),t.setStyleRelation("background",["background-color"])}function rDe(){return t=>{const e={},n=iO(t);for(const i of n)X5e(i)?(e.repeat=e.repeat||[],e.repeat.push(i)):Z5e(i)?(e.position=e.position||[],e.position.push(i)):eDe(i)?e.attachment=i:XG(i)?e.color=i:nDe(i)&&(e.image=i);return{path:"background",value:e}}}function oDe(){return t=>({path:"background.color",value:t})}function sDe(){return t=>{const e=[];return e.push(["background-color",t.color]),e}}function aDe(t){t.setNormalizer("border",lDe()),t.setNormalizer("border-top",sy("top")),t.setNormalizer("border-right",sy("right")),t.setNormalizer("border-bottom",sy("bottom")),t.setNormalizer("border-left",sy("left")),t.setNormalizer("border-color",VT("color")),t.setNormalizer("border-width",VT("width")),t.setNormalizer("border-style",VT("style")),t.setNormalizer("border-top-color",vs("color","top")),t.setNormalizer("border-top-style",vs("style","top")),t.setNormalizer("border-top-width",vs("width","top")),t.setNormalizer("border-right-color",vs("color","right")),t.setNormalizer("border-right-style",vs("style","right")),t.setNormalizer("border-right-width",vs("width","right")),t.setNormalizer("border-bottom-color",vs("color","bottom")),t.setNormalizer("border-bottom-style",vs("style","bottom")),t.setNormalizer("border-bottom-width",vs("width","bottom")),t.setNormalizer("border-left-color",vs("color","left")),t.setNormalizer("border-left-style",vs("style","left")),t.setNormalizer("border-left-width",vs("width","left")),t.setExtractor("border-top",ay("top")),t.setExtractor("border-right",ay("right")),t.setExtractor("border-bottom",ay("bottom")),t.setExtractor("border-left",ay("left")),t.setExtractor("border-top-color","border.color.top"),t.setExtractor("border-right-color","border.color.right"),t.setExtractor("border-bottom-color","border.color.bottom"),t.setExtractor("border-left-color","border.color.left"),t.setExtractor("border-top-width","border.width.top"),t.setExtractor("border-right-width","border.width.right"),t.setExtractor("border-bottom-width","border.width.bottom"),t.setExtractor("border-left-width","border.width.left"),t.setExtractor("border-top-style","border.style.top"),t.setExtractor("border-right-style","border.style.right"),t.setExtractor("border-bottom-style","border.style.bottom"),t.setExtractor("border-left-style","border.style.left"),t.setReducer("border-color",ov("border-color")),t.setReducer("border-style",ov("border-style")),t.setReducer("border-width",ov("border-width")),t.setReducer("border-top",ly("top")),t.setReducer("border-right",ly("right")),t.setReducer("border-bottom",ly("bottom")),t.setReducer("border-left",ly("left")),t.setReducer("border",cDe()),t.setStyleRelation("border",["border-color","border-style","border-width","border-top","border-right","border-bottom","border-left","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-width","border-right-width","border-bottom-width","border-left-width"]),t.setStyleRelation("border-color",["border-top-color","border-right-color","border-bottom-color","border-left-color"]),t.setStyleRelation("border-style",["border-top-style","border-right-style","border-bottom-style","border-left-style"]),t.setStyleRelation("border-width",["border-top-width","border-right-width","border-bottom-width","border-left-width"]),t.setStyleRelation("border-top",["border-top-color","border-top-style","border-top-width"]),t.setStyleRelation("border-right",["border-right-color","border-right-style","border-right-width"]),t.setStyleRelation("border-bottom",["border-bottom-color","border-bottom-style","border-bottom-width"]),t.setStyleRelation("border-left",["border-left-color","border-left-style","border-left-width"])}function lDe(){return t=>{const{color:e,style:n,width:i}=eY(t);return{path:"border",value:{color:rv(e),style:rv(n),width:rv(i)}}}}function sy(t){return e=>{const{color:n,style:i,width:r}=eY(e),o={};return n!==void 0&&(o.color={[t]:n}),i!==void 0&&(o.style={[t]:i}),r!==void 0&&(o.width={[t]:r}),{path:"border",value:o}}}function VT(t){return e=>({path:"border",value:uDe(e,t)})}function uDe(t,e){return{[e]:rv(t)}}function vs(t,e){return n=>({path:"border",value:{[t]:{[e]:n}}})}function ay(t){return(e,n)=>{if(n.border)return _p(n.border,t)}}function _p(t,e){const n={};return t.width&&t.width[e]&&(n.width=t.width[e]),t.style&&t.style[e]&&(n.style=t.style[e]),t.color&&t.color[e]&&(n.color=t.color[e]),n}function eY(t){const e={},n=iO(t);for(const i of n)vS(i)||/thin|medium|thick/.test(i)?e.width=i:j5e(i)?e.style=i:e.color=i;return e}function cDe(){return e=>{const n=_p(e,"top"),i=_p(e,"right"),r=_p(e,"bottom"),o=_p(e,"left"),s=[n,i,r,o],a={width:t(s,"width"),style:t(s,"style"),color:t(s,"color")},l=Vh(a,"all");return l.length?l:[...Object.entries(a).reduce((c,[d,f])=>(f&&(c.push([`border-${d}`,f]),s.forEach(h=>delete h[d])),c),[]),...Vh(n,"top"),...Vh(i,"right"),...Vh(r,"bottom"),...Vh(o,"left")]};function t(e,n){return e.map(i=>i[n]).reduce((i,r)=>i==r?i:null)}}function ly(t){return e=>Vh(e,t)}function Vh(t,e){const n=[];if(t&&t.width&&n.push("width"),t&&t.style&&n.push("style"),t&&t.color&&n.push("color"),n.length==3){const i=n.map(r=>t[r]).join(" ");return[e=="all"?["border",i]:[`border-${e}`,i]]}return e=="all"?[]:n.map(i=>[`border-${e}-${i}`,t[i]])}function dDe(t){t.setNormalizer("margin",ZG("margin")),t.setNormalizer("margin-top",e=>({path:"margin.top",value:e})),t.setNormalizer("margin-right",e=>({path:"margin.right",value:e})),t.setNormalizer("margin-bottom",e=>({path:"margin.bottom",value:e})),t.setNormalizer("margin-left",e=>({path:"margin.left",value:e})),t.setReducer("margin",ov("margin")),t.setStyleRelation("margin",["margin-top","margin-right","margin-bottom","margin-left"])}function fDe(t){t.setNormalizer("padding",ZG("padding")),t.setNormalizer("padding-top",e=>({path:"padding.top",value:e})),t.setNormalizer("padding-right",e=>({path:"padding.right",value:e})),t.setNormalizer("padding-bottom",e=>({path:"padding.bottom",value:e})),t.setNormalizer("padding-left",e=>({path:"padding.left",value:e})),t.setReducer("padding",ov("padding")),t.setStyleRelation("padding",["padding-top","padding-right","padding-bottom","padding-left"])}class tY{crashes=[];state="initializing";_crashNumberLimit;_now=Date.now;_minimumNonErrorTimePeriod;_boundErrorHandler;_listeners;constructor(e){if(this.crashes=[],this._crashNumberLimit=typeof e.crashNumberLimit=="number"?e.crashNumberLimit:3,this._minimumNonErrorTimePeriod=typeof e.minimumNonErrorTimePeriod=="number"?e.minimumNonErrorTimePeriod:5e3,this._boundErrorHandler=n=>{const i="error"in n?n.error:n.reason;i instanceof Error&&this._handleError(i,n)},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.")}destroy(){this._stopErrorHandling(),this._listeners={}}on(e,n){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(n)}off(e,n){this._listeners[e]=this._listeners[e].filter(i=>i!==n)}_fire(e,...n){const i=this._listeners[e]||[];for(const r of i)r.apply(this,[null,...n])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(e,n){if(this._shouldReactToError(e)){this.crashes.push({message:e.message,stack:e.stack,filename:n instanceof ErrorEvent?n.filename:void 0,lineno:n instanceof ErrorEvent?n.lineno:void 0,colno:n instanceof ErrorEvent?n.colno:void 0,date:this._now()});const i=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:e,causesRestart:i}),i?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(e){return e.is&&e.is("CKEditorError")&&e.context!==void 0&&e.context!==null&&this.state==="ready"&&this._isErrorComingFromThisItem(e)}_shouldRestart(){if(this.crashes.length<=this._crashNumberLimit)return!0;const e=this.crashes[this.crashes.length-1].date,n=this.crashes[this.crashes.length-1-this._crashNumberLimit].date;return(e-n)/this._crashNumberLimit>this._minimumNonErrorTimePeriod}}function xA(t,e=new Set){const n=[t],i=new Set;let r=0;for(;n.length>r;){const o=n[r++];if(!(i.has(o)||!hDe(o)||e.has(o)))if(i.add(o),Symbol.iterator in o)try{for(const s of o)n.push(s)}catch{}else for(const s in o)s!=="defaultValue"&&n.push(o[s])}return i}function hDe(t){const e=Object.prototype.toString.call(t),n=typeof t;return!(n==="number"||n==="boolean"||n==="string"||n==="symbol"||n==="function"||e==="[object Date]"||e==="[object RegExp]"||e==="[object Module]"||t===void 0||t===null||t._watchdogExcluded||t instanceof EventTarget||t instanceof Event)}function nY(t,e,n=new Set){if(t===e&&mDe(t))return!0;const i=xA(t,n),r=xA(e,n);for(const o of i)if(r.has(o))return!0;return!1}function mDe(t){return typeof t=="object"&&t!==null}class iY extends tY{_editor=null;_lifecyclePromise=null;_throttledSave;_data;_lastDocumentVersion;_elementOrData;_initUsingData=!0;_editables={};_config;_excludedProps;constructor(e,n={}){super(n),this._throttledSave=Km(this._save.bind(this),typeof n.saveInterval=="number"?n.saveInterval:5e3),e&&(this._creator=(i,r)=>e.create(i,r)),this._destructor=i=>i.destroy()}get editor(){return this._editor}get _item(){return this._editor}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}_restart(){return Promise.resolve().then(()=>(this.state="initializing",this._fire("stateChange"),this._destroy())).catch(e=>{console.error("An error happened during the editor destroying.",e)}).then(()=>{const e={},n=[],i=this._config.rootsAttributes||{},r={};for(const[s,a]of Object.entries(this._data.roots))a.isLoaded?(e[s]="",r[s]=i[s]||{}):n.push(s);const o={...this._config,extraPlugins:this._config.extraPlugins||[],lazyRoots:n,rootsAttributes:r,_watchdogInitialData:this._data};return delete o.initialData,o.extraPlugins.push(gDe),this._initUsingData?this.create(e,o,o.context):Rc(this._elementOrData)?this.create(this._elementOrData,o,o.context):this.create(this._editables,o,o.context)}).then(()=>{this._fire("restart")})}create(e=this._elementOrData,n=this._config,i){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then(()=>(super._startErrorHandling(),this._elementOrData=e,this._initUsingData=typeof e=="string"||Object.keys(e).length>0&&typeof Object.values(e)[0]=="string",this._config=this._cloneEditorConfiguration(n)||{},this._config.context=i,this._creator(e,this._config))).then(r=>{this._editor=r,r.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=r.model.document.version,this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this.state="ready",this._fire("stateChange")}).finally(()=>{this._lifecyclePromise=null}),this._lifecyclePromise}destroy(){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy())).finally(()=>{this._lifecyclePromise=null}),this._lifecyclePromise}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling(),this._throttledSave.cancel();const e=this._editor;return this._editor=null,e.model.document.off("change:data",this._throttledSave),this._destructor(e)})}_save(){const e=this._editor.model.document.version;try{this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this._lastDocumentVersion=e}catch(n){console.error(n,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(e){this._excludedProps=e}_getData(){const e=this._editor,n=e.model.document.roots.filter(a=>a.isAttached()&&a.rootName!="$graveyard"),{plugins:i}=e,r=i.has("CommentsRepository")&&i.get("CommentsRepository"),o=i.has("TrackChanges")&&i.get("TrackChanges"),s={roots:{},markers:{},commentThreads:JSON.stringify([]),suggestions:JSON.stringify([])};n.forEach(a=>{s.roots[a.rootName]={content:JSON.stringify(Array.from(a.getChildren())),attributes:JSON.stringify(Array.from(a.getAttributes())),isLoaded:a._isLoaded}});for(const a of e.model.markers)a._affectsData&&(s.markers[a.name]={rangeJSON:a.getRange().toJSON(),usingOperation:a._managedUsingOperations,affectsData:a._affectsData});return r&&(s.commentThreads=JSON.stringify(r.getCommentThreads({toJSON:!0,skipNotAttached:!0}))),o&&(s.suggestions=JSON.stringify(o.getSuggestions({toJSON:!0,skipNotAttached:!0}))),s}_getEditables(){const e={};for(const n of this.editor.model.document.getRootNames()){const i=this.editor.ui.getEditableElement(n);i&&(e[n]=i)}return e}_isErrorComingFromThisItem(e){return nY(this._editor,e.context,this._excludedProps)}_cloneEditorConfiguration(e){return dS(e,(n,i)=>{if(Rc(n)||i==="context")return n})}}class gDe{editor;_data;constructor(e){this.editor=e,this._data=e.config.get("_watchdogInitialData")}init(){this.editor.data.on("init",e=>{e.stop(),this.editor.model.enqueueChange({isUndoable:!1},n=>{this._restoreCollaborationData(),this._restoreEditorData(n)}),this.editor.data.fire("ready")},{priority:999})}_createNode(e,n){if("name"in n){const i=e.createElement(n.name,n.attributes);if(n.children)for(const r of n.children)i._appendChild(this._createNode(e,r));return i}else return e.createText(n.data,n.attributes)}_restoreEditorData(e){const n=this.editor;Object.entries(this._data.roots).forEach(([i,{content:r,attributes:o}])=>{const s=JSON.parse(r),a=JSON.parse(o),l=n.model.document.getRoot(i);for(const[u,c]of a)e.setAttribute(u,c,l);for(const u of s){const c=this._createNode(e,u);e.insert(c,l,"end")}}),Object.entries(this._data.markers).forEach(([i,r])=>{const{document:o}=n.model,{rangeJSON:{start:s,end:a},...l}=r,u=o.getRoot(s.root),c=e.createPositionFromPath(u,s.path,s.stickiness),d=e.createPositionFromPath(u,a.path,a.stickiness),f=e.createRange(c,d);e.addMarker(i,{range:f,...l})})}_restoreCollaborationData(){const e=JSON.parse(this._data.commentThreads),n=JSON.parse(this._data.suggestions);if(this.editor.plugins.has("CommentsRepository")){const i=this.editor.plugins.get("CommentsRepository");for(const r of i.getCommentThreads())i._removeCommentThread({threadId:r.id});e.forEach(r=>{const o=this.editor.config.get("collaboration.channelId");this.editor.plugins.get("CommentsRepository").addCommentThread({channelId:o,...r})})}if(this.editor.plugins.has("TrackChangesEditing")){const i=this.editor.plugins.get("TrackChangesEditing");for(const r of i.getSuggestions())i._removeSuggestion(r);n.forEach(r=>{i.addSuggestionData(r)})}}}const sv=Symbol("MainQueueId");class pDe extends tY{_watchdogs=new Map;_watchdogConfig;_context=null;_contextProps=new Set;_actionQueues=new vDe;_contextConfig;_item;constructor(e,n={}){super(n),this._watchdogConfig=n,this._creator=i=>e.create(i),this._destructor=i=>i.destroy(),this._actionQueues.onEmpty(()=>{this.state==="initializing"&&(this.state="ready",this._fire("stateChange"))})}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}get context(){return this._context}create(e={}){return this._actionQueues.enqueue(sv,()=>(this._contextConfig=e,this._create()))}getItem(e){return this._getWatchdog(e)._item}getItemState(e){return this._getWatchdog(e).state}add(e){const n=tV(e);return Promise.all(n.map(i=>this._actionQueues.enqueue(i.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 r;if(this._watchdogs.has(i.id))throw new Error(`Item with the given id is already added: '${i.id}'.`);if(i.type==="editor")return r=new iY(null,this._watchdogConfig),r.setCreator(i.creator),r._setExcludedProperties(this._contextProps),i.destructor&&r.setDestructor(i.destructor),this._watchdogs.set(i.id,r),r.on("error",(o,{error:s,causesRestart:a})=>{this._fire("itemError",{itemId:i.id,error:s}),a&&this._actionQueues.enqueue(i.id,()=>new Promise(l=>{const u=()=>{r.off("restart",u),this._fire("itemRestart",{itemId:i.id}),l()};r.on("restart",u)}))}),r.create(i.sourceElementOrData,i.config,this._context);throw new Error(`Not supported item type: '${i.type}'.`)})))}remove(e){const n=tV(e);return Promise.all(n.map(i=>this._actionQueues.enqueue(i,()=>{const r=this._getWatchdog(i);return this._watchdogs.delete(i),r.destroy()})))}destroy(){return this._actionQueues.enqueue(sv,()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))}_restart(){return this._actionQueues.enqueue(sv,()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch(e=>{console.error("An error happened during destroying the context or items.",e)}).then(()=>this._create()).then(()=>this._fire("restart"))))}_create(){return Promise.resolve().then(()=>(this._startErrorHandling(),this._creator(this._contextConfig))).then(e=>(this._context=e,this._contextProps=xA(this._context),Promise.all(Array.from(this._watchdogs.values()).map(n=>(n._setExcludedProperties(this._contextProps),n.create(void 0,void 0,this._context))))))}_destroy(){return Promise.resolve().then(()=>{this._stopErrorHandling();const e=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map(n=>n.destroy())).then(()=>this._destructor(e))})}_getWatchdog(e){const n=this._watchdogs.get(e);if(!n)throw new Error(`Item with the given id was not registered: ${e}.`);return n}_isErrorComingFromThisItem(e){for(const n of this._watchdogs.values())if(n._isErrorComingFromThisItem(e))return!1;return nY(this._context,e.context)}}class vDe{_onEmptyCallbacks=[];_queues=new Map;_activeActions=0;onEmpty(e){this._onEmptyCallbacks.push(e)}enqueue(e,n){const i=e===sv;this._activeActions++,this._queues.get(e)||this._queues.set(e,Promise.resolve());const o=(i?Promise.all(this._queues.values()):Promise.all([this._queues.get(sv),this._queues.get(e)])).then(n),s=o.catch(()=>{});return this._queues.set(e,s),o.finally(()=>{this._activeActions--,this._queues.get(e)===s&&this._activeActions===0&&this._onEmptyCallbacks.forEach(a=>a())})}}function tV(t){return Array.isArray(t)?t:[t]}class xe extends Ln(){editor;_disableStack=new Set;constructor(e){super(),this.editor=e,this.set("isEnabled",!0)}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",nV,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",nV),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}function nV(t){t.return=!1,t.stop()}class Ht extends Ln(){editor;_isEnabledBasedOnSelection;_affectsData;_disableStack;static get _throwErrorWhenUsedAsAPlugin(){return!0}constructor(e){super(),this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._isEnabledBasedOnSelection=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.listenTo(e,"change:isReadOnly",()=>{this.refresh()}),this.on("set:isEnabled",n=>{if(!this.affectsData)return;const i=e.model.document.selection,o=!(i.getFirstPosition().root.rootName=="$graveyard")&&e.model.canEditAt(i);(e.isReadOnly||this._isEnabledBasedOnSelection&&!o)&&(n.return=!1,n.stop())},{priority:"highest"}),this.on("execute",n=>{this.isEnabled||n.stop()},{priority:"high"})}get affectsData(){return this._affectsData}set affectsData(e){this._affectsData=e}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",iV,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",iV),this.refresh())}execute(...e){}destroy(){this.stopListening()}}function iV(t){t.return=!1,t.stop()}class rV extends Ht{_childCommandsDefinitions=[];refresh(){}execute(...e){const n=this._getFirstEnabledCommand();return!!n&&n.execute(e)}registerChildCommand(e,n={}){$K(this._childCommandsDefinitions,{command:e,priority:n.priority||"normal"}),e.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){const e=this._childCommandsDefinitions.find(({command:n})=>n.isEnabled);return e&&e.command}}class bDe{_commands;constructor(){this._commands=new Map}add(e,n){this._commands.set(e,n)}get(e){return this._commands.get(e)}execute(e,...n){const i=this.get(e);if(!i)throw new oe("commandcollection-command-not-found",this,{commandName:e});return i.execute(...n)}*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 rY extends Fn(){_context;_plugins=new Map;_availablePlugins;_contextPlugins;constructor(e,n=[],i=[]){super(),this._context=e,this._availablePlugins=new Map;for(const r of n)r.pluginName&&this._availablePlugins.set(r.pluginName,r);this._contextPlugins=new Map;for(const[r,o]of i)this._contextPlugins.set(r,o),this._contextPlugins.set(o,r),r.pluginName&&this._availablePlugins.set(r.pluginName,r)}*[Symbol.iterator](){for(const e of this._plugins)typeof e[0]=="function"&&(yield e)}get(e){const n=this._plugins.get(e);if(!n){let i=e;throw typeof e=="function"&&(i=e.pluginName||e.name),new oe("plugincollection-plugin-not-loaded",this._context,{plugin:i})}return n}has(e){return this._plugins.has(e)}async init(e,n=[],i=[]){const r=this,o=this._context;h(e),g(e);const s=e.filter(k=>!d(k,n)),a=[...m(s)];S(a,i);const l=_(a);return await C(l,"init"),await C(l,"afterInit"),l;function u(k){return typeof k=="function"}function c(k){return u(k)&&!!k.isContextPlugin}function d(k,T){return T.some(E=>E===k||f(k)===E||f(E)===k)}function f(k){return u(k)?k.pluginName||k.name:k}function h(k,T=new Set){k.forEach(E=>{u(E)&&(T.has(E)||(T.add(E),E.pluginName&&!r._availablePlugins.has(E.pluginName)&&r._availablePlugins.set(E.pluginName,E),E.requires&&h(E.requires,T)))})}function m(k,T=new Set){return k.map(E=>u(E)?E:r._availablePlugins.get(E)).reduce((E,x)=>T.has(x)?E:(T.add(x),x.requires&&(g(x.requires,x),m(x.requires,T).forEach(P=>E.add(P))),E.add(x)),new Set)}function g(k,T=null){k.map(E=>u(E)?E:r._availablePlugins.get(E)||E).forEach(E=>{v(E),p(E,T),b(E,T),y(E,T)})}function v(k){if(typeof k=="function"&&k._throwErrorWhenUsedAsAPlugin)throw new oe("plugincollection-plugin-invalid-constructor",o,{name:k.name})}function p(k,T){if(!u(k))throw T?new oe("plugincollection-soft-required",o,{missingPlugin:k,requiredBy:f(T)}):new oe("plugincollection-plugin-not-found",o,{plugin:k})}function b(k,T){if(c(T)&&!c(k))throw new oe("plugincollection-context-required",o,{plugin:f(k),requiredBy:f(T)})}function y(k,T){if(T&&d(k,n))throw new oe("plugincollection-required",o,{plugin:f(k),requiredBy:f(T)})}function _(k){return k.map(T=>{let E=r._contextPlugins.get(T);return E=E||new T(o),r._add(T,E),E})}function C(k,T){return k.reduce((E,x)=>!x[T]||r._contextPlugins.has(x)?E:E.then(x[T].bind(x)),Promise.resolve())}function S(k,T){for(const E of T){if(typeof E!="function")throw new oe("plugincollection-replace-plugin-invalid-type",null,{pluginItem:E});const x=E.pluginName;if(!x)throw new oe("plugincollection-replace-plugin-missing-name",null,{pluginItem:E});if(E.requires&&E.requires.length)throw new oe("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:x});const P=r._availablePlugins.get(x);if(!P)throw new oe("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:x});const A=k.indexOf(P);if(A===-1){if(r._contextPlugins.has(P))return;throw new oe("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:x})}if(P.requires&&P.requires.length)throw new oe("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:x});k.splice(A,1,E),r._availablePlugins.set(x,E)}}}destroy(){const e=[];for(const[,n]of this)typeof n.destroy=="function"&&!this._contextPlugins.has(n)&&e.push(n.destroy());return Promise.all(e)}_add(e,n){this._plugins.set(e,n);const i=e.pluginName;if(i){if(this._plugins.has(i))throw new oe("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e});this._plugins.set(i,n)}}}class oV{config;plugins;locale;t;editors;static defaultConfig;static builtinPlugins;_contextOwner=null;constructor(e){const{translations:n,...i}=e||{};this.config=new KK(i,this.constructor.defaultConfig);const r=this.constructor.builtinPlugins;this.config.define("plugins",r),this.plugins=new rY(this,r);const o=this.config.get("language")||{};this.locale=new zRe({uiLanguage:typeof o=="string"?o:o.ui,contentLanguage:this.config.get("language.content"),translations:n}),this.t=this.locale.t,this.editors=new Er}initPlugins(){const e=this.config.get("plugins")||[],n=this.config.get("substitutePlugins")||[];for(const i of e.concat(n)){if(typeof i!="function")throw new oe("context-initplugins-constructor-only",null,{Plugin:i});if(i.isContextPlugin!==!0)throw new oe("context-initplugins-invalid-plugin",null,{Plugin:i})}return this.plugins.init(e,[],n)}destroy(){return Promise.all(Array.from(this.editors,e=>e.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,n){if(this._contextOwner)throw new oe("context-addeditor-private-context");this.editors.add(e),n&&(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 n of this.config.names())["plugins","removePlugins","extraPlugins"].includes(n)||(e[n]=this.config.get(n));return e}static create(e){return new Promise(n=>{const i=new this(e);n(i.initPlugins().then(()=>i))})}static get _throwErrorWhenUsedAsAPlugin(){return!0}}class bS extends Ln(){context;constructor(e){super(),this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}class yDe extends Qi{editor;constructor(e){super(),this.editor=e}set(e,n,i={}){if(typeof n=="string"){const r=n;n=(o,s)=>{this.editor.execute(r),s()}}super.set(e,n,i)}}const FT="contentEditing",sV="common";class wDe{keystrokeInfos=new Map;_editor;constructor(e){this._editor=e;const n=e.config.get("menuBar.isVisible"),i=e.locale.t;this.addKeystrokeInfoCategory({id:FT,label:i("Content editing keystrokes"),description:i("These keyboard shortcuts allow for quick access to content editing features.")});const r=[{label:i("Close contextual balloons, dropdowns, and dialogs"),keystroke:"Esc"},{label:i("Open the accessibility help dialog"),keystroke:"Alt+0"},{label:i("Move focus between form fields (inputs, buttons, etc.)"),keystroke:[["Tab"],["Shift+Tab"]]},{label:i("Move focus to the toolbar, navigate between toolbars"),keystroke:"Alt+F10",mayRequireFn:!0},{label:i("Navigate through the toolbar or menu bar"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]},{label:i("Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content."),keystroke:[["Enter"],["Space"]]}];n&&r.push({label:i("Move focus to the menu bar, navigate between menu bars"),keystroke:"Alt+F9",mayRequireFn:!0}),this.addKeystrokeInfoCategory({id:"navigation",label:i("User interface and content navigation keystrokes"),description:i("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),groups:[{id:"common",keystrokes:r}]})}addKeystrokeInfoCategory({id:e,label:n,description:i,groups:r}){this.keystrokeInfos.set(e,{id:e,label:n,description:i,groups:new Map}),this.addKeystrokeInfoGroup({categoryId:e,id:sV}),r&&r.forEach(o=>{this.addKeystrokeInfoGroup({categoryId:e,...o})})}addKeystrokeInfoGroup({categoryId:e=FT,id:n,label:i,keystrokes:r}){const o=this.keystrokeInfos.get(e);if(!o)throw new oe("accessibility-unknown-keystroke-info-category",this._editor,{groupId:n,categoryId:e});o.groups.set(n,{id:n,label:i,keystrokes:r||[]})}addKeystrokeInfos({categoryId:e=FT,groupId:n=sV,keystrokes:i}){if(!this.keystrokeInfos.has(e))throw new oe("accessibility-unknown-keystroke-info-category",this._editor,{categoryId:e,keystrokes:i});const r=this.keystrokeInfos.get(e);if(!r.groups.has(n))throw new oe("accessibility-unknown-keystroke-info-group",this._editor,{groupId:n,categoryId:e,keystrokes:i});r.groups.get(n).keystrokes.push(...i)}}function _De(t){return{sessionId:EDe(),pageSessionId:xDe(),hostname:window.location.hostname,version:globalThis.CKEDITOR_VERSION,type:CDe(t),plugins:SDe(t.plugins),distribution:kDe(),env:TDe(),integration:Object.create(null),menuBar:{isVisible:!!t.config.get("menuBar.isVisible")},language:{ui:t.locale.uiLanguage,content:t.locale.contentLanguage},toolbar:{main:$T(t.config.get("toolbar")),block:$T(t.config.get("blockToolbar")),balloon:$T(t.config.get("balloonToolbar"))}}}function CDe(t){return Object.getPrototypeOf(t).constructor.editorName}function SDe(t){return Array.from(t).filter(([e])=>!!e.pluginName).map(([e])=>{const{pluginName:n,isContextPlugin:i,isOfficialPlugin:r,isPremiumPlugin:o}=e;return{isContext:!!i,isOfficial:!!r,isPremium:!!o,name:n}})}function $T(t){if(!t)return;const e=Array.isArray(t)?{items:t}:t,n=o(e.items||[]);return{isMultiline:n.includes("-"),shouldNotGroupWhenFull:!!e.shouldNotGroupWhenFull,items:r(n)};function r(s){return s.filter(a=>a!=="|"&&a!=="-")}function o(s){return s.flatMap(a=>typeof a=="string"?[a]:o(a.items))}}function kDe(){return{channel:window[Symbol.for("cke distribution")]||"sh"}}function TDe(){let t="unknown",e="unknown";return vt.isMac?t="mac":vt.isWindows?t="windows":vt.isiOS?t="ios":vt.isAndroid&&(t="android"),vt.isGecko?e="gecko":vt.isBlink?e="blink":vt.isSafari&&(e="safari"),{os:t,browser:e}}function EDe(){return localStorage.getItem("__ckeditor-session-id")||localStorage.setItem("__ckeditor-session-id",Ur()),localStorage.getItem("__ckeditor-session-id")}function xDe(){return Qe.window.CKEDITOR_PAGE_SESSION_ID=Qe.window.CKEDITOR_PAGE_SESSION_ID||Ur(),Qe.window.CKEDITOR_PAGE_SESSION_ID}class ADe extends Ln(){static get editorName(){return"Editor"}accessibility;commands;config;conversion;data;editing;locale;model;plugins;keystrokes;t;static defaultConfig;static builtinPlugins;_context;_readOnlyLocks;static get _throwErrorWhenUsedAsAPlugin(){return!0}constructor(e={}){if(super(),typeof e!="object"||Array.isArray(e))throw new oe("editor-config-invalid-type");if("sanitizeHtml"in e)throw new oe("editor-config-sanitizehtml-not-supported");const n=this.constructor,{translations:i,...r}=n.defaultConfig||{},{translations:o=i,...s}=e,a=e.language||r.language;this._context=e.context||new oV({language:a,translations:o}),this._context._addEditor(this,!e.context);const l=Array.from(n.builtinPlugins||[]);this.config=new KK(s,r),this.config.define("plugins",l),this.config.define(this._context._getEditorConfig()),c(this.config),this.plugins=new rY(this,l,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new bDe,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.model=new D5e(this.config),this.on("change:isReadOnly",()=>{this.model.document.isReadOnly=this.isReadOnly});const u=new mMe;this.data=new FLe(this.model,u),this.editing=new pLe(this.model,u),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new zLe([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 yDe(this),this.keystrokes.listenTo(this.editing.view.document),this.accessibility=new wDe(this),d(this);function c(f){let h=f.get("licenseKey");if(!h&&window.CKEDITOR_GLOBAL_LICENSE_KEY&&(h=window.CKEDITOR_GLOBAL_LICENSE_KEY,f.set("licenseKey",h)),!h)throw new oe("license-key-missing")}function d(f){const h=f.config.get("licenseKey"),m=window[Symbol.for("cke distribution")]||"sh";function g(k,T){f.enableReadOnlyMode(Symbol("invalidLicense")),f._showLicenseError(k,T)}function v(k){return["exp","jti","vc"].every(E=>E in k)}function p(k){return Object.getOwnPropertyNames(k).sort().filter(x=>x!="vc"&&k[x]!=null).map(x=>k[x])}function b(k){const{hostname:T}=new URL(window.location.href);if(k.includes(T))return!0;const E=T.split(".");return k.filter(x=>x.includes("*")).map(x=>x.split(".")).filter(x=>x.length<=E.length).map(x=>Array(E.length-x.length).fill(x[0]==="*"?"*":"").concat(x)).some(x=>E.every((P,A)=>x[A]===P||x[A]==="*"))}function y(k){const T=k[0].toUpperCase()+k.slice(1),E=k==="evaluation"?"an":"a";console.info(`%cCKEditor 5 ${T} License`,"color: #ffffff; background: #743CCD; font-size: 14px; padding: 4px 8px; border-radius: 4px;"),console.warn(`⚠️ You are using ${E} ${k} license of CKEditor 5${k==="trial"?" which is for evaluation purposes only":""}. For production usage, please obtain a production license at https://portal.ckeditor.com/`)}if(h=="GPL"){m=="cloud"&&g("distributionChannel");return}const _=g4(h);if(!_){g("invalid");return}if(!v(_)){g("invalid");return}if(_.distributionChannel&&!li(_.distributionChannel).includes(m)){g("distributionChannel");return}if(jRe(p(_))!=_.vc.toLowerCase()){g("invalid");return}if(new Date(_.exp*1e3)0&&!b(S)){g("domainLimit");return}if(["evaluation","trial"].includes(_.licenseType)&&_.exp*1e3{g(`${k}Limit`)},6e5);f.on("destroy",()=>{clearTimeout(T)})}_.usageEndpoint&&f.once("ready",()=>{const k={requestId:Ur(),requestTime:Math.round(Date.now()/1e3),license:h,editor:PDe(f)};f._sendUsageRequest(_.usageEndpoint,k).then(T=>{const{status:E,message:x}=T;x&&console.warn(x),E!="ok"&&g("usageLimit")},()=>{YIe("license-key-validation-endpoint-not-reachable",{url:_.usageEndpoint})})},{priority:"high"})}}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new oe("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new oe("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),this._readOnlyLocks.size===1&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new oe("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),this._readOnlyLocks.size===0&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}setData(e){this.data.set(e)}getData(e){return this.data.get(e)}initPlugins(){const e=this.config,n=e.get("plugins"),i=e.get("removePlugins")||[],r=e.get("extraPlugins")||[],o=e.get("substitutePlugins")||[];return this.plugins.init(n.concat(r),i,o).then(a=>(s(this),a));function s(a){const l=a.config.get("licenseKey");if(l==="GPL")return;const u=g4(l);if(!u)return;const c=[...a.plugins].map(([d])=>d).find(d=>!d.pluginName||!d.licenseFeatureCode?!1:iMe(u,d.licenseFeatureCode));c&&(a.enableReadOnlyMode(Symbol("invalidLicense")),a._showLicenseError("pluginNotAllowed",c.pluginName))}}destroy(){let e=Promise.resolve();return this.state=="initializing"&&(e=new Promise(n=>this.once("ready",n))),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,...n){try{return this.commands.execute(e,...n)}catch(i){oe.rethrowUnexpectedError(i,this)}}focus(){this.editing.view.focus()}static create(...e){throw new Error("This is an abstract method.")}static Context=oV;static EditorWatchdog=iY;static ContextWatchdog=pDe;_showLicenseError(e,n){setTimeout(()=>{if(e=="invalid")throw new oe("invalid-license-key");if(e=="expired")throw new oe("license-key-expired");if(e=="domainLimit")throw new oe("license-key-domain-limit");if(e=="pluginNotAllowed"){const i=n.replace(/(Editing|UI)$/,""),r=this.plugins.has(i);throw new oe("license-key-plugin-not-allowed",null,{pluginName:r?i:n})}if(e=="featureNotAllowed")throw new oe("license-key-feature-not-allowed",null,{featureName:n});if(e=="evaluationLimit")throw new oe("license-key-evaluation-limit");if(e=="trialLimit")throw new oe("license-key-trial-limit");if(e=="developmentLimit")throw new oe("license-key-development-limit");if(e=="usageLimit")throw new oe("license-key-usage-limit");if(e=="distributionChannel")throw new oe("license-key-invalid-distribution-channel")},0),this._showLicenseError=()=>{}}async _sendUsageRequest(e,n){const i=new Headers({"Content-Type":"application/json"}),r=await fetch(new URL(e),{method:"POST",headers:i,body:JSON.stringify(n)});if(!r.ok)throw new Error(`HTTP Response: ${r.status}`);return r.json()}}function PDe(t){const e=_De(t);function n(i,r){if(Ic(e,i)!==void 0)throw new oe("editor-usage-data-path-already-set",{path:i});LK(e,i,r)}return t.fire("collectUsageData",{setUsageData:n}),e}function IDe(t){if(!s1(t.updateSourceElement))throw new oe("attachtoform-missing-elementapi-interface",t);const e=t.sourceElement;if(RDe(e)&&e.form){let n;const i=e.form,r=()=>t.updateSourceElement();s1(i.submit)&&(n=i.submit,i.submit=()=>{r(),n.apply(i)}),i.addEventListener("submit",r),t.on("destroy",()=>{i.removeEventListener("submit",r),n&&(i.submit=n)})}}function RDe(t){return!!t&&t.tagName.toLowerCase()==="textarea"}function MDe(t){class e extends t{sourceElement;updateSourceElement(i){if(!this.sourceElement)throw new oe("editor-missing-sourceelement",this);const r=this.config.get("updateSourceElementOnDestroy"),o=this.sourceElement instanceof HTMLTextAreaElement;if(!r&&!o){o4(this.sourceElement,"");return}const s=typeof i=="string"?i:this.data.get();o4(this.sourceElement,s)}}return e}class m1 extends bS{_actions;static get pluginName(){return"PendingActions"}static get isOfficialPlugin(){return!0}init(){this.set("hasAny",!1),this._actions=new Er({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if(typeof e!="string")throw new oe("pendingactions-add-invalid-message",this);const n=new(Ln());return n.set("message",e),this._actions.add(n),this.hasAny=!0,n}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]()}}class ODe extends Ln(){total;_reader;_data;constructor(){super();const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=n=>{this.loaded=n.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const n=this._reader;return this.total=e.size,new Promise((i,r)=>{n.onload=()=>{const o=n.result;this._data=o,i(o)},n.onerror=()=>{r("error")},n.onabort=()=>{r("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}class eu extends xe{loaders=new Er;_loadersMap=new Map;_pendingAction=null;static get pluginName(){return"FileRepository"}static get isOfficialPlugin(){return!0}static get requires(){return[m1]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,n)=>n?e/n*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return hn("filerepository-no-upload-adapter"),null;const n=new aV(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(n),this._loadersMap.set(e,n),e instanceof Promise&&n.file.then(i=>{this._loadersMap.set(i,n)}).catch(()=>{}),n.on("change:uploaded",()=>{let i=0;for(const r of this.loaders)i+=r.uploaded;this.uploaded=i}),n.on("change:uploadTotal",()=>{let i=0;for(const r of this.loaders)r.uploadTotal&&(i+=r.uploadTotal);this.uploadTotal=i}),n}destroyLoader(e){const n=e instanceof aV?e:this.getLoader(e);n._destroy(),this.loaders.remove(n),this._loadersMap.forEach((i,r)=>{i===n&&this._loadersMap.delete(r)})}_updatePendingAction(){const e=this.editor.plugins.get(m1);if(this.loaders.length){if(!this._pendingAction){const n=this.editor.t,i=r=>`${n("Upload in progress")} ${parseInt(r)}%.`;this._pendingAction=e.add(i(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",i)}}else e.remove(this._pendingAction),this._pendingAction=null}}class aV extends Ln(){id;_filePromiseWrapper;_adapter;_reader;constructor(e,n){super(),this.id=Ur(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=n(this),this._reader=new ODe,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(i,r)=>r?i/r*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new oe("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 oe("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 n={};return n.promise=new Promise((i,r)=>{n.rejecter=r,n.isFulfilled=!1,e.then(o=>{n.isFulfilled=!0,i(o)}).catch(o=>{n.isFulfilled=!0,r(o)})}),n}}class LDe extends xe{static get requires(){return[eu]}static get pluginName(){return"Base64UploadAdapter"}static get licenseFeatureCode(){return"B64A"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}init(){this.editor.plugins.get(eu).createUploadAdapter=e=>new DDe(e)}}let DDe=class{loader;reader;constructor(e){this.loader=e}upload(){return new Promise((e,n)=>{const i=this.reader=new window.FileReader;i.addEventListener("load",()=>{e({default:i.result})}),i.addEventListener("error",r=>{n(r)}),i.addEventListener("abort",()=>{n()}),this.loader.file.then(r=>{i.readAsDataURL(r)})})}abort(){this.reader.abort()}};var lV='',NDe='',oY='',sY='',rO='',BDe='',aY='',VDe='',lY='',FDe='',oO='',uY='',sO='',$De='',zDe='',HDe='',UDe='',WDe='',yS='',qDe='',jDe='',KDe='',uV='',GDe='',YDe='',XDe='',cV='',JDe='',ZDe='',QDe='',eNe='',cY='',tNe='',AA='',nNe='',dY='',PA='',fY='',hY='',mY='',iNe='',rNe='',oNe='',sNe='',aNe='',dV='',lNe='',uNe='',cNe='',dNe='',pg='',fNe=` +`,hNe='',fV='',mNe='',gNe='',pNe=` +`,vNe='',bNe='',yNe='',wNe='',_Ne='',CNe='',SNe='',kNe='',hV='',TNe='',ENe='',aO='',xNe='',mV='',ANe='';const IA={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const t in IA)Object.freeze(IA[t]);const kf=Object.freeze(IA);var gV={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function pV(t){var e,n=[],i=1,r;if(typeof t=="number")return{space:"rgb",values:[t>>>16,(t&65280)>>>8,t&255],alpha:1};if(typeof t=="number")return{space:"rgb",values:[t>>>16,(t&65280)>>>8,t&255],alpha:1};if(t=String(t).toLowerCase(),kf[t])n=kf[t].slice(),r="rgb";else if(t==="transparent")i=0,r="rgb",n=[0,0,0];else if(t[0]==="#"){var o=t.slice(1),s=o.length,a=s<=4;i=1,a?(n=[parseInt(o[0]+o[0],16),parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16)],s===4&&(i=parseInt(o[3]+o[3],16)/255)):(n=[parseInt(o[0]+o[1],16),parseInt(o[2]+o[3],16),parseInt(o[4]+o[5],16)],s===8&&(i=parseInt(o[6]+o[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),r="rgb"}else if(e=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(t)){var l=e[1];r=l.replace(/a$/,"");var u=r==="cmyk"?4:r==="gray"?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/),r==="color"&&(r=n.shift()),n=n.map(function(c,d){if(c[c.length-1]==="%")return c=parseFloat(c)/100,d===3?c:r==="rgb"?c*255:r[0]==="h"||r[0]==="l"&&!d?c*100:r==="lab"?c*125:r==="lch"?d<2?c*150:c*360:r[0]==="o"&&!d?c:r==="oklab"?c*.4:r==="oklch"?d<2?c*.4:c*360:c;if(r[d]==="h"||d===2&&r[r.length-1]==="h"){if(gV[c]!==void 0)return gV[c];if(c.endsWith("deg"))return parseFloat(c);if(c.endsWith("turn"))return parseFloat(c)*360;if(c.endsWith("grad"))return parseFloat(c)*360/400;if(c.endsWith("rad"))return parseFloat(c)*180/Math.PI}return c==="none"?0:parseFloat(c)}),i=n.length>u?n.pop():1}else/[0-9](?:\s|\/|,)/.test(t)&&(n=t.match(/([0-9]+)/g).map(function(c){return parseFloat(c)}),r=t.match(/([a-z])/ig)?.join("")?.toLowerCase()||"rgb");return{space:r,values:n,alpha:i}}const gY={};for(const t of Object.keys(kf))gY[kf[t]]=t;const at={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},lu=(6/29)**3;function mm(t){const e=t>.0031308?1.055*t**.4166666666666667-.055:t*12.92;return Math.min(Math.max(0,e),1)}function gm(t){return t>.04045?((t+.055)/1.055)**2.4:t/12.92}for(const t of Object.keys(at)){if(!("channels"in at[t]))throw new Error("missing channels property: "+t);if(!("labels"in at[t]))throw new Error("missing channel labels property: "+t);if(at[t].labels.length!==at[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=at[t];delete at[t].channels,delete at[t].labels,Object.defineProperty(at[t],"channels",{value:e}),Object.defineProperty(at[t],"labels",{value:n})}at.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,i=t[2]/255,r=Math.min(e,n,i),o=Math.max(e,n,i),s=o-r;let a,l;switch(o){case r:{a=0;break}case e:{a=(n-i)/s;break}case n:{a=2+(i-e)/s;break}case i:{a=4+(e-n)/s;break}}a=Math.min(a*60,360),a<0&&(a+=360);const u=(r+o)/2;return o===r?l=0:u<=.5?l=s/(o+r):l=s/(2-o-r),[a,l*100,u*100]};at.rgb.hsv=function(t){let e,n,i,r,o;const s=t[0]/255,a=t[1]/255,l=t[2]/255,u=Math.max(s,a,l),c=u-Math.min(s,a,l),d=function(f){return(u-f)/6/c+1/2};if(c===0)r=0,o=0;else{switch(o=c/u,e=d(s),n=d(a),i=d(l),u){case s:{r=i-n;break}case a:{r=1/3+e-i;break}case l:{r=2/3+n-e;break}}r<0?r+=1:r>1&&(r-=1)}return[r*360,o*100,u*100]};at.rgb.hwb=function(t){const e=t[0],n=t[1];let i=t[2];const r=at.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(n,i));return i=1-1/255*Math.max(e,Math.max(n,i)),[r,o*100,i*100]};at.rgb.oklab=function(t){const e=gm(t[0]/255),n=gm(t[1]/255),i=gm(t[2]/255),r=Math.cbrt(.4122214708*e+.5363325363*n+.0514459929*i),o=Math.cbrt(.2119034982*e+.6806995451*n+.1073969566*i),s=Math.cbrt(.0883024619*e+.2817188376*n+.6299787005*i),a=.2104542553*r+.793617785*o-.0040720468*s,l=1.9779984951*r-2.428592205*o+.4505937099*s,u=.0259040371*r+.7827717662*o-.808675766*s;return[a*100,l*100,u*100]};at.rgb.cmyk=function(t){const e=t[0]/255,n=t[1]/255,i=t[2]/255,r=Math.min(1-e,1-n,1-i),o=(1-e-r)/(1-r)||0,s=(1-n-r)/(1-r)||0,a=(1-i-r)/(1-r)||0;return[o*100,s*100,a*100,r*100]};function PNe(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}at.rgb.keyword=function(t){const e=gY[t];if(e)return e;let n=Number.POSITIVE_INFINITY,i;for(const r of Object.keys(kf)){const o=kf[r],s=PNe(t,o);slu?n**(1/3):7.787*n+16/116,i=i>lu?i**(1/3):7.787*i+16/116,r=r>lu?r**(1/3):7.787*r+16/116;const o=116*i-16,s=500*(n-i),a=200*(i-r);return[o,s,a]};at.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,i=t[2]/100;let r,o;if(n===0)return o=i*255,[o,o,o];const s=i<.5?i*(1+n):i+n-i*n,a=2*i-s,l=[0,0,0];for(let u=0;u<3;u++)r=e+1/3*-(u-1),r<0&&r++,r>1&&r--,6*r<1?o=a+(s-a)*6*r:2*r<1?o=s:3*r<2?o=a+(s-a)*(2/3-r)*6:o=a,l[u]=o*255;return l};at.hsl.hsv=function(t){const e=t[0];let n=t[1]/100,i=t[2]/100,r=n;const o=Math.max(i,.01);i*=2,n*=i<=1?i:2-i,r*=o<=1?o:2-o;const s=(i+n)/2,a=i===0?2*r/(o+r):2*n/(i+n);return[e,a*100,s*100]};at.hsv.rgb=function(t){const e=t[0]/60,n=t[1]/100;let i=t[2]/100;const r=Math.floor(e)%6,o=e-Math.floor(e),s=255*i*(1-n),a=255*i*(1-n*o),l=255*i*(1-n*(1-o));switch(i*=255,r){case 0:return[i,l,s];case 1:return[a,i,s];case 2:return[s,i,l];case 3:return[s,a,i];case 4:return[l,s,i];case 5:return[i,s,a]}};at.hsv.hsl=function(t){const e=t[0],n=t[1]/100,i=t[2]/100,r=Math.max(i,.01);let o,s;s=(2-n)*i;const a=(2-n)*r;return o=n*r,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};at.hwb.rgb=function(t){const e=t[0]/360;let n=t[1]/100,i=t[2]/100;const r=n+i;let o;r>1&&(n/=r,i/=r);const s=Math.floor(6*e),a=1-i;o=6*e-s,(s&1)!==0&&(o=1-o);const l=n+o*(a-n);let u,c,d;switch(s){default:case 6:case 0:{u=a,c=l,d=n;break}case 1:{u=l,c=a,d=n;break}case 2:{u=n,c=a,d=l;break}case 3:{u=n,c=l,d=a;break}case 4:{u=l,c=n,d=a;break}case 5:{u=a,c=n,d=l;break}}return[u*255,c*255,d*255]};at.cmyk.rgb=function(t){const e=t[0]/100,n=t[1]/100,i=t[2]/100,r=t[3]/100,o=1-Math.min(1,e*(1-r)+r),s=1-Math.min(1,n*(1-r)+r),a=1-Math.min(1,i*(1-r)+r);return[o*255,s*255,a*255]};at.xyz.rgb=function(t){const e=t[0]/100,n=t[1]/100,i=t[2]/100;let r,o,s;return r=e*3.2404542+n*-1.5371385+i*-.4985314,o=e*-.969266+n*1.8760108+i*.041556,s=e*.0556434+n*-.2040259+i*1.0572252,r=mm(r),o=mm(o),s=mm(s),[r*255,o*255,s*255]};at.xyz.lab=function(t){let e=t[0],n=t[1],i=t[2];e/=95.047,n/=100,i/=108.883,e=e>lu?e**(1/3):7.787*e+16/116,n=n>lu?n**(1/3):7.787*n+16/116,i=i>lu?i**(1/3):7.787*i+16/116;const r=116*n-16,o=500*(e-n),s=200*(n-i);return[r,o,s]};at.xyz.oklab=function(t){const e=t[0]/100,n=t[1]/100,i=t[2]/100,r=Math.cbrt(.8189330101*e+.3618667424*n-.1288597137*i),o=Math.cbrt(.0329845436*e+.9293118715*n+.0361456387*i),s=Math.cbrt(.0482003018*e+.2643662691*n+.633851707*i),a=.2104542553*r+.793617785*o-.0040720468*s,l=1.9779984951*r-2.428592205*o+.4505937099*s,u=.0259040371*r+.7827717662*o-.808675766*s;return[a*100,l*100,u*100]};at.oklab.oklch=function(t){return at.lab.lch(t)};at.oklab.xyz=function(t){const e=t[0]/100,n=t[1]/100,i=t[2]/100,r=(.999999998*e+.396337792*n+.215803758*i)**3,o=(1.000000008*e-.105561342*n-.063854175*i)**3,s=(1.000000055*e-.089484182*n-1.291485538*i)**3,a=1.227013851*r-.55779998*o+.281256149*s,l=-.040580178*r+1.11225687*o-.071676679*s,u=-.076381285*r-.421481978*o+1.58616322*s;return[a*100,l*100,u*100]};at.oklab.rgb=function(t){const e=t[0]/100,n=t[1]/100,i=t[2]/100,r=(e+.3963377774*n+.2158037573*i)**3,o=(e-.1055613458*n-.0638541728*i)**3,s=(e-.0894841775*n-1.291485548*i)**3,a=mm(4.0767416621*r-3.3077115913*o+.2309699292*s),l=mm(-1.2684380046*r+2.6097574011*o-.3413193965*s),u=mm(-.0041960863*r-.7034186147*o+1.707614701*s);return[a*255,l*255,u*255]};at.oklch.oklab=function(t){return at.lch.lab(t)};at.lab.xyz=function(t){const e=t[0],n=t[1],i=t[2];let r,o,s;o=(e+16)/116,r=n/500+o,s=o-i/200;const a=o**3,l=r**3,u=s**3;return o=a>lu?a:(o-16/116)/7.787,r=l>lu?l:(r-16/116)/7.787,s=u>lu?u:(s-16/116)/7.787,r*=95.047,o*=100,s*=108.883,[r,o,s]};at.lab.lch=function(t){const e=t[0],n=t[1],i=t[2];let r;r=Math.atan2(i,n)*360/2/Math.PI,r<0&&(r+=360);const s=Math.sqrt(n*n+i*i);return[e,s,r]};at.lch.lab=function(t){const e=t[0],n=t[1],r=t[2]/360*2*Math.PI,o=n*Math.cos(r),s=n*Math.sin(r);return[e,o,s]};at.rgb.ansi16=function(t,e=null){const[n,i,r]=t;let o=e===null?at.rgb.hsv(t)[2]:e;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(r/255)<<2|Math.round(i/255)<<1|Math.round(n/255));return o===2&&(s+=60),s};at.hsv.ansi16=function(t){return at.rgb.ansi16(at.hsv.rgb(t),t[2])};at.rgb.ansi256=function(t){const e=t[0],n=t[1],i=t[2];return e>>4===n>>4&&n>>4===i>>4?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)};at.ansi16.rgb=function(t){t=t[0];let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];const n=(Math.trunc(t>50)+1)*.5,i=(e&1)*n*255,r=(e>>1&1)*n*255,o=(e>>2&1)*n*255;return[i,r,o]};at.ansi256.rgb=function(t){if(t=t[0],t>=232){const o=(t-232)*10+8;return[o,o,o]}t-=16;let e;const n=Math.floor(t/36)/5*255,i=Math.floor((e=t%36)/6)/5*255,r=e%6/5*255;return[n,i,r]};at.rgb.hex=function(t){const n=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".slice(n.length)+n};at.hex.rgb=function(t){const e=t.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!e)return[0,0,0];let n=e[0];e[0].length===3&&(n=[...n].map(a=>a+a).join(""));const i=Number.parseInt(n,16),r=i>>16&255,o=i>>8&255,s=i&255;return[r,o,s]};at.rgb.hcg=function(t){const e=t[0]/255,n=t[1]/255,i=t[2]/255,r=Math.max(Math.max(e,n),i),o=Math.min(Math.min(e,n),i),s=r-o;let a;const l=s<1?o/(1-s):0;return s<=0?a=0:r===e?a=(n-i)/s%6:r===n?a=2+(i-e)/s:a=4+(e-n)/s,a/=6,a%=1,[a*360,s*100,l*100]};at.hsl.hcg=function(t){const e=t[1]/100,n=t[2]/100,i=n<.5?2*e*n:2*e*(1-n);let r=0;return i<1&&(r=(n-.5*i)/(1-i)),[t[0],i*100,r*100]};at.hsv.hcg=function(t){const e=t[1]/100,n=t[2]/100,i=e*n;let r=0;return i<1&&(r=(n-i)/(1-i)),[t[0],i*100,r*100]};at.hcg.rgb=function(t){const e=t[0]/360,n=t[1]/100,i=t[2]/100;if(n===0)return[i*255,i*255,i*255];const r=[0,0,0],o=e%1*6,s=o%1,a=1-s;let l=0;switch(Math.floor(o)){case 0:{r[0]=1,r[1]=s,r[2]=0;break}case 1:{r[0]=a,r[1]=1,r[2]=0;break}case 2:{r[0]=0,r[1]=1,r[2]=s;break}case 3:{r[0]=0,r[1]=a,r[2]=1;break}case 4:{r[0]=s,r[1]=0,r[2]=1;break}default:r[0]=1,r[1]=0,r[2]=a}return l=(1-n)*i,[(n*r[0]+l)*255,(n*r[1]+l)*255,(n*r[2]+l)*255]};at.hcg.hsv=function(t){const e=t[1]/100,n=t[2]/100,i=e+n*(1-e);let r=0;return i>0&&(r=e/i),[t[0],r*100,i*100]};at.hcg.hsl=function(t){const e=t[1]/100,i=t[2]/100*(1-e)+.5*e;let r=0;return i>0&&i<.5?r=e/(2*i):i>=.5&&i<1&&(r=e/(2*(1-i))),[t[0],r*100,i*100]};at.hcg.hwb=function(t){const e=t[1]/100,n=t[2]/100,i=e+n*(1-e);return[t[0],(i-e)*100,(1-i)*100]};at.hwb.hcg=function(t){const e=t[1]/100,i=1-t[2]/100,r=i-e;let o=0;return r<1&&(o=(i-r)/(1-r)),[t[0],r*100,o*100]};at.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};at.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};at.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};at.gray.hsl=function(t){return[0,0,t[0]]};at.gray.hsv=at.gray.hsl;at.gray.hwb=function(t){return[0,100,t[0]]};at.gray.cmyk=function(t){return[0,0,0,t[0]]};at.gray.lab=function(t){return[t[0],0,0]};at.gray.hex=function(t){const e=Math.round(t[0]/100*255)&255,i=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".slice(i.length)+i};at.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};function INe(){const t={},e=Object.keys(at);for(let{length:n}=e,i=0;i0;){const i=n.pop(),r=Object.keys(at[i]);for(let{length:o}=r,s=0;s1&&(n=i),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function BNe(t){const e=function(...n){const i=n[0];if(i==null)return i;i.length>1&&(n=i);const r=t(n);if(typeof r=="object")for(let{length:o}=r,s=0;st>n?n:tMath.round(n*t)/n,VNe=t=>UNe(RA(t)),RA=t=>(t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?wr(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?wr(parseInt(t.substring(6,8),16)/255,2):1}),FNe=t=>HNe(zNe(t)),$Ne=({h:t,s:e,v:n,a:i})=>{const r=(200-e)*n/100;return{h:wr(t),s:wr(r>0&&r<200?e*n/100/(r<=100?r:200-r)*100:0),l:wr(r/2),a:wr(i,2)}},MA=t=>{const{h:e,s:n,l:i}=$Ne(t);return`hsl(${e}, ${n}%, ${i}%)`},zNe=({h:t,s:e,v:n,a:i})=>{t=t/360*6,e=e/100,n=n/100;const r=Math.floor(t),o=n*(1-e),s=n*(1-(t-r)*e),a=n*(1-(1-t+r)*e),l=r%6;return{r:wr([n,s,o,o,a,n][l]*255),g:wr([a,n,n,s,o,o][l]*255),b:wr([o,o,a,n,n,s][l]*255),a:wr(i,2)}},uy=t=>{const e=t.toString(16);return e.length<2?"0"+e:e},HNe=({r:t,g:e,b:n,a:i})=>{const r=i<1?uy(wr(i*255)):"";return"#"+uy(t)+uy(e)+uy(n)+r},UNe=({r:t,g:e,b:n,a:i})=>{const r=Math.max(t,e,n),o=r-Math.min(t,e,n),s=o?r===t?(e-n)/o:r===e?2+(n-t)/o:4+(t-e)/o:0;return{h:wr(60*(s<0?s+6:s)),s:wr(r?o/r*100:0),v:wr(r/255*100),a:i}},pY=(t,e)=>{if(t===e)return!0;for(const n in t)if(t[n]!==e[n])return!1;return!0},WNe=(t,e)=>t.toLowerCase()===e.toLowerCase()?!0:pY(RA(t),RA(e)),vV={},vY=t=>{let e=vV[t];return e||(e=document.createElement("template"),e.innerHTML=t,vV[t]=e),e},lO=(t,e,n)=>{t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n}))};let pm=!1;const OA=t=>"touches"in t,qNe=t=>pm&&!OA(t)?!1:(pm||(pm=OA(t)),!0),bV=(t,e)=>{const n=OA(e)?e.touches[0]:e,i=t.el.getBoundingClientRect();lO(t.el,"move",t.getMove({x:ub((n.pageX-(i.left+window.pageXOffset))/i.width),y:ub((n.pageY-(i.top+window.pageYOffset))/i.height)}))},jNe=(t,e)=>{const n=e.keyCode;n>40||t.xy&&n<37||n<33||(e.preventDefault(),lO(t.el,"move",t.getMove({x:n===39?.01:n===37?-.01:n===34?.05:n===33?-.05:n===35?1:n===36?-1:0,y:n===40?.01:n===38?-.01:0},!0)))};class bY{constructor(e,n,i,r){const o=vY(`
`);e.appendChild(o.content.cloneNode(!0));const s=e.querySelector(`[part=${n}]`);s.addEventListener("mousedown",this),s.addEventListener("touchstart",this),s.addEventListener("keydown",this),this.el=s,this.xy=r,this.nodes=[s.firstChild,s]}set dragging(e){const n=e?document.addEventListener:document.removeEventListener;n(pm?"touchmove":"mousemove",this),n(pm?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!qNe(e)||!pm&&e.button!=0)return;this.el.focus(),bV(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),bV(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":jNe(this,e);break}}style(e){e.forEach((n,i)=>{for(const r in n)this.nodes[i].style.setProperty(r,n[r])})}}class KNe extends bY{constructor(e){super(e,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:e}){this.h=e,this.style([{left:`${e/360*100}%`,color:MA({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${wr(e)}`)}getMove(e,n){return{h:n?ub(this.h+e.x*360,0,360):360*e.x}}}class GNe extends bY{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:`${100-e.v}%`,left:`${e.s}%`,color:MA(e)},{"background-color":MA({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${wr(e.s)}%, Brightness ${wr(e.v)}%`)}getMove(e,n){return{s:n?ub(this.hsva.s+e.x*100,0,100):e.x*100,v:n?ub(this.hsva.v-e.y*100,0,100):Math.round(100-e.y*100)}}}const YNe=':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}',XNe="[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}",JNe="[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}",cy=Symbol("same"),zT=Symbol("color"),yV=Symbol("hsva"),HT=Symbol("update"),wV=Symbol("parts"),_V=Symbol("css"),CV=Symbol("sliders");class ZNe extends HTMLElement{static get observedAttributes(){return["color"]}get[_V](){return[YNe,XNe,JNe]}get[CV](){return[GNe,KNe]}get color(){return this[zT]}set color(e){if(!this[cy](e)){const n=this.colorModel.toHsva(e);this[HT](n),this[zT]=e}}constructor(){super();const e=vY(``),n=this.attachShadow({mode:"open"});n.appendChild(e.content.cloneNode(!0)),n.addEventListener("move",this),this[wV]=this[CV].map(i=>new i(n))}connectedCallback(){if(this.hasOwnProperty("color")){const e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,n,i){const r=this.colorModel.fromAttr(i);this[cy](r)||(this.color=r)}handleEvent(e){const n=this[yV],i={...n,...e.detail};this[HT](i);let r;!pY(i,n)&&!this[cy](r=this.colorModel.fromHsva(i))&&(this[zT]=r,lO(this,"color-changed",{value:r}))}[cy](e){return this.color&&this.colorModel.equal(e,this.color)}[HT](e){this[yV]=e,this[wV].forEach(n=>n.update(e))}}const QNe={defaultColor:"#000",toHsva:VNe,fromHsva:({h:t,s:e,v:n})=>FNe({h:t,s:e,v:n,a:1}),equal:WNe,fromAttr:t=>t};class e3e extends ZNe{get colorModel(){return QNe}}class qr extends Er{_parentElement;constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(n,i,r)=>{this._renderViewIntoCollectionParent(i,r)}),this.on("remove",(n,i)=>{i.element&&this._parentElement&&i.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(const n of this)this._renderViewIntoCollectionParent(n)}delegate(...e){if(!e.length||!t3e(e))throw new oe("ui-viewcollection-delegate-wrong-events",this);return{to:n=>{for(const i of this)for(const r of e)i.delegate(r).to(n);this.on("add",(i,r)=>{for(const o of e)r.delegate(o).to(n)}),this.on("remove",(i,r)=>{for(const o of e)r.stopDelegating(o,n)})}}}_renderViewIntoCollectionParent(e,n){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[n])}remove(e){return super.remove(e)}}function t3e(t){return t.every(e=>typeof e=="string")}const n3e="http://www.w3.org/1999/xhtml";class Io extends Fn(){ns;tag;text;attributes;children;eventListeners;_isRendered;_revertData;constructor(e){super(),Object.assign(this,kV(SV(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData=xV(),this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new oe("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){function*e(n){if(n.children)for(const i of n.children)g1(i)?yield i:uO(i)&&(yield*e(i))}yield*e(this)}static bind(e,n){return{to(i,r){return new i3e({eventNameOrFunction:i,attribute:i,observable:e,emitter:n,callback:r})},if(i,r,o){return new yY({observable:e,emitter:n,attribute:i,valueIfTrue:r,callback:o})}}}static extend(e,n){if(e._isRendered)throw new oe("template-extend-render",[this,e]);SY(e,kV(SV(n)))}_renderNode(e){let n;if(e.node?n=this.tag&&this.text:n=this.tag?this.text:!this.text,n)throw new oe("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let n=e.node;return n||(n=e.node=document.createElementNS(this.ns||n3e,this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),n}_renderText(e){let n=e.node;return n?e.revertData.text=n.textContent:n=e.node=document.createTextNode(""),Zw(this.text)?this._bindToObservable({schema:this.text,updater:o3e(n),data:e}):n.textContent=this.text.join(""),n}_renderAttributes(e){if(!this.attributes)return;const n=e.node,i=e.revertData;for(const r in this.attributes){const o=n.getAttribute(r),s=this.attributes[r];i&&(i.attributes[r]=o);const a=EV(s)?s[0].ns:null;if(Zw(s)){const l=EV(s)?s[0].value:s;i&&AV(r)&&l.unshift(o),this._bindToObservable({schema:l,updater:s3e(n,r,a),data:e})}else if(r=="style"&&typeof s[0]!="string")this._renderStyleAttribute(s[0],e);else{i&&o&&AV(r)&&s.unshift(o);const l=s.map(u=>u&&(u.value||u)).reduce((u,c)=>u.concat(c),[]).reduce(CY,"");Ym(l)||n.setAttributeNS(a,r,l)}}}_renderStyleAttribute(e,n){const i=n.node;for(const r in e){const o=e[r];Zw(o)?this._bindToObservable({schema:[o],updater:a3e(i,r),data:n}):LA(r)?i.style.setProperty(r,o):i.style[r]=o}}_renderElementChildren(e){const n=e.node,i=e.intoFragment?document.createDocumentFragment():n,r=e.isApplying;let o=0;for(const s of this.children)if(cO(s)){if(!r){s.setParent(n);for(const a of s)i.appendChild(a.element)}}else if(g1(s))r||(s.isRendered||s.render(),i.appendChild(s.element));else if(Mc(s))i.appendChild(s);else if(r){const a=e.revertData,l=xV();a.children.push(l),s._renderNode({intoFragment:!1,node:i.childNodes[o++],isApplying:!0,revertData:l})}else i.appendChild(s.render());e.intoFragment&&n.appendChild(i)}_setUpListeners(e){if(this.eventListeners)for(const n in this.eventListeners){const i=this.eventListeners[n].map(r=>{const[o,s]=n.split("@");return r.activateDomEventListener(o,s,e)});e.revertData&&e.revertData.bindings.push(i)}}_bindToObservable({schema:e,updater:n,data:i}){const r=i.revertData;wY(e,n,i);const o=e.filter(s=>!Ym(s)).filter(s=>s.observable).map(s=>s.activateAttributeListener(e,n,i));r&&r.bindings.push(o)}_revertTemplateFromNode(e,n){for(const r of n.bindings)for(const o of r)o();if(n.text){e.textContent=n.text;return}const i=e;for(const r in n.attributes){const o=n.attributes[r];o===null?i.removeAttribute(r):i.setAttribute(r,o)}for(let r=0;rwY(e,n,i);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,r),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,r)}}}class i3e extends c0{eventNameOrFunction;constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,n,i){const r=(o,s)=>{(!n||s.target.matches(n))&&(typeof this.eventNameOrFunction=="function"?this.eventNameOrFunction(s):this.observable.fire(this.eventNameOrFunction,s))};return this.emitter.listenTo(i.node,e,r),()=>{this.emitter.stopListening(i.node,e,r)}}}class yY extends c0{valueIfTrue;constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){const n=super.getValue(e);return Ym(n)?!1:this.valueIfTrue||!0}}function Zw(t){return t?(t.value&&(t=t.value),Array.isArray(t)?t.some(Zw):t instanceof c0):!1}function LA(t){return/^--[a-zA-Z_-][\w-]*$/.test(t)}function r3e(t,e){return t.map(n=>n instanceof c0?n.getValue(e):n)}function wY(t,e,{node:n}){const i=r3e(t,n);let r;t.length==1&&t[0]instanceof yY?r=i[0]:r=i.reduce(CY,""),Ym(r)?e.remove():e.set(r)}function o3e(t){return{set(e){t.textContent=e},remove(){t.textContent=""}}}function s3e(t,e,n){return{set(i){t.setAttributeNS(n,e,i)},remove(){t.removeAttributeNS(n,e)}}}function a3e(t,e){return{set(n){LA(e)?t.style.setProperty(e,n):t.style[e]=n},remove(){LA(e)?t.style.removeProperty(e):t.style[e]=null}}}function SV(t){return dS(t,n=>{if(n&&(n instanceof c0||uO(n)||g1(n)||cO(n)))return n})}function kV(t){if(typeof t=="string"?t=c3e(t):t.text&&d3e(t),t.on&&(t.eventListeners=u3e(t.on),delete t.on),!t.text){t.attributes&&l3e(t.attributes);const e=[];if(t.children)if(cO(t.children))e.push(t.children);else for(const n of t.children)uO(n)||g1(n)||Mc(n)?e.push(n):e.push(new Io(n));t.children=e}return t}function l3e(t){for(const e in t)t[e].value&&(t[e].value=li(t[e].value)),_Y(t,e)}function u3e(t){for(const e in t)_Y(t,e);return t}function c3e(t){return{text:[t]}}function d3e(t){t.text=li(t.text)}function _Y(t,e){t[e]=li(t[e])}function CY(t,e){return Ym(e)?t:Ym(t)?e:`${t} ${e}`}function TV(t,e){for(const n in e)t[n]?t[n].push(...e[n]):t[n]=e[n]}function SY(t,e){if(e.attributes&&(t.attributes||(t.attributes={}),TV(t.attributes,e.attributes)),e.eventListeners&&(t.eventListeners||(t.eventListeners={}),TV(t.eventListeners,e.eventListeners)),e.text&&t.text.push(...e.text),e.children&&e.children.length){if(t.children.length!=e.children.length)throw new oe("ui-template-extend-children-mismatch",t);let n=0;for(const i of e.children)SY(t.children[n++],i)}}function Ym(t){return!t&&t!==0}function g1(t){return t instanceof ut}function uO(t){return t instanceof Io}function cO(t){return t instanceof qr}function EV(t){return so(t[0])&&t[0].ns}function xV(){return{children:[],bindings:[],attributes:{}}}function AV(t){return t=="class"||t=="style"}class ut extends zo(Ln()){element;isRendered;locale;t;template;_viewCollections;_unboundChildren;_bindTemplate;constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new Er,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(n,i)=>{i.locale=e,i.t=e&&e.t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=Io.bind(this,this)}createCollection(e){const n=new qr(e);return this._viewCollections.add(n),n}registerChild(e){us(e)||(e=[e]);for(const n of e)this._unboundChildren.add(n)}deregisterChild(e){us(e)||(e=[e]);for(const n of e)this._unboundChildren.remove(n)}setTemplate(e){this.template=new Io(e)}extendTemplate(e){Io.extend(this.template,e)}render(){if(this.isRendered)throw new oe("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)}}const PV={POLITE:"polite",ASSERTIVE:"assertive"};class f3e{editor;view;constructor(e){this.editor=e,e.once("ready",()=>{for(const n of Object.values(PV))this.announce("",n)})}announce(e,n=PV.POLITE){const i=this.editor;if(!i.ui.view)return;this.view||(this.view=new h3e(i.locale),i.ui.view.body.add(this.view));const{politeness:r,isUnsafeHTML:o}=typeof n=="string"?{politeness:n}:n;let s=this.view.regionViews.find(a=>a.politeness===r);s||(s=new m3e(i,r),this.view.regionViews.add(s)),s.announce({announcement:e,isUnsafeHTML:o})}}class h3e extends ut{regionViews;constructor(e){super(e),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}}class m3e extends ut{politeness;_domConverter;_pruneAnnouncementsInterval;constructor(e,n){super(e.locale),this.setTemplate({tag:"div",attributes:{"aria-live":n,"aria-relevant":"additions"},children:[{tag:"ul",attributes:{class:["ck","ck-aria-live-region-list"]}}]}),e.on("destroy",()=>{this._pruneAnnouncementsInterval!==null&&(clearInterval(this._pruneAnnouncementsInterval),this._pruneAnnouncementsInterval=null)}),this.politeness=n,this._domConverter=e.data.htmlProcessor.domConverter,this._pruneAnnouncementsInterval=setInterval(()=>{this.element&&this._listElement.firstChild&&this._listElement.firstChild.remove()},5e3)}announce({announcement:e,isUnsafeHTML:n}){if(!e.trim().length)return;const i=document.createElement("li");n?this._domConverter.setContentOf(i,e):i.innerText=e,this._listElement.appendChild(i)}get _listElement(){return this.element.querySelector("ul")}}function Wf({emitter:t,activator:e,callback:n,contextElements:i,listenerOptions:r}){t.listenTo(document,"mousedown",(o,s)=>{if(!e())return;const a=typeof s.composedPath=="function"?s.composedPath():[],l=typeof i=="function"?i():i;for(const u of l)if(u.contains(s.target)||a.includes(u))return;n()},r)}function cb(t){class e extends t{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...i){super(...i),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.template&&this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}return e}function g3e(t){class e extends t{_onDragBound=this._onDrag.bind(this);_onDragEndBound=this._onDragEnd.bind(this);_lastDraggingCoordinates={x:0,y:0};constructor(...i){super(...i),this.on("render",()=>{this._attachListeners()}),this.set("isDragging",!1)}_attachListeners(){this.listenTo(this.element,"mousedown",this._onDragStart.bind(this)),this.listenTo(this.element,"touchstart",this._onDragStart.bind(this))}_attachDragListeners(){this.listenTo(Qe.document,"mouseup",this._onDragEndBound),this.listenTo(Qe.document,"touchend",this._onDragEndBound),this.listenTo(Qe.document,"mousemove",this._onDragBound),this.listenTo(Qe.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening(Qe.document,"mouseup",this._onDragEndBound),this.stopListening(Qe.document,"touchend",this._onDragEndBound),this.stopListening(Qe.document,"mousemove",this._onDragBound),this.stopListening(Qe.document,"touchmove",this._onDragBound)}_onDragStart(i,r){if(!this._isHandleElementPressed(r))return;this._attachDragListeners();let o=0,s=0;r instanceof MouseEvent?(o=r.clientX,s=r.clientY):(o=r.touches[0].clientX,s=r.touches[0].clientY),this._lastDraggingCoordinates={x:o,y:s},this.isDragging=!0}_onDrag(i,r){if(!this.isDragging){this._detachDragListeners();return}let o=0,s=0;r instanceof MouseEvent?(o=r.clientX,s=r.clientY):(o=r.touches[0].clientX,s=r.touches[0].clientY),r.preventDefault(),this.fire("drag",{deltaX:Math.round(o-this._lastDraggingCoordinates.x),deltaY:Math.round(s-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:o,y:s}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(i){return this.dragHandleElement?this.dragHandleElement===i.target||i.target instanceof HTMLElement&&this.dragHandleElement.contains(i.target):!1}}return e}function vg({view:t}){t.listenTo(t.element,"submit",(e,n)=>{n.preventDefault(),t.fire("submit")},{useCapture:!0})}function kY({keystrokeHandler:t,focusTracker:e,gridItems:n,numberOfColumns:i,uiLanguageDirection:r}){const o=typeof i=="number"?()=>i:i;t.set("arrowright",s((u,c)=>r==="rtl"?l(u,c.length):a(u,c.length))),t.set("arrowleft",s((u,c)=>r==="rtl"?a(u,c.length):l(u,c.length))),t.set("arrowup",s((u,c)=>{let d=u-o();return d<0&&(d=u+o()*Math.floor(c.length/o()),d>c.length-1&&(d-=o())),d})),t.set("arrowdown",s((u,c)=>{let d=u+o();return d>c.length-1&&(d=u%o()),d}));function s(u){return c=>{const d=n.find(m=>m.element===e.focusedElement),f=n.getIndex(d),h=u(f,n);n.get(h).focus(),c.stopPropagation(),c.preventDefault()}}function a(u,c){return u===c-1?0:u+1}function l(u,c){return u===0?c-1:u-1}}class mc extends ut{id;constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${Ur()}`;const n=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:n.to("for")},children:[{text:n.to("text")}]})}}class p3e extends ut{constructor(e,n){super(e);const i=e.t,r=new mc;r.text=i("Help Contents. To close this dialog press ESC."),this.setTemplate({tag:"div",attributes:{class:["ck","ck-accessibility-help-dialog__content"],"aria-labelledby":r.id,role:"document",tabindex:-1},children:[Ko(document,"p",{},i("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(n.values())),r]})}focus(){this.element.focus()}_createCategories(e){return e.map(n=>{const i=[Ko(document,"h3",{},n.label),...Array.from(n.groups.values()).map(r=>this._createGroup(r)).flat()];return n.description&&i.splice(1,0,Ko(document,"p",{},n.description)),Ko(document,"section",{},i)})}_createGroup(e){const n=e.keystrokes.sort((r,o)=>r.label.localeCompare(o.label)).map(r=>this._createGroupRow(r)).flat(),i=[Ko(document,"dl",{},n)];return e.label&&i.unshift(Ko(document,"h4",{},e.label)),i}_createGroupRow(e){const n=this.locale.t,i=Ko(document,"dt"),r=Ko(document,"dd"),o=b3e(e.keystroke),s=[];for(const a of o)s.push(a.map(v3e).join(""));return i.innerHTML=e.label,r.innerHTML=s.join(", ")+(e.mayRequireFn&&vt.isMac?` ${n("(may require Fn)")}`:""),[i,r]}}function v3e(t){return l1(t).split("+").map(e=>`${e}`).join("+")}function b3e(t){return typeof t=="string"?[[t]]:typeof t[0]=="string"?[t]:t}class Sa extends ut{static presentationalAttributeNames=["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"];constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.set("isVisible",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon",e.if("isVisible","ck-hidden",n=>!n),"ck-reset_all-excluded",e.if("isColorInherited","ck-icon_inherit-color")],viewBox:e.to("viewBox"),"aria-hidden":!0}})}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 n=new DOMParser().parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg");if(!n)throw new oe("ui-iconview-invalid-svg",this);const i=n.getAttribute("viewBox");i&&(this.viewBox=i);for(const{name:r,value:o}of Array.from(n.attributes))Sa.presentationalAttributeNames.includes(r)&&this.element.setAttribute(r,o);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;n.childNodes.length>0;)this.element.appendChild(n.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(e=>{e.style.fill=this.fillColor})}}class TY extends ut{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:e.to("style"),id:e.to("id")},children:[{text:e.to("text")}]})}}class wt extends ut{children;labelView;iconView;keystrokeView;_focusDelayed=null;constructor(e,n=new TY){super(e);const i=this.bindTemplate,r=Ur();this.set("_ariaPressed",!1),this.set("_ariaChecked",!1),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${r}`),this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("role",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._setupLabelView(n),this.iconView=new Sa,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.iconView.bind("content").to(this,"icon"),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));const o={tag:"button",attributes:{class:["ck","ck-button",i.to("class"),i.if("isEnabled","ck-disabled",s=>!s),i.if("isVisible","ck-hidden",s=>!s),i.to("isOn",s=>s?"ck-on":"ck-off"),i.if("withText","ck-button_with-text"),i.if("withKeystroke","ck-button_with-keystroke")],role:i.to("role"),type:i.to("type",s=>s||"button"),tabindex:i.to("tabindex"),"aria-checked":i.to("_ariaChecked"),"aria-pressed":i.to("_ariaPressed"),"aria-label":i.to("ariaLabel"),"aria-labelledby":i.to("ariaLabelledBy"),"aria-disabled":i.if("isEnabled",!0,s=>!s),"data-cke-tooltip-text":i.to("_tooltipString"),"data-cke-tooltip-position":i.to("tooltipPosition")},children:this.children,on:{click:i.to(s=>{this.isEnabled?this.fire("execute"):s.preventDefault()})}};this.bind("_ariaPressed").to(this,"isOn",this,"isToggleable",this,"role",(s,a,l)=>!a||IV(l)?!1:String(!!s)),this.bind("_ariaChecked").to(this,"isOn",this,"isToggleable",this,"role",(s,a,l)=>!a||!IV(l)?!1:String(!!s)),vt.isSafari&&(this._focusDelayed||(this._focusDelayed=zM(()=>this.focus(),0)),o.on.mousedown=i.to(()=>{this._focusDelayed()}),o.on.mouseup=i.to(()=>{this._focusDelayed.cancel()})),this.setTemplate(o)}render(){super.render(),this.icon&&this.children.add(this.iconView),this.on("change:icon",(e,n,i,r)=>{i&&!r?this.children.add(this.iconView,0):!i&&r&&this.children.remove(this.iconView)}),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_setupLabelView(e){return e.bind("text","style","id").to(this,"label","labelStyle","ariaLabelledBy"),e}_createKeystrokeView(){const e=new ut;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",n=>l1(n))}]}),e}_getTooltipString(e,n,i){return e?typeof e=="string"?e:(i&&(i=l1(i)),e instanceof Function?e(n,i):`${n}${i?` (${i})`:""}`):""}}function IV(t){switch(t){case"radio":case"checkbox":case"option":case"switch":case"menuitemcheckbox":case"menuitemradio":return!0;default:return!1}}class qf extends ut{children;iconView;constructor(e,n={}){super(e);const i=this.bindTemplate;this.set("label",n.label||""),this.set("class",n.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children}),n.icon&&(this.iconView=new Sa,this.iconView.content=n.icon,this.children.add(this.iconView));const r=new ut(e);r.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:i.to("label")}]}),this.children.add(r)}}class Ho extends Fn(){focusables;focusTracker;keystrokeHandler;actions;constructor(e){if(super(),this.focusables=e.focusables,this.focusTracker=e.focusTracker,this.keystrokeHandler=e.keystrokeHandler,this.actions=e.actions,e.actions&&e.keystrokeHandler)for(const n in e.actions){let i=e.actions[n];typeof i=="string"&&(i=[i]);for(const r of i)e.keystrokeHandler.set(r,(o,s)=>{this[n](),s()},e.keystrokeHandlerOptions)}this.on("forwardCycle",()=>this.focusFirst(),{priority:"low"}),this.on("backwardCycle",()=>this.focusLast(),{priority:"low"})}get first(){return this.focusables.find(UT)||null}get last(){return this.focusables.filter(UT).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let e=null;return this.focusTracker.focusedElement===null?null:(this.focusables.find((n,i)=>{const r=n.element===this.focusTracker.focusedElement;return r&&(e=i),r}),e)}focusFirst(){this._focus(this.first,1)}focusLast(){this._focus(this.last,-1)}focusNext(){const e=this.next;if(e&&this.focusables.getIndex(e)===this.current){this.fire("forwardCycle");return}e===this.first?this.fire("forwardCycle"):this._focus(e,1)}focusPrevious(){const e=this.previous;if(e&&this.focusables.getIndex(e)===this.current){this.fire("backwardCycle");return}e===this.last?this.fire("backwardCycle"):this._focus(e,-1)}chain(e){const n=()=>this.current===null?null:this.focusables.get(this.current);this.listenTo(e,"forwardCycle",i=>{const r=n();this.focusNext(),r!==n()&&i.stop()},{priority:"low"}),this.listenTo(e,"backwardCycle",i=>{const r=n();this.focusPrevious(),r!==n()&&i.stop()},{priority:"low"})}unchain(e){this.stopListening(e)}_focus(e,n){e&&this.focusTracker.focusedElement!==e.element&&e.focus(n)}_getDomFocusableItem(e){const n=this.focusables.length;if(!n)return null;const i=this.current;if(i===null)return this[e===1?"first":"last"];let r=this.focusables.get(i),o=(i+n+e)%n;do{const s=this.focusables.get(o);if(UT(s)){r=s;break}o=(o+n+e)%n}while(o!==i);return r}}function UT(t){return d0(t)&&vu(t.element)}function d0(t){return"focus"in t&&typeof t.focus=="function"}function y3e(t){return d0(t)&&"focusCycler"in t&&t.focusCycler instanceof Ho}class w3e extends ut{children;keystrokes;focusCycler;_focusTracker;_focusables;constructor(e){super(e),this.children=this.createCollection(),this.keystrokes=new Qi,this._focusTracker=new wi,this._focusables=new qr,this.focusCycler=new Ho({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__actions"]},children:this.children})}render(){super.render(),this.keystrokes.listenTo(this.element)}setButtons(e){for(const n of e){const i=new wt(this.locale);let r;i.on("execute",()=>n.onExecute()),n.onCreate&&n.onCreate(i);for(r in n)r!="onExecute"&&r!="onCreate"&&i.set(r,n[r]);this.children.add(i)}this._updateFocusCyclableItems()}focus(e){e===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach(e=>{this._focusables.add(e),this._focusTracker.add(e.element)})}}class _3e extends ut{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__content"]},children:this.children})}reset(){for(;this.children.length;)this.children.remove(0)}}const js={SCREEN_CENTER:"screen-center",EDITOR_CENTER:"editor-center",EDITOR_TOP_SIDE:"editor-top-side",EDITOR_TOP_CENTER:"editor-top-center",EDITOR_BOTTOM_CENTER:"editor-bottom-center",EDITOR_ABOVE_CENTER:"editor-above-center",EDITOR_BELOW_CENTER:"editor-below-center"},RV=gg("px");class db extends g3e(ut){parts;headerView;closeButtonView;actionsView;static defaultOffset=15;contentView;keystrokes;focusTracker;wasMoved=!1;_getCurrentDomRoot;_getViewportOffset;_focusables;_focusCycler;constructor(e,{getCurrentDomRoot:n,getViewportOffset:i,keystrokeHandlerOptions:r}){super(e);const o=this.bindTemplate,s=e.t;this.set("className",""),this.set("ariaLabel",s("Editor dialog")),this.set("isModal",!1),this.set("position",js.SCREEN_CENTER),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getCurrentDomRoot=n,this._getViewportOffset=i,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new Qi,this.focusTracker=new wi,this._focusables=new qr,this._focusCycler=new Ho({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"},keystrokeHandlerOptions:r}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog-overlay",o.if("isModal","ck-dialog-overlay__transparent",a=>!a),o.if("_isVisible","ck-hidden",a=>!a)],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",o.if("isModal","ck-dialog_modal"),o.to("className")],role:"dialog","aria-label":o.to("ariaLabel"),style:{top:o.to("_top",a=>RV(a)),left:o.to("_left",a=>RV(a)),visibility:o.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",(e,n)=>{e.defaultPrevented||(this.fire("close",{source:"escKeyPress"}),n())}),this.on("drag",(e,{deltaX:n,deltaY:i})=>{this.wasMoved=!0,this.moveBy(n,i)}),this.listenTo(Qe.window,"resize",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.listenTo(Qe.document,"scroll",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.on("change:_isVisible",(e,n,i)=>{i&&(this._isTransparent=!0,setTimeout(()=>{this.updatePosition(),this._isTransparent=!1,this.focus()},10))}),this.keystrokes.listenTo(this.element)}get dragHandleElement(){return this.headerView&&!this.isModal?this.headerView.element:null}setupParts({icon:e,title:n,hasCloseButton:i=!0,content:r,actionButtons:o}){n&&(this.headerView=new qf(this.locale,{icon:e}),i&&(this.closeButtonView=this._createCloseButton(),this.headerView.children.add(this.closeButtonView)),this.headerView.label=n,this.ariaLabel=n,this.parts.add(this.headerView,0)),r&&(r instanceof ut&&(r=[r]),this.contentView=new _3e(this.locale),this.contentView.children.addMany(r),this.parts.add(this.contentView)),o&&(this.actionsView=new w3e(this.locale),this.actionsView.setButtons(o),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}moveTo(e,n){const i=this._getViewportRect(),r=this._getDialogRect();e+r.width>i.right&&(e=i.right-r.width),e{this._focusables.add(n),this.focusTracker.add(n.element),y3e(n)&&this._focusCycler.chain(n.focusCycler)})}_createCloseButton(){const e=new wt(this.locale),n=this.locale.t;return e.set({label:n("Close"),tooltip:!0,icon:oO}),e.on("execute",()=>this.fire("close",{source:"closeButton"})),e}}let EY=class Vl extends xe{view;static _visibleDialogPlugin;_onHide;static get pluginName(){return"Dialog"}static get isOfficialPlugin(){return!0}constructor(e){super(e);const n=e.t;this._initShowHideListeners(),this._initFocusToggler(),this._initMultiRootIntegration(),this.set({id:null,isOpen:!1}),e.accessibility.addKeystrokeInfos({categoryId:"navigation",keystrokes:[{label:n("Move focus in and out of an active dialog window"),keystroke:"Ctrl+F6",mayRequireFn:!0}]})}destroy(){super.destroy(),Vl._visibleDialogPlugin===this&&this._unlockBodyScroll()}_initShowHideListeners(){this.on("show",(e,n)=>{this._show(n)}),this.on("show",(e,n)=>{n.onShow&&n.onShow(this)},{priority:"low"}),this.on("hide",()=>{Vl._visibleDialogPlugin&&Vl._visibleDialogPlugin._hide()}),this.on("hide",()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)},{priority:"low"})}_initFocusToggler(){const e=this.editor;e.keystrokes.set("Ctrl+F6",(n,i)=>{!this.isOpen||this.view.isModal||(this.view.focusTracker.isFocused?e.editing.view.focus():this.view.focus(),i())})}_initMultiRootIntegration(){const e=this.editor.model;e.document.on("change:data",()=>{if(!this.view)return;const n=e.document.differ.getChangedRoots();for(const i of n)i.state&&this.view.updatePosition()})}show(e){this.hide(),this.fire(`show:${e.id}`,e)}_show({id:e,icon:n,title:i,hasCloseButton:r=!0,content:o,actionButtons:s,className:a,isModal:l,position:u,onHide:c,keystrokeHandlerOptions:d}){const f=this.editor;this.view=new db(f.locale,{getCurrentDomRoot:()=>f.editing.view.getDomRoot(f.model.document.selection.anchor.root.rootName),getViewportOffset:()=>f.ui.viewportOffset,keystrokeHandlerOptions:d});const h=this.view;h.on("close",()=>{this.hide()}),f.ui.view.body.add(h),f.keystrokes.listenTo(h.element),u||(u=l?js.SCREEN_CENTER:js.EDITOR_CENTER),l&&this._lockBodyScroll(),h.set({position:u,_isVisible:!0,className:a,isModal:l}),h.setupParts({icon:n,title:i,hasCloseButton:r,content:o,actionButtons:s}),this.id=e,c&&(this._onHide=c),this.isOpen=!0,Vl._visibleDialogPlugin=this}hide(){Vl._visibleDialogPlugin&&Vl._visibleDialogPlugin.fire(`hide:${Vl._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;const e=this.editor,n=this.view;n.isModal&&this._unlockBodyScroll(),n.contentView&&n.contentView.reset(),e.ui.view.body.remove(n),e.ui.focusTracker.remove(n.element),e.keystrokes.stopListening(n.element),n.destroy(),e.editing.view.focus(),this.id=null,this.isOpen=!1,Vl._visibleDialogPlugin=null}_lockBodyScroll(){document.documentElement.classList.add("ck-dialog-scroll-locked")}_unlockBodyScroll(){document.documentElement.classList.remove("ck-dialog-scroll-locked")}};class bg extends wt{_checkIconHolderView=new C3e;constructor(e,n=new TY){super(e,n),this.set({hasCheckSpace:!1,_hasCheck:this.isToggleable});const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-list-item-button",i.if("isToggleable","ck-list-item-button_toggleable")]}}),this.bind("_hasCheck").to(this,"hasCheckSpace",this,"isToggleable",(r,o)=>r||o)}render(){super.render(),this._hasCheck&&this.children.add(this._checkIconHolderView,0),this._watchCheckIconHolderMount()}_watchCheckIconHolderMount(){this._checkIconHolderView.bind("isOn").to(this,"isOn",e=>this.isToggleable&&e),this.on("change:_hasCheck",(e,n,i)=>{const{children:r,_checkIconHolderView:o}=this;i?r.add(o,0):r.remove(o)})}}class C3e extends ut{children;_checkIconView=this._createCheckIconView();constructor(){super();const e=this.bindTemplate;this.children=this.createCollection(),this.set("isOn",!1),this.setTemplate({tag:"span",children:this.children,attributes:{class:["ck","ck-list-item-button__check-holder",e.to("isOn",n=>n?"ck-on":"ck-off")]}})}render(){super.render(),this.isOn&&this.children.add(this._checkIconView,0),this._watchCheckIconMount()}_watchCheckIconMount(){this.on("change:isOn",(e,n,i)=>{const{children:r,_checkIconView:o}=this;i&&!r.has(o)?r.add(o):!i&&r.has(o)&&r.remove(o)})}_createCheckIconView(){const e=new Sa;return e.content=sO,e.extendTemplate({attributes:{class:"ck-list-item-button__check-icon"}}),e}}class Wi extends bg{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}class S3e extends xe{contentView=null;static get requires(){return[EY]}static get pluginName(){return"AccessibilityHelp"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.locale.t;e.ui.componentFactory.add("accessibilityHelp",()=>{const i=this._createButton(wt);return i.set({tooltip:!0,withText:!1,label:n("Accessibility help")}),i}),e.ui.componentFactory.add("menuBar:accessibilityHelp",()=>{const i=this._createButton(Wi);return i.label=n("Accessibility"),i}),e.keystrokes.set("Alt+0",(i,r)=>{this._toggleDialog(),r()}),this._setupRootLabels()}_createButton(e){const n=this.editor,i=n.plugins.get("Dialog"),r=n.locale,o=new e(r);return o.set({keystroke:"Alt+0",icon:lV,isToggleable:!0}),o.on("execute",()=>this._toggleDialog()),o.bind("isOn").to(i,"id",s=>s==="accessibilityHelp"),o}_setupRootLabels(){const e=this.editor,n=e.editing.view,i=e.t;e.ui.on("ready",()=>{n.change(o=>{for(const s of n.document.roots)r(o,s)}),e.on("addRoot",(o,s)=>{const a=e.editing.view.document.getRoot(s.rootName);n.change(l=>r(l,a))},{priority:"low"})});function r(o,s){const l=[s.getAttribute("aria-label"),i("Press %0 for help.",[l1("Alt+0")])].filter(u=>u).join(". ");o.setAttribute("aria-label",l,s)}}_toggleDialog(){const e=this.editor,n=e.plugins.get("Dialog"),i=e.locale.t;this.contentView||(this.contentView=new p3e(e.locale,e.accessibility.keystrokeInfos)),n.id==="accessibilityHelp"?n.hide():n.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:i("Accessibility help"),icon:lV,hasCloseButton:!0,content:this.contentView})}}class Ks extends qr{locale;_bodyCollectionContainer;static _bodyWrapper;constructor(e,n=[]){super(n),this.locale=e}get bodyCollectionContainer(){return this._bodyCollectionContainer}attachToDom(){this._bodyCollectionContainer=new Io({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection,role:"application"},children:this}).render(),(!Ks._bodyWrapper||!Ks._bodyWrapper.isConnected)&&(Ks._bodyWrapper=Ko(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(Ks._bodyWrapper)),Ks._bodyWrapper.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove(),Ks._bodyWrapper&&!Ks._bodyWrapper.childElementCount&&(Ks._bodyWrapper.remove(),delete Ks._bodyWrapper)}}const MV=gg("px"),k3e={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}};class Ki extends ut{content;_pinWhenIsVisibleCallback;_resizeObserver;constructor(e){super(e);const n=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,this._resizeObserver=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",n.to("position",i=>`ck-balloon-panel_${i}`),n.if("isVisible","ck-balloon-panel_visible"),n.if("withArrow","ck-balloon-panel_with-arrow"),n.to("class")],style:{top:n.to("top",MV),left:n.to("left",MV)}},children:this.content})}destroy(){this.hide(),super.destroy()}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){const n=Qw(e.target);if(n&&!vu(n))return!1;this.show();const i=Ki.defaultPositions,r=Object.assign({},{element:this.element,positions:[i.southArrowNorth,i.southArrowNorthMiddleWest,i.southArrowNorthMiddleEast,i.southArrowNorthWest,i.southArrowNorthEast,i.northArrowSouth,i.northArrowSouthMiddleWest,i.northArrowSouthMiddleEast,i.northArrowSouthWest,i.northArrowSouthEast,i.viewportStickyNorth],limiter:Qe.document.body,fitInViewport:!0},e),o=Ki._getOptimalPosition(r)||k3e,s=parseInt(o.left),a=parseInt(o.top),l=o.name,u=o.config||{},{withArrow:c=!0}=u;return this.top=a,this.left=s,this.position=l,this.withArrow=c,!0}pin(e){this.unpin(),this._startPinning(e)&&(this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback))}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){if(!this.attachTo(e))return!1;let n=Qw(e.target);const i=e.limiter?Qw(e.limiter):Qe.document.body;if(this.listenTo(Qe.document,"scroll",(r,o)=>{const s=o.target,a=n&&s.contains(n),l=i&&s.contains(i);(a||l||!n||!i)&&this.attachTo(e)},{useCapture:!0}),this.listenTo(Qe.window,"resize",()=>{this.attachTo(e)}),!this._resizeObserver&&(n&&fi(n)&&(n=n.parentElement),n)){const r=()=>{vu(n)||this.unpin()};this._resizeObserver=new NM(n,r)}return!0}_stopPinning(){this.stopListening(Qe.document,"scroll"),this.stopListening(Qe.window,"resize"),this._resizeObserver&&(this._resizeObserver.destroy(),this._resizeObserver=null)}static generatePositions(e={}){const{sideOffset:n=Ki.arrowSideOffset,heightOffset:i=Ki.arrowHeightOffset,stickyVerticalOffset:r=Ki.stickyVerticalOffset,config:o}=e;return{northWestArrowSouthWest:(l,u)=>({top:s(l,u),left:l.left-n,name:"arrow_sw",...o&&{config:o}}),northWestArrowSouthMiddleWest:(l,u)=>({top:s(l,u),left:l.left-u.width*.25-n,name:"arrow_smw",...o&&{config:o}}),northWestArrowSouth:(l,u)=>({top:s(l,u),left:l.left-u.width/2,name:"arrow_s",...o&&{config:o}}),northWestArrowSouthMiddleEast:(l,u)=>({top:s(l,u),left:l.left-u.width*.75+n,name:"arrow_sme",...o&&{config:o}}),northWestArrowSouthEast:(l,u)=>({top:s(l,u),left:l.left-u.width+n,name:"arrow_se",...o&&{config:o}}),northArrowSouthWest:(l,u)=>({top:s(l,u),left:l.left+l.width/2-n,name:"arrow_sw",...o&&{config:o}}),northArrowSouthMiddleWest:(l,u)=>({top:s(l,u),left:l.left+l.width/2-u.width*.25-n,name:"arrow_smw",...o&&{config:o}}),northArrowSouth:(l,u)=>({top:s(l,u),left:l.left+l.width/2-u.width/2,name:"arrow_s",...o&&{config:o}}),northArrowSouthMiddleEast:(l,u)=>({top:s(l,u),left:l.left+l.width/2-u.width*.75+n,name:"arrow_sme",...o&&{config:o}}),northArrowSouthEast:(l,u)=>({top:s(l,u),left:l.left+l.width/2-u.width+n,name:"arrow_se",...o&&{config:o}}),northEastArrowSouthWest:(l,u)=>({top:s(l,u),left:l.right-n,name:"arrow_sw",...o&&{config:o}}),northEastArrowSouthMiddleWest:(l,u)=>({top:s(l,u),left:l.right-u.width*.25-n,name:"arrow_smw",...o&&{config:o}}),northEastArrowSouth:(l,u)=>({top:s(l,u),left:l.right-u.width/2,name:"arrow_s",...o&&{config:o}}),northEastArrowSouthMiddleEast:(l,u)=>({top:s(l,u),left:l.right-u.width*.75+n,name:"arrow_sme",...o&&{config:o}}),northEastArrowSouthEast:(l,u)=>({top:s(l,u),left:l.right-u.width+n,name:"arrow_se",...o&&{config:o}}),southWestArrowNorthWest:l=>({top:a(l),left:l.left-n,name:"arrow_nw",...o&&{config:o}}),southWestArrowNorthMiddleWest:(l,u)=>({top:a(l),left:l.left-u.width*.25-n,name:"arrow_nmw",...o&&{config:o}}),southWestArrowNorth:(l,u)=>({top:a(l),left:l.left-u.width/2,name:"arrow_n",...o&&{config:o}}),southWestArrowNorthMiddleEast:(l,u)=>({top:a(l),left:l.left-u.width*.75+n,name:"arrow_nme",...o&&{config:o}}),southWestArrowNorthEast:(l,u)=>({top:a(l),left:l.left-u.width+n,name:"arrow_ne",...o&&{config:o}}),southArrowNorthWest:l=>({top:a(l),left:l.left+l.width/2-n,name:"arrow_nw",...o&&{config:o}}),southArrowNorthMiddleWest:(l,u)=>({top:a(l),left:l.left+l.width/2-u.width*.25-n,name:"arrow_nmw",...o&&{config:o}}),southArrowNorth:(l,u)=>({top:a(l),left:l.left+l.width/2-u.width/2,name:"arrow_n",...o&&{config:o}}),southArrowNorthMiddleEast:(l,u)=>({top:a(l),left:l.left+l.width/2-u.width*.75+n,name:"arrow_nme",...o&&{config:o}}),southArrowNorthEast:(l,u)=>({top:a(l),left:l.left+l.width/2-u.width+n,name:"arrow_ne",...o&&{config:o}}),southEastArrowNorthWest:l=>({top:a(l),left:l.right-n,name:"arrow_nw",...o&&{config:o}}),southEastArrowNorthMiddleWest:(l,u)=>({top:a(l),left:l.right-u.width*.25-n,name:"arrow_nmw",...o&&{config:o}}),southEastArrowNorth:(l,u)=>({top:a(l),left:l.right-u.width/2,name:"arrow_n",...o&&{config:o}}),southEastArrowNorthMiddleEast:(l,u)=>({top:a(l),left:l.right-u.width*.75+n,name:"arrow_nme",...o&&{config:o}}),southEastArrowNorthEast:(l,u)=>({top:a(l),left:l.right-u.width+n,name:"arrow_ne",...o&&{config:o}}),westArrowEast:(l,u)=>({top:l.top+l.height/2-u.height/2,left:l.left-u.width-i,name:"arrow_e",...o&&{config:o}}),eastArrowWest:(l,u)=>({top:l.top+l.height/2-u.height/2,left:l.right+i,name:"arrow_w",...o&&{config:o}}),viewportStickyNorth:(l,u,c)=>{const d=new Wt(Qe.document.body).getIntersection(c.getVisible());if(!d)return null;const f=d.getVisible();return!l.getIntersection(f)||!(f.top-l.top-rthis._showBalloon(),50,{leading:!0});_lastFocusedEditableElement=null;_balloonClass;constructor(e,n={}){super(),this.editor=e,this._balloonClass=n.balloonClass,e.on("ready",()=>this._handleEditorReady())}destroy(){const e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){const e=this.editor;this._isEnabled()&&e.ui.view&&(e.ui.focusTracker.on("change:isFocused",(n,i,r)=>{this._updateLastFocusedEditableElement(),r?this._showBalloon():this._hideBalloon()}),e.ui.focusTracker.on("change:focusedElement",(n,i,r)=>{this._updateLastFocusedEditableElement(),r&&this._showBalloon()}),e.ui.on("update",()=>{this._showBalloonThrottled()}))}_getNormalizedConfig(){return{side:this.editor.locale.contentLanguageDirection==="ltr"?"right":"left",position:"border",verticalOffset:0,horizontalOffset:5}}_showBalloon(){const e=this._getBalloonAttachOptions();e&&(this._balloonView||(this._balloonView=this._createBalloonView()),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_createBalloonView(){const e=this.editor,n=new Ki,i=this._createBadgeContent();return n.content.add(i),this._balloonClass&&(n.class=this._balloonClass),e.ui.view.body.add(n),n}_getBalloonAttachOptions(){if(!this._lastFocusedEditableElement)return null;const e=this._getNormalizedConfig(),n=e.side==="right"?x3e(this._lastFocusedEditableElement,e):A3e(this._lastFocusedEditableElement,e);return{target:this._lastFocusedEditableElement,positions:[n]}}_updateLastFocusedEditableElement(){const e=this.editor,n=e.ui.focusTracker.isFocused,i=e.ui.focusTracker.focusedElement;if(!n||!i){this._lastFocusedEditableElement=null;return}const r=Array.from(e.ui.getEditableElementsNames()).map(o=>e.ui.getEditableElement(o));r.includes(i)?this._lastFocusedEditableElement=i:this._lastFocusedEditableElement=r[0]}}function x3e(t,e){return AY(t,e,(n,i)=>n.left+n.width-i.width-e.horizontalOffset)}function A3e(t,e){return AY(t,e,n=>n.left+e.horizontalOffset)}function AY(t,e,n){return(i,r)=>{const o=new Wt(t);if(o.widtho.preventDefault())}}]})}}class wS extends wt{toggleSwitchView;constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new ut;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}class OV extends PY(wt){}class M3e extends PY(bg){}function PY(t){class e extends t{_fileInputView;constructor(...i){super(...i),this._fileInputView=new O3e(this.locale),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",()=>{this._fileInputView.open()}),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}return e}class O3e extends ut{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);const n=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:n.to("acceptedType"),multiple:n.to("allowMultipleFiles")},on:{change:n.to(()=>{this.element?.files?.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}class L3e extends ut{buttonView;children;constructor(e,n){super(e);const i=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid",void 0),n&&this.children.addMany(n),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",i.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:i.if("isCollapsed","hidden"),"aria-labelledby":i.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}focus(){this.buttonView.focus()}_createButtonView(){const e=new wt(this.locale),n=e.bindTemplate;return e.set({withText:!0,icon:yS}),e.extendTemplate({attributes:{"aria-expanded":n.to("isOn",i=>String(i))}}),e.bind("label").to(this),e.bind("isOn").to(this,"isCollapsed",i=>!i),e.on("execute",()=>{this.isCollapsed=!this.isCollapsed}),e}}function DA(t,e){const n=t.t,i={Black:n("Black"),"Dim grey":n("Dim grey"),Grey:n("Grey"),"Light grey":n("Light grey"),White:n("White"),Red:n("Red"),Orange:n("Orange"),Yellow:n("Yellow"),"Light green":n("Light green"),Green:n("Green"),Aquamarine:n("Aquamarine"),Turquoise:n("Turquoise"),"Light blue":n("Light blue"),Blue:n("Blue"),Purple:n("Purple")};return e.map(r=>{const o=i[r.label];return o&&o!=r.label&&(r.label=o),r})}function NA(t){return t.map(D3e).filter(e=>!!e)}function D3e(t){return typeof t=="string"?{model:t,label:t,hasBorder:!1,view:{name:"span",styles:{color:t}}}:{model:t.color,label:t.label||t.color,hasBorder:t.hasBorder===void 0?!1:t.hasBorder,view:{name:"span",styles:{color:`${t.color}`}}}}class IY extends wt{constructor(e){super(e);const n=this.bindTemplate;this.set("color",void 0),this.set("hasBorder",!1),this.icon=HDe,this.extendTemplate({attributes:{style:{backgroundColor:n.to("color",i=>vt.isMediaForcedColors?null:i)},class:["ck","ck-color-grid__tile",n.if("hasBorder","ck-color-selector__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}class LV extends ut{columns;items;focusTracker;keystrokes;constructor(e,n){super(e);const i=n&&n.colorDefinitions?n.colorDefinitions:[];this.columns=n?.columns||5;const r={gridTemplateColumns:`repeat( ${this.columns}, 1fr)`};this.set("selectedColor",void 0),this.items=this.createCollection(),this.focusTracker=new wi,this.keystrokes=new Qi,this.items.on("add",(o,s)=>{s.isOn=s.color===this.selectedColor}),i.forEach(o=>{const s=new IY;s.set({color:o.color,label:o.label,tooltip:!0,hasBorder:o.options.hasBorder}),s.on("execute",()=>{this.fire("execute",{value:o.color,hasBorder:o.options.hasBorder,label:o.label})}),this.items.add(s)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:r}}),this.on("change:selectedColor",(o,s,a)=>{for(const l of this.items)l.isOn=l.color===a})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,n)=>{this.focusTracker.add(n.element)}),this.items.on("remove",(e,n)=>{this.focusTracker.remove(n.element)}),this.keystrokes.listenTo(this.element),kY({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:this.columns,uiLanguageDirection:this.locale?.uiLanguageDirection})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}}function RY(t,e){if(!t)return"";const n=MY(t);if(!n)return"";if(n.space===e)return t;if(!F3e(n))return"";const r=$d[n.space][e];if(!r)return"";const o=r(n.space==="hex"?n.hexValue:n.values);return V3e(o,e)}function N3e(t){if(!t)return"";const e=MY(t);return e?e.space==="hex"?e.hexValue:RY(t,"hex"):"#000"}function B3e(t,e){customElements.get(t)===void 0&&customElements.define(t,e)}function V3e(t,e){switch(e){case"hex":return`#${t}`;case"rgb":return`rgb(${t[0]}, ${t[1]}, ${t[2]})`;case"hsl":return`hsl(${t[0]}, ${t[1]}%, ${t[2]}%)`;case"hwb":return`hwb(${t[0]}, ${t[1]}, ${t[2]})`;case"lab":return`lab(${t[0]}% ${t[1]} ${t[2]})`;case"lch":return`lch(${t[0]}% ${t[1]} ${t[2]})`;default:return""}}function MY(t){if(t.startsWith("#")){const n=pV(t);return{space:"hex",values:n.values,hexValue:t,alpha:n.alpha}}const e=pV(t);return e.space?e:null}function F3e(t){return Object.keys($d).includes(t.space)}class Go extends ut{fieldView;labelView;statusView;fieldWrapperChildren;constructor(e,n){super(e);const i=`ck-labeled-field-view-${Ur()}`,r=`ck-labeled-field-view-status-${Ur()}`;this.fieldView=n(this,i,r),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(r),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",(s,a)=>s||a);const o=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",o.to("class"),o.if("isEnabled","ck-disabled",s=>!s),o.if("isEmpty","ck-labeled-field-view_empty"),o.if("isFocused","ck-labeled-field-view_focused"),o.if("placeholder","ck-labeled-field-view_placeholder"),o.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){const n=new mc(this.locale);return n.for=e,n.bind("text").to(this,"label"),n}_createStatusView(e){const n=new ut(this.locale),i=this.bindTemplate;return n.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",r=>!r)],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),n}focus(e){this.fieldView.focus(e)}}class $3e extends ut{focusTracker;constructor(e){super(e),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("tabIndex",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.set("ariaLabel",void 0),this.focusTracker=new wi,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const n=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",n.if("isFocused","ck-input_focused"),n.if("isEmpty","ck-input-text_empty"),n.if("hasError","ck-error")],id:n.to("id"),placeholder:n.to("placeholder"),tabindex:n.to("tabIndex"),readonly:n.to("isReadOnly"),"aria-invalid":n.if("hasError",!0),"aria-describedby":n.to("ariaDescribedById"),"aria-label":n.to("ariaLabel")},on:{input:n.to((...i)=>{this.fire("input",...i),this._updateIsEmpty()}),change:n.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(e,n,i)=>{this._setDomElementValue(i),this._updateIsEmpty()})}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}reset(){this.value=this.element.value="",this._updateIsEmpty()}_updateIsEmpty(){this.isEmpty=z3e(this.element)}_setDomElementValue(e){this.element.value=!e&&e!==0?"":e}}function z3e(t){return!t.value}class OY extends $3e{constructor(e){super(e),this.set("inputMode","text");const n=this.bindTemplate;this.extendTemplate({attributes:{inputmode:n.to("inputMode")}})}}class LY extends OY{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}class H3e extends OY{constructor(e,{min:n,max:i,step:r}={}){super(e);const o=this.bindTemplate;this.set("min",n),this.set("max",i),this.set("step",r),this.extendTemplate({attributes:{type:"number",class:["ck-input-number"],min:o.to("min"),max:o.to("max"),step:o.to("step")}})}}class U3e extends ut{children;constructor(e){super(e);const n=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",n.to("position",i=>`ck-dropdown__panel_${i}`),n.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:n.to(i=>{const r=i.target;r instanceof Element&&r.tagName.toLocaleLowerCase()==="input"||i.preventDefault()})}})}focus(){if(this.children.length){const e=this.children.first;typeof e.focus=="function"?e.focus():hn("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){const e=this.children.last;typeof e.focusLast=="function"?e.focusLast():e.focus()}}}class p1 extends ut{buttonView;panelView;focusTracker;keystrokes;listView;toolbarView;menuView;constructor(e,n,i){super(e);const r=this.bindTemplate;this.buttonView=n,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new Qi,this.focusTracker=new wi,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",r.to("class"),r.if("isEnabled","ck-disabled",o=>!o)],id:r.to("id"),"aria-describedby":r.to("ariaDescribedById")},children:[n,i]}),n.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":r.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.on("change:isOpen",(n,i,r)=>{if(r)if(this.panelPosition==="auto"){const o=p1._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=o?o.name:this._defaultPanelPositionName}else this.panelView.position=this.panelPosition}),this.keystrokes.listenTo(this.element);const e=(n,i)=>{this.isOpen&&(this.isOpen=!1,i())};this.keystrokes.set("arrowdown",(n,i)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,i())}),this.keystrokes.set("arrowright",(n,i)=>{this.isOpen&&i()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:e,north:n,southEast:i,southWest:r,northEast:o,northWest:s,southMiddleEast:a,southMiddleWest:l,northMiddleEast:u,northMiddleWest:c}=p1.defaultPanelPositions;return this.locale.uiLanguageDirection!=="rtl"?[i,r,a,l,e,o,s,u,c,n]:[r,i,l,a,e,s,o,c,u,n]}get _defaultPanelPositionName(){return this.locale.uiLanguageDirection==="rtl"?"sw":"se"}static defaultPanelPositions={south:(e,n)=>({top:e.bottom,left:e.left-(n.width-e.width)/2,name:"s"}),southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,n)=>({top:e.bottom,left:e.left-n.width+e.width,name:"sw"}),southMiddleEast:(e,n)=>({top:e.bottom,left:e.left-(n.width-e.width)/4,name:"sme"}),southMiddleWest:(e,n)=>({top:e.bottom,left:e.left-(n.width-e.width)*3/4,name:"smw"}),north:(e,n)=>({top:e.top-n.height,left:e.left-(n.width-e.width)/2,name:"n"}),northEast:(e,n)=>({top:e.top-n.height,left:e.left,name:"ne"}),northWest:(e,n)=>({top:e.top-n.height,left:e.left-n.width+e.width,name:"nw"}),northMiddleEast:(e,n)=>({top:e.top-n.height,left:e.left-(n.width-e.width)/4,name:"nme"}),northMiddleWest:(e,n)=>({top:e.top-n.height,left:e.left-(n.width-e.width)*3/4,name:"nmw"})};static _getOptimalPosition=BM}class DY extends wt{arrowView;constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",n=>String(n))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new Sa;return e.content=yS,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}class $s extends ut{children;constructor(e){super(e);const n=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",n.if("isVisible","ck-hidden",i=>!i)],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}}class dO extends ut{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}class e_ extends ut{labelView;items;children;constructor(e,n=new mc){super(e);const i=this.bindTemplate,r=new jf(e);this.set({label:"",isVisible:!0}),this.labelView=n,this.labelView.bind("text").to(this,"label"),this.children=this.createCollection(),this.children.addMany([this.labelView,r]),r.set({role:"group",ariaLabelledBy:n.id}),r.focusTracker.destroy(),r.keystrokes.destroy(),this.items=r.items,this.setTemplate({tag:"li",attributes:{role:"presentation",class:["ck","ck-list__group",i.if("isVisible","ck-hidden",o=>!o)]},children:this.children})}focus(){if(this.items){const e=this.items.find(n=>!(n instanceof dO));e&&e.focus()}}}class jf extends ut{focusables;items;focusTracker;keystrokes;_focusCycler;_listItemGroupToChangeListeners=new WeakMap;constructor(e){super(e);const n=this.bindTemplate;this.focusables=new qr,this.items=this.createCollection(),this.focusTracker=new wi,this.keystrokes=new Qi,this._focusCycler=new Ho({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",void 0),this.set("role",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],role:n.to("role"),"aria-label":n.to("ariaLabel"),"aria-labelledby":n.to("ariaLabelledBy")},children:this.items})}render(){super.render();for(const e of this.items)e instanceof e_?this._registerFocusableItemsGroup(e):e instanceof $s&&this._registerFocusableListItem(e);this.items.on("change",(e,n)=>{for(const i of n.removed)i instanceof e_?this._deregisterFocusableItemsGroup(i):i instanceof $s&&this._deregisterFocusableListItem(i);for(const i of Array.from(n.added).reverse())i instanceof e_?this._registerFocusableItemsGroup(i,n.index):this._registerFocusableListItem(i,n.index)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_registerFocusableListItem(e,n){this.focusTracker.add(e.element),this.focusables.add(e,n)}_deregisterFocusableListItem(e){this.focusTracker.remove(e.element),this.focusables.remove(e)}_getOnGroupItemsChangeCallback(e){return(n,i)=>{for(const r of i.removed)this._deregisterFocusableListItem(r);for(const r of Array.from(i.added).reverse())this._registerFocusableListItem(r,this.items.getIndex(e)+i.index)}}_registerFocusableItemsGroup(e,n){Array.from(e.items).forEach((r,o)=>{const s=typeof n<"u"?n+o:void 0;this._registerFocusableListItem(r,s)});const i=this._getOnGroupItemsChangeCallback(e);this._listItemGroupToChangeListeners.set(e,i),e.items.on("change",i)}_deregisterFocusableItemsGroup(e){for(const n of e.items)this._deregisterFocusableListItem(n);e.items.off("change",this._listItemGroupToChangeListeners.get(e)),this._listItemGroupToChangeListeners.delete(e)}}class NY extends ut{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class W3e extends ut{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function q3e(t){return t.bindTemplate.to(e=>{e.target===t.element&&e.preventDefault()})}function BY(t){if(Array.isArray(t))return{items:t,removeItems:[]};const e={items:[],removeItems:[]};return t?{...e,...t}:e}const j3e={alignLeft:rO,bold:lY,importExport:XDe,paragraph:lNe,plus:dNe,text:ENe,threeVerticalDots:aO,pilcrow:cNe,dragIndicator:WDe};class Xm extends ut{options;items;focusTracker;keystrokes;itemsView;children;focusables;_focusCycler;_behavior;constructor(e,n){super(e);const i=this.bindTemplate,r=this.t;this.options=n||{},this.set("ariaLabel",r("Editor toolbar")),this.set("maxWidth","auto"),this.set("role","toolbar"),this.set("isGrouping",!!this.options.shouldGroupWhenFull),this.items=this.createCollection(),this.focusTracker=new wi,this.keystrokes=new Qi,this.set("class",void 0),this.set("isCompact",!1),this.set("isVertical",!1),this.itemsView=new K3e(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const o=e.uiLanguageDirection==="rtl";this._focusCycler=new Ho({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[o?"arrowright":"arrowleft","arrowup"],focusNext:[o?"arrowleft":"arrowright","arrowdown"]}});const s=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact"),i.if("isGrouping","ck-toolbar_grouping"),i.if("isVertical","ck-toolbar_vertical")];this.options.shouldGroupWhenFull&&this.options.isFloating&&s.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:s,role:i.to("role"),"aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:q3e(this)}}),this._behavior=this.options.shouldGroupWhenFull?new NV(this):new DV(this)}render(){super.render(),this.focusTracker.add(this.element);for(const e of this.items)this.focusTracker.add(e);this.items.on("add",(e,n)=>{this.focusTracker.add(n)}),this.items.on("remove",(e,n)=>{this.focusTracker.remove(n)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,n,i){this.items.addMany(this._buildItemsFromConfig(e,n,i))}switchBehavior(e){this._behavior.type!==e&&(this._behavior.destroy(),this.itemsView.children.clear(),this.focusables.clear(),e==="dynamic"?(this._behavior=new NV(this),this._behavior.render(this),this._behavior.refreshItems()):(this._behavior=new DV(this),this._behavior.render(this)))}_buildItemsFromConfig(e,n,i){const r=BY(e),o=i||r.removeItems;return this._cleanItemsConfiguration(r.items,n,o).map(a=>so(a)?this._createNestedToolbarDropdown(a,n,o):a==="|"?new NY:a==="-"?new W3e:n.create(a)).filter(a=>!!a)}_cleanItemsConfiguration(e,n,i){const r=e.filter((o,s,a)=>o==="|"?!0:i.indexOf(o)!==-1?!1:o==="-"?this.options.shouldGroupWhenFull?(hn("toolbarview-line-break-ignored-when-grouping-items",a),!1):!0:!so(o)&&!n.has(o)?(hn("toolbarview-item-unavailable",{item:o}),!1):!0);return this._cleanSeparatorsAndLineBreaks(r)}_cleanSeparatorsAndLineBreaks(e){const n=s=>s!=="-"&&s!=="|",i=e.length,r=e.findIndex(n);if(r===-1)return[];const o=i-e.slice().reverse().findIndex(n);return e.slice(r,o).filter((s,a,l)=>n(s)?!0:!(a>0&&l[a-1]===s))}_createNestedToolbarDropdown(e,n,i){let{label:r,icon:o,items:s,tooltip:a=!0,withText:l=!1}=e;if(s=this._cleanItemsConfiguration(s,n,i),!s.length)return null;const u=this.locale,c=Ro(u);return r||hn("toolbarview-nested-toolbar-dropdown-missing-label",e),c.class="ck-toolbar__nested-toolbar-dropdown",c.buttonView.set({label:r,tooltip:a,withText:!!l}),o!==!1?c.buttonView.icon=j3e[o]||o||aO:c.buttonView.withText=!0,CS(c,()=>c.toolbarView._buildItemsFromConfig(s,n,i)),c}}class K3e extends ut{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class DV{type="static";constructor(e){e.isGrouping=!1,e.itemsView.children.bindTo(e.items).using(n=>n),e.focusables.bindTo(e.items).using(n=>d0(n)?n:null)}render(){}destroy(){}}class NV{type="dynamic";view;viewChildren;viewFocusables;viewItemsView;viewFocusTracker;viewLocale;ungroupedItems;groupedItems;groupedItemsDropdown;resizeObserver=null;cachedPadding=null;shouldUpdateGroupingOnNextResize=!1;viewElement;constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.view.isGrouping=!0,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),e.itemsView.children.bindTo(this.ungroupedItems).using(n=>n),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),e.children.on("change",this._updateFocusCyclableItems.bind(this)),e.items.on("change",(n,i)=>{const r=i.index,o=Array.from(i.added);for(const s of i.removed)r>=this.ungroupedItems.length?this.groupedItems.remove(s):this.ungroupedItems.remove(s);for(let s=r;sthis.ungroupedItems.length?this.groupedItems.add(a,s-this.ungroupedItems.length):this.ungroupedItems.add(a,s)}this._updateGrouping()})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.viewChildren.length>1&&(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last)),this.resizeObserver.destroy()}refreshItems(){const e=this.view;if(e.items.length){for(let n=0;nr.right-this.cachedPadding:i.left{(!e||e!==n.contentRect.width||this.shouldUpdateGroupingOnNextResize)&&(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=n.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new NY),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,n=e.t,i=Ro(e);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition=e.uiLanguageDirection==="ltr"?"sw":"se",CS(i,this.groupedItems),i.buttonView.set({label:n("Show more items"),tooltip:!0,tooltipPosition:e.uiLanguageDirection==="rtl"?"se":"sw",icon:aO}),i}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{d0(e)&&this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}class _S extends ut{children;actionView;arrowView;keystrokes;focusTracker;constructor(e,n){super(e);const i=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(n),this.arrowView=this._createArrowView(),this.keystrokes=new Qi,this.focusTracker=new wi,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",i.to("class"),i.if("isVisible","ck-hidden",r=>!r),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,n)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),n())}),this.keystrokes.set("arrowleft",(e,n)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),n())})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(e){const n=e||new wt;return e||n.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),n.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),n.delegate("execute").to(this),n}_createArrowView(){const e=new wt,n=e.bindTemplate;return e.icon=yS,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":n.to("isOn"),"aria-haspopup":!0,"aria-expanded":n.to("isOn",i=>String(i))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}}function Ro(t,e=DY){const n=typeof e=="function"?new e(t):e,i=new U3e(t),r=new p1(t,n,i);return n.bind("isEnabled").to(r),n instanceof _S?n.arrowView.bind("isOn").to(r,"isOpen"):n.bind("isOn").to(r,"isOpen"),G3e(r),r}function CS(t,e,n={}){t.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),t.isOpen?BV(t,e,n):t.once("change:isOpen",()=>BV(t,e,n),{priority:"highest"}),n.enableActiveItemFocusOnDropdownOpen&&fO(t,()=>t.toolbarView.items.find(i=>i.isOn))}function BV(t,e,n){const i=t.locale,r=i.t,o=t.toolbarView=new Xm(i),s=typeof e=="function"?e():e;o.ariaLabel=n.ariaLabel||r("Dropdown toolbar"),n.maxWidth&&(o.maxWidth=n.maxWidth),n.class&&(o.class=n.class),n.isCompact&&(o.isCompact=n.isCompact),n.isVertical&&(o.isVertical=!0),s instanceof qr?o.items.bindTo(s).using(a=>a):o.items.addMany(s),t.panelView.children.add(o),t.focusTracker.add(o),o.items.delegate("execute").to(t)}function f0(t,e,n={}){t.isOpen?VV(t,e,n):t.once("change:isOpen",()=>VV(t,e,n),{priority:"highest"}),fO(t,()=>t.listView.items.find(i=>i instanceof $s?i.children.first.isOn:!1))}function VV(t,e,n){const i=t.locale,r=t.listView=new jf(i),o=typeof e=="function"?e():e;r.ariaLabel=n.ariaLabel,r.role=n.role,FY(t,r.items,o,i),t.panelView.children.add(r),r.items.delegate("execute").to(t)}function fO(t,e){t.on("change:isOpen",()=>{if(!t.isOpen)return;const n=e();n&&(typeof n.focus=="function"?n.focus():hn("ui-dropdown-focus-child-on-open-child-missing-focus",{view:n}))},{priority:ou.low-10})}function G3e(t){Y3e(t),X3e(t),J3e(t),Z3e(t),Q3e(t),eBe(t)}function Y3e(t){Wf({emitter:t,activator:()=>t.isRendered&&t.isOpen,callback:()=>{t.isOpen=!1},contextElements:()=>[t.element,...VY(t.focusTracker).filter(e=>!t.element.contains(e))]})}function VY(t){return[...t.elements,...t.externalViews.flatMap(e=>VY(e.focusTracker))]}function X3e(t){t.on("execute",e=>{e.source instanceof wS||(t.isOpen=!1)})}function J3e(t){t.focusTracker.on("change:isFocused",(e,n,i)=>{i||!t.isOpen||(t.isOpen=!1)})}function Z3e(t){t.keystrokes.set("arrowdown",(e,n)=>{t.isOpen&&(t.panelView.focus(),n())}),t.keystrokes.set("arrowup",(e,n)=>{t.isOpen&&(t.panelView.focusLast(),n())})}function Q3e(t){t.on("change:isOpen",(e,n,i)=>{if(i)return;t.focusTracker.elements.some(o=>o.contains(Qe.document.activeElement))&&t.buttonView.focus()})}function eBe(t){t.on("change:isOpen",(e,n,i)=>{i&&t.panelView.focus()},{priority:"low"})}function FY(t,e,n,i){tBe(e),e.bindTo(n).using(r=>{if(r.type==="separator")return new dO(i);if(r.type==="group"){const o=new e_(i);return o.set({label:r.label}),FY(t,o.items,r.items,i),o.items.delegate("execute").to(t),o}else if(r.type==="button"||r.type==="switchbutton"){const o=r.model.role==="menuitemcheckbox"||r.model.role==="menuitemradio",s=new $s(i);let a;return r.type==="button"?(a=new bg(i,r.labelView),a.set({isToggleable:o})):a=new wS(i),a.bind(...Object.keys(r.model)).to(r.model),a.delegate("execute").to(s),s.children.add(a),s}return null})}function tBe(t){let e=0;const n=o=>!(o instanceof $s)||!(o.children.first instanceof bg)?null:o.children.first,i=o=>{const s=n(o);return!s||!s.isToggleable?null:s},r=o=>{for(const s of t){const a=n(s);a&&(a.hasCheckSpace=o)}};t.on("change",(o,s)=>{const a=e>0;for(const u of s.removed)i(u)&&e--;for(const u of s.added){const c=n(u);c&&(c.isToggleable&&e++,c.hasCheckSpace=e>0)}const l=e>0;a!==l&&r(l)})}const tu=(t,e,n)=>{const i=new LY(t.locale);return i.set({id:e,ariaDescribedById:n}),i.bind("isReadOnly").to(t,"isEnabled",r=>!r),i.bind("hasError").to(t,"errorText",r=>!!r),i.on("input",()=>{t.errorText=null}),t.bind("isEmpty","isFocused","placeholder").to(i),i},nBe=(t,e,n)=>{const i=new H3e(t.locale);return i.set({id:e,ariaDescribedById:n,inputMode:"numeric"}),i.bind("isReadOnly").to(t,"isEnabled",r=>!r),i.bind("hasError").to(t,"errorText",r=>!!r),i.on("input",()=>{t.errorText=null}),t.bind("isEmpty","isFocused","placeholder").to(i),i},iBe=(t,e,n)=>{const i=Ro(t.locale);return i.set({id:e,ariaDescribedById:n}),i.bind("isEnabled").to(t),i},rBe=150;class oBe extends ut{hexInputRow;_debounceColorPickerEvent;_config;constructor(e,n={}){super(e),this.set({color:"",_hexColor:""}),this.hexInputRow=this._createInputRow();const i=this.createCollection();n.hideInput||i.add(this.hexInputRow),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker"],tabindex:-1},children:i}),this._config=n,this._debounceColorPickerEvent=ml(r=>{this.set("color",r),this.fire("colorSelected",{color:this.color})},rBe,{leading:!0}),this.on("set:color",(r,o,s)=>{r.return=RY(s,this._config.format||"hsl")}),this.on("change:color",()=>{this._hexColor=WT(this.color)}),this.on("change:_hexColor",()=>{document.activeElement!==this.picker&&this.picker.setAttribute("color",this._hexColor),WT(this.color)!=WT(this._hexColor)&&(this.color=this._hexColor)})}render(){if(super.render(),B3e("hex-color-picker",e3e),this.picker=Qe.document.createElement("hex-color-picker"),this.picker.setAttribute("class","hex-color-picker"),this.picker.setAttribute("tabindex","-1"),this._createSlidersView(),this.element){this.hexInputRow.element?this.element.insertBefore(this.picker,this.hexInputRow.element):this.element.appendChild(this.picker);const e=document.createElement("style");e.textContent='[role="slider"]:focus [part$="pointer"] {border: 1px solid #fff;outline: 1px solid var(--ck-color-focus-border);box-shadow: 0 0 0 2px #fff;}',this.picker.shadowRoot.appendChild(e)}this.picker.addEventListener("color-changed",e=>{const n=e.detail.value;this._debounceColorPickerEvent(n)})}focus(){!this._config.hideInput&&(vt.isGecko||vt.isiOS||vt.isSafari||vt.isBlink)&&this.hexInputRow.children.get(1).focus(),this.slidersView.first.focus()}_createSlidersView(){const i=[...this.picker.shadowRoot.children].filter(r=>r.getAttribute("role")==="slider").map(r=>new sBe(r));this.slidersView=this.createCollection(),i.forEach(r=>{this.slidersView.add(r)})}_createInputRow(){const e=this._createColorInput();return new lBe(this.locale,e)}_createColorInput(){const e=new Go(this.locale,tu),{t:n}=this.locale;return e.set({label:n("HEX"),class:"color-picker-hex-input"}),e.fieldView.bind("value").to(this,"_hexColor",i=>e.isFocused?e.fieldView.value:i.startsWith("#")?i.substring(1):i),e.fieldView.on("input",()=>{const i=e.fieldView.element.value;if(i){const r=$Y(i);r&&this._debounceColorPickerEvent(r)}}),e}isValid(){const{t:e}=this.locale;return this._config.hideInput?!0:(this.resetValidationStatus(),this.hexInputRow.getParsedColor()?!0:(this.hexInputRow.inputView.errorText=e('Please enter a valid color (e.g. "ff0000").'),!1))}resetValidationStatus(){this.hexInputRow.inputView.errorText=null}}function WT(t){let e=N3e(t);return e||(e="#000"),e.length===4&&(e="#"+[e[1],e[1],e[2],e[2],e[3],e[3]].join("")),e.toLowerCase()}class sBe extends ut{constructor(e){super(),this.element=e}focus(){this.element.focus()}}class aBe extends ut{constructor(e){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__hash-view"]},children:"#"})}}class lBe extends ut{children;inputView;constructor(e,n){super(e),this.inputView=n,this.children=this.createCollection([new aBe,this.inputView]),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__row"]},children:this.children})}getParsedColor(){return $Y(this.inputView.fieldView.element.value)}}function $Y(t){if(!t)return null;const e=t.trim().replace(/^#/,"");return![3,4,6,8].includes(e.length)||!/^(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/.test(e)?null:`#${e}`}class uBe extends Ln(Er){constructor(e){super(e),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",this.length===0)})}add(e,n){return this.find(i=>i.color===e.color)?this:super.add(e,n)}hasColor(e){return!!this.find(n=>n.color===e)}}class cBe extends ut{items;colorDefinitions;focusTracker;columns;documentColors;documentColorsCount;staticColorsGrid;documentColorsGrid;colorPickerButtonView;removeColorButtonView;_focusables;_documentColorsLabel;_removeButtonLabel;_colorPickerLabel;constructor(e,{colors:n,columns:i,removeButtonLabel:r,documentColorsLabel:o,documentColorsCount:s,colorPickerLabel:a,focusTracker:l,focusables:u}){super(e);const c=this.bindTemplate;this.set("isVisible",!0),this.focusTracker=l,this.items=this.createCollection(),this.colorDefinitions=n,this.columns=i,this.documentColors=new uBe,this.documentColorsCount=s,this._focusables=u,this._removeButtonLabel=r,this._colorPickerLabel=a,this._documentColorsLabel=o,this.setTemplate({tag:"div",attributes:{class:["ck-color-grids-fragment",c.if("isVisible","ck-hidden",d=>!d)]},children:this.items}),this.removeColorButtonView=this._createRemoveColorButton(),this.items.add(this.removeColorButtonView)}updateDocumentColors(e,n){const i=e.document,r=this.documentColorsCount;this.documentColors.clear();for(const o of i.getRoots()){const s=e.createRangeIn(o);for(const a of s.getItems())if(a.is("$textProxy")&&a.hasAttribute(n)&&(this._addColorToDocumentColors(a.getAttribute(n)),this.documentColors.length>=r))return}}updateSelectedColors(){const e=this.documentColorsGrid,n=this.staticColorsGrid,i=this.selectedColor;n.selectedColor=i,e&&(e.selectedColor=i)}render(){if(super.render(),this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount){const e=Io.bind(this.documentColors,this.documentColors),n=new ut(this.locale);n.setTemplate({tag:"span",attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]},children:[{text:this._documentColorsLabel}]}),this.items.add(n),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}this._createColorPickerButton(),this._addColorSelectorElementsToFocusTracker()}focus(){this.removeColorButtonView.focus()}destroy(){super.destroy()}addColorPickerButton(){this.colorPickerButtonView&&(this.items.add(this.colorPickerButtonView),this.focusTracker.add(this.colorPickerButtonView.element),this._focusables.add(this.colorPickerButtonView))}_addColorSelectorElementsToFocusTracker(){this.focusTracker.add(this.removeColorButtonView.element),this._focusables.add(this.removeColorButtonView),this.staticColorsGrid&&(this.focusTracker.add(this.staticColorsGrid.element),this._focusables.add(this.staticColorsGrid)),this.documentColorsGrid&&(this.focusTracker.add(this.documentColorsGrid.element),this._focusables.add(this.documentColorsGrid))}_createColorPickerButton(){this.colorPickerButtonView=new wt,this.colorPickerButtonView.set({label:this._colorPickerLabel,withText:!0,icon:zDe,class:"ck-color-selector__color-picker"}),this.colorPickerButtonView.on("execute",()=>{this.fire("colorPicker:show")})}_createRemoveColorButton(){const e=new wt;return e.set({withText:!0,icon:qDe,label:this._removeButtonLabel}),e.class="ck-color-selector__remove-color",e.on("execute",()=>{this.fire("execute",{value:null,source:"removeColorButton"})}),e.render(),e}_createStaticColorsGrid(){const e=new LV(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.on("execute",(n,i)=>{this.fire("execute",{value:i.value,source:"staticColorsGrid"})}),e}_createDocumentColorsGrid(){const e=Io.bind(this.documentColors,this.documentColors),n=new LV(this.locale,{columns:this.columns});return n.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),n.items.bindTo(this.documentColors).using(i=>{const r=new IY;return r.set({color:i.color,hasBorder:i.options?.hasBorder}),i.label&&r.set({label:i.label,tooltip:!0}),r.on("execute",()=>{this.fire("execute",{value:i.color,source:"documentColorsGrid"})}),r}),this.documentColors.on("change:isEmpty",(i,r,o)=>{o&&(n.selectedColor=null)}),n}_addColorToDocumentColors(e){const n=this.colorDefinitions.find(i=>i.color===e);n?this.documentColors.add(Object.assign({},n)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}}class dBe extends ut{items;colorPickerView;saveButtonView;cancelButtonView;actionBarView;focusTracker;keystrokes;_focusables;_colorPickerViewConfig;constructor(e,{focusTracker:n,focusables:i,keystrokes:r,colorPickerViewConfig:o}){super(e),this.items=this.createCollection(),this.focusTracker=n,this.keystrokes=r,this.set("isVisible",!1),this.set("selectedColor",void 0),this._focusables=i,this._colorPickerViewConfig=o;const s=this.bindTemplate,{saveButtonView:a,cancelButtonView:l}=this._createActionButtons();this.saveButtonView=a,this.cancelButtonView=l,this.actionBarView=this._createActionBarView({saveButtonView:a,cancelButtonView:l}),this.setTemplate({tag:"div",attributes:{class:["ck-color-picker-fragment",s.if("isVisible","ck-hidden",u=>!u)]},children:this.items})}render(){super.render();const e=new oBe(this.locale,{...this._colorPickerViewConfig});this.colorPickerView=e,this.colorPickerView.render(),this.selectedColor&&(e.color=this.selectedColor),this.listenTo(this,"change:selectedColor",(n,i,r)=>{e.color=r}),this.items.add(this.colorPickerView),this.items.add(this.actionBarView),this._addColorPickersElementsToFocusTracker(),this._stopPropagationOnArrowsKeys(),this._executeOnEnterPress(),this._executeUponColorChange()}destroy(){super.destroy()}focus(){this.colorPickerView.focus()}resetValidationStatus(){this.colorPickerView.resetValidationStatus()}_executeOnEnterPress(){this.keystrokes.set("enter",e=>{this.isVisible&&this.focusTracker.focusedElement!==this.cancelButtonView.element&&this.colorPickerView.isValid()&&(this.fire("execute",{value:this.selectedColor}),e.stopPropagation(),e.preventDefault())})}_stopPropagationOnArrowsKeys(){const e=n=>n.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}_addColorPickersElementsToFocusTracker(){for(const n of this.colorPickerView.slidersView)this.focusTracker.add(n.element),this._focusables.add(n);const e=this.colorPickerView.hexInputRow.children.get(1);e.element&&(this.focusTracker.add(e.element),this._focusables.add(e)),this.focusTracker.add(this.saveButtonView.element),this._focusables.add(this.saveButtonView),this.focusTracker.add(this.cancelButtonView.element),this._focusables.add(this.cancelButtonView)}_createActionBarView({saveButtonView:e,cancelButtonView:n}){const i=new ut,r=this.createCollection();return r.add(e),r.add(n),i.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector_action-bar"]},children:r}),i}_createActionButtons(){const e=this.locale,n=e.t,i=new wt(e),r=new wt(e);return i.set({icon:sO,class:"ck-button-save",type:"button",withText:!1,label:n("Accept")}),r.set({icon:oO,class:"ck-button-cancel",type:"button",withText:!1,label:n("Cancel")}),i.on("execute",()=>{this.colorPickerView.isValid()&&this.fire("execute",{source:"colorPickerSaveButton",value:this.selectedColor})}),r.on("execute",()=>{this.fire("colorPicker:cancel")}),{saveButtonView:i,cancelButtonView:r}}_executeUponColorChange(){this.colorPickerView.on("colorSelected",(e,n)=>{this.fire("execute",{value:n.color,source:"colorPicker"}),this.set("selectedColor",n.color)})}}class hO extends ut{focusTracker;keystrokes;items;colorGridsFragmentView;colorPickerFragmentView;_focusCycler;_focusables;_colorPickerViewConfig;constructor(e,{colors:n,columns:i,removeButtonLabel:r,documentColorsLabel:o,documentColorsCount:s,colorPickerLabel:a,colorPickerViewConfig:l}){super(e),this.items=this.createCollection(),this.focusTracker=new wi,this.keystrokes=new Qi,this._focusables=new qr,this._colorPickerViewConfig=l,this._focusCycler=new Ho({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.colorGridsFragmentView=new cBe(e,{colors:n,columns:i,removeButtonLabel:r,documentColorsLabel:o,documentColorsCount:s,colorPickerLabel:a,focusTracker:this.focusTracker,focusables:this._focusables}),this.colorPickerFragmentView=new dBe(e,{focusables:this._focusables,focusTracker:this.focusTracker,keystrokes:this.keystrokes,colorPickerViewConfig:l}),this.set("_isColorGridsFragmentVisible",!0),this.set("_isColorPickerFragmentVisible",!1),this.set("selectedColor",void 0),this.colorGridsFragmentView.bind("isVisible").to(this,"_isColorGridsFragmentVisible"),this.colorPickerFragmentView.bind("isVisible").to(this,"_isColorPickerFragmentVisible"),this.on("change:selectedColor",(u,c,d)=>{this.colorGridsFragmentView.set("selectedColor",d),this.colorPickerFragmentView.set("selectedColor",d)}),this.colorGridsFragmentView.on("change:selectedColor",(u,c,d)=>{this.set("selectedColor",d)}),this.colorPickerFragmentView.on("change:selectedColor",(u,c,d)=>{this.set("selectedColor",d)}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector"]},children:this.items})}render(){super.render(),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}appendUI(){this._appendColorGridsFragment(),this._colorPickerViewConfig&&this._appendColorPickerFragment()}showColorPickerFragment(){!this.colorPickerFragmentView.colorPickerView||this._isColorPickerFragmentVisible||(this._isColorPickerFragmentVisible=!0,this.colorPickerFragmentView.focus(),this.colorPickerFragmentView.resetValidationStatus(),this._isColorGridsFragmentVisible=!1)}showColorGridsFragment(){this._isColorGridsFragmentVisible||(this._isColorGridsFragmentVisible=!0,this.colorGridsFragmentView.focus(),this._isColorPickerFragmentVisible=!1)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}updateDocumentColors(e,n){this.colorGridsFragmentView.updateDocumentColors(e,n)}updateSelectedColors(){this.colorGridsFragmentView.updateSelectedColors()}_appendColorGridsFragment(){this.items.length||(this.items.add(this.colorGridsFragmentView),this.colorGridsFragmentView.delegate("execute").to(this),this.colorGridsFragmentView.delegate("colorPicker:show").to(this))}_appendColorPickerFragment(){this.items.length!==2&&(this.items.add(this.colorPickerFragmentView),this.colorGridsFragmentView.colorPickerButtonView&&this.colorGridsFragmentView.colorPickerButtonView.on("execute",()=>{this.showColorPickerFragment()}),this.colorGridsFragmentView.addColorPickerButton(),this.colorPickerFragmentView.delegate("execute").to(this),this.colorPickerFragmentView.delegate("colorPicker:cancel").to(this))}}class fBe{editor;_components=new Map;constructor(e){this.editor=e}*names(){for(const e of this._components.values())yield e.originalName}add(e,n){this._components.set(qT(e),{callback:n,originalName:e})}create(e){if(!this.has(e))throw new oe("componentfactory-item-missing",this,{name:e});return this._components.get(qT(e)).callback(this.editor.locale)}has(e){return this._components.has(qT(e))}}function qT(t){return String(t).toLowerCase()}const FV="ck-tooltip";class Yr extends zo(){tooltipTextView;balloonPanelView;static defaultBalloonPositions=Ki.generatePositions({heightOffset:5,sideOffset:13});_currentElementWithTooltip=null;_currentTooltipPosition=null;_mutationObserver=null;_pinTooltipDebounced;_unpinTooltipDebounced;_watchdogExcluded;static _editors=new Set;static _instance=null;constructor(e){if(super(),Yr._editors.add(e),Yr._instance)return Yr._instance;Yr._instance=this,this.tooltipTextView=new ut(e.locale),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new Ki(e.locale),this.balloonPanelView.class=FV,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=hBe(()=>{this._updateTooltipPosition()}),this._pinTooltipDebounced=ml(this._pinTooltip,600),this._unpinTooltipDebounced=ml(this._unpinTooltip,400),this.listenTo(Qe.document,"keydown",this._onKeyDown.bind(this),{useCapture:!0}),this.listenTo(Qe.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(Qe.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(Qe.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(Qe.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(Qe.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(e){const n=e.ui.view&&e.ui.view.body;Yr._editors.delete(e),this.stopListening(e.ui),n&&n.has(this.balloonPanelView)&&n.remove(this.balloonPanelView),Yr._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),Yr._instance=null)}static getPositioningFunctions(e){const n=Yr.defaultBalloonPositions;return{s:[n.southArrowNorth,n.southArrowNorthEast,n.southArrowNorthWest],n:[n.northArrowSouth],e:[n.eastArrowWest],w:[n.westArrowEast],sw:[n.southArrowNorthEast],se:[n.southArrowNorthWest]}[e]}_onKeyDown(e,n){n.key==="Escape"&&this._currentElementWithTooltip&&(this._unpinTooltip(),n.stopPropagation())}_onEnterOrFocus(e,{target:n}){const i=jT(n);if(!i){e.name==="focus"&&this._unpinTooltip();return}if(i===this._currentElementWithTooltip){this._unpinTooltipDebounced.cancel();return}this._unpinTooltip(),e.name==="focus"&&!i.matches(":hover")||i.matches("[data-cke-tooltip-instant]")?this._pinTooltip(i,KT(i)):this._pinTooltipDebounced(i,KT(i))}_onLeaveOrBlur(e,{target:n,relatedTarget:i}){if(e.name==="mouseleave"){if(!Rc(n))return;const r=this.balloonPanelView.element,o=r&&(r===i||r.contains(i)),s=!o&&n===r;if(o){this._unpinTooltipDebounced.cancel();return}if(!s&&this._currentElementWithTooltip&&n!==this._currentElementWithTooltip)return;const a=jT(n),l=jT(i);(s||a&&a!==l)&&(this._pinTooltipDebounced.cancel(),this._currentElementWithTooltip&&this._currentElementWithTooltip.matches("[data-cke-tooltip-instant]")||a&&a.matches("[data-cke-tooltip-instant]")?this._unpinTooltip():this._unpinTooltipDebounced())}else{if(this._currentElementWithTooltip&&n!==this._currentElementWithTooltip)return;this._pinTooltipDebounced.cancel(),this._unpinTooltipDebounced()}}_onScroll(e,{target:n}){this._currentElementWithTooltip&&(n.contains(this.balloonPanelView.element)&&n.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(e,{text:n,position:i,cssClass:r}){this._unpinTooltip();const o=Mi(Yr._editors.values()).ui.view.body;o.has(this.balloonPanelView)||o.add(this.balloonPanelView),this.tooltipTextView.text=n,this.balloonPanelView.class=[FV,r].filter(s=>s).join(" "),this.balloonPanelView.pin({target:e,positions:Yr.getPositioningFunctions(i)}),this._mutationObserver.attach(e);for(const s of Yr._editors)this.listenTo(s.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=e,this._currentTooltipPosition=i}_unpinTooltip(){this._unpinTooltipDebounced.cancel(),this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const e of Yr._editors)this.stopListening(e.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this.tooltipTextView.text="",this._mutationObserver.detach()}_updateTooltipPosition(){if(!this._currentElementWithTooltip)return;const e=KT(this._currentElementWithTooltip);if(!vu(this._currentElementWithTooltip)||!e.text){this._unpinTooltip();return}this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:Yr.getPositioningFunctions(e.position)})}}function jT(t){return Rc(t)?t.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function KT(t){return{text:t.dataset.ckeTooltipText,position:t.dataset.ckeTooltipPosition||"s",cssClass:t.dataset.ckeTooltipClass||""}}function hBe(t){const e=new MutationObserver(()=>{t()});return{attach(n){e.observe(n,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){e.disconnect()}}}class mBe extends xY{licenseTypeMessage={evaluation:"For evaluation purposes only",trial:"For evaluation purposes only",development:"For development purposes only"};constructor(e){super(e,{balloonClass:"ck-evaluation-badge-balloon"})}_isEnabled(){const n=this.editor.config.get("licenseKey"),i=$V(n);return!!(i&&this.licenseTypeMessage[i])}_createBadgeContent(){const e=this.editor.config.get("licenseKey"),n=$V(e);return new gBe(this.editor.locale,this.licenseTypeMessage[n])}_getNormalizedConfig(){const e=super._getNormalizedConfig(),n=this.editor.config.get("ui.poweredBy")||{},i=n.position||e.position,r=n.side||e.side;return{position:i,side:r==="left"?"right":"left",verticalOffset:e.verticalOffset,horizontalOffset:e.horizontalOffset}}}class gBe extends ut{constructor(e,n){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-evaluation-badge"],"aria-hidden":!0},children:[{tag:"span",attributes:{class:["ck","ck-evaluation-badge__label"]},children:[n]}]})}}function $V(t){if(t=="GPL")return"GPL";const e=HM(t.split(".")[1]);return e?e.licenseType||"production":null}class yg extends $s{constructor(e,n){super(e);const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item"]},on:{mouseenter:i.to("mouseenter")}}),this.delegate("mouseenter").to(n)}}const dy=5,uh={toggleMenusAndFocusItemsOnHover(t){t.on("menu:mouseenter",e=>{if(!(!t.isFocusBorderEnabled&&!t.isOpen)){if(t.isOpen)for(const n of t.menus){const i=e.path[0],r=i instanceof yg&&i.children.first===n;n.isOpen=(e.path.includes(n)||r)&&n.isEnabled}e.source.focus()}})},focusCycleMenusOnArrows(t){const e=t.locale.uiLanguageDirection==="rtl";t.on("menu:arrowright",i=>{n(i.source,e?-1:1)}),t.on("menu:arrowleft",i=>{n(i.source,e?1:-1)});function n(i,r){const o=t.children.getIndex(i),s=i.isOpen,a=t.children.length,l=t.children.get((o+a+r)%a);i.isOpen=!1,s&&(l.isOpen=!0),l.buttonView.focus()}},closeMenusWhenTheBarCloses(t){t.on("change:isOpen",()=>{t.isOpen||t.menus.forEach(e=>{e.isOpen=!1})})},closeMenuWhenAnotherOnTheSameLevelOpens(t){t.on("menu:change:isOpen",(e,n,i)=>{i&&t.menus.filter(r=>e.source.parentMenuView===r.parentMenuView&&e.source!==r&&r.isOpen).forEach(r=>{r.isOpen=!1})})},closeOnClickOutside(t){Wf({emitter:t,activator:()=>t.isOpen,callback:()=>t.close(),contextElements:()=>t.children.map(e=>e.element)})},enableFocusHighlightOnInteraction(t){let e=!1;t.on("change:isOpen",(n,i,r)=>{r||(e||(t.isFocusBorderEnabled=!1),e=!1)}),t.listenTo(t.element,"keydown",()=>{e=!0},{useCapture:!0}),t.listenTo(t.element,"keyup",()=>{e=!1},{useCapture:!0}),t.listenTo(t.element,"focus",()=>{e&&(t.isFocusBorderEnabled=!0)},{useCapture:!0})}},Du={openAndFocusPanelOnArrowDownKey(t){t.keystrokes.set("arrowdown",(e,n)=>{t.isEnabled&&t.focusTracker.focusedElement===t.buttonView.element&&(t.isOpen||(t.isOpen=!0),t.panelView.focus(),n())})},openOnArrowRightKey(t){const e=t.locale.uiLanguageDirection==="rtl"?"arrowleft":"arrowright";t.keystrokes.set(e,(n,i)=>{t.focusTracker.focusedElement!==t.buttonView.element||!t.isEnabled||(t.isOpen||(t.isOpen=!0),t.panelView.focus(),i())})},openOnButtonClick(t){t.buttonView.on("execute",()=>{t.isOpen=!0})},toggleOnButtonClick(t){t.buttonView.on("execute",()=>{t.isOpen=!t.isOpen})},openAndFocusOnEnterKeyPress(t){t.keystrokes.set("enter",(e,n)=>{t.focusTracker.focusedElement===t.buttonView.element&&(t.isOpen=!0,t.panelView.focus(),n())})},closeOnArrowLeftKey(t){const e=t.locale.uiLanguageDirection==="rtl"?"arrowright":"arrowleft";t.keystrokes.set(e,(n,i)=>{t.isOpen&&(t.isOpen=!1,t.focus(),i())})},closeOnEscKey(t){t.keystrokes.set("esc",(e,n)=>{t.isOpen&&(t.isOpen=!1,t.focus(),n())})},closeOnParentClose(t){t.parentMenuView.on("change:isOpen",(e,n,i)=>{!i&&e.source===t.parentMenuView&&(t.isOpen=!1)})}},pBe={southEast:t=>({top:t.bottom,left:t.left,name:"se"}),southWest:(t,e)=>({top:t.bottom,left:t.left-e.width+t.width,name:"sw"}),northEast:(t,e)=>({top:t.top-e.height,left:t.left,name:"ne"}),northWest:(t,e)=>({top:t.top-e.height,left:t.left-e.width+t.width,name:"nw"}),eastSouth:t=>({top:t.top,left:t.right-dy,name:"es"}),eastNorth:(t,e)=>({top:t.top-e.height,left:t.right-dy,name:"en"}),westSouth:(t,e)=>({top:t.top,left:t.left-e.width+dy,name:"ws"}),westNorth:(t,e)=>({top:t.top-e.height,left:t.left-e.width+dy,name:"wn"})},vBe=[{menuId:"file",label:"File",groups:[{groupId:"export",items:["menuBar:exportPdf","menuBar:exportWord"]},{groupId:"import",items:["menuBar:importWord"]},{groupId:"revisionHistory",items:["menuBar:revisionHistory"]}]},{menuId:"edit",label:"Edit",groups:[{groupId:"undo",items:["menuBar:undo","menuBar:redo"]},{groupId:"selectAll",items:["menuBar:selectAll"]},{groupId:"findAndReplace",items:["menuBar:findAndReplace"]}]},{menuId:"view",label:"View",groups:[{groupId:"sourceEditingEnhanced",items:["menuBar:sourceEditingEnhanced"]},{groupId:"sourceEditing",items:["menuBar:sourceEditing"]},{groupId:"showBlocks",items:["menuBar:showBlocks"]},{groupId:"previewMergeFields",items:["menuBar:previewMergeFields"]},{groupId:"fullscreen",items:["menuBar:fullscreen"]},{groupId:"restrictedEditing",items:["menuBar:restrictedEditing"]}]},{menuId:"insert",label:"Insert",groups:[{groupId:"insertMainWidgets",items:["menuBar:insertImage","menuBar:ckbox","menuBar:ckfinder","menuBar:insertTable","menuBar:insertTableLayout"]},{groupId:"insertInline",items:["menuBar:link","menuBar:insertFootnote","menuBar:bookmark","menuBar:comment","menuBar:insertMergeField","menuBar:emoji"]},{groupId:"insertMinorWidgets",items:["menuBar:mediaEmbed","menuBar:insertTemplate","menuBar:specialCharacters","menuBar:blockQuote","menuBar:codeBlock","menuBar:htmlEmbed"]},{groupId:"insertStructureWidgets",items:["menuBar:horizontalLine","menuBar:pageBreak","menuBar:tableOfContents"]},{groupId:"restrictedEditingException",items:["menuBar:restrictedEditingException:inline","menuBar:restrictedEditingException:block"]}]},{menuId:"format",label:"Format",groups:[{groupId:"textAndFont",items:[{menuId:"text",label:"Text",groups:[{groupId:"basicStyles",items:["menuBar:bold","menuBar:italic","menuBar:underline","menuBar:strikethrough","menuBar:superscript","menuBar:subscript","menuBar:code"]},{groupId:"textPartLanguage",items:["menuBar:textPartLanguage"]}]},{menuId:"font",label:"Font",groups:[{groupId:"fontProperties",items:["menuBar:fontSize","menuBar:fontFamily"]},{groupId:"fontColors",items:["menuBar:fontColor","menuBar:fontBackgroundColor"]},{groupId:"highlight",items:["menuBar:highlight"]}]},"menuBar:heading"]},{groupId:"list",items:["menuBar:bulletedList","menuBar:numberedList","menuBar:multiLevelList","menuBar:todoList"]},{groupId:"indent",items:["menuBar:alignment","menuBar:lineHeight","menuBar:indent","menuBar:outdent"]},{groupId:"caseChange",items:["menuBar:caseChange"]},{groupId:"removeFormat",items:["menuBar:removeFormat"]}]},{menuId:"tools",label:"Tools",groups:[{groupId:"aiTools",items:["menuBar:aiAssistant","menuBar:aiCommands","menuBar:toggleAi","menuBar:aiQuickActions"]},{groupId:"tools",items:["menuBar:trackChanges","menuBar:commentsArchive"]}]},{menuId:"help",label:"Help",groups:[{groupId:"help",items:["menuBar:accessibilityHelp"]}]}];function bBe(t){let e;return!("items"in t)||!t.items?e={items:Bo(vBe),addItems:[],removeItems:[],isVisible:!0,isUsingDefaultConfig:!0,...t}:e={items:t.items,removeItems:[],addItems:[],isVisible:!0,isUsingDefaultConfig:!1,...t},e}function yBe({normalizedConfig:t,locale:e,componentFactory:n,extraItems:i}){const r=Bo(t);return zV(t,r,i),wBe(t,r),zV(t,r,r.addItems),_Be(t,r,n),zY(t,r),CBe(r,e),r}function wBe(t,e){const n=e.removeItems,i=[];e.items=e.items.filter(({menuId:r})=>n.includes(r)?(i.push(r),!1):!0),wg(e.items,r=>{r.groups=r.groups.filter(({groupId:o})=>n.includes(o)?(i.push(o),!1):!0);for(const o of r.groups)o.items=o.items.filter(s=>{const a=HY(s);return n.includes(a)?(i.push(a),!1):!0})});for(const r of n)i.includes(r)||hn("menu-bar-item-could-not-be-removed",{menuBarConfig:t,itemName:r})}function zV(t,e,n){const i=[];if(n.length!=0){for(const r of n){const o=TBe(r.position),s=EBe(r.position);if(SBe(r))if(!s)o==="start"?(e.items.unshift(r.menu),i.push(r)):o==="end"&&(e.items.push(r.menu),i.push(r));else{const a=e.items.findIndex(l=>l.menuId===s);a!=-1?o==="before"?(e.items.splice(a,0,r.menu),i.push(r)):o==="after"&&(e.items.splice(a+1,0,r.menu),i.push(r)):HV(e,r.menu,s,o)&&i.push(r)}else kBe(r)?wg(e.items,a=>{if(a.menuId===s)o==="start"?(a.groups.unshift(r.group),i.push(r)):o==="end"&&(a.groups.push(r.group),i.push(r));else{const l=a.groups.findIndex(u=>u.groupId===s);l!==-1&&(o==="before"?(a.groups.splice(l,0,r.group),i.push(r)):o==="after"&&(a.groups.splice(l+1,0,r.group),i.push(r)))}}):HV(e,r.item,s,o)&&i.push(r)}for(const r of n)i.includes(r)||hn("menu-bar-item-could-not-be-added",{menuBarConfig:t,addedItemConfig:r})}}function HV(t,e,n,i){let r=!1;return wg(t.items,o=>{for(const{groupId:s,items:a}of o.groups){if(r)return;if(s===n)i==="start"?(a.unshift(e),r=!0):i==="end"&&(a.push(e),r=!0);else{const l=a.findIndex(u=>HY(u)===n);l!==-1&&(i==="before"?(a.splice(l,0,e),r=!0):i==="after"&&(a.splice(l+1,0,e),r=!0))}}}),r}function _Be(t,e,n){wg(e.items,i=>{for(const r of i.groups)r.items=r.items.filter(o=>{const s=typeof o=="string"&&!n.has(o);return s&&!e.isUsingDefaultConfig&&hn("menu-bar-item-unavailable",{menuBarConfig:t,parentMenuConfig:Bo(i),componentName:o}),!s})})}function zY(t,e){const n=e.isUsingDefaultConfig;let i=!1;if(e.items=e.items.filter(r=>r.groups.length?!0:(GT(t,r,n),!1)),!e.items.length){GT(t,t,n);return}wg(e.items,r=>{r.groups=r.groups.filter(o=>o.items.length?!0:(i=!0,!1));for(const o of r.groups)o.items=o.items.filter(s=>UY(s)&&!s.groups.length?(GT(t,s,n),i=!0,!1):!0)}),i&&zY(t,e)}function GT(t,e,n){n||hn("menu-bar-menu-empty",{menuBarConfig:t,emptyMenuConfig:e})}function CBe(t,e){const n=e.t,i={File:n({string:"File",id:"MENU_BAR_MENU_FILE"}),Edit:n({string:"Edit",id:"MENU_BAR_MENU_EDIT"}),View:n({string:"View",id:"MENU_BAR_MENU_VIEW"}),Insert:n({string:"Insert",id:"MENU_BAR_MENU_INSERT"}),Format:n({string:"Format",id:"MENU_BAR_MENU_FORMAT"}),Tools:n({string:"Tools",id:"MENU_BAR_MENU_TOOLS"}),Help:n({string:"Help",id:"MENU_BAR_MENU_HELP"}),Text:n({string:"Text",id:"MENU_BAR_MENU_TEXT"}),Font:n({string:"Font",id:"MENU_BAR_MENU_FONT"})};wg(t.items,r=>{r.label in i&&(r.label=i[r.label])})}function wg(t,e){if(Array.isArray(t))for(const i of t)n(i);function n(i){e(i);for(const r of i.groups)for(const o of r.items)UY(o)&&n(o)}}function SBe(t){return typeof t=="object"&&"menu"in t}function kBe(t){return typeof t=="object"&&"group"in t}function TBe(t){return t.startsWith("start")?"start":t.startsWith("end")?"end":t.startsWith("after")?"after":"before"}function EBe(t){const e=t.match(/^[^:]+:(.+)/);return e?e[1]:null}function HY(t){return typeof t=="string"?t:t.menuId}function UY(t){return typeof t=="object"&&"menuId"in t}class xBe extends Ln(){editor;componentFactory;focusTracker;tooltipManager;poweredBy;evaluationBadge;ariaLiveAnnouncer;isReady=!1;_editableElementsMap=new Map;_focusableToolbarDefinitions=[];_extraMenuBarElements=[];_lastFocusedForeignElement=null;_domEmitter;constructor(e){super();const n=e.editing.view;this.editor=e,this.componentFactory=new fBe(e),this.focusTracker=new wi,this.tooltipManager=new Yr(e),this.poweredBy=new I3e(e),this.evaluationBadge=new mBe(e),this.ariaLiveAnnouncer=new f3e(e),this._initViewportOffset(this._readViewportOffsetFromConfig()),this.once("ready",()=>{this._bindBodyCollectionWithFocusTracker(),this.isReady=!0}),this.listenTo(n.document,"layoutChanged",this.update.bind(this)),this.listenTo(n,"scrollToTheSelection",this._handleScrollToTheSelection.bind(this)),this._initFocusTracking(),this._initVisualViewportSupport()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor),this.poweredBy.destroy(),this.evaluationBadge.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null,this.editor.keystrokes.stopListening(e);this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[],this._domEmitter&&this._domEmitter.stopListening()}setEditableElement(e,n){this._editableElementsMap.set(e,n),n.ckeditorInstance||(n.ckeditorInstance=this.editor),this.focusTracker.add(n);const i=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(n)};this.isReady?i():this.once("ready",i)}removeEditableElement(e){const n=this._editableElementsMap.get(e);n&&(this._editableElementsMap.delete(e),this.editor.keystrokes.stopListening(n),this.focusTracker.remove(n),n.ckeditorInstance=null)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,n={}){e.isRendered?(this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)):e.once("render",()=>{this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)}),this._focusableToolbarDefinitions.push({toolbarView:e,options:n})}extendMenuBar(e){this._extraMenuBarElements.push(e)}initMenuBar(e){const n=e.element;this.focusTracker.add(n),this.editor.keystrokes.listenTo(n);const i=bBe(this.editor.config.get("menuBar")||{});e.fillFromConfig(i,this.componentFactory,this._extraMenuBarElements),this.editor.keystrokes.set("Esc",(r,o)=>{n.contains(this.editor.ui.focusTracker.focusedElement)&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):this.editor.editing.view.focus(),o())}),this.editor.keystrokes.set("Alt+F9",(r,o)=>{n.contains(this.editor.ui.focusTracker.focusedElement)||(this._saveLastFocusedForeignElement(),e.isFocusBorderEnabled=!0,e.focus(),o())})}_readViewportOffsetFromConfig(){const e=this.editor,n=e.config.get("ui.viewportOffset");if(n)return n;const i=e.config.get("toolbar.viewportTopOffset");return i?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:i}):{top:0}}_initFocusTracking(){const e=this.editor;let n;e.keystrokes.set("Alt+F10",(i,r)=>{this._saveLastFocusedForeignElement();const o=this._getCurrentFocusedToolbarDefinition();(!o||!n)&&(n=this._getFocusableCandidateToolbarDefinitions());for(let s=0;s{const o=this._getCurrentFocusedToolbarDefinition();o&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):e.editing.view.focus(),o.options.afterBlur&&o.options.afterBlur(),r())})}_saveLastFocusedForeignElement(){const e=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(e)&&!Array.from(this.editor.editing.view.domRoots.values()).includes(e)&&(this._lastFocusedForeignElement=e)}_getFocusableCandidateToolbarDefinitions(){const e=[];for(const n of this._focusableToolbarDefinitions){const{toolbarView:i,options:r}=n;(vu(i.element)||r.beforeFocus)&&e.push(n)}return e.sort((n,i)=>UV(n)-UV(i)),e}_getCurrentFocusedToolbarDefinition(){for(const e of this._focusableToolbarDefinitions)if(e.toolbarView.element&&e.toolbarView.element.contains(this.focusTracker.focusedElement))return e;return null}_focusFocusableCandidateToolbar(e){const{toolbarView:n,options:{beforeFocus:i}}=e;return i&&i(),vu(n.element)?(n.focus(),!0):!1}_handleScrollToTheSelection(e,n){const i={top:0,bottom:0,left:0,right:0,...this.viewportOffset};n.viewportOffset.top+=i.top,n.viewportOffset.bottom+=i.bottom,n.viewportOffset.left+=i.left,n.viewportOffset.right+=i.right}_bindBodyCollectionWithFocusTracker(){const e=this.view.body;for(const n of e)this.focusTracker.add(n.element);e.on("add",(n,i)=>{this.focusTracker.add(i.element)}),e.on("remove",(n,i)=>{this.focusTracker.remove(i.element)})}_initViewportOffset(e){this.on("set:viewportOffset",(n,i,r)=>{const o=this._getVisualViewportTopOffset(r);r.visualTop!==o&&(n.return={...r,visualTop:o})}),this.set("viewportOffset",e)}_initVisualViewportSupport(){if(!Qe.window.visualViewport)return;const e=()=>{const n=this._getVisualViewportTopOffset(this.viewportOffset);this.viewportOffset.visualTop!==n&&(this.viewportOffset={...this.viewportOffset,visualTop:n})};this._domEmitter=new(zo()),this._domEmitter.listenTo(Qe.window.visualViewport,"scroll",e),this._domEmitter.listenTo(Qe.window.visualViewport,"resize",e)}_getVisualViewportTopOffset(e){const n=Xw().top,i=e.top||0;return n>i?0:i-n}}function UV(t){const{toolbarView:e,options:n}=t;let i=10;return vu(e.element)&&i--,n.isContextual&&(i-=2),i}class ABe extends ut{body;menuBarView;toolbar;constructor(e){super(e),this.body=new Ks(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class PBe extends ABe{top;main;_voiceLabelView;constructor(e){super(e),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:e.uiLanguageDirection,lang:e.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){const e=this.t,n=new mc;return n.text=e("Rich Text Editor"),n.extendTemplate({attributes:{class:"ck-voice-label"}}),n}}class IBe extends ut{name=null;_editingView;_editableElement;_hasExternalElement;constructor(e,n,i){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=n}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){const e=this._editingView;e.isRenderingInProgress?i(this):n(this);function n(r){e.change(o=>{const s=e.document.getRoot(r.name);o.addClass(r.isFocused?"ck-focused":"ck-blurred",s),o.removeClass(r.isFocused?"ck-blurred":"ck-focused",s)})}function i(r){e.once("change:isRenderingInProgress",(o,s,a)=>{a?i(r):n(r)})}}}class RBe extends IBe{_options;constructor(e,n,i,r={}){super(e,n,i),this._options=r,this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView;e.change(n=>{const i=e.document.getRoot(this.name);n.setAttribute("aria-label",this.getEditableAriaLabel(),i)})}getEditableAriaLabel(){const e=this.locale.t,n=this._options.label,i=this._editableElement,r=this.name;if(typeof n=="string")return n;if(typeof n=="object")return n[r];if(typeof n=="function")return n(this);if(i){const o=i.getAttribute("aria-label");if(o)return o}return e("Rich Text Editor. Editing area: %0",r)}}class Xs extends ut{children;constructor(e,n={}){super(e);const i=this.bindTemplate;this.set("class",["ck","ck-form__row",...li(n.class||[])]),this.children=this.createCollection(),n.children&&n.children.forEach(r=>this.children.add(r)),this.set("_role",null),this.set("_ariaLabelledBy",null),n.labelView&&this.set({_role:"group",_ariaLabelledBy:n.labelView.id}),this.setTemplate({tag:"div",attributes:{class:i.to("class",r=>r.join(" ")),role:i.to("_role"),"aria-labelledby":i.to("_ariaLabelledBy")},children:this.children})}}class WV extends bS{static get pluginName(){return"Notification"}static get isOfficialPlugin(){return!0}init(){this.on("show:warning",(e,n)=>{window.alert(n.message)},{priority:"lowest"})}showSuccess(e,n={}){this._showNotification({message:e,type:"success",namespace:n.namespace,title:n.title})}showInfo(e,n={}){this._showNotification({message:e,type:"info",namespace:n.namespace,title:n.title})}showWarning(e,n={}){this._showNotification({message:e,type:"warning",namespace:n.namespace,title:n.title})}_showNotification(e){const n=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(n,{message:e.message,type:e.type,title:e.title||""})}}class Jm extends Ln(){constructor(e,n){super(),n&&BK(this,n),e&&this.set(e)}}const fy=gg("px");class bu extends xe{positionLimiter;visibleStack;_viewToStack=new Map;_idToStack=new Map;_view=null;_rotatorView=null;_fakePanelsView=null;static get pluginName(){return"ContextualBalloon"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.positionLimiter=()=>{const n=this.editor.editing.view,r=n.document.selection.editableElement;return r?n.domConverter.mapViewToDom(r.root):null},this.decorate("getPositionOptions"),this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}destroy(){super.destroy(),this._view&&this._view.destroy(),this._rotatorView&&this._rotatorView.destroy(),this._fakePanelsView&&this._fakePanelsView.destroy()}get view(){return this._view||this._createPanelView(),this._view}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this._view||this._createPanelView(),this.hasView(e.view))throw new oe("contextualballoon-add-view-exist",[this,e]);const n=e.stackId||"main";if(!this._idToStack.has(n)){this._idToStack.set(n,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(n)),this._numberOfStacks=this._idToStack.size,(!this._visibleStack||e.singleViewMode)&&this.showStack(n);return}const i=this._idToStack.get(n);e.singleViewMode&&this.showStack(n),i.set(e.view,e),this._viewToStack.set(e.view,i),i===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new oe("contextualballoon-remove-view-not-exist",[this,e]);const n=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(n.size===1?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(n.values())[n.size-2])),n.size===1?(this._idToStack.delete(this._getStackId(n)),this._numberOfStacks=this._idToStack.size):n.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition()}getPositionOptions(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:{...this.editor.ui.viewportOffset,top:this.editor.ui.viewportOffset.visualTop}})),e}showStack(e){this.visibleStack=e;const n=this._idToStack.get(e);if(!n)throw new oe("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==n&&this._showView(Array.from(n.values()).pop())}_createPanelView(){this._view=new Ki(this.editor.locale),this.editor.ui.view.body.add(this._view),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(i=>i[1]===e)[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let n=e.indexOf(this._visibleStack)+1;e[n]||(n=0),this.showStack(this._getStackId(e[n]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let n=e.indexOf(this._visibleStack)-1;e[n]||(n=e.length-1),this.showStack(this._getStackId(e[n]))}_createRotatorView(){const e=new MBe(this.editor.locale),n=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(i,r)=>!r&&i>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(i,r)=>{if(r<2)return"";const o=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return n("%0 of %1",[o,r])}),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){const e=new OBe(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(n,i)=>!i&&n>=2?Math.min(n-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:n="",withArrow:i=!0,singleViewMode:r=!1}){this.view.class=n,this.view.withArrow=i,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition(),r&&(this._singleViewMode=!0)}}class MBe extends ut{focusTracker;buttonPrevView;buttonNextView;content;constructor(e){super(e);const n=e.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new wi,this.buttonPrevView=this._createButtonView(n("Previous"),pg),this.buttonNextView=this._createButtonView(n("Next"),cY),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",r=>r?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,n){const i=new wt(this.locale);return i.set({label:e,icon:n,tooltip:!0}),i}}class OBe extends ut{content;_balloonPanelView;constructor(e,n){super(e);const i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=n,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",r=>r?"":"ck-hidden")],style:{top:i.to("top",fy),left:i.to("left",fy),width:i.to("width",fy),height:i.to("height",fy)}},children:this.content}),this.on("change:numberOfPanels",(r,o,s,a)=>{s>a?this._addPanels(s-a):this._removePanels(a-s),this.updatePosition()})}_addPanels(e){for(;e--;){const n=new ut;n.setTemplate({tag:"div"}),this.content.add(n),this.registerChild(n)}}_removePanels(e){for(;e--;){const n=this.content.last;this.content.remove(n),this.deregisterChild(n),n.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:n}=this._balloonPanelView,{width:i,height:r}=new Wt(this._balloonPanelView.element);Object.assign(this,{top:e,left:n,width:i,height:r})}}}const ch=gg("px");class LBe extends ut{content;contentPanelElement;_contentPanelPlaceholder;constructor(e){super(e);const n=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheBottomOfLimiter",!1),this.set("_stickyTopOffset",null),this.set("_stickyBottomOffset",null),this.content=this.createCollection(),this._contentPanelPlaceholder=new Io({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:n.to("isSticky",i=>i?"block":"none"),height:n.to("isSticky",i=>i?ch(this._contentPanelRect.height):null)}}}).render(),this.contentPanelElement=new Io({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",n.if("isSticky","ck-sticky-panel__content_sticky"),n.if("_isStickyToTheBottomOfLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:n.to("isSticky",i=>i?ch(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:n.to("_stickyTopOffset",i=>i&&ch(i)),bottom:n.to("_stickyBottomOffset",i=>i&&ch(i)),marginLeft:n.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this.contentPanelElement]})}render(){super.render(),this.checkIfShouldBeSticky(),this.listenTo(Qe.document,"scroll",()=>{this.checkIfShouldBeSticky()},{useCapture:!0}),this.listenTo(this,"change:isActive",()=>{this.checkIfShouldBeSticky()}),Qe.window.visualViewport&&(this.listenTo(Qe.window.visualViewport,"scroll",()=>{this.checkIfShouldBeSticky()}),this.listenTo(Qe.window.visualViewport,"resize",()=>{this.checkIfShouldBeSticky()}))}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive){this._unstick();return}const e=new Wt(this.limiterElement);let n=e.getVisible();if(n){const o=new Wt(Qe.window);o.top+=this.viewportTopOffset,o.height-=this.viewportTopOffset,n=n.getIntersection(o)}const{left:i,top:r}=Xw();if(e.moveBy(i,r),n&&n.moveBy(i,r),n&&e.topn.height){const o=Math.max(e.bottom-n.bottom,0)+this.limiterBottomOffset;this._contentPanelRect.height+o+1String(i)),"data-cke-tooltip-disabled":n.to("isOn")},on:{mouseenter:n.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new Sa;return e.content=yS,e.extendTemplate({attributes:{class:"ck-menu-bar__menu__button__arrow"}}),e}}class NBe extends ut{children;constructor(e){super(e);const n=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-menu-bar__menu__panel",n.to("position",i=>`ck-menu-bar__menu__panel_position_${i}`),n.if("isVisible","ck-hidden",i=>!i)],tabindex:"-1"},children:this.children,on:{selectstart:n.to(i=>{i.target.tagName.toLocaleLowerCase()!=="input"&&i.preventDefault()})}})}focus(e=1){this.children.length&&(e===1?this.children.first.focus():this.children.last.focus())}}class la extends ut{buttonView;panelView;focusTracker;keystrokes;constructor(e){super(e);const n=this.bindTemplate;this.buttonView=new DBe(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.panelView=new NBe(e),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new Qi,this.focusTracker=new wi,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("panelPosition","w"),this.set("class",void 0),this.set("parentMenuView",null),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar__menu",n.to("class"),n.if("isEnabled","ck-disabled",i=>!i),n.if("parentMenuView","ck-menu-bar__menu_top-level",i=>!i)]},children:[this.buttonView,this.panelView]})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.keystrokes.listenTo(this.element),Du.closeOnEscKey(this),this._repositionPanelOnOpen()}_attachBehaviors(){this.parentMenuView?(Du.openOnButtonClick(this),Du.openOnArrowRightKey(this),Du.closeOnArrowLeftKey(this),Du.openAndFocusOnEnterKeyPress(this),Du.closeOnParentClose(this)):(this._propagateArrowKeystrokeEvents(),Du.openAndFocusPanelOnArrowDownKey(this),Du.toggleOnButtonClick(this))}_propagateArrowKeystrokeEvents(){this.keystrokes.set("arrowright",(e,n)=>{this.fire("arrowright"),n()}),this.keystrokes.set("arrowleft",(e,n)=>{this.fire("arrowleft"),n()})}_repositionPanelOnOpen(){this.on("change:isOpen",(e,n,i)=>{if(!i)return;const r=la._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=r?r.name:this._defaultMenuPositionName})}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:e,southWest:n,northEast:i,northWest:r,westSouth:o,eastSouth:s,westNorth:a,eastNorth:l}=pBe;return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?[s,l,o,a]:[e,n,i,r]:this.parentMenuView?[o,a,s,l]:[n,e,r,i]}get _defaultMenuPositionName(){return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?"es":"se":this.parentMenuView?"ws":"sw"}static _getOptimalPosition=BM}class Zm extends jf{constructor(e){super(e),this.role="menu",this.items.on("change",this._setItemsCheckSpace.bind(this))}_setItemsCheckSpace(){const e=Array.from(this.items).some(n=>{const i=qV(n);return i&&i.isToggleable});this.items.forEach(n=>{const i=qV(n);i&&(i.hasCheckSpace=e)})}}function qV(t){return t instanceof $s?t.children.map(e=>BBe(e)?e.buttonView:e).find(e=>e instanceof bg):null}function BBe(t){return typeof t=="object"&&"buttonView"in t&&t.buttonView instanceof wt}class WY extends M3e{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}const jV=["mouseenter","arrowleft","arrowright","change:isOpen"];class VBe extends ut{children;menus=[];constructor(e){super(e);const n=e.t,i=this.bindTemplate;this.set({isOpen:!1,isFocusBorderEnabled:!1}),this._setupIsOpenUpdater(),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar",i.if("isFocusBorderEnabled","ck-menu-bar_focus-border-enabled")],"aria-label":n("Editor menu bar"),role:"menubar"},children:this.children})}fillFromConfig(e,n,i=[]){const r=this.locale,s=yBe({normalizedConfig:e,locale:r,componentFactory:n,extraItems:i}).items.map(a=>this._createMenu({componentFactory:n,menuDefinition:a}));this.children.addMany(s)}render(){super.render(),uh.toggleMenusAndFocusItemsOnHover(this),uh.closeMenusWhenTheBarCloses(this),uh.closeMenuWhenAnotherOnTheSameLevelOpens(this),uh.focusCycleMenusOnArrows(this),uh.closeOnClickOutside(this),uh.enableFocusHighlightOnInteraction(this)}focus(){this.children.first&&this.children.first.focus()}close(){for(const e of this.children)e.isOpen=!1}disable(){for(const e of this.children)e.isEnabled=!1}enable(){for(const e of this.children)e.isEnabled=!0}registerMenu(e,n=null){n?(e.delegate(...jV).to(n),e.parentMenuView=n):e.delegate(...jV).to(this,i=>"menu:"+i),e._attachBehaviors(),this.menus.push(e)}_createMenu({componentFactory:e,menuDefinition:n,parentMenuView:i}){const r=this.locale,o=new la(r);return this.registerMenu(o,i),o.buttonView.set({label:n.label}),o.once("change:isOpen",()=>{const s=new Zm(r);s.ariaLabel=n.label,o.panelView.children.add(s),s.items.addMany(this._createMenuItems({menuDefinition:n,parentMenuView:o,componentFactory:e}))}),o}_createMenuItems({menuDefinition:e,parentMenuView:n,componentFactory:i}){const r=this.locale,o=[];for(const s of e.groups){for(const a of s.items){const l=new yg(r,n);if(so(a))l.children.add(this._createMenu({componentFactory:i,menuDefinition:a,parentMenuView:n}));else{const u=this._createMenuItemContentFromFactory({componentName:a,componentFactory:i,parentMenuView:n});if(!u)continue;l.children.add(u)}o.push(l)}s!==e.groups[e.groups.length-1]&&o.push(new dO(r))}return o}_createMenuItemContentFromFactory({componentName:e,parentMenuView:n,componentFactory:i}){const r=i.create(e);return r instanceof la||r instanceof Wi||r instanceof WY?(this._registerMenuTree(r,n),r.on("execute",()=>{this.close()}),r):(hn("menu-bar-component-unsupported",{componentName:e,componentView:r}),null)}_registerMenuTree(e,n){if(!(e instanceof la)){e.delegate("mouseenter").to(n);return}this.registerMenu(e,n);const i=e.panelView.children.filter(o=>o instanceof Zm)[0];if(!i){e.delegate("mouseenter").to(n);return}const r=i.items.filter(o=>o instanceof $s);for(const o of r)this._registerMenuTree(o.children.get(0),e)}_setupIsOpenUpdater(){let e;this.on("menu:change:isOpen",(n,i,r)=>{clearTimeout(e),r?this.isOpen=!0:e=setTimeout(()=>{this.isOpen=Array.from(this.children).some(o=>o.isOpen)},0)})}}const mO=["left","right","center","justify"];function qY(t){return mO.includes(t)}function jY(t,e){return e.contentLanguageDirection=="rtl"?t==="right":t==="left"}function KY(t){const e=t.map(i=>{let r;return typeof i=="string"?r={name:i}:r=i,r}).filter(i=>{const r=mO.includes(i.name);return r||hn("alignment-config-name-not-recognized",{option:i}),r}),n=e.filter(i=>!!i.className).length;if(n&&n{const s=o.slice(r+1);if(s.some(l=>l.name==i.name))throw new oe("alignment-config-name-already-defined",{option:i,configuredOptions:t});if(i.className&&s.some(u=>u.className==i.className))throw new oe("alignment-config-classname-already-defined",{option:i,configuredOptions:t})}),e}const gO="alignment";class FBe extends Ht{refresh(){const n=this.editor.locale,i=Mi(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!i&&this._canBeAligned(i),this.isEnabled&&i.hasAttribute("alignment")?this.value=i.getAttribute("alignment"):this.value=n.contentLanguageDirection==="rtl"?"right":"left"}execute(e={}){const n=this.editor,i=n.locale,r=n.model,o=r.document,s=e.value;r.change(a=>{const l=Array.from(o.selection.getSelectedBlocks()).filter(d=>this._canBeAligned(d)),u=l[0].getAttribute("alignment");jY(s,i)||u===s||!s?$Be(l,a):zBe(l,a,s)})}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,gO)}}function $Be(t,e){for(const n of t)e.removeAttribute(gO,n)}function zBe(t,e,n){for(const i of t)e.setAttribute(gO,n,i)}class HBe extends xe{static get pluginName(){return"AlignmentEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("alignment",{options:mO.map(n=>({name:n}))})}init(){const e=this.editor,n=e.locale,i=e.model.schema,o=KY(e.config.get("alignment.options")).filter(u=>qY(u.name)&&!jY(u.name,n)),s=o.some(u=>!!u.className);i.extend("$block",{allowAttributes:"alignment"}),e.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),s?e.conversion.attributeToAttribute(jBe(o)):e.conversion.for("downcast").attributeToAttribute(UBe(o));const a=WBe(o);for(const u of a)e.conversion.for("upcast").attributeToAttribute(u);const l=qBe(o);for(const u of l)e.conversion.for("upcast").attributeToAttribute(u);e.commands.add("alignment",new FBe(e))}}function UBe(t){const e={};for(const{name:i}of t)e[i]={key:"style",value:{"text-align":i}};return{model:{key:"alignment",values:t.map(i=>i.name)},view:e}}function WBe(t){const e=[];for(const{name:n}of t)e.push({view:{key:"style",value:{"text-align":n}},model:{key:"alignment",value:n}});return e}function qBe(t){const e=[];for(const{name:n}of t)e.push({view:{key:"align",value:n},model:{key:"alignment",value:n}});return e}function jBe(t){const e={};for(const i of t)e[i.name]={key:"class",value:i.className};return{model:{key:"alignment",values:t.map(i=>i.name)},view:e}}const qg=new Map([["left",rO],["right",aY],["center",oY],["justify",sY]]);class KBe extends xe{get localizedOptionTitles(){const e=this.editor.t;return{left:e("Align left"),right:e("Align right"),center:e("Align center"),justify:e("Justify")}}static get pluginName(){return"AlignmentUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=KY(e.config.get("alignment.options"));n.map(i=>i.name).filter(qY).forEach(i=>this._addButton(i)),this._addToolbarDropdown(n),this._addMenuBarMenu(n)}_addButton(e){this.editor.ui.componentFactory.add(`alignment:${e}`,i=>this._createButton(i,e))}_createButton(e,n,i={}){const r=this.editor,o=r.commands.get("alignment"),s=new wt(e);return s.set({label:this.localizedOptionTitles[n],icon:qg.get(n),tooltip:!0,isToggleable:!0,...i}),s.bind("isEnabled").to(o),s.bind("isOn").to(o,"value",a=>a===n),this.listenTo(s,"execute",()=>{r.execute("alignment",{value:n}),r.editing.view.focus()}),s}_addToolbarDropdown(e){const n=this.editor;n.ui.componentFactory.add("alignment",r=>{const o=Ro(r),s=r.uiLanguageDirection==="rtl"?"w":"e",a=r.t;CS(o,()=>e.map(c=>this._createButton(r,c.name,{tooltipPosition:s})),{enableActiveItemFocusOnDropdownOpen:!0,isVertical:!0,ariaLabel:a("Text alignment toolbar")}),o.buttonView.set({label:a("Text alignment"),tooltip:!0}),o.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const l=r.contentLanguageDirection==="rtl"?qg.get("right"):qg.get("left"),u=n.commands.get("alignment");return o.buttonView.bind("icon").to(u,"value",c=>qg.get(c)||l),o.bind("isEnabled").to(u,"isEnabled"),this.listenTo(o,"execute",()=>{n.editing.view.focus()}),o})}_addMenuBarMenu(e){const n=this.editor;n.ui.componentFactory.add("menuBar:alignment",i=>{const r=n.commands.get("alignment"),o=i.t,s=new la(i),a=new Zm(i);s.bind("isEnabled").to(r),a.set({ariaLabel:o("Text alignment"),role:"menu"}),s.buttonView.set({label:o("Text alignment")});for(const l of e){const u=new yg(i,s),c=new Wi(i);c.delegate("execute").to(s),c.set({label:this.localizedOptionTitles[l.name],icon:qg.get(l.name),role:"menuitemcheckbox",isToggleable:!0}),c.on("execute",()=>{n.execute("alignment",{value:l.name}),n.editing.view.focus()}),c.bind("isOn").to(r,"value",d=>d===l.name),c.bind("isEnabled").to(r,"isEnabled"),u.children.add(c),a.items.add(u)}return s.panelView.children.add(a),s})}}class GBe extends xe{static get requires(){return[HBe,KBe]}static get pluginName(){return"Alignment"}static get isOfficialPlugin(){return!0}}class GY{model;limit;_isLocked;_size;_batch=null;_changeCallback;_selectionChangeCallback;constructor(e,n=20){this.model=e,this._size=0,this.limit=n,this._isLocked=!1,this._changeCallback=(i,r)=>{r.isLocal&&r.isUndoable&&r!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(e){this._size+=e,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}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=!1){(!this.isLocked||e)&&(this._batch=null,this._size=0)}}class YBe extends Ht{_buffer;constructor(e,n){super(e),this._buffer=new GY(e.model,n),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const n=this.editor.model,i=n.document,r=e.text||"",o=r.length;let s=i.selection;if(e.selection?s=e.selection:e.range&&(s=n.createSelection(e.range)),!n.canEditAt(s))return;const a=e.resultRange;n.enqueueChange(this._buffer.batch,l=>{this._buffer.lock();const u=Array.from(i.selection.getAttributes());n.deleteContent(s),r&&n.insertContent(l.createText(r,u),s),a?l.setSelection(a):s.is("documentSelection")||l.setSelection(s),this._buffer.unlock(),this._buffer.input(o)})}}const YY=["insertText","insertReplacementText"],XBe=[...YY,"insertCompositionText"];class JBe extends _l{focusObserver;constructor(e){super(e),this.focusObserver=e.getObserver(d1);const n=vt.isAndroid?XBe:YY,i=e.document;i.on("beforeinput",(r,o)=>{if(!this.isEnabled)return;const{data:s,targetRanges:a,inputType:l,domEvent:u,isComposing:c}=o;if(!n.includes(l))return;this.focusObserver.flush();const d=new pu(i,"insertText");i.fire(d,new Sf(e,u,{text:s,selection:e.createSelection(a),isComposing:c})),d.stop.called&&r.stop()}),vt.isAndroid||i.on("compositionend",(r,{data:o,domEvent:s})=>{this.isEnabled&&o&&i.fire("insertText",new Sf(e,s,{text:o,isComposing:!0}))},{priority:"low"})}observe(){}stopObserving(){}}class XY extends xe{_typingQueue;static get pluginName(){return"Input"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.model,i=e.editing.view,r=e.editing.mapper,o=n.document.selection;this._typingQueue=new ZBe(e),i.addObserver(JBe);const s=new YBe(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",s),e.commands.add("input",s),this.listenTo(i.document,"beforeinput",()=>{this._typingQueue.flush("next beforeinput")},{priority:"high"}),this.listenTo(i.document,"insertText",(a,l)=>{const{text:u,selection:c}=l;if(i.document.selection.isFake&&c&&i.document.selection.isSimilar(c)&&l.preventDefault(),c&&Array.from(c.getRanges()).some(m=>!m.isCollapsed)&&l.preventDefault(),!s.isEnabled){l.preventDefault();return}let d;c&&(d=Array.from(c.getRanges()).filter(m=>m.root.is("rootElement")).map(m=>r.toModelRange(m)).map(m=>eO(m,n.schema)||m)),(!d||!d.length)&&(d=Array.from(o.getRanges()));let f=u;if(vt.isAndroid){const m=Array.from(d[0].getItems()).reduce((g,v)=>g+(v.is("$textProxy")?v.data:""),"");if(m&&(m.length<=f.length?f.startsWith(m)&&(f=f.substring(m.length),d[0].start=d[0].start.getShiftedBy(m.length)):m.startsWith(f)&&(d[0].start=d[0].start.getShiftedBy(f.length),f="")),f.length==0&&d[0].isCollapsed)return}const h={text:f,selection:n.createSelection(d)};this._typingQueue.push(h,!!l.isComposing),l.domEvent.defaultPrevented&&this._typingQueue.flush("beforeinput default prevented")}),vt.isAndroid?this.listenTo(i.document,"keydown",(a,l)=>{o.isCollapsed||l.keyCode!=229||!i.document.isComposing||KV(n,s)}):this.listenTo(i.document,"compositionstart",()=>{o.isCollapsed||KV(n,s)},{priority:"high"}),this.listenTo(i.document,"mutations",(a,{mutations:l})=>{if(this._typingQueue.hasAffectedElements())for(const{node:u}of l){const c=e4e(u,r),d=r.toModelElement(c);if(this._typingQueue.isElementAffected(d)){this._typingQueue.flush("mutations");return}}}),this.listenTo(i.document,"compositionend",()=>{this._typingQueue.flush("before composition end")},{priority:"high"}),this.listenTo(i.document,"compositionend",()=>{this._typingQueue.flush("after composition end");const a=[];if(this._typingQueue.hasAffectedElements())for(const l of this._typingQueue.flushAffectedElements()){const u=r.toViewElement(l);u&&a.push({type:"children",node:u})}(a.length||!vt.isAndroid)&&i.document.fire("mutations",{mutations:a})},{priority:"lowest"})}destroy(){super.destroy(),this._typingQueue.destroy()}}class ZBe{editor;flushDebounced=ml(()=>this.flush("timeout"),50);_queue=[];_isComposing=!1;_affectedElements=new Set;constructor(e){this.editor=e}destroy(){for(this.flushDebounced.cancel(),this._affectedElements.clear();this._queue.length;)this.shift()}get length(){return this._queue.length}push(e,n){const i={text:e.text};if(e.selection){i.selectionRanges=[];for(const r of e.selection.getRanges())i.selectionRanges.push(ko.fromRange(r)),this._affectedElements.add(r.start.parent)}this._queue.push(i),this._isComposing||=n,this.flushDebounced()}shift(){const e=this._queue.shift(),n={text:e.text};if(e.selectionRanges){const i=e.selectionRanges.map(r=>QBe(r)).filter(r=>!!r);i.length&&(n.selection=this.editor.model.createSelection(i))}return n}flush(e){const n=this.editor,i=n.model,r=n.editing.view;if(this.flushDebounced.cancel(),!this._queue.length)return;const s=n.commands.get("insertText").buffer;i.enqueueChange(s.batch,()=>{for(s.lock();this._queue.length;){const a=this.shift();n.execute("insertText",a)}s.unlock(),this._isComposing||this._affectedElements.clear(),this._isComposing=!1}),r.scrollToTheSelection()}isElementAffected(e){return this._affectedElements.has(e)}hasAffectedElements(){return this._affectedElements.size>0}flushAffectedElements(){const e=Array.from(this._affectedElements);return this._affectedElements.clear(),e}}function KV(t,e){if(!e.isEnabled)return;const n=e.buffer;n.lock(),t.enqueueChange(n.batch,()=>{t.deleteContent(t.document.selection)}),n.unlock()}function QBe(t){const e=t.toRange();return t.detach(),e.root.rootName=="$graveyard"?null:e}function e4e(t,e){let n=t.is("$text")?t.parent:t;for(;!e.toModelElement(n);)n=n.parent;return n}class GV extends Ht{direction;_buffer;constructor(e,n){super(e),this.direction=n,this._buffer=new GY(e.model,e.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(e={}){const n=this.editor.model,i=n.document;n.enqueueChange(this._buffer.batch,r=>{this._buffer.lock();const o=r.createSelection(e.selection||i.selection);if(!n.canEditAt(o))return;const s=e.sequence||1,a=o.isCollapsed;if(o.isCollapsed&&n.modifySelection(o,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(s)){this._replaceEntireContentWithParagraph(r);return}if(this._shouldReplaceFirstBlockWithParagraph(o,s)){this.editor.execute("paragraph",{selection:o});return}if(o.isCollapsed)return;let l=0;o.getFirstRange().getMinimalFlatRanges().forEach(u=>{l+=yA(u.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),n.deleteContent(o,{doNotResetEntireContent:a,direction:this.direction}),this._buffer.input(l),r.setSelection(o),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const n=this.editor.model,r=n.document.selection,o=n.schema.getLimitElement(r);if(!(r.isCollapsed&&r.containsEntireContent(o))||!n.schema.checkChild(o,"paragraph"))return!1;const a=o.getChild(0);return!(a&&a.is("element","paragraph"))}_replaceEntireContentWithParagraph(e){const n=this.editor.model,r=n.document.selection,o=n.schema.getLimitElement(r),s=e.createElement("paragraph");e.remove(e.createRangeIn(o)),e.insert(s,o),e.setSelection(s,0)}_shouldReplaceFirstBlockWithParagraph(e,n){const i=this.editor.model;if(n>1||this.direction!="backward"||!e.isCollapsed)return!1;const r=e.getFirstPosition(),o=i.schema.getLimitElement(r),s=o.getChild(0);return!(r.parent!=s||!e.containsEntireContent(s)||!i.schema.checkChild(o,"paragraph")||s.name=="paragraph")}}const t4e="character",YV="word",n4e="codePoint",uc="selection",Fh="backward",Cp="forward",JY={deleteContent:{unit:uc,direction:Fh},deleteContentBackward:{unit:n4e,direction:Fh},deleteWordBackward:{unit:YV,direction:Fh},deleteHardLineBackward:{unit:uc,direction:Fh},deleteSoftLineBackward:{unit:uc,direction:Fh},deleteContentForward:{unit:t4e,direction:Cp},deleteWordForward:{unit:YV,direction:Cp},deleteHardLineForward:{unit:uc,direction:Cp},deleteSoftLineForward:{unit:uc,direction:Cp}};class i4e extends _l{constructor(e){super(e);const n=e.document;let i=0;n.on("keydown",()=>{i++}),n.on("keyup",()=>{i=0}),n.on("beforeinput",(r,o)=>{if(!this.isEnabled)return;const{targetRanges:s,domEvent:a,inputType:l}=o,u=JY[l];if(!u)return;const c={direction:u.direction,unit:u.unit,sequence:i};c.unit==uc&&(c.selectionToRemove=e.createSelection(s[0])),l==="deleteContentBackward"&&(vt.isAndroid&&(c.sequence=1),o4e(s)&&(c.unit=uc,c.selectionToRemove=e.createSelection(s)));const d=new Hf(n,"delete",s[0]);n.fire(d,new Sf(e,a,c)),d.stop.called&&r.stop()}),vt.isBlink&&r4e(this)}observe(){}stopObserving(){}}function r4e(t){const e=t.view,n=e.document;let i=null,r=!1;n.on("keydown",(a,{keyCode:l})=>{i=l,r=!1}),n.on("keyup",(a,{keyCode:l,domEvent:u})=>{const c=n.selection,d=t.isEnabled&&l==i&&o(l)&&!c.isCollapsed&&!r;if(i=null,d){const f=c.getFirstRange(),h=new Hf(n,"delete",f),m={unit:uc,direction:s(l),selectionToRemove:c};n.fire(h,new Sf(e,u,m))}}),n.on("beforeinput",(a,{inputType:l})=>{const u=JY[l];o(i)&&u&&u.direction==s(i)&&(r=!0)},{priority:"high"}),n.on("beforeinput",(a,{inputType:l,data:u})=>{i==Yt.delete&&l=="insertText"&&u==""&&a.stop()},{priority:"high"});function o(a){return a==Yt.backspace||a==Yt.delete}function s(a){return a==Yt.backspace?Fh:Cp}}function o4e(t){if(t.length!=1||t[0].isCollapsed)return!1;const e=t[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0});let n=0;for(const{nextPosition:i,item:r}of e){if(i.parent.is("$text")){const o=i.parent.data,s=i.offset;if(UM(o,s)||WM(o,s)||aG(o,s))continue;n++}else(r.is("containerElement")||r.is("emptyElement"))&&n++;if(n>1)return!0}return!1}class yu extends xe{_undoOnBackspace;static get pluginName(){return"Delete"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.editing.view,i=n.document,r=e.model.document;n.addObserver(i4e),this._undoOnBackspace=!1;const o=new GV(e,"forward");e.commands.add("deleteForward",o),e.commands.add("forwardDelete",o),e.commands.add("delete",new GV(e,"backward")),this.listenTo(i,"delete",(s,a)=>{i.isComposing||a.preventDefault();const{direction:l,sequence:u,selectionToRemove:c,unit:d}=a,f=l==="forward"?"deleteForward":"delete",h={sequence:u};if(d=="selection"){const m=Array.from(c.getRanges()).map(g=>e.editing.mapper.toModelRange(g)).map(g=>eO(g,e.model.schema)||g);h.selection=e.model.createSelection(m)}else h.unit=d;e.execute(f,h),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(i,"keydown",(s,a)=>{if(i.isComposing||a.keyCode!=Yt.backspace||!r.selection.isCollapsed)return;const l=e.model.schema.getLimitElement(r.selection),u=e.model.createPositionAt(l,0);if(u.isTouching(r.selection.getFirstPosition())){a.preventDefault();const c=e.model.schema.getNearestSelectionRange(u,"forward");if(!c)return;const d=n.createSelection(e.editing.mapper.toViewRange(c)),f=d.getFirstRange(),h=new Hf(document,"delete",f),m={unit:"selection",direction:"backward",selectionToRemove:d};i.fire(h,new Sf(n,a.domEvent,m))}}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(i,"delete",(s,a)=>{this._undoOnBackspace&&a.direction=="backward"&&a.sequence==1&&a.unit=="codePoint"&&(this._undoOnBackspace=!1,e.execute("undo"),a.preventDefault(),s.stop())},{context:"$capture"}),this.listenTo(r,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class s4e extends xe{static get requires(){return[XY,yu]}static get pluginName(){return"Typing"}static get isOfficialPlugin(){return!0}}function ZY(t,e){let n=t.start;return{text:Array.from(t.getWalker({ignoreElementEnd:!1})).reduce((r,{item:o})=>o.is("$text")||o.is("$textProxy")?r+o.data:(n=e.createPositionAfter(o),""),""),range:e.createRange(n,t.end)}}class pO extends Ln(){model;testCallback;_hasMatch;constructor(e,n){super(),this.model=e,this.testCallback=n,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()}get hasMatch(){return this._hasMatch}_startListening(){const n=this.model.document;this.listenTo(n.selection,"change:range",(i,{directChange:r})=>{if(r){if(!n.selection.isCollapsed){this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1);return}this._evaluateTextBeforeSelection("selection")}}),this.listenTo(n,"change:data",(i,r)=>{r.isUndo||!r.isLocal||this._evaluateTextBeforeSelection("data",{batch:r})})}_evaluateTextBeforeSelection(e,n={}){const i=this.model,o=i.document.selection,s=i.createRange(i.createPositionAt(o.focus.parent,0),o.focus),{text:a,range:l}=ZY(s,i),u=this.testCallback(a);if(!u&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!u,u){const c=Object.assign(n,{text:a,range:l});typeof u=="object"&&Object.assign(c,u),this.fire(`matched:${e}`,c)}}}class v1 extends xe{attributes;_overrideUid;_isNextGravityRestorationSkipped=!1;static get pluginName(){return"TwoStepCaretMovement"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){const e=this.editor,n=e.model,i=e.editing.view,r=e.locale,o=n.document.selection;this.listenTo(i.document,"arrowKey",(s,a)=>{if(!o.isCollapsed||a.shiftKey||a.altKey||a.ctrlKey)return;const l=a.keyCode==Yt.arrowright,u=a.keyCode==Yt.arrowleft;if(!l&&!u)return;const c=r.contentLanguageDirection;let d=!1;c==="ltr"&&l||c==="rtl"&&u?d=this._handleForwardMovement(a):d=this._handleBackwardMovement(a),d===!0&&s.stop()},{context:"$text",priority:"highest"}),this.listenTo(o,"change:range",(s,a)=>{if(this._isNextGravityRestorationSkipped){this._isNextGravityRestorationSkipped=!1;return}this._isGravityOverridden&&(!a.directChange&&ys(o.getFirstPosition(),this.attributes)||this._restoreGravity())}),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const n=this.attributes,i=this.editor.model,r=i.document.selection,o=r.getFirstPosition();return this._isGravityOverridden||o.isAtStart&&Ml(r,n)?!1:ys(o,n)?(e&&Kg(e),Ml(r,n)&&ys(o,n,!0)?jg(i,n):this._overrideGravity(),!0):!1}_handleBackwardMovement(e){const n=this.attributes,i=this.editor.model,r=i.document.selection,o=r.getFirstPosition();return this._isGravityOverridden?(e&&Kg(e),this._restoreGravity(),ys(o,n,!0)?jg(i,n):hy(i,n,o),!0):o.isAtStart?Ml(r,n)?(e&&Kg(e),hy(i,n,o),!0):!1:!Ml(r,n)&&ys(o,n,!0)?(e&&Kg(e),hy(i,n,o),!0):XV(o,n)?o.isAtEnd&&!Ml(r,n)&&ys(o,n)?(e&&Kg(e),hy(i,n,o),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):!1}_enableClickingAfterNode(){const e=this.editor,n=e.model,i=n.document.selection,r=e.editing.view.document;e.editing.view.addObserver(nO),e.editing.view.addObserver(B5e);let o=!1,s=!1;this.listenTo(r,"touchstart",()=>{s=!1,o=!0}),this.listenTo(r,"mousedown",()=>{s=!0}),this.listenTo(r,"selectionChange",()=>{const a=this.attributes;if(!s&&!o||(s=!1,o=!1,!i.isCollapsed)||!Ml(i,a))return;const l=i.getFirstPosition();ys(l,a)&&(l.isAtStart||ys(l,a,!0)?jg(n,a):this._isGravityOverridden||this._overrideGravity())})}_enableInsertContentSelectionAttributesFixer(){const n=this.editor.model,i=n.document.selection,r=this.attributes;this.listenTo(n,"insertContent",()=>{const o=i.getFirstPosition();Ml(i,r)&&ys(o,r)&&jg(n,r)},{priority:"low"})}_handleDeleteContentAfterNode(){const e=this.editor,n=e.model,i=n.document.selection,r=e.editing.view;let o=!1,s=!1;this.listenTo(r.document,"delete",(a,l)=>{o=l.direction==="backward"},{priority:"high"}),this.listenTo(n,"deleteContent",()=>{if(!o)return;const a=i.getFirstPosition();s=Ml(i,this.attributes)&&!XV(a,this.attributes)},{priority:"high"}),this.listenTo(n,"deleteContent",()=>{o&&(o=!1,!s&&e.model.enqueueChange(()=>{const a=i.getFirstPosition();Ml(i,this.attributes)&&ys(a,this.attributes)&&(a.isAtStart||ys(a,this.attributes,!0)?jg(n,this.attributes):this._isGravityOverridden||this._overrideGravity())}))},{priority:"low"})}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 Ml(t,e){for(const n of e)if(t.hasAttribute(n))return!0;return!1}function hy(t,e,n){const i=n.nodeBefore;t.change(r=>{if(i){const o=[],s=t.schema.isObject(i)&&t.schema.isInline(i);for(const[a,l]of i.getAttributes())t.schema.checkAttribute("$text",a)&&(!s||t.schema.getAttributeProperties(a).copyFromObject!==!1)&&o.push([a,l]);r.setSelectionAttribute(o)}else r.removeSelectionAttribute(e)})}function jg(t,e){t.change(n=>{n.removeSelectionAttribute(e)})}function Kg(t){t.preventDefault()}function XV(t,e){const n=t.getShiftedBy(-1);return ys(n,e)}function ys(t,e,n=!1){const{nodeBefore:i,nodeAfter:r}=t;for(const o of e){const s=i?i.getAttribute(o):void 0,a=r?r.getAttribute(o):void 0;if(!(n&&(s===void 0||a===void 0))&&a!==s)return!0}return!1}const JV={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"½",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"⅓",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"⅔",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"¼",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"¾",null]},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:dh('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:dh("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:dh("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:dh('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:dh('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:dh("'"),to:[null,"‚",null,"’"]}},ZV={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},a4e=["symbols","mathematical","typography","quotes"];class l4e extends xe{static get requires(){return["Delete","Input"]}static get pluginName(){return"TextTransformation"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("typing",{transformations:{include:a4e}})}init(){const n=this.editor.model.document.selection;n.on("change:range",()=>{const i=n.anchor,r=!!i&&i.parent.is("element","codeBlock"),o=n.hasAttribute("code");this.isEnabled=!(r||o)}),this._enableTransformationWatchers()}_enableTransformationWatchers(){const e=this.editor,n=e.model,i=e.plugins.get("Delete"),r=f4e(e.config.get("typing.transformations")),o=a=>{for(const l of r)if(l.from.test(a))return{normalizedTransformation:l}},s=new pO(e.model,o);s.on("matched:data",(a,l)=>{if(!l.batch.isTyping)return;const{from:u,to:c}=l.normalizedTransformation,d=u.exec(l.text),f=c(d.slice(1)),h=l.range;let m=d.index;n.enqueueChange(g=>{for(let v=1;v{i.requestUndoOnBackspace()})})}),s.bind("isEnabled").to(this)}}function u4e(t){return typeof t=="string"?new RegExp(`(${OIe(t)})$`):t}function c4e(t){return typeof t=="string"?()=>[t]:t instanceof Array?()=>t:t}function d4e(t){return(t.textNode?t.textNode:t.nodeAfter).getAttributes()}function dh(t){return new RegExp(`(^|\\s)(${t})([^${t}]*)(${t})$`)}function f4e(t){const e=t.extra||[],n=t.remove||[],i=o=>!n.includes(o),r=t.include.concat(e).filter(i);return h4e(r).filter(i).map(o=>typeof o=="string"&&JV[o]?JV[o]:o).filter(o=>typeof o=="object").map(o=>({from:u4e(o.from),to:c4e(o.to)}))}function h4e(t){const e=new Set;for(const n of t)if(typeof n=="string"&&ZV[n])for(const i of ZV[n])e.add(i);else e.add(n);return Array.from(e)}function SS(t,e,n,i){return i.createRange(QV(t,e,n,!0,i),QV(t,e,n,!1,i))}function QV(t,e,n,i,r){let o=t.textNode||(i?t.nodeBefore:t.nodeAfter),s=null;for(;o&&o.getAttribute(e)==n;)s=o,o=i?o.previousSibling:o.nextSibling;return s?r.createPositionAt(s,i?"before":"after"):t}function QY(t,e,n,i){const r=t.editing.view,o=new Set;r.document.registerPostFixer(s=>{const a=t.model.document.selection;let l=!1;if(a.hasAttribute(e)){const u=SS(a.getFirstPosition(),e,a.getAttribute(e),t.model),c=t.editing.mapper.toViewRange(u);for(const d of c.getItems())d.is("element",n)&&!d.hasClass(i)&&(s.addClass(i,d),o.add(d),l=!0)}return l}),t.conversion.for("editingDowncast").add(s=>{s.on("insert",a,{priority:"highest"}),s.on("remove",a,{priority:"highest"}),s.on("attribute",a,{priority:"highest"}),s.on("selection",a,{priority:"highest"});function a(){r.change(l=>{for(const u of o.values())l.removeClass(i,u),o.delete(u)})}})}function Nu(t,e,n,i){let r,o=null;typeof i=="function"?r=i:(o=t.commands.get(i),r=()=>{t.execute(i)}),t.model.document.on("change:data",(s,a)=>{if(o&&!o.isEnabled||!e.isEnabled)return;const l=Mi(t.model.document.selection.getRanges());if(!l.isCollapsed||a.isUndo||!a.isLocal)return;const u=Array.from(t.model.document.differ.getChanges()),c=u[0];if(u.length!=1||c.type!=="insert"||c.name!="$text"||c.length!=1)return;const d=c.position.parent;if(d.is("element","codeBlock")||d.is("element","listItem")&&typeof i!="function"&&!["numberedList","bulletedList","todoList"].includes(i)||o&&o.value===!0)return;const f=d.getChild(0),h=t.model.createRangeOn(f);if(!h.containsRange(l)&&!l.end.isEqual(h.end))return;const m=n.exec(f.data.substr(0,l.end.offset));m&&t.model.enqueueChange(g=>{const v=t.model.document.selection,p=g.createPositionAt(d,0),b=g.createPositionAt(d,m[0].length),y=new ko(p,b);if(r({match:m})!==!1){const C=Array.from(v.getAttributes());g.remove(y);const S=v.getFirstRange(),k=g.createRangeIn(d);d.isEmpty&&!k.isEqual(S)&&!k.containsRange(S,!0)&&g.remove(d),m4e(g,v,C)}y.detach(),t.model.enqueueChange(()=>{t.plugins.get("Delete").requestUndoOnBackspace()})})})}function m4e(t,e,n){const i=t.model.schema,r=e.getFirstPosition();let o=new su(r);i.checkChild(o,"$text")&&(o=o.push("$text"));for(const[s,a]of n)i.checkAttribute(o,s)&&t.setSelectionAttribute(s,a)}function fh(t,e,n,i){let r,o;n instanceof RegExp?r=n:o=n,o=o||(s=>{let a;const l=[],u=[];for(;(a=r.exec(s))!==null&&!(a&&a.length<4);){let{index:c,"1":d,"2":f,"3":h}=a;const m=d+f+h;c+=a[0].length-m.length;const g=[c,c+d.length],v=[c+d.length+f.length,c+d.length+f.length+h.length];l.push(g),l.push(v),u.push([c+d.length,c+d.length+f.length])}return{remove:l,format:u}}),t.model.document.on("change:data",(s,a)=>{if(a.isUndo||!a.isLocal||!e.isEnabled)return;const l=t.model,u=l.document.selection;if(!u.isCollapsed)return;const c=Array.from(l.document.differ.getChanges()),d=c[0];if(c.length!=1||d.type!=="insert"||d.name!="$text"||d.length!=1)return;const f=u.focus,h=f.parent,{text:m,range:g}=g4e(l.createRange(l.createPositionAt(h,0),f),l),v=o(m),p=eF(g.start,v.format,l),b=eF(g.start,v.remove,l);p.length&&b.length&&l.enqueueChange(y=>{if(i(y,p)!==!1){for(const C of b.reverse())y.remove(C);l.enqueueChange(()=>{t.plugins.get("Delete").requestUndoOnBackspace()})}})})}function eF(t,e,n){return e.filter(i=>i[0]!==void 0&&i[1]!==void 0).map(i=>n.createRange(t.getShiftedBy(i[0]),t.getShiftedBy(i[1])))}function g4e(t,e){let n=t.start;return{text:Array.from(t.getItems()).reduce((r,o)=>!(o.is("$text")||o.is("$textProxy"))||o.getAttribute("code")?(n=e.createPositionAfter(o),""):r+o.data,""),range:e.createRange(n,t.end)}}class p4e extends xe{static get requires(){return[yu]}static get pluginName(){return"Autoformat"}static get isOfficialPlugin(){return!0}afterInit(){const e=this.editor,n=this.editor.t;this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats(),e.accessibility.addKeystrokeInfos({keystrokes:[{label:n("Revert autoformatting action"),keystroke:"Backspace"}]})}_addListAutoformats(){const e=this.editor.commands;e.get("bulletedList")&&Nu(this.editor,this,/^[*-]\s$/,"bulletedList"),e.get("numberedList")&&Nu(this.editor,this,/^1[.|)]\s$/,"numberedList"),e.get("todoList")&&Nu(this.editor,this,/^\[\s?\]\s$/,"todoList"),e.get("checkTodoList")&&Nu(this.editor,this,/^\[\s?x\s?\]\s$/,()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")})}_addBasicStylesAutoformats(){const e=this.editor.commands;if(e.get("bold")){const n=my(this.editor,"bold");fh(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,n),fh(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,n)}if(e.get("italic")){const n=my(this.editor,"italic");fh(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,n),fh(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,n)}if(e.get("code")){const n=my(this.editor,"code");fh(this.editor,this,/(`)([^`]+)(`)$/g,n)}if(e.get("strikethrough")){const n=my(this.editor,"strikethrough");fh(this.editor,this,/(~~)([^~]+)(~~)$/g,n)}}_addHeadingAutoformats(){const e=this.editor.commands.get("heading");e&&e.modelElements.filter(n=>n.match(/^heading[1-6]$/)).forEach(n=>{const i=n[7],r=new RegExp(`^(#{${i}})\\s$`);Nu(this.editor,this,r,()=>{if(!e.isEnabled||e.value===n)return!1;this.editor.execute("heading",{value:n})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&Nu(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){const e=this.editor,n=e.model.document.selection;e.commands.get("codeBlock")&&Nu(e,this,/^```$/,()=>{if(n.getFirstPosition().parent.is("element","listItem"))return!1;this.editor.execute("codeBlock",{usePreviousLanguageChoice:!0})})}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&Nu(this.editor,this,/^---$/,"horizontalLine")}}function my(t,e){return(n,i)=>{if(!t.commands.get(e).isEnabled)return!1;const o=t.model.schema.getValidRanges(i,e);for(const s of o)n.setAttribute(e,!0,s);n.removeSelectionAttribute(e)}}class Kf extends Ht{attributeKey;constructor(e,n){super(e),this.attributeKey=n}refresh(){const e=this.editor.model,n=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(n.selection,this.attributeKey)}execute(e={}){const n=this.editor.model,r=n.document.selection,o=e.forceValue===void 0?!this.value:e.forceValue;n.change(s=>{if(r.isCollapsed)o?s.setSelectionAttribute(this.attributeKey,!0):s.removeSelectionAttribute(this.attributeKey);else{const a=n.schema.getValidRanges(r.getRanges(),this.attributeKey,{includeEmptyRanges:!0});for(const l of a){let u=l,c=this.attributeKey;l.isCollapsed&&(u=l.start.parent,c=cs._getStoreAttributeKey(this.attributeKey)),o?s.setAttribute(c,o,u):s.removeAttribute(c,u)}}})}_getValueFromFirstAllowedNode(){const e=this.editor.model,n=e.schema,i=e.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const r of i.getRanges())for(const o of r.getItems())if(n.checkAttribute(o,this.attributeKey))return o.hasAttribute(this.attributeKey);return!1}}const hh="bold";class v4e extends xe{static get pluginName(){return"BoldEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=this.editor.t;e.model.schema.extend("$text",{allowAttributes:hh}),e.model.schema.setAttributeProperties(hh,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:hh,view:"strong",upcastAlso:["b",i=>{const r=i.getStyle("font-weight");return r&&(r=="bold"||Number(r)>=600)?{name:!0,styles:["font-weight"]}:null}]}),e.commands.add(hh,new Kf(e,hh)),e.keystrokes.set("CTRL+B",hh),e.accessibility.addKeystrokeInfos({keystrokes:[{label:n("Bold text"),keystroke:"CTRL+B"}]})}}function Gf({editor:t,commandName:e,plugin:n,icon:i,label:r,keystroke:o}){return s=>{const a=t.commands.get(e),l=new s(t.locale);return l.set({label:r,icon:i,keystroke:o,isToggleable:!0}),l.bind("isEnabled").to(a,"isEnabled"),l.bind("isOn").to(a,"value"),l instanceof Wi?l.set({role:"menuitemcheckbox"}):l.set({tooltip:!0}),n.listenTo(l,"execute",()=>{t.execute(e),t.editing.view.focus()}),l}}const YT="bold";class b4e extends xe{static get pluginName(){return"BoldUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.locale.t,i=Gf({editor:e,commandName:YT,plugin:this,icon:lY,label:n("Bold"),keystroke:"CTRL+B"});e.ui.componentFactory.add(YT,()=>i(wt)),e.ui.componentFactory.add("menuBar:"+YT,()=>i(Wi))}}class y4e extends xe{static get requires(){return[v4e,b4e]}static get pluginName(){return"Bold"}static get isOfficialPlugin(){return!0}}const ld="code",w4e="ck-code_selected";class _4e extends xe{static get pluginName(){return"CodeEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[v1]}init(){const e=this.editor,n=this.editor.t;e.model.schema.extend("$text",{allowAttributes:ld}),e.model.schema.setAttributeProperties(ld,{isFormatting:!0,copyOnEnter:!1}),e.conversion.attributeToElement({model:ld,view:"code"}),e.commands.add(ld,new Kf(e,ld)),e.plugins.get(v1).registerAttribute(ld),QY(e,ld,"code",w4e),e.accessibility.addKeystrokeInfos({keystrokes:[{label:n("Move out of an inline code style"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}}const XT="code";class C4e extends xe{static get pluginName(){return"CodeUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.locale.t,i=Gf({editor:e,commandName:XT,plugin:this,icon:$De,label:n("Code")});e.ui.componentFactory.add(XT,()=>i(wt)),e.ui.componentFactory.add("menuBar:"+XT,()=>i(Wi))}}class S4e extends xe{static get requires(){return[_4e,C4e]}static get pluginName(){return"Code"}static get isOfficialPlugin(){return!0}}const mh="italic";class k4e extends xe{static get pluginName(){return"ItalicEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=this.editor.t;e.model.schema.extend("$text",{allowAttributes:mh}),e.model.schema.setAttributeProperties(mh,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:mh,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(mh,new Kf(e,mh)),e.keystrokes.set("CTRL+I",mh),e.accessibility.addKeystrokeInfos({keystrokes:[{label:n("Italic text"),keystroke:"CTRL+I"}]})}}const JT="italic";class T4e extends xe{static get pluginName(){return"ItalicUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.locale.t,i=Gf({editor:e,commandName:JT,plugin:this,icon:JDe,keystroke:"CTRL+I",label:n("Italic")});e.ui.componentFactory.add(JT,()=>i(wt)),e.ui.componentFactory.add("menuBar:"+JT,()=>i(Wi))}}class E4e extends xe{static get requires(){return[k4e,T4e]}static get pluginName(){return"Italic"}static get isOfficialPlugin(){return!0}}const Gg="strikethrough";class x4e extends xe{static get pluginName(){return"StrikethroughEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Gg}),e.model.schema.setAttributeProperties(Gg,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Gg,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),e.commands.add(Gg,new Kf(e,Gg)),e.keystrokes.set("CTRL+SHIFT+X","strikethrough"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:n("Strikethrough text"),keystroke:"CTRL+SHIFT+X"}]})}}const ZT="strikethrough";class A4e extends xe{static get pluginName(){return"StrikethroughUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.locale.t,i=Gf({editor:e,commandName:ZT,plugin:this,icon:bNe,keystroke:"CTRL+SHIFT+X",label:n("Strikethrough")});e.ui.componentFactory.add(ZT,()=>i(wt)),e.ui.componentFactory.add("menuBar:"+ZT,()=>i(Wi))}}class P4e extends xe{static get requires(){return[x4e,A4e]}static get pluginName(){return"Strikethrough"}static get isOfficialPlugin(){return!0}}const Yg="subscript";class I4e extends xe{static get pluginName(){return"SubscriptEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Yg}),e.model.schema.setAttributeProperties(Yg,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Yg,view:"sub",upcastAlso:[{styles:{"vertical-align":"sub"}}]}),e.commands.add(Yg,new Kf(e,Yg))}}const QT="subscript";class R4e extends xe{static get pluginName(){return"SubscriptUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.locale.t,i=Gf({editor:e,commandName:QT,plugin:this,icon:yNe,label:n("Subscript")});e.ui.componentFactory.add(QT,()=>i(wt)),e.ui.componentFactory.add("menuBar:"+QT,()=>i(Wi))}}class M4e extends xe{static get requires(){return[I4e,R4e]}static get pluginName(){return"Subscript"}static get isOfficialPlugin(){return!0}}const Xg="superscript";class O4e extends xe{static get pluginName(){return"SuperscriptEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Xg}),e.model.schema.setAttributeProperties(Xg,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Xg,view:"sup",upcastAlso:[{styles:{"vertical-align":"super"}}]}),e.commands.add(Xg,new Kf(e,Xg))}}const eE="superscript";class L4e extends xe{static get pluginName(){return"SuperscriptUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.locale.t,i=Gf({editor:e,commandName:eE,plugin:this,icon:wNe,label:n("Superscript")});e.ui.componentFactory.add(eE,()=>i(wt)),e.ui.componentFactory.add("menuBar:"+eE,()=>i(Wi))}}class D4e extends xe{static get requires(){return[O4e,L4e]}static get pluginName(){return"Superscript"}static get isOfficialPlugin(){return!0}}const Jg="underline";class N4e extends xe{static get pluginName(){return"UnderlineEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Jg}),e.model.schema.setAttributeProperties(Jg,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Jg,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),e.commands.add(Jg,new Kf(e,Jg)),e.keystrokes.set("CTRL+U","underline"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:n("Underline text"),keystroke:"CTRL+U"}]})}}const tE="underline";class B4e extends xe{static get pluginName(){return"UnderlineUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.locale.t,i=Gf({editor:e,commandName:tE,plugin:this,icon:xNe,label:n("Underline"),keystroke:"CTRL+U"});e.ui.componentFactory.add(tE,()=>i(wt)),e.ui.componentFactory.add("menuBar:"+tE,()=>i(Wi))}}class V4e extends xe{static get requires(){return[N4e,B4e]}static get pluginName(){return"Underline"}static get isOfficialPlugin(){return!0}}function*eX(t,e){for(const n of e)n&&t.getAttributeProperties(n[0]).copyOnEnter&&(yield n)}class F4e extends Ht{execute(){this.editor.model.change(e=>{this.enterBlock(e),this.fire("afterExecute",{writer:e})})}enterBlock(e){const n=this.editor.model,i=n.document.selection,r=n.schema,o=i.isCollapsed,s=i.getFirstRange(),a=s.start.parent,l=s.end.parent;if(r.isLimit(a)||r.isLimit(l))return!o&&a==l&&n.deleteContent(i),!1;if(o){const u=eX(e.model.schema,i.getAttributes());return tF(e,s.start),e.setSelectionAttribute(u),!0}else{const u=!(s.start.isAtStart&&s.end.isAtEnd),c=a==l;if(n.deleteContent(i,{leaveUnmerged:u}),u){if(c)return tF(e,i.focus),!0;e.setSelection(l,0)}}return!1}}function tF(t,e){t.split(e),t.setSelection(e.parent.nextSibling,0)}const $4e={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class tX extends _l{constructor(e){super(e);const n=this.document;let i=!1;n.on("keydown",(r,o)=>{i=o.shiftKey}),n.on("beforeinput",(r,o)=>{if(!this.isEnabled)return;let s=o.inputType;vt.isSafari&&i&&s=="insertParagraph"&&(s="insertLineBreak");const a=o.domEvent,l=$4e[s];if(!l)return;const u=new Hf(n,"enter",o.targetRanges[0]);n.fire(u,new Sf(e,a,{isSoft:l.isSoft})),u.stop.called&&r.stop()})}observe(){}stopObserving(){}}class kS extends xe{static get pluginName(){return"Enter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.editing.view,i=n.document,r=this.editor.t;n.addObserver(tX),e.commands.add("enter",new F4e(e)),this.listenTo(i,"enter",(o,s)=>{i.isComposing||s.preventDefault(),!s.isSoft&&(e.execute("enter"),n.scrollToTheSelection())},{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:r("Insert a hard break (a new paragraph)"),keystroke:"Enter"}]})}}class z4e extends Ht{execute(){const e=this.editor.model,n=e.document;e.change(i=>{U4e(e,i,n.selection),this.fire("afterExecute",{writer:i})})}refresh(){const e=this.editor.model,n=e.document;this.isEnabled=H4e(e.schema,n.selection)}}function H4e(t,e){if(e.rangeCount>1)return!1;const n=e.anchor;if(!n||!t.checkChild(n,"softBreak"))return!1;const i=e.getFirstRange(),r=i.start.parent,o=i.end.parent;return!((BA(r,t)||BA(o,t))&&r!==o)}function U4e(t,e,n){const i=n.isCollapsed,r=n.getFirstRange(),o=r.start.parent,s=r.end.parent,a=o==s;if(i){const l=eX(t.schema,n.getAttributes());nF(t,e,r.end),e.removeSelectionAttribute(n.getAttributeKeys()),e.setSelectionAttribute(l)}else{const l=!(r.start.isAtStart&&r.end.isAtEnd);t.deleteContent(n,{leaveUnmerged:l}),a?nF(t,e,n.focus):l&&e.setSelection(s,0)}}function nF(t,e,n){const i=e.createElement("softBreak");t.insertContent(i,n),e.setSelection(i,"after")}function BA(t,e){return t.is("rootElement")?!1:e.isLimit(t)||BA(t.parent,e)}class W4e extends xe{static get pluginName(){return"ShiftEnter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.model.schema,i=e.conversion,r=e.editing.view,o=r.document,s=this.editor.t;n.register("softBreak",{allowWhere:"$text",isInline:!0}),i.for("upcast").elementToElement({model:"softBreak",view:"br"}),i.for("downcast").elementToElement({model:"softBreak",view:(a,{writer:l})=>l.createEmptyElement("br")}),r.addObserver(tX),e.commands.add("shiftEnter",new z4e(e)),this.listenTo(o,"enter",(a,l)=>{o.isComposing||l.preventDefault(),l.isSoft&&(e.execute("shiftEnter"),r.scrollToTheSelection())},{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:s("Insert a soft break (a <br> element)"),keystroke:"Shift+Enter"}]})}}class q4e extends Ht{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const n=this.editor.model,i=n.schema,r=n.document.selection,o=Array.from(r.getSelectedBlocks()),s=e.forceValue===void 0?!this.value:e.forceValue;n.change(a=>{if(!s)this._removeQuote(a,o.filter(gy));else{const l=o.filter(u=>gy(u)||rF(i,u));this._applyQuote(a,l)}})}_getValue(){const e=this.editor.model.document.selection,n=Mi(e.getSelectedBlocks());return!!(n&&gy(n))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,n=this.editor.model.schema,i=Mi(e.getSelectedBlocks());return i?rF(n,i):!1}_removeQuote(e,n){iF(e,n).reverse().forEach(i=>{if(i.start.isAtStart&&i.end.isAtEnd){e.unwrap(i.start.parent);return}if(i.start.isAtStart){const o=e.createPositionBefore(i.start.parent);e.move(i,o);return}i.end.isAtEnd||e.split(i.end);const r=e.createPositionAfter(i.end.parent);e.move(i,r)})}_applyQuote(e,n){const i=[];iF(e,n).reverse().forEach(r=>{let o=gy(r.start);o||(o=e.createElement("blockQuote"),e.wrap(r,o)),i.push(o)}),i.reverse().reduce((r,o)=>r.nextSibling==o?(e.merge(e.createPositionAfter(r)),r):o)}}function gy(t){return t.parent.name=="blockQuote"?t.parent:null}function iF(t,e){let n,i=0;const r=[];for(;i{const a=e.model.document.differ.getChanges();for(const l of a)if(l.type=="insert"){const u=l.position.nodeAfter;if(!u)continue;if(u.is("element","blockQuote")&&u.isEmpty)return s.remove(u),!0;if(u.is("element","blockQuote")&&!n.checkChild(l.position,u))return s.unwrap(u),!0;if(u.is("element")){const c=s.createRangeIn(u);for(const d of c.getItems())if(d.is("element","blockQuote")&&!n.checkChild(s.createPositionBefore(d),d))return s.unwrap(d),!0}}else if(l.type=="remove"){const u=l.position.parent;if(u.is("element","blockQuote")&&u.isEmpty)return s.remove(u),!0}return!1});const i=this.editor.editing.view.document,r=e.model.document.selection,o=e.commands.get("blockQuote");this.listenTo(i,"enter",(s,a)=>{if(!r.isCollapsed||!o.value)return;r.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"}),this.listenTo(i,"delete",(s,a)=>{if(a.direction!="backward"||!r.isCollapsed||!o.value)return;const l=r.getLastPosition().parent;l.isEmpty&&!l.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),a.preventDefault(),s.stop())},{context:"blockquote"})}}class K4e extends xe{static get pluginName(){return"BlockQuoteUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("blockQuote",()=>{const n=this._createButton(wt);return n.set({tooltip:!0}),n}),e.ui.componentFactory.add("menuBar:blockQuote",()=>{const n=this._createButton(Wi);return n.set({role:"menuitemcheckbox"}),n})}_createButton(e){const n=this.editor,i=n.locale,r=n.commands.get("blockQuote"),o=new e(n.locale),s=i.t;return o.set({label:s("Block quote"),icon:hNe,isToggleable:!0}),o.bind("isEnabled").to(r,"isEnabled"),o.bind("isOn").to(r,"value"),this.listenTo(o,"execute",()=>{n.execute("blockQuote"),n.editing.view.focus()}),o}}class G4e extends xe{static get requires(){return[j4e,K4e]}static get pluginName(){return"BlockQuote"}static get isOfficialPlugin(){return!0}}class Y4e extends Fn(){_stack=[];add(e,n){const i=this._stack,r=i[0];this._insertDescriptor(e);const o=i[0];r!==o&&!nE(r,o)&&this.fire("change:top",{oldDescriptor:r,newDescriptor:o,writer:n})}remove(e,n){const i=this._stack,r=i[0];this._removeDescriptor(e);const o=i[0];r!==o&&!nE(r,o)&&this.fire("change:top",{oldDescriptor:r,newDescriptor:o,writer:n})}_insertDescriptor(e){const n=this._stack,i=n.findIndex(o=>o.id===e.id);if(nE(e,n[i]))return;i>-1&&n.splice(i,1);let r=0;for(;n[r]&&X4e(n[r],e);)r++;n.splice(r,0,e)}_removeDescriptor(e){const n=this._stack,i=n.findIndex(r=>r.id===e);i>-1&&n.splice(i,1)}}function nE(t,e){return t&&e&&t.priority==e.priority&&b1(t.classes)==b1(e.classes)}function X4e(t,e){return t.priority>e.priority?!0:t.priorityb1(e.classes)}function b1(t){return Array.isArray(t)?t.sort().join(","):t}const J4e="ck-widget",oF="ck-widget_selected";function ci(t){return t.is("element")?!!t.getCustomProperty("widget"):!1}function vO(t,e,n={}){if(!t.is("containerElement"))throw new oe("widget-to-widget-wrong-element-type",null,{element:t});return e.setAttribute("contenteditable","false",t),e.addClass(J4e,t),e.setCustomProperty("widget",!0,t),t.getFillerOffset=nVe,e.setCustomProperty("widgetLabel",[],t),n.label&&eVe(t,n.label),n.hasSelectionHandle&&iVe(t,e),nX(t,e),t}function Z4e(t,e,n){if(e.classes&&n.addClass(li(e.classes),t),e.attributes)for(const i in e.attributes)n.setAttribute(i,e.attributes[i],t)}function Q4e(t,e,n){if(e.classes&&n.removeClass(li(e.classes),t),e.attributes)for(const i in e.attributes)n.removeAttribute(i,t)}function nX(t,e,n=Z4e,i=Q4e){const r=new Y4e;r.on("change:top",(a,l)=>{l.oldDescriptor&&i(t,l.oldDescriptor,l.writer),l.newDescriptor&&n(t,l.newDescriptor,l.writer)});const o=(a,l,u)=>r.add(l,u),s=(a,l,u)=>r.remove(l,u);e.setCustomProperty("addHighlight",o,t),e.setCustomProperty("removeHighlight",s,t)}function eVe(t,e){t.getCustomProperty("widgetLabel").push(e)}function tVe(t){return t.getCustomProperty("widgetLabel").reduce((n,i)=>typeof i=="function"?n?n+". "+i():i():n?n+". "+i:i,"")}function bO(t,e,n={}){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],t),n.withAriaRole!==!1&&e.setAttribute("role","textbox",t),t.isReadOnly||e.setAttribute("tabindex","-1",t),n.label&&e.setAttribute("aria-label",n.label,t),e.setAttribute("contenteditable",t.isReadOnly?"false":"true",t),t.on("change:isReadOnly",(i,r,o)=>{e.setAttribute("contenteditable",o?"false":"true",t),o?e.removeAttribute("tabindex",t):e.setAttribute("tabindex","-1",t)}),t.on("change:isFocused",(i,r,o)=>{o?e.addClass("ck-editor__nested-editable_focused",t):e.removeClass("ck-editor__nested-editable_focused",t)}),nX(t,e),t}function iX(t,e){const n=t.getSelectedElement();if(n){const i=zl(t);if(i)return e.createRange(e.createPositionAt(n,i))}return e.schema.findOptimalInsertionRange(t)}function nVe(){return null}function iVe(t,e){const n=e.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(i){const r=this.toDomElement(i),o=new Sa;return o.set("content",UDe),o.render(),r.appendChild(o.element),r});e.insert(e.createPositionAt(t,0),n),e.addClass(["ck-widget_with-selection-handle"],t)}function yO(t){const e=a=>{const{width:l,paddingLeft:u,paddingRight:c}=a.ownerDocument.defaultView.getComputedStyle(a);return parseFloat(l)-(parseFloat(u)||0)-(parseFloat(c)||0)},n=t.parentElement;if(!n)return 0;let i=e(n);const r=5;let o=0,s=n;for(;isNaN(i);){if(s=s.parentElement,++o>r)return 0;i=e(s)}return i}function rVe(t,e=new Wt(t)){const n=yO(t);return n?e.width/n*100:0}const Fl="widget-type-around";function ud(t,e,n){return!!t&&ci(t)&&!n.isInline(e)}function oVe(t){return t.closest(".ck-widget__type-around__button")}function sVe(t){return t.classList.contains("ck-widget__type-around__button_before")?"before":"after"}function aVe(t,e){const n=t.closest(".ck-widget");return e.mapDomToView(n)}function zl(t){return t.getAttribute(Fl)}const rX=["before","after"],lVe=new DOMParser().parseFromString(mNe,"image/svg+xml").firstChild,sF="ck-widget__type-around_disabled";class uVe extends xe{_currentFakeCaretModelElement=null;static get pluginName(){return"WidgetTypeAround"}static get isOfficialPlugin(){return!0}static get requires(){return[kS,yu]}init(){const e=this.editor,n=e.editing.view;this.on("change:isEnabled",(i,r,o)=>{n.change(s=>{for(const a of n.document.roots)o?s.removeClass(sF,a):s.addClass(sF,a)}),o||e.model.change(s=>{s.removeSelectionAttribute(Fl)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(e,n){const i=this.editor,r=i.editing.view,o=i.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);i.execute("insertParagraph",{position:i.model.createPositionAt(e,n),attributes:o}),r.focus(),r.scrollToTheSelection()}_listenToIfEnabled(e,n,i,r){this.listenTo(e,n,(...o)=>{this.isEnabled&&i(...o)},r)}_insertParagraphAccordingToFakeCaretPosition(){const i=this.editor.model.document.selection,r=zl(i);if(!r)return!1;const o=i.getSelectedElement();return this._insertParagraph(o,r),!0}_enableTypeAroundUIInjection(){const e=this.editor,n=e.model.schema,i=e.locale.t,r={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(o,s,a)=>{const l=a.mapper.toViewElement(s.item);l&&ud(l,s.item,n)&&(cVe(a.writer,r,l),l.getCustomProperty("widgetLabel").push(()=>this.isEnabled?i("Press Enter to type after or press Shift + Enter to type before the widget"):""))},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,n=e.model,i=n.document.selection,r=n.schema,o=e.editing.view;this._listenToIfEnabled(o.document,"arrowKey",(a,l)=>{this._handleArrowKeyPress(a,l)},{context:[ci,"$text"],priority:"high"}),this._listenToIfEnabled(i,"change:range",(a,l)=>{l.directChange&&e.model.change(u=>{u.removeSelectionAttribute(Fl)})}),this._listenToIfEnabled(n.document,"change:data",()=>{const a=i.getSelectedElement();if(a){const l=e.editing.mapper.toViewElement(a);if(ud(l,a,r))return}e.model.change(l=>{l.removeSelectionAttribute(Fl)})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(a,l,u)=>{const c=u.writer;if(this._currentFakeCaretModelElement){const m=u.mapper.toViewElement(this._currentFakeCaretModelElement);m&&(c.removeClass(rX.map(s),m),this._currentFakeCaretModelElement=null)}const d=l.selection.getSelectedElement();if(!d)return;const f=u.mapper.toViewElement(d);if(!ud(f,d,r))return;const h=zl(l.selection);h&&(c.addClass(s(h),f),this._currentFakeCaretModelElement=d)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(a,l,u)=>{u||e.model.change(c=>{c.removeSelectionAttribute(Fl)})});function s(a){return`ck-widget_type-around_show-fake-caret_${a}`}}_handleArrowKeyPress(e,n){const i=this.editor,r=i.model,o=r.document.selection,s=r.schema,a=i.editing.view;if(n.shiftKey)return;const l=n.keyCode,u=ORe(l,i.locale.contentLanguageDirection),c=a.document.selection.getSelectedElement(),d=i.editing.mapper.toModelElement(c);let f;ud(c,d,s)?f=this._handleArrowKeyPressOnSelectedWidget(u):o.isCollapsed?f=this._handleArrowKeyPressWhenSelectionNextToAWidget(u):n.shiftKey||(f=this._handleArrowKeyPressWhenNonCollapsedSelection(u)),f&&(n.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const i=this.editor.model,r=i.document.selection,o=zl(r);return i.change(s=>{if(o){if(!(o===(e?"after":"before")))return s.removeSelectionAttribute(Fl),!0}else return s.setSelectionAttribute(Fl,e?"after":"before"),!0;return!1})}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const n=this.editor,i=n.model,r=i.schema,o=n.plugins.get("Widget"),s=o._getObjectElementNextToSelection(e),a=n.editing.mapper.toViewElement(s);return ud(a,s,r)?(i.change(l=>{o._setSelectionOverElement(s),l.setSelectionAttribute(Fl,e?"before":"after")}),!0):!1}_handleArrowKeyPressWhenNonCollapsedSelection(e){const n=this.editor,i=n.model,r=i.schema,o=n.editing.mapper,s=i.document.selection,a=e?s.getLastPosition().nodeBefore:s.getFirstPosition().nodeAfter,l=o.toViewElement(a);return ud(l,a,r)?(i.change(u=>{u.setSelection(a,"on"),u.setSelectionAttribute(Fl,e?"after":"before")}),!0):!1}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,n=e.editing.view;this._listenToIfEnabled(n.document,"mousedown",(i,r)=>{const o=oVe(r.domTarget);if(!o)return;const s=sVe(o),a=aVe(o,n.domConverter),l=e.editing.mapper.toModelElement(a);this._insertParagraph(l,s),r.preventDefault(),i.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,n=e.model.document.selection,i=e.editing.view;this._listenToIfEnabled(i.document,"enter",(r,o)=>{if(r.eventPhase!="atTarget")return;const s=n.getSelectedElement(),a=e.editing.mapper.toViewElement(s),l=e.model.schema;let u;this._insertParagraphAccordingToFakeCaretPosition()?u=!0:ud(a,s,l)&&(this._insertParagraph(s,o.isSoft?"before":"after"),u=!0),u&&(o.preventDefault(),r.stop())},{context:ci})}_enableInsertingParagraphsOnTypingKeystroke(){const n=this.editor.editing.view.document;this._listenToIfEnabled(n,"insertText",(i,r)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(r.selection=n.selection)},{priority:"high"}),vt.isAndroid?this._listenToIfEnabled(n,"keydown",(i,r)=>{r.keyCode==229&&this._insertParagraphAccordingToFakeCaretPosition()}):this._listenToIfEnabled(n,"compositionstart",()=>{this._insertParagraphAccordingToFakeCaretPosition()},{priority:"highest"})}_enableDeleteIntegration(){const e=this.editor,n=e.editing.view,i=e.model,r=i.schema;this._listenToIfEnabled(n.document,"delete",(o,s)=>{if(o.eventPhase!="atTarget")return;const a=zl(i.document.selection);if(!a)return;const l=s.direction,u=i.document.selection.getSelectedElement(),c=a==="before",d=l=="forward";if(c===d)e.execute("delete",{selection:i.createSelection(u,"on")});else{const h=r.getNearestSelectionRange(i.createPositionAt(u,a),l);if(h)if(!h.isCollapsed)i.change(m=>{m.setSelection(h),e.execute(d?"deleteForward":"delete")});else{const m=i.createSelection(h.start);if(i.modifySelection(m,{direction:l}),!m.focus.isEqual(h.start))i.change(g=>{g.setSelection(h),e.execute(d?"deleteForward":"delete")});else{const g=hVe(r,h.start.parent);i.deleteContent(i.createSelection(g,"on"),{doNotAutoparagraph:!0})}}}s.preventDefault(),o.stop()},{context:ci})}_enableInsertContentIntegration(){const e=this.editor,n=this.editor.model,i=n.document.selection;this._listenToIfEnabled(e.model,"insertContent",(r,[o,s])=>{if(s&&!s.is("documentSelection"))return;const a=zl(i);if(a)return r.stop(),n.change(l=>{const u=i.getSelectedElement(),c=n.createPositionAt(u,a),d=l.createSelection(c),f=n.insertContent(o,d);return l.setSelection(d),f})},{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,i=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",(r,o)=>{const[,s,a={}]=o;if(s&&!s.is("documentSelection"))return;const l=zl(i);l&&(a.findOptimalPosition=l,o[3]=a)},{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,i=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(r,[o])=>{if(o&&!o.is("documentSelection"))return;zl(i)&&r.stop()},{priority:"high"})}}function cVe(t,e,n){const i=t.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(r){const o=this.toDomElement(r);return dVe(o,e),fVe(o),o});t.insert(t.createPositionAt(n,"end"),i)}function dVe(t,e){for(const n of rX){const i=new Io({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${n}`],title:e[n],"aria-hidden":"true"},children:[t.ownerDocument.importNode(lVe,!0)]});t.appendChild(i.render())}}function fVe(t){const e=new Io({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});t.appendChild(e.render())}function hVe(t,e){let n=e;for(const i of e.getAncestors({parentFirst:!0})){if(i.childCount>1||t.isLimit(i))break;n=i}return n}function mVe(t){const e=t.model;return(n,i)=>{const r=i.keyCode==Yt.arrowup,o=i.keyCode==Yt.arrowdown,s=i.shiftKey,a=e.document.selection;if(!r&&!o)return;const l=o,u=gVe(t,a,l);if(u){if(u.isCollapsed){if(a.isCollapsed)return;if(s)return}(u.isCollapsed||pVe(t,u,l))&&(e.change(c=>{const d=l?u.end:u.start;if(s){const f=e.createSelection(a.anchor);f.setFocus(d),c.setSelection(f)}else c.setSelection(d)}),n.stop(),i.preventDefault(),i.stopPropagation())}}}function gVe(t,e,n){const i=t.model;if(n){const r=e.focus,o=aF(i,r,"forward");if(!o)return;const s=i.createRange(r,o),a=lF(i.schema,s,"backward");if(a)return i.createRange(r,a)}else{const r=e.focus,o=aF(i,r,"backward");if(!o)return;const s=i.createRange(o,r),a=lF(i.schema,s,"forward");if(a)return i.createRange(a,r)}}function aF(t,e,n){const i=t.schema,r=t.createRangeIn(e.root),o=n=="forward"?"elementStart":"elementEnd";for(const{previousPosition:s,item:a,type:l}of r.getWalker({startPosition:e,direction:n})){if(i.isLimit(a)&&!i.isInline(a))return s;if(l==o&&i.isBlock(a))return null}return null}function lF(t,e,n){const i=n=="backward"?e.end:e.start;if(t.checkChild(i,"$text"))return i;for(const{nextPosition:r}of e.getWalker({direction:n}))if(t.checkChild(r,"$text"))return r}function pVe(t,e,n){const i=t.model,r=t.view.domConverter;if(n){const u=i.createSelection(e.start);i.modifySelection(u),!u.focus.isAtEnd&&!e.start.isEqual(u.focus)&&(e=i.createRange(u.focus,e.end))}const o=t.mapper.toViewRange(e),s=r.viewRangeToDom(o),a=Wt.getDomRangeRects(s);let l;for(const u of a){if(l===void 0){l=Math.round(u.bottom);continue}if(Math.round(u.top)>=l)return!1;l=Math.max(l,Math.round(u.bottom))}return!0}class h0 extends xe{_previouslySelected=new Set;static get pluginName(){return"Widget"}static get isOfficialPlugin(){return!0}static get requires(){return[uVe,yu]}init(){const e=this.editor,n=e.editing.view,i=n.document,r=e.t;this.editor.editing.downcastDispatcher.on("selection",(o,s,a)=>{const l=a.writer,u=s.selection;if(u.isCollapsed)return;const c=u.getSelectedElement();if(!c)return;const d=e.editing.mapper.toViewElement(c);ci(d)&&a.consumable.consume(u,"selection")&&l.setSelection(l.createRangeOn(d),{fake:!0,label:tVe(d)})}),this.editor.editing.downcastDispatcher.on("selection",(o,s,a)=>{this._clearPreviouslySelectedWidgets(a.writer);const l=a.writer,u=l.document.selection;let c=null;for(const d of u.getRanges())for(const f of d){const h=f.item;ci(h)&&!_Ve(h,c)&&(l.addClass(oF,h),this._previouslySelected.add(h),c=h)}},{priority:"low"}),n.addObserver(nO),n.addObserver(YG),this.listenTo(i,"mousedown",(...o)=>this._onMousedown(...o)),this.listenTo(i,"pointerdown",(...o)=>this._onPointerdown(...o)),this.listenTo(i,"arrowKey",(...o)=>{this._handleSelectionChangeOnArrowKeyPress(...o)},{context:[ci,"$text"]}),this.listenTo(i,"arrowKey",(...o)=>{this._preventDefaultOnArrowKeyPress(...o)},{context:"$root"}),this.listenTo(i,"arrowKey",mVe(this.editor.editing),{context:"$text"}),this.listenTo(i,"delete",(o,s)=>{this._handleDelete(s.direction=="forward")&&(s.preventDefault(),o.stop())},{context:"$root"}),this.listenTo(i,"tab",(o,s)=>{this._selectNextEditable(s.shiftKey?"backward":"forward")&&(n.scrollToTheSelection(),s.preventDefault(),o.stop())},{context:o=>ci(o)||o.is("editableElement"),priority:"low"}),this.listenTo(i,"keydown",(o,s)=>{s.keystroke==Yt.esc&&this._selectAncestorWidget()&&(s.preventDefault(),o.stop())},{context:o=>o.is("editableElement"),priority:"low"}),e.accessibility.addKeystrokeInfoGroup({id:"widget",label:r("Keystrokes that can be used when a widget is selected (for example: image, table, etc.)"),keystrokes:[{label:r("Move focus from an editable area back to the parent widget"),keystroke:"Esc"},{label:r("Insert a new paragraph directly after a widget"),keystroke:"Enter"},{label:r("Insert a new paragraph directly before a widget"),keystroke:"Shift+Enter"},{label:r("Move the caret to allow typing directly before a widget"),keystroke:[["arrowup"],["arrowleft"]]},{label:r("Move the caret to allow typing directly after a widget"),keystroke:[["arrowdown"],["arrowright"]]}]})}_onMousedown(e,n){const i=n.target;i&&n.domEvent.detail>=3&&this._selectBlockContent(i)&&n.preventDefault()}_onPointerdown(e,n){if(!n.domEvent.isPrimary)return;const i=this.editor,r=i.editing.view,o=r.document;let s=n.target;if(!s)return;if(!ci(s)){const l=yVe(s);if(!l)return;if(ci(l))s=l;else{const u=wVe(r,n);if(u&&ci(u))s=u;else return}}(vt.isAndroid||vt.isiOS)&&n.preventDefault(),o.isFocused||r.focus();const a=i.editing.mapper.toModelElement(s);this._setSelectionOverElement(a)}_selectBlockContent(e){const n=this.editor,i=n.model,r=n.editing.mapper,o=i.schema,s=r.findMappedViewAncestor(this.editor.editing.view.createPositionAt(e,0)),a=CVe(r.toModelElement(s),i.schema);return a?(i.change(l=>{const u=o.isLimit(a)?null:SVe(l.createPositionAfter(a),o),c=l.createPositionAt(a,0),d=u?l.createPositionAt(u,0):l.createPositionAt(a,"end");l.setSelection(l.createRange(c,d))}),!0):!1}_handleSelectionChangeOnArrowKeyPress(e,n){const i=n.keyCode,r=this.editor.model,o=r.schema,s=r.document.selection,a=s.getSelectedElement(),l=$M(i,this.editor.locale.contentLanguageDirection),u=l=="down"||l=="right",c=l=="up"||l=="down";if(!n.shiftKey&&!s.isCollapsed){if(vVe(s,o)){const p=u?s.getLastPosition():s.getFirstPosition(),b=o.getNearestSelectionRange(p,u?"forward":"backward");b&&(r.change(y=>{y.setSelection(b)}),n.preventDefault(),e.stop())}return}const d=bVe(r,u),f=r.createSelection(d);if(r.modifySelection(f,{direction:u?"forward":"backward"}),f.isEqual(d))return;f.focus.isTouching(d.focus)&&r.modifySelection(f,{direction:u?"forward":"backward"});const h=u?d.focus.nodeBefore:d.focus.nodeAfter,m=f.focus.nodeBefore,g=f.focus.nodeAfter,v=u?m:g;if(n.shiftKey)(a&&o.isObject(a)||v&&o.isObject(v)||h&&o.isObject(h))&&(r.change(p=>{p.setSelection(f)}),n.preventDefault(),e.stop());else if(v&&o.isObject(v)){if(o.isInline(v)&&c)return;r.change(p=>{p.setSelection(v,"on")}),n.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,n){const i=this.editor.model,r=i.schema,o=i.document.selection.getSelectedElement();o&&r.isObject(o)&&(n.preventDefault(),e.stop())}_handleDelete(e){const i=this.editor.model.document.selection;if(!this.editor.model.canEditAt(i)||!i.isCollapsed)return;const r=this._getObjectElementNextToSelection(e);if(r)return this.editor.model.change(o=>{let s=i.anchor.parent;for(;s.isEmpty;){const a=s;s=a.parent,o.remove(a)}this._setSelectionOverElement(r)}),!0}_setSelectionOverElement(e){this.editor.model.change(n=>{n.setSelection(n.createRangeOn(e))})}_getObjectElementNextToSelection(e){const n=this.editor.model,i=n.schema,r=n.document.selection,o=n.createSelection(r);if(n.modifySelection(o,{direction:e?"forward":"backward"}),o.isEqual(r))return null;const s=e?o.focus.nodeBefore:o.focus.nodeAfter;return s&&i.isObject(s)?s:null}_clearPreviouslySelectedWidgets(e){for(const n of this._previouslySelected)e.removeClass(oF,n);this._previouslySelected.clear()}_selectNextEditable(e){const n=this.editor.editing,i=n.view,r=this.editor.model,o=i.document.selection,s=r.document.selection;let a;if(s.rangeCount>1){const u=s.isBackward?s.getFirstRange():s.getLastRange();a=n.mapper.toViewPosition(e=="forward"?u.end:u.start)}else a=e=="forward"?o.getFirstPosition():o.getLastPosition();const l=this._findNextFocusRange(a,e);return l?(r.change(u=>{u.setSelection(l)}),!0):!1}_findNextFocusRange(e,n){const i=this.editor.editing,r=i.view,o=this.editor.model,s=r.document.selection,a=s.editableElement,l=a.getPath();let u=s.getSelectedElement();u&&!ci(u)&&(u=null);const c=n=="forward"?r.createRange(e,r.createPositionAt(e.root,"end")):r.createRange(r.createPositionAt(e.root,0),e);for(const{nextPosition:d}of c.getWalker({direction:n})){const f=d.parent;if(ci(f)&&f!=u){const h=i.mapper.toModelElement(f);if(!o.schema.isBlock(h))continue;if(ur(l,f.getPath())!="extension")return o.createRangeOn(h)}else if(f.is("editableElement")){if(f==a&&!u)continue;const h=i.mapper.toModelPosition(d),m=o.schema.getNearestSelectionRange(h,n);if(!m)continue;return f==a&&u?m:ur(l,f.getPath())!="extension"?o.createRangeIn(o.schema.getLimitElement(m)):m}}return null}_selectAncestorWidget(){const e=this.editor,n=e.editing.mapper,r=e.editing.view.document.selection.getFirstPosition().parent,s=(r.is("$text")?r.parent:r).findAncestor(ci);if(!s)return!1;const a=n.toModelElement(s);return a?(e.model.change(l=>{l.setSelection(a,"on")}),!0):!1}}function vVe(t,e){const n=t.getFirstPosition(),i=t.getLastPosition(),r=n.nodeAfter,o=i.nodeBefore;return!!r&&e.isObject(r)||!!o&&e.isObject(o)}function bVe(t,e){const n=t.document.selection,i=n.getSelectedElement(),r=zl(n);return i&&r=="before"?t.createSelection(i,"before"):i&&r=="after"?t.createSelection(i,"after"):t.createSelection(n.getRanges(),{backward:i&&t.schema.isObject(i)?!e:n.isBackward})}function yVe(t){let e=t;for(;e;){if(e.is("editableElement")||ci(e))return e;e=e.parent}return null}function wVe(t,e){const n=XK(e.domEvent);let i=null;if(n?i=t.domConverter.domRangeToView(n):i=t.createRange(t.createPositionAt(e.target,0)),!i)return null;const r=i.start;if(!r.parent)return null;let o=r.parent;return r.parent.is("editableElement")&&(r.isAtEnd&&r.nodeBefore?o=r.nodeBefore:r.isAtStart&&r.nodeAfter&&(o=r.nodeAfter)),o.is("$text")?o.parent:o}function _Ve(t,e){return e?Array.from(t.getAncestors()).includes(e):!1}function CVe(t,e){for(const n of t.getAncestors({includeSelf:!0,parentFirst:!0})){if(e.checkChild(n,"$text"))return n;if(e.isLimit(n)&&!e.isObject(n))break}return null}function SVe(t,e){const n=new Ql({startPosition:t});for(const{item:i}of n){if(e.isLimit(i)||!i.is("element"))return null;if(e.checkChild(i,"$text"))return i}return null}class y1 extends xe{_toolbarDefinitions=new Map;_balloon;static get requires(){return[bu]}static get pluginName(){return"WidgetToolbarRepository"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const n=e.plugins.get("BalloonToolbar");this.listenTo(n,"show",i=>{kVe(e.editing.view.document.selection)&&i.stop()},{priority:"high"})}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:n,items:i,getRelatedElement:r,balloonClassName:o="ck-toolbar-container",positions:s}){if(!i.length){hn("widget-toolbar-no-items",{toolbarId:e});return}const a=this.editor,l=a.t,u=new Xm(a.locale);if(u.ariaLabel=n||l("Widget toolbar"),this._toolbarDefinitions.has(e))throw new oe("widget-toolbar-duplicated",this,{toolbarId:e});const c={view:u,getRelatedElement:r,balloonClassName:o,itemsConfig:i,positions:s,initialized:!1};a.ui.addToolbar(u,{isContextual:!0,beforeFocus:()=>{const d=r(a.editing.view.document.selection);d&&this._showToolbar(c,d)},afterBlur:()=>{this._hideToolbar(c)}}),this._toolbarDefinitions.set(e,c)}_updateToolbarsVisibility(){let e=0,n=null,i=null;for(const r of this._toolbarDefinitions.values()){const o=r.getRelatedElement(this.editor.editing.view.document.selection);if(!this.isEnabled||!o)this._isToolbarInBalloon(r)&&this._hideToolbar(r);else if(!this.editor.ui.focusTracker.isFocused)this._isToolbarVisible(r)&&this._hideToolbar(r);else{const s=o.getAncestors().length;s>e&&(e=s,n=o,i=r)}}i&&this._showToolbar(i,n)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,n){this._isToolbarVisible(e)?uF(this.editor,n,e.positions):this._isToolbarInBalloon(e)||(e.initialized||(e.initialized=!0,e.view.fillFromConfig(e.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:e.view,position:oX(this.editor,n,e.positions),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const i of this._toolbarDefinitions.values())if(this._isToolbarVisible(i)){const r=i.getRelatedElement(this.editor.editing.view.document.selection);uF(this.editor,r,e.positions)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function uF(t,e,n){const i=t.plugins.get("ContextualBalloon"),r=oX(t,e,n);i.updatePosition(r)}function oX(t,e,n){const i=t.editing.view,r=Ki.defaultPositions;return{target:i.domConverter.mapViewToDom(e),positions:n||[r.northArrowSouth,r.northArrowSouthWest,r.northArrowSouthEast,r.southArrowNorth,r.southArrowNorthWest,r.southArrowNorthEast,r.viewportStickyNorth]}}function kVe(t){const e=t.getSelectedElement();return!!(e&&ci(e))}class TVe extends Ln(){_referenceCoordinates;_options;_originalWidth;_originalHeight;_originalWidthPercents;_aspectRatio;constructor(e){super(),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}get originalWidth(){return this._originalWidth}get originalHeight(){return this._originalHeight}get originalWidthPercents(){return this._originalWidthPercents}get aspectRatio(){return this._aspectRatio}begin(e,n,i){const r=new Wt(n);this.activeHandlePosition=AVe(e),this._referenceCoordinates=EVe(n,PVe(this.activeHandlePosition)),this._originalWidth=r.width,this._originalHeight=r.height,this._aspectRatio=r.width/r.height;const o=i.style.width;o&&o.match(/^\d+(\.\d*)?%$/)?this._originalWidthPercents=parseFloat(o):this._originalWidthPercents=rVe(i,r)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}function EVe(t,e){const n=new Wt(t),i=e.split("-"),r={x:i[1]=="right"?n.right:n.left,y:i[0]=="bottom"?n.bottom:n.top};return r.x+=t.ownerDocument.defaultView.scrollX,r.y+=t.ownerDocument.defaultView.scrollY,r}function xVe(t){return`ck-widget__resizer__handle-${t}`}function AVe(t){const e=["top-left","top-right","bottom-right","bottom-left"];for(const n of e)if(t.classList.contains(xVe(n)))return n}function PVe(t){const e=t.split("-"),n={top:"bottom",bottom:"top",left:"right",right:"left"};return`${n[e[0]]}-${n[e[1]]}`}class IVe extends ut{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",n=>n?`ck-orientation-${n}`:"")],style:{display:e.if("_isVisible","none",n=>!n)}},children:[{text:e.to("_label")}]})}_bindToState(e,n){this.bind("_isVisible").to(n,"proposedWidth",n,"proposedHeight",(i,r)=>i!==null&&r!==null),this.bind("_label").to(n,"proposedHandleHostWidth",n,"proposedHandleHostHeight",n,"proposedWidthPercents",(i,r,o)=>e.unit==="px"?`${i}×${r}`:`${o}%`),this.bind("_viewPosition").to(n,"activeHandlePosition",n,"proposedHandleHostWidth",n,"proposedHandleHostHeight",(i,r,o)=>r<50||o<50?"above-center":i)}_dismiss(){this.unbind(),this._isVisible=!1}}class cF extends Ln(){_state;_sizeView;_options;_viewResizerWrapper=null;_initialViewWidth;constructor(e){super(),this._options=e,this.set("isEnabled",!0),this.set("isSelected",!1),this.bind("isVisible").to(this,"isEnabled",this,"isSelected",(n,i)=>n&&i),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",n=>{!this.state.proposedWidth&&!this.state.proposedWidthPercents&&(this._cleanup(),n.stop())},{priority:"high"})}get state(){return this._state}show(){this._options.editor.editing.view.change(n=>{n.removeClass("ck-hidden",this._viewResizerWrapper)})}hide(){this._options.editor.editing.view.change(n=>{n.addClass("ck-hidden",this._viewResizerWrapper)})}attach(){const e=this,n=this._options.viewElement;this._options.editor.editing.view.change(r=>{const o=r.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},function(s){const a=this.toDomElement(s);return e._appendHandles(a),e._appendSizeUI(a),a});r.insert(r.createPositionAt(n,"end"),o),r.addClass("ck-widget_with-resizer",n),this._viewResizerWrapper=o,this.isVisible||this.hide()}),this.on("change:isVisible",()=>{this.isVisible?(this.show(),this.redraw()):this.hide()})}begin(e){this._state=new TVe(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 n=this._proposeNewSize(e);this._options.editor.editing.view.change(u=>{const c=this._options.unit||"%",d=(c==="%"?n.widthPercents:n.width)+c;u.setStyle("width",d,this._options.viewElement)});const r=this._getHandleHost(),o=new Wt(r),s=Math.round(o.width),a=Math.round(o.height),l=new Wt(r);n.width=Math.round(l.width),n.height=Math.round(l.height),this.redraw(o),this.state.update({...n,handleHostWidth:s,handleHostHeight:a})}commit(){const e=this._options.unit||"%",n=(e==="%"?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(n)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const n=this._domResizerWrapper;if(!OVe(n))return;const i=n.parentElement,r=this._getHandleHost(),o=this._viewResizerWrapper,s=[o.getStyle("width"),o.getStyle("height"),o.getStyle("left"),o.getStyle("top")];let a;if(i.isSameNode(r)){const l=e||new Wt(r);a=[l.width+"px",l.height+"px",void 0,void 0]}else a=[r.offsetWidth+"px",r.offsetHeight+"px",r.offsetLeft+"px",r.offsetTop+"px"];ur(s,a)!=="same"&&this._options.editor.editing.view.change(l=>{l.setStyle({width:a[0],height:a[1],left:a[2],top:a[3]},o)})}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(n=>{n.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){const n=this.state,i=MVe(e),r=this._options.isCentered?this._options.isCentered(this):!0,o={x:n._referenceCoordinates.x-(i.x+n.originalWidth),y:i.y-n.originalHeight-n._referenceCoordinates.y};r&&n.activeHandlePosition.endsWith("-right")&&(o.x=i.x-(n._referenceCoordinates.x+n.originalWidth)),r&&(o.x*=2);let s=Math.abs(n.originalWidth+o.x),a=Math.abs(n.originalHeight+o.y);return(s/n.aspectRatio>a?"width":"height")=="width"?a=s/n.aspectRatio:s=a*n.aspectRatio,{width:Math.round(s),height:Math.round(a),widthPercents:Math.min(Math.round(n.originalWidthPercents/n.originalWidth*s*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 n=["top-left","top-right","bottom-right","bottom-left"];for(const i of n)e.appendChild(new Io({tag:"div",attributes:{class:`ck-widget__resizer__handle ${RVe(i)}`}}).render())}_appendSizeUI(e){this._sizeView=new IVe,this._sizeView.render(),e.appendChild(this._sizeView.element)}}function RVe(t){return`ck-widget__resizer__handle-${t}`}function MVe(t){return{x:t.pageX,y:t.pageY}}function OVe(t){return t&&t.ownerDocument&&t.ownerDocument.contains(t)}class iE extends xe{_resizers=new Map;_observer;_redrawSelectedResizerThrottled;static get pluginName(){return"WidgetResize"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.editing,n=Qe.window.document;this.set("selectedResizer",null),this.set("_activeResizer",null),e.view.addObserver(nO),this._observer=new(zo()),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(n,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(n,"mouseup",this._mouseUpListener.bind(this)),this._redrawSelectedResizerThrottled=Km(()=>this.redrawSelectedResizer(),200),this.editor.ui.on("update",this._redrawSelectedResizerThrottled),this.editor.model.document.on("change",()=>{for(const[r,o]of this._resizers)r.isAttached()||(this._resizers.delete(r),o.destroy())},{priority:"lowest"}),this._observer.listenTo(Qe.window,"resize",this._redrawSelectedResizerThrottled);const i=this.editor.editing.view.document.selection;i.on("change",()=>{const r=i.getSelectedElement(),o=this.getResizerByViewElement(r)||null;o?this.select(o):this.deselect()})}redrawSelectedResizer(){this.selectedResizer&&this.selectedResizer.isVisible&&this.selectedResizer.redraw()}destroy(){super.destroy(),this._observer.stopListening();for(const e of this._resizers.values())e.destroy();this._redrawSelectedResizerThrottled.cancel()}select(e){this.deselect(),this.selectedResizer=e,this.selectedResizer.isSelected=!0}deselect(){this.selectedResizer&&(this.selectedResizer.isSelected=!1),this.selectedResizer=null}attachTo(e){const n=new cF(e),i=this.editor.plugins;if(n.attach(),i.has("WidgetToolbarRepository")){const s=i.get("WidgetToolbarRepository");n.on("begin",()=>{s.forceDisabled("resize")},{priority:"lowest"}),n.on("cancel",()=>{s.clearForceDisabled("resize")},{priority:"highest"}),n.on("commit",()=>{s.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(e.viewElement,n);const o=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(o)==n&&this.select(n),n}getResizerByViewElement(e){return this._resizers.get(e)}_getResizerByHandle(e){for(const n of this._resizers.values())if(n.containsHandle(e))return n}_mouseDownListener(e,n){const i=n.domTarget;cF.isResizeHandle(i)&&(this._activeResizer=this._getResizerByHandle(i)||null,this._activeResizer&&(this._activeResizer.begin(i),e.stop(),n.preventDefault()))}_mouseMoveListener(e,n){this._activeResizer&&this._activeResizer.updateSize(n)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}class fb extends Cl{domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"];constructor(e){super(e);const n=this.document;this.listenTo(n,"paste",i("clipboardInput"),{priority:"low"}),this.listenTo(n,"drop",i("clipboardInput"),{priority:"low"}),this.listenTo(n,"dragover",i("dragging"),{priority:"low"});function i(r){return(o,s)=>{s.preventDefault();const a=s.dropRange?[s.dropRange]:null,l=new pu(n,r);n.fire(l,{dataTransfer:s.dataTransfer,method:o.name,targetRanges:a,target:s.target,domEvent:s.domEvent}),l.stop.called&&s.stopPropagation()}}}onDomEvent(e){const n="clipboardData"in e?e.clipboardData:e.dataTransfer,i=e.type=="drop"||e.type=="paste",r={dataTransfer:new bG(n,{cacheFiles:i})};if(e.type=="drop"||e.type=="dragover"){const o=XK(e);r.dropRange=o&&this.view.domConverter.domRangeToView(o)}this.fire(e.type,e,r)}}function LVe(t){return t=t.replace(/&/g,"&").replace(//g,">").replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
").replace(/\t/g,"    ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  "),(t.includes("

")||t.includes("
"))&&(t=`

${t}

`),t}function DVe(t){return t.replace(/(\s+)<\/span>/g,(e,n)=>n.length==1?" ":n).replace(//g,"")}const dF=["figcaption","li"],fF=["ol","ul"];function sX(t,e){if(e.is("$text")||e.is("$textProxy"))return e.data;if(e.is("element","img")&&e.hasAttribute("alt"))return e.getAttribute("alt");if(e.is("element","br"))return` +`;let n="",i=null;for(const r of e.getChildren())n+=NVe(r,i)+sX(t,r),i=r;if(e.is("rawElement")){const o=document.implementation.createHTMLDocument("").createElement("div");e.render(o,t),n+=aX(o)}return n}function aX(t){let e="";if(t.nodeType===Node.TEXT_NODE)return t.textContent;if(t.tagName==="BR")return` +`;for(const n of t.childNodes)e+=aX(n);return e}function NVe(t,e){return e?t.is("element","li")&&!t.isEmpty&&t.getChild(0).is("containerElement")||fF.includes(t.name)&&fF.includes(e.name)?` + +`:!t.is("containerElement")&&!e.is("containerElement")?"":dF.includes(t.name)||dF.includes(e.name)?` +`:t.is("element")&&t.getCustomProperty("dataPipeline:transparentRendering")||e.is("element")&&e.getCustomProperty("dataPipeline:transparentRendering")?"":` + +`:""}class av extends xe{_markersToCopy=new Map;static get pluginName(){return"ClipboardMarkersUtils"}static get isOfficialPlugin(){return!0}_registerMarkerToCopy(e,n){this._markersToCopy.set(e,n)}_copySelectedFragmentWithMarkers(e,n,i=r=>r.model.getSelectedContent(r.model.document.selection)){return this.editor.model.change(r=>{const o=r.model.document.selection;r.setSelection(n);const s=this._insertFakeMarkersIntoSelection(r,r.model.document.selection,e),a=i(r),l=this._removeFakeMarkersInsideElement(r,a);for(const[u,c]of Object.entries(s)){l[u]||=r.createRangeIn(a);for(const d of c)r.remove(d)}a.markers.clear();for(const[u,c]of Object.entries(l))a.markers.set(u,c);return r.setSelection(o),a})}_pasteMarkersIntoTransformedElement(e,n){const i=this._getPasteMarkersFromRangeMap(e);return this.editor.model.change(r=>{const o=this._insertFakeMarkersElements(r,i),s=n(r),a=this._removeFakeMarkersInsideElement(r,s);for(const l of Object.values(o).flat())r.remove(l);for(const[l,u]of Object.entries(a))r.model.markers.has(l)||r.addMarker(l,{usingOperation:!0,affectsData:!0,range:u});return s})}_pasteFragmentWithMarkers(e){const n=this._getPasteMarkersFromRangeMap(e.markers);e.markers.clear();for(const i of n)e.markers.set(i.name,i.range);return this.editor.model.insertContent(e)}_forceMarkersCopy(e,n,i={allowedActions:"all",copyPartiallySelected:!0,duplicateOnPaste:!0}){const r=this._markersToCopy.get(e);this._markersToCopy.set(e,i),n(),r?this._markersToCopy.set(e,r):this._markersToCopy.delete(e)}_isMarkerCopyable(e,n){const i=this._getMarkerClipboardConfig(e);if(!i)return!1;if(!n)return!0;const{allowedActions:r}=i;return r==="all"||r.includes(n)}_hasMarkerConfiguration(e){return!!this._getMarkerClipboardConfig(e)}_getMarkerClipboardConfig(e){const[n]=e.split(":");return this._markersToCopy.get(n)||null}_insertFakeMarkersIntoSelection(e,n,i){const r=this._getCopyableMarkersFromSelection(e,n,i);return this._insertFakeMarkersElements(e,r)}_getCopyableMarkersFromSelection(e,n,i){const r=Array.from(n.getRanges()),o=new Set(r.flatMap(a=>Array.from(e.model.markers.getMarkersIntersectingRange(a)))),s=a=>{if(!this._isMarkerCopyable(a.name,i))return!1;const{copyPartiallySelected:u}=this._getMarkerClipboardConfig(a.name);if(!u){const c=a.getRange();return r.some(d=>d.containsRange(c,!0))}return!0};return Array.from(o).filter(s).map(a=>({name:i==="dragstart"?this._getUniqueMarkerName(a.name):a.name,range:a.getRange()}))}_getPasteMarkersFromRangeMap(e,n=null){const{model:i}=this.editor;return(e instanceof Map?Array.from(e.entries()):Object.entries(e)).flatMap(([o,s])=>{if(!this._hasMarkerConfiguration(o))return[{name:o,range:s}];if(this._isMarkerCopyable(o,n)){const a=this._getMarkerClipboardConfig(o),l=i.markers.has(o)&&i.markers.get(o).getRange().root.rootName==="$graveyard";return(a.duplicateOnPaste||l)&&(o=this._getUniqueMarkerName(o)),[{name:o,range:s}]}return[]})}_insertFakeMarkersElements(e,n){const i={},r=n.flatMap(o=>{const{start:s,end:a}=o.range;return[{position:s,marker:o,type:"start"},{position:a,marker:o,type:"end"}]}).sort(({position:o},{position:s})=>o.isBefore(s)?1:-1);for(const{position:o,marker:s,type:a}of r){const l=e.createElement("$marker",{"data-name":s.name,"data-type":a});i[s.name]||(i[s.name]=[]),i[s.name].push(l),e.insert(l,o)}return i}_removeFakeMarkersInsideElement(e,n){const r=this._getAllFakeMarkersFromElement(e,n).reduce((o,s)=>{const a=s.markerElement&&e.createPositionBefore(s.markerElement);let l=o[s.name],u=!1;return l?.start&&l?.end&&(this._getMarkerClipboardConfig(s.name).duplicateOnPaste?o[this._getUniqueMarkerName(s.name)]=o[s.name]:u=!0,l=null),u||(o[s.name]={...l,[s.type]:a}),s.markerElement&&e.remove(s.markerElement),o},{});return PIe(r,o=>new Ee(o.start||e.createPositionFromPath(n,[0]),o.end||e.createPositionAt(n,"end")))}_getAllFakeMarkersFromElement(e,n){const i=Array.from(e.createRangeIn(n)).flatMap(({item:s})=>{if(!s.is("element","$marker"))return[];const a=s.getAttribute("data-name"),l=s.getAttribute("data-type");return[{markerElement:s,name:a,type:l}]}),r=[],o=[];for(const s of i)s.type==="end"&&(i.some(l=>l.name===s.name&&l.type==="start")||r.push({markerElement:null,name:s.name,type:"start"})),s.type==="start"&&(i.some(l=>l.name===s.name&&l.type==="end")||o.unshift({markerElement:null,name:s.name,type:"end"}));return[...r,...i,...o]}_getUniqueMarkerName(e){const n=e.split(":"),i=Ur().substring(1,6);return n.length===3?`${n.slice(0,2).join(":")}:${i}`:`${n.join(":")}:${i}`}}class fs extends xe{static get pluginName(){return"ClipboardPipeline"}static get isOfficialPlugin(){return!0}static get requires(){return[av]}init(){this.editor.editing.view.addObserver(fb),this._setupPasteDrop(),this._setupCopyCut()}_fireOutputTransformationEvent(e,n,i){const r=this.editor.plugins.get("ClipboardMarkersUtils");this.editor.model.enqueueChange({isUndoable:i==="cut"},()=>{const o=r._copySelectedFragmentWithMarkers(i,n);this.fire("outputTransformation",{dataTransfer:e,content:o,method:i})})}_setupPasteDrop(){const e=this.editor,n=e.model,i=e.editing.view,r=i.document,o=this.editor.plugins.get("ClipboardMarkersUtils");this.listenTo(r,"clipboardInput",(s,a)=>{a.method=="paste"&&!e.model.canEditAt(e.model.document.selection)&&s.stop()},{priority:"highest"}),this.listenTo(r,"clipboardInput",(s,a)=>{const l=a.dataTransfer;let u;if(a.content)u=a.content;else{let f="";l.getData("text/html")?f=DVe(l.getData("text/html")):l.getData("text/plain")&&(f=LVe(l.getData("text/plain"))),u=this.editor.data.htmlProcessor.toView(f)}const c=new pu(this,"inputTransformation"),d=l.getData("application/ckeditor5-editor-id")||null;this.fire(c,{content:u,dataTransfer:l,sourceEditorId:d,targetRanges:a.targetRanges,method:a.method}),c.stop.called&&s.stop(),i.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(s,a)=>{if(a.content.isEmpty)return;const u=this.editor.data.toModel(a.content,"$clipboardHolder");u.childCount!=0&&(s.stop(),n.change(()=>{this.fire("contentInsertion",{content:u,method:a.method,sourceEditorId:a.sourceEditorId,dataTransfer:a.dataTransfer,targetRanges:a.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(s,a)=>{a.resultRange=o._pasteFragmentWithMarkers(a.content)},{priority:"low"})}_setupCopyCut(){const e=this.editor,n=e.model.document,r=e.editing.view.document,o=(s,a)=>{const l=a.dataTransfer;a.preventDefault(),this._fireOutputTransformationEvent(l,n.selection,s.name)};this.listenTo(r,"copy",o,{priority:"low"}),this.listenTo(r,"cut",(s,a)=>{e.model.canEditAt(e.model.document.selection)?o(s,a):a.preventDefault()},{priority:"low"}),this.listenTo(this,"outputTransformation",(s,a)=>{const l=e.data.toView(a.content,{isClipboardPipeline:!0});r.fire("clipboardOutput",{dataTransfer:a.dataTransfer,content:l,method:a.method})},{priority:"low"}),this.listenTo(r,"clipboardOutput",(s,a)=>{a.content.isEmpty||(a.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(a.content)),a.dataTransfer.setData("text/plain",sX(e.data.htmlProcessor.domConverter,a.content)),a.dataTransfer.setData("application/ckeditor5-editor-id",this.editor.id)),a.method=="cut"&&e.model.deleteContent(n.selection)},{priority:"low"})}}const rE=gg("px");let BVe=class extends ut{constructor(){super();const e=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",e.if("isVisible","ck-hidden",n=>!n)],style:{left:e.to("left",n=>rE(n)),top:e.to("top",n=>rE(n)),width:e.to("width",n=>rE(n))}}})}};class py extends xe{removeDropMarkerDelayed=zM(()=>this.removeDropMarker(),40);_updateDropMarkerThrottled=Km(e=>this._updateDropMarker(e),40);_reconvertMarkerThrottled=Km(()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")},0);_dropTargetLineView=new BVe;_domEmitter=new(zo());_scrollables=new Map;static get pluginName(){return"DragDropTarget"}static get isOfficialPlugin(){return!0}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(const{resizeObserver:e}of this._scrollables.values())e.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(e,n,i,r,o,s){this.removeDropMarkerDelayed.cancel();const a=hF(this.editor,e,n,i,r,o,s);return a?s&&s.containsRange(a)?(this.removeDropMarker(),null):a&&!this.editor.model.canEditAt(a)?(this.removeDropMarker(),null):(this._updateDropMarkerThrottled(a),a):null}getFinalDropRange(e,n,i,r,o,s){const a=hF(this.editor,e,n,i,r,o,s);return this.removeDropMarker(),a}removeDropMarker(){const e=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,e.markers.has("drop-target")&&e.change(n=>{n.removeMarker("drop-target")})}_setupDropMarker(){const e=this.editor;e.ui.view.body.add(this._dropTargetLineView),e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(n,{writer:i})=>{if(e.model.schema.checkChild(n.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(i);n.markerRange.isCollapsed?this._updateDropTargetLine(n.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(e){const n=this.editor,i=n.model.markers;n.model.change(r=>{i.has("drop-target")?i.get("drop-target").getRange().isEqual(e)||r.updateMarker("drop-target",{range:e}):r.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})})}_createDropTargetPosition(e){return e.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(n){const i=this.toDomElement(n);return i.append("⁠",n.createElement("span"),"⁠"),i})}_updateDropTargetLine(e){const n=this.editor.editing,i=e.start.nodeBefore,r=e.start.nodeAfter,o=e.start.parent,s=i?n.mapper.toViewElement(i):null,a=s?n.view.domConverter.mapViewToDom(s):null,l=r?n.mapper.toViewElement(r):null,u=l?n.view.domConverter.mapViewToDom(l):null,c=n.mapper.toViewElement(o);if(!c)return;const d=n.view.domConverter.mapViewToDom(c),f=this._getScrollableRect(c),{scrollX:h,scrollY:m}=Qe.window,g=a?new Wt(a):null,v=u?new Wt(u):null,p=new Wt(d).excludeScrollbarsAndBorders(),b=g?g.bottom:p.top,y=v?v.top:p.bottom,_=Qe.window.getComputedStyle(d),C=b<=y?(b+y)/2:y;if(f.topa.schema.checkChild(f,m))){if(a.schema.checkChild(f,"$text"))return a.createRange(f);if(d)return vy(t,mF(t,d.parent),i,r)}}}else if(a.schema.isInline(c))return vy(t,c,i,r)}if(a.schema.isBlock(c))return vy(t,c,i,r);if(a.schema.checkChild(c,"$block")){const d=Array.from(c.getChildren()).filter(m=>m.is("element")&&!VVe(t,m));let f=0,h=d.length;if(h==0)return a.createRange(a.createPositionAt(c,"end"));for(;f{r?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")}),vt.isAndroid&&this.forceDisabled("noAndroidSupport"),e.plugins.has("BlockToolbar")){const i=e.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(i,"dragstart",(r,o)=>this._handleBlockDragStart(o)),this._domEmitter.listenTo(Qe.document,"dragover",(r,o)=>this._handleBlockDragging(o)),this._domEmitter.listenTo(Qe.document,"drop",(r,o)=>this._handleBlockDragging(o)),this._domEmitter.listenTo(Qe.document,"dragend",()=>this._handleBlockDragEnd(),{useCapture:!0}),this.isEnabled&&i.setAttribute("draggable","true"),this.on("change:isEnabled",(r,o,s)=>{i.setAttribute("draggable",s?"true":"false")})}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(e){if(!this.isEnabled)return;const n=this.editor.model,i=n.document.selection,r=this.editor.editing.view,o=Array.from(i.getSelectedBlocks()),s=n.createRange(n.createPositionBefore(o[0]),n.createPositionAfter(o[o.length-1]));n.change(a=>a.setSelection(s)),this._isBlockDragging=!0,r.focus(),r.getObserver(fb).onDomEvent(e)}_handleBlockDragging(e){if(!this.isEnabled||!this._isBlockDragging)return;const n=e.clientX+(this.editor.locale.contentLanguageDirection=="ltr"?100:-100),i=e.clientY,r=document.elementFromPoint(n,i),o=this.editor.editing.view;!r||!r.closest(".ck-editor__editable")||o.getObserver(fb).onDomEvent({...e,type:e.type,dataTransfer:e.dataTransfer,target:r,clientX:n,clientY:i,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation()})}_handleBlockDragEnd(){this._isBlockDragging=!1}}class zVe extends xe{_draggedRange;_draggingUid;_draggableElement;_clearDraggableAttributesDelayed=zM(()=>this._clearDraggableAttributes(),40);_blockMode=!1;_domEmitter=new(zo());_previewContainer;static get pluginName(){return"DragDrop"}static get isOfficialPlugin(){return!0}static get requires(){return[fs,h0,py,$Ve]}init(){const e=this.editor,n=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,n.addObserver(fb),n.addObserver(YG),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(i,r,o)=>{o?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(i,r,o)=>{o||this._finalizeDragging(!1)}),vt.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._previewContainer&&this._previewContainer.remove(),this._domEmitter.stopListening(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,n=e.model,i=e.editing.view,r=i.document,o=e.plugins.get(py);this.listenTo(r,"dragstart",(s,a)=>{if(a.target?.is("editableElement")){a.preventDefault();return}if(this._prepareDraggedRange(a.target),!this._draggedRange){a.preventDefault();return}this._draggingUid=Ur();const l=this.isEnabled&&e.model.canEditAt(this._draggedRange);a.dataTransfer.effectAllowed=l?"copyMove":"copy",a.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const u=n.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(a.dataTransfer,u,"dragstart");const{dataTransfer:d,domTarget:f,domEvent:h}=a,{clientX:m}=h;this._updatePreview({dataTransfer:d,domTarget:f,clientX:m}),a.stopPropagation(),l||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(r,"dragend",(s,a)=>{this._finalizeDragging(!a.dataTransfer.isCanceled&&a.dataTransfer.dropEffect=="move")},{priority:"low"}),this._domEmitter.listenTo(Qe.document,"dragend",()=>{this._blockMode=!1},{useCapture:!0}),this.listenTo(r,"dragenter",()=>{this.isEnabled&&i.focus()}),this.listenTo(r,"dragleave",()=>{o.removeDropMarkerDelayed()}),this.listenTo(r,"dragging",(s,a)=>{if(!this.isEnabled){a.dataTransfer.dropEffect="none";return}const{clientX:l,clientY:u}=a.domEvent;if(!o.updateDropMarker(a.target,a.targetRanges,l,u,this._blockMode,this._draggedRange)){a.dataTransfer.dropEffect="none";return}this._draggedRange||(a.dataTransfer.dropEffect="copy"),vt.isGecko||(a.dataTransfer.effectAllowed=="copy"?a.dataTransfer.dropEffect="copy":["all","copyMove"].includes(a.dataTransfer.effectAllowed)&&(a.dataTransfer.dropEffect="move")),s.stop()},{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,i=e.editing.view.document,r=e.plugins.get(py);this.listenTo(i,"clipboardInput",(o,s)=>{if(s.method!="drop")return;const{clientX:a,clientY:l}=s.domEvent,u=r.getFinalDropRange(s.target,s.targetRanges,a,l,this._blockMode,this._draggedRange);if(!u){this._finalizeDragging(!1),o.stop();return}if(this._draggedRange&&this._draggingUid!=s.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),gF(s.dataTransfer)=="move"&&this._draggedRange&&this._draggedRange.containsRange(u,!0)){this._finalizeDragging(!1),o.stop();return}s.targetRanges=[e.editing.mapper.toViewRange(u)]},{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(fs);e.on("contentInsertion",(n,i)=>{if(!this.isEnabled||i.method!=="drop")return;const r=i.targetRanges.map(o=>this.editor.editing.mapper.toModelRange(o));this.editor.model.change(o=>o.setSelection(r))},{priority:"high"}),e.on("contentInsertion",(n,i)=>{if(!this.isEnabled||i.method!=="drop")return;const r=gF(i.dataTransfer)=="move",o=!i.resultRange||!i.resultRange.isCollapsed;this._finalizeDragging(o&&r)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,n=e.editing.view,i=n.document;this.listenTo(i,"pointerdown",(r,o)=>{if(vt.isAndroid||!o)return;this._clearDraggableAttributesDelayed.cancel();let s=pF(o.target);if(vt.isBlink&&!e.isReadOnly&&!s&&!i.selection.isCollapsed){const a=i.selection.getSelectedElement();(!a||!ci(a))&&(s=i.selection.editableElement)}s&&(n.change(a=>{a.setAttribute("draggable","true",s)}),this._draggableElement=e.editing.mapper.toModelElement(s))}),this.listenTo(i,"pointerup",()=>{vt.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change(n=>{this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"&&n.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_finalizeDragging(e){const n=this.editor,i=n.model;n.plugins.get(py).removeDropMarker(),this._clearDraggableAttributes(),n.plugins.has("WidgetToolbarRepository")&&n.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(e&&this.isEnabled&&i.change(o=>{const s=i.createSelection(this._draggedRange);i.deleteContent(s,{doNotAutoparagraph:!0});const a=s.getFirstPosition().parent;a.isEmpty&&!i.schema.checkChild(a,"$text")&&i.schema.checkChild(a,"paragraph")&&o.insertElement("paragraph",a,0)}),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(e){const n=this.editor,i=n.model,r=i.document.selection,o=e?pF(e):null;if(o){const u=n.editing.mapper.toModelElement(o);this._draggedRange=ko.fromRange(i.createRangeOn(u)),this._blockMode=i.schema.isBlock(u),n.plugins.has("WidgetToolbarRepository")&&n.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop");return}if(r.isCollapsed&&!r.getFirstPosition().parent.isEmpty)return;const s=Array.from(r.getSelectedBlocks()),a=r.getFirstRange();if(s.length==0){this._draggedRange=ko.fromRange(a);return}const l=uX(i,s);if(s.length>1)this._draggedRange=ko.fromRange(l),this._blockMode=!0;else if(s.length==1){const u=a.start.isTouching(l.start)&&a.end.isTouching(l.end);this._draggedRange=ko.fromRange(u?l:a),this._blockMode=u}i.change(u=>u.setSelection(this._draggedRange.toRange()))}_updatePreview({dataTransfer:e,domTarget:n,clientX:i}){const r=this.editor.editing.view,o=r.document.selection.editableElement,s=r.domConverter.mapViewToDom(o),a=Qe.window.getComputedStyle(s);this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):(this._previewContainer=Ko(Qe.document,"div",{style:"position: fixed; left: -999999px;"}),Qe.document.body.appendChild(this._previewContainer));const l=Ko(Qe.document,"div");l.className="ck ck-content ck-clipboard-preview";const u=new Wt(s),c=parseFloat(a.paddingLeft),d=parseFloat(a.paddingRight),f=parseFloat(a.width)-c-d;if(s.contains(n))if(vt.isiOS)l.style.maxWidth=`${f}px`,l.style.padding="10px",l.style.minWidth="200px",l.style.minHeight="20px",l.style.boxSizing="border-box",l.style.backgroundColor="var(--ck-color-base-background)";else return;else if(vt.isiOS)l.style.width=`${f}px`,l.style.backgroundColor="var(--ck-color-base-background)";else{const h=u.left-i+c;l.style.width=`${f+h}px`,l.style.paddingLeft=`${h}px`}r.domConverter.setContentOf(l,e.getData("text/html")),e.setDragImage(l,0,0),this._previewContainer.appendChild(l)}}function gF(t){return vt.isGecko?t.dropEffect:["all","copyMove"].includes(t.effectAllowed)?"move":"copy"}function pF(t){if(t.is("editableElement"))return null;if(t.hasClass("ck-widget__selection-handle"))return t.findAncestor(ci);if(ci(t))return t;const e=t.findAncestor(n=>ci(n)||n.is("editableElement"));return ci(e)?e:null}function uX(t,e){const n=e[0],i=e[e.length-1],r=n.getCommonAncestor(i),o=t.createPositionBefore(n),s=t.createPositionAfter(i);if(r&&r.is("element")&&!t.schema.isLimit(r)){const a=t.createRangeOn(r),l=o.isTouching(a.start),u=s.isTouching(a.end);if(l&&u)return uX(t,[r])}return t.createRange(o,s)}class HVe extends xe{static get pluginName(){return"PastePlainText"}static get isOfficialPlugin(){return!0}static get requires(){return[fs]}init(){const e=this.editor,n=e.model,i=e.editing.view,r=n.document.selection;i.addObserver(fb),e.plugins.get(fs).on("contentInsertion",(o,s)=>{UVe(s.content,n)&&n.change(a=>{const l=Array.from(r.getAttributes()).filter(([c])=>n.schema.getAttributeProperties(c).isFormatting);r.isCollapsed||n.deleteContent(r,{doNotAutoparagraph:!0}),l.push(...r.getAttributes());const u=a.createRangeIn(s.content);for(const c of u.getItems())for(const d of l)n.schema.checkAttribute(c,d[0])&&a.setAttribute(d[0],d[1],c)})})}}function UVe(t,e){let n=e.createRangeIn(t);if(t.childCount==1){const i=t.getChild(0);i.is("element")&&e.schema.isBlock(i)&&!e.schema.isObject(i)&&!e.schema.isLimit(i)&&(n=e.createRangeIn(i))}for(const i of n.getItems())if(!e.schema.isInline(i)||Array.from(i.getAttributeKeys()).find(o=>e.schema.getAttributeProperties(o).isFormatting))return!1;return!0}class cX extends xe{static get pluginName(){return"Clipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[av,fs,zVe,HVe]}init(){const e=this.editor,n=this.editor.t;e.accessibility.addKeystrokeInfos({keystrokes:[{label:n("Copy selected content"),keystroke:"CTRL+C"},{label:n("Paste content"),keystroke:"CTRL+V"},{label:n("Paste content as plain text"),keystroke:"CTRL+SHIFT+V"}]})}}const WVe={autoRefresh:!0},vF=36e5,qVe=5e3;class wO extends Ln(){_refresh;_options;_tokenRefreshTimeout;_isDestroyed=!1;constructor(e,n={}){if(super(),!e)throw new oe("token-missing-token-url",this);n.initValue&&this._validateTokenValue(n.initValue),this.set("value",n.initValue),typeof e=="function"?this._refresh=e:this._refresh=()=>jVe(e),this._options={...WVe,...n}}init(){return new Promise((e,n)=>{if(!this.value){this.refreshToken().then(e).catch(n);return}this._options.autoRefresh&&this._registerRefreshTokenTimeout(),e(this)})}refreshToken(){const e=this._options.autoRefresh;return this._refresh().then(n=>(this._validateTokenValue(n),this.set("value",n),e&&this._registerRefreshTokenTimeout(),this)).catch(n=>{throw hn("token-refresh-failed",{autoRefresh:e}),e&&this._registerRefreshTokenTimeout(qVe),n})}destroy(){this._isDestroyed=!0,clearTimeout(this._tokenRefreshTimeout)}_validateTokenValue(e){const n=typeof e=="string",i=!/^".*"$/.test(e),r=n&&e.split(".").length===3;if(!(i&&r))throw new oe("token-not-in-jwt-format",this)}_registerRefreshTokenTimeout(e){if(clearTimeout(this._tokenRefreshTimeout),this._isDestroyed)return;const n=e||this._getTokenRefreshTimeoutTime();this._tokenRefreshTimeout=setTimeout(()=>{this.refreshToken()},n)}_getTokenRefreshTimeoutTime(){try{const[,e]=this.value.split("."),{exp:n}=JSON.parse(atob(e));return n?(n>2147483647&&console.warn("Token expiration time exceeds 32-bit integer range. This might cause unpredictable token refresh timing. Token expiration time should always be provided in seconds.",{tokenExpireTime:n}),Math.floor((n*1e3-Date.now())/2)):vF}catch{return vF}}static create(e,n={}){return new wO(e,n).init()}}function jVe(t){return new Promise((e,n)=>{const i=new XMLHttpRequest;i.open("GET",t),i.addEventListener("load",()=>{const r=i.status,o=i.response;return r<200||r>299?n(new oe("token-cannot-download-new-token",null)):e(o)}),i.addEventListener("error",()=>n(new Error("Network Error"))),i.addEventListener("abort",()=>n(new Error("Abort"))),i.send()})}const VA=/^data:(\S*?);base64,/;class KVe extends Fn(){file;xhr;_token;_apiAddress;constructor(e,n,i){if(super(),!e)throw new oe("fileuploader-missing-file",null);if(!n)throw new oe("fileuploader-missing-token",null);if(!i)throw new oe("fileuploader-missing-api-address",null);this.file=YVe(e)?GVe(e):e,this._token=n,this._apiAddress=i}onProgress(e){return this.on("progress",(n,i)=>e(i)),this}onError(e){return this.once("error",(n,i)=>e(i)),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.xhr,n=i=>()=>this.fire("error",i);e.addEventListener("error",n("Network Error")),e.addEventListener("abort",n("Abort"));e.upload&&e.upload.addEventListener("progress",i=>{i.lengthComputable&&this.fire("progress",{total:i.total,uploaded:i.loaded})}),e.addEventListener("load",()=>{const i=e.status,r=e.response;if(i<200||i>299)return this.fire("error",r.message||r.error)})}_sendRequest(){const e=new FormData,n=this.xhr;return e.append("file",this.file),new Promise((i,r)=>{n.addEventListener("load",()=>{const o=n.status,s=n.response;return o<200||o>299?s.message?r(new oe("fileuploader-uploading-data-failed",this,{message:s.message})):r(s.error):i(s)}),n.addEventListener("error",()=>r(new Error("Network Error"))),n.addEventListener("abort",()=>r(new Error("Abort"))),n.send(e)})}}function GVe(t,e=512){try{const n=t.match(VA)[1],i=atob(t.replace(VA,"")),r=[];for(let o=0;on||0),e.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(e.toolbar)}_initPlaceholder(){const e=this.editor,n=e.editing.view,i=n.document.getRoot(),r=e.sourceElement;let o;const s=e.config.get("placeholder");s&&(o=typeof s=="string"?s:s[this.view.editable.name]),!o&&r&&r.tagName.toLowerCase()==="textarea"&&(o=r.getAttribute("placeholder")),o&&(i.placeholder=o),qM({view:n,element:i,isDirectHost:!1,keepOnFocus:!0})}_initContextualBalloonIntegration(){if(!this.editor.plugins.has("ContextualBalloon"))return;const{stickyPanel:e}=this.view,n=this.editor.plugins.get("ContextualBalloon");n.on("getPositionOptions",r=>{const o=r.return;if(!o||!e.isSticky||!e.element)return;const s=new Wt(e.element).height,a=typeof o.target=="function"?o.target():o.target,l=typeof o.limiter=="function"?o.limiter():o.limiter;if(a&&l&&new Wt(a).height>=new Wt(l).height-s)return;const u={...o.viewportOffsetConfig},c=(u.top||0)+s;r.return={...o,viewportOffsetConfig:{...u,top:c}}},{priority:"low"});const i=()=>{n.visibleView&&n.updatePosition()};this.listenTo(e,"change:isSticky",i),this.listenTo(this.editor.ui,"change:viewportOffset",i)}_handleScrollToTheSelectionWithStickyPanel(e,n,i){const r=this.view.stickyPanel;if(r.isSticky){const o=new Wt(r.element).height;n.viewportOffset.top+=o}else{const o=()=>{this.editor.editing.view.scrollToTheSelection(i)};this.listenTo(r,"change:isSticky",o),setTimeout(()=>{this.stopListening(r,"change:isSticky",o)},20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const e=this.view.stickyPanel,n=this.editor.plugins.get("Dialog");n.on("show",()=>{const i=n.view;i.on("moveTo",(r,o)=>{if(!e.isSticky||i.wasMoved||i.isModal)return;const s=new Wt(e.contentPanelElement);o[1]{const r=new this(e,n);i(r.initPlugins().then(()=>r.ui.init(t_(e)?e:null)).then(()=>r.data.init(r.config.get("initialData"))).then(()=>r.fire("ready")).then(()=>r))})}}function nFe(t){return t_(t)?bRe(t):t}function t_(t){return Rc(t)}class iFe extends Ht{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,n=e.document.selection;let i=e.schema.getLimitElement(n);if(n.containsEntireContent(i)||!bF(e.schema,i))do if(i=i.parent,!i)return;while(!bF(e.schema,i));e.change(r=>{r.setSelection(i,"in")})}}function bF(t,e){return t.isLimit(e)&&(t.checkChild(e,"$text")||t.checkChild(e,"paragraph"))}const rFe=FM("Ctrl+A");class oFe extends xe{static get pluginName(){return"SelectAllEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.t,r=e.editing.view.document;e.commands.add("selectAll",new iFe(e)),this.listenTo(r,"keydown",(o,s)=>{Gm(s)===rFe&&(e.execute("selectAll"),s.preventDefault())}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:n("Select all"),keystroke:"CTRL+A"}]})}}class sFe extends xe{static get pluginName(){return"SelectAllUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",()=>{const n=this._createButton(wt);return n.set({tooltip:!0}),n}),e.ui.componentFactory.add("menuBar:selectAll",()=>this._createButton(Wi))}_createButton(e){const n=this.editor,i=n.locale,r=n.commands.get("selectAll"),o=new e(n.locale),s=i.t;return o.set({label:s("Select all"),icon:gNe,keystroke:"Ctrl+A"}),o.bind("isEnabled").to(r,"isEnabled"),this.listenTo(o,"execute",()=>{n.execute("selectAll"),n.editing.view.focus()}),o}}class aFe extends xe{static get requires(){return[oFe,sFe]}static get pluginName(){return"SelectAll"}static get isOfficialPlugin(){return!0}}class dX extends Ht{_stack=[];_createdBatches=new WeakSet;constructor(e){super(e),this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(e.data,"set",(n,i)=>{i[1]={...i[1]};const r=i[1];r.batchType||(r.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(e.data,"set",(n,i)=>{i[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(e){const n=this.editor.model.document.selection,i={ranges:n.hasOwnRange?Array.from(n.getRanges()):[],isBackward:n.isBackward};this._stack.push({batch:e,selection:i}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,n,i){const r=this.editor.model,o=r.document,s=[],a=e.map(u=>u.getTransformedByOperations(i)),l=a.flat();for(const u of a){const c=u.filter(d=>d.root!=o.graveyard).filter(d=>!uFe(d,l));c.length&&(lFe(c),s.push(c[0]))}s.length&&r.change(u=>{u.setSelection(s,{backward:n})})}_undo(e,n){const i=this.editor.model,r=i.document;this._createdBatches.add(n);const o=e.operations.slice().filter(s=>s.isDocumentOperation);o.reverse();for(const s of o){const a=s.baseVersion+1,l=Array.from(r.history.getOperations(a)),c=jLe([s.getReversed()],l,{useRelations:!0,document:this.editor.model.document,forceWeakRemove:!0}).operationsA;for(let d of c){const f=d.affectedSelectable;f&&!i.canEditAt(f)&&(d=new or(d.baseVersion)),n.addOperation(d),i.applyOperation(d),r.history.setOperationAsUndone(s,d)}}}}function lFe(t){t.sort((e,n)=>e.start.isBefore(n.start)?-1:1);for(let e=1;en!==t&&n.containsRange(t,!0))}class cFe extends dX{execute(e=null){const n=e?this._stack.findIndex(o=>o.batch==e):this._stack.length-1,i=this._stack.splice(n,1)[0],r=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(r,()=>{this._undo(i.batch,r);const o=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,o)}),this.fire("revert",i.batch,r),this.refresh()}}class dFe extends dX{execute(){const e=this._stack.pop(),n=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(n,()=>{const r=e.batch.operations[e.batch.operations.length-1].baseVersion+1,o=this.editor.model.document.history.getOperations(r);this._restoreSelection(e.selection.ranges,e.selection.isBackward,o),this._undo(e.batch,n)}),this.fire("revert",e.batch,n),this.refresh()}}class fFe extends xe{_undoCommand;_redoCommand;_batchRegistry=new WeakSet;static get pluginName(){return"UndoEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.t;this._undoCommand=new cFe(e),this._redoCommand=new dFe(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(i,r)=>{const o=r[0];if(!o.isDocumentOperation)return;const s=o.batch,a=this._redoCommand.createdBatches.has(s),l=this._undoCommand.createdBatches.has(s);this._batchRegistry.has(s)||(this._batchRegistry.add(s),s.isUndoable&&(a?this._undoCommand.addBatch(s):l||(this._undoCommand.addBatch(s),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(i,r,o)=>{this._redoCommand.addBatch(o)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:n("Undo"),keystroke:"CTRL+Z"},{label:n("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}}class hFe extends xe{static get pluginName(){return"UndoUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.locale,i=e.t,r=n.uiLanguageDirection=="ltr"?mV:fV,o=n.uiLanguageDirection=="ltr"?fV:mV;this._addButtonsToFactory("undo",i("Undo"),"CTRL+Z",r),this._addButtonsToFactory("redo",i("Redo"),"CTRL+Y",o)}_addButtonsToFactory(e,n,i,r){const o=this.editor;o.ui.componentFactory.add(e,()=>{const s=this._createButton(wt,e,n,i,r);return s.set({tooltip:!0}),s}),o.ui.componentFactory.add("menuBar:"+e,()=>this._createButton(Wi,e,n,i,r))}_createButton(e,n,i,r,o){const s=this.editor,a=s.locale,l=s.commands.get(n),u=new e(a);return u.set({label:i,icon:o,keystroke:r}),u.bind("isEnabled").to(l,"isEnabled"),this.listenTo(u,"execute",()=>{s.execute(n),s.editing.view.focus()}),u}}class _O extends xe{static get requires(){return[fFe,hFe]}static get pluginName(){return"Undo"}static get isOfficialPlugin(){return!0}}class mFe extends xe{static get requires(){return[S3e,cX,kS,aFe,W4e,s4e,_O]}static get pluginName(){return"Essentials"}static get isOfficialPlugin(){return!0}}class CO extends Ht{attributeKey;constructor(e,n){super(e),this.attributeKey=n}refresh(){const e=this.editor.model,n=e.document;this.value=n.selection.getAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(n.selection,this.attributeKey)}execute(e={}){const n=this.editor.model,r=n.document.selection,o=e.value,s=e.batch,a=l=>{if(r.isCollapsed)o?l.setSelectionAttribute(this.attributeKey,o):l.removeSelectionAttribute(this.attributeKey);else{const u=n.schema.getValidRanges(r.getRanges(),this.attributeKey,{includeEmptyRanges:!0});for(const c of u){let d=c,f=this.attributeKey;c.isCollapsed&&(d=c.start.parent,f=cs._getStoreAttributeKey(this.attributeKey)),o?l.setAttribute(f,o,d):l.removeAttribute(f,d)}}};s?n.enqueueChange(s,l=>{a(l)}):n.change(l=>{a(l)})}}const po="fontSize",Ha="fontColor",ql="fontBackgroundColor";function gFe(t,e){const n={model:{key:t,values:[]},view:{},upcastAlso:{}};for(const i of e)n.model.values.push(i.model),n.view[i.model]=i.view,i.upcastAlso&&(n.upcastAlso[i.model]=i.upcastAlso);return n}function fX(t){return e=>vFe(e.getStyle(t))}function hX(t){return(e,{writer:n})=>n.createAttributeElement("span",{style:`${t}:${e}`},{priority:7})}function pFe({dropdownView:t,colors:e,columns:n,removeButtonLabel:i,colorPickerLabel:r,documentColorsLabel:o,documentColorsCount:s,colorPickerViewConfig:a}){const l=t.locale,u=new hO(l,{colors:e,columns:n,removeButtonLabel:i,colorPickerLabel:r,documentColorsLabel:o,documentColorsCount:s,colorPickerViewConfig:a});return t.colorSelectorView=u,t.panelView.children.add(u),u}function vFe(t){return t.replace(/\s/g,"")}class bFe extends CO{constructor(e){super(e,po)}}function hb(t){return t.map(e=>yFe(e)).filter(e=>e!==void 0)}const yF={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function yFe(t){if(typeof t=="number"&&(t=String(t)),typeof t=="object"&&CFe(t))return FA(t);const e=_Fe(t);if(e)return FA(e);if(t==="default")return{model:void 0,title:"Default"};if(!SFe(t))return wFe(t)}function wFe(t){return typeof t=="string"&&(t={title:t,model:`${parseFloat(t)}px`}),t.view={name:"span",styles:{"font-size":t.model}},FA(t)}function FA(t){return t.view&&typeof t.view!="string"&&!t.view.priority&&(t.view.priority=7),t}function _Fe(t){return typeof t=="string"?yF[t]:yF[t.model]}function CFe(t){return t.title&&t.model&&t.view}function SFe(t){let e;if(typeof t=="object")if(t.model)e=parseFloat(t.model);else throw new oe("font-size-invalid-definition",null,t);else e=parseFloat(t);return isNaN(e)}const wF=["x-small","x-small","small","medium","large","x-large","xx-large","xxx-large"];class kFe extends xe{static get pluginName(){return"FontSizeEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(po,{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:po}),e.model.schema.setAttributeProperties(po,{isFormatting:!0,copyOnEnter:!0});const n=e.config.get("fontSize.supportAllValues"),i=hb(this.editor.config.get("fontSize.options")).filter(o=>o.model),r=gFe(po,i);n?(this._prepareAnyValueConverters(r),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(r),e.commands.add(po,new bFe(e))}_prepareAnyValueConverters(e){const n=this.editor,i=e.model.values.filter(r=>!vS(String(r))&&!JG(String(r)));if(i.length)throw new oe("font-size-invalid-use-of-named-presets",null,{presets:i});n.conversion.for("downcast").attributeToElement({model:po,view:(r,{writer:o})=>{if(r)return o.createAttributeElement("span",{style:"font-size:"+r},{priority:7})}}),n.conversion.for("upcast").elementToAttribute({model:{key:po,value:r=>r.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{size:/^[+-]?\d{1,3}$/}},model:{key:po,value:n=>{const i=n.getAttribute("size"),r=i[0]==="-"||i[0]==="+";let o=parseInt(i,10);r&&(o=3+o);const s=wF.length-1,a=Math.min(Math.max(o,0),s);return wF[a]}}})}}class TFe extends xe{static get pluginName(){return"FontSizeUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.t,i=this._getLocalizedOptions(),r=e.commands.get(po),o=n("Font Size"),s=EFe(i,r);e.ui.componentFactory.add(po,a=>{const l=Ro(a);return f0(l,s,{role:"menu",ariaLabel:o}),l.buttonView.set({label:o,icon:uV,tooltip:!0}),l.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),l.bind("isEnabled").to(r),this.listenTo(l,"execute",u=>{e.execute(u.source.commandName,{value:u.source.commandParam}),e.editing.view.focus()}),l}),e.ui.componentFactory.add(`menuBar:${po}`,a=>{const l=new la(a);l.buttonView.set({label:o,icon:uV}),l.bind("isEnabled").to(r);const u=new Zm(a);for(const c of s){const d=new yg(a,l),f=new Wi(a);f.set({role:"menuitemradio",isToggleable:!0}),f.bind(...Object.keys(c.model)).to(c.model),f.delegate("execute").to(l),f.on("execute",()=>{e.execute(c.model.commandName,{value:c.model.commandParam}),e.editing.view.focus()}),d.children.add(f),u.items.add(d)}return l.panelView.children.add(u),l})}_getLocalizedOptions(){const e=this.editor,n=e.t,i={Default:n("Default"),Tiny:n("Tiny"),Small:n("Small"),Big:n("Big"),Huge:n("Huge")};return hb(e.config.get(po).options).map(o=>{const s=i[o.title];return s&&s!=o.title&&(o=Object.assign({},o,{title:s})),o})}}function EFe(t,e){const n=new Er;for(const i of t){const r={type:"button",model:new Jm({commandName:po,commandParam:i.model,label:i.title,class:"ck-fontsize-option",role:"menuitemradio",withText:!0})};i.view&&typeof i.view!="string"&&(i.view.styles&&r.model.set("labelStyle",`font-size:${i.view.styles["font-size"]}`),i.view.classes&&r.model.set("class",`${r.model.class} ${i.view.classes}`)),r.model.bind("isOn").to(e,"value",o=>o===i.model),n.add(r)}return n}class xFe extends xe{static get requires(){return[kFe,TFe]}static get pluginName(){return"FontSize"}static get isOfficialPlugin(){return!0}normalizeSizeOptions(e){return hb(e)}}class AFe extends CO{constructor(e){super(e,Ha)}}class PFe extends xe{static get pluginName(){return"FontColorEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(Ha,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:Ha,value:fX("color")}}),e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:Ha,value:n=>n.getAttribute("color")}}),e.conversion.for("downcast").attributeToElement({model:Ha,view:hX("color")}),e.commands.add(Ha,new AFe(e)),e.model.schema.extend("$text",{allowAttributes:Ha}),e.model.schema.setAttributeProperties(Ha,{isFormatting:!0,copyOnEnter:!0})}}class mX extends xe{commandName;componentName;icon;dropdownLabel;columns;constructor(e,{commandName:n,componentName:i,icon:r,dropdownLabel:o}){super(e),this.commandName=n,this.componentName=i,this.icon=r,this.dropdownLabel=o,this.columns=e.config.get(`${this.componentName}.columns`)}init(){const e=this.editor,n=e.locale,i=n.t,r=e.commands.get(this.commandName),o=e.config.get(this.componentName),s=NA(o.colors),a=DA(n,s),l=o.documentColors,u=o.colorPicker!==!1;e.ui.componentFactory.add(this.componentName,c=>{const d=Ro(c);let f=!1;const h=pFe({dropdownView:d,colors:a.map(m=>({label:m.label,color:m.model,options:{hasBorder:m.hasBorder}})),columns:this.columns,removeButtonLabel:i("Remove color"),colorPickerLabel:i("Color picker"),documentColorsLabel:l!==0?i("Document colors"):"",documentColorsCount:l===void 0?this.columns:l,colorPickerViewConfig:u?o.colorPicker||{}:!1});return h.bind("selectedColor").to(r,"value"),d.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),d.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),d.bind("isEnabled").to(r),h.on("execute",(m,g)=>{d.isOpen&&e.execute(this.commandName,{value:g.value,batch:this._undoStepBatch}),g.source!=="colorPicker"&&e.editing.view.focus(),g.source==="colorPickerSaveButton"&&(d.isOpen=!1)}),h.on("colorPicker:show",()=>{this._undoStepBatch=e.model.createBatch()}),h.on("colorPicker:cancel",()=>{this._undoStepBatch.operations.length&&(d.isOpen=!1,e.execute("undo",this._undoStepBatch)),e.editing.view.focus()}),d.on("change:isOpen",(m,g,v)=>{f||(f=!0,d.colorSelectorView.appendUI()),v&&(l!==0&&h.updateDocumentColors(e.model,this.componentName),h.updateSelectedColors(),h.showColorGridsFragment())}),fO(d,()=>d.colorSelectorView.colorGridsFragmentView.staticColorsGrid.items.find(m=>m.isOn)),d}),e.ui.componentFactory.add(`menuBar:${this.componentName}`,c=>{const d=new la(c);d.buttonView.set({label:this.dropdownLabel,icon:this.icon}),d.bind("isEnabled").to(r);let f=!1;const h=new hO(c,{colors:a.map(m=>({label:m.label,color:m.model,options:{hasBorder:m.hasBorder}})),columns:this.columns,removeButtonLabel:i("Remove color"),colorPickerLabel:i("Color picker"),documentColorsLabel:l!==0?i("Document colors"):"",documentColorsCount:l===void 0?this.columns:l,colorPickerViewConfig:!1});return h.bind("selectedColor").to(r,"value"),h.delegate("execute").to(d),h.on("execute",(m,g)=>{e.execute(this.commandName,{value:g.value,batch:this._undoStepBatch}),e.editing.view.focus()}),d.on("change:isOpen",(m,g,v)=>{f||(f=!0,h.appendUI()),v&&(l!==0&&h.updateDocumentColors(e.model,this.componentName),h.updateSelectedColors(),h.showColorGridsFragment())}),d.panelView.children.add(h),d})}}class IFe extends mX{constructor(e){const n=e.locale.t;super(e,{commandName:Ha,componentName:Ha,icon:KDe,dropdownLabel:n("Font Color")})}static get pluginName(){return"FontColorUI"}}class RFe extends xe{static get requires(){return[PFe,IFe]}static get pluginName(){return"FontColor"}static get isOfficialPlugin(){return!0}}class MFe extends CO{constructor(e){super(e,ql)}}class OFe extends xe{static get pluginName(){return"FontBackgroundColorEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(ql,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(QG),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:ql,value:fX("background-color")}}),e.conversion.for("downcast").attributeToElement({model:ql,view:hX("background-color")}),e.commands.add(ql,new MFe(e)),e.model.schema.extend("$text",{allowAttributes:ql}),e.model.schema.setAttributeProperties(ql,{isFormatting:!0,copyOnEnter:!0})}}class LFe extends mX{constructor(e){const n=e.locale.t;super(e,{commandName:ql,componentName:ql,icon:jDe,dropdownLabel:n("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class DFe extends xe{static get requires(){return[OFe,LFe]}static get pluginName(){return"FontBackgroundColor"}static get isOfficialPlugin(){return!0}}class NFe extends Ht{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,n=e.document,i=Mi(n.selection.getSelectedBlocks());this.value=!!i&&i.is("element","paragraph"),this.isEnabled=!!i&&_F(i,e.schema)}execute(e={}){const n=this.editor.model,i=n.document,r=e.selection||i.selection;n.canEditAt(r)&&n.change(o=>{const s=r.getSelectedBlocks();for(const a of s)!a.is("element","paragraph")&&_F(a,n.schema)&&o.rename(a,"paragraph")})}}function _F(t,e){return e.checkChild(t.parent,"paragraph")&&!e.isObject(t)}class BFe extends Ht{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){const n=this.editor.model,i=e.attributes;let r=e.position;return n.canEditAt(r)?n.change(o=>{if(r=this._findPositionToInsertParagraph(r,o),!r)return null;const s=o.createElement("paragraph");return i&&n.schema.setAllowedAttributes(s,i,o),n.insertContent(s,r),o.setSelection(s,"in"),o.createPositionAt(s,0)}):null}_findPositionToInsertParagraph(e,n){const i=this.editor.model;if(i.schema.checkChild(e,"paragraph"))return e;const r=i.schema.findAllowedParent(e,"paragraph");if(!r)return null;const o=e.parent,s=i.schema.checkChild(o,"$text");return o.isEmpty||s&&e.isAtEnd?i.createPositionAfter(o):!o.isEmpty&&s&&e.isAtStart?i.createPositionBefore(o):n.split(e,r).position}}class TS extends xe{static get pluginName(){return"Paragraph"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.model;e.commands.add("paragraph",new NFe(e)),e.commands.add("insertParagraph",new BFe(e)),n.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(i,{writer:r})=>!TS.paragraphLikeElements.has(i.name)||i.isEmpty?null:r.createElement("paragraph"),view:/.+/,converterPriority:"low"})}static paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"])}class VFe extends Ht{modelElements;constructor(e,n){super(e),this.modelElements=n}refresh(){const e=Mi(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(n=>CF(e,n,this.editor.model.schema))}execute(e){const n=this.editor.model,i=n.document,r=e.value;n.change(o=>{const s=Array.from(i.selection.getSelectedBlocks()).filter(a=>CF(a,r,n.schema));for(const a of s)a.is("element",r)||o.rename(a,r)})}}function CF(t,e,n){return n.checkChild(t.parent,e)&&!n.isObject(t)}const SF="paragraph";class FFe extends xe{static get pluginName(){return"HeadingEditing"}static get isOfficialPlugin(){return!0}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[TS]}init(){const e=this.editor,n=e.config.get("heading.options"),i=[];for(const r of n)r.model!=="paragraph"&&(e.model.schema.register(r.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(r),i.push(r.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new VFe(e,i))}afterInit(){const e=this.editor,n=e.commands.get("enter"),i=e.config.get("heading.options");n&&this.listenTo(n,"afterExecute",(r,o)=>{const s=e.model.document.selection.getFirstPosition().parent;i.some(l=>s.is("element",l.model))&&!s.is("element",SF)&&s.childCount===0&&o.writer.rename(s,SF)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:ou.low+1})}}function $Fe(t){const e=t.t,n={Paragraph:e("Paragraph"),"Heading 1":e("Heading 1"),"Heading 2":e("Heading 2"),"Heading 3":e("Heading 3"),"Heading 4":e("Heading 4"),"Heading 5":e("Heading 5"),"Heading 6":e("Heading 6")};return t.config.get("heading.options").map(i=>{const r=n[i.title];return r&&r!=i.title&&(i.title=r),i})}class zFe extends xe{static get pluginName(){return"HeadingUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.t,i=$Fe(e),r=n("Choose heading"),o=n("Heading");e.ui.componentFactory.add("heading",s=>{const a={},l=new Er,u=e.commands.get("heading"),c=e.commands.get("paragraph"),d=[u];for(const h of i){const m={type:"button",model:new Jm({label:h.title,class:h.class,role:"menuitemradio",withText:!0})};h.model==="paragraph"?(m.model.bind("isOn").to(c,"value"),m.model.set("commandName","paragraph"),d.push(c)):(m.model.bind("isOn").to(u,"value",g=>g===h.model),m.model.set({commandName:"heading",commandValue:h.model})),l.add(m),a[h.model]=h.title}const f=Ro(s);return f0(f,l,{ariaLabel:o,role:"menu"}),f.buttonView.set({ariaLabel:o,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:o}),f.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),f.bind("isEnabled").toMany(d,"isEnabled",(...h)=>h.some(m=>m)),f.buttonView.bind("label").to(u,"value",c,"value",(h,m)=>{const g=m?"paragraph":h;return typeof g=="boolean"||!a[g]?r:a[g]}),f.buttonView.bind("ariaLabel").to(u,"value",c,"value",(h,m)=>{const g=m?"paragraph":h;return typeof g=="boolean"||!a[g]?o:`${a[g]}, ${o}`}),this.listenTo(f,"execute",h=>{const{commandName:m,commandValue:g}=h.source;e.execute(m,g?{value:g}:void 0),e.editing.view.focus()}),f}),e.ui.componentFactory.add("menuBar:heading",s=>{const a=new la(s),l=e.commands.get("heading"),u=e.commands.get("paragraph"),c=[l],d=new Zm(s);a.set({class:"ck-heading-dropdown"}),d.set({ariaLabel:n("Heading"),role:"menu"}),a.buttonView.set({label:n("Heading")}),a.panelView.children.add(d);for(const f of i){const h=new yg(s,a),m=new Wi(s);h.children.add(m),d.items.add(h),m.set({isToggleable:!0,label:f.title,role:"menuitemradio",class:f.class}),m.delegate("execute").to(a),m.on("execute",()=>{const g=f.model==="paragraph"?"paragraph":"heading";e.execute(g,{value:f.model}),e.editing.view.focus()}),f.model==="paragraph"?(m.bind("isOn").to(u,"value"),c.push(u)):m.bind("isOn").to(l,"value",g=>g===f.model)}return a.bind("isEnabled").toMany(c,"isEnabled",(...f)=>f.some(h=>h)),a})}}class HFe extends xe{static get requires(){return[FFe,zFe]}static get pluginName(){return"Heading"}static get isOfficialPlugin(){return!0}}var oE={},sE={},aE={},kF;function UFe(){return kF||(kF=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(n){if(!n||typeof n!="object")return!1;const i=Object.getPrototypeOf(n);return i===null||i===Object.prototype||Object.getPrototypeOf(i)===null?Object.prototype.toString.call(n)==="[object Object]":!1}t.isPlainObject=e})(aE)),aE}var lE={},TF;function WFe(){return TF||(TF=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(n){return Object.getOwnPropertySymbols(n).filter(i=>Object.prototype.propertyIsEnumerable.call(n,i))}t.getSymbols=e})(lE)),lE}var uE={},EF;function qFe(){return EF||(EF=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}t.getTag=e})(uE)),uE}var cE={},xF;function jFe(){return xF||(xF=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e="[object RegExp]",n="[object String]",i="[object Number]",r="[object Boolean]",o="[object Arguments]",s="[object Symbol]",a="[object Date]",l="[object Map]",u="[object Set]",c="[object Array]",d="[object Function]",f="[object ArrayBuffer]",h="[object Object]",m="[object Error]",g="[object DataView]",v="[object Uint8Array]",p="[object Uint8ClampedArray]",b="[object Uint16Array]",y="[object Uint32Array]",_="[object BigUint64Array]",C="[object Int8Array]",S="[object Int16Array]",k="[object Int32Array]",T="[object BigInt64Array]",E="[object Float32Array]",x="[object Float64Array]";t.argumentsTag=o,t.arrayBufferTag=f,t.arrayTag=c,t.bigInt64ArrayTag=T,t.bigUint64ArrayTag=_,t.booleanTag=r,t.dataViewTag=g,t.dateTag=a,t.errorTag=m,t.float32ArrayTag=E,t.float64ArrayTag=x,t.functionTag=d,t.int16ArrayTag=S,t.int32ArrayTag=k,t.int8ArrayTag=C,t.mapTag=l,t.numberTag=i,t.objectTag=h,t.regexpTag=e,t.setTag=u,t.stringTag=n,t.symbolTag=s,t.uint16ArrayTag=b,t.uint32ArrayTag=y,t.uint8ArrayTag=v,t.uint8ClampedArrayTag=p})(cE)),cE}var dE={},AF;function KFe(){return AF||(AF=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(n,i){return n===i||Number.isNaN(n)&&Number.isNaN(i)}t.eq=e})(dE)),dE}var PF;function GFe(){return PF||(PF=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const e=UFe(),n=WFe(),i=qFe(),r=jFe(),o=KFe();function s(u,c,d){return a(u,c,void 0,void 0,void 0,void 0,d)}function a(u,c,d,f,h,m,g){const v=g(u,c,d,f,h,m);if(v!==void 0)return v;if(typeof u==typeof c)switch(typeof u){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return u===c;case"number":return u===c||Object.is(u,c);case"function":return u===c;case"object":return l(u,c,m,g)}return l(u,c,m,g)}function l(u,c,d,f){if(Object.is(u,c))return!0;let h=i.getTag(u),m=i.getTag(c);if(h===r.argumentsTag&&(h=r.objectTag),m===r.argumentsTag&&(m=r.objectTag),h!==m)return!1;switch(h){case r.stringTag:return u.toString()===c.toString();case r.numberTag:{const p=u.valueOf(),b=c.valueOf();return o.eq(p,b)}case r.booleanTag:case r.dateTag:case r.symbolTag:return Object.is(u.valueOf(),c.valueOf());case r.regexpTag:return u.source===c.source&&u.flags===c.flags;case r.functionTag:return u===c}d=d??new Map;const g=d.get(u),v=d.get(c);if(g!=null&&v!=null)return g===c;d.set(u,c),d.set(c,u);try{switch(h){case r.mapTag:{if(u.size!==c.size)return!1;for(const[p,b]of u.entries())if(!c.has(p)||!a(b,c.get(p),p,u,c,d,f))return!1;return!0}case r.setTag:{if(u.size!==c.size)return!1;const p=Array.from(u.values()),b=Array.from(c.values());for(let y=0;ya(_,S,void 0,u,c,d,f));if(C===-1)return!1;b.splice(C,1)}return!0}case r.arrayTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:case r.bigUint64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.bigInt64ArrayTag:case r.float32ArrayTag:case r.float64ArrayTag:{if(typeof Buffer<"u"&&Buffer.isBuffer(u)!==Buffer.isBuffer(c)||u.length!==c.length)return!1;for(let p=0;pn.isInlineImageView(o)?i&&(o.getStyle("display")=="block"||o.findAncestor(n.isBlockImageView)?"imageBlock":"imageInline")!==e?null:r(o):null;function r(o){const s={name:!0};return o.hasAttribute("src")&&(s.attributes=["src"]),s}}function SO(t,e){const n=Mi(e.getSelectedBlocks());return!n||t.isObject(n)||n.isEmpty&&n.name!="listItem"?"imageBlock":"imageInline"}function w1(t){return t&&t.endsWith("px")?parseInt(t):null}function _1(t){const e=w1(t.getStyle("width")),n=w1(t.getStyle("height"));return!!(e&&n)}const t6e=/^(image|image-inline)$/;class kr extends xe{_domEmitter=new(zo());static get pluginName(){return"ImageUtils"}static get isOfficialPlugin(){return!0}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={},n=null,i=null,r={}){const o=this.editor,s=o.model,a=s.document.selection,l=pX(o,n||a,i);e={...Object.fromEntries(a.getAttributes()),...e};for(const u in e)s.schema.checkAttribute(l,u)||delete e[u];return s.change(u=>{const{setImageSizes:c=!0}=r,d=u.createElement(l,e);return s.insertObject(d,n,null,{setSelection:"on",findOptimalPosition:!n&&l!="imageInline"?"auto":void 0}),d.parent?(c&&this.setImageNaturalSizeAttributes(d),d):null})}setImageNaturalSizeAttributes(e){const n=e.getAttribute("src");n&&(e.getAttribute("width")||e.getAttribute("height")||this.editor.model.change(i=>{const r=new Qe.window.Image;this._domEmitter.listenTo(r,"load",()=>{!e.getAttribute("width")&&!e.getAttribute("height")&&this.editor.model.enqueueChange(i.batch,o=>{o.setAttribute("width",r.naturalWidth,e),o.setAttribute("height",r.naturalHeight,e)}),this._domEmitter.stopListening(r,"load")}),r.src=n}))}getClosestSelectedImageWidget(e){const n=e.getFirstPosition();if(!n)return null;const i=e.getSelectedElement();if(i&&this.isImageWidget(i))return i;let r=n.parent;for(;r;){if(r.is("element")&&this.isImageWidget(r))return r;r=r.parent}return null}getClosestSelectedImageElement(e){const n=e.getSelectedElement();return this.isImage(n)?n:e.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(e){return e.findAncestor({classes:t6e})}isImageAllowed(){const n=this.editor.model.document.selection;return n6e(this.editor,n)&&i6e(n)}toImageWidget(e,n,i){return n.setCustomProperty("image",!0,e),vO(e,n,{label:()=>{const s=this.findViewImgElement(e).getAttribute("alt");return s?`${s} ${i}`:i}})}isImageWidget(e){return!!e.getCustomProperty("image")&&ci(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 n=this.editor.editing.view;for(const{item:i}of n.createRangeIn(e))if(this.isInlineImageView(i))return i}destroy(){return this._domEmitter.stopListening(),super.destroy()}}function n6e(t,e){if(pX(t,e,null)=="imageBlock"){const i=r6e(e,t.model);if(t.model.schema.checkChild(i,"imageBlock"))return!0}else if(t.model.schema.checkChild(e.focus,"imageInline"))return!0;return!1}function i6e(t){return[...t.focus.getAncestors()].every(e=>!e.is("element","imageBlock"))}function r6e(t,e){const i=iX(t,e).start.parent;return i.isEmpty&&!i.is("element","$root")?i.parent:i}function pX(t,e,n){const i=t.model.schema,r=t.config.get("image.insert.type");return t.plugins.has("ImageBlockEditing")?t.plugins.has("ImageInlineEditing")?n||(r==="inline"?"imageInline":r!=="auto"?"imageBlock":e.is("selection")?SO(i,e):i.checkChild(e,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class o6e extends Ht{refresh(){const i=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!i,this.isEnabled&&i.hasAttribute("alt")?this.value=i.getAttribute("alt"):this.value=!1}execute(e){const n=this.editor,i=n.plugins.get("ImageUtils"),r=n.model,o=i.getClosestSelectedImageElement(r.document.selection);r.change(s=>{s.setAttribute("alt",e.newValue,o)})}}class s6e extends xe{static get requires(){return[kr]}static get pluginName(){return"ImageTextAlternativeEditing"}static get isOfficialPlugin(){return!0}init(){this.editor.commands.add("imageTextAlternative",new o6e(this.editor))}}class a6e extends ut{focusTracker;keystrokes;labeledInput;backButtonView;saveButtonView;children;_focusables;_focusCycler;constructor(e){super(e),this.focusTracker=new wi,this.keystrokes=new Qi,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.labeledInput=this._createLabeledInputView(),this.children=this.createCollection([this._createHeaderView()]),this.children.add(new Xs(e,{children:[this.labeledInput,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding"]})),this._focusables=new qr,this.keystrokes.set("Esc",(n,i)=>{this.fire("cancel"),i()}),this._focusCycler=new Ho({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),vg({view:this}),[this.backButtonView,this.labeledInput,this.saveButtonView].forEach(n=>{this._focusables.add(n),this.focusTracker.add(n.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createBackButton(){const e=this.locale.t,n=new wt(this.locale);return n.set({class:"ck-button-back",label:e("Back"),icon:pg,tooltip:!0}),n.delegate("execute").to(this,"cancel"),n}_createSaveButton(){const e=this.locale.t,n=new wt(this.locale);return n.set({label:e("Save"),withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),n}_createHeaderView(){const e=this.locale.t,n=new qf(this.locale,{label:e("Text Alternative")});return n.children.add(this.backButtonView,0),n}_createLabeledInputView(){const e=this.locale.t,n=new Go(this.locale,tu);return n.label=e("Text alternative"),n.class="ck-labeled-field-view_full-width",n}}function l6e(t){const e=t.plugins.get("ContextualBalloon");if(t.plugins.get("ImageUtils").getClosestSelectedImageWidget(t.editing.view.document.selection)){const i=kO(t);e.updatePosition(i)}}function kO(t){const e=t.editing.view,n=Ki.defaultPositions,i=t.plugins.get("ImageUtils");return{target:e.domConverter.mapViewToDom(i.getClosestSelectedImageWidget(e.document.selection)),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}class u6e extends xe{_balloon;_form;static get requires(){return[bu]}static get pluginName(){return"ImageTextAlternativeUI"}static get isOfficialPlugin(){return!0}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const e=this.editor,n=e.t;e.ui.componentFactory.add("imageTextAlternative",i=>{const r=e.commands.get("imageTextAlternative"),o=new wt(i);return o.set({label:n("Change image text alternative"),icon:TNe,tooltip:!0}),o.bind("isEnabled").to(r,"isEnabled"),o.bind("isOn").to(r,"value",s=>!!s),this.listenTo(o,"execute",()=>{this._showForm()}),o})}_createForm(){const e=this.editor,i=e.editing.view.document,r=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(cb(a6e))(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.listenTo(e.ui,"update",()=>{r.getClosestSelectedImageWidget(i.selection)?this._isVisible&&l6e(e):this._hideForm(!0)}),Wf({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const e=this.editor,n=e.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:kO(e)}),i.fieldView.value=i.fieldView.element.value=n.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){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&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class vX extends xe{static get requires(){return[s6e,u6e]}static get pluginName(){return"ImageTextAlternative"}static get isOfficialPlugin(){return!0}}function c6e(t){const e=(n,i,r)=>{if(!r.consumable.test(i.viewItem,{name:!0,classes:"image"}))return;const o=t.findViewImgElement(i.viewItem);if(!o||!r.consumable.test(o,{name:!0}))return;r.consumable.consume(i.viewItem,{name:!0,classes:"image"});const s=r.convertItem(o,i.modelCursor),a=Mi(s.modelRange.getItems());if(!a){r.consumable.revert(i.viewItem,{name:!0,classes:"image"});return}r.convertChildren(i.viewItem,a),r.updateConversionResult(a,i)};return n=>{n.on("element:figure",e)}}function d6e(t){const e=["srcset","media","type","sizes"],n=(i,r,o)=>{const s=r.viewItem;if(!o.consumable.test(s,{name:!0}))return;const a=new Map;for(const c of s.getChildren())if(c.is("element","source")){const d={};for(const f of e)c.hasAttribute(f)&&o.consumable.test(c,{attributes:f})&&(d[f]=c.getAttribute(f));Object.keys(d).length&&a.set(c,d)}const l=t.findViewImgElement(s);if(!l)return;let u=r.modelCursor.parent;if(!u.is("element","imageBlock")){const c=o.convertItem(l,r.modelCursor);r.modelRange=c.modelRange,r.modelCursor=c.modelCursor,u=Mi(c.modelRange.getItems())}o.consumable.consume(s,{name:!0});for(const[c,d]of a)o.consumable.consume(c,{attributes:Object.keys(d)});a.size&&o.writer.setAttribute("sources",Array.from(a.values()),u),o.convertChildren(s,u)};return i=>{i.on("element:picture",n)}}function bX(t,e){const n=(i,r,o)=>{if(!o.consumable.consume(r.item,i.name))return;const s=o.writer,a=o.mapper.toViewElement(r.item),l=t.findViewImgElement(a);r.attributeNewValue===null?(s.removeAttribute("srcset",l),s.removeAttribute("sizes",l)):r.attributeNewValue&&(s.setAttribute("srcset",r.attributeNewValue,l),s.setAttribute("sizes","100vw",l))};return i=>{i.on(`attribute:srcset:${e}`,n)}}function f6e(t){const e=(n,i,r)=>{if(!r.consumable.consume(i.item,n.name))return;const o=r.writer,s=r.mapper.toViewElement(i.item),a=t.findViewImgElement(s),l=i.attributeNewValue;if(l&&l.length){const u=[];let c=a.parent;for(;c&&c.is("attributeElement");){const h=c.parent;o.unwrap(o.createRangeOn(a),c),u.unshift(c),c=h}const d=a.parent.is("element","picture"),f=d?a.parent:o.createContainerElement("picture",null);d||o.insert(o.createPositionBefore(a),f),o.remove(o.createRangeIn(f)),o.insert(o.createPositionAt(f,"end"),l.map(h=>o.createEmptyElement("source",h))),o.move(o.createRangeOn(a),o.createPositionAt(f,"end"));for(const h of u)o.wrap(o.createRangeOn(f),h)}else if(a.parent.is("element","picture")){const u=a.parent;o.move(o.createRangeOn(a),o.createPositionBefore(u)),o.remove(u)}};return n=>{n.on("attribute:sources:imageBlock",e),n.on("attribute:sources:imageInline",e)}}function C1(t,e,n){const i=(r,o,s)=>{if(!s.consumable.consume(o.item,r.name))return;const a=s.writer,l=s.mapper.toViewElement(o.item),u=t.findViewImgElement(l);a.setAttribute(o.attributeKey,o.attributeNewValue||"",u)};return r=>{r.on(`attribute:${n}:${e}`,i)}}class TO extends _l{observe(e){this.listenTo(e,"load",(n,i)=>{const r=i.target;this.checkShouldIgnoreEventFromTarget(r)||r.tagName=="IMG"&&this._fireEvents(i)},{useCapture:!0})}stopObserving(e){this.stopListening(e)}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class h6e extends Ht{constructor(e){super(e);const n=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||n==="block"&&hn("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||n==="inline"&&hn("image-inline-plugin-required")}refresh(){const e=this.editor.plugins.get("ImageUtils");this.isEnabled=e.isImageAllowed()}execute(e){const n=li(e.source),i=this.editor.model.document.selection,r=this.editor.plugins.get("ImageUtils"),o=Object.fromEntries(i.getAttributes());n.forEach((s,a)=>{const l=i.getSelectedElement();if(typeof s=="string"&&(s={src:s}),a&&l&&r.isImage(l)){const u=this.editor.model.createPositionAfter(l);r.insertImage({...s,...o},u,e.imageType)}else e.breakBlock?r.insertImage({...s,...o},i.getFirstPosition(),e.imageType):r.insertImage({...s,...o},null,e.imageType)})}}class m6e extends Ht{constructor(e){super(e),this.decorate("cleanupImage")}refresh(){const n=this.editor.plugins.get("ImageUtils"),i=this.editor.model.document.selection.getSelectedElement();this.isEnabled=n.isImage(i),this.value=this.isEnabled?i.getAttribute("src"):null}execute(e){const n=this.editor.model.document.selection.getSelectedElement(),i=this.editor.plugins.get("ImageUtils");this.editor.model.change(r=>{r.setAttribute("src",e.source,n),this.cleanupImage(r,n),i.setImageNaturalSizeAttributes(n)})}cleanupImage(e,n){e.removeAttribute("srcset",n),e.removeAttribute("sizes",n),e.removeAttribute("sources",n),e.removeAttribute("width",n),e.removeAttribute("height",n),e.removeAttribute("alt",n)}}class EO extends xe{static get requires(){return[kr]}static get pluginName(){return"ImageEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.conversion;e.editing.view.addObserver(TO),n.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const i=new h6e(e),r=new m6e(e);e.commands.add("insertImage",i),e.commands.add("replaceImageSource",r),e.commands.add("imageInsert",i)}}class yX extends xe{static get requires(){return[kr]}static get pluginName(){return"ImageSizeAttributes"}static get isOfficialPlugin(){return!0}afterInit(){this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline")}_registerSchema(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["width","height"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["width","height"]})}_registerConverters(e){const n=this.editor,i=n.plugins.get("ImageUtils"),r=e==="imageBlock"?"figure":"img";n.conversion.for("upcast").attributeToAttribute({view:{name:r,styles:{width:/.+/}},model:{key:"width",value:s=>_1(s)?w1(s.getStyle("width")):null}}).attributeToAttribute({view:{name:r,key:"width"},model:"width"}).attributeToAttribute({view:{name:r,styles:{height:/.+/}},model:{key:"height",value:s=>_1(s)?w1(s.getStyle("height")):null}}).attributeToAttribute({view:{name:r,key:"height"},model:"height"}),n.conversion.for("editingDowncast").add(s=>{o(s,"width","width",!0,!0),o(s,"height","height",!0,!0)}),n.conversion.for("dataDowncast").add(s=>{o(s,"width","width",!1),o(s,"height","height",!1)}),n.conversion.for("upcast").add(s=>{s.on("element:img",(a,l,u)=>{const c=l.viewItem.getAttribute("width"),d=l.viewItem.getAttribute("height");c&&d&&u.consumable.consume(l.viewItem,{styles:["aspect-ratio"]})})});function o(s,a,l,u,c=!1){s.on(`attribute:${a}:${e}`,(d,f,h)=>{if(!h.consumable.consume(f.item,d.name))return;const m=h.writer,g=h.mapper.toViewElement(f.item),v=i.findViewImgElement(g);f.attributeNewValue!==null?m.setAttribute(l,f.attributeNewValue,v):m.removeAttribute(l,v);const p=f.item.getAttribute("width"),b=f.item.getAttribute("height"),y=p&&b;if(y&&c&&m.setAttribute("loading","lazy",v),f.item.hasAttribute("sources"))return;const _=f.item.hasAttribute("resizedWidth");e==="imageInline"&&!_&&!u||y&&m.setStyle("aspect-ratio",`${p}/${b}`,v)})}}}class wX extends Ht{_modelElementName;constructor(e,n){super(e),this._modelElementName=n}refresh(){const n=this.editor.plugins.get("ImageUtils"),i=n.getClosestSelectedImageElement(this.editor.model.document.selection);this._modelElementName==="imageBlock"?this.isEnabled=n.isInlineImage(i):this.isEnabled=n.isBlockImage(i)}execute(e={}){const n=this.editor,i=this.editor.model,r=n.plugins.get("ImageUtils"),o=r.getClosestSelectedImageElement(i.document.selection),s=Object.fromEntries(o.getAttributes());return!s.src&&!s.uploadId?null:i.change(a=>{const{setImageSizes:l=!0}=e,u=Array.from(i.markers).filter(f=>f.getRange().containsItem(o)),c=r.insertImage(s,i.createSelection(o,"on"),this._modelElementName,{setImageSizes:l});if(!c)return null;const d=a.createRangeOn(c);for(const f of u){const h=f.getRange(),m=h.root.rootName!="$graveyard"?h.getJoined(d,!0):d;a.updateMarker(f,{range:m})}return{oldElement:o,newElement:c}})}}class _X extends xe{static get requires(){return[kr]}static get pluginName(){return"ImagePlaceholder"}static get isOfficialPlugin(){return!0}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){const e=this.editor.model.schema;e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["placeholder"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){const e=this.editor,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("editingDowncast").add(r=>{r.on("attribute:placeholder",(o,s,a)=>{if(!a.consumable.test(s.item,o.name)||!s.item.is("element","imageBlock")&&!s.item.is("element","imageInline"))return;a.consumable.consume(s.item,o.name);const l=a.writer,u=a.mapper.toViewElement(s.item),c=i.findViewImgElement(u);s.attributeNewValue?(l.addClass("image_placeholder",c),l.setStyle("background-image",`url(${s.attributeNewValue})`,c),l.setCustomProperty("editingPipeline:doNotReuseOnce",!0,c)):(l.removeClass("image_placeholder",c),l.removeStyle("background-image",c))})})}_setupLoadListener(){const e=this.editor,n=e.model,i=e.editing,r=i.view,o=e.plugins.get("ImageUtils");r.addObserver(TO),this.listenTo(r.document,"imageLoaded",(s,a)=>{const l=r.domConverter.mapDomToView(a.target);if(!l)return;const u=o.getImageWidgetFromImageView(l);if(!u)return;const c=i.mapper.toModelElement(u);!c||!c.hasAttribute("placeholder")||n.enqueueChange({isUndoable:!1},d=>{d.removeAttribute("placeholder",c)})})}}class CX extends xe{static get requires(){return[EO,yX,kr,_X,fs]}static get pluginName(){return"ImageBlockEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new wX(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,n=e.t,i=e.conversion,r=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToStructure({model:"imageBlock",view:(o,{writer:s})=>OF(s)}),i.for("editingDowncast").elementToStructure({model:"imageBlock",view:(o,{writer:s})=>r.toImageWidget(OF(s),s,n("image widget"))}),i.for("downcast").add(C1(r,"imageBlock","src")).add(C1(r,"imageBlock","alt")).add(bX(r,"imageBlock")),i.for("upcast").elementToElement({view:gX(e,"imageBlock"),model:(o,{writer:s})=>s.createElement("imageBlock",o.hasAttribute("src")?{src:o.getAttribute("src")}:void 0)}).add(c6e(r))}_setupClipboardIntegration(){const e=this.editor,n=e.model,i=e.editing.view,r=e.plugins.get("ImageUtils"),o=e.plugins.get("ClipboardPipeline");this.listenTo(o,"inputTransformation",(s,a)=>{const l=Array.from(a.content.getChildren());let u;if(!l.every(r.isInlineImageView))return;a.targetRanges?u=e.editing.mapper.toModelRange(a.targetRanges[0]):u=n.document.selection.getFirstRange();const c=n.createSelection(u);if(SO(n.schema,c)==="imageBlock"){const d=new Pu(i.document),f=l.map(h=>d.createElement("figure",{class:"image"},h));a.content=d.createDocumentFragment(f)}}),this.listenTo(o,"contentInsertion",(s,a)=>{a.method==="paste"&&n.change(l=>{const u=l.createRangeIn(a.content);for(const c of u.getItems())c.is("element","imageBlock")&&r.setImageNaturalSizeAttributes(c)})})}}class g6e extends ut{focusTracker;keystrokes;_focusables;_focusCycler;children;constructor(e,n=[]){super(e),this.focusTracker=new wi,this.keystrokes=new Qi,this._focusables=new qr,this.children=this.createCollection(),this._focusCycler=new Ho({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const i of n)this.children.add(i),this._focusables.add(i),i instanceof L3e&&this._focusables.addMany(i.children);this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),vg({view:this});for(const n of this._focusables)this.focusTracker.add(n.element);this.keystrokes.listenTo(this.element);const e=n=>n.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}class SX extends xe{static get pluginName(){return"ImageInsertUI"}static get isOfficialPlugin(){return!0}static get requires(){return[kr]}dropdownView;_integrations=new Map;constructor(e){super(e),e.config.define("image.insert.integrations",["upload","assetManager","url"])}init(){const e=this.editor,n=e.model.document.selection,i=e.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(e.model.document,"change",()=>{this.isImageSelected=i.isImage(n.getSelectedElement())});const r=s=>this._createToolbarComponent(s),o=s=>this._createMenuBarComponent(s);e.ui.componentFactory.add("insertImage",r),e.ui.componentFactory.add("imageInsert",r),e.ui.componentFactory.add("menuBar:insertImage",o)}registerIntegration({name:e,observable:n,buttonViewCreator:i,formViewCreator:r,menuBarButtonViewCreator:o,requiresForm:s=!1,override:a=!1}){this._integrations.has(e)&&!a&&hn("image-insert-integration-exists",{name:e}),this._integrations.set(e,{observable:n,buttonViewCreator:i,menuBarButtonViewCreator:o,formViewCreator:r,requiresForm:s})}_createToolbarComponent(e){const n=this.editor,i=e.t,r=this._prepareIntegrations();if(!r.length)return null;let o;const s=r[0];if(r.length==1){if(!s.requiresForm)return s.buttonViewCreator(!0);o=s.buttonViewCreator(!0)}else{const u=s.buttonViewCreator(!1);o=new _S(e,u),o.tooltip=!0,o.bind("label").to(this,"isImageSelected",c=>i(c?"Replace image":"Insert image"))}const a=this.dropdownView=Ro(e,o),l=r.map(({observable:u})=>typeof u=="function"?u():u);return a.bind("isEnabled").toMany(l,"isEnabled",(...u)=>u.some(c=>c)),a.once("change:isOpen",()=>{const u=r.flatMap(({formViewCreator:d})=>d(r.length==1)),c=new g6e(n.locale,u);a.panelView.children.add(c)}),a}_createMenuBarComponent(e){const n=e.t,i=this._prepareIntegrations();if(!i.length)return null;const r=i.flatMap(({menuBarButtonViewCreator:a})=>a(i.length==1)),o=new la(e),s=new Zm(e);o.panelView.children.add(s),o.buttonView.set({icon:GDe,label:n("Image")});for(const a of r){const l=new yg(e,o);l.children.add(a),s.items.add(l),a.delegate("execute").to(o)}return o}_prepareIntegrations(){const n=this.editor.config.get("image.insert.integrations"),i=[];if(!n.length)return hn("image-insert-integrations-not-specified"),i;for(const r of n){if(!this._integrations.has(r)){["upload","assetManager","url"].includes(r)||hn("image-insert-unknown-integration",{item:r});continue}i.push(this._integrations.get(r))}return i.length||hn("image-insert-integrations-not-registered"),i}}class p6e extends xe{static get requires(){return[CX,h0,vX,SX]}static get pluginName(){return"ImageBlock"}static get isOfficialPlugin(){return!0}}class v6e extends xe{static get requires(){return[EO,yX,kr,_X,fs]}static get pluginName(){return"ImageInlineEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"],disallowIn:["caption"]}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new wX(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,n=e.t,i=e.conversion,r=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToElement({model:"imageInline",view:(o,{writer:s})=>s.createEmptyElement("img")}),i.for("editingDowncast").elementToStructure({model:"imageInline",view:(o,{writer:s})=>r.toImageWidget(e6e(s),s,n("image widget"))}),i.for("downcast").add(C1(r,"imageInline","src")).add(C1(r,"imageInline","alt")).add(bX(r,"imageInline")),i.for("upcast").elementToElement({view:gX(e,"imageInline"),model:(o,{writer:s})=>s.createElement("imageInline",o.hasAttribute("src")?{src:o.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const e=this.editor,n=e.model,i=e.editing.view,r=e.plugins.get("ImageUtils"),o=e.plugins.get("ClipboardPipeline");this.listenTo(o,"inputTransformation",(s,a)=>{const l=Array.from(a.content.getChildren());let u;if(!l.every(r.isBlockImageView))return;a.targetRanges?u=e.editing.mapper.toModelRange(a.targetRanges[0]):u=n.document.selection.getFirstRange();const c=n.createSelection(u);if(SO(n.schema,c)==="imageInline"){const d=new Pu(i.document),f=l.map(h=>h.childCount===1?(Array.from(h.getAttributes()).forEach(m=>d.setAttribute(...m,r.findViewImgElement(h))),h.getChild(0)):h);a.content=d.createDocumentFragment(f)}}),this.listenTo(o,"contentInsertion",(s,a)=>{a.method==="paste"&&n.change(l=>{const u=l.createRangeIn(a.content);for(const c of u.getItems())c.is("element","imageInline")&&r.setImageNaturalSizeAttributes(c)})})}}class b6e extends xe{static get requires(){return[v6e,h0,vX,SX]}static get pluginName(){return"ImageInline"}static get isOfficialPlugin(){return!0}}let y6e=class extends xe{static get requires(){return[p6e,b6e]}static get pluginName(){return"Image"}static get isOfficialPlugin(){return!0}};class kX extends xe{static get pluginName(){return"ImageCaptionUtils"}static get isOfficialPlugin(){return!0}static get requires(){return[kr]}getCaptionFromImageModelElement(e){for(const n of e.getChildren())if(n&&n.is("element","caption"))return n;return null}getCaptionFromModelSelection(e){const n=this.editor.plugins.get("ImageUtils"),i=e.getFirstPosition().findAncestor("caption");return i&&n.isBlockImage(i.parent)?i:null}matchImageCaptionViewElement(e){const n=this.editor.plugins.get("ImageUtils");return e.name=="figcaption"&&n.isBlockImageView(e.parent)?{name:!0}:null}}class w6e extends Ht{refresh(){const e=this.editor,n=e.plugins.get("ImageCaptionUtils"),i=e.plugins.get("ImageUtils");if(!e.plugins.has(CX)){this.isEnabled=!1,this.value=!1;return}const r=e.model.document.selection,o=r.getSelectedElement();if(!o){const s=n.getCaptionFromModelSelection(r);this.isEnabled=!!s,this.value=!!s;return}this.isEnabled=i.isImage(o),this.isEnabled?this.value=!!n.getCaptionFromImageModelElement(o):this.value=!1}execute(e={}){const{focusCaptionOnShow:n}=e;this.editor.model.change(i=>{this.value?this._hideImageCaption(i):this._showImageCaption(i,n)})}_showImageCaption(e,n){const r=this.editor.model.document.selection,o=this.editor.plugins.get("ImageCaptionEditing"),s=this.editor.plugins.get("ImageUtils");let a=r.getSelectedElement();const l=o._getSavedCaption(a);s.isInlineImage(a)&&(this.editor.execute("imageTypeBlock"),a=r.getSelectedElement());const u=l||e.createElement("caption");e.append(u,a),n&&e.setSelection(u,"in")}_hideImageCaption(e){const n=this.editor,i=n.model.document.selection,r=n.plugins.get("ImageCaptionEditing"),o=n.plugins.get("ImageCaptionUtils");let s=i.getSelectedElement(),a;s?a=o.getCaptionFromImageModelElement(s):(a=o.getCaptionFromModelSelection(i),s=a.parent),r._saveCaption(s,a),e.setSelection(s,"on"),e.remove(a)}}class _6e extends xe{static get requires(){return[kr,kX]}static get pluginName(){return"ImageCaptionEditing"}static get isOfficialPlugin(){return!0}_savedCaptionsMap;constructor(e){super(e),this._savedCaptionsMap=new WeakMap}init(){const e=this.editor,n=e.model.schema;n.isRegistered("caption")?n.extend("caption",{allowIn:"imageBlock"}):n.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new w6e(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const e=this.editor,n=e.editing.view,i=e.plugins.get("ImageUtils"),r=e.plugins.get("ImageCaptionUtils"),o=e.t;e.conversion.for("upcast").elementToElement({view:s=>r.matchImageCaptionViewElement(s),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(s,{writer:a})=>i.isBlockImage(s.parent)?a.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(s,{writer:a})=>{if(!i.isBlockImage(s.parent))return null;const l=a.createEditableElement("figcaption");a.setCustomProperty("imageCaption",!0,l),l.placeholder=o("Enter image caption"),qM({view:n,element:l,keepOnFocus:!0});const u=s.parent.getAttribute("alt"),c=u?o("Caption for image: %0",[u]):o("Caption for the image");return bO(l,a,{label:c})}})}_setupImageTypeCommandsIntegration(){const e=this.editor,n=e.plugins.get("ImageUtils"),i=e.plugins.get("ImageCaptionUtils"),r=e.commands.get("imageTypeInline"),o=e.commands.get("imageTypeBlock"),s=a=>{if(!a.return)return;const{oldElement:l,newElement:u}=a.return;if(!l)return;if(n.isBlockImage(l)){const d=i.getCaptionFromImageModelElement(l);if(d){this._saveCaption(u,d);return}}const c=this._getSavedCaption(l);c&&this._saveCaption(u,c)};r&&this.listenTo(r,"execute",s,{priority:"low"}),o&&this.listenTo(o,"execute",s,{priority:"low"})}_getSavedCaption(e){const n=this._savedCaptionsMap.get(e);return n?zn.fromJSON(n):null}_saveCaption(e,n){this._savedCaptionsMap.set(e,n.toJSON())}_registerCaptionReconversion(){const e=this.editor,n=e.model,i=e.plugins.get("ImageUtils"),r=e.plugins.get("ImageCaptionUtils");n.document.on("change:data",()=>{const o=n.document.differ.getChanges();for(const s of o){if(s.attributeKey!=="alt")continue;const a=s.range.start.nodeAfter;if(i.isBlockImage(a)){const l=r.getCaptionFromImageModelElement(a);if(!l)return;e.editing.reconvertItem(l)}}})}}class C6e extends xe{static get requires(){return[kX]}static get pluginName(){return"ImageCaptionUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.editing.view,i=e.plugins.get("ImageCaptionUtils"),r=e.t;e.ui.componentFactory.add("toggleImageCaption",o=>{const s=e.commands.get("toggleImageCaption"),a=new wt(o);return a.set({icon:uY,tooltip:!0,isToggleable:!0}),a.bind("isOn","isEnabled").to(s,"value","isEnabled"),a.bind("label").to(s,"value",l=>r(l?"Toggle caption off":"Toggle caption on")),this.listenTo(a,"execute",()=>{e.execute("toggleImageCaption",{focusCaptionOnShow:!0});const l=i.getCaptionFromModelSelection(e.model.document.selection);if(l){const u=e.editing.mapper.toViewElement(l);n.scrollToTheSelection(),n.change(c=>{c.addClass("image__caption_highlighted",u)})}e.editing.view.focus()}),a})}}class S6e extends xe{static get requires(){return[_6e,C6e]}static get pluginName(){return"ImageCaption"}static get isOfficialPlugin(){return!0}}function TX(t){const e=t.map(n=>n.replace("+","\\+"));return new RegExp(`^image\\/(${e.join("|")})$`)}function k6e(t){return new Promise((e,n)=>{const i=t.getAttribute("src");fetch(i).then(r=>r.blob()).then(r=>{const o=EX(r,i),a=`image.${o.replace("image/","")}`,l=new File([r],a,{type:o});e(l)}).catch(r=>r&&r.name==="TypeError"?E6e(i).then(e).catch(n):n(r))})}function T6e(t,e){return!t.isInlineImageView(e)||!e.getAttribute("src")?!1:!!e.getAttribute("src").match(/^data:image\/\w+;base64,/g)||!!e.getAttribute("src").match(/^blob:/g)}function EX(t,e){return t.type?t.type:e.match(/data:(image\/\w+);base64/)?e.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}function E6e(t){return x6e(t).then(e=>{const n=EX(e,t),r=`image.${n.replace("image/","")}`;return new File([e],r,{type:n})})}function x6e(t){return new Promise((e,n)=>{const i=Qe.document.createElement("img");i.addEventListener("load",()=>{const r=Qe.document.createElement("canvas");r.width=i.width,r.height=i.height,r.getContext("2d").drawImage(i,0,0),r.toBlob(s=>s?e(s):n())}),i.addEventListener("error",()=>n()),i.src=t})}class A6e extends xe{static get pluginName(){return"ImageUploadUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("uploadImage",()=>this._createToolbarButton()),e.ui.componentFactory.add("imageUpload",()=>this._createToolbarButton()),e.ui.componentFactory.add("menuBar:uploadImage",()=>this._createMenuBarButton("standalone")),e.plugins.has("ImageInsertUI")&&e.plugins.get("ImageInsertUI").registerIntegration({name:"upload",observable:()=>e.commands.get("uploadImage"),buttonViewCreator:()=>this._createToolbarButton(),formViewCreator:()=>this._createDropdownButton(),menuBarButtonViewCreator:n=>this._createMenuBarButton(n?"insertOnly":"insertNested")})}_createButton(e){const n=this.editor,i=n.locale,r=n.commands.get("uploadImage"),o=n.config.get("image.upload.types"),s=TX(o),a=new e(n.locale),l=i.t;return a.set({acceptedType:o.map(u=>`image/${u}`).join(","),allowMultipleFiles:!0,label:l("Upload from computer"),icon:YDe}),a.bind("isEnabled").to(r),a.on("done",(u,c)=>{const d=Array.from(c).filter(f=>s.test(f.type));d.length&&(n.execute("uploadImage",{file:d}),n.editing.view.focus())}),a}_createToolbarButton(){const e=this.editor.locale.t,n=this.editor.plugins.get("ImageInsertUI"),i=this.editor.commands.get("uploadImage"),r=this._createButton(OV);return r.tooltip=!0,r.bind("label").to(n,"isImageSelected",i,"isAccessAllowed",(o,s)=>e(s?o?"Replace image from computer":"Upload image from computer":"You have no image upload permissions.")),r}_createDropdownButton(){const e=this.editor.locale.t,n=this.editor.plugins.get("ImageInsertUI"),i=this._createButton(OV);return i.withText=!0,i.bind("label").to(n,"isImageSelected",r=>e(r?"Replace from computer":"Upload from computer")),i.on("execute",()=>{n.dropdownView.isOpen=!1}),i}_createMenuBarButton(e){const n=this.editor.locale.t,i=this._createButton(WY);switch(i.withText=!0,e){case"standalone":i.label=n("Image from computer");break;case"insertOnly":i.label=n("Image");break;case"insertNested":i.label=n("From computer");break}return i}}class P6e extends xe{static get pluginName(){return"ImageUploadProgress"}static get isOfficialPlugin(){return!0}placeholder;constructor(e){super(e),this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}uploadStatusChange=(e,n,i)=>{const r=this.editor,o=n.item,s=o.getAttribute("uploadId");if(!i.consumable.consume(n.item,e.name))return;const a=r.plugins.get("ImageUtils"),l=r.plugins.get(eu),u=s?n.attributeNewValue:null,c=this.placeholder,d=r.editing.mapper.toViewElement(o),f=i.writer;if(u=="reading"){LF(d,f),DF(a,c,d,f);return}if(u=="uploading"){const h=l.loaders.get(s);LF(d,f),h?(NF(d,f),R6e(d,f,h,r.editing.view),N6e(a,d,f,h)):DF(a,c,d,f);return}u=="complete"&&l.loaders.get(s)&&O6e(d,f,r.editing.view),M6e(d,f),NF(d,f),I6e(d,f)}}function LF(t,e){t.hasClass("ck-appear")||e.addClass("ck-appear",t)}function I6e(t,e){e.removeClass("ck-appear",t)}function DF(t,e,n,i){n.hasClass("ck-image-upload-placeholder")||i.addClass("ck-image-upload-placeholder",n);const r=t.findViewImgElement(n);r.getAttribute("src")!==e&&i.setAttribute("src",e,r),xX(n,"placeholder")||i.insert(i.createPositionAfter(r),D6e(i))}function NF(t,e){t.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",t),AX(t,e,"placeholder")}function R6e(t,e,n,i){const r=L6e(e);e.insert(e.createPositionAt(t,"end"),r),n.on("change:uploadedPercent",(o,s,a)=>{i.change(l=>{l.setStyle("width",a+"%",r)})})}function M6e(t,e){AX(t,e,"progressBar")}function O6e(t,e,n){const i=e.createUIElement("div",{class:"ck-image-upload-complete-icon"});e.insert(e.createPositionAt(t,"end"),i),setTimeout(()=>{n.change(r=>r.remove(r.createRangeOn(i)))},3e3)}function L6e(t){const e=t.createUIElement("div",{class:"ck-progress-bar"});return t.setCustomProperty("progressBar",!0,e),e}function D6e(t){const e=t.createUIElement("div",{class:"ck-upload-placeholder-loader"});return t.setCustomProperty("placeholder",!0,e),e}function xX(t,e){for(const n of t.getChildren())if(n.getCustomProperty(e))return n}function AX(t,e,n){const i=xX(t,n);i&&e.remove(e.createRangeOn(i))}function N6e(t,e,n,i){if(i.data){const r=t.findViewImgElement(e);n.setAttribute("src",i.data,r)}}class B6e extends Ht{constructor(e){super(e),this.set("isAccessAllowed",!0)}refresh(){const e=this.editor,n=e.plugins.get("ImageUtils"),i=e.model.document.selection.getSelectedElement();this.isEnabled=n.isImageAllowed()||n.isImage(i)}execute(e){const n=li(e.file),i=this.editor.model.document.selection,r=this.editor.plugins.get("ImageUtils"),o=Object.fromEntries(i.getAttributes());n.forEach((s,a)=>{const l=i.getSelectedElement();if(a&&l&&r.isImage(l)){const u=this.editor.model.createPositionAfter(l);this._uploadImage(s,o,u)}else this._uploadImage(s,o)})}_uploadImage(e,n,i){const r=this.editor,s=r.plugins.get(eu).createLoader(e),a=r.plugins.get("ImageUtils");s&&a.insertImage({...n,uploadId:s.id},i)}}class V6e extends xe{static get requires(){return[eu,WV,fs,kr]}static get pluginName(){return"ImageUploadEditing"}static get isOfficialPlugin(){return!0}_uploadImageElements;_uploadedImages=new Map;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,n=e.model.document,i=e.conversion,r=e.plugins.get(eu),o=e.plugins.get("ImageUtils"),s=e.plugins.get("ClipboardPipeline"),a=TX(e.config.get("image.upload.types")),l=new B6e(e);e.commands.add("uploadImage",l),e.commands.add("imageUpload",l),i.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}).add(u=>u.on("element:img",(c,d,f)=>{if(!f.consumable.test(d.viewItem,{attributes:["data-ck-upload-id"]}))return;const h=d.viewItem.getAttribute("data-ck-upload-id");if(!h)return;const[m]=Array.from(d.modelRange.getItems({shallow:!0})),g=r.loaders.get(h);m&&(f.writer.setAttribute("uploadId",h,m),f.consumable.consume(d.viewItem,{attributes:["data-ck-upload-id"]}),g&&g.data&&f.writer.setAttribute("uploadStatus",g.status,m))},{priority:"low"})),this.listenTo(e.editing.view.document,"clipboardInput",(u,c)=>{if(F6e(c.dataTransfer))return;const d=Array.from(c.dataTransfer.files).filter(h=>h?a.test(h.type):!1);if(!d.length)return;if(u.stop(),e.model.change(h=>{c.targetRanges&&h.setSelection(c.targetRanges.map(m=>e.editing.mapper.toModelRange(m))),e.execute("uploadImage",{file:d})}),!e.commands.get("uploadImage").isAccessAllowed){const h=e.plugins.get("Notification"),m=e.locale.t;h.showWarning(m("You have no image upload permissions."),{namespace:"image"})}}),this.listenTo(s,"inputTransformation",(u,c)=>{const d=Array.from(e.editing.view.createRangeIn(c.content)).map(h=>h.item).filter(h=>T6e(o,h)&&!h.getAttribute("uploadProcessed")).map(h=>({promise:k6e(h),imageElement:h}));if(!d.length)return;const f=new Pu(e.editing.view.document);for(const h of d){f.setAttribute("uploadProcessed",!0,h.imageElement);const m=r.createLoader(h.promise);m&&(f.setAttribute("src","",h.imageElement),f.setAttribute("uploadId",m.id,h.imageElement))}}),e.editing.view.document.on("dragover",(u,c)=>{c.preventDefault()}),n.on("change",()=>{const u=n.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),c=new Set;for(const d of u)if(d.type=="insert"&&d.name!="$text"){const f=d.position.nodeAfter,h=d.position.root.rootName=="$graveyard";for(const m of $6e(e,f)){const g=m.getAttribute("uploadId"),v=m.getAttribute("uploadStatus");if(!g||v=="complete")continue;const p=r.loaders.get(g);if(!p){!h&&this._uploadedImages.has(g)&&e.model.enqueueChange({isUndoable:!1},b=>{b.setAttribute("uploadStatus","complete",m),this.fire("uploadComplete",{data:this._uploadedImages.get(g),imageElement:m})});continue}h?c.has(g)||Array.from(this._uploadImageElements.get(g)).every(y=>y.root.rootName=="$graveyard")&&p.abort():(c.add(g),this._uploadImageElements.has(g)?this._uploadImageElements.get(g).add(m):this._uploadImageElements.set(g,new Set([m])),p.status=="idle"&&this._readAndUpload(p))}}}),this.on("uploadComplete",(u,{imageElement:c,data:d})=>{const f=d.urls?d.urls:d;this.editor.model.change(h=>{h.setAttribute("src",f.default,c),this._parseAndSetSrcsetAttributeOnImage(f,c,h),o.setImageNaturalSizeAttributes(c)})},{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&(e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageBlock")),this.editor.plugins.has("ImageInlineEditing")&&(e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageInline"))}_readAndUpload(e){const n=this.editor,i=n.model,r=n.locale.t,o=n.plugins.get(eu),s=n.plugins.get(WV),a=n.plugins.get("ImageUtils"),l=this._uploadImageElements;return i.enqueueChange({isUndoable:!1},c=>{const d=l.get(e.id);for(const f of d)c.setAttribute("uploadStatus","reading",f)}),e.read().then(()=>{const c=e.upload();n.ui&&n.ui.ariaLiveAnnouncer.announce(r("Uploading image"));for(const d of l.get(e.id)){if(vt.isSafari){const f=n.editing.mapper.toViewElement(d),h=a.findViewImgElement(f);n.editing.view.once("render",()=>{if(!h.parent)return;const m=n.editing.view.domConverter.mapViewToDom(h.parent);if(!m)return;const g=m.style.display;m.style.display="none",m._ckHack=m.offsetHeight,m.style.display=g})}i.enqueueChange({isUndoable:!1},f=>{f.setAttribute("uploadStatus","uploading",d)})}return c}).then(c=>{i.enqueueChange({isUndoable:!1},d=>{for(const f of l.get(e.id))d.setAttribute("uploadStatus","complete",f),this.fire("uploadComplete",{data:c,imageElement:f});n.ui&&n.ui.ariaLiveAnnouncer.announce(r("Image upload complete")),this._uploadedImages.set(e.id,c)}),u()}).catch(c=>{if(n.ui&&n.ui.ariaLiveAnnouncer.announce(r("Error during image upload")),e.status!=="error"&&e.status!=="aborted")throw c;e.status=="error"&&c&&s.showWarning(c,{title:r("Upload failed"),namespace:"upload"}),i.enqueueChange({isUndoable:!1},d=>{for(const f of l.get(e.id))f.root.rootName!=="$graveyard"&&d.remove(f)}),u()});function u(){i.enqueueChange({isUndoable:!1},c=>{for(const d of l.get(e.id))c.removeAttribute("uploadId",d),c.removeAttribute("uploadStatus",d);l.delete(e.id)}),o.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,n,i){let r=0;const o=Object.keys(e).filter(s=>{const a=parseInt(s,10);if(!isNaN(a))return r=Math.max(r,a),!0}).map(s=>`${e[s]} ${s}w`).join(", ");if(o!=""){const s={srcset:o};!n.hasAttribute("width")&&!n.hasAttribute("height")&&(s.width=r),i.setAttributes(s,n)}}_registerConverters(e){const{conversion:n,plugins:i}=this.editor,r=i.get(eu),o=i.get(kr);n.for("dataDowncast").add(s=>{s.on(`attribute:uploadId:${e}`,(a,l,u)=>{if(!u.consumable.test(l.item,a.name))return;const c=r.loaders.get(l.attributeNewValue);if(!c||!c.data)return null;const d=u.mapper.toViewElement(l.item),f=o.findViewImgElement(d);f&&(u.consumable.consume(l.item,a.name),u.writer.setAttribute("data-ck-upload-id",c.id,f))})})}}function F6e(t){return Array.from(t.types).includes("text/html")&&t.getData("text/html")!==""}function $6e(t,e){const n=t.plugins.get("ImageUtils");return Array.from(t.model.createRangeOn(e)).filter(i=>n.isImage(i.item)).map(i=>i.item)}class z6e extends xe{static get pluginName(){return"ImageUpload"}static get isOfficialPlugin(){return!0}static get requires(){return[V6e,A6e,P6e]}}class H6e extends Ht{refresh(){const e=this.editor,i=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!i,!i||!i.hasAttribute("resizedWidth")?this.value=null:this.value={width:i.getAttribute("resizedWidth"),height:null}}execute(e){const n=this.editor,i=n.model,r=n.plugins.get("ImageUtils"),o=r.getClosestSelectedImageElement(i.document.selection);this.value={width:e.width,height:null},o&&i.change(s=>{s.setAttribute("resizedWidth",e.width,o),s.removeAttribute("resizedHeight",o),r.setImageNaturalSizeAttributes(o)})}}class PX extends xe{static get requires(){return[kr]}static get pluginName(){return"ImageResizeEditing"}static get licenseFeatureCode(){return"IR"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:custom",value:"custom",icon:"custom"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const e=this.editor,n=new H6e(e);this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",n),e.commands.add("imageResize",n)}afterInit(){this._registerSchema()}_registerSchema(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&(e.extend("imageBlock",{allowAttributes:["resizedWidth","resizedHeight"]}),e.setAttributeProperties("resizedWidth",{isFormatting:!0}),e.setAttributeProperties("resizedHeight",{isFormatting:!0})),this.editor.plugins.has("ImageInlineEditing")&&(e.extend("imageInline",{allowAttributes:["resizedWidth","resizedHeight"]}),e.setAttributeProperties("resizedWidth",{isFormatting:!0}),e.setAttributeProperties("resizedHeight",{isFormatting:!0}))}_registerConverters(e){const n=this.editor,i=n.plugins.get("ImageUtils");n.conversion.for("downcast").add(r=>r.on(`attribute:resizedWidth:${e}`,(o,s,a)=>{if(!a.consumable.consume(s.item,o.name))return;const l=a.writer,u=a.mapper.toViewElement(s.item);s.attributeNewValue!==null?(l.setStyle("width",s.attributeNewValue,u),l.addClass("image_resized",u)):(l.removeStyle("width",u),l.removeClass("image_resized",u))})),n.conversion.for("dataDowncast").attributeToAttribute({model:{name:e,key:"resizedHeight"},view:r=>({key:"style",value:{height:r}})}),n.conversion.for("editingDowncast").add(r=>r.on(`attribute:resizedHeight:${e}`,(o,s,a)=>{if(!a.consumable.consume(s.item,o.name))return;const l=a.writer,u=a.mapper.toViewElement(s.item),c=e==="imageInline"?i.findViewImgElement(u):u;s.attributeNewValue!==null?l.setStyle("height",s.attributeNewValue,c):l.removeStyle("height",c)})),n.conversion.for("upcast").attributeToAttribute({view:{name:e==="imageBlock"?"figure":"img",styles:{width:/.+/}},model:{key:"resizedWidth",value:r=>_1(r)?null:r.getStyle("width")}}),n.conversion.for("upcast").attributeToAttribute({view:{name:e==="imageBlock"?"figure":"img",styles:{height:/.+/}},model:{key:"resizedHeight",value:r=>_1(r)?null:r.getStyle("height")}}),n.conversion.for("upcast").add(r=>{r.on(`element:${e==="imageBlock"?"figure":"img"}`,(o,s,a)=>{a.consumable.consume(s.viewItem,{classes:["image_resized"]})})})}}const mE={small:aNe,medium:sNe,large:oNe,custom:iNe,original:rNe};class U6e extends xe{static get requires(){return[PX]}static get pluginName(){return"ImageResizeButtons"}static get isOfficialPlugin(){return!0}_resizeUnit;constructor(e){super(e),this._resizeUnit=e.config.get("image.resizeUnit")}init(){const e=this.editor,n=e.config.get("image.resizeOptions"),i=e.commands.get("resizeImage");this.bind("isEnabled").to(i);for(const r of n)this._registerImageResizeButton(r);this._registerImageResizeDropdown(n)}_registerImageResizeButton(e){const n=this.editor,{name:i,value:r,icon:o}=e;n.ui.componentFactory.add(i,s=>{const a=new wt(s),l=n.commands.get("resizeImage"),u=this._getOptionLabelValue(e,!0);if(!mE[o])throw new oe("imageresizebuttons-missing-icon",n,e);if(a.set({label:u,icon:mE[o],tooltip:u,isToggleable:!0}),a.bind("isEnabled").to(this),n.plugins.has("ImageCustomResizeUI")&&Zg(e)){const c=n.plugins.get("ImageCustomResizeUI");this.listenTo(a,"execute",()=>{c._showForm(this._resizeUnit)})}else{const c=r?r+this._resizeUnit:null;a.bind("isOn").to(l,"value",l,"isEnabled",$A(c)),this.listenTo(a,"execute",()=>{n.execute("resizeImage",{width:c})})}return a})}_registerImageResizeDropdown(e){const n=this.editor,i=n.t,r=e.find(s=>!s.value),o=s=>{const a=n.commands.get("resizeImage"),l=Ro(s,DY),u=l.buttonView,c=i("Resize image");return u.set({tooltip:c,commandValue:r.value,icon:mE.medium,isToggleable:!0,label:this._getOptionLabelValue(r),withText:!0,class:"ck-resize-image-button",ariaLabel:c,ariaLabelledBy:void 0}),u.bind("label").to(a,"value",d=>d&&d.width?d.width:this._getOptionLabelValue(r)),l.bind("isEnabled").to(this),f0(l,()=>this._getResizeDropdownListItemDefinitions(e,a),{ariaLabel:i("Image resize list"),role:"menu"}),this.listenTo(l,"execute",d=>{"onClick"in d.source?d.source.onClick():(n.execute(d.source.commandName,{width:d.source.commandValue}),n.editing.view.focus())}),l};n.ui.componentFactory.add("resizeImage",o),n.ui.componentFactory.add("imageResize",o)}_getOptionLabelValue(e,n=!1){const i=this.editor.t;return e.label?e.label:n?Zg(e)?i("Custom image size"):e.value?i("Resize image to %0",e.value+this._resizeUnit):i("Resize image to the original size"):Zg(e)?i("Custom"):e.value?e.value+this._resizeUnit:i("Original")}_getResizeDropdownListItemDefinitions(e,n){const{editor:i}=this,r=new Er,o=e.map(s=>Zg(s)?{...s,valueWithUnits:"custom"}:s.value?{...s,valueWithUnits:`${s.value}${this._resizeUnit}`}:{...s,valueWithUnits:null});for(const s of o){let a=null;if(i.plugins.has("ImageCustomResizeUI")&&Zg(s)){const l=i.plugins.get("ImageCustomResizeUI");a={type:"button",model:new Jm({label:this._getOptionLabelValue(s),role:"menuitemradio",withText:!0,icon:null,onClick:()=>{l._showForm(this._resizeUnit)}})};const u=Object.values(o).map(c=>c.valueWithUnits);a.model.bind("isOn").to(n,"value",n,"isEnabled",W6e(u))}else a={type:"button",model:new Jm({commandName:"resizeImage",commandValue:s.valueWithUnits,label:this._getOptionLabelValue(s),role:"menuitemradio",withText:!0,icon:null})},a.model.bind("isOn").to(n,"value",n,"isEnabled",$A(s.valueWithUnits));a.model.bind("isEnabled").to(n,"isEnabled"),r.add(a)}return r}}function Zg(t){return t.value==="custom"}function $A(t){return(e,n)=>{const i=e;return i===void 0||!n?!1:t===null&&i===t?!0:i!==null&&i.width===t}}function W6e(t){return(e,n)=>!t.some(i=>$A(i)(e,n))}const q6e="figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img",gE="image_resized";class j6e extends xe{static get requires(){return[iE,kr]}static get pluginName(){return"ImageResizeHandles"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(e),this._setupResizerCreator()}_setupResizerCreator(){const e=this.editor,n=e.editing.view,i=e.plugins.get("ImageUtils");n.addObserver(TO),this.listenTo(n.document,"imageLoaded",(r,o)=>{if(!o.target.matches(q6e))return;const s=e.editing.view.domConverter,a=s.domToView(o.target),l=i.getImageWidgetFromImageView(a);let u=this.editor.plugins.get(iE).getResizerByViewElement(l);if(u){u.redraw();return}const c=e.editing.mapper,d=c.toModelElement(l);u=e.plugins.get(iE).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:d,viewElement:l,editor:e,getHandleHost(f){return f.querySelector("img")},getResizeHost(){return s.mapViewToDom(c.toViewElement(d))},isCentered(){return d.getAttribute("imageStyle")=="alignCenter"},onCommit(f){n.change(h=>{h.removeClass(gE,l)}),e.execute("resizeImage",{width:f})}}),u.on("updateSize",()=>{l.hasClass(gE)||n.change(h=>{h.addClass(gE,l)});const f=d.name==="imageInline"?a:l;f.getStyle("height")&&n.change(h=>{h.removeStyle("height",f)})}),u.bind("isEnabled").to(this)})}}function IX(t){if(!t)return null;const[,e,n]=t.trim().match(/([.,\d]+)(%|px)$/)||[],i=Number.parseFloat(e);return Number.isNaN(i)?null:{value:i,unit:n}}function RX(t,e,n){return n==="px"?{value:e.value,unit:"px"}:{value:e.value/t*100,unit:"%"}}function MX(t){const{editing:e}=t,i=t.plugins.get("ImageUtils").getClosestSelectedImageElement(t.model.document.selection);if(!i)return null;const r=e.mapper.toViewElement(i),o=e.view.domConverter.mapViewToDom(r);return{model:i,view:r,dom:o}}function K6e(t,e){const n=MX(t);if(!n)return null;const i=IX(n.model.getAttribute("resizedWidth")||null);if(!i)return null;if(i.unit===e)return i;const r=yO(n.dom),o={value:new Wt(n.dom).width};return RX(r,o,e)}class G6e extends ut{focusTracker;keystrokes;unit;backButtonView;saveButtonView;labeledInput;children;_focusables;_focusCycler;_validators;constructor(e,n,i){super(e),this.focusTracker=new wi,this.keystrokes=new Qi,this.unit=n,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.labeledInput=this._createLabeledInputView(),this.children=this.createCollection([this._createHeaderView()]),this.children.add(new Xs(e,{children:[this.labeledInput,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding"]})),this._focusables=new qr,this._validators=i,this.keystrokes.set("Esc",(r,o)=>{this.fire("cancel"),o()}),this._focusCycler=new Ho({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-image-custom-resize-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),vg({view:this}),[this.backButtonView,this.labeledInput,this.saveButtonView].forEach(n=>{this._focusables.add(n),this.focusTracker.add(n.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createBackButton(){const e=this.locale.t,n=new wt(this.locale);return n.set({class:"ck-button-back",label:e("Back"),icon:pg,tooltip:!0}),n.delegate("execute").to(this,"cancel"),n}_createSaveButton(){const e=this.locale.t,n=new wt(this.locale);return n.set({label:e("Save"),withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),n}_createHeaderView(){const e=this.locale.t,n=new qf(this.locale,{label:e("Image Resize")});return n.children.add(this.backButtonView,0),n}_createLabeledInputView(){const e=this.locale.t,n=new Go(this.locale,nBe);return n.label=e("Resize image (in %0)",this.unit),n.class="ck-labeled-field-view_full-width",n.fieldView.set({step:.1}),n}isValid(){this.resetFormStatus();for(const e of this._validators){const n=e(this);if(n)return this.labeledInput.errorText=n,!1}return!0}resetFormStatus(){this.labeledInput.errorText=null}get rawSize(){const{element:e}=this.labeledInput.fieldView;return e?e.value:null}get parsedSize(){const{rawSize:e}=this;if(e===null)return null;const n=Number.parseFloat(e);return Number.isNaN(n)?null:n}get sizeWithUnits(){const{parsedSize:e,unit:n}=this;return e===null?null:`${e}${n}`}}function Y6e(t,e){const n=MX(t);if(!n)return null;const i=yO(n.dom),r=IX(window.getComputedStyle(n.dom).minWidth)||{value:1},o=Math.max(.1,RX(i,r,e).value);return{unit:e,lower:o,upper:e==="px"?i:100}}class X6e extends xe{_balloon;_form;static get requires(){return[bu]}static get pluginName(){return"ImageCustomResizeUI"}static get isOfficialPlugin(){return!0}destroy(){super.destroy(),this._form&&this._form.destroy()}_createForm(e){const n=this.editor;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(cb(G6e))(n.locale,e,J6e(n)),this._form.render(),this.listenTo(this._form,"submit",()=>{this._form.isValid()&&(n.execute("resizeImage",{width:this._form.sizeWithUnits}),this._hideForm(!0))}),this.listenTo(this._form.labeledInput,"change:errorText",()=>{n.ui.update()}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),Wf({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(e){if(this._isVisible)return;this._form||this._createForm(e);const n=this.editor,i=this._form.labeledInput;this._form.disableCssTransitions(),this._form.resetFormStatus(),this._isInBalloon||this._balloon.add({view:this._form,position:kO(n)});const r=K6e(n,e),o=r?r.value.toFixed(1):"",s=Y6e(n,e);i.fieldView.value=i.fieldView.element.value=o,s&&Object.assign(i.fieldView,{min:s.lower.toFixed(1),max:Math.ceil(s.upper).toFixed(1)}),this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){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&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}function J6e(t){const e=t.t;return[n=>{if(n.rawSize.trim()==="")return e("The value must not be empty.");if(n.parsedSize===null)return e("The value should be a plain number.")}]}class Z6e extends xe{static get requires(){return[PX,j6e,X6e,U6e]}static get pluginName(){return"ImageResize"}static get isOfficialPlugin(){return!0}}class Q6e extends Ht{_defaultStyles;_styles;constructor(e,n){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(n.map(i=>{if(i.isDefault)for(const r of i.modelElements)this._defaultStyles[r]=i.name;return[i.name,i]}))}refresh(){const i=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!i,this.isEnabled?i.hasAttribute("imageStyle")?this.value=i.getAttribute("imageStyle"):this.value=this._defaultStyles[i.name]:this.value=!1}execute(e={}){const n=this.editor,i=n.model,r=n.plugins.get("ImageUtils");i.change(o=>{const s=e.value,{setImageSizes:a=!0}=e;let l=r.getClosestSelectedImageElement(i.document.selection);s&&this.shouldConvertImageType(s,l)&&(this.editor.execute(r.isBlockImage(l)?"imageTypeInline":"imageTypeBlock",{setImageSizes:a}),l=r.getClosestSelectedImageElement(i.document.selection)),!s||this._styles.get(s).isDefault?o.removeAttribute("imageStyle",l):o.setAttribute("imageStyle",s,l),a&&r.setImageNaturalSizeAttributes(l)})}shouldConvertImageType(e,n){return!this._styles.get(e).modelElements.includes(n.name)}}const n_={get inline(){return{name:"inline",title:"In line",icon:fY,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:dY,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:hY,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:AA,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:PA,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:mY,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:AA,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:PA,modelElements:["imageBlock"],className:"image-style-side"}}},e8e={full:nNe,left:hY,right:mY,center:AA,inlineLeft:dY,inlineRight:PA,inline:fY},t8e=[{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 n8e(t){return(t.configuredStyles.options||[]).map(i=>o8e(i)).filter(i=>s8e(i,t))}function i8e(t,e){return t&&e?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:t?{options:["block","side"]}:e?{options:["inline","alignLeft","alignRight"]}:{}}function r8e(t){return t.has("ImageBlockEditing")&&t.has("ImageInlineEditing")?[...t8e]:[]}function o8e(t){return typeof t=="string"?n_[t]?t={...n_[t]}:t={name:t}:t=a8e(n_[t.name],t),typeof t.icon=="string"&&(t.icon=e8e[t.icon]||t.icon),t}function s8e(t,{isBlockPluginLoaded:e,isInlinePluginLoaded:n}){const{modelElements:i,name:r}=t;if(!i||!i.length||!r)return OX({style:t}),!1;{const o=[e?"imageBlock":null,n?"imageInline":null];if(!i.some(s=>o.includes(s)))return hn("image-style-missing-dependency",{style:t,missingPlugins:i.map(s=>s==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}function a8e(t,e){const n={...e};for(const i in t)Object.prototype.hasOwnProperty.call(e,i)||(n[i]=t[i]);return n}function OX(t){hn("image-style-configuration-definition-invalid",t)}const S1={normalizeStyles:n8e,getDefaultStylesConfiguration:i8e,getDefaultDropdownDefinitions:r8e,warnInvalidStyle:OX};function l8e(t){return(e,n,i)=>{if(!i.consumable.consume(n.item,e.name))return;const r=zA(n.attributeNewValue,t),o=zA(n.attributeOldValue,t),s=i.mapper.toViewElement(n.item),a=i.writer;o&&a.removeClass(o.className,s),r&&a.addClass(r.className,s)}}function u8e(t){const e={imageInline:t.filter(n=>!n.isDefault&&n.modelElements.includes("imageInline")),imageBlock:t.filter(n=>!n.isDefault&&n.modelElements.includes("imageBlock"))};return(n,i,r)=>{if(!i.modelRange)return;const o=i.viewItem,s=Mi(i.modelRange.getItems());if(s&&r.schema.checkAttribute(s,"imageStyle")){for(const a of e[s.name])r.consumable.consume(o,{classes:a.className})&&r.writer.setAttribute("imageStyle",a.name,s);c8e(r,o,s,t)}}}function c8e(t,e,n,i){if(!t.consumable.test(e,{styles:["float"]}))return;let r=null;switch(e.getStyle("float")){case"left":r="alignLeft";break;case"right":r="alignRight";break}if(!r)return;const o=zA(r,i);if(!o)return;const s=n_[o.name];QFe(o,s)&&(t.writer.setAttribute("imageStyle",r,n),t.consumable.consume(e,{styles:["float"]}))}function zA(t,e){for(const n of e)if(n.name===t)return n}class LX extends xe{static get pluginName(){return"ImageStyleEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[kr]}normalizedStyles;init(){const e=this.editor,n=e.plugins.has("ImageBlockEditing"),i=e.plugins.has("ImageInlineEditing");e.config.define("image.styles",S1.getDefaultStylesConfiguration(n,i)),this.normalizedStyles=S1.normalizeStyles({configuredStyles:e.config.get("image.styles"),isBlockPluginLoaded:n,isInlinePluginLoaded:i}),this._setupConversion(n,i),this._setupPostFixer(),e.commands.add("imageStyle",new Q6e(e,this.normalizedStyles))}_setupConversion(e,n){const i=this.editor,r=i.model.schema,o=l8e(this.normalizedStyles),s=u8e(this.normalizedStyles);i.editing.downcastDispatcher.on("attribute:imageStyle",o),i.data.downcastDispatcher.on("attribute:imageStyle",o),e&&(r.extend("imageBlock",{allowAttributes:"imageStyle"}),r.setAttributeProperties("imageStyle",{isFormatting:!0}),i.data.upcastDispatcher.on("element:figure",s,{priority:"low"})),n&&(r.extend("imageInline",{allowAttributes:"imageStyle"}),r.setAttributeProperties("imageStyle",{isFormatting:!0}),i.data.upcastDispatcher.on("element:img",s,{priority:"low"}))}_setupPostFixer(){const e=this.editor,n=e.model.document,i=e.plugins.get(kr),r=new Map(this.normalizedStyles.map(o=>[o.name,o]));n.registerPostFixer(o=>{let s=!1;for(const a of n.differ.getChanges())if(a.type=="insert"||a.type=="attribute"&&a.attributeKey=="imageStyle"){let l=a.type=="insert"?a.position.nodeAfter:a.range.start.nodeAfter;if(l&&l.is("element","paragraph")&&l.childCount>0&&(l=l.getChild(0)),!i.isImage(l))continue;const u=l.getAttribute("imageStyle");if(!u)continue;const c=r.get(u);(!c||!c.modelElements.includes(l.name))&&(o.removeAttribute("imageStyle",l),s=!0)}return s})}}class d8e extends xe{static get requires(){return[LX]}static get pluginName(){return"ImageStyleUI"}static get isOfficialPlugin(){return!0}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,n=this.editor.config.get("image.toolbar")||[],i=e.get("ImageStyleEditing"),r=BF(i.normalizedStyles,this.localizedDefaultStylesTitles);for(const s of r)this._createButton(s);const o=BF([...n.filter(so),...S1.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(const s of o)this._createDropdown(s,r)}_createDropdown(e,n){const i=this.editor.ui.componentFactory;i.add(e.name,r=>{let o;const{defaultItem:s,items:a,title:l}=e,u=a.filter(h=>n.find(({name:m})=>VF(m)===h)).map(h=>{const m=i.create(h);return h===s&&(o=m),m});a.length!==u.length&&S1.warnInvalidStyle({dropdown:e});const c=Ro(r,_S),d=c.buttonView,f=d.arrowView;return CS(c,u,{enableActiveItemFocusOnDropdownOpen:!0}),d.set({label:FF(l,o.label),class:null,tooltip:!0}),f.unbind("label"),f.set({label:l}),d.bind("icon").toMany(u,"isOn",(...h)=>{const m=h.findIndex(Vg);return m<0?o.icon:u[m].icon}),d.bind("label").toMany(u,"isOn",(...h)=>{const m=h.findIndex(Vg);return FF(l,m<0?o.label:u[m].label)}),d.bind("isOn").toMany(u,"isOn",(...h)=>h.some(Vg)),d.bind("class").toMany(u,"isOn",(...h)=>h.some(Vg)?"ck-splitbutton_flatten":void 0),d.on("execute",()=>{u.some(({isOn:h})=>h)?c.isOpen=!c.isOpen:o.fire("execute")}),c.bind("isEnabled").toMany(u,"isEnabled",(...h)=>h.some(Vg)),this.listenTo(c,"execute",()=>{this.editor.editing.view.focus()}),c})}_createButton(e){const n=e.name;this.editor.ui.componentFactory.add(VF(n),i=>{const r=this.editor.commands.get("imageStyle"),o=new wt(i);return o.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(r,"isEnabled"),o.bind("isOn").to(r,"value",s=>s===n),o.on("execute",this._executeCommand.bind(this,n)),o})}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function BF(t,e){for(const n of t)e[n.title]&&(n.title=e[n.title]);return t}function VF(t){return`imageStyle:${t}`}function FF(t,e){return(t?t+": ":"")+e}class f8e extends xe{static get requires(){return[LX,d8e]}static get pluginName(){return"ImageStyle"}static get isOfficialPlugin(){return!0}}class h8e extends xe{static get requires(){return[y1,kr]}static get pluginName(){return"ImageToolbar"}static get isOfficialPlugin(){return!0}afterInit(){const e=this.editor,n=e.t,i=e.plugins.get(y1),r=e.plugins.get("ImageUtils");i.register("image",{ariaLabel:n("Image toolbar"),items:m8e(e.config.get("image.toolbar")||[]),getRelatedElement:o=>r.getClosestSelectedImageWidget(o)})}}function m8e(t){return t.map(e=>so(e)?e.name:e)}class g8e extends xe{static get requires(){return[EO,kr]}static get pluginName(){return"PictureEditing"}static get isOfficialPlugin(){return!0}afterInit(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.model.schema.extend("imageBlock",{allowAttributes:["sources"]}),e.plugins.has("ImageInlineEditing")&&e.model.schema.extend("imageInline",{allowAttributes:["sources"]}),this._setupConversion(),this._setupImageUploadEditingIntegration()}_setupConversion(){const e=this.editor,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("upcast").add(d6e(i)),n.for("downcast").add(f6e(i))}_setupImageUploadEditingIntegration(){const e=this.editor;if(!e.plugins.has("ImageUploadEditing"))return;const n=e.plugins.get("ImageUploadEditing");this.listenTo(n,"uploadComplete",(i,{imageElement:r,data:o})=>{const s=o.sources;s&&e.model.change(a=>{a.setAttributes({sources:s},r)})})}}class p8e extends xe{static get pluginName(){return"IndentEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.commands.add("indent",new rV(e)),e.commands.add("outdent",new rV(e))}}class v8e extends xe{static get pluginName(){return"IndentUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.locale,i=e.t,r=n.uiLanguageDirection=="ltr"?cV:dV,o=n.uiLanguageDirection=="ltr"?dV:cV;this._defineButton("indent",i("Increase indent"),r),this._defineButton("outdent",i("Decrease indent"),o)}_defineButton(e,n,i){const r=this.editor;r.ui.componentFactory.add(e,()=>{const o=this._createButton(wt,e,n,i);return o.set({tooltip:!0}),o}),r.ui.componentFactory.add("menuBar:"+e,()=>this._createButton(Wi,e,n,i))}_createButton(e,n,i,r){const o=this.editor,s=o.commands.get(n),a=new e(o.locale);return a.set({label:i,icon:r}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>{o.execute(n),o.editing.view.focus()}),a}}class b8e extends xe{static get pluginName(){return"Indent"}static get isOfficialPlugin(){return!0}static get requires(){return[p8e,v8e]}}class by extends Ht{_indentBehavior;constructor(e,n){super(e),this._indentBehavior=n}refresh(){const n=this.editor.model,i=Mi(n.document.selection.getSelectedBlocks());if(!i||!this._isIndentationChangeAllowed(i)){this.isEnabled=!1;return}this.isEnabled=this._indentBehavior.checkEnabled(i.getAttribute("blockIndent"))}execute(){const e=this.editor.model,n=this._getBlocksToChange();e.change(i=>{for(const r of n){const o=r.getAttribute("blockIndent"),s=this._indentBehavior.getNextIndent(o);s?i.setAttribute("blockIndent",s,r):i.removeAttribute("blockIndent",r)}})}_getBlocksToChange(){const n=this.editor.model.document.selection;return Array.from(n.getSelectedBlocks()).filter(r=>this._isIndentationChangeAllowed(r))}_isIndentationChangeAllowed(e){const n=this.editor;return n.model.schema.checkAttribute(e,"blockIndent")?!n.plugins.has("ListUtils")||!this._indentBehavior.isForward?!0:!n.plugins.get("ListUtils").isListItemBlock(e):!1}}class $F{isForward;offset;unit;constructor(e){this.isForward=e.direction==="forward",this.offset=e.offset,this.unit=e.unit}checkEnabled(e){const n=parseFloat(e||"0");return this.isForward||n>0}getNextIndent(e){const n=parseFloat(e||"0");if(!(!e||e.endsWith(this.unit)))return this.isForward?this.offset+this.unit:void 0;const r=this.isForward?this.offset:-this.offset,o=n+r;return o>0?o+this.unit:void 0}}class zF{isForward;classes;constructor(e){this.isForward=e.direction==="forward",this.classes=e.classes}checkEnabled(e){const n=this.classes.indexOf(e);return this.isForward?n=0}getNextIndent(e){const n=this.classes.indexOf(e),i=this.isForward?1:-1;return this.classes[n+i]}}const y8e=["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"];class w8e extends xe{constructor(e){super(e),e.config.define("indentBlock",{offset:40,unit:"px"})}static get pluginName(){return"IndentBlock"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.config.get("indentBlock");n.classes&&n.classes.length?(this._setupConversionUsingClasses(n.classes),e.commands.add("indentBlock",new by(e,new zF({direction:"forward",classes:n.classes}))),e.commands.add("outdentBlock",new by(e,new zF({direction:"backward",classes:n.classes})))):(e.data.addStyleProcessorRules(dDe),this._setupConversionUsingOffset(),e.commands.add("indentBlock",new by(e,new $F({direction:"forward",offset:n.offset,unit:n.unit}))),e.commands.add("outdentBlock",new by(e,new $F({direction:"backward",offset:n.offset,unit:n.unit}))))}afterInit(){const e=this.editor,n=e.model.schema,i=e.commands.get("indent"),r=e.commands.get("outdent"),o=e.config.get("heading.options");(o&&o.map(l=>l.model)||y8e).forEach(l=>{n.isRegistered(l)&&n.extend(l,{allowAttributes:"blockIndent"})}),n.setAttributeProperties("blockIndent",{isFormatting:!0}),i.registerChildCommand(e.commands.get("indentBlock")),r.registerChildCommand(e.commands.get("outdentBlock"))}_setupConversionUsingOffset(){const e=this.editor.conversion,i=this.editor.locale.contentLanguageDirection==="rtl"?"margin-right":"margin-left";e.for("upcast").attributeToAttribute({view:{styles:{[i]:/[\s\S]+/}},model:{key:"blockIndent",value:r=>{if(!r.is("element","li"))return r.getStyle(i)}}}),e.for("downcast").attributeToAttribute({model:"blockIndent",view:r=>({key:"style",value:{[i]:r}})})}_setupConversionUsingClasses(e){const n={model:{key:"blockIndent",values:[]},view:{}};for(const i of e)n.model.values.push(i),n.view[i]={key:"class",value:[i]};this.editor.conversion.attributeToAttribute(n)}}class _8e{_definitions=new Set;get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach(n=>this._definitions.add(n)):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",(n,i,r)=>{if(!r.consumable.test(i.item,"attribute:linkHref")||!(i.item.is("selection")||r.schema.isInline(i.item)))return;const o=r.writer,s=o.document.selection;for(const a of this._definitions){const l=o.createAttributeElement("a",a.attributes,{priority:5});a.classes&&o.addClass(a.classes,l);for(const u in a.styles)o.setStyle(u,a.styles[u],l);o.setCustomProperty("link",!0,l),a.callback(i.attributeNewValue)?i.item.is("selection")?o.wrap(s.getFirstRange(),l):o.wrap(r.mapper.toViewRange(i.range),l):o.unwrap(r.mapper.toViewRange(i.range),l)}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",(n,i,{writer:r,mapper:o})=>{const s=o.toViewElement(i.item),a=Array.from(s.getChildren()).find(l=>l.is("element","a"));if(a)for(const l of this._definitions){const u=gl(l.attributes);if(l.callback(i.attributeNewValue)){for(const[c,d]of u)c==="class"?r.addClass(d,a):r.setAttribute(c,d,a);l.classes&&r.addClass(l.classes,a);for(const c in l.styles)r.setStyle(c,l.styles[c],a)}else{for(const[c,d]of u)c==="class"?r.removeClass(d,a):r.removeAttribute(c,a);l.classes&&r.removeClass(l.classes,a);for(const c in l.styles)r.removeStyle(c,a)}}})}}}const C8e=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,S8e="^(?:(?:):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))",k8e=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,T8e=/^((\w+:(\/{2,})?)|(\W))/i,E8e=["https?","ftps?","mailto"],yy="Ctrl+K";function x8e(t){return t.is("attributeElement")&&!!t.getCustomProperty("link")}function HF(t,{writer:e}){const n=e.createAttributeElement("a",{href:t},{priority:5});return e.setCustomProperty("link",!0,n),n}function DX(t,e=E8e){const n=String(t),i=e.join("|"),r=new RegExp(`${S8e.replace("",i)}`,"i");return A8e(n,r)?n:"#"}function A8e(t,e){return!!t.replace(C8e,"").match(e)}function P8e(t,e){const n={"Open in a new tab":t("Open in a new tab"),Downloadable:t("Downloadable")};return e.forEach(i=>("label"in i&&n[i.label]&&(i.label=n[i.label]),i)),e}function I8e(t){const e=[];if(t)for(const[n,i]of Object.entries(t)){const r=Object.assign({},i,{id:`link${DIe(n)}`});e.push(r)}return e}function HA(t,e){return t?e.checkAttribute(t.name,"linkHref"):!1}function R8e(t){return k8e.test(t)}function xO(t,e){const n=R8e(t)?"mailto:":e,i=!!n&&!NX(t);return t&&i?n+t:t}function NX(t){return T8e.test(t)}function M8e(t){window.open(t,"_blank","noopener")}function UA(t){let e="";for(const n of t.getItems()){if(!n.is("$text")&&!n.is("$textProxy"))return;e+=n.data}return e}class O8e extends Ht{manualDecorators=new Er;automaticDecorators=new _8e;restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,n=e.document.selection,i=n.getSelectedElement()||Mi(n.getSelectedBlocks());HA(i,e.schema)?(this.value=i.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(i,"linkHref")):(this.value=n.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(n,"linkHref"));for(const r of this.manualDecorators)r.value=this._getDecoratorStateFromModel(r.id)}execute(e,n={},i){const r=this.editor.model,o=r.document.selection,s=[],a=[];for(const l in n)n[l]?s.push(l):a.push(l);r.change(l=>{const u=f=>{l.setAttribute("linkHref",e,f),s.forEach(h=>l.setAttribute(h,!0,f)),a.forEach(h=>l.removeAttribute(h,f))},c=(f,h)=>{const m=UA(f);if(!m)return f;let g=i;if(g||(g=h&&h==m?e:m),g!=m){const v=l.createDocumentFragment();for(const _ of f.getItems()){const C=_;l.append(l.createText(C.data,C.getAttributes()),v)}const p=l.createRangeIn(v),b=L8e(m,g);let y=0;for(const{offset:_,actual:C,expected:S}of b){const k=_+y,T=l.createRange(p.start.getShiftedBy(k),p.start.getShiftedBy(k+C.length)),x=D8e(T,p).getAttributes(),P=Array.from(x).filter(([I])=>r.schema.getAttributeProperties(I).isFormatting),A=l.createText(S,P);u(A),l.remove(T),l.insert(A,T.start),y+=S.length}return r.insertContent(v,f),l.createRange(f.start,f.start.getShiftedBy(g.length))}},d=f=>{const{plugins:h}=this.editor;if(l.setSelection(f.end),h.has("TwoStepCaretMovement"))h.get("TwoStepCaretMovement")._handleForwardMovement();else for(const m of["linkHref",...s,...a])l.removeSelectionAttribute(m)};if(o.isCollapsed){const f=o.getFirstPosition();if(o.hasAttribute("linkHref")){const h=o.getAttribute("linkHref"),m=SS(f,"linkHref",h,r),g=c(m,h);u(g||m),g&&d(g)}else if(e!==""){const h=gl(o.getAttributes());h.set("linkHref",e),s.forEach(g=>{h.set(g,!0)});const m=r.insertContent(l.createText(i||e,h),f);d(m)}}else{const f=Array.from(o.getRanges()),h=r.schema.getValidRanges(f,"linkHref"),m=[];for(const p of o.getSelectedBlocks())r.schema.checkAttribute(p,"linkHref")&&m.push(l.createRangeOn(p));const g=m.slice();for(const p of h)this._isRangeToUpdate(p,m)&&g.push(p);const v=f.map(p=>({start:Bi.fromPosition(p.start,"toPrevious"),end:Bi.fromPosition(p.end,"toNext")}));for(let p of g){const b=(p.start.textNode||p.start.nodeAfter).getAttribute("linkHref");p=c(p,b)||p,u(p)}l.setSelection(v.map(p=>{const b=p.start.toPosition(),y=p.end.toPosition();return p.start.detach(),p.end.detach(),r.createRange(b,y)}))}})}_getDecoratorStateFromModel(e){const n=this.editor.model,i=n.document.selection,r=i.getSelectedElement();return HA(r,n.schema)?r.getAttribute(e):i.getAttribute(e)}_isRangeToUpdate(e,n){for(const i of n)if(i.containsRange(e))return!1;return!0}}function L8e(t,e){const n=fm(t,e),i={equal:0,insert:0,delete:0},r=[];let o="",s="";for(const a of[...n,null])a=="insert"?s+=e[i.equal+i.insert]:a=="delete"?o+=t[i.equal+i.delete]:(o.length||s.length)&&(r.push({offset:i.equal,actual:o,expected:s}),o="",s=""),a&&i[a]++;return r}function D8e(t,e){if(!t.isCollapsed)return Mi(t.getItems());const n=t.start;return n.textNode?n.textNode:!n.nodeBefore||n.isEqual(e.start)?n.nodeAfter:n.nodeBefore}class N8e extends Ht{refresh(){const e=this.editor.model,n=e.document.selection,i=n.getSelectedElement();HA(i,e.schema)?this.isEnabled=e.schema.checkAttribute(i,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(n,"linkHref")}execute(){const e=this.editor,n=this.editor.model,i=n.document.selection,r=e.commands.get("link");n.change(o=>{const s=i.isCollapsed?[SS(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),n)]:n.schema.getValidRanges(i.getRanges(),"linkHref");for(const a of s)if(o.removeAttribute("linkHref",a),r)for(const l of r.manualDecorators)o.removeAttribute(l.id,a)})}}class B8e extends Ln(){id;defaultValue;label;attributes;classes;styles;constructor({id:e,label:n,attributes:i,classes:r,styles:o,defaultValue:s}){super(),this.id=e,this.set("value",void 0),this.defaultValue=s,this.label=n,this.attributes=i,this.classes=r,this.styles=o}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}const V8e="ck-link_selected",UF="automatic",F8e="manual",$8e=/^(https?:)?\/\//;class k1 extends xe{_linkOpeners=[];static get pluginName(){return"LinkEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[v1,XY,fs]}constructor(e){super(e),e.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1,toolbar:["linkPreview","|","editLink","linkProperties","unlink"]})}init(){const e=this.editor,n=this.editor.config.get("link.allowedProtocols");e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:HF}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(o,s)=>HF(DX(o,n),s)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:o=>o.getAttribute("href")}}),e.commands.add("link",new O8e(e)),e.commands.add("unlink",new N8e(e));const i=P8e(e.t,I8e(e.config.get("link.decorators")));this._enableAutomaticDecorators(i.filter(o=>o.mode===UF)),this._enableManualDecorators(i.filter(o=>o.mode===F8e)),e.plugins.get(v1).registerAttribute("linkHref"),QY(e,"linkHref","a",V8e),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration()}_registerLinkOpener(e){this._linkOpeners.push(e)}_enableAutomaticDecorators(e){const n=this.editor,r=n.commands.get("link").automaticDecorators;n.config.get("link.addTargetToExternalLinks")&&r.add({id:"linkIsExternal",mode:UF,callback:o=>!!o&&$8e.test(o),attributes:{target:"_blank",rel:"noopener noreferrer"}}),r.add(e),r.length&&n.conversion.for("downcast").add(r.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const n=this.editor,r=n.commands.get("link").manualDecorators;e.forEach(o=>{n.model.schema.extend("$text",{allowAttributes:o.id});const s=new B8e(o);r.add(s),n.conversion.for("downcast").attributeToElement({model:s.id,view:(a,{writer:l,schema:u},{item:c})=>{if((c.is("selection")||u.isInline(c))&&a){const d=l.createAttributeElement("a",s.attributes,{priority:5});s.classes&&l.addClass(s.classes,d);for(const f in s.styles)l.setStyle(f,s.styles[f],d);return l.setCustomProperty("link",!0,d),d}}}),n.conversion.for("upcast").elementToAttribute({view:{name:"a",...s._createPattern()},model:{key:s.id}})})}_enableLinkOpen(){const e=this.editor,i=e.editing.view.document,r=o=>{this._linkOpeners.some(s=>s(o))||M8e(o)};this.listenTo(i,"click",(o,s)=>{if(!(vt.isMac?s.domEvent.metaKey:s.domEvent.ctrlKey))return;let l=s.domTarget;if(l.tagName.toLowerCase()!="a"&&(l=l.closest("a")),!l)return;const u=l.getAttribute("href");u&&(o.stop(),s.preventDefault(),r(u))},{context:"$capture"}),this.listenTo(i,"keydown",(o,s)=>{const l=e.commands.get("link").value;l&&s.keyCode===Yt.enter&&s.altKey&&(o.stop(),r(l))})}_enableSelectionAttributesFixer(){const n=this.editor.model,i=n.document.selection;this.listenTo(i,"change:attribute",(r,{attributeKeys:o})=>{!o.includes("linkHref")||i.hasAttribute("linkHref")||n.change(s=>{z8e(s,H8e(n.schema))})})}_enableClipboardIntegration(){const e=this.editor,n=e.model,i=this.editor.config.get("link.defaultProtocol");i&&this.listenTo(e.plugins.get("ClipboardPipeline"),"contentInsertion",(r,o)=>{n.change(s=>{const a=s.createRangeIn(o.content);for(const l of a.getItems())if(l.hasAttribute("linkHref")){const u=xO(l.getAttribute("linkHref"),i);s.setAttribute("linkHref",u,l)}})})}}function z8e(t,e){t.removeSelectionAttribute("linkHref");for(const n of e)t.removeSelectionAttribute(n)}function H8e(t){return t.getDefinition("$text").allowAttributes.filter(n=>n.startsWith("link"))}class U8e extends wt{constructor(e){super(e);const n=this.bindTemplate;this.set({href:void 0,withText:!0}),this.extendTemplate({attributes:{class:["ck-link-toolbar__preview"],href:n.to("href"),target:"_blank",rel:"noopener noreferrer"},on:{click:n.to(i=>{if(this.href){const r=()=>i.preventDefault();this.fire("navigate",this.href,r)}})}}),this.template.tag="a"}}class W8e extends ut{focusTracker=new wi;keystrokes=new Qi;backButtonView;saveButtonView;displayedTextInputView;urlInputView;children;providersListChildren;_validators;_focusables=new qr;_focusCycler;constructor(e,n){super(e),this._validators=n,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.displayedTextInputView=this._createDisplayedTextInput(),this.urlInputView=this._createUrlInput(),this.providersListChildren=this.createCollection(),this.children=this.createCollection([this._createHeaderView()]),this._createFormChildren(),this.listenTo(this.providersListChildren,"add",()=>{this.stopListening(this.providersListChildren,"add"),this.children.add(this._createProvidersListView())}),this._focusCycler=new Ho({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-link-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),vg({view:this}),[this.urlInputView,this.saveButtonView,...this.providersListChildren,this.backButtonView,this.displayedTextInputView].forEach(n=>{this._focusables.add(n),this.focusTracker.add(n.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}isValid(){this.resetFormStatus();for(const e of this._validators){const n=e(this);if(n)return this.urlInputView.errorText=n,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null}_createBackButton(){const e=this.locale.t,n=new wt(this.locale);return n.set({class:"ck-button-back",label:e("Back"),icon:pg,tooltip:!0}),n.delegate("execute").to(this,"cancel"),n}_createSaveButton(){const e=this.locale.t,n=new wt(this.locale);return n.set({label:e("Insert"),tooltip:!1,withText:!0,type:"submit",class:"ck-button-action ck-button-bold"}),n}_createHeaderView(){const e=this.locale.t,n=new qf(this.locale,{label:e("Link")});return n.children.add(this.backButtonView,0),n}_createProvidersListView(){const e=new jf(this.locale);return e.extendTemplate({attributes:{class:["ck-link-form__providers-list"]}}),e.items.bindTo(this.providersListChildren).using(n=>{const i=new $s(this.locale);return i.children.add(n),i}),e}_createDisplayedTextInput(){const e=this.locale.t,n=new Go(this.locale,tu);return n.label=e("Displayed text"),n.class="ck-labeled-field-view_full-width",n}_createUrlInput(){const e=this.locale.t,n=new Go(this.locale,tu);return n.fieldView.inputMode="url",n.label=e("Link URL"),n.class="ck-labeled-field-view_full-width",n}_createFormChildren(){this.children.add(new Xs(this.locale,{children:[this.displayedTextInputView],class:["ck-form__row_large-top-padding"]})),this.children.add(new Xs(this.locale,{children:[this.urlInputView,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding","ck-form__row_large-bottom-padding"]}))}get url(){const{element:e}=this.urlInputView.fieldView;return e?e.value.trim():null}}class q8e extends ut{focusTracker=new wi;keystrokes=new Qi;backButtonView;listView;listChildren;emptyListInformation;children;_focusables=new qr;_focusCycler;constructor(e){super(e),this.listChildren=this.createCollection(),this.backButtonView=this._createBackButton(),this.listView=this._createListView(),this.emptyListInformation=this._createEmptyLinksListItemView(),this.children=this.createCollection([this._createHeaderView(),this.emptyListInformation]),this.set("title",""),this.set("emptyListPlaceholder",""),this.set("hasItems",!1),this.listenTo(this.listChildren,"change",()=>{this.hasItems=this.listChildren.length>0}),this.on("change:hasItems",(n,i,r)=>{r?(this.children.remove(this.emptyListInformation),this.children.add(this.listView)):(this.children.remove(this.listView),this.children.add(this.emptyListInformation))}),this.keystrokes.set("Esc",(n,i)=>{this.fire("cancel"),i()}),this._focusCycler=new Ho({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-providers"],tabindex:"-1"},children:this.children})}render(){super.render(),[this.listView,this.backButtonView].forEach(n=>{this._focusables.add(n),this.focusTracker.add(n.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createListView(){const e=new jf(this.locale);return e.extendTemplate({attributes:{class:["ck-link-providers__list"]}}),e.items.bindTo(this.listChildren).using(n=>{const i=new $s(this.locale);return i.children.add(n),i}),e}_createBackButton(){const e=this.locale.t,n=new wt(this.locale);return n.set({class:"ck-button-back",label:e("Back"),icon:pg,tooltip:!0}),n.delegate("execute").to(this,"cancel"),n}_createHeaderView(){const e=new qf(this.locale);return e.bind("label").to(this,"title"),e.children.add(this.backButtonView,0),e}_createEmptyLinksListItemView(){const e=new ut(this.locale);return e.setTemplate({tag:"p",attributes:{class:["ck","ck-link__empty-list-info"]},children:[{text:this.bindTemplate.to("emptyListPlaceholder")}]}),e}}class j8e extends ut{focusTracker=new wi;keystrokes=new Qi;backButtonView;children;listChildren;_focusables=new qr;_focusCycler;constructor(e){super(e),this.backButtonView=this._createBackButton(),this.listChildren=this.createCollection(),this.children=this.createCollection([this._createHeaderView(),this._createListView()]),this._focusCycler=new Ho({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-properties"],tabindex:"-1"},children:this.children}),this.keystrokes.set("Esc",(n,i)=>{this.fire("back"),i()})}render(){super.render(),[...this.listChildren,this.backButtonView].forEach(n=>{this._focusables.add(n),this.focusTracker.add(n.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createBackButton(){const e=this.locale.t,n=new wt(this.locale);return n.set({class:"ck-button-back",label:e("Back"),icon:pg,tooltip:!0}),n.delegate("execute").to(this,"back"),n}_createHeaderView(){const e=this.locale.t,n=new qf(this.locale,{label:e("Link properties")});return n.children.add(this.backButtonView,0),n}_createListView(){const e=new jf(this.locale);return e.extendTemplate({attributes:{class:["ck-link__list"]}}),e.items.bindTo(this.listChildren).using(n=>{const i=new $s(this.locale);return i.children.add(n),i}),e}}class K8e extends wt{arrowView;constructor(e){super(e),this.set({withText:!0}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-link__button"]}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new Sa;return e.content=cY,e}}const Ma="link-ui";class G8e extends xe{toolbarView=null;formView=null;linkProviderItemsView=null;propertiesView=null;_balloon;_linksProviders=new Er;static get requires(){return[bu,k1]}static get pluginName(){return"LinkUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=this.editor.t;this.set("selectedLinkableText",void 0),e.editing.view.addObserver(N5e),this._balloon=e.plugins.get(bu),this._registerComponents(),this._registerEditingOpeners(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:Ma,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:Ma,view:(i,{writer:r})=>{if(!i.markerRange.isCollapsed)return null;const o=r.createUIElement("span");return r.addClass(["ck-fake-link-selection","ck-fake-link-selection_collapsed"],o),o}}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:n("Create link"),keystroke:yy},{label:n("Move out of a link"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}destroy(){super.destroy(),this.propertiesView&&this.propertiesView.destroy(),this.formView&&this.formView.destroy(),this.toolbarView&&this.toolbarView.destroy(),this.linkProviderItemsView&&this.linkProviderItemsView.destroy()}registerLinksListProvider(e){const n=this._linksProviders.filter(i=>(i.order||0)<=(e.order||0)).length;this._linksProviders.add(e,n)}_createViews(){const e=this.editor.commands.get("link");this.toolbarView=this._createToolbarView(),this.formView=this._createFormView(),e.manualDecorators.length&&(this.propertiesView=this._createPropertiesView()),this._enableUserBalloonInteractions()}_createToolbarView(){const e=this.editor,n=new Xm(e.locale),i=e.commands.get("link");n.class="ck-link-toolbar";let r=e.config.get("link.toolbar");return i.manualDecorators.length||(r=r.filter(o=>o!=="linkProperties")),n.fillFromConfig(r,e.ui.componentFactory),n.keystrokes.set("Esc",(o,s)=>{this._hideUI(),s()}),n.keystrokes.set(yy,(o,s)=>{this._addFormView(),s()}),e.ui.addToolbar(n,{isContextual:!0,beforeFocus:()=>{this._getSelectedLinkElement()&&!this._isToolbarVisible&&this._showUI(!0)},afterBlur:()=>{this._hideUI(!1)}}),n}_createFormView(){const e=this.editor,n=e.locale.t,i=e.commands.get("link"),r=e.config.get("link.defaultProtocol"),o=new(cb(W8e))(e.locale,Y8e(e));return o.displayedTextInputView.bind("isEnabled").to(this,"selectedLinkableText",s=>s!==void 0),o.urlInputView.bind("isEnabled").to(i,"isEnabled"),o.saveButtonView.bind("isEnabled").to(i,"isEnabled"),o.saveButtonView.bind("label").to(i,"value",s=>n(s?"Update":"Insert")),this.listenTo(o,"submit",()=>{if(o.isValid()){const s=o.urlInputView.fieldView.element.value,a=xO(s,r),l=o.displayedTextInputView.fieldView.element.value;e.execute("link",a,this._getDecoratorSwitchesState(),l!==this.selectedLinkableText?l:void 0),this._closeFormView()}}),this.listenTo(o.urlInputView,"change:errorText",()=>{e.ui.update()}),this.listenTo(o,"cancel",()=>{this._closeFormView()}),o.keystrokes.set("Esc",(s,a)=>{this._closeFormView(),a()}),o.providersListChildren.bindTo(this._linksProviders).using(s=>this._createLinksListProviderButton(s)),o}_createLinkProviderListView(e){return e.getListItems().map(({href:n,label:i,icon:r})=>{const o=new wt;return o.set({label:i,icon:r,tooltip:!1,withText:!0}),o.on("execute",()=>{this.formView.resetFormStatus(),this.formView.urlInputView.fieldView.value=n,this.editor.editing.view.focus(),this._removeLinksProviderView(),this.formView.focus()}),o})}_createLinkProviderItemsView(e){const n=this.editor,i=n.locale.t,r=new q8e(n.locale),{emptyListPlaceholder:o,label:s}=e;return r.emptyListPlaceholder=o||i("No links available"),r.title=s,this.listenTo(r,"cancel",()=>{n.editing.view.focus(),this._removeLinksProviderView(),this.formView.focus()}),r}_createPropertiesView(){const e=this.editor,n=this.editor.commands.get("link"),i=new(cb(j8e))(e.locale);return this.listenTo(i,"back",()=>{e.editing.view.focus(),this._removePropertiesView()}),i.listChildren.bindTo(n.manualDecorators).using(r=>{const o=new wS(e.locale);return o.set({label:r.label,withText:!0}),o.bind("isOn").toMany([r,n],"value",(s,a)=>a===void 0&&s===void 0?!!r.defaultValue:!!s),o.on("execute",()=>{r.set("value",!o.isOn),e.execute("link",n.value,this._getDecoratorSwitchesState())}),o}),i}_getDecoratorSwitchesState(){const e=this.editor.commands.get("link");return Array.from(e.manualDecorators).reduce((n,i)=>{const r=e.value===void 0&&i.value===void 0?i.defaultValue:i.value;return{...n,[i.id]:!!r}},{})}_registerEditingOpeners(){this.editor.plugins.get(k1)._registerLinkOpener(n=>{const i=this._getLinkProviderLinkByHref(n);if(!i)return!1;const{item:r,provider:o}=i;return o.navigate?o.navigate(r):!1})}_registerComponents(){const e=this.editor;e.ui.componentFactory.add("link",()=>{const n=this._createButton(wt);return n.set({tooltip:!0}),n}),e.ui.componentFactory.add("menuBar:link",()=>{const n=this._createButton(Wi);return n.set({role:"menuitemcheckbox"}),n}),e.ui.componentFactory.add("linkPreview",n=>{const i=new U8e(n),r=e.config.get("link.allowedProtocols"),o=e.commands.get("link"),s=n.t;i.bind("isEnabled").to(o,"value",l=>!!l),i.bind("href").to(o,"value",l=>l&&DX(l,r));const a=l=>{if(!l){i.label=void 0,i.icon=void 0,i.tooltip=s("Open link in new tab");return}const u=this._getLinkProviderLinkByHref(l);if(u){const{label:c,tooltip:d,icon:f}=u.item;i.label=c,i.tooltip=d||!1,i.icon=f}else i.label=l,i.icon=void 0,i.tooltip=s("Open link in new tab")};return a(o.value),this.listenTo(o,"change:value",(l,u,c)=>{a(c)}),this.listenTo(i,"navigate",(l,u,c)=>{const d=this._getLinkProviderLinkByHref(u);if(!d)return;const{provider:f,item:h}=d,{navigate:m}=f;m&&m(h)&&(l.stop(),c())}),i}),e.ui.componentFactory.add("unlink",n=>{const i=e.commands.get("unlink"),r=new wt(n),o=n.t;return r.set({label:o("Unlink"),icon:ANe,tooltip:!0}),r.bind("isEnabled").to(i),this.listenTo(r,"execute",()=>{e.execute("unlink"),this._hideUI()}),r}),e.ui.componentFactory.add("editLink",n=>{const i=e.commands.get("link"),r=new wt(n),o=n.t;return r.set({label:o("Edit link"),icon:uNe,tooltip:!0}),r.bind("isEnabled").to(i),this.listenTo(r,"execute",()=>{this._addFormView()}),r}),e.ui.componentFactory.add("linkProperties",n=>{const i=e.commands.get("link"),r=new wt(n),o=n.t;return r.set({label:o("Link properties"),icon:pNe,tooltip:!0}),r.bind("isEnabled").to(i,"isEnabled",i,"value",i,"manualDecorators",(s,a,l)=>s&&!!a&&l.length>0),this.listenTo(r,"execute",()=>{this._addPropertiesView()}),r})}_createLinksListProviderButton(e){const n=this.editor.locale,i=new K8e(n);return i.set({label:e.label}),this.listenTo(i,"execute",()=>{this._showLinksProviderView(e)}),i}_createButton(e){const n=this.editor,i=n.locale,r=n.commands.get("link"),o=new e(n.locale),s=i.t;return o.set({label:s("Link"),icon:ZDe,keystroke:yy,isToggleable:!0}),o.bind("isEnabled").to(r,"isEnabled"),o.bind("isOn").to(r,"value",a=>!!a),this.listenTo(o,"execute",()=>{n.editing.view.scrollToTheSelection(),this._showUI(!0),this._getSelectedLinkElement()&&this._addFormView()}),o}_enableBalloonActivators(){const e=this.editor,n=e.editing.view.document;this.listenTo(n,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),e.keystrokes.set(yy,(i,r)=>{r(),e.commands.get("link").isEnabled&&(e.editing.view.scrollToTheSelection(),this._showUI(!0))})}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",(e,n)=>{this._isToolbarVisible&&!this.toolbarView.focusTracker.isFocused&&(this.toolbarView.focus(),n())},{priority:"high"}),this.editor.keystrokes.set("Esc",(e,n)=>{this._isUIVisible&&(this._hideUI(),n())}),Wf({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>{this._hideUI(!1)}})}_addToolbarView(){this.toolbarView||this._createViews(),!this._isToolbarInPanel&&this._balloon.add({view:this.toolbarView,position:this._getBalloonPositionData(),balloonClassName:"ck-toolbar-container"})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this.formView.resetFormStatus(),this.formView.backButtonView.isVisible=e.isEnabled&&!!e.value,this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.selectedLinkableText=this._getSelectedLinkableText(),this.formView.displayedTextInputView.fieldView.value=this.selectedLinkableText||"",this.formView.urlInputView.fieldView.value=e.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_addPropertiesView(){this.propertiesView||this._createViews(),!this._arePropertiesInPanel&&(this.propertiesView.disableCssTransitions(),this._balloon.add({view:this.propertiesView,position:this._getBalloonPositionData()}),this.propertiesView.enableCssTransitions(),this.propertiesView.focus())}_showLinksProviderView(e){this.linkProviderItemsView&&this._removeLinksProviderView(),this.linkProviderItemsView=this._createLinkProviderItemsView(e),this._addLinkProviderItemsView(e)}_addLinkProviderItemsView(e){this.linkProviderItemsView.listChildren.clear(),this.linkProviderItemsView.listChildren.addMany(this._createLinkProviderListView(e)),this._balloon.add({view:this.linkProviderItemsView,position:this._getBalloonPositionData()}),this.linkProviderItemsView.focus()}_closeFormView(){const e=this.editor.commands.get("link");this.selectedLinkableText=void 0,e.value!==void 0?this._removeFormView():this._hideUI()}_removePropertiesView(){this._arePropertiesInPanel&&this._balloon.remove(this.propertiesView)}_removeLinksProviderView(){this._isLinksListInPanel&&this._balloon.remove(this.linkProviderItemsView)}_removeFormView(e=!0){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this.formView.displayedTextInputView.fieldView.reset(),this.formView.urlInputView.fieldView.reset(),this._balloon.remove(this.formView),e&&this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._isToolbarVisible?this._addFormView():this._addToolbarView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addToolbarView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(e=!0){const n=this.editor;this._isUIInPanel&&(this.stopListening(n.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e&&n.editing.view.focus(),this._removeLinksProviderView(),this._removePropertiesView(),this._removeFormView(e),this._isToolbarInPanel&&this._balloon.remove(this.toolbarView),this._hideFakeVisualSelection())}_startUpdatingUI(){const e=this.editor,n=e.editing.view.document;let i=this._getSelectedLinkElement(),r=s();const o=()=>{const a=this._getSelectedLinkElement(),l=s();i&&!a||!i&&l!==r?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=a,r=l};function s(){return n.selection.focus.getAncestors().reverse().find(a=>a.is("element"))}this.listenTo(e.ui,"update",o),this.listenTo(this._balloon,"change:visibleView",o)}get _arePropertiesInPanel(){return!!this.propertiesView&&this._balloon.hasView(this.propertiesView)}get _isLinksListInPanel(){return!!this.linkProviderItemsView&&this._balloon.hasView(this.linkProviderItemsView)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _isToolbarInPanel(){return!!this.toolbarView&&this._balloon.hasView(this.toolbarView)}get _isPropertiesVisible(){return!!this.propertiesView&&this._balloon.visibleView===this.propertiesView}get _isFormVisible(){return!!this.formView&&this._balloon.visibleView==this.formView}get _isToolbarVisible(){return!!this.toolbarView&&this._balloon.visibleView===this.toolbarView}get _isUIInPanel(){return this._arePropertiesInPanel||this._isLinksListInPanel||this._isFormInPanel||this._isToolbarInPanel}get _isUIVisible(){return this._isPropertiesVisible||this._isLinksListInPanel||this._isFormVisible||this._isToolbarVisible}_getBalloonPositionData(){const e=this.editor.editing.view,n=e.document;if(this.editor.model.markers.has(Ma)){const r=this.editor.editing.mapper.markerNameToElements(Ma);if(r){const o=Array.from(r),s=e.createRange(e.createPositionBefore(o[0]),e.createPositionAfter(o[o.length-1]));return{target:e.domConverter.viewRangeToDom(s)}}}return{target:()=>{const r=this._getSelectedLinkElement();return r?e.domConverter.mapViewToDom(r):e.domConverter.viewRangeToDom(n.selection.getFirstRange())}}}_getSelectedLinkElement(){const e=this.editor.editing.view,n=e.document.selection,i=n.getSelectedElement();if(n.isCollapsed||i&&ci(i))return pE(n.getFirstPosition());{const r=n.getFirstRange().getTrimmed(),o=pE(r.start),s=pE(r.end);return!o||o!=s?null:e.createRangeIn(o).getTrimmed().isEqual(r)?o:null}}_getSelectedLinkableText(){const e=this.editor.model,n=this.editor.editing,i=this._getSelectedLinkElement();if(!i)return UA(e.document.selection.getFirstRange());const r=n.view.createRangeOn(i),o=n.mapper.toModelRange(r);return UA(o)}_getLinkProviderLinkByHref(e){if(!e)return null;for(const n of this._linksProviders){const i=n.getItem?n.getItem(e):n.getListItems().find(r=>r.href===e);if(i)return{provider:n,item:i}}return null}_showFakeVisualSelection(){const e=this.editor.model;e.change(n=>{const i=e.document.selection.getFirstRange();if(e.markers.has(Ma))n.updateMarker(Ma,{range:i});else if(i.start.isAtEnd){const r=i.start.getLastMatchingPosition(({item:o})=>!e.schema.isContent(o),{boundaries:i});n.addMarker(Ma,{usingOperation:!1,affectsData:!1,range:n.createRange(r,i.end)})}else n.addMarker(Ma,{usingOperation:!1,affectsData:!1,range:i})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(Ma)&&e.change(n=>{n.removeMarker(Ma)})}}function pE(t){return t.getAncestors().find(e=>x8e(e))||null}function Y8e(t){const e=t.t,n=t.config.get("link.allowCreatingEmptyLinks");return[i=>{if(!n&&!i.url.length)return e("Link URL must not be empty.")}]}const X8e=4,BX=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}))|localhost)(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i"),J8e=2;class Z8e extends xe{static get requires(){return[yu,k1]}static get pluginName(){return"AutoLink"}static get isOfficialPlugin(){return!0}init(){const n=this.editor.model.document.selection;n.on("change:range",()=>{this.isEnabled=!n.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(e,n){return n.textNode&&n.textNode.hasAttribute("linkHref")?SS(n,"linkHref",n.textNode.getAttribute("linkHref"),e):null}_selectEntireLinks(e,n){const r=this.editor.model,o=r.document.selection,s=o.getFirstPosition(),a=o.getLastPosition();let l=n.getJoined(this._expandLinkRange(r,s)||n);l&&(l=l.getJoined(this._expandLinkRange(r,a)||n)),l&&(l.start.isBefore(s)||l.end.isAfter(a))&&e.setSelection(l)}_enablePasteLinking(){const e=this.editor,n=e.model,i=n.document.selection,r=e.plugins.get("ClipboardPipeline"),o=e.commands.get("link");r.on("inputTransformation",(s,a)=>{if(!this.isEnabled||!o.isEnabled||i.isCollapsed||a.method!=="paste"||i.rangeCount>1)return;const l=i.getFirstRange(),u=a.dataTransfer.getData("text/plain");if(!u)return;const c=u.match(BX);c&&c[2]===u&&(n.change(d=>{this._selectEntireLinks(d,l),o.execute(u)}),s.stop())},{priority:"high"})}_enableTypingHandling(){const e=this.editor,n=new pO(e.model,i=>{let r=i;if(!Q8e(r))return;r=r.slice(0,-1),"!.:,;?".includes(r[r.length-1])&&(r=r.slice(0,-1));const o=WF(r);if(o)return{url:o,removedTrailingCharacters:i.length-r.length}});n.on("matched:data",(i,r)=>{const{batch:o,range:s,url:a,removedTrailingCharacters:l}=r;if(!o.isTyping)return;const u=s.end.getShiftedBy(-l),c=u.getShiftedBy(-a.length),d=e.model.createRange(c,u);this._applyAutoLink(a,d)}),n.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,n=e.model,i=e.commands.get("enter");i&&i.on("execute",()=>{const r=n.document.selection.getFirstPosition();let o;r.parent.previousSibling?.is("element")?o=n.createRangeIn(r.parent.previousSibling):o=n.createRange(n.createPositionAt(r.parent,0),r),this._checkAndApplyAutoLinkOnRange(o)})}_enableShiftEnterHandling(){const e=this.editor,n=e.model,i=e.commands.get("shiftEnter");i&&i.on("execute",()=>{const r=n.document.selection.getFirstPosition(),o=n.createRange(n.createPositionAt(r.parent,0),r.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(o)})}_checkAndApplyAutoLinkOnRange(e){const n=this.editor.model,{text:i,range:r}=ZY(e,n),o=WF(i);if(o){const s=n.createRange(r.end.getShiftedBy(-o.length),r.end);this._applyAutoLink(o,s)}}_applyAutoLink(e,n){const i=this.editor.model,r=this.editor.config.get("link.defaultProtocol"),o=xO(e,r);!this.isEnabled||!e$e(n,i)||!NX(o)||t$e(n)||this._persistAutoLink(o,n)}_persistAutoLink(e,n){const i=this.editor.model,r=this.editor.plugins.get("Delete");i.enqueueChange(o=>{o.setAttribute("linkHref",e,n),i.enqueueChange(()=>{r.requestUndoOnBackspace()})})}}function Q8e(t){return t.length>X8e&&t[t.length-1]===" "&&t[t.length-2]!==" "}function WF(t){const e=BX.exec(t);return e?e[J8e]:null}function e$e(t,e){return e.schema.checkAttributeInSelection(e.createSelection(t),"linkHref")}function t$e(t){const e=t.start.nodeAfter;return!!e&&e.hasAttribute("linkHref")}class n$e extends xe{static get requires(){return[k1,G8e,Z8e]}static get pluginName(){return"Link"}static get isOfficialPlugin(){return!0}}class zs{_startElement;_referenceIndent;_isForward;_includeSelf;_sameAttributes;_sameIndent;_lowerIndent;_higherIndent;constructor(e,n){this._startElement=e,this._referenceIndent=e.getAttribute("listIndent"),this._isForward=n.direction=="forward",this._includeSelf=!!n.includeSelf,this._sameAttributes=li(n.sameAttributes||[]),this._sameIndent=!!n.sameIndent,this._lowerIndent=!!n.lowerIndent,this._higherIndent=!!n.higherIndent}static first(e,n){const r=new this(e,n)[Symbol.iterator]();return Mi(r)}*[Symbol.iterator](){const e=[];for(const{node:n}of new m0(this._getStartNode(),this._isForward?"forward":"backward")){const i=n.getAttribute("listIndent");if(ithis._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){e.push(n);continue}}else{if(!this._sameIndent){if(this._higherIndent){e.length&&(yield*e,e.length=0);break}continue}if(this._sameAttributes.some(r=>n.getAttribute(r)!==this._startElement.getAttribute(r)))break}e.length&&(yield*e,e.length=0),yield n}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}class m0{_node;_isForward;_previousNodesByIndent=[];_previous=null;_previousNodeIndent=null;constructor(e,n="forward"){this._node=e,this._isForward=n==="forward"}[Symbol.iterator](){return this}next(){if(!ti(this._node))return{done:!0,value:void 0};const e=this._node.getAttribute("listIndent");let n=null;if(this._previous){const r=this._previousNodeIndent;e>r?this._previousNodesByIndent[r]=this._previous:es.getAttribute("listIndent"))),o=new Map;for(const s of n)o.set(s,zs.first(s,{lowerIndent:!0}));for(const s of n){if(i.has(s))continue;i.add(s);const a=s.getAttribute("listIndent")-1;if(a<0){ES(s,e);continue}if(s.getAttribute("listIndent")==r){const l=u$e(s,o.get(s),e);for(const u of l)i.add(u);if(l.length)continue}e.setAttribute("listIndent",a,s)}return Yf(i)}function ES(t,e){t=li(t);for(const n of t)n.is("element","listItem")&&e.rename(n,"paragraph");for(const n of t)for(const i of n.getAttributeKeys())i.startsWith("list")&&e.removeAttribute(i,n);return t}function mb(t){if(!t.length)return!1;const e=t[0].getAttribute("listItemId");return e?!t.some(n=>n.getAttribute("listItemId")!=e):!1}function a$e(t,e){const n=[];let i=Number.POSITIVE_INFINITY;for(const{node:r}of new m0(t.nextSibling)){const o=r.getAttribute("listIndent");if(o==0)break;oe.root.rootName!=="$graveyard").sort((e,n)=>e.index-n.index)}function gb(t){const e=t.document.selection.getSelectedElement();return e&&t.schema.isObject(e)&&t.schema.isBlock(e)?e:null}function vE(t,e){return e.checkChild(t.parent,"listItem")&&e.checkChild(t,"$text")&&!e.isObject(t)}function l$e(t){return t=="numbered"||t=="customNumbered"}function u$e(t,e,n){return Oc(e,{direction:"forward"}).pop().index>t.index?WA(t,e,n):[]}class jF extends Ht{_direction;constructor(e,n){super(e),this._direction=n}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,n=KF(e.document.selection);e.change(i=>{const r=[];mb(n)&&!Lc(n[0])?(this._direction=="forward"&&r.push(...qA(n,i)),r.push(...AO(n[0],i))):this._direction=="forward"?r.push(...qA(n,i,{expand:!0})):r.push(...s$e(n,i));for(const o of r){if(!o.hasAttribute("listType"))continue;const s=zs.first(o,{sameIndent:!0});s&&i.setAttribute("listType",s.getAttribute("listType"),o)}this._fireAfterExecute(r)})}_fireAfterExecute(e){this.fire("afterExecute",Yf(new Set(e)))}_checkEnabled(){let e=KF(this.editor.model.document.selection),n=e[0];if(!n)return!1;if(this._direction=="backward"||mb(e)&&!Lc(e[0]))return!0;e=g0(e),n=e[0];const i=zs.first(n,{sameIndent:!0});return i?i.getAttribute("listType")==n.getAttribute("listType"):!1}}function KF(t){const e=Array.from(t.getSelectedBlocks()),n=e.findIndex(i=>!ti(i));return n!=-1&&(e.length=n),e}class wy extends Ht{type;_listWalkerOptions;constructor(e,n,i={}){super(e),this.type=n,this._listWalkerOptions=i.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const n=this.editor.model,i=n.document,r=gb(n),o=Array.from(i.selection.getSelectedBlocks()).filter(a=>n.schema.checkAttribute(a,"listType")||vE(a,n.schema)),s=e.forceValue!==void 0?!e.forceValue:this.value;n.change(a=>{if(s){const l=o[o.length-1],u=Oc(l,{direction:"forward"}),c=[];u.length>1&&c.push(...AO(u[1],a)),c.push(...ES(o,a)),c.push(...a$e(l,a)),this._fireAfterExecute(c)}else if((r||i.selection.isCollapsed)&&ti(o[0])){const l=VX(r||o[0],this._listWalkerOptions);for(const u of l)a.setAttributes({...e.additionalAttributes,listType:this.type},u);this._fireAfterExecute(l)}else{const l=[];for(const u of o)if(!u.hasAttribute("listType"))!u.is("element","listItem")&&vE(u,n.schema)&&a.rename(u,"listItem"),a.setAttributes({...e.additionalAttributes,listIndent:0,listItemId:Qm.next(),listType:this.type},u),l.push(u);else for(const c of g0(u,{withNested:!1}))c.getAttribute("listType")!=this.type&&(a.setAttributes({...e.additionalAttributes,listType:this.type},c),l.push(c));this._fireAfterExecute(l)}})}_fireAfterExecute(e){this.fire("afterExecute",Yf(new Set(e)))}_getValue(){const e=this.editor.model.document.selection,n=Array.from(e.getSelectedBlocks());if(!n.length)return!1;for(const i of n)if(i.getAttribute("listType")!=this.type)return!1;return!0}_checkEnabled(){const e=this.editor.model,n=e.schema,i=e.document.selection,r=Array.from(i.getSelectedBlocks());if(!r.length)return!1;if(this.value)return!0;for(const o of r)if(n.checkAttribute(o,"listType")||vE(o,n))return!0;return!1}}class GF extends Ht{_direction;constructor(e,n){super(e),this._direction=n}refresh(){this.isEnabled=this._checkEnabled()}execute({shouldMergeOnBlocksContentLevel:e=!1}={}){const n=this.editor.model,i=n.document.selection,r=[];n.change(o=>{const{firstElement:s,lastElement:a}=this._getMergeSubjectElements(i,e),l=s.getAttribute("listIndent")||0,u=a.getAttribute("listIndent"),c=a.getAttribute("listItemId");if(l!=u){const d=r$e(a);r.push(...qA([a,...d],o,{indentBy:l-u,expand:l{const i=AO(this._getStartBlock(),n);this._fireAfterExecute(i)})}_fireAfterExecute(e){this.fire("afterExecute",Yf(new Set(e)))}_checkEnabled(){const e=this.editor.model.document.selection,n=this._getStartBlock();return e.isCollapsed&&ti(n)&&!Lc(n)}_getStartBlock(){const n=this.editor.model.document.selection.getFirstPosition().parent;return this._direction=="before"?n:n.nextSibling}}class c$e extends xe{static get pluginName(){return"ListItemBoldIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[pa]}init(){const e=this.editor,n=e.plugins.get("ListFormatting"),i=e.plugins.get(pa);!e.plugins.has("BoldEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(n.registerFormatAttribute("bold","listItemBold"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemBold",setAttributeOnDowncast(r,o,s,a){o&&(r.addClass("ck-list-marker-bold",s),vt.isSafari&&!(a&&a.dataPipeline)&&r.setStyle("--ck-content-list-marker-dummy-bold","0",s))}}))}afterInit(){const e=this.editor,n=e.model;!e.plugins.has("BoldEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(n.schema.extend("$listItem",{allowAttributes:"listItemBold"}),n.schema.setAttributeProperties("listItemBold",{isFormatting:!0}),n.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemBold"),e.conversion.for("upcast").attributeToAttribute({model:"listItemBold",view:{name:"li",classes:"ck-list-marker-bold"}}))}}class d$e extends xe{static get pluginName(){return"ListItemItalicIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[pa]}init(){const e=this.editor,n=e.plugins.get("ListFormatting"),i=e.plugins.get(pa);!e.plugins.has("ItalicEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(n.registerFormatAttribute("italic","listItemItalic"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemItalic",setAttributeOnDowncast(r,o,s,a){o&&(r.addClass("ck-list-marker-italic",s),vt.isSafari&&!(a&&a.dataPipeline)&&r.setStyle("--ck-content-list-marker-dummy-italic","0",s))}}))}afterInit(){const e=this.editor,n=e.model;!e.plugins.has("ItalicEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(n.schema.extend("$listItem",{allowAttributes:"listItemItalic"}),n.schema.setAttributeProperties("listItemItalic",{isFormatting:!0}),n.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemItalic"),e.conversion.for("upcast").attributeToAttribute({model:"listItemItalic",view:{name:"li",classes:"ck-list-marker-italic"}}))}}class f$e extends xe{static get pluginName(){return"ListItemFontSizeIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[pa]}init(){const e=this.editor,n=e.plugins.get("ListFormatting"),i=e.plugins.get(pa);if(!e.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;const r=hb(e.config.get("fontSize.options"));n.registerFormatAttribute("fontSize","listItemFontSize"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontSize",setAttributeOnDowncast(o,s,a,l){if(s){const u=r.find(c=>c.model==s);u&&u.view&&typeof u.view!="string"?u.view.styles?(o.addClass("ck-list-marker-font-size",a),o.setStyle("--ck-content-list-marker-font-size",u.view.styles["font-size"],a)):u.view.classes&&(o.addClass(`ck-list-marker-font-size-${s}`,a),vt.isSafari&&!(l&&l.dataPipeline)&&o.setStyle("--ck-content-list-marker-dummy-font-size","0",a)):(o.addClass("ck-list-marker-font-size",a),o.setStyle("--ck-content-list-marker-font-size",s,a))}}})}afterInit(){const e=this.editor,n=e.model;if(!e.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;n.schema.extend("$listItem",{allowAttributes:"listItemFontSize"}),n.schema.setAttributeProperties("listItemFontSize",{isFormatting:!0}),n.schema.addAttributeCheck(r=>{if(!r.last.getAttribute("listItemId"))return!1},"listItemFontSize"),e.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:r=>r.getStyle("--ck-content-list-marker-font-size")},view:{name:"li",classes:"ck-list-marker-font-size",styles:{"--ck-content-list-marker-font-size":/.*/}}});const i=hb(e.config.get("fontSize.options"));for(const r of i)r.model&&r.view&&e.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:r.model},view:{name:"li",classes:`ck-list-marker-font-size-${r.model}`}})}}class h$e extends xe{static get pluginName(){return"ListItemFontColorIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[pa]}init(){const e=this.editor,n=e.plugins.get("ListFormatting"),i=e.plugins.get(pa);!e.plugins.has("FontColorEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(n.registerFormatAttribute("fontColor","listItemFontColor"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontColor",setAttributeOnDowncast(r,o,s){o&&(r.addClass("ck-list-marker-color",s),r.setStyle("--ck-content-list-marker-color",o,s))}}))}afterInit(){const e=this.editor,n=e.model;!e.plugins.has("FontColorEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(n.schema.extend("$listItem",{allowAttributes:"listItemFontColor"}),n.schema.setAttributeProperties("listItemFontColor",{isFormatting:!0}),n.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemFontColor"),e.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontColor",value:i=>i.getStyle("--ck-content-list-marker-color")},view:{name:"li",classes:"ck-list-marker-color",styles:{"--ck-content-list-marker-color":/.*/}}}))}}class m$e extends xe{static get pluginName(){return"ListItemFontFamilyIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[pa]}init(){const e=this.editor,n=e.plugins.get("ListFormatting"),i=e.plugins.get(pa);!e.plugins.has("FontFamilyEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(n.registerFormatAttribute("fontFamily","listItemFontFamily"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontFamily",setAttributeOnDowncast(r,o,s){o&&(r.addClass("ck-list-marker-font-family",s),r.setStyle("--ck-content-list-marker-font-family",o,s))}}))}afterInit(){const e=this.editor,n=e.model;!e.plugins.has("FontFamilyEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(n.schema.extend("$listItem",{allowAttributes:"listItemFontFamily"}),n.schema.setAttributeProperties("listItemFontFamily",{isFormatting:!0}),n.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemFontFamily"),e.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontFamily",value:i=>i.getStyle("--ck-content-list-marker-font-family")},view:{name:"li",classes:"ck-list-marker-font-family",styles:{"--ck-content-list-marker-font-family":/.*/}}}))}}class g$e extends xe{_loadedFormatting={};static get pluginName(){return"ListFormatting"}static get isOfficialPlugin(){return!0}static get requires(){return[c$e,d$e,f$e,h$e,m$e]}constructor(e){super(e),e.config.define("list.enableListItemMarkerFormatting",!0)}afterInit(){this.editor.config.get("list.enableListItemMarkerFormatting")&&this._registerPostfixerForListItemFormatting()}_registerPostfixerForListItemFormatting(){const e=this.editor.model;e.document.registerPostFixer(n=>{const i=e.document.differ.getChanges(),r=new Set;let o=!1;for(const s of i)if(s.type==="attribute")(s.attributeKey=="listItemId"||s.attributeKey=="listType"||this._isInlineOrSelectionFormatting(s.attributeKey)||Object.values(this._loadedFormatting).includes(s.attributeKey))&&(ti(s.range.start.nodeAfter)?r.add(s.range.start.nodeAfter):ti(s.range.start.parent)&&r.add(s.range.start.parent));else if(ti(s.position.nodeAfter)&&r.add(s.position.nodeAfter),ti(s.position.nodeBefore)&&r.add(s.position.nodeBefore),ti(s.position.parent)&&r.add(s.position.parent),s.type=="insert"&&s.name!="$text"){const a=n.createRangeIn(s.position.nodeAfter);for(const l of a.getItems())ti(l)&&r.add(l)}for(const s of r){const a=p$e(e,s,Object.keys(this._loadedFormatting));for(const[l,u]of Object.entries(a)){const c=this._loadedFormatting[l];(u&&v$e(n,s,c,u)||!u&&b$e(n,s,c))&&(o=!0)}}return o})}registerFormatAttribute(e,n){this._loadedFormatting[e]=n}_isInlineOrSelectionFormatting(e){return e.replace(/^selection:/,"")in this._loadedFormatting}}function p$e(t,e,n){if(Lc(e))return XF(t,e,n);const i=_g(e);return XF(t,i[0],n)}function XF(t,e,n){if(!y$e(e)||t.schema.isLimit(e))return Object.fromEntries(n.map(a=>[a]));if(e.isEmpty)return Object.fromEntries(n.map(a=>[a,e.getAttribute(`selection:${a}`)]));const i=new Set(n),r={},s=t.createRangeIn(e).getWalker({ignoreElementEnd:!0});for(const{item:a}of s){for(const l of i)if(t.schema.checkAttribute(a,l)){const u=a.getAttribute(l);u===void 0?(i.delete(l),r[l]=void 0):r[l]===void 0?r[l]=u:r[l]!==u&&(i.delete(l),r[l]=void 0)}else l in r||(r[l]=void 0);if(!i.size)break;t.schema.isLimit(a)&&s.jumpTo(t.createPositionAfter(a))}return r}function v$e(t,e,n,i){const r=_g(e);let o=!1;for(const s of r)(!s.hasAttribute(n)||s.getAttribute(n)!==i)&&(t.setAttribute(n,i,s),o=!0);return o}function b$e(t,e,n){const i=_g(e);let r=!1;for(const o of i)o.hasAttribute(n)&&(t.removeAttribute(n,o),r=!0);return r}function y$e(t){return["numbered","bulleted","customNumbered","customBulleted"].includes(t.getAttribute("listType"))}class w$e extends xe{static get pluginName(){return"ListUtils"}static get isOfficialPlugin(){return!0}expandListBlocksToCompleteList(e){return o$e(e)}isFirstBlockOfListItem(e){return Lc(e)}isListItemBlock(e){return ti(e)}expandListBlocksToCompleteItems(e,n={}){return g0(e,n)}isNumberedListType(e){return l$e(e)}}function _$e(t){return t.is("element","ol")||t.is("element","ul")}function jA(t){return t.is("element","li")}function C$e(t){let e=0,n=t.parent;for(;n;){if(jA(n))e++;else{const i=n.previousSibling;i&&jA(i)&&e++}n=n.parent}return e}function S$e(t,e,n,i=$X(n,e)){return t.createAttributeElement(FX(n),null,{priority:2*e/100-100,id:i})}function k$e(t,e,n){return t.createAttributeElement("li",null,{priority:(2*e+1)/100-100,id:n})}function FX(t){return t=="numbered"||t=="customNumbered"?"ol":"ul"}function $X(t,e){return`list-${t}-${e}`}function Zs(t,e,n){const i=t.nodeBefore;if(ti(i)){let r=i;for(const{node:o}of new m0(r,"backward"))if(r=o,n.has(r)||(n.add(r),e.has(i)))return;e.add(r)}else{const r=t.nodeAfter;ti(r)&&e.add(r)}}function T$e(t,e){let n=0,i=-1,r=null,o=!1;for(const{node:s}of t){const a=s.getAttribute("listIndent");if(a>n){let l;r===null?(r=a-n,l=n):(r>a&&(r=a),l=a-r),l>i+1&&(l=i+1),e.setAttribute("listIndent",l,s),o=!0,i=l}else r=null,n=a+1,i=a}return o}function E$e(t,e,n){const i=new Set;let r=!1;for(const{node:o}of t){if(i.has(o))continue;let s=o.getAttribute("listType"),a=o.getAttribute("listItemId");if(e.has(a)&&(a=Qm.next()),e.add(a),o.is("element","listItem")){o.getAttribute("listItemId")!=a&&(n.setAttribute("listItemId",a,o),r=!0);continue}for(const l of Oc(o,{direction:"forward"}))i.add(l),l.getAttribute("listType")!=s&&(a=Qm.next(),s=l.getAttribute("listType")),l.getAttribute("listItemId")!=a&&(n.setAttribute("listItemId",a,l),r=!0)}return r}function x$e(){return(t,e,n)=>{const{writer:i,schema:r}=n;if(!e.modelRange)return;const o=Array.from(e.modelRange.getItems({shallow:!0})).filter(d=>r.checkAttribute(d,"listItemId"));if(!o.length)return;const s=e.viewItem.getAttribute("data-list-item-id")||Qm.next();n.consumable.consume(e.viewItem,{attributes:"data-list-item-id"});const a=C$e(e.viewItem);let l=e.viewItem.parent&&e.viewItem.parent.is("element","ol")?"numbered":"bulleted";const u=o[0].getAttribute("listType");u&&(l=u);const c={listItemId:s,listIndent:a,listType:l};for(const d of o)d.hasAttribute("listItemId")||i.setAttributes(c,d);o.length>1&&o[1].getAttribute("listItemId")!=c.listItemId&&n.keepEmptyElement(o[0])}}function A$e(t,e,n,i){return()=>{const l=t.document.differ.getChanges(),u=[],c=new Set,d=new Set,f=new Set;for(const h of l)if(h.type=="insert"&&h.name!="$text")Zs(h.position,c,f),h.attributes.has("listItemId")?d.add(h.position.nodeAfter):Zs(h.position.getShiftedBy(h.length),c,f);else if(h.type=="remove"&&h.attributes.has("listItemId"))Zs(h.position,c,f);else if(h.type=="attribute"){const m=h.range.start.nodeAfter;n.includes(h.attributeKey)?(Zs(h.range.start,c,f),h.attributeNewValue===null?(Zs(h.range.start.getShiftedBy(1),c,f),o(m)&&u.push(m)):d.add(m)):ti(m)&&o(m)&&u.push(m)}for(const h of c.values())u.push(...r(h,d));for(const h of new Set(u))e.reconvertItem(h)};function r(l,u){const c=[],d=new Set,f=[];for(const{node:h,previous:m}of new m0(l)){if(d.has(h))continue;const g=h.getAttribute("listIndent");m&&gn.includes(p))),modelElement:h};const v=Oc(h,{direction:"forward"});for(const p of v)d.add(p),(o(p,v)||a(p,f,u))&&c.push(p)}return c}function o(l,u){const c=e.mapper.toViewElement(l);if(!c)return!1;if(s(c)||i.fire("checkElement",{modelElement:l,viewElement:c}))return!0;if(!l.is("element","paragraph")&&!l.is("element","listItem"))return!1;const f=HX(l,n,u);return f&&c.is("element","p")?!0:!!(!f&&c.is("element","span"))}function s(l){for(l=l.parent;l.is("attributeElement")&&["ol","ul","li"].includes(l.name);)l=l.parent;return!!(l.getCustomProperty("$structureSlotParent")&&!e.mapper.toModelElement(l))}function a(l,u,c){if(c.has(l))return!1;const d=e.mapper.toViewElement(l);let f=u.length-1;for(let h=d.parent;!h.is("editableElement");h=h.parent){const m=jA(h),g=_$e(h);if(!g&&!m)continue;const v=`checkAttributes:${m?"item":"list"}`;if(i.fire(v,{viewElement:h,modelAttributes:u[f].modelAttributes,modelReferenceElement:u[f].modelElement}))break;if(g&&(f--,f<0))return!1}return!0}}function JF(t,e,n,{dataPipeline:i}={}){const r=D$e(t,e);return(o,s,a)=>{const{writer:l,mapper:u,consumable:c}=a,d=s.item;if(!t.includes(s.attributeKey)||!r(d,c))return;const f={...a.options,dataPipeline:i},h=I$e(d,u,n,l);zX(h,l,u),O$e(h,l);const m=M$e(d,h,e,l,f);L$e(d,m,e,l,f)}}function P$e(t){return(e,n,i)=>{const{writer:r,mapper:o}=i,s=e.name.split(":")[1];if(!t.checkAttribute(s,"listItemId"))return;const a=o.toViewPosition(n.position),l=n.position.getShiftedBy(n.length),u=o.toViewPosition(l,{isPhantom:!0}),d=r.createRange(a,u).getTrimmed().end.nodeBefore;d&&zX(d,r,o)}}function ZF(t,{dataPipeline:e}={}){return(n,{writer:i})=>{if(!HX(n,t))return null;if(!e)return i.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const r=i.createContainerElement("p");return i.setCustomProperty("dataPipeline:transparentRendering",!0,r),r}}function I$e(t,e,n,i){const r=n.createRangeOn(t),s=e.toViewRange(r).getTrimmed().getWalker();for(const{item:a}of s)if(a.is("element")&&a.getCustomProperty("listItemMarker"))s.jumpTo(i.createPositionAfter(a));else if(a.is("element")&&!a.getCustomProperty("listItemWrapper"))return a}function R$e(t,e){return(n,i)=>{if(i.modelPosition.offset>0)return;const r=i.modelPosition.parent;if(!ti(r)||!t.some(u=>u.scope=="itemMarker"&&u.canInjectMarkerIntoElement&&u.canInjectMarkerIntoElement(r)))return;const o=i.mapper.toViewElement(r),s=e.createRangeIn(o),a=s.getWalker();let l=s.start;for(const{item:u}of a){if(u.is("element")&&i.mapper.toModelElement(u)||u.is("$textProxy"))break;u.is("element")&&u.getCustomProperty("listItemMarker")&&(l=e.createPositionAfter(u),a.skip(({previousPosition:c})=>!c.isEqual(l)))}i.viewPosition=l}}function zX(t,e,n){for(;t.parent.is("attributeElement")&&t.parent.getCustomProperty("listItemWrapper");)e.unwrap(e.createRangeOn(t),t.parent);const i=[];r(e.createPositionBefore(t).getWalker({direction:"backward"})),r(e.createRangeIn(t).getWalker());for(const o of i)e.remove(o);function r(o){for(const{item:s}of o){if(s.is("element")&&n.toModelElement(s))break;s.is("element")&&s.getCustomProperty("listItemMarker")&&i.push(s)}}}function M$e(t,e,n,i,{dataPipeline:r}){let o=i.createRangeOn(e);if(!Lc(t))return o;for(const s of n){if(s.scope!="itemMarker")continue;const a=s.createElement(i,t,{dataPipeline:r});if(!a||(i.setCustomProperty("listItemMarker",!0,a),s.canInjectMarkerIntoElement&&s.canInjectMarkerIntoElement(t)?i.insert(i.createPositionAt(e,0),a):(i.insert(o.start,a),o=i.createRange(i.createPositionBefore(a),i.createPositionAfter(e))),!s.createWrapperElement||!s.canWrapElement))continue;const l=s.createWrapperElement(i,t,{dataPipeline:r});i.setCustomProperty("listItemWrapper",!0,l),s.canWrapElement(t)?o=i.wrap(o,l):(o=i.wrap(i.createRangeOn(a),l),o=i.createRange(o.start,i.createPositionAfter(e)))}return o}function O$e(t,e){let n=t.parent;for(;n.is("attributeElement")&&["ul","ol","li"].includes(n.name);){const i=n.parent;e.unwrap(e.createRangeOn(t),n),n=i}}function L$e(t,e,n,i,r){if(!t.hasAttribute("listIndent"))return;const o=t.getAttribute("listIndent");let s=t;for(let a=o;a>=0;a--){const l=k$e(i,a,s.getAttribute("listItemId")),u=S$e(i,a,s.getAttribute("listType"));for(const c of n)(c.scope=="list"||c.scope=="item")&&s.hasAttribute(c.attributeName)&&c.setAttributeOnDowncast(i,s.getAttribute(c.attributeName),c.scope=="list"?u:l,r,s);if(e=i.wrap(e,l),e=i.wrap(e,u),a==0||(s=zs.first(s,{lowerIndent:!0}),!s))break}}function D$e(t,e){const n=e.filter(i=>i.consume===!1).map(i=>i.attributeName);return(i,r)=>{const o=[];for(const s of t)i.hasAttribute(s)&&!n.includes(s)&&o.push(`attribute:${s}`);return o.every(s=>r.test(i,s)!==!1)?(o.forEach(s=>r.consume(i,s)),!0):!1}}function HX(t,e,n=_g(t)){if(!ti(t))return!1;for(const i of t.getAttributeKeys())if(!(i.startsWith("selection:")||i=="htmlEmptyBlock")&&!e.includes(i))return!1;return n.length<2}const i_=["listType","listIndent","listItemId"];class pa extends xe{_downcastStrategies=[];static get pluginName(){return"ListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[kS,yu,w$e,fs,g$e]}constructor(e){super(e),e.config.define("list.multiBlock",!0)}init(){const e=this.editor,n=e.model,i=e.config.get("list.multiBlock");if(e.plugins.has("LegacyListEditing"))throw new oe("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});n.schema.register("$listItem",{allowAttributes:i_}),i?(n.schema.extend("$container",{allowAttributesOf:"$listItem"}),n.schema.extend("$block",{allowAttributesOf:"$listItem"}),n.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):n.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const r of i_)n.schema.setAttributeProperties(r,{copyOnReplace:!0});e.commands.add("numberedList",new wy(e,"numbered")),e.commands.add("bulletedList",new wy(e,"bulleted")),e.commands.add("customNumberedList",new wy(e,"customNumbered",{multiLevel:!0})),e.commands.add("customBulletedList",new wy(e,"customBulleted",{multiLevel:!0})),e.commands.add("indentList",new jF(e,"forward")),e.commands.add("outdentList",new jF(e,"backward")),e.commands.add("splitListItemBefore",new YF(e,"before")),e.commands.add("splitListItemAfter",new YF(e,"after")),i&&(e.commands.add("mergeListItemBackward",new GF(e,"backward")),e.commands.add("mergeListItemForward",new GF(e,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration(),this._setupListItemIdConversionStrategy()}afterInit(){const n=this.editor.commands,i=n.get("indent"),r=n.get("outdent");i&&i.registerChildCommand(n.get("indentList"),{priority:"high"}),r&&r.registerChildCommand(n.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(e){this._downcastStrategies.push(e)}getListAttributeNames(){return[...i_,...this._downcastStrategies.map(e=>e.attributeName)]}_setupDeleteIntegration(){const e=this.editor,n=e.commands.get("mergeListItemBackward"),i=e.commands.get("mergeListItemForward");this.listenTo(e.editing.view.document,"delete",(r,o)=>{const s=e.model.document.selection;gb(e.model)||e.model.change(()=>{const a=s.getFirstPosition();if(s.isCollapsed&&o.direction=="backward"){if(!a.isAtStart)return;const l=a.parent;if(!ti(l))return;if(!zs.first(l,{sameAttributes:"listType",sameIndent:!0})&&l.getAttribute("listIndent")===0)qF(l)||e.execute("splitListItemAfter"),e.execute("outdentList");else{if(!n||!n.isEnabled)return;n.execute({shouldMergeOnBlocksContentLevel:QF(e.model,"backward")})}o.preventDefault(),r.stop()}else{if(s.isCollapsed&&!s.getLastPosition().isAtEnd||!i||!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:QF(e.model,"forward")}),o.preventDefault(),r.stop()}})},{context:"li"})}_setupEnterIntegration(){const e=this.editor,n=e.model,i=e.commands,r=i.get("enter");this.listenTo(e.editing.view.document,"enter",(o,s)=>{const a=n.document,l=a.selection.getFirstPosition().parent;if(a.selection.isCollapsed&&ti(l)&&l.isEmpty&&!s.isSoft){const u=Lc(l),c=qF(l);u&&c?(e.execute("outdentList"),s.preventDefault(),o.stop()):u&&!c?(e.execute("splitListItemAfter"),s.preventDefault(),o.stop()):c&&(e.execute("splitListItemBefore"),s.preventDefault(),o.stop())}},{context:"li"}),this.listenTo(r,"afterExecute",()=>{const o=i.get("splitListItemBefore");if(o.refresh(),!o.isEnabled)return;const a=e.model.document.selection.getLastPosition().parent;_g(a).length===2&&o.execute()})}_setupTabIntegration(){const e=this.editor;this.listenTo(e.editing.view.document,"tab",(n,i)=>{const r=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(r).isEnabled&&(e.execute(r),i.stopPropagation(),i.preventDefault(),n.stop())},{context:"li"})}_setupConversion(){const e=this.editor,n=e.model,i=this.getListAttributeNames(),r=e.config.get("list.multiBlock"),o=r?"paragraph":"listItem";e.conversion.for("upcast").elementToElement({view:"li",model:(a,{writer:l})=>l.createElement(o,{listType:""})}).elementToElement({view:"p",model:(a,{writer:l})=>a.parent&&a.parent.is("element","li")?l.createElement(o,{listType:""}):null,converterPriority:"high"}).add(a=>{a.on("element:li",x$e())}),r||e.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),e.conversion.for("editingDowncast").elementToElement({model:o,view:ZF(i),converterPriority:"high"}).add(a=>{a.on("attribute",JF(i,this._downcastStrategies,n)),a.on("remove",P$e(n.schema))}),e.conversion.for("dataDowncast").elementToElement({model:o,view:ZF(i,{dataPipeline:!0}),converterPriority:"high"}).add(a=>{a.on("attribute",JF(i,this._downcastStrategies,n,{dataPipeline:!0}))});const s=R$e(this._downcastStrategies,e.editing.view);e.editing.mapper.on("modelToViewPosition",s),e.data.mapper.on("modelToViewPosition",s),this.listenTo(n.document,"change:data",A$e(n,e.editing,i,this),{priority:"high"}),this.on("checkAttributes:item",(a,{viewElement:l,modelAttributes:u})=>{l.id!=u.listItemId&&(a.return=!0,a.stop())}),this.on("checkAttributes:list",(a,{viewElement:l,modelAttributes:u})=>{(l.name!=FX(u.listType)||l.id!=$X(u.listType,u.listIndent))&&(a.return=!0,a.stop())})}_setupModelPostFixing(){const e=this.editor.model,n=this.getListAttributeNames();e.document.registerPostFixer(i=>N$e(e,i,n,this)),this.on("postFixer",(i,{listNodes:r,writer:o})=>{i.return=T$e(r,o)||i.return},{priority:"high"}),this.on("postFixer",(i,{listNodes:r,writer:o,seenIds:s})=>{i.return=E$e(r,s,o)||i.return},{priority:"high"})}_setupClipboardIntegration(){const e=this.editor.model,n=this.editor.plugins.get("ClipboardPipeline");this.listenTo(e,"insertContent",B$e(e),{priority:"high"}),this.listenTo(n,"outputTransformation",(i,r)=>{e.change(o=>{const s=Array.from(r.content.getChildren()),a=s[s.length-1];if(s.length>1&&a.is("element")&&a.isEmpty&&s.slice(0,-1).every(ti)&&o.remove(a),r.method=="copy"||r.method=="cut"){const l=Array.from(r.content.getChildren());mb(l)&&ES(l,o)}})})}_setupAccessibilityIntegration(){const e=this.editor,n=e.t;e.accessibility.addKeystrokeInfoGroup({id:"list",label:n("Keystrokes that can be used in a list"),keystrokes:[{label:n("Increase list item indent"),keystroke:"Tab"},{label:n("Decrease list item indent"),keystroke:"Shift+Tab"}]})}_setupListItemIdConversionStrategy(){this.registerDowncastStrategy({scope:"item",attributeName:"listItemId",setAttributeOnDowncast(e,n,i,r){r&&(r.skipListItemIds||r.isClipboardPipeline)||e.setAttribute("data-list-item-id",n,i)}})}}function N$e(t,e,n,i){const r=t.document.differ.getChanges(),o=new Set,s=new Set,a=i.editor.config.get("list.multiBlock");let l=!1;for(const c of r){if(c.type=="insert"&&c.name!="$text"){const d=c.position.nodeAfter;if(!t.schema.checkAttribute(d,"listItemId"))for(const f of Array.from(d.getAttributeKeys()))n.includes(f)&&(e.removeAttribute(f,d),l=!0);Zs(c.position,s,o),c.attributes.has("listItemId")||Zs(c.position.getShiftedBy(c.length),s,o);for(const{item:f,previousPosition:h}of t.createRangeIn(d))ti(f)&&Zs(h,s,o)}else c.type=="remove"?Zs(c.position,s,o):c.type=="attribute"&&n.includes(c.attributeKey)&&(Zs(c.range.start,s,o),c.attributeNewValue===null&&Zs(c.range.start.getShiftedBy(1),s,o));if(!a&&c.type=="attribute"&&i_.includes(c.attributeKey)){const d=c.range.start.nodeAfter;c.attributeNewValue===null&&d&&d.is("element","listItem")?(e.rename(d,"paragraph"),l=!0):c.attributeOldValue===null&&d&&d.is("element")&&d.name!="listItem"&&(e.rename(d,"listItem"),l=!0)}}const u=new Set;for(const c of s.values())l=i.fire("postFixer",{listNodes:new i$e(c),listHead:c,writer:e,seenIds:u})||l;return l}function B$e(t){return(e,[n,i])=>{const r=n.is("documentFragment")?Array.from(n.getChildren()):[n];if(!r.length)return;const s=(i?t.createSelection(i):t.document.selection).getFirstPosition();let a;if(ti(s.parent))a=s.parent;else if(ti(s.nodeBefore)&&ti(s.nodeAfter))a=s.nodeBefore;else return;t.change(l=>{const u=a.getAttribute("listType"),c=a.getAttribute("listIndent"),d=r[0].getAttribute("listIndent")||0,f=Math.max(c-d,0);for(const h of r){const m=ti(h);a.is("element","listItem")&&h.is("element","paragraph")&&l.rename(h,"listItem"),l.setAttributes({listIndent:(m?h.getAttribute("listIndent"):0)+f,listItemId:m?h.getAttribute("listItemId"):Qm.next(),listType:u},h)}})}}function QF(t,e){const n=t.document.selection;if(!n.isCollapsed)return!gb(t);if(e==="forward")return!0;const r=n.getFirstPosition().parent,o=r.previousSibling;return t.schema.isObject(o)?!1:o.isEmpty?!0:mb([r,o])}function e6(t,e,n,i){t.ui.componentFactory.add(e,()=>{const r=t6(wt,t,e,n,i);return r.set({tooltip:!0,isToggleable:!0}),r}),t.ui.componentFactory.add(`menuBar:${e}`,()=>{const r=t6(Wi,t,e,n,i);return r.set({role:"menuitemcheckbox",isToggleable:!0}),r})}function t6(t,e,n,i,r){const o=e.commands.get(n),s=new t(e.locale);return s.set({label:i,icon:r}),s.bind("isOn","isEnabled").to(o,"value","isEnabled"),s.on("execute",()=>{e.execute(n),e.editing.view.focus()}),s}class V$e extends xe{static get pluginName(){return"ListUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||e6(this.editor,"numberedList",e("Numbered List"),tNe),this.editor.ui.componentFactory.has("bulletedList")||e6(this.editor,"bulletedList",e("Bulleted List"),FDe)}}class F$e extends xe{static get requires(){return[pa,V$e]}static get pluginName(){return"List"}static get isOfficialPlugin(){return!0}}const $$e=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:t,typeAttribute:e,listType:n}of $$e);function n6(t,e){const n=(i,r,o)=>{if(!o.consumable.consume(r.item,i.name))return;const s=r.attributeNewValue,a=o.writer,l=o.mapper.toViewElement(r.item),u=[...l.getChildren()].find(d=>d.getCustomProperty("media-content"));a.remove(u);const c=t.getMediaViewElement(a,s,e);a.insert(a.createPositionAt(l,0),c)};return i=>{i.on("attribute:url:media",n)}}function z$e(t,e,n){return e.setCustomProperty("media",!0,t),vO(t,e,{label:n})}function i6(t,e,n,i){return t.createContainerElement("figure",{class:"media"},[e.getMediaViewElement(t,n,i),t.createSlot()])}function r6(t){const e=t.getSelectedElement();return e&&e.is("element","media")?e:null}function UX(t,e,n,i){t.change(r=>{const o=r.createElement("media",{url:e});t.insertObject(o,n,null,{setSelection:"on",findOptimalPosition:i?"auto":void 0})})}class H$e extends Ht{refresh(){const e=this.editor.model,n=e.document.selection,i=r6(n);this.value=i?i.getAttribute("url"):void 0,this.isEnabled=W$e(n)||U$e(n,e)}execute(e){const n=this.editor.model,i=n.document.selection,r=r6(i);r?n.change(o=>{o.setAttribute("url",e,r)}):UX(n,e,i,!0)}}function U$e(t,e){let i=iX(t,e).start.parent;return i.isEmpty&&!e.schema.isLimit(i)&&(i=i.parent),e.schema.checkChild(i,"media")}function W$e(t){const e=t.getSelectedElement();return!!e&&e.name==="media"}const q$e="0 0 64 42";class j$e{locale;providerDefinitions;constructor(e,n){const i=n.providers,r=n.extraProviders||[],o=new Set(n.removeProviders),s=i.concat(r).filter(a=>{const l=a.name;return l?!o.has(l):(hn("media-embed-no-provider-name",{provider:a}),!1)});this.locale=e,this.providerDefinitions=s}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,n,i){return this._getMedia(n).getViewElement(e,i)}_getMedia(e){if(!e)return new o6(this.locale);e=e.trim();for(const n of this.providerDefinitions){const i=n.html,r=li(n.url);for(const o of r){const s=this._getUrlMatches(e,o);if(s)return new o6(this.locale,e,s,i)}}return null}_getUrlMatches(e,n){let i=e.match(n);if(i)return i;let r=e.replace(/^https?:\/\//,"");return i=r.match(n),i||(r=r.replace(/^www\./,""),i=r.match(n),i)?i:null}}class o6{url;_locale;_match;_previewRenderer;constructor(e,n,i,r){this.url=this._getValidUrl(n),this._locale=e,this._match=i,this._previewRenderer=r}getViewElement(e,n){const i={};let r;if(n.renderForEditingView||n.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(i["data-oembed-url"]=this.url),n.renderForEditingView&&(i.class="ck-media__wrapper");const o=this._getPreviewHtml(n);r=e.createRawElement("div",i,(s,a)=>{a.setContentOf(s,o)})}else this.url&&(i.url=this.url),r=e.createEmptyElement(n.elementName,i);return e.setCustomProperty("media-content",!0,r),r}_getPreviewHtml(e){return this._previewRenderer?this._previewRenderer(this._match):this.url&&e.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const e=new Sa,n=this._locale.t;return e.content=QDe,e.viewBox=q$e,new Io({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[e]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":n("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(e){return e?e.match(/^https?/)?e:"https://"+e:null}}class T1 extends xe{static get pluginName(){return"MediaEmbedEditing"}static get isOfficialPlugin(){return!0}registry;constructor(e){super(e),e.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:[/^dailymotion\.com\/video\/(\w+)/,/^dai.ly\/(\w+)/],html:n=>`
`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:n=>`
`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,/^(?:m\.)?youtube\.com\/shorts\/([\w-]+)(?:\?t=(\d+))?/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/],html:n=>{const i=n[1],r=n[2];return`
`}},{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:n=>`
`},{name:"instagram",url:[/^instagram\.com\/p\/(\w+)/,/^instagram\.com\/reel\/(\w+)/]},{name:"twitter",url:[/^twitter\.com/,/^x\.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 j$e(e.locale,e.config.get("mediaEmbed"))}init(){const e=this.editor,n=e.model.schema,i=e.t,r=e.conversion,o=e.config.get("mediaEmbed.previewsInData"),s=e.config.get("mediaEmbed.elementName"),a=this.registry;e.commands.add("mediaEmbed",new H$e(e)),n.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),r.for("dataDowncast").elementToStructure({model:"media",view:(l,{writer:u})=>{const c=l.getAttribute("url");return i6(u,a,c,{elementName:s,renderMediaPreview:!!c&&o})}}),r.for("dataDowncast").add(n6(a,{elementName:s,renderMediaPreview:o})),r.for("editingDowncast").elementToStructure({model:"media",view:(l,{writer:u})=>{const c=l.getAttribute("url"),d=i6(u,a,c,{elementName:s,renderForEditingView:!0});return z$e(d,u,i("media widget"))}}),r.for("editingDowncast").add(n6(a,{elementName:s,renderForEditingView:!0})),r.for("upcast").elementToElement({view:l=>["oembed",s].includes(l.name)&&l.getAttribute("url")?{name:!0}:null,model:(l,{writer:u})=>{const c=l.getAttribute("url");return a.hasMedia(c)?u.createElement("media",{url:c}):null}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(l,{writer:u})=>{const c=l.getAttribute("data-oembed-url");return a.hasMedia(c)?u.createElement("media",{url:c}):null}}).add(l=>{const u=(c,d,f)=>{if(!f.consumable.consume(d.viewItem,{name:!0,classes:"media"}))return;const{modelRange:h,modelCursor:m}=f.convertChildren(d.viewItem,d.modelCursor);d.modelRange=h,d.modelCursor=m,Mi(h.getItems())||f.consumable.revert(d.viewItem,{name:!0,classes:"media"})};l.on("element:figure",u)})}}const K$e=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class G$e extends xe{static get requires(){return[cX,yu,_O]}static get pluginName(){return"AutoMediaEmbed"}static get isOfficialPlugin(){return!0}_timeoutId;_positionToInsert;constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}init(){const e=this.editor,n=e.model.document,i=e.plugins.get("ClipboardPipeline");this.listenTo(i,"inputTransformation",()=>{const o=n.selection.getFirstRange(),s=Bi.fromPosition(o.start);s.stickiness="toPrevious";const a=Bi.fromPosition(o.end);a.stickiness="toNext",n.once("change:data",()=>{this._embedMediaBetweenPositions(s,a),s.detach(),a.detach()},{priority:"high"})}),e.commands.get("undo").on("execute",()=>{this._timeoutId&&(Qe.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(e,n){const i=this.editor,r=i.plugins.get(T1).registry,o=new ko(e,n),s=o.getWalker({ignoreElementEnd:!0});let a="";for(const u of s)u.item.is("$textProxy")&&(a+=u.item.data);if(a=a.trim(),!a.match(K$e)){o.detach();return}if(!r.hasMedia(a)){o.detach();return}if(!i.commands.get("mediaEmbed").isEnabled){o.detach();return}this._positionToInsert=Bi.fromPosition(e),this._timeoutId=Qe.window.setTimeout(()=>{i.model.change(u=>{this._timeoutId=null,u.remove(o),o.detach();let c=null;this._positionToInsert.root.rootName!=="$graveyard"&&(c=this._positionToInsert),UX(i.model,a,c,!1),this._positionToInsert.detach(),this._positionToInsert=null}),i.plugins.get(yu).requestUndoOnBackspace()},100)}}class Y$e extends ut{focusTracker;keystrokes;urlInputView;_validators;_urlInputViewInfoDefault;_urlInputViewInfoTip;constructor(e,n){super(n),this.focusTracker=new wi,this.keystrokes=new Qi,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this._validators=e,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView]})}render(){super.render(),vg({view:this}),this.focusTracker.add(this.urlInputView.element),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.urlInputView.focus()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(e){this.urlInputView.fieldView.value=e.trim()}isValid(){this.resetFormStatus();for(const e of this._validators){const n=e(this);if(n)return this.urlInputView.errorText=n,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t,n=new Go(this.locale,tu),i=n.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."),n.label=e("Media URL"),n.infoText=this._urlInputViewInfoDefault,i.inputMode="url",i.on("input",()=>{n.infoText=i.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=i.element.value.trim()}),n}}class X$e extends xe{static get requires(){return[T1,EY]}static get pluginName(){return"MediaEmbedUI"}static get isOfficialPlugin(){return!0}_formView;init(){const e=this.editor;e.ui.componentFactory.add("mediaEmbed",()=>{const n=this.editor.locale.t,i=this._createDialogButton(wt);return i.tooltip=!0,i.label=n("Insert media"),i}),e.ui.componentFactory.add("menuBar:mediaEmbed",()=>{const n=this.editor.locale.t,i=this._createDialogButton(Wi);return i.label=n("Media"),i})}_createDialogButton(e){const n=this.editor,i=new e(n.locale),r=n.commands.get("mediaEmbed"),o=this.editor.plugins.get("Dialog");return i.icon=eNe,i.bind("isEnabled").to(r,"isEnabled"),i.on("execute",()=>{o.id==="mediaEmbed"?o.hide():this._showDialog()}),i}_showDialog(){const e=this.editor,n=e.plugins.get("Dialog"),i=e.commands.get("mediaEmbed"),r=e.locale.t,o=i.value!==void 0;if(!this._formView){const s=e.plugins.get(T1).registry;this._formView=new(cb(Y$e))(J$e(e.t,s),e.locale),this._formView.on("submit",()=>this._handleSubmitForm())}n.show({id:"mediaEmbed",title:r("Media embed"),content:this._formView,isModal:!0,onShow:()=>{this._formView.url=i.value||"",this._formView.resetFormStatus(),this._formView.urlInputView.fieldView.select()},actionButtons:[{label:r("Cancel"),withText:!0,onExecute:()=>n.hide()},{label:r(o?"Save":"Insert"),class:"ck-button-action",withText:!0,onExecute:()=>this._handleSubmitForm()}]})}_handleSubmitForm(){const e=this.editor,n=e.plugins.get("Dialog");this._formView.isValid()&&(e.execute("mediaEmbed",this._formView.url),n.hide(),e.editing.view.focus())}}function J$e(t,e){return[n=>{if(!n.url.length)return t("The URL must not be empty.")},n=>{if(!e.hasMedia(n.url))return t("This media URL is not supported.")}]}class Z$e extends xe{static get requires(){return[T1,X$e,G$e,h0]}static get pluginName(){return"MediaEmbed"}static get isOfficialPlugin(){return!0}}const s6={"(":")","[":"]","{":"}"};class Q$e extends Ht{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,n=e.document;this.isEnabled=e.schema.checkAttributeInSelection(n.selection,"mention")}execute(e){const n=this.editor.model,r=n.document.selection,o=typeof e.mention=="string"?{id:e.mention}:e.mention,s=o.id,a=e.range||r.getFirstRange();if(!n.canEditAt(a))return;const l=e.text||s,u=WX({_text:l,id:s},o);if(!s.startsWith(e.marker))throw new oe("mentioncommand-incorrect-id",this);n.change(c=>{const d=gl(r.getAttributes()),f=new Map(d.entries());f.set("mention",u);const h=n.insertContent(c.createText(l,f),a),m=h.start.nodeBefore,g=h.end.nodeAfter,v=g&&g.is("$text")&&g.data.startsWith(" ");let p=!1;if(m&&g&&m.is("$text")&&g.is("$text")){const b=m.data.slice(-1),y=b in s6,_=y&&g.data.startsWith(s6[b]);p=y&&_}!p&&!v&&n.insertContent(c.createText(" ",d),a.start.getShiftedBy(l.length))})}}class e7e extends xe{static get pluginName(){return"MentionEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,n=e.model,i=n.document;n.schema.extend("$text",{allowAttributes:"mention"}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",attributes:"data-mention",classes:"mention"},model:{key:"mention",value:r=>qX(r)}}),e.conversion.for("downcast").attributeToElement({model:"mention",view:n7e}),e.conversion.for("downcast").add(t7e),i.registerPostFixer(r=>o7e(r,i,n.schema)),i.registerPostFixer(r=>s7e(r,i)),i.registerPostFixer(r=>i7e(r,i)),e.commands.add("mention",new Q$e(e))}}function WX(t,e){return Object.assign({uid:Ur()},t,e||{})}function qX(t,e){const n=t.getAttribute("data-mention"),i=t.getChild(0);if(!i)return;const r={id:n,_text:i.data};return WX(r,e)}function t7e(t){t.on("attribute:mention",(e,n,i)=>{const r=n.attributeNewValue;if(!n.item.is("$textProxy")||!r)return;const o=n.range.start;(o.textNode||o.nodeAfter).data!=r._text&&i.consumable.consume(n.item,e.name)},{priority:"highest"})}function n7e(t,{writer:e}){if(!t)return;const n={class:"mention","data-mention":t.id},i={id:t.uid,priority:20};return e.createAttributeElement("span",n,i)}function i7e(t,e){const n=e.selection,i=n.focus;return n.isCollapsed&&n.hasAttribute("mention")&&r7e(i)?(t.removeSelectionAttribute("mention"),!0):!1}function r7e(t){const e=t.isAtStart;return t.nodeBefore&&t.nodeBefore.is("$text")||e}function o7e(t,e,n){const i=e.differ.getChanges();let r=!1;for(const o of i){if(o.type=="attribute")continue;const s=o.position;if(o.name=="$text"){const a=s.textNode&&s.textNode.nextSibling;r=cd(s.textNode,t)||r,r=cd(a,t)||r,r=cd(s.nodeBefore,t)||r,r=cd(s.nodeAfter,t)||r}if(o.name!="$text"&&o.type=="insert"){const a=s.nodeAfter;for(const l of t.createRangeIn(a).getItems())r=cd(l,t)||r}if(o.type=="insert"&&n.isInline(o.name)){const a=s.nodeAfter&&s.nodeAfter.nextSibling;r=cd(s.nodeBefore,t)||r,r=cd(a,t)||r}}return r}function s7e(t,e){const n=e.differ.getChanges();let i=!1;for(const r of n)if(r.type==="attribute"&&r.attributeKey!="mention"){const o=r.range.start.nodeBefore,s=r.range.end.nodeAfter;for(const a of[o,s])jX(a)&&a.getAttribute(r.attributeKey)!=r.attributeNewValue&&(t.setAttribute(r.attributeKey,r.attributeNewValue,a),i=!0)}return i}function jX(t){if(!t||!(t.is("$text")||t.is("$textProxy"))||!t.hasAttribute("mention"))return!1;const e=t.data,i=t.getAttribute("mention")._text;return e!=i}function cd(t,e){return jX(t)?(e.removeAttribute("mention",t),!0):!1}class a7e extends jf{selected;position;constructor(e){super(e),this.extendTemplate({attributes:{class:["ck-mentions"],tabindex:"-1"}})}selectFirst(){this.select(0)}selectNext(){const e=this.selected,n=this.items.getIndex(e);this.select(n+1)}selectPrevious(){const e=this.selected,n=this.items.getIndex(e);this.select(n-1)}select(e){let n=0;e>0&&e{o?(this.domElement.classList.add("ck-on"),this.domElement.classList.remove("ck-off")):(this.domElement.classList.add("ck-off"),this.domElement.classList.remove("ck-on"))}),this.listenTo(this.domElement,"click",()=>{this.fire("execute")})}render(){super.render(),this.element=this.domElement}focus(){this.domElement.focus()}}class u7e extends $s{item;marker;highlight(){const e=this.children.first;e.isOn=!0}removeHighlight(){const e=this.children.first;e.isOn=!1}}const _y=3,c7e=[Yt.arrowup,Yt.arrowdown,Yt.esc],d7e=[Yt.enter,Yt.tab];class f7e extends xe{_mentionsView;_mentionsConfigurations;_balloon;_items=new Er;_lastRequested;_requestFeedDebounced;static get pluginName(){return"MentionUI"}static get isOfficialPlugin(){return!0}static get requires(){return[bu]}constructor(e){super(e),this._mentionsView=this._createMentionView(),this._mentionsConfigurations=new Map,this._requestFeedDebounced=ml(this._requestFeed,100),e.config.define("mention",{feeds:[]})}init(){const e=this.editor,n=e.config.get("mention.commitKeys")||d7e,i=c7e.concat(n);this._balloon=e.plugins.get(bu),e.editing.view.document.on("keydown",(s,a)=>{o(a.keyCode)&&this._isUIVisible&&(a.preventDefault(),s.stop(),a.keyCode==Yt.arrowdown&&this._mentionsView.selectNext(),a.keyCode==Yt.arrowup&&this._mentionsView.selectPrevious(),n.includes(a.keyCode)&&this._mentionsView.executeSelected(),a.keyCode==Yt.esc&&this._hideUIAndRemoveMarker())},{priority:"highest"}),Wf({emitter:this._mentionsView,activator:()=>this._isUIVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUIAndRemoveMarker()});const r=e.config.get("mention.feeds");for(const s of r){const{feed:a,marker:l,dropdownLimit:u}=s;if(!y7e(l))throw new oe("mentionconfig-incorrect-marker",null,{marker:l});const c=typeof a=="function"?a.bind(this.editor):p7e(a),d=s.itemRenderer,f={marker:l,feedCallback:c,itemRenderer:d,dropdownLimit:u};this._mentionsConfigurations.set(l,f)}this._setupTextWatcher(r),this.listenTo(e,"change:isReadOnly",()=>{this._hideUIAndRemoveMarker()}),this.on("requestFeed:response",(s,a)=>this._handleFeedResponse(a)),this.on("requestFeed:error",()=>this._hideUIAndRemoveMarker());function o(s){return i.includes(s)}}destroy(){super.destroy(),this._mentionsView.destroy()}get _isUIVisible(){return this._balloon.visibleView===this._mentionsView}_createMentionView(){const e=this.editor.locale,n=new a7e(e);return n.items.bindTo(this._items).using(i=>{const{item:r,marker:o}=i,{dropdownLimit:s}=this._mentionsConfigurations.get(o),a=s||this.editor.config.get("mention.dropdownLimit")||10;if(n.items.length>=a)return null;const l=new u7e(e),u=this._renderItem(r,o);return u.delegate("execute").to(l),l.children.add(u),l.item=r,l.marker=o,l.on("execute",()=>{n.fire("execute",{item:r,marker:o})}),l}),n.on("execute",(i,r)=>{const o=this.editor,s=o.model,a=r.item,l=r.marker,u=o.model.markers.get("mention"),c=s.createPositionAt(s.document.selection.focus),d=s.createPositionAt(u.getStart()),f=s.createRange(d,c);this._hideUIAndRemoveMarker(),o.execute("mention",{mention:a,text:a.text,marker:l,range:f}),o.editing.view.focus()}),n}_getItemRenderer(e){const{itemRenderer:n}=this._mentionsConfigurations.get(e);return n}_requestFeed(e,n){this._lastRequested=n;const{feedCallback:i}=this._mentionsConfigurations.get(e),r=i(n);if(!(r instanceof Promise)){this.fire("requestFeed:response",{feed:r,marker:e,feedText:n});return}r.then(s=>{this._lastRequested==n?this.fire("requestFeed:response",{feed:s,marker:e,feedText:n}):this.fire("requestFeed:discarded",{feed:s,marker:e,feedText:n})}).catch(s=>{this.fire("requestFeed:error",{error:s}),hn("mention-feed-callback-error",{marker:e})})}_setupTextWatcher(e){const n=this.editor,i=e.map(s=>({...s,pattern:GX(s.marker,s.minimumCharacters||0)})),r=new pO(n.model,m7e(i));r.on("matched",(s,a)=>{const l=KX(i,a.text),c=n.model.document.selection.focus,d=n.model.createPositionAt(c.parent,l.position);if(v7e(c)||b7e(d)){this._hideUIAndRemoveMarker();return}const f=g7e(l,a.text),h=l.marker.length+f.length,m=c.getShiftedBy(-h),g=c.getShiftedBy(-f.length),v=n.model.createRange(m,g);if(bE(n)){const p=n.model.markers.get("mention");n.model.change(b=>{b.updateMarker(p,{range:v})})}else n.model.change(p=>{p.addMarker("mention",{range:v,usingOperation:!1,affectsData:!1})});this._requestFeedDebounced(l.marker,f)}),r.on("unmatched",()=>{this._hideUIAndRemoveMarker()});const o=n.commands.get("mention");return r.bind("isEnabled").to(o),r}_handleFeedResponse(e){const{feed:n,marker:i}=e;if(!bE(this.editor))return;this._items.clear();for(const o of n){const s=typeof o!="object"?{id:o,text:o}:o;this._items.add({item:s,marker:i})}const r=this.editor.model.markers.get("mention");this._items.length?this._showOrUpdateUI(r):this._hideUIAndRemoveMarker()}_showOrUpdateUI(e){this._isUIVisible?this._balloon.updatePosition(this._getBalloonPanelPositionData(e,this._mentionsView.position)):this._balloon.add({view:this._mentionsView,position:this._getBalloonPanelPositionData(e,this._mentionsView.position),singleViewMode:!0,balloonClassName:"ck-mention-balloon"}),this._mentionsView.position=this._balloon.view.position,this._mentionsView.selectFirst()}_hideUIAndRemoveMarker(){this._balloon.hasView(this._mentionsView)&&this._balloon.remove(this._mentionsView),bE(this.editor)&&this.editor.model.change(e=>e.removeMarker("mention")),this._mentionsView.position=void 0}_renderItem(e,n){const i=this.editor;let r,o=e.id;const s=this._getItemRenderer(n);if(s){const a=s(e);typeof a!="string"?r=new l7e(i.locale,a):o=a}if(!r){const a=new wt(i.locale);a.label=o,a.withText=!0,r=a}return r}_getBalloonPanelPositionData(e,n){const i=this.editor,r=i.editing,o=r.view.domConverter,s=r.mapper,a=i.locale.uiLanguageDirection;return{target:()=>{let l=e.getRange();l.start.root.rootName=="$graveyard"&&(l=i.model.document.selection.getFirstRange());const u=s.toViewRange(l);return Wt.getDomRangeRects(o.viewRangeToDom(u)).pop()},limiter:()=>{const l=this.editor.editing.view,c=l.document.selection.editableElement;return c?l.domConverter.mapViewToDom(c.root):null},positions:h7e(n,a)}}}function h7e(t,e){const n={caret_se:i=>({top:i.bottom+_y,left:i.right,name:"caret_se",config:{withArrow:!1}}),caret_ne:(i,r)=>({top:i.top-r.height-_y,left:i.right,name:"caret_ne",config:{withArrow:!1}}),caret_sw:(i,r)=>({top:i.bottom+_y,left:i.right-r.width,name:"caret_sw",config:{withArrow:!1}}),caret_nw:(i,r)=>({top:i.top-r.height-_y,left:i.right-r.width,name:"caret_nw",config:{withArrow:!1}})};return Object.prototype.hasOwnProperty.call(n,t)?[n[t]]:e!=="rtl"?[n.caret_se,n.caret_sw,n.caret_ne,n.caret_nw]:[n.caret_sw,n.caret_se,n.caret_nw,n.caret_ne]}function KX(t,e){let n;for(const i of t){const r=e.lastIndexOf(i.marker);r>0&&!e.substring(r-1).match(i.pattern)||(!n||r>=n.position)&&(n={marker:i.marker,position:r,minimumCharacters:i.minimumCharacters,pattern:i.pattern})}return n}function GX(t,e){const n=e==0?"*":`{${e},}`,i=vt.features.isRegExpUnicodePropertySupported?`\\p{Ps}\\p{Pi}"'`:`\\(\\[{"'`,r=".";t=t.replace(/[.*+?^${}()\-|[\]\\]/g,"\\$&");const o=`(?:^|[ ${i}])(${t})(${r}${n})$`;return new RegExp(o,"u")}function m7e(t){return n=>{const i=KX(t,n);if(!i)return!1;let r=0;i.position!==0&&(r=i.position-1);const o=n.substring(r);return i.pattern.test(o)}}function g7e(t,e){let n=0;t.position!==0&&(n=t.position-1);const i=GX(t.marker,0);return e.substring(n).match(i)[2]}function p7e(t){return e=>t.filter(i=>(typeof i=="string"?i:String(i.id)).toLowerCase().includes(e.toLowerCase()))}function v7e(t){const e=t.textNode&&t.textNode.hasAttribute("mention"),n=t.nodeBefore;return e||n&&n.is("$text")&&n.hasAttribute("mention")}function b7e(t){const e=t.nodeAfter;return e&&e.is("$text")&&e.hasAttribute("mention")}function y7e(t){return!!t}function bE(t){return t.model.markers.has("mention")}class w7e extends xe{toMentionAttribute(e,n){return qX(e,n)}static get pluginName(){return"Mention"}static get isOfficialPlugin(){return!0}static get requires(){return[e7e,f7e]}}function _7e(t,e){const n=[];for(const i of e.createRangeIn(t)){const r=i.item;r.is("element","a")&&!r.hasAttribute("href")&&(r.hasAttribute("id")||r.hasAttribute("name"))&&n.push(r)}for(const i of n){const r=i.parent.getChildIndex(i)+1,o=i.getChildren();e.insertChild(r,o,i.parent)}}function YX(t){const e=parseFloat(t);return t.endsWith("pt")?$h(e*96/72):t.endsWith("pc")?$h(e*12*96/72):t.endsWith("in")?$h(e*96):t.endsWith("cm")?$h(e*96/2.54):t.endsWith("mm")?$h(e/10*96/2.54):t}function a6(t){return t!==void 0&&t.endsWith("px")}function $h(t){return Math.round(t)+"px"}function C7e(t,e,n){if(!t.childCount)return;const i=new Pu(t.document),r=k7e(t,i);if(!r.length)return;const o={},s=[];for(const a of r)if(a.indent!==void 0){T7e(a)||(s.length=0);const l=`${a.id}:${a.indent}`,u=Math.min(a.indent-1,s.length);if(us.length-1||s[u].listElement.name!=d.type){u==0&&d.type=="ol"&&a.id!==void 0&&o[l]&&(d.startIndex=o[l]);const f=I7e(d,i,n);if(a6(a.marginLeft)&&(u==0||a6(s[u-1].marginLeft))){let h=a.marginLeft;u>0&&(h=$h(parseFloat(h)-parseFloat(s[u-1].marginLeft))),i.setStyle("padding-left",h,f)}if(s.length==0){const h=a.element.parent,m=h.getChildIndex(a.element)+1;i.insertChild(m,f,h)}else{const h=s[u-1].listItemElements;i.appendChild(f,h[h.length-1])}s[u]={...a,listElement:f,listItemElements:[]},u==0&&a.id!==void 0&&(o[l]=d.startIndex||1)}}const c=a.element.name=="li"?a.element:i.createElement("li");i.appendChild(c,s[u].listElement),s[u].listItemElements.push(c),u==0&&a.id!==void 0&&o[l]++,a.element!=c&&i.appendChild(a.element,c),M7e(a.element,i),i.removeStyle("text-indent",a.element),i.removeStyle("margin-left",a.element)}else{const l=s.find(u=>u.marginLeft==a.marginLeft);if(l){const u=l.listItemElements;i.appendChild(a.element,u[u.length-1]),i.removeStyle("margin-left",a.element)}else s.length=0}}function S7e(t,e){for(const n of e.createRangeIn(t)){const i=n.item;if(i.is("element","li")){const r=i.getChild(0);r&&r.is("element","p")&&e.unwrapElement(r)}}}function k7e(t,e){const n=e.createRangeIn(t),i=[],r=new Set;for(const o of n.getItems()){if(!o.is("element")||!o.name.match(/^(p|h\d+|li|div)$/))continue;let s=O7e(o);if(s!==void 0&&parseFloat(s)==0&&!Array.from(o.getClassNames()).find(a=>a.startsWith("MsoList"))&&(s=void 0),o.hasStyle("mso-list")&&o.getStyle("mso-list")!=="none"||s!==void 0&&r.has(s)){const a=R7e(o);i.push({element:o,id:a.id,order:a.order,indent:a.indent,marginLeft:s}),s!==void 0&&r.add(s)}else r.clear()}return i}function T7e(t){const e=t.element.previousSibling;if(!e){const n=t.element.parent;return yE(n)&&(!n.previousSibling||yE(n.previousSibling))}return yE(e)}function yE(t){return t.is("element","ol")||t.is("element","ul")}function E7e(t,e){const n=new RegExp(`@list l${t.id}:level${t.indent}\\s*({[^}]*)`,"gi"),i=/mso-level-number-format:([^;]{0,100});/gi,r=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,o=new RegExp(`@list\\s+l${t.id}:level\\d\\s*{[^{]*mso-level-text:"%\\d\\\\.`,"gi"),s=new RegExp(`@list l${t.id}:level\\d\\s*{[^{]*mso-level-number-format:`,"gi"),a=o.exec(e),l=s.exec(e),u=a&&!l,c=n.exec(e);let d="decimal",f="ol",h=null;if(c&&c[1]){const m=i.exec(c[1]);if(m&&m[1]&&(d=m[1].trim(),f=d!=="bullet"&&d!=="image"?"ol":"ul"),d==="bullet"){const g=x7e(t.element);g&&(d=g)}else{const g=r.exec(c[1]);g&&g[1]&&(h=parseInt(g[1]))}u&&(f="ol")}return{type:f,startIndex:h,style:P7e(d),isLegalStyleList:u}}function x7e(t){if(t.name=="li"&&t.parent.name=="ul"&&t.parent.hasAttribute("type"))return t.parent.getAttribute("type");const e=A7e(t);if(!e)return null;const n=e._data;return n==="o"?"circle":n==="·"?"disc":n==="§"?"square":null}function A7e(t){if(t.getChild(0).is("$text"))return null;for(const e of t.getChildren()){if(!e.is("element","span"))continue;const n=e.getChild(0);if(n)return n.is("$text")?n:n.getChild(0)}return null}function P7e(t){if(t.startsWith("arabic-leading-zero"))return"decimal-leading-zero";switch(t){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 t;default:return null}}function I7e(t,e,n){const i=e.createElement(t.type);return t.style&&e.setStyle("list-style-type",t.style,i),t.startIndex&&t.startIndex>1&&e.setAttribute("start",t.startIndex,i),t.isLegalStyleList&&n&&e.addClass("legal-list",i),i}function R7e(t){const e=t.getStyle("mso-list");if(e===void 0)return{};const n=e.match(/(^|\s{1,100})l(\d+)/i),i=e.match(/\s{0,100}lfo(\d+)/i),r=e.match(/\s{0,100}level(\d+)/i);return n&&i&&r?{id:n[2],order:i[1],indent:parseInt(r[1])}:{indent:1}}function M7e(t,e){const n=new pl({name:"span",styles:{"mso-list":"Ignore"}}),i=e.createRangeIn(t);for(const r of i)r.type==="elementStart"&&n.match(r.item)&&e.remove(r.item)}function O7e(t){const e=t.getStyle("margin-left");return e===void 0||e.endsWith("px")?e:YX(e)}function L7e(t,e){if(!t.childCount)return;const n=new Pu(t.document),i=N7e(t,n);B7e(i,t,n),F7e(i,t,n),V7e(t,n);const r=$7e(t,n);r.length&&H7e(r,z7e(e),n)}function D7e(t){return btoa(t.match(/\w{2}/g).map(e=>String.fromCharCode(parseInt(e,16))).join(""))}function N7e(t,e){const n=e.createRangeIn(t),i=new pl({name:/v:(.+)/}),r=[];for(const o of n){if(o.type!="elementStart")continue;const s=o.item,a=s.previousSibling,l=a&&a.is("element")?a.name:null,u=["Chart"],c=i.match(s),d=s.getAttribute("o:gfxdata"),f=l==="v:shapetype",h=d&&u.some(m=>s.getAttribute("id").includes(m));c&&d&&!f&&!h&&r.push(o.item.getAttribute("id"))}return r}function B7e(t,e,n){const i=n.createRangeIn(e),r=new pl({name:"img"}),o=[];for(const s of i)if(s.item.is("element")&&r.match(s.item)){const a=s.item,l=a.getAttribute("v:shapes")?a.getAttribute("v:shapes").split(" "):[];l.length&&l.every(u=>t.indexOf(u)>-1)?o.push(a):a.getAttribute("src")||o.push(a)}for(const s of o)n.remove(s)}function V7e(t,e){const n=e.createRangeIn(t),i=new pl({name:/v:(.+)/}),r=[];for(const o of n)o.type=="elementStart"&&i.match(o.item)&&r.push(o.item);for(const o of r)e.remove(o)}function F7e(t,e,n){const i=n.createRangeIn(e),r=[];for(const a of i)if(a.type=="elementStart"&&a.item.is("element","v:shape")){const l=a.item.getAttribute("id");if(t.includes(l))continue;o(a.item.parent.getChildren(),l)||r.push(a.item)}for(const a of r){const l={src:s(a)};a.hasAttribute("alt")&&(l.alt=a.getAttribute("alt"));const u=n.createElement("img",l);n.insertChild(a.index+1,u,a.parent)}function o(a,l){for(const u of a){if(u.is("element")&&(u.name=="img"&&u.getAttribute("v:shapes")==l||o(u.getChildren(),l)))return!0}return!1}function s(a){for(const l of a.getChildren()){if(l.is("element")&&l.getAttribute("src"))return l.getAttribute("src")}}}function $7e(t,e){const n=e.createRangeIn(t),i=new pl({name:"img"}),r=[];let o=0;for(const s of n)s.item.is("element")&&i.match(s.item)&&(s.item.getAttribute("src").startsWith("file://")&&r.push({element:s.item,imageIndex:o}),o++);return r}function z7e(t){if(!t)return[];const e=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,n=new RegExp("(?:("+e.source+"))([\\da-fA-F\\s]+)\\}","g"),i=t.match(n),r=[];if(i)for(const o of i){let s=!1;o.includes("\\pngblip")?s="image/png":o.includes("\\jpegblip")&&(s="image/jpeg"),s&&r.push({hex:o.replace(e,"").replace(/[^\da-fA-F]/g,""),type:s})}return r}function H7e(t,e,n){for(let i=0;i!r.hasStyle(`border-${a}-style`)))e.setStyle("border-style","none",r);else for(const a of o)r.hasStyle(`border-${a}-style`)||e.setStyle(`border-${a}-style`,"none",r);const s=["width","height",...o.map(a=>`border-${a}-width`),...o.map(a=>`padding-${a}`)];for(const a of s)r.hasStyle(a)&&e.setStyle(a,YX(r.getStyle(a)),r)}}function XX(t,e){for(const n of e.createRangeIn(t).getItems())n.is("element","table")&&(n.getStyle("width")==="0px"&&e.removeStyle("width",n),n.getAttribute("width")==="0"&&e.removeAttribute("width",n))}function q7e(t,e){const n=new Map,i=new Map;let r=null;for(const{item:s}of e.createRangeIn(t))if(s.is("element")){if(s.getStyle("mso-element")==="footnote-list"){r=s;continue}if(s.hasStyle("mso-footnote-id")){const a=s.findAncestor("element",l=>l.getStyle("mso-element")==="footnote");if(a){const l=a.getAttribute("id");i.set(l,a)}else{const l=s.getStyle("mso-footnote-id");n.set(l,s)}continue}}if(!n.size||!r)return;const o=K7e(e);e.replace(r,o);for(const[s,a]of n){const l=i.get(s);if(!l)continue;e.replace(a,G7e(e,s));const u=Y7e(e,s);j7e(e,l);for(const c of l.getChildren()){let d=c;c.is("element")&&(d=e.clone(c,!0)),e.appendChild(d,u.content)}e.appendChild(u.listItem,o)}}function j7e(t,e){const n=[],i=[];for(const{item:r}of t.createRangeIn(e))if(r.is("element")&&r.getStyle("mso-footnote-id")){n.unshift(r);const{nextSibling:o}=r;o?.is("$text")&&o.data.startsWith(" ")&&i.unshift(o)}for(const r of n)t.remove(r);for(const r of i){const o=r.data.substring(1);if(o.length>0){const s=r.parent,a=s.getChildIndex(r),l=t.createText(o);t.remove(r),t.insertChild(a,l,s)}else t.remove(r)}return e}function K7e(t){return t.createElement("ol",{class:"footnotes"})}function G7e(t,e){const n=t.createElement("sup",{class:"footnote"}),i=t.createElement("a",{id:`ref-${e}`,href:`#${e}`});return t.appendChild(i,n),n}function Y7e(t,e){const n=t.createElement("li",{id:e,class:"footnote-definition"}),i=t.createElement("a",{href:`#ref-${e}`,class:"footnote-backlink"}),r=t.createElement("div",{class:"footnote-content"});return t.appendChild(t.createText("^"),i),t.appendChild(i,n),t.appendChild(r,n),{listItem:n,content:r}}const X7e=//i,J7e=/xmlns:o="urn:schemas-microsoft-com/i;class Z7e{document;hasMultiLevelListPlugin;hasTablePropertiesPlugin;hasExtendedTableBlockAlignment;constructor(e,n=!1,i=!1,r=!1){this.document=e,this.hasMultiLevelListPlugin=n,this.hasTablePropertiesPlugin=i,this.hasExtendedTableBlockAlignment=r}isActive(e){return X7e.test(e)||J7e.test(e)}execute(e){const n=new Pu(this.document),{body:i,stylesString:r}=e._parsedData;_7e(i,n),C7e(i,r,this.hasMultiLevelListPlugin),L7e(i,e.dataTransfer.getData("text/rtf")),W7e(i,n,this.hasTablePropertiesPlugin,this.hasExtendedTableBlockAlignment),XX(i,n),q7e(i,n),U7e(i),e.content=i}}function Q7e(t,e){for(const n of t.getChildren())if(n.is("element","b")&&n.getStyle("font-weight")==="normal"){const i=t.getChildIndex(n);e.remove(n),e.insertChild(i,n.getChildren(),t)}}function e9e(t,e){const n=new mS(e.document.stylesProcessor),i=new pS(n,{renderingMode:"data"}),r=i.blockElements,o=i.inlineObjectElements,s=[];for(const a of e.createRangeIn(t)){const l=a.item;if(l.is("element","br")){const u=l6(l,"forward",e,{blockElements:r,inlineObjectElements:o}),c=l6(l,"backward",e,{blockElements:r,inlineObjectElements:o}),d=u6(u,r);(u6(c,r)||d)&&s.push(l)}}for(const a of s)a.hasClass("Apple-interchange-newline")?e.remove(a):e.replace(a,e.createElement("p"))}function l6(t,e,n,{blockElements:i,inlineObjectElements:r}){let o=n.createPositionAt(t,e=="forward"?"after":"before");return o=o.getLastMatchingPosition(({item:s})=>s.is("element")&&!i.includes(s.name)&&!r.includes(s.name),{direction:e}),e=="forward"?o.nodeAfter:o.nodeBefore}function u6(t,e){return!!t&&t.is("element")&&e.includes(t.name)}function t9e(t,e,n){const i=new Set;for(const r of e.createRangeIn(t).getItems())!r.is("view:$textProxy")||!r.data.includes(" ")||n9e(r.parent)&&i.add(r.textNode);for(const r of i)i9e(r,e,n)}function n9e(t){let e=t;for(;e;){if(e.is("element")&&e.getStyle?.("white-space")==="pre-wrap")return!0;e=e.parent}return!1}function i9e(t,e,n){const{parent:i,data:r}=t,o=r.replaceAll(" "," ".repeat(n)),s=i.getChildIndex(t);e.remove(t),e.insertChild(s,e.createText(o),i)}const r9e=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class o9e{document;constructor(e){this.document=e}isActive(e){return r9e.test(e)}execute(e){const n=new Pu(this.document),{body:i}=e._parsedData;Q7e(i,n),S7e(i,n),e9e(i,n),t9e(i,n,8),e.content=i}}function s9e(t,e){for(const n of t.getChildren())n.is("element","table")&&n.hasAttribute("xmlns")&&e.removeAttribute("xmlns",n)}function a9e(t,e){for(const n of t.getChildren())if(n.is("element","google-sheets-html-origin")){const i=t.getChildIndex(n);e.remove(n),e.insertChild(i,n.getChildren(),t)}}function l9e(t,e){for(const n of Array.from(t.getChildren()))n.is("element","style")&&e.remove(n)}const u9e=/[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<\/span>/g,"").replace(/()[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g," <\/o:p>/g," ").replace(/( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)<")}function f9e(t){t.querySelectorAll("span[style*=spacerun]").forEach(e=>{const n=e,i=n.innerText.length||0;n.innerText=Array(i+1).join("  ").substr(0,i)})}function c6(t){return t.replace(/(\s+)<\/span>/g,(e,n)=>n.length===1?" ":Array(n.length+1).join("  ").substr(0,n.length))}function h9e(t,e){const n=new DOMParser;t=t.replace(/