mc-plus 1.0.91 → 1.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/index.js +74 -78
- package/dist/es/mc-checkbox-fUrJ11Pn.js +27 -0
- package/dist/es/mc-checkbox-group-DE7LdKhc.js +17 -0
- package/dist/es/mc-form-DSnSPFEV.js +125 -0
- package/dist/es/mc-form-item-x7MVIw2A.js +107 -0
- package/dist/es/{mc-input-qt44a-BA.js → mc-input-Dji1TCLK.js} +2 -2
- package/dist/es/{mc-input-group-BVInIbfD.js → mc-input-group-C412QZF6.js} +1 -1
- package/dist/es/mc-lightbox-LuAm7sTR.js +27 -0
- package/dist/es/mc-otp-zlicIS5X.js +72 -0
- package/dist/es/mc-radio-group-CH90E56Q.js +14 -0
- package/dist/es/{mc-radio-BvJudWMS.js → mc-radio-oKtW62nH.js} +2 -2
- package/dist/es/{mc-richtext-cCvk3_YC.js → mc-richtext-NegVG4QT.js} +3 -3
- package/dist/es/{mc-select-tQeJEpzP.js → mc-select-CCjPA3Fm.js} +1 -1
- package/dist/es/{mc-select-group-Ssi6Fqxg.js → mc-select-group-BjbSnZ2v.js} +1 -1
- package/dist/es/{mc-select-group-plus--I98oCQp.js → mc-select-group-plus-DGd4HEjo.js} +1 -1
- package/dist/es/{mc-select-multi-option-C88bpVmy.js → mc-select-multi-option-D4woh8WX.js} +1 -1
- package/dist/es/{mc-select-option-CC72eawi.js → mc-select-option-BauwRp9j.js} +2 -2
- package/dist/es/{mc-select-option-plus-C8tF0LmF.js → mc-select-option-plus-DpMjFIC4.js} +2 -2
- package/dist/es/{mc-select-plus-CuCSyBFq.js → mc-select-plus-CiTDNs_C.js} +5 -5
- package/dist/es/{mc-switch-lTGTJv17.js → mc-switch-BdCQPDDk.js} +8 -8
- package/dist/es/{mc-tab-DG4Xp3K-.js → mc-tab-RML3Io4K.js} +19 -19
- package/dist/es/{mc-table-B2e9bH-x.js → mc-table-Klsieon4.js} +1 -1
- package/dist/es/{mc-table-plus-Byf8E_rc.js → mc-table-plus-BpZYuZwB.js} +24 -24
- package/dist/es/mc-textarea-D-fL5RMY.js +18 -0
- package/dist/es/theme/mc-checkbox.css +1 -1
- package/dist/es/theme/mc-form-item.css +1 -1
- package/dist/es/theme/mc-lightbox.css +1 -1
- package/dist/index.css +1 -1
- package/dist/types/components.d.ts +0 -1
- package/dist/types/mc-checkbox/types.d.ts +2 -1
- package/dist/types/mc-checkbox-group/types.d.ts +5 -2
- package/dist/types/mc-form/index.d.ts +29 -8
- package/dist/types/mc-form/mc-form.vue.d.ts +10 -2
- package/dist/types/mc-form/types.d.ts +8 -2
- package/dist/types/mc-form-item/types.d.ts +1 -1
- package/dist/types/mc-otp/types.d.ts +2 -0
- package/dist/types/mc-radio-group/types.d.ts +2 -0
- package/dist/types/mc-switch/types.d.ts +2 -0
- package/dist/types/mc-textarea/types.d.ts +2 -0
- package/dist/types/mc-upload/index.d.ts +3 -3
- package/dist/types/mc-upload/mc-upload.vue.d.ts +1 -1
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.css.gz +0 -0
- package/dist/umd/index.umd.cjs +59 -59
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/package.json +1 -1
- package/dist/es/mc-checkbox-BbtQA-ct.js +0 -27
- package/dist/es/mc-checkbox-group-DYUFk58Z.js +0 -17
- package/dist/es/mc-form-CzrT7EJQ.js +0 -119
- package/dist/es/mc-form-item-DB5P_tJG.js +0 -105
- package/dist/es/mc-lightbox-CHPAlSAZ.js +0 -25
- package/dist/es/mc-otp-oPzld7i2.js +0 -72
- package/dist/es/mc-radio-group-Cu_zrby6.js +0 -14
- package/dist/es/mc-step-v2-DOizPA9I.js +0 -76
- package/dist/es/mc-textarea-DIfCDzeM.js +0 -18
- package/dist/es/theme/mc-step-v2.css +0 -1
- package/dist/types/mc-step-v2/constant.d.ts +0 -4
- package/dist/types/mc-step-v2/index.d.ts +0 -109
- package/dist/types/mc-step-v2/mc-step-child-item-v2.vue.d.ts +0 -20
- package/dist/types/mc-step-v2/mc-step-item-v2.vue.d.ts +0 -31
- package/dist/types/mc-step-v2/mc-step-v2.vue.d.ts +0 -30
- package/dist/types/mc-step-v2/types.d.ts +0 -41
package/dist/umd/index.umd.cjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
(function(B,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):r((B=typeof globalThis<"u"?globalThis:B||self).McPlus={},B.Vue)})(this,function(B,r){"use strict";var
|
|
2
|
-
/* [wrapped with `+
|
|
3
|
-
`)}(o,function(s,i){return ya(Ly,function(a){var l="_."+a[0];i&a[1]&&!ba(s,l)&&s.push(l)}),s.sort()}(function(s){var i=s.match(Ay);return i?i[1].split(Vy):[]}(o),n)))}function Yd(t,e,n,o,s,i,a,l,c,d){var u=8&e;e|=u?32:64,4&(e&=~(u?64:32))||(e&=-4);var p=[t,e,s,u?i:void 0,u?a:void 0,u?void 0:i,u?void 0:a,l,c,d],h=n.apply(void 0,p);return function(f){var m=function(k){for(var y=k.name+"",b=Hd[y],x=Ty.call(Hd,y)?b.length:0;x--;){var w=b[x],C=w.func;if(C==null||C==k)return w.name}return y}(f),g=bs[m];if(typeof g!="function"||!(m in To.prototype))return!1;if(f===g)return!0;var v=Fd(g);return!!v&&f===v[0]}(t)&&qd(h,p),h.placeholder=o,Jd(h,t,e)}function wa(t){return t.placeholder}var zy=/^(?:0|[1-9]\d*)$/;function xs(t,e){var n=typeof t;return!!(e=e??9007199254740991)&&(n=="number"||n!="symbol"&&zy.test(t))&&t>-1&&t%1==0&&t<e}var $y=Math.min,Xd="__lodash_placeholder__";function fr(t,e){for(var n=-1,o=t.length,s=0,i=[];++n<o;){var a=t[n];a!==e&&a!==Xd||(t[n]=Xd,i[s++]=n)}return i}function xa(t,e,n,o,s,i,a,l,c,d){var u=128&e,p=1&e,h=2&e,f=24&e,m=512&e,g=h?void 0:hr(t);return function v(){for(var k=arguments.length,y=Array(k),b=k;b--;)y[b]=arguments[b];if(f)var x=wa(v),w=function(M,N){for(var T=M.length,R=0;T--;)M[T]===N&&++R;return R}(y,x);if(o&&(y=$d(y,o,s,f)),i&&(y=Pd(y,i,a,f)),k-=w,f&&k<d){var C=fr(y,x);return Yd(t,e,xa,v.placeholder,n,y,C,l,c,d-k)}var S=p?n:this,E=h?S[t]:t;return k=y.length,l?y=function(M,N){for(var T=M.length,R=$y(N.length,T),z=Wd(M);R--;){var _=N[R];M[R]=xs(_,T)?z[_]:void 0}return M}(y,l):m&&k>1&&y.reverse(),u&&c<k&&(y.length=c),this&&this!==ot&&this instanceof v&&(E=g||hr(E)),E.apply(S,y)}}var Zd="__lodash_placeholder__",Py=Math.min,Qd=Math.max;function eu(t,e,n){e=="__proto__"&&ws?ws(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Cs(t,e){return t===e||t!=t&&e!=e}var jy=Object.prototype.hasOwnProperty;function Ca(t,e,n){var o=t[e];jy.call(t,e)&&Cs(o,n)&&(n!==void 0||e in t)||eu(t,e,n)}var tu=Math.max;function Sa(t,e){return Ud(function(n,o,s){return o=tu(o===void 0?n.length-1:o,0),function(){for(var i=arguments,a=-1,l=tu(i.length-o,0),c=Array(l);++a<l;)c[a]=i[o+a];a=-1;for(var d=Array(o+1);++a<o;)d[a]=i[a];return d[o]=s(c),ga(n,this,d)}}(t,e,Bo),t+"")}function Ea(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=9007199254740991}function Kt(t){return t!=null&&Ea(t.length)&&!Ve(t)}var Fy=Object.prototype;function Ss(t){var e=t&&t.constructor;return t===(typeof e=="function"&&e.prototype||Fy)}function nu(t){return wt(t)&&on(t)=="[object Arguments]"}var ou=Object.prototype,Hy=ou.hasOwnProperty,Wy=ou.propertyIsEnumerable,Es=nu(function(){return arguments}())?nu:function(t){return wt(t)&&Hy.call(t,"callee")&&!Wy.call(t,"callee")},ru=typeof B=="object"&&B&&!B.nodeType&&B,su=ru&&typeof module=="object"&&module&&!module.nodeType&&module,iu=su&&su.exports===ru?ot.Buffer:void 0,mr=(iu?iu.isBuffer:void 0)||function(){return!1},Te={};function Ms(t){return function(e){return t(e)}}Te["[object Float32Array]"]=Te["[object Float64Array]"]=Te["[object Int8Array]"]=Te["[object Int16Array]"]=Te["[object Int32Array]"]=Te["[object Uint8Array]"]=Te["[object Uint8ClampedArray]"]=Te["[object Uint16Array]"]=Te["[object Uint32Array]"]=!0,Te["[object Arguments]"]=Te["[object Array]"]=Te["[object ArrayBuffer]"]=Te["[object Boolean]"]=Te["[object DataView]"]=Te["[object Date]"]=Te["[object Error]"]=Te["[object Function]"]=Te["[object Map]"]=Te["[object Number]"]=Te["[object Object]"]=Te["[object RegExp]"]=Te["[object Set]"]=Te["[object String]"]=Te["[object WeakMap]"]=!1;var au=typeof B=="object"&&B&&!B.nodeType&&B,gr=au&&typeof module=="object"&&module&&!module.nodeType&&module,Ma=gr&&gr.exports===au&&Jn.process,_o=function(){try{return gr&&gr.require&&gr.require("util").types||Ma&&Ma.binding&&Ma.binding("util")}catch{}}(),lu=_o&&_o.isTypedArray,Na=lu?Ms(lu):function(t){return wt(t)&&Ea(t.length)&&!!Te[on(t)]},Ky=Object.prototype.hasOwnProperty;function cu(t,e){return function(n){return t(e(n))}}var qy=cu(Object.keys,Object),Uy=Object.prototype.hasOwnProperty;function Ba(t){if(!Ss(t))return qy(t);var e=[];for(var n in Object(t))Uy.call(t,n)&&n!="constructor"&&e.push(n);return e}function Sn(t){return Kt(t)?function(e){var n=de(e),o=!n&&Es(e),s=!n&&!o&&mr(e),i=!n&&!o&&!s&&Na(e),a=n||o||s||i,l=a?function(u,p){for(var h=-1,f=Array(u);++h<u;)f[h]=p(h);return f}(e.length,String):[],c=l.length;for(var d in e)!Ky.call(e,d)||a&&(d=="length"||s&&(d=="offset"||d=="parent")||i&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||xs(d,c))||l.push(d);return l}(t):Ba(t)}var Ta,Gy=Object.prototype.hasOwnProperty,Jy=(Ta=function(t,e){if(Ss(e)||Kt(e))(function(o,s,i){var a=!i;i||(i={});for(var l=-1,c=s.length;++l<c;){var d=s[l],u=void 0;u===void 0&&(u=o[d]),a?eu(i,d,u):Ca(i,d,u)}})(e,Sn(e),t);else for(var n in e)Gy.call(e,n)&&Ca(t,n,e[n])},Sa(function(t,e){var n=-1,o=e.length,s=o>1?e[o-1]:void 0,i=o>2?e[2]:void 0;for(s=Ta.length>3&&typeof s=="function"?(o--,s):void 0,i&&function(l,c,d){if(!Tt(d))return!1;var u=typeof c;return!!(u=="number"?Kt(d)&&xs(c,d.length):u=="string"&&c in d)&&Cs(d[c],l)}(e[0],e[1],i)&&(s=o<3?void 0:s,o=1),t=Object(t);++n<o;){var a=e[n];a&&Ta(t,a)}return t})),Yy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xy=/^\w*$/;function Oa(t,e){if(de(t))return!1;var n=typeof t;return!(n!="number"&&n!="symbol"&&n!="boolean"&&t!=null&&!Mo(t))||Xy.test(t)||!Yy.test(t)||e!=null&&t in Object(e)}var vr=Zn(Object,"create"),Zy=Object.prototype.hasOwnProperty,Qy=Object.prototype.hasOwnProperty;function Qn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function Ns(t,e){for(var n=t.length;n--;)if(Cs(t[n][0],e))return n;return-1}Qn.prototype.clear=function(){this.__data__=vr?vr(null):{},this.size=0},Qn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Qn.prototype.get=function(t){var e=this.__data__;if(vr){var n=e[t];return n==="__lodash_hash_undefined__"?void 0:n}return Zy.call(e,t)?e[t]:void 0},Qn.prototype.has=function(t){var e=this.__data__;return vr?e[t]!==void 0:Qy.call(e,t)},Qn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=vr&&e===void 0?"__lodash_hash_undefined__":e,this};var ek=Array.prototype.splice;function rn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}rn.prototype.clear=function(){this.__data__=[],this.size=0},rn.prototype.delete=function(t){var e=this.__data__,n=Ns(e,t);return!(n<0||(n==e.length-1?e.pop():ek.call(e,n,1),--this.size,0))},rn.prototype.get=function(t){var e=this.__data__,n=Ns(e,t);return n<0?void 0:e[n][1]},rn.prototype.has=function(t){return Ns(this.__data__,t)>-1},rn.prototype.set=function(t,e){var n=this.__data__,o=Ns(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};var yr=Zn(ot,"Map");function Bs(t,e){var n=t.__data__;return function(o){var s=typeof o;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?o!=="__proto__":o===null}(e)?n[typeof e=="string"?"string":"hash"]:n.map}function sn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function _a(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var n=function(){var o=arguments,s=e?e.apply(this,o):o[0],i=n.cache;if(i.has(s))return i.get(s);var a=t.apply(this,o);return n.cache=i.set(s,a)||i,a};return n.cache=new(_a.Cache||sn),n}sn.prototype.clear=function(){this.size=0,this.__data__={hash:new Qn,map:new(yr||rn),string:new Qn}},sn.prototype.delete=function(t){var e=Bs(this,t).delete(t);return this.size-=e?1:0,e},sn.prototype.get=function(t){return Bs(this,t).get(t)},sn.prototype.has=function(t){return Bs(this,t).has(t)},sn.prototype.set=function(t,e){var n=Bs(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this},_a.Cache=sn;var du,Aa,Va,tk=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nk=/\\(\\)?/g,ok=(du=function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(tk,function(n,o,s,i){e.push(s?i.replace(nk,"$1"):o||n)}),e},Aa=_a(du,function(t){return Va.size===500&&Va.clear(),t}),Va=Aa.cache,Aa);function qt(t){return t==null?"":gs(t)}function uu(t,e){return de(t)?t:Oa(t,e)?[t]:ok(qt(t))}function Ts(t){if(typeof t=="string"||Mo(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Ia(t,e){for(var n=0,o=(e=uu(e,t)).length;t!=null&&n<o;)t=t[Ts(e[n++])];return n&&n==o?t:void 0}function Ao(t,e,n){var o=t==null?void 0:Ia(t,e);return o===void 0?n:o}function pu(t,e){for(var n=-1,o=e.length,s=t.length;++n<o;)t[s+n]=e[n];return t}var hu=Bt?Bt.isConcatSpreadable:void 0;function rk(t){return de(t)||Es(t)||!!(hu&&t&&t[hu])}var sk=cu(Object.getPrototypeOf,Object),Os=Sa(function(t,e,n){var o=1;if(n.length){var s=fr(n,wa(Os));o|=32}return function(i,a,l,c,d,u,p,h){var f=2&a;if(!f&&typeof i!="function")throw new TypeError("Expected a function");var m=c?c.length:0;if(m||(a&=-97,c=d=void 0),p=p===void 0?p:Qd(Yn(p),0),h=h===void 0?h:Yn(h),m-=d?d.length:0,64&a){var g=c,v=d;c=d=void 0}var k=f?void 0:Fd(i),y=[i,a,l,c,d,g,v,void 0,p,h];if(k&&function(x,w){var C=x[1],S=w[1],E=C|S,M=E<131,N=S==128&&C==8||S==128&&C==256&&x[7].length<=w[8]||S==384&&w[7].length<=w[8]&&C==8;if(!M&&!N)return x;1&S&&(x[2]=w[2],E|=1&C?0:4);var T=w[3];if(T){var R=x[3];x[3]=R?$d(R,T,w[4]):T,x[4]=R?fr(x[3],Zd):w[4]}(T=w[5])&&(R=x[5],x[5]=R?Pd(R,T,w[6]):T,x[6]=R?fr(x[5],Zd):w[6]),(T=w[7])&&(x[7]=T),128&S&&(x[8]=x[8]==null?w[8]:Py(x[8],w[8])),x[9]==null&&(x[9]=w[9]),x[0]=w[0],x[1]=E}(y,k),i=y[0],a=y[1],l=y[2],c=y[3],d=y[4],!(h=y[9]=y[9]===void 0?f?0:i.length:Qd(y[9]-m,0))&&24&a&&(a&=-25),a&&a!=1)b=a==8||a==16?function(x,w,C){var S=hr(x);return function E(){for(var M=arguments.length,N=Array(M),T=M,R=wa(E);T--;)N[T]=arguments[T];var z=M<3&&N[0]!==R&&N[M-1]!==R?[]:fr(N,R);return(M-=z.length)<C?Yd(x,w,xa,E.placeholder,void 0,N,z,void 0,void 0,C-M):ga(this&&this!==ot&&this instanceof E?S:x,this,N)}}(i,a,h):a!=32&&a!=33||d.length?xa.apply(void 0,y):function(x,w,C,S){var E=1&w,M=hr(x);return function N(){for(var T=-1,R=arguments.length,z=-1,_=S.length,I=Array(_+R),O=this&&this!==ot&&this instanceof N?M:x;++z<_;)I[z]=S[z];for(;R--;)I[z++]=arguments[++T];return ga(O,E?C:this,I)}}(i,a,l,c);else var b=function(x,w,C){var S=1&w,E=hr(x);return function M(){return(this&&this!==ot&&this instanceof M?E:x).apply(S?C:this,arguments)}}(i,a,l);return Jd((k?Ld:qd)(b,y),i,a)}(t,o,e,n,s)});Os.placeholder={};var ik=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function fu(t,e,n,o){var s=-1,i=t==null?0:t.length;for(o&&i&&(n=t[++s]);++s<i;)n=e(n,t[s],s,t);return n}var Da,ak=(Da={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},function(t){return Da==null?void 0:Da[t]}),lk=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ck=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),dk=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,uk=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,mu="\\ud800-\\udfff",gu="\\u2700-\\u27bf",vu="a-z\\xdf-\\xf6\\xf8-\\xff",yu="A-Z\\xc0-\\xd6\\xd8-\\xde",ku="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bu="["+ku+"]",wu="\\d+",pk="["+gu+"]",xu="["+vu+"]",Cu="[^"+mu+ku+wu+gu+vu+yu+"]",Su="(?:\\ud83c[\\udde6-\\uddff]){2}",Eu="[\\ud800-\\udbff][\\udc00-\\udfff]",Vo="["+yu+"]",Mu="(?:"+xu+"|"+Cu+")",hk="(?:"+Vo+"|"+Cu+")",Nu="(?:['’](?:d|ll|m|re|s|t|ve))?",Bu="(?:['’](?:D|LL|M|RE|S|T|VE))?",Tu="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Ou="[\\ufe0e\\ufe0f]?",fk=Ou+Tu+"(?:\\u200d(?:"+["[^"+mu+"]",Su,Eu].join("|")+")"+Ou+Tu+")*",mk="(?:"+[pk,Su,Eu].join("|")+")"+fk,gk=RegExp([Vo+"?"+xu+"+"+Nu+"(?="+[bu,Vo,"$"].join("|")+")",hk+"+"+Bu+"(?="+[bu,Vo+Mu,"$"].join("|")+")",Vo+"?"+Mu+"+"+Nu,Vo+"+"+Bu,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",wu,mk].join("|"),"g"),vk=RegExp("['’]","g"),yk=ot.isFinite,kk=Math.min;function _u(t){var e=Math[t];return function(n,o){if(n=vs(n),(o=o==null?0:kk(Yn(o),292))&&yk(n)){var s=(qt(n)+"e").split("e");return+((s=(qt(e(s[0]+"e"+(+s[1]+o)))+"e").split("e"))[0]+"e"+(+s[1]-o))}return e(n)}}var Au=_u("ceil");function Vu(t,e,n){return t==t&&(n!==void 0&&(t=t<=n?t:n),t=t>=e?t:e),t}function Ut(t){var e=this.__data__=new rn(t);this.size=e.size}Ut.prototype.clear=function(){this.__data__=new rn,this.size=0},Ut.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Ut.prototype.get=function(t){return this.__data__.get(t)},Ut.prototype.has=function(t){return this.__data__.has(t)},Ut.prototype.set=function(t,e){var n=this.__data__;if(n instanceof rn){var o=n.__data__;if(!yr||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new sn(o)}return n.set(t,e),this.size=n.size,this};var Iu=typeof B=="object"&&B&&!B.nodeType&&B,Du=Iu&&typeof module=="object"&&module&&!module.nodeType&&module,Ru=Du&&Du.exports===Iu?ot.Buffer:void 0;function Lu(t,e){for(var n=-1,o=t==null?0:t.length,s=0,i=[];++n<o;){var a=t[n];e(a,n,t)&&(i[s++]=a)}return i}Ru&&Ru.allocUnsafe;var bk=Object.prototype.propertyIsEnumerable,zu=Object.getOwnPropertySymbols,wk=zu?function(t){return t==null?[]:(t=Object(t),Lu(zu(t),function(e){return bk.call(t,e)}))}:function(){return[]};function Ra(t){return function(e,n,o){var s=n(e);return de(e)?s:pu(s,o(e))}(t,Sn,wk)}var La=Zn(ot,"DataView"),za=Zn(ot,"Promise"),Io=Zn(ot,"Set"),$u="[object Map]",Pu="[object Promise]",ju="[object Set]",Fu="[object WeakMap]",Hu="[object DataView]",xk=Xn(La),Ck=Xn(yr),Sk=Xn(za),Ek=Xn(Io),Mk=Xn(pr),xt=on;(La&&xt(new La(new ArrayBuffer(1)))!=Hu||yr&&xt(new yr)!=$u||za&&xt(za.resolve())!=Pu||Io&&xt(new Io)!=ju||pr&&xt(new pr)!=Fu)&&(xt=function(t){var e=on(t),n=e=="[object Object]"?t.constructor:void 0,o=n?Xn(n):"";if(o)switch(o){case xk:return Hu;case Ck:return $u;case Sk:return Pu;case Ek:return ju;case Mk:return Fu}return e});var Nk=Object.prototype.hasOwnProperty,_s=ot.Uint8Array;function $a(t){var e=new t.constructor(t.byteLength);return new _s(e).set(new _s(t)),e}var Bk=/\w*$/,Wu=Bt?Bt.prototype:void 0,Ku=Wu?Wu.valueOf:void 0,qu=_o&&_o.isMap,Tk=qu?Ms(qu):function(t){return wt(t)&&xt(t)=="[object Map]"},Uu=_o&&_o.isSet,Ok=Uu?Ms(Uu):function(t){return wt(t)&&xt(t)=="[object Set]"},Gu="[object Arguments]",Ju="[object Function]",Yu="[object Object]",Ee={};function As(t,e,n,o,s,i){var a;if(a!==void 0)return a;if(!Tt(t))return t;var l=de(t);if(l)a=function(h){var f=h.length,m=new h.constructor(f);return f&&typeof h[0]=="string"&&Nk.call(h,"index")&&(m.index=h.index,m.input=h.input),m}(t);else{var c=xt(t),d=c==Ju||c=="[object GeneratorFunction]";if(mr(t))return t.slice();if(c==Yu||c==Gu||d&&!s)a=d?{}:function(h){return typeof h.constructor!="function"||Ss(h)?{}:ks(sk(h))}(t);else{if(!Ee[c])return s?t:{};a=function(h,f){var m,g,v,k=h.constructor;switch(f){case"[object ArrayBuffer]":return $a(h);case"[object Boolean]":case"[object Date]":return new k(+h);case"[object DataView]":return v=$a((g=h).buffer),new g.constructor(v,g.byteOffset,g.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(y){var b=$a(y.buffer);return new y.constructor(b,y.byteOffset,y.length)}(h);case"[object Map]":case"[object Set]":return new k;case"[object Number]":case"[object String]":return new k(h);case"[object RegExp]":return function(y){var b=new y.constructor(y.source,Bk.exec(y));return b.lastIndex=y.lastIndex,b}(h);case"[object Symbol]":return m=h,Ku?Object(Ku.call(m)):{}}}(t,c)}}i||(i=new Ut);var u=i.get(t);if(u)return u;i.set(t,a),Ok(t)?t.forEach(function(h){a.add(As(h,e,n,0,t,i))}):Tk(t)&&t.forEach(function(h,f){a.set(f,As(h,e,n,0,t,i))});var p=l?void 0:Ra(t);return ya(p||t,function(h,f){p&&(h=t[f=h]),Ca(a,f,As(h,e,n,0,t,i))}),a}function Do(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new sn;++e<n;)this.add(t[e])}function Xu(t,e){for(var n=-1,o=t==null?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1}function Pa(t,e){return t.has(e)}function Zu(t,e,n,o,s,i){var a=1&n,l=t.length,c=e.length;if(l!=c&&!(a&&c>l))return!1;var d=i.get(t),u=i.get(e);if(d&&u)return d==e&&u==t;var p=-1,h=!0,f=2&n?new Do:void 0;for(i.set(t,e),i.set(e,t);++p<l;){var m=t[p],g=e[p];if(o)var v=a?o(g,m,p,e,t,i):o(m,g,p,t,e,i);if(v!==void 0){if(v)continue;h=!1;break}if(f){if(!Xu(e,function(k,y){if(!Pa(f,y)&&(m===k||s(m,k,n,o,i)))return f.push(y)})){h=!1;break}}else if(m!==g&&!s(m,g,n,o,i)){h=!1;break}}return i.delete(t),i.delete(e),h}function _k(t){var e=-1,n=Array(t.size);return t.forEach(function(o,s){n[++e]=[s,o]}),n}function ja(t){var e=-1,n=Array(t.size);return t.forEach(function(o){n[++e]=o}),n}Ee[Gu]=Ee["[object Array]"]=Ee["[object ArrayBuffer]"]=Ee["[object DataView]"]=Ee["[object Boolean]"]=Ee["[object Date]"]=Ee["[object Float32Array]"]=Ee["[object Float64Array]"]=Ee["[object Int8Array]"]=Ee["[object Int16Array]"]=Ee["[object Int32Array]"]=Ee["[object Map]"]=Ee["[object Number]"]=Ee[Yu]=Ee["[object RegExp]"]=Ee["[object Set]"]=Ee["[object String]"]=Ee["[object Symbol]"]=Ee["[object Uint8Array]"]=Ee["[object Uint8ClampedArray]"]=Ee["[object Uint16Array]"]=Ee["[object Uint32Array]"]=!0,Ee["[object Error]"]=Ee[Ju]=Ee["[object WeakMap]"]=!1,Do.prototype.add=Do.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Do.prototype.has=function(t){return this.__data__.has(t)};var Qu=Bt?Bt.prototype:void 0,Fa=Qu?Qu.valueOf:void 0,Ak=Object.prototype.hasOwnProperty,ep="[object Arguments]",tp="[object Array]",Vs="[object Object]",np=Object.prototype.hasOwnProperty;function Ha(t,e,n,o,s){return t===e||(t==null||e==null||!wt(t)&&!wt(e)?t!=t&&e!=e:function(i,a,l,c,d,u){var p=de(i),h=de(a),f=p?tp:xt(i),m=h?tp:xt(a),g=(f=f==ep?Vs:f)==Vs,v=(m=m==ep?Vs:m)==Vs,k=f==m;if(k&&mr(i)){if(!mr(a))return!1;p=!0,g=!1}if(k&&!g)return u||(u=new Ut),p||Na(i)?Zu(i,a,l,c,d,u):function(C,S,E,M,N,T,R){switch(E){case"[object DataView]":if(C.byteLength!=S.byteLength||C.byteOffset!=S.byteOffset)return!1;C=C.buffer,S=S.buffer;case"[object ArrayBuffer]":return!(C.byteLength!=S.byteLength||!T(new _s(C),new _s(S)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Cs(+C,+S);case"[object Error]":return C.name==S.name&&C.message==S.message;case"[object RegExp]":case"[object String]":return C==S+"";case"[object Map]":var z=_k;case"[object Set]":var _=1&M;if(z||(z=ja),C.size!=S.size&&!_)return!1;var I=R.get(C);if(I)return I==S;M|=2,R.set(C,S);var O=Zu(z(C),z(S),M,N,T,R);return R.delete(C),O;case"[object Symbol]":if(Fa)return Fa.call(C)==Fa.call(S)}return!1}(i,a,f,l,c,d,u);if(!(1&l)){var y=g&&np.call(i,"__wrapped__"),b=v&&np.call(a,"__wrapped__");if(y||b){var x=y?i.value():i,w=b?a.value():a;return u||(u=new Ut),d(x,w,l,c,u)}}return!!k&&(u||(u=new Ut),function(C,S,E,M,N,T){var R=1&E,z=Ra(C),_=z.length;if(_!=Ra(S).length&&!R)return!1;for(var I=_;I--;){var O=z[I];if(!(R?O in S:Ak.call(S,O)))return!1}var V=T.get(C),P=T.get(S);if(V&&P)return V==S&&P==C;var A=!0;T.set(C,S),T.set(S,C);for(var L=R;++I<_;){var j=C[O=z[I]],q=S[O];if(M)var H=R?M(q,j,O,S,C,T):M(j,q,O,C,S,T);if(!(H===void 0?j===q||N(j,q,E,M,T):H)){A=!1;break}L||(L=O=="constructor")}if(A&&!L){var U=C.constructor,Y=S.constructor;U==Y||!("constructor"in C)||!("constructor"in S)||typeof U=="function"&&U instanceof U&&typeof Y=="function"&&Y instanceof Y||(A=!1)}return T.delete(C),T.delete(S),A}(i,a,l,c,d,u))}(t,e,n,o,Ha,s))}function op(t){return t==t&&!Tt(t)}function rp(t,e){return function(n){return n!=null&&n[t]===e&&(e!==void 0||t in Object(n))}}function Vk(t,e){return t!=null&&e in Object(t)}function sp(t,e,n){for(var o=-1,s=(e=uu(e,t)).length,i=!1;++o<s;){var a=Ts(e[o]);if(!(i=t!=null&&n(t,a)))break;t=t[a]}return i||++o!=s?i:!!(s=t==null?0:t.length)&&Ea(s)&&xs(a,s)&&(de(t)||Es(t))}function ip(t){return function(e){return e==null?void 0:e[t]}}function En(t){return typeof t=="function"?t:t==null?Bo:typeof t=="object"?de(t)?(o=t[0],s=t[1],Oa(o)&&op(s)?rp(Ts(o),s):function(i){var a=Ao(i,o);return a===void 0&&a===s?function(l,c){return l!=null&&sp(l,c,Vk)}(i,o):Ha(s,a,3)}):(n=function(i){for(var a=Sn(i),l=a.length;l--;){var c=a[l],d=i[c];a[l]=[c,d,op(d)]}return a}(e=t),n.length==1&&n[0][2]?rp(n[0][0],n[0][1]):function(i){return i===e||function(a,l,c){var d=c.length,u=d;if(a==null)return!u;for(a=Object(a);d--;){var p=c[d];if(p[2]?p[1]!==a[p[0]]:!(p[0]in a))return!1}for(;++d<u;){var h=(p=c[d])[0],f=a[h],m=p[1];if(p[2]){if(f===void 0&&!(h in a))return!1}else if(!Ha(m,f,3,void 0,new Ut))return!1}return!0}(i,0,n)}):function(i){return Oa(i)?ip(Ts(i)):function(a){return function(l){return Ia(l,a)}}(i)}(t);var e,n,o,s}var ap,kr=(ap=function(t,e){return t&&function(n,o,s){for(var i=-1,a=Object(n),l=s(n),c=l.length;c--;){var d=l[++i];if(o(a[d],d,a)===!1)break}return n}(t,e,Sn)},function(t,e){if(t==null)return t;if(!Kt(t))return ap(t,e);for(var n=t.length,o=-1,s=Object(t);++o<n&&e(s[o],o,s)!==!1;);return t}),Wa=function(){return ot.Date.now()},Ik=Math.max,Dk=Math.min;function Is(t,e,n){var o,s,i,a,l,c,d=0,u=!1,p=!1,h=!0;if(typeof t!="function")throw new TypeError("Expected a function");function f(y){var b=o,x=s;return o=s=void 0,d=y,a=t.apply(x,b)}function m(y){var b=y-c;return c===void 0||b>=e||b<0||p&&y-d>=i}function g(){var y=Wa();if(m(y))return v(y);l=setTimeout(g,function(b){var x=e-(b-c);return p?Dk(x,i-(b-d)):x}(y))}function v(y){return l=void 0,h&&o?f(y):(o=s=void 0,a)}function k(){var y=Wa(),b=m(y);if(o=arguments,s=this,c=y,b){if(l===void 0)return function(x){return d=x,l=setTimeout(g,e),u?f(x):a}(c);if(p)return clearTimeout(l),l=setTimeout(g,e),f(c)}return l===void 0&&(l=setTimeout(g,e)),a}return e=vs(e)||0,Tt(n)&&(u=!!n.leading,i=(p="maxWait"in n)?Ik(vs(n.maxWait)||0,e):i,h="trailing"in n?!!n.trailing:h),k.cancel=function(){l!==void 0&&clearTimeout(l),d=0,o=c=s=l=void 0},k.flush=function(){return l===void 0?a:v(Wa())},k}function lp(t){return wt(t)&&Kt(t)}var cp=Sa(function(t,e){return lp(t)?function(n,o){var s=-1,i=ba,a=!0,l=n.length,c=[],d=o.length;if(!l)return c;o.length>=200&&(i=Pa,a=!1,o=new Do(o));e:for(;++s<l;){var u=n[s],p=u;if(u=u!==0?u:0,a&&p==p){for(var h=d;h--;)if(o[h]===p)continue e;c.push(u)}else i(o,p,void 0)||c.push(u)}return c}(t,function(n,o,s,i,a){var l=-1,c=n.length;for(s||(s=rk),a||(a=[]);++l<c;){var d=n[l];s(d)&&pu(a,d)}return a}(e,0,lp)):[]});function Ds(t,e){var n;return(de(t)?ya:kr)(t,typeof(n=e)=="function"?n:Bo)}function Rk(t,e){var n=[];return kr(t,function(o,s,i){e(o,s,i)&&n.push(o)}),n}function br(t,e){return(de(t)?Lu:Rk)(t,En(e))}var Lk=Math.max;function an(t,e,n){var o=t==null?0:t.length;if(!o)return-1;var s=n==null?0:Yn(n);return s<0&&(s=Lk(o+s,0)),Gd(t,En(e),s)}var dp,Ro=(dp=an,function(t,e,n){var o=Object(t);if(!Kt(t)){var s=En(e);t=Sn(t),e=function(a){return s(o[a],a,o)}}var i=dp(t,e,n);return i>-1?o[s?t[i]:i]:void 0});function up(t){return t&&t.length?t[0]:void 0}function pp(t,e){var n=-1,o=Kt(t)?Array(t.length):[];return kr(t,function(s,i,a){o[++n]=e(s,i,a)}),o}function Mn(t,e){return(de(t)?No:pp)(t,En(e))}var Rs=_u("floor"),zk=Object.prototype.hasOwnProperty;function $k(t,e){return t!=null&&zk.call(t,e)}function Pk(t,e){return t!=null&&sp(t,e,$k)}function Lo(t){return typeof t=="string"||!de(t)&&wt(t)&&on(t)=="[object String]"}var jk=Math.max;function gt(t,e,n,o){t=Kt(t)?t:function(i){return i==null?[]:function(a,l){return No(l,function(c){return a[c]})}(i,Sn(i))}(t),n=n?Yn(n):0;var s=t.length;return n<0&&(n=jk(s+n,0)),Lo(t)?n<=s&&t.indexOf(e,n)>-1:!!s&&ka(t,e,n)>-1}function hp(t,e,n){return t!=null&&t.length?ka(t,e,0):-1}function fp(t){return t===!0||t===!1||wt(t)&&on(t)=="[object Boolean]"}var Fk=Object.prototype.hasOwnProperty;function Ct(t){if(t==null)return!0;if(Kt(t)&&(de(t)||typeof t=="string"||typeof t.splice=="function"||mr(t)||Na(t)||Es(t)))return!t.length;var e=xt(t);if(e=="[object Map]"||e=="[object Set]")return!t.size;if(Ss(t))return!Ba(t).length;for(var n in t)if(Fk.call(t,n))return!1;return!0}function Ls(t){return typeof t=="number"||wt(t)&&on(t)=="[object Number]"}function xe(t){return t==null}var mp,gp=(mp=function(t,e,n){return t+(n?" ":"")+e.toLowerCase()},function(t){return fu(function(e){return function(n){return uk.test(n)}(e=qt(e))?function(n){return n.match(gk)||[]}(e):function(n){return n.match(dk)||[]}(e)}(function(e){return(e=qt(e))&&e.replace(lk,ak).replace(ck,"")}(t).replace(vk,"")),mp,"")});function Hk(t,e){if(t!==e){var n=t!==void 0,o=t===null,s=t==t,i=Mo(t),a=e!==void 0,l=e===null,c=e==e,d=Mo(e);if(!l&&!d&&!i&&t>e||i&&a&&c&&!l&&!d||o&&a&&c||!n&&c||!s)return 1;if(!o&&!i&&!d&&t<e||d&&n&&s&&!o&&!i||l&&n&&s||!a&&s||!c)return-1}return 0}var Wk=ip("length"),vp="\\ud800-\\udfff",Kk="["+vp+"]",Ka="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",qa="\\ud83c[\\udffb-\\udfff]",yp="[^"+vp+"]",kp="(?:\\ud83c[\\udde6-\\uddff]){2}",bp="[\\ud800-\\udbff][\\udc00-\\udfff]",wp="(?:"+Ka+"|"+qa+")?",xp="[\\ufe0e\\ufe0f]?",qk=xp+wp+"(?:\\u200d(?:"+[yp,kp,bp].join("|")+")"+xp+wp+")*",Uk="(?:"+[yp+Ka+"?",Ka,kp,bp,Kk].join("|")+")",Cp=RegExp(qa+"(?="+qa+")|"+Uk+qk,"g");function Gk(t,e,n,o,s){return s(t,function(i,a,l){n=o?(o=!1,i):e(n,i,a,l)}),n}function Ua(t){if(t==null)return 0;if(Kt(t))return Lo(t)?function(o){return ik.test(o)}(e=t)?function(o){for(var s=Cp.lastIndex=0;Cp.test(o);)++s;return s}(e):Wk(e):t.length;var e,n=xt(t);return n=="[object Map]"||n=="[object Set]"?t.size:Ba(t).length}function Jk(t,e){var n;return kr(t,function(o,s,i){return!(n=e(o,s,i))}),!!n}function Sp(t,e,n){return(de(t)?Xu:Jk)(t,En(e))}function zo(t,e,n){var o=!0,s=!0;if(typeof t!="function")throw new TypeError("Expected a function");return Tt(n)&&(o="leading"in n?!!n.leading:o,s="trailing"in n?!!n.trailing:s),Is(t,e,{leading:o,maxWait:e,trailing:s})}function Ep(t){return qt(t).toLowerCase()}var Yk=Io&&1/ja(new Io([,-0]))[1]==1/0?function(t){return new Io(t)}:jd;const X=t=>(t.install=e=>{e.component(t.name,t)},t),Ga=(t=0)=>new Promise(e=>setTimeout(e,t)),Ja=t=>`${t}px`,Gt=(t,e)=>{if(Tt(t))return e in t?t[e]:t[e.replace(/-([a-z])/g,(n,o)=>o.toUpperCase())]},Mp="mc-icon",Xk=r.defineComponent({name:Mp,__name:"mc-icon",props:{name:{},size:{default:24},color:{}},emits:["click"],setup(t,{expose:e,emit:n}){const o=n,s=r.ref();return e({ref:s}),(i,a)=>(r.openBlock(),r.createElementBlock("span",{class:"mc-icon",style:r.normalizeStyle({fontSize:`${t.size}px`,width:`${t.size}px`,height:`${t.size}px`,color:t.color})},[r.createElementVNode("i",{ref_key:"_ref",ref:s,class:r.normalizeClass(["mc-iconfont",`mc-icon--${t.name}`]),onClick:a[0]||(a[0]=l=>(c=>{o("click",c)})(l))},null,2)],4))}}),K=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},eo=K(Xk,[["__scopeId","data-v-24abf3b0"]]),ce=X(eo),Np="mc-alert-message",Zk={class:"mc-alert-message-header"},Qk={class:"mc-alert-message-title-container"},eb={key:0,class:"mc-alert-message-icon-group"},tb={class:"mc-alert-message-icon-wrapper"},nb={class:"mc-alert-message-icon-wrapper"},ob={key:0,class:"mc-alert-message-body"},rb=r.defineComponent({name:Np,__name:"mc-alert-message",props:{modelValue:{type:Boolean,default:!0},width:{},height:{},type:{default:"info"},message:{},content:{},closable:{type:Boolean,default:!1},hideIcon:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1}},emits:["click","close","update:modelValue","expand"],setup(t,{expose:e,emit:n}){const o=t,s=n,i=r.ref(),a=r.useSlots(),l=r.computed(()=>o.content||a.content),c=r.computed(()=>p.value||a.icon),d=r.ref(!1),u=r.computed(()=>!o.expandable||d.value),p=r.computed(()=>{if(!o.hideIcon)switch(o.type){case"success":return"Accept_02";case"error":return"Error_04";case"warning":return"Error_02";case"info":return"Info_02";default:return}}),h=()=>{s("update:modelValue",!1),s("close")},f=()=>{s("click"),o.expandable&&(d.value=!d.value,s("expand",d.value))};return e({ref:i,close:h,show:()=>{d.value=!0},hide:()=>{d.value=!1}}),(m,g)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"_ref",ref:i,class:r.normalizeClass(["mc-alert-message",[`mc-alert-message-${t.type}`]]),style:r.normalizeStyle({width:t.width,height:t.height,cursor:t.expandable?"pointer":"default"}),onClick:f},[r.createElementVNode("div",Zk,[r.createElementVNode("div",Qk,[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-alert-message-icon",style:r.normalizeStyle({height:l.value?"30px":"24px"})},[r.renderSlot(m.$slots,"icon",{},()=>[r.createVNode(r.unref(ce),{name:p.value,size:24},null,8,["name"])],!0)],4)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"mc-alert-message-title",style:r.normalizeStyle({fontSize:l.value?"18px":"16px",fontWeight:l.value?"600":"400",lineHeight:l.value?"30px":"24px"})},[r.renderSlot(m.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.message),1)],!0)],4)]),t.closable||t.expandable?(r.openBlock(),r.createElementBlock("div",eb,[r.createElementVNode("div",tb,[t.expandable?(r.openBlock(),r.createBlock(r.unref(ce),{key:0,name:"Down-Chevron",size:24,class:"mc-alert-message-tool-icon mc-alert-message-tool-icon-expand",style:r.normalizeStyle({transform:u.value?"rotate(180deg)":"rotate(0deg)"})},null,8,["style"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",nb,[t.closable?(r.openBlock(),r.createBlock(r.unref(ce),{key:0,name:"Cross",size:24,class:"mc-alert-message-tool-icon mc-alert-message-tool-icon-close",onClick:r.withModifiers(h,["stop"])})):r.createCommentVNode("",!0)])])):r.createCommentVNode("",!0)]),l.value?(r.openBlock(),r.createElementBlock("div",ob,[r.createVNode(r.Transition,{name:"mc-alert-message-content-transition"},{default:r.withCtx(()=>[u.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-alert-message-content",style:r.normalizeStyle({paddingLeft:c.value?"48px":"16px"})},[r.renderSlot(m.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)],6))}}),Bp=X(K(rb,[["__scopeId","data-v-26d43a1b"]])),zs=(t,e,n)=>{r.isRef(t)?r.watch(t,(o,s)=>{s==null||s.removeEventListener(e,n),o==null||o.addEventListener(e,n)}):r.onMounted(()=>t==null?void 0:t.addEventListener(e,n)),r.onBeforeUnmount(()=>{var o;return(o=r.unref(t))==null?void 0:o.removeEventListener(e,n)})},$s=(t,e)=>{zs(document,"click",n=>{if(t.value&&n.target)if(de(t.value)){let o=!0;for(let s=0;s<t.value.length;s++)if(t.value[s].contains(n.target)){o=!1;break}o&&e(n)}else t.value.contains(n.target)||e(n)})},$o=(t,{afterFocus:e,beforeBlur:n,afterBlur:o}={})=>{const s=r.getCurrentInstance(),{emit:i}=s,a=r.ref(),l=r.ref(!1);return zs(a,"click",()=>{var c;(c=t.value)==null||c.focus()}),{wrapperRef:a,isFocused:l,handleFocus:c=>{l.value||(l.value=!0,i("focus",c),e==null||e())},handleBlur:c=>{var d;Ve(n)&&n(c)||c.relatedTarget&&((d=a.value)!=null&&d.contains(c.relatedTarget))||(l.value=!1,i("blur",c),o==null||o())}}};function ke(t){const e=r.getCurrentInstance();if(!e)throw new Error("useProp must be used within a component");return r.computed(()=>{var o;const n=(o=e==null?void 0:e.proxy)==null?void 0:o.$props;if(!de(t))return n==null?void 0:n[t];for(const s of t)if(Pk(n,s))return n==null?void 0:n[s]})}const Ya=(t,e,n=300)=>{const o=new ResizeObserver(zo(a=>{for(let l of a)e(l.contentRect)},n)),s=a=>{o.observe(a)},i=a=>{o.unobserve(a)};return r.onMounted(()=>{t.value&&s(t.value)}),r.onBeforeUnmount(()=>{t.value&&i(t.value)}),r.watch(t,a=>{a&&s(a)}),{resizeObserver:o,observe:s,unobserve:i}},$t=()=>{const t=ke("width"),e=ke("height");return{width:r.computed(()=>typeof t.value=="number"?`${t.value}px`:t.value||void 0),height:r.computed(()=>typeof e.value=="number"?`${e.value}px`:e.value||void 0)}},Tp=t=>{const e=r.ref(!1),n=()=>{e.value=!0},o=()=>{e.value=!1};return r.onMounted(()=>{t.value&&(t.value.addEventListener("mouseenter",n),t.value.addEventListener("mouseleave",o))}),r.onBeforeMount(()=>{t.value&&(t.value.removeEventListener("mouseenter",n),t.value.removeEventListener("mouseleave",o))}),{isHovering:e}},Op="mc-button",sb=["type","disabled"],ib={key:1,class:"loading-icon"},ab={class:"mc-button-text"},lb=r.defineComponent({name:Op,__name:"mc-button",props:{type:{default:"primary"},nativeType:{default:"button"},size:{default:"medium"},disabled:{type:Boolean},loading:{type:Boolean},useThrottle:{type:Boolean,default:!0},throttleDuration:{default:500},leftIcon:{},rightIcon:{},content:{},height:{},width:{}},emits:["click"],setup(t,{expose:e,emit:n}){const o=t,s=n,i=r.ref(),{width:a,height:l}=$t(),c=u=>{o.loading||o.disabled||s("click",u)},d=zo(c,o.throttleDuration,{trailing:!1});return e({ref:i}),(u,p)=>(r.openBlock(),r.createElementBlock("button",{ref_key:"_ref",ref:i,style:r.normalizeStyle({width:r.unref(a),height:r.unref(l)}),class:r.normalizeClass(["mc-button",{[`mc-button--${t.type}`]:t.type,[`mc-button--${t.size}`]:t.size,"is-loading":t.loading,"is-disabled":t.disabled}]),type:t.nativeType,disabled:!(!t.disabled&&!t.loading)||void 0,onClick:p[0]||(p[0]=h=>t.useThrottle?r.unref(d)(h):c(h))},[t.leftIcon&&!t.loading?(r.openBlock(),r.createBlock(r.unref(ce),{key:0,name:t.leftIcon},null,8,["name"])):r.createCommentVNode("",!0),t.loading&&!t.disabled?(r.openBlock(),r.createElementBlock("span",ib,[r.createVNode(r.unref(ce),{name:"Loading",size:16})])):r.createCommentVNode("",!0),r.createElementVNode("div",ab,[r.renderSlot(u.$slots,"default",{},void 0,!0)]),t.rightIcon?(r.openBlock(),r.createBlock(r.unref(ce),{key:2,name:t.rightIcon},null,8,["name"])):r.createCommentVNode("",!0)],14,sb))}}),to=X(K(lb,[["__scopeId","data-v-dfec08a5"]])),Po=Symbol("mc-form-context"),_p="mc-form";function no(){return no=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},no.apply(this,arguments)}function Xa(t){return Xa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xa(t)}function wr(t,e){return wr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},wr(t,e)}function Za(t,e,n){return Za=function(){if(typeof Reflect>"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}}()?Reflect.construct.bind():function(o,s,i){var a=[null];a.push.apply(a,s);var l=new(Function.bind.apply(o,a));return i&&wr(l,i.prototype),l},Za.apply(null,arguments)}function Qa(t){var e=typeof Map=="function"?new Map:void 0;return Qa=function(n){if(n===null||(o=n,Function.toString.call(o).indexOf("[native code]")===-1))return n;var o;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,s)}function s(){return Za(n,arguments,Xa(this).constructor)}return s.prototype=Object.create(n.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),wr(s,n)},Qa(t)}var cb=/%[sdj%]/g,Ap=function(){};function el(t){if(!t||!t.length)return null;var e={};return t.forEach(function(n){var o=n.field;e[o]=e[o]||[],e[o].push(n)}),e}function St(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];var s=0,i=n.length;return typeof t=="function"?t.apply(null,n):typeof t=="string"?t.replace(cb,function(a){if(a==="%%")return"%";if(s>=i)return a;switch(a){case"%s":return String(n[s++]);case"%d":return Number(n[s++]);case"%j":try{return JSON.stringify(n[s++])}catch{return"[Circular]"}break;default:return a}}):t}function Ue(t,e){return t==null||!(e!=="array"||!Array.isArray(t)||t.length)||!(!function(n){return n==="string"||n==="url"||n==="hex"||n==="email"||n==="date"||n==="pattern"}(e)||typeof t!="string"||t)}function Vp(t,e,n){var o=0,s=t.length;(function i(a){if(a&&a.length)n(a);else{var l=o;o+=1,l<s?e(t[l],i):n([])}})([])}typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(Ap=function(t,e){typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&e.every(function(n){return typeof n=="string"})&&console.warn(t,e)});var Ip=function(t){var e,n;function o(s,i){var a;return(a=t.call(this,"Async Validation Error")||this).errors=s,a.fields=i,a}return n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,wr(e,n),o}(Qa(Error));function Dp(t,e){return function(n){var o,s;return o=t.fullFields?function(i,a){for(var l=i,c=0;c<a.length;c++){if(l==null)return l;l=l[a[c]]}return l}(e,t.fullFields):e[n.field||t.fullField],(s=n)&&s.message!==void 0?(n.field=n.field||t.fullField,n.fieldValue=o,n):{message:typeof n=="function"?n():n,fieldValue:o,field:n.field||t.fullField}}}function Rp(t,e){if(e){for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];typeof o=="object"&&typeof t[n]=="object"?t[n]=no({},t[n],o):t[n]=o}}return t}var tl,Lp=function(t,e,n,o,s,i){!t.required||n.hasOwnProperty(t.field)&&!Ue(e,i||t.type)||o.push(St(s.messages.required,t.fullField))},db=/^(([^<>()\[\]\\.,;:\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,}))$/,ub=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,xr={integer:function(t){return xr.number(t)&&parseInt(t,10)===t},float:function(t){return xr.number(t)&&!xr.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return!isNaN(t)&&typeof t=="number"},object:function(t){return typeof t=="object"&&!xr.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(db)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(function(){if(tl)return tl;var e="[a-fA-F\\d:]",n=function(h){return h&&h.includeBoundaries?"(?:(?<=\\s|^)(?="+e+")|(?<="+e+")(?=\\s|$))":""},o="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",s="[a-fA-F\\d]{1,4}",i=(`
|
|
1
|
+
(function(B,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):r((B=typeof globalThis<"u"?globalThis:B||self).McPlus={},B.Vue)})(this,function(B,r){"use strict";var VB=Object.defineProperty;var IB=(B,r,Jn)=>r in B?VB(B,r,{enumerable:!0,configurable:!0,writable:!0,value:Jn}):B[r]=Jn;var Ce=(B,r,Jn)=>IB(B,typeof r!="symbol"?r+"":r,Jn);var Jn=typeof global=="object"&&global&&global.Object===Object&&global,oy=typeof self=="object"&&self&&self.Object===Object&&self,ot=Jn||oy||Function("return this")(),Bt=ot.Symbol,Od=Object.prototype,ry=Od.hasOwnProperty,iy=Od.toString,ur=Bt?Bt.toStringTag:void 0,sy=Object.prototype.toString,_d=Bt?Bt.toStringTag:void 0;function on(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":_d&&_d in Object(t)?function(e){var n=ry.call(e,ur),o=e[ur];try{e[ur]=void 0;var i=!0}catch{}var s=iy.call(e);return i&&(n?e[ur]=o:delete e[ur]),s}(t):function(e){return sy.call(e)}(t)}function wt(t){return t!=null&&typeof t=="object"}function So(t){return typeof t=="symbol"||wt(t)&&on(t)=="[object Symbol]"}function Eo(t,e){for(var n=-1,o=t==null?0:t.length,i=Array(o);++n<o;)i[n]=e(t[n],n,t);return i}var ce=Array.isArray,Ad=Bt?Bt.prototype:void 0,Vd=Ad?Ad.toString:void 0;function mi(t){if(typeof t=="string")return t;if(ce(t))return Eo(t,mi)+"";if(So(t))return Vd?Vd.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var ay=/\s/,ly=/^\s+/;function Tt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var cy=/^[-+]0x[0-9a-f]+$/i,dy=/^0b[01]+$/i,uy=/^0o[0-7]+$/i,py=parseInt;function gi(t){if(typeof t=="number")return t;if(So(t))return NaN;if(Tt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Tt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;var n;t=(n=t)?n.slice(0,function(i){for(var s=i.length;s--&&ay.test(i.charAt(s)););return s}(n)+1).replace(ly,""):n;var o=dy.test(t);return o||uy.test(t)?py(t.slice(2),o?2:8):cy.test(t)?NaN:+t}var hy=1/0;function Gn(t){var e=function(o){return o?(o=gi(o))===hy||o===-1/0?17976931348623157e292*(o<0?-1:1):o==o?o:0:o===0?o:0}(t),n=e%1;return e==e?n?e-n:e:0}function Mo(t){return t}function Ve(t){if(!Tt(t))return!1;var e=on(t);return e=="[object Function]"||e=="[object GeneratorFunction]"||e=="[object AsyncFunction]"||e=="[object Proxy]"}var Id,ma=ot["__core-js_shared__"],Dd=(Id=/[^.]+$/.exec(ma&&ma.keys&&ma.keys.IE_PROTO||""))?"Symbol(src)_1."+Id:"",fy=Function.prototype.toString;function Yn(t){if(t!=null){try{return fy.call(t)}catch{}try{return t+""}catch{}}return""}var my=/^\[object .+?Constructor\]$/,gy=Function.prototype,vy=Object.prototype,yy=gy.toString,by=vy.hasOwnProperty,ky=RegExp("^"+yy.call(by).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Xn(t,e){var n=function(o,i){return o==null?void 0:o[i]}(t,e);return function(o){return!(!Tt(o)||(i=o,Dd&&Dd in i))&&(Ve(o)?ky:my).test(Yn(o));var i}(n)?n:void 0}var pr=Xn(ot,"WeakMap"),vi=pr&&new pr,Rd=vi?function(t,e){return vi.set(t,e),t}:Mo,Ld=Object.create,yi=function(){function t(){}return function(e){if(!Tt(e))return{};if(Ld)return Ld(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function hr(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=yi(t.prototype),o=t.apply(n,e);return Tt(o)?o:n}}function ga(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var wy=Math.max;function zd(t,e,n,o){for(var i=-1,s=t.length,a=n.length,l=-1,c=e.length,d=wy(s-a,0),u=Array(c+d),p=!o;++l<c;)u[l]=e[l];for(;++i<a;)(p||i<s)&&(u[n[i]]=t[i]);for(;d--;)u[l++]=t[i++];return u}var xy=Math.max;function $d(t,e,n,o){for(var i=-1,s=t.length,a=-1,l=n.length,c=-1,d=e.length,u=xy(s-l,0),p=Array(u+d),h=!o;++i<u;)p[i]=t[i];for(var f=i;++c<d;)p[f+c]=e[c];for(;++a<l;)(h||i<s)&&(p[f+n[a]]=t[i++]);return p}function va(){}function No(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Pd(){}No.prototype=yi(va.prototype),No.prototype.constructor=No;var jd=vi?function(t){return vi.get(t)}:Pd,Fd={},Cy=Object.prototype.hasOwnProperty;function Bo(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Hd(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}Bo.prototype=yi(va.prototype),Bo.prototype.constructor=Bo;var Sy=Object.prototype.hasOwnProperty;function bi(t){if(wt(t)&&!ce(t)&&!(t instanceof No)){if(t instanceof Bo)return t;if(Sy.call(t,"__wrapped__"))return function(e){if(e instanceof No)return e.clone();var n=new Bo(e.__wrapped__,e.__chain__);return n.__actions__=Hd(e.__actions__),n.__index__=e.__index__,n.__values__=e.__values__,n}(t)}return new Bo(t)}bi.prototype=va.prototype,bi.prototype.constructor=bi;var Ey=Date.now;function Wd(t){var e=0,n=0;return function(){var o=Ey(),i=16-(o-n);if(n=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Kd=Wd(Rd),My=/\{\n\/\* \[wrapped with (.+)\] \*/,Ny=/,? & /,By=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ki=function(){try{var t=Xn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ty=ki?function(t,e){return ki(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:Mo,Ud=Wd(Ty);function ya(t,e){for(var n=-1,o=t==null?0:t.length;++n<o&&e(t[n],n,t)!==!1;);return t}function qd(t,e,n,o){for(var i=t.length,s=n+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function Oy(t){return t!=t}function ba(t,e,n){return e==e?function(o,i,s){for(var a=s-1,l=o.length;++a<l;)if(o[a]===i)return a;return-1}(t,e,n):qd(t,Oy,n)}function ka(t,e){return!(t==null||!t.length)&&ba(t,e,0)>-1}var _y=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function Jd(t,e,n){var o=e+"";return Ud(t,function(i,s){var a=s.length;if(!a)return i;var l=a-1;return s[l]=(a>1?"& ":"")+s[l],s=s.join(a>2?", ":" "),i.replace(By,`{
|
|
2
|
+
/* [wrapped with `+s+`] */
|
|
3
|
+
`)}(o,function(i,s){return ya(_y,function(a){var l="_."+a[0];s&a[1]&&!ka(i,l)&&i.push(l)}),i.sort()}(function(i){var s=i.match(My);return s?s[1].split(Ny):[]}(o),n)))}function Gd(t,e,n,o,i,s,a,l,c,d){var u=8&e;e|=u?32:64,4&(e&=~(u?64:32))||(e&=-4);var p=[t,e,i,u?s:void 0,u?a:void 0,u?void 0:s,u?void 0:a,l,c,d],h=n.apply(void 0,p);return function(f){var m=function(b){for(var y=b.name+"",k=Fd[y],x=Cy.call(Fd,y)?k.length:0;x--;){var w=k[x],S=w.func;if(S==null||S==b)return w.name}return y}(f),g=bi[m];if(typeof g!="function"||!(m in No.prototype))return!1;if(f===g)return!0;var v=jd(g);return!!v&&f===v[0]}(t)&&Kd(h,p),h.placeholder=o,Jd(h,t,e)}function wa(t){return t.placeholder}var Ay=/^(?:0|[1-9]\d*)$/;function wi(t,e){var n=typeof t;return!!(e=e??9007199254740991)&&(n=="number"||n!="symbol"&&Ay.test(t))&&t>-1&&t%1==0&&t<e}var Vy=Math.min,Yd="__lodash_placeholder__";function fr(t,e){for(var n=-1,o=t.length,i=0,s=[];++n<o;){var a=t[n];a!==e&&a!==Yd||(t[n]=Yd,s[i++]=n)}return s}function xa(t,e,n,o,i,s,a,l,c,d){var u=128&e,p=1&e,h=2&e,f=24&e,m=512&e,g=h?void 0:hr(t);return function v(){for(var b=arguments.length,y=Array(b),k=b;k--;)y[k]=arguments[k];if(f)var x=wa(v),w=function(M,N){for(var T=M.length,R=0;T--;)M[T]===N&&++R;return R}(y,x);if(o&&(y=zd(y,o,i,f)),s&&(y=$d(y,s,a,f)),b-=w,f&&b<d){var S=fr(y,x);return Gd(t,e,xa,v.placeholder,n,y,S,l,c,d-b)}var C=p?n:this,E=h?C[t]:t;return b=y.length,l?y=function(M,N){for(var T=M.length,R=Vy(N.length,T),z=Hd(M);R--;){var _=N[R];M[R]=wi(_,T)?z[_]:void 0}return M}(y,l):m&&b>1&&y.reverse(),u&&c<b&&(y.length=c),this&&this!==ot&&this instanceof v&&(E=g||hr(E)),E.apply(C,y)}}var Xd="__lodash_placeholder__",Iy=Math.min,Zd=Math.max;function Qd(t,e,n){e=="__proto__"&&ki?ki(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function xi(t,e){return t===e||t!=t&&e!=e}var Dy=Object.prototype.hasOwnProperty;function Ca(t,e,n){var o=t[e];Dy.call(t,e)&&xi(o,n)&&(n!==void 0||e in t)||Qd(t,e,n)}var eu=Math.max;function Sa(t,e){return Ud(function(n,o,i){return o=eu(o===void 0?n.length-1:o,0),function(){for(var s=arguments,a=-1,l=eu(s.length-o,0),c=Array(l);++a<l;)c[a]=s[o+a];a=-1;for(var d=Array(o+1);++a<o;)d[a]=s[a];return d[o]=i(c),ga(n,this,d)}}(t,e,Mo),t+"")}function Ea(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=9007199254740991}function Kt(t){return t!=null&&Ea(t.length)&&!Ve(t)}var Ry=Object.prototype;function Ci(t){var e=t&&t.constructor;return t===(typeof e=="function"&&e.prototype||Ry)}function tu(t){return wt(t)&&on(t)=="[object Arguments]"}var nu=Object.prototype,Ly=nu.hasOwnProperty,zy=nu.propertyIsEnumerable,Si=tu(function(){return arguments}())?tu:function(t){return wt(t)&&Ly.call(t,"callee")&&!zy.call(t,"callee")},ou=typeof B=="object"&&B&&!B.nodeType&&B,ru=ou&&typeof module=="object"&&module&&!module.nodeType&&module,iu=ru&&ru.exports===ou?ot.Buffer:void 0,mr=(iu?iu.isBuffer:void 0)||function(){return!1},Te={};function Ei(t){return function(e){return t(e)}}Te["[object Float32Array]"]=Te["[object Float64Array]"]=Te["[object Int8Array]"]=Te["[object Int16Array]"]=Te["[object Int32Array]"]=Te["[object Uint8Array]"]=Te["[object Uint8ClampedArray]"]=Te["[object Uint16Array]"]=Te["[object Uint32Array]"]=!0,Te["[object Arguments]"]=Te["[object Array]"]=Te["[object ArrayBuffer]"]=Te["[object Boolean]"]=Te["[object DataView]"]=Te["[object Date]"]=Te["[object Error]"]=Te["[object Function]"]=Te["[object Map]"]=Te["[object Number]"]=Te["[object Object]"]=Te["[object RegExp]"]=Te["[object Set]"]=Te["[object String]"]=Te["[object WeakMap]"]=!1;var su=typeof B=="object"&&B&&!B.nodeType&&B,gr=su&&typeof module=="object"&&module&&!module.nodeType&&module,Ma=gr&&gr.exports===su&&Jn.process,To=function(){try{return gr&&gr.require&&gr.require("util").types||Ma&&Ma.binding&&Ma.binding("util")}catch{}}(),au=To&&To.isTypedArray,Na=au?Ei(au):function(t){return wt(t)&&Ea(t.length)&&!!Te[on(t)]},$y=Object.prototype.hasOwnProperty;function lu(t,e){return function(n){return t(e(n))}}var Py=lu(Object.keys,Object),jy=Object.prototype.hasOwnProperty;function Ba(t){if(!Ci(t))return Py(t);var e=[];for(var n in Object(t))jy.call(t,n)&&n!="constructor"&&e.push(n);return e}function Cn(t){return Kt(t)?function(e){var n=ce(e),o=!n&&Si(e),i=!n&&!o&&mr(e),s=!n&&!o&&!i&&Na(e),a=n||o||i||s,l=a?function(u,p){for(var h=-1,f=Array(u);++h<u;)f[h]=p(h);return f}(e.length,String):[],c=l.length;for(var d in e)!$y.call(e,d)||a&&(d=="length"||i&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||wi(d,c))||l.push(d);return l}(t):Ba(t)}var Ta,Fy=Object.prototype.hasOwnProperty,Hy=(Ta=function(t,e){if(Ci(e)||Kt(e))(function(o,i,s){var a=!s;s||(s={});for(var l=-1,c=i.length;++l<c;){var d=i[l],u=void 0;u===void 0&&(u=o[d]),a?Qd(s,d,u):Ca(s,d,u)}})(e,Cn(e),t);else for(var n in e)Fy.call(e,n)&&Ca(t,n,e[n])},Sa(function(t,e){var n=-1,o=e.length,i=o>1?e[o-1]:void 0,s=o>2?e[2]:void 0;for(i=Ta.length>3&&typeof i=="function"?(o--,i):void 0,s&&function(l,c,d){if(!Tt(d))return!1;var u=typeof c;return!!(u=="number"?Kt(d)&&wi(c,d.length):u=="string"&&c in d)&&xi(d[c],l)}(e[0],e[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var a=e[n];a&&Ta(t,a)}return t})),Wy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ky=/^\w*$/;function Oa(t,e){if(ce(t))return!1;var n=typeof t;return!(n!="number"&&n!="symbol"&&n!="boolean"&&t!=null&&!So(t))||Ky.test(t)||!Wy.test(t)||e!=null&&t in Object(e)}var vr=Xn(Object,"create"),Uy=Object.prototype.hasOwnProperty,qy=Object.prototype.hasOwnProperty;function Zn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function Mi(t,e){for(var n=t.length;n--;)if(xi(t[n][0],e))return n;return-1}Zn.prototype.clear=function(){this.__data__=vr?vr(null):{},this.size=0},Zn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Zn.prototype.get=function(t){var e=this.__data__;if(vr){var n=e[t];return n==="__lodash_hash_undefined__"?void 0:n}return Uy.call(e,t)?e[t]:void 0},Zn.prototype.has=function(t){var e=this.__data__;return vr?e[t]!==void 0:qy.call(e,t)},Zn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=vr&&e===void 0?"__lodash_hash_undefined__":e,this};var Jy=Array.prototype.splice;function rn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}rn.prototype.clear=function(){this.__data__=[],this.size=0},rn.prototype.delete=function(t){var e=this.__data__,n=Mi(e,t);return!(n<0||(n==e.length-1?e.pop():Jy.call(e,n,1),--this.size,0))},rn.prototype.get=function(t){var e=this.__data__,n=Mi(e,t);return n<0?void 0:e[n][1]},rn.prototype.has=function(t){return Mi(this.__data__,t)>-1},rn.prototype.set=function(t,e){var n=this.__data__,o=Mi(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};var yr=Xn(ot,"Map");function Ni(t,e){var n=t.__data__;return function(o){var i=typeof o;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?o!=="__proto__":o===null}(e)?n[typeof e=="string"?"string":"hash"]:n.map}function sn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function _a(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var n=function(){var o=arguments,i=e?e.apply(this,o):o[0],s=n.cache;if(s.has(i))return s.get(i);var a=t.apply(this,o);return n.cache=s.set(i,a)||s,a};return n.cache=new(_a.Cache||sn),n}sn.prototype.clear=function(){this.size=0,this.__data__={hash:new Zn,map:new(yr||rn),string:new Zn}},sn.prototype.delete=function(t){var e=Ni(this,t).delete(t);return this.size-=e?1:0,e},sn.prototype.get=function(t){return Ni(this,t).get(t)},sn.prototype.has=function(t){return Ni(this,t).has(t)},sn.prototype.set=function(t,e){var n=Ni(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this},_a.Cache=sn;var cu,Aa,Va,Gy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yy=/\\(\\)?/g,Xy=(cu=function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Gy,function(n,o,i,s){e.push(i?s.replace(Yy,"$1"):o||n)}),e},Aa=_a(cu,function(t){return Va.size===500&&Va.clear(),t}),Va=Aa.cache,Aa);function Ut(t){return t==null?"":mi(t)}function du(t,e){return ce(t)?t:Oa(t,e)?[t]:Xy(Ut(t))}function Bi(t){if(typeof t=="string"||So(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Ia(t,e){for(var n=0,o=(e=du(e,t)).length;t!=null&&n<o;)t=t[Bi(e[n++])];return n&&n==o?t:void 0}function Oo(t,e,n){var o=t==null?void 0:Ia(t,e);return o===void 0?n:o}function uu(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t}var pu=Bt?Bt.isConcatSpreadable:void 0;function Zy(t){return ce(t)||Si(t)||!!(pu&&t&&t[pu])}var Qy=lu(Object.getPrototypeOf,Object),Ti=Sa(function(t,e,n){var o=1;if(n.length){var i=fr(n,wa(Ti));o|=32}return function(s,a,l,c,d,u,p,h){var f=2&a;if(!f&&typeof s!="function")throw new TypeError("Expected a function");var m=c?c.length:0;if(m||(a&=-97,c=d=void 0),p=p===void 0?p:Zd(Gn(p),0),h=h===void 0?h:Gn(h),m-=d?d.length:0,64&a){var g=c,v=d;c=d=void 0}var b=f?void 0:jd(s),y=[s,a,l,c,d,g,v,void 0,p,h];if(b&&function(x,w){var S=x[1],C=w[1],E=S|C,M=E<131,N=C==128&&S==8||C==128&&S==256&&x[7].length<=w[8]||C==384&&w[7].length<=w[8]&&S==8;if(!M&&!N)return x;1&C&&(x[2]=w[2],E|=1&S?0:4);var T=w[3];if(T){var R=x[3];x[3]=R?zd(R,T,w[4]):T,x[4]=R?fr(x[3],Xd):w[4]}(T=w[5])&&(R=x[5],x[5]=R?$d(R,T,w[6]):T,x[6]=R?fr(x[5],Xd):w[6]),(T=w[7])&&(x[7]=T),128&C&&(x[8]=x[8]==null?w[8]:Iy(x[8],w[8])),x[9]==null&&(x[9]=w[9]),x[0]=w[0],x[1]=E}(y,b),s=y[0],a=y[1],l=y[2],c=y[3],d=y[4],!(h=y[9]=y[9]===void 0?f?0:s.length:Zd(y[9]-m,0))&&24&a&&(a&=-25),a&&a!=1)k=a==8||a==16?function(x,w,S){var C=hr(x);return function E(){for(var M=arguments.length,N=Array(M),T=M,R=wa(E);T--;)N[T]=arguments[T];var z=M<3&&N[0]!==R&&N[M-1]!==R?[]:fr(N,R);return(M-=z.length)<S?Gd(x,w,xa,E.placeholder,void 0,N,z,void 0,void 0,S-M):ga(this&&this!==ot&&this instanceof E?C:x,this,N)}}(s,a,h):a!=32&&a!=33||d.length?xa.apply(void 0,y):function(x,w,S,C){var E=1&w,M=hr(x);return function N(){for(var T=-1,R=arguments.length,z=-1,_=C.length,I=Array(_+R),O=this&&this!==ot&&this instanceof N?M:x;++z<_;)I[z]=C[z];for(;R--;)I[z++]=arguments[++T];return ga(O,E?S:this,I)}}(s,a,l,c);else var k=function(x,w,S){var C=1&w,E=hr(x);return function M(){return(this&&this!==ot&&this instanceof M?E:x).apply(C?S:this,arguments)}}(s,a,l);return Jd((b?Rd:Kd)(k,y),s,a)}(t,o,e,n,i)});Ti.placeholder={};var eb=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function hu(t,e,n,o){var i=-1,s=t==null?0:t.length;for(o&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}var Da,tb=(Da={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},function(t){return Da==null?void 0:Da[t]}),nb=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ob=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),rb=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ib=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,fu="\\ud800-\\udfff",mu="\\u2700-\\u27bf",gu="a-z\\xdf-\\xf6\\xf8-\\xff",vu="A-Z\\xc0-\\xd6\\xd8-\\xde",yu="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bu="["+yu+"]",ku="\\d+",sb="["+mu+"]",wu="["+gu+"]",xu="[^"+fu+yu+ku+mu+gu+vu+"]",Cu="(?:\\ud83c[\\udde6-\\uddff]){2}",Su="[\\ud800-\\udbff][\\udc00-\\udfff]",_o="["+vu+"]",Eu="(?:"+wu+"|"+xu+")",ab="(?:"+_o+"|"+xu+")",Mu="(?:['’](?:d|ll|m|re|s|t|ve))?",Nu="(?:['’](?:D|LL|M|RE|S|T|VE))?",Bu="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Tu="[\\ufe0e\\ufe0f]?",lb=Tu+Bu+"(?:\\u200d(?:"+["[^"+fu+"]",Cu,Su].join("|")+")"+Tu+Bu+")*",cb="(?:"+[sb,Cu,Su].join("|")+")"+lb,db=RegExp([_o+"?"+wu+"+"+Mu+"(?="+[bu,_o,"$"].join("|")+")",ab+"+"+Nu+"(?="+[bu,_o+Eu,"$"].join("|")+")",_o+"?"+Eu+"+"+Mu,_o+"+"+Nu,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ku,cb].join("|"),"g"),ub=RegExp("['’]","g"),pb=ot.isFinite,hb=Math.min;function Ou(t){var e=Math[t];return function(n,o){if(n=gi(n),(o=o==null?0:hb(Gn(o),292))&&pb(n)){var i=(Ut(n)+"e").split("e");return+((i=(Ut(e(i[0]+"e"+(+i[1]+o)))+"e").split("e"))[0]+"e"+(+i[1]-o))}return e(n)}}var _u=Ou("ceil");function Au(t,e,n){return t==t&&(n!==void 0&&(t=t<=n?t:n),t=t>=e?t:e),t}function qt(t){var e=this.__data__=new rn(t);this.size=e.size}qt.prototype.clear=function(){this.__data__=new rn,this.size=0},qt.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},qt.prototype.get=function(t){return this.__data__.get(t)},qt.prototype.has=function(t){return this.__data__.has(t)},qt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof rn){var o=n.__data__;if(!yr||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new sn(o)}return n.set(t,e),this.size=n.size,this};var Vu=typeof B=="object"&&B&&!B.nodeType&&B,Iu=Vu&&typeof module=="object"&&module&&!module.nodeType&&module,Du=Iu&&Iu.exports===Vu?ot.Buffer:void 0;function Ru(t,e){for(var n=-1,o=t==null?0:t.length,i=0,s=[];++n<o;){var a=t[n];e(a,n,t)&&(s[i++]=a)}return s}Du&&Du.allocUnsafe;var fb=Object.prototype.propertyIsEnumerable,Lu=Object.getOwnPropertySymbols,mb=Lu?function(t){return t==null?[]:(t=Object(t),Ru(Lu(t),function(e){return fb.call(t,e)}))}:function(){return[]};function Ra(t){return function(e,n,o){var i=n(e);return ce(e)?i:uu(i,o(e))}(t,Cn,mb)}var La=Xn(ot,"DataView"),za=Xn(ot,"Promise"),Ao=Xn(ot,"Set"),zu="[object Map]",$u="[object Promise]",Pu="[object Set]",ju="[object WeakMap]",Fu="[object DataView]",gb=Yn(La),vb=Yn(yr),yb=Yn(za),bb=Yn(Ao),kb=Yn(pr),xt=on;(La&&xt(new La(new ArrayBuffer(1)))!=Fu||yr&&xt(new yr)!=zu||za&&xt(za.resolve())!=$u||Ao&&xt(new Ao)!=Pu||pr&&xt(new pr)!=ju)&&(xt=function(t){var e=on(t),n=e=="[object Object]"?t.constructor:void 0,o=n?Yn(n):"";if(o)switch(o){case gb:return Fu;case vb:return zu;case yb:return $u;case bb:return Pu;case kb:return ju}return e});var wb=Object.prototype.hasOwnProperty,Oi=ot.Uint8Array;function $a(t){var e=new t.constructor(t.byteLength);return new Oi(e).set(new Oi(t)),e}var xb=/\w*$/,Hu=Bt?Bt.prototype:void 0,Wu=Hu?Hu.valueOf:void 0,Ku=To&&To.isMap,Cb=Ku?Ei(Ku):function(t){return wt(t)&&xt(t)=="[object Map]"},Uu=To&&To.isSet,Sb=Uu?Ei(Uu):function(t){return wt(t)&&xt(t)=="[object Set]"},qu="[object Arguments]",Ju="[object Function]",Gu="[object Object]",Se={};function _i(t,e,n,o,i,s){var a;if(a!==void 0)return a;if(!Tt(t))return t;var l=ce(t);if(l)a=function(h){var f=h.length,m=new h.constructor(f);return f&&typeof h[0]=="string"&&wb.call(h,"index")&&(m.index=h.index,m.input=h.input),m}(t);else{var c=xt(t),d=c==Ju||c=="[object GeneratorFunction]";if(mr(t))return t.slice();if(c==Gu||c==qu||d&&!i)a=d?{}:function(h){return typeof h.constructor!="function"||Ci(h)?{}:yi(Qy(h))}(t);else{if(!Se[c])return i?t:{};a=function(h,f){var m,g,v,b=h.constructor;switch(f){case"[object ArrayBuffer]":return $a(h);case"[object Boolean]":case"[object Date]":return new b(+h);case"[object DataView]":return v=$a((g=h).buffer),new g.constructor(v,g.byteOffset,g.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(y){var k=$a(y.buffer);return new y.constructor(k,y.byteOffset,y.length)}(h);case"[object Map]":case"[object Set]":return new b;case"[object Number]":case"[object String]":return new b(h);case"[object RegExp]":return function(y){var k=new y.constructor(y.source,xb.exec(y));return k.lastIndex=y.lastIndex,k}(h);case"[object Symbol]":return m=h,Wu?Object(Wu.call(m)):{}}}(t,c)}}s||(s=new qt);var u=s.get(t);if(u)return u;s.set(t,a),Sb(t)?t.forEach(function(h){a.add(_i(h,e,n,0,t,s))}):Cb(t)&&t.forEach(function(h,f){a.set(f,_i(h,e,n,0,t,s))});var p=l?void 0:Ra(t);return ya(p||t,function(h,f){p&&(h=t[f=h]),Ca(a,f,_i(h,e,n,0,t,s))}),a}function Vo(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new sn;++e<n;)this.add(t[e])}function Yu(t,e){for(var n=-1,o=t==null?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1}function Pa(t,e){return t.has(e)}function Xu(t,e,n,o,i,s){var a=1&n,l=t.length,c=e.length;if(l!=c&&!(a&&c>l))return!1;var d=s.get(t),u=s.get(e);if(d&&u)return d==e&&u==t;var p=-1,h=!0,f=2&n?new Vo:void 0;for(s.set(t,e),s.set(e,t);++p<l;){var m=t[p],g=e[p];if(o)var v=a?o(g,m,p,e,t,s):o(m,g,p,t,e,s);if(v!==void 0){if(v)continue;h=!1;break}if(f){if(!Yu(e,function(b,y){if(!Pa(f,y)&&(m===b||i(m,b,n,o,s)))return f.push(y)})){h=!1;break}}else if(m!==g&&!i(m,g,n,o,s)){h=!1;break}}return s.delete(t),s.delete(e),h}function Eb(t){var e=-1,n=Array(t.size);return t.forEach(function(o,i){n[++e]=[i,o]}),n}function ja(t){var e=-1,n=Array(t.size);return t.forEach(function(o){n[++e]=o}),n}Se[qu]=Se["[object Array]"]=Se["[object ArrayBuffer]"]=Se["[object DataView]"]=Se["[object Boolean]"]=Se["[object Date]"]=Se["[object Float32Array]"]=Se["[object Float64Array]"]=Se["[object Int8Array]"]=Se["[object Int16Array]"]=Se["[object Int32Array]"]=Se["[object Map]"]=Se["[object Number]"]=Se[Gu]=Se["[object RegExp]"]=Se["[object Set]"]=Se["[object String]"]=Se["[object Symbol]"]=Se["[object Uint8Array]"]=Se["[object Uint8ClampedArray]"]=Se["[object Uint16Array]"]=Se["[object Uint32Array]"]=!0,Se["[object Error]"]=Se[Ju]=Se["[object WeakMap]"]=!1,Vo.prototype.add=Vo.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Vo.prototype.has=function(t){return this.__data__.has(t)};var Zu=Bt?Bt.prototype:void 0,Fa=Zu?Zu.valueOf:void 0,Mb=Object.prototype.hasOwnProperty,Qu="[object Arguments]",ep="[object Array]",Ai="[object Object]",tp=Object.prototype.hasOwnProperty;function Ha(t,e,n,o,i){return t===e||(t==null||e==null||!wt(t)&&!wt(e)?t!=t&&e!=e:function(s,a,l,c,d,u){var p=ce(s),h=ce(a),f=p?ep:xt(s),m=h?ep:xt(a),g=(f=f==Qu?Ai:f)==Ai,v=(m=m==Qu?Ai:m)==Ai,b=f==m;if(b&&mr(s)){if(!mr(a))return!1;p=!0,g=!1}if(b&&!g)return u||(u=new qt),p||Na(s)?Xu(s,a,l,c,d,u):function(S,C,E,M,N,T,R){switch(E){case"[object DataView]":if(S.byteLength!=C.byteLength||S.byteOffset!=C.byteOffset)return!1;S=S.buffer,C=C.buffer;case"[object ArrayBuffer]":return!(S.byteLength!=C.byteLength||!T(new Oi(S),new Oi(C)));case"[object Boolean]":case"[object Date]":case"[object Number]":return xi(+S,+C);case"[object Error]":return S.name==C.name&&S.message==C.message;case"[object RegExp]":case"[object String]":return S==C+"";case"[object Map]":var z=Eb;case"[object Set]":var _=1&M;if(z||(z=ja),S.size!=C.size&&!_)return!1;var I=R.get(S);if(I)return I==C;M|=2,R.set(S,C);var O=Xu(z(S),z(C),M,N,T,R);return R.delete(S),O;case"[object Symbol]":if(Fa)return Fa.call(S)==Fa.call(C)}return!1}(s,a,f,l,c,d,u);if(!(1&l)){var y=g&&tp.call(s,"__wrapped__"),k=v&&tp.call(a,"__wrapped__");if(y||k){var x=y?s.value():s,w=k?a.value():a;return u||(u=new qt),d(x,w,l,c,u)}}return!!b&&(u||(u=new qt),function(S,C,E,M,N,T){var R=1&E,z=Ra(S),_=z.length;if(_!=Ra(C).length&&!R)return!1;for(var I=_;I--;){var O=z[I];if(!(R?O in C:Mb.call(C,O)))return!1}var V=T.get(S),P=T.get(C);if(V&&P)return V==C&&P==S;var A=!0;T.set(S,C),T.set(C,S);for(var L=R;++I<_;){var j=S[O=z[I]],K=C[O];if(M)var H=R?M(K,j,O,C,S,T):M(j,K,O,S,C,T);if(!(H===void 0?j===K||N(j,K,E,M,T):H)){A=!1;break}L||(L=O=="constructor")}if(A&&!L){var q=S.constructor,Y=C.constructor;q==Y||!("constructor"in S)||!("constructor"in C)||typeof q=="function"&&q instanceof q&&typeof Y=="function"&&Y instanceof Y||(A=!1)}return T.delete(S),T.delete(C),A}(s,a,l,c,d,u))}(t,e,n,o,Ha,i))}function np(t){return t==t&&!Tt(t)}function op(t,e){return function(n){return n!=null&&n[t]===e&&(e!==void 0||t in Object(n))}}function Nb(t,e){return t!=null&&e in Object(t)}function rp(t,e,n){for(var o=-1,i=(e=du(e,t)).length,s=!1;++o<i;){var a=Bi(e[o]);if(!(s=t!=null&&n(t,a)))break;t=t[a]}return s||++o!=i?s:!!(i=t==null?0:t.length)&&Ea(i)&&wi(a,i)&&(ce(t)||Si(t))}function ip(t){return function(e){return e==null?void 0:e[t]}}function Sn(t){return typeof t=="function"?t:t==null?Mo:typeof t=="object"?ce(t)?(o=t[0],i=t[1],Oa(o)&&np(i)?op(Bi(o),i):function(s){var a=Oo(s,o);return a===void 0&&a===i?function(l,c){return l!=null&&rp(l,c,Nb)}(s,o):Ha(i,a,3)}):(n=function(s){for(var a=Cn(s),l=a.length;l--;){var c=a[l],d=s[c];a[l]=[c,d,np(d)]}return a}(e=t),n.length==1&&n[0][2]?op(n[0][0],n[0][1]):function(s){return s===e||function(a,l,c){var d=c.length,u=d;if(a==null)return!u;for(a=Object(a);d--;){var p=c[d];if(p[2]?p[1]!==a[p[0]]:!(p[0]in a))return!1}for(;++d<u;){var h=(p=c[d])[0],f=a[h],m=p[1];if(p[2]){if(f===void 0&&!(h in a))return!1}else if(!Ha(m,f,3,void 0,new qt))return!1}return!0}(s,0,n)}):function(s){return Oa(s)?ip(Bi(s)):function(a){return function(l){return Ia(l,a)}}(s)}(t);var e,n,o,i}var sp,br=(sp=function(t,e){return t&&function(n,o,i){for(var s=-1,a=Object(n),l=i(n),c=l.length;c--;){var d=l[++s];if(o(a[d],d,a)===!1)break}return n}(t,e,Cn)},function(t,e){if(t==null)return t;if(!Kt(t))return sp(t,e);for(var n=t.length,o=-1,i=Object(t);++o<n&&e(i[o],o,i)!==!1;);return t}),Wa=function(){return ot.Date.now()},Bb=Math.max,Tb=Math.min;function Vi(t,e,n){var o,i,s,a,l,c,d=0,u=!1,p=!1,h=!0;if(typeof t!="function")throw new TypeError("Expected a function");function f(y){var k=o,x=i;return o=i=void 0,d=y,a=t.apply(x,k)}function m(y){var k=y-c;return c===void 0||k>=e||k<0||p&&y-d>=s}function g(){var y=Wa();if(m(y))return v(y);l=setTimeout(g,function(k){var x=e-(k-c);return p?Tb(x,s-(k-d)):x}(y))}function v(y){return l=void 0,h&&o?f(y):(o=i=void 0,a)}function b(){var y=Wa(),k=m(y);if(o=arguments,i=this,c=y,k){if(l===void 0)return function(x){return d=x,l=setTimeout(g,e),u?f(x):a}(c);if(p)return clearTimeout(l),l=setTimeout(g,e),f(c)}return l===void 0&&(l=setTimeout(g,e)),a}return e=gi(e)||0,Tt(n)&&(u=!!n.leading,s=(p="maxWait"in n)?Bb(gi(n.maxWait)||0,e):s,h="trailing"in n?!!n.trailing:h),b.cancel=function(){l!==void 0&&clearTimeout(l),d=0,o=c=i=l=void 0},b.flush=function(){return l===void 0?a:v(Wa())},b}function ap(t){return wt(t)&&Kt(t)}var lp=Sa(function(t,e){return ap(t)?function(n,o){var i=-1,s=ka,a=!0,l=n.length,c=[],d=o.length;if(!l)return c;o.length>=200&&(s=Pa,a=!1,o=new Vo(o));e:for(;++i<l;){var u=n[i],p=u;if(u=u!==0?u:0,a&&p==p){for(var h=d;h--;)if(o[h]===p)continue e;c.push(u)}else s(o,p,void 0)||c.push(u)}return c}(t,function(n,o,i,s,a){var l=-1,c=n.length;for(i||(i=Zy),a||(a=[]);++l<c;){var d=n[l];i(d)&&uu(a,d)}return a}(e,0,ap)):[]});function Ii(t,e){var n;return(ce(t)?ya:br)(t,typeof(n=e)=="function"?n:Mo)}function Ob(t,e){var n=[];return br(t,function(o,i,s){e(o,i,s)&&n.push(o)}),n}function kr(t,e){return(ce(t)?Ru:Ob)(t,Sn(e))}var _b=Math.max;function Io(t,e,n){var o=t==null?0:t.length;if(!o)return-1;var i=n==null?0:Gn(n);return i<0&&(i=_b(o+i,0)),qd(t,Sn(e),i)}var cp,Do=(cp=Io,function(t,e,n){var o=Object(t);if(!Kt(t)){var i=Sn(e);t=Cn(t),e=function(a){return i(o[a],a,o)}}var s=cp(t,e,n);return s>-1?o[i?t[s]:s]:void 0});function dp(t){return t&&t.length?t[0]:void 0}function up(t,e){var n=-1,o=Kt(t)?Array(t.length):[];return br(t,function(i,s,a){o[++n]=e(i,s,a)}),o}function En(t,e){return(ce(t)?Eo:up)(t,Sn(e))}var Di=Ou("floor"),Ab=Object.prototype.hasOwnProperty;function Vb(t,e){return t!=null&&Ab.call(t,e)}function Ib(t,e){return t!=null&&rp(t,e,Vb)}function Ro(t){return typeof t=="string"||!ce(t)&&wt(t)&&on(t)=="[object String]"}var Db=Math.max;function gt(t,e,n,o){t=Kt(t)?t:function(s){return s==null?[]:function(a,l){return Eo(l,function(c){return a[c]})}(s,Cn(s))}(t),n=n?Gn(n):0;var i=t.length;return n<0&&(n=Db(i+n,0)),Ro(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&ba(t,e,n)>-1}function pp(t){return t===!0||t===!1||wt(t)&&on(t)=="[object Boolean]"}var Rb=Object.prototype.hasOwnProperty;function Ct(t){if(t==null)return!0;if(Kt(t)&&(ce(t)||typeof t=="string"||typeof t.splice=="function"||mr(t)||Na(t)||Si(t)))return!t.length;var e=xt(t);if(e=="[object Map]"||e=="[object Set]")return!t.size;if(Ci(t))return!Ba(t).length;for(var n in t)if(Rb.call(t,n))return!1;return!0}function Ri(t){return typeof t=="number"||wt(t)&&on(t)=="[object Number]"}function Ee(t){return t==null}var hp,fp=(hp=function(t,e,n){return t+(n?" ":"")+e.toLowerCase()},function(t){return hu(function(e){return function(n){return ib.test(n)}(e=Ut(e))?function(n){return n.match(db)||[]}(e):function(n){return n.match(rb)||[]}(e)}(function(e){return(e=Ut(e))&&e.replace(nb,tb).replace(ob,"")}(t).replace(ub,"")),hp,"")});function Lb(t,e){if(t!==e){var n=t!==void 0,o=t===null,i=t==t,s=So(t),a=e!==void 0,l=e===null,c=e==e,d=So(e);if(!l&&!d&&!s&&t>e||s&&a&&c&&!l&&!d||o&&a&&c||!n&&c||!i)return 1;if(!o&&!s&&!d&&t<e||d&&n&&i&&!o&&!s||l&&n&&i||!a&&i||!c)return-1}return 0}var zb=ip("length"),mp="\\ud800-\\udfff",$b="["+mp+"]",Ka="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ua="\\ud83c[\\udffb-\\udfff]",gp="[^"+mp+"]",vp="(?:\\ud83c[\\udde6-\\uddff]){2}",yp="[\\ud800-\\udbff][\\udc00-\\udfff]",bp="(?:"+Ka+"|"+Ua+")?",kp="[\\ufe0e\\ufe0f]?",Pb=kp+bp+"(?:\\u200d(?:"+[gp,vp,yp].join("|")+")"+kp+bp+")*",jb="(?:"+[gp+Ka+"?",Ka,vp,yp,$b].join("|")+")",wp=RegExp(Ua+"(?="+Ua+")|"+jb+Pb,"g");function Fb(t,e,n,o,i){return i(t,function(s,a,l){n=o?(o=!1,s):e(n,s,a,l)}),n}function qa(t){if(t==null)return 0;if(Kt(t))return Ro(t)?function(o){return eb.test(o)}(e=t)?function(o){for(var i=wp.lastIndex=0;wp.test(o);)++i;return i}(e):zb(e):t.length;var e,n=xt(t);return n=="[object Map]"||n=="[object Set]"?t.size:Ba(t).length}function Hb(t,e){var n;return br(t,function(o,i,s){return!(n=e(o,i,s))}),!!n}function xp(t,e,n){return(ce(t)?Yu:Hb)(t,Sn(e))}function Lo(t,e,n){var o=!0,i=!0;if(typeof t!="function")throw new TypeError("Expected a function");return Tt(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),Vi(t,e,{leading:o,maxWait:e,trailing:i})}function Cp(t){return Ut(t).toLowerCase()}var Wb=Ao&&1/ja(new Ao([,-0]))[1]==1/0?function(t){return new Ao(t)}:Pd;const Z=t=>(t.install=e=>{e.component(t.name,t)},t),Ja=(t=0)=>new Promise(e=>setTimeout(e,t)),Ga=t=>`${t}px`,Jt=(t,e)=>{if(Tt(t))return e in t?t[e]:t[e.replace(/-([a-z])/g,(n,o)=>o.toUpperCase())]},Sp="mc-icon",Kb=r.defineComponent({name:Sp,__name:"mc-icon",props:{name:{},size:{default:24},color:{}},emits:["click"],setup(t,{expose:e,emit:n}){const o=n,i=r.ref();return e({ref:i}),(s,a)=>(r.openBlock(),r.createElementBlock("span",{class:"mc-icon",style:r.normalizeStyle({fontSize:`${t.size}px`,width:`${t.size}px`,height:`${t.size}px`,color:t.color})},[r.createElementVNode("i",{ref_key:"_ref",ref:i,class:r.normalizeClass(["mc-iconfont",`mc-icon--${t.name}`]),onClick:a[0]||(a[0]=l=>(c=>{o("click",c)})(l))},null,2)],4))}}),U=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},Qn=U(Kb,[["__scopeId","data-v-24abf3b0"]]),de=Z(Qn),Ep="mc-alert-message",Ub={class:"mc-alert-message-header"},qb={class:"mc-alert-message-title-container"},Jb={key:0,class:"mc-alert-message-icon-group"},Gb={class:"mc-alert-message-icon-wrapper"},Yb={class:"mc-alert-message-icon-wrapper"},Xb={key:0,class:"mc-alert-message-body"},Zb=r.defineComponent({name:Ep,__name:"mc-alert-message",props:{modelValue:{type:Boolean,default:!0},width:{},height:{},type:{default:"info"},message:{},content:{},closable:{type:Boolean,default:!1},hideIcon:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1}},emits:["click","close","update:modelValue","expand"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),a=r.useSlots(),l=r.computed(()=>o.content||a.content),c=r.computed(()=>p.value||a.icon),d=r.ref(!1),u=r.computed(()=>!o.expandable||d.value),p=r.computed(()=>{if(!o.hideIcon)switch(o.type){case"success":return"Accept_02";case"error":return"Error_04";case"warning":return"Error_02";case"info":return"Info_02";default:return}}),h=()=>{i("update:modelValue",!1),i("close")},f=()=>{i("click"),o.expandable&&(d.value=!d.value,i("expand",d.value))};return e({ref:s,close:h,show:()=>{d.value=!0},hide:()=>{d.value=!1}}),(m,g)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"_ref",ref:s,class:r.normalizeClass(["mc-alert-message",[`mc-alert-message-${t.type}`]]),style:r.normalizeStyle({width:t.width,height:t.height,cursor:t.expandable?"pointer":"default"}),onClick:f},[r.createElementVNode("div",Ub,[r.createElementVNode("div",qb,[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-alert-message-icon",style:r.normalizeStyle({height:l.value?"30px":"24px"})},[r.renderSlot(m.$slots,"icon",{},()=>[r.createVNode(r.unref(de),{name:p.value,size:24},null,8,["name"])],!0)],4)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"mc-alert-message-title",style:r.normalizeStyle({fontSize:l.value?"18px":"16px",fontWeight:l.value?"600":"400",lineHeight:l.value?"30px":"24px"})},[r.renderSlot(m.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.message),1)],!0)],4)]),t.closable||t.expandable?(r.openBlock(),r.createElementBlock("div",Jb,[r.createElementVNode("div",Gb,[t.expandable?(r.openBlock(),r.createBlock(r.unref(de),{key:0,name:"Down-Chevron",size:24,class:"mc-alert-message-tool-icon mc-alert-message-tool-icon-expand",style:r.normalizeStyle({transform:u.value?"rotate(180deg)":"rotate(0deg)"})},null,8,["style"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",Yb,[t.closable?(r.openBlock(),r.createBlock(r.unref(de),{key:0,name:"Cross",size:24,class:"mc-alert-message-tool-icon mc-alert-message-tool-icon-close",onClick:r.withModifiers(h,["stop"])})):r.createCommentVNode("",!0)])])):r.createCommentVNode("",!0)]),l.value?(r.openBlock(),r.createElementBlock("div",Xb,[r.createVNode(r.Transition,{name:"mc-alert-message-content-transition"},{default:r.withCtx(()=>[u.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-alert-message-content",style:r.normalizeStyle({paddingLeft:c.value?"48px":"16px"})},[r.renderSlot(m.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)],6))}}),Mp=Z(U(Zb,[["__scopeId","data-v-26d43a1b"]])),Li=(t,e,n)=>{r.isRef(t)?r.watch(t,(o,i)=>{i==null||i.removeEventListener(e,n),o==null||o.addEventListener(e,n)}):r.onMounted(()=>t==null?void 0:t.addEventListener(e,n)),r.onBeforeUnmount(()=>{var o;return(o=r.unref(t))==null?void 0:o.removeEventListener(e,n)})},zi=(t,e)=>{Li(document,"click",n=>{if(t.value&&n.target)if(ce(t.value)){let o=!0;for(let i=0;i<t.value.length;i++)if(t.value[i].contains(n.target)){o=!1;break}o&&e(n)}else t.value.contains(n.target)||e(n)})},zo=(t,{afterFocus:e,beforeBlur:n,afterBlur:o}={})=>{const i=r.getCurrentInstance(),{emit:s}=i,a=r.ref(),l=r.ref(!1);return Li(a,"click",()=>{var c;(c=t.value)==null||c.focus()}),{wrapperRef:a,isFocused:l,handleFocus:c=>{l.value||(l.value=!0,s("focus",c),e==null||e())},handleBlur:c=>{var d;Ve(n)&&n(c)||c.relatedTarget&&((d=a.value)!=null&&d.contains(c.relatedTarget))||(l.value=!1,s("blur",c),o==null||o())}}};function be(t){const e=r.getCurrentInstance();if(!e)throw new Error("useProp must be used within a component");return r.computed(()=>{var o;const n=(o=e==null?void 0:e.proxy)==null?void 0:o.$props;if(!ce(t))return n==null?void 0:n[t];for(const i of t)if(Ib(n,i))return n==null?void 0:n[i]})}const Np=(t,e,n=300)=>{const o=new ResizeObserver(Lo(a=>{for(let l of a)e(l.contentRect)},n)),i=a=>{o.observe(a)},s=a=>{o.unobserve(a)};return r.onMounted(()=>{t.value&&i(t.value)}),r.onBeforeUnmount(()=>{t.value&&s(t.value)}),r.watch(t,a=>{a&&i(a)}),{resizeObserver:o,observe:i,unobserve:s}},$t=()=>{const t=be("width"),e=be("height");return{width:r.computed(()=>typeof t.value=="number"?`${t.value}px`:t.value||void 0),height:r.computed(()=>typeof e.value=="number"?`${e.value}px`:e.value||void 0)}},Bp=t=>{const e=r.ref(!1),n=()=>{e.value=!0},o=()=>{e.value=!1};return r.onMounted(()=>{t.value&&(t.value.addEventListener("mouseenter",n),t.value.addEventListener("mouseleave",o))}),r.onBeforeMount(()=>{t.value&&(t.value.removeEventListener("mouseenter",n),t.value.removeEventListener("mouseleave",o))}),{isHovering:e}},Tp="mc-button",Qb=["type","disabled"],ek={key:1,class:"loading-icon"},tk={class:"mc-button-text"},nk=r.defineComponent({name:Tp,__name:"mc-button",props:{type:{default:"primary"},nativeType:{default:"button"},size:{default:"medium"},disabled:{type:Boolean},loading:{type:Boolean},useThrottle:{type:Boolean,default:!0},throttleDuration:{default:500},leftIcon:{},rightIcon:{},content:{},height:{},width:{}},emits:["click"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),{width:a,height:l}=$t(),c=u=>{o.loading||o.disabled||i("click",u)},d=Lo(c,o.throttleDuration,{trailing:!1});return e({ref:s}),(u,p)=>(r.openBlock(),r.createElementBlock("button",{ref_key:"_ref",ref:s,style:r.normalizeStyle({width:r.unref(a),height:r.unref(l)}),class:r.normalizeClass(["mc-button",{[`mc-button--${t.type}`]:t.type,[`mc-button--${t.size}`]:t.size,"is-loading":t.loading,"is-disabled":t.disabled}]),type:t.nativeType,disabled:!(!t.disabled&&!t.loading)||void 0,onClick:p[0]||(p[0]=h=>t.useThrottle?r.unref(d)(h):c(h))},[t.leftIcon&&!t.loading?(r.openBlock(),r.createBlock(r.unref(de),{key:0,name:t.leftIcon},null,8,["name"])):r.createCommentVNode("",!0),t.loading&&!t.disabled?(r.openBlock(),r.createElementBlock("span",ek,[r.createVNode(r.unref(de),{name:"Loading",size:16})])):r.createCommentVNode("",!0),r.createElementVNode("div",tk,[r.renderSlot(u.$slots,"default",{},void 0,!0)]),t.rightIcon?(r.openBlock(),r.createBlock(r.unref(de),{key:2,name:t.rightIcon},null,8,["name"])):r.createCommentVNode("",!0)],14,Qb))}}),eo=Z(U(nk,[["__scopeId","data-v-dfec08a5"]])),$o=Symbol("mc-form-context"),Op="mc-form";function to(){return to=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},to.apply(this,arguments)}function Ya(t){return Ya=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ya(t)}function wr(t,e){return wr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},wr(t,e)}function Xa(t,e,n){return Xa=function(){if(typeof Reflect>"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}}()?Reflect.construct.bind():function(o,i,s){var a=[null];a.push.apply(a,i);var l=new(Function.bind.apply(o,a));return s&&wr(l,s.prototype),l},Xa.apply(null,arguments)}function Za(t){var e=typeof Map=="function"?new Map:void 0;return Za=function(n){if(n===null||(o=n,Function.toString.call(o).indexOf("[native code]")===-1))return n;var o;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Xa(n,arguments,Ya(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),wr(i,n)},Za(t)}var ok=/%[sdj%]/g,_p=function(){};function Qa(t){if(!t||!t.length)return null;var e={};return t.forEach(function(n){var o=n.field;e[o]=e[o]||[],e[o].push(n)}),e}function St(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];var i=0,s=n.length;return typeof t=="function"?t.apply(null,n):typeof t=="string"?t.replace(ok,function(a){if(a==="%%")return"%";if(i>=s)return a;switch(a){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}break;default:return a}}):t}function qe(t,e){return t==null||!(e!=="array"||!Array.isArray(t)||t.length)||!(!function(n){return n==="string"||n==="url"||n==="hex"||n==="email"||n==="date"||n==="pattern"}(e)||typeof t!="string"||t)}function Ap(t,e,n){var o=0,i=t.length;(function s(a){if(a&&a.length)n(a);else{var l=o;o+=1,l<i?e(t[l],s):n([])}})([])}typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(_p=function(t,e){typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&e.every(function(n){return typeof n=="string"})&&console.warn(t,e)});var Vp=function(t){var e,n;function o(i,s){var a;return(a=t.call(this,"Async Validation Error")||this).errors=i,a.fields=s,a}return n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,wr(e,n),o}(Za(Error));function Ip(t,e){return function(n){var o,i;return o=t.fullFields?function(s,a){for(var l=s,c=0;c<a.length;c++){if(l==null)return l;l=l[a[c]]}return l}(e,t.fullFields):e[n.field||t.fullField],(i=n)&&i.message!==void 0?(n.field=n.field||t.fullField,n.fieldValue=o,n):{message:typeof n=="function"?n():n,fieldValue:o,field:n.field||t.fullField}}}function Dp(t,e){if(e){for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];typeof o=="object"&&typeof t[n]=="object"?t[n]=to({},t[n],o):t[n]=o}}return t}var el,Rp=function(t,e,n,o,i,s){!t.required||n.hasOwnProperty(t.field)&&!qe(e,s||t.type)||o.push(St(i.messages.required,t.fullField))},rk=/^(([^<>()\[\]\\.,;:\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,}))$/,ik=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,xr={integer:function(t){return xr.number(t)&&parseInt(t,10)===t},float:function(t){return xr.number(t)&&!xr.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return!isNaN(t)&&typeof t=="number"},object:function(t){return typeof t=="object"&&!xr.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(rk)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(function(){if(el)return el;var e="[a-fA-F\\d:]",n=function(h){return h&&h.includeBoundaries?"(?:(?<=\\s|^)(?="+e+")|(?<="+e+")(?=\\s|$))":""},o="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",i="[a-fA-F\\d]{1,4}",s=(`
|
|
4
4
|
(?:
|
|
5
|
-
(?:`+
|
|
6
|
-
(?:`+
|
|
7
|
-
(?:`+
|
|
8
|
-
(?:`+
|
|
9
|
-
(?:`+
|
|
10
|
-
(?:`+
|
|
11
|
-
(?:`+
|
|
12
|
-
(?::(?:(?::`+
|
|
5
|
+
(?:`+i+":){7}(?:"+i+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
6
|
+
(?:`+i+":){6}(?:"+o+"|:"+i+`|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
|
|
7
|
+
(?:`+i+":){5}(?::"+o+"|(?::"+i+`){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
|
|
8
|
+
(?:`+i+":){4}(?:(?::"+i+"){0,1}:"+o+"|(?::"+i+`){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
|
|
9
|
+
(?:`+i+":){3}(?:(?::"+i+"){0,2}:"+o+"|(?::"+i+`){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
|
|
10
|
+
(?:`+i+":){2}(?:(?::"+i+"){0,3}:"+o+"|(?::"+i+`){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
|
|
11
|
+
(?:`+i+":){1}(?:(?::"+i+"){0,4}:"+o+"|(?::"+i+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
12
|
+
(?::(?:(?::`+i+"){0,5}:"+o+"|(?::"+i+`){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
13
13
|
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
14
|
-
`).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),a=new RegExp("(?:^"+o+"$)|(?:^"+i+"$)"),l=new RegExp("^"+o+"$"),c=new RegExp("^"+i+"$"),d=function(h){return h&&h.exact?a:new RegExp("(?:"+n(h)+o+n(h)+")|(?:"+n(h)+i+n(h)+")","g")};d.v4=function(h){return h&&h.exact?l:new RegExp(""+n(h)+o+n(h),"g")},d.v6=function(h){return h&&h.exact?c:new RegExp(""+n(h)+i+n(h),"g")};var u=d.v4().source,p=d.v6().source;return tl=new RegExp("(?:^(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|"+u+"|"+p+'|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?$)',"i")}())},hex:function(t){return typeof t=="string"&&!!t.match(ub)}},jo="enum",lt=Lp,Pt=function(t,e,n,o,s){if(t.required&&e===void 0)Lp(t,e,n,o,s);else{var i=t.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(i)>-1?xr[i](e)||o.push(St(s.messages.types[i],t.fullField,t.type)):i&&typeof e!==t.type&&o.push(St(s.messages.types[i],t.fullField,t.type))}},Fo=function(t,e,n,o,s){var i=typeof t.len=="number",a=typeof t.min=="number",l=typeof t.max=="number",c=e,d=null,u=typeof e=="number",p=typeof e=="string",h=Array.isArray(e);if(u?d="number":p?d="string":h&&(d="array"),!d)return!1;h&&(c=e.length),p&&(c=e.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),i?c!==t.len&&o.push(St(s.messages[d].len,t.fullField,t.len)):a&&!l&&c<t.min?o.push(St(s.messages[d].min,t.fullField,t.min)):l&&!a&&c>t.max?o.push(St(s.messages[d].max,t.fullField,t.max)):a&&l&&(c<t.min||c>t.max)&&o.push(St(s.messages[d].range,t.fullField,t.min,t.max))},zp=function(t,e,n,o,s){t.pattern&&(t.pattern instanceof RegExp?(t.pattern.lastIndex=0,t.pattern.test(e)||o.push(St(s.messages.pattern.mismatch,t.fullField,e,t.pattern))):typeof t.pattern=="string"&&(new RegExp(t.pattern).test(e)||o.push(St(s.messages.pattern.mismatch,t.fullField,e,t.pattern))))},nl=function(t,e,n,o,s){var i=t.type,a=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(Ue(e,i)&&!t.required)return n();lt(t,e,o,a,s,i),Ue(e,i)||Pt(t,e,o,a,s)}n(a)},Cr={string:function(t,e,n,o,s){var i=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(Ue(e,"string")&&!t.required)return n();lt(t,e,o,i,s,"string"),Ue(e,"string")||(Pt(t,e,o,i,s),Fo(t,e,0,i,s),zp(t,e,0,i,s),t.whitespace===!0&&function(a,l,c,d,u){(/^\s+$/.test(l)||l==="")&&d.push(St(u.messages.whitespace,a.fullField))}(t,e,0,i,s))}n(i)},method:function(t,e,n,o,s){var i=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(Ue(e)&&!t.required)return n();lt(t,e,o,i,s),e!==void 0&&Pt(t,e,o,i,s)}n(i)},number:function(t,e,n,o,s){var i=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(e===""&&(e=void 0),Ue(e)&&!t.required)return n();lt(t,e,o,i,s),e!==void 0&&(Pt(t,e,o,i,s),Fo(t,e,0,i,s))}n(i)},boolean:function(t,e,n,o,s){var i=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(Ue(e)&&!t.required)return n();lt(t,e,o,i,s),e!==void 0&&Pt(t,e,o,i,s)}n(i)},regexp:function(t,e,n,o,s){var i=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(Ue(e)&&!t.required)return n();lt(t,e,o,i,s),Ue(e)||Pt(t,e,o,i,s)}n(i)},integer:function(t,e,n,o,s){var i=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(Ue(e)&&!t.required)return n();lt(t,e,o,i,s),e!==void 0&&(Pt(t,e,o,i,s),Fo(t,e,0,i,s))}n(i)},float:function(t,e,n,o,s){var i=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(Ue(e)&&!t.required)return n();lt(t,e,o,i,s),e!==void 0&&(Pt(t,e,o,i,s),Fo(t,e,0,i,s))}n(i)},array:function(t,e,n,o,s){var i=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(e==null&&!t.required)return n();lt(t,e,o,i,s,"array"),e!=null&&(Pt(t,e,o,i,s),Fo(t,e,0,i,s))}n(i)},object:function(t,e,n,o,s){var i=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(Ue(e)&&!t.required)return n();lt(t,e,o,i,s),e!==void 0&&Pt(t,e,o,i,s)}n(i)},enum:function(t,e,n,o,s){var i=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(Ue(e)&&!t.required)return n();lt(t,e,o,i,s),e!==void 0&&function(a,l,c,d,u){a[jo]=Array.isArray(a[jo])?a[jo]:[],a[jo].indexOf(l)===-1&&d.push(St(u.messages[jo],a.fullField,a[jo].join(", ")))}(t,e,0,i,s)}n(i)},pattern:function(t,e,n,o,s){var i=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(Ue(e,"string")&&!t.required)return n();lt(t,e,o,i,s),Ue(e,"string")||zp(t,e,0,i,s)}n(i)},date:function(t,e,n,o,s){var i=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(Ue(e,"date")&&!t.required)return n();var a;lt(t,e,o,i,s),Ue(e,"date")||(a=e instanceof Date?e:new Date(e),Pt(t,a,o,i,s),a&&Fo(t,a.getTime(),0,i,s))}n(i)},url:nl,hex:nl,email:nl,required:function(t,e,n,o,s){var i=[],a=Array.isArray(e)?"array":typeof e;lt(t,e,o,i,s,a),n(i)},any:function(t,e,n,o,s){var i=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(Ue(e)&&!t.required)return n();lt(t,e,o,i,s)}n(i)}};function ol(){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 t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var rl=ol(),Sr=function(){function t(n){this.rules=null,this._messages=rl,this.define(n)}var e=t.prototype;return e.define=function(n){var o=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(typeof n!="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(s){var i=n[s];o.rules[s]=Array.isArray(i)?i:[i]})},e.messages=function(n){return n&&(this._messages=Rp(ol(),n)),this._messages},e.validate=function(n,o,s){var i=this;o===void 0&&(o={}),s===void 0&&(s=function(){});var a=n,l=o,c=s;if(typeof l=="function"&&(c=l,l={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,a),Promise.resolve(a);if(l.messages){var d=this.messages();d===rl&&(d=ol()),Rp(d,l.messages),l.messages=d}else l.messages=this.messages();var u={};(l.keys||Object.keys(this.rules)).forEach(function(h){var f=i.rules[h],m=a[h];f.forEach(function(g){var v=g;typeof v.transform=="function"&&(a===n&&(a=no({},a)),m=a[h]=v.transform(m)),(v=typeof v=="function"?{validator:v}:no({},v)).validator=i.getValidationMethod(v),v.validator&&(v.field=h,v.fullField=v.fullField||h,v.type=i.getType(v),u[h]=u[h]||[],u[h].push({rule:v,value:m,source:a,field:h}))})});var p={};return function(h,f,m,g,v){if(f.first){var k=new Promise(function(E,M){var N=function(T){var R=[];return Object.keys(T).forEach(function(z){R.push.apply(R,T[z]||[])}),R}(h);Vp(N,m,function(T){return g(T),T.length?M(new Ip(T,el(T))):E(v)})});return k.catch(function(E){return E}),k}var y=f.firstFields===!0?Object.keys(h):f.firstFields||[],b=Object.keys(h),x=b.length,w=0,C=[],S=new Promise(function(E,M){var N=function(T){if(C.push.apply(C,T),++w===x)return g(C),C.length?M(new Ip(C,el(C))):E(v)};b.length||(g(C),E(v)),b.forEach(function(T){var R=h[T];y.indexOf(T)!==-1?Vp(R,m,N):function(z,_,I){var O=[],V=0,P=z.length;function A(L){O.push.apply(O,L||[]),++V===P&&I(O)}z.forEach(function(L){_(L,A)})}(R,m,N)})});return S.catch(function(E){return E}),S}(u,l,function(h,f){var m,g=h.rule,v=!(g.type!=="object"&&g.type!=="array"||typeof g.fields!="object"&&typeof g.defaultField!="object");function k(b,x){return no({},x,{fullField:g.fullField+"."+b,fullFields:g.fullFields?[].concat(g.fullFields,[b]):[b]})}function y(b){b===void 0&&(b=[]);var x=Array.isArray(b)?b:[b];!l.suppressWarning&&x.length&&t.warning("async-validator:",x),x.length&&g.message!==void 0&&(x=[].concat(g.message));var w=x.map(Dp(g,a));if(l.first&&w.length)return p[g.field]=1,f(w);if(v){if(g.required&&!h.value)return g.message!==void 0?w=[].concat(g.message).map(Dp(g,a)):l.error&&(w=[l.error(g,St(l.messages.required,g.field))]),f(w);var C={};g.defaultField&&Object.keys(h.value).map(function(M){C[M]=g.defaultField}),C=no({},C,h.rule.fields);var S={};Object.keys(C).forEach(function(M){var N=C[M],T=Array.isArray(N)?N:[N];S[M]=T.map(k.bind(null,M))});var E=new t(S);E.messages(l.messages),h.rule.options&&(h.rule.options.messages=l.messages,h.rule.options.error=l.error),E.validate(h.value,h.rule.options||l,function(M){var N=[];w&&w.length&&N.push.apply(N,w),M&&M.length&&N.push.apply(N,M),f(N.length?N:null)})}else f(w)}if(v=v&&(g.required||!g.required&&h.value),g.field=h.field,g.asyncValidator)m=g.asyncValidator(g,h.value,y,h.source,l);else if(g.validator){try{m=g.validator(g,h.value,y,h.source,l)}catch(b){console.error==null||console.error(b),l.suppressValidatorError||setTimeout(function(){throw b},0),y(b.message)}m===!0?y():m===!1?y(typeof g.message=="function"?g.message(g.fullField||g.field):g.message||(g.fullField||g.field)+" fails"):m instanceof Array?y(m):m instanceof Error&&y(m.message)}m&&m.then&&m.then(function(){return y()},function(b){return y(b)})},function(h){(function(f){var m=[],g={};function v(y){var b;Array.isArray(y)?m=(b=m).concat.apply(b,y):m.push(y)}for(var k=0;k<f.length;k++)v(f[k]);m.length?(g=el(m),c(m,g)):c(null,a)})(h)},a)},e.getType=function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!Cr.hasOwnProperty(n.type))throw new Error(St("Unknown rule type %s",n.type));return n.type||"string"},e.getValidationMethod=function(n){if(typeof n.validator=="function")return n.validator;var o=Object.keys(n),s=o.indexOf("message");return s!==-1&&o.splice(s,1),o.length===1&&o[0]==="required"?Cr.required:Cr[this.getType(n)]||void 0},t}();Sr.register=function(t,e){if(typeof e!="function")throw new Error("Cannot register a validator by type, validator is not a function");Cr[t]=e},Sr.warning=Ap,Sr.messages=rl,Sr.validators=Cr;var vt="top",Ot="bottom",_t="right",ct="left",sl="auto",Er=[vt,Ot,_t,ct],Ho="start",Mr="end",$p="viewport",Nr="popper",Pp=Er.reduce(function(t,e){return t.concat([e+"-"+Ho,e+"-"+Mr])},[]),jp=[].concat(Er,[sl]).reduce(function(t,e){return t.concat([e,e+"-"+Ho,e+"-"+Mr])},[]),pb=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Jt(t){return t?(t.nodeName||"").toLowerCase():null}function Et(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function oo(t){return t instanceof Et(t).Element||t instanceof Element}function At(t){return t instanceof Et(t).HTMLElement||t instanceof HTMLElement}function il(t){return typeof ShadowRoot<"u"&&(t instanceof Et(t).ShadowRoot||t instanceof ShadowRoot)}const hb={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var o=e.styles[n]||{},s=e.attributes[n]||{},i=e.elements[n];At(i)&&Jt(i)&&(Object.assign(i.style,o),Object.keys(s).forEach(function(a){var l=s[a];l===!1?i.removeAttribute(a):i.setAttribute(a,l===!0?"":l)}))})},effect:function(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(o){var s=e.elements[o],i=e.attributes[o]||{},a=Object.keys(e.styles.hasOwnProperty(o)?e.styles[o]:n[o]).reduce(function(l,c){return l[c]="",l},{});At(s)&&Jt(s)&&(Object.assign(s.style,a),Object.keys(i).forEach(function(l){s.removeAttribute(l)}))})}},requires:["computeStyles"]};function Yt(t){return t.split("-")[0]}var ro=Math.max,Ps=Math.min,Wo=Math.round;function al(){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 Fp(){return!/^((?!chrome|android).)*safari/i.test(al())}function Ko(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var o=t.getBoundingClientRect(),s=1,i=1;e&&At(t)&&(s=t.offsetWidth>0&&Wo(o.width)/t.offsetWidth||1,i=t.offsetHeight>0&&Wo(o.height)/t.offsetHeight||1);var a=(oo(t)?Et(t):window).visualViewport,l=!Fp()&&n,c=(o.left+(l&&a?a.offsetLeft:0))/s,d=(o.top+(l&&a?a.offsetTop:0))/i,u=o.width/s,p=o.height/i;return{width:u,height:p,top:d,right:c+u,bottom:d+p,left:c,x:c,y:d}}function ll(t){var e=Ko(t),n=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:o}}function Hp(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&il(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function ln(t){return Et(t).getComputedStyle(t)}function fb(t){return["table","td","th"].indexOf(Jt(t))>=0}function Nn(t){return((oo(t)?t.ownerDocument:t.document)||window.document).documentElement}function js(t){return Jt(t)==="html"?t:t.assignedSlot||t.parentNode||(il(t)?t.host:null)||Nn(t)}function Wp(t){return At(t)&&ln(t).position!=="fixed"?t.offsetParent:null}function Br(t){for(var e=Et(t),n=Wp(t);n&&fb(n)&&ln(n).position==="static";)n=Wp(n);return n&&(Jt(n)==="html"||Jt(n)==="body"&&ln(n).position==="static")?e:n||function(o){var s=/firefox/i.test(al());if(/Trident/i.test(al())&&At(o)&&ln(o).position==="fixed")return null;var i=js(o);for(il(i)&&(i=i.host);At(i)&&["html","body"].indexOf(Jt(i))<0;){var a=ln(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||s&&a.willChange==="filter"||s&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}(t)||e}function cl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Tr(t,e,n){return ro(t,Ps(e,n))}function Kp(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function qp(t,e){return e.reduce(function(n,o){return n[o]=t,n},{})}const mb={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,o=t.name,s=t.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,l=Yt(n.placement),c=cl(l),d=[ct,_t].indexOf(l)>=0?"height":"width";if(i&&a){var u=function(E,M){return Kp(typeof(E=typeof E=="function"?E(Object.assign({},M.rects,{placement:M.placement})):E)!="number"?E:qp(E,Er))}(s.padding,n),p=ll(i),h=c==="y"?vt:ct,f=c==="y"?Ot:_t,m=n.rects.reference[d]+n.rects.reference[c]-a[c]-n.rects.popper[d],g=a[c]-n.rects.reference[c],v=Br(i),k=v?c==="y"?v.clientHeight||0:v.clientWidth||0:0,y=m/2-g/2,b=u[h],x=k-p[d]-u[f],w=k/2-p[d]/2+y,C=Tr(b,w,x),S=c;n.modifiersData[o]=((e={})[S]=C,e.centerOffset=C-w,e)}},effect:function(t){var e=t.state,n=t.options.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o!="string"||(o=e.elements.popper.querySelector(o)))&&Hp(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qo(t){return t.split("-")[1]}var gb={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Up(t){var e,n=t.popper,o=t.popperRect,s=t.placement,i=t.variation,a=t.offsets,l=t.position,c=t.gpuAcceleration,d=t.adaptive,u=t.roundOffsets,p=t.isFixed,h=a.x,f=h===void 0?0:h,m=a.y,g=m===void 0?0:m,v=typeof u=="function"?u({x:f,y:g}):{x:f,y:g};f=v.x,g=v.y;var k=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),b=ct,x=vt,w=window;if(d){var C=Br(n),S="clientHeight",E="clientWidth";C===Et(n)&&ln(C=Nn(n)).position!=="static"&&l==="absolute"&&(S="scrollHeight",E="scrollWidth"),(s===vt||(s===ct||s===_t)&&i===Mr)&&(x=Ot,g-=(p&&C===w&&w.visualViewport?w.visualViewport.height:C[S])-o.height,g*=c?1:-1),s!==ct&&(s!==vt&&s!==Ot||i!==Mr)||(b=_t,f-=(p&&C===w&&w.visualViewport?w.visualViewport.width:C[E])-o.width,f*=c?1:-1)}var M,N=Object.assign({position:l},d&&gb),T=u===!0?function(R,z){var _=R.x,I=R.y,O=z.devicePixelRatio||1;return{x:Wo(_*O)/O||0,y:Wo(I*O)/O||0}}({x:f,y:g},Et(n)):{x:f,y:g};return f=T.x,g=T.y,c?Object.assign({},N,((M={})[x]=y?"0":"",M[b]=k?"0":"",M.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",M)):Object.assign({},N,((e={})[x]=y?g+"px":"",e[b]=k?f+"px":"",e.transform="",e))}var Fs={passive:!0},vb={left:"right",right:"left",bottom:"top",top:"bottom"};function Hs(t){return t.replace(/left|right|bottom|top/g,function(e){return vb[e]})}var yb={start:"end",end:"start"};function Gp(t){return t.replace(/start|end/g,function(e){return yb[e]})}function dl(t){var e=Et(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ul(t){return Ko(Nn(t)).left+dl(t).scrollLeft}function pl(t){var e=ln(t),n=e.overflow,o=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+o)}function Jp(t){return["html","body","#document"].indexOf(Jt(t))>=0?t.ownerDocument.body:At(t)&&pl(t)?t:Jp(js(t))}function Or(t,e){var n;e===void 0&&(e=[]);var o=Jp(t),s=o===((n=t.ownerDocument)==null?void 0:n.body),i=Et(o),a=s?[i].concat(i.visualViewport||[],pl(o)?o:[]):o,l=e.concat(a);return s?l:l.concat(Or(js(a)))}function hl(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Yp(t,e,n){return e===$p?hl(function(o,s){var i=Et(o),a=Nn(o),l=i.visualViewport,c=a.clientWidth,d=a.clientHeight,u=0,p=0;if(l){c=l.width,d=l.height;var h=Fp();(h||!h&&s==="fixed")&&(u=l.offsetLeft,p=l.offsetTop)}return{width:c,height:d,x:u+ul(o),y:p}}(t,n)):oo(e)?function(o,s){var i=Ko(o,!1,s==="fixed");return i.top=i.top+o.clientTop,i.left=i.left+o.clientLeft,i.bottom=i.top+o.clientHeight,i.right=i.left+o.clientWidth,i.width=o.clientWidth,i.height=o.clientHeight,i.x=i.left,i.y=i.top,i}(e,n):hl(function(o){var s,i=Nn(o),a=dl(o),l=(s=o.ownerDocument)==null?void 0:s.body,c=ro(i.scrollWidth,i.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),d=ro(i.scrollHeight,i.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),u=-a.scrollLeft+ul(o),p=-a.scrollTop;return ln(l||i).direction==="rtl"&&(u+=ro(i.clientWidth,l?l.clientWidth:0)-c),{width:c,height:d,x:u,y:p}}(Nn(t)))}function Xp(t){var e,n=t.reference,o=t.element,s=t.placement,i=s?Yt(s):null,a=s?qo(s):null,l=n.x+n.width/2-o.width/2,c=n.y+n.height/2-o.height/2;switch(i){case vt:e={x:l,y:n.y-o.height};break;case Ot:e={x:l,y:n.y+n.height};break;case _t:e={x:n.x+n.width,y:c};break;case ct:e={x:n.x-o.width,y:c};break;default:e={x:n.x,y:n.y}}var d=i?cl(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(a){case Ho:e[d]=e[d]-(n[u]/2-o[u]/2);break;case Mr:e[d]=e[d]+(n[u]/2-o[u]/2)}}return e}function _r(t,e){e===void 0&&(e={});var n=e,o=n.placement,s=o===void 0?t.placement:o,i=n.strategy,a=i===void 0?t.strategy:i,l=n.boundary,c=l===void 0?"clippingParents":l,d=n.rootBoundary,u=d===void 0?$p:d,p=n.elementContext,h=p===void 0?Nr:p,f=n.altBoundary,m=f!==void 0&&f,g=n.padding,v=g===void 0?0:g,k=Kp(typeof v!="number"?v:qp(v,Er)),y=h===Nr?"reference":Nr,b=t.rects.popper,x=t.elements[m?y:h],w=function(z,_,I,O){var V=_==="clippingParents"?function(j){var q=Or(js(j)),H=["absolute","fixed"].indexOf(ln(j).position)>=0&&At(j)?Br(j):j;return oo(H)?q.filter(function(U){return oo(U)&&Hp(U,H)&&Jt(U)!=="body"}):[]}(z):[].concat(_),P=[].concat(V,[I]),A=P[0],L=P.reduce(function(j,q){var H=Yp(z,q,O);return j.top=ro(H.top,j.top),j.right=Ps(H.right,j.right),j.bottom=Ps(H.bottom,j.bottom),j.left=ro(H.left,j.left),j},Yp(z,A,O));return L.width=L.right-L.left,L.height=L.bottom-L.top,L.x=L.left,L.y=L.top,L}(oo(x)?x:x.contextElement||Nn(t.elements.popper),c,u,a),C=Ko(t.elements.reference),S=Xp({reference:C,element:b,placement:s}),E=hl(Object.assign({},b,S)),M=h===Nr?E:C,N={top:w.top-M.top+k.top,bottom:M.bottom-w.bottom+k.bottom,left:w.left-M.left+k.left,right:M.right-w.right+k.right},T=t.modifiersData.offset;if(h===Nr&&T){var R=T[s];Object.keys(N).forEach(function(z){var _=[_t,Ot].indexOf(z)>=0?1:-1,I=[vt,Ot].indexOf(z)>=0?"y":"x";N[z]+=R[I]*_})}return N}function kb(t,e){e===void 0&&(e={});var n=e,o=n.placement,s=n.boundary,i=n.rootBoundary,a=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,d=c===void 0?jp:c,u=qo(o),p=u?l?Pp:Pp.filter(function(m){return qo(m)===u}):Er,h=p.filter(function(m){return d.indexOf(m)>=0});h.length===0&&(h=p);var f=h.reduce(function(m,g){return m[g]=_r(t,{placement:g,boundary:s,rootBoundary:i,padding:a})[Yt(g)],m},{});return Object.keys(f).sort(function(m,g){return f[m]-f[g]})}const bb={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,o=t.name;if(!e.modifiersData[o]._skip){for(var s=n.mainAxis,i=s===void 0||s,a=n.altAxis,l=a===void 0||a,c=n.fallbackPlacements,d=n.padding,u=n.boundary,p=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,m=f===void 0||f,g=n.allowedAutoPlacements,v=e.options.placement,k=Yt(v),y=c||(k!==v&&m?function(j){if(Yt(j)===sl)return[];var q=Hs(j);return[Gp(j),q,Gp(q)]}(v):[Hs(v)]),b=[v].concat(y).reduce(function(j,q){return j.concat(Yt(q)===sl?kb(e,{placement:q,boundary:u,rootBoundary:p,padding:d,flipVariations:m,allowedAutoPlacements:g}):q)},[]),x=e.rects.reference,w=e.rects.popper,C=new Map,S=!0,E=b[0],M=0;M<b.length;M++){var N=b[M],T=Yt(N),R=qo(N)===Ho,z=[vt,Ot].indexOf(T)>=0,_=z?"width":"height",I=_r(e,{placement:N,boundary:u,rootBoundary:p,altBoundary:h,padding:d}),O=z?R?_t:ct:R?Ot:vt;x[_]>w[_]&&(O=Hs(O));var V=Hs(O),P=[];if(i&&P.push(I[T]<=0),l&&P.push(I[O]<=0,I[V]<=0),P.every(function(j){return j})){E=N,S=!1;break}C.set(N,P)}if(S)for(var A=function(j){var q=b.find(function(H){var U=C.get(H);if(U)return U.slice(0,j).every(function(Y){return Y})});if(q)return E=q,"break"},L=m?3:1;L>0&&A(L)!=="break";L--);e.placement!==E&&(e.modifiersData[o]._skip=!0,e.placement=E,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Zp(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 Qp(t){return[vt,_t,Ot,ct].some(function(e){return t[e]>=0})}function wb(t,e,n){n===void 0&&(n=!1);var o,s,i=At(e),a=At(e)&&function(p){var h=p.getBoundingClientRect(),f=Wo(h.width)/p.offsetWidth||1,m=Wo(h.height)/p.offsetHeight||1;return f!==1||m!==1}(e),l=Nn(e),c=Ko(t,a,n),d={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!n)&&((Jt(e)!=="body"||pl(l))&&(d=(o=e)!==Et(o)&&At(o)?{scrollLeft:(s=o).scrollLeft,scrollTop:s.scrollTop}:dl(o)),At(e)?((u=Ko(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):l&&(u.x=ul(l))),{x:c.left+d.scrollLeft-u.x,y:c.top+d.scrollTop-u.y,width:c.width,height:c.height}}function xb(t){var e=new Map,n=new Set,o=[];function s(i){n.add(i.name),[].concat(i.requires||[],i.requiresIfExists||[]).forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&s(l)}}),o.push(i)}return t.forEach(function(i){e.set(i.name,i)}),t.forEach(function(i){n.has(i.name)||s(i)}),o}var eh={placement:"bottom",modifiers:[],strategy:"absolute"};function th(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function Cb(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,o=n===void 0?[]:n,s=e.defaultOptions,i=s===void 0?eh:s;return function(a,l,c){c===void 0&&(c=i);var d,u,p={placement:"bottom",orderedModifiers:[],options:Object.assign({},eh,i),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},h=[],f=!1,m={state:p,setOptions:function(v){var k=typeof v=="function"?v(p.options):v;g(),p.options=Object.assign({},i,p.options,k),p.scrollParents={reference:oo(a)?Or(a):a.contextElement?Or(a.contextElement):[],popper:Or(l)};var y=function(b){var x=xb(b);return pb.reduce(function(w,C){return w.concat(x.filter(function(S){return S.phase===C}))},[])}(function(b){var x=b.reduce(function(w,C){var S=w[C.name];return w[C.name]=S?Object.assign({},S,C,{options:Object.assign({},S.options,C.options),data:Object.assign({},S.data,C.data)}):C,w},{});return Object.keys(x).map(function(w){return x[w]})}([].concat(o,p.options.modifiers)));return p.orderedModifiers=y.filter(function(b){return b.enabled}),p.orderedModifiers.forEach(function(b){var x=b.name,w=b.options,C=w===void 0?{}:w,S=b.effect;if(typeof S=="function"){var E=S({state:p,name:x,instance:m,options:C});h.push(E||function(){})}}),m.update()},forceUpdate:function(){if(!f){var v=p.elements,k=v.reference,y=v.popper;if(th(k,y)){p.rects={reference:wb(k,Br(y),p.options.strategy==="fixed"),popper:ll(y)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(M){return p.modifiersData[M.name]=Object.assign({},M.data)});for(var b=0;b<p.orderedModifiers.length;b++)if(p.reset!==!0){var x=p.orderedModifiers[b],w=x.fn,C=x.options,S=C===void 0?{}:C,E=x.name;typeof w=="function"&&(p=w({state:p,options:S,name:E,instance:m})||p)}else p.reset=!1,b=-1}}},update:(d=function(){return new Promise(function(v){m.forceUpdate(),v(p)})},function(){return u||(u=new Promise(function(v){Promise.resolve().then(function(){u=void 0,v(d())})})),u}),destroy:function(){g(),f=!0}};if(!th(a,l))return m;function g(){h.forEach(function(v){return v()}),h=[]}return m.setOptions(c).then(function(v){!f&&c.onFirstUpdate&&c.onFirstUpdate(v)}),m}}var Sb=Cb({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,o=t.options,s=o.scroll,i=s===void 0||s,a=o.resize,l=a===void 0||a,c=Et(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&d.forEach(function(u){u.addEventListener("scroll",n.update,Fs)}),l&&c.addEventListener("resize",n.update,Fs),function(){i&&d.forEach(function(u){u.removeEventListener("scroll",n.update,Fs)}),l&&c.removeEventListener("resize",n.update,Fs)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=Xp({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,o=n.gpuAcceleration,s=o===void 0||o,i=n.adaptive,a=i===void 0||i,l=n.roundOffsets,c=l===void 0||l,d={placement:Yt(e.placement),variation:qo(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Up(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Up(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},hb,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,o=t.name,s=n.offset,i=s===void 0?[0,0]:s,a=jp.reduce(function(u,p){return u[p]=function(h,f,m){var g=Yt(h),v=[ct,vt].indexOf(g)>=0?-1:1,k=typeof m=="function"?m(Object.assign({},f,{placement:h})):m,y=k[0],b=k[1];return y=y||0,b=(b||0)*v,[ct,_t].indexOf(g)>=0?{x:b,y}:{x:y,y:b}}(p,e.rects,i),u},{}),l=a[e.placement],c=l.x,d=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[o]=a}},bb,{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,o=t.name,s=n.mainAxis,i=s===void 0||s,a=n.altAxis,l=a!==void 0&&a,c=n.boundary,d=n.rootBoundary,u=n.altBoundary,p=n.padding,h=n.tether,f=h===void 0||h,m=n.tetherOffset,g=m===void 0?0:m,v=_r(e,{boundary:c,rootBoundary:d,padding:p,altBoundary:u}),k=Yt(e.placement),y=qo(e.placement),b=!y,x=cl(k),w=x==="x"?"y":"x",C=e.modifiersData.popperOffsets,S=e.rects.reference,E=e.rects.popper,M=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,N=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),T=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,R={x:0,y:0};if(C){if(i){var z,_=x==="y"?vt:ct,I=x==="y"?Ot:_t,O=x==="y"?"height":"width",V=C[x],P=V+v[_],A=V-v[I],L=f?-E[O]/2:0,j=y===Ho?S[O]:E[O],q=y===Ho?-E[O]:-S[O],H=e.elements.arrow,U=f&&H?ll(H):{width:0,height:0},Y=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},J=Y[_],Q=Y[I],oe=Tr(0,S[O],U[O]),fe=b?S[O]/2-L-oe-J-N.mainAxis:j-oe-J-N.mainAxis,le=b?-S[O]/2+L+oe+Q+N.mainAxis:q+oe+Q+N.mainAxis,me=e.elements.arrow&&Br(e.elements.arrow),Be=me?x==="y"?me.clientTop||0:me.clientLeft||0:0,Z=(z=T==null?void 0:T[x])!=null?z:0,se=V+le-Z,ae=Tr(f?Ps(P,V+fe-Z-Be):P,V,f?ro(A,se):A);C[x]=ae,R[x]=ae-V}if(l){var re,Ce=x==="x"?vt:ct,nt=x==="x"?Ot:_t,Oe=C[w],_e=w==="y"?"height":"width",ue=Oe+v[Ce],ge=Oe-v[nt],at=[vt,ct].indexOf(k)!==-1,ft=(re=T==null?void 0:T[w])!=null?re:0,we=at?ue:Oe-S[_e]-E[_e]-ft+N.altAxis,D=at?Oe+S[_e]+E[_e]-ft-N.altAxis:ge,W=f&&at?function(ee,ve,ye){var Re=Tr(ee,ve,ye);return Re>ye?ye:Re}(we,Oe,D):Tr(f?we:ue,Oe,f?D:ge);C[w]=W,R[w]=W-Oe}e.modifiersData[o]=R}},requiresIfExists:["offset"]},mb,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,o=e.rects.reference,s=e.rects.popper,i=e.modifiersData.preventOverflow,a=_r(e,{elementContext:"reference"}),l=_r(e,{altBoundary:!0}),c=Zp(a,o),d=Zp(l,s,i),u=Qp(c),p=Qp(d);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}}]});const nh="mc-popper",Eb={key:0,id:"arrow",class:"mc-popper-arrow","data-popper-arrow":""},Ws=X(K(r.defineComponent({name:nh,__name:"mc-popper",props:{content:{},trigger:{default:"hover"},placement:{default:"top"},disabled:{type:Boolean},popperOptions:{},showTimeout:{default:0},hideTimeout:{default:300},transitionName:{default:"fade"},showArrow:{type:Boolean,default:!0}},emits:["visible:change","click:outside"],setup(t,{expose:e,emit:n}){const o=t,s=n,i=r.ref({}),a=r.ref({}),l=r.ref({}),c=r.ref(),d=r.ref(),u=r.ref(),p=r.ref(!1),h=w=>{o.disabled&&(w=!1),p.value=w,s("visible:change",w)},f=r.computed(()=>({placement:o.placement,modifiers:[{name:"offset",options:{offset:[0,8]}}],...o.popperOptions}));let m,g,v;r.watch(p,w=>{w&&d.value&&u.value&&(m=Sb(d.value,u.value,f.value))},{flush:"post"}),r.onUnmounted(()=>{xe(m)||(m.destroy(),m=void 0)});const k=r.computed(()=>o.trigger==="hover"?o.showTimeout:0),y=r.computed(()=>o.trigger==="hover"?o.hideTimeout:0);r.watchEffect(()=>{i.value={},a.value={},l.value={},o.disabled?x(!1):o.trigger==="click"?i.value.click=()=>{p.value?x():b()}:o.trigger==="hover"&&(i.value.mouseenter=()=>b(),a.value.mouseleave=()=>x(),l.value.mouseenter=()=>b()),g=Is(Os(h,null,!0),k.value),v=Is(Os(h,null,!1),y.value)});const b=(w=!0)=>{v==null||v.cancel(),w?g==null||g():h(!0)},x=(w=!0)=>{g==null||g.cancel(),w?v==null||v():h(!1)};return $s(c,()=>{s("click:outside"),o.trigger==="click"&&p.value&&x(!1)}),e({show:()=>b(!1),hide:()=>x(!1)}),(w,C)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:"mc-popper",ref_key:"containerNode",ref:c},r.toHandlers(a.value,!0)),[r.createElementVNode("div",r.mergeProps({class:"mc-popper-trigger",ref_key:"triggerNode",ref:d},r.toHandlers(i.value,!0)),[r.renderSlot(w.$slots,"default",{},void 0,!0)],16),r.createVNode(r.Transition,{name:t.transitionName},{default:r.withCtx(()=>[p.value?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,class:"mc-popper-popper",ref_key:"popperNode",ref:u},r.toHandlers(l.value,!0)),[r.renderSlot(w.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0),t.showArrow?(r.openBlock(),r.createElementBlock("div",Eb)):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0)]),_:3},8,["name"])],16))}}),[["__scopeId","data-v-10213bd3"]])),oh="mc-tooltip",Mb={class:"mc-tooltip"},Uo=X(K(r.defineComponent({name:oh,__name:"mc-tooltip",props:{iconSize:{default:24},iconName:{default:"Info"},content:{},theme:{default:"light"},placement:{default:"top"},showArrow:{type:Boolean,default:!0},iconColor:{},trigger:{default:"hover"}},setup(t,{expose:e}){const n=r.computed(()=>({strategy:"fixed"})),o=r.ref();return e({hide:()=>{var s;return(s=o.value)==null?void 0:s.hide()},show:()=>{var s;return(s=o.value)==null?void 0:s.show()}}),(s,i)=>(r.openBlock(),r.createElementBlock("div",Mb,[r.createVNode(r.unref(Ws),{ref_key:"popperRef",ref:o,placement:t.placement,"show-arrow":t.showArrow,"popper-options":n.value,trigger:t.trigger},{content:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["mc-tooltip-content",`mc-tooltip-content-${t.theme}`])},[r.renderSlot(s.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)],2)]),default:r.withCtx(()=>[r.renderSlot(s.$slots,"default",{},()=>[r.createVNode(r.unref(ce),{class:"mc-tooltip-icon",name:t.iconName,size:t.iconSize,color:t.iconColor},null,8,["name","size","color"])],!0)]),_:3},8,["placement","show-arrow","popper-options","trigger"])]))}}),[["__scopeId","data-v-cd8fce58"]])),Nb={class:"mc-form"},Bb=r.defineComponent({name:_p,__name:"mc-form",props:{model:{},rules:{default:()=>({})},disabled:{type:Boolean},direction:{default:"vertical"},scrollToError:{type:Boolean,default:!1}},setup(t,{expose:e}){const n=t,o=new Map,s=a=>{if(de(a)){if(Ct(a))return Array.from(o.values());{const l=[];return Ds(a,c=>{const d=o.get(c);d&&l.push(d)}),l}}return o.get(a)},i=(a=[])=>{const l=s(a);Ct(l)||(de(l)?Ds(l,c=>c.clearValidate()):l.clearValidate())};return r.provide(Po,{model:r.computed(()=>n.model),rules:r.computed(()=>n.rules),disabled:r.computed(()=>!!n.disabled),direction:r.computed(()=>n.direction),addFormItem:a=>{Ct(a.prop)||o.set(a.prop,a)},removeFormItem:a=>{Ct(a.prop)||o.delete(a.prop)}}),e({validate:async(a=[],l)=>{try{return i(),await(async(c,d)=>{const u=s(c);if(Ct(u))return d==null||d(!0),!0;try{return await(async p=>{const h=[];for(const f of p)try{await f.validate()}catch(m){h.push(m)}return!Ua(h)||Promise.reject(h)})(de(u)?u:[u]),d==null||d(!0),!0}catch(p){if(p instanceof Error)throw p;const h=p;return d==null||d(!1,h),Promise.reject(h)}})(a,l)}catch(c){return n.scrollToError&&(async d=>{const u=Sn(up(d))[0],p=s(u);if(Ct(p))return;const h=p.id;if(!h.size)return;const f=up(Array.from(h));if(!f)return;const m=document.getElementById(f);m==null||m.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}),await Ga(500),m==null||m.focus()})(c),Promise.reject(c)}},resetFields:(a=[])=>{const l=s(a);Ct(l)||(de(l)?Ds(l,c=>c.resetField()):l.resetField())},clearValidate:i}),(a,l)=>(r.openBlock(),r.createElementBlock("div",Nb,[r.createElementVNode("form",{onSubmit:l[0]||(l[0]=r.withModifiers(()=>{},["prevent"]))},[r.renderSlot(a.$slots,"default",{},void 0,!0)],32)]))}}),rh=X(K(Bb,[["__scopeId","data-v-67e22718"]])),fl=Symbol("mc-form-item-context"),sh="mc-form-item",Tb={class:"mc-form-item-label-wrapper"},Ob={key:0,class:"mc-form-item-label"},_b={key:0,class:"mc-form-item-help"},Ab={key:0,class:"mc-form-item-desc"},Vb={class:"mc-form-item__content"},Ib={key:0,class:"mc-form-item__error"},Db=r.defineComponent({name:sh,__name:"mc-form-item",props:{prop:{default:""},label:{},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},rules:{},help:{},desc:{}},setup(t){const e=t,n=r.reactive(new Map),o=r.reactive(new Map),s=r.computed(()=>o.values().next().value),i=r.inject(Po,void 0),{addFormId:a,removeFormId:l}=(v=>{const k=r.inject(Po,void 0),y=new Map,b=ke("prop"),x=()=>{if(xe(b.value))return;const C=de(b.value)?b.value:[b.value];for(const S of C){const E=v(S);y.set(S,E),k==null||k.addFormItem(E)}},w=()=>{for(const C of y.values())k==null||k.removeFormItem(C)};return r.onBeforeMount(()=>{x()}),r.onUnmounted(()=>{w()}),r.watch(()=>b.value,C=>{w(),Ct(C)||x()},{deep:!0}),{formItemInstances:y,addFormId:(C,S)=>{const E=y.get(C);E&&E.id.add(S)},removeFormId:(C,S)=>{const E=y.get(C);E&&E.id.delete(S)}}})(v=>(n.set(v,"init"),{prop:v,id:new Set,validate:c(v),resetField:d(v),clearValidate:h})),c=v=>async(k,y)=>f(v,k,y),d=v=>async()=>{const k=i==null?void 0:i.model.value;xe(k)||(k[v]=u(v),await r.nextTick(),h())},{getInitialValue:u}=(()=>{const v=r.inject(Po,void 0),k=ke("prop"),y=new Map;return r.watch(()=>k.value,b=>{(x=>{const w=v==null?void 0:v.model.value;if(xe(x)||Ct(x))y.clear();else if(de(x))for(const C of x)y.set(C,Ao(w,C));else y.set(x,Ao(w,x))})(b)}),{getInitialValue:b=>{if(!xe(b))return As(y.get(b),5)}}})();let p=!1;const h=()=>{for(const v of n.keys())n.set(v,"init");for(const v of o.keys())o.delete(v);p=!1},f=async(v,k,y)=>{if(p||e.disabled)return Promise.resolve(!0);const b=(C=>{const S=[],E=!!e.required;E&&S.push({required:!0}),e.rules&&S.push(...e.rules);const M=i==null?void 0:i.rules.value;if(M){const N=Ao(M,C);N&&S.push(...N)}if(E){const N=br(Mn(S,(T,R)=>[T,R]),T=>gt(Sn(T[0]),"required"));if(Ua(N))for(const T of N){const[R,z]=T;R.required!==E&&(S[z]={...R,required:E})}else S.push({required:E})}return S})(v),x=((C,S)=>br(C,E=>!(!E.trigger&&S&&S!=="change")&&(!E.trigger||!S||(de(E.trigger)?gt(E.trigger,S):E.trigger===S))).map(({trigger:E,...M})=>M))(b,k);if(Ct(x))return y==null||y(!0),Promise.resolve(!0);n.set(v,"validating");const w=((C,S)=>{const E=new Sr({[C]:S}),M=i==null?void 0:i.model.value;return E.validate({[C]:Ao(M,C)},{firstFields:!0})})(v,x);try{return await w,n.set(v,"success"),o.delete(v),y==null||y(!0),Promise.resolve(!0)}catch(C){const{errors:S,fields:E}=C;n.set(v,"error");const M=S&&Ua(S)>0?S[0].message??"":"";return o.set(v,M),y==null||y(!1,E),Promise.reject(E)}},m=r.computed(()=>(i==null?void 0:i.direction.value)==="horizontal"),g=r.computed(()=>{var b;if(e.required)return!0;if((b=e.rules)!=null&&b.length)return Sp(e.rules,x=>!!x.required);const v=i==null?void 0:i.rules.value,k=de(e.prop)?e.prop:[e.prop],y=[];for(const x of k){const w=Ao(v,x);w&&y.push(...w)}return Sp(y,x=>!!x.required)});return r.provide(fl,{disabled:r.computed(()=>e.disabled),validateStatus:n,prop:r.computed(()=>e.prop),addFormId:a,removeFormId:l,validate:f}),(v,k)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-form-item",{"mc-form-item-horizontal":m.value}])},[r.renderSlot(v.$slots,"label",{required:g.value},()=>[r.createElementVNode("div",null,[r.createElementVNode("div",Tb,[t.label?(r.openBlock(),r.createElementBlock("label",Ob,[r.createElementVNode("span",{class:r.normalizeClass(["mc-form-item-lable-text",{"mc-form-item-label-required":g.value}])},r.toDisplayString(t.label),3),t.help||v.$slots.help?(r.openBlock(),r.createElementBlock("div",_b,[r.renderSlot(v.$slots,"help",{},()=>[r.createVNode(r.unref(Uo),{content:t.help,"icon-size":20},null,8,["content"])],!0)])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.renderSlot(v.$slots,"tool",{},void 0,!0)]),t.desc||v.$slots.desc?(r.openBlock(),r.createElementBlock("div",Ab,[r.renderSlot(v.$slots,"desc",{},()=>[r.createTextVNode(r.toDisplayString(t.desc),1)],!0)])):r.createCommentVNode("",!0)])],!0),r.createElementVNode("div",Vb,[r.renderSlot(v.$slots,"default",{},void 0,!0),r.createVNode(r.Transition,{name:"mc-form-item-error"},{default:r.withCtx(()=>[s.value?(r.openBlock(),r.createElementBlock("div",Ib,r.toDisplayString(s.value),1)):r.createCommentVNode("",!0)]),_:1})])],2))}}),ih=X(K(Db,[["__scopeId","data-v-09bf5320"]])),ah=({externalId:t,externalDisabled:e}={})=>{const n=r.inject(Po,void 0),o=r.inject(fl,void 0),s=ke(["validateProp","validate-prop"]),i=(c=>{const d=ke("id");if(d.value)return d.value;{const u=((p=10)=>String(Date.now()).slice(-p))();return c?`${c}-${u}`:u}})((t==null?void 0:t.value)??"mc-form-item");r.onMounted(()=>{a()}),r.onBeforeUnmount(()=>{a("remove")});const a=(c="add")=>{const d=s.value;if(d)c==="add"?o==null||o.addFormId(d,i):o==null||o.removeFormId(d,i);else{const u=o==null?void 0:o.prop.value;if(Ct(u))return;const p=de(u)?u:[u];for(const h of p)c==="add"?h&&(o==null||o.addFormId(h,i)):h&&(o==null||o.removeFormId(h,i))}},l=(({formCtx:c,formItemCtx:d,externalDisabled:u})=>{const p=ke("disabled");return r.computed(()=>p.value||!!(c!=null&&c.disabled.value)||!!(d!=null&&d.disabled.value)||!!(u!=null&&u.value))})({formCtx:n,formItemCtx:o,externalDisabled:e});return{formCtx:n,formItemCtx:o,formId:i,formDisabled:l}},cn=({externalId:t,externalDisabled:e,disableValidation:n,validator:o}={})=>{const s=ke(["disableValidation","disable-validation"]),i=ke(["validateProp","validate-prop"]),a=r.computed(()=>!!s.value||!!(n!=null&&n.value)),{formCtx:l,formItemCtx:c,formId:d,formDisabled:u}=ah({externalId:t,externalDisabled:e}),p=r.computed(()=>{if(a.value)return"init";if(Ve(o)&&o()==="error")return"error";const b=c==null?void 0:c.validateStatus;return b!=null&&b.size?i.value?b.get(i.value)||"init":b.values().next().value||"init":"init"}),h=r.computed(()=>a.value?"":`mc-form-validate-${p.value}`),f=r.computed(()=>!a.value&&p.value==="error"),m=r.computed(()=>!a.value&&p.value==="success"),g=ke(["hideValidationIcon","hide-validation-icon"]),v=r.computed(()=>!a.value&&!g.value&&(f.value?"Reject_02":!!m.value&&"Accept_02")),k=ke("modelValue");r.watch(()=>k.value,()=>{y("change")});const y=async b=>{if(!a.value)try{if(i.value)await(c==null?void 0:c.validate(i.value,b));else{const x=c==null?void 0:c.prop.value;if(x){const w=de(x)?x:[x],C=[];for(const S of w)C.push(c==null?void 0:c.validate(S,b));await Promise.all(C)}}}catch(x){console.error("[mc-form] validate error: ",x)}};return{formCtx:l,formItemCtx:c,formId:d,formDisabled:u,validateStatus:p,validateStyle:h,isError:f,isSuccess:m,statusIcon:v,validateByTrigger:y}},lh="mc-checkbox",ml=Symbol("mc-checkbox-group-context"),ch="mc-checkbox-group",Rb={class:"mc-checkbox"},Lb=["id","value","disabled","onKeypress"],zb={key:0,class:"mc-checkbox-content"},$b={key:0,class:"mc-checkbox-remarks"},Pb=r.defineComponent({name:lh,__name:"mc-checkbox",props:{modelValue:{type:Boolean},disabled:{type:Boolean},content:{},remarks:{},partial:{type:Boolean},disableValidation:{type:Boolean,default:!1},value:{}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:e}){const n=t,o=e,s=r.ref(),{wrapperRef:i,isFocused:a,handleFocus:l,handleBlur:c}=$o(s),{checkboxGroupDisabled:d,isCheckboxGroup:u,isCheckboxSelected:p,handleCheckboxSelect:h}=(()=>{const b=r.inject(ml,void 0),x=r.computed(()=>{var C;return!!((C=b==null?void 0:b.disabled)!=null&&C.value)}),w=r.computed(()=>!!b&&Ve(b==null?void 0:b.handleSelect));return{checkboxGroupCtx:b,checkboxGroupDisabled:x,isCheckboxGroup:w,isCheckboxSelected:C=>{var S;return!xe(C)&>((S=b==null?void 0:b.modelValue)==null?void 0:S.value,C)},handleCheckboxSelect:C=>{b==null||b.handleSelect(C)}}})(),{formId:f,formDisabled:m,validateStyle:g,validateByTrigger:v}=cn({externalDisabled:d}),k=r.computed(()=>u.value?p(n.value):!!n.modelValue),y=async()=>{m.value||(u.value?h(n.value):(o("update:modelValue",!n.modelValue),o("change",!n.modelValue),await r.nextTick(),v("input")))};return(b,x)=>(r.openBlock(),r.createElementBlock("div",Rb,[r.createElementVNode("label",{ref_key:"checkboxRef",ref:i,class:r.normalizeClass(["mc-checkbox-wrapper",{"mc-checkbox-disabled":r.unref(m),"mc-checkbox-checked":k.value,"mc-checkbox-partial":t.partial,"mc-checkbox-focused":r.unref(a),[r.unref(g)]:r.unref(g)}]),onClick:r.withModifiers(y,["prevent"])},[r.createElementVNode("input",{ref_key:"checkboxInputRef",ref:s,id:r.unref(f),type:"checkbox",class:"mc-checkbox-input",value:k.value,disabled:r.unref(m),onKeypress:r.withKeys(r.withModifiers(y,["prevent","stop"]),["enter"]),onFocus:x[0]||(x[0]=(...w)=>r.unref(l)&&r.unref(l)(...w)),onBlur:x[1]||(x[1]=(...w)=>r.unref(c)&&r.unref(c)(...w))},null,40,Lb),x[2]||(x[2]=r.createElementVNode("div",{class:"mc-checkbox-box"},null,-1)),t.content||b.$slots.default?(r.openBlock(),r.createElementBlock("div",zb,[r.renderSlot(b.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)])):r.createCommentVNode("",!0)],2),t.remarks||b.$slots.remarks?(r.openBlock(),r.createElementBlock("div",$b,[r.renderSlot(b.$slots,"remarks",{},()=>[r.createTextVNode(r.toDisplayString(t.remarks),1)],!0)])):r.createCommentVNode("",!0)]))}}),so=X(K(Pb,[["__scopeId","data-v-7a17545f"]])),jb=["id"],dh=X(r.defineComponent({name:ch,__name:"mc-checkbox-group",props:{modelValue:{default:()=>[]},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,{formId:s,validateByTrigger:i}=cn();return r.provide(ml,{modelValue:r.computed(()=>n.modelValue),disabled:r.computed(()=>n.disabled),handleSelect:async a=>{if(!a)return;const l=[...n.modelValue],c=hp(l,a);c>-1?l.splice(c,1):l.push(a),o("update:modelValue",l),o("change",l),await r.nextTick(),i("input")}}),(a,l)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-checkbox-group",id:r.unref(s)},[r.renderSlot(a.$slots,"default")],8,jb))}})),gl=Symbol("mc-collapse-context"),uh="mc-collapse",Fb={class:"mc-collapse"},ph=X(K(r.defineComponent({name:uh,__name:"mc-collapse",props:{modelValue:{default:()=>[]},accordion:{type:Boolean,default:!1},transition:{type:Boolean,default:!1},destroyOnHide:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e;return r.watchEffect(()=>{n.accordion&&n.modelValue.length}),r.provide(gl,{activeNames:r.computed(()=>n.modelValue),transition:r.computed(()=>n.transition),destroyOnHide:r.computed(()=>n.destroyOnHide),handleItemClick:s=>{let i=[...n.modelValue??[]];if(n.accordion)i=[i[0]===s?"":s];else{const a=i.indexOf(s);a>-1?i.splice(a,1):i.push(s)}o("update:modelValue",i),o("change",i)}}),(s,i)=>(r.openBlock(),r.createElementBlock("div",Fb,[r.renderSlot(s.$slots,"default",{},void 0,!0)]))}}),[["__scopeId","data-v-b551884b"]])),hh="mc-icon-plus",Hb=r.defineComponent({name:hh,__name:"mc-icon-plus",props:{name:{},size:{default:24},width:{},height:{},color:{},cursor:{default:"default"}},emits:["click"],setup(t,{emit:e}){const n=t,o=e,{width:s,height:i}=$t(),a=r.computed(()=>n.width?s.value:`${n.size}px`),l=r.computed(()=>n.height?i.value:`${n.size}px`),c=()=>{o("click",n.name)};return(d,u)=>(r.openBlock(),r.createElementBlock("span",{class:"mc-icon-plus",style:r.normalizeStyle({fontSize:`${t.size}px`,width:a.value,height:l.value,color:t.color,cursor:t.cursor}),onClick:c},[r.createElementVNode("i",{class:r.normalizeClass(["mc-iconfont-plus",`mc-icon-plus-${t.name}`])},null,2)],4))}}),fh=K(Hb,[["__scopeId","data-v-779c77bf"]]),Bn=X(fh),mh="mc-collapse-item",Wb={class:"mc-collapse-item-header"},Kb={class:"mc-collapse-item-title"},qb={key:0,class:"mc-collapse-item-content"},Ub=r.defineComponent({name:mh,__name:"mc-collapse-item",props:{name:{},title:{},disabled:{type:Boolean}},setup(t){const e=r.inject(gl,void 0),n=r.computed(()=>{var l;return!!((l=e==null?void 0:e.activeNames.value)!=null&&l.includes(t.name))}),o=r.computed(()=>!!(e!=null&&e.transition.value)),s=r.computed(()=>!!(e!=null&&e.destroyOnHide.value)),i=r.computed(()=>!s.value||n.value),a=()=>{t.disabled||(e==null||e.handleItemClick(t.name))};return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-collapse-item",onClick:a},[r.createElementVNode("div",Wb,[r.createElementVNode("span",Kb,[r.renderSlot(l.$slots,"title",{isActive:n.value},()=>[r.createTextVNode(r.toDisplayString(t.title),1)],!0)]),r.createElementVNode("span",{class:r.normalizeClass(["triangle-icon",{"triangle-icon-active":n.value}])},[r.createVNode(r.unref(Bn),{name:"down-chevron",cursor:"pointer"})],2)]),r.createVNode(r.Transition,{name:"mc-collapse-item-content-"+(o.value?"transition":"no-transition")},{default:r.withCtx(()=>[i.value?r.withDirectives((r.openBlock(),r.createElementBlock("div",qb,[r.renderSlot(l.$slots,"default",{isActive:n.value},void 0,!0)],512)),[[r.vShow,n.value]]):r.createCommentVNode("",!0)]),_:3},8,["name"])]))}}),gh=X(K(Ub,[["__scopeId","data-v-4d4a75b5"]])),vh="mc-toast",Gb={key:0,class:"mc-toast-msg-icon"},Jb={key:1,class:"mc-toast-msg-text"},Yb={class:"mc-toast-msg-close-container"},Xb={key:0,class:"mc-toast-countdown"},Zb={key:1,class:"mc-toast-msg-close"},Qb={key:0,class:"mc-toast-content-container"},yh=K(r.defineComponent({name:vh,__name:"mc-toast",props:{type:{default:"info"},message:{},content:{},closable:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},duration:{default:void 0},hideIcon:{type:Boolean,default:!1},countDownIcon:{type:Boolean,default:!0},width:{},onClose:{}},emits:["close"],setup(t,{expose:e,emit:n}){const o=t,s=n,i=r.computed(()=>{if(!o.hideIcon)switch(o.type){case"success":return"Accept_02";case"error":return"Error_04";case"warning":return"Error_02";case"info":return"Info_02";default:return}}),a=r.computed(()=>o.countDownIcon&&!!o.duration),l=r.computed(()=>o.duration||3e3),c=r.ref(Math.floor(l.value/1e3));let d=null;o.autoClose&&(d=setInterval(()=>{c.value>0?c.value--:u()},1e3));const u=()=>{p(),s("close")},p=()=>{d&&clearInterval(d)};return r.onUnmounted(()=>{p()}),e({close:u}),(h,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-toast",[`mc-toast-${t.type}`]]),style:r.normalizeStyle({width:t.width})},[r.createElementVNode("div",{class:r.normalizeClass(["mc-toast-msg-container",{"mc-toast-has-content":t.content||h.$slots.content}])},[i.value?(r.openBlock(),r.createElementBlock("div",Gb,[r.createVNode(r.unref(ce),{name:i.value},null,8,["name"])])):r.createCommentVNode("",!0),t.message||h.$slots.default?(r.openBlock(),r.createElementBlock("div",Jb,[r.renderSlot(h.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.message),1)],!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",Yb,[a.value?(r.openBlock(),r.createElementBlock("div",Xb,r.toDisplayString(c.value),1)):r.createCommentVNode("",!0),t.closable?(r.openBlock(),r.createElementBlock("div",Zb,[r.createVNode(r.unref(ce),{name:"Cross",onClick:u})])):r.createCommentVNode("",!0)])],2),t.content||h.$slots.content?(r.openBlock(),r.createElementBlock("div",Qb,[r.renderSlot(h.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)])):r.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-bcfcc654"]]),dn=[];let je=null;const Ks=t=>{let e={};e=typeof t=="string"?{message:t}:{...t},e.type=e.type||"info",e.autoClose=e.autoClose!==!1,e.closable=e.closable!==!1,dn.length>=5&&dn.length>0&&dn[0].close();const n=je||(je=document.createElement("div"),je.className="mc-toast-container",je.style.position="fixed",je.style.top="5vh",je.style.left="50%",je.style.transform="translateX(-50%)",je.style.zIndex="9999",je.style.display="flex",je.style.flexDirection="column",je.style.gap="12px",je.style.pointerEvents="none",document.body.appendChild(je),je),o=document.createElement("div");o.style.pointerEvents="auto",o.style.animation="toast-slide-in 0.3s ease-out";const s=Date.now().toString(36)+Math.random().toString(36).slice(2),i=r.createVNode(yh,{...e,onClose:()=>{o.style.animation="toast-slide-out 0.3s ease-in",e.onClose&&e.onClose(),setTimeout(()=>{(l=>{const c=dn.findIndex(d=>d.id===l);if(c!==-1){const d=dn[c];r.render(null,d.wrapper),je&&je.contains(d.wrapper)&&je.removeChild(d.wrapper),dn.splice(c,1),je&&document.body.contains(je)&&dn.length===0&&(document.body.removeChild(je),je=null)}})(s)},300)}});r.render(i,o),n.appendChild(o);const a={id:s,wrapper:o,close:()=>{var c;const l=i.component;l&&l.exposed&&((c=l.exposed)==null||c.close())}};return dn.push(a),{...a}},qs={success:t=>Ks(typeof t=="string"?{message:t,type:"success"}:{...t,type:"success"}),error:t=>Ks(typeof t=="string"?{message:t,type:"error"}:{...t,type:"error"}),warning:t=>Ks(typeof t=="string"?{message:t,type:"warning"}:{...t,type:"warning"}),info:t=>Ks(typeof t=="string"?{message:t,type:"info"}:{...t,type:"info"}),closeAll:()=>{dn.forEach(t=>{t.close()})}};(()=>{if(document.getElementById("mc-toast-v2-styles"))return;const t=document.createElement("style");t.id="mc-toast-v2-styles",t.textContent=`
|
|
14
|
+
`).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),a=new RegExp("(?:^"+o+"$)|(?:^"+s+"$)"),l=new RegExp("^"+o+"$"),c=new RegExp("^"+s+"$"),d=function(h){return h&&h.exact?a:new RegExp("(?:"+n(h)+o+n(h)+")|(?:"+n(h)+s+n(h)+")","g")};d.v4=function(h){return h&&h.exact?l:new RegExp(""+n(h)+o+n(h),"g")},d.v6=function(h){return h&&h.exact?c:new RegExp(""+n(h)+s+n(h),"g")};var u=d.v4().source,p=d.v6().source;return el=new RegExp("(?:^(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|"+u+"|"+p+'|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?$)',"i")}())},hex:function(t){return typeof t=="string"&&!!t.match(ik)}},Po="enum",lt=Rp,Pt=function(t,e,n,o,i){if(t.required&&e===void 0)Rp(t,e,n,o,i);else{var s=t.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(s)>-1?xr[s](e)||o.push(St(i.messages.types[s],t.fullField,t.type)):s&&typeof e!==t.type&&o.push(St(i.messages.types[s],t.fullField,t.type))}},jo=function(t,e,n,o,i){var s=typeof t.len=="number",a=typeof t.min=="number",l=typeof t.max=="number",c=e,d=null,u=typeof e=="number",p=typeof e=="string",h=Array.isArray(e);if(u?d="number":p?d="string":h&&(d="array"),!d)return!1;h&&(c=e.length),p&&(c=e.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),s?c!==t.len&&o.push(St(i.messages[d].len,t.fullField,t.len)):a&&!l&&c<t.min?o.push(St(i.messages[d].min,t.fullField,t.min)):l&&!a&&c>t.max?o.push(St(i.messages[d].max,t.fullField,t.max)):a&&l&&(c<t.min||c>t.max)&&o.push(St(i.messages[d].range,t.fullField,t.min,t.max))},Lp=function(t,e,n,o,i){t.pattern&&(t.pattern instanceof RegExp?(t.pattern.lastIndex=0,t.pattern.test(e)||o.push(St(i.messages.pattern.mismatch,t.fullField,e,t.pattern))):typeof t.pattern=="string"&&(new RegExp(t.pattern).test(e)||o.push(St(i.messages.pattern.mismatch,t.fullField,e,t.pattern))))},tl=function(t,e,n,o,i){var s=t.type,a=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(qe(e,s)&&!t.required)return n();lt(t,e,o,a,i,s),qe(e,s)||Pt(t,e,o,a,i)}n(a)},Cr={string:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(qe(e,"string")&&!t.required)return n();lt(t,e,o,s,i,"string"),qe(e,"string")||(Pt(t,e,o,s,i),jo(t,e,0,s,i),Lp(t,e,0,s,i),t.whitespace===!0&&function(a,l,c,d,u){(/^\s+$/.test(l)||l==="")&&d.push(St(u.messages.whitespace,a.fullField))}(t,e,0,s,i))}n(s)},method:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(qe(e)&&!t.required)return n();lt(t,e,o,s,i),e!==void 0&&Pt(t,e,o,s,i)}n(s)},number:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(e===""&&(e=void 0),qe(e)&&!t.required)return n();lt(t,e,o,s,i),e!==void 0&&(Pt(t,e,o,s,i),jo(t,e,0,s,i))}n(s)},boolean:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(qe(e)&&!t.required)return n();lt(t,e,o,s,i),e!==void 0&&Pt(t,e,o,s,i)}n(s)},regexp:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(qe(e)&&!t.required)return n();lt(t,e,o,s,i),qe(e)||Pt(t,e,o,s,i)}n(s)},integer:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(qe(e)&&!t.required)return n();lt(t,e,o,s,i),e!==void 0&&(Pt(t,e,o,s,i),jo(t,e,0,s,i))}n(s)},float:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(qe(e)&&!t.required)return n();lt(t,e,o,s,i),e!==void 0&&(Pt(t,e,o,s,i),jo(t,e,0,s,i))}n(s)},array:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(e==null&&!t.required)return n();lt(t,e,o,s,i,"array"),e!=null&&(Pt(t,e,o,s,i),jo(t,e,0,s,i))}n(s)},object:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(qe(e)&&!t.required)return n();lt(t,e,o,s,i),e!==void 0&&Pt(t,e,o,s,i)}n(s)},enum:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(qe(e)&&!t.required)return n();lt(t,e,o,s,i),e!==void 0&&function(a,l,c,d,u){a[Po]=Array.isArray(a[Po])?a[Po]:[],a[Po].indexOf(l)===-1&&d.push(St(u.messages[Po],a.fullField,a[Po].join(", ")))}(t,e,0,s,i)}n(s)},pattern:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(qe(e,"string")&&!t.required)return n();lt(t,e,o,s,i),qe(e,"string")||Lp(t,e,0,s,i)}n(s)},date:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(qe(e,"date")&&!t.required)return n();var a;lt(t,e,o,s,i),qe(e,"date")||(a=e instanceof Date?e:new Date(e),Pt(t,a,o,s,i),a&&jo(t,a.getTime(),0,s,i))}n(s)},url:tl,hex:tl,email:tl,required:function(t,e,n,o,i){var s=[],a=Array.isArray(e)?"array":typeof e;lt(t,e,o,s,i,a),n(s)},any:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(qe(e)&&!t.required)return n();lt(t,e,o,s,i)}n(s)}};function nl(){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 t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var ol=nl(),Sr=function(){function t(n){this.rules=null,this._messages=ol,this.define(n)}var e=t.prototype;return e.define=function(n){var o=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(typeof n!="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(i){var s=n[i];o.rules[i]=Array.isArray(s)?s:[s]})},e.messages=function(n){return n&&(this._messages=Dp(nl(),n)),this._messages},e.validate=function(n,o,i){var s=this;o===void 0&&(o={}),i===void 0&&(i=function(){});var a=n,l=o,c=i;if(typeof l=="function"&&(c=l,l={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,a),Promise.resolve(a);if(l.messages){var d=this.messages();d===ol&&(d=nl()),Dp(d,l.messages),l.messages=d}else l.messages=this.messages();var u={};(l.keys||Object.keys(this.rules)).forEach(function(h){var f=s.rules[h],m=a[h];f.forEach(function(g){var v=g;typeof v.transform=="function"&&(a===n&&(a=to({},a)),m=a[h]=v.transform(m)),(v=typeof v=="function"?{validator:v}:to({},v)).validator=s.getValidationMethod(v),v.validator&&(v.field=h,v.fullField=v.fullField||h,v.type=s.getType(v),u[h]=u[h]||[],u[h].push({rule:v,value:m,source:a,field:h}))})});var p={};return function(h,f,m,g,v){if(f.first){var b=new Promise(function(E,M){var N=function(T){var R=[];return Object.keys(T).forEach(function(z){R.push.apply(R,T[z]||[])}),R}(h);Ap(N,m,function(T){return g(T),T.length?M(new Vp(T,Qa(T))):E(v)})});return b.catch(function(E){return E}),b}var y=f.firstFields===!0?Object.keys(h):f.firstFields||[],k=Object.keys(h),x=k.length,w=0,S=[],C=new Promise(function(E,M){var N=function(T){if(S.push.apply(S,T),++w===x)return g(S),S.length?M(new Vp(S,Qa(S))):E(v)};k.length||(g(S),E(v)),k.forEach(function(T){var R=h[T];y.indexOf(T)!==-1?Ap(R,m,N):function(z,_,I){var O=[],V=0,P=z.length;function A(L){O.push.apply(O,L||[]),++V===P&&I(O)}z.forEach(function(L){_(L,A)})}(R,m,N)})});return C.catch(function(E){return E}),C}(u,l,function(h,f){var m,g=h.rule,v=!(g.type!=="object"&&g.type!=="array"||typeof g.fields!="object"&&typeof g.defaultField!="object");function b(k,x){return to({},x,{fullField:g.fullField+"."+k,fullFields:g.fullFields?[].concat(g.fullFields,[k]):[k]})}function y(k){k===void 0&&(k=[]);var x=Array.isArray(k)?k:[k];!l.suppressWarning&&x.length&&t.warning("async-validator:",x),x.length&&g.message!==void 0&&(x=[].concat(g.message));var w=x.map(Ip(g,a));if(l.first&&w.length)return p[g.field]=1,f(w);if(v){if(g.required&&!h.value)return g.message!==void 0?w=[].concat(g.message).map(Ip(g,a)):l.error&&(w=[l.error(g,St(l.messages.required,g.field))]),f(w);var S={};g.defaultField&&Object.keys(h.value).map(function(M){S[M]=g.defaultField}),S=to({},S,h.rule.fields);var C={};Object.keys(S).forEach(function(M){var N=S[M],T=Array.isArray(N)?N:[N];C[M]=T.map(b.bind(null,M))});var E=new t(C);E.messages(l.messages),h.rule.options&&(h.rule.options.messages=l.messages,h.rule.options.error=l.error),E.validate(h.value,h.rule.options||l,function(M){var N=[];w&&w.length&&N.push.apply(N,w),M&&M.length&&N.push.apply(N,M),f(N.length?N:null)})}else f(w)}if(v=v&&(g.required||!g.required&&h.value),g.field=h.field,g.asyncValidator)m=g.asyncValidator(g,h.value,y,h.source,l);else if(g.validator){try{m=g.validator(g,h.value,y,h.source,l)}catch(k){console.error==null||console.error(k),l.suppressValidatorError||setTimeout(function(){throw k},0),y(k.message)}m===!0?y():m===!1?y(typeof g.message=="function"?g.message(g.fullField||g.field):g.message||(g.fullField||g.field)+" fails"):m instanceof Array?y(m):m instanceof Error&&y(m.message)}m&&m.then&&m.then(function(){return y()},function(k){return y(k)})},function(h){(function(f){var m=[],g={};function v(y){var k;Array.isArray(y)?m=(k=m).concat.apply(k,y):m.push(y)}for(var b=0;b<f.length;b++)v(f[b]);m.length?(g=Qa(m),c(m,g)):c(null,a)})(h)},a)},e.getType=function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!Cr.hasOwnProperty(n.type))throw new Error(St("Unknown rule type %s",n.type));return n.type||"string"},e.getValidationMethod=function(n){if(typeof n.validator=="function")return n.validator;var o=Object.keys(n),i=o.indexOf("message");return i!==-1&&o.splice(i,1),o.length===1&&o[0]==="required"?Cr.required:Cr[this.getType(n)]||void 0},t}();Sr.register=function(t,e){if(typeof e!="function")throw new Error("Cannot register a validator by type, validator is not a function");Cr[t]=e},Sr.warning=_p,Sr.messages=ol,Sr.validators=Cr;var vt="top",Ot="bottom",_t="right",ct="left",rl="auto",Er=[vt,Ot,_t,ct],Fo="start",Mr="end",zp="viewport",Nr="popper",$p=Er.reduce(function(t,e){return t.concat([e+"-"+Fo,e+"-"+Mr])},[]),Pp=[].concat(Er,[rl]).reduce(function(t,e){return t.concat([e,e+"-"+Fo,e+"-"+Mr])},[]),sk=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Gt(t){return t?(t.nodeName||"").toLowerCase():null}function Et(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function no(t){return t instanceof Et(t).Element||t instanceof Element}function At(t){return t instanceof Et(t).HTMLElement||t instanceof HTMLElement}function il(t){return typeof ShadowRoot<"u"&&(t instanceof Et(t).ShadowRoot||t instanceof ShadowRoot)}const ak={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var o=e.styles[n]||{},i=e.attributes[n]||{},s=e.elements[n];At(s)&&Gt(s)&&(Object.assign(s.style,o),Object.keys(i).forEach(function(a){var l=i[a];l===!1?s.removeAttribute(a):s.setAttribute(a,l===!0?"":l)}))})},effect:function(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(o){var i=e.elements[o],s=e.attributes[o]||{},a=Object.keys(e.styles.hasOwnProperty(o)?e.styles[o]:n[o]).reduce(function(l,c){return l[c]="",l},{});At(i)&&Gt(i)&&(Object.assign(i.style,a),Object.keys(s).forEach(function(l){i.removeAttribute(l)}))})}},requires:["computeStyles"]};function Yt(t){return t.split("-")[0]}var oo=Math.max,$i=Math.min,Ho=Math.round;function sl(){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 jp(){return!/^((?!chrome|android).)*safari/i.test(sl())}function Wo(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var o=t.getBoundingClientRect(),i=1,s=1;e&&At(t)&&(i=t.offsetWidth>0&&Ho(o.width)/t.offsetWidth||1,s=t.offsetHeight>0&&Ho(o.height)/t.offsetHeight||1);var a=(no(t)?Et(t):window).visualViewport,l=!jp()&&n,c=(o.left+(l&&a?a.offsetLeft:0))/i,d=(o.top+(l&&a?a.offsetTop:0))/s,u=o.width/i,p=o.height/s;return{width:u,height:p,top:d,right:c+u,bottom:d+p,left:c,x:c,y:d}}function al(t){var e=Wo(t),n=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:o}}function Fp(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&il(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function an(t){return Et(t).getComputedStyle(t)}function lk(t){return["table","td","th"].indexOf(Gt(t))>=0}function Mn(t){return((no(t)?t.ownerDocument:t.document)||window.document).documentElement}function Pi(t){return Gt(t)==="html"?t:t.assignedSlot||t.parentNode||(il(t)?t.host:null)||Mn(t)}function Hp(t){return At(t)&&an(t).position!=="fixed"?t.offsetParent:null}function Br(t){for(var e=Et(t),n=Hp(t);n&&lk(n)&&an(n).position==="static";)n=Hp(n);return n&&(Gt(n)==="html"||Gt(n)==="body"&&an(n).position==="static")?e:n||function(o){var i=/firefox/i.test(sl());if(/Trident/i.test(sl())&&At(o)&&an(o).position==="fixed")return null;var s=Pi(o);for(il(s)&&(s=s.host);At(s)&&["html","body"].indexOf(Gt(s))<0;){var a=an(s);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||i&&a.willChange==="filter"||i&&a.filter&&a.filter!=="none")return s;s=s.parentNode}return null}(t)||e}function ll(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Tr(t,e,n){return oo(t,$i(e,n))}function Wp(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Kp(t,e){return e.reduce(function(n,o){return n[o]=t,n},{})}const ck={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,o=t.name,i=t.options,s=n.elements.arrow,a=n.modifiersData.popperOffsets,l=Yt(n.placement),c=ll(l),d=[ct,_t].indexOf(l)>=0?"height":"width";if(s&&a){var u=function(E,M){return Wp(typeof(E=typeof E=="function"?E(Object.assign({},M.rects,{placement:M.placement})):E)!="number"?E:Kp(E,Er))}(i.padding,n),p=al(s),h=c==="y"?vt:ct,f=c==="y"?Ot:_t,m=n.rects.reference[d]+n.rects.reference[c]-a[c]-n.rects.popper[d],g=a[c]-n.rects.reference[c],v=Br(s),b=v?c==="y"?v.clientHeight||0:v.clientWidth||0:0,y=m/2-g/2,k=u[h],x=b-p[d]-u[f],w=b/2-p[d]/2+y,S=Tr(k,w,x),C=c;n.modifiersData[o]=((e={})[C]=S,e.centerOffset=S-w,e)}},effect:function(t){var e=t.state,n=t.options.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o!="string"||(o=e.elements.popper.querySelector(o)))&&Fp(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ko(t){return t.split("-")[1]}var dk={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Up(t){var e,n=t.popper,o=t.popperRect,i=t.placement,s=t.variation,a=t.offsets,l=t.position,c=t.gpuAcceleration,d=t.adaptive,u=t.roundOffsets,p=t.isFixed,h=a.x,f=h===void 0?0:h,m=a.y,g=m===void 0?0:m,v=typeof u=="function"?u({x:f,y:g}):{x:f,y:g};f=v.x,g=v.y;var b=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),k=ct,x=vt,w=window;if(d){var S=Br(n),C="clientHeight",E="clientWidth";S===Et(n)&&an(S=Mn(n)).position!=="static"&&l==="absolute"&&(C="scrollHeight",E="scrollWidth"),(i===vt||(i===ct||i===_t)&&s===Mr)&&(x=Ot,g-=(p&&S===w&&w.visualViewport?w.visualViewport.height:S[C])-o.height,g*=c?1:-1),i!==ct&&(i!==vt&&i!==Ot||s!==Mr)||(k=_t,f-=(p&&S===w&&w.visualViewport?w.visualViewport.width:S[E])-o.width,f*=c?1:-1)}var M,N=Object.assign({position:l},d&&dk),T=u===!0?function(R,z){var _=R.x,I=R.y,O=z.devicePixelRatio||1;return{x:Ho(_*O)/O||0,y:Ho(I*O)/O||0}}({x:f,y:g},Et(n)):{x:f,y:g};return f=T.x,g=T.y,c?Object.assign({},N,((M={})[x]=y?"0":"",M[k]=b?"0":"",M.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",M)):Object.assign({},N,((e={})[x]=y?g+"px":"",e[k]=b?f+"px":"",e.transform="",e))}var ji={passive:!0},uk={left:"right",right:"left",bottom:"top",top:"bottom"};function Fi(t){return t.replace(/left|right|bottom|top/g,function(e){return uk[e]})}var pk={start:"end",end:"start"};function qp(t){return t.replace(/start|end/g,function(e){return pk[e]})}function cl(t){var e=Et(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function dl(t){return Wo(Mn(t)).left+cl(t).scrollLeft}function ul(t){var e=an(t),n=e.overflow,o=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+o)}function Jp(t){return["html","body","#document"].indexOf(Gt(t))>=0?t.ownerDocument.body:At(t)&&ul(t)?t:Jp(Pi(t))}function Or(t,e){var n;e===void 0&&(e=[]);var o=Jp(t),i=o===((n=t.ownerDocument)==null?void 0:n.body),s=Et(o),a=i?[s].concat(s.visualViewport||[],ul(o)?o:[]):o,l=e.concat(a);return i?l:l.concat(Or(Pi(a)))}function pl(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Gp(t,e,n){return e===zp?pl(function(o,i){var s=Et(o),a=Mn(o),l=s.visualViewport,c=a.clientWidth,d=a.clientHeight,u=0,p=0;if(l){c=l.width,d=l.height;var h=jp();(h||!h&&i==="fixed")&&(u=l.offsetLeft,p=l.offsetTop)}return{width:c,height:d,x:u+dl(o),y:p}}(t,n)):no(e)?function(o,i){var s=Wo(o,!1,i==="fixed");return s.top=s.top+o.clientTop,s.left=s.left+o.clientLeft,s.bottom=s.top+o.clientHeight,s.right=s.left+o.clientWidth,s.width=o.clientWidth,s.height=o.clientHeight,s.x=s.left,s.y=s.top,s}(e,n):pl(function(o){var i,s=Mn(o),a=cl(o),l=(i=o.ownerDocument)==null?void 0:i.body,c=oo(s.scrollWidth,s.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),d=oo(s.scrollHeight,s.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),u=-a.scrollLeft+dl(o),p=-a.scrollTop;return an(l||s).direction==="rtl"&&(u+=oo(s.clientWidth,l?l.clientWidth:0)-c),{width:c,height:d,x:u,y:p}}(Mn(t)))}function Yp(t){var e,n=t.reference,o=t.element,i=t.placement,s=i?Yt(i):null,a=i?Ko(i):null,l=n.x+n.width/2-o.width/2,c=n.y+n.height/2-o.height/2;switch(s){case vt:e={x:l,y:n.y-o.height};break;case Ot:e={x:l,y:n.y+n.height};break;case _t:e={x:n.x+n.width,y:c};break;case ct:e={x:n.x-o.width,y:c};break;default:e={x:n.x,y:n.y}}var d=s?ll(s):null;if(d!=null){var u=d==="y"?"height":"width";switch(a){case Fo:e[d]=e[d]-(n[u]/2-o[u]/2);break;case Mr:e[d]=e[d]+(n[u]/2-o[u]/2)}}return e}function _r(t,e){e===void 0&&(e={});var n=e,o=n.placement,i=o===void 0?t.placement:o,s=n.strategy,a=s===void 0?t.strategy:s,l=n.boundary,c=l===void 0?"clippingParents":l,d=n.rootBoundary,u=d===void 0?zp:d,p=n.elementContext,h=p===void 0?Nr:p,f=n.altBoundary,m=f!==void 0&&f,g=n.padding,v=g===void 0?0:g,b=Wp(typeof v!="number"?v:Kp(v,Er)),y=h===Nr?"reference":Nr,k=t.rects.popper,x=t.elements[m?y:h],w=function(z,_,I,O){var V=_==="clippingParents"?function(j){var K=Or(Pi(j)),H=["absolute","fixed"].indexOf(an(j).position)>=0&&At(j)?Br(j):j;return no(H)?K.filter(function(q){return no(q)&&Fp(q,H)&&Gt(q)!=="body"}):[]}(z):[].concat(_),P=[].concat(V,[I]),A=P[0],L=P.reduce(function(j,K){var H=Gp(z,K,O);return j.top=oo(H.top,j.top),j.right=$i(H.right,j.right),j.bottom=$i(H.bottom,j.bottom),j.left=oo(H.left,j.left),j},Gp(z,A,O));return L.width=L.right-L.left,L.height=L.bottom-L.top,L.x=L.left,L.y=L.top,L}(no(x)?x:x.contextElement||Mn(t.elements.popper),c,u,a),S=Wo(t.elements.reference),C=Yp({reference:S,element:k,placement:i}),E=pl(Object.assign({},k,C)),M=h===Nr?E:S,N={top:w.top-M.top+b.top,bottom:M.bottom-w.bottom+b.bottom,left:w.left-M.left+b.left,right:M.right-w.right+b.right},T=t.modifiersData.offset;if(h===Nr&&T){var R=T[i];Object.keys(N).forEach(function(z){var _=[_t,Ot].indexOf(z)>=0?1:-1,I=[vt,Ot].indexOf(z)>=0?"y":"x";N[z]+=R[I]*_})}return N}function hk(t,e){e===void 0&&(e={});var n=e,o=n.placement,i=n.boundary,s=n.rootBoundary,a=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,d=c===void 0?Pp:c,u=Ko(o),p=u?l?$p:$p.filter(function(m){return Ko(m)===u}):Er,h=p.filter(function(m){return d.indexOf(m)>=0});h.length===0&&(h=p);var f=h.reduce(function(m,g){return m[g]=_r(t,{placement:g,boundary:i,rootBoundary:s,padding:a})[Yt(g)],m},{});return Object.keys(f).sort(function(m,g){return f[m]-f[g]})}const fk={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,o=t.name;if(!e.modifiersData[o]._skip){for(var i=n.mainAxis,s=i===void 0||i,a=n.altAxis,l=a===void 0||a,c=n.fallbackPlacements,d=n.padding,u=n.boundary,p=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,m=f===void 0||f,g=n.allowedAutoPlacements,v=e.options.placement,b=Yt(v),y=c||(b!==v&&m?function(j){if(Yt(j)===rl)return[];var K=Fi(j);return[qp(j),K,qp(K)]}(v):[Fi(v)]),k=[v].concat(y).reduce(function(j,K){return j.concat(Yt(K)===rl?hk(e,{placement:K,boundary:u,rootBoundary:p,padding:d,flipVariations:m,allowedAutoPlacements:g}):K)},[]),x=e.rects.reference,w=e.rects.popper,S=new Map,C=!0,E=k[0],M=0;M<k.length;M++){var N=k[M],T=Yt(N),R=Ko(N)===Fo,z=[vt,Ot].indexOf(T)>=0,_=z?"width":"height",I=_r(e,{placement:N,boundary:u,rootBoundary:p,altBoundary:h,padding:d}),O=z?R?_t:ct:R?Ot:vt;x[_]>w[_]&&(O=Fi(O));var V=Fi(O),P=[];if(s&&P.push(I[T]<=0),l&&P.push(I[O]<=0,I[V]<=0),P.every(function(j){return j})){E=N,C=!1;break}S.set(N,P)}if(C)for(var A=function(j){var K=k.find(function(H){var q=S.get(H);if(q)return q.slice(0,j).every(function(Y){return Y})});if(K)return E=K,"break"},L=m?3:1;L>0&&A(L)!=="break";L--);e.placement!==E&&(e.modifiersData[o]._skip=!0,e.placement=E,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Xp(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 Zp(t){return[vt,_t,Ot,ct].some(function(e){return t[e]>=0})}function mk(t,e,n){n===void 0&&(n=!1);var o,i,s=At(e),a=At(e)&&function(p){var h=p.getBoundingClientRect(),f=Ho(h.width)/p.offsetWidth||1,m=Ho(h.height)/p.offsetHeight||1;return f!==1||m!==1}(e),l=Mn(e),c=Wo(t,a,n),d={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(s||!s&&!n)&&((Gt(e)!=="body"||ul(l))&&(d=(o=e)!==Et(o)&&At(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:cl(o)),At(e)?((u=Wo(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):l&&(u.x=dl(l))),{x:c.left+d.scrollLeft-u.x,y:c.top+d.scrollTop-u.y,width:c.width,height:c.height}}function gk(t){var e=new Map,n=new Set,o=[];function i(s){n.add(s.name),[].concat(s.requires||[],s.requiresIfExists||[]).forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),o.push(s)}return t.forEach(function(s){e.set(s.name,s)}),t.forEach(function(s){n.has(s.name)||i(s)}),o}var Qp={placement:"bottom",modifiers:[],strategy:"absolute"};function eh(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function vk(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,o=n===void 0?[]:n,i=e.defaultOptions,s=i===void 0?Qp:i;return function(a,l,c){c===void 0&&(c=s);var d,u,p={placement:"bottom",orderedModifiers:[],options:Object.assign({},Qp,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},h=[],f=!1,m={state:p,setOptions:function(v){var b=typeof v=="function"?v(p.options):v;g(),p.options=Object.assign({},s,p.options,b),p.scrollParents={reference:no(a)?Or(a):a.contextElement?Or(a.contextElement):[],popper:Or(l)};var y=function(k){var x=gk(k);return sk.reduce(function(w,S){return w.concat(x.filter(function(C){return C.phase===S}))},[])}(function(k){var x=k.reduce(function(w,S){var C=w[S.name];return w[S.name]=C?Object.assign({},C,S,{options:Object.assign({},C.options,S.options),data:Object.assign({},C.data,S.data)}):S,w},{});return Object.keys(x).map(function(w){return x[w]})}([].concat(o,p.options.modifiers)));return p.orderedModifiers=y.filter(function(k){return k.enabled}),p.orderedModifiers.forEach(function(k){var x=k.name,w=k.options,S=w===void 0?{}:w,C=k.effect;if(typeof C=="function"){var E=C({state:p,name:x,instance:m,options:S});h.push(E||function(){})}}),m.update()},forceUpdate:function(){if(!f){var v=p.elements,b=v.reference,y=v.popper;if(eh(b,y)){p.rects={reference:mk(b,Br(y),p.options.strategy==="fixed"),popper:al(y)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(M){return p.modifiersData[M.name]=Object.assign({},M.data)});for(var k=0;k<p.orderedModifiers.length;k++)if(p.reset!==!0){var x=p.orderedModifiers[k],w=x.fn,S=x.options,C=S===void 0?{}:S,E=x.name;typeof w=="function"&&(p=w({state:p,options:C,name:E,instance:m})||p)}else p.reset=!1,k=-1}}},update:(d=function(){return new Promise(function(v){m.forceUpdate(),v(p)})},function(){return u||(u=new Promise(function(v){Promise.resolve().then(function(){u=void 0,v(d())})})),u}),destroy:function(){g(),f=!0}};if(!eh(a,l))return m;function g(){h.forEach(function(v){return v()}),h=[]}return m.setOptions(c).then(function(v){!f&&c.onFirstUpdate&&c.onFirstUpdate(v)}),m}}var yk=vk({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,o=t.options,i=o.scroll,s=i===void 0||i,a=o.resize,l=a===void 0||a,c=Et(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&d.forEach(function(u){u.addEventListener("scroll",n.update,ji)}),l&&c.addEventListener("resize",n.update,ji),function(){s&&d.forEach(function(u){u.removeEventListener("scroll",n.update,ji)}),l&&c.removeEventListener("resize",n.update,ji)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=Yp({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,o=n.gpuAcceleration,i=o===void 0||o,s=n.adaptive,a=s===void 0||s,l=n.roundOffsets,c=l===void 0||l,d={placement:Yt(e.placement),variation:Ko(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Up(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Up(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},ak,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,o=t.name,i=n.offset,s=i===void 0?[0,0]:i,a=Pp.reduce(function(u,p){return u[p]=function(h,f,m){var g=Yt(h),v=[ct,vt].indexOf(g)>=0?-1:1,b=typeof m=="function"?m(Object.assign({},f,{placement:h})):m,y=b[0],k=b[1];return y=y||0,k=(k||0)*v,[ct,_t].indexOf(g)>=0?{x:k,y}:{x:y,y:k}}(p,e.rects,s),u},{}),l=a[e.placement],c=l.x,d=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[o]=a}},fk,{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,o=t.name,i=n.mainAxis,s=i===void 0||i,a=n.altAxis,l=a!==void 0&&a,c=n.boundary,d=n.rootBoundary,u=n.altBoundary,p=n.padding,h=n.tether,f=h===void 0||h,m=n.tetherOffset,g=m===void 0?0:m,v=_r(e,{boundary:c,rootBoundary:d,padding:p,altBoundary:u}),b=Yt(e.placement),y=Ko(e.placement),k=!y,x=ll(b),w=x==="x"?"y":"x",S=e.modifiersData.popperOffsets,C=e.rects.reference,E=e.rects.popper,M=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,N=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),T=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,R={x:0,y:0};if(S){if(s){var z,_=x==="y"?vt:ct,I=x==="y"?Ot:_t,O=x==="y"?"height":"width",V=S[x],P=V+v[_],A=V-v[I],L=f?-E[O]/2:0,j=y===Fo?C[O]:E[O],K=y===Fo?-E[O]:-C[O],H=e.elements.arrow,q=f&&H?al(H):{width:0,height:0},Y=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},G=Y[_],Q=Y[I],oe=Tr(0,C[O],q[O]),fe=k?C[O]/2-L-oe-G-N.mainAxis:j-oe-G-N.mainAxis,le=k?-C[O]/2+L+oe+Q+N.mainAxis:K+oe+Q+N.mainAxis,me=e.elements.arrow&&Br(e.elements.arrow),Be=me?x==="y"?me.clientTop||0:me.clientLeft||0:0,X=(z=T==null?void 0:T[x])!=null?z:0,ie=V+le-X,ae=Tr(f?$i(P,V+fe-X-Be):P,V,f?oo(A,ie):A);S[x]=ae,R[x]=ae-V}if(l){var re,xe=x==="x"?vt:ct,nt=x==="x"?Ot:_t,Oe=S[w],_e=w==="y"?"height":"width",ue=Oe+v[xe],ge=Oe-v[nt],at=[vt,ct].indexOf(b)!==-1,ft=(re=T==null?void 0:T[w])!=null?re:0,we=at?ue:Oe-C[_e]-E[_e]-ft+N.altAxis,D=at?Oe+C[_e]+E[_e]-ft-N.altAxis:ge,W=f&&at?function(ee,ve,ye){var Re=Tr(ee,ve,ye);return Re>ye?ye:Re}(we,Oe,D):Tr(f?we:ue,Oe,f?D:ge);S[w]=W,R[w]=W-Oe}e.modifiersData[o]=R}},requiresIfExists:["offset"]},ck,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,o=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,a=_r(e,{elementContext:"reference"}),l=_r(e,{altBoundary:!0}),c=Xp(a,o),d=Xp(l,i,s),u=Zp(c),p=Zp(d);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}}]});const th="mc-popper",bk={key:0,id:"arrow",class:"mc-popper-arrow","data-popper-arrow":""},Hi=Z(U(r.defineComponent({name:th,__name:"mc-popper",props:{content:{},trigger:{default:"hover"},placement:{default:"top"},disabled:{type:Boolean},popperOptions:{},showTimeout:{default:0},hideTimeout:{default:300},transitionName:{default:"fade"},showArrow:{type:Boolean,default:!0}},emits:["visible:change","click:outside"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref({}),a=r.ref({}),l=r.ref({}),c=r.ref(),d=r.ref(),u=r.ref(),p=r.ref(!1),h=w=>{o.disabled&&(w=!1),p.value=w,i("visible:change",w)},f=r.computed(()=>({placement:o.placement,modifiers:[{name:"offset",options:{offset:[0,8]}}],...o.popperOptions}));let m,g,v;r.watch(p,w=>{w&&d.value&&u.value&&(m=yk(d.value,u.value,f.value))},{flush:"post"}),r.onUnmounted(()=>{Ee(m)||(m.destroy(),m=void 0)});const b=r.computed(()=>o.trigger==="hover"?o.showTimeout:0),y=r.computed(()=>o.trigger==="hover"?o.hideTimeout:0);r.watchEffect(()=>{s.value={},a.value={},l.value={},o.disabled?x(!1):o.trigger==="click"?s.value.click=()=>{p.value?x():k()}:o.trigger==="hover"&&(s.value.mouseenter=()=>k(),a.value.mouseleave=()=>x(),l.value.mouseenter=()=>k()),g=Vi(Ti(h,null,!0),b.value),v=Vi(Ti(h,null,!1),y.value)});const k=(w=!0)=>{v==null||v.cancel(),w?g==null||g():h(!0)},x=(w=!0)=>{g==null||g.cancel(),w?v==null||v():h(!1)};return zi(c,()=>{i("click:outside"),o.trigger==="click"&&p.value&&x(!1)}),e({show:()=>k(!1),hide:()=>x(!1)}),(w,S)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:"mc-popper",ref_key:"containerNode",ref:c},r.toHandlers(a.value,!0)),[r.createElementVNode("div",r.mergeProps({class:"mc-popper-trigger",ref_key:"triggerNode",ref:d},r.toHandlers(s.value,!0)),[r.renderSlot(w.$slots,"default",{},void 0,!0)],16),r.createVNode(r.Transition,{name:t.transitionName},{default:r.withCtx(()=>[p.value?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,class:"mc-popper-popper",ref_key:"popperNode",ref:u},r.toHandlers(l.value,!0)),[r.renderSlot(w.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0),t.showArrow?(r.openBlock(),r.createElementBlock("div",bk)):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0)]),_:3},8,["name"])],16))}}),[["__scopeId","data-v-10213bd3"]])),nh="mc-tooltip",kk={class:"mc-tooltip"},Uo=Z(U(r.defineComponent({name:nh,__name:"mc-tooltip",props:{iconSize:{default:24},iconName:{default:"Info"},content:{},theme:{default:"light"},placement:{default:"top"},showArrow:{type:Boolean,default:!0},iconColor:{},trigger:{default:"hover"}},setup(t,{expose:e}){const n=r.computed(()=>({strategy:"fixed"})),o=r.ref();return e({hide:()=>{var i;return(i=o.value)==null?void 0:i.hide()},show:()=>{var i;return(i=o.value)==null?void 0:i.show()}}),(i,s)=>(r.openBlock(),r.createElementBlock("div",kk,[r.createVNode(r.unref(Hi),{ref_key:"popperRef",ref:o,placement:t.placement,"show-arrow":t.showArrow,"popper-options":n.value,trigger:t.trigger},{content:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["mc-tooltip-content",`mc-tooltip-content-${t.theme}`])},[r.renderSlot(i.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)],2)]),default:r.withCtx(()=>[r.renderSlot(i.$slots,"default",{},()=>[r.createVNode(r.unref(de),{class:"mc-tooltip-icon",name:t.iconName,size:t.iconSize,color:t.iconColor},null,8,["name","size","color"])],!0)]),_:3},8,["placement","show-arrow","popper-options","trigger"])]))}}),[["__scopeId","data-v-cd8fce58"]])),wk={class:"mc-form"},xk=r.defineComponent({name:Op,__name:"mc-form",props:{model:{default:()=>({})},modelValue:{},rules:{default:()=>({})},disabled:{type:Boolean},direction:{default:"vertical"},scrollToError:{type:Boolean,default:!1}},emits:["update:modelValue","reset"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=new Map,a=d=>{if(ce(d)){if(Ct(d))return Array.from(s.values());{const u=[];return Ii(d,p=>{const h=s.get(p);h&&u.push(h)}),u}}return s.get(d)},l=async(d=[],u,p=!0)=>{try{return p&&c(),await(async(f,m)=>{const g=a(f);if(Ct(g))return m==null||m(!0),!0;try{return await(async v=>{const b=[];for(const y of v)try{await y.validate()}catch(k){b.push(k)}return!qa(b)||Promise.reject(b)})(ce(g)?g:[g]),m==null||m(!0),!0}catch(v){if(v instanceof Error)throw v;const b=v;return m==null||m(!1,b),Promise.reject(b)}})(d,u)}catch(h){return o.scrollToError&&(async f=>{const m=Cn(dp(f))[0],g=a(m);if(Ct(g))return;const v=g.id;if(!v.size)return;const b=dp(Array.from(v));if(!b)return;const y=document.getElementById(b);y==null||y.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}),await Ja(500),y==null||y.focus()})(h),Promise.reject(h)}},c=(d=[])=>{const u=a(d);Ct(u)||(ce(u)?Ii(u,p=>p.clearValidate()):u.clearValidate())};return r.provide($o,{model:r.computed(()=>Ee(o.modelValue)?o.model:o.modelValue),rules:r.computed(()=>o.rules),disabled:r.computed(()=>!!o.disabled),direction:r.computed(()=>o.direction),addFormItem:d=>{Ct(d.prop)||s.set(d.prop,d)},removeFormItem:d=>{Ct(d.prop)||s.delete(d.prop)}}),e({validate:l,validateFields:async(d,u)=>l(d,u,!1),resetFields:async(d=[])=>{const u=a(d);if(Ct(u))return;const p={};ce(u)?Ii(u,h=>{p[h.prop]=h.getInitialValue()}):p[u.prop]=u.getInitialValue(),await r.nextTick(),i("reset",p),i("update:modelValue",p),await r.nextTick(),c(d)},clearValidate:c}),(d,u)=>(r.openBlock(),r.createElementBlock("div",wk,[r.createElementVNode("form",{onSubmit:u[0]||(u[0]=r.withModifiers(()=>{},["prevent"]))},[r.renderSlot(d.$slots,"default",{},void 0,!0)],32)]))}}),oh=Z(U(xk,[["__scopeId","data-v-318f0cd2"]])),hl=Symbol("mc-form-item-context"),rh="mc-form-item",Ck={class:"mc-form-item-label-wrapper"},Sk={key:0,class:"mc-form-item-label"},Ek={key:0,class:"mc-form-item-help"},Mk={key:0,class:"mc-form-item-desc"},Nk={class:"mc-form-item__content"},Bk={key:0,class:"mc-form-item__error"},Tk=r.defineComponent({name:rh,__name:"mc-form-item",props:{prop:{default:""},label:{},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},rules:{},help:{},desc:{}},setup(t){const e=t,n=r.reactive(new Map),o=r.reactive(new Map),i=r.computed(()=>o.values().next().value),s=r.inject($o,void 0),{addFormId:a,removeFormId:l}=(v=>{const b=r.inject($o,void 0),y=new Map,k=be("prop"),x=()=>{if(Ee(k.value))return;const S=ce(k.value)?k.value:[k.value];for(const C of S){const E=v(C);y.set(C,E),b==null||b.addFormItem(E)}},w=()=>{for(const S of y.values())b==null||b.removeFormItem(S)};return r.onBeforeMount(()=>{x()}),r.onUnmounted(()=>{w()}),r.watch(()=>k.value,S=>{w(),Ct(S)||x()},{deep:!0}),{formItemInstances:y,addFormId:(S,C)=>{const E=y.get(S);E&&E.id.add(C)},removeFormId:(S,C)=>{const E=y.get(S);E&&E.id.delete(C)}}})(v=>(n.set(v,"init"),{prop:v,id:new Set,validate:c(v),getInitialValue:d(v),clearValidate:h})),c=v=>async(b,y)=>f(v,b,y),d=v=>()=>{const b=s==null?void 0:s.model.value;if(!Ee(b))return u(v)},{getInitialValue:u}=(()=>{const v=r.inject($o,void 0),b=be("prop"),y=new Map,k=x=>{const w=v==null?void 0:v.model.value;if(Ee(x)||Ct(x))y.clear();else if(ce(x))for(const S of x)y.set(S,Oo(w,S));else y.set(x,Oo(w,x))};return r.onMounted(()=>{k(b.value)}),r.watch(()=>b.value,x=>{k(x)}),{getInitialValue:x=>{if(!Ee(x))return _i(y.get(x),5)}}})();let p=!1;const h=()=>{for(const v of n.keys())n.set(v,"init");for(const v of o.keys())o.delete(v);p=!1},f=async(v,b,y)=>{if(p||e.disabled)return Promise.resolve(!0);const k=(S=>{const C=[],E=!!e.required;E&&C.push({required:!0}),e.rules&&C.push(...e.rules);const M=s==null?void 0:s.rules.value;if(M){const N=Oo(M,S);N&&C.push(...N)}if(E){const N=kr(En(C,(T,R)=>[T,R]),T=>gt(Cn(T[0]),"required"));if(qa(N))for(const T of N){const[R,z]=T;R.required!==E&&(C[z]={...R,required:E})}else C.push({required:E})}return C})(v),x=((S,C)=>kr(S,E=>!(!E.trigger&&C&&C!=="change")&&(!E.trigger||!C||(ce(E.trigger)?gt(E.trigger,C):E.trigger===C))).map(({trigger:E,...M})=>M))(k,b);if(Ct(x))return y==null||y(!0),Promise.resolve(!0);n.set(v,"validating");const w=((S,C)=>{const E=new Sr({[S]:C}),M=s==null?void 0:s.model.value;return E.validate({[S]:Oo(M,S)},{firstFields:!0})})(v,x);try{return await w,n.set(v,"success"),o.delete(v),y==null||y(!0),Promise.resolve(!0)}catch(S){const{errors:C,fields:E}=S;n.set(v,"error");const M=C&&qa(C)>0?C[0].message??"":"";return o.set(v,M),y==null||y(!1,E),Promise.reject(E)}},m=r.computed(()=>(s==null?void 0:s.direction.value)==="horizontal"),g=r.computed(()=>{var k;if(e.required)return!0;if((k=e.rules)!=null&&k.length)return xp(e.rules,x=>!!x.required);const v=s==null?void 0:s.rules.value,b=ce(e.prop)?e.prop:[e.prop],y=[];for(const x of b){const w=Oo(v,x);w&&y.push(...w)}return xp(y,x=>!!x.required)});return r.provide(hl,{disabled:r.computed(()=>e.disabled),validateStatus:n,prop:r.computed(()=>e.prop),addFormId:a,removeFormId:l,validate:f}),(v,b)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-form-item",{"mc-form-item-horizontal":m.value}])},[r.renderSlot(v.$slots,"label",{required:g.value},()=>[r.createElementVNode("div",null,[r.createElementVNode("div",Ck,[t.label?(r.openBlock(),r.createElementBlock("label",Sk,[r.createElementVNode("span",{class:r.normalizeClass(["mc-form-item-lable-text",{"mc-form-item-label-required":g.value}])},r.toDisplayString(t.label),3),t.help||v.$slots.help?(r.openBlock(),r.createElementBlock("div",Ek,[r.renderSlot(v.$slots,"help",{},()=>[r.createVNode(r.unref(Uo),{content:t.help,"icon-size":20},null,8,["content"])],!0)])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.renderSlot(v.$slots,"tool",{},void 0,!0)]),t.desc||v.$slots.desc?(r.openBlock(),r.createElementBlock("div",Mk,[r.renderSlot(v.$slots,"desc",{},()=>[r.createTextVNode(r.toDisplayString(t.desc),1)],!0)])):r.createCommentVNode("",!0)])],!0),r.createElementVNode("div",Nk,[r.renderSlot(v.$slots,"default",{},void 0,!0),r.createVNode(r.Transition,{name:"mc-form-item-error"},{default:r.withCtx(()=>[i.value?(r.openBlock(),r.createElementBlock("div",Bk,r.toDisplayString(i.value),1)):r.createCommentVNode("",!0)]),_:1})])],2))}}),ih=Z(U(Tk,[["__scopeId","data-v-133ad5d0"]])),sh=({externalId:t,externalDisabled:e}={})=>{const n=r.inject($o,void 0),o=r.inject(hl,void 0),i=be(["validateProp","validate-prop"]),s=(c=>{const d=be("id");if(d.value)return d.value;{const u=((p=10)=>String(Date.now()).slice(-p))();return c?`${c}-${u}`:u}})((t==null?void 0:t.value)??"mc-form-item");r.onMounted(()=>{a()}),r.onBeforeUnmount(()=>{a("remove")});const a=(c="add")=>{const d=i.value;if(d)c==="add"?o==null||o.addFormId(d,s):o==null||o.removeFormId(d,s);else{const u=o==null?void 0:o.prop.value;if(Ct(u))return;const p=ce(u)?u:[u];for(const h of p)c==="add"?h&&(o==null||o.addFormId(h,s)):h&&(o==null||o.removeFormId(h,s))}},l=(({formCtx:c,formItemCtx:d,externalDisabled:u})=>{const p=be("disabled");return r.computed(()=>p.value||!!(c!=null&&c.disabled.value)||!!(d!=null&&d.disabled.value)||!!(u!=null&&u.value))})({formCtx:n,formItemCtx:o,externalDisabled:e});return{formCtx:n,formItemCtx:o,formId:s,formDisabled:l}},ln=({externalId:t,externalDisabled:e,disableValidation:n,validator:o}={})=>{const i=be(["disableValidation","disable-validation"]),s=be(["validateProp","validate-prop"]),a=r.computed(()=>!!i.value||!!(n!=null&&n.value)),{formCtx:l,formItemCtx:c,formId:d,formDisabled:u}=sh({externalId:t,externalDisabled:e}),p=r.computed(()=>{if(a.value)return"init";if(Ve(o)&&o()==="error")return"error";const k=c==null?void 0:c.validateStatus;return k!=null&&k.size?s.value?k.get(s.value)||"init":k.values().next().value||"init":"init"}),h=r.computed(()=>a.value?"":`mc-form-validate-${p.value}`),f=r.computed(()=>!a.value&&p.value==="error"),m=r.computed(()=>!a.value&&p.value==="success"),g=be(["hideValidationIcon","hide-validation-icon"]),v=r.computed(()=>!a.value&&!g.value&&(f.value?"Reject_02":!!m.value&&"Accept_02")),b=be("modelValue");r.watch(()=>b.value,()=>{y("change")});const y=async k=>{if(!a.value)try{if(s.value)await(c==null?void 0:c.validate(s.value,k));else{const x=c==null?void 0:c.prop.value;if(x){const w=ce(x)?x:[x],S=[];for(const C of w)S.push(c==null?void 0:c.validate(C,k));await Promise.all(S)}}}catch(x){console.error("[mc-form] validate error: ",x)}};return{formCtx:l,formItemCtx:c,formId:d,formDisabled:u,validateStatus:p,validateStyle:h,isError:f,isSuccess:m,statusIcon:v,validateByTrigger:y}},ah="mc-checkbox",fl=Symbol("mc-checkbox-group-context"),lh="mc-checkbox-group",Ok={class:"mc-checkbox"},_k=["id","value","disabled","onKeypress"],Ak={key:0,class:"mc-checkbox-content"},Vk={key:0,class:"mc-checkbox-remarks"},Ik=r.defineComponent({name:ah,__name:"mc-checkbox",props:{modelValue:{type:Boolean},disabled:{type:Boolean},content:{},remarks:{},partial:{type:Boolean},value:{},disableValidation:{type:Boolean,default:!1},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(),{wrapperRef:s,isFocused:a,handleFocus:l,handleBlur:c}=zo(i),{checkboxGroupCtx:d,checkboxGroupDisabled:u,isCheckboxGroup:p,isCheckboxSelected:h,handleCheckboxSelect:f}=(()=>{const x=r.inject(fl,void 0),w=r.computed(()=>{var C;return!!((C=x==null?void 0:x.disabled)!=null&&C.value)}),S=r.computed(()=>!!x&&Ve(x==null?void 0:x.handleSelect));return{checkboxGroupCtx:x,checkboxGroupDisabled:w,isCheckboxGroup:S,isCheckboxSelected:C=>{var E;return!Ee(C)&>((E=x==null?void 0:x.modelValue)==null?void 0:E.value,C)},handleCheckboxSelect:C=>{x==null||x.handleSelect(C)}}})(),{formId:m,formDisabled:g,validateStyle:v,validateByTrigger:b}=ln({externalDisabled:u,disableValidation:d==null?void 0:d.disableValidation}),y=r.computed(()=>p.value?h(n.value):!!n.modelValue),k=async()=>{g.value||(p.value?f(n.value):(o("update:modelValue",!n.modelValue),o("change",!n.modelValue),await r.nextTick(),b("input")))};return(x,w)=>(r.openBlock(),r.createElementBlock("div",Ok,[r.createElementVNode("label",{ref_key:"checkboxRef",ref:s,class:r.normalizeClass(["mc-checkbox-wrapper",{"mc-checkbox-disabled":r.unref(g),"mc-checkbox-checked":y.value,"mc-checkbox-partial":t.partial,"mc-checkbox-focused":r.unref(a),[r.unref(v)]:r.unref(v)}]),onClick:r.withModifiers(k,["prevent"])},[r.createElementVNode("input",{ref_key:"checkboxInputRef",ref:i,id:r.unref(m),type:"checkbox",class:"mc-checkbox-input",value:y.value,disabled:r.unref(g),onKeypress:r.withKeys(r.withModifiers(k,["prevent","stop"]),["enter"]),onFocus:w[0]||(w[0]=(...S)=>r.unref(l)&&r.unref(l)(...S)),onBlur:w[1]||(w[1]=(...S)=>r.unref(c)&&r.unref(c)(...S))},null,40,_k),w[2]||(w[2]=r.createElementVNode("div",{class:"mc-checkbox-box"},null,-1)),t.content||x.$slots.default?(r.openBlock(),r.createElementBlock("div",Ak,[r.renderSlot(x.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)])):r.createCommentVNode("",!0)],2),t.remarks||x.$slots.remarks?(r.openBlock(),r.createElementBlock("div",Vk,[r.renderSlot(x.$slots,"remarks",{},()=>[r.createTextVNode(r.toDisplayString(t.remarks),1)],!0)])):r.createCommentVNode("",!0)]))}}),ro=Z(U(Ik,[["__scopeId","data-v-8dbde265"]])),Dk=["id"],ch=Z(r.defineComponent({name:lh,__name:"mc-checkbox-group",props:{modelValue:{default:()=>[]},disabled:{type:Boolean,default:!1},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,{formId:i,validateByTrigger:s}=ln();return r.provide(fl,{modelValue:r.computed(()=>n.modelValue),disabled:r.computed(()=>n.disabled),disableValidation:r.computed(()=>!!n.disableValidation),handleSelect:async a=>{if(!a)return;const l=[...n.modelValue],c=(u=a,(d=l)!=null&&d.length?ba(d,u,0):-1);var d,u;c>-1?l.splice(c,1):l.push(a),o("update:modelValue",l),o("change",l),await r.nextTick(),s("input")}}),(a,l)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-checkbox-group",id:r.unref(i)},[r.renderSlot(a.$slots,"default")],8,Dk))}})),ml=Symbol("mc-collapse-context"),dh="mc-collapse",Rk={class:"mc-collapse"},uh=Z(U(r.defineComponent({name:dh,__name:"mc-collapse",props:{modelValue:{default:()=>[]},accordion:{type:Boolean,default:!1},transition:{type:Boolean,default:!1},destroyOnHide:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e;return r.watchEffect(()=>{n.accordion&&n.modelValue.length}),r.provide(ml,{activeNames:r.computed(()=>n.modelValue),transition:r.computed(()=>n.transition),destroyOnHide:r.computed(()=>n.destroyOnHide),handleItemClick:i=>{let s=[...n.modelValue??[]];if(n.accordion)s=[s[0]===i?"":i];else{const a=s.indexOf(i);a>-1?s.splice(a,1):s.push(i)}o("update:modelValue",s),o("change",s)}}),(i,s)=>(r.openBlock(),r.createElementBlock("div",Rk,[r.renderSlot(i.$slots,"default",{},void 0,!0)]))}}),[["__scopeId","data-v-b551884b"]])),ph="mc-icon-plus",Lk=r.defineComponent({name:ph,__name:"mc-icon-plus",props:{name:{},size:{default:24},width:{},height:{},color:{},cursor:{default:"default"}},emits:["click"],setup(t,{emit:e}){const n=t,o=e,{width:i,height:s}=$t(),a=r.computed(()=>n.width?i.value:`${n.size}px`),l=r.computed(()=>n.height?s.value:`${n.size}px`),c=()=>{o("click",n.name)};return(d,u)=>(r.openBlock(),r.createElementBlock("span",{class:"mc-icon-plus",style:r.normalizeStyle({fontSize:`${t.size}px`,width:a.value,height:l.value,color:t.color,cursor:t.cursor}),onClick:c},[r.createElementVNode("i",{class:r.normalizeClass(["mc-iconfont-plus",`mc-icon-plus-${t.name}`])},null,2)],4))}}),hh=U(Lk,[["__scopeId","data-v-779c77bf"]]),Nn=Z(hh),fh="mc-collapse-item",zk={class:"mc-collapse-item-header"},$k={class:"mc-collapse-item-title"},Pk={key:0,class:"mc-collapse-item-content"},jk=r.defineComponent({name:fh,__name:"mc-collapse-item",props:{name:{},title:{},disabled:{type:Boolean}},setup(t){const e=r.inject(ml,void 0),n=r.computed(()=>{var l;return!!((l=e==null?void 0:e.activeNames.value)!=null&&l.includes(t.name))}),o=r.computed(()=>!!(e!=null&&e.transition.value)),i=r.computed(()=>!!(e!=null&&e.destroyOnHide.value)),s=r.computed(()=>!i.value||n.value),a=()=>{t.disabled||(e==null||e.handleItemClick(t.name))};return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-collapse-item",onClick:a},[r.createElementVNode("div",zk,[r.createElementVNode("span",$k,[r.renderSlot(l.$slots,"title",{isActive:n.value},()=>[r.createTextVNode(r.toDisplayString(t.title),1)],!0)]),r.createElementVNode("span",{class:r.normalizeClass(["triangle-icon",{"triangle-icon-active":n.value}])},[r.createVNode(r.unref(Nn),{name:"down-chevron",cursor:"pointer"})],2)]),r.createVNode(r.Transition,{name:"mc-collapse-item-content-"+(o.value?"transition":"no-transition")},{default:r.withCtx(()=>[s.value?r.withDirectives((r.openBlock(),r.createElementBlock("div",Pk,[r.renderSlot(l.$slots,"default",{isActive:n.value},void 0,!0)],512)),[[r.vShow,n.value]]):r.createCommentVNode("",!0)]),_:3},8,["name"])]))}}),mh=Z(U(jk,[["__scopeId","data-v-4d4a75b5"]])),gh="mc-toast",Fk={key:0,class:"mc-toast-msg-icon"},Hk={key:1,class:"mc-toast-msg-text"},Wk={class:"mc-toast-msg-close-container"},Kk={key:0,class:"mc-toast-countdown"},Uk={key:1,class:"mc-toast-msg-close"},qk={key:0,class:"mc-toast-content-container"},vh=U(r.defineComponent({name:gh,__name:"mc-toast",props:{type:{default:"info"},message:{},content:{},closable:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},duration:{default:void 0},hideIcon:{type:Boolean,default:!1},countDownIcon:{type:Boolean,default:!0},width:{},onClose:{}},emits:["close"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.computed(()=>{if(!o.hideIcon)switch(o.type){case"success":return"Accept_02";case"error":return"Error_04";case"warning":return"Error_02";case"info":return"Info_02";default:return}}),a=r.computed(()=>o.countDownIcon&&!!o.duration),l=r.computed(()=>o.duration||3e3),c=r.ref(Math.floor(l.value/1e3));let d=null;o.autoClose&&(d=setInterval(()=>{c.value>0?c.value--:u()},1e3));const u=()=>{p(),i("close")},p=()=>{d&&clearInterval(d)};return r.onUnmounted(()=>{p()}),e({close:u}),(h,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-toast",[`mc-toast-${t.type}`]]),style:r.normalizeStyle({width:t.width})},[r.createElementVNode("div",{class:r.normalizeClass(["mc-toast-msg-container",{"mc-toast-has-content":t.content||h.$slots.content}])},[s.value?(r.openBlock(),r.createElementBlock("div",Fk,[r.createVNode(r.unref(de),{name:s.value},null,8,["name"])])):r.createCommentVNode("",!0),t.message||h.$slots.default?(r.openBlock(),r.createElementBlock("div",Hk,[r.renderSlot(h.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.message),1)],!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",Wk,[a.value?(r.openBlock(),r.createElementBlock("div",Kk,r.toDisplayString(c.value),1)):r.createCommentVNode("",!0),t.closable?(r.openBlock(),r.createElementBlock("div",Uk,[r.createVNode(r.unref(de),{name:"Cross",onClick:u})])):r.createCommentVNode("",!0)])],2),t.content||h.$slots.content?(r.openBlock(),r.createElementBlock("div",qk,[r.renderSlot(h.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)])):r.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-bcfcc654"]]),cn=[];let je=null;const Wi=t=>{let e={};e=typeof t=="string"?{message:t}:{...t},e.type=e.type||"info",e.autoClose=e.autoClose!==!1,e.closable=e.closable!==!1,cn.length>=5&&cn.length>0&&cn[0].close();const n=je||(je=document.createElement("div"),je.className="mc-toast-container",je.style.position="fixed",je.style.top="5vh",je.style.left="50%",je.style.transform="translateX(-50%)",je.style.zIndex="9999",je.style.display="flex",je.style.flexDirection="column",je.style.gap="12px",je.style.pointerEvents="none",document.body.appendChild(je),je),o=document.createElement("div");o.style.pointerEvents="auto",o.style.animation="toast-slide-in 0.3s ease-out";const i=Date.now().toString(36)+Math.random().toString(36).slice(2),s=r.createVNode(vh,{...e,onClose:()=>{o.style.animation="toast-slide-out 0.3s ease-in",e.onClose&&e.onClose(),setTimeout(()=>{(l=>{const c=cn.findIndex(d=>d.id===l);if(c!==-1){const d=cn[c];r.render(null,d.wrapper),je&&je.contains(d.wrapper)&&je.removeChild(d.wrapper),cn.splice(c,1),je&&document.body.contains(je)&&cn.length===0&&(document.body.removeChild(je),je=null)}})(i)},300)}});r.render(s,o),n.appendChild(o);const a={id:i,wrapper:o,close:()=>{var c;const l=s.component;l&&l.exposed&&((c=l.exposed)==null||c.close())}};return cn.push(a),{...a}},Ki={success:t=>Wi(typeof t=="string"?{message:t,type:"success"}:{...t,type:"success"}),error:t=>Wi(typeof t=="string"?{message:t,type:"error"}:{...t,type:"error"}),warning:t=>Wi(typeof t=="string"?{message:t,type:"warning"}:{...t,type:"warning"}),info:t=>Wi(typeof t=="string"?{message:t,type:"info"}:{...t,type:"info"}),closeAll:()=>{cn.forEach(t=>{t.close()})}};(()=>{if(document.getElementById("mc-toast-v2-styles"))return;const t=document.createElement("style");t.id="mc-toast-v2-styles",t.textContent=`
|
|
15
15
|
@keyframes toast-slide-in {
|
|
16
16
|
from {
|
|
17
17
|
transform: translateY(100%);
|
|
@@ -33,19 +33,19 @@
|
|
|
33
33
|
opacity: 0;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
`,document.head.appendChild(t)})();const kh=X(yh),bh="mc-copy",e1={class:"mc-copy"},t1={class:"mc-copy-text"},wh=X(K(r.defineComponent({name:bh,__name:"mc-copy",props:{text:{},showToast:{type:Boolean,default:!1},toastSuccessText:{default:"copy succeed"},toastErrorText:{default:"copy failed"},manual:{type:Boolean,default:!1}},emits:["copy","success","error"],setup(t,{emit:e}){const n=t,o=e,s=async()=>{if(n.text)if(n.manual)o("copy",n.text);else try{await navigator.clipboard.writeText(n.text),o("success",n.text),n.showToast&&qs.success(n.toastSuccessText)}catch(i){console.error(i),o("error",n.text,i),n.showToast&&qs.error(n.toastErrorText)}};return(i,a)=>(r.openBlock(),r.createElementBlock("div",e1,[r.renderSlot(i.$slots,"default",{},()=>[r.createElementVNode("span",t1,r.toDisplayString(t.text),1)],!0),r.createVNode(r.unref(ce),{name:"Duplicate",class:"mc-copy-icon",onClick:s})]))}}),[["__scopeId","data-v-93e0e595"]])),xh="mc-count",n1={key:0,class:"mc-count-number"},Ch=X(K(r.defineComponent({name:xh,__name:"mc-count",props:{value:{},theme:{default:"red"},type:{default:"medium"},hiddenZero:{type:Boolean,default:!0},max:{default:99}},emits:["change"],setup(t,{emit:e}){const n=t,o=e,s=r.computed(()=>{const c=Number(n.value);return isNaN(c)?(console.warn("mc-count: value is not a number"),0):c}),i=r.computed(()=>!n.hiddenZero||s.value>0),a=r.computed(()=>n.max&&s.value>n.max?`${n.max}+`:`${s.value}`),l=r.computed(()=>n.type==="tiny");return r.watch(()=>n.value,(c,d)=>{c!==d&&o("change",c)}),(c,d)=>i.value?(r.openBlock(),r.createElementBlock("i",{key:0,class:r.normalizeClass(["mc-count",[`mc-count-${t.theme}`,`mc-count-${t.type}`]])},[l.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",n1,r.toDisplayString(a.value),1))],2)):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-58404c8a"]])),Sh="mc-currency-icon",o1={class:"mc-currency-icon-img-wrapper"},r1=["src","alt"],s1={class:"mc-currency-icon-label"},i1={class:"mc-currency-icon-text"},a1=r.defineComponent({name:Sh,__name:"mc-currency-icon",props:{currency:{},direction:{default:"horizontal"},desc:{},cdnUrl:{},suffix:{default:"svg"},height:{},width:{}},setup(t){const e=t,{generateFileUrl:n}=(o=e.cdnUrl,s=e.suffix,{generateFileUrl:l=>{if(o&&s&&l)return`${o}/${l}.${s}`}});var o,s;const{width:i,height:a}=$t();return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-currency-icon",style:r.normalizeStyle({width:r.unref(i),height:r.unref(a)})},[r.createElementVNode("div",o1,[r.renderSlot(l.$slots,"icon",{},()=>[r.createElementVNode("img",{src:r.unref(n)(t.currency),class:"mc-currency-icon-img",alt:`${t.currency}-icon`},null,8,r1)],!0)]),r.createElementVNode("div",{class:r.normalizeClass(["mc-currency-icon-content",[`mc-currency-icon-content-${t.direction}`]])},[r.createElementVNode("div",s1,[r.renderSlot(l.$slots,"default",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.currency),1)],!0)]),r.createElementVNode("div",i1,[r.renderSlot(l.$slots,"desc",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.desc),1)],!0)])],2)],4))}}),Eh=X(K(a1,[["__scopeId","data-v-56ce704b"]])),Mh="mc-divider",vl=X(K(r.defineComponent({name:Mh,__name:"mc-divider",props:{size:{default:"small"},emphasis:{default:"minimal"},orientation:{default:"horizontal"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-divider",[`mc-divider-${t.orientation}`,`mc-divider-${t.size}`,`mc-divider-${t.emphasis}`]])},null,2))}),[["__scopeId","data-v-7527b8b5"]])),Nh="mc-overlay",l1={key:0},c1=r.defineComponent({name:Nh,__name:"mc-overlay",props:{visible:{type:Boolean},fixed:{type:Boolean,default:!0},portCssSelector:{default:"body"}},emits:["click"],setup(t,{expose:e,emit:n}){const o=t,s=n;r.onBeforeMount(()=>{const a=document.querySelector(o.portCssSelector);a&&window.getComputedStyle(a).position==="static"&&(a.style.position="relative")});const i=r.ref();return e({ref:i}),(a,l)=>t.visible?(r.openBlock(),r.createElementBlock("div",l1,[(r.openBlock(),r.createBlock(r.Teleport,{to:t.portCssSelector},[r.createElementVNode("div",{ref_key:"_ref",ref:i,class:"mc-overlay",onClick:l[0]||(l[0]=c=>(d=>{d.target===i.value&&s("click")})(c)),style:r.normalizeStyle({position:t.fixed?"fixed":"absolute"})},[r.renderSlot(a.$slots,"default",{},void 0,!0)],4)],8,["to"]))])):r.createCommentVNode("",!0)}}),Us=X(K(c1,[["__scopeId","data-v-7e34ebbc"]])),Bh="mc-reset",yl=X(K(r.defineComponent({name:Bh,__name:"mc-reset",props:{rotate:{type:Boolean,default:!1},autoRotate:{type:Boolean,default:!0},duration:{default:300}},emits:["reset"],setup(t,{emit:e}){const n=t,o=e,s=r.ref(!1),i=r.computed(()=>n.autoRotate?s.value:n.rotate),a=async()=>{o("reset"),n.autoRotate&&(s.value=!0,await Ga(n.duration),s.value=!1)};return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-reset",onClick:a},[r.createVNode(r.unref(ce),{name:"Refresh",size:24,class:r.normalizeClass(["mc-reset-icon",{"mc-reset-rotate":i.value}])},null,8,["class"]),r.createElementVNode("span",null,[r.renderSlot(l.$slots,"default",{},()=>[c[0]||(c[0]=r.createTextVNode("Reset",-1))],!0)])]))}}),[["__scopeId","data-v-7877623f"]])),Th="mc-title-toolbar",d1={key:0,class:"mc-title-toolbar-reset"},u1={key:1,class:"mc-title-toolbar-line"},p1={key:2,class:"mc-title-toolbar-mandatory"},kl=X(K(r.defineComponent({name:Th,__name:"mc-title-tool-bar",props:{showReset:{type:Boolean,default:!0},showMandatory:{type:Boolean,default:!0}},emits:["reset"],setup(t,{expose:e,emit:n}){const o=r.ref(),s=n,i=r.ref(!1);let a;const l=zo(()=>{clearTimeout(a),i.value=!0,a=setTimeout(()=>{i.value=!1},300),s("reset")},300);return e({ref:o}),(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-title-toolbar",ref_key:"_ref",ref:o},[t.showReset?(r.openBlock(),r.createElementBlock("div",d1,[r.createVNode(r.unref(yl),{rotate:i.value,onReset:r.unref(l),"auto-rotate":!1},{default:r.withCtx(()=>[r.renderSlot(c.$slots,"reset",{},void 0,!0)]),_:3},8,["rotate","onReset"])])):r.createCommentVNode("",!0),t.showReset&&t.showMandatory?(r.openBlock(),r.createElementBlock("div",u1)):r.createCommentVNode("",!0),t.showMandatory?(r.openBlock(),r.createElementBlock("div",p1,[r.renderSlot(c.$slots,"mandatory",{},()=>[d[0]||(d[0]=r.createTextVNode("Mandatory",-1))],!0)])):r.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-ec7f65e7"]])),Oh="mc-title",h1={class:"mc-title-content"},f1={class:"mc-title-text"},m1={class:"mc-title-tool-bar"},Ar=X(K(r.defineComponent({name:Oh,__name:"mc-title",props:{width:{default:"100%"},height:{default:"auto"},title:{},showToolBar:{type:Boolean,default:!0},showBorder:{type:Boolean,default:!1},showReset:{type:Boolean,default:!0},showMandatory:{type:Boolean,default:!0}},emits:["reset"],setup(t,{expose:e,emit:n}){const o=n,s=r.ref();return e({ref:s}),(i,a)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-title",{"mc-title-border":t.showBorder}]),ref_key:"_ref",ref:s,style:r.normalizeStyle({width:t.width,height:t.height})},[r.createElementVNode("div",h1,[r.renderSlot(i.$slots,"default",{},()=>[r.createElementVNode("h1",f1,r.toDisplayString(t.title),1)],!0)]),r.createElementVNode("div",m1,[r.renderSlot(i.$slots,"tool-bar",{},()=>[t.showToolBar?(r.openBlock(),r.createBlock(r.unref(kl),{key:0,"show-reset":t.showReset,"show-mandatory":t.showMandatory,onReset:a[0]||(a[0]=l=>o("reset"))},{reset:r.withCtx(()=>[r.renderSlot(i.$slots,"reset",{},void 0,!0)]),mandatory:r.withCtx(()=>[r.renderSlot(i.$slots,"mandatory",{},void 0,!0)]),_:3},8,["show-reset","show-mandatory"])):r.createCommentVNode("",!0)],!0)])],6))}}),[["__scopeId","data-v-c7fdb5b7"]])),_h="mc-modal-header",g1={class:"mc-modal-header"},Gs=X(K(r.defineComponent({name:_h,__name:"mc-modal-header",props:{title:{},showBorder:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0}},emits:["close"],setup(t,{emit:e}){const n=e;return(o,s)=>(r.openBlock(),r.createElementBlock("div",g1,[r.createVNode(r.unref(Ar),{title:t.title,"show-border":t.showBorder,height:"100%",class:"mc-modal-header-title"},{"tool-bar":r.withCtx(()=>[r.createVNode(r.unref(ce),{name:"Cross",size:24,class:"mc-modal-header-close-icon",onClick:s[0]||(s[0]=i=>n("close"))})]),default:r.withCtx(()=>[r.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3},8,["title","show-border"])]))}}),[["__scopeId","data-v-482de3aa"]])),Ah="mc-footer",v1={key:0,class:"mc-footer-content"},y1={class:"mc-footer-bottom"},k1={class:"mc-footer-bottom-content"},b1={class:"mc-footer-left"},w1={class:"mc-footer-right"},x1={class:"mc-footer-right-button-group"},Go=X(K(r.defineComponent({name:Ah,__name:"mc-footer",props:{width:{},height:{},wrapperWidth:{},showborder:{type:Boolean,default:!0}},setup(t,{expose:e}){const n=r.ref();return e({ref:n}),(o,s)=>(r.openBlock(),r.createElementBlock("section",{class:r.normalizeClass(["mc-footer",{"mc-footer-border":t.showborder}]),style:r.normalizeStyle({width:t.width,height:t.height}),ref_key:"_ref",ref:n},[o.$slots.desc?(r.openBlock(),r.createElementBlock("div",v1,[r.createElementVNode("div",{class:"mc-footer-wrapper",style:r.normalizeStyle({width:t.wrapperWidth})},[r.renderSlot(o.$slots,"desc",{},void 0,!0)],4)])):r.createCommentVNode("",!0),r.createElementVNode("div",y1,[r.createElementVNode("div",{class:"mc-footer-wrapper",style:r.normalizeStyle({width:t.wrapperWidth})},[r.createElementVNode("div",k1,[r.createElementVNode("div",b1,[r.renderSlot(o.$slots,"left",{},void 0,!0)]),r.createElementVNode("div",w1,[r.renderSlot(o.$slots,"right",{},()=>[r.createElementVNode("div",x1,[r.renderSlot(o.$slots,"right-button-group",{},void 0,!0)])],!0)])])],4)])],6))}}),[["__scopeId","data-v-4553dea7"]])),Vh=(t=300)=>{const e=r.ref(!1),n=r.ref(!1),o=()=>{e.value=!0},s=()=>{e.value=!1},i=()=>{n.value=!0},a=()=>{n.value=!1};let l=null;const c=()=>{l&&clearTimeout(l)};return r.onUnmounted(()=>{c()}),{isOverlayShow:e,isContentShow:n,setOverlayShow:o,setOverlayHide:s,setContentShow:i,setContentHide:a,openOverlay:()=>{c(),o(),l=setTimeout(()=>{i()},t)},closeOverlay:()=>{c(),a(),l=setTimeout(()=>{s()},t)}}},Ih="mc-drawer",C1={key:0,class:"mc-drawer-container"},S1={class:"mc-drawer-header"},E1={class:"mc-drawer-content-wrapper"},M1={class:"mc-drawer-content"},N1={key:0,class:"mc-drawer-footer"},B1=r.defineComponent({name:Ih,__name:"mc-drawer",props:{modelValue:{type:Boolean},title:{},size:{default:"medium"},maskClosable:{type:Boolean,default:!0},fixed:{type:Boolean,default:!0},portCssSelector:{default:"body"},showBorder:{type:Boolean,default:!0},hideFooter:{type:Boolean,default:!1},position:{default:"right"}},emits:["update:modelValue","close"],setup(t,{expose:e,emit:n}){const o=t,s=r.ref(!1),{isOverlayShow:i,isContentShow:a,openOverlay:l,closeOverlay:c}=Vh(),d=()=>{s.value=!0,l()},u=()=>{c()},p=()=>{s.value=!1,h("close"),h("update:modelValue",!1)};r.watch(()=>o.modelValue,(v,k)=>{!k&&v?d():u()});const h=n,f=()=>{o.maskClosable&&u()},m=()=>{u()},g=r.ref();return e({ref:g,open:d,close:u}),(v,k)=>s.value?(r.openBlock(),r.createElementBlock("div",C1,[r.createVNode(r.Transition,{name:"mc-drawer-overlay",onAfterLeave:p},{default:r.withCtx(()=>[r.createVNode(r.unref(Us),{visible:r.unref(i),fixed:t.fixed,"port-css-selector":t.portCssSelector,onClick:f},{default:r.withCtx(()=>[r.createVNode(r.Transition,{name:`mc-drawer-content-${t.position}`},{default:r.withCtx(()=>[r.unref(a)?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-drawer",[`mc-drawer-${t.size}`,`mc-drawer-${t.position}`]]),ref_key:"_ref",ref:g},[r.createElementVNode("div",S1,[r.renderSlot(v.$slots,"header",{},()=>[r.createVNode(r.unref(Gs),{title:t.title,"show-border":t.showBorder,onClose:m},{default:r.withCtx(()=>[r.renderSlot(v.$slots,"header-title",{},void 0,!0)]),_:3},8,["title","show-border"])],!0)]),r.createElementVNode("div",E1,[r.createElementVNode("div",M1,[r.renderSlot(v.$slots,"default",{},void 0,!0)])]),t.hideFooter?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",N1,[r.renderSlot(v.$slots,"footer",{},()=>[r.createVNode(r.unref(Go),null,{left:r.withCtx(()=>[r.renderSlot(v.$slots,"footer-left",{},void 0,!0)]),right:r.withCtx(()=>[r.renderSlot(v.$slots,"footer-right",{},void 0,!0)]),"right-button-group":r.withCtx(()=>[r.renderSlot(v.$slots,"footer-right-button-group",{},void 0,!0)]),desc:r.withCtx(()=>[r.renderSlot(v.$slots,"footer-desc",{},void 0,!0)]),_:3})],!0)]))],2)):r.createCommentVNode("",!0)]),_:3},8,["name"])]),_:3},8,["visible","fixed","port-css-selector"])]),_:3})])):r.createCommentVNode("",!0)}}),Dh=X(K(B1,[["__scopeId","data-v-e0751c5a"]])),Vr=Symbol("mc-input-group-context"),Rh="mc-input-group",Lh=t=>{const e=r.inject(Vr,void 0);if(!e)return;const n=r.computed(()=>e.disabled.value),o=ke("inputGroupPosition");if(!o||!o.value)return;const{validateStatus:s,isExpanded:i,isFocused:a,isHovering:l}=t;return s&&r.watch(s,c=>{e.setInputGroupValidate(c)}),i&&r.watch(i,c=>{e.setInputGroupExpanded(c)}),r.watch([a,l],([c,d])=>{c||d?e.setInputGroupActived(!0,o.value):e.setInputGroupActived(!1,o.value)}),{inputGroupDisabled:n}},zh="mc-input",T1={key:0,class:"mc-input__prefix"},O1=["id","type","disabled","readonly","autocomplete","placeholder","autofocus","maxlength"],_1={key:2,class:"mc-input__password"},A1={key:0,class:"mc-input__suffix"},V1={key:4,class:"mc-input-append"},I1={class:"mc-input-append-text"},D1=r.defineComponent({name:zh,__name:"mc-input",props:{modelValue:{},width:{},height:{},id:{},type:{default:"text"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},placeholder:{default:"Please enter"},readonly:{type:Boolean,default:!1},autocomplete:{default:"off"},autofocus:{type:Boolean,default:!1},prefixIcon:{},suffixIcon:{},maxlength:{},currencyAccuracy:{},inputGroupPosition:{},disableValidation:{type:Boolean,default:!1},hideValidationIcon:{type:Boolean,default:!1},textAlign:{default:"left"},validateProp:{},formatter:{},parser:{}},emits:["update:modelValue","input","change","focus","blur","paste","clear","delete"],setup(t,{expose:e,emit:n}){const o=t,{formatter:s,parser:i}=o,a=n,l=r.ref(),c=r.computed(()=>xe(o.modelValue)?"":qt(o.modelValue)),d=O=>(o.type==="number"?O=(V=>V.replace(/[^\d]/g,""))(O):o.type==="currency"&&(O=((V,P=8)=>{V=V.replace(/(?:[^0-9.]+)/g,"");const[A,...L]=V.split(".");if(L.length){const j=L.join("");return P===0?A:`${A}.${j.substring(0,P)}`}return A})(O,o.currencyAccuracy)),Ve(i)&&(O=i(O)),O),u=()=>{const O=l.value,V=(P=c.value,o.type==="number"?P=(A=>A.replace(/[^\d]/g,""))(P):o.type==="currency"&&(P=(A=>{A=A.toString();const[L,j]=A.toString().split("."),q=L.replace(/(\d)(?=(\d{3})+$)/g,"$1,");return gt(A,".")?`${q}.${j}`:q})(P)),Ve(s)&&(P=s(P)),P);var P;O&&O.value!==V&&(O.value=V)};r.onMounted(()=>{u()});const p=r.ref(!1),h=r.computed(()=>o.type==="password"),{formId:f,formDisabled:m,validateStatus:g,validateStyle:v,statusIcon:k,validateByTrigger:y}=cn({externalDisabled:r.computed(()=>!!(E!=null&&E.inputGroupDisabled.value))}),{wrapperRef:b,isFocused:x,handleFocus:w,handleBlur:C}=$o(l,{afterBlur(){y("blur")}}),{isHovering:S}=Tp(b),E=Lh({validateStatus:g,isFocused:x,isHovering:S}),M=()=>{a("delete")},N=O=>{a("paste",O)};r.watch(()=>o.currencyAccuracy,()=>{a("update:modelValue",d(c.value))});const{recordCursor:T,setCursor:R}=function(O){const V=r.ref();return{recordCursor:()=>{if(!O.value)return;const{selectionStart:P,selectionEnd:A,value:L}=O.value;if(!P||!A)return;const j=L.slice(0,P),q=L.slice(A);V.value={selectionStart:P,selectionEnd:A,value:L,beforeTxt:j,afterTxt:q}},setCursor:()=>{if(!O.value||!V.value)return;const{value:P}=O.value,{beforeTxt:A,afterTxt:L,selectionStart:j}=V.value;if(!A||!L||!j)return;let q=P.length;if(function(H,U,Y){H=qt(H),U=gs(U);var J=H.length,Q=Y=Y===void 0?J:Vu(Yn(Y),0,J);return(Y-=U.length)>=0&&H.slice(Y,Q)==U}(P,L))q=P.length-L.length;else if(function(H,U,Y){return H=qt(H),Y=Y==null?0:Vu(Yn(Y),0,H.length),U=gs(U),H.slice(Y,Y+U.length)==U}(P,A))q=A.length;else{const H=A[j-1],U=P.indexOf(H,j-1);U!==-1&&(q=U+1)}O.value.setSelectionRange(q,q)}}}(l),z=async O=>{const{value:V}=O.target;T(),a("update:modelValue",d(V)),a("input",d(V)),await r.nextTick(),u(),R(),y("input")},_=O=>{const{value:V}=O.target;a("change",d(V))},I=()=>{m.value||(p.value=!p.value)};return r.watch(()=>m.value,O=>{O&&(p.value=!1)}),r.watch(c,()=>{u()}),e({ref:l,focus:async()=>{var O;await r.nextTick(),(O=l.value)==null||O.focus()},blur:async()=>{var O;(O=l.value)==null||O.blur()},select:()=>{var O;(O=l.value)==null||O.select()},clear:()=>{a("update:modelValue",""),a("input",""),a("change",""),a("clear")}}),(O,V)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-input",{"mc-input--disabled":r.unref(m),"mc-input--focused":r.unref(x),"mc-input--inputed":t.modelValue,"mc-input-hovering":r.unref(S),[r.unref(v)]:r.unref(v)}]),style:r.normalizeStyle({width:t.width,height:t.height}),ref_key:"wrapperRef",ref:b},[O.$slots.prefix||t.prefixIcon?(r.openBlock(),r.createElementBlock("div",T1,[r.renderSlot(O.$slots,"prefix",{},()=>[t.prefixIcon?(r.openBlock(),r.createBlock(r.unref(ce),{key:0,class:"mc-input-icon",name:t.prefixIcon,size:24},null,8,["name"])):r.createCommentVNode("",!0)],!0)])):r.createCommentVNode("",!0),r.createElementVNode("input",{class:"mc-input__inner",style:r.normalizeStyle({textAlign:t.textAlign}),ref_key:"inputRef",ref:l,id:r.unref(f),type:h.value?p.value?"text":"password":"text",disabled:r.unref(m),readonly:t.readonly,autocomplete:t.autocomplete,placeholder:t.placeholder,autofocus:t.autofocus,maxlength:t.maxlength,onInput:z,onChange:_,onFocus:V[0]||(V[0]=(...P)=>r.unref(w)&&r.unref(w)(...P)),onBlur:V[1]||(V[1]=(...P)=>r.unref(C)&&r.unref(C)(...P)),onKeydown:r.withKeys(M,["delete"]),onPaste:N},null,44,O1),r.unref(k)?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mc-input__status",r.unref(v)])},[r.createVNode(r.unref(ce),{name:r.unref(k),size:24},null,8,["name"])],2)):r.createCommentVNode("",!0),t.type==="password"?(r.openBlock(),r.createElementBlock("div",_1,[r.createVNode(r.unref(ce),{class:"mc-input-icon",name:p.value?"Review-Hidden":"Review",size:24,onClick:I},null,8,["name"])])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:3},[O.$slots.suffix||t.suffixIcon?(r.openBlock(),r.createElementBlock("div",A1,[r.renderSlot(O.$slots,"suffix",{},()=>[t.suffixIcon?(r.openBlock(),r.createBlock(r.unref(ce),{key:0,name:t.suffixIcon,size:24},null,8,["name"])):r.createCommentVNode("",!0)],!0)])):r.createCommentVNode("",!0)],64)),O.$slots.append?(r.openBlock(),r.createElementBlock("div",V1,[r.createElementVNode("div",I1,[r.renderSlot(O.$slots,"append",{},void 0,!0)])])):r.createCommentVNode("",!0)],6))}}),bl=X(K(D1,[["__scopeId","data-v-83786ea1"]])),R1=["id"],L1={key:0,class:"mc-input-group-divider"},$h=X(K(r.defineComponent({name:Rh,__name:"mc-input-group",props:{disabled:{type:Boolean,default:!1},suffixFlex:{default:1},prefixFlex:{default:1}},setup(t){const{isError:e,isExpanded:n,isPrefixActived:o,isSuffixActived:s,setInputGroupValidate:i,setInputGroupExpanded:a,setInputGroupActived:l}=(()=>{const p=r.ref("init"),h=r.computed(()=>p.value==="error"),f=r.ref(!1),m=r.ref(!1),g=r.ref(!1);return{validateStatus:p,isError:h,isExpanded:f,isPrefixActived:m,isSuffixActived:g,setInputGroupValidate:v=>{p.value=v},setInputGroupExpanded:v=>{f.value=v},setInputGroupActived:(v,k)=>{k==="prefix"?m.value=v:g.value=v}}})(),{formId:c,formDisabled:d}=ah(),u=r.computed(()=>!o.value&&!s.value&&!n.value||d.value);return r.provide(Vr,{disabled:d,setInputGroupExpanded:a,setInputGroupValidate:i,setInputGroupActived:l}),(p,h)=>(r.openBlock(),r.createElementBlock("div",{id:r.unref(c),class:r.normalizeClass(["mc-input-group",{"mc-input-group-disabled":r.unref(d)}])},[r.createElementVNode("div",{class:r.normalizeClass(["mc-input-group-prefix",{"mc-input-group-prefix-expanded":r.unref(n),"mc-input-group-prefix-actived":r.unref(o),"mc-input-group-prefix-error":r.unref(e)}]),style:r.normalizeStyle({flex:t.prefixFlex})},[r.renderSlot(p.$slots,"prefix",{},void 0,!0)],6),u.value?(r.openBlock(),r.createElementBlock("div",L1)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["mc-input-group-suffix",{"mc-input-group-suffix-expanded":r.unref(n),"mc-input-group-suffix-actived":r.unref(s),"mc-input-group-suffix-error":r.unref(e)}]),style:r.normalizeStyle({flex:t.suffixFlex})},[r.renderSlot(p.$slots,"suffix",{},void 0,!0)],6)],10,R1))}}),[["__scopeId","data-v-a61c5f3e"]])),Ph="mc-lightbox",z1={key:0,class:"mc-lightbox-container"},$1={class:"mc-lightbox-header"},P1={class:"mc-lightbox-content-wrapper"},j1={key:0,class:"mc-lightbox-footer"},F1=r.defineComponent({name:Ph,__name:"mc-lightbox",props:{modelValue:{type:Boolean,default:!1},title:{},size:{default:"medium"},maskClosable:{type:Boolean,default:!0},fixed:{type:Boolean,default:!0},portCssSelector:{default:"body"},hideFooter:{type:Boolean,default:!1},showBorder:{type:Boolean,default:!1},minHeight:{default:void 0}},emits:["update:modelValue","open","close"],setup(t,{expose:e,emit:n}){const o=t,s=n,i=r.ref(),a=r.ref(),l=r.ref(!1),{isOverlayShow:c,isContentShow:d,openOverlay:u,closeOverlay:p}=Vh(),h=()=>{o.maskClosable&&g()},f=()=>{g()},m=()=>{l.value=!0,u(),s("open"),s("update:modelValue",!0)},g=()=>{p()},v=()=>{l.value=!1,s("close"),s("update:modelValue",!1)};return r.watch(()=>o.modelValue,(k,y)=>{!y&&k?m():y&&!k&&g()}),e({ref:i,open:m,close:g}),(k,y)=>l.value?(r.openBlock(),r.createElementBlock("div",z1,[r.createVNode(r.Transition,{name:"mc-lightbox-overlay",onAfterLeave:v},{default:r.withCtx(()=>[r.createVNode(r.unref(Us),{visible:r.unref(c),fixed:t.fixed,"port-css-selector":t.portCssSelector,onClick:h},{default:r.withCtx(()=>[r.createVNode(r.Transition,{name:"mc-lightbox-content"},{default:r.withCtx(()=>[r.unref(d)?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-lightbox",[`mc-lightbox-${t.size}`]]),ref_key:"lightboxRef",ref:i},[r.createElementVNode("div",$1,[r.renderSlot(k.$slots,"header",{},()=>[r.createVNode(r.unref(Gs),{title:t.title,"show-border":t.showBorder,onClose:f},{default:r.withCtx(()=>[r.renderSlot(k.$slots,"header-title",{},void 0,!0)]),_:3},8,["title","show-border"])],!0)]),r.createElementVNode("div",P1,[r.createElementVNode("div",{class:"mc-lightbox-content",style:r.normalizeStyle({minHeight:t.minHeight?`${t.minHeight}px`:void 0}),ref_key:"contentRef",ref:a},[r.renderSlot(k.$slots,"default",{},void 0,!0)],4)]),t.hideFooter?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",j1,[r.renderSlot(k.$slots,"footer",{},()=>[r.createVNode(r.unref(Go),null,{left:r.withCtx(()=>[r.renderSlot(k.$slots,"footer-left",{},void 0,!0)]),right:r.withCtx(()=>[r.renderSlot(k.$slots,"footer-right",{},void 0,!0)]),"right-button-group":r.withCtx(()=>[r.renderSlot(k.$slots,"footer-right-button-group",{},void 0,!0)]),desc:r.withCtx(()=>[r.renderSlot(k.$slots,"footer-desc",{},void 0,!0)]),_:3})],!0)]))],2)):r.createCommentVNode("",!0)]),_:3})]),_:3},8,["visible","fixed","port-css-selector"])]),_:3})])):r.createCommentVNode("",!0)}}),jh=X(K(F1,[["__scopeId","data-v-fb1a683b"]])),Fh="mc-loading",H1={key:0,class:"mc-loading-pulse"},W1={key:1,class:"mc-loading-spin"},K1={class:"mc-loading-text"},wl=X(K(r.defineComponent({name:Fh,__name:"mc-loading",props:{loading:{type:Boolean},loadingText:{},size:{default:"medium"},type:{default:"spin"}},setup(t){const e=t,n=r.computed(()=>e.size==="small"?24:e.size==="medium"?32:64);return(o,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-loading",[`mc-loading-${t.size}`,{"mc-loading-active":t.loading}]])},[t.type==="pulse"?(r.openBlock(),r.createElementBlock("div",H1,[...s[0]||(s[0]=[r.createElementVNode("i",{class:"mc-loading-pulse-dot"},null,-1),r.createElementVNode("i",{class:"mc-loading-pulse-dot"},null,-1),r.createElementVNode("i",{class:"mc-loading-pulse-dot"},null,-1),r.createElementVNode("i",{class:"mc-loading-pulse-dot"},null,-1)])])):t.type==="spin"?(r.openBlock(),r.createElementBlock("div",W1,[r.createVNode(r.unref(ce),{name:"Loading_Line",size:n.value},null,8,["size"])])):r.createCommentVNode("",!0),t.loadingText||o.$slots.default?r.renderSlot(o.$slots,"default",{key:2},()=>[r.createElementVNode("p",K1,r.toDisplayString(t.loadingText),1)],!0):r.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-d1cc3cc8"]])),Hh="mc-removable-tag",q1={class:"mc-removable-tag-content"},U1=r.defineComponent({name:Hh,__name:"mc-removable-tag",props:{label:{},disabled:{type:Boolean,default:!1}},emits:["remove"],setup(t,{emit:e}){const n=t,o=e,s=()=>{n.disabled||o("remove",n.label)};return(i,a)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-removable-tag",{"mc-removable-tag-disabled":t.disabled}])},[r.createElementVNode("span",q1,[r.renderSlot(i.$slots,"default",{label:t.label},()=>[r.createTextVNode(r.toDisplayString(t.label),1)],!0)]),t.disabled?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(r.unref(Bn),{key:0,class:"mc-removable-tag-close-icon",name:"cross",cursor:t.disabled?"not-allowed":"pointer",onClick:s},null,8,["cursor"]))],2))}}),xl=X(K(U1,[["__scopeId","data-v-fec756a7"]])),Wh="mc-multi-tag",G1={class:"mc-multi-tag-label"},J1={class:"mc-multi-tag-option-list"},Kh=X(K(r.defineComponent({name:Wh,__name:"mc-multi-tag",props:{label:{},tags:{default:()=>[]},disabled:{type:Boolean,default:!1},disableTags:{default:()=>[]}},emits:["remove:all","remove:tag"],setup(t,{emit:e}){const n=t,o=e,s=r.computed(()=>n.disabled||n.disableTags.length),i=c=>!!n.disabled||!!n.disableTags.includes(c),a=c=>{n.disabled||o("remove:tag",c,n.label)},l=()=>{s.value||o("remove:all",n.label)};return(c,d)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-multi-tag",{"mc-multi-tag-disabled":t.disabled}])},[s.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createVNode(r.unref(Bn),{class:"mc-multi-tag-close-all-icon",name:"cross",onClick:l}),d[0]||(d[0]=r.createElementVNode("i",{class:"mc-multi-tag-divider"},null,-1))],64)),r.createElementVNode("span",G1,r.toDisplayString(`${t.label} :`),1),r.createElementVNode("ul",J1,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.tags,u=>(r.openBlock(),r.createBlock(r.unref(xl),{key:u,label:u,disabled:i(u),onRemove:a},null,8,["label","disabled"]))),128))])],2))}}),[["__scopeId","data-v-0a31c60a"]])),qh="mc-otp",Y1=["id"],X1={class:"mc-otp-input-list"},Z1=["onClick"],Q1=["onUpdate:modelValue","disabled","onInput","onKeydown"],ew=r.defineComponent({name:qh,__name:"mc-otp",props:{modelValue:{},disabled:{type:Boolean,default:!1},length:{default:6}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,s=r.ref([]),i=r.reactive(new Array(n.length)),{focusIndex:a,setFocus:l,nextFocus:c,prevFocus:d}=(k=>{const y=r.ref(),b=S=>{y.value=S};$s(k,()=>{xe(y.value)||m("blur"),b(void 0)});const x=ke("length"),w=S=>{var T;const E=x.value??0;S<0&&(S=0),S>E-1&&(S=E-1),y.value=S;const M=k.value[S],N=(T=M==null?void 0:M.children)==null?void 0:T[0];N==null||N.focus()},C=ke("modelValue");return{focusIndex:y,setFocusIndex:b,setFocus:w,nextFocus:()=>{r.nextTick(()=>{var E;const S=((E=C.value)==null?void 0:E.length)??0;S<(x.value??0)&&w(S)})},prevFocus:()=>{r.nextTick(()=>{var E;const S=((E=C.value)==null?void 0:E.length)??0;S-1>=0&&w(S-1)})}}})(s),{formId:u,formDisabled:p,validateStyle:h,statusIcon:f,validateByTrigger:m}=cn({externalDisabled:r.computed(()=>n.disabled)}),g=k=>{for(let y=0;y<n.length;y++)i[y]=(k==null?void 0:k[y])||""};r.onMounted(()=>{g(n.modelValue)}),r.watch(()=>n.modelValue,k=>{g(k)});const v=async()=>{o("change",i.join("")),o("update:modelValue",i.join("")),await r.nextTick(),m("input")};return r.watchEffect(()=>{var k;if((((k=n.modelValue)==null?void 0:k.length)??0)>n.length)throw new Error("modelValue length is greater than length.")}),(k,y)=>(r.openBlock(),r.createElementBlock("div",{id:r.unref(u),class:r.normalizeClass(["mc-otp",{"mc-otp-disabled":r.unref(p),[r.unref(h)]:r.unref(h)}])},[r.createElementVNode("ul",X1,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.length,b=>(r.openBlock(),r.createElementBlock("li",{key:b,class:r.normalizeClass(["mc-otp-input-item",{"mc-otp-input-item-focus":r.unref(a)===b-1}]),ref_for:!0,ref:x=>((w,C)=>{C&&(s.value[w]=C)})(b-1,x),onClick:x=>(async w=>{Ct(i[w])?c():l(w)})(b-1)},[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":x=>i[b-1]=x,class:"mc-otp-input",type:"number",disabled:r.unref(p),onInput:x=>(async(w,C)=>{if(p.value)return;const S=C.target;let E=S.value.slice(0,1);S.value=E,i[w]=E,v(),E&&c()})(b-1,x),onPaste:y[0]||(y[0]=x=>(async w=>{var S;if(w.preventDefault(),p.value)return;const C=((S=w.clipboardData)==null?void 0:S.getData("text").slice(0,n.length))||"";g(C),v(),c()})(x)),onKeydown:[r.withKeys(r.withModifiers(x=>(async w=>{i[w]="",v(),d()})(b-1),["prevent","stop"]),["backspace"]),r.withKeys(r.withModifiers(x=>r.unref(l)(b-2),["prevent","stop"]),["left"]),r.withKeys(r.withModifiers(x=>r.unref(l)(b),["prevent","stop"]),["right"]),y[2]||(y[2]=r.withKeys(r.withModifiers(()=>{},["prevent","stop"]),["tab"]))],onMousedown:y[1]||(y[1]=r.withModifiers(()=>{},["prevent"]))},null,40,Q1),[[r.vModelText,i[b-1]]])],10,Z1))),128))]),r.unref(f)?(r.openBlock(),r.createBlock(r.unref(ce),{key:0,class:"mc-otp-status-icon",name:r.unref(f),size:24},null,8,["name"])):r.createCommentVNode("",!0)],10,Y1))}}),Uh=X(K(ew,[["__scopeId","data-v-d04352a4"]])),Gh="mc-progress-bar",tw={key:0,class:"mc-progress-bar-shimmer"},nw={key:0,class:"mc-progress-bar-remarks"},Cl=X(K(r.defineComponent({name:Gh,__name:"mc-progress-bar",props:{percentage:{default:0},height:{default:"4px"},width:{default:"100%"},remarks:{},showPercentage:{type:Boolean,default:!1},transitionDuration:{default:300},shimmer:{type:Boolean,default:!1}},emits:["update:percentage","complete"],setup(t,{expose:e,emit:n}){const o=t,s=n,{width:i,height:a}=$t(),l=r.ref();r.watchEffect(()=>{l.value&&l.value.style.setProperty("--border-radius",a.value||"auto")});const c=r.computed(()=>{const p=o.percentage/100;return p>1?1:p<0?0:p});r.watch(()=>o.percentage,p=>{p>=100&&s("complete")},{immediate:!0});const d=r.useSlots(),u=r.computed(()=>o.showPercentage||!!o.remarks||!!d.remarks);return e({updatePercentage:p=>{s("update:percentage",p)},complete:()=>{s("update:percentage",100),s("complete")},reset:()=>{s("update:percentage",0)}}),(p,h)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-progress-bar",style:r.normalizeStyle({width:r.unref(i)})},[r.createElementVNode("div",{ref_key:"progressBarRef",ref:l,class:"mc-progress-bar-wrapper",style:r.normalizeStyle({width:r.unref(i),height:r.unref(a)})},[r.createElementVNode("div",{class:"mc-progress-bar-inner",style:r.normalizeStyle({transform:`scaleX(${c.value})`,transitionDuration:`${t.transitionDuration}ms`})},null,4),t.shimmer?(r.openBlock(),r.createElementBlock("i",tw)):r.createCommentVNode("",!0)],4),u.value?(r.openBlock(),r.createElementBlock("div",nw,[r.renderSlot(p.$slots,"remarks",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.remarks||`${r.unref(Au)(100*c.value)}%`),1)],!0)])):r.createCommentVNode("",!0)],4))}}),[["__scopeId","data-v-7ebc305e"]])),Jh="mc-success-icon",io=X(K(r.defineComponent({name:Jh,__name:"mc-success-icon",props:{width:{default:"40px"},height:{default:"40px"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("svg",{class:"success-icon",style:r.normalizeStyle({width:t.width,height:t.height}),viewBox:"0 0 400 400"},[...n[0]||(n[0]=[r.createElementVNode("circle",{class:"circle",fill:"none",transform:"rotate(-90 200 200)","stroke-width":"20",cx:"200",cy:"200",r:"190","stroke-linecap":"round"},null,-1),r.createElementVNode("polyline",{class:"tick",fill:"none","stroke-width":"26",points:"120,214 173,260 274,160","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],4))}),[["__scopeId","data-v-be465c78"]])),Yh="mc-progress-indicator",Xh="mc-progress-indicator-step",Zh="mc-progress-indicator-step-num",ow={key:0,class:"mc-progress-indicator-step-num-icon"},rw={key:1},sw=K(r.defineComponent({name:Zh,__name:"mc-progress-indicator-step-num",props:{num:{},status:{default:"default"},showSuccessIcon:{type:Boolean,default:!0},isChild:{type:Boolean,default:!1},icon:{}},setup(t){const e=t,n=r.computed(()=>e.showSuccessIcon&&e.status==="success"&&!e.isChild);return(o,s)=>n.value?(r.openBlock(),r.createBlock(r.unref(io),{key:0})):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mc-progress-indicator-step-num",[`mc-progress-indicator-step-num-${t.status}`,{"mc-progress-indicator-step-num-child":t.isChild}]])},[t.isChild?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",ow,[t.icon?(r.openBlock(),r.createBlock(r.unref(Bn),{key:0,name:t.icon},null,8,["name"])):(r.openBlock(),r.createElementBlock("span",rw,r.toDisplayString(t.num),1))]))],2))}}),[["__scopeId","data-v-e3df2f74"]]);class Qh{constructor(e,n){Se(this,"id");Se(this,"stepKey");Se(this,"index");Se(this,"parentIndex");Se(this,"childIndex");Se(this,"label");Se(this,"icon");Se(this,"showContent");Se(this,"success");Se(this,"hiddenHeader");Se(this,"hiddenFooter");Se(this,"hiddenFooterLeft");Se(this,"hiddenFooterRight");Se(this,"previousStep");Se(this,"nextStep");Se(this,"parentStep");Se(this,"childrenSteps");Se(this,"iconSlot");Se(this,"labelSlot");Se(this,"defaultSlot");Se(this,"contentTitleSlot");Se(this,"contentToolbarSlot");Se(this,"contentSlot");Se(this,"contentFooterSlot");Se(this,"contentFooterLeftSlot");Se(this,"contentFooterRightSlot");var s;const o=((i=10)=>String(Date.now()).slice(-i))();this.id=e!=null&&e.id||e!=null&&e.step?`${o}-${(s=e==null?void 0:e.step)==null?void 0:s.toString()}`:o,this.stepKey=e==null?void 0:e.step,this.label=e==null?void 0:e.label,this.icon=e==null?void 0:e.icon,this.showContent=Gt(e,"show-content"),this.success=e==null?void 0:e.success,this.hiddenHeader=Gt(e,"hidden-header"),this.hiddenFooter=Gt(e,"hidden-footer"),this.hiddenFooterLeft=Gt(e,"hidden-footer-left"),this.hiddenFooterRight=Gt(e,"hidden-footer-right"),this.iconSlot=n==null?void 0:n.icon,this.labelSlot=n==null?void 0:n.label,this.defaultSlot=n==null?void 0:n.default,this.contentTitleSlot=Gt(n,"content-title"),this.contentToolbarSlot=Gt(n,"content-toolbar"),this.contentSlot=n==null?void 0:n.content,this.contentFooterSlot=Gt(n,"content-footer"),this.contentFooterLeftSlot=Gt(n,"content-footer-left"),this.contentFooterRightSlot=Gt(n,"content-footer-right")}get isChild(){return!!this.parentStep}get hasChildren(){var e;return!!((e=this.childrenSteps)!=null&&e.size)}getChildrenSteps(){var e;return Array.from(((e=this.childrenSteps)==null?void 0:e.values())||[])}hasChildStep(e){var n;return!!((n=this.childrenSteps)!=null&&n.has(e))}getFirstChildStep(){var e;return(e=this.childrenSteps)==null?void 0:e.values().next().value}getLastChildStep(){var e;return Array.from(((e=this.childrenSteps)==null?void 0:e.values())||[]).pop()}appendChildStep(e){this.childrenSteps||(this.childrenSteps=new Map),this.childrenSteps.set(e.stepKey,e)}removeChildStep(e){var n,o;(n=this.childrenSteps)==null||n.delete(e),((o=this.childrenSteps)==null?void 0:o.size)===0&&(this.childrenSteps=void 0)}clearContent(){this.defaultSlot=void 0,this.contentSlot=void 0,this.contentTitleSlot=void 0,this.contentToolbarSlot=void 0,this.contentFooterSlot=void 0,this.contentFooterLeftSlot=void 0,this.contentFooterRightSlot=void 0}}const Sl="mc-progress-indicator-item",iw={class:"mc-grogress-indicator-item"},ef=X(r.defineComponent({name:Sl,__name:"mc-progress-indicator-item",props:{icon:{},id:{},step:{},label:{},showContent:{type:Boolean},success:{type:Boolean},hiddenHeader:{type:Boolean},hiddenFooter:{type:Boolean},hiddenFooterLeft:{type:Boolean},hiddenFooterRight:{type:Boolean}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",iw))})),El="mc-progress-indicator-child-item",aw={class:"mc-grogress-indicator-child-item"},tf=X(r.defineComponent({name:El,__name:"mc-progress-indicator-child-item",props:{id:{},step:{},label:{},showContent:{type:Boolean},success:{type:Boolean},hiddenHeader:{type:Boolean},hiddenFooter:{type:Boolean},hiddenFooterLeft:{type:Boolean},hiddenFooterRight:{type:Boolean}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",aw))})),lw=(t,e)=>t===0?"first":t===e-1?"last":"middle",Js=(t,e,n="manual")=>{const o=r.unref(e);if(fp(t==null?void 0:t.success)&&t.success||t!=null&&t.parentStep&&Js(t.parentStep,e)==="success")return"success";if(!(o&&t&&Ls(o.index)&&Ls(t.index)))return"default";if(n==="auto"){if(t.isChild||!t.hasChildren){if(t.index<o.index)return"success"}else if(t.hasChildren){let s=!0;for(const i of t==null?void 0:t.getChildrenSteps())if(Js(i,e,n)!=="success"){s=!1;break}if(s)return"success"}}return t.index<=o.index?"active":"default"},nf=(t,e)=>fp(t==null?void 0:t.showContent)?t==null?void 0:t.showContent:!xe(t==null?void 0:t.stepKey)&&t.stepKey===(e==null?void 0:e.stepKey),cw=["id"],dw={key:0,class:"mc-progress-indicator-step-container"},uw={class:"mc-progress-indicator-step-content"},pw={key:0,class:"mc-progress-indicator-step-content-header"},hw={key:0,class:"mc-progress-indicator-step-content-footer-container"},fw={class:"mc-progress-indicator-step-content-footer"},mw={class:"mc-progress-indicator-step-content-footer-left-container"},gw={key:0,class:"mc-progress-indicator-step-content-footer-left"},vw={class:"mc-progress-indicator-step-content-footer-right-container"},yw={key:0,class:"mc-progress-indicator-step-content-footer-right"},kw=K(r.defineComponent({name:Xh,__name:"mc-progress-indicator-step",props:{successBehavior:{default:"auto"},currentStep:{},step:{},position:{default:"middle"},showSuccessIcon:{type:Boolean,default:!0}},setup(t){const e=t,n=r.computed(()=>nf(e.step,r.unref(e.currentStep))),o=r.computed(()=>nf(e.step.nextStep,r.unref(e.currentStep))),s=r.computed(()=>!!e.step.isChild),i=r.computed(()=>Js(e.step,e.currentStep,e.successBehavior)),a=r.computed(()=>Js(e.step.previousStep,e.currentStep,e.successBehavior)),l=r.computed(()=>Ls(e.step.parentIndex)?e.step.parentIndex+1:0);return(c,d)=>(r.openBlock(),r.createElementBlock("div",{id:t.step.id,class:"mc-progress-indicator-step"},[r.createElementVNode("div",{class:r.normalizeClass(["mc-progress-indicator-step-item",{"mc-progress-indicator-step-item-child":s.value}])},[r.createElementVNode("i",{class:r.normalizeClass(["mc-progress-indicator-step-line mc-progress-indicator-step-line-up",[`mc-progress-indicator-step-line-${a.value}`,`mc-progress-indicator-step-line-${t.position}`]])},null,2),r.renderSlot(c.$slots,"icon",{stepKey:t.step.stepKey,label:t.step.label,status:i.value},()=>[r.createVNode(sw,{num:l.value,icon:t.step.icon,status:i.value,"show-success-icon":t.showSuccessIcon,"is-child":s.value},null,8,["num","icon","status","show-success-icon","is-child"])],!0),r.createElementVNode("i",{class:r.normalizeClass(["mc-progress-indicator-step-line mc-progress-indicator-step-line-down",[`mc-progress-indicator-step-line-${i.value}`,`mc-progress-indicator-step-line-${t.position}`]])},null,2)],2),n.value?(r.openBlock(),r.createElementBlock("div",dw,[r.renderSlot(c.$slots,"default",{stepKey:t.step.stepKey,label:t.step.label,status:i.value},()=>[r.createElementVNode("div",uw,[t.step.hiddenHeader?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",pw,[r.renderSlot(c.$slots,"content-title",{stepKey:t.step.stepKey,label:t.step.label,status:i.value},()=>[r.createElementVNode("span",{class:r.normalizeClass(["mc-progress-indicator-step-content-title",[`mc-progress-indicator-step-content-title-${i.value}`]])},r.toDisplayString(t.step.label),3)],!0),r.renderSlot(c.$slots,"content-toolbar",{stepKey:t.step.stepKey,label:t.step.label,status:i.value},void 0,!0)])),r.renderSlot(c.$slots,"content",{stepKey:t.step.stepKey,label:t.step.label,status:i.value},void 0,!0)]),t.step.hiddenFooter?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",hw,[r.renderSlot(c.$slots,"content-footer",{stepKey:t.step.stepKey,label:t.step.label,status:i.value},()=>[r.createElementVNode("div",fw,[r.createElementVNode("div",mw,[t.step.hiddenFooterLeft?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",gw,[r.renderSlot(c.$slots,"content-footer-left",{stepKey:t.step.stepKey,label:t.step.label,status:i.value},void 0,!0)]))]),r.createElementVNode("div",vw,[t.step.hiddenFooterRight?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",yw,[r.renderSlot(c.$slots,"content-footer-right",{stepKey:t.step.stepKey,label:t.step.label,status:i.value},void 0,!0)]))])])],!0)]))],!0)])):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mc-progress-indicator-step-label",[`mc-progress-indicator-step-label-${i.value}`,{"mc-progress-indicator-step-label-child":s.value,"mc-progress-indicator-step-label-need-padding-bottom":o.value}]])},[r.renderSlot(c.$slots,"label",{stepKey:t.step.stepKey,label:t.step.label,status:i.value},()=>[r.createTextVNode(r.toDisplayString(t.step.label),1)],!0)],2))],8,cw))}}),[["__scopeId","data-v-150dfe0a"]]),bw={class:"mc-grogress-indicator"},of=X(K(r.defineComponent({name:Yh,__name:"mc-progress-indicator",props:{modelValue:{},successSteps:{},successBehavior:{default:"auto"},previousBehavior:{default:"last-child"},showSuccessIcon:{type:Boolean,default:!0},scrollToStep:{type:Boolean,default:!1}},emits:["update:modelValue","update:successSteps","change","click:step"],setup(t,{expose:e,emit:n}){const o=t,s=n,{stepItems:i,currentStep:a}=(()=>{const d=r.ref([]),u=r.ref(new Map),p=r.useSlots();r.watchEffect(()=>{var v;const{stepItems:m,stepMap:g}=(k=>{const y=[],b=new Map;let x,w=0,C=0;const S=(E,M)=>{de(E)&&E.forEach(N=>{var R,z,_;const T=(R=(N==null?void 0:N.type)||{})==null?void 0:R.name;if(T===Sl){const I=Lo(N.children)||de(N.children)||!Ve((z=N.children)==null?void 0:z.default)?N.children:(_=N.children)==null?void 0:_.default(),O=N.props,V=N.children,P=new Qh(O,V);P.parentIndex=w++,P.index=C++,x&&(P.previousStep=x,x.nextStep=P),x=P,y.push(P),b.set(P.stepKey,P),S(I,P)}else if(T===El){const I=N.props,O=N.children,V=new Qh(I,O);V.index=C++,M&&(M.clearContent(),M.appendChildStep(V),V.parentIndex=M.parentIndex,V.parentStep=M,V.childIndex=M.getChildrenSteps().length),x&&(V.previousStep=x,x.nextStep=V),b.set(V.stepKey,V),y.push(V),x=V}else de(N.children)&&S(N.children,M)})};return S(k),{stepItems:y,stepMap:b}})((v=p.default)==null?void 0:v.call(p));d.value=m,u.value=g});const h=ke("modelValue"),f=r.computed(()=>u.value.get(h.value));return{stepItems:d,currentStep:f}})(),l=d=>{xe(d)||s("update:modelValue",d)},c=async d=>{if(!o.scrollToStep||xe(d==null?void 0:d.stepKey))return;await r.nextTick();const u=document.getElementById(d.id);u&&u.scrollIntoView({behavior:"smooth"})};return e({goStep:l,goNextStep:()=>{var u,p;const d=(u=a.value)==null?void 0:u.nextStep;xe(d==null?void 0:d.stepKey)||(d.hasChildren?l((p=d==null?void 0:d.getFirstChildStep())==null?void 0:p.stepKey):l(d.stepKey),c(d))},goPreviousStep:()=>{var u,p,h,f,m,g;const d=(u=a.value)==null?void 0:u.previousStep;if(!xe(d==null?void 0:d.stepKey))if((p=a.value)!=null&&p.isChild&&d===((h=a.value)==null?void 0:h.parentStep)){const v=d.previousStep;o.previousBehavior==="last-child"?(l(v==null?void 0:v.stepKey),c(v)):v!=null&&v.isChild?(l((m=(f=v.parentStep)==null?void 0:f.getFirstChildStep())==null?void 0:m.stepKey),c(v.parentStep)):(l(v==null?void 0:v.stepKey),c(v))}else l(d==null?void 0:d.stepKey),d!=null&&d.isChild&&((g=d.parentStep)==null?void 0:g.getFirstChildStep())===d?c(d.parentStep):c(d)}}),(d,u)=>(r.openBlock(),r.createElementBlock("div",bw,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(i),(p,h)=>(r.openBlock(),r.createBlock(kw,{key:p.stepKey,position:r.unref(lw)(h,r.unref(i).length),step:p,"current-step":r.unref(a),"success-behavior":t.successBehavior,"show-success-icon":t.showSuccessIcon},r.createSlots({_:2},[p.labelSlot?{name:"label",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.labelSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"0"}:void 0,p.iconSlot?{name:"icon",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.iconSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"1"}:void 0,p.defaultSlot?{name:"default",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.defaultSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"2"}:void 0,p.contentTitleSlot?{name:"content-title",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentTitleSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"3"}:void 0,p.contentToolbarSlot?{name:"content-toolbar",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentToolbarSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"4"}:void 0,p.contentSlot?{name:"content",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"5"}:void 0,p.contentFooterSlot?{name:"content-footer",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentFooterSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"6"}:void 0,p.contentFooterLeftSlot?{name:"content-footer-left",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentFooterLeftSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"7"}:void 0,p.contentFooterRightSlot?{name:"content-footer-right",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentFooterRightSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"8"}:void 0]),1032,["position","step","current-step","success-behavior","show-success-icon"]))),128))]))}}),[["__scopeId","data-v-a2c50544"]])),Ml=Symbol("mc-radio-group-context"),rf="mc-radio-group",ww=["id"],sf=X(K(r.defineComponent({name:rf,__name:"mc-radio-group",props:{modelValue:{type:[Number,String,Boolean]},disabled:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,{formId:s}=cn();return r.provide(Ml,{modelValue:r.computed(()=>n.modelValue),disabled:r.computed(()=>n.disabled),handleSelect:i=>{o("update:modelValue",i),o("change",i)}}),(i,a)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-radio-group",id:r.unref(s)},[r.renderSlot(i.$slots,"default",{},void 0,!0)],8,ww))}}),[["__scopeId","data-v-e40c3cfa"]])),af="mc-radio",xw=["disabled","onKeypress"],Cw={class:"mc-radio-wrapper"},Sw={class:"mc-radio-content"},Ew={key:0,class:"mc-radio-help"},Mw={class:"mc-radio-remark"},lf=X(K(r.defineComponent({name:af,__name:"mc-radio",props:{label:{},value:{type:[Number,String,Boolean]},disabled:{type:Boolean},remark:{},help:{}},emits:["focus","blur"],setup(t){const e=t,n=r.inject(Ml,void 0),o=r.ref(),{wrapperRef:s,isFocused:i,handleFocus:a,handleBlur:l}=$o(o),c=r.computed(()=>{var f;return((f=n==null?void 0:n.modelValue)==null?void 0:f.value)===e.value}),{formDisabled:d,validateStyle:u,validateByTrigger:p}=cn({externalDisabled:r.computed(()=>{var f;return!!((f=n==null?void 0:n.disabled)!=null&&f.value)})}),h=async()=>{d.value||(n==null||n.handleSelect(e.value),await r.nextTick(),p("input"))};return(f,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"wrapperRef",ref:s,class:r.normalizeClass(["mc-radio",{"mc-radio-has-remark":!!t.remark}])},[r.createElementVNode("label",{class:r.normalizeClass(["mc-radio-label",{"mc-radio-checked":c.value,"mc-radio-disabled":r.unref(d),"mc-radio-focused":r.unref(i),[r.unref(u)]:r.unref(u)}]),onClick:r.withModifiers(h,["prevent"])},[r.createElementVNode("input",{ref_key:"inputRef",ref:o,type:"radio",class:"mc-radio-input",disabled:r.unref(d),onFocus:m[0]||(m[0]=(...g)=>r.unref(a)&&r.unref(a)(...g)),onBlur:m[1]||(m[1]=(...g)=>r.unref(l)&&r.unref(l)(...g)),onKeypress:r.withKeys(r.withModifiers(h,["prevent","stop"]),["enter"])},null,40,xw),r.createElementVNode("div",Cw,[m[2]||(m[2]=r.createElementVNode("span",{class:"mc-radio-circle"},null,-1)),r.createElementVNode("div",Sw,[r.renderSlot(f.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.label),1)],!0)]),t.help||f.$slots.help?(r.openBlock(),r.createElementBlock("div",Ew,[r.renderSlot(f.$slots,"help",{},()=>[r.createVNode(r.unref(Uo),{content:t.help,"icon-size":24},null,8,["content"])],!0)])):r.createCommentVNode("",!0)])],2),r.createElementVNode("div",Mw,[r.renderSlot(f.$slots,"remark",{},()=>[r.createTextVNode(r.toDisplayString(t.remark),1)],!0)])],2))}}),[["__scopeId","data-v-37cfb183"]]));function Qe(t){this.content=t}function cf(t,e,n){for(let o=0;;o++){if(o==t.childCount||o==e.childCount)return t.childCount==e.childCount?null:n;let s=t.child(o),i=e.child(o);if(s!=i){if(!s.sameMarkup(i))return n;if(s.isText&&s.text!=i.text){for(let a=0;s.text[a]==i.text[a];a++)n++;return n}if(s.content.size||i.content.size){let a=cf(s.content,i.content,n+1);if(a!=null)return a}n+=s.nodeSize}else n+=s.nodeSize}}function df(t,e,n,o){for(let s=t.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:n,b:o};let a=t.child(--s),l=e.child(--i),c=a.nodeSize;if(a!=l){if(!a.sameMarkup(l))return{a:n,b:o};if(a.isText&&a.text!=l.text){let d=0,u=Math.min(a.text.length,l.text.length);for(;d<u&&a.text[a.text.length-d-1]==l.text[l.text.length-d-1];)d++,n--,o--;return{a:n,b:o}}if(a.content.size||l.content.size){let d=df(a.content,l.content,n-1,o-1);if(d)return d}n-=c,o-=c}else n-=c,o-=c}}Qe.prototype={constructor:Qe,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var o=n&&n!=t?this.remove(n):this,s=o.find(t),i=o.content.slice();return s==-1?i.push(n||t,e):(i[s+1]=e,n&&(i[s]=n)),new Qe(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Qe(n)},addToStart:function(t,e){return new Qe([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Qe(n)},addBefore:function(t,e,n){var o=this.remove(e),s=o.content.slice(),i=o.find(t);return s.splice(i==-1?s.length:i,0,e,n),new Qe(s)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=Qe.from(t)).size?new Qe(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=Qe.from(t)).size?new Qe(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Qe.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},Qe.from=function(t){if(t instanceof Qe)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Qe(e)};class ${constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let o=0;o<e.length;o++)this.size+=e[o].nodeSize}nodesBetween(e,n,o,s=0,i){for(let a=0,l=0;l<n;a++){let c=this.content[a],d=l+c.nodeSize;if(d>e&&o(c,s+l,i||null,a)!==!1&&c.content.size){let u=l+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,n-u),o,s+u)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,o,s){let i="",a=!0;return this.nodesBetween(e,n,(l,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,n-c):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&o&&(a?a=!1:i+=o),i+=d},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,o=e.firstChild,s=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(o)&&(s[s.length-1]=n.withText(n.text+o.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new $(s,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let o=[],s=0;if(n>e)for(let i=0,a=0;a<n;i++){let l=this.content[i],c=a+l.nodeSize;c>e&&((a<e||c>n)&&(l=l.isText?l.cut(Math.max(0,e-a),Math.min(l.text.length,n-a)):l.cut(Math.max(0,e-a-1),Math.min(l.content.size,n-a-1))),o.push(l),s+=l.nodeSize),a=c}return new $(o,s)}cutByIndex(e,n){return e==n?$.empty:e==0&&n==this.content.length?this:new $(this.content.slice(e,n))}replaceChild(e,n){let o=this.content[e];if(o==n)return this;let s=this.content.slice(),i=this.size+n.nodeSize-o.nodeSize;return s[e]=n,new $(s,i)}addToStart(e){return new $([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new $(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,o=0;n<this.content.length;n++){let s=this.content[n];e(s,o,n),o+=s.nodeSize}}findDiffStart(e,n=0){return cf(this,e,n)}findDiffEnd(e,n=this.size,o=e.size){return df(this,e,n,o)}findIndex(e){if(e==0)return Ys(0,e);if(e==this.size)return Ys(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,o=0;;n++){let s=o+this.child(n).nodeSize;if(s>=e)return s==e?Ys(n+1,s):Ys(n,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return $.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new $(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return $.empty;let n,o=0;for(let s=0;s<e.length;s++){let i=e[s];o+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(n||(n=e.slice(0,s)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new $(n||e,o)}static from(e){if(!e)return $.empty;if(e instanceof $)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new $([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}$.empty=new $([],0);const Nl={index:0,offset:0};function Ys(t,e){return Nl.index=t,Nl.offset=e,Nl}function Xs(t,e){if(t===e)return!0;if(!t||typeof t!="object"||!e||typeof e!="object")return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let o=0;o<t.length;o++)if(!Xs(t[o],e[o]))return!1}else{for(let o in t)if(!(o in e)||!Xs(t[o],e[o]))return!1;for(let o in e)if(!(o in t))return!1}return!0}let Me=class Od{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,o=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!o&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,s)),n.push(this),o=!0),n&&n.push(i)}}return n||(n=e.slice()),o||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Xs(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let o=e.marks[n.type];if(!o)throw new RangeError(`There is no mark type ${n.type} in this schema`);let s=o.create(n.attrs);return o.checkAttrs(s.attrs),s}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let o=0;o<e.length;o++)if(!e[o].eq(n[o]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Od.none;if(e instanceof Od)return[e];let n=e.slice();return n.sort((o,s)=>o.type.rank-s.type.rank),n}};Me.none=[];class Zs extends Error{}class G{constructor(e,n,o){this.content=e,this.openStart=n,this.openEnd=o}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let o=pf(this.content,e+this.openStart,n);return o&&new G(o,this.openStart,this.openEnd)}removeBetween(e,n){return new G(uf(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return G.empty;let o=n.openStart||0,s=n.openEnd||0;if(typeof o!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new G($.fromJSON(e,n.content),o,s)}static maxOpen(e,n=!0){let o=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)o++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)s++;return new G(e,o,s)}}function uf(t,e,n){let{index:o,offset:s}=t.findIndex(e),i=t.maybeChild(o),{index:a,offset:l}=t.findIndex(n);if(s==e||i.isText){if(l!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(o!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(o,i.copy(uf(i.content,e-s-1,n-s-1)))}function pf(t,e,n,o){let{index:s,offset:i}=t.findIndex(e),a=t.maybeChild(s);if(i==e||a.isText)return o&&!o.canReplace(s,s,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=pf(a.content,e-i-1,n,a);return l&&t.replaceChild(s,a.copy(l))}function Nw(t,e,n){if(n.openStart>t.depth)throw new Zs("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Zs("Inconsistent open depths");return hf(t,e,n,0)}function hf(t,e,n,o){let s=t.index(o),i=t.node(o);if(s==e.index(o)&&o<t.depth-n.openStart){let a=hf(t,e,n,o+1);return i.copy(i.content.replaceChild(s,a))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=o||e.depth!=o){let{start:a,end:l}=function(c,d){let u=d.depth-c.openStart,p=d.node(u).copy(c.content);for(let h=u-1;h>=0;h--)p=d.node(h).copy($.from(p));return{start:p.resolveNoCache(c.openStart+u),end:p.resolveNoCache(p.content.size-c.openEnd-u)}}(n,t);return lo(i,mf(t,a,l,e,o))}{let a=t.parent,l=a.content;return lo(a,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}}return lo(i,Qs(t,e,o))}function ff(t,e){if(!e.type.compatibleContent(t.type))throw new Zs("Cannot join "+e.type.name+" onto "+t.type.name)}function Bl(t,e,n){let o=t.node(n);return ff(o,e.node(n)),o}function ao(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Ir(t,e,n,o){let s=(e||t).node(n),i=0,a=e?e.index(n):s.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(ao(t.nodeAfter,o),i++));for(let l=i;l<a;l++)ao(s.child(l),o);e&&e.depth==n&&e.textOffset&&ao(e.nodeBefore,o)}function lo(t,e){return t.type.checkContent(e),t.copy(e)}function mf(t,e,n,o,s){let i=t.depth>s&&Bl(t,e,s+1),a=o.depth>s&&Bl(n,o,s+1),l=[];return Ir(null,t,s,l),i&&a&&e.index(s)==n.index(s)?(ff(i,a),ao(lo(i,mf(t,e,n,o,s+1)),l)):(i&&ao(lo(i,Qs(t,e,s+1)),l),Ir(e,n,s,l),a&&ao(lo(a,Qs(n,o,s+1)),l)),Ir(o,null,s,l),new $(l)}function Qs(t,e,n){let o=[];return Ir(null,t,n,o),t.depth>n&&ao(lo(Bl(t,e,n+1),Qs(t,e,n+1)),o),Ir(e,null,n,o),new $(o)}G.empty=new G($.empty,0,0);class Dr{constructor(e,n,o){this.pos=e,this.path=n,this.parentOffset=o,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return(e=this.resolveDepth(e))==0?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let o=this.pos-this.path[this.path.length-1],s=e.child(n);return o?e.child(n).cut(o):s}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let o=this.path[3*n],s=n==0?0:this.path[3*n-1]+1;for(let i=0;i<e;i++)s+=o.child(i).nodeSize;return s}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Me.none;if(this.textOffset)return e.child(n).marks;let o=e.maybeChild(n-1),s=e.maybeChild(n);if(!o){let l=o;o=s,s=l}let i=o.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive!==!1||s&&i[a].isInSet(s.marks)||(i=i[a--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let o=n.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<o.length;i++)o[i].type.spec.inclusive!==!1||s&&o[i].isInSet(s.marks)||(o=o[i--].removeFromSet(o));return o}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let o=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);o>=0;o--)if(e.pos<=this.end(o)&&(!n||n(this.node(o))))return new ei(this,e,o);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let o=[],s=0,i=n;for(let a=e;;){let{index:l,offset:c}=a.content.findIndex(i),d=i-c;if(o.push(a,l,s+c),!d||(a=a.child(l),a.isText))break;i=d-1,s+=c+1}return new Dr(n,o,i)}static resolveCached(e,n){let o=gf.get(e);if(o)for(let i=0;i<o.elts.length;i++){let a=o.elts[i];if(a.pos==n)return a}else gf.set(e,o=new Bw);let s=o.elts[o.i]=Dr.resolve(e,n);return o.i=(o.i+1)%Tw,s}}class Bw{constructor(){this.elts=[],this.i=0}}const Tw=12,gf=new WeakMap;class ei{constructor(e,n,o){this.$from=e,this.$to=n,this.depth=o}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Ow=Object.create(null);class jt{constructor(e,n,o,s=Me.none){this.type=e,this.attrs=n,this.marks=s,this.content=o||$.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,o,s=0){this.content.nodesBetween(e,n,o,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,o,s){return this.content.textBetween(e,n,o,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,o){return this.type==e&&Xs(this.attrs,n||e.defaultAttrs||Ow)&&Me.sameSet(this.marks,o||Me.none)}copy(e=null){return e==this.content?this:new jt(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new jt(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,o=!1){if(e==n)return G.empty;let s=this.resolve(e),i=this.resolve(n),a=o?0:s.sharedDepth(n),l=s.start(a),c=s.node(a).content.cut(s.pos-l,i.pos-l);return new G(c,s.depth-a,i.depth-a)}replace(e,n,o){return Nw(this.resolve(e),this.resolve(n),o)}nodeAt(e){for(let n=this;;){let{index:o,offset:s}=n.content.findIndex(e);if(n=n.maybeChild(o),!n)return null;if(s==e||n.isText)return n;e-=s+1}}childAfter(e){let{index:n,offset:o}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:o}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:o}=this.content.findIndex(e);if(o<e)return{node:this.content.child(n),index:n,offset:o};let s=this.content.child(n-1);return{node:s,index:n-1,offset:o-s.nodeSize}}resolve(e){return Dr.resolveCached(this,e)}resolveNoCache(e){return Dr.resolve(this,e)}rangeHasMark(e,n,o){let s=!1;return n>e&&this.nodesBetween(e,n,i=>(o.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),vf(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,o=$.empty,s=0,i=o.childCount){let a=this.contentMatchAt(e).matchFragment(o,s,i),l=a&&a.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=s;c<i;c++)if(!this.type.allowsMarks(o.child(c).marks))return!1;return!0}canReplaceWith(e,n,o,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(o),a=i&&i.matchFragment(this.content,n);return!!a&&a.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Me.none;for(let n=0;n<this.marks.length;n++){let o=this.marks[n];o.type.checkAttrs(o.attrs),e=o.addToSet(e)}if(!Me.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let o;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");o=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,o)}let s=$.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,s,o);return i.type.checkAttrs(i.attrs),i}}jt.prototype.text=void 0;class ti extends jt{constructor(e,n,o,s){if(super(e,n,null,s),!o)throw new RangeError("Empty text nodes are not allowed");this.text=o}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):vf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ti(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ti(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function vf(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class co{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let o=new _w(e,n);if(o.next==null)return co.empty;let s=yf(o);o.next&&o.err("Unexpected trailing text");let i=function(a){let l=Object.create(null);return function c(d){let u=[];d.forEach(h=>{a[h].forEach(({term:f,to:m})=>{if(!f)return;let g;for(let v=0;v<u.length;v++)u[v][0]==f&&(g=u[v][1]);wf(a,m).forEach(v=>{g||u.push([f,g=[]]),g.indexOf(v)==-1&&g.push(v)})})});let p=l[d.join(",")]=new co(d.indexOf(a.length-1)>-1);for(let h=0;h<u.length;h++){let f=u[h][1].sort(bf);p.next.push({type:u[h][0],next:l[f.join(",")]||c(f)})}return p}(wf(a,0))}(function(a){let l=[[]];return u(function p(h,f){if(h.type=="choice")return h.exprs.reduce((m,g)=>m.concat(p(g,f)),[]);if(h.type!="seq"){if(h.type=="star"){let m=c();return d(f,m),u(p(h.expr,m),m),[d(m)]}if(h.type=="plus"){let m=c();return u(p(h.expr,f),m),u(p(h.expr,m),m),[d(m)]}if(h.type=="opt")return[d(f)].concat(p(h.expr,f));if(h.type=="range"){let m=f;for(let g=0;g<h.min;g++){let v=c();u(p(h.expr,m),v),m=v}if(h.max==-1)u(p(h.expr,m),m);else for(let g=h.min;g<h.max;g++){let v=c();d(m,v),u(p(h.expr,m),v),m=v}return[d(m)]}if(h.type=="name")return[d(f,void 0,h.value)];throw new Error("Unknown expr type")}for(let m=0;;m++){let g=p(h.exprs[m],f);if(m==h.exprs.length-1)return g;u(g,f=c())}}(a,0),c()),l;function c(){return l.push([])-1}function d(p,h,f){let m={term:f,to:h};return l[p].push(m),m}function u(p,h){p.forEach(f=>f.to=h)}}(s));return function(a,l){for(let c=0,d=[a];c<d.length;c++){let u=d[c],p=!u.validEnd,h=[];for(let f=0;f<u.next.length;f++){let{type:m,next:g}=u.next[f];h.push(m.name),!p||m.isText||m.hasRequiredAttrs()||(p=!1),d.indexOf(g)==-1&&d.push(g)}p&&l.err("Only non-generatable nodes ("+h.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,o),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,o=e.childCount){let s=this;for(let i=n;s&&i<o;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!n.isText&&!n.hasRequiredAttrs())return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let o=0;o<e.next.length;o++)if(this.next[n].type==e.next[o].type)return!0;return!1}fillBefore(e,n=!1,o=0){let s=[this];return function i(a,l){let c=a.matchFragment(e,o);if(c&&(!n||c.validEnd))return $.from(l.map(d=>d.createAndFill()));for(let d=0;d<a.next.length;d++){let{type:u,next:p}=a.next[d];if(!u.isText&&!u.hasRequiredAttrs()&&s.indexOf(p)==-1){s.push(p);let h=i(p,l.concat(u));if(h)return h}}return null}(this,[])}findWrapping(e){for(let o=0;o<this.wrapCache.length;o+=2)if(this.wrapCache[o]==e)return this.wrapCache[o+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),o=[{match:this,type:null,via:null}];for(;o.length;){let s=o.shift(),i=s.match;if(i.matchType(e)){let a=[];for(let l=s;l.type;l=l.via)a.push(l.type);return a.reverse()}for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];l.isLeaf||l.hasRequiredAttrs()||l.name in n||s.type&&!c.validEnd||(o.push({match:l.contentMatch,type:l,via:s}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function n(o){e.push(o);for(let s=0;s<o.next.length;s++)e.indexOf(o.next[s].next)==-1&&n(o.next[s].next)}(this),e.map((n,o)=>{let s=o+(n.validEnd?"*":" ")+" ";for(let i=0;i<n.next.length;i++)s+=(i?", ":"")+n.next[i].type.name+"->"+e.indexOf(n.next[i].next);return s}).join(`
|
|
37
|
-
`)}}co.empty=new co(!0);class _w{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function yf(t){let e=[];do e.push(Aw(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Aw(t){let e=[];do e.push(Vw(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Vw(t){let e=function(n){if(n.eat("(")){let o=yf(n);return n.eat(")")||n.err("Missing closing paren"),o}if(!/\W/.test(n.next)){let o=function(s,i){let a=s.nodeTypes,l=a[i];if(l)return[l];let c=[];for(let d in a){let u=a[d];u.isInGroup(i)&&c.push(u)}return c.length==0&&s.err("No node type or group '"+i+"' found"),c}(n,n.next).map(s=>(n.inline==null?n.inline=s.isInline:n.inline!=s.isInline&&n.err("Mixing inline and block content"),{type:"name",value:s}));return n.pos++,o.length==1?o[0]:{type:"choice",exprs:o}}n.err("Unexpected token '"+n.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=Iw(t,e)}return e}function kf(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Iw(t,e){let n=kf(t),o=n;return t.eat(",")&&(o=t.next!="}"?kf(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:o,expr:e}}function bf(t,e){return e-t}function wf(t,e){let n=[];return function o(s){let i=t[s];if(i.length==1&&!i[0].term)return o(i[0].to);n.push(s);for(let a=0;a<i.length;a++){let{term:l,to:c}=i[a];l||n.indexOf(c)!=-1||o(c)}}(e),n.sort(bf)}function xf(t){let e=Object.create(null);for(let n in t){let o=t[n];if(!o.hasDefault)return null;e[n]=o.default}return e}function Cf(t,e){let n=Object.create(null);for(let o in t){let s=e&&e[o];if(s===void 0){let i=t[o];if(!i.hasDefault)throw new RangeError("No value supplied for attribute "+o);s=i.default}n[o]=s}return n}function Sf(t,e,n,o){for(let s in e)if(!(s in t))throw new RangeError(`Unsupported attribute ${s} for ${n} of type ${s}`);for(let s in t){let i=t[s];i.validate&&i.validate(e[s])}}function Ef(t,e){let n=Object.create(null);if(e)for(let o in e)n[o]=new Dw(t,o,e[o]);return n}let Mf=class sy{constructor(e,n,o){this.name=e,this.schema=n,this.spec=o,this.markSet=null,this.groups=o.group?o.group.split(" "):[],this.attrs=Ef(e,o.attrs),this.defaultAttrs=xf(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(o.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==co.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Cf(this.attrs,e)}create(e=null,n,o){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new jt(this,this.computeAttrs(e),$.from(n),Me.setFrom(o))}createChecked(e=null,n,o){return n=$.from(n),this.checkContent(n),new jt(this,this.computeAttrs(e),n,Me.setFrom(o))}createAndFill(e=null,n,o){if(e=this.computeAttrs(e),(n=$.from(n)).size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let s=this.contentMatch.matchFragment(n),i=s&&s.fillBefore($.empty,!0);return i?new jt(this,e,n.append(i),Me.setFrom(o)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let o=0;o<e.childCount;o++)if(!this.allowsMarks(e.child(o).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Sf(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let o=0;o<e.length;o++)this.allowsMarkType(e[o].type)?n&&n.push(e[o]):n||(n=e.slice(0,o));return n?n.length?n:Me.none:e}static compile(e,n){let o=Object.create(null);e.forEach((i,a)=>o[i]=new sy(i,n,a));let s=n.spec.topNode||"doc";if(!o[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!o.text)throw new RangeError("Every schema needs a 'text' type");for(let i in o.text.attrs)throw new RangeError("The text node type should not have attributes");return o}};class Dw{constructor(e,n,o){this.hasDefault=Object.prototype.hasOwnProperty.call(o,"default"),this.default=o.default,this.validate=typeof o.validate=="string"?function(s,i,a){let l=a.split("|");return c=>{let d=c===null?"null":typeof c;if(l.indexOf(d)<0)throw new RangeError(`Expected value of type ${l} for attribute ${i} on type ${s}, got ${d}`)}}(e,n,o.validate):o.validate}get isRequired(){return!this.hasDefault}}class ni{constructor(e,n,o,s){this.name=e,this.rank=n,this.schema=o,this.spec=s,this.attrs=Ef(e,s.attrs),this.excluded=null;let i=xf(this.attrs);this.instance=i?new Me(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Me(this,Cf(this.attrs,e))}static compile(e,n){let o=Object.create(null),s=0;return e.forEach((i,a)=>o[i]=new ni(i,s++,n,a)),o}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Sf(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Nf{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let s in e)n[s]=e[s];n.nodes=Qe.from(e.nodes),n.marks=Qe.from(e.marks||{}),this.nodes=Mf.compile(this.spec.nodes,this),this.marks=ni.compile(this.spec.marks,this);let o=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],a=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=o[a]||(o[a]=co.parse(a,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?Bf(this,l.split(" ")):l!=""&&i.inlineContent?null:[]}for(let s in this.marks){let i=this.marks[s],a=i.spec.excludes;i.excluded=a==null?[i]:a==""?[]:Bf(this,a.split(" "))}this.nodeFromJSON=s=>jt.fromJSON(this,s),this.markFromJSON=s=>Me.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,o,s){if(typeof e=="string")e=this.nodeType(e);else{if(!(e instanceof Mf))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(n,o,s)}text(e,n){let o=this.nodes.text;return new ti(o,o.defaultAttrs,e,Me.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Bf(t,e){let n=[];for(let o=0;o<e.length;o++){let s=e[o],i=t.marks[s],a=i;if(i)n.push(i);else for(let l in t.marks){let c=t.marks[l];(s=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(s)>-1)&&n.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[o]+"'")}return n}class Tn{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let o=this.matchedStyles=[];n.forEach(s=>{if(function(i){return i.tag!=null}(s))this.tags.push(s);else if(function(i){return i.style!=null}(s)){let i=/[^=]*/.exec(s.style)[0];o.indexOf(i)<0&&o.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let o=new Af(this,n,!1);return o.addAll(e,Me.none,n.from,n.to),o.finish()}parseSlice(e,n={}){let o=new Af(this,n,!0);return o.addAll(e,Me.none,n.from,n.to),G.maxOpen(o.finish())}matchTag(e,n,o){for(let s=o?this.tags.indexOf(o)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(Lw(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let a=i.getAttrs(e);if(a===!1)continue;i.attrs=a||void 0}return i}}}matchStyle(e,n,o,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let a=this.styles[i],l=a.style;if(!(l.indexOf(e)!=0||a.context&&!o.matchesContext(a.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(a.getAttrs){let c=a.getAttrs(n);if(c===!1)continue;a.attrs=c||void 0}return a}}}static schemaRules(e){let n=[];function o(s){let i=s.priority==null?50:s.priority,a=0;for(;a<n.length;a++){let l=n[a];if((l.priority==null?50:l.priority)<i)break}n.splice(a,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(a=>{o(a=Vf(a)),a.mark||a.ignore||a.clearMark||(a.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(a=>{o(a=Vf(a)),a.node||a.ignore||a.mark||(a.node=s)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Tn(e,Tn.schemaRules(e)))}}const Tf={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Rw={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Of={ol:!0,ul:!0};function _f(t,e,n){return e!=null?(e?1:0)|(e==="full"?2:0):t&&t.whitespace=="pre"?3:-5&n}class Tl{constructor(e,n,o,s,i,a){this.type=e,this.attrs=n,this.marks=o,this.solid=s,this.options=a,this.content=[],this.activeMarks=Me.none,this.match=i||(4&a?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore($.from(e));if(!n){let o,s=this.type.contentMatch;return(o=s.findWrapping(e.type))?(this.match=s,o):null}this.match=this.type.contentMatch.matchFragment(n)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let o,s=this.content[this.content.length-1];if(s&&s.isText&&(o=/[ \t\r\n\u000c]+$/.exec(s.text))){let i=s;s.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=$.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore($.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Tf.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Af{constructor(e,n,o){this.parser=e,this.options=n,this.isOpen=o,this.open=0,this.localPreserveWS=!1;let s,i=n.topNode,a=_f(null,n.preserveWhitespace,0)|(o?4:0);s=i?new Tl(i.type,i.attrs,Me.none,!0,n.topMatch||i.type.contentMatch,a):new Tl(o?null:e.schema.topNodeType,null,Me.none,!0,null,a),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let o=e.nodeValue,s=this.top,i=2&s.options?"full":this.localPreserveWS||(1&s.options)>0;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(o)){if(i)o=i!=="full"?o.replace(/\r?\n|\r/g," "):o.replace(/\r\n?/g,`
|
|
38
|
-
`);else if(o=o.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(o)&&this.open==this.nodes.length-1){let a=
|
|
39
|
-
`),n)}ignoreFallback(e,n){e.nodeName!="BR"||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let o=e.style;if(o&&o.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],a=o.getPropertyValue(i);if(a)for(let l;;){let c=this.parser.matchStyle(i,a,this,l);if(!c)break;if(c.ignore)return null;if(n=c.clearMark?n.filter(d=>!c.clearMark(d)):n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming!==!1)break;l=c}}return n}addElementByRule(e,n,o,s){let i,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),o,e.nodeName=="BR")||this.leafFallback(e,o);else{let c=this.enter(a,n.attrs||null,o,n.preserveWhitespace);c&&(i=!0,o=c)}else{let c=this.parser.schema.marks[n.mark];o=o.concat(c.create(n.attrs))}let l=this.top;if(a&&a.isLeaf)this.findInside(e);else if(s)this.addElement(e,o,s);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,o,!1));else{let c=e;typeof n.contentElement=="string"?c=e.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(e):n.contentElement&&(c=n.contentElement),this.findAround(e,c,!0),this.addAll(c,o),this.findAround(e,c,!1)}i&&this.sync(l)&&this.open--}addAll(e,n,o,s){let i=o||0;for(let a=o?e.childNodes[o]:e.firstChild,l=s==null?null:e.childNodes[s];a!=l;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,n);this.findAtPoint(e,i)}findPlace(e,n,o){let s,i;for(let a=this.open,l=0;a>=0;a--){let c=this.nodes[a],d=c.findWrapping(e);if(d&&(!s||s.length>d.length+l)&&(s=d,i=c,!d.length))break;if(c.solid){if(o)break;l+=2}}if(!s)return null;this.sync(i);for(let a=0;a<s.length;a++)n=this.enterInner(s[a],null,n,!1);return n}insertNode(e,n,o){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let s=this.findPlace(e,n,o);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let a=Me.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):If(l.type,e.type))&&(a=l.addToSet(a));return i.content.push(e.mark(a)),!0}return!1}enter(e,n,o,s){let i=this.findPlace(e.create(n),o,!1);return i&&(i=this.enterInner(e,n,o,!0,s)),i}enterInner(e,n,o,s=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let l=_f(e,i,a.options);4&a.options&&a.content.length==0&&(l|=4);let c=Me.none;return o=o.filter(d=>!(a.type?a.type.allowsMarkType(d.type):If(d.type,e))||(c=d.addToSet(c),!1)),this.nodes.push(new Tl(e,n,c,s,null,l)),this.open++,o}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=1)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let o=this.nodes[n].content;for(let s=o.length-1;s>=0;s--)e+=o[s].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let o=0;o<this.find.length;o++)this.find[o].node==e&&this.find[o].offset==n&&(this.find[o].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,o){if(e!=n&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&n.compareDocumentPosition(this.find[s].node)&(o?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),o=this.options.context,s=!(this.isOpen||o&&o.parent.type!=this.nodes[0].type),i=-(o?o.depth+1:0)+(s?0:1),a=(l,c)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;c>=i;c--)if(a(l-1,c))return!0;return!1}{let u=c>0||c==0&&s?this.nodes[c].type:o&&c>=i?o.node(c-i).type:null;if(!u||u.name!=d&&!u.isInGroup(d))return!1;c--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(o&&o.isTextblock&&o.defaultAttrs)return o}for(let n in this.parser.schema.nodes){let o=this.parser.schema.nodes[n];if(o.isTextblock&&o.defaultAttrs)return o}}}function Lw(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Vf(t){let e={};for(let n in t)e[n]=t[n];return e}function If(t,e){let n=e.schema.nodes;for(let o in n){let s=n[o];if(!s.allowsMarkType(t))continue;let i=[],a=l=>{i.push(l);for(let c=0;c<l.edgeCount;c++){let{type:d,next:u}=l.edge(c);if(d==e||i.indexOf(u)<0&&a(u))return!0}};if(a(s.contentMatch))return!0}}class uo{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},o){o||(o=Ol(n).createDocumentFragment());let s=o,i=[];return e.forEach(a=>{if(i.length||a.marks.length){let l=0,c=0;for(;l<i.length&&c<a.marks.length;){let d=a.marks[c];if(this.marks[d.type.name]){if(!d.eq(i[l][0])||d.type.spec.spanning===!1)break;l++,c++}else c++}for(;l<i.length;)s=i.pop()[1];for(;c<a.marks.length;){let d=a.marks[c++],u=this.serializeMark(d,a.isInline,n);u&&(i.push([d,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(a,n))}),o}serializeNodeInner(e,n){let{dom:o,contentDOM:s}=oi(Ol(n),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,s)}return o}serializeNode(e,n={}){let o=this.serializeNodeInner(e,n);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(o),o=i.dom)}return o}serializeMark(e,n,o={}){let s=this.marks[e.type.name];return s&&oi(Ol(o),s(e,n),null,e.attrs)}static renderSpec(e,n,o=null,s){return oi(e,n,o,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new uo(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Df(e.nodes);return n.text||(n.text=o=>o.text),n}static marksFromSchema(e){return Df(e.marks)}}function Df(t){let e={};for(let n in t){let o=t[n].spec.toDOM;o&&(e[n]=o)}return e}function Ol(t){return t.document||window.document}const Rf=new WeakMap;function oi(t,e,n,o){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s,i=e[0];if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(o&&(s=function(p){let h=Rf.get(p);return h===void 0&&Rf.set(p,h=function(f){let m=null;return function g(v){if(v&&typeof v=="object")if(Array.isArray(v))if(typeof v[0]=="string")m||(m=[]),m.push(v);else for(let k=0;k<v.length;k++)g(v[k]);else for(let k in v)g(v[k])}(f),m}(p)),h}(o))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a,l=i.indexOf(" ");l>0&&(n=i.slice(0,l),i=i.slice(l+1));let c=n?t.createElementNS(n,i):t.createElement(i),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let p in d)if(d[p]!=null){let h=p.indexOf(" ");h>0?c.setAttributeNS(p.slice(0,h),p.slice(h+1),d[p]):p=="style"&&c.style?c.style.cssText=d[p]:c.setAttribute(p,d[p])}}for(let p=u;p<e.length;p++){let h=e[p];if(h===0){if(p<e.length-1||p>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}{let{dom:f,contentDOM:m}=oi(t,h,n,o);if(c.appendChild(f),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:c,contentDOM:a}}const Lf=Math.pow(2,16);function zw(t,e){return t+e*Lf}function zf(t){return 65535&t}class _l{constructor(e,n,o){this.pos=e,this.delInfo=n,this.recover=o}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Mt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Mt.empty)return Mt.empty}recover(e){let n=0,o=zf(e);if(!this.inverted)for(let s=0;s<o;s++)n+=this.ranges[3*s+2]-this.ranges[3*s+1];return this.ranges[3*o]+n+function(s){return(s-(65535&s))/Lf}(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,o){let s=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?s:0);if(c>e)break;let d=this.ranges[l+i],u=this.ranges[l+a],p=c+d;if(e<=p){let h=c+s+((d?e==c?-1:e==p?1:n:n)<0?0:u);if(o)return h;let f=e==(n<0?c:p)?null:zw(l/3,e-c),m=e==c?2:e==p?1:4;return(n<0?e!=c:e!=p)&&(m|=8),new _l(h,m,f)}s+=u-d}return o?e+s:new _l(e+s,0,null)}touches(e,n){let o=0,s=zf(n),i=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?o:0);if(c>e)break;let d=this.ranges[l+i];if(e<=c+d&&l==3*s)return!0;o+=this.ranges[l+a]-d}return!1}forEach(e){let n=this.inverted?2:1,o=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let a=this.ranges[s],l=a-(this.inverted?i:0),c=a+(this.inverted?0:i),d=this.ranges[s+n],u=this.ranges[s+o];e(l,l+d,c,c+u),i+=u-d}}invert(){return new Mt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Mt.empty:new Mt(e<0?[0,-e,0]:[0,0,e])}}Mt.empty=new Mt([]);class Rr{constructor(e,n,o=0,s=e?e.length:0){this.mirror=n,this.from=o,this.to=s,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Rr(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,o=this._maps.length;n<e._maps.length;n++){let s=e.getMirror(n);this.appendMap(e._maps[n],s!=null&&s<n?o+s:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,o=this._maps.length+e._maps.length;n>=0;n--){let s=e.getMirror(n);this.appendMap(e._maps[n].invert(),s!=null&&s>n?o-s-1:void 0)}}invert(){let e=new Rr;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let o=this.from;o<this.to;o++)e=this._maps[o].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,o){let s=0;for(let i=this.from;i<this.to;i++){let a=this._maps[i].mapResult(e,n);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this._maps[l].recover(a.recover);continue}}s|=a.delInfo,e=a.pos}return o?e:new _l(e,s,null)}}const Al=Object.create(null);class rt{getMap(){return Mt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let o=Al[n.stepType];if(!o)throw new RangeError(`No step type ${n.stepType} defined`);return o.fromJSON(e,n)}static jsonID(e,n){if(e in Al)throw new RangeError("Duplicate use of step JSON ID "+e);return Al[e]=n,n.prototype.jsonID=e,n}}class We{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new We(e,null)}static fail(e){return new We(null,e)}static fromReplace(e,n,o,s){try{return We.ok(e.replace(n,o,s))}catch(i){if(i instanceof Zs)return We.fail(i.message);throw i}}}function Vl(t,e,n){let o=[];for(let s=0;s<t.childCount;s++){let i=t.child(s);i.content.size&&(i=i.copy(Vl(i.content,e,i))),i.isInline&&(i=e(i,n,s)),o.push(i)}return $.fromArray(o)}class On extends rt{constructor(e,n,o){super(),this.from=e,this.to=n,this.mark=o}apply(e){let n=e.slice(this.from,this.to),o=e.resolve(this.from),s=o.node(o.sharedDepth(this.to)),i=new G(Vl(n.content,(a,l)=>a.isAtom&&l.type.allowsMarkType(this.mark.type)?a.mark(this.mark.addToSet(a.marks)):a,s),n.openStart,n.openEnd);return We.fromReplace(e,this.from,this.to,i)}invert(){return new Ft(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),o=e.mapResult(this.to,-1);return n.deleted&&o.deleted||n.pos>=o.pos?null:new On(n.pos,o.pos,this.mark)}merge(e){return e instanceof On&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new On(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new On(n.from,n.to,e.markFromJSON(n.mark))}}rt.jsonID("addMark",On);class Ft extends rt{constructor(e,n,o){super(),this.from=e,this.to=n,this.mark=o}apply(e){let n=e.slice(this.from,this.to),o=new G(Vl(n.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),n.openStart,n.openEnd);return We.fromReplace(e,this.from,this.to,o)}invert(){return new On(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),o=e.mapResult(this.to,-1);return n.deleted&&o.deleted||n.pos>=o.pos?null:new Ft(n.pos,o.pos,this.mark)}merge(e){return e instanceof Ft&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ft(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ft(n.from,n.to,e.markFromJSON(n.mark))}}rt.jsonID("removeMark",Ft);class _n extends rt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return We.fail("No node at mark step's position");let o=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return We.fromReplace(e,this.pos,this.pos+1,new G($.from(o),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let o=this.mark.addToSet(n.marks);if(o.length==n.marks.length){for(let s=0;s<n.marks.length;s++)if(!n.marks[s].isInSet(o))return new _n(this.pos,n.marks[s]);return new _n(this.pos,this.mark)}}return new po(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new _n(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new _n(n.pos,e.markFromJSON(n.mark))}}rt.jsonID("addNodeMark",_n);class po extends rt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return We.fail("No node at mark step's position");let o=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return We.fromReplace(e,this.pos,this.pos+1,new G($.from(o),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return n&&this.mark.isInSet(n.marks)?new _n(this.pos,this.mark):this}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new po(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new po(n.pos,e.markFromJSON(n.mark))}}rt.jsonID("removeNodeMark",po);class Ge extends rt{constructor(e,n,o,s=!1){super(),this.from=e,this.to=n,this.slice=o,this.structure=s}apply(e){return this.structure&&Il(e,this.from,this.to)?We.fail("Structure replace would overwrite content"):We.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Mt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ge(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),o=e.mapResult(this.to,-1);return n.deletedAcross&&o.deletedAcross?null:new Ge(n.pos,Math.max(n.pos,o.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Ge)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let n=this.slice.size+e.slice.size==0?G.empty:new G(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ge(e.from,this.to,n,this.structure)}}{let n=this.slice.size+e.slice.size==0?G.empty:new G(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ge(this.from,this.to+(e.to-e.from),n,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ge(n.from,n.to,G.fromJSON(e,n.slice),!!n.structure)}}rt.jsonID("replace",Ge);class Je extends rt{constructor(e,n,o,s,i,a,l=!1){super(),this.from=e,this.to=n,this.gapFrom=o,this.gapTo=s,this.slice=i,this.insert=a,this.structure=l}apply(e){if(this.structure&&(Il(e,this.from,this.gapFrom)||Il(e,this.gapTo,this.to)))return We.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return We.fail("Gap is not a flat range");let o=this.slice.insertAt(this.insert,n.content);return o?We.fromReplace(e,this.from,this.to,o):We.fail("Content does not fit in gap")}getMap(){return new Mt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Je(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),o=e.mapResult(this.to,-1),s=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?o.pos:e.map(this.gapTo,1);return n.deletedAcross&&o.deletedAcross||s<n.pos||i>o.pos?null:new Je(n.pos,o.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Je(n.from,n.to,n.gapFrom,n.gapTo,G.fromJSON(e,n.slice),n.insert,!!n.structure)}}function Il(t,e,n){let o=t.resolve(e),s=n-e,i=o.depth;for(;s>0&&i>0&&o.indexAfter(i)==o.node(i).childCount;)i--,s--;if(s>0){let a=o.node(i).maybeChild(o.indexAfter(i));for(;s>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,s--}}return!1}function Dl(t,e,n,o=n.contentMatch,s=!0){let i=t.doc.nodeAt(e),a=[],l=e+1;for(let c=0;c<i.childCount;c++){let d=i.child(c),u=l+d.nodeSize,p=o.matchType(d.type);if(p){o=p;for(let h=0;h<d.marks.length;h++)n.allowsMarkType(d.marks[h].type)||t.step(new Ft(l,u,d.marks[h]));if(s&&d.isText&&n.whitespace!="pre"){let h,f,m=/\r?\n|\r/g;for(;h=m.exec(d.text);)f||(f=new G($.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),a.push(new Ge(l+h.index,l+h.index+h[0].length,f))}}else a.push(new Ge(l,u,G.empty));l=u}if(!o.validEnd){let c=o.fillBefore($.empty,!0);t.replace(l,l,new G(c,0,0))}for(let c=a.length-1;c>=0;c--)t.step(a[c])}function $w(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Jo(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let o=t.$from.node(n),s=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&o.canReplace(s,i,e))return n;if(n==0||o.type.spec.isolating||!$w(o,s,i))break}return null}function Rl(t,e,n=null,o=t){let s=function(a,l){let{parent:c,startIndex:d,endIndex:u}=a,p=c.contentMatchAt(d).findWrapping(l);if(!p)return null;let h=p.length?p[0]:l;return c.canReplaceWith(d,u,h)?p:null}(t,e),i=s&&function(a,l){let{parent:c,startIndex:d,endIndex:u}=a,p=c.child(d),h=l.contentMatch.findWrapping(p.type);if(!h)return null;let f=(h.length?h[h.length-1]:l).contentMatch;for(let m=d;f&&m<u;m++)f=f.matchType(c.child(m).type);return f&&f.validEnd?h:null}(o,e);return i?s.map($f).concat({type:e,attrs:n}).concat(i.map($f)):null}function $f(t){return{type:t,attrs:null}}function Pf(t,e,n,o){e.forEach((s,i)=>{if(s.isText){let a,l=/\r?\n|\r/g;for(;a=l.exec(s.text);){let c=t.mapping.slice(o).map(n+1+i+a.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function jf(t,e,n,o){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let a=t.mapping.slice(o).map(n+1+i);t.replaceWith(a,a+1,e.type.schema.text(`
|
|
40
|
-
`))}})}function un(t,e,n=1,o){let s=t.resolve(e),i=s.depth-n,a=o&&o[o.length-1]||s.parent;if(i<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!a.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let d=s.depth-1,u=n-2;d>i;d--,u--){let p=s.node(d),h=s.index(d);if(p.type.spec.isolating)return!1;let f=p.content.cutByIndex(h,p.childCount),m=o&&o[u+1];m&&(f=f.replaceChild(0,m.type.create(m.attrs)));let g=o&&o[u]||p;if(!p.canReplace(h+1,p.childCount)||!g.type.validContent(f))return!1}let l=s.indexAfter(i),c=o&&o[0];return s.node(i).canReplaceWith(l,l,c?c.type:s.node(i+1).type)}function An(t,e){let n=t.resolve(e),o=n.index();return Ff(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(o,o+1)}function Ff(t,e){return!(!t||!e||t.isLeaf||!function(n,o){o.content.size||n.type.compatibleContent(o.type);let s=n.contentMatchAt(n.childCount),{linebreakReplacement:i}=n.type.schema;for(let a=0;a<o.childCount;a++){let l=o.child(a),c=l.type==i?n.type.schema.nodes.text:l.type;if(s=s.matchType(c),!s||!n.type.allowsMarks(l.marks))return!1}return s.validEnd}(t,e))}function ri(t,e,n=-1){let o=t.resolve(e);for(let s=o.depth;;s--){let i,a,l=o.index(s);if(s==o.depth?(i=o.nodeBefore,a=o.nodeAfter):n>0?(i=o.node(s+1),l++,a=o.node(s).maybeChild(l)):(i=o.node(s).maybeChild(l-1),a=o.node(s+1)),i&&!i.isTextblock&&Ff(i,a)&&o.node(s).canReplace(l,l+1))return e;if(s==0)break;e=n<0?o.before(s):o.after(s)}}function Hf(t,e,n){let o=t.resolve(e);if(!n.content.size)return e;let s=n.content;for(let i=0;i<n.openStart;i++)s=s.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let a=o.depth;a>=0;a--){let l=a==o.depth?0:o.pos<=(o.start(a+1)+o.end(a+1))/2?-1:1,c=o.index(a)+(l>0?1:0),d=o.node(a),u=!1;if(i==1)u=d.canReplace(c,c,s);else{let p=d.contentMatchAt(c).findWrapping(s.firstChild.type);u=p&&d.canReplaceWith(c,c,p[0])}if(u)return l==0?o.pos:l<0?o.before(a+1):o.after(a+1)}return null}function si(t,e,n=e,o=G.empty){if(e==n&&!o.size)return null;let s=t.resolve(e),i=t.resolve(n);return Wf(s,i,o)?new Ge(e,n,o):new Pw(s,i,o).fit()}function Wf(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}rt.jsonID("replaceAround",Je);class Pw{constructor(e,n,o){this.$from=e,this.$to=n,this.unplaced=o,this.frontier=[],this.placed=$.empty;for(let s=0;s<=e.depth;s++){let i=e.node(s);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(s))})}for(let s=e.depth;s>0;s--)this.placed=$.from(e.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,o=this.$from,s=this.close(e<0?this.$to:o.doc.resolve(e));if(!s)return null;let i=this.placed,a=o.depth,l=s.depth;for(;a&&l&&i.childCount==1;)i=i.firstChild.content,a--,l--;let c=new G(i,a,l);return e>-1?new Je(o.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||o.pos!=this.$to.pos?new Ge(o.pos,s.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,o=0,s=this.unplaced.openEnd;o<e;o++){let i=n.firstChild;if(n.childCount>1&&(s=0),i.type.spec.isolating&&s<=o){e=o;break}n=i.content}for(let n=1;n<=2;n++)for(let o=n==1?e:this.unplaced.openStart;o>=0;o--){let s,i=null;o?(i=Ll(this.unplaced.content,o-1).firstChild,s=i.content):s=this.unplaced.content;let a=s.firstChild;for(let l=this.depth;l>=0;l--){let c,{type:d,match:u}=this.frontier[l],p=null;if(n==1&&(a?u.matchType(a.type)||(p=u.fillBefore($.from(a),!1)):i&&d.compatibleContent(i.type)))return{sliceDepth:o,frontierDepth:l,parent:i,inject:p};if(n==2&&a&&(c=u.findWrapping(a.type)))return{sliceDepth:o,frontierDepth:l,parent:i,wrap:c};if(i&&u.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:o}=this.unplaced,s=Ll(e,n);return!(!s.childCount||s.firstChild.isLeaf||(this.unplaced=new G(e,n+1,Math.max(o,s.size+n>=e.size-o?n+1:0)),0))}dropNode(){let{content:e,openStart:n,openEnd:o}=this.unplaced,s=Ll(e,n);if(s.childCount<=1&&n>0){let i=e.size-n<=n+s.size;this.unplaced=new G(Lr(e,n-1,1),n-1,i?n-1:o)}else this.unplaced=new G(Lr(e,n,1),n,o)}placeNodes({sliceDepth:e,frontierDepth:n,parent:o,inject:s,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let a=this.unplaced,l=o?o.content:a.content,c=a.openStart-e,d=0,u=[],{match:p,type:h}=this.frontier[n];if(s){for(let g=0;g<s.childCount;g++)u.push(s.child(g));p=p.matchFragment(s)}let f=l.size+e-(a.content.size-a.openEnd);for(;d<l.childCount;){let g=l.child(d),v=p.matchType(g.type);if(!v)break;d++,(d>1||c==0||g.content.size)&&(p=v,u.push(Kf(g.mark(h.allowedMarks(g.marks)),d==1?c:0,d==l.childCount?f:-1)))}let m=d==l.childCount;m||(f=-1),this.placed=zr(this.placed,n,$.from(u)),this.frontier[n].match=p,m&&f<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,v=l;g<f;g++){let k=v.lastChild;this.frontier.push({type:k.type,match:k.contentMatchAt(k.childCount)}),v=k.content}this.unplaced=m?e==0?G.empty:new G(Lr(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new G(Lr(a.content,e,d),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,n=this.frontier[this.depth];if(!n.type.isTextblock||!zl(this.$to,this.$to.depth,n.type,n.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:o}=this.$to,s=this.$to.after(o);for(;o>1&&s==this.$to.end(--o);)++s;return s}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:o,type:s}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),a=zl(e,n,s,o,i);if(a){for(let l=n-1;l>=0;l--){let{match:c,type:d}=this.frontier[l],u=zl(e,l,d,c,!0);if(!u||u.childCount)continue e}return{depth:n,fit:a,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=zr(this.placed,n.depth,n.fit)),e=n.move;for(let o=n.depth+1;o<=e.depth;o++){let s=e.node(o),i=s.type.contentMatch.fillBefore(s.content,!0,e.index(o));this.openFrontierNode(s.type,s.attrs,i)}return e}openFrontierNode(e,n=null,o){let s=this.frontier[this.depth];s.match=s.match.matchType(e),this.placed=zr(this.placed,this.depth,$.from(e.create(n,o))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore($.empty,!0);e.childCount&&(this.placed=zr(this.placed,this.frontier.length,e))}}function Lr(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Lr(t.firstChild.content,e-1,n)))}function zr(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(zr(t.lastChild.content,e-1,n)))}function Ll(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Kf(t,e,n){if(e<=0)return t;let o=t.content;return e>1&&(o=o.replaceChild(0,Kf(o.firstChild,e-1,o.childCount==1?n-1:0))),e>0&&(o=t.type.contentMatch.fillBefore(o).append(o),n<=0&&(o=o.append(t.type.contentMatch.matchFragment(o).fillBefore($.empty,!0)))),t.copy(o)}function zl(t,e,n,o,s){let i=t.node(e),a=s?t.indexAfter(e):t.index(e);if(a==i.childCount&&!n.compatibleContent(i.type))return null;let l=o.fillBefore(i.content,!0,a);return l&&!function(c,d,u){for(let p=u;p<d.childCount;p++)if(!c.allowsMarks(d.child(p).marks))return!0;return!1}(n,i.content,a)?l:null}function jw(t){return t.spec.defining||t.spec.definingForContent}function qf(t,e,n,o,s){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(qf(i.content,e+1,n,o,i)))}if(e>o){let i=s.contentMatchAt(0),a=i.fillBefore(t).append(t);t=a.append(i.matchFragment(a).fillBefore($.empty,!0))}return t}function Uf(t,e){let n=[];for(let o=Math.min(t.depth,e.depth);o>=0;o--){let s=t.start(o);if(s<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(s==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==s-1)&&n.push(o)}return n}class Yo extends rt{constructor(e,n,o){super(),this.pos=e,this.attr=n,this.value=o}apply(e){let n=e.nodeAt(this.pos);if(!n)return We.fail("No node at attribute step's position");let o=Object.create(null);for(let i in n.attrs)o[i]=n.attrs[i];o[this.attr]=this.value;let s=n.type.create(o,null,n.marks);return We.fromReplace(e,this.pos,this.pos+1,new G($.from(s),0,n.isLeaf?0:1))}getMap(){return Mt.empty}invert(e){return new Yo(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Yo(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Yo(n.pos,n.attr,n.value)}}rt.jsonID("attr",Yo);class $r extends rt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let s in e.attrs)n[s]=e.attrs[s];n[this.attr]=this.value;let o=e.type.create(n,e.content,e.marks);return We.ok(o)}getMap(){return Mt.empty}invert(e){return new $r(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new $r(n.attr,n.value)}}rt.jsonID("docAttr",$r);let Pr=class extends Error{};Pr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(Pr.prototype=Object.create(Error.prototype)).constructor=Pr,Pr.prototype.name="TransformError";class Gf{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Rr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Pr(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,o=G.empty){let s=si(this.doc,e,n,o);return s&&this.step(s),this}replaceWith(e,n,o){return this.replace(e,n,new G($.from(o),0,0))}delete(e,n){return this.replace(e,n,G.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,o){return function(s,i,a,l){if(!l.size)return s.deleteRange(i,a);let c=s.doc.resolve(i),d=s.doc.resolve(a);if(Wf(c,d,l))return s.step(new Ge(i,a,l));let u=Uf(c,s.doc.resolve(a));u[u.length-1]==0&&u.pop();let p=-(c.depth+1);u.unshift(p);for(let v=c.depth,k=c.pos-1;v>0;v--,k--){let y=c.node(v).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;u.indexOf(v)>-1?p=v:c.before(v)==k&&u.splice(1,0,-v)}let h=u.indexOf(p),f=[],m=l.openStart;for(let v=l.content,k=0;;k++){let y=v.firstChild;if(f.push(y),k==l.openStart)break;v=y.content}for(let v=m-1;v>=0;v--){let k=f[v],y=jw(k.type);if(y&&!k.sameMarkup(c.node(Math.abs(p)-1)))m=v;else if(y||!k.type.isTextblock)break}for(let v=l.openStart;v>=0;v--){let k=(v+m+1)%(l.openStart+1),y=f[k];if(y)for(let b=0;b<u.length;b++){let x=u[(b+h)%u.length],w=!0;x<0&&(w=!1,x=-x);let C=c.node(x-1),S=c.index(x-1);if(C.canReplaceWith(S,S,y.type,y.marks))return s.replace(c.before(x),w?d.after(x):a,new G(qf(l.content,0,l.openStart,k),k,l.openEnd))}}let g=s.steps.length;for(let v=u.length-1;v>=0&&(s.replace(i,a,l),!(s.steps.length>g));v--){let k=u[v];k<0||(i=c.before(k),a=d.after(k))}}(this,e,n,o),this}replaceRangeWith(e,n,o){return function(s,i,a,l){if(!l.isInline&&i==a&&s.doc.resolve(i).parent.content.size){let c=function(d,u,p){let h=d.resolve(u);if(h.parent.canReplaceWith(h.index(),h.index(),p))return u;if(h.parentOffset==0)for(let f=h.depth-1;f>=0;f--){let m=h.index(f);if(h.node(f).canReplaceWith(m,m,p))return h.before(f+1);if(m>0)return null}if(h.parentOffset==h.parent.content.size)for(let f=h.depth-1;f>=0;f--){let m=h.indexAfter(f);if(h.node(f).canReplaceWith(m,m,p))return h.after(f+1);if(m<h.node(f).childCount)return null}return null}(s.doc,i,l.type);c!=null&&(i=a=c)}s.replaceRange(i,a,new G($.from(l),0,0))}(this,e,n,o),this}deleteRange(e,n){return function(o,s,i){let a=o.doc.resolve(s),l=o.doc.resolve(i),c=Uf(a,l);for(let d=0;d<c.length;d++){let u=c[d],p=d==c.length-1;if(p&&u==0||a.node(u).type.contentMatch.validEnd)return o.delete(a.start(u),l.end(u));if(u>0&&(p||a.node(u-1).canReplace(a.index(u-1),l.indexAfter(u-1))))return o.delete(a.before(u),l.after(u))}for(let d=1;d<=a.depth&&d<=l.depth;d++)if(s-a.start(d)==a.depth-d&&i>a.end(d)&&l.end(d)-i!=l.depth-d&&a.start(d-1)==l.start(d-1)&&a.node(d-1).canReplace(a.index(d-1),l.index(d-1)))return o.delete(a.before(d),i);o.delete(s,i)}(this,e,n),this}lift(e,n){return function(o,s,i){let{$from:a,$to:l,depth:c}=s,d=a.before(c+1),u=l.after(c+1),p=d,h=u,f=$.empty,m=0;for(let k=c,y=!1;k>i;k--)y||a.index(k)>0?(y=!0,f=$.from(a.node(k).copy(f)),m++):p--;let g=$.empty,v=0;for(let k=c,y=!1;k>i;k--)y||l.after(k+1)<l.end(k)?(y=!0,g=$.from(l.node(k).copy(g)),v++):h++;o.step(new Je(p,h,d,u,new G(f.append(g),m,v),f.size-m,!0))}(this,e,n),this}join(e,n=1){return function(o,s,i){let a=null,{linebreakReplacement:l}=o.doc.type.schema,c=o.doc.resolve(s-i),d=c.node().type;if(l&&d.inlineContent){let f=d.whitespace=="pre",m=!!d.contentMatch.matchType(l);f&&!m?a=!1:!f&&m&&(a=!0)}let u=o.steps.length;if(a===!1){let f=o.doc.resolve(s+i);jf(o,f.node(),f.before(),u)}d.inlineContent&&Dl(o,s+i-1,d,c.node().contentMatchAt(c.index()),a==null);let p=o.mapping.slice(u),h=p.map(s-i);if(o.step(new Ge(h,p.map(s+i,-1),G.empty,!0)),a===!0){let f=o.doc.resolve(h);Pf(o,f.node(),f.before(),o.steps.length)}}(this,e,n),this}wrap(e,n){return function(o,s,i){let a=$.empty;for(let d=i.length-1;d>=0;d--){if(a.size){let u=i[d].type.contentMatch.matchFragment(a);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}a=$.from(i[d].type.create(i[d].attrs,a))}let l=s.start,c=s.end;o.step(new Je(l,c,l,c,new G(a,0,0),i.length,!0))}(this,e,n),this}setBlockType(e,n=e,o,s=null){return function(i,a,l,c,d){if(!c.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let u=i.steps.length;i.doc.nodesBetween(a,l,(p,h)=>{let f=typeof d=="function"?d(p):d;if(p.isTextblock&&!p.hasMarkup(c,f)&&function(m,g,v){let k=m.resolve(g),y=k.index();return k.parent.canReplaceWith(y,y+1,v)}(i.doc,i.mapping.slice(u).map(h),c)){let m=null;if(c.schema.linebreakReplacement){let y=c.whitespace=="pre",b=!!c.contentMatch.matchType(c.schema.linebreakReplacement);y&&!b?m=!1:!y&&b&&(m=!0)}m===!1&&jf(i,p,h,u),Dl(i,i.mapping.slice(u).map(h,1),c,void 0,m===null);let g=i.mapping.slice(u),v=g.map(h,1),k=g.map(h+p.nodeSize,1);return i.step(new Je(v,k,v+1,k-1,new G($.from(c.create(f,null,p.marks)),0,0),1,!0)),m===!0&&Pf(i,p,h,u),!1}})}(this,e,n,o,s),this}setNodeMarkup(e,n,o=null,s){return function(i,a,l,c,d){let u=i.doc.nodeAt(a);if(!u)throw new RangeError("No node at given position");l||(l=u.type);let p=l.create(c,null,d||u.marks);if(u.isLeaf)return i.replaceWith(a,a+u.nodeSize,p);if(!l.validContent(u.content))throw new RangeError("Invalid content for node type "+l.name);i.step(new Je(a,a+u.nodeSize,a+1,a+u.nodeSize-1,new G($.from(p),0,0),1,!0))}(this,e,n,o,s),this}setNodeAttribute(e,n,o){return this.step(new Yo(e,n,o)),this}setDocAttribute(e,n){return this.step(new $r(e,n)),this}addNodeMark(e,n){return this.step(new _n(e,n)),this}removeNodeMark(e,n){let o=this.doc.nodeAt(e);if(!o)throw new RangeError("No node at position "+e);if(n instanceof Me)n.isInSet(o.marks)&&this.step(new po(e,n));else{let s,i=o.marks,a=[];for(;s=n.isInSet(i);)a.push(new po(e,s)),i=s.removeFromSet(i);for(let l=a.length-1;l>=0;l--)this.step(a[l])}return this}split(e,n=1,o){return function(s,i,a=1,l){let c=s.doc.resolve(i),d=$.empty,u=$.empty;for(let p=c.depth,h=c.depth-a,f=a-1;p>h;p--,f--){d=$.from(c.node(p).copy(d));let m=l&&l[f];u=$.from(m?m.type.create(m.attrs,u):c.node(p).copy(u))}s.step(new Ge(i,i,new G(d.append(u),a,a),!0))}(this,e,n,o),this}addMark(e,n,o){return function(s,i,a,l){let c,d,u=[],p=[];s.doc.nodesBetween(i,a,(h,f,m)=>{if(!h.isInline)return;let g=h.marks;if(!l.isInSet(g)&&m.type.allowsMarkType(l.type)){let v=Math.max(f,i),k=Math.min(f+h.nodeSize,a),y=l.addToSet(g);for(let b=0;b<g.length;b++)g[b].isInSet(y)||(c&&c.to==v&&c.mark.eq(g[b])?c.to=k:u.push(c=new Ft(v,k,g[b])));d&&d.to==v?d.to=k:p.push(d=new On(v,k,l))}}),u.forEach(h=>s.step(h)),p.forEach(h=>s.step(h))}(this,e,n,o),this}removeMark(e,n,o){return function(s,i,a,l){let c=[],d=0;s.doc.nodesBetween(i,a,(u,p)=>{if(!u.isInline)return;d++;let h=null;if(l instanceof ni){let f,m=u.marks;for(;f=l.isInSet(m);)(h||(h=[])).push(f),m=f.removeFromSet(m)}else l?l.isInSet(u.marks)&&(h=[l]):h=u.marks;if(h&&h.length){let f=Math.min(p+u.nodeSize,a);for(let m=0;m<h.length;m++){let g,v=h[m];for(let k=0;k<c.length;k++){let y=c[k];y.step==d-1&&v.eq(c[k].style)&&(g=y)}g?(g.to=f,g.step=d):c.push({style:v,from:Math.max(p,i),to:f,step:d})}}}),c.forEach(u=>s.step(new Ft(u.from,u.to,u.style)))}(this,e,n,o),this}clearIncompatible(e,n,o){return Dl(this,e,n,o),this}}const $l=Object.create(null);class pe{constructor(e,n,o){this.$anchor=e,this.$head=n,this.ranges=o||[new Fw(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=G.empty){let o=n.content.lastChild,s=null;for(let l=0;l<n.openEnd;l++)s=o,o=o.lastChild;let i=e.steps.length,a=this.ranges;for(let l=0;l<a.length;l++){let{$from:c,$to:d}=a[l],u=e.mapping.slice(i);e.replaceRange(u.map(c.pos),u.map(d.pos),l?G.empty:n),l==0&&Xf(e,i,(o?o.isInline:s&&s.isTextblock)?-1:1)}}replaceWith(e,n){let o=e.steps.length,s=this.ranges;for(let i=0;i<s.length;i++){let{$from:a,$to:l}=s[i],c=e.mapping.slice(o),d=c.map(a.pos),u=c.map(l.pos);i?e.deleteRange(d,u):(e.replaceRangeWith(d,u,n),Xf(e,o,n.isInline?-1:1))}}static findFrom(e,n,o=!1){let s=e.parent.inlineContent?new ie(e):Xo(e.node(0),e.parent,e.pos,e.index(),n,o);if(s)return s;for(let i=e.depth-1;i>=0;i--){let a=n<0?Xo(e.node(0),e.node(i),e.before(i+1),e.index(i),n,o):Xo(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,o);if(a)return a}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Nt(e.node(0))}static atStart(e){return Xo(e,e,0,0,1)||new Nt(e)}static atEnd(e){return Xo(e,e,e.content.size,e.childCount,-1)||new Nt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let o=$l[n.type];if(!o)throw new RangeError(`No selection type ${n.type} defined`);return o.fromJSON(e,n)}static jsonID(e,n){if(e in $l)throw new RangeError("Duplicate use of selection JSON ID "+e);return $l[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ie.between(this.$anchor,this.$head).getBookmark()}}pe.prototype.visible=!0;class Fw{constructor(e,n){this.$from=e,this.$to=n}}let Jf=!1;function Yf(t){Jf||t.parent.inlineContent||(Jf=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class ie extends pe{constructor(e,n=e){Yf(e),Yf(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let o=e.resolve(n.map(this.head));if(!o.parent.inlineContent)return pe.near(o);let s=e.resolve(n.map(this.anchor));return new ie(s.parent.inlineContent?s:o,o)}replace(e,n=G.empty){if(super.replace(e,n),n==G.empty){let o=this.$from.marksAcross(this.$to);o&&e.ensureMarks(o)}}eq(e){return e instanceof ie&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ii(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ie(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,o=n){let s=e.resolve(n);return new this(s,o==n?s:e.resolve(o))}static between(e,n,o){let s=e.pos-n.pos;if(o&&!s||(o=s>=0?1:-1),!n.parent.inlineContent){let i=pe.findFrom(n,o,!0)||pe.findFrom(n,-o,!0);if(!i)return pe.near(n,o);n=i.$head}return e.parent.inlineContent||(s==0||(e=(pe.findFrom(e,-o,!0)||pe.findFrom(e,o,!0)).$anchor).pos<n.pos!=s<0)&&(e=n),new ie(e,n)}}pe.jsonID("text",ie);class ii{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ii(e.map(this.anchor),e.map(this.head))}resolve(e){return ie.between(e.resolve(this.anchor),e.resolve(this.head))}}class ne extends pe{constructor(e){let n=e.nodeAfter,o=e.node(0).resolve(e.pos+n.nodeSize);super(e,o),this.node=n}map(e,n){let{deleted:o,pos:s}=n.mapResult(this.anchor),i=e.resolve(s);return o?pe.near(i):new ne(i)}content(){return new G($.from(this.node),0,0)}eq(e){return e instanceof ne&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Pl(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ne(e.resolve(n.anchor))}static create(e,n){return new ne(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ne.prototype.visible=!1,pe.jsonID("node",ne);class Pl{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:o}=e.mapResult(this.anchor);return n?new ii(o,o):new Pl(o)}resolve(e){let n=e.resolve(this.anchor),o=n.nodeAfter;return o&&ne.isSelectable(o)?new ne(n):pe.near(n)}}class Nt extends pe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=G.empty){if(n==G.empty){e.delete(0,e.doc.content.size);let o=pe.atStart(e.doc);o.eq(e.selection)||e.setSelection(o)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Nt(e)}map(e){return new Nt(e)}eq(e){return e instanceof Nt}getBookmark(){return Hw}}pe.jsonID("all",Nt);const Hw={map(){return this},resolve:t=>new Nt(t)};function Xo(t,e,n,o,s,i=!1){if(e.inlineContent)return ie.create(t,n);for(let a=o-(s>0?0:1);s>0?a<e.childCount:a>=0;a+=s){let l=e.child(a);if(l.isAtom){if(!i&&ne.isSelectable(l))return ne.create(t,n-(s<0?l.nodeSize:0))}else{let c=Xo(t,l,n+s,s<0?l.childCount:0,s,i);if(c)return c}n+=l.nodeSize*s}return null}function Xf(t,e,n){let o=t.steps.length-1;if(o<e)return;let s,i=t.steps[o];(i instanceof Ge||i instanceof Je)&&(t.mapping.maps[o].forEach((a,l,c,d)=>{s==null&&(s=d)}),t.setSelection(pe.near(t.doc.resolve(s),n)))}class Ww extends Gf{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return Me.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,n){super.addStep(e,n),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let o=this.selection;return n&&(e=e.mark(this.storedMarks||(o.empty?o.$from.marks():o.$from.marksAcross(o.$to)||Me.none))),o.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,o){let s=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(s.text(e),!0):this.deleteSelection();{if(o==null&&(o=n),o=o??n,!e)return this.deleteRange(n,o);let i=this.storedMarks;if(!i){let a=this.doc.resolve(n);i=o==n?a.marks():a.marksAcross(this.doc.resolve(o))}return this.replaceRangeWith(n,o,s.text(e,i)),this.selection.empty||this.setSelection(pe.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Zf(t,e){return e&&t?t.bind(e):t}class jr{constructor(e,n,o){this.name=e,this.init=Zf(n.init,o),this.apply=Zf(n.apply,o)}}const Kw=[new jr("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new jr("selection",{init:(t,e)=>t.selection||pe.atStart(e.doc),apply:t=>t.selection}),new jr("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,o)=>o.selection.$cursor?t.storedMarks:null}),new jr("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class jl{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Kw.slice(),n&&n.forEach(o=>{if(this.pluginsByKey[o.key])throw new RangeError("Adding different instances of a keyed plugin ("+o.key+")");this.plugins.push(o),this.pluginsByKey[o.key]=o,o.spec.state&&this.fields.push(new jr(o.key,o.spec.state,o))})}}class Zo{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let o=0;o<this.config.plugins.length;o++)if(o!=n){let s=this.config.plugins[o];if(s.spec.filterTransaction&&!s.spec.filterTransaction.call(s,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],o=this.applyInner(e),s=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let l=this.config.plugins[a];if(l.spec.appendTransaction){let c=s?s[a].n:0,d=s?s[a].state:this,u=c<n.length&&l.spec.appendTransaction.call(l,c?n.slice(c):n,d,o);if(u&&o.filterTransaction(u,a)){if(u.setMeta("appendedTransaction",e),!s){s=[];for(let p=0;p<this.config.plugins.length;p++)s.push(p<a?{state:o,n:n.length}:{state:this,n:0})}n.push(u),o=o.applyInner(u),i=!0}s&&(s[a]={state:o,n:n.length})}}if(!i)return{state:o,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Zo(this.config),o=this.config.fields;for(let s=0;s<o.length;s++){let i=o[s];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new Ww(this)}static create(e){let n=new jl(e.doc?e.doc.type.schema:e.schema,e.plugins),o=new Zo(n);for(let s=0;s<n.fields.length;s++)o[n.fields[s].name]=n.fields[s].init(e,o);return o}reconfigure(e){let n=new jl(this.schema,e.plugins),o=n.fields,s=new Zo(n);for(let i=0;i<o.length;i++){let a=o[i].name;s[a]=this.hasOwnProperty(a)?this[a]:o[i].init(e,s)}return s}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(o=>o.toJSON())),e&&typeof e=="object")for(let o in e){if(o=="doc"||o=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=e[o],i=s.spec.state;i&&i.toJSON&&(n[o]=i.toJSON.call(s,this[s.key]))}return n}static fromJSON(e,n,o){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let s=new jl(e.schema,e.plugins),i=new Zo(s);return s.fields.forEach(a=>{if(a.name=="doc")i.doc=jt.fromJSON(e.schema,n.doc);else if(a.name=="selection")i.selection=pe.fromJSON(i.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(o)for(let l in o){let c=o[l],d=c.spec.state;if(c.key==a.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l))return void(i[a.name]=d.fromJSON.call(c,e,n[l],i))}i[a.name]=a.init(e,i)}}),i}}function Qf(t,e,n){for(let o in t){let s=t[o];s instanceof Function?s=s.bind(e):o=="handleDOMEvents"&&(s=Qf(s,e,{})),n[o]=s}return n}class Le{constructor(e){this.spec=e,this.props={},e.props&&Qf(e.props,this,this.props),this.key=e.key?e.key.key:em("plugin")}getState(e){return e[this.key]}}const Fl=Object.create(null);function em(t){return t in Fl?t+"$"+ ++Fl[t]:(Fl[t]=0,t+"$")}class Ye{constructor(e="key"){this.key=em(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Hl=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function tm(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const nm=(t,e,n)=>{let o=tm(t,n);if(!o)return!1;let s=Wl(o);if(!s){let a=o.blockRange(),l=a&&Jo(a);return l!=null&&(e&&e(t.tr.lift(a,l).scrollIntoView()),!0)}let i=s.nodeBefore;if(um(t,s,e,-1))return!0;if(o.parent.content.size==0&&(Qo(i,"end")||ne.isSelectable(i)))for(let a=o.depth;;a--){let l=si(t.doc,o.before(a),o.after(a),G.empty);if(l&&l.slice.size<l.to-l.from){if(e){let c=t.tr.step(l);c.setSelection(Qo(i,"end")?pe.findFrom(c.doc.resolve(c.mapping.map(s.pos,-1)),-1):ne.create(c.doc,s.pos-i.nodeSize)),e(c.scrollIntoView())}return!0}if(a==1||o.node(a-1).childCount>1)break}return!(!i.isAtom||s.depth!=o.depth-1||(e&&e(t.tr.delete(s.pos-i.nodeSize,s.pos).scrollIntoView()),0))};function om(t,e,n){let o=e.nodeBefore,s=e.pos-1;for(;!o.isTextblock;s--){if(o.type.spec.isolating)return!1;let c=o.lastChild;if(!c)return!1;o=c}let i=e.nodeAfter,a=e.pos+1;for(;!i.isTextblock;a++){if(i.type.spec.isolating)return!1;let c=i.firstChild;if(!c)return!1;i=c}let l=si(t.doc,s,a,G.empty);if(!l||l.from!=s||l instanceof Ge&&l.slice.size>=a-s)return!1;if(n){let c=t.tr.step(l);c.setSelection(ie.create(c.doc,s)),n(c.scrollIntoView())}return!0}function Qo(t,e,n=!1){for(let o=t;o;o=e=="start"?o.firstChild:o.lastChild){if(o.isTextblock)return!0;if(n&&o.childCount!=1)return!1}return!1}const rm=(t,e,n)=>{let{$head:o,empty:s}=t.selection,i=o;if(!s)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):o.parentOffset>0)return!1;i=Wl(o)}let a=i&&i.nodeBefore;return!(!a||!ne.isSelectable(a)||(e&&e(t.tr.setSelection(ne.create(t.doc,i.pos-a.nodeSize)).scrollIntoView()),0))};function Wl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function sm(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const im=(t,e,n)=>{let o=sm(t,n);if(!o)return!1;let s=Kl(o);if(!s)return!1;let i=s.nodeAfter;if(um(t,s,e,1))return!0;if(o.parent.content.size==0&&(Qo(i,"start")||ne.isSelectable(i))){let a=si(t.doc,o.before(),o.after(),G.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Qo(i,"start")?pe.findFrom(l.doc.resolve(l.mapping.map(s.pos)),1):ne.create(l.doc,l.mapping.map(s.pos))),e(l.scrollIntoView())}return!0}}return!(!i.isAtom||s.depth!=o.depth-1||(e&&e(t.tr.delete(s.pos,s.pos+i.nodeSize).scrollIntoView()),0))},am=(t,e,n)=>{let{$head:o,empty:s}=t.selection,i=o;if(!s)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):o.parentOffset<o.parent.content.size)return!1;i=Kl(o)}let a=i&&i.nodeAfter;return!(!a||!ne.isSelectable(a)||(e&&e(t.tr.setSelection(ne.create(t.doc,i.pos)).scrollIntoView()),0))};function Kl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const lm=(t,e)=>{let{$head:n,$anchor:o}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(o)||(e&&e(t.tr.insertText(`
|
|
41
|
-
`).scrollIntoView()),0))};function ql(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const cm=(t,e)=>{let n=t.selection,{$from:o,$to:s}=n;if(n instanceof Nt||o.parent.inlineContent||s.parent.inlineContent)return!1;let i=ql(s.parent.contentMatchAt(s.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let a=(!o.parentOffset&&s.index()<s.parent.childCount?o:s).pos,l=t.tr.insert(a,i.createAndFill());l.setSelection(ie.create(l.doc,a+1)),e(l.scrollIntoView())}return!0},dm=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(un(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let o=n.blockRange(),s=o&&Jo(o);return s!=null&&(e&&e(t.tr.lift(o,s).scrollIntoView()),!0)};function um(t,e,n,o){let s,i,a=e.nodeBefore,l=e.nodeAfter,c=a.type.spec.isolating||l.type.spec.isolating;if(!c&&function(f,m,g){let v=m.nodeBefore,k=m.nodeAfter,y=m.index();return!(!(v&&k&&v.type.compatibleContent(k.type))||(!v.content.size&&m.parent.canReplace(y-1,y)?(g&&g(f.tr.delete(m.pos-v.nodeSize,m.pos).scrollIntoView()),0):!m.parent.canReplace(y,y+1)||!k.isTextblock&&!An(f.doc,m.pos)||(g&&g(f.tr.join(m.pos).scrollIntoView()),0)))}(t,e,n))return!0;let d=!c&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(s=(i=a.contentMatchAt(a.childCount)).findWrapping(l.type))&&i.matchType(s[0]||l.type).validEnd){if(n){let f=e.pos+l.nodeSize,m=$.empty;for(let k=s.length-1;k>=0;k--)m=$.from(s[k].create(null,m));m=$.from(a.copy(m));let g=t.tr.step(new Je(e.pos-1,f,e.pos,f,new G(m,1,0),s.length,!0)),v=g.doc.resolve(f+2*s.length);v.nodeAfter&&v.nodeAfter.type==a.type&&An(g.doc,v.pos)&&g.join(v.pos),n(g.scrollIntoView())}return!0}let u=l.type.spec.isolating||o>0&&c?null:pe.findFrom(e,1),p=u&&u.$from.blockRange(u.$to),h=p&&Jo(p);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(p,h).scrollIntoView()),!0;if(d&&Qo(l,"start",!0)&&Qo(a,"end")){let f=a,m=[];for(;m.push(f),!f.isTextblock;)f=f.lastChild;let g=l,v=1;for(;!g.isTextblock;g=g.firstChild)v++;if(f.canReplace(f.childCount,f.childCount,g.content)){if(n){let k=$.empty;for(let y=m.length-1;y>=0;y--)k=$.from(m[y].copy(k));n(t.tr.step(new Je(e.pos-m.length,e.pos+l.nodeSize,e.pos+v,e.pos+l.nodeSize-v,new G(k,m.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function pm(t){return function(e,n){let o=e.selection,s=t<0?o.$from:o.$to,i=s.depth;for(;s.node(i).isInline;){if(!i)return!1;i--}return!!s.node(i).isTextblock&&(n&&n(e.tr.setSelection(ie.create(e.doc,t<0?s.start(i):s.end(i)))),!0)}}const qw=pm(-1),Uw=pm(1);function hm(t,e=null){return function(n,o){let s=!1;for(let i=0;i<n.selection.ranges.length&&!s;i++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[i];n.doc.nodesBetween(a,l,(c,d)=>{if(s)return!1;if(c.isTextblock&&!c.hasMarkup(t,e))if(c.type==t)s=!0;else{let u=n.doc.resolve(d),p=u.index();s=u.parent.canReplaceWith(p,p+1,t)}})}if(!s)return!1;if(o){let i=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:l},$to:{pos:c}}=n.selection.ranges[a];i.setBlockType(l,c,t,e)}o(i.scrollIntoView())}return!0}}function Ul(...t){return function(e,n,o){for(let s=0;s<t.length;s++)if(t[s](e,n,o))return!0;return!1}}Ul(Hl,nm,rm),Ul(Hl,im,am),Ul(lm,cm,dm,(t,e)=>{let{$from:n,$to:o}=t.selection;if(t.selection instanceof ne&&t.selection.node.isBlock)return!(!n.parentOffset||!un(t.doc,n.pos)||(e&&e(t.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let s,i,a=[],l=!1,c=!1;for(let h=n.depth;;h--){if(n.node(h).isBlock){l=n.end(h)==n.pos+(n.depth-h),c=n.start(h)==n.pos-(n.depth-h),i=ql(n.node(h-1).contentMatchAt(n.indexAfter(h-1))),a.unshift(l&&i?{type:i}:null),s=h;break}if(h==1)return!1;a.unshift(null)}let d=t.tr;(t.selection instanceof ie||t.selection instanceof Nt)&&d.deleteSelection();let u=d.mapping.map(n.pos),p=un(d.doc,u,a.length,a);if(p||(a[0]=i?{type:i}:null,p=un(d.doc,u,a.length,a)),!p)return!1;if(d.split(u,a.length,a),!l&&c&&n.node(s).type!=i){let h=d.mapping.map(n.before(s)),f=d.doc.resolve(h);i&&n.node(s-1).canReplaceWith(f.index(),f.index()+1,i)&&d.setNodeMarkup(d.mapping.map(n.before(s)),i)}return e&&e(d.scrollIntoView()),!0}),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform();const et=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},er=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Gl=null;const pn=function(t,e,n){let o=Gl||(Gl=document.createRange());return o.setEnd(t,n??t.nodeValue.length),o.setStart(t,e||0),o},ho=function(t,e,n,o){return n&&(fm(t,e,n,o,-1)||fm(t,e,n,o,1))},Gw=/^(img|br|input|textarea|hr)$/i;function fm(t,e,n,o,s){for(var i;;){if(t==n&&e==o)return!0;if(e==(s<0?0:Vt(t))){let a=t.parentNode;if(!a||a.nodeType!=1||Fr(t)||Gw.test(t.nodeName)||t.contentEditable=="false")return!1;e=et(t)+(s<0?0:1),t=a}else{if(t.nodeType!=1)return!1;{let a=t.childNodes[e+(s<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false"){if(!(!((i=a.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection))return!1;e+=s}else t=a,e=s<0?Vt(t):0}}}}function Vt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Fr(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const ai=function(t){return t.focusNode&&ho(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function fo(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const Xt=typeof navigator<"u"?navigator:null,mm=typeof document<"u"?document:null,Vn=Xt&&Xt.userAgent||"",Jl=/Edge\/(\d+)/.exec(Vn),gm=/MSIE \d/.exec(Vn),Yl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Vn),yt=!!(gm||Yl||Jl),In=gm?document.documentMode:Yl?+Yl[1]:Jl?+Jl[1]:0,It=!yt&&/gecko\/(\d+)/i.test(Vn);It&&(/Firefox\/(\d+)/.exec(Vn)||[0,0])[1];const Xl=!yt&&/Chrome\/(\d+)/.exec(Vn),st=!!Xl,vm=Xl?+Xl[1]:0,dt=!yt&&!!Xt&&/Apple Computer/.test(Xt.vendor),tr=dt&&(/Mobile\/\w+/.test(Vn)||!!Xt&&Xt.maxTouchPoints>2),Dt=tr||!!Xt&&/Mac/.test(Xt.platform),Jw=!!Xt&&/Win/.test(Xt.platform),hn=/Android \d/.test(Vn),Hr=!!mm&&"webkitFontSmoothing"in mm.documentElement.style,Yw=Hr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Xw(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function fn(t,e){return typeof t=="number"?t:t[e]}function Zw(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,o=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*o}}function ym(t,e,n){let o=t.someProp("scrollThreshold")||0,s=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let a=n||t.dom;a;){if(a.nodeType!=1){a=er(a);continue}let l=a,c=l==i.body,d=c?Xw(i):Zw(l),u=0,p=0;if(e.top<d.top+fn(o,"top")?p=-(d.top-e.top+fn(s,"top")):e.bottom>d.bottom-fn(o,"bottom")&&(p=e.bottom-e.top>d.bottom-d.top?e.top+fn(s,"top")-d.top:e.bottom-d.bottom+fn(s,"bottom")),e.left<d.left+fn(o,"left")?u=-(d.left-e.left+fn(s,"left")):e.right>d.right-fn(o,"right")&&(u=e.right-d.right+fn(s,"right")),u||p)if(c)i.defaultView.scrollBy(u,p);else{let f=l.scrollLeft,m=l.scrollTop;p&&(l.scrollTop+=p),u&&(l.scrollLeft+=u);let g=l.scrollLeft-f,v=l.scrollTop-m;e={left:e.left-g,top:e.top-v,right:e.right-g,bottom:e.bottom-v}}let h=c?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(h))break;a=h=="absolute"?a.offsetParent:er(a)}}function km(t){let e=[],n=t.ownerDocument;for(let o=t;o&&(e.push({dom:o,top:o.scrollTop,left:o.scrollLeft}),t!=n);o=er(o));return e}function bm(t,e){for(let n=0;n<t.length;n++){let{dom:o,top:s,left:i}=t[n];o.scrollTop!=s+e&&(o.scrollTop=s+e),o.scrollLeft!=i&&(o.scrollLeft=i)}}let nr=null;function wm(t,e){let n,o,s,i,a=2e8,l=0,c=e.top,d=e.top;for(let u=t.firstChild,p=0;u;u=u.nextSibling,p++){let h;if(u.nodeType==1)h=u.getClientRects();else{if(u.nodeType!=3)continue;h=pn(u).getClientRects()}for(let f=0;f<h.length;f++){let m=h[f];if(m.top<=c&&m.bottom>=d){c=Math.max(m.bottom,c),d=Math.min(m.top,d);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<a){n=u,a=g,o=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(l=p+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!s&&m.left<=e.left&&m.right>=e.left&&(s=u,i={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(l=p+1)}}return!n&&s&&(n=s,o=i,a=0),n&&n.nodeType==3?function(u,p){let h=u.nodeValue.length,f=document.createRange();for(let m=0;m<h;m++){f.setEnd(u,m+1),f.setStart(u,m);let g=Dn(f,1);if(g.top!=g.bottom&&Zl(p,g))return{node:u,offset:m+(p.left>=(g.left+g.right)/2?1:0)}}return{node:u,offset:0}}(n,o):!n||a&&n.nodeType==1?{node:t,offset:l}:wm(n,o)}function Zl(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function xm(t,e,n){let o=t.childNodes.length;if(o&&n.top<n.bottom)for(let s=Math.max(0,Math.min(o-1,Math.floor(o*(e.top-n.top)/(n.bottom-n.top))-2)),i=s;;){let a=t.childNodes[i];if(a.nodeType==1){let l=a.getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(Zl(e,d))return xm(a,e,d)}}if((i=(i+1)%o)==s)break}return t}function Qw(t,e){let n,o=t.dom.ownerDocument,s=0,i=function(d,u,p){if(d.caretPositionFromPoint)try{let h=d.caretPositionFromPoint(u,p);if(h)return{node:h.offsetNode,offset:Math.min(Vt(h.offsetNode),h.offset)}}catch{}if(d.caretRangeFromPoint){let h=d.caretRangeFromPoint(u,p);if(h)return{node:h.startContainer,offset:Math.min(Vt(h.startContainer),h.startOffset)}}}(o,e.left,e.top);i&&({node:n,offset:s}=i);let a,l=(t.root.elementFromPoint?t.root:o).elementFromPoint(e.left,e.top);if(!l||!t.dom.contains(l.nodeType!=1?l.parentNode:l)){let d=t.dom.getBoundingClientRect();if(!Zl(e,d)||(l=xm(t.dom,e,d),!l))return null}if(dt)for(let d=l;n&&d;d=er(d))d.draggable&&(n=void 0);if(l=function(d,u){let p=d.parentNode;return p&&/^li$/i.test(p.nodeName)&&u.left<d.getBoundingClientRect().left?p:d}(l,e),n){if(It&&n.nodeType==1&&(s=Math.min(s,n.childNodes.length),s<n.childNodes.length)){let u,p=n.childNodes[s];p.nodeName=="IMG"&&(u=p.getBoundingClientRect()).right<=e.left&&u.bottom>e.top&&s++}let d;Hr&&s&&n.nodeType==1&&(d=n.childNodes[s-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&s--,n==t.dom&&s==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:s!=0&&n.nodeType==1&&n.childNodes[s-1].nodeName=="BR"||(a=function(u,p,h,f){let m=-1;for(let g=p,v=!1;g!=u.dom;){let k,y=u.docView.nearestDesc(g,!0);if(!y)return null;if(y.dom.nodeType==1&&(y.node.isBlock&&y.parent||!y.contentDOM)&&((k=y.dom.getBoundingClientRect()).width||k.height)&&(y.node.isBlock&&y.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(y.dom.nodeName)&&(!v&&k.left>f.left||k.top>f.top?m=y.posBefore:(!v&&k.right<f.left||k.bottom<f.top)&&(m=y.posAfter),v=!0),!y.contentDOM&&m<0&&!y.node.isText))return(y.node.isBlock?f.top<(k.top+k.bottom)/2:f.left<(k.left+k.right)/2)?y.posBefore:y.posAfter;g=y.dom.parentNode}return m>-1?m:u.docView.posFromDOM(p,h,-1)}(t,n,s,e))}a==null&&(a=function(d,u,p){let{node:h,offset:f}=wm(u,p),m=-1;if(h.nodeType==1&&!h.firstChild){let g=h.getBoundingClientRect();m=g.left!=g.right&&p.left>(g.left+g.right)/2?1:-1}return d.docView.posFromDOM(h,f,m)}(t,l,e));let c=t.docView.nearestDesc(l,!0);return{pos:a,inside:c?c.posAtStart-c.border:-1}}function Cm(t){return t.top<t.bottom||t.left<t.right}function Dn(t,e){let n=t.getClientRects();if(n.length){let o=n[e<0?0:n.length-1];if(Cm(o))return o}return Array.prototype.find.call(n,Cm)||t.getBoundingClientRect()}const ex=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Sm(t,e,n){let{node:o,offset:s,atom:i}=t.docView.domFromPos(e,n<0?-1:1),a=Hr||It;if(o.nodeType==3){if(!a||!ex.test(o.nodeValue)&&(n<0?s:s!=o.nodeValue.length)){let l=s,c=s,d=n<0?1:-1;return n<0&&!s?(c++,d=-1):n>=0&&s==o.nodeValue.length?(l--,d=1):n<0?l--:c++,Wr(Dn(pn(o,l,c),d),d<0)}{let l=Dn(pn(o,s,s),n);if(It&&s&&/\s/.test(o.nodeValue[s-1])&&s<o.nodeValue.length){let c=Dn(pn(o,s-1,s-1),-1);if(c.top==l.top){let d=Dn(pn(o,s,s+1),-1);if(d.top!=l.top)return Wr(d,d.left<c.left)}}return l}}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&s&&(n<0||s==Vt(o))){let l=o.childNodes[s-1];if(l.nodeType==1)return Ql(l.getBoundingClientRect(),!1)}if(i==null&&s<Vt(o)){let l=o.childNodes[s];if(l.nodeType==1)return Ql(l.getBoundingClientRect(),!0)}return Ql(o.getBoundingClientRect(),n>=0)}if(i==null&&s&&(n<0||s==Vt(o))){let l=o.childNodes[s-1],c=l.nodeType==3?pn(l,Vt(l)-(a?0:1)):l.nodeType!=1||l.nodeName=="BR"&&l.nextSibling?null:l;if(c)return Wr(Dn(c,1),!1)}if(i==null&&s<Vt(o)){let l=o.childNodes[s];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?pn(l,0,a?0:1):l.nodeType==1?l:null:null;if(c)return Wr(Dn(c,-1),!0)}return Wr(Dn(o.nodeType==3?pn(o):o,-n),n>=0)}function Wr(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Ql(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Em(t,e,n){let o=t.state,s=t.root.activeElement;o!=e&&t.updateState(e),s!=t.dom&&t.focus();try{return n()}finally{o!=e&&t.updateState(o),s!=t.dom&&s&&s.focus()}}const tx=/[\u0590-\u08ac]/;let Mm=null,Nm=null,Bm=!1;class Kr{constructor(e,n,o,s){this.parent=e,this.children=n,this.dom=o,this.contentDOM=s,this.dirty=0,o.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,o){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,o=this.posAtStart;;n++){let s=this.children[n];if(s==e)return o;o+=s.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,o){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode)){if(o<0){let i,a;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&(!(a=i.pmViewDesc)||a.parent!=this);)i=i.previousSibling;return i?this.posBeforeChild(a)+a.size:this.posAtStart}{let i,a;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&(!(a=i.pmViewDesc)||a.parent!=this);)i=i.nextSibling;return i?this.posBeforeChild(a):this.posAtEnd}}let s;if(e==this.dom&&this.contentDOM)s=n>et(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!1;break}if(i.previousSibling)break}if(s==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!0;break}if(i.nextSibling)break}}return s??o>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let o=!0,s=e;s;s=s.parentNode){let i,a=this.getDesc(s);if(a&&(!n||a.node)){if(!o||!(i=a.nodeDOM)||(i.nodeType==1?i.contains(e.nodeType==1?e:e.parentNode):i==e))return a;o=!1}}}getDesc(e){let n=e.pmViewDesc;for(let o=n;o;o=o.parent)if(o==this)return n}posFromDOM(e,n,o){for(let s=e;s;s=s.parentNode){let i=this.getDesc(s);if(i)return i.localPosFromDOM(e,n,o)}return-1}descAt(e){for(let n=0,o=0;n<this.children.length;n++){let s=this.children[n],i=o+s.size;if(o==e&&i!=o){for(;!s.border&&s.children.length;)for(let a=0;a<s.children.length;a++){let l=s.children[a];if(l.size){s=l;break}}return s}if(e<i)return s.descAt(e-o-s.border);o=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let o=0,s=0;for(let i=0;o<this.children.length;o++){let a=this.children[o],l=i+a.size;if(l>e||a instanceof _m){s=e-i;break}i=l}if(s)return this.children[o].domFromPos(s-this.children[o].border,n);for(let i;o&&!(i=this.children[o-1]).size&&i instanceof Tm&&i.side>=0;o--);if(n<=0){let i,a=!0;for(;i=o?this.children[o-1]:null,i&&i.dom.parentNode!=this.contentDOM;o--,a=!1);return i&&n&&a&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?et(i.dom)+1:0}}{let i,a=!0;for(;i=o<this.children.length?this.children[o]:null,i&&i.dom.parentNode!=this.contentDOM;o++,a=!1);return i&&a&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?et(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,o=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let s=-1,i=-1;for(let a=o,l=0;;l++){let c=this.children[l],d=a+c.size;if(s==-1&&e<=d){let u=a+c.border;if(e>=u&&n<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,n,u);e=a;for(let p=l;p>0;p--){let h=this.children[p-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){s=et(h.dom)+1;break}e-=h.size}s==-1&&(s=0)}if(s>-1&&(d>n||l==this.children.length-1)){n=d;for(let u=l+1;u<this.children.length;u++){let p=this.children[u];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){i=et(p.dom);break}n+=p.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=d}return{node:this.contentDOM,from:e,to:n,fromOffset:s,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:o}=this.domFromPos(e,0);if(n.nodeType!=1||o==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[o]}setSelection(e,n,o,s=!1){let i=Math.min(e,n),a=Math.max(e,n);for(let f=0,m=0;f<this.children.length;f++){let g=this.children[f],v=m+g.size;if(i>m&&a<v)return g.setSelection(e-m-g.border,n-m-g.border,o,s);m=v}let l=this.domFromPos(e,e?-1:1),c=n==e?l:this.domFromPos(n,n?-1:1),d=o.root.getSelection(),u=o.domSelectionRange(),p=!1;if((It||dt)&&e==n){let{node:f,offset:m}=l;if(f.nodeType==3){if(p=!(!m||f.nodeValue[m-1]!=`
|
|
42
|
-
`),p&&m==f.nodeValue.length)for(let g,v=f;v;v=v.parentNode){if(g=v.nextSibling){g.nodeName=="BR"&&(l=c={node:g.parentNode,offset:et(g)+1});break}let k=v.pmViewDesc;if(k&&k.node&&k.node.isBlock)break}}else{let g=f.childNodes[m-1];p=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(It&&u.focusNode&&u.focusNode!=c.node&&u.focusNode.nodeType==1){let f=u.focusNode.childNodes[u.focusOffset];f&&f.contentEditable=="false"&&(s=!0)}if(!(s||p&&dt)&&ho(l.node,l.offset,u.anchorNode,u.anchorOffset)&&ho(c.node,c.offset,u.focusNode,u.focusOffset))return;let h=!1;if((d.extend||e==n)&&(!p||!It)){d.collapse(l.node,l.offset);try{e!=n&&d.extend(c.node,c.offset),h=!0}catch{}}if(!h){if(e>n){let m=l;l=c,c=m}let f=document.createRange();f.setEnd(c.node,c.offset),f.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let o=0,s=0;s<this.children.length;s++){let i=this.children[s],a=o+i.size;if(o==a?e<=a&&n>=o:e<a&&n>o){let l=o+i.border,c=a-i.border;if(e>=l&&n<=c)return this.dirty=e==o||n==a?2:1,void(e!=l||n!=c||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-l,n-l):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}o=a}this.dirty=2}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let o=e==1?2:1;n.dirty<o&&(n.dirty=o)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Tm extends Kr{constructor(e,n,o,s){let i,a=n.type.toDOM;if(typeof a=="function"&&(a=a(o,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:s)),!n.type.spec.raw){if(a.nodeType!=1){let l=document.createElement("span");l.appendChild(a),a=l}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(e,[],a,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==0&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return!!n&&n(e)}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class nx extends Kr{constructor(e,n,o,s){super(e,[],n,null),this.textDOM=o,this.text=s}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class mo extends Kr{constructor(e,n,o,s,i){super(e,[],o,s),this.mark=n,this.spec=i}static create(e,n,o,s){let i=s.nodeViews[n.type.name],a=i&&i(n,s,o);return a&&a.dom||(a=uo.renderSpec(document,n.type.spec.toDOM(n,o),null,n.attrs)),new mo(e,n,a.dom,a.contentDOM||a.dom,a)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=3&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=0){let o=this.parent;for(;!o.node;)o=o.parent;o.dirty<this.dirty&&(o.dirty=this.dirty),this.dirty=0}}slice(e,n,o){let s=mo.create(this.parent,this.mark,!0,o),i=this.children,a=this.size;n<a&&(i=tc(i,n,a,o)),e>0&&(i=tc(i,0,e,o));for(let l=0;l<i.length;l++)i[l].parent=s;return s.children=i,s}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Rn extends Kr{constructor(e,n,o,s,i,a,l,c,d){super(e,[],i,a),this.node=n,this.outerDeco=o,this.innerDeco=s,this.nodeDOM=l}static create(e,n,o,s,i,a){let l,c=i.nodeViews[n.type.name],d=c&&c(n,i,()=>l?l.parent?l.parent.posBeforeChild(l):void 0:a,o,s),u=d&&d.dom,p=d&&d.contentDOM;if(n.isText)if(u){if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(n.text);else u||({dom:u,contentDOM:p}=uo.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));p||n.isText||u.nodeName=="BR"||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let h=u;return u=Im(u,o,n),d?l=new ox(e,n,o,s,u,p||null,h,d,i,a+1):n.isText?new li(e,n,o,s,u,h,i):new Rn(e,n,o,s,u,p||null,h,i,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let n=this.children.length-1;n>=0;n--){let o=this.children[n];if(this.dom.contains(o.dom.parentNode)){e.contentElement=o.dom.parentNode;break}}e.contentElement||(e.getContent=()=>$.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,n,o){return this.dirty==0&&e.eq(this.node)&&ci(n,this.outerDeco)&&o.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let o=this.node.inlineContent,s=n,i=e.composing?this.localCompositionInfo(e,n):null,a=i&&i.pos>-1?i:null,l=i&&i.pos<0,c=new sx(this,a&&a.node,e);(function(d,u,p,h){let f=u.locals(d),m=0;if(f.length==0){for(let y=0;y<d.childCount;y++){let b=d.child(y);h(b,f,u.forChild(m,b),y),m+=b.nodeSize}return}let g=0,v=[],k=null;for(let y=0;;){let b,x,w,C;for(;g<f.length&&f[g].to==m;){let E=f[g++];E.widget&&(b?(x||(x=[b])).push(E):b=E)}if(b)if(x){x.sort(ix);for(let E=0;E<x.length;E++)p(x[E],y,!!k)}else p(b,y,!!k);if(k)C=-1,w=k,k=null;else{if(!(y<d.childCount))break;C=y,w=d.child(y++)}for(let E=0;E<v.length;E++)v[E].to<=m&&v.splice(E--,1);for(;g<f.length&&f[g].from<=m&&f[g].to>m;)v.push(f[g++]);let S=m+w.nodeSize;if(w.isText){let E=S;g<f.length&&f[g].from<E&&(E=f[g].from);for(let M=0;M<v.length;M++)v[M].to<E&&(E=v[M].to);E<S&&(k=w.cut(E-m),w=w.cut(0,E-m),S=E,C=-1)}else for(;g<f.length&&f[g].to<S;)g++;h(w,w.isInline&&!w.isLeaf?v.filter(E=>!E.inline):v.slice(),u.forChild(m,w),C),m=S}})(this.node,this.innerDeco,(d,u,p)=>{d.spec.marks?c.syncToMarks(d.spec.marks,o,e):d.type.side>=0&&!p&&c.syncToMarks(u==this.node.childCount?Me.none:this.node.child(u).marks,o,e),c.placeWidget(d,e,s)},(d,u,p,h)=>{let f;c.syncToMarks(d.marks,o,e),c.findNodeMatch(d,u,p,h)||l&&e.state.selection.from>s&&e.state.selection.to<s+d.nodeSize&&(f=c.findIndexWithChild(i.node))>-1&&c.updateNodeAt(d,u,p,f,e)||c.updateNextNode(d,u,p,e,h,s)||c.addNode(d,u,p,e,s),s+=d.nodeSize}),c.syncToMarks([],o,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==2)&&(a&&this.protectLocalComposition(e,a),Am(this.contentDOM,this.children,e),tr&&function(d){if(d.nodeName=="UL"||d.nodeName=="OL"){let u=d.style.cssText;d.style.cssText=u+"; list-style: square !important",window.getComputedStyle(d).listStyle,d.style.cssText=u}}(this.dom))}localCompositionInfo(e,n){let{from:o,to:s}=e.state.selection;if(!(e.state.selection instanceof ie)||o<n||s>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let a=i.nodeValue,l=function(c,d,u,p){for(let h=0,f=0;h<c.childCount&&f<=p;){let m=c.child(h++),g=f;if(f+=m.nodeSize,!m.isText)continue;let v=m.text;for(;h<c.childCount;){let k=c.child(h++);if(f+=k.nodeSize,!k.isText)break;v+=k.text}if(f>=u){if(f>=p&&v.slice(p-d.length-g,p-g)==d)return p-d.length;let k=g<p?v.lastIndexOf(d,p-g-1):-1;if(k>=0&&k+d.length+g>=u)return g+k;if(u==p&&v.length>=p+d.length-g&&v.slice(p-g,p-g+d.length)==d)return p}}return-1}(this.node.content,a,o-n,s-n);return l<0?null:{node:i,pos:l,text:a}}return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:o,text:s}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let a=new nx(this,i,n,s);e.input.compositionNodes.push(a),this.children=tc(this.children,o,o+s.length,e,a)}update(e,n,o,s){return!(this.dirty==3||!e.sameMarkup(this.node)||(this.updateInner(e,n,o,s),0))}updateInner(e,n,o,s){this.updateOuterDeco(n),this.node=e,this.innerDeco=o,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(ci(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,o=this.dom;this.dom=Vm(this.dom,this.nodeDOM,ec(this.outerDeco,this.node,n),ec(e,this.node,n)),this.dom!=o&&(o.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Om(t,e,n,o,s){Im(o,e,t);let i=new Rn(void 0,t,e,n,o,o,o,s,0);return i.contentDOM&&i.updateChildren(s,0),i}class li extends Rn{constructor(e,n,o,s,i,a,l){super(e,n,o,s,i,null,a,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,o,s){return!(this.dirty==3||this.dirty!=0&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(n),this.dirty==0&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=e,this.dirty=0,0))}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,o){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,o)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,o){let s=this.node.cut(e,n),i=document.createTextNode(s.text);return new li(this.parent,s,this.outerDeco,this.innerDeco,i,i,o)}markDirty(e,n){super.markDirty(e,n),this.dom==this.nodeDOM||e!=0&&n!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class _m extends Kr{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==0&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class ox extends Rn{constructor(e,n,o,s,i,a,l,c,d,u){super(e,n,o,s,i,a,l,d,u),this.spec=c}update(e,n,o,s){if(this.dirty==3)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,o);return i&&this.updateInner(e,n,o,s),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,n,o,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,o,s){this.spec.setSelection?this.spec.setSelection(e,n,o.root):super.setSelection(e,n,o,s)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Am(t,e,n){let o=t.firstChild,s=!1;for(let i=0;i<e.length;i++){let a=e[i],l=a.dom;if(l.parentNode==t){for(;l!=o;)o=Dm(o),s=!0;o=o.nextSibling}else s=!0,t.insertBefore(l,o);if(a instanceof mo){let c=o?o.previousSibling:t.lastChild;Am(a.contentDOM,a.children,n),o=c?c.nextSibling:t.firstChild}}for(;o;)o=Dm(o),s=!0;s&&n.trackWrites==t&&(n.trackWrites=null)}const qr=function(t){t&&(this.nodeName=t)};qr.prototype=Object.create(null);const go=[new qr];function ec(t,e,n){if(t.length==0)return go;let o=n?go[0]:new qr,s=[o];for(let i=0;i<t.length;i++){let a=t[i].type.attrs;if(a){a.nodeName&&s.push(o=new qr(a.nodeName));for(let l in a){let c=a[l];c!=null&&(n&&s.length==1&&s.push(o=new qr(e.isInline?"span":"div")),l=="class"?o.class=(o.class?o.class+" ":"")+c:l=="style"?o.style=(o.style?o.style+";":"")+c:l!="nodeName"&&(o[l]=c))}}}return s}function Vm(t,e,n,o){if(n==go&&o==go)return e;let s=e;for(let i=0;i<o.length;i++){let a=o[i],l=n[i];if(i){let c;l&&l.nodeName==a.nodeName&&s!=t&&(c=s.parentNode)&&c.nodeName.toLowerCase()==a.nodeName||(c=document.createElement(a.nodeName),c.pmIsDeco=!0,c.appendChild(s),l=go[0]),s=c}rx(s,l||go[0],a)}return s}function rx(t,e,n){for(let o in e)o=="class"||o=="style"||o=="nodeName"||o in n||t.removeAttribute(o);for(let o in n)o!="class"&&o!="style"&&o!="nodeName"&&n[o]!=e[o]&&t.setAttribute(o,n[o]);if(e.class!=n.class){let o=e.class?e.class.split(" ").filter(Boolean):[],s=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<o.length;i++)s.indexOf(o[i])==-1&&t.classList.remove(o[i]);for(let i=0;i<s.length;i++)o.indexOf(s[i])==-1&&t.classList.add(s[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let o,s=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;o=s.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function Im(t,e,n){return Vm(t,t,go,ec(e,n,t.nodeType!=1))}function ci(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Dm(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class sx{constructor(e,n,o){this.lock=n,this.view=o,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(s,i){let a=i,l=a.children.length,c=s.childCount,d=new Map,u=[];e:for(;c>0;){let p;for(;;)if(l){let f=a.children[l-1];if(!(f instanceof mo)){p=f,l--;break}a=f,l=f.children.length}else{if(a==i)break e;l=a.parent.children.indexOf(a),a=a.parent}let h=p.node;if(h){if(h!=s.child(c-1))break;--c,d.set(p,c),u.push(p)}}return{index:c,matched:d,matches:u.reverse()}}(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let o=e;o<n;o++)this.top.children[o].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,o){let s=0,i=this.stack.length>>1,a=Math.min(i,e.length);for(;s<a&&(s==i-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let l=-1;for(let c=this.index;c<Math.min(this.index+3,this.top.children.length);c++){let d=this.top.children[c];if(d.matchesMark(e[i])&&!this.isLocked(d.dom)){l=c;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=mo.create(this.top,e[i],n,o);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,o,s){let i,a=-1;if(s>=this.preMatch.index&&(i=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&i.matchesNode(e,n,o))a=this.top.children.indexOf(i,this.index);else for(let l=this.index,c=Math.min(this.top.children.length,l+5);l<c;l++){let d=this.top.children[l];if(d.matchesNode(e,n,o)&&!this.preMatch.matched.has(d)){a=l;break}}return!(a<0||(this.destroyBetween(this.index,a),this.index++,0))}updateNodeAt(e,n,o,s,i){let a=this.top.children[s];return a.dirty==3&&a.dom==a.contentDOM&&(a.dirty=2),!!a.update(e,n,o,i)&&(this.destroyBetween(this.index,s),this.index++,!0)}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let o=e.pmViewDesc;if(o){for(let s=this.index;s<this.top.children.length;s++)if(this.top.children[s]==o)return s}return-1}e=n}}updateNextNode(e,n,o,s,i,a){for(let l=this.index;l<this.top.children.length;l++){let c=this.top.children[l];if(c instanceof Rn){let d=this.preMatch.matched.get(c);if(d!=null&&d!=i)return!1;let u,p=c.dom,h=this.isLocked(p)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=3&&ci(n,c.outerDeco));if(!h&&c.update(e,n,o,s))return this.destroyBetween(this.index,l),c.dom!=p&&(this.changed=!0),this.index++,!0;if(!h&&(u=this.recreateWrapper(c,e,n,o,s,a)))return this.destroyBetween(this.index,l),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=2,u.updateChildren(s,a+1),u.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,o,s,i,a){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!ci(o,e.outerDeco)||!s.eq(e.innerDeco))return null;let l=Rn.create(this.top,n,o,s,i,a);if(l.contentDOM){l.children=e.children,e.children=[];for(let c of l.children)c.parent=l}return e.destroy(),l}addNode(e,n,o,s,i){let a=Rn.create(this.top,e,n,o,s,i);a.contentDOM&&a.updateChildren(s,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,n,o){let s=this.index<this.top.children.length?this.top.children[this.index]:null;if(!s||!s.matchesWidget(e)||e!=s.widget&&s.widget.type.toDOM.parentNode){let i=new Tm(this.top,e,n,o);this.top.children.splice(this.index++,0,i),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof mo;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof li)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((dt||st)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let o=document.createElement(e);e=="IMG"&&(o.className="ProseMirror-separator",o.alt=""),e=="BR"&&(o.className="ProseMirror-trailingBreak");let s=new _m(this.top,[],o,null);n!=this.top?n.children.push(s):n.children.splice(this.index++,0,s),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function ix(t,e){return t.type.side-e.type.side}function tc(t,e,n,o,s){let i=[];for(let a=0,l=0;a<t.length;a++){let c=t[a],d=l,u=l+=c.size;d>=n||u<=e?i.push(c):(d<e&&i.push(c.slice(0,e-d,o)),s&&(i.push(s),s=void 0),u>n&&i.push(c.slice(n-d,c.size,o)))}return i}function nc(t,e=null){let n=t.domSelectionRange(),o=t.state.doc;if(!n.focusNode)return null;let s=t.docView.nearestDesc(n.focusNode),i=s&&s.size==0,a=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let l,c,d=o.resolve(a);if(ai(n)){for(l=a;s&&!s.node;)s=s.parent;let p=s.node;if(s&&p.isAtom&&ne.isSelectable(p)&&s.parent&&(!p.isInline||!function(h,f,m){for(let g=f==0,v=f==Vt(h);g||v;){if(h==m)return!0;let k=et(h);if(!(h=h.parentNode))return!1;g=g&&k==0,v=v&&k==Vt(h)}}(n.focusNode,n.focusOffset,s.dom))){let h=s.posBefore;c=new ne(a==h?d:o.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let p=a,h=a;for(let f=0;f<n.rangeCount;f++){let m=n.getRangeAt(f);p=Math.min(p,t.docView.posFromDOM(m.startContainer,m.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(p<0)return null;[l,a]=h==t.state.selection.anchor?[h,p]:[p,h],d=o.resolve(a)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=o.resolve(l);return c||(c=rc(t,u,d,e=="pointer"||t.state.selection.head<d.pos&&!i?1:-1)),c}function Rm(t){return t.editable?t.hasFocus():Hm(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function mn(t,e=!1){let n=t.state.selection;if(Pm(t,n),Rm(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&st){let o=t.domSelectionRange(),s=t.domObserver.currentSelection;if(o.anchorNode&&s.anchorNode&&ho(o.anchorNode,o.anchorOffset,s.anchorNode,s.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)(function(o){let s=o.domSelection();if(!s)return;let i=o.cursorWrapper.dom,a=i.nodeName=="IMG";a?s.collapse(i.parentNode,et(i)+1):s.collapse(i,0),!a&&!o.state.selection.visible&&yt&&In<=11&&(i.disabled=!0,i.disabled=!1)})(t);else{let o,s,{anchor:i,head:a}=n;!Lm||n instanceof ie||(n.$from.parent.inlineContent||(o=zm(t,n.from)),n.empty||n.$from.parent.inlineContent||(s=zm(t,n.to))),t.docView.setSelection(i,a,t,e),Lm&&(o&&$m(o),s&&$m(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(l){let c=l.dom.ownerDocument;c.removeEventListener("selectionchange",l.input.hideSelectionGuard);let d=l.domSelectionRange(),u=d.anchorNode,p=d.anchorOffset;c.addEventListener("selectionchange",l.input.hideSelectionGuard=()=>{d.anchorNode==u&&d.anchorOffset==p||(c.removeEventListener("selectionchange",l.input.hideSelectionGuard),setTimeout(()=>{Rm(l)&&!l.state.selection.visible||l.dom.classList.remove("ProseMirror-hideselection")},20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Lm=dt||st&&vm<63;function zm(t,e){let{node:n,offset:o}=t.docView.domFromPos(e,0),s=o<n.childNodes.length?n.childNodes[o]:null,i=o?n.childNodes[o-1]:null;if(dt&&s&&s.contentEditable=="false")return oc(s);if(!(s&&s.contentEditable!="false"||i&&i.contentEditable!="false")){if(s)return oc(s);if(i)return oc(i)}}function oc(t){return t.contentEditable="true",dt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function $m(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Pm(t,e){if(e instanceof ne){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(jm(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else jm(t)}function jm(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function rc(t,e,n,o){return t.someProp("createSelectionBetween",s=>s(t,e,n))||ie.between(e,n,o)}function Fm(t){return!(t.editable&&!t.hasFocus())&&Hm(t)}function Hm(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function sc(t,e){let{$anchor:n,$head:o}=t.selection,s=e>0?n.max(o):n.min(o),i=s.parent.inlineContent?s.depth?t.doc.resolve(e>0?s.after():s.before()):null:s;return i&&pe.findFrom(i,e)}function Ln(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Wm(t,e,n){let o=t.state.selection;if(!(o instanceof ie)){if(o instanceof ne&&o.node.isInline)return Ln(t,new ie(e>0?o.$to:o.$from));{let s=sc(t.state,e);return!!s&&Ln(t,s)}}if(n.indexOf("s")>-1){let{$head:s}=o,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=t.state.doc.resolve(s.pos+i.nodeSize*(e<0?-1:1));return Ln(t,new ie(o.$anchor,a))}if(!o.empty)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let s=sc(t.state,e);return!!(s&&s instanceof ne)&&Ln(t,s)}if(!(Dt&&n.indexOf("m")>-1)){let s,i=o.$head,a=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!a||a.isText)return!1;let l=e<0?i.pos-a.nodeSize:i.pos;return!!(a.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM)&&(ne.isSelectable(a)?Ln(t,new ne(e<0?t.state.doc.resolve(i.pos-a.nodeSize):i)):!!Hr&&Ln(t,new ie(t.state.doc.resolve(e<0?l:l+a.nodeSize))))}}function di(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Ur(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function or(t,e){return e<0?function(n){let o=n.domSelectionRange(),s=o.focusNode,i=o.focusOffset;if(!s)return;let a,l,c=!1;for(It&&s.nodeType==1&&i<di(s)&&Ur(s.childNodes[i],-1)&&(c=!0);;)if(i>0){if(s.nodeType!=1)break;{let d=s.childNodes[i-1];if(Ur(d,-1))a=s,l=--i;else{if(d.nodeType!=3)break;s=d,i=s.nodeValue.length}}}else{if(Km(s))break;{let d=s.previousSibling;for(;d&&Ur(d,-1);)a=s.parentNode,l=et(d),d=d.previousSibling;if(d)s=d,i=di(s);else{if(s=s.parentNode,s==n.dom)break;i=0}}}c?ic(n,s,i):a&&ic(n,a,l)}(t):function(n){let o=n.domSelectionRange(),s=o.focusNode,i=o.focusOffset;if(!s)return;let a,l,c=di(s);for(;;)if(i<c){if(s.nodeType!=1||!Ur(s.childNodes[i],1))break;a=s,l=++i}else{if(Km(s))break;{let d=s.nextSibling;for(;d&&Ur(d,1);)a=d.parentNode,l=et(d)+1,d=d.nextSibling;if(d)s=d,i=0,c=di(s);else{if(s=s.parentNode,s==n.dom)break;i=c=0}}}a&&ic(n,a,l)}(t)}function Km(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function ic(t,e,n){if(e.nodeType!=3){let i,a;(a=function(l,c){for(;l&&c==l.childNodes.length&&!Fr(l);)c=et(l)+1,l=l.parentNode;for(;l&&c<l.childNodes.length;){let d=l.childNodes[c];if(d.nodeType==3)return d;if(d.nodeType==1&&d.contentEditable=="false")break;l=d,c=0}}(e,n))?(e=a,n=0):(i=function(l,c){for(;l&&!c&&!Fr(l);)c=et(l),l=l.parentNode;for(;l&&c;){let d=l.childNodes[c-1];if(d.nodeType==3)return d;if(d.nodeType==1&&d.contentEditable=="false")break;c=(l=d).childNodes.length}}(e,n))&&(e=i,n=i.nodeValue.length)}let o=t.domSelection();if(!o)return;if(ai(o)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),o.removeAllRanges(),o.addRange(i)}else o.extend&&o.extend(e,n);t.domObserver.setCurSelection();let{state:s}=t;setTimeout(()=>{t.state==s&&mn(t)},50)}function qm(t,e){let n=t.state.doc.resolve(e);if(!st&&!Jw&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),i=(s.top+s.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(s.left-o.left)>1)return s.left<o.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),i=(s.top+s.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(s.left-o.left)>1)return s.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Um(t,e,n){let o=t.state.selection;if(o instanceof ie&&!o.empty||n.indexOf("s")>-1||Dt&&n.indexOf("m")>-1)return!1;let{$from:s,$to:i}=o;if(!s.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let a=sc(t.state,e);if(a&&a instanceof ne)return Ln(t,a)}if(!s.parent.inlineContent){let a=e<0?s:i,l=o instanceof Nt?pe.near(a,e):pe.findFrom(a,e);return!!l&&Ln(t,l)}return!1}function Gm(t,e){if(!(t.state.selection instanceof ie))return!0;let{$head:n,$anchor:o,empty:s}=t.state.selection;if(!n.sameParent(o))return!0;if(!s)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let a=t.state.tr;return e<0?a.delete(n.pos-i.nodeSize,n.pos):a.delete(n.pos,n.pos+i.nodeSize),t.dispatch(a),!0}return!1}function Jm(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function ac(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:o,openStart:s,openEnd:i}=e;for(;s>1&&i>1&&o.childCount==1&&o.firstChild.childCount==1;){s--,i--;let h=o.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),o=h.content}let a=t.someProp("clipboardSerializer")||uo.fromSchema(t.state.schema),l=og(),c=l.createElement("div");c.appendChild(a.serializeFragment(o,{document:l}));let d,u=c.firstChild,p=0;for(;u&&u.nodeType==1&&(d=tg[u.nodeName.toLowerCase()]);){for(let h=d.length-1;h>=0;h--){let f=l.createElement(d[h]);for(;c.firstChild;)f.appendChild(c.firstChild);c.appendChild(f),p++}u=c.firstChild}return u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${s} ${i}${p?` -${p}`:""} ${JSON.stringify(n)}`),{dom:c,text:t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
|
|
43
|
-
|
|
44
|
-
`),slice:e}}function
|
|
45
|
-
`))),0,0),t.someProp("transformPasted",h=>{a=h(a,t,!0)}),a;let p=t.someProp("clipboardTextParser",h=>h(e,s,o,t));if(p)a=p;else{let h=s.marks(),{schema:f}=t.state,m=uo.fromSchema(f);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let v=i.appendChild(document.createElement("p"));g&&v.appendChild(m.serializeNode(f.text(g,h)))})}}else t.someProp("transformPastedHTML",p=>{n=p(n,t)}),i=function(p){let h=/^(\s*<meta [^>]*>)*/.exec(p);h&&(p=p.slice(h[0].length));let f,m=og().createElement("div"),g=/<([a-z][^>\s]+)/i.exec(p);if((f=g&&tg[g[1].toLowerCase()])&&(p=f.map(v=>"<"+v+">").join("")+p+f.map(v=>"</"+v+">").reverse().join("")),m.innerHTML=function(v){let k=window.trustedTypes;return k?(cc||(cc=k.defaultPolicy||k.createPolicy("ProseMirrorClipboard",{createHTML:y=>y})),cc.createHTML(v)):v}(p),f)for(let v=0;v<f.length;v++)m=m.querySelector(f[v])||m;return m}(n),Hr&&function(p){let h=p.querySelectorAll(st?"span:not([class]):not([style])":"span.Apple-converted-space");for(let f=0;f<h.length;f++){let m=h[f];m.childNodes.length==1&&m.textContent==" "&&m.parentNode&&m.parentNode.replaceChild(p.ownerDocument.createTextNode(" "),m)}}(i);let d=i&&i.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let p=+u[3];p>0;p--){let h=i.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;i=h}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Tn.fromSchema(t.state.schema)).parseSlice(i,{preserveWhitespace:!(!c&&!u),context:s,ruleFromNode:h=>h.nodeName!="BR"||h.nextSibling||!h.parentNode||ax.test(h.parentNode.nodeName)?null:{ignore:!0}})),u)a=function(p,h){if(!p.size)return p;let f,m=p.content.firstChild.type.schema;try{f=JSON.parse(h)}catch{return p}let{content:g,openStart:v,openEnd:k}=p;for(let y=f.length-2;y>=0;y-=2){let b=m.nodes[f[y]];if(!b||b.hasRequiredAttrs())break;g=$.from(b.create(f[y+1],g)),v++,k++}return new G(g,v,k)}(eg(a,+u[1],+u[2]),u[4]);else if(a=G.maxOpen(function(p,h){if(p.childCount<2)return p;for(let f=h.depth;f>=0;f--){let m,g=h.node(f).contentMatchAt(h.index(f)),v=[];if(p.forEach(k=>{if(!v)return;let y,b=g.findWrapping(k.type);if(!b)return v=null;if(y=v.length&&m.length&&Zm(b,m,k,v[v.length-1],0))v[v.length-1]=y;else{v.length&&(v[v.length-1]=Qm(v[v.length-1],m.length));let x=Xm(k,b);v.push(x),g=g.matchType(x.type),m=b}}),v)return $.from(v)}return p}(a.content,s),!0),a.openStart||a.openEnd){let p=0,h=0;for(let f=a.content.firstChild;p<a.openStart&&!f.type.spec.isolating;p++,f=f.firstChild);for(let f=a.content.lastChild;h<a.openEnd&&!f.type.spec.isolating;h++,f=f.lastChild);a=eg(a,p,h)}return t.someProp("transformPasted",p=>{a=p(a,t,c)}),a}const ax=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Xm(t,e,n=0){for(let o=e.length-1;o>=n;o--)t=e[o].create(null,$.from(t));return t}function Zm(t,e,n,o,s){if(s<t.length&&s<e.length&&t[s]==e[s]){let i=Zm(t,e,n,o.lastChild,s+1);if(i)return o.copy(o.content.replaceChild(o.childCount-1,i));if(o.contentMatchAt(o.childCount).matchType(s==t.length-1?n.type:t[s+1]))return o.copy(o.content.append($.from(Xm(n,t,s+1))))}}function Qm(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Qm(t.lastChild,e-1)),o=t.contentMatchAt(t.childCount).fillBefore($.empty,!0);return t.copy(n.append(o))}function lc(t,e,n,o,s,i){let a=e<0?t.firstChild:t.lastChild,l=a.content;return t.childCount>1&&(i=0),s<o-1&&(l=lc(l,e,n,o,s+1,i)),s>=n&&(l=e<0?a.contentMatchAt(0).fillBefore(l,i<=s).append(l):l.append(a.contentMatchAt(a.childCount).fillBefore($.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(l))}function eg(t,e,n){return e<t.openStart&&(t=new G(lc(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new G(lc(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const tg={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let ng=null;function og(){return ng||(ng=document.implementation.createHTMLDocument("title"))}let cc=null;const ut={},pt={},lx={touchstart:!0,touchmove:!0};class cx{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function zn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function dc(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=o=>uc(t,o))})}function uc(t,e){return t.someProp("handleDOMEvents",n=>{let o=n[e.type];return!!o&&(o(t,e)||e.defaultPrevented)})}function dx(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function ui(t){return{left:t.clientX,top:t.clientY}}function pc(t,e,n,o,s){if(o==-1)return!1;let i=t.state.doc.resolve(o);for(let a=i.depth+1;a>0;a--)if(t.someProp(e,l=>a>i.depth?l(t,n,i.nodeAfter,i.before(a),s,!0):l(t,n,i.node(a),i.before(a),s,!1)))return!0;return!1}function rr(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let o=t.state.tr.setSelection(e);o.setMeta("pointer",!0),t.dispatch(o)}function ux(t,e,n,o){return pc(t,"handleDoubleClickOn",e,n,o)||t.someProp("handleDoubleClick",s=>s(t,e,o))}function px(t,e,n,o){return pc(t,"handleTripleClickOn",e,n,o)||t.someProp("handleTripleClick",s=>s(t,e,o))||function(s,i,a){if(a.button!=0)return!1;let l=s.state.doc;if(i==-1)return!!l.inlineContent&&(rr(s,ie.create(l,0,l.content.size)),!0);let c=l.resolve(i);for(let d=c.depth+1;d>0;d--){let u=d>c.depth?c.nodeAfter:c.node(d),p=c.before(d);if(u.inlineContent)rr(s,ie.create(l,p+1,p+1+u.content.size));else{if(!ne.isSelectable(u))continue;rr(s,ne.create(l,p))}return!0}}(t,n,o)}function hc(t){return pi(t)}pt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!sg(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!hn||!st||n.keyCode!=13))if(n.keyCode!=229&&t.domObserver.forceFlush(),!tr||n.keyCode!=13||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",o=>o(t,n))||function(o,s){let i=s.keyCode,a=function(l){let c="";return l.ctrlKey&&(c+="c"),l.metaKey&&(c+="m"),l.altKey&&(c+="a"),l.shiftKey&&(c+="s"),c}(s);if(i==8||Dt&&i==72&&a=="c")return Gm(o,-1)||or(o,-1);if(i==46&&!s.shiftKey||Dt&&i==68&&a=="c")return Gm(o,1)||or(o,1);if(i==13||i==27)return!0;if(i==37||Dt&&i==66&&a=="c"){let l=i==37?qm(o,o.state.selection.from)=="ltr"?-1:1:-1;return Wm(o,l,a)||or(o,l)}if(i==39||Dt&&i==70&&a=="c"){let l=i==39?qm(o,o.state.selection.from)=="ltr"?1:-1:1;return Wm(o,l,a)||or(o,l)}return i==38||Dt&&i==80&&a=="c"?Um(o,-1,a)||or(o,-1):i==40||Dt&&i==78&&a=="c"?function(l){if(!dt||l.state.selection.$head.parentOffset>0)return!1;let{focusNode:c,focusOffset:d}=l.domSelectionRange();if(c&&c.nodeType==1&&d==0&&c.firstChild&&c.firstChild.contentEditable=="false"){let u=c.firstChild;Jm(l,u,"true"),setTimeout(()=>Jm(l,u,"false"),20)}return!1}(o)||Um(o,1,a)||or(o,1):a==(Dt?"m":"c")&&(i==66||i==73||i==89||i==90)}(t,n)?n.preventDefault():zn(t,"key");else{let o=Date.now();t.input.lastIOSEnter=o,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==o&&(t.someProp("handleKeyDown",s=>s(t,fo(13,"Enter"))),t.input.lastIOSEnter=0)},200)}},pt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},pt.keypress=(t,e)=>{let n=e;if(sg(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Dt&&n.metaKey)return;if(t.someProp("handleKeyPress",s=>s(t,n)))return void n.preventDefault();let o=t.state.selection;if(!(o instanceof ie&&o.$from.sameParent(o.$to))){let s=String.fromCharCode(n.charCode),i=()=>t.state.tr.insertText(s).scrollIntoView();/[\r\n]/.test(s)||t.someProp("handleTextInput",a=>a(t,o.$from.pos,o.$to.pos,s,i))||t.dispatch(i()),n.preventDefault()}};const rg=Dt?"metaKey":"ctrlKey";ut.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let o=hc(t),s=Date.now(),i="singleClick";s-t.input.lastClick.time<500&&function(l,c){let d=c.x-l.clientX,u=c.y-l.clientY;return d*d+u*u<100}(n,t.input.lastClick)&&!n[rg]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:s,x:n.clientX,y:n.clientY,type:i,button:n.button};let a=t.posAtCoords(ui(n));a&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new hx(t,a,n,!!o)):(i=="doubleClick"?ux:px)(t,a.pos,a.inside,n)?n.preventDefault():zn(t,"pointer"))};class hx{constructor(e,n,o,s){let i,a;if(this.view=e,this.pos=n,this.event=o,this.flushed=s,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!o[rg],this.allowDefault=o.shiftKey,n.inside>-1)i=e.state.doc.nodeAt(n.inside),a=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,a=u.depth?u.before():0}const l=s?null:o.target,c=l?e.docView.nearestDesc(l,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:d}=e.state;(o.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||d instanceof ne&&d.from<=a&&d.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!It||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),zn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>mn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(ui(e))),this.updateAllowDefault(e),this.allowDefault||!n?zn(this.view,"pointer"):function(o,s,i,a,l){return pc(o,"handleClickOn",s,i,a)||o.someProp("handleClick",c=>c(o,s,a))||(l?function(c,d){if(d==-1)return!1;let u,p,h=c.state.selection;h instanceof ne&&(u=h.node);let f=c.state.doc.resolve(d);for(let m=f.depth+1;m>0;m--){let g=m>f.depth?f.nodeAfter:f.node(m);if(ne.isSelectable(g)){p=u&&h.$from.depth>0&&m>=h.$from.depth&&f.before(h.$from.depth+1)==h.$from.pos?f.before(h.$from.depth):f.before(m);break}}return p!=null&&(rr(c,ne.create(c.state.doc,p)),!0)}(o,i):function(c,d){if(d==-1)return!1;let u=c.state.doc.resolve(d),p=u.nodeAfter;return!!(p&&p.isAtom&&ne.isSelectable(p))&&(rr(c,new ne(u)),!0)}(o,i))}(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||dt&&this.mightDrag&&!this.mightDrag.node.isAtom||st&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(rr(this.view,pe.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):zn(this.view,"pointer")}move(e){this.updateAllowDefault(e),zn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function sg(t,e){return!!t.composing||!!(dt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}ut.touchstart=t=>{t.input.lastTouch=Date.now(),hc(t),zn(t,"pointer")},ut.touchmove=t=>{t.input.lastTouch=Date.now(),zn(t,"pointer")},ut.contextmenu=t=>hc(t);const fx=hn?5e3:-1;function ig(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>pi(t),e))}function ag(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function pi(t,e=!1){if(!(hn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),ag(t),e||t.docView&&t.docView.dirty){let n=nc(t),o=t.state.selection;return n&&!n.eq(o)?t.dispatch(t.state.tr.setSelection(n)):!t.markCursor&&!e||o.$from.node(o.$from.sharedDepth(o.to)).inlineContent?t.updateState(t.state):t.dispatch(t.state.tr.deleteSelection()),!0}return!1}}pt.compositionstart=pt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ie&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(o=>o.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),pi(t,!0),t.markCursor=null;else if(pi(t,!e.selection.empty),It&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let o=t.domSelectionRange();for(let s=o.focusNode,i=o.focusOffset;s&&s.nodeType==1&&i!=0;){let a=i<0?s.lastChild:s.childNodes[i-1];if(!a)break;if(a.nodeType==3){let l=t.domSelection();l&&l.collapse(a,a.nodeValue.length);break}s=a,i=-1}}t.input.composing=!0}ig(t,fx)},pt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,ig(t,20))};const Gr=yt&&In<15||tr&&Yw<604;function Jr(t,e,n,o,s){let i=Ym(t,e,n,o,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,s,i||G.empty)))return!0;if(!i)return!1;let a=function(c){return c.openStart==0&&c.openEnd==0&&c.content.childCount==1?c.content.firstChild:null}(i),l=a?t.state.tr.replaceSelectionWith(a,o):t.state.tr.replaceSelection(i);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function lg(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ut.copy=pt.cut=(t,e)=>{let n=e,o=t.state.selection,s=n.type=="cut";if(o.empty)return;let i=Gr?null:n.clipboardData,a=o.content(),{dom:l,text:c}=ac(t,a);i?(n.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",c)):function(d,u){if(!d.dom.parentNode)return;let p=d.dom.parentNode.appendChild(document.createElement("div"));p.appendChild(u),p.style.cssText="position: fixed; left: -10000px; top: 10px";let h=getSelection(),f=document.createRange();f.selectNodeContents(u),d.dom.blur(),h.removeAllRanges(),h.addRange(f),setTimeout(()=>{p.parentNode&&p.parentNode.removeChild(p),d.focus()},50)}(t,l),s&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},pt.paste=(t,e)=>{let n=e;if(t.composing&&!hn)return;let o=Gr?null:n.clipboardData,s=t.input.shiftKey&&t.input.lastKeyCode!=45;o&&Jr(t,lg(o),o.getData("text/html"),s,n)?n.preventDefault():function(i,a){if(!i.dom.parentNode)return;let l=i.input.shiftKey||i.state.selection.$from.parent.type.spec.code,c=i.dom.parentNode.appendChild(document.createElement(l?"textarea":"div"));l||(c.contentEditable="true"),c.style.cssText="position: fixed; left: -10000px; top: 10px",c.focus();let d=i.input.shiftKey&&i.input.lastKeyCode!=45;setTimeout(()=>{i.focus(),c.parentNode&&c.parentNode.removeChild(c),l?Jr(i,c.value,null,d,a):Jr(i,c.textContent,c.innerHTML,d,a)},50)}(t,n)};class cg{constructor(e,n,o){this.slice=e,this.move=n,this.node=o}}const mx=Dt?"altKey":"ctrlKey";function dg(t,e){let n=t.someProp("dragCopies",o=>!o(e));return n??!e[mx]}ut.dragstart=(t,e)=>{let n=e,o=t.input.mouseDown;if(o&&o.done(),!n.dataTransfer)return;let s,i=t.state.selection,a=i.empty?null:t.posAtCoords(ui(n));if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof ne?i.to-1:i.to))){if(o&&o.mightDrag)s=ne.create(t.state.doc,o.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let p=t.docView.nearestDesc(n.target,!0);p&&p.node.type.spec.draggable&&p!=t.docView&&(s=ne.create(t.state.doc,p.posBefore))}}let l=(s||t.state.selection).content(),{dom:c,text:d,slice:u}=ac(t,l);(!n.dataTransfer.files.length||!st||vm>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Gr?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",Gr||n.dataTransfer.setData("text/plain",d),t.dragging=new cg(u,dg(t,n),s)},ut.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},pt.dragover=pt.dragenter=(t,e)=>e.preventDefault(),pt.drop=(t,e)=>{let n=e,o=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let s=t.posAtCoords(ui(n));if(!s)return;let i=t.state.doc.resolve(s.pos),a=o&&o.slice;a?t.someProp("transformPasted",m=>{a=m(a,t,!1)}):a=Ym(t,lg(n.dataTransfer),Gr?null:n.dataTransfer.getData("text/html"),!1,i);let l=!(!o||!dg(t,n));if(t.someProp("handleDrop",m=>m(t,n,a||G.empty,l)))return void n.preventDefault();if(!a)return;n.preventDefault();let c=a?Hf(t.state.doc,i.pos,a):i.pos;c==null&&(c=i.pos);let d=t.state.tr;if(l){let{node:m}=o;m?m.replace(d):d.deleteSelection()}let u=d.mapping.map(c),p=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,h=d.doc;if(p?d.replaceRangeWith(u,u,a.content.firstChild):d.replaceRange(u,u,a),d.doc.eq(h))return;let f=d.doc.resolve(u);if(p&&ne.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))d.setSelection(new ne(f));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((g,v,k,y)=>m=y),d.setSelection(rc(t,f,d.doc.resolve(m)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))},ut.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&mn(t)},20))},ut.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},ut.beforeinput=(t,e)=>{if(st&&hn&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,fo(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in pt)ut[t]=pt[t];function Yr(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class hi{constructor(e,n){this.toDOM=e,this.spec=n||vo,this.side=this.spec.side||0}map(e,n,o,s){let{pos:i,deleted:a}=e.mapResult(n.from+s,this.side<0?-1:1);return a?null:new ht(i-o,i-o,this)}valid(){return!0}eq(e){return this==e||e instanceof hi&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Yr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class $n{constructor(e,n){this.attrs=e,this.spec=n||vo}map(e,n,o,s){let i=e.map(n.from+s,this.spec.inclusiveStart?-1:1)-o,a=e.map(n.to+s,this.spec.inclusiveEnd?1:-1)-o;return i>=a?null:new ht(i,a,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof $n&&Yr(this.attrs,e.attrs)&&Yr(this.spec,e.spec)}static is(e){return e.type instanceof $n}destroy(){}}class fc{constructor(e,n){this.attrs=e,this.spec=n||vo}map(e,n,o,s){let i=e.mapResult(n.from+s,1);if(i.deleted)return null;let a=e.mapResult(n.to+s,-1);return a.deleted||a.pos<=i.pos?null:new ht(i.pos-o,a.pos-o,this)}valid(e,n){let o,{index:s,offset:i}=e.content.findIndex(n.from);return i==n.from&&!(o=e.child(s)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof fc&&Yr(this.attrs,e.attrs)&&Yr(this.spec,e.spec)}destroy(){}}class ht{constructor(e,n,o){this.from=e,this.to=n,this.type=o}copy(e,n){return new ht(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,o){return this.type.map(e,this,n,o)}static widget(e,n,o){return new ht(e,e,new hi(n,o))}static inline(e,n,o,s){return new ht(e,n,new $n(o,s))}static node(e,n,o,s){return new ht(e,n,new fc(o,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof $n}get widget(){return this.type instanceof hi}}const sr=[],vo={};class Ie{constructor(e,n){this.local=e.length?e:sr,this.children=n.length?n:sr}static create(e,n){return n.length?fi(n,e,0,vo):it}find(e,n,o){let s=[];return this.findInner(e??0,n??1e9,s,0,o),s}findInner(e,n,o,s,i){for(let a=0;a<this.local.length;a++){let l=this.local[a];l.from<=n&&l.to>=e&&(!i||i(l.spec))&&o.push(l.copy(l.from+s,l.to+s))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>e){let l=this.children[a]+1;this.children[a+2].findInner(e-l,n-l,o,s+l,i)}}map(e,n,o){return this==it||e.maps.length==0?this:this.mapInner(e,n,0,0,o||vo)}mapInner(e,n,o,s,i){let a;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(e,o,s);c&&c.type.valid(n,c)?(a||(a=[])).push(c):i.onRemove&&i.onRemove(this.local[l].spec)}return this.children.length?function(l,c,d,u,p,h,f){let m=l.slice();for(let v=0,k=h;v<d.maps.length;v++){let y=0;d.maps[v].forEach((b,x,w,C)=>{let S=C-w-(x-b);for(let E=0;E<m.length;E+=3){let M=m[E+1];if(M<0||b>M+k-y)continue;let N=m[E]+k-y;x>=N?m[E+1]=b<=N?-2:-1:b>=k&&S&&(m[E]+=S,m[E+1]+=S)}y+=S}),k=d.maps[v].map(k,-1)}let g=!1;for(let v=0;v<m.length;v+=3)if(m[v+1]<0){if(m[v+1]==-2){g=!0,m[v+1]=-1;continue}let k=d.map(l[v]+h),y=k-p;if(y<0||y>=u.content.size){g=!0;continue}let b=d.map(l[v+1]+h,-1)-p,{index:x,offset:w}=u.content.findIndex(y),C=u.maybeChild(x);if(C&&w==y&&w+C.nodeSize==b){let S=m[v+2].mapInner(d,C,k+1,l[v]+h+1,f);S!=it?(m[v]=y,m[v+1]=b,m[v+2]=S):(m[v+1]=-2,g=!0)}else g=!0}if(g){let v=function(y,b,x,w,C,S,E){function M(N,T){for(let R=0;R<N.local.length;R++){let z=N.local[R].map(w,C,T);z?x.push(z):E.onRemove&&E.onRemove(N.local[R].spec)}for(let R=0;R<N.children.length;R+=3)M(N.children[R+2],N.children[R]+T+1)}for(let N=0;N<y.length;N+=3)y[N+1]==-1&&M(y[N+2],b[N]+S+1);return x}(m,l,c,d,p,h,f),k=fi(v,u,0,f);c=k.local;for(let y=0;y<m.length;y+=3)m[y+1]<0&&(m.splice(y,3),y-=3);for(let y=0,b=0;y<k.children.length;y+=3){let x=k.children[y];for(;b<m.length&&m[b]<x;)b+=3;m.splice(b,0,k.children[y],k.children[y+1],k.children[y+2])}}return new Ie(c.sort(yo),m)}(this.children,a||[],e,n,o,s,i):a?new Ie(a.sort(yo),sr):it}add(e,n){return n.length?this==it?Ie.create(e,n):this.addInner(e,n,0):this}addInner(e,n,o){let s,i=0;e.forEach((l,c)=>{let d,u=c+o;if(d=pg(n,l,u)){for(s||(s=this.children.slice());i<s.length&&s[i]<c;)i+=3;s[i]==c?s[i+2]=s[i+2].addInner(l,d,u+1):s.splice(i,0,c,c+l.nodeSize,fi(d,l,u+1,vo)),i+=3}});let a=ug(i?hg(n):n,-o);for(let l=0;l<a.length;l++)a[l].type.valid(e,a[l])||a.splice(l--,1);return new Ie(a.length?this.local.concat(a).sort(yo):this.local,s||this.children)}remove(e){return e.length==0||this==it?this:this.removeInner(e,0)}removeInner(e,n){let o=this.children,s=this.local;for(let i=0;i<o.length;i+=3){let a,l=o[i]+n,c=o[i+1]+n;for(let u,p=0;p<e.length;p++)(u=e[p])&&u.from>l&&u.to<c&&(e[p]=null,(a||(a=[])).push(u));if(!a)continue;o==this.children&&(o=this.children.slice());let d=o[i+2].removeInner(a,l+1);d!=it?o[i+2]=d:(o.splice(i,3),i-=3)}if(s.length){for(let i,a=0;a<e.length;a++)if(i=e[a])for(let l=0;l<s.length;l++)s[l].eq(i,n)&&(s==this.local&&(s=this.local.slice()),s.splice(l--,1))}return o==this.children&&s==this.local?this:s.length||o.length?new Ie(s,o):it}forChild(e,n){if(this==it)return this;if(n.isLeaf)return Ie.empty;let o,s;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(o=this.children[l+2]);break}let i=e+1,a=i+n.content.size;for(let l=0;l<this.local.length;l++){let c=this.local[l];if(c.from<a&&c.to>i&&c.type instanceof $n){let d=Math.max(i,c.from)-i,u=Math.min(a,c.to)-i;d<u&&(s||(s=[])).push(c.copy(d,u))}}if(s){let l=new Ie(s.sort(yo),sr);return o?new Pn([l,o]):l}return o||it}eq(e){if(this==e)return!0;if(!(e instanceof Ie)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return mc(this.localsInner(e))}localsInner(e){if(this==it)return sr;if(e.inlineContent||!this.local.some($n.is))return this.local;let n=[];for(let o=0;o<this.local.length;o++)this.local[o].type instanceof $n||n.push(this.local[o]);return n}forEachSet(e){e(this)}}Ie.empty=new Ie([],[]),Ie.removeOverlap=mc;const it=Ie.empty;class Pn{constructor(e){this.members=e}map(e,n){const o=this.members.map(s=>s.map(e,n,vo));return Pn.from(o)}forChild(e,n){if(n.isLeaf)return Ie.empty;let o=[];for(let s=0;s<this.members.length;s++){let i=this.members[s].forChild(e,n);i!=it&&(i instanceof Pn?o=o.concat(i.members):o.push(i))}return Pn.from(o)}eq(e){if(!(e instanceof Pn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,o=!0;for(let s=0;s<this.members.length;s++){let i=this.members[s].localsInner(e);if(i.length)if(n){o&&(n=n.slice(),o=!1);for(let a=0;a<i.length;a++)n.push(i[a])}else n=i}return n?mc(o?n:n.sort(yo)):sr}static from(e){switch(e.length){case 0:return it;case 1:return e[0];default:return new Pn(e.every(n=>n instanceof Ie)?e:e.reduce((n,o)=>n.concat(o instanceof Ie?o:o.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function ug(t,e){if(!e||!t.length)return t;let n=[];for(let o=0;o<t.length;o++){let s=t[o];n.push(new ht(s.from+e,s.to+e,s.type))}return n}function pg(t,e,n){if(e.isLeaf)return null;let o=n+e.nodeSize,s=null;for(let i,a=0;a<t.length;a++)(i=t[a])&&i.from>n&&i.to<o&&((s||(s=[])).push(i),t[a]=null);return s}function hg(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function fi(t,e,n,o){let s=[],i=!1;e.forEach((l,c)=>{let d=pg(t,l,c+n);if(d){i=!0;let u=fi(d,l,n+c+1,o);u!=it&&s.push(c,c+l.nodeSize,u)}});let a=ug(i?hg(t):t,-n).sort(yo);for(let l=0;l<a.length;l++)a[l].type.valid(e,a[l])||(o.onRemove&&o.onRemove(a[l].spec),a.splice(l--,1));return a.length||s.length?new Ie(a,s):it}function yo(t,e){return t.from-e.from||t.to-e.to}function mc(t){let e=t;for(let n=0;n<e.length-1;n++){let o=e[n];if(o.from!=o.to)for(let s=n+1;s<e.length;s++){let i=e[s];if(i.from!=o.from){i.from<o.to&&(e==t&&(e=t.slice()),e[n]=o.copy(o.from,i.from),fg(e,s,o.copy(i.from,o.to)));break}i.to!=o.to&&(e==t&&(e=t.slice()),e[s]=i.copy(i.from,o.to),fg(e,s+1,i.copy(o.to,i.to)))}}return e}function fg(t,e,n){for(;e<t.length&&yo(n,t[e])>0;)e++;t.splice(e,0,n)}function gc(t){let e=[];return t.someProp("decorations",n=>{let o=n(t.state);o&&o!=it&&e.push(o)}),t.cursorWrapper&&e.push(Ie.create(t.state.doc,[t.cursorWrapper.deco])),Pn.from(e)}const gx={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},vx=yt&&In<=11;class yx{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class kx{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new yx,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(o=>{for(let s=0;s<o.length;s++)this.queue.push(o[s]);yt&&In<=11&&o.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():this.flush()}),vx&&(this.onCharData=o=>{this.queue.push({target:o.target,type:"characterData",oldValue:o.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,gx)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Fm(this.view)){if(this.suppressingSelectionUpdates)return mn(this.view);if(yt&&In<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ho(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n,o=new Set;for(let i=e.focusNode;i;i=er(i))o.add(i);for(let i=e.anchorNode;i;i=er(i))if(o.has(i)){n=i;break}let s=n&&this.view.docView.nearestDesc(n);return s&&s.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let o=e.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(o)&&Fm(e)&&!this.ignoreSelectionChange(o),i=-1,a=-1,l=!1,c=[];if(e.editable)for(let u=0;u<n.length;u++){let p=this.registerMutation(n[u],c);p&&(i=i<0?p.from:Math.min(p.from,i),a=a<0?p.to:Math.max(p.to,a),p.typeOver&&(l=!0))}if(It&&c.length){let u=c.filter(p=>p.nodeName=="BR");if(u.length==2){let[p,h]=u;p.parentNode&&p.parentNode.parentNode==h.parentNode?h.remove():p.remove()}else{let{focusNode:p}=this.currentSelection;for(let h of u){let f=h.parentNode;!f||f.nodeName!="LI"||p&&bx(e,p)==f||h.remove()}}}let d=null;i<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ai(o)&&(d=nc(e))&&d.eq(pe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,mn(e),this.currentSelection.set(o),e.scrollToSelection()):(i>-1||s)&&(i>-1&&(e.docView.markDirty(i,a),function(u){if(!mg.has(u)&&(mg.set(u,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(u.dom).whiteSpace)!==-1)){if(u.requiresGeckoHackNode=It,gg)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),gg=!0}}(e)),this.handleDOMChange(i,a,l,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(o)||mn(e),this.currentSelection.set(o))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let o=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(o==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!o||o.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let u=e.addedNodes[d];n.push(u),u.nodeType==3&&(this.lastChangedTextNode=u)}if(o.contentDOM&&o.contentDOM!=o.dom&&!o.contentDOM.contains(e.target))return{from:o.posBefore,to:o.posAfter};let s=e.previousSibling,i=e.nextSibling;if(yt&&In<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:u,nextSibling:p}=e.addedNodes[d];(!u||Array.prototype.indexOf.call(e.addedNodes,u)<0)&&(s=u),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(i=p)}let a=s&&s.parentNode==e.target?et(s)+1:0,l=o.localPosFromDOM(e.target,a,-1),c=i&&i.parentNode==e.target?et(i):e.target.childNodes.length;return{from:l,to:o.localPosFromDOM(e.target,c,1)}}return e.type=="attributes"?{from:o.posAtStart-o.border,to:o.posAtEnd+o.border}:(this.lastChangedTextNode=e.target,{from:o.posAtStart,to:o.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let mg=new WeakMap,gg=!1;function vg(t,e){let n=e.startContainer,o=e.startOffset,s=e.endContainer,i=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return ho(a.node,a.offset,s,i)&&([n,o,s,i]=[s,i,n,o]),{anchorNode:n,anchorOffset:o,focusNode:s,focusOffset:i}}function bx(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let o=t.docView.nearestDesc(n,!0);if(o&&o.node.isBlock)return n}return null}function wx(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(dt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(t.parentNode.lastChild==t||dt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const xx=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function yg(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:rc(t,e.resolve(n.anchor),e.resolve(n.head))}function vc(t,e,n){let o=t.depth,s=e?t.end():t.pos;for(;o>0&&(e||t.indexAfter(o)==t.node(o).childCount);)o--,s++,e=!1;if(n){let i=t.node(o).maybeChild(t.indexAfter(o));for(;i&&!i.isLeaf;)i=i.firstChild,s++}return s}function kg(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class bg{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new cx,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Eg),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Cg(this),xg(this),this.nodeViews=Sg(this),this.docView=Om(this.state.doc,wg(this),gc(this),this.dom,this),this.domObserver=new kx(this,(o,s,i,a)=>function(l,c,d,u,p){let h=l.input.compositionPendingChanges||(l.composing?l.input.compositionID:0);if(l.input.compositionPendingChanges=0,c<0){let _=l.input.lastSelectionTime>Date.now()-50?l.input.lastSelectionOrigin:null,I=nc(l,_);if(I&&!l.state.selection.eq(I)){if(st&&hn&&l.input.lastKeyCode===13&&Date.now()-100<l.input.lastKeyCodeTime&&l.someProp("handleKeyDown",V=>V(l,fo(13,"Enter"))))return;let O=l.state.tr.setSelection(I);_=="pointer"?O.setMeta("pointer",!0):_=="key"&&O.scrollIntoView(),h&&O.setMeta("composition",h),l.dispatch(O)}return}let f=l.state.doc.resolve(c),m=f.sharedDepth(d);c=f.before(m+1),d=l.state.doc.resolve(d).after(m+1);let g,v,k=l.state.selection,y=function(_,I,O){let V,{node:P,fromOffset:A,toOffset:L,from:j,to:q}=_.docView.parseRange(I,O),H=_.domSelectionRange(),U=H.anchorNode;if(U&&_.dom.contains(U.nodeType==1?U:U.parentNode)&&(V=[{node:U,offset:H.anchorOffset}],ai(H)||V.push({node:H.focusNode,offset:H.focusOffset})),st&&_.input.lastKeyCode===8)for(let le=L;le>A;le--){let me=P.childNodes[le-1],Be=me.pmViewDesc;if(me.nodeName=="BR"&&!Be){L=le;break}if(!Be||Be.size)break}let Y=_.state.doc,J=_.someProp("domParser")||Tn.fromSchema(_.state.schema),Q=Y.resolve(j),oe=null,fe=J.parse(P,{topNode:Q.parent,topMatch:Q.parent.contentMatchAt(Q.index()),topOpen:!0,from:A,to:L,preserveWhitespace:Q.parent.type.whitespace!="pre"||"full",findPositions:V,ruleFromNode:wx,context:Q});if(V&&V[0].pos!=null){let le=V[0].pos,me=V[1]&&V[1].pos;me==null&&(me=le),oe={anchor:le+j,head:me+j}}return{doc:fe,sel:oe,from:j,to:q}}(l,c,d),b=l.state.doc,x=b.slice(y.from,y.to);l.input.lastKeyCode===8&&Date.now()-100<l.input.lastKeyCodeTime?(g=l.state.selection.to,v="end"):(g=l.state.selection.from,v="start"),l.input.lastKeyCode=null;let w=function(_,I,O,V,P){let A=_.findDiffStart(I,O);if(A==null)return null;let{a:L,b:j}=_.findDiffEnd(I,O+_.size,O+I.size);if(P=="end"&&(V-=L+Math.max(0,A-Math.min(L,j))-A),L<A&&_.size<I.size){let q=V<=A&&V>=L?A-V:0;A-=q,A&&A<I.size&&kg(I.textBetween(A-1,A+1))&&(A+=q?1:-1),j=A+(j-L),L=A}else if(j<A){let q=V<=A&&V>=j?A-V:0;A-=q,A&&A<_.size&&kg(_.textBetween(A-1,A+1))&&(A+=q?1:-1),L=A+(L-j),j=A}return{start:A,endA:L,endB:j}}(x.content,y.doc.content,y.from,g,v);if(w&&l.input.domChangeCount++,(tr&&l.input.lastIOSEnter>Date.now()-225||hn)&&p.some(_=>_.nodeType==1&&!xx.test(_.nodeName))&&(!w||w.endA>=w.endB)&&l.someProp("handleKeyDown",_=>_(l,fo(13,"Enter"))))return void(l.input.lastIOSEnter=0);if(!w){if(!(u&&k instanceof ie&&!k.empty&&k.$head.sameParent(k.$anchor))||l.composing||y.sel&&y.sel.anchor!=y.sel.head){if(y.sel){let _=yg(l,l.state.doc,y.sel);if(_&&!_.eq(l.state.selection)){let I=l.state.tr.setSelection(_);h&&I.setMeta("composition",h),l.dispatch(I)}}return}w={start:k.from,endA:k.to,endB:k.to}}l.state.selection.from<l.state.selection.to&&w.start==w.endB&&l.state.selection instanceof ie&&(w.start>l.state.selection.from&&w.start<=l.state.selection.from+2&&l.state.selection.from>=y.from?w.start=l.state.selection.from:w.endA<l.state.selection.to&&w.endA>=l.state.selection.to-2&&l.state.selection.to<=y.to&&(w.endB+=l.state.selection.to-w.endA,w.endA=l.state.selection.to)),yt&&In<=11&&w.endB==w.start+1&&w.endA==w.start&&w.start>y.from&&y.doc.textBetween(w.start-y.from-1,w.start-y.from+1)==" "&&(w.start--,w.endA--,w.endB--);let C=y.doc.resolveNoCache(w.start-y.from),S=y.doc.resolveNoCache(w.endB-y.from),E=b.resolve(w.start),M=C.sameParent(S)&&C.parent.inlineContent&&E.end()>=w.endA;if((tr&&l.input.lastIOSEnter>Date.now()-225&&(!M||p.some(_=>_.nodeName=="DIV"||_.nodeName=="P"))||!M&&C.pos<y.doc.content.size&&(!C.sameParent(S)||!C.parent.inlineContent)&&C.pos<S.pos&&!/\S/.test(y.doc.textBetween(C.pos,S.pos,"","")))&&l.someProp("handleKeyDown",_=>_(l,fo(13,"Enter"))))return void(l.input.lastIOSEnter=0);if(l.state.selection.anchor>w.start&&function(_,I,O,V,P){if(O-I<=P.pos-V.pos||vc(V,!0,!1)<P.pos)return!1;let A=_.resolve(I);if(!V.parent.isTextblock){let j=A.nodeAfter;return j!=null&&O==I+j.nodeSize}if(A.parentOffset<A.parent.content.size||!A.parent.isTextblock)return!1;let L=_.resolve(vc(A,!0,!0));return!(!L.parent.isTextblock||L.pos>O||vc(L,!0,!1)<O)&&V.parent.content.cut(V.parentOffset).eq(L.parent.content)}(b,w.start,w.endA,C,S)&&l.someProp("handleKeyDown",_=>_(l,fo(8,"Backspace"))))return void(hn&&st&&l.domObserver.suppressSelectionUpdates());st&&w.endB==w.start&&(l.input.lastChromeDelete=Date.now()),hn&&!M&&C.start()!=S.start()&&S.parentOffset==0&&C.depth==S.depth&&y.sel&&y.sel.anchor==y.sel.head&&y.sel.head==w.endA&&(w.endB-=2,S=y.doc.resolveNoCache(w.endB-y.from),setTimeout(()=>{l.someProp("handleKeyDown",function(_){return _(l,fo(13,"Enter"))})},20));let N,T=w.start,R=w.endA,z=_=>{let I=_||l.state.tr.replace(T,R,y.doc.slice(w.start-y.from,w.endB-y.from));if(y.sel){let O=yg(l,I.doc,y.sel);O&&!(st&&l.composing&&O.empty&&(w.start!=w.endB||l.input.lastChromeDelete<Date.now()-100)&&(O.head==T||O.head==I.mapping.map(R)-1)||yt&&O.empty&&O.head==T)&&I.setSelection(O)}return h&&I.setMeta("composition",h),I.scrollIntoView()};if(M)if(C.pos==S.pos){yt&&In<=11&&C.parentOffset==0&&(l.domObserver.suppressSelectionUpdates(),setTimeout(()=>mn(l),20));let _=z(l.state.tr.delete(T,R)),I=b.resolve(w.start).marksAcross(b.resolve(w.endA));I&&_.ensureMarks(I),l.dispatch(_)}else if(w.endA==w.endB&&(N=function(_,I){let O,V,P,A=_.firstChild.marks,L=I.firstChild.marks,j=A,q=L;for(let U=0;U<L.length;U++)j=L[U].removeFromSet(j);for(let U=0;U<A.length;U++)q=A[U].removeFromSet(q);if(j.length==1&&q.length==0)V=j[0],O="add",P=U=>U.mark(V.addToSet(U.marks));else{if(j.length!=0||q.length!=1)return null;V=q[0],O="remove",P=U=>U.mark(V.removeFromSet(U.marks))}let H=[];for(let U=0;U<I.childCount;U++)H.push(P(I.child(U)));if($.from(H).eq(_))return{mark:V,type:O}}(C.parent.content.cut(C.parentOffset,S.parentOffset),E.parent.content.cut(E.parentOffset,w.endA-E.start())))){let _=z(l.state.tr);N.type=="add"?_.addMark(T,R,N.mark):_.removeMark(T,R,N.mark),l.dispatch(_)}else if(C.parent.child(C.index()).isText&&C.index()==S.index()-(S.textOffset?0:1)){let _=C.parent.textBetween(C.parentOffset,S.parentOffset),I=()=>z(l.state.tr.insertText(_,T,R));l.someProp("handleTextInput",O=>O(l,T,R,_,I))||l.dispatch(I())}else l.dispatch(z());else l.dispatch(z())}(this,o,s,i,a)),this.domObserver.start(),function(o){for(let s in ut){let i=ut[s];o.dom.addEventListener(s,o.input.eventHandlers[s]=a=>{!dx(o,a)||uc(o,a)||!o.editable&&a.type in pt||i(o,a)},lx[s]?{passive:!0}:void 0)}dt&&o.dom.addEventListener("input",()=>null),dc(o)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&dc(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Eg),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let o in this._props)n[o]=this._props[o];n.state=this.state;for(let o in e)n[o]=e[o];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var o;let s=this.state,i=!1,a=!1;e.storedMarks&&this.composing&&(ag(this),a=!0),this.state=e;let l=s.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=Sg(this);(function(m,g){let v=0,k=0;for(let y in m){if(m[y]!=g[y])return!0;v++}for(let y in g)k++;return v!=k})(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&dc(this),this.editable=Cg(this),xg(this);let c=gc(this),d=wg(this),u=s.plugins==e.plugins||s.doc.eq(e.doc)?e.scrollToSelection>s.scrollToSelection?"to selection":"preserve":"reset",p=i||!this.docView.matchesNode(e.doc,d,c);!p&&e.selection.eq(s.selection)||(a=!0);let h=u=="preserve"&&a&&this.dom.style.overflowAnchor==null&&function(f){let m,g,v=f.dom.getBoundingClientRect(),k=Math.max(0,v.top);for(let y=(v.left+v.right)/2,b=k+1;b<Math.min(innerHeight,v.bottom);b+=5){let x=f.root.elementFromPoint(y,b);if(!x||x==f.dom||!f.dom.contains(x))continue;let w=x.getBoundingClientRect();if(w.top>=k-20){m=x,g=w.top;break}}return{refDOM:m,refTop:g,stack:km(f.dom)}}(this);if(a){this.domObserver.stop();let f=p&&(yt||st)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&function(m,g){let v=Math.min(m.$anchor.sharedDepth(m.head),g.$anchor.sharedDepth(g.head));return m.$anchor.start(v)!=g.$anchor.start(v)}(s.selection,e.selection);if(p){let m=st?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(g){let v=g.domSelectionRange();if(!v.focusNode)return null;let k=function(b,x){for(;;){if(b.nodeType==3&&x)return b;if(b.nodeType==1&&x>0){if(b.contentEditable=="false")return null;x=Vt(b=b.childNodes[x-1])}else{if(!b.parentNode||Fr(b))return null;x=et(b),b=b.parentNode}}}(v.focusNode,v.focusOffset),y=function(b,x){for(;;){if(b.nodeType==3&&x<b.nodeValue.length)return b;if(b.nodeType==1&&x<b.childNodes.length){if(b.contentEditable=="false")return null;b=b.childNodes[x],x=0}else{if(!b.parentNode||Fr(b))return null;x=et(b)+1,b=b.parentNode}}}(v.focusNode,v.focusOffset);if(k&&y&&k!=y){let b=y.pmViewDesc,x=g.domObserver.lastChangedTextNode;if(k==x||y==x)return x;if(!b||!b.isText(y.nodeValue))return y;if(g.input.compositionNode==y){let w=k.pmViewDesc;if(w&&w.isText(k.nodeValue))return y}}return k||y}(this)),!i&&this.docView.update(e.doc,d,c,this)||(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=Om(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(m){let g=m.docView.domFromPos(m.state.selection.anchor,0),v=m.domSelectionRange();return ho(g.node,g.offset,v.anchorNode,v.anchorOffset)}(this))?mn(this,f):(Pm(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((o=this.dragging)===null||o===void 0)&&o.node&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&function({refDOM:f,refTop:m,stack:g}){let v=f?f.getBoundingClientRect().top:0;bm(g,v==0?0:v-m)}(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(e.nodeType==1?e:e.parentNode)&&!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ne){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&ym(this,n.getBoundingClientRect(),e)}else ym(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let n=0;n<this.pluginViews.length;n++){let o=this.pluginViews[n];o.update&&o.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let o=this.directPlugins[n];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let o=this.state.plugins[n];o.spec.view&&this.pluginViews.push(o.spec.view(this))}}}updateDraggedNode(e,n){let o=e.node,s=-1;if(this.state.doc.nodeAt(o.from)==o.node)s=o.from;else{let i=o.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==o.node&&(s=i)}this.dragging=new cg(e.slice,e.move,s<0?void 0:ne.create(this.state.doc,s))}someProp(e,n){let o,s=this._props&&this._props[e];if(s!=null&&(o=n?n(s):s))return o;for(let a=0;a<this.directPlugins.length;a++){let l=this.directPlugins[a].props[e];if(l!=null&&(o=n?n(l):l))return o}let i=this.state.plugins;if(i)for(let a=0;a<i.length;a++){let l=i[a].props[e];if(l!=null&&(o=n?n(l):l))return o}}hasFocus(){if(yt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(nr)return e.focus(nr);let n=km(e);e.focus(nr==null?{get preventScroll(){return nr={preventScroll:!0},!0}}:void 0),nr||(nr=!1,bm(n,0))}(this.dom),mn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Qw(this,e)}coordsAtPos(e,n=1){return Sm(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,o=-1){let s=this.docView.posFromDOM(e,n,o);if(s==null)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(e,n){return function(o,s,i){return Mm==s&&Nm==i?Bm:(Mm=s,Nm=i,Bm=i=="up"||i=="down"?function(a,l,c){let d=l.selection,u=c=="up"?d.$from:d.$to;return Em(a,l,()=>{let{node:p}=a.docView.domFromPos(u.pos,c=="up"?-1:1);for(;;){let f=a.docView.nearestDesc(p,!0);if(!f)break;if(f.node.isBlock){p=f.contentDOM||f.dom;break}p=f.dom.parentNode}let h=Sm(a,u.pos,1);for(let f=p.firstChild;f;f=f.nextSibling){let m;if(f.nodeType==1)m=f.getClientRects();else{if(f.nodeType!=3)continue;m=pn(f,0,f.nodeValue.length).getClientRects()}for(let g=0;g<m.length;g++){let v=m[g];if(v.bottom>v.top+1&&(c=="up"?h.top-v.top>2*(v.bottom-h.top):v.bottom-h.bottom>2*(h.bottom-v.top)))return!1}}return!0})}(o,s,i):function(a,l,c){let{$head:d}=l.selection;if(!d.parent.isTextblock)return!1;let u=d.parentOffset,p=!u,h=u==d.parent.content.size,f=a.domSelection();return f?tx.test(d.parent.textContent)&&f.modify?Em(a,l,()=>{let{focusNode:m,focusOffset:g,anchorNode:v,anchorOffset:k}=a.domSelectionRange(),y=f.caretBidiLevel;f.modify("move",c,"character");let b=d.depth?a.docView.domAfterPos(d.before()):a.dom,{focusNode:x,focusOffset:w}=a.domSelectionRange(),C=x&&!b.contains(x.nodeType==1?x:x.parentNode)||m==x&&g==w;try{f.collapse(v,k),m&&(m!=v||g!=k)&&f.extend&&f.extend(m,g)}catch{}return y!=null&&(f.caretBidiLevel=y),C}):c=="left"||c=="backward"?p:h:d.pos==d.start()||d.pos==d.end()}(o,s,i))}(this,n||this.state,e)}pasteHTML(e,n){return Jr(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Jr(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return ac(this,e)}destroy(){this.docView&&(function(e){e.domObserver.stop();for(let n in e.input.eventHandlers)e.dom.removeEventListener(n,e.input.eventHandlers[n]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],gc(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Gl=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return function(n,o){uc(n,o)||!ut[o.type]||!n.editable&&o.type in pt||ut[o.type](n,o)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?dt&&this.root.nodeType===11&&function(n){let o=n.activeElement;for(;o&&o.shadowRoot;)o=o.shadowRoot.activeElement;return o}(this.dom.ownerDocument)==this.dom&&function(n,o){if(o.getComposedRanges){let a=o.getComposedRanges(n.root)[0];if(a)return vg(n,a)}let s;function i(a){a.preventDefault(),a.stopImmediatePropagation(),s=a.getTargetRanges()[0]}return n.dom.addEventListener("beforeinput",i,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",i,!0),s?vg(n,s):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function wg(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let o in n)o=="class"?e.class+=" "+n[o]:o=="style"?e.style=(e.style?e.style+";":"")+n[o]:e[o]||o=="contenteditable"||o=="nodeName"||(e[o]=String(n[o]))}),e.translate||(e.translate="no"),[ht.node(0,t.state.doc.content.size,e)]}function xg(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:ht.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Cg(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Sg(t){let e=Object.create(null);function n(o){for(let s in o)Object.prototype.hasOwnProperty.call(e,s)||(e[s]=o[s])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Eg(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}bg.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};for(var jn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},mi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Cx=typeof navigator<"u"&&/Mac/.test(navigator.platform),Sx=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),tt=0;tt<10;tt++)jn[48+tt]=jn[96+tt]=String(tt);for(tt=1;tt<=24;tt++)jn[tt+111]="F"+tt;for(tt=65;tt<=90;tt++)jn[tt]=String.fromCharCode(tt+32),mi[tt]=String.fromCharCode(tt);for(var yc in jn)mi.hasOwnProperty(yc)||(mi[yc]=jn[yc]);const Ex=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Mx=typeof navigator<"u"&&/Win/.test(navigator.platform);function Nx(t){let e,n,o,s,i=t.split(/-(?!$)/),a=i[i.length-1];a=="Space"&&(a=" ");for(let l=0;l<i.length-1;l++){let c=i[l];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))e=!0;else if(/^(c|ctrl|control)$/i.test(c))n=!0;else if(/^s(hift)?$/i.test(c))o=!0;else{if(!/^mod$/i.test(c))throw new Error("Unrecognized modifier name: "+c);Ex?s=!0:n=!0}}return e&&(a="Alt-"+a),n&&(a="Ctrl-"+a),s&&(a="Meta-"+a),o&&(a="Shift-"+a),a}function kc(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function Mg(t){let e=function(n){let o=Object.create(null);for(let s in n)o[Nx(s)]=n[s];return o}(t);return function(n,o){let s,i=function(l){var c=!(Cx&&l.metaKey&&l.shiftKey&&!l.ctrlKey&&!l.altKey||Sx&&l.shiftKey&&l.key&&l.key.length==1||l.key=="Unidentified")&&l.key||(l.shiftKey?mi:jn)[l.keyCode]||l.key||"Unidentified";return c=="Esc"&&(c="Escape"),c=="Del"&&(c="Delete"),c=="Left"&&(c="ArrowLeft"),c=="Up"&&(c="ArrowUp"),c=="Right"&&(c="ArrowRight"),c=="Down"&&(c="ArrowDown"),c}(o),a=e[kc(i,o)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(o.shiftKey){let l=e[kc(i,o,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((o.altKey||o.metaKey||o.ctrlKey)&&!(Mx&&o.ctrlKey&&o.altKey)&&(s=jn[o.keyCode])&&s!=i){let l=e[kc(s,o)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var Bx=Object.defineProperty,bc=(t,e)=>{for(var n in e)Bx(t,n,{get:e[n],enumerable:!0})};function gi(t){const{state:e,transaction:n}=t;let{selection:o}=n,{doc:s}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return o},get doc(){return s},get tr(){return o=n.selection,s=n.doc,i=n.storedMarks,n}}}var vi=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:o}=e,{tr:s}=n,i=this.buildProps(s);return Object.fromEntries(Object.entries(t).map(([a,l])=>[a,(...c)=>{const d=l(...c)(i);return s.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(s),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:o,state:s}=this,{view:i}=o,a=[],l=!!t,c=t||s.tr,d={...Object.fromEntries(Object.entries(n).map(([u,p])=>[u,(...h)=>{const f=this.buildProps(c,e),m=p(...h)(f);return a.push(m),d}])),run:()=>(l||!e||c.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(c),a.every(u=>u===!0))};return d}createCan(t){const{rawCommands:e,state:n}=this,o=!1,s=t||n.tr,i=this.buildProps(s,o);return{...Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>l(...c)({...i,dispatch:void 0})])),chain:()=>this.createChain(s,o)}}buildProps(t,e=!0){const{rawCommands:n,editor:o,state:s}=this,{view:i}=o,a={tr:t,editor:o,view:i,state:gi({state:s,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...d)=>c(...d)(a)]))}};return a}},Ng={};bc(Ng,{blur:()=>Tx,clearContent:()=>Ox,clearNodes:()=>_x,command:()=>Ax,createParagraphNear:()=>Vx,cut:()=>Ix,deleteCurrentNode:()=>Dx,deleteNode:()=>Rx,deleteRange:()=>Lx,deleteSelection:()=>zx,enter:()=>$x,exitCode:()=>Px,extendMarkRange:()=>jx,first:()=>Fx,focus:()=>Hx,forEach:()=>Wx,insertContent:()=>Kx,insertContentAt:()=>qx,joinBackward:()=>Jx,joinDown:()=>Gx,joinForward:()=>Yx,joinItemBackward:()=>Xx,joinItemForward:()=>Zx,joinTextblockBackward:()=>Qx,joinTextblockForward:()=>eC,joinUp:()=>Ux,keyboardShortcut:()=>tC,lift:()=>nC,liftEmptyBlock:()=>oC,liftListItem:()=>rC,newlineInCode:()=>sC,resetAttributes:()=>iC,scrollIntoView:()=>aC,selectAll:()=>lC,selectNodeBackward:()=>cC,selectNodeForward:()=>dC,selectParentNode:()=>uC,selectTextblockEnd:()=>pC,selectTextblockStart:()=>hC,setContent:()=>fC,setMark:()=>mC,setMeta:()=>gC,setNode:()=>vC,setNodeSelection:()=>yC,setTextSelection:()=>kC,sinkListItem:()=>bC,splitBlock:()=>wC,splitListItem:()=>xC,toggleList:()=>CC,toggleMark:()=>SC,toggleNode:()=>EC,toggleWrap:()=>MC,undoInputRule:()=>NC,unsetAllMarks:()=>BC,unsetMark:()=>TC,updateAttributes:()=>OC,wrapIn:()=>_C,wrapInList:()=>AC});var Tx=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),Ox=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),_x=()=>({state:t,tr:e,dispatch:n})=>{const{selection:o}=e,{ranges:s}=o;return!n||(s.forEach(({$from:i,$to:a})=>{t.doc.nodesBetween(i.pos,a.pos,(l,c)=>{if(l.type.isText)return;const{doc:d,mapping:u}=e,p=d.resolve(u.map(c)),h=d.resolve(u.map(c+l.nodeSize)),f=p.blockRange(h);if(!f)return;const m=Jo(f);if(l.type.isTextblock){const{defaultType:g}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(f.start,g)}(m||m===0)&&e.lift(f,m)})}),!0)},Ax=t=>e=>t(e),Vx=()=>({state:t,dispatch:e})=>cm(t,e),Ix=(t,e)=>({editor:n,tr:o})=>{const{state:s}=n,i=s.doc.slice(t.from,t.to);o.deleteRange(t.from,t.to);const a=o.mapping.map(e);return o.insert(a,i.content),o.setSelection(new ie(o.doc.resolve(Math.max(a-1,0)))),!0},Dx=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,o=n.$anchor.node();if(o.content.size>0)return!1;const s=t.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===o.type){if(e){const a=s.before(i),l=s.after(i);t.delete(a,l).scrollIntoView()}return!0}return!1};function Ke(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var Rx=t=>({tr:e,state:n,dispatch:o})=>{const s=Ke(t,n.schema),i=e.selection.$anchor;for(let a=i.depth;a>0;a-=1)if(i.node(a).type===s){if(o){const l=i.before(a),c=i.after(a);e.delete(l,c).scrollIntoView()}return!0}return!1},Lx=t=>({tr:e,dispatch:n})=>{const{from:o,to:s}=t;return n&&e.delete(o,s),!0},zx=()=>({state:t,dispatch:e})=>Hl(t,e),$x=()=>({commands:t})=>t.keyboardShortcut("Enter"),Px=()=>({state:t,dispatch:e})=>((n,o)=>{let{$head:s,$anchor:i}=n.selection;if(!s.parent.type.spec.code||!s.sameParent(i))return!1;let a=s.node(-1),l=s.indexAfter(-1),c=ql(a.contentMatchAt(l));if(!c||!a.canReplaceWith(l,l,c))return!1;if(o){let d=s.after(),u=n.tr.replaceWith(d,d,c.createAndFill());u.setSelection(pe.near(u.doc.resolve(d),1)),o(u.scrollIntoView())}return!0})(t,e);function wc(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function yi(t,e,n={strict:!0}){const o=Object.keys(e);return!o.length||o.every(s=>n.strict?e[s]===t[s]:wc(e[s])?e[s].test(t[s]):e[s]===t[s])}function Bg(t,e,n={}){return t.find(o=>o.type===e&&yi(Object.fromEntries(Object.keys(n).map(s=>[s,o.attrs[s]])),n))}function Tg(t,e,n={}){return!!Bg(t,e,n)}function xc(t,e,n){var o;if(!t||!e)return;let s=t.parent.childAfter(t.parentOffset);if(s.node&&s.node.marks.some(d=>d.type===e)||(s=t.parent.childBefore(t.parentOffset)),!s.node||!s.node.marks.some(d=>d.type===e)||(n=n||((o=s.node.marks[0])==null?void 0:o.attrs),!Bg([...s.node.marks],e,n)))return;let i=s.index,a=t.start()+s.offset,l=i+1,c=a+s.node.nodeSize;for(;i>0&&Tg([...t.parent.child(i-1).marks],e,n);)i-=1,a-=t.parent.child(i).nodeSize;for(;l<t.parent.childCount&&Tg([...t.parent.child(l).marks],e,n);)c+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function gn(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var jx=(t,e={})=>({tr:n,state:o,dispatch:s})=>{const i=gn(t,o.schema),{doc:a,selection:l}=n,{$from:c,from:d,to:u}=l;if(s){const p=xc(c,i,e);if(p&&p.from<=d&&p.to>=u){const h=ie.create(a,p.from,p.to);n.setSelection(h)}}return!0},Fx=t=>e=>{const n=typeof t=="function"?t(e):t;for(let o=0;o<n.length;o+=1)if(n[o](e))return!0;return!1};function Og(t){return t instanceof ie}function ko(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function _g(t,e=null){if(!e)return null;const n=pe.atStart(t),o=pe.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return o;const s=n.from,i=o.to;return e==="all"?ie.create(t,ko(0,s,i),ko(t.content.size,s,i)):ie.create(t,ko(e,s,i),ko(e,s,i))}function Cc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Hx=(t=null,e={})=>({editor:n,view:o,tr:s,dispatch:i})=>{e={scrollIntoView:!0,...e};const a=()=>{(Cc()||navigator.platform==="Android"||/android/i.test(navigator.userAgent))&&o.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(o.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(o.hasFocus()&&t===null||t===!1)return!0;if(i&&t===null&&!Og(n.state.selection))return a(),!0;const l=_g(s.doc,t)||n.state.selection,c=n.state.selection.eq(l);return i&&(c||s.setSelection(l),c&&s.storedMarks&&s.setStoredMarks(s.storedMarks),a()),!0},Wx=(t,e)=>n=>t.every((o,s)=>e(o,{...n,index:s})),Kx=(t,e)=>({tr:n,commands:o})=>o.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),Ag=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const o=e[n];o.nodeType===3&&o.nodeValue&&/^(\n\s\s|\n)$/.test(o.nodeValue)?t.removeChild(o):o.nodeType===1&&Ag(o)}return t};function ki(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return Ag(n)}function Xr(t,e,n){if(t instanceof jt||t instanceof $)return t;n={slice:!0,parseOptions:{},...n};const o=typeof t=="string";if(typeof t=="object"&&t!==null)try{if(Array.isArray(t)&&t.length>0)return $.fromArray(t.map(i=>e.nodeFromJSON(i)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),Xr("",e,n)}if(o){if(n.errorOnInvalidContent){let i=!1,a="";const l=new Nf({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(i=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Tn.fromSchema(l).parseSlice(ki(t),n.parseOptions):Tn.fromSchema(l).parse(ki(t),n.parseOptions),n.errorOnInvalidContent&&i)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=Tn.fromSchema(e);return n.slice?s.parseSlice(ki(t),n.parseOptions).content:s.parse(ki(t),n.parseOptions)}return Xr("",e,n)}var qx=(t,e,n)=>({tr:o,dispatch:s,editor:i})=>{var a;if(s){let l;const c=g=>{i.emit("contentError",{editor:i,error:g,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...(n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{Xr(e,i.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(g){c(g)}try{l=Xr(e,i.schema,{parseOptions:d,errorOnInvalidContent:(a=n.errorOnInvalidContent)!=null?a:i.options.enableContentCheck})}catch(g){return c(g),!1}let u,{from:p,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,m=!0;if(("type"in l?[l]:l).forEach(g=>{g.check(),f=!!f&&g.isText&&g.marks.length===0,m=!!m&&g.isBlock}),p===h&&m){const{parent:g}=o.doc.resolve(p);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(p-=1,h+=1)}if(f){if(Array.isArray(e))u=e.map(g=>g.text||"").join("");else if(e instanceof $){let g="";e.forEach(v=>{v.text&&(g+=v.text)}),u=g}else u=typeof e=="object"&&e&&e.text?e.text:e;o.insertText(u,p,h)}else{u=l;const g=o.doc.resolve(p),v=g.node(),k=g.parentOffset===0,y=v.isText||v.isTextblock,b=v.content.size>0;k&&y&&b&&(p=Math.max(0,p-1)),o.replaceWith(p,h,u)}n.updateSelection&&function(g,v){const k=g.steps.length-1;if(k<v)return;const y=g.steps[k];if(!(y instanceof Ge||y instanceof Je))return;const b=g.mapping.maps[k];let x=0;b.forEach((w,C,S,E)=>{x===0&&(x=E)}),g.setSelection(pe.near(g.doc.resolve(x),-1))}(o,o.steps.length-1),n.applyInputRules&&o.setMeta("applyInputRules",{from:p,text:u}),n.applyPasteRules&&o.setMeta("applyPasteRules",{from:p,text:u})}return!0},Ux=()=>({state:t,dispatch:e})=>((n,o)=>{let s,i=n.selection,a=i instanceof ne;if(a){if(i.node.isTextblock||!An(n.doc,i.from))return!1;s=i.from}else if(s=ri(n.doc,i.from,-1),s==null)return!1;if(o){let l=n.tr.join(s);a&&l.setSelection(ne.create(l.doc,s-n.doc.resolve(s).nodeBefore.nodeSize)),o(l.scrollIntoView())}return!0})(t,e),Gx=()=>({state:t,dispatch:e})=>((n,o)=>{let s,i=n.selection;if(i instanceof ne){if(i.node.isTextblock||!An(n.doc,i.to))return!1;s=i.to}else if(s=ri(n.doc,i.to,1),s==null)return!1;return o&&o(n.tr.join(s).scrollIntoView()),!0})(t,e),Jx=()=>({state:t,dispatch:e})=>nm(t,e),Yx=()=>({state:t,dispatch:e})=>im(t,e),Xx=()=>({state:t,dispatch:e,tr:n})=>{try{const o=ri(t.doc,t.selection.$from.pos,-1);return o!=null&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},Zx=()=>({state:t,dispatch:e,tr:n})=>{try{const o=ri(t.doc,t.selection.$from.pos,1);return o!=null&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},Qx=()=>({state:t,dispatch:e})=>((n,o)=>{let s=tm(n,void 0);if(!s)return!1;let i=Wl(s);return!!i&&om(n,i,o)})(t,e),eC=()=>({state:t,dispatch:e})=>((n,o)=>{let s=sm(n,void 0);if(!s)return!1;let i=Kl(s);return!!i&&om(n,i,o)})(t,e);function Vg(){return typeof navigator<"u"&&/Mac/.test(navigator.platform)}var tC=t=>({editor:e,view:n,tr:o,dispatch:s})=>{const i=function(d){const u=d.split(/-(?!$)/);let p,h,f,m,g=u[u.length-1];g==="Space"&&(g=" ");for(let v=0;v<u.length-1;v+=1){const k=u[v];if(/^(cmd|meta|m)$/i.test(k))m=!0;else if(/^a(lt)?$/i.test(k))p=!0;else if(/^(c|ctrl|control)$/i.test(k))h=!0;else if(/^s(hift)?$/i.test(k))f=!0;else{if(!/^mod$/i.test(k))throw new Error(`Unrecognized modifier name: ${k}`);Cc()||Vg()?m=!0:h=!0}}return p&&(g=`Alt-${g}`),h&&(g=`Ctrl-${g}`),m&&(g=`Meta-${g}`),f&&(g=`Shift-${g}`),g}(t).split(/-(?!$)/),a=i.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return c==null||c.steps.forEach(d=>{const u=d.map(o.mapping);u&&s&&o.maybeStep(u)}),!0};function Fn(t,e,n={}){const{from:o,to:s,empty:i}=t.selection,a=e?Ke(e,t.schema):null,l=[];t.doc.nodesBetween(o,s,(u,p)=>{if(u.isText)return;const h=Math.max(o,p),f=Math.min(s,p+u.nodeSize);l.push({node:u,from:h,to:f})});const c=s-o,d=l.filter(u=>!a||a.name===u.node.type.name).filter(u=>yi(u.node.attrs,n,{strict:!1}));return i?!!d.length:d.reduce((u,p)=>u+p.to-p.from,0)>=c}var nC=(t,e={})=>({state:n,dispatch:o})=>!!Fn(n,Ke(t,n.schema),e)&&((s,i)=>{let{$from:a,$to:l}=s.selection,c=a.blockRange(l),d=c&&Jo(c);return d!=null&&(i&&i(s.tr.lift(c,d).scrollIntoView()),!0)})(n,o),oC=()=>({state:t,dispatch:e})=>dm(t,e),rC=t=>({state:e,dispatch:n})=>{return(o=Ke(t,e.schema),function(s,i){let{$from:a,$to:l}=s.selection,c=a.blockRange(l,d=>d.childCount>0&&d.firstChild.type==o);return!!c&&(!i||(a.node(c.depth-1).type==o?function(d,u,p,h){let f=d.tr,m=h.end,g=h.$to.end(h.depth);m<g&&(f.step(new Je(m-1,g,m,g,new G($.from(p.create(null,h.parent.copy())),1,0),1,!0)),h=new ei(f.doc.resolve(h.$from.pos),f.doc.resolve(g),h.depth));const v=Jo(h);if(v==null)return!1;f.lift(h,v);let k=f.doc.resolve(f.mapping.map(m,-1)-1);return An(f.doc,k.pos)&&k.nodeBefore.type==k.nodeAfter.type&&f.join(k.pos),u(f.scrollIntoView()),!0}(s,i,o,c):function(d,u,p){let h=d.tr,f=p.parent;for(let C=p.end,S=p.endIndex-1,E=p.startIndex;S>E;S--)C-=f.child(S).nodeSize,h.delete(C-1,C+1);let m=h.doc.resolve(p.start),g=m.nodeAfter;if(h.mapping.map(p.end)!=p.start+m.nodeAfter.nodeSize)return!1;let v=p.startIndex==0,k=p.endIndex==f.childCount,y=m.node(-1),b=m.index(-1);if(!y.canReplace(b+(v?0:1),b+1,g.content.append(k?$.empty:$.from(f))))return!1;let x=m.pos,w=x+g.nodeSize;return h.step(new Je(x-(v?1:0),w+(k?1:0),x+1,w-1,new G((v?$.empty:$.from(f.copy($.empty))).append(k?$.empty:$.from(f.copy($.empty))),v?0:1,k?0:1),v?0:1)),u(h.scrollIntoView()),!0}(s,i,c)))})(e,n);var o},sC=()=>({state:t,dispatch:e})=>lm(t,e);function bi(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Ig(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((o,s)=>(n.includes(s)||(o[s]=t[s]),o),{})}var iC=(t,e)=>({tr:n,state:o,dispatch:s})=>{let i=null,a=null;const l=bi(typeof t=="string"?t:t.name,o.schema);return!!l&&(l==="node"&&(i=Ke(t,o.schema)),l==="mark"&&(a=gn(t,o.schema)),s&&n.selection.ranges.forEach(c=>{o.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,u)=>{i&&i===d.type&&n.setNodeMarkup(u,void 0,Ig(d.attrs,e)),a&&d.marks.length&&d.marks.forEach(p=>{a===p.type&&n.addMark(u,u+d.nodeSize,a.create(Ig(p.attrs,e)))})})}),!0)},aC=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),lC=()=>({tr:t,dispatch:e})=>{if(e){const n=new Nt(t.doc);t.setSelection(n)}return!0},cC=()=>({state:t,dispatch:e})=>rm(t,e),dC=()=>({state:t,dispatch:e})=>am(t,e),uC=()=>({state:t,dispatch:e})=>((n,o)=>{let s,{$from:i,to:a}=n.selection,l=i.sharedDepth(a);return l!=0&&(s=i.before(l),o&&o(n.tr.setSelection(ne.create(n.doc,s))),!0)})(t,e),pC=()=>({state:t,dispatch:e})=>Uw(t,e),hC=()=>({state:t,dispatch:e})=>qw(t,e);function Sc(t,e,n={},o={}){return Xr(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:o.errorOnInvalidContent})}var fC=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:o={}}={})=>({editor:s,tr:i,dispatch:a,commands:l})=>{const{doc:c}=i;if(o.preserveWhitespace!=="full"){const d=Sc(t,s.schema,o,{errorOnInvalidContent:e??s.options.enableContentCheck});return a&&i.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!n),!0}return a&&i.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:c.content.size},t,{parseOptions:o,errorOnInvalidContent:e??s.options.enableContentCheck})};function Dg(t,e){const n=gn(e,t.schema),{from:o,to:s,empty:i}=t.selection,a=[];i?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(o,s,c=>{a.push(...c.marks)});const l=a.find(c=>c.type.name===n.name);return l?{...l.attrs}:{}}function Rg(t,e){const n=new Gf(t);return e.forEach(o=>{o.steps.forEach(s=>{n.step(s)})}),n}function wi(t){return e=>function(n,o){for(let s=n.depth;s>0;s-=1){const i=n.node(s);if(o(i))return{pos:s>0?n.before(s):0,start:n.start(s),depth:s,node:i}}}(e.$from,t)}function te(t,e,n){return t.config[e]===void 0&&t.parent?te(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?te(t.parent,e,n):null}):t.config[e]}function Ec(t){return t.map(e=>{const n=te(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return n?[e,...Ec(n())]:e}).flat(10)}function Mc(t,e){const n=uo.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function Lg(t){return typeof t=="function"}function be(t,e=void 0,...n){return Lg(t)?e?t.bind(e)(...n):t(...n):t}function Zr(t){return{baseExtensions:t.filter(e=>e.type==="extension"),nodeExtensions:t.filter(e=>e.type==="node"),markExtensions:t.filter(e=>e.type==="mark")}}function zg(t){const e=[],{nodeExtensions:n,markExtensions:o}=Zr(t),s=[...n,...o],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(a=>{const l=te(a,"addGlobalAttributes",{name:a.name,options:a.options,storage:a.storage,extensions:s});l&&l().forEach(c=>{c.types.forEach(d=>{Object.entries(c.attributes).forEach(([u,p])=>{e.push({type:d,name:u,attribute:{...i,...p}})})})})}),s.forEach(a=>{const l={name:a.name,options:a.options,storage:a.storage},c=te(a,"addAttributes",l);if(!c)return;const d=c();Object.entries(d).forEach(([u,p])=>{const h={...i,...p};typeof(h==null?void 0:h.default)=="function"&&(h.default=h.default()),h!=null&&h.isRequired&&(h==null?void 0:h.default)===void 0&&delete h.default,e.push({type:a.name,name:u,attribute:h})})}),e}function Fe(...t){return t.filter(e=>!!e).reduce((e,n)=>{const o={...e};return Object.entries(n).forEach(([s,i])=>{if(o[s])if(s==="class"){const a=i?String(i).split(" "):[],l=o[s]?o[s].split(" "):[],c=a.filter(d=>!l.includes(d));o[s]=[...l,...c].join(" ")}else if(s==="style"){const a=i?i.split(";").map(d=>d.trim()).filter(Boolean):[],l=o[s]?o[s].split(";").map(d=>d.trim()).filter(Boolean):[],c=new Map;l.forEach(d=>{const[u,p]=d.split(":").map(h=>h.trim());c.set(u,p)}),a.forEach(d=>{const[u,p]=d.split(":").map(h=>h.trim());c.set(u,p)}),o[s]=Array.from(c.entries()).map(([d,u])=>`${d}: ${u}`).join("; ")}else o[s]=i;else o[s]=i}),o},{})}function xi(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,o)=>Fe(n,o),{})}function $g(t,e){return"style"in t?t:{...t,getAttrs:n=>{const o=t.getAttrs?t.getAttrs(n):t.attrs;if(o===!1)return!1;const s=e.reduce((i,a)=>{const l=a.attribute.parseHTML?a.attribute.parseHTML(n):function(c){return typeof c!="string"?c:c.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(c):c==="true"||c!=="false"&&c}(n.getAttribute(a.name));return l==null?i:{...i,[a.name]:l}},{});return{...o,...s}}}}function Pg(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>(e!=="attrs"||!function(o={}){return Object.keys(o).length===0&&o.constructor===Object}(n))&&n!=null))}function Nc(t){return t.sort((e,n)=>{const o=te(e,"priority")||100,s=te(n,"priority")||100;return o>s?-1:o<s?1:0})}function jg(t){const e=Nc(Ec(t)),n=function(o){const s=o.filter((i,a)=>o.indexOf(i)!==a);return Array.from(new Set(s))}(e.map(o=>o.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),e}function Fg(t,e,n){const{from:o,to:s}=e,{blockSeparator:i=`
|
|
46
|
-
|
|
47
|
-
`,textSerializers:a={}}=n||{};let l="";return t.nodesBetween(o,s,(c,d,u,p)=>{var h;c.isBlock&&d>o&&(l+=i);const f=a==null?void 0:a[c.type.name];if(f)return u&&(l+=f({node:c,pos:d,parent:u,index:p,range:e})),!1;c.isText&&(l+=(h=c==null?void 0:c.text)==null?void 0:h.slice(Math.max(o,d)-d,s-d))}),l}function Hg(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function Wg(t,e){const n=bi(typeof e=="string"?e:e.name,t.schema);return n==="node"?function(o,s){const i=Ke(s,o.schema),{from:a,to:l}=o.selection,c=[];o.doc.nodesBetween(a,l,u=>{c.push(u)});const d=c.reverse().find(u=>u.type.name===i.name);return d?{...d.attrs}:{}}(t,e):n==="mark"?Dg(t,e):{}}function Kg(t){const{mapping:e,steps:n}=t,o=[];return e.maps.forEach((s,i)=>{const a=[];if(s.ranges.length)s.forEach((l,c)=>{a.push({from:l,to:c})});else{const{from:l,to:c}=n[i];if(l===void 0||c===void 0)return;a.push({from:l,to:c})}a.forEach(({from:l,to:c})=>{const d=e.slice(i).map(l,-1),u=e.slice(i).map(c),p=e.invert().map(d,-1),h=e.invert().map(u);o.push({oldRange:{from:p,to:h},newRange:{from:d,to:u}})})}),function(s){const i=function(a,l=JSON.stringify){const c={};return a.filter(d=>{const u=l(d);return!Object.prototype.hasOwnProperty.call(c,u)&&(c[u]=!0)})}(s);return i.length===1?i:i.filter((a,l)=>!i.filter((d,u)=>u!==l).some(d=>a.oldRange.from>=d.oldRange.from&&a.oldRange.to<=d.oldRange.to&&a.newRange.from>=d.newRange.from&&a.newRange.to<=d.newRange.to))}(o)}function Bc(t,e,n){const o=[];return t===e?n.resolve(t).marks().forEach(s=>{const i=xc(n.resolve(t),s.type);i&&o.push({mark:s,...i})}):n.nodesBetween(t,e,(s,i)=>{s&&(s==null?void 0:s.nodeSize)!==void 0&&o.push(...s.marks.map(a=>({from:i,to:i+s.nodeSize,mark:a})))}),o}function Tc(t,e){return e.nodes[t]||e.marks[t]||null}function Ci(t,e,n){return Object.fromEntries(Object.entries(n).filter(([o])=>{const s=t.find(i=>i.type===e&&i.name===o);return!!s&&s.attribute.keepOnSplit}))}function Oc(t,e,n={}){const{empty:o,ranges:s}=t.selection,i=e?gn(e,t.schema):null;if(o)return!!(t.storedMarks||t.selection.$from.marks()).filter(u=>!i||i.name===u.type.name).find(u=>yi(u.attrs,n,{strict:!1}));let a=0;const l=[];if(s.forEach(({$from:u,$to:p})=>{const h=u.pos,f=p.pos;t.doc.nodesBetween(h,f,(m,g)=>{if(!m.isText&&!m.marks.length)return;const v=Math.max(h,g),k=Math.min(f,g+m.nodeSize);a+=k-v,l.push(...m.marks.map(y=>({mark:y,from:v,to:k})))})}),a===0)return!1;const c=l.filter(u=>!i||i.name===u.mark.type.name).filter(u=>yi(u.mark.attrs,n,{strict:!1})).reduce((u,p)=>u+p.to-p.from,0),d=l.filter(u=>!i||u.mark.type!==i&&u.mark.type.excludes(i)).reduce((u,p)=>u+p.to-p.from,0);return(c>0?c+d:c)>=a}function qg(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Ug(t,e){const{nodeExtensions:n}=Zr(e),o=n.find(i=>i.name===t);if(!o)return!1;const s=be(te(o,"group",{name:o.name,options:o.options,storage:o.storage}));return typeof s=="string"&&s.split(" ").includes("list")}function Si(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var o;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((o=t.text)!=null?o:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let s=!0;return t.content.forEach(i=>{s!==!1&&(Si(i,{ignoreWhitespace:n,checkChildren:e})||(s=!1))}),s}return!1}function Gg(t){return t instanceof ne}var mC=(t,e={})=>({tr:n,state:o,dispatch:s})=>{const{selection:i}=n,{empty:a,ranges:l}=i,c=gn(t,o.schema);if(s)if(a){const d=Dg(o,c);n.addStoredMark(c.create({...d,...e}))}else l.forEach(d=>{const u=d.$from.pos,p=d.$to.pos;o.doc.nodesBetween(u,p,(h,f)=>{const m=Math.max(f,u),g=Math.min(f+h.nodeSize,p);h.marks.find(v=>v.type===c)?h.marks.forEach(v=>{c===v.type&&n.addMark(m,g,c.create({...v.attrs,...e}))}):n.addMark(m,g,c.create(e))})});return function(d,u,p){var h;const{selection:f}=u;let m=null;if(Og(f)&&(m=f.$cursor),m){const v=(h=d.storedMarks)!=null?h:m.marks();return m.parent.type.allowsMarkType(p)&&(!!p.isInSet(v)||!v.some(k=>k.type.excludes(p)))}const{ranges:g}=f;return g.some(({$from:v,$to:k})=>{let y=v.depth===0&&d.doc.inlineContent&&d.doc.type.allowsMarkType(p);return d.doc.nodesBetween(v.pos,k.pos,(b,x,w)=>{if(y)return!1;if(b.isInline){const C=!w||w.type.allowsMarkType(p),S=!!p.isInSet(b.marks)||!b.marks.some(E=>E.type.excludes(p));y=C&&S}return!y}),y})}(o,n,c)},gC=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),vC=(t,e={})=>({state:n,dispatch:o,chain:s})=>{const i=Ke(t,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),i.isTextblock?s().command(({commands:l})=>!!hm(i,{...a,...e})(n)||l.clearNodes()).command(({state:l})=>hm(i,{...a,...e})(l,o)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},yC=t=>({tr:e,dispatch:n})=>{if(n){const{doc:o}=e,s=ko(t,0,o.content.size),i=ne.create(o,s);e.setSelection(i)}return!0},kC=t=>({tr:e,dispatch:n})=>{if(n){const{doc:o}=e,{from:s,to:i}=typeof t=="number"?{from:t,to:t}:t,a=ie.atStart(o).from,l=ie.atEnd(o).to,c=ko(s,a,l),d=ko(i,a,l),u=ie.create(o,c,d);e.setSelection(u)}return!0},bC=t=>({state:e,dispatch:n})=>{return(s=Ke(t,e.schema),function(i,a){let{$from:l,$to:c}=i.selection,d=l.blockRange(c,f=>f.childCount>0&&f.firstChild.type==s);if(!d)return!1;let u=d.startIndex;if(u==0)return!1;let p=d.parent,h=p.child(u-1);if(h.type!=s)return!1;if(a){let f=h.lastChild&&h.lastChild.type==p.type,m=$.from(f?s.create():null),g=new G($.from(s.create(null,$.from(p.type.create(null,m)))),f?3:1,0),v=d.start,k=d.end;a(i.tr.step(new Je(v-(f?3:1),k,v,k,g,1,!0)).scrollIntoView())}return!0})(e,n);var s};function Jg(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const o=n.filter(s=>e==null?void 0:e.includes(s.type.name));t.tr.ensureMarks(o)}}var wC=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:o,editor:s})=>{const{selection:i,doc:a}=e,{$from:l,$to:c}=i,d=Ci(s.extensionManager.attributes,l.node().type.name,l.node().attrs);if(i instanceof ne&&i.node.isBlock)return!(!l.parentOffset||!un(a,l.pos)||(o&&(t&&Jg(n,s.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),0));if(!l.parent.isBlock)return!1;const u=c.parentOffset===c.parent.content.size,p=l.depth===0?void 0:function(m){for(let g=0;g<m.edgeCount;g+=1){const{type:v}=m.edge(g);if(v.isTextblock&&!v.hasRequiredAttrs())return v}return null}(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=u&&p?[{type:p,attrs:d}]:void 0,f=un(e.doc,e.mapping.map(l.pos),1,h);if(h||f||!un(e.doc,e.mapping.map(l.pos),1,p?[{type:p}]:void 0)||(f=!0,h=p?[{type:p,attrs:d}]:void 0),o){if(f&&(i instanceof ie&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,h),p&&!u&&!l.parentOffset&&l.parent.type!==p)){const m=e.mapping.map(l.before()),g=e.doc.resolve(m);l.node(-1).canReplaceWith(g.index(),g.index()+1,p)&&e.setNodeMarkup(e.mapping.map(l.before()),p)}t&&Jg(n,s.extensionManager.splittableMarks),e.scrollIntoView()}return f},xC=(t,e={})=>({tr:n,state:o,dispatch:s,editor:i})=>{var a;const l=Ke(t,o.schema),{$from:c,$to:d}=o.selection,u=o.selection.node;if(u&&u.isBlock||c.depth<2||!c.sameParent(d))return!1;const p=c.node(-1);if(p.type!==l)return!1;const h=i.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(s){let k=$.empty;const y=c.index(-1)?1:c.index(-2)?2:3;for(let E=c.depth-y;E>=c.depth-3;E-=1)k=$.from(c.node(E).copy(k));const b=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,x={...Ci(h,c.node().type.name,c.node().attrs),...e},w=((a=l.contentMatch.defaultType)==null?void 0:a.createAndFill(x))||void 0;k=k.append($.from(l.createAndFill(null,w)||void 0));const C=c.before(c.depth-(y-1));n.replace(C,c.after(-b),new G(k,4-y,0));let S=-1;n.doc.nodesBetween(C,n.doc.content.size,(E,M)=>{if(S>-1)return!1;E.isTextblock&&E.content.size===0&&(S=M+1)}),S>-1&&n.setSelection(ie.near(n.doc.resolve(S))),n.scrollIntoView()}return!0}const f=d.pos===c.end()?p.contentMatchAt(0).defaultType:null,m={...Ci(h,p.type.name,p.attrs),...e},g={...Ci(h,c.node().type.name,c.node().attrs),...e};n.delete(c.pos,d.pos);const v=f?[{type:l,attrs:m},{type:f,attrs:g}]:[{type:l,attrs:m}];if(!un(n.doc,c.pos,2))return!1;if(s){const{selection:k,storedMarks:y}=o,{splittableMarks:b}=i.extensionManager,x=y||k.$to.parentOffset&&k.$from.marks();if(n.split(c.pos,2,v).scrollIntoView(),!x||!s)return!0;const w=x.filter(C=>b.includes(C.type.name));n.ensureMarks(w)}return!0},_c=(t,e)=>{const n=wi(i=>i.type===e)(t.selection);if(!n)return!0;const o=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(o===void 0)return!0;const s=t.doc.nodeAt(o);return n.node.type!==(s==null?void 0:s.type)||!An(t.doc,n.pos)||(t.join(n.pos),!0)},Ac=(t,e)=>{const n=wi(i=>i.type===e)(t.selection);if(!n)return!0;const o=t.doc.resolve(n.start).after(n.depth);if(o===void 0)return!0;const s=t.doc.nodeAt(o);return n.node.type!==(s==null?void 0:s.type)||!An(t.doc,o)||(t.join(o),!0)},CC=(t,e,n,o={})=>({editor:s,tr:i,state:a,dispatch:l,chain:c,commands:d,can:u})=>{const{extensions:p,splittableMarks:h}=s.extensionManager,f=Ke(t,a.schema),m=Ke(e,a.schema),{selection:g,storedMarks:v}=a,{$from:k,$to:y}=g,b=k.blockRange(y),x=v||g.$to.parentOffset&&g.$from.marks();if(!b)return!1;const w=wi(C=>Ug(C.type.name,p))(g);if(b.depth>=1&&w&&b.depth-w.depth<=1){if(w.node.type===f)return d.liftListItem(m);if(Ug(w.node.type.name,p)&&f.validContent(w.node.content)&&l)return c().command(()=>(i.setNodeMarkup(w.pos,f),!0)).command(()=>_c(i,f)).command(()=>Ac(i,f)).run()}return n&&x&&l?c().command(()=>{const C=u().wrapInList(f,o),S=x.filter(E=>h.includes(E.type.name));return i.ensureMarks(S),!!C||d.clearNodes()}).wrapInList(f,o).command(()=>_c(i,f)).command(()=>Ac(i,f)).run():c().command(()=>!!u().wrapInList(f,o)||d.clearNodes()).wrapInList(f,o).command(()=>_c(i,f)).command(()=>Ac(i,f)).run()},SC=(t,e={},n={})=>({state:o,commands:s})=>{const{extendEmptyMarkRange:i=!1}=n,a=gn(t,o.schema);return Oc(o,a,e)?s.unsetMark(a,{extendEmptyMarkRange:i}):s.setMark(a,e)},EC=(t,e,n={})=>({state:o,commands:s})=>{const i=Ke(t,o.schema),a=Ke(e,o.schema),l=Fn(o,i,n);let c;return o.selection.$anchor.sameParent(o.selection.$head)&&(c=o.selection.$anchor.parent.attrs),l?s.setNode(a,c):s.setNode(i,{...c,...n})},MC=(t,e={})=>({state:n,commands:o})=>{const s=Ke(t,n.schema);return Fn(n,s,e)?o.lift(s):o.wrapIn(s,e)},NC=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let o=0;o<n.length;o+=1){const s=n[o];let i;if(s.spec.isInputRules&&(i=s.getState(t))){if(e){const a=t.tr,l=i.transform;for(let c=l.steps.length-1;c>=0;c-=1)a.step(l.steps[c].invert(l.docs[c]));if(i.text){const c=a.doc.resolve(i.from).marks();a.replaceWith(i.from,i.to,t.schema.text(i.text,c))}else a.delete(i.from,i.to)}return!0}}return!1},BC=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:o,ranges:s}=n;return o||e&&s.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},TC=(t,e={})=>({tr:n,state:o,dispatch:s})=>{var i;const{extendEmptyMarkRange:a=!1}=e,{selection:l}=n,c=gn(t,o.schema),{$from:d,empty:u,ranges:p}=l;if(!s)return!0;if(u&&a){let{from:h,to:f}=l;const m=(i=d.marks().find(v=>v.type===c))==null?void 0:i.attrs,g=xc(d,c,m);g&&(h=g.from,f=g.to),n.removeMark(h,f,c)}else p.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,c)});return n.removeStoredMark(c),!0},OC=(t,e={})=>({tr:n,state:o,dispatch:s})=>{let i=null,a=null;const l=bi(typeof t=="string"?t:t.name,o.schema);return!!l&&(l==="node"&&(i=Ke(t,o.schema)),l==="mark"&&(a=gn(t,o.schema)),s&&n.selection.ranges.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;let p,h,f,m;n.selection.empty?o.doc.nodesBetween(d,u,(g,v)=>{i&&i===g.type&&(f=Math.max(v,d),m=Math.min(v+g.nodeSize,u),p=v,h=g)}):o.doc.nodesBetween(d,u,(g,v)=>{v<d&&i&&i===g.type&&(f=Math.max(v,d),m=Math.min(v+g.nodeSize,u),p=v,h=g),v>=d&&v<=u&&(i&&i===g.type&&n.setNodeMarkup(v,void 0,{...g.attrs,...e}),a&&g.marks.length&&g.marks.forEach(k=>{if(a===k.type){const y=Math.max(v,d),b=Math.min(v+g.nodeSize,u);n.addMark(y,b,a.create({...k.attrs,...e}))}}))}),h&&(p!==void 0&&n.setNodeMarkup(p,void 0,{...h.attrs,...e}),a&&h.marks.length&&h.marks.forEach(g=>{a===g.type&&n.addMark(f,m,a.create({...g.attrs,...e}))}))}),!0)},_C=(t,e={})=>({state:n,dispatch:o})=>function(s,i=null){return function(a,l){let{$from:c,$to:d}=a.selection,u=c.blockRange(d),p=u&&Rl(u,s,i);return!!p&&(l&&l(a.tr.wrap(u,p).scrollIntoView()),!0)}}(Ke(t,n.schema),e)(n,o),AC=(t,e={})=>({state:n,dispatch:o})=>function(s,i=null){return function(a,l){let{$from:c,$to:d}=a.selection,u=c.blockRange(d);if(!u)return!1;let p=l?a.tr:null;return!!function(h,f,m,g=null){let v=!1,k=f,y=f.$from.doc;if(f.depth>=2&&f.$from.node(f.depth-1).type.compatibleContent(m)&&f.startIndex==0){if(f.$from.index(f.depth-1)==0)return!1;let x=y.resolve(f.start-2);k=new ei(x,x,f.depth),f.endIndex<f.parent.childCount&&(f=new ei(f.$from,y.resolve(f.$to.end(f.depth)),f.depth)),v=!0}let b=Rl(k,m,g,f);return!!b&&(h&&function(x,w,C,S,E){let M=$.empty;for(let _=C.length-1;_>=0;_--)M=$.from(C[_].type.create(C[_].attrs,M));x.step(new Je(w.start-(S?2:0),w.end,w.start,w.end,new G(M,0,0),C.length,!0));let N=0;for(let _=0;_<C.length;_++)C[_].type==E&&(N=_+1);let T=C.length-N,R=w.start+C.length-(S?2:0),z=w.parent;for(let _=w.startIndex,I=w.endIndex,O=!0;_<I;_++,O=!1)!O&&un(x.doc,R,T)&&(x.split(R,T),R+=2*T),R+=z.child(_).nodeSize}(h,f,b,v,m),!0)}(p,u,s,i)&&(l&&l(p.scrollIntoView()),!0)}}(Ke(t,n.schema),e)(n,o),VC=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(o=>o.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(o=>o!==e):delete this.callbacks[t]),this}once(t,e){const n=(...o)=>{this.off(t,n),e.apply(this,o)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},Ei=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)==null||e}};function Mi(t){var e;const{editor:n,from:o,to:s,text:i,rules:a,plugin:l}=t,{view:c}=n;if(c.composing)return!1;const d=c.state.doc.resolve(o);if(d.parent.type.spec.code||(e=d.nodeBefore||d.nodeAfter)!=null&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const p=((h,f=500)=>{let m="";const g=h.parentOffset;return h.parent.nodesBetween(Math.max(0,g-f),g,(v,k,y,b)=>{var x,w;const C=((w=(x=v.type.spec).toText)==null?void 0:w.call(x,{node:v,pos:k,parent:y,index:b}))||v.textContent||"%leaf%";m+=v.isAtom&&!v.isText?C:C.slice(0,Math.max(0,g-k))}),m})(d)+i;return a.forEach(h=>{if(u)return;const f=((x,w)=>{if(wc(w))return w.exec(x);const C=w(x);if(!C)return null;const S=[C.text];return S.index=C.index,S.input=x,S.data=C.data,C.replaceWith&&(C.text.includes(C.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),S.push(C.replaceWith)),S})(p,h.find);if(!f)return;const m=c.state.tr,g=gi({state:c.state,transaction:m}),v={from:o-(f[0].length-i.length),to:s},{commands:k,chain:y,can:b}=new vi({editor:n,state:g});h.handler({state:g,range:v,match:f,commands:k,chain:y,can:b})!==null&&m.steps.length&&(h.undoable&&m.setMeta(l,{transform:m,from:o,to:s,text:i}),c.dispatch(m),u=!0)}),u}function Ni(t){return function(e){return Object.prototype.toString.call(e).slice(8,-1)}(t)==="Object"&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Yg(t,e){const n={...t};return Ni(t)&&Ni(e)&&Object.keys(e).forEach(o=>{Ni(e[o])&&Ni(t[o])?n[o]=Yg(t[o],e[o]):n[o]=e[o]}),n}var Vc=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...be(te(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...be(te(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>Yg(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},Hn=class iy extends Vc{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new iy(n)}static handleExit({editor:e,mark:n}){const{tr:o}=e.state,s=e.state.selection.$from;if(s.pos===s.end()){const i=s.marks();if(!!!i.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=i.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&o.removeStoredMark(l),o.insertText(" ",s.pos),e.view.dispatch(o),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},IC=class{constructor(t){this.find=t.find,this.handler=t.handler}},Bi=null,Ti=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=jg(t),this.schema=function(n,o){var s;const i=zg(n),{nodeExtensions:a,markExtensions:l}=Zr(n),c=(s=a.find(p=>te(p,"topNode")))==null?void 0:s.name,d=Object.fromEntries(a.map(p=>{const h=i.filter(y=>y.type===p.name),f={name:p.name,options:p.options,storage:p.storage,editor:o},m=Pg({...n.reduce((y,b)=>{const x=te(b,"extendNodeSchema",f);return{...y,...x?x(p):{}}},{}),content:be(te(p,"content",f)),marks:be(te(p,"marks",f)),group:be(te(p,"group",f)),inline:be(te(p,"inline",f)),atom:be(te(p,"atom",f)),selectable:be(te(p,"selectable",f)),draggable:be(te(p,"draggable",f)),code:be(te(p,"code",f)),whitespace:be(te(p,"whitespace",f)),linebreakReplacement:be(te(p,"linebreakReplacement",f)),defining:be(te(p,"defining",f)),isolating:be(te(p,"isolating",f)),attrs:Object.fromEntries(h.map(y=>{var b,x;return[y.name,{default:(b=y==null?void 0:y.attribute)==null?void 0:b.default,validate:(x=y==null?void 0:y.attribute)==null?void 0:x.validate}]}))}),g=be(te(p,"parseHTML",f));g&&(m.parseDOM=g.map(y=>$g(y,h)));const v=te(p,"renderHTML",f);v&&(m.toDOM=y=>v({node:y,HTMLAttributes:xi(y,h)}));const k=te(p,"renderText",f);return k&&(m.toText=k),[p.name,m]})),u=Object.fromEntries(l.map(p=>{const h=i.filter(k=>k.type===p.name),f={name:p.name,options:p.options,storage:p.storage,editor:o},m=Pg({...n.reduce((k,y)=>{const b=te(y,"extendMarkSchema",f);return{...k,...b?b(p):{}}},{}),inclusive:be(te(p,"inclusive",f)),excludes:be(te(p,"excludes",f)),group:be(te(p,"group",f)),spanning:be(te(p,"spanning",f)),code:be(te(p,"code",f)),attrs:Object.fromEntries(h.map(k=>{var y,b;return[k.name,{default:(y=k==null?void 0:k.attribute)==null?void 0:y.default,validate:(b=k==null?void 0:k.attribute)==null?void 0:b.validate}]}))}),g=be(te(p,"parseHTML",f));g&&(m.parseDOM=g.map(k=>$g(k,h)));const v=te(p,"renderHTML",f);return v&&(m.toDOM=k=>v({mark:k,HTMLAttributes:xi(k,h)})),[p.name,m]}));return new Nf({topNode:c,nodes:d,marks:u})}(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n=te(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Tc(e.name,this.schema)});return n?{...t,...n()}:t},{})}get plugins(){const{editor:t}=this;return Nc([...this.extensions].reverse()).flatMap(n=>{const o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Tc(n.name,this.schema)},s=[],i=te(n,"addKeyboardShortcuts",o);let a={};if(n.type==="mark"&&te(n,"exitable",o)&&(a.ArrowRight=()=>Hn.handleExit({editor:t,mark:n})),i){const p=Object.fromEntries(Object.entries(i()).map(([h,f])=>[h,()=>f({editor:t})]));a={...a,...p}}const l=new Le({props:{handleKeyDown:Mg(a)}});s.push(l);const c=te(n,"addInputRules",o);if(qg(n,t.options.enableInputRules)&&c){const p=c();if(p&&p.length){const h=function(m){const{editor:g,rules:v}=m,k=new Le({state:{init:()=>null,apply(y,b,x){const w=y.getMeta(k);if(w)return w;const C=y.getMeta("applyInputRules");return C&&setTimeout(()=>{let{text:S}=C;typeof S=="string"||(S=Mc($.from(S),x.schema));const{from:E}=C,M=E+S.length;Mi({editor:g,from:E,to:M,text:S,rules:v,plugin:k})}),y.selectionSet||y.docChanged?null:b}},props:{handleTextInput:(y,b,x,w)=>Mi({editor:g,from:b,to:x,text:w,rules:v,plugin:k}),handleDOMEvents:{compositionend:y=>(setTimeout(()=>{const{$cursor:b}=y.state.selection;b&&Mi({editor:g,from:b.pos,to:b.pos,text:"",rules:v,plugin:k})}),!1)},handleKeyDown(y,b){if(b.key!=="Enter")return!1;const{$cursor:x}=y.state.selection;return!!x&&Mi({editor:g,from:x.pos,to:x.pos,text:`
|
|
48
|
-
`,rules:v,plugin:k})}},isInputRules:!0});return k}({editor:t,rules:p}),f=Array.isArray(h)?h:[h];s.push(...f)}}const d=te(n,"addPasteRules",o);if(qg(n,t.options.enablePasteRules)&&d){const p=d();if(p&&p.length){const h=function(f){const{editor:m,rules:g}=f;let v,k=null,y=!1,b=!1,x=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null;try{v=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{v=null}const w=({state:C,from:S,to:E,rule:M,pasteEvt:N})=>{const T=C.tr,R=gi({state:C,transaction:T});if(function(z){const{editor:_,state:I,from:O,to:V,rule:P,pasteEvent:A,dropEvent:L}=z,{commands:j,chain:q,can:H}=new vi({editor:_,state:I}),U=[];return I.doc.nodesBetween(O,V,(Y,J)=>{var Q,oe,fe,le,me;if((oe=(Q=Y.type)==null?void 0:Q.spec)!=null&&oe.code||!(Y.isText||Y.isTextblock||Y.isInline))return;const Be=(me=(le=(fe=Y.content)==null?void 0:fe.size)!=null?le:Y.nodeSize)!=null?me:0,Z=Math.max(O,J),se=Math.min(V,J+Be);if(Z>=se)return;((re,Ce,nt)=>{if(wc(Ce))return[...re.matchAll(Ce)];const Oe=Ce(re,nt);return Oe?Oe.map(_e=>{const ue=[_e.text];return ue.index=_e.index,ue.input=re,ue.data=_e.data,_e.replaceWith&&(_e.text.includes(_e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),ue.push(_e.replaceWith)),ue}):[]})(Y.isText?Y.text||"":Y.textBetween(Z-J,se-J,void 0,""),P.find,A).forEach(re=>{if(re.index===void 0)return;const Ce=Z+re.index+1,nt=Ce+re[0].length,Oe={from:I.tr.mapping.map(Ce),to:I.tr.mapping.map(nt)},_e=P.handler({state:I,range:Oe,match:re,commands:j,chain:q,can:H,pasteEvent:A,dropEvent:L});U.push(_e)})}),U.every(Y=>Y!==null)}({editor:m,state:R,from:Math.max(S-1,0),to:E.b-1,rule:M,pasteEvent:N,dropEvent:v})&&T.steps.length){try{v=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{v=null}return x=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,T}};return g.map(C=>new Le({view(S){const E=N=>{var T;k=(T=S.dom.parentElement)!=null&&T.contains(N.target)?S.dom.parentElement:null,k&&(Bi=m)},M=()=>{Bi&&(Bi=null)};return window.addEventListener("dragstart",E),window.addEventListener("dragend",M),{destroy(){window.removeEventListener("dragstart",E),window.removeEventListener("dragend",M)}}},props:{handleDOMEvents:{drop:(S,E)=>{if(b=k===S.dom.parentElement,v=E,!b){const M=Bi;M!=null&&M.isEditable&&setTimeout(()=>{const N=M.state.selection;N&&M.commands.deleteRange({from:N.from,to:N.to})},10)}return!1},paste:(S,E)=>{var M;const N=(M=E.clipboardData)==null?void 0:M.getData("text/html");return x=E,y=!!(N!=null&&N.includes("data-pm-slice")),!1}}},appendTransaction:(S,E,M)=>{const N=S[0],T=N.getMeta("uiEvent")==="paste"&&!y,R=N.getMeta("uiEvent")==="drop"&&!b,z=N.getMeta("applyPasteRules"),_=!!z;if(!T&&!R&&!_)return;if(_){let{text:V}=z;typeof V=="string"||(V=Mc($.from(V),M.schema));const{from:P}=z,A=P+V.length,L=(j=>{var q;const H=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(q=H.clipboardData)==null||q.setData("text/html",j),H})(V);return w({rule:C,state:M,from:P,to:{b:A},pasteEvt:L})}const I=E.doc.content.findDiffStart(M.doc.content),O=E.doc.content.findDiffEnd(M.doc.content);return typeof I=="number"&&O&&I!==O.b?w({rule:C,state:M,from:I,to:O,pasteEvt:x}):void 0}}))}({editor:t,rules:p});s.push(...h)}}const u=te(n,"addProseMirrorPlugins",o);if(u){const p=u();s.push(...p)}return s})}get attributes(){return zg(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Zr(this.extensions);return Object.fromEntries(e.filter(n=>!!te(n,"addNodeView")).map(n=>{const o=this.attributes.filter(a=>a.type===n.name),s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Ke(n.name,this.schema)},i=te(n,"addNodeView",s);return i?[n.name,(a,l,c,d,u)=>{const p=xi(a,o);return i()({node:a,view:l,getPos:c,decorations:d,innerDecorations:u,editor:t,extension:n,HTMLAttributes:p})}]:[]}))}get markViews(){const{editor:t}=this,{markExtensions:e}=Zr(this.extensions);return Object.fromEntries(e.filter(n=>!!te(n,"addMarkView")).map(n=>{const o=this.attributes.filter(a=>a.type===n.name),s={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:gn(n.name,this.schema)},i=te(n,"addMarkView",s);return i?[n.name,(a,l,c)=>{const d=xi(a,o);return i()({mark:a,view:l,inline:c,editor:t,extension:n,HTMLAttributes:d,updateAttributes:u=>{(function(p,h,f={}){const{state:m}=h,{doc:g,tr:v}=m,k=p;g.descendants((y,b)=>{const x=v.mapping.map(b),w=v.mapping.map(b)+y.nodeSize;let C=null;if(y.marks.forEach(E=>{if(E!==k)return!1;C=E}),!C)return;let S=!1;if(Object.keys(f).forEach(E=>{f[E]!==C.attrs[E]&&(S=!0)}),S){const E=p.type.create({...p.attrs,...f});v.removeMark(x,w,p.type),v.addMark(x,w,E)}}),v.docChanged&&h.view.dispatch(v)})(a,t,u)}})}]:[]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const o={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Tc(e.name,this.schema)};e.type==="mark"&&((n=be(te(e,"keepOnSplit",o)))==null||n)&&this.splittableMarks.push(e.name);const s=te(e,"onBeforeCreate",o),i=te(e,"onCreate",o),a=te(e,"onUpdate",o),l=te(e,"onSelectionUpdate",o),c=te(e,"onTransaction",o),d=te(e,"onFocus",o),u=te(e,"onBlur",o),p=te(e,"onDestroy",o);s&&this.editor.on("beforeCreate",s),i&&this.editor.on("create",i),a&&this.editor.on("update",a),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),u&&this.editor.on("blur",u),p&&this.editor.on("destroy",p)})}};Ti.resolve=jg,Ti.sort=Nc,Ti.flatten=Ec,bc({},{ClipboardTextSerializer:()=>Xg,Commands:()=>Zg,Delete:()=>Qg,Drop:()=>ev,Editable:()=>tv,FocusEvents:()=>ov,Keymap:()=>rv,Paste:()=>sv,Tabindex:()=>iv,focusEventsPluginKey:()=>nv});var qe=class ay extends Vc{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new ay(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},Xg=qe.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new Le({key:new Ye("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:o,selection:s}=e,{ranges:i}=s,a=Math.min(...i.map(d=>d.$from.pos)),l=Math.max(...i.map(d=>d.$to.pos)),c=Hg(n);return Fg(o,{from:a,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),Zg=qe.create({name:"commands",addCommands:()=>({...Ng})}),Qg=qe.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,o,s;const i=()=>{var a,l,c,d;if((d=(c=(l=(a=this.editor.options.coreExtensionOptions)==null?void 0:a.delete)==null?void 0:l.filterTransaction)==null?void 0:c.call(l,t))!=null?d:t.getMeta("y-sync$"))return;const u=Rg(t.before,[t,...e]);Kg(u).forEach(h=>{u.mapping.mapResult(h.oldRange.from).deletedAfter&&u.mapping.mapResult(h.oldRange.to).deletedBefore&&u.before.nodesBetween(h.oldRange.from,h.oldRange.to,(f,m)=>{const g=m+f.nodeSize-2,v=h.oldRange.from<=m&&g<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:f,from:m,to:g,newFrom:u.mapping.map(m),newTo:u.mapping.map(g),deletedRange:h.oldRange,newRange:h.newRange,partial:!v,editor:this.editor,transaction:t,combinedTransform:u})})});const p=u.mapping;u.steps.forEach((h,f)=>{var m,g;if(h instanceof Ft){const v=p.slice(f).map(h.from,-1),k=p.slice(f).map(h.to),y=p.invert().map(v,-1),b=p.invert().map(k),x=(m=u.doc.nodeAt(v-1))==null?void 0:m.marks.some(C=>C.eq(h.mark)),w=(g=u.doc.nodeAt(k))==null?void 0:g.marks.some(C=>C.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:y,to:b},newRange:{from:v,to:k},partial:!!(w||x),editor:this.editor,transaction:t,combinedTransform:u})}})};(s=(o=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:o.async)==null||s?setTimeout(i,0):i()}}),ev=qe.create({name:"drop",addProseMirrorPlugins(){return[new Le({key:new Ye("tiptapDrop"),props:{handleDrop:(t,e,n,o)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:o})}}})]}}),tv=qe.create({name:"editable",addProseMirrorPlugins(){return[new Le({key:new Ye("editable"),props:{editable:()=>this.editor.options.editable}})]}}),nv=new Ye("focusEvents"),ov=qe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Le({key:nv,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const o=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(o),!1},blur:(e,n)=>{t.isFocused=!1;const o=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(o),!1}}}})]}}),rv=qe.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:i})=>[()=>i.undoInputRule(),()=>i.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:d,$anchor:u}=l,{pos:p,parent:h}=u,f=u.parent.isTextblock&&p>0?a.doc.resolve(p-1):u,m=f.parent.type.spec.isolating,g=u.pos-u.parentOffset,v=m&&f.parent.childCount===1?g===u.pos:pe.atStart(c).from===p;return!(!d||!h.type.isTextblock||h.textContent.length||!v||v&&u.parent.type.name==="paragraph")&&i.clearNodes()}),()=>i.deleteSelection(),()=>i.joinBackward(),()=>i.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.deleteCurrentNode(),()=>i.joinForward(),()=>i.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...n},s={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Cc()||Vg()?s:o},addProseMirrorPlugins(){return[new Le({key:new Ye("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(f=>f.getMeta("composition")))return;const o=t.some(f=>f.docChanged)&&!e.doc.eq(n.doc),s=t.some(f=>f.getMeta("preventClearDocument"));if(!o||s)return;const{empty:i,from:a,to:l}=e.selection,c=pe.atStart(e.doc).from,d=pe.atEnd(e.doc).to;if(i||a!==c||l!==d||!Si(n.doc))return;const u=n.tr,p=gi({state:n,transaction:u}),{commands:h}=new vi({editor:this.editor,state:p});return h.clearNodes(),u.steps.length?u:void 0}})]}}),sv=qe.create({name:"paste",addProseMirrorPlugins(){return[new Le({key:new Ye("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),iv=qe.create({name:"tabindex",addProseMirrorPlugins(){return[new Le({key:new Ye("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),DC=class dr{constructor(e,n,o=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=o,this.resolvedPos=e,this.editor=n,this.currentNode=s}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,o=this.to;if(this.isBlock){if(this.content.size===0)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);n=this.from+1,o=this.to-1}this.editor.commands.insertContentAt({from:n,to:o},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new dr(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new dr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new dr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,o)=>{const s=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,a=this.pos+o+(i?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(a);if(!s&&l.depth<=this.depth)return;const c=new dr(l,this.editor,s,s?n:null);s&&(c.actualDepth=this.depth+1),e.push(new dr(l,this.editor,s,s?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let o=null,s=this.parent;for(;s&&!o;){if(s.node.type.name===e)if(Object.keys(n).length>0){const i=s.node.attrs,a=Object.keys(n);for(let l=0;l<a.length;l+=1){const c=a[l];if(i[c]!==n[c])break}}else o=s;s=s.parent}return o}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},o=!1){let s=[];if(!this.children||this.children.length===0)return s;const i=Object.keys(n);return this.children.forEach(a=>{o&&s.length>0||(a.node.type.name===e&&i.every(l=>n[l]===a.node.attrs[l])&&s.push(a),o&&s.length>0||(s=s.concat(a.querySelectorAll(e,n,o))))}),s}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},RC=class extends VC{constructor(t={}){super(),this.css=null,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:o})=>{throw o},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:o,slice:s,moved:i})=>this.options.onDrop(o,s,i)),this.on("paste",({event:o,slice:s})=>this.options.onPaste(o,s)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=_g(e,this.options.autofocus);this.editorState=Zo.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=function(t,e){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=`.ProseMirror {
|
|
36
|
+
`,document.head.appendChild(t)})();const yh=Z(vh),bh="mc-copy",Jk={class:"mc-copy"},Gk={class:"mc-copy-text"},kh=Z(U(r.defineComponent({name:bh,__name:"mc-copy",props:{text:{},showToast:{type:Boolean,default:!1},toastSuccessText:{default:"copy succeed"},toastErrorText:{default:"copy failed"},manual:{type:Boolean,default:!1}},emits:["copy","success","error"],setup(t,{emit:e}){const n=t,o=e,i=async()=>{if(n.text)if(n.manual)o("copy",n.text);else try{await navigator.clipboard.writeText(n.text),o("success",n.text),n.showToast&&Ki.success(n.toastSuccessText)}catch(s){console.error(s),o("error",n.text,s),n.showToast&&Ki.error(n.toastErrorText)}};return(s,a)=>(r.openBlock(),r.createElementBlock("div",Jk,[r.renderSlot(s.$slots,"default",{},()=>[r.createElementVNode("span",Gk,r.toDisplayString(t.text),1)],!0),r.createVNode(r.unref(de),{name:"Duplicate",class:"mc-copy-icon",onClick:i})]))}}),[["__scopeId","data-v-93e0e595"]])),wh="mc-count",Yk={key:0,class:"mc-count-number"},xh=Z(U(r.defineComponent({name:wh,__name:"mc-count",props:{value:{},theme:{default:"red"},type:{default:"medium"},hiddenZero:{type:Boolean,default:!0},max:{default:99}},emits:["change"],setup(t,{emit:e}){const n=t,o=e,i=r.computed(()=>{const c=Number(n.value);return isNaN(c)?(console.warn("mc-count: value is not a number"),0):c}),s=r.computed(()=>!n.hiddenZero||i.value>0),a=r.computed(()=>n.max&&i.value>n.max?`${n.max}+`:`${i.value}`),l=r.computed(()=>n.type==="tiny");return r.watch(()=>n.value,(c,d)=>{c!==d&&o("change",c)}),(c,d)=>s.value?(r.openBlock(),r.createElementBlock("i",{key:0,class:r.normalizeClass(["mc-count",[`mc-count-${t.theme}`,`mc-count-${t.type}`]])},[l.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Yk,r.toDisplayString(a.value),1))],2)):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-58404c8a"]])),Ch="mc-currency-icon",Xk={class:"mc-currency-icon-img-wrapper"},Zk=["src","alt"],Qk={class:"mc-currency-icon-label"},e1={class:"mc-currency-icon-text"},t1=r.defineComponent({name:Ch,__name:"mc-currency-icon",props:{currency:{},direction:{default:"horizontal"},desc:{},cdnUrl:{},suffix:{default:"svg"},height:{},width:{}},setup(t){const e=t,{generateFileUrl:n}=(o=e.cdnUrl,i=e.suffix,{generateFileUrl:l=>{if(o&&i&&l)return`${o}/${l}.${i}`}});var o,i;const{width:s,height:a}=$t();return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-currency-icon",style:r.normalizeStyle({width:r.unref(s),height:r.unref(a)})},[r.createElementVNode("div",Xk,[r.renderSlot(l.$slots,"icon",{},()=>[r.createElementVNode("img",{src:r.unref(n)(t.currency),class:"mc-currency-icon-img",alt:`${t.currency}-icon`},null,8,Zk)],!0)]),r.createElementVNode("div",{class:r.normalizeClass(["mc-currency-icon-content",[`mc-currency-icon-content-${t.direction}`]])},[r.createElementVNode("div",Qk,[r.renderSlot(l.$slots,"default",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.currency),1)],!0)]),r.createElementVNode("div",e1,[r.renderSlot(l.$slots,"desc",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.desc),1)],!0)])],2)],4))}}),Sh=Z(U(t1,[["__scopeId","data-v-56ce704b"]])),Eh="mc-divider",gl=Z(U(r.defineComponent({name:Eh,__name:"mc-divider",props:{size:{default:"small"},emphasis:{default:"minimal"},orientation:{default:"horizontal"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-divider",[`mc-divider-${t.orientation}`,`mc-divider-${t.size}`,`mc-divider-${t.emphasis}`]])},null,2))}),[["__scopeId","data-v-7527b8b5"]])),Mh="mc-overlay",n1={key:0},o1=r.defineComponent({name:Mh,__name:"mc-overlay",props:{visible:{type:Boolean},fixed:{type:Boolean,default:!0},portCssSelector:{default:"body"}},emits:["click"],setup(t,{expose:e,emit:n}){const o=t,i=n;r.onBeforeMount(()=>{const a=document.querySelector(o.portCssSelector);a&&window.getComputedStyle(a).position==="static"&&(a.style.position="relative")});const s=r.ref();return e({ref:s}),(a,l)=>t.visible?(r.openBlock(),r.createElementBlock("div",n1,[(r.openBlock(),r.createBlock(r.Teleport,{to:t.portCssSelector},[r.createElementVNode("div",{ref_key:"_ref",ref:s,class:"mc-overlay",onClick:l[0]||(l[0]=c=>(d=>{d.target===s.value&&i("click")})(c)),style:r.normalizeStyle({position:t.fixed?"fixed":"absolute"})},[r.renderSlot(a.$slots,"default",{},void 0,!0)],4)],8,["to"]))])):r.createCommentVNode("",!0)}}),Ui=Z(U(o1,[["__scopeId","data-v-7e34ebbc"]])),Nh="mc-reset",vl=Z(U(r.defineComponent({name:Nh,__name:"mc-reset",props:{rotate:{type:Boolean,default:!1},autoRotate:{type:Boolean,default:!0},duration:{default:300}},emits:["reset"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(!1),s=r.computed(()=>n.autoRotate?i.value:n.rotate),a=async()=>{o("reset"),n.autoRotate&&(i.value=!0,await Ja(n.duration),i.value=!1)};return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-reset",onClick:a},[r.createVNode(r.unref(de),{name:"Refresh",size:24,class:r.normalizeClass(["mc-reset-icon",{"mc-reset-rotate":s.value}])},null,8,["class"]),r.createElementVNode("span",null,[r.renderSlot(l.$slots,"default",{},()=>[c[0]||(c[0]=r.createTextVNode("Reset",-1))],!0)])]))}}),[["__scopeId","data-v-7877623f"]])),Bh="mc-title-toolbar",r1={key:0,class:"mc-title-toolbar-reset"},i1={key:1,class:"mc-title-toolbar-line"},s1={key:2,class:"mc-title-toolbar-mandatory"},yl=Z(U(r.defineComponent({name:Bh,__name:"mc-title-tool-bar",props:{showReset:{type:Boolean,default:!0},showMandatory:{type:Boolean,default:!0}},emits:["reset"],setup(t,{expose:e,emit:n}){const o=r.ref(),i=n,s=r.ref(!1);let a;const l=Lo(()=>{clearTimeout(a),s.value=!0,a=setTimeout(()=>{s.value=!1},300),i("reset")},300);return e({ref:o}),(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-title-toolbar",ref_key:"_ref",ref:o},[t.showReset?(r.openBlock(),r.createElementBlock("div",r1,[r.createVNode(r.unref(vl),{rotate:s.value,onReset:r.unref(l),"auto-rotate":!1},{default:r.withCtx(()=>[r.renderSlot(c.$slots,"reset",{},void 0,!0)]),_:3},8,["rotate","onReset"])])):r.createCommentVNode("",!0),t.showReset&&t.showMandatory?(r.openBlock(),r.createElementBlock("div",i1)):r.createCommentVNode("",!0),t.showMandatory?(r.openBlock(),r.createElementBlock("div",s1,[r.renderSlot(c.$slots,"mandatory",{},()=>[d[0]||(d[0]=r.createTextVNode("Mandatory",-1))],!0)])):r.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-ec7f65e7"]])),Th="mc-title",a1={class:"mc-title-content"},l1={class:"mc-title-text"},c1={class:"mc-title-tool-bar"},Ar=Z(U(r.defineComponent({name:Th,__name:"mc-title",props:{width:{default:"100%"},height:{default:"auto"},title:{},showToolBar:{type:Boolean,default:!0},showBorder:{type:Boolean,default:!1},showReset:{type:Boolean,default:!0},showMandatory:{type:Boolean,default:!0}},emits:["reset"],setup(t,{expose:e,emit:n}){const o=n,i=r.ref();return e({ref:i}),(s,a)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-title",{"mc-title-border":t.showBorder}]),ref_key:"_ref",ref:i,style:r.normalizeStyle({width:t.width,height:t.height})},[r.createElementVNode("div",a1,[r.renderSlot(s.$slots,"default",{},()=>[r.createElementVNode("h1",l1,r.toDisplayString(t.title),1)],!0)]),r.createElementVNode("div",c1,[r.renderSlot(s.$slots,"tool-bar",{},()=>[t.showToolBar?(r.openBlock(),r.createBlock(r.unref(yl),{key:0,"show-reset":t.showReset,"show-mandatory":t.showMandatory,onReset:a[0]||(a[0]=l=>o("reset"))},{reset:r.withCtx(()=>[r.renderSlot(s.$slots,"reset",{},void 0,!0)]),mandatory:r.withCtx(()=>[r.renderSlot(s.$slots,"mandatory",{},void 0,!0)]),_:3},8,["show-reset","show-mandatory"])):r.createCommentVNode("",!0)],!0)])],6))}}),[["__scopeId","data-v-c7fdb5b7"]])),Oh="mc-modal-header",d1={class:"mc-modal-header"},qi=Z(U(r.defineComponent({name:Oh,__name:"mc-modal-header",props:{title:{},showBorder:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0}},emits:["close"],setup(t,{emit:e}){const n=e;return(o,i)=>(r.openBlock(),r.createElementBlock("div",d1,[r.createVNode(r.unref(Ar),{title:t.title,"show-border":t.showBorder,height:"100%",class:"mc-modal-header-title"},{"tool-bar":r.withCtx(()=>[r.createVNode(r.unref(de),{name:"Cross",size:24,class:"mc-modal-header-close-icon",onClick:i[0]||(i[0]=s=>n("close"))})]),default:r.withCtx(()=>[r.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3},8,["title","show-border"])]))}}),[["__scopeId","data-v-482de3aa"]])),_h="mc-footer",u1={key:0,class:"mc-footer-content"},p1={class:"mc-footer-bottom"},h1={class:"mc-footer-bottom-content"},f1={class:"mc-footer-left"},m1={class:"mc-footer-right"},g1={class:"mc-footer-right-button-group"},qo=Z(U(r.defineComponent({name:_h,__name:"mc-footer",props:{width:{},height:{},wrapperWidth:{},showborder:{type:Boolean,default:!0}},setup(t,{expose:e}){const n=r.ref();return e({ref:n}),(o,i)=>(r.openBlock(),r.createElementBlock("section",{class:r.normalizeClass(["mc-footer",{"mc-footer-border":t.showborder}]),style:r.normalizeStyle({width:t.width,height:t.height}),ref_key:"_ref",ref:n},[o.$slots.desc?(r.openBlock(),r.createElementBlock("div",u1,[r.createElementVNode("div",{class:"mc-footer-wrapper",style:r.normalizeStyle({width:t.wrapperWidth})},[r.renderSlot(o.$slots,"desc",{},void 0,!0)],4)])):r.createCommentVNode("",!0),r.createElementVNode("div",p1,[r.createElementVNode("div",{class:"mc-footer-wrapper",style:r.normalizeStyle({width:t.wrapperWidth})},[r.createElementVNode("div",h1,[r.createElementVNode("div",f1,[r.renderSlot(o.$slots,"left",{},void 0,!0)]),r.createElementVNode("div",m1,[r.renderSlot(o.$slots,"right",{},()=>[r.createElementVNode("div",g1,[r.renderSlot(o.$slots,"right-button-group",{},void 0,!0)])],!0)])])],4)])],6))}}),[["__scopeId","data-v-4553dea7"]])),Ah=(t=300)=>{const e=r.ref(!1),n=r.ref(!1),o=()=>{e.value=!0},i=()=>{e.value=!1},s=()=>{n.value=!0},a=()=>{n.value=!1};let l=null;const c=()=>{l&&clearTimeout(l)};return r.onUnmounted(()=>{c()}),{isOverlayShow:e,isContentShow:n,setOverlayShow:o,setOverlayHide:i,setContentShow:s,setContentHide:a,openOverlay:()=>{c(),o(),l=setTimeout(()=>{s()},t)},closeOverlay:()=>{c(),a(),l=setTimeout(()=>{i()},t)}}},Vh="mc-drawer",v1={key:0,class:"mc-drawer-container"},y1={class:"mc-drawer-header"},b1={class:"mc-drawer-content-wrapper"},k1={class:"mc-drawer-content"},w1={key:0,class:"mc-drawer-footer"},x1=r.defineComponent({name:Vh,__name:"mc-drawer",props:{modelValue:{type:Boolean},title:{},size:{default:"medium"},maskClosable:{type:Boolean,default:!0},fixed:{type:Boolean,default:!0},portCssSelector:{default:"body"},showBorder:{type:Boolean,default:!0},hideFooter:{type:Boolean,default:!1},position:{default:"right"}},emits:["update:modelValue","close"],setup(t,{expose:e,emit:n}){const o=t,i=r.ref(!1),{isOverlayShow:s,isContentShow:a,openOverlay:l,closeOverlay:c}=Ah(),d=()=>{i.value=!0,l()},u=()=>{c()},p=()=>{i.value=!1,h("close"),h("update:modelValue",!1)};r.watch(()=>o.modelValue,(v,b)=>{!b&&v?d():u()});const h=n,f=()=>{o.maskClosable&&u()},m=()=>{u()},g=r.ref();return e({ref:g,open:d,close:u}),(v,b)=>i.value?(r.openBlock(),r.createElementBlock("div",v1,[r.createVNode(r.Transition,{name:"mc-drawer-overlay",onAfterLeave:p},{default:r.withCtx(()=>[r.createVNode(r.unref(Ui),{visible:r.unref(s),fixed:t.fixed,"port-css-selector":t.portCssSelector,onClick:f},{default:r.withCtx(()=>[r.createVNode(r.Transition,{name:`mc-drawer-content-${t.position}`},{default:r.withCtx(()=>[r.unref(a)?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-drawer",[`mc-drawer-${t.size}`,`mc-drawer-${t.position}`]]),ref_key:"_ref",ref:g},[r.createElementVNode("div",y1,[r.renderSlot(v.$slots,"header",{},()=>[r.createVNode(r.unref(qi),{title:t.title,"show-border":t.showBorder,onClose:m},{default:r.withCtx(()=>[r.renderSlot(v.$slots,"header-title",{},void 0,!0)]),_:3},8,["title","show-border"])],!0)]),r.createElementVNode("div",b1,[r.createElementVNode("div",k1,[r.renderSlot(v.$slots,"default",{},void 0,!0)])]),t.hideFooter?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",w1,[r.renderSlot(v.$slots,"footer",{},()=>[r.createVNode(r.unref(qo),null,{left:r.withCtx(()=>[r.renderSlot(v.$slots,"footer-left",{},void 0,!0)]),right:r.withCtx(()=>[r.renderSlot(v.$slots,"footer-right",{},void 0,!0)]),"right-button-group":r.withCtx(()=>[r.renderSlot(v.$slots,"footer-right-button-group",{},void 0,!0)]),desc:r.withCtx(()=>[r.renderSlot(v.$slots,"footer-desc",{},void 0,!0)]),_:3})],!0)]))],2)):r.createCommentVNode("",!0)]),_:3},8,["name"])]),_:3},8,["visible","fixed","port-css-selector"])]),_:3})])):r.createCommentVNode("",!0)}}),Ih=Z(U(x1,[["__scopeId","data-v-e0751c5a"]])),Vr=Symbol("mc-input-group-context"),Dh="mc-input-group",Rh=t=>{const e=r.inject(Vr,void 0);if(!e)return;const n=r.computed(()=>e.disabled.value),o=be("inputGroupPosition");if(!o||!o.value)return;const{validateStatus:i,isExpanded:s,isFocused:a,isHovering:l}=t;return i&&r.watch(i,c=>{e.setInputGroupValidate(c)}),s&&r.watch(s,c=>{e.setInputGroupExpanded(c)}),r.watch([a,l],([c,d])=>{c||d?e.setInputGroupActived(!0,o.value):e.setInputGroupActived(!1,o.value)}),{inputGroupDisabled:n}},Lh="mc-input",C1={key:0,class:"mc-input__prefix"},S1=["id","type","disabled","readonly","autocomplete","placeholder","autofocus","maxlength"],E1={key:2,class:"mc-input__password"},M1={key:0,class:"mc-input__suffix"},N1={key:4,class:"mc-input-append"},B1={class:"mc-input-append-text"},T1=r.defineComponent({name:Lh,__name:"mc-input",props:{modelValue:{},width:{},height:{},id:{},type:{default:"text"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},placeholder:{default:"Please enter"},readonly:{type:Boolean,default:!1},autocomplete:{default:"off"},autofocus:{type:Boolean,default:!1},prefixIcon:{},suffixIcon:{},maxlength:{},currencyAccuracy:{},inputGroupPosition:{},disableValidation:{type:Boolean,default:!1},hideValidationIcon:{type:Boolean,default:!1},textAlign:{default:"left"},validateProp:{},formatter:{},parser:{}},emits:["update:modelValue","input","change","focus","blur","paste","clear","delete"],setup(t,{expose:e,emit:n}){const o=t,{formatter:i,parser:s}=o,a=n,l=r.ref(),c=r.computed(()=>Ee(o.modelValue)?"":Ut(o.modelValue)),d=O=>(o.type==="number"?O=(V=>V.replace(/[^\d]/g,""))(O):o.type==="currency"&&(O=((V,P=8)=>{V=V.replace(/(?:[^0-9.]+)/g,"");const[A,...L]=V.split(".");if(L.length){const j=L.join("");return P===0?A:`${A}.${j.substring(0,P)}`}return A})(O,o.currencyAccuracy)),Ve(s)&&(O=s(O)),O),u=()=>{const O=l.value,V=(P=c.value,o.type==="number"?P=(A=>A.replace(/[^\d]/g,""))(P):o.type==="currency"&&(P=(A=>{A=A.toString();const[L,j]=A.toString().split("."),K=L.replace(/(\d)(?=(\d{3})+$)/g,"$1,");return gt(A,".")?`${K}.${j}`:K})(P)),Ve(i)&&(P=i(P)),P);var P;O&&O.value!==V&&(O.value=V)};r.onMounted(()=>{u()});const p=r.ref(!1),h=r.computed(()=>o.type==="password"),{formId:f,formDisabled:m,validateStatus:g,validateStyle:v,statusIcon:b,validateByTrigger:y}=ln({externalDisabled:r.computed(()=>!!(E!=null&&E.inputGroupDisabled.value))}),{wrapperRef:k,isFocused:x,handleFocus:w,handleBlur:S}=zo(l,{afterBlur(){y("blur")}}),{isHovering:C}=Bp(k),E=Rh({validateStatus:g,isFocused:x,isHovering:C}),M=()=>{a("delete")},N=O=>{a("paste",O)};r.watch(()=>o.currencyAccuracy,()=>{a("update:modelValue",d(c.value))});const{recordCursor:T,setCursor:R}=function(O){const V=r.ref();return{recordCursor:()=>{if(!O.value)return;const{selectionStart:P,selectionEnd:A,value:L}=O.value;if(!P||!A)return;const j=L.slice(0,P),K=L.slice(A);V.value={selectionStart:P,selectionEnd:A,value:L,beforeTxt:j,afterTxt:K}},setCursor:()=>{if(!O.value||!V.value)return;const{value:P}=O.value,{beforeTxt:A,afterTxt:L,selectionStart:j}=V.value;if(!A||!L||!j)return;let K=P.length;if(function(H,q,Y){H=Ut(H),q=mi(q);var G=H.length,Q=Y=Y===void 0?G:Au(Gn(Y),0,G);return(Y-=q.length)>=0&&H.slice(Y,Q)==q}(P,L))K=P.length-L.length;else if(function(H,q,Y){return H=Ut(H),Y=Y==null?0:Au(Gn(Y),0,H.length),q=mi(q),H.slice(Y,Y+q.length)==q}(P,A))K=A.length;else{const H=A[j-1],q=P.indexOf(H,j-1);q!==-1&&(K=q+1)}O.value.setSelectionRange(K,K)}}}(l),z=async O=>{const{value:V}=O.target;T(),a("update:modelValue",d(V)),a("input",d(V)),await r.nextTick(),u(),R(),y("input")},_=O=>{const{value:V}=O.target;a("change",d(V))},I=()=>{m.value||(p.value=!p.value)};return r.watch(()=>m.value,O=>{O&&(p.value=!1)}),r.watch(c,()=>{u()}),e({ref:l,focus:async()=>{var O;await r.nextTick(),(O=l.value)==null||O.focus()},blur:async()=>{var O;(O=l.value)==null||O.blur()},select:()=>{var O;(O=l.value)==null||O.select()},clear:()=>{a("update:modelValue",""),a("input",""),a("change",""),a("clear")}}),(O,V)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-input",{"mc-input--disabled":r.unref(m),"mc-input--focused":r.unref(x),"mc-input--inputed":t.modelValue,"mc-input-hovering":r.unref(C),[r.unref(v)]:r.unref(v)}]),style:r.normalizeStyle({width:t.width,height:t.height}),ref_key:"wrapperRef",ref:k},[O.$slots.prefix||t.prefixIcon?(r.openBlock(),r.createElementBlock("div",C1,[r.renderSlot(O.$slots,"prefix",{},()=>[t.prefixIcon?(r.openBlock(),r.createBlock(r.unref(de),{key:0,class:"mc-input-icon",name:t.prefixIcon,size:24},null,8,["name"])):r.createCommentVNode("",!0)],!0)])):r.createCommentVNode("",!0),r.createElementVNode("input",{class:"mc-input__inner",style:r.normalizeStyle({textAlign:t.textAlign}),ref_key:"inputRef",ref:l,id:r.unref(f),type:h.value?p.value?"text":"password":"text",disabled:r.unref(m),readonly:t.readonly,autocomplete:t.autocomplete,placeholder:t.placeholder,autofocus:t.autofocus,maxlength:t.maxlength,onInput:z,onChange:_,onFocus:V[0]||(V[0]=(...P)=>r.unref(w)&&r.unref(w)(...P)),onBlur:V[1]||(V[1]=(...P)=>r.unref(S)&&r.unref(S)(...P)),onKeydown:r.withKeys(M,["delete"]),onPaste:N},null,44,S1),r.unref(b)?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mc-input__status",r.unref(v)])},[r.createVNode(r.unref(de),{name:r.unref(b),size:24},null,8,["name"])],2)):r.createCommentVNode("",!0),t.type==="password"?(r.openBlock(),r.createElementBlock("div",E1,[r.createVNode(r.unref(de),{class:"mc-input-icon",name:p.value?"Review-Hidden":"Review",size:24,onClick:I},null,8,["name"])])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:3},[O.$slots.suffix||t.suffixIcon?(r.openBlock(),r.createElementBlock("div",M1,[r.renderSlot(O.$slots,"suffix",{},()=>[t.suffixIcon?(r.openBlock(),r.createBlock(r.unref(de),{key:0,name:t.suffixIcon,size:24},null,8,["name"])):r.createCommentVNode("",!0)],!0)])):r.createCommentVNode("",!0)],64)),O.$slots.append?(r.openBlock(),r.createElementBlock("div",N1,[r.createElementVNode("div",B1,[r.renderSlot(O.$slots,"append",{},void 0,!0)])])):r.createCommentVNode("",!0)],6))}}),bl=Z(U(T1,[["__scopeId","data-v-83786ea1"]])),O1=["id"],_1={key:0,class:"mc-input-group-divider"},zh=Z(U(r.defineComponent({name:Dh,__name:"mc-input-group",props:{disabled:{type:Boolean,default:!1},suffixFlex:{default:1},prefixFlex:{default:1}},setup(t){const{isError:e,isExpanded:n,isPrefixActived:o,isSuffixActived:i,setInputGroupValidate:s,setInputGroupExpanded:a,setInputGroupActived:l}=(()=>{const p=r.ref("init"),h=r.computed(()=>p.value==="error"),f=r.ref(!1),m=r.ref(!1),g=r.ref(!1);return{validateStatus:p,isError:h,isExpanded:f,isPrefixActived:m,isSuffixActived:g,setInputGroupValidate:v=>{p.value=v},setInputGroupExpanded:v=>{f.value=v},setInputGroupActived:(v,b)=>{b==="prefix"?m.value=v:g.value=v}}})(),{formId:c,formDisabled:d}=sh(),u=r.computed(()=>!o.value&&!i.value&&!n.value||d.value);return r.provide(Vr,{disabled:d,setInputGroupExpanded:a,setInputGroupValidate:s,setInputGroupActived:l}),(p,h)=>(r.openBlock(),r.createElementBlock("div",{id:r.unref(c),class:r.normalizeClass(["mc-input-group",{"mc-input-group-disabled":r.unref(d)}])},[r.createElementVNode("div",{class:r.normalizeClass(["mc-input-group-prefix",{"mc-input-group-prefix-expanded":r.unref(n),"mc-input-group-prefix-actived":r.unref(o),"mc-input-group-prefix-error":r.unref(e)}]),style:r.normalizeStyle({flex:t.prefixFlex})},[r.renderSlot(p.$slots,"prefix",{},void 0,!0)],6),u.value?(r.openBlock(),r.createElementBlock("div",_1)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["mc-input-group-suffix",{"mc-input-group-suffix-expanded":r.unref(n),"mc-input-group-suffix-actived":r.unref(i),"mc-input-group-suffix-error":r.unref(e)}]),style:r.normalizeStyle({flex:t.suffixFlex})},[r.renderSlot(p.$slots,"suffix",{},void 0,!0)],6)],10,O1))}}),[["__scopeId","data-v-a61c5f3e"]])),$h="mc-lightbox",A1={key:0,class:"mc-lightbox-container"},V1={class:"mc-lightbox-header"},I1={class:"mc-lightbox-content-wrapper"},D1={key:0,class:"mc-lightbox-footer"},R1=r.defineComponent({name:$h,__name:"mc-lightbox",props:{modelValue:{type:Boolean,default:!1},title:{},size:{default:"medium"},maskClosable:{type:Boolean,default:!0},fixed:{type:Boolean,default:!0},portCssSelector:{default:"body"},hideFooter:{type:Boolean,default:!1},showBorder:{type:Boolean,default:!1},minHeight:{default:void 0}},emits:["update:modelValue","open","close"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),a=r.ref(),l=r.ref(!1),{isOverlayShow:c,isContentShow:d,openOverlay:u,closeOverlay:p}=Ah(),h=()=>{o.maskClosable&&g()},f=()=>{g()},m=()=>{l.value=!0,u(),i("open"),i("update:modelValue",!0)},g=()=>{p()},v=()=>{l.value=!1,i("close"),i("update:modelValue",!1)};return r.onMounted(()=>{o.modelValue&&m()}),r.watch(()=>o.modelValue,(b,y)=>{!y&&b?m():y&&!b&&g()}),e({ref:s,open:m,close:g}),(b,y)=>l.value?(r.openBlock(),r.createElementBlock("div",A1,[r.createVNode(r.Transition,{name:"mc-lightbox-overlay",onAfterLeave:v},{default:r.withCtx(()=>[r.createVNode(r.unref(Ui),{visible:r.unref(c),fixed:t.fixed,"port-css-selector":t.portCssSelector,onClick:h},{default:r.withCtx(()=>[r.createVNode(r.Transition,{name:"mc-lightbox-content"},{default:r.withCtx(()=>[r.unref(d)?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-lightbox",[`mc-lightbox-${t.size}`]]),ref_key:"lightboxRef",ref:s},[r.createElementVNode("div",V1,[r.renderSlot(b.$slots,"header",{},()=>[r.createVNode(r.unref(qi),{title:t.title,"show-border":t.showBorder,onClose:f},{default:r.withCtx(()=>[r.renderSlot(b.$slots,"header-title",{},void 0,!0)]),_:3},8,["title","show-border"])],!0)]),r.createElementVNode("div",I1,[r.createElementVNode("div",{class:"mc-lightbox-content",style:r.normalizeStyle({minHeight:t.minHeight?`${t.minHeight}px`:void 0}),ref_key:"contentRef",ref:a},[r.renderSlot(b.$slots,"default",{},void 0,!0)],4)]),t.hideFooter?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",D1,[r.renderSlot(b.$slots,"footer",{},()=>[r.createVNode(r.unref(qo),null,{left:r.withCtx(()=>[r.renderSlot(b.$slots,"footer-left",{},void 0,!0)]),right:r.withCtx(()=>[r.renderSlot(b.$slots,"footer-right",{},void 0,!0)]),"right-button-group":r.withCtx(()=>[r.renderSlot(b.$slots,"footer-right-button-group",{},void 0,!0)]),desc:r.withCtx(()=>[r.renderSlot(b.$slots,"footer-desc",{},void 0,!0)]),_:3})],!0)]))],2)):r.createCommentVNode("",!0)]),_:3})]),_:3},8,["visible","fixed","port-css-selector"])]),_:3})])):r.createCommentVNode("",!0)}}),Ph=Z(U(R1,[["__scopeId","data-v-a0340029"]])),jh="mc-loading",L1={key:0,class:"mc-loading-pulse"},z1={key:1,class:"mc-loading-spin"},$1={class:"mc-loading-text"},kl=Z(U(r.defineComponent({name:jh,__name:"mc-loading",props:{loading:{type:Boolean},loadingText:{},size:{default:"medium"},type:{default:"spin"}},setup(t){const e=t,n=r.computed(()=>e.size==="small"?24:e.size==="medium"?32:64);return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-loading",[`mc-loading-${t.size}`,{"mc-loading-active":t.loading}]])},[t.type==="pulse"?(r.openBlock(),r.createElementBlock("div",L1,[...i[0]||(i[0]=[r.createElementVNode("i",{class:"mc-loading-pulse-dot"},null,-1),r.createElementVNode("i",{class:"mc-loading-pulse-dot"},null,-1),r.createElementVNode("i",{class:"mc-loading-pulse-dot"},null,-1),r.createElementVNode("i",{class:"mc-loading-pulse-dot"},null,-1)])])):t.type==="spin"?(r.openBlock(),r.createElementBlock("div",z1,[r.createVNode(r.unref(de),{name:"Loading_Line",size:n.value},null,8,["size"])])):r.createCommentVNode("",!0),t.loadingText||o.$slots.default?r.renderSlot(o.$slots,"default",{key:2},()=>[r.createElementVNode("p",$1,r.toDisplayString(t.loadingText),1)],!0):r.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-d1cc3cc8"]])),Fh="mc-removable-tag",P1={class:"mc-removable-tag-content"},j1=r.defineComponent({name:Fh,__name:"mc-removable-tag",props:{label:{},disabled:{type:Boolean,default:!1}},emits:["remove"],setup(t,{emit:e}){const n=t,o=e,i=()=>{n.disabled||o("remove",n.label)};return(s,a)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-removable-tag",{"mc-removable-tag-disabled":t.disabled}])},[r.createElementVNode("span",P1,[r.renderSlot(s.$slots,"default",{label:t.label},()=>[r.createTextVNode(r.toDisplayString(t.label),1)],!0)]),t.disabled?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(r.unref(Nn),{key:0,class:"mc-removable-tag-close-icon",name:"cross",cursor:t.disabled?"not-allowed":"pointer",onClick:i},null,8,["cursor"]))],2))}}),wl=Z(U(j1,[["__scopeId","data-v-fec756a7"]])),Hh="mc-multi-tag",F1={class:"mc-multi-tag-label"},H1={class:"mc-multi-tag-option-list"},Wh=Z(U(r.defineComponent({name:Hh,__name:"mc-multi-tag",props:{label:{},tags:{default:()=>[]},disabled:{type:Boolean,default:!1},disableTags:{default:()=>[]}},emits:["remove:all","remove:tag"],setup(t,{emit:e}){const n=t,o=e,i=r.computed(()=>n.disabled||n.disableTags.length),s=c=>!!n.disabled||!!n.disableTags.includes(c),a=c=>{n.disabled||o("remove:tag",c,n.label)},l=()=>{i.value||o("remove:all",n.label)};return(c,d)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-multi-tag",{"mc-multi-tag-disabled":t.disabled}])},[i.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createVNode(r.unref(Nn),{class:"mc-multi-tag-close-all-icon",name:"cross",onClick:l}),d[0]||(d[0]=r.createElementVNode("i",{class:"mc-multi-tag-divider"},null,-1))],64)),r.createElementVNode("span",F1,r.toDisplayString(`${t.label} :`),1),r.createElementVNode("ul",H1,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.tags,u=>(r.openBlock(),r.createBlock(r.unref(wl),{key:u,label:u,disabled:s(u),onRemove:a},null,8,["label","disabled"]))),128))])],2))}}),[["__scopeId","data-v-0a31c60a"]])),Kh="mc-otp",W1=["id"],K1={class:"mc-otp-input-list"},U1=["onClick"],q1=["onUpdate:modelValue","disabled","onInput","onKeydown"],J1=r.defineComponent({name:Kh,__name:"mc-otp",props:{modelValue:{},disabled:{type:Boolean,default:!1},length:{default:6},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,i=r.ref([]),s=r.reactive(new Array(n.length)),{focusIndex:a,setFocus:l,nextFocus:c,prevFocus:d}=(b=>{const y=r.ref(),k=C=>{y.value=C};zi(b,()=>{Ee(y.value)||m("blur"),k(void 0)});const x=be("length"),w=C=>{var T;const E=x.value??0;C<0&&(C=0),C>E-1&&(C=E-1),y.value=C;const M=b.value[C],N=(T=M==null?void 0:M.children)==null?void 0:T[0];N==null||N.focus()},S=be("modelValue");return{focusIndex:y,setFocusIndex:k,setFocus:w,nextFocus:()=>{r.nextTick(()=>{var E;const C=((E=S.value)==null?void 0:E.length)??0;C<(x.value??0)&&w(C)})},prevFocus:()=>{r.nextTick(()=>{var E;const C=((E=S.value)==null?void 0:E.length)??0;C-1>=0&&w(C-1)})}}})(i),{formId:u,formDisabled:p,validateStyle:h,statusIcon:f,validateByTrigger:m}=ln({externalDisabled:r.computed(()=>n.disabled)}),g=b=>{for(let y=0;y<n.length;y++)s[y]=(b==null?void 0:b[y])||""};r.onMounted(()=>{g(n.modelValue)}),r.watch(()=>n.modelValue,b=>{g(b)});const v=async()=>{o("change",s.join("")),o("update:modelValue",s.join("")),await r.nextTick(),m("input")};return r.watchEffect(()=>{var b;if((((b=n.modelValue)==null?void 0:b.length)??0)>n.length)throw new Error("modelValue length is greater than length.")}),(b,y)=>(r.openBlock(),r.createElementBlock("div",{id:r.unref(u),class:r.normalizeClass(["mc-otp",{"mc-otp-disabled":r.unref(p),[r.unref(h)]:r.unref(h)}])},[r.createElementVNode("ul",K1,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.length,k=>(r.openBlock(),r.createElementBlock("li",{key:k,class:r.normalizeClass(["mc-otp-input-item",{"mc-otp-input-item-focus":r.unref(a)===k-1}]),ref_for:!0,ref:x=>((w,S)=>{S&&(i.value[w]=S)})(k-1,x),onClick:x=>(async w=>{Ct(s[w])?c():l(w)})(k-1)},[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":x=>s[k-1]=x,class:"mc-otp-input",type:"number",disabled:r.unref(p),onInput:x=>(async(w,S)=>{if(p.value)return;const C=S.target;let E=C.value.slice(0,1);C.value=E,s[w]=E,v(),E&&c()})(k-1,x),onPaste:y[0]||(y[0]=x=>(async w=>{var C;if(w.preventDefault(),p.value)return;const S=((C=w.clipboardData)==null?void 0:C.getData("text").slice(0,n.length))||"";g(S),v(),c()})(x)),onKeydown:[r.withKeys(r.withModifiers(x=>(async w=>{s[w]="",v(),d()})(k-1),["prevent","stop"]),["backspace"]),r.withKeys(r.withModifiers(x=>r.unref(l)(k-2),["prevent","stop"]),["left"]),r.withKeys(r.withModifiers(x=>r.unref(l)(k),["prevent","stop"]),["right"]),y[2]||(y[2]=r.withKeys(r.withModifiers(()=>{},["prevent","stop"]),["tab"]))],onMousedown:y[1]||(y[1]=r.withModifiers(()=>{},["prevent"]))},null,40,q1),[[r.vModelText,s[k-1]]])],10,U1))),128))]),r.unref(f)?(r.openBlock(),r.createBlock(r.unref(de),{key:0,class:"mc-otp-status-icon",name:r.unref(f),size:24},null,8,["name"])):r.createCommentVNode("",!0)],10,W1))}}),Uh=Z(U(J1,[["__scopeId","data-v-d04352a4"]])),qh="mc-progress-bar",G1={key:0,class:"mc-progress-bar-shimmer"},Y1={key:0,class:"mc-progress-bar-remarks"},xl=Z(U(r.defineComponent({name:qh,__name:"mc-progress-bar",props:{percentage:{default:0},height:{default:"4px"},width:{default:"100%"},remarks:{},showPercentage:{type:Boolean,default:!1},transitionDuration:{default:300},shimmer:{type:Boolean,default:!1}},emits:["update:percentage","complete"],setup(t,{expose:e,emit:n}){const o=t,i=n,{width:s,height:a}=$t(),l=r.ref();r.watchEffect(()=>{l.value&&l.value.style.setProperty("--border-radius",a.value||"auto")});const c=r.computed(()=>{const p=o.percentage/100;return p>1?1:p<0?0:p});r.watch(()=>o.percentage,p=>{p>=100&&i("complete")},{immediate:!0});const d=r.useSlots(),u=r.computed(()=>o.showPercentage||!!o.remarks||!!d.remarks);return e({updatePercentage:p=>{i("update:percentage",p)},complete:()=>{i("update:percentage",100),i("complete")},reset:()=>{i("update:percentage",0)}}),(p,h)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-progress-bar",style:r.normalizeStyle({width:r.unref(s)})},[r.createElementVNode("div",{ref_key:"progressBarRef",ref:l,class:"mc-progress-bar-wrapper",style:r.normalizeStyle({width:r.unref(s),height:r.unref(a)})},[r.createElementVNode("div",{class:"mc-progress-bar-inner",style:r.normalizeStyle({transform:`scaleX(${c.value})`,transitionDuration:`${t.transitionDuration}ms`})},null,4),t.shimmer?(r.openBlock(),r.createElementBlock("i",G1)):r.createCommentVNode("",!0)],4),u.value?(r.openBlock(),r.createElementBlock("div",Y1,[r.renderSlot(p.$slots,"remarks",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.remarks||`${r.unref(_u)(100*c.value)}%`),1)],!0)])):r.createCommentVNode("",!0)],4))}}),[["__scopeId","data-v-7ebc305e"]])),Jh="mc-success-icon",Jo=Z(U(r.defineComponent({name:Jh,__name:"mc-success-icon",props:{width:{default:"40px"},height:{default:"40px"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("svg",{class:"success-icon",style:r.normalizeStyle({width:t.width,height:t.height}),viewBox:"0 0 400 400"},[...n[0]||(n[0]=[r.createElementVNode("circle",{class:"circle",fill:"none",transform:"rotate(-90 200 200)","stroke-width":"20",cx:"200",cy:"200",r:"190","stroke-linecap":"round"},null,-1),r.createElementVNode("polyline",{class:"tick",fill:"none","stroke-width":"26",points:"120,214 173,260 274,160","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],4))}),[["__scopeId","data-v-be465c78"]])),Gh="mc-progress-indicator",Yh="mc-progress-indicator-step",Xh="mc-progress-indicator-step-num",X1={key:0,class:"mc-progress-indicator-step-num-icon"},Z1={key:1},Q1=U(r.defineComponent({name:Xh,__name:"mc-progress-indicator-step-num",props:{num:{},status:{default:"default"},showSuccessIcon:{type:Boolean,default:!0},isChild:{type:Boolean,default:!1},icon:{}},setup(t){const e=t,n=r.computed(()=>e.showSuccessIcon&&e.status==="success"&&!e.isChild);return(o,i)=>n.value?(r.openBlock(),r.createBlock(r.unref(Jo),{key:0})):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mc-progress-indicator-step-num",[`mc-progress-indicator-step-num-${t.status}`,{"mc-progress-indicator-step-num-child":t.isChild}]])},[t.isChild?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",X1,[t.icon?(r.openBlock(),r.createBlock(r.unref(Nn),{key:0,name:t.icon},null,8,["name"])):(r.openBlock(),r.createElementBlock("span",Z1,r.toDisplayString(t.num),1))]))],2))}}),[["__scopeId","data-v-e3df2f74"]]);class Zh{constructor(e,n){Ce(this,"id");Ce(this,"stepKey");Ce(this,"index");Ce(this,"parentIndex");Ce(this,"childIndex");Ce(this,"label");Ce(this,"icon");Ce(this,"showContent");Ce(this,"success");Ce(this,"hiddenHeader");Ce(this,"hiddenFooter");Ce(this,"hiddenFooterLeft");Ce(this,"hiddenFooterRight");Ce(this,"previousStep");Ce(this,"nextStep");Ce(this,"parentStep");Ce(this,"childrenSteps");Ce(this,"iconSlot");Ce(this,"labelSlot");Ce(this,"defaultSlot");Ce(this,"contentTitleSlot");Ce(this,"contentToolbarSlot");Ce(this,"contentSlot");Ce(this,"contentFooterSlot");Ce(this,"contentFooterLeftSlot");Ce(this,"contentFooterRightSlot");var i;const o=((s=10)=>String(Date.now()).slice(-s))();this.id=e!=null&&e.id||e!=null&&e.step?`${o}-${(i=e==null?void 0:e.step)==null?void 0:i.toString()}`:o,this.stepKey=e==null?void 0:e.step,this.label=e==null?void 0:e.label,this.icon=e==null?void 0:e.icon,this.showContent=Jt(e,"show-content"),this.success=e==null?void 0:e.success,this.hiddenHeader=Jt(e,"hidden-header"),this.hiddenFooter=Jt(e,"hidden-footer"),this.hiddenFooterLeft=Jt(e,"hidden-footer-left"),this.hiddenFooterRight=Jt(e,"hidden-footer-right"),this.iconSlot=n==null?void 0:n.icon,this.labelSlot=n==null?void 0:n.label,this.defaultSlot=n==null?void 0:n.default,this.contentTitleSlot=Jt(n,"content-title"),this.contentToolbarSlot=Jt(n,"content-toolbar"),this.contentSlot=n==null?void 0:n.content,this.contentFooterSlot=Jt(n,"content-footer"),this.contentFooterLeftSlot=Jt(n,"content-footer-left"),this.contentFooterRightSlot=Jt(n,"content-footer-right")}get isChild(){return!!this.parentStep}get hasChildren(){var e;return!!((e=this.childrenSteps)!=null&&e.size)}getChildrenSteps(){var e;return Array.from(((e=this.childrenSteps)==null?void 0:e.values())||[])}hasChildStep(e){var n;return!!((n=this.childrenSteps)!=null&&n.has(e))}getFirstChildStep(){var e;return(e=this.childrenSteps)==null?void 0:e.values().next().value}getLastChildStep(){var e;return Array.from(((e=this.childrenSteps)==null?void 0:e.values())||[]).pop()}appendChildStep(e){this.childrenSteps||(this.childrenSteps=new Map),this.childrenSteps.set(e.stepKey,e)}removeChildStep(e){var n,o;(n=this.childrenSteps)==null||n.delete(e),((o=this.childrenSteps)==null?void 0:o.size)===0&&(this.childrenSteps=void 0)}clearContent(){this.defaultSlot=void 0,this.contentSlot=void 0,this.contentTitleSlot=void 0,this.contentToolbarSlot=void 0,this.contentFooterSlot=void 0,this.contentFooterLeftSlot=void 0,this.contentFooterRightSlot=void 0}}const Cl="mc-progress-indicator-item",ew={class:"mc-grogress-indicator-item"},Qh=Z(r.defineComponent({name:Cl,__name:"mc-progress-indicator-item",props:{icon:{},id:{},step:{},label:{},showContent:{type:Boolean},success:{type:Boolean},hiddenHeader:{type:Boolean},hiddenFooter:{type:Boolean},hiddenFooterLeft:{type:Boolean},hiddenFooterRight:{type:Boolean}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",ew))})),Sl="mc-progress-indicator-child-item",tw={class:"mc-grogress-indicator-child-item"},ef=Z(r.defineComponent({name:Sl,__name:"mc-progress-indicator-child-item",props:{id:{},step:{},label:{},showContent:{type:Boolean},success:{type:Boolean},hiddenHeader:{type:Boolean},hiddenFooter:{type:Boolean},hiddenFooterLeft:{type:Boolean},hiddenFooterRight:{type:Boolean}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",tw))})),nw=(t,e)=>t===0?"first":t===e-1?"last":"middle",Ji=(t,e,n="manual")=>{const o=r.unref(e);if(pp(t==null?void 0:t.success)&&t.success||t!=null&&t.parentStep&&Ji(t.parentStep,e)==="success")return"success";if(!(o&&t&&Ri(o.index)&&Ri(t.index)))return"default";if(n==="auto"){if(t.isChild||!t.hasChildren){if(t.index<o.index)return"success"}else if(t.hasChildren){let i=!0;for(const s of t==null?void 0:t.getChildrenSteps())if(Ji(s,e,n)!=="success"){i=!1;break}if(i)return"success"}}return t.index<=o.index?"active":"default"},tf=(t,e)=>pp(t==null?void 0:t.showContent)?t==null?void 0:t.showContent:!Ee(t==null?void 0:t.stepKey)&&t.stepKey===(e==null?void 0:e.stepKey),ow=["id"],rw={key:0,class:"mc-progress-indicator-step-container"},iw={class:"mc-progress-indicator-step-content"},sw={key:0,class:"mc-progress-indicator-step-content-header"},aw={key:0,class:"mc-progress-indicator-step-content-footer-container"},lw={class:"mc-progress-indicator-step-content-footer"},cw={class:"mc-progress-indicator-step-content-footer-left-container"},dw={key:0,class:"mc-progress-indicator-step-content-footer-left"},uw={class:"mc-progress-indicator-step-content-footer-right-container"},pw={key:0,class:"mc-progress-indicator-step-content-footer-right"},hw=U(r.defineComponent({name:Yh,__name:"mc-progress-indicator-step",props:{successBehavior:{default:"auto"},currentStep:{},step:{},position:{default:"middle"},showSuccessIcon:{type:Boolean,default:!0}},setup(t){const e=t,n=r.computed(()=>tf(e.step,r.unref(e.currentStep))),o=r.computed(()=>tf(e.step.nextStep,r.unref(e.currentStep))),i=r.computed(()=>!!e.step.isChild),s=r.computed(()=>Ji(e.step,e.currentStep,e.successBehavior)),a=r.computed(()=>Ji(e.step.previousStep,e.currentStep,e.successBehavior)),l=r.computed(()=>Ri(e.step.parentIndex)?e.step.parentIndex+1:0);return(c,d)=>(r.openBlock(),r.createElementBlock("div",{id:t.step.id,class:"mc-progress-indicator-step"},[r.createElementVNode("div",{class:r.normalizeClass(["mc-progress-indicator-step-item",{"mc-progress-indicator-step-item-child":i.value}])},[r.createElementVNode("i",{class:r.normalizeClass(["mc-progress-indicator-step-line mc-progress-indicator-step-line-up",[`mc-progress-indicator-step-line-${a.value}`,`mc-progress-indicator-step-line-${t.position}`]])},null,2),r.renderSlot(c.$slots,"icon",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createVNode(Q1,{num:l.value,icon:t.step.icon,status:s.value,"show-success-icon":t.showSuccessIcon,"is-child":i.value},null,8,["num","icon","status","show-success-icon","is-child"])],!0),r.createElementVNode("i",{class:r.normalizeClass(["mc-progress-indicator-step-line mc-progress-indicator-step-line-down",[`mc-progress-indicator-step-line-${s.value}`,`mc-progress-indicator-step-line-${t.position}`]])},null,2)],2),n.value?(r.openBlock(),r.createElementBlock("div",rw,[r.renderSlot(c.$slots,"default",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createElementVNode("div",iw,[t.step.hiddenHeader?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",sw,[r.renderSlot(c.$slots,"content-title",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createElementVNode("span",{class:r.normalizeClass(["mc-progress-indicator-step-content-title",[`mc-progress-indicator-step-content-title-${s.value}`]])},r.toDisplayString(t.step.label),3)],!0),r.renderSlot(c.$slots,"content-toolbar",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},void 0,!0)])),r.renderSlot(c.$slots,"content",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},void 0,!0)]),t.step.hiddenFooter?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",aw,[r.renderSlot(c.$slots,"content-footer",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createElementVNode("div",lw,[r.createElementVNode("div",cw,[t.step.hiddenFooterLeft?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",dw,[r.renderSlot(c.$slots,"content-footer-left",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},void 0,!0)]))]),r.createElementVNode("div",uw,[t.step.hiddenFooterRight?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",pw,[r.renderSlot(c.$slots,"content-footer-right",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},void 0,!0)]))])])],!0)]))],!0)])):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mc-progress-indicator-step-label",[`mc-progress-indicator-step-label-${s.value}`,{"mc-progress-indicator-step-label-child":i.value,"mc-progress-indicator-step-label-need-padding-bottom":o.value}]])},[r.renderSlot(c.$slots,"label",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createTextVNode(r.toDisplayString(t.step.label),1)],!0)],2))],8,ow))}}),[["__scopeId","data-v-150dfe0a"]]),fw={class:"mc-grogress-indicator"},nf=Z(U(r.defineComponent({name:Gh,__name:"mc-progress-indicator",props:{modelValue:{},successSteps:{},successBehavior:{default:"auto"},previousBehavior:{default:"last-child"},showSuccessIcon:{type:Boolean,default:!0},scrollToStep:{type:Boolean,default:!1}},emits:["update:modelValue","update:successSteps","change","click:step"],setup(t,{expose:e,emit:n}){const o=t,i=n,{stepItems:s,currentStep:a}=(()=>{const d=r.ref([]),u=r.ref(new Map),p=r.useSlots();r.watchEffect(()=>{var v;const{stepItems:m,stepMap:g}=(b=>{const y=[],k=new Map;let x,w=0,S=0;const C=(E,M)=>{ce(E)&&E.forEach(N=>{var R,z,_;const T=(R=(N==null?void 0:N.type)||{})==null?void 0:R.name;if(T===Cl){const I=Ro(N.children)||ce(N.children)||!Ve((z=N.children)==null?void 0:z.default)?N.children:(_=N.children)==null?void 0:_.default(),O=N.props,V=N.children,P=new Zh(O,V);P.parentIndex=w++,P.index=S++,x&&(P.previousStep=x,x.nextStep=P),x=P,y.push(P),k.set(P.stepKey,P),C(I,P)}else if(T===Sl){const I=N.props,O=N.children,V=new Zh(I,O);V.index=S++,M&&(M.clearContent(),M.appendChildStep(V),V.parentIndex=M.parentIndex,V.parentStep=M,V.childIndex=M.getChildrenSteps().length),x&&(V.previousStep=x,x.nextStep=V),k.set(V.stepKey,V),y.push(V),x=V}else ce(N.children)&&C(N.children,M)})};return C(b),{stepItems:y,stepMap:k}})((v=p.default)==null?void 0:v.call(p));d.value=m,u.value=g});const h=be("modelValue"),f=r.computed(()=>u.value.get(h.value));return{stepItems:d,currentStep:f}})(),l=d=>{Ee(d)||i("update:modelValue",d)},c=async d=>{if(!o.scrollToStep||Ee(d==null?void 0:d.stepKey))return;await r.nextTick();const u=document.getElementById(d.id);u&&u.scrollIntoView({behavior:"smooth"})};return e({goStep:l,goNextStep:()=>{var u,p;const d=(u=a.value)==null?void 0:u.nextStep;Ee(d==null?void 0:d.stepKey)||(d.hasChildren?l((p=d==null?void 0:d.getFirstChildStep())==null?void 0:p.stepKey):l(d.stepKey),c(d))},goPreviousStep:()=>{var u,p,h,f,m,g;const d=(u=a.value)==null?void 0:u.previousStep;if(!Ee(d==null?void 0:d.stepKey))if((p=a.value)!=null&&p.isChild&&d===((h=a.value)==null?void 0:h.parentStep)){const v=d.previousStep;o.previousBehavior==="last-child"?(l(v==null?void 0:v.stepKey),c(v)):v!=null&&v.isChild?(l((m=(f=v.parentStep)==null?void 0:f.getFirstChildStep())==null?void 0:m.stepKey),c(v.parentStep)):(l(v==null?void 0:v.stepKey),c(v))}else l(d==null?void 0:d.stepKey),d!=null&&d.isChild&&((g=d.parentStep)==null?void 0:g.getFirstChildStep())===d?c(d.parentStep):c(d)}}),(d,u)=>(r.openBlock(),r.createElementBlock("div",fw,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(s),(p,h)=>(r.openBlock(),r.createBlock(hw,{key:p.stepKey,position:r.unref(nw)(h,r.unref(s).length),step:p,"current-step":r.unref(a),"success-behavior":t.successBehavior,"show-success-icon":t.showSuccessIcon},r.createSlots({_:2},[p.labelSlot?{name:"label",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.labelSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"0"}:void 0,p.iconSlot?{name:"icon",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.iconSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"1"}:void 0,p.defaultSlot?{name:"default",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.defaultSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"2"}:void 0,p.contentTitleSlot?{name:"content-title",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentTitleSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"3"}:void 0,p.contentToolbarSlot?{name:"content-toolbar",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentToolbarSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"4"}:void 0,p.contentSlot?{name:"content",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"5"}:void 0,p.contentFooterSlot?{name:"content-footer",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentFooterSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"6"}:void 0,p.contentFooterLeftSlot?{name:"content-footer-left",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentFooterLeftSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"7"}:void 0,p.contentFooterRightSlot?{name:"content-footer-right",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentFooterRightSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"8"}:void 0]),1032,["position","step","current-step","success-behavior","show-success-icon"]))),128))]))}}),[["__scopeId","data-v-a2c50544"]])),El=Symbol("mc-radio-group-context"),of="mc-radio-group",mw=["id"],rf=Z(U(r.defineComponent({name:of,__name:"mc-radio-group",props:{modelValue:{type:[Number,String,Boolean]},disabled:{type:Boolean},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,{formId:i}=ln();return r.provide(El,{modelValue:r.computed(()=>n.modelValue),disabled:r.computed(()=>n.disabled),handleSelect:s=>{o("update:modelValue",s),o("change",s)}}),(s,a)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-radio-group",id:r.unref(i)},[r.renderSlot(s.$slots,"default",{},void 0,!0)],8,mw))}}),[["__scopeId","data-v-e40c3cfa"]])),sf="mc-radio",gw=["disabled","onKeypress"],vw={class:"mc-radio-wrapper"},yw={class:"mc-radio-content"},bw={key:0,class:"mc-radio-help"},kw={class:"mc-radio-remark"},af=Z(U(r.defineComponent({name:sf,__name:"mc-radio",props:{label:{},value:{type:[Number,String,Boolean]},disabled:{type:Boolean},remark:{},help:{}},emits:["focus","blur"],setup(t){const e=t,n=r.inject(El,void 0),o=r.ref(),{wrapperRef:i,isFocused:s,handleFocus:a,handleBlur:l}=zo(o),c=r.computed(()=>{var f;return((f=n==null?void 0:n.modelValue)==null?void 0:f.value)===e.value}),{formDisabled:d,validateStyle:u,validateByTrigger:p}=ln({externalDisabled:r.computed(()=>{var f;return!!((f=n==null?void 0:n.disabled)!=null&&f.value)})}),h=async()=>{d.value||(n==null||n.handleSelect(e.value),await r.nextTick(),p("input"))};return(f,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"wrapperRef",ref:i,class:r.normalizeClass(["mc-radio",{"mc-radio-has-remark":!!t.remark}])},[r.createElementVNode("label",{class:r.normalizeClass(["mc-radio-label",{"mc-radio-checked":c.value,"mc-radio-disabled":r.unref(d),"mc-radio-focused":r.unref(s),[r.unref(u)]:r.unref(u)}]),onClick:r.withModifiers(h,["prevent"])},[r.createElementVNode("input",{ref_key:"inputRef",ref:o,type:"radio",class:"mc-radio-input",disabled:r.unref(d),onFocus:m[0]||(m[0]=(...g)=>r.unref(a)&&r.unref(a)(...g)),onBlur:m[1]||(m[1]=(...g)=>r.unref(l)&&r.unref(l)(...g)),onKeypress:r.withKeys(r.withModifiers(h,["prevent","stop"]),["enter"])},null,40,gw),r.createElementVNode("div",vw,[m[2]||(m[2]=r.createElementVNode("span",{class:"mc-radio-circle"},null,-1)),r.createElementVNode("div",yw,[r.renderSlot(f.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.label),1)],!0)]),t.help||f.$slots.help?(r.openBlock(),r.createElementBlock("div",bw,[r.renderSlot(f.$slots,"help",{},()=>[r.createVNode(r.unref(Uo),{content:t.help,"icon-size":24},null,8,["content"])],!0)])):r.createCommentVNode("",!0)])],2),r.createElementVNode("div",kw,[r.renderSlot(f.$slots,"remark",{},()=>[r.createTextVNode(r.toDisplayString(t.remark),1)],!0)])],2))}}),[["__scopeId","data-v-37cfb183"]]));function Qe(t){this.content=t}function lf(t,e,n){for(let o=0;;o++){if(o==t.childCount||o==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(o),s=e.child(o);if(i!=s){if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let a=0;i.text[a]==s.text[a];a++)n++;return n}if(i.content.size||s.content.size){let a=lf(i.content,s.content,n+1);if(a!=null)return a}n+=i.nodeSize}else n+=i.nodeSize}}function cf(t,e,n,o){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:o};let a=t.child(--i),l=e.child(--s),c=a.nodeSize;if(a!=l){if(!a.sameMarkup(l))return{a:n,b:o};if(a.isText&&a.text!=l.text){let d=0,u=Math.min(a.text.length,l.text.length);for(;d<u&&a.text[a.text.length-d-1]==l.text[l.text.length-d-1];)d++,n--,o--;return{a:n,b:o}}if(a.content.size||l.content.size){let d=cf(a.content,l.content,n-1,o-1);if(d)return d}n-=c,o-=c}else n-=c,o-=c}}Qe.prototype={constructor:Qe,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var o=n&&n!=t?this.remove(n):this,i=o.find(t),s=o.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new Qe(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Qe(n)},addToStart:function(t,e){return new Qe([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Qe(n)},addBefore:function(t,e,n){var o=this.remove(e),i=o.content.slice(),s=o.find(t);return i.splice(s==-1?i.length:s,0,e,n),new Qe(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=Qe.from(t)).size?new Qe(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=Qe.from(t)).size?new Qe(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Qe.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},Qe.from=function(t){if(t instanceof Qe)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Qe(e)};class ${constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let o=0;o<e.length;o++)this.size+=e[o].nodeSize}nodesBetween(e,n,o,i=0,s){for(let a=0,l=0;l<n;a++){let c=this.content[a],d=l+c.nodeSize;if(d>e&&o(c,i+l,s||null,a)!==!1&&c.content.size){let u=l+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,n-u),o,i+u)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,o,i){let s="",a=!0;return this.nodesBetween(e,n,(l,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,n-c):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&o&&(a?a=!1:s+=o),s+=d},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,o=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(o)&&(i[i.length-1]=n.withText(n.text+o.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new $(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let o=[],i=0;if(n>e)for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;c>e&&((a<e||c>n)&&(l=l.isText?l.cut(Math.max(0,e-a),Math.min(l.text.length,n-a)):l.cut(Math.max(0,e-a-1),Math.min(l.content.size,n-a-1))),o.push(l),i+=l.nodeSize),a=c}return new $(o,i)}cutByIndex(e,n){return e==n?$.empty:e==0&&n==this.content.length?this:new $(this.content.slice(e,n))}replaceChild(e,n){let o=this.content[e];if(o==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-o.nodeSize;return i[e]=n,new $(i,s)}addToStart(e){return new $([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new $(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,o=0;n<this.content.length;n++){let i=this.content[n];e(i,o,n),o+=i.nodeSize}}findDiffStart(e,n=0){return lf(this,e,n)}findDiffEnd(e,n=this.size,o=e.size){return cf(this,e,n,o)}findIndex(e){if(e==0)return Gi(0,e);if(e==this.size)return Gi(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,o=0;;n++){let i=o+this.child(n).nodeSize;if(i>=e)return i==e?Gi(n+1,i):Gi(n,o);o=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return $.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new $(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return $.empty;let n,o=0;for(let i=0;i<e.length;i++){let s=e[i];o+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new $(n||e,o)}static from(e){if(!e)return $.empty;if(e instanceof $)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new $([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}$.empty=new $([],0);const Ml={index:0,offset:0};function Gi(t,e){return Ml.index=t,Ml.offset=e,Ml}function Yi(t,e){if(t===e)return!0;if(!t||typeof t!="object"||!e||typeof e!="object")return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let o=0;o<t.length;o++)if(!Yi(t[o],e[o]))return!1}else{for(let o in t)if(!(o in e)||!Yi(t[o],e[o]))return!1;for(let o in e)if(!(o in t))return!1}return!0}let Me=class Td{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,o=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!o&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),o=!0),n&&n.push(s)}}return n||(n=e.slice()),o||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Yi(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let o=e.marks[n.type];if(!o)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=o.create(n.attrs);return o.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let o=0;o<e.length;o++)if(!e[o].eq(n[o]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Td.none;if(e instanceof Td)return[e];let n=e.slice();return n.sort((o,i)=>o.type.rank-i.type.rank),n}};Me.none=[];class Xi extends Error{}class J{constructor(e,n,o){this.content=e,this.openStart=n,this.openEnd=o}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let o=uf(this.content,e+this.openStart,n);return o&&new J(o,this.openStart,this.openEnd)}removeBetween(e,n){return new J(df(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return J.empty;let o=n.openStart||0,i=n.openEnd||0;if(typeof o!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new J($.fromJSON(e,n.content),o,i)}static maxOpen(e,n=!0){let o=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)o++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new J(e,o,i)}}function df(t,e,n){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o),{index:a,offset:l}=t.findIndex(n);if(i==e||s.isText){if(l!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(o!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(o,s.copy(df(s.content,e-i-1,n-i-1)))}function uf(t,e,n,o){let{index:i,offset:s}=t.findIndex(e),a=t.maybeChild(i);if(s==e||a.isText)return o&&!o.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=uf(a.content,e-s-1,n,a);return l&&t.replaceChild(i,a.copy(l))}function ww(t,e,n){if(n.openStart>t.depth)throw new Xi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Xi("Inconsistent open depths");return pf(t,e,n,0)}function pf(t,e,n,o){let i=t.index(o),s=t.node(o);if(i==e.index(o)&&o<t.depth-n.openStart){let a=pf(t,e,n,o+1);return s.copy(s.content.replaceChild(i,a))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=o||e.depth!=o){let{start:a,end:l}=function(c,d){let u=d.depth-c.openStart,p=d.node(u).copy(c.content);for(let h=u-1;h>=0;h--)p=d.node(h).copy($.from(p));return{start:p.resolveNoCache(c.openStart+u),end:p.resolveNoCache(p.content.size-c.openEnd-u)}}(n,t);return so(s,ff(t,a,l,e,o))}{let a=t.parent,l=a.content;return so(a,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}}return so(s,Zi(t,e,o))}function hf(t,e){if(!e.type.compatibleContent(t.type))throw new Xi("Cannot join "+e.type.name+" onto "+t.type.name)}function Nl(t,e,n){let o=t.node(n);return hf(o,e.node(n)),o}function io(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Ir(t,e,n,o){let i=(e||t).node(n),s=0,a=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(io(t.nodeAfter,o),s++));for(let l=s;l<a;l++)io(i.child(l),o);e&&e.depth==n&&e.textOffset&&io(e.nodeBefore,o)}function so(t,e){return t.type.checkContent(e),t.copy(e)}function ff(t,e,n,o,i){let s=t.depth>i&&Nl(t,e,i+1),a=o.depth>i&&Nl(n,o,i+1),l=[];return Ir(null,t,i,l),s&&a&&e.index(i)==n.index(i)?(hf(s,a),io(so(s,ff(t,e,n,o,i+1)),l)):(s&&io(so(s,Zi(t,e,i+1)),l),Ir(e,n,i,l),a&&io(so(a,Zi(n,o,i+1)),l)),Ir(o,null,i,l),new $(l)}function Zi(t,e,n){let o=[];return Ir(null,t,n,o),t.depth>n&&io(so(Nl(t,e,n+1),Zi(t,e,n+1)),o),Ir(e,null,n,o),new $(o)}J.empty=new J($.empty,0,0);class Dr{constructor(e,n,o){this.pos=e,this.path=n,this.parentOffset=o,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return(e=this.resolveDepth(e))==0?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let o=this.pos-this.path[this.path.length-1],i=e.child(n);return o?e.child(n).cut(o):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let o=this.path[3*n],i=n==0?0:this.path[3*n-1]+1;for(let s=0;s<e;s++)i+=o.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Me.none;if(this.textOffset)return e.child(n).marks;let o=e.maybeChild(n-1),i=e.maybeChild(n);if(!o){let l=o;o=i,i=l}let s=o.marks;for(var a=0;a<s.length;a++)s[a].type.spec.inclusive!==!1||i&&s[a].isInSet(i.marks)||(s=s[a--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let o=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<o.length;s++)o[s].type.spec.inclusive!==!1||i&&o[s].isInSet(i.marks)||(o=o[s--].removeFromSet(o));return o}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let o=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);o>=0;o--)if(e.pos<=this.end(o)&&(!n||n(this.node(o))))return new Qi(this,e,o);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let o=[],i=0,s=n;for(let a=e;;){let{index:l,offset:c}=a.content.findIndex(s),d=s-c;if(o.push(a,l,i+c),!d||(a=a.child(l),a.isText))break;s=d-1,i+=c+1}return new Dr(n,o,s)}static resolveCached(e,n){let o=mf.get(e);if(o)for(let s=0;s<o.elts.length;s++){let a=o.elts[s];if(a.pos==n)return a}else mf.set(e,o=new xw);let i=o.elts[o.i]=Dr.resolve(e,n);return o.i=(o.i+1)%Cw,i}}class xw{constructor(){this.elts=[],this.i=0}}const Cw=12,mf=new WeakMap;class Qi{constructor(e,n,o){this.$from=e,this.$to=n,this.depth=o}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Sw=Object.create(null);class jt{constructor(e,n,o,i=Me.none){this.type=e,this.attrs=n,this.marks=i,this.content=o||$.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,o,i=0){this.content.nodesBetween(e,n,o,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,o,i){return this.content.textBetween(e,n,o,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,o){return this.type==e&&Yi(this.attrs,n||e.defaultAttrs||Sw)&&Me.sameSet(this.marks,o||Me.none)}copy(e=null){return e==this.content?this:new jt(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new jt(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,o=!1){if(e==n)return J.empty;let i=this.resolve(e),s=this.resolve(n),a=o?0:i.sharedDepth(n),l=i.start(a),c=i.node(a).content.cut(i.pos-l,s.pos-l);return new J(c,i.depth-a,s.depth-a)}replace(e,n,o){return ww(this.resolve(e),this.resolve(n),o)}nodeAt(e){for(let n=this;;){let{index:o,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(o),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:o}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:o}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:o}=this.content.findIndex(e);if(o<e)return{node:this.content.child(n),index:n,offset:o};let i=this.content.child(n-1);return{node:i,index:n-1,offset:o-i.nodeSize}}resolve(e){return Dr.resolveCached(this,e)}resolveNoCache(e){return Dr.resolve(this,e)}rangeHasMark(e,n,o){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(o.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),gf(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,o=$.empty,i=0,s=o.childCount){let a=this.contentMatchAt(e).matchFragment(o,i,s),l=a&&a.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=i;c<s;c++)if(!this.type.allowsMarks(o.child(c).marks))return!1;return!0}canReplaceWith(e,n,o,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(o),a=s&&s.matchFragment(this.content,n);return!!a&&a.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Me.none;for(let n=0;n<this.marks.length;n++){let o=this.marks[n];o.type.checkAttrs(o.attrs),e=o.addToSet(e)}if(!Me.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let o;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");o=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,o)}let i=$.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,o);return s.type.checkAttrs(s.attrs),s}}jt.prototype.text=void 0;class es extends jt{constructor(e,n,o,i){if(super(e,n,null,i),!o)throw new RangeError("Empty text nodes are not allowed");this.text=o}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):gf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new es(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new es(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function gf(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class ao{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let o=new Ew(e,n);if(o.next==null)return ao.empty;let i=vf(o);o.next&&o.err("Unexpected trailing text");let s=function(a){let l=Object.create(null);return function c(d){let u=[];d.forEach(h=>{a[h].forEach(({term:f,to:m})=>{if(!f)return;let g;for(let v=0;v<u.length;v++)u[v][0]==f&&(g=u[v][1]);kf(a,m).forEach(v=>{g||u.push([f,g=[]]),g.indexOf(v)==-1&&g.push(v)})})});let p=l[d.join(",")]=new ao(d.indexOf(a.length-1)>-1);for(let h=0;h<u.length;h++){let f=u[h][1].sort(bf);p.next.push({type:u[h][0],next:l[f.join(",")]||c(f)})}return p}(kf(a,0))}(function(a){let l=[[]];return u(function p(h,f){if(h.type=="choice")return h.exprs.reduce((m,g)=>m.concat(p(g,f)),[]);if(h.type!="seq"){if(h.type=="star"){let m=c();return d(f,m),u(p(h.expr,m),m),[d(m)]}if(h.type=="plus"){let m=c();return u(p(h.expr,f),m),u(p(h.expr,m),m),[d(m)]}if(h.type=="opt")return[d(f)].concat(p(h.expr,f));if(h.type=="range"){let m=f;for(let g=0;g<h.min;g++){let v=c();u(p(h.expr,m),v),m=v}if(h.max==-1)u(p(h.expr,m),m);else for(let g=h.min;g<h.max;g++){let v=c();d(m,v),u(p(h.expr,m),v),m=v}return[d(m)]}if(h.type=="name")return[d(f,void 0,h.value)];throw new Error("Unknown expr type")}for(let m=0;;m++){let g=p(h.exprs[m],f);if(m==h.exprs.length-1)return g;u(g,f=c())}}(a,0),c()),l;function c(){return l.push([])-1}function d(p,h,f){let m={term:f,to:h};return l[p].push(m),m}function u(p,h){p.forEach(f=>f.to=h)}}(i));return function(a,l){for(let c=0,d=[a];c<d.length;c++){let u=d[c],p=!u.validEnd,h=[];for(let f=0;f<u.next.length;f++){let{type:m,next:g}=u.next[f];h.push(m.name),!p||m.isText||m.hasRequiredAttrs()||(p=!1),d.indexOf(g)==-1&&d.push(g)}p&&l.err("Only non-generatable nodes ("+h.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,o),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,o=e.childCount){let i=this;for(let s=n;i&&s<o;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!n.isText&&!n.hasRequiredAttrs())return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let o=0;o<e.next.length;o++)if(this.next[n].type==e.next[o].type)return!0;return!1}fillBefore(e,n=!1,o=0){let i=[this];return function s(a,l){let c=a.matchFragment(e,o);if(c&&(!n||c.validEnd))return $.from(l.map(d=>d.createAndFill()));for(let d=0;d<a.next.length;d++){let{type:u,next:p}=a.next[d];if(!u.isText&&!u.hasRequiredAttrs()&&i.indexOf(p)==-1){i.push(p);let h=s(p,l.concat(u));if(h)return h}}return null}(this,[])}findWrapping(e){for(let o=0;o<this.wrapCache.length;o+=2)if(this.wrapCache[o]==e)return this.wrapCache[o+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),o=[{match:this,type:null,via:null}];for(;o.length;){let i=o.shift(),s=i.match;if(s.matchType(e)){let a=[];for(let l=i;l.type;l=l.via)a.push(l.type);return a.reverse()}for(let a=0;a<s.next.length;a++){let{type:l,next:c}=s.next[a];l.isLeaf||l.hasRequiredAttrs()||l.name in n||i.type&&!c.validEnd||(o.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function n(o){e.push(o);for(let i=0;i<o.next.length;i++)e.indexOf(o.next[i].next)==-1&&n(o.next[i].next)}(this),e.map((n,o)=>{let i=o+(n.validEnd?"*":" ")+" ";for(let s=0;s<n.next.length;s++)i+=(s?", ":"")+n.next[s].type.name+"->"+e.indexOf(n.next[s].next);return i}).join(`
|
|
37
|
+
`)}}ao.empty=new ao(!0);class Ew{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function vf(t){let e=[];do e.push(Mw(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Mw(t){let e=[];do e.push(Nw(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Nw(t){let e=function(n){if(n.eat("(")){let o=vf(n);return n.eat(")")||n.err("Missing closing paren"),o}if(!/\W/.test(n.next)){let o=function(i,s){let a=i.nodeTypes,l=a[s];if(l)return[l];let c=[];for(let d in a){let u=a[d];u.isInGroup(s)&&c.push(u)}return c.length==0&&i.err("No node type or group '"+s+"' found"),c}(n,n.next).map(i=>(n.inline==null?n.inline=i.isInline:n.inline!=i.isInline&&n.err("Mixing inline and block content"),{type:"name",value:i}));return n.pos++,o.length==1?o[0]:{type:"choice",exprs:o}}n.err("Unexpected token '"+n.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=Bw(t,e)}return e}function yf(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Bw(t,e){let n=yf(t),o=n;return t.eat(",")&&(o=t.next!="}"?yf(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:o,expr:e}}function bf(t,e){return e-t}function kf(t,e){let n=[];return function o(i){let s=t[i];if(s.length==1&&!s[0].term)return o(s[0].to);n.push(i);for(let a=0;a<s.length;a++){let{term:l,to:c}=s[a];l||n.indexOf(c)!=-1||o(c)}}(e),n.sort(bf)}function wf(t){let e=Object.create(null);for(let n in t){let o=t[n];if(!o.hasDefault)return null;e[n]=o.default}return e}function xf(t,e){let n=Object.create(null);for(let o in t){let i=e&&e[o];if(i===void 0){let s=t[o];if(!s.hasDefault)throw new RangeError("No value supplied for attribute "+o);i=s.default}n[o]=i}return n}function Cf(t,e,n,o){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let s=t[i];s.validate&&s.validate(e[i])}}function Sf(t,e){let n=Object.create(null);if(e)for(let o in e)n[o]=new Tw(t,o,e[o]);return n}let Ef=class Q0{constructor(e,n,o){this.name=e,this.schema=n,this.spec=o,this.markSet=null,this.groups=o.group?o.group.split(" "):[],this.attrs=Sf(e,o.attrs),this.defaultAttrs=wf(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(o.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ao.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:xf(this.attrs,e)}create(e=null,n,o){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new jt(this,this.computeAttrs(e),$.from(n),Me.setFrom(o))}createChecked(e=null,n,o){return n=$.from(n),this.checkContent(n),new jt(this,this.computeAttrs(e),n,Me.setFrom(o))}createAndFill(e=null,n,o){if(e=this.computeAttrs(e),(n=$.from(n)).size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore($.empty,!0);return s?new jt(this,e,n.append(s),Me.setFrom(o)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let o=0;o<e.childCount;o++)if(!this.allowsMarks(e.child(o).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Cf(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let o=0;o<e.length;o++)this.allowsMarkType(e[o].type)?n&&n.push(e[o]):n||(n=e.slice(0,o));return n?n.length?n:Me.none:e}static compile(e,n){let o=Object.create(null);e.forEach((s,a)=>o[s]=new Q0(s,n,a));let i=n.spec.topNode||"doc";if(!o[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!o.text)throw new RangeError("Every schema needs a 'text' type");for(let s in o.text.attrs)throw new RangeError("The text node type should not have attributes");return o}};class Tw{constructor(e,n,o){this.hasDefault=Object.prototype.hasOwnProperty.call(o,"default"),this.default=o.default,this.validate=typeof o.validate=="string"?function(i,s,a){let l=a.split("|");return c=>{let d=c===null?"null":typeof c;if(l.indexOf(d)<0)throw new RangeError(`Expected value of type ${l} for attribute ${s} on type ${i}, got ${d}`)}}(e,n,o.validate):o.validate}get isRequired(){return!this.hasDefault}}class ts{constructor(e,n,o,i){this.name=e,this.rank=n,this.schema=o,this.spec=i,this.attrs=Sf(e,i.attrs),this.excluded=null;let s=wf(this.attrs);this.instance=s?new Me(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Me(this,xf(this.attrs,e))}static compile(e,n){let o=Object.create(null),i=0;return e.forEach((s,a)=>o[s]=new ts(s,i++,n,a)),o}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Cf(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Mf{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Qe.from(e.nodes),n.marks=Qe.from(e.marks||{}),this.nodes=Ef.compile(this.spec.nodes,this),this.marks=ts.compile(this.spec.marks,this);let o=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],a=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=o[a]||(o[a]=ao.parse(a,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?Nf(this,l.split(" ")):l!=""&&s.inlineContent?null:[]}for(let i in this.marks){let s=this.marks[i],a=s.spec.excludes;s.excluded=a==null?[s]:a==""?[]:Nf(this,a.split(" "))}this.nodeFromJSON=i=>jt.fromJSON(this,i),this.markFromJSON=i=>Me.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,o,i){if(typeof e=="string")e=this.nodeType(e);else{if(!(e instanceof Ef))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(n,o,i)}text(e,n){let o=this.nodes.text;return new es(o,o.defaultAttrs,e,Me.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Nf(t,e){let n=[];for(let o=0;o<e.length;o++){let i=e[o],s=t.marks[i],a=s;if(s)n.push(s);else for(let l in t.marks){let c=t.marks[l];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[o]+"'")}return n}class Bn{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let o=this.matchedStyles=[];n.forEach(i=>{if(function(s){return s.tag!=null}(i))this.tags.push(i);else if(function(s){return s.style!=null}(i)){let s=/[^=]*/.exec(i.style)[0];o.indexOf(s)<0&&o.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let o=new _f(this,n,!1);return o.addAll(e,Me.none,n.from,n.to),o.finish()}parseSlice(e,n={}){let o=new _f(this,n,!0);return o.addAll(e,Me.none,n.from,n.to),J.maxOpen(o.finish())}matchTag(e,n,o){for(let i=o?this.tags.indexOf(o)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(_w(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let a=s.getAttrs(e);if(a===!1)continue;s.attrs=a||void 0}return s}}}matchStyle(e,n,o,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let a=this.styles[s],l=a.style;if(!(l.indexOf(e)!=0||a.context&&!o.matchesContext(a.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(a.getAttrs){let c=a.getAttrs(n);if(c===!1)continue;a.attrs=c||void 0}return a}}}static schemaRules(e){let n=[];function o(i){let s=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let l=n[a];if((l.priority==null?50:l.priority)<s)break}n.splice(a,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(a=>{o(a=Af(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(a=>{o(a=Af(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Bn(e,Bn.schemaRules(e)))}}const Bf={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Ow={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Tf={ol:!0,ul:!0};function Of(t,e,n){return e!=null?(e?1:0)|(e==="full"?2:0):t&&t.whitespace=="pre"?3:-5&n}class Bl{constructor(e,n,o,i,s,a){this.type=e,this.attrs=n,this.marks=o,this.solid=i,this.options=a,this.content=[],this.activeMarks=Me.none,this.match=s||(4&a?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore($.from(e));if(!n){let o,i=this.type.contentMatch;return(o=i.findWrapping(e.type))?(this.match=i,o):null}this.match=this.type.contentMatch.matchFragment(n)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let o,i=this.content[this.content.length-1];if(i&&i.isText&&(o=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=$.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore($.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Bf.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class _f{constructor(e,n,o){this.parser=e,this.options=n,this.isOpen=o,this.open=0,this.localPreserveWS=!1;let i,s=n.topNode,a=Of(null,n.preserveWhitespace,0)|(o?4:0);i=s?new Bl(s.type,s.attrs,Me.none,!0,n.topMatch||s.type.contentMatch,a):new Bl(o?null:e.schema.topNodeType,null,Me.none,!0,null,a),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let o=e.nodeValue,i=this.top,s=2&i.options?"full":this.localPreserveWS||(1&i.options)>0;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(o)){if(s)o=s!=="full"?o.replace(/\r?\n|\r/g," "):o.replace(/\r\n?/g,`
|
|
38
|
+
`);else if(o=o.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(o)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(o=o.slice(1))}o&&this.insertNode(this.parser.schema.text(o),n,!/\S/.test(o)),this.findInText(e)}else this.findInside(e)}addElement(e,n,o){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a,l=e.nodeName.toLowerCase();Tf.hasOwnProperty(l)&&this.parser.normalizeLists&&function(d){for(let u=d.firstChild,p=null;u;u=u.nextSibling){let h=u.nodeType==1?u.nodeName.toLowerCase():null;h&&Tf.hasOwnProperty(h)&&p?(p.appendChild(u),u=p):h=="li"?p=u:h&&(p=null)}}(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,o));e:if(c?c.ignore:Ow.hasOwnProperty(l))this.findInside(e),this.ignoreFallback(e,n);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let d,u=this.needsBlock;if(Bf.hasOwnProperty(l))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),d=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let p=c&&c.skip?n:this.readStyles(e,n);p&&this.addAll(e,p),d&&this.sync(s),this.needsBlock=u}else{let d=this.readStyles(e,n);d&&this.addElementByRule(e,c,d,c.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
39
|
+
`),n)}ignoreFallback(e,n){e.nodeName!="BR"||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let o=e.style;if(o&&o.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],a=o.getPropertyValue(s);if(a)for(let l;;){let c=this.parser.matchStyle(s,a,this,l);if(!c)break;if(c.ignore)return null;if(n=c.clearMark?n.filter(d=>!c.clearMark(d)):n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming!==!1)break;l=c}}return n}addElementByRule(e,n,o,i){let s,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),o,e.nodeName=="BR")||this.leafFallback(e,o);else{let c=this.enter(a,n.attrs||null,o,n.preserveWhitespace);c&&(s=!0,o=c)}else{let c=this.parser.schema.marks[n.mark];o=o.concat(c.create(n.attrs))}let l=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,o,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,o,!1));else{let c=e;typeof n.contentElement=="string"?c=e.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(e):n.contentElement&&(c=n.contentElement),this.findAround(e,c,!0),this.addAll(c,o),this.findAround(e,c,!1)}s&&this.sync(l)&&this.open--}addAll(e,n,o,i){let s=o||0;for(let a=o?e.childNodes[o]:e.firstChild,l=i==null?null:e.childNodes[i];a!=l;a=a.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(a,n);this.findAtPoint(e,s)}findPlace(e,n,o){let i,s;for(let a=this.open,l=0;a>=0;a--){let c=this.nodes[a],d=c.findWrapping(e);if(d&&(!i||i.length>d.length+l)&&(i=d,s=c,!d.length))break;if(c.solid){if(o)break;l+=2}}if(!i)return null;this.sync(s);for(let a=0;a<i.length;a++)n=this.enterInner(i[a],null,n,!1);return n}insertNode(e,n,o){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,o);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let a=Me.none;for(let l of i.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):Vf(l.type,e.type))&&(a=l.addToSet(a));return s.content.push(e.mark(a)),!0}return!1}enter(e,n,o,i){let s=this.findPlace(e.create(n),o,!1);return s&&(s=this.enterInner(e,n,o,!0,i)),s}enterInner(e,n,o,i=!1,s){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let l=Of(e,s,a.options);4&a.options&&a.content.length==0&&(l|=4);let c=Me.none;return o=o.filter(d=>!(a.type?a.type.allowsMarkType(d.type):Vf(d.type,e))||(c=d.addToSet(c),!1)),this.nodes.push(new Bl(e,n,c,i,null,l)),this.open++,o}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=1)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let o=this.nodes[n].content;for(let i=o.length-1;i>=0;i--)e+=o[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let o=0;o<this.find.length;o++)this.find[o].node==e&&this.find[o].offset==n&&(this.find[o].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,o){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(o?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),o=this.options.context,i=!(this.isOpen||o&&o.parent.type!=this.nodes[0].type),s=-(o?o.depth+1:0)+(i?0:1),a=(l,c)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;c>=s;c--)if(a(l-1,c))return!0;return!1}{let u=c>0||c==0&&i?this.nodes[c].type:o&&c>=s?o.node(c-s).type:null;if(!u||u.name!=d&&!u.isInGroup(d))return!1;c--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(o&&o.isTextblock&&o.defaultAttrs)return o}for(let n in this.parser.schema.nodes){let o=this.parser.schema.nodes[n];if(o.isTextblock&&o.defaultAttrs)return o}}}function _w(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Af(t){let e={};for(let n in t)e[n]=t[n];return e}function Vf(t,e){let n=e.schema.nodes;for(let o in n){let i=n[o];if(!i.allowsMarkType(t))continue;let s=[],a=l=>{s.push(l);for(let c=0;c<l.edgeCount;c++){let{type:d,next:u}=l.edge(c);if(d==e||s.indexOf(u)<0&&a(u))return!0}};if(a(i.contentMatch))return!0}}class lo{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},o){o||(o=Tl(n).createDocumentFragment());let i=o,s=[];return e.forEach(a=>{if(s.length||a.marks.length){let l=0,c=0;for(;l<s.length&&c<a.marks.length;){let d=a.marks[c];if(this.marks[d.type.name]){if(!d.eq(s[l][0])||d.type.spec.spanning===!1)break;l++,c++}else c++}for(;l<s.length;)i=s.pop()[1];for(;c<a.marks.length;){let d=a.marks[c++],u=this.serializeMark(d,a.isInline,n);u&&(s.push([d,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),o}serializeNodeInner(e,n){let{dom:o,contentDOM:i}=ns(Tl(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return o}serializeNode(e,n={}){let o=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(o),o=s.dom)}return o}serializeMark(e,n,o={}){let i=this.marks[e.type.name];return i&&ns(Tl(o),i(e,n),null,e.attrs)}static renderSpec(e,n,o=null,i){return ns(e,n,o,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new lo(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=If(e.nodes);return n.text||(n.text=o=>o.text),n}static marksFromSchema(e){return If(e.marks)}}function If(t){let e={};for(let n in t){let o=t[n].spec.toDOM;o&&(e[n]=o)}return e}function Tl(t){return t.document||window.document}const Df=new WeakMap;function ns(t,e,n,o){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i,s=e[0];if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(o&&(i=function(p){let h=Df.get(p);return h===void 0&&Df.set(p,h=function(f){let m=null;return function g(v){if(v&&typeof v=="object")if(Array.isArray(v))if(typeof v[0]=="string")m||(m=[]),m.push(v);else for(let b=0;b<v.length;b++)g(v[b]);else for(let b in v)g(v[b])}(f),m}(p)),h}(o))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a,l=s.indexOf(" ");l>0&&(n=s.slice(0,l),s=s.slice(l+1));let c=n?t.createElementNS(n,s):t.createElement(s),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let p in d)if(d[p]!=null){let h=p.indexOf(" ");h>0?c.setAttributeNS(p.slice(0,h),p.slice(h+1),d[p]):p=="style"&&c.style?c.style.cssText=d[p]:c.setAttribute(p,d[p])}}for(let p=u;p<e.length;p++){let h=e[p];if(h===0){if(p<e.length-1||p>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}{let{dom:f,contentDOM:m}=ns(t,h,n,o);if(c.appendChild(f),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:c,contentDOM:a}}const Rf=Math.pow(2,16);function Aw(t,e){return t+e*Rf}function Lf(t){return 65535&t}class Ol{constructor(e,n,o){this.pos=e,this.delInfo=n,this.recover=o}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Mt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Mt.empty)return Mt.empty}recover(e){let n=0,o=Lf(e);if(!this.inverted)for(let i=0;i<o;i++)n+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*o]+n+function(i){return(i-(65535&i))/Rf}(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,o){let i=0,s=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?i:0);if(c>e)break;let d=this.ranges[l+s],u=this.ranges[l+a],p=c+d;if(e<=p){let h=c+i+((d?e==c?-1:e==p?1:n:n)<0?0:u);if(o)return h;let f=e==(n<0?c:p)?null:Aw(l/3,e-c),m=e==c?2:e==p?1:4;return(n<0?e!=c:e!=p)&&(m|=8),new Ol(h,m,f)}i+=u-d}return o?e+i:new Ol(e+i,0,null)}touches(e,n){let o=0,i=Lf(n),s=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?o:0);if(c>e)break;let d=this.ranges[l+s];if(e<=c+d&&l==3*i)return!0;o+=this.ranges[l+a]-d}return!1}forEach(e){let n=this.inverted?2:1,o=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let a=this.ranges[i],l=a-(this.inverted?s:0),c=a+(this.inverted?0:s),d=this.ranges[i+n],u=this.ranges[i+o];e(l,l+d,c,c+u),s+=u-d}}invert(){return new Mt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Mt.empty:new Mt(e<0?[0,-e,0]:[0,0,e])}}Mt.empty=new Mt([]);class Rr{constructor(e,n,o=0,i=e?e.length:0){this.mirror=n,this.from=o,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Rr(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,o=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?o+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,o=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?o-i-1:void 0)}}invert(){let e=new Rr;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let o=this.from;o<this.to;o++)e=this._maps[o].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,o){let i=0;for(let s=this.from;s<this.to;s++){let a=this._maps[s].mapResult(e,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return o?e:new Ol(e,i,null)}}const _l=Object.create(null);class rt{getMap(){return Mt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let o=_l[n.stepType];if(!o)throw new RangeError(`No step type ${n.stepType} defined`);return o.fromJSON(e,n)}static jsonID(e,n){if(e in _l)throw new RangeError("Duplicate use of step JSON ID "+e);return _l[e]=n,n.prototype.jsonID=e,n}}class We{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new We(e,null)}static fail(e){return new We(null,e)}static fromReplace(e,n,o,i){try{return We.ok(e.replace(n,o,i))}catch(s){if(s instanceof Xi)return We.fail(s.message);throw s}}}function Al(t,e,n){let o=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(Al(s.content,e,s))),s.isInline&&(s=e(s,n,i)),o.push(s)}return $.fromArray(o)}class Tn extends rt{constructor(e,n,o){super(),this.from=e,this.to=n,this.mark=o}apply(e){let n=e.slice(this.from,this.to),o=e.resolve(this.from),i=o.node(o.sharedDepth(this.to)),s=new J(Al(n.content,(a,l)=>a.isAtom&&l.type.allowsMarkType(this.mark.type)?a.mark(this.mark.addToSet(a.marks)):a,i),n.openStart,n.openEnd);return We.fromReplace(e,this.from,this.to,s)}invert(){return new Ft(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),o=e.mapResult(this.to,-1);return n.deleted&&o.deleted||n.pos>=o.pos?null:new Tn(n.pos,o.pos,this.mark)}merge(e){return e instanceof Tn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Tn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Tn(n.from,n.to,e.markFromJSON(n.mark))}}rt.jsonID("addMark",Tn);class Ft extends rt{constructor(e,n,o){super(),this.from=e,this.to=n,this.mark=o}apply(e){let n=e.slice(this.from,this.to),o=new J(Al(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return We.fromReplace(e,this.from,this.to,o)}invert(){return new Tn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),o=e.mapResult(this.to,-1);return n.deleted&&o.deleted||n.pos>=o.pos?null:new Ft(n.pos,o.pos,this.mark)}merge(e){return e instanceof Ft&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ft(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ft(n.from,n.to,e.markFromJSON(n.mark))}}rt.jsonID("removeMark",Ft);class On extends rt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return We.fail("No node at mark step's position");let o=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return We.fromReplace(e,this.pos,this.pos+1,new J($.from(o),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let o=this.mark.addToSet(n.marks);if(o.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(o))return new On(this.pos,n.marks[i]);return new On(this.pos,this.mark)}}return new co(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new On(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new On(n.pos,e.markFromJSON(n.mark))}}rt.jsonID("addNodeMark",On);class co extends rt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return We.fail("No node at mark step's position");let o=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return We.fromReplace(e,this.pos,this.pos+1,new J($.from(o),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return n&&this.mark.isInSet(n.marks)?new On(this.pos,this.mark):this}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new co(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new co(n.pos,e.markFromJSON(n.mark))}}rt.jsonID("removeNodeMark",co);class Je extends rt{constructor(e,n,o,i=!1){super(),this.from=e,this.to=n,this.slice=o,this.structure=i}apply(e){return this.structure&&Vl(e,this.from,this.to)?We.fail("Structure replace would overwrite content"):We.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Mt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Je(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),o=e.mapResult(this.to,-1);return n.deletedAcross&&o.deletedAcross?null:new Je(n.pos,Math.max(n.pos,o.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Je)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let n=this.slice.size+e.slice.size==0?J.empty:new J(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Je(e.from,this.to,n,this.structure)}}{let n=this.slice.size+e.slice.size==0?J.empty:new J(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Je(this.from,this.to+(e.to-e.from),n,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Je(n.from,n.to,J.fromJSON(e,n.slice),!!n.structure)}}rt.jsonID("replace",Je);class Ge extends rt{constructor(e,n,o,i,s,a,l=!1){super(),this.from=e,this.to=n,this.gapFrom=o,this.gapTo=i,this.slice=s,this.insert=a,this.structure=l}apply(e){if(this.structure&&(Vl(e,this.from,this.gapFrom)||Vl(e,this.gapTo,this.to)))return We.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return We.fail("Gap is not a flat range");let o=this.slice.insertAt(this.insert,n.content);return o?We.fromReplace(e,this.from,this.to,o):We.fail("Content does not fit in gap")}getMap(){return new Mt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Ge(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),o=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?o.pos:e.map(this.gapTo,1);return n.deletedAcross&&o.deletedAcross||i<n.pos||s>o.pos?null:new Ge(n.pos,o.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ge(n.from,n.to,n.gapFrom,n.gapTo,J.fromJSON(e,n.slice),n.insert,!!n.structure)}}function Vl(t,e,n){let o=t.resolve(e),i=n-e,s=o.depth;for(;i>0&&s>0&&o.indexAfter(s)==o.node(s).childCount;)s--,i--;if(i>0){let a=o.node(s).maybeChild(o.indexAfter(s));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function Il(t,e,n,o=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),a=[],l=e+1;for(let c=0;c<s.childCount;c++){let d=s.child(c),u=l+d.nodeSize,p=o.matchType(d.type);if(p){o=p;for(let h=0;h<d.marks.length;h++)n.allowsMarkType(d.marks[h].type)||t.step(new Ft(l,u,d.marks[h]));if(i&&d.isText&&n.whitespace!="pre"){let h,f,m=/\r?\n|\r/g;for(;h=m.exec(d.text);)f||(f=new J($.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),a.push(new Je(l+h.index,l+h.index+h[0].length,f))}}else a.push(new Je(l,u,J.empty));l=u}if(!o.validEnd){let c=o.fillBefore($.empty,!0);t.replace(l,l,new J(c,0,0))}for(let c=a.length-1;c>=0;c--)t.step(a[c])}function Vw(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Go(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let o=t.$from.node(n),i=t.$from.index(n),s=t.$to.indexAfter(n);if(n<t.depth&&o.canReplace(i,s,e))return n;if(n==0||o.type.spec.isolating||!Vw(o,i,s))break}return null}function Dl(t,e,n=null,o=t){let i=function(a,l){let{parent:c,startIndex:d,endIndex:u}=a,p=c.contentMatchAt(d).findWrapping(l);if(!p)return null;let h=p.length?p[0]:l;return c.canReplaceWith(d,u,h)?p:null}(t,e),s=i&&function(a,l){let{parent:c,startIndex:d,endIndex:u}=a,p=c.child(d),h=l.contentMatch.findWrapping(p.type);if(!h)return null;let f=(h.length?h[h.length-1]:l).contentMatch;for(let m=d;f&&m<u;m++)f=f.matchType(c.child(m).type);return f&&f.validEnd?h:null}(o,e);return s?i.map(zf).concat({type:e,attrs:n}).concat(s.map(zf)):null}function zf(t){return{type:t,attrs:null}}function $f(t,e,n,o){e.forEach((i,s)=>{if(i.isText){let a,l=/\r?\n|\r/g;for(;a=l.exec(i.text);){let c=t.mapping.slice(o).map(n+1+s+a.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function Pf(t,e,n,o){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let a=t.mapping.slice(o).map(n+1+s);t.replaceWith(a,a+1,e.type.schema.text(`
|
|
40
|
+
`))}})}function dn(t,e,n=1,o){let i=t.resolve(e),s=i.depth-n,a=o&&o[o.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=n-2;d>s;d--,u--){let p=i.node(d),h=i.index(d);if(p.type.spec.isolating)return!1;let f=p.content.cutByIndex(h,p.childCount),m=o&&o[u+1];m&&(f=f.replaceChild(0,m.type.create(m.attrs)));let g=o&&o[u]||p;if(!p.canReplace(h+1,p.childCount)||!g.type.validContent(f))return!1}let l=i.indexAfter(s),c=o&&o[0];return i.node(s).canReplaceWith(l,l,c?c.type:i.node(s+1).type)}function _n(t,e){let n=t.resolve(e),o=n.index();return jf(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(o,o+1)}function jf(t,e){return!(!t||!e||t.isLeaf||!function(n,o){o.content.size||n.type.compatibleContent(o.type);let i=n.contentMatchAt(n.childCount),{linebreakReplacement:s}=n.type.schema;for(let a=0;a<o.childCount;a++){let l=o.child(a),c=l.type==s?n.type.schema.nodes.text:l.type;if(i=i.matchType(c),!i||!n.type.allowsMarks(l.marks))return!1}return i.validEnd}(t,e))}function rs(t,e,n=-1){let o=t.resolve(e);for(let i=o.depth;;i--){let s,a,l=o.index(i);if(i==o.depth?(s=o.nodeBefore,a=o.nodeAfter):n>0?(s=o.node(i+1),l++,a=o.node(i).maybeChild(l)):(s=o.node(i).maybeChild(l-1),a=o.node(i+1)),s&&!s.isTextblock&&jf(s,a)&&o.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?o.before(i):o.after(i)}}function Ff(t,e,n){let o=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let a=o.depth;a>=0;a--){let l=a==o.depth?0:o.pos<=(o.start(a+1)+o.end(a+1))/2?-1:1,c=o.index(a)+(l>0?1:0),d=o.node(a),u=!1;if(s==1)u=d.canReplace(c,c,i);else{let p=d.contentMatchAt(c).findWrapping(i.firstChild.type);u=p&&d.canReplaceWith(c,c,p[0])}if(u)return l==0?o.pos:l<0?o.before(a+1):o.after(a+1)}return null}function is(t,e,n=e,o=J.empty){if(e==n&&!o.size)return null;let i=t.resolve(e),s=t.resolve(n);return Hf(i,s,o)?new Je(e,n,o):new Iw(i,s,o).fit()}function Hf(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}rt.jsonID("replaceAround",Ge);class Iw{constructor(e,n,o){this.$from=e,this.$to=n,this.unplaced=o,this.frontier=[],this.placed=$.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=$.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,o=this.$from,i=this.close(e<0?this.$to:o.doc.resolve(e));if(!i)return null;let s=this.placed,a=o.depth,l=i.depth;for(;a&&l&&s.childCount==1;)s=s.firstChild.content,a--,l--;let c=new J(s,a,l);return e>-1?new Ge(o.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||o.pos!=this.$to.pos?new Je(o.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,o=0,i=this.unplaced.openEnd;o<e;o++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=o){e=o;break}n=s.content}for(let n=1;n<=2;n++)for(let o=n==1?e:this.unplaced.openStart;o>=0;o--){let i,s=null;o?(s=Rl(this.unplaced.content,o-1).firstChild,i=s.content):i=this.unplaced.content;let a=i.firstChild;for(let l=this.depth;l>=0;l--){let c,{type:d,match:u}=this.frontier[l],p=null;if(n==1&&(a?u.matchType(a.type)||(p=u.fillBefore($.from(a),!1)):s&&d.compatibleContent(s.type)))return{sliceDepth:o,frontierDepth:l,parent:s,inject:p};if(n==2&&a&&(c=u.findWrapping(a.type)))return{sliceDepth:o,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:o}=this.unplaced,i=Rl(e,n);return!(!i.childCount||i.firstChild.isLeaf||(this.unplaced=new J(e,n+1,Math.max(o,i.size+n>=e.size-o?n+1:0)),0))}dropNode(){let{content:e,openStart:n,openEnd:o}=this.unplaced,i=Rl(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new J(Lr(e,n-1,1),n-1,s?n-1:o)}else this.unplaced=new J(Lr(e,n,1),n,o)}placeNodes({sliceDepth:e,frontierDepth:n,parent:o,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g<s.length;g++)this.openFrontierNode(s[g]);let a=this.unplaced,l=o?o.content:a.content,c=a.openStart-e,d=0,u=[],{match:p,type:h}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)u.push(i.child(g));p=p.matchFragment(i)}let f=l.size+e-(a.content.size-a.openEnd);for(;d<l.childCount;){let g=l.child(d),v=p.matchType(g.type);if(!v)break;d++,(d>1||c==0||g.content.size)&&(p=v,u.push(Wf(g.mark(h.allowedMarks(g.marks)),d==1?c:0,d==l.childCount?f:-1)))}let m=d==l.childCount;m||(f=-1),this.placed=zr(this.placed,n,$.from(u)),this.frontier[n].match=p,m&&f<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,v=l;g<f;g++){let b=v.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),v=b.content}this.unplaced=m?e==0?J.empty:new J(Lr(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new J(Lr(a.content,e,d),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,n=this.frontier[this.depth];if(!n.type.isTextblock||!Ll(this.$to,this.$to.depth,n.type,n.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:o}=this.$to,i=this.$to.after(o);for(;o>1&&i==this.$to.end(--o);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:o,type:i}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),a=Ll(e,n,i,o,s);if(a){for(let l=n-1;l>=0;l--){let{match:c,type:d}=this.frontier[l],u=Ll(e,l,d,c,!0);if(!u||u.childCount)continue e}return{depth:n,fit:a,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=zr(this.placed,n.depth,n.fit)),e=n.move;for(let o=n.depth+1;o<=e.depth;o++){let i=e.node(o),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(o));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,o){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=zr(this.placed,this.depth,$.from(e.create(n,o))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore($.empty,!0);e.childCount&&(this.placed=zr(this.placed,this.frontier.length,e))}}function Lr(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Lr(t.firstChild.content,e-1,n)))}function zr(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(zr(t.lastChild.content,e-1,n)))}function Rl(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Wf(t,e,n){if(e<=0)return t;let o=t.content;return e>1&&(o=o.replaceChild(0,Wf(o.firstChild,e-1,o.childCount==1?n-1:0))),e>0&&(o=t.type.contentMatch.fillBefore(o).append(o),n<=0&&(o=o.append(t.type.contentMatch.matchFragment(o).fillBefore($.empty,!0)))),t.copy(o)}function Ll(t,e,n,o,i){let s=t.node(e),a=i?t.indexAfter(e):t.index(e);if(a==s.childCount&&!n.compatibleContent(s.type))return null;let l=o.fillBefore(s.content,!0,a);return l&&!function(c,d,u){for(let p=u;p<d.childCount;p++)if(!c.allowsMarks(d.child(p).marks))return!0;return!1}(n,s.content,a)?l:null}function Dw(t){return t.spec.defining||t.spec.definingForContent}function Kf(t,e,n,o,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(Kf(s.content,e+1,n,o,s)))}if(e>o){let s=i.contentMatchAt(0),a=s.fillBefore(t).append(t);t=a.append(s.matchFragment(a).fillBefore($.empty,!0))}return t}function Uf(t,e){let n=[];for(let o=Math.min(t.depth,e.depth);o>=0;o--){let i=t.start(o);if(i<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}class Yo extends rt{constructor(e,n,o){super(),this.pos=e,this.attr=n,this.value=o}apply(e){let n=e.nodeAt(this.pos);if(!n)return We.fail("No node at attribute step's position");let o=Object.create(null);for(let s in n.attrs)o[s]=n.attrs[s];o[this.attr]=this.value;let i=n.type.create(o,null,n.marks);return We.fromReplace(e,this.pos,this.pos+1,new J($.from(i),0,n.isLeaf?0:1))}getMap(){return Mt.empty}invert(e){return new Yo(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Yo(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Yo(n.pos,n.attr,n.value)}}rt.jsonID("attr",Yo);class $r extends rt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let o=e.type.create(n,e.content,e.marks);return We.ok(o)}getMap(){return Mt.empty}invert(e){return new $r(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new $r(n.attr,n.value)}}rt.jsonID("docAttr",$r);let Pr=class extends Error{};Pr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(Pr.prototype=Object.create(Error.prototype)).constructor=Pr,Pr.prototype.name="TransformError";class qf{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Rr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Pr(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,o=J.empty){let i=is(this.doc,e,n,o);return i&&this.step(i),this}replaceWith(e,n,o){return this.replace(e,n,new J($.from(o),0,0))}delete(e,n){return this.replace(e,n,J.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,o){return function(i,s,a,l){if(!l.size)return i.deleteRange(s,a);let c=i.doc.resolve(s),d=i.doc.resolve(a);if(Hf(c,d,l))return i.step(new Je(s,a,l));let u=Uf(c,i.doc.resolve(a));u[u.length-1]==0&&u.pop();let p=-(c.depth+1);u.unshift(p);for(let v=c.depth,b=c.pos-1;v>0;v--,b--){let y=c.node(v).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;u.indexOf(v)>-1?p=v:c.before(v)==b&&u.splice(1,0,-v)}let h=u.indexOf(p),f=[],m=l.openStart;for(let v=l.content,b=0;;b++){let y=v.firstChild;if(f.push(y),b==l.openStart)break;v=y.content}for(let v=m-1;v>=0;v--){let b=f[v],y=Dw(b.type);if(y&&!b.sameMarkup(c.node(Math.abs(p)-1)))m=v;else if(y||!b.type.isTextblock)break}for(let v=l.openStart;v>=0;v--){let b=(v+m+1)%(l.openStart+1),y=f[b];if(y)for(let k=0;k<u.length;k++){let x=u[(k+h)%u.length],w=!0;x<0&&(w=!1,x=-x);let S=c.node(x-1),C=c.index(x-1);if(S.canReplaceWith(C,C,y.type,y.marks))return i.replace(c.before(x),w?d.after(x):a,new J(Kf(l.content,0,l.openStart,b),b,l.openEnd))}}let g=i.steps.length;for(let v=u.length-1;v>=0&&(i.replace(s,a,l),!(i.steps.length>g));v--){let b=u[v];b<0||(s=c.before(b),a=d.after(b))}}(this,e,n,o),this}replaceRangeWith(e,n,o){return function(i,s,a,l){if(!l.isInline&&s==a&&i.doc.resolve(s).parent.content.size){let c=function(d,u,p){let h=d.resolve(u);if(h.parent.canReplaceWith(h.index(),h.index(),p))return u;if(h.parentOffset==0)for(let f=h.depth-1;f>=0;f--){let m=h.index(f);if(h.node(f).canReplaceWith(m,m,p))return h.before(f+1);if(m>0)return null}if(h.parentOffset==h.parent.content.size)for(let f=h.depth-1;f>=0;f--){let m=h.indexAfter(f);if(h.node(f).canReplaceWith(m,m,p))return h.after(f+1);if(m<h.node(f).childCount)return null}return null}(i.doc,s,l.type);c!=null&&(s=a=c)}i.replaceRange(s,a,new J($.from(l),0,0))}(this,e,n,o),this}deleteRange(e,n){return function(o,i,s){let a=o.doc.resolve(i),l=o.doc.resolve(s),c=Uf(a,l);for(let d=0;d<c.length;d++){let u=c[d],p=d==c.length-1;if(p&&u==0||a.node(u).type.contentMatch.validEnd)return o.delete(a.start(u),l.end(u));if(u>0&&(p||a.node(u-1).canReplace(a.index(u-1),l.indexAfter(u-1))))return o.delete(a.before(u),l.after(u))}for(let d=1;d<=a.depth&&d<=l.depth;d++)if(i-a.start(d)==a.depth-d&&s>a.end(d)&&l.end(d)-s!=l.depth-d&&a.start(d-1)==l.start(d-1)&&a.node(d-1).canReplace(a.index(d-1),l.index(d-1)))return o.delete(a.before(d),s);o.delete(i,s)}(this,e,n),this}lift(e,n){return function(o,i,s){let{$from:a,$to:l,depth:c}=i,d=a.before(c+1),u=l.after(c+1),p=d,h=u,f=$.empty,m=0;for(let b=c,y=!1;b>s;b--)y||a.index(b)>0?(y=!0,f=$.from(a.node(b).copy(f)),m++):p--;let g=$.empty,v=0;for(let b=c,y=!1;b>s;b--)y||l.after(b+1)<l.end(b)?(y=!0,g=$.from(l.node(b).copy(g)),v++):h++;o.step(new Ge(p,h,d,u,new J(f.append(g),m,v),f.size-m,!0))}(this,e,n),this}join(e,n=1){return function(o,i,s){let a=null,{linebreakReplacement:l}=o.doc.type.schema,c=o.doc.resolve(i-s),d=c.node().type;if(l&&d.inlineContent){let f=d.whitespace=="pre",m=!!d.contentMatch.matchType(l);f&&!m?a=!1:!f&&m&&(a=!0)}let u=o.steps.length;if(a===!1){let f=o.doc.resolve(i+s);Pf(o,f.node(),f.before(),u)}d.inlineContent&&Il(o,i+s-1,d,c.node().contentMatchAt(c.index()),a==null);let p=o.mapping.slice(u),h=p.map(i-s);if(o.step(new Je(h,p.map(i+s,-1),J.empty,!0)),a===!0){let f=o.doc.resolve(h);$f(o,f.node(),f.before(),o.steps.length)}}(this,e,n),this}wrap(e,n){return function(o,i,s){let a=$.empty;for(let d=s.length-1;d>=0;d--){if(a.size){let u=s[d].type.contentMatch.matchFragment(a);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}a=$.from(s[d].type.create(s[d].attrs,a))}let l=i.start,c=i.end;o.step(new Ge(l,c,l,c,new J(a,0,0),s.length,!0))}(this,e,n),this}setBlockType(e,n=e,o,i=null){return function(s,a,l,c,d){if(!c.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let u=s.steps.length;s.doc.nodesBetween(a,l,(p,h)=>{let f=typeof d=="function"?d(p):d;if(p.isTextblock&&!p.hasMarkup(c,f)&&function(m,g,v){let b=m.resolve(g),y=b.index();return b.parent.canReplaceWith(y,y+1,v)}(s.doc,s.mapping.slice(u).map(h),c)){let m=null;if(c.schema.linebreakReplacement){let y=c.whitespace=="pre",k=!!c.contentMatch.matchType(c.schema.linebreakReplacement);y&&!k?m=!1:!y&&k&&(m=!0)}m===!1&&Pf(s,p,h,u),Il(s,s.mapping.slice(u).map(h,1),c,void 0,m===null);let g=s.mapping.slice(u),v=g.map(h,1),b=g.map(h+p.nodeSize,1);return s.step(new Ge(v,b,v+1,b-1,new J($.from(c.create(f,null,p.marks)),0,0),1,!0)),m===!0&&$f(s,p,h,u),!1}})}(this,e,n,o,i),this}setNodeMarkup(e,n,o=null,i){return function(s,a,l,c,d){let u=s.doc.nodeAt(a);if(!u)throw new RangeError("No node at given position");l||(l=u.type);let p=l.create(c,null,d||u.marks);if(u.isLeaf)return s.replaceWith(a,a+u.nodeSize,p);if(!l.validContent(u.content))throw new RangeError("Invalid content for node type "+l.name);s.step(new Ge(a,a+u.nodeSize,a+1,a+u.nodeSize-1,new J($.from(p),0,0),1,!0))}(this,e,n,o,i),this}setNodeAttribute(e,n,o){return this.step(new Yo(e,n,o)),this}setDocAttribute(e,n){return this.step(new $r(e,n)),this}addNodeMark(e,n){return this.step(new On(e,n)),this}removeNodeMark(e,n){let o=this.doc.nodeAt(e);if(!o)throw new RangeError("No node at position "+e);if(n instanceof Me)n.isInSet(o.marks)&&this.step(new co(e,n));else{let i,s=o.marks,a=[];for(;i=n.isInSet(s);)a.push(new co(e,i)),s=i.removeFromSet(s);for(let l=a.length-1;l>=0;l--)this.step(a[l])}return this}split(e,n=1,o){return function(i,s,a=1,l){let c=i.doc.resolve(s),d=$.empty,u=$.empty;for(let p=c.depth,h=c.depth-a,f=a-1;p>h;p--,f--){d=$.from(c.node(p).copy(d));let m=l&&l[f];u=$.from(m?m.type.create(m.attrs,u):c.node(p).copy(u))}i.step(new Je(s,s,new J(d.append(u),a,a),!0))}(this,e,n,o),this}addMark(e,n,o){return function(i,s,a,l){let c,d,u=[],p=[];i.doc.nodesBetween(s,a,(h,f,m)=>{if(!h.isInline)return;let g=h.marks;if(!l.isInSet(g)&&m.type.allowsMarkType(l.type)){let v=Math.max(f,s),b=Math.min(f+h.nodeSize,a),y=l.addToSet(g);for(let k=0;k<g.length;k++)g[k].isInSet(y)||(c&&c.to==v&&c.mark.eq(g[k])?c.to=b:u.push(c=new Ft(v,b,g[k])));d&&d.to==v?d.to=b:p.push(d=new Tn(v,b,l))}}),u.forEach(h=>i.step(h)),p.forEach(h=>i.step(h))}(this,e,n,o),this}removeMark(e,n,o){return function(i,s,a,l){let c=[],d=0;i.doc.nodesBetween(s,a,(u,p)=>{if(!u.isInline)return;d++;let h=null;if(l instanceof ts){let f,m=u.marks;for(;f=l.isInSet(m);)(h||(h=[])).push(f),m=f.removeFromSet(m)}else l?l.isInSet(u.marks)&&(h=[l]):h=u.marks;if(h&&h.length){let f=Math.min(p+u.nodeSize,a);for(let m=0;m<h.length;m++){let g,v=h[m];for(let b=0;b<c.length;b++){let y=c[b];y.step==d-1&&v.eq(c[b].style)&&(g=y)}g?(g.to=f,g.step=d):c.push({style:v,from:Math.max(p,s),to:f,step:d})}}}),c.forEach(u=>i.step(new Ft(u.from,u.to,u.style)))}(this,e,n,o),this}clearIncompatible(e,n,o){return Il(this,e,n,o),this}}const zl=Object.create(null);class pe{constructor(e,n,o){this.$anchor=e,this.$head=n,this.ranges=o||[new Rw(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=J.empty){let o=n.content.lastChild,i=null;for(let l=0;l<n.openEnd;l++)i=o,o=o.lastChild;let s=e.steps.length,a=this.ranges;for(let l=0;l<a.length;l++){let{$from:c,$to:d}=a[l],u=e.mapping.slice(s);e.replaceRange(u.map(c.pos),u.map(d.pos),l?J.empty:n),l==0&&Yf(e,s,(o?o.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let o=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=e.mapping.slice(o),d=c.map(a.pos),u=c.map(l.pos);s?e.deleteRange(d,u):(e.replaceRangeWith(d,u,n),Yf(e,o,n.isInline?-1:1))}}static findFrom(e,n,o=!1){let i=e.parent.inlineContent?new se(e):Xo(e.node(0),e.parent,e.pos,e.index(),n,o);if(i)return i;for(let s=e.depth-1;s>=0;s--){let a=n<0?Xo(e.node(0),e.node(s),e.before(s+1),e.index(s),n,o):Xo(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,o);if(a)return a}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Nt(e.node(0))}static atStart(e){return Xo(e,e,0,0,1)||new Nt(e)}static atEnd(e){return Xo(e,e,e.content.size,e.childCount,-1)||new Nt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let o=zl[n.type];if(!o)throw new RangeError(`No selection type ${n.type} defined`);return o.fromJSON(e,n)}static jsonID(e,n){if(e in zl)throw new RangeError("Duplicate use of selection JSON ID "+e);return zl[e]=n,n.prototype.jsonID=e,n}getBookmark(){return se.between(this.$anchor,this.$head).getBookmark()}}pe.prototype.visible=!0;class Rw{constructor(e,n){this.$from=e,this.$to=n}}let Jf=!1;function Gf(t){Jf||t.parent.inlineContent||(Jf=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class se extends pe{constructor(e,n=e){Gf(e),Gf(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let o=e.resolve(n.map(this.head));if(!o.parent.inlineContent)return pe.near(o);let i=e.resolve(n.map(this.anchor));return new se(i.parent.inlineContent?i:o,o)}replace(e,n=J.empty){if(super.replace(e,n),n==J.empty){let o=this.$from.marksAcross(this.$to);o&&e.ensureMarks(o)}}eq(e){return e instanceof se&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ss(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new se(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,o=n){let i=e.resolve(n);return new this(i,o==n?i:e.resolve(o))}static between(e,n,o){let i=e.pos-n.pos;if(o&&!i||(o=i>=0?1:-1),!n.parent.inlineContent){let s=pe.findFrom(n,o,!0)||pe.findFrom(n,-o,!0);if(!s)return pe.near(n,o);n=s.$head}return e.parent.inlineContent||(i==0||(e=(pe.findFrom(e,-o,!0)||pe.findFrom(e,o,!0)).$anchor).pos<n.pos!=i<0)&&(e=n),new se(e,n)}}pe.jsonID("text",se);class ss{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ss(e.map(this.anchor),e.map(this.head))}resolve(e){return se.between(e.resolve(this.anchor),e.resolve(this.head))}}class ne extends pe{constructor(e){let n=e.nodeAfter,o=e.node(0).resolve(e.pos+n.nodeSize);super(e,o),this.node=n}map(e,n){let{deleted:o,pos:i}=n.mapResult(this.anchor),s=e.resolve(i);return o?pe.near(s):new ne(s)}content(){return new J($.from(this.node),0,0)}eq(e){return e instanceof ne&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new $l(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ne(e.resolve(n.anchor))}static create(e,n){return new ne(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ne.prototype.visible=!1,pe.jsonID("node",ne);class $l{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:o}=e.mapResult(this.anchor);return n?new ss(o,o):new $l(o)}resolve(e){let n=e.resolve(this.anchor),o=n.nodeAfter;return o&&ne.isSelectable(o)?new ne(n):pe.near(n)}}class Nt extends pe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=J.empty){if(n==J.empty){e.delete(0,e.doc.content.size);let o=pe.atStart(e.doc);o.eq(e.selection)||e.setSelection(o)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Nt(e)}map(e){return new Nt(e)}eq(e){return e instanceof Nt}getBookmark(){return Lw}}pe.jsonID("all",Nt);const Lw={map(){return this},resolve:t=>new Nt(t)};function Xo(t,e,n,o,i,s=!1){if(e.inlineContent)return se.create(t,n);for(let a=o-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let l=e.child(a);if(l.isAtom){if(!s&&ne.isSelectable(l))return ne.create(t,n-(i<0?l.nodeSize:0))}else{let c=Xo(t,l,n+i,i<0?l.childCount:0,i,s);if(c)return c}n+=l.nodeSize*i}return null}function Yf(t,e,n){let o=t.steps.length-1;if(o<e)return;let i,s=t.steps[o];(s instanceof Je||s instanceof Ge)&&(t.mapping.maps[o].forEach((a,l,c,d)=>{i==null&&(i=d)}),t.setSelection(pe.near(t.doc.resolve(i),n)))}class zw extends qf{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return Me.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,n){super.addStep(e,n),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let o=this.selection;return n&&(e=e.mark(this.storedMarks||(o.empty?o.$from.marks():o.$from.marksAcross(o.$to)||Me.none))),o.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,o){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(o==null&&(o=n),o=o??n,!e)return this.deleteRange(n,o);let s=this.storedMarks;if(!s){let a=this.doc.resolve(n);s=o==n?a.marks():a.marksAcross(this.doc.resolve(o))}return this.replaceRangeWith(n,o,i.text(e,s)),this.selection.empty||this.setSelection(pe.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Xf(t,e){return e&&t?t.bind(e):t}class jr{constructor(e,n,o){this.name=e,this.init=Xf(n.init,o),this.apply=Xf(n.apply,o)}}const $w=[new jr("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new jr("selection",{init:(t,e)=>t.selection||pe.atStart(e.doc),apply:t=>t.selection}),new jr("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,o)=>o.selection.$cursor?t.storedMarks:null}),new jr("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class Pl{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=$w.slice(),n&&n.forEach(o=>{if(this.pluginsByKey[o.key])throw new RangeError("Adding different instances of a keyed plugin ("+o.key+")");this.plugins.push(o),this.pluginsByKey[o.key]=o,o.spec.state&&this.fields.push(new jr(o.key,o.spec.state,o))})}}class Zo{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let o=0;o<this.config.plugins.length;o++)if(o!=n){let i=this.config.plugins[o];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],o=this.applyInner(e),i=null;for(;;){let s=!1;for(let a=0;a<this.config.plugins.length;a++){let l=this.config.plugins[a];if(l.spec.appendTransaction){let c=i?i[a].n:0,d=i?i[a].state:this,u=c<n.length&&l.spec.appendTransaction.call(l,c?n.slice(c):n,d,o);if(u&&o.filterTransaction(u,a)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let p=0;p<this.config.plugins.length;p++)i.push(p<a?{state:o,n:n.length}:{state:this,n:0})}n.push(u),o=o.applyInner(u),s=!0}i&&(i[a]={state:o,n:n.length})}}if(!s)return{state:o,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Zo(this.config),o=this.config.fields;for(let i=0;i<o.length;i++){let s=o[i];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new zw(this)}static create(e){let n=new Pl(e.doc?e.doc.type.schema:e.schema,e.plugins),o=new Zo(n);for(let i=0;i<n.fields.length;i++)o[n.fields[i].name]=n.fields[i].init(e,o);return o}reconfigure(e){let n=new Pl(this.schema,e.plugins),o=n.fields,i=new Zo(n);for(let s=0;s<o.length;s++){let a=o[s].name;i[a]=this.hasOwnProperty(a)?this[a]:o[s].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(o=>o.toJSON())),e&&typeof e=="object")for(let o in e){if(o=="doc"||o=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[o],s=i.spec.state;s&&s.toJSON&&(n[o]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,o){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Pl(e.schema,e.plugins),s=new Zo(i);return i.fields.forEach(a=>{if(a.name=="doc")s.doc=jt.fromJSON(e.schema,n.doc);else if(a.name=="selection")s.selection=pe.fromJSON(s.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(o)for(let l in o){let c=o[l],d=c.spec.state;if(c.key==a.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l))return void(s[a.name]=d.fromJSON.call(c,e,n[l],s))}s[a.name]=a.init(e,s)}}),s}}function Zf(t,e,n){for(let o in t){let i=t[o];i instanceof Function?i=i.bind(e):o=="handleDOMEvents"&&(i=Zf(i,e,{})),n[o]=i}return n}class Le{constructor(e){this.spec=e,this.props={},e.props&&Zf(e.props,this,this.props),this.key=e.key?e.key.key:Qf("plugin")}getState(e){return e[this.key]}}const jl=Object.create(null);function Qf(t){return t in jl?t+"$"+ ++jl[t]:(jl[t]=0,t+"$")}class Ye{constructor(e="key"){this.key=Qf(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Fl=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function em(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const tm=(t,e,n)=>{let o=em(t,n);if(!o)return!1;let i=Hl(o);if(!i){let a=o.blockRange(),l=a&&Go(a);return l!=null&&(e&&e(t.tr.lift(a,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(dm(t,i,e,-1))return!0;if(o.parent.content.size==0&&(Qo(s,"end")||ne.isSelectable(s)))for(let a=o.depth;;a--){let l=is(t.doc,o.before(a),o.after(a),J.empty);if(l&&l.slice.size<l.to-l.from){if(e){let c=t.tr.step(l);c.setSelection(Qo(s,"end")?pe.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):ne.create(c.doc,i.pos-s.nodeSize)),e(c.scrollIntoView())}return!0}if(a==1||o.node(a-1).childCount>1)break}return!(!s.isAtom||i.depth!=o.depth-1||(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),0))};function nm(t,e,n){let o=e.nodeBefore,i=e.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;let c=o.lastChild;if(!c)return!1;o=c}let s=e.nodeAfter,a=e.pos+1;for(;!s.isTextblock;a++){if(s.type.spec.isolating)return!1;let c=s.firstChild;if(!c)return!1;s=c}let l=is(t.doc,i,a,J.empty);if(!l||l.from!=i||l instanceof Je&&l.slice.size>=a-i)return!1;if(n){let c=t.tr.step(l);c.setSelection(se.create(c.doc,i)),n(c.scrollIntoView())}return!0}function Qo(t,e,n=!1){for(let o=t;o;o=e=="start"?o.firstChild:o.lastChild){if(o.isTextblock)return!0;if(n&&o.childCount!=1)return!1}return!1}const om=(t,e,n)=>{let{$head:o,empty:i}=t.selection,s=o;if(!i)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):o.parentOffset>0)return!1;s=Hl(o)}let a=s&&s.nodeBefore;return!(!a||!ne.isSelectable(a)||(e&&e(t.tr.setSelection(ne.create(t.doc,s.pos-a.nodeSize)).scrollIntoView()),0))};function Hl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function rm(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const im=(t,e,n)=>{let o=rm(t,n);if(!o)return!1;let i=Wl(o);if(!i)return!1;let s=i.nodeAfter;if(dm(t,i,e,1))return!0;if(o.parent.content.size==0&&(Qo(s,"start")||ne.isSelectable(s))){let a=is(t.doc,o.before(),o.after(),J.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Qo(s,"start")?pe.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):ne.create(l.doc,l.mapping.map(i.pos))),e(l.scrollIntoView())}return!0}}return!(!s.isAtom||i.depth!=o.depth-1||(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),0))},sm=(t,e,n)=>{let{$head:o,empty:i}=t.selection,s=o;if(!i)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):o.parentOffset<o.parent.content.size)return!1;s=Wl(o)}let a=s&&s.nodeAfter;return!(!a||!ne.isSelectable(a)||(e&&e(t.tr.setSelection(ne.create(t.doc,s.pos)).scrollIntoView()),0))};function Wl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const am=(t,e)=>{let{$head:n,$anchor:o}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(o)||(e&&e(t.tr.insertText(`
|
|
41
|
+
`).scrollIntoView()),0))};function Kl(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const lm=(t,e)=>{let n=t.selection,{$from:o,$to:i}=n;if(n instanceof Nt||o.parent.inlineContent||i.parent.inlineContent)return!1;let s=Kl(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let a=(!o.parentOffset&&i.index()<i.parent.childCount?o:i).pos,l=t.tr.insert(a,s.createAndFill());l.setSelection(se.create(l.doc,a+1)),e(l.scrollIntoView())}return!0},cm=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(dn(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let o=n.blockRange(),i=o&&Go(o);return i!=null&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)};function dm(t,e,n,o){let i,s,a=e.nodeBefore,l=e.nodeAfter,c=a.type.spec.isolating||l.type.spec.isolating;if(!c&&function(f,m,g){let v=m.nodeBefore,b=m.nodeAfter,y=m.index();return!(!(v&&b&&v.type.compatibleContent(b.type))||(!v.content.size&&m.parent.canReplace(y-1,y)?(g&&g(f.tr.delete(m.pos-v.nodeSize,m.pos).scrollIntoView()),0):!m.parent.canReplace(y,y+1)||!b.isTextblock&&!_n(f.doc,m.pos)||(g&&g(f.tr.join(m.pos).scrollIntoView()),0)))}(t,e,n))return!0;let d=!c&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(i=(s=a.contentMatchAt(a.childCount)).findWrapping(l.type))&&s.matchType(i[0]||l.type).validEnd){if(n){let f=e.pos+l.nodeSize,m=$.empty;for(let b=i.length-1;b>=0;b--)m=$.from(i[b].create(null,m));m=$.from(a.copy(m));let g=t.tr.step(new Ge(e.pos-1,f,e.pos,f,new J(m,1,0),i.length,!0)),v=g.doc.resolve(f+2*i.length);v.nodeAfter&&v.nodeAfter.type==a.type&&_n(g.doc,v.pos)&&g.join(v.pos),n(g.scrollIntoView())}return!0}let u=l.type.spec.isolating||o>0&&c?null:pe.findFrom(e,1),p=u&&u.$from.blockRange(u.$to),h=p&&Go(p);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(p,h).scrollIntoView()),!0;if(d&&Qo(l,"start",!0)&&Qo(a,"end")){let f=a,m=[];for(;m.push(f),!f.isTextblock;)f=f.lastChild;let g=l,v=1;for(;!g.isTextblock;g=g.firstChild)v++;if(f.canReplace(f.childCount,f.childCount,g.content)){if(n){let b=$.empty;for(let y=m.length-1;y>=0;y--)b=$.from(m[y].copy(b));n(t.tr.step(new Ge(e.pos-m.length,e.pos+l.nodeSize,e.pos+v,e.pos+l.nodeSize-v,new J(b,m.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function um(t){return function(e,n){let o=e.selection,i=t<0?o.$from:o.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return!!i.node(s).isTextblock&&(n&&n(e.tr.setSelection(se.create(e.doc,t<0?i.start(s):i.end(s)))),!0)}}const Pw=um(-1),jw=um(1);function pm(t,e=null){return function(n,o){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];n.doc.nodesBetween(a,l,(c,d)=>{if(i)return!1;if(c.isTextblock&&!c.hasMarkup(t,e))if(c.type==t)i=!0;else{let u=n.doc.resolve(d),p=u.index();i=u.parent.canReplaceWith(p,p+1,t)}})}if(!i)return!1;if(o){let s=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:l},$to:{pos:c}}=n.selection.ranges[a];s.setBlockType(l,c,t,e)}o(s.scrollIntoView())}return!0}}function Ul(...t){return function(e,n,o){for(let i=0;i<t.length;i++)if(t[i](e,n,o))return!0;return!1}}Ul(Fl,tm,om),Ul(Fl,im,sm),Ul(am,lm,cm,(t,e)=>{let{$from:n,$to:o}=t.selection;if(t.selection instanceof ne&&t.selection.node.isBlock)return!(!n.parentOffset||!dn(t.doc,n.pos)||(e&&e(t.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let i,s,a=[],l=!1,c=!1;for(let h=n.depth;;h--){if(n.node(h).isBlock){l=n.end(h)==n.pos+(n.depth-h),c=n.start(h)==n.pos-(n.depth-h),s=Kl(n.node(h-1).contentMatchAt(n.indexAfter(h-1))),a.unshift(l&&s?{type:s}:null),i=h;break}if(h==1)return!1;a.unshift(null)}let d=t.tr;(t.selection instanceof se||t.selection instanceof Nt)&&d.deleteSelection();let u=d.mapping.map(n.pos),p=dn(d.doc,u,a.length,a);if(p||(a[0]=s?{type:s}:null,p=dn(d.doc,u,a.length,a)),!p)return!1;if(d.split(u,a.length,a),!l&&c&&n.node(i).type!=s){let h=d.mapping.map(n.before(i)),f=d.doc.resolve(h);s&&n.node(i-1).canReplaceWith(f.index(),f.index()+1,s)&&d.setNodeMarkup(d.mapping.map(n.before(i)),s)}return e&&e(d.scrollIntoView()),!0}),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform();const et=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},er=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let ql=null;const un=function(t,e,n){let o=ql||(ql=document.createRange());return o.setEnd(t,n??t.nodeValue.length),o.setStart(t,e||0),o},uo=function(t,e,n,o){return n&&(hm(t,e,n,o,-1)||hm(t,e,n,o,1))},Fw=/^(img|br|input|textarea|hr)$/i;function hm(t,e,n,o,i){for(var s;;){if(t==n&&e==o)return!0;if(e==(i<0?0:Vt(t))){let a=t.parentNode;if(!a||a.nodeType!=1||Fr(t)||Fw.test(t.nodeName)||t.contentEditable=="false")return!1;e=et(t)+(i<0?0:1),t=a}else{if(t.nodeType!=1)return!1;{let a=t.childNodes[e+(i<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false"){if(!(!((s=a.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection))return!1;e+=i}else t=a,e=i<0?Vt(t):0}}}}function Vt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Fr(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const as=function(t){return t.focusNode&&uo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function po(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const Xt=typeof navigator<"u"?navigator:null,fm=typeof document<"u"?document:null,An=Xt&&Xt.userAgent||"",Jl=/Edge\/(\d+)/.exec(An),mm=/MSIE \d/.exec(An),Gl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(An),yt=!!(mm||Gl||Jl),Vn=mm?document.documentMode:Gl?+Gl[1]:Jl?+Jl[1]:0,It=!yt&&/gecko\/(\d+)/i.test(An);It&&(/Firefox\/(\d+)/.exec(An)||[0,0])[1];const Yl=!yt&&/Chrome\/(\d+)/.exec(An),it=!!Yl,gm=Yl?+Yl[1]:0,dt=!yt&&!!Xt&&/Apple Computer/.test(Xt.vendor),tr=dt&&(/Mobile\/\w+/.test(An)||!!Xt&&Xt.maxTouchPoints>2),Dt=tr||!!Xt&&/Mac/.test(Xt.platform),Hw=!!Xt&&/Win/.test(Xt.platform),pn=/Android \d/.test(An),Hr=!!fm&&"webkitFontSmoothing"in fm.documentElement.style,Ww=Hr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Kw(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function hn(t,e){return typeof t=="number"?t:t[e]}function Uw(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,o=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*o}}function vm(t,e,n){let o=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let a=n||t.dom;a;){if(a.nodeType!=1){a=er(a);continue}let l=a,c=l==s.body,d=c?Kw(s):Uw(l),u=0,p=0;if(e.top<d.top+hn(o,"top")?p=-(d.top-e.top+hn(i,"top")):e.bottom>d.bottom-hn(o,"bottom")&&(p=e.bottom-e.top>d.bottom-d.top?e.top+hn(i,"top")-d.top:e.bottom-d.bottom+hn(i,"bottom")),e.left<d.left+hn(o,"left")?u=-(d.left-e.left+hn(i,"left")):e.right>d.right-hn(o,"right")&&(u=e.right-d.right+hn(i,"right")),u||p)if(c)s.defaultView.scrollBy(u,p);else{let f=l.scrollLeft,m=l.scrollTop;p&&(l.scrollTop+=p),u&&(l.scrollLeft+=u);let g=l.scrollLeft-f,v=l.scrollTop-m;e={left:e.left-g,top:e.top-v,right:e.right-g,bottom:e.bottom-v}}let h=c?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(h))break;a=h=="absolute"?a.offsetParent:er(a)}}function ym(t){let e=[],n=t.ownerDocument;for(let o=t;o&&(e.push({dom:o,top:o.scrollTop,left:o.scrollLeft}),t!=n);o=er(o));return e}function bm(t,e){for(let n=0;n<t.length;n++){let{dom:o,top:i,left:s}=t[n];o.scrollTop!=i+e&&(o.scrollTop=i+e),o.scrollLeft!=s&&(o.scrollLeft=s)}}let nr=null;function km(t,e){let n,o,i,s,a=2e8,l=0,c=e.top,d=e.top;for(let u=t.firstChild,p=0;u;u=u.nextSibling,p++){let h;if(u.nodeType==1)h=u.getClientRects();else{if(u.nodeType!=3)continue;h=un(u).getClientRects()}for(let f=0;f<h.length;f++){let m=h[f];if(m.top<=c&&m.bottom>=d){c=Math.max(m.bottom,c),d=Math.min(m.top,d);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<a){n=u,a=g,o=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(l=p+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!i&&m.left<=e.left&&m.right>=e.left&&(i=u,s={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(l=p+1)}}return!n&&i&&(n=i,o=s,a=0),n&&n.nodeType==3?function(u,p){let h=u.nodeValue.length,f=document.createRange();for(let m=0;m<h;m++){f.setEnd(u,m+1),f.setStart(u,m);let g=In(f,1);if(g.top!=g.bottom&&Xl(p,g))return{node:u,offset:m+(p.left>=(g.left+g.right)/2?1:0)}}return{node:u,offset:0}}(n,o):!n||a&&n.nodeType==1?{node:t,offset:l}:km(n,o)}function Xl(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function wm(t,e,n){let o=t.childNodes.length;if(o&&n.top<n.bottom)for(let i=Math.max(0,Math.min(o-1,Math.floor(o*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let a=t.childNodes[s];if(a.nodeType==1){let l=a.getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(Xl(e,d))return wm(a,e,d)}}if((s=(s+1)%o)==i)break}return t}function qw(t,e){let n,o=t.dom.ownerDocument,i=0,s=function(d,u,p){if(d.caretPositionFromPoint)try{let h=d.caretPositionFromPoint(u,p);if(h)return{node:h.offsetNode,offset:Math.min(Vt(h.offsetNode),h.offset)}}catch{}if(d.caretRangeFromPoint){let h=d.caretRangeFromPoint(u,p);if(h)return{node:h.startContainer,offset:Math.min(Vt(h.startContainer),h.startOffset)}}}(o,e.left,e.top);s&&({node:n,offset:i}=s);let a,l=(t.root.elementFromPoint?t.root:o).elementFromPoint(e.left,e.top);if(!l||!t.dom.contains(l.nodeType!=1?l.parentNode:l)){let d=t.dom.getBoundingClientRect();if(!Xl(e,d)||(l=wm(t.dom,e,d),!l))return null}if(dt)for(let d=l;n&&d;d=er(d))d.draggable&&(n=void 0);if(l=function(d,u){let p=d.parentNode;return p&&/^li$/i.test(p.nodeName)&&u.left<d.getBoundingClientRect().left?p:d}(l,e),n){if(It&&n.nodeType==1&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let u,p=n.childNodes[i];p.nodeName=="IMG"&&(u=p.getBoundingClientRect()).right<=e.left&&u.bottom>e.top&&i++}let d;Hr&&i&&n.nodeType==1&&(d=n.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,n==t.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:i!=0&&n.nodeType==1&&n.childNodes[i-1].nodeName=="BR"||(a=function(u,p,h,f){let m=-1;for(let g=p,v=!1;g!=u.dom;){let b,y=u.docView.nearestDesc(g,!0);if(!y)return null;if(y.dom.nodeType==1&&(y.node.isBlock&&y.parent||!y.contentDOM)&&((b=y.dom.getBoundingClientRect()).width||b.height)&&(y.node.isBlock&&y.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(y.dom.nodeName)&&(!v&&b.left>f.left||b.top>f.top?m=y.posBefore:(!v&&b.right<f.left||b.bottom<f.top)&&(m=y.posAfter),v=!0),!y.contentDOM&&m<0&&!y.node.isText))return(y.node.isBlock?f.top<(b.top+b.bottom)/2:f.left<(b.left+b.right)/2)?y.posBefore:y.posAfter;g=y.dom.parentNode}return m>-1?m:u.docView.posFromDOM(p,h,-1)}(t,n,i,e))}a==null&&(a=function(d,u,p){let{node:h,offset:f}=km(u,p),m=-1;if(h.nodeType==1&&!h.firstChild){let g=h.getBoundingClientRect();m=g.left!=g.right&&p.left>(g.left+g.right)/2?1:-1}return d.docView.posFromDOM(h,f,m)}(t,l,e));let c=t.docView.nearestDesc(l,!0);return{pos:a,inside:c?c.posAtStart-c.border:-1}}function xm(t){return t.top<t.bottom||t.left<t.right}function In(t,e){let n=t.getClientRects();if(n.length){let o=n[e<0?0:n.length-1];if(xm(o))return o}return Array.prototype.find.call(n,xm)||t.getBoundingClientRect()}const Jw=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Cm(t,e,n){let{node:o,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),a=Hr||It;if(o.nodeType==3){if(!a||!Jw.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){let l=i,c=i,d=n<0?1:-1;return n<0&&!i?(c++,d=-1):n>=0&&i==o.nodeValue.length?(l--,d=1):n<0?l--:c++,Wr(In(un(o,l,c),d),d<0)}{let l=In(un(o,i,i),n);if(It&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){let c=In(un(o,i-1,i-1),-1);if(c.top==l.top){let d=In(un(o,i,i+1),-1);if(d.top!=l.top)return Wr(d,d.left<c.left)}}return l}}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==Vt(o))){let l=o.childNodes[i-1];if(l.nodeType==1)return Zl(l.getBoundingClientRect(),!1)}if(s==null&&i<Vt(o)){let l=o.childNodes[i];if(l.nodeType==1)return Zl(l.getBoundingClientRect(),!0)}return Zl(o.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==Vt(o))){let l=o.childNodes[i-1],c=l.nodeType==3?un(l,Vt(l)-(a?0:1)):l.nodeType!=1||l.nodeName=="BR"&&l.nextSibling?null:l;if(c)return Wr(In(c,1),!1)}if(s==null&&i<Vt(o)){let l=o.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?un(l,0,a?0:1):l.nodeType==1?l:null:null;if(c)return Wr(In(c,-1),!0)}return Wr(In(o.nodeType==3?un(o):o,-n),n>=0)}function Wr(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Zl(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Sm(t,e,n){let o=t.state,i=t.root.activeElement;o!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{o!=e&&t.updateState(o),i!=t.dom&&i&&i.focus()}}const Gw=/[\u0590-\u08ac]/;let Em=null,Mm=null,Nm=!1;class Kr{constructor(e,n,o,i){this.parent=e,this.children=n,this.dom=o,this.contentDOM=i,this.dirty=0,o.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,o){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,o=this.posAtStart;;n++){let i=this.children[n];if(i==e)return o;o+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,o){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode)){if(o<0){let s,a;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&(!(a=s.pmViewDesc)||a.parent!=this);)s=s.previousSibling;return s?this.posBeforeChild(a)+a.size:this.posAtStart}{let s,a;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&(!(a=s.pmViewDesc)||a.parent!=this);)s=s.nextSibling;return s?this.posBeforeChild(a):this.posAtEnd}}let i;if(e==this.dom&&this.contentDOM)i=n>et(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??o>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let o=!0,i=e;i;i=i.parentNode){let s,a=this.getDesc(i);if(a&&(!n||a.node)){if(!o||!(s=a.nodeDOM)||(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))return a;o=!1}}}getDesc(e){let n=e.pmViewDesc;for(let o=n;o;o=o.parent)if(o==this)return n}posFromDOM(e,n,o){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,o)}return-1}descAt(e){for(let n=0,o=0;n<this.children.length;n++){let i=this.children[n],s=o+i.size;if(o==e&&s!=o){for(;!i.border&&i.children.length;)for(let a=0;a<i.children.length;a++){let l=i.children[a];if(l.size){i=l;break}}return i}if(e<s)return i.descAt(e-o-i.border);o=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let o=0,i=0;for(let s=0;o<this.children.length;o++){let a=this.children[o],l=s+a.size;if(l>e||a instanceof Om){i=e-s;break}s=l}if(i)return this.children[o].domFromPos(i-this.children[o].border,n);for(let s;o&&!(s=this.children[o-1]).size&&s instanceof Bm&&s.side>=0;o--);if(n<=0){let s,a=!0;for(;s=o?this.children[o-1]:null,s&&s.dom.parentNode!=this.contentDOM;o--,a=!1);return s&&n&&a&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?et(s.dom)+1:0}}{let s,a=!0;for(;s=o<this.children.length?this.children[o]:null,s&&s.dom.parentNode!=this.contentDOM;o++,a=!1);return s&&a&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?et(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,o=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let a=o,l=0;;l++){let c=this.children[l],d=a+c.size;if(i==-1&&e<=d){let u=a+c.border;if(e>=u&&n<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,n,u);e=a;for(let p=l;p>0;p--){let h=this.children[p-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=et(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(d>n||l==this.children.length-1)){n=d;for(let u=l+1;u<this.children.length;u++){let p=this.children[u];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){s=et(p.dom);break}n+=p.size}s==-1&&(s=this.contentDOM.childNodes.length);break}a=d}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:o}=this.domFromPos(e,0);if(n.nodeType!=1||o==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[o]}setSelection(e,n,o,i=!1){let s=Math.min(e,n),a=Math.max(e,n);for(let f=0,m=0;f<this.children.length;f++){let g=this.children[f],v=m+g.size;if(s>m&&a<v)return g.setSelection(e-m-g.border,n-m-g.border,o,i);m=v}let l=this.domFromPos(e,e?-1:1),c=n==e?l:this.domFromPos(n,n?-1:1),d=o.root.getSelection(),u=o.domSelectionRange(),p=!1;if((It||dt)&&e==n){let{node:f,offset:m}=l;if(f.nodeType==3){if(p=!(!m||f.nodeValue[m-1]!=`
|
|
42
|
+
`),p&&m==f.nodeValue.length)for(let g,v=f;v;v=v.parentNode){if(g=v.nextSibling){g.nodeName=="BR"&&(l=c={node:g.parentNode,offset:et(g)+1});break}let b=v.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let g=f.childNodes[m-1];p=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(It&&u.focusNode&&u.focusNode!=c.node&&u.focusNode.nodeType==1){let f=u.focusNode.childNodes[u.focusOffset];f&&f.contentEditable=="false"&&(i=!0)}if(!(i||p&&dt)&&uo(l.node,l.offset,u.anchorNode,u.anchorOffset)&&uo(c.node,c.offset,u.focusNode,u.focusOffset))return;let h=!1;if((d.extend||e==n)&&(!p||!It)){d.collapse(l.node,l.offset);try{e!=n&&d.extend(c.node,c.offset),h=!0}catch{}}if(!h){if(e>n){let m=l;l=c,c=m}let f=document.createRange();f.setEnd(c.node,c.offset),f.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let o=0,i=0;i<this.children.length;i++){let s=this.children[i],a=o+s.size;if(o==a?e<=a&&n>=o:e<a&&n>o){let l=o+s.border,c=a-s.border;if(e>=l&&n<=c)return this.dirty=e==o||n==a?2:1,void(e!=l||n!=c||!s.contentLost&&s.dom.parentNode==this.contentDOM?s.markDirty(e-l,n-l):s.dirty=3);s.dirty=s.dom!=s.contentDOM||s.dom.parentNode!=this.contentDOM||s.children.length?3:2}o=a}this.dirty=2}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let o=e==1?2:1;n.dirty<o&&(n.dirty=o)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Bm extends Kr{constructor(e,n,o,i){let s,a=n.type.toDOM;if(typeof a=="function"&&(a=a(o,()=>s?s.parent?s.parent.posBeforeChild(s):void 0:i)),!n.type.spec.raw){if(a.nodeType!=1){let l=document.createElement("span");l.appendChild(a),a=l}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(e,[],a,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==0&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return!!n&&n(e)}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Yw extends Kr{constructor(e,n,o,i){super(e,[],n,null),this.textDOM=o,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class ho extends Kr{constructor(e,n,o,i,s){super(e,[],o,i),this.mark=n,this.spec=s}static create(e,n,o,i){let s=i.nodeViews[n.type.name],a=s&&s(n,i,o);return a&&a.dom||(a=lo.renderSpec(document,n.type.spec.toDOM(n,o),null,n.attrs)),new ho(e,n,a.dom,a.contentDOM||a.dom,a)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=3&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=0){let o=this.parent;for(;!o.node;)o=o.parent;o.dirty<this.dirty&&(o.dirty=this.dirty),this.dirty=0}}slice(e,n,o){let i=ho.create(this.parent,this.mark,!0,o),s=this.children,a=this.size;n<a&&(s=ec(s,n,a,o)),e>0&&(s=ec(s,0,e,o));for(let l=0;l<s.length;l++)s[l].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Dn extends Kr{constructor(e,n,o,i,s,a,l,c,d){super(e,[],s,a),this.node=n,this.outerDeco=o,this.innerDeco=i,this.nodeDOM=l}static create(e,n,o,i,s,a){let l,c=s.nodeViews[n.type.name],d=c&&c(n,s,()=>l?l.parent?l.parent.posBeforeChild(l):void 0:a,o,i),u=d&&d.dom,p=d&&d.contentDOM;if(n.isText)if(u){if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(n.text);else u||({dom:u,contentDOM:p}=lo.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));p||n.isText||u.nodeName=="BR"||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let h=u;return u=Vm(u,o,n),d?l=new Xw(e,n,o,i,u,p||null,h,d,s,a+1):n.isText?new ls(e,n,o,i,u,h,s):new Dn(e,n,o,i,u,p||null,h,s,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let n=this.children.length-1;n>=0;n--){let o=this.children[n];if(this.dom.contains(o.dom.parentNode)){e.contentElement=o.dom.parentNode;break}}e.contentElement||(e.getContent=()=>$.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,n,o){return this.dirty==0&&e.eq(this.node)&&cs(n,this.outerDeco)&&o.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let o=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,a=s&&s.pos>-1?s:null,l=s&&s.pos<0,c=new Qw(this,a&&a.node,e);(function(d,u,p,h){let f=u.locals(d),m=0;if(f.length==0){for(let y=0;y<d.childCount;y++){let k=d.child(y);h(k,f,u.forChild(m,k),y),m+=k.nodeSize}return}let g=0,v=[],b=null;for(let y=0;;){let k,x,w,S;for(;g<f.length&&f[g].to==m;){let E=f[g++];E.widget&&(k?(x||(x=[k])).push(E):k=E)}if(k)if(x){x.sort(ex);for(let E=0;E<x.length;E++)p(x[E],y,!!b)}else p(k,y,!!b);if(b)S=-1,w=b,b=null;else{if(!(y<d.childCount))break;S=y,w=d.child(y++)}for(let E=0;E<v.length;E++)v[E].to<=m&&v.splice(E--,1);for(;g<f.length&&f[g].from<=m&&f[g].to>m;)v.push(f[g++]);let C=m+w.nodeSize;if(w.isText){let E=C;g<f.length&&f[g].from<E&&(E=f[g].from);for(let M=0;M<v.length;M++)v[M].to<E&&(E=v[M].to);E<C&&(b=w.cut(E-m),w=w.cut(0,E-m),C=E,S=-1)}else for(;g<f.length&&f[g].to<C;)g++;h(w,w.isInline&&!w.isLeaf?v.filter(E=>!E.inline):v.slice(),u.forChild(m,w),S),m=C}})(this.node,this.innerDeco,(d,u,p)=>{d.spec.marks?c.syncToMarks(d.spec.marks,o,e):d.type.side>=0&&!p&&c.syncToMarks(u==this.node.childCount?Me.none:this.node.child(u).marks,o,e),c.placeWidget(d,e,i)},(d,u,p,h)=>{let f;c.syncToMarks(d.marks,o,e),c.findNodeMatch(d,u,p,h)||l&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(f=c.findIndexWithChild(s.node))>-1&&c.updateNodeAt(d,u,p,f,e)||c.updateNextNode(d,u,p,e,h,i)||c.addNode(d,u,p,e,i),i+=d.nodeSize}),c.syncToMarks([],o,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==2)&&(a&&this.protectLocalComposition(e,a),_m(this.contentDOM,this.children,e),tr&&function(d){if(d.nodeName=="UL"||d.nodeName=="OL"){let u=d.style.cssText;d.style.cssText=u+"; list-style: square !important",window.getComputedStyle(d).listStyle,d.style.cssText=u}}(this.dom))}localCompositionInfo(e,n){let{from:o,to:i}=e.state.selection;if(!(e.state.selection instanceof se)||o<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=function(c,d,u,p){for(let h=0,f=0;h<c.childCount&&f<=p;){let m=c.child(h++),g=f;if(f+=m.nodeSize,!m.isText)continue;let v=m.text;for(;h<c.childCount;){let b=c.child(h++);if(f+=b.nodeSize,!b.isText)break;v+=b.text}if(f>=u){if(f>=p&&v.slice(p-d.length-g,p-g)==d)return p-d.length;let b=g<p?v.lastIndexOf(d,p-g-1):-1;if(b>=0&&b+d.length+g>=u)return g+b;if(u==p&&v.length>=p+d.length-g&&v.slice(p-g,p-g+d.length)==d)return p}}return-1}(this.node.content,a,o-n,i-n);return l<0?null:{node:s,pos:l,text:a}}return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:o,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let a=new Yw(this,s,n,i);e.input.compositionNodes.push(a),this.children=ec(this.children,o,o+i.length,e,a)}update(e,n,o,i){return!(this.dirty==3||!e.sameMarkup(this.node)||(this.updateInner(e,n,o,i),0))}updateInner(e,n,o,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=o,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(cs(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,o=this.dom;this.dom=Am(this.dom,this.nodeDOM,Ql(this.outerDeco,this.node,n),Ql(e,this.node,n)),this.dom!=o&&(o.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Tm(t,e,n,o,i){Vm(o,e,t);let s=new Dn(void 0,t,e,n,o,o,o,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class ls extends Dn{constructor(e,n,o,i,s,a,l){super(e,n,o,i,s,null,a,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,o,i){return!(this.dirty==3||this.dirty!=0&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(n),this.dirty==0&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=0,0))}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,o){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,o)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,o){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new ls(this.parent,i,this.outerDeco,this.innerDeco,s,s,o)}markDirty(e,n){super.markDirty(e,n),this.dom==this.nodeDOM||e!=0&&n!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Om extends Kr{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==0&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Xw extends Dn{constructor(e,n,o,i,s,a,l,c,d,u){super(e,n,o,i,s,a,l,d,u),this.spec=c}update(e,n,o,i){if(this.dirty==3)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,o);return s&&this.updateInner(e,n,o,i),s}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,n,o,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,o,i){this.spec.setSelection?this.spec.setSelection(e,n,o.root):super.setSelection(e,n,o,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function _m(t,e,n){let o=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let a=e[s],l=a.dom;if(l.parentNode==t){for(;l!=o;)o=Im(o),i=!0;o=o.nextSibling}else i=!0,t.insertBefore(l,o);if(a instanceof ho){let c=o?o.previousSibling:t.lastChild;_m(a.contentDOM,a.children,n),o=c?c.nextSibling:t.firstChild}}for(;o;)o=Im(o),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Ur=function(t){t&&(this.nodeName=t)};Ur.prototype=Object.create(null);const fo=[new Ur];function Ql(t,e,n){if(t.length==0)return fo;let o=n?fo[0]:new Ur,i=[o];for(let s=0;s<t.length;s++){let a=t[s].type.attrs;if(a){a.nodeName&&i.push(o=new Ur(a.nodeName));for(let l in a){let c=a[l];c!=null&&(n&&i.length==1&&i.push(o=new Ur(e.isInline?"span":"div")),l=="class"?o.class=(o.class?o.class+" ":"")+c:l=="style"?o.style=(o.style?o.style+";":"")+c:l!="nodeName"&&(o[l]=c))}}}return i}function Am(t,e,n,o){if(n==fo&&o==fo)return e;let i=e;for(let s=0;s<o.length;s++){let a=o[s],l=n[s];if(s){let c;l&&l.nodeName==a.nodeName&&i!=t&&(c=i.parentNode)&&c.nodeName.toLowerCase()==a.nodeName||(c=document.createElement(a.nodeName),c.pmIsDeco=!0,c.appendChild(i),l=fo[0]),i=c}Zw(i,l||fo[0],a)}return i}function Zw(t,e,n){for(let o in e)o=="class"||o=="style"||o=="nodeName"||o in n||t.removeAttribute(o);for(let o in n)o!="class"&&o!="style"&&o!="nodeName"&&n[o]!=e[o]&&t.setAttribute(o,n[o]);if(e.class!=n.class){let o=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<o.length;s++)i.indexOf(o[s])==-1&&t.classList.remove(o[s]);for(let s=0;s<i.length;s++)o.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let o,i=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;o=i.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function Vm(t,e,n){return Am(t,t,fo,Ql(e,n,t.nodeType!=1))}function cs(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Im(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Qw{constructor(e,n,o){this.lock=n,this.view=o,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(i,s){let a=s,l=a.children.length,c=i.childCount,d=new Map,u=[];e:for(;c>0;){let p;for(;;)if(l){let f=a.children[l-1];if(!(f instanceof ho)){p=f,l--;break}a=f,l=f.children.length}else{if(a==s)break e;l=a.parent.children.indexOf(a),a=a.parent}let h=p.node;if(h){if(h!=i.child(c-1))break;--c,d.set(p,c),u.push(p)}}return{index:c,matched:d,matches:u.reverse()}}(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let o=e;o<n;o++)this.top.children[o].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,o){let i=0,s=this.stack.length>>1,a=Math.min(s,e.length);for(;i<a&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let l=-1;for(let c=this.index;c<Math.min(this.index+3,this.top.children.length);c++){let d=this.top.children[c];if(d.matchesMark(e[s])&&!this.isLocked(d.dom)){l=c;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=ho.create(this.top,e[s],n,o);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,s++}}findNodeMatch(e,n,o,i){let s,a=-1;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,o))a=this.top.children.indexOf(s,this.index);else for(let l=this.index,c=Math.min(this.top.children.length,l+5);l<c;l++){let d=this.top.children[l];if(d.matchesNode(e,n,o)&&!this.preMatch.matched.has(d)){a=l;break}}return!(a<0||(this.destroyBetween(this.index,a),this.index++,0))}updateNodeAt(e,n,o,i,s){let a=this.top.children[i];return a.dirty==3&&a.dom==a.contentDOM&&(a.dirty=2),!!a.update(e,n,o,s)&&(this.destroyBetween(this.index,i),this.index++,!0)}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let o=e.pmViewDesc;if(o){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==o)return i}return-1}e=n}}updateNextNode(e,n,o,i,s,a){for(let l=this.index;l<this.top.children.length;l++){let c=this.top.children[l];if(c instanceof Dn){let d=this.preMatch.matched.get(c);if(d!=null&&d!=s)return!1;let u,p=c.dom,h=this.isLocked(p)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=3&&cs(n,c.outerDeco));if(!h&&c.update(e,n,o,i))return this.destroyBetween(this.index,l),c.dom!=p&&(this.changed=!0),this.index++,!0;if(!h&&(u=this.recreateWrapper(c,e,n,o,i,a)))return this.destroyBetween(this.index,l),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=2,u.updateChildren(i,a+1),u.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,o,i,s,a){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!cs(o,e.outerDeco)||!i.eq(e.innerDeco))return null;let l=Dn.create(this.top,n,o,i,s,a);if(l.contentDOM){l.children=e.children,e.children=[];for(let c of l.children)c.parent=l}return e.destroy(),l}addNode(e,n,o,i,s){let a=Dn.create(this.top,e,n,o,i,s);a.contentDOM&&a.updateChildren(i,s+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,n,o){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(!i||!i.matchesWidget(e)||e!=i.widget&&i.widget.type.toDOM.parentNode){let s=new Bm(this.top,e,n,o);this.top.children.splice(this.index++,0,s),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof ho;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof ls)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((dt||it)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let o=document.createElement(e);e=="IMG"&&(o.className="ProseMirror-separator",o.alt=""),e=="BR"&&(o.className="ProseMirror-trailingBreak");let i=new Om(this.top,[],o,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function ex(t,e){return t.type.side-e.type.side}function ec(t,e,n,o,i){let s=[];for(let a=0,l=0;a<t.length;a++){let c=t[a],d=l,u=l+=c.size;d>=n||u<=e?s.push(c):(d<e&&s.push(c.slice(0,e-d,o)),i&&(s.push(i),i=void 0),u>n&&s.push(c.slice(n-d,c.size,o)))}return s}function tc(t,e=null){let n=t.domSelectionRange(),o=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,a=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let l,c,d=o.resolve(a);if(as(n)){for(l=a;i&&!i.node;)i=i.parent;let p=i.node;if(i&&p.isAtom&&ne.isSelectable(p)&&i.parent&&(!p.isInline||!function(h,f,m){for(let g=f==0,v=f==Vt(h);g||v;){if(h==m)return!0;let b=et(h);if(!(h=h.parentNode))return!1;g=g&&b==0,v=v&&b==Vt(h)}}(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;c=new ne(a==h?d:o.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let p=a,h=a;for(let f=0;f<n.rangeCount;f++){let m=n.getRangeAt(f);p=Math.min(p,t.docView.posFromDOM(m.startContainer,m.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(p<0)return null;[l,a]=h==t.state.selection.anchor?[h,p]:[p,h],d=o.resolve(a)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=o.resolve(l);return c||(c=oc(t,u,d,e=="pointer"||t.state.selection.head<d.pos&&!s?1:-1)),c}function Dm(t){return t.editable?t.hasFocus():Fm(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function fn(t,e=!1){let n=t.state.selection;if($m(t,n),Dm(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&it){let o=t.domSelectionRange(),i=t.domObserver.currentSelection;if(o.anchorNode&&i.anchorNode&&uo(o.anchorNode,o.anchorOffset,i.anchorNode,i.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)(function(o){let i=o.domSelection();if(!i)return;let s=o.cursorWrapper.dom,a=s.nodeName=="IMG";a?i.collapse(s.parentNode,et(s)+1):i.collapse(s,0),!a&&!o.state.selection.visible&&yt&&Vn<=11&&(s.disabled=!0,s.disabled=!1)})(t);else{let o,i,{anchor:s,head:a}=n;!Rm||n instanceof se||(n.$from.parent.inlineContent||(o=Lm(t,n.from)),n.empty||n.$from.parent.inlineContent||(i=Lm(t,n.to))),t.docView.setSelection(s,a,t,e),Rm&&(o&&zm(o),i&&zm(i)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(l){let c=l.dom.ownerDocument;c.removeEventListener("selectionchange",l.input.hideSelectionGuard);let d=l.domSelectionRange(),u=d.anchorNode,p=d.anchorOffset;c.addEventListener("selectionchange",l.input.hideSelectionGuard=()=>{d.anchorNode==u&&d.anchorOffset==p||(c.removeEventListener("selectionchange",l.input.hideSelectionGuard),setTimeout(()=>{Dm(l)&&!l.state.selection.visible||l.dom.classList.remove("ProseMirror-hideselection")},20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Rm=dt||it&&gm<63;function Lm(t,e){let{node:n,offset:o}=t.docView.domFromPos(e,0),i=o<n.childNodes.length?n.childNodes[o]:null,s=o?n.childNodes[o-1]:null;if(dt&&i&&i.contentEditable=="false")return nc(i);if(!(i&&i.contentEditable!="false"||s&&s.contentEditable!="false")){if(i)return nc(i);if(s)return nc(s)}}function nc(t){return t.contentEditable="true",dt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function zm(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function $m(t,e){if(e instanceof ne){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Pm(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Pm(t)}function Pm(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function oc(t,e,n,o){return t.someProp("createSelectionBetween",i=>i(t,e,n))||se.between(e,n,o)}function jm(t){return!(t.editable&&!t.hasFocus())&&Fm(t)}function Fm(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function rc(t,e){let{$anchor:n,$head:o}=t.selection,i=e>0?n.max(o):n.min(o),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&pe.findFrom(s,e)}function Rn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Hm(t,e,n){let o=t.state.selection;if(!(o instanceof se)){if(o instanceof ne&&o.node.isInline)return Rn(t,new se(e>0?o.$to:o.$from));{let i=rc(t.state,e);return!!i&&Rn(t,i)}}if(n.indexOf("s")>-1){let{$head:i}=o,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let a=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Rn(t,new se(o.$anchor,a))}if(!o.empty)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let i=rc(t.state,e);return!!(i&&i instanceof ne)&&Rn(t,i)}if(!(Dt&&n.indexOf("m")>-1)){let i,s=o.$head,a=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!a||a.isText)return!1;let l=e<0?s.pos-a.nodeSize:s.pos;return!!(a.isAtom||(i=t.docView.descAt(l))&&!i.contentDOM)&&(ne.isSelectable(a)?Rn(t,new ne(e<0?t.state.doc.resolve(s.pos-a.nodeSize):s)):!!Hr&&Rn(t,new se(t.state.doc.resolve(e<0?l:l+a.nodeSize))))}}function ds(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function qr(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function or(t,e){return e<0?function(n){let o=n.domSelectionRange(),i=o.focusNode,s=o.focusOffset;if(!i)return;let a,l,c=!1;for(It&&i.nodeType==1&&s<ds(i)&&qr(i.childNodes[s],-1)&&(c=!0);;)if(s>0){if(i.nodeType!=1)break;{let d=i.childNodes[s-1];if(qr(d,-1))a=i,l=--s;else{if(d.nodeType!=3)break;i=d,s=i.nodeValue.length}}}else{if(Wm(i))break;{let d=i.previousSibling;for(;d&&qr(d,-1);)a=i.parentNode,l=et(d),d=d.previousSibling;if(d)i=d,s=ds(i);else{if(i=i.parentNode,i==n.dom)break;s=0}}}c?ic(n,i,s):a&&ic(n,a,l)}(t):function(n){let o=n.domSelectionRange(),i=o.focusNode,s=o.focusOffset;if(!i)return;let a,l,c=ds(i);for(;;)if(s<c){if(i.nodeType!=1||!qr(i.childNodes[s],1))break;a=i,l=++s}else{if(Wm(i))break;{let d=i.nextSibling;for(;d&&qr(d,1);)a=d.parentNode,l=et(d)+1,d=d.nextSibling;if(d)i=d,s=0,c=ds(i);else{if(i=i.parentNode,i==n.dom)break;s=c=0}}}a&&ic(n,a,l)}(t)}function Wm(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function ic(t,e,n){if(e.nodeType!=3){let s,a;(a=function(l,c){for(;l&&c==l.childNodes.length&&!Fr(l);)c=et(l)+1,l=l.parentNode;for(;l&&c<l.childNodes.length;){let d=l.childNodes[c];if(d.nodeType==3)return d;if(d.nodeType==1&&d.contentEditable=="false")break;l=d,c=0}}(e,n))?(e=a,n=0):(s=function(l,c){for(;l&&!c&&!Fr(l);)c=et(l),l=l.parentNode;for(;l&&c;){let d=l.childNodes[c-1];if(d.nodeType==3)return d;if(d.nodeType==1&&d.contentEditable=="false")break;c=(l=d).childNodes.length}}(e,n))&&(e=s,n=s.nodeValue.length)}let o=t.domSelection();if(!o)return;if(as(o)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),o.removeAllRanges(),o.addRange(s)}else o.extend&&o.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&fn(t)},50)}function Km(t,e){let n=t.state.doc.resolve(e);if(!it&&!Hw&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Um(t,e,n){let o=t.state.selection;if(o instanceof se&&!o.empty||n.indexOf("s")>-1||Dt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=o;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let a=rc(t.state,e);if(a&&a instanceof ne)return Rn(t,a)}if(!i.parent.inlineContent){let a=e<0?i:s,l=o instanceof Nt?pe.near(a,e):pe.findFrom(a,e);return!!l&&Rn(t,l)}return!1}function qm(t,e){if(!(t.state.selection instanceof se))return!0;let{$head:n,$anchor:o,empty:i}=t.state.selection;if(!n.sameParent(o))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let a=t.state.tr;return e<0?a.delete(n.pos-s.nodeSize,n.pos):a.delete(n.pos,n.pos+s.nodeSize),t.dispatch(a),!0}return!1}function Jm(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function sc(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:o,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&o.childCount==1&&o.firstChild.childCount==1;){i--,s--;let h=o.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),o=h.content}let a=t.someProp("clipboardSerializer")||lo.fromSchema(t.state.schema),l=ng(),c=l.createElement("div");c.appendChild(a.serializeFragment(o,{document:l}));let d,u=c.firstChild,p=0;for(;u&&u.nodeType==1&&(d=eg[u.nodeName.toLowerCase()]);){for(let h=d.length-1;h>=0;h--){let f=l.createElement(d[h]);for(;c.firstChild;)f.appendChild(c.firstChild);c.appendChild(f),p++}u=c.firstChild}return u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${p?` -${p}`:""} ${JSON.stringify(n)}`),{dom:c,text:t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
|
|
43
|
+
|
|
44
|
+
`),slice:e}}function Gm(t,e,n,o,i){let s,a,l=i.parent.type.spec.code;if(!n&&!e)return null;let c=!!e&&(o||l||!n);if(c){if(t.someProp("transformPastedText",h=>{e=h(e,l||o,t)}),l)return a=new J($.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
45
|
+
`))),0,0),t.someProp("transformPasted",h=>{a=h(a,t,!0)}),a;let p=t.someProp("clipboardTextParser",h=>h(e,i,o,t));if(p)a=p;else{let h=i.marks(),{schema:f}=t.state,m=lo.fromSchema(f);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let v=s.appendChild(document.createElement("p"));g&&v.appendChild(m.serializeNode(f.text(g,h)))})}}else t.someProp("transformPastedHTML",p=>{n=p(n,t)}),s=function(p){let h=/^(\s*<meta [^>]*>)*/.exec(p);h&&(p=p.slice(h[0].length));let f,m=ng().createElement("div"),g=/<([a-z][^>\s]+)/i.exec(p);if((f=g&&eg[g[1].toLowerCase()])&&(p=f.map(v=>"<"+v+">").join("")+p+f.map(v=>"</"+v+">").reverse().join("")),m.innerHTML=function(v){let b=window.trustedTypes;return b?(lc||(lc=b.defaultPolicy||b.createPolicy("ProseMirrorClipboard",{createHTML:y=>y})),lc.createHTML(v)):v}(p),f)for(let v=0;v<f.length;v++)m=m.querySelector(f[v])||m;return m}(n),Hr&&function(p){let h=p.querySelectorAll(it?"span:not([class]):not([style])":"span.Apple-converted-space");for(let f=0;f<h.length;f++){let m=h[f];m.childNodes.length==1&&m.textContent==" "&&m.parentNode&&m.parentNode.replaceChild(p.ownerDocument.createTextNode(" "),m)}}(s);let d=s&&s.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let p=+u[3];p>0;p--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Bn.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!(!c&&!u),context:i,ruleFromNode:h=>h.nodeName!="BR"||h.nextSibling||!h.parentNode||tx.test(h.parentNode.nodeName)?null:{ignore:!0}})),u)a=function(p,h){if(!p.size)return p;let f,m=p.content.firstChild.type.schema;try{f=JSON.parse(h)}catch{return p}let{content:g,openStart:v,openEnd:b}=p;for(let y=f.length-2;y>=0;y-=2){let k=m.nodes[f[y]];if(!k||k.hasRequiredAttrs())break;g=$.from(k.create(f[y+1],g)),v++,b++}return new J(g,v,b)}(Qm(a,+u[1],+u[2]),u[4]);else if(a=J.maxOpen(function(p,h){if(p.childCount<2)return p;for(let f=h.depth;f>=0;f--){let m,g=h.node(f).contentMatchAt(h.index(f)),v=[];if(p.forEach(b=>{if(!v)return;let y,k=g.findWrapping(b.type);if(!k)return v=null;if(y=v.length&&m.length&&Xm(k,m,b,v[v.length-1],0))v[v.length-1]=y;else{v.length&&(v[v.length-1]=Zm(v[v.length-1],m.length));let x=Ym(b,k);v.push(x),g=g.matchType(x.type),m=k}}),v)return $.from(v)}return p}(a.content,i),!0),a.openStart||a.openEnd){let p=0,h=0;for(let f=a.content.firstChild;p<a.openStart&&!f.type.spec.isolating;p++,f=f.firstChild);for(let f=a.content.lastChild;h<a.openEnd&&!f.type.spec.isolating;h++,f=f.lastChild);a=Qm(a,p,h)}return t.someProp("transformPasted",p=>{a=p(a,t,c)}),a}const tx=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Ym(t,e,n=0){for(let o=e.length-1;o>=n;o--)t=e[o].create(null,$.from(t));return t}function Xm(t,e,n,o,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=Xm(t,e,n,o.lastChild,i+1);if(s)return o.copy(o.content.replaceChild(o.childCount-1,s));if(o.contentMatchAt(o.childCount).matchType(i==t.length-1?n.type:t[i+1]))return o.copy(o.content.append($.from(Ym(n,t,i+1))))}}function Zm(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Zm(t.lastChild,e-1)),o=t.contentMatchAt(t.childCount).fillBefore($.empty,!0);return t.copy(n.append(o))}function ac(t,e,n,o,i,s){let a=e<0?t.firstChild:t.lastChild,l=a.content;return t.childCount>1&&(s=0),i<o-1&&(l=ac(l,e,n,o,i+1,s)),i>=n&&(l=e<0?a.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(a.contentMatchAt(a.childCount).fillBefore($.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(l))}function Qm(t,e,n){return e<t.openStart&&(t=new J(ac(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new J(ac(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const eg={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let tg=null;function ng(){return tg||(tg=document.implementation.createHTMLDocument("title"))}let lc=null;const ut={},pt={},nx={touchstart:!0,touchmove:!0};class ox{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Ln(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function cc(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=o=>dc(t,o))})}function dc(t,e){return t.someProp("handleDOMEvents",n=>{let o=n[e.type];return!!o&&(o(t,e)||e.defaultPrevented)})}function rx(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function us(t){return{left:t.clientX,top:t.clientY}}function uc(t,e,n,o,i){if(o==-1)return!1;let s=t.state.doc.resolve(o);for(let a=s.depth+1;a>0;a--)if(t.someProp(e,l=>a>s.depth?l(t,n,s.nodeAfter,s.before(a),i,!0):l(t,n,s.node(a),s.before(a),i,!1)))return!0;return!1}function rr(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let o=t.state.tr.setSelection(e);o.setMeta("pointer",!0),t.dispatch(o)}function ix(t,e,n,o){return uc(t,"handleDoubleClickOn",e,n,o)||t.someProp("handleDoubleClick",i=>i(t,e,o))}function sx(t,e,n,o){return uc(t,"handleTripleClickOn",e,n,o)||t.someProp("handleTripleClick",i=>i(t,e,o))||function(i,s,a){if(a.button!=0)return!1;let l=i.state.doc;if(s==-1)return!!l.inlineContent&&(rr(i,se.create(l,0,l.content.size)),!0);let c=l.resolve(s);for(let d=c.depth+1;d>0;d--){let u=d>c.depth?c.nodeAfter:c.node(d),p=c.before(d);if(u.inlineContent)rr(i,se.create(l,p+1,p+1+u.content.size));else{if(!ne.isSelectable(u))continue;rr(i,ne.create(l,p))}return!0}}(t,n,o)}function pc(t){return ps(t)}pt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!rg(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!pn||!it||n.keyCode!=13))if(n.keyCode!=229&&t.domObserver.forceFlush(),!tr||n.keyCode!=13||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",o=>o(t,n))||function(o,i){let s=i.keyCode,a=function(l){let c="";return l.ctrlKey&&(c+="c"),l.metaKey&&(c+="m"),l.altKey&&(c+="a"),l.shiftKey&&(c+="s"),c}(i);if(s==8||Dt&&s==72&&a=="c")return qm(o,-1)||or(o,-1);if(s==46&&!i.shiftKey||Dt&&s==68&&a=="c")return qm(o,1)||or(o,1);if(s==13||s==27)return!0;if(s==37||Dt&&s==66&&a=="c"){let l=s==37?Km(o,o.state.selection.from)=="ltr"?-1:1:-1;return Hm(o,l,a)||or(o,l)}if(s==39||Dt&&s==70&&a=="c"){let l=s==39?Km(o,o.state.selection.from)=="ltr"?1:-1:1;return Hm(o,l,a)||or(o,l)}return s==38||Dt&&s==80&&a=="c"?Um(o,-1,a)||or(o,-1):s==40||Dt&&s==78&&a=="c"?function(l){if(!dt||l.state.selection.$head.parentOffset>0)return!1;let{focusNode:c,focusOffset:d}=l.domSelectionRange();if(c&&c.nodeType==1&&d==0&&c.firstChild&&c.firstChild.contentEditable=="false"){let u=c.firstChild;Jm(l,u,"true"),setTimeout(()=>Jm(l,u,"false"),20)}return!1}(o)||Um(o,1,a)||or(o,1):a==(Dt?"m":"c")&&(s==66||s==73||s==89||s==90)}(t,n)?n.preventDefault():Ln(t,"key");else{let o=Date.now();t.input.lastIOSEnter=o,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==o&&(t.someProp("handleKeyDown",i=>i(t,po(13,"Enter"))),t.input.lastIOSEnter=0)},200)}},pt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},pt.keypress=(t,e)=>{let n=e;if(rg(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Dt&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n)))return void n.preventDefault();let o=t.state.selection;if(!(o instanceof se&&o.$from.sameParent(o.$to))){let i=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(i).scrollIntoView();/[\r\n]/.test(i)||t.someProp("handleTextInput",a=>a(t,o.$from.pos,o.$to.pos,i,s))||t.dispatch(s()),n.preventDefault()}};const og=Dt?"metaKey":"ctrlKey";ut.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let o=pc(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&function(l,c){let d=c.x-l.clientX,u=c.y-l.clientY;return d*d+u*u<100}(n,t.input.lastClick)&&!n[og]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button};let a=t.posAtCoords(us(n));a&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new ax(t,a,n,!!o)):(s=="doubleClick"?ix:sx)(t,a.pos,a.inside,n)?n.preventDefault():Ln(t,"pointer"))};class ax{constructor(e,n,o,i){let s,a;if(this.view=e,this.pos=n,this.event=o,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!o[og],this.allowDefault=o.shiftKey,n.inside>-1)s=e.state.doc.nodeAt(n.inside),a=n.inside;else{let u=e.state.doc.resolve(n.pos);s=u.parent,a=u.depth?u.before():0}const l=i?null:o.target,c=l?e.docView.nearestDesc(l,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:d}=e.state;(o.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||d instanceof ne&&d.from<=a&&d.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!It||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ln(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>fn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(us(e))),this.updateAllowDefault(e),this.allowDefault||!n?Ln(this.view,"pointer"):function(o,i,s,a,l){return uc(o,"handleClickOn",i,s,a)||o.someProp("handleClick",c=>c(o,i,a))||(l?function(c,d){if(d==-1)return!1;let u,p,h=c.state.selection;h instanceof ne&&(u=h.node);let f=c.state.doc.resolve(d);for(let m=f.depth+1;m>0;m--){let g=m>f.depth?f.nodeAfter:f.node(m);if(ne.isSelectable(g)){p=u&&h.$from.depth>0&&m>=h.$from.depth&&f.before(h.$from.depth+1)==h.$from.pos?f.before(h.$from.depth):f.before(m);break}}return p!=null&&(rr(c,ne.create(c.state.doc,p)),!0)}(o,s):function(c,d){if(d==-1)return!1;let u=c.state.doc.resolve(d),p=u.nodeAfter;return!!(p&&p.isAtom&&ne.isSelectable(p))&&(rr(c,new ne(u)),!0)}(o,s))}(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||dt&&this.mightDrag&&!this.mightDrag.node.isAtom||it&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(rr(this.view,pe.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Ln(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ln(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function rg(t,e){return!!t.composing||!!(dt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}ut.touchstart=t=>{t.input.lastTouch=Date.now(),pc(t),Ln(t,"pointer")},ut.touchmove=t=>{t.input.lastTouch=Date.now(),Ln(t,"pointer")},ut.contextmenu=t=>pc(t);const lx=pn?5e3:-1;function ig(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>ps(t),e))}function sg(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function ps(t,e=!1){if(!(pn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),sg(t),e||t.docView&&t.docView.dirty){let n=tc(t),o=t.state.selection;return n&&!n.eq(o)?t.dispatch(t.state.tr.setSelection(n)):!t.markCursor&&!e||o.$from.node(o.$from.sharedDepth(o.to)).inlineContent?t.updateState(t.state):t.dispatch(t.state.tr.deleteSelection()),!0}return!1}}pt.compositionstart=pt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof se&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(o=>o.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),ps(t,!0),t.markCursor=null;else if(ps(t,!e.selection.empty),It&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let o=t.domSelectionRange();for(let i=o.focusNode,s=o.focusOffset;i&&i.nodeType==1&&s!=0;){let a=s<0?i.lastChild:i.childNodes[s-1];if(!a)break;if(a.nodeType==3){let l=t.domSelection();l&&l.collapse(a,a.nodeValue.length);break}i=a,s=-1}}t.input.composing=!0}ig(t,lx)},pt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,ig(t,20))};const Jr=yt&&Vn<15||tr&&Ww<604;function Gr(t,e,n,o,i){let s=Gm(t,e,n,o,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,i,s||J.empty)))return!0;if(!s)return!1;let a=function(c){return c.openStart==0&&c.openEnd==0&&c.content.childCount==1?c.content.firstChild:null}(s),l=a?t.state.tr.replaceSelectionWith(a,o):t.state.tr.replaceSelection(s);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function ag(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ut.copy=pt.cut=(t,e)=>{let n=e,o=t.state.selection,i=n.type=="cut";if(o.empty)return;let s=Jr?null:n.clipboardData,a=o.content(),{dom:l,text:c}=sc(t,a);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",c)):function(d,u){if(!d.dom.parentNode)return;let p=d.dom.parentNode.appendChild(document.createElement("div"));p.appendChild(u),p.style.cssText="position: fixed; left: -10000px; top: 10px";let h=getSelection(),f=document.createRange();f.selectNodeContents(u),d.dom.blur(),h.removeAllRanges(),h.addRange(f),setTimeout(()=>{p.parentNode&&p.parentNode.removeChild(p),d.focus()},50)}(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},pt.paste=(t,e)=>{let n=e;if(t.composing&&!pn)return;let o=Jr?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;o&&Gr(t,ag(o),o.getData("text/html"),i,n)?n.preventDefault():function(s,a){if(!s.dom.parentNode)return;let l=s.input.shiftKey||s.state.selection.$from.parent.type.spec.code,c=s.dom.parentNode.appendChild(document.createElement(l?"textarea":"div"));l||(c.contentEditable="true"),c.style.cssText="position: fixed; left: -10000px; top: 10px",c.focus();let d=s.input.shiftKey&&s.input.lastKeyCode!=45;setTimeout(()=>{s.focus(),c.parentNode&&c.parentNode.removeChild(c),l?Gr(s,c.value,null,d,a):Gr(s,c.textContent,c.innerHTML,d,a)},50)}(t,n)};class lg{constructor(e,n,o){this.slice=e,this.move=n,this.node=o}}const cx=Dt?"altKey":"ctrlKey";function cg(t,e){let n=t.someProp("dragCopies",o=>!o(e));return n??!e[cx]}ut.dragstart=(t,e)=>{let n=e,o=t.input.mouseDown;if(o&&o.done(),!n.dataTransfer)return;let i,s=t.state.selection,a=s.empty?null:t.posAtCoords(us(n));if(!(a&&a.pos>=s.from&&a.pos<=(s instanceof ne?s.to-1:s.to))){if(o&&o.mightDrag)i=ne.create(t.state.doc,o.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let p=t.docView.nearestDesc(n.target,!0);p&&p.node.type.spec.draggable&&p!=t.docView&&(i=ne.create(t.state.doc,p.posBefore))}}let l=(i||t.state.selection).content(),{dom:c,text:d,slice:u}=sc(t,l);(!n.dataTransfer.files.length||!it||gm>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Jr?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",Jr||n.dataTransfer.setData("text/plain",d),t.dragging=new lg(u,cg(t,n),i)},ut.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},pt.dragover=pt.dragenter=(t,e)=>e.preventDefault(),pt.drop=(t,e)=>{let n=e,o=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(us(n));if(!i)return;let s=t.state.doc.resolve(i.pos),a=o&&o.slice;a?t.someProp("transformPasted",m=>{a=m(a,t,!1)}):a=Gm(t,ag(n.dataTransfer),Jr?null:n.dataTransfer.getData("text/html"),!1,s);let l=!(!o||!cg(t,n));if(t.someProp("handleDrop",m=>m(t,n,a||J.empty,l)))return void n.preventDefault();if(!a)return;n.preventDefault();let c=a?Ff(t.state.doc,s.pos,a):s.pos;c==null&&(c=s.pos);let d=t.state.tr;if(l){let{node:m}=o;m?m.replace(d):d.deleteSelection()}let u=d.mapping.map(c),p=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,h=d.doc;if(p?d.replaceRangeWith(u,u,a.content.firstChild):d.replaceRange(u,u,a),d.doc.eq(h))return;let f=d.doc.resolve(u);if(p&&ne.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))d.setSelection(new ne(f));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((g,v,b,y)=>m=y),d.setSelection(oc(t,f,d.doc.resolve(m)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))},ut.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&fn(t)},20))},ut.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},ut.beforeinput=(t,e)=>{if(it&&pn&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,po(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in pt)ut[t]=pt[t];function Yr(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class hs{constructor(e,n){this.toDOM=e,this.spec=n||mo,this.side=this.spec.side||0}map(e,n,o,i){let{pos:s,deleted:a}=e.mapResult(n.from+i,this.side<0?-1:1);return a?null:new ht(s-o,s-o,this)}valid(){return!0}eq(e){return this==e||e instanceof hs&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Yr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class zn{constructor(e,n){this.attrs=e,this.spec=n||mo}map(e,n,o,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-o,a=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-o;return s>=a?null:new ht(s,a,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof zn&&Yr(this.attrs,e.attrs)&&Yr(this.spec,e.spec)}static is(e){return e.type instanceof zn}destroy(){}}class hc{constructor(e,n){this.attrs=e,this.spec=n||mo}map(e,n,o,i){let s=e.mapResult(n.from+i,1);if(s.deleted)return null;let a=e.mapResult(n.to+i,-1);return a.deleted||a.pos<=s.pos?null:new ht(s.pos-o,a.pos-o,this)}valid(e,n){let o,{index:i,offset:s}=e.content.findIndex(n.from);return s==n.from&&!(o=e.child(i)).isText&&s+o.nodeSize==n.to}eq(e){return this==e||e instanceof hc&&Yr(this.attrs,e.attrs)&&Yr(this.spec,e.spec)}destroy(){}}class ht{constructor(e,n,o){this.from=e,this.to=n,this.type=o}copy(e,n){return new ht(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,o){return this.type.map(e,this,n,o)}static widget(e,n,o){return new ht(e,e,new hs(n,o))}static inline(e,n,o,i){return new ht(e,n,new zn(o,i))}static node(e,n,o,i){return new ht(e,n,new hc(o,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof zn}get widget(){return this.type instanceof hs}}const ir=[],mo={};class Ie{constructor(e,n){this.local=e.length?e:ir,this.children=n.length?n:ir}static create(e,n){return n.length?fs(n,e,0,mo):st}find(e,n,o){let i=[];return this.findInner(e??0,n??1e9,i,0,o),i}findInner(e,n,o,i,s){for(let a=0;a<this.local.length;a++){let l=this.local[a];l.from<=n&&l.to>=e&&(!s||s(l.spec))&&o.push(l.copy(l.from+i,l.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>e){let l=this.children[a]+1;this.children[a+2].findInner(e-l,n-l,o,i+l,s)}}map(e,n,o){return this==st||e.maps.length==0?this:this.mapInner(e,n,0,0,o||mo)}mapInner(e,n,o,i,s){let a;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(e,o,i);c&&c.type.valid(n,c)?(a||(a=[])).push(c):s.onRemove&&s.onRemove(this.local[l].spec)}return this.children.length?function(l,c,d,u,p,h,f){let m=l.slice();for(let v=0,b=h;v<d.maps.length;v++){let y=0;d.maps[v].forEach((k,x,w,S)=>{let C=S-w-(x-k);for(let E=0;E<m.length;E+=3){let M=m[E+1];if(M<0||k>M+b-y)continue;let N=m[E]+b-y;x>=N?m[E+1]=k<=N?-2:-1:k>=b&&C&&(m[E]+=C,m[E+1]+=C)}y+=C}),b=d.maps[v].map(b,-1)}let g=!1;for(let v=0;v<m.length;v+=3)if(m[v+1]<0){if(m[v+1]==-2){g=!0,m[v+1]=-1;continue}let b=d.map(l[v]+h),y=b-p;if(y<0||y>=u.content.size){g=!0;continue}let k=d.map(l[v+1]+h,-1)-p,{index:x,offset:w}=u.content.findIndex(y),S=u.maybeChild(x);if(S&&w==y&&w+S.nodeSize==k){let C=m[v+2].mapInner(d,S,b+1,l[v]+h+1,f);C!=st?(m[v]=y,m[v+1]=k,m[v+2]=C):(m[v+1]=-2,g=!0)}else g=!0}if(g){let v=function(y,k,x,w,S,C,E){function M(N,T){for(let R=0;R<N.local.length;R++){let z=N.local[R].map(w,S,T);z?x.push(z):E.onRemove&&E.onRemove(N.local[R].spec)}for(let R=0;R<N.children.length;R+=3)M(N.children[R+2],N.children[R]+T+1)}for(let N=0;N<y.length;N+=3)y[N+1]==-1&&M(y[N+2],k[N]+C+1);return x}(m,l,c,d,p,h,f),b=fs(v,u,0,f);c=b.local;for(let y=0;y<m.length;y+=3)m[y+1]<0&&(m.splice(y,3),y-=3);for(let y=0,k=0;y<b.children.length;y+=3){let x=b.children[y];for(;k<m.length&&m[k]<x;)k+=3;m.splice(k,0,b.children[y],b.children[y+1],b.children[y+2])}}return new Ie(c.sort(go),m)}(this.children,a||[],e,n,o,i,s):a?new Ie(a.sort(go),ir):st}add(e,n){return n.length?this==st?Ie.create(e,n):this.addInner(e,n,0):this}addInner(e,n,o){let i,s=0;e.forEach((l,c)=>{let d,u=c+o;if(d=ug(n,l,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<c;)s+=3;i[s]==c?i[s+2]=i[s+2].addInner(l,d,u+1):i.splice(s,0,c,c+l.nodeSize,fs(d,l,u+1,mo)),s+=3}});let a=dg(s?pg(n):n,-o);for(let l=0;l<a.length;l++)a[l].type.valid(e,a[l])||a.splice(l--,1);return new Ie(a.length?this.local.concat(a).sort(go):this.local,i||this.children)}remove(e){return e.length==0||this==st?this:this.removeInner(e,0)}removeInner(e,n){let o=this.children,i=this.local;for(let s=0;s<o.length;s+=3){let a,l=o[s]+n,c=o[s+1]+n;for(let u,p=0;p<e.length;p++)(u=e[p])&&u.from>l&&u.to<c&&(e[p]=null,(a||(a=[])).push(u));if(!a)continue;o==this.children&&(o=this.children.slice());let d=o[s+2].removeInner(a,l+1);d!=st?o[s+2]=d:(o.splice(s,3),s-=3)}if(i.length){for(let s,a=0;a<e.length;a++)if(s=e[a])for(let l=0;l<i.length;l++)i[l].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return o==this.children&&i==this.local?this:i.length||o.length?new Ie(i,o):st}forChild(e,n){if(this==st)return this;if(n.isLeaf)return Ie.empty;let o,i;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(o=this.children[l+2]);break}let s=e+1,a=s+n.content.size;for(let l=0;l<this.local.length;l++){let c=this.local[l];if(c.from<a&&c.to>s&&c.type instanceof zn){let d=Math.max(s,c.from)-s,u=Math.min(a,c.to)-s;d<u&&(i||(i=[])).push(c.copy(d,u))}}if(i){let l=new Ie(i.sort(go),ir);return o?new $n([l,o]):l}return o||st}eq(e){if(this==e)return!0;if(!(e instanceof Ie)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return fc(this.localsInner(e))}localsInner(e){if(this==st)return ir;if(e.inlineContent||!this.local.some(zn.is))return this.local;let n=[];for(let o=0;o<this.local.length;o++)this.local[o].type instanceof zn||n.push(this.local[o]);return n}forEachSet(e){e(this)}}Ie.empty=new Ie([],[]),Ie.removeOverlap=fc;const st=Ie.empty;class $n{constructor(e){this.members=e}map(e,n){const o=this.members.map(i=>i.map(e,n,mo));return $n.from(o)}forChild(e,n){if(n.isLeaf)return Ie.empty;let o=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=st&&(s instanceof $n?o=o.concat(s.members):o.push(s))}return $n.from(o)}eq(e){if(!(e instanceof $n)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,o=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(n){o&&(n=n.slice(),o=!1);for(let a=0;a<s.length;a++)n.push(s[a])}else n=s}return n?fc(o?n:n.sort(go)):ir}static from(e){switch(e.length){case 0:return st;case 1:return e[0];default:return new $n(e.every(n=>n instanceof Ie)?e:e.reduce((n,o)=>n.concat(o instanceof Ie?o:o.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function dg(t,e){if(!e||!t.length)return t;let n=[];for(let o=0;o<t.length;o++){let i=t[o];n.push(new ht(i.from+e,i.to+e,i.type))}return n}function ug(t,e,n){if(e.isLeaf)return null;let o=n+e.nodeSize,i=null;for(let s,a=0;a<t.length;a++)(s=t[a])&&s.from>n&&s.to<o&&((i||(i=[])).push(s),t[a]=null);return i}function pg(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function fs(t,e,n,o){let i=[],s=!1;e.forEach((l,c)=>{let d=ug(t,l,c+n);if(d){s=!0;let u=fs(d,l,n+c+1,o);u!=st&&i.push(c,c+l.nodeSize,u)}});let a=dg(s?pg(t):t,-n).sort(go);for(let l=0;l<a.length;l++)a[l].type.valid(e,a[l])||(o.onRemove&&o.onRemove(a[l].spec),a.splice(l--,1));return a.length||i.length?new Ie(a,i):st}function go(t,e){return t.from-e.from||t.to-e.to}function fc(t){let e=t;for(let n=0;n<e.length-1;n++){let o=e[n];if(o.from!=o.to)for(let i=n+1;i<e.length;i++){let s=e[i];if(s.from!=o.from){s.from<o.to&&(e==t&&(e=t.slice()),e[n]=o.copy(o.from,s.from),hg(e,i,o.copy(s.from,o.to)));break}s.to!=o.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,o.to),hg(e,i+1,s.copy(o.to,s.to)))}}return e}function hg(t,e,n){for(;e<t.length&&go(n,t[e])>0;)e++;t.splice(e,0,n)}function mc(t){let e=[];return t.someProp("decorations",n=>{let o=n(t.state);o&&o!=st&&e.push(o)}),t.cursorWrapper&&e.push(Ie.create(t.state.doc,[t.cursorWrapper.deco])),$n.from(e)}const dx={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ux=yt&&Vn<=11;class px{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class hx{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new px,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(o=>{for(let i=0;i<o.length;i++)this.queue.push(o[i]);yt&&Vn<=11&&o.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),ux&&(this.onCharData=o=>{this.queue.push({target:o.target,type:"characterData",oldValue:o.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,dx)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(jm(this.view)){if(this.suppressingSelectionUpdates)return fn(this.view);if(yt&&Vn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&uo(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n,o=new Set;for(let s=e.focusNode;s;s=er(s))o.add(s);for(let s=e.anchorNode;s;s=er(s))if(o.has(s)){n=s;break}let i=n&&this.view.docView.nearestDesc(n);return i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let o=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(o)&&jm(e)&&!this.ignoreSelectionChange(o),s=-1,a=-1,l=!1,c=[];if(e.editable)for(let u=0;u<n.length;u++){let p=this.registerMutation(n[u],c);p&&(s=s<0?p.from:Math.min(p.from,s),a=a<0?p.to:Math.max(p.to,a),p.typeOver&&(l=!0))}if(It&&c.length){let u=c.filter(p=>p.nodeName=="BR");if(u.length==2){let[p,h]=u;p.parentNode&&p.parentNode.parentNode==h.parentNode?h.remove():p.remove()}else{let{focusNode:p}=this.currentSelection;for(let h of u){let f=h.parentNode;!f||f.nodeName!="LI"||p&&fx(e,p)==f||h.remove()}}}let d=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&as(o)&&(d=tc(e))&&d.eq(pe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,fn(e),this.currentSelection.set(o),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,a),function(u){if(!fg.has(u)&&(fg.set(u,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(u.dom).whiteSpace)!==-1)){if(u.requiresGeckoHackNode=It,mg)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),mg=!0}}(e)),this.handleDOMChange(s,a,l,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(o)||fn(e),this.currentSelection.set(o))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let o=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(o==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!o||o.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let u=e.addedNodes[d];n.push(u),u.nodeType==3&&(this.lastChangedTextNode=u)}if(o.contentDOM&&o.contentDOM!=o.dom&&!o.contentDOM.contains(e.target))return{from:o.posBefore,to:o.posAfter};let i=e.previousSibling,s=e.nextSibling;if(yt&&Vn<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:u,nextSibling:p}=e.addedNodes[d];(!u||Array.prototype.indexOf.call(e.addedNodes,u)<0)&&(i=u),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(s=p)}let a=i&&i.parentNode==e.target?et(i)+1:0,l=o.localPosFromDOM(e.target,a,-1),c=s&&s.parentNode==e.target?et(s):e.target.childNodes.length;return{from:l,to:o.localPosFromDOM(e.target,c,1)}}return e.type=="attributes"?{from:o.posAtStart-o.border,to:o.posAtEnd+o.border}:(this.lastChangedTextNode=e.target,{from:o.posAtStart,to:o.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let fg=new WeakMap,mg=!1;function gg(t,e){let n=e.startContainer,o=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return uo(a.node,a.offset,i,s)&&([n,o,i,s]=[i,s,n,o]),{anchorNode:n,anchorOffset:o,focusNode:i,focusOffset:s}}function fx(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let o=t.docView.nearestDesc(n,!0);if(o&&o.node.isBlock)return n}return null}function mx(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(dt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(t.parentNode.lastChild==t||dt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const gx=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function vg(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:oc(t,e.resolve(n.anchor),e.resolve(n.head))}function gc(t,e,n){let o=t.depth,i=e?t.end():t.pos;for(;o>0&&(e||t.indexAfter(o)==t.node(o).childCount);)o--,i++,e=!1;if(n){let s=t.node(o).maybeChild(t.indexAfter(o));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function yg(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class bg{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ox,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Sg),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=xg(this),wg(this),this.nodeViews=Cg(this),this.docView=Tm(this.state.doc,kg(this),mc(this),this.dom,this),this.domObserver=new hx(this,(o,i,s,a)=>function(l,c,d,u,p){let h=l.input.compositionPendingChanges||(l.composing?l.input.compositionID:0);if(l.input.compositionPendingChanges=0,c<0){let _=l.input.lastSelectionTime>Date.now()-50?l.input.lastSelectionOrigin:null,I=tc(l,_);if(I&&!l.state.selection.eq(I)){if(it&&pn&&l.input.lastKeyCode===13&&Date.now()-100<l.input.lastKeyCodeTime&&l.someProp("handleKeyDown",V=>V(l,po(13,"Enter"))))return;let O=l.state.tr.setSelection(I);_=="pointer"?O.setMeta("pointer",!0):_=="key"&&O.scrollIntoView(),h&&O.setMeta("composition",h),l.dispatch(O)}return}let f=l.state.doc.resolve(c),m=f.sharedDepth(d);c=f.before(m+1),d=l.state.doc.resolve(d).after(m+1);let g,v,b=l.state.selection,y=function(_,I,O){let V,{node:P,fromOffset:A,toOffset:L,from:j,to:K}=_.docView.parseRange(I,O),H=_.domSelectionRange(),q=H.anchorNode;if(q&&_.dom.contains(q.nodeType==1?q:q.parentNode)&&(V=[{node:q,offset:H.anchorOffset}],as(H)||V.push({node:H.focusNode,offset:H.focusOffset})),it&&_.input.lastKeyCode===8)for(let le=L;le>A;le--){let me=P.childNodes[le-1],Be=me.pmViewDesc;if(me.nodeName=="BR"&&!Be){L=le;break}if(!Be||Be.size)break}let Y=_.state.doc,G=_.someProp("domParser")||Bn.fromSchema(_.state.schema),Q=Y.resolve(j),oe=null,fe=G.parse(P,{topNode:Q.parent,topMatch:Q.parent.contentMatchAt(Q.index()),topOpen:!0,from:A,to:L,preserveWhitespace:Q.parent.type.whitespace!="pre"||"full",findPositions:V,ruleFromNode:mx,context:Q});if(V&&V[0].pos!=null){let le=V[0].pos,me=V[1]&&V[1].pos;me==null&&(me=le),oe={anchor:le+j,head:me+j}}return{doc:fe,sel:oe,from:j,to:K}}(l,c,d),k=l.state.doc,x=k.slice(y.from,y.to);l.input.lastKeyCode===8&&Date.now()-100<l.input.lastKeyCodeTime?(g=l.state.selection.to,v="end"):(g=l.state.selection.from,v="start"),l.input.lastKeyCode=null;let w=function(_,I,O,V,P){let A=_.findDiffStart(I,O);if(A==null)return null;let{a:L,b:j}=_.findDiffEnd(I,O+_.size,O+I.size);if(P=="end"&&(V-=L+Math.max(0,A-Math.min(L,j))-A),L<A&&_.size<I.size){let K=V<=A&&V>=L?A-V:0;A-=K,A&&A<I.size&&yg(I.textBetween(A-1,A+1))&&(A+=K?1:-1),j=A+(j-L),L=A}else if(j<A){let K=V<=A&&V>=j?A-V:0;A-=K,A&&A<_.size&&yg(_.textBetween(A-1,A+1))&&(A+=K?1:-1),L=A+(L-j),j=A}return{start:A,endA:L,endB:j}}(x.content,y.doc.content,y.from,g,v);if(w&&l.input.domChangeCount++,(tr&&l.input.lastIOSEnter>Date.now()-225||pn)&&p.some(_=>_.nodeType==1&&!gx.test(_.nodeName))&&(!w||w.endA>=w.endB)&&l.someProp("handleKeyDown",_=>_(l,po(13,"Enter"))))return void(l.input.lastIOSEnter=0);if(!w){if(!(u&&b instanceof se&&!b.empty&&b.$head.sameParent(b.$anchor))||l.composing||y.sel&&y.sel.anchor!=y.sel.head){if(y.sel){let _=vg(l,l.state.doc,y.sel);if(_&&!_.eq(l.state.selection)){let I=l.state.tr.setSelection(_);h&&I.setMeta("composition",h),l.dispatch(I)}}return}w={start:b.from,endA:b.to,endB:b.to}}l.state.selection.from<l.state.selection.to&&w.start==w.endB&&l.state.selection instanceof se&&(w.start>l.state.selection.from&&w.start<=l.state.selection.from+2&&l.state.selection.from>=y.from?w.start=l.state.selection.from:w.endA<l.state.selection.to&&w.endA>=l.state.selection.to-2&&l.state.selection.to<=y.to&&(w.endB+=l.state.selection.to-w.endA,w.endA=l.state.selection.to)),yt&&Vn<=11&&w.endB==w.start+1&&w.endA==w.start&&w.start>y.from&&y.doc.textBetween(w.start-y.from-1,w.start-y.from+1)==" "&&(w.start--,w.endA--,w.endB--);let S=y.doc.resolveNoCache(w.start-y.from),C=y.doc.resolveNoCache(w.endB-y.from),E=k.resolve(w.start),M=S.sameParent(C)&&S.parent.inlineContent&&E.end()>=w.endA;if((tr&&l.input.lastIOSEnter>Date.now()-225&&(!M||p.some(_=>_.nodeName=="DIV"||_.nodeName=="P"))||!M&&S.pos<y.doc.content.size&&(!S.sameParent(C)||!S.parent.inlineContent)&&S.pos<C.pos&&!/\S/.test(y.doc.textBetween(S.pos,C.pos,"","")))&&l.someProp("handleKeyDown",_=>_(l,po(13,"Enter"))))return void(l.input.lastIOSEnter=0);if(l.state.selection.anchor>w.start&&function(_,I,O,V,P){if(O-I<=P.pos-V.pos||gc(V,!0,!1)<P.pos)return!1;let A=_.resolve(I);if(!V.parent.isTextblock){let j=A.nodeAfter;return j!=null&&O==I+j.nodeSize}if(A.parentOffset<A.parent.content.size||!A.parent.isTextblock)return!1;let L=_.resolve(gc(A,!0,!0));return!(!L.parent.isTextblock||L.pos>O||gc(L,!0,!1)<O)&&V.parent.content.cut(V.parentOffset).eq(L.parent.content)}(k,w.start,w.endA,S,C)&&l.someProp("handleKeyDown",_=>_(l,po(8,"Backspace"))))return void(pn&&it&&l.domObserver.suppressSelectionUpdates());it&&w.endB==w.start&&(l.input.lastChromeDelete=Date.now()),pn&&!M&&S.start()!=C.start()&&C.parentOffset==0&&S.depth==C.depth&&y.sel&&y.sel.anchor==y.sel.head&&y.sel.head==w.endA&&(w.endB-=2,C=y.doc.resolveNoCache(w.endB-y.from),setTimeout(()=>{l.someProp("handleKeyDown",function(_){return _(l,po(13,"Enter"))})},20));let N,T=w.start,R=w.endA,z=_=>{let I=_||l.state.tr.replace(T,R,y.doc.slice(w.start-y.from,w.endB-y.from));if(y.sel){let O=vg(l,I.doc,y.sel);O&&!(it&&l.composing&&O.empty&&(w.start!=w.endB||l.input.lastChromeDelete<Date.now()-100)&&(O.head==T||O.head==I.mapping.map(R)-1)||yt&&O.empty&&O.head==T)&&I.setSelection(O)}return h&&I.setMeta("composition",h),I.scrollIntoView()};if(M)if(S.pos==C.pos){yt&&Vn<=11&&S.parentOffset==0&&(l.domObserver.suppressSelectionUpdates(),setTimeout(()=>fn(l),20));let _=z(l.state.tr.delete(T,R)),I=k.resolve(w.start).marksAcross(k.resolve(w.endA));I&&_.ensureMarks(I),l.dispatch(_)}else if(w.endA==w.endB&&(N=function(_,I){let O,V,P,A=_.firstChild.marks,L=I.firstChild.marks,j=A,K=L;for(let q=0;q<L.length;q++)j=L[q].removeFromSet(j);for(let q=0;q<A.length;q++)K=A[q].removeFromSet(K);if(j.length==1&&K.length==0)V=j[0],O="add",P=q=>q.mark(V.addToSet(q.marks));else{if(j.length!=0||K.length!=1)return null;V=K[0],O="remove",P=q=>q.mark(V.removeFromSet(q.marks))}let H=[];for(let q=0;q<I.childCount;q++)H.push(P(I.child(q)));if($.from(H).eq(_))return{mark:V,type:O}}(S.parent.content.cut(S.parentOffset,C.parentOffset),E.parent.content.cut(E.parentOffset,w.endA-E.start())))){let _=z(l.state.tr);N.type=="add"?_.addMark(T,R,N.mark):_.removeMark(T,R,N.mark),l.dispatch(_)}else if(S.parent.child(S.index()).isText&&S.index()==C.index()-(C.textOffset?0:1)){let _=S.parent.textBetween(S.parentOffset,C.parentOffset),I=()=>z(l.state.tr.insertText(_,T,R));l.someProp("handleTextInput",O=>O(l,T,R,_,I))||l.dispatch(I())}else l.dispatch(z());else l.dispatch(z())}(this,o,i,s,a)),this.domObserver.start(),function(o){for(let i in ut){let s=ut[i];o.dom.addEventListener(i,o.input.eventHandlers[i]=a=>{!rx(o,a)||dc(o,a)||!o.editable&&a.type in pt||s(o,a)},nx[i]?{passive:!0}:void 0)}dt&&o.dom.addEventListener("input",()=>null),cc(o)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&cc(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Sg),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let o in this._props)n[o]=this._props[o];n.state=this.state;for(let o in e)n[o]=e[o];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var o;let i=this.state,s=!1,a=!1;e.storedMarks&&this.composing&&(sg(this),a=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=Cg(this);(function(m,g){let v=0,b=0;for(let y in m){if(m[y]!=g[y])return!0;v++}for(let y in g)b++;return v!=b})(f,this.nodeViews)&&(this.nodeViews=f,s=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&cc(this),this.editable=xg(this),wg(this);let c=mc(this),d=kg(this),u=i.plugins==e.plugins||i.doc.eq(e.doc)?e.scrollToSelection>i.scrollToSelection?"to selection":"preserve":"reset",p=s||!this.docView.matchesNode(e.doc,d,c);!p&&e.selection.eq(i.selection)||(a=!0);let h=u=="preserve"&&a&&this.dom.style.overflowAnchor==null&&function(f){let m,g,v=f.dom.getBoundingClientRect(),b=Math.max(0,v.top);for(let y=(v.left+v.right)/2,k=b+1;k<Math.min(innerHeight,v.bottom);k+=5){let x=f.root.elementFromPoint(y,k);if(!x||x==f.dom||!f.dom.contains(x))continue;let w=x.getBoundingClientRect();if(w.top>=b-20){m=x,g=w.top;break}}return{refDOM:m,refTop:g,stack:ym(f.dom)}}(this);if(a){this.domObserver.stop();let f=p&&(yt||it)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&function(m,g){let v=Math.min(m.$anchor.sharedDepth(m.head),g.$anchor.sharedDepth(g.head));return m.$anchor.start(v)!=g.$anchor.start(v)}(i.selection,e.selection);if(p){let m=it?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(g){let v=g.domSelectionRange();if(!v.focusNode)return null;let b=function(k,x){for(;;){if(k.nodeType==3&&x)return k;if(k.nodeType==1&&x>0){if(k.contentEditable=="false")return null;x=Vt(k=k.childNodes[x-1])}else{if(!k.parentNode||Fr(k))return null;x=et(k),k=k.parentNode}}}(v.focusNode,v.focusOffset),y=function(k,x){for(;;){if(k.nodeType==3&&x<k.nodeValue.length)return k;if(k.nodeType==1&&x<k.childNodes.length){if(k.contentEditable=="false")return null;k=k.childNodes[x],x=0}else{if(!k.parentNode||Fr(k))return null;x=et(k)+1,k=k.parentNode}}}(v.focusNode,v.focusOffset);if(b&&y&&b!=y){let k=y.pmViewDesc,x=g.domObserver.lastChangedTextNode;if(b==x||y==x)return x;if(!k||!k.isText(y.nodeValue))return y;if(g.input.compositionNode==y){let w=b.pmViewDesc;if(w&&w.isText(b.nodeValue))return y}}return b||y}(this)),!s&&this.docView.update(e.doc,d,c,this)||(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=Tm(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(m){let g=m.docView.domFromPos(m.state.selection.anchor,0),v=m.domSelectionRange();return uo(g.node,g.offset,v.anchorNode,v.anchorOffset)}(this))?fn(this,f):($m(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((o=this.dragging)===null||o===void 0)&&o.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&function({refDOM:f,refTop:m,stack:g}){let v=f?f.getBoundingClientRect().top:0;bm(g,v==0?0:v-m)}(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(e.nodeType==1?e:e.parentNode)&&!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ne){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&vm(this,n.getBoundingClientRect(),e)}else vm(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let n=0;n<this.pluginViews.length;n++){let o=this.pluginViews[n];o.update&&o.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let o=this.directPlugins[n];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let o=this.state.plugins[n];o.spec.view&&this.pluginViews.push(o.spec.view(this))}}}updateDraggedNode(e,n){let o=e.node,i=-1;if(this.state.doc.nodeAt(o.from)==o.node)i=o.from;else{let s=o.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==o.node&&(i=s)}this.dragging=new lg(e.slice,e.move,i<0?void 0:ne.create(this.state.doc,i))}someProp(e,n){let o,i=this._props&&this._props[e];if(i!=null&&(o=n?n(i):i))return o;for(let a=0;a<this.directPlugins.length;a++){let l=this.directPlugins[a].props[e];if(l!=null&&(o=n?n(l):l))return o}let s=this.state.plugins;if(s)for(let a=0;a<s.length;a++){let l=s[a].props[e];if(l!=null&&(o=n?n(l):l))return o}}hasFocus(){if(yt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(nr)return e.focus(nr);let n=ym(e);e.focus(nr==null?{get preventScroll(){return nr={preventScroll:!0},!0}}:void 0),nr||(nr=!1,bm(n,0))}(this.dom),fn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return qw(this,e)}coordsAtPos(e,n=1){return Cm(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,o=-1){let i=this.docView.posFromDOM(e,n,o);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return function(o,i,s){return Em==i&&Mm==s?Nm:(Em=i,Mm=s,Nm=s=="up"||s=="down"?function(a,l,c){let d=l.selection,u=c=="up"?d.$from:d.$to;return Sm(a,l,()=>{let{node:p}=a.docView.domFromPos(u.pos,c=="up"?-1:1);for(;;){let f=a.docView.nearestDesc(p,!0);if(!f)break;if(f.node.isBlock){p=f.contentDOM||f.dom;break}p=f.dom.parentNode}let h=Cm(a,u.pos,1);for(let f=p.firstChild;f;f=f.nextSibling){let m;if(f.nodeType==1)m=f.getClientRects();else{if(f.nodeType!=3)continue;m=un(f,0,f.nodeValue.length).getClientRects()}for(let g=0;g<m.length;g++){let v=m[g];if(v.bottom>v.top+1&&(c=="up"?h.top-v.top>2*(v.bottom-h.top):v.bottom-h.bottom>2*(h.bottom-v.top)))return!1}}return!0})}(o,i,s):function(a,l,c){let{$head:d}=l.selection;if(!d.parent.isTextblock)return!1;let u=d.parentOffset,p=!u,h=u==d.parent.content.size,f=a.domSelection();return f?Gw.test(d.parent.textContent)&&f.modify?Sm(a,l,()=>{let{focusNode:m,focusOffset:g,anchorNode:v,anchorOffset:b}=a.domSelectionRange(),y=f.caretBidiLevel;f.modify("move",c,"character");let k=d.depth?a.docView.domAfterPos(d.before()):a.dom,{focusNode:x,focusOffset:w}=a.domSelectionRange(),S=x&&!k.contains(x.nodeType==1?x:x.parentNode)||m==x&&g==w;try{f.collapse(v,b),m&&(m!=v||g!=b)&&f.extend&&f.extend(m,g)}catch{}return y!=null&&(f.caretBidiLevel=y),S}):c=="left"||c=="backward"?p:h:d.pos==d.start()||d.pos==d.end()}(o,i,s))}(this,n||this.state,e)}pasteHTML(e,n){return Gr(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Gr(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return sc(this,e)}destroy(){this.docView&&(function(e){e.domObserver.stop();for(let n in e.input.eventHandlers)e.dom.removeEventListener(n,e.input.eventHandlers[n]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],mc(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,ql=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return function(n,o){dc(n,o)||!ut[o.type]||!n.editable&&o.type in pt||ut[o.type](n,o)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?dt&&this.root.nodeType===11&&function(n){let o=n.activeElement;for(;o&&o.shadowRoot;)o=o.shadowRoot.activeElement;return o}(this.dom.ownerDocument)==this.dom&&function(n,o){if(o.getComposedRanges){let a=o.getComposedRanges(n.root)[0];if(a)return gg(n,a)}let i;function s(a){a.preventDefault(),a.stopImmediatePropagation(),i=a.getTargetRanges()[0]}return n.dom.addEventListener("beforeinput",s,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",s,!0),i?gg(n,i):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function kg(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let o in n)o=="class"?e.class+=" "+n[o]:o=="style"?e.style=(e.style?e.style+";":"")+n[o]:e[o]||o=="contenteditable"||o=="nodeName"||(e[o]=String(n[o]))}),e.translate||(e.translate="no"),[ht.node(0,t.state.doc.content.size,e)]}function wg(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:ht.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function xg(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Cg(t){let e=Object.create(null);function n(o){for(let i in o)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=o[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Sg(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}bg.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};for(var Pn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ms={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},vx=typeof navigator<"u"&&/Mac/.test(navigator.platform),yx=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),tt=0;tt<10;tt++)Pn[48+tt]=Pn[96+tt]=String(tt);for(tt=1;tt<=24;tt++)Pn[tt+111]="F"+tt;for(tt=65;tt<=90;tt++)Pn[tt]=String.fromCharCode(tt+32),ms[tt]=String.fromCharCode(tt);for(var vc in Pn)ms.hasOwnProperty(vc)||(ms[vc]=Pn[vc]);const bx=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),kx=typeof navigator<"u"&&/Win/.test(navigator.platform);function wx(t){let e,n,o,i,s=t.split(/-(?!$)/),a=s[s.length-1];a=="Space"&&(a=" ");for(let l=0;l<s.length-1;l++){let c=s[l];if(/^(cmd|meta|m)$/i.test(c))i=!0;else if(/^a(lt)?$/i.test(c))e=!0;else if(/^(c|ctrl|control)$/i.test(c))n=!0;else if(/^s(hift)?$/i.test(c))o=!0;else{if(!/^mod$/i.test(c))throw new Error("Unrecognized modifier name: "+c);bx?i=!0:n=!0}}return e&&(a="Alt-"+a),n&&(a="Ctrl-"+a),i&&(a="Meta-"+a),o&&(a="Shift-"+a),a}function yc(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function Eg(t){let e=function(n){let o=Object.create(null);for(let i in n)o[wx(i)]=n[i];return o}(t);return function(n,o){let i,s=function(l){var c=!(vx&&l.metaKey&&l.shiftKey&&!l.ctrlKey&&!l.altKey||yx&&l.shiftKey&&l.key&&l.key.length==1||l.key=="Unidentified")&&l.key||(l.shiftKey?ms:Pn)[l.keyCode]||l.key||"Unidentified";return c=="Esc"&&(c="Escape"),c=="Del"&&(c="Delete"),c=="Left"&&(c="ArrowLeft"),c=="Up"&&(c="ArrowUp"),c=="Right"&&(c="ArrowRight"),c=="Down"&&(c="ArrowDown"),c}(o),a=e[yc(s,o)];if(a&&a(n.state,n.dispatch,n))return!0;if(s.length==1&&s!=" "){if(o.shiftKey){let l=e[yc(s,o,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((o.altKey||o.metaKey||o.ctrlKey)&&!(kx&&o.ctrlKey&&o.altKey)&&(i=Pn[o.keyCode])&&i!=s){let l=e[yc(i,o)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var xx=Object.defineProperty,bc=(t,e)=>{for(var n in e)xx(t,n,{get:e[n],enumerable:!0})};function gs(t){const{state:e,transaction:n}=t;let{selection:o}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return o},get doc(){return i},get tr(){return o=n.selection,i=n.doc,s=n.storedMarks,n}}}var vs=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:o}=e,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([a,l])=>[a,(...c)=>{const d=l(...c)(s);return i.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(i),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:o,state:i}=this,{view:s}=o,a=[],l=!!t,c=t||i.tr,d={...Object.fromEntries(Object.entries(n).map(([u,p])=>[u,(...h)=>{const f=this.buildProps(c,e),m=p(...h)(f);return a.push(m),d}])),run:()=>(l||!e||c.getMeta("preventDispatch")||this.hasCustomState||s.dispatch(c),a.every(u=>u===!0))};return d}createCan(t){const{rawCommands:e,state:n}=this,o=!1,i=t||n.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>l(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(t,e=!0){const{rawCommands:n,editor:o,state:i}=this,{view:s}=o,a={tr:t,editor:o,view:s,state:gs({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...d)=>c(...d)(a)]))}};return a}},Mg={};bc(Mg,{blur:()=>Cx,clearContent:()=>Sx,clearNodes:()=>Ex,command:()=>Mx,createParagraphNear:()=>Nx,cut:()=>Bx,deleteCurrentNode:()=>Tx,deleteNode:()=>Ox,deleteRange:()=>_x,deleteSelection:()=>Ax,enter:()=>Vx,exitCode:()=>Ix,extendMarkRange:()=>Dx,first:()=>Rx,focus:()=>Lx,forEach:()=>zx,insertContent:()=>$x,insertContentAt:()=>Px,joinBackward:()=>Hx,joinDown:()=>Fx,joinForward:()=>Wx,joinItemBackward:()=>Kx,joinItemForward:()=>Ux,joinTextblockBackward:()=>qx,joinTextblockForward:()=>Jx,joinUp:()=>jx,keyboardShortcut:()=>Gx,lift:()=>Yx,liftEmptyBlock:()=>Xx,liftListItem:()=>Zx,newlineInCode:()=>Qx,resetAttributes:()=>eC,scrollIntoView:()=>tC,selectAll:()=>nC,selectNodeBackward:()=>oC,selectNodeForward:()=>rC,selectParentNode:()=>iC,selectTextblockEnd:()=>sC,selectTextblockStart:()=>aC,setContent:()=>lC,setMark:()=>cC,setMeta:()=>dC,setNode:()=>uC,setNodeSelection:()=>pC,setTextSelection:()=>hC,sinkListItem:()=>fC,splitBlock:()=>mC,splitListItem:()=>gC,toggleList:()=>vC,toggleMark:()=>yC,toggleNode:()=>bC,toggleWrap:()=>kC,undoInputRule:()=>wC,unsetAllMarks:()=>xC,unsetMark:()=>CC,updateAttributes:()=>SC,wrapIn:()=>EC,wrapInList:()=>MC});var Cx=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),Sx=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),Ex=()=>({state:t,tr:e,dispatch:n})=>{const{selection:o}=e,{ranges:i}=o;return!n||(i.forEach(({$from:s,$to:a})=>{t.doc.nodesBetween(s.pos,a.pos,(l,c)=>{if(l.type.isText)return;const{doc:d,mapping:u}=e,p=d.resolve(u.map(c)),h=d.resolve(u.map(c+l.nodeSize)),f=p.blockRange(h);if(!f)return;const m=Go(f);if(l.type.isTextblock){const{defaultType:g}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(f.start,g)}(m||m===0)&&e.lift(f,m)})}),!0)},Mx=t=>e=>t(e),Nx=()=>({state:t,dispatch:e})=>lm(t,e),Bx=(t,e)=>({editor:n,tr:o})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);o.deleteRange(t.from,t.to);const a=o.mapping.map(e);return o.insert(a,s.content),o.setSelection(new se(o.doc.resolve(Math.max(a-1,0)))),!0},Tx=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,o=n.$anchor.node();if(o.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o.type){if(e){const a=i.before(s),l=i.after(s);t.delete(a,l).scrollIntoView()}return!0}return!1};function Ke(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var Ox=t=>({tr:e,state:n,dispatch:o})=>{const i=Ke(t,n.schema),s=e.selection.$anchor;for(let a=s.depth;a>0;a-=1)if(s.node(a).type===i){if(o){const l=s.before(a),c=s.after(a);e.delete(l,c).scrollIntoView()}return!0}return!1},_x=t=>({tr:e,dispatch:n})=>{const{from:o,to:i}=t;return n&&e.delete(o,i),!0},Ax=()=>({state:t,dispatch:e})=>Fl(t,e),Vx=()=>({commands:t})=>t.keyboardShortcut("Enter"),Ix=()=>({state:t,dispatch:e})=>((n,o)=>{let{$head:i,$anchor:s}=n.selection;if(!i.parent.type.spec.code||!i.sameParent(s))return!1;let a=i.node(-1),l=i.indexAfter(-1),c=Kl(a.contentMatchAt(l));if(!c||!a.canReplaceWith(l,l,c))return!1;if(o){let d=i.after(),u=n.tr.replaceWith(d,d,c.createAndFill());u.setSelection(pe.near(u.doc.resolve(d),1)),o(u.scrollIntoView())}return!0})(t,e);function kc(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function ys(t,e,n={strict:!0}){const o=Object.keys(e);return!o.length||o.every(i=>n.strict?e[i]===t[i]:kc(e[i])?e[i].test(t[i]):e[i]===t[i])}function Ng(t,e,n={}){return t.find(o=>o.type===e&&ys(Object.fromEntries(Object.keys(n).map(i=>[i,o.attrs[i]])),n))}function Bg(t,e,n={}){return!!Ng(t,e,n)}function wc(t,e,n){var o;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if(i.node&&i.node.marks.some(d=>d.type===e)||(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(d=>d.type===e)||(n=n||((o=i.node.marks[0])==null?void 0:o.attrs),!Ng([...i.node.marks],e,n)))return;let s=i.index,a=t.start()+i.offset,l=s+1,c=a+i.node.nodeSize;for(;s>0&&Bg([...t.parent.child(s-1).marks],e,n);)s-=1,a-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&Bg([...t.parent.child(l).marks],e,n);)c+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function mn(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var Dx=(t,e={})=>({tr:n,state:o,dispatch:i})=>{const s=mn(t,o.schema),{doc:a,selection:l}=n,{$from:c,from:d,to:u}=l;if(i){const p=wc(c,s,e);if(p&&p.from<=d&&p.to>=u){const h=se.create(a,p.from,p.to);n.setSelection(h)}}return!0},Rx=t=>e=>{const n=typeof t=="function"?t(e):t;for(let o=0;o<n.length;o+=1)if(n[o](e))return!0;return!1};function Tg(t){return t instanceof se}function vo(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Og(t,e=null){if(!e)return null;const n=pe.atStart(t),o=pe.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return o;const i=n.from,s=o.to;return e==="all"?se.create(t,vo(0,i,s),vo(t.content.size,i,s)):se.create(t,vo(e,i,s),vo(e,i,s))}function xc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Lx=(t=null,e={})=>({editor:n,view:o,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const a=()=>{(xc()||navigator.platform==="Android"||/android/i.test(navigator.userAgent))&&o.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(o.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(o.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!Tg(n.state.selection))return a(),!0;const l=Og(i.doc,t)||n.state.selection,c=n.state.selection.eq(l);return s&&(c||i.setSelection(l),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},zx=(t,e)=>n=>t.every((o,i)=>e(o,{...n,index:i})),$x=(t,e)=>({tr:n,commands:o})=>o.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),_g=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const o=e[n];o.nodeType===3&&o.nodeValue&&/^(\n\s\s|\n)$/.test(o.nodeValue)?t.removeChild(o):o.nodeType===1&&_g(o)}return t};function bs(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return _g(n)}function Xr(t,e,n){if(t instanceof jt||t instanceof $)return t;n={slice:!0,parseOptions:{},...n};const o=typeof t=="string";if(typeof t=="object"&&t!==null)try{if(Array.isArray(t)&&t.length>0)return $.fromArray(t.map(s=>e.nodeFromJSON(s)));const i=e.nodeFromJSON(t);return n.errorOnInvalidContent&&i.check(),i}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),Xr("",e,n)}if(o){if(n.errorOnInvalidContent){let s=!1,a="";const l=new Mf({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Bn.fromSchema(l).parseSlice(bs(t),n.parseOptions):Bn.fromSchema(l).parse(bs(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=Bn.fromSchema(e);return n.slice?i.parseSlice(bs(t),n.parseOptions).content:i.parse(bs(t),n.parseOptions)}return Xr("",e,n)}var Px=(t,e,n)=>({tr:o,dispatch:i,editor:s})=>{var a;if(i){let l;const c=g=>{s.emit("contentError",{editor:s,error:g,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...(n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Xr(e,s.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(g){c(g)}try{l=Xr(e,s.schema,{parseOptions:d,errorOnInvalidContent:(a=n.errorOnInvalidContent)!=null?a:s.options.enableContentCheck})}catch(g){return c(g),!1}let u,{from:p,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,m=!0;if(("type"in l?[l]:l).forEach(g=>{g.check(),f=!!f&&g.isText&&g.marks.length===0,m=!!m&&g.isBlock}),p===h&&m){const{parent:g}=o.doc.resolve(p);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(p-=1,h+=1)}if(f){if(Array.isArray(e))u=e.map(g=>g.text||"").join("");else if(e instanceof $){let g="";e.forEach(v=>{v.text&&(g+=v.text)}),u=g}else u=typeof e=="object"&&e&&e.text?e.text:e;o.insertText(u,p,h)}else{u=l;const g=o.doc.resolve(p),v=g.node(),b=g.parentOffset===0,y=v.isText||v.isTextblock,k=v.content.size>0;b&&y&&k&&(p=Math.max(0,p-1)),o.replaceWith(p,h,u)}n.updateSelection&&function(g,v){const b=g.steps.length-1;if(b<v)return;const y=g.steps[b];if(!(y instanceof Je||y instanceof Ge))return;const k=g.mapping.maps[b];let x=0;k.forEach((w,S,C,E)=>{x===0&&(x=E)}),g.setSelection(pe.near(g.doc.resolve(x),-1))}(o,o.steps.length-1),n.applyInputRules&&o.setMeta("applyInputRules",{from:p,text:u}),n.applyPasteRules&&o.setMeta("applyPasteRules",{from:p,text:u})}return!0},jx=()=>({state:t,dispatch:e})=>((n,o)=>{let i,s=n.selection,a=s instanceof ne;if(a){if(s.node.isTextblock||!_n(n.doc,s.from))return!1;i=s.from}else if(i=rs(n.doc,s.from,-1),i==null)return!1;if(o){let l=n.tr.join(i);a&&l.setSelection(ne.create(l.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),o(l.scrollIntoView())}return!0})(t,e),Fx=()=>({state:t,dispatch:e})=>((n,o)=>{let i,s=n.selection;if(s instanceof ne){if(s.node.isTextblock||!_n(n.doc,s.to))return!1;i=s.to}else if(i=rs(n.doc,s.to,1),i==null)return!1;return o&&o(n.tr.join(i).scrollIntoView()),!0})(t,e),Hx=()=>({state:t,dispatch:e})=>tm(t,e),Wx=()=>({state:t,dispatch:e})=>im(t,e),Kx=()=>({state:t,dispatch:e,tr:n})=>{try{const o=rs(t.doc,t.selection.$from.pos,-1);return o!=null&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},Ux=()=>({state:t,dispatch:e,tr:n})=>{try{const o=rs(t.doc,t.selection.$from.pos,1);return o!=null&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},qx=()=>({state:t,dispatch:e})=>((n,o)=>{let i=em(n,void 0);if(!i)return!1;let s=Hl(i);return!!s&&nm(n,s,o)})(t,e),Jx=()=>({state:t,dispatch:e})=>((n,o)=>{let i=rm(n,void 0);if(!i)return!1;let s=Wl(i);return!!s&&nm(n,s,o)})(t,e);function Ag(){return typeof navigator<"u"&&/Mac/.test(navigator.platform)}var Gx=t=>({editor:e,view:n,tr:o,dispatch:i})=>{const s=function(d){const u=d.split(/-(?!$)/);let p,h,f,m,g=u[u.length-1];g==="Space"&&(g=" ");for(let v=0;v<u.length-1;v+=1){const b=u[v];if(/^(cmd|meta|m)$/i.test(b))m=!0;else if(/^a(lt)?$/i.test(b))p=!0;else if(/^(c|ctrl|control)$/i.test(b))h=!0;else if(/^s(hift)?$/i.test(b))f=!0;else{if(!/^mod$/i.test(b))throw new Error(`Unrecognized modifier name: ${b}`);xc()||Ag()?m=!0:h=!0}}return p&&(g=`Alt-${g}`),h&&(g=`Ctrl-${g}`),m&&(g=`Meta-${g}`),f&&(g=`Shift-${g}`),g}(t).split(/-(?!$)/),a=s.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return c==null||c.steps.forEach(d=>{const u=d.map(o.mapping);u&&i&&o.maybeStep(u)}),!0};function jn(t,e,n={}){const{from:o,to:i,empty:s}=t.selection,a=e?Ke(e,t.schema):null,l=[];t.doc.nodesBetween(o,i,(u,p)=>{if(u.isText)return;const h=Math.max(o,p),f=Math.min(i,p+u.nodeSize);l.push({node:u,from:h,to:f})});const c=i-o,d=l.filter(u=>!a||a.name===u.node.type.name).filter(u=>ys(u.node.attrs,n,{strict:!1}));return s?!!d.length:d.reduce((u,p)=>u+p.to-p.from,0)>=c}var Yx=(t,e={})=>({state:n,dispatch:o})=>!!jn(n,Ke(t,n.schema),e)&&((i,s)=>{let{$from:a,$to:l}=i.selection,c=a.blockRange(l),d=c&&Go(c);return d!=null&&(s&&s(i.tr.lift(c,d).scrollIntoView()),!0)})(n,o),Xx=()=>({state:t,dispatch:e})=>cm(t,e),Zx=t=>({state:e,dispatch:n})=>{return(o=Ke(t,e.schema),function(i,s){let{$from:a,$to:l}=i.selection,c=a.blockRange(l,d=>d.childCount>0&&d.firstChild.type==o);return!!c&&(!s||(a.node(c.depth-1).type==o?function(d,u,p,h){let f=d.tr,m=h.end,g=h.$to.end(h.depth);m<g&&(f.step(new Ge(m-1,g,m,g,new J($.from(p.create(null,h.parent.copy())),1,0),1,!0)),h=new Qi(f.doc.resolve(h.$from.pos),f.doc.resolve(g),h.depth));const v=Go(h);if(v==null)return!1;f.lift(h,v);let b=f.doc.resolve(f.mapping.map(m,-1)-1);return _n(f.doc,b.pos)&&b.nodeBefore.type==b.nodeAfter.type&&f.join(b.pos),u(f.scrollIntoView()),!0}(i,s,o,c):function(d,u,p){let h=d.tr,f=p.parent;for(let S=p.end,C=p.endIndex-1,E=p.startIndex;C>E;C--)S-=f.child(C).nodeSize,h.delete(S-1,S+1);let m=h.doc.resolve(p.start),g=m.nodeAfter;if(h.mapping.map(p.end)!=p.start+m.nodeAfter.nodeSize)return!1;let v=p.startIndex==0,b=p.endIndex==f.childCount,y=m.node(-1),k=m.index(-1);if(!y.canReplace(k+(v?0:1),k+1,g.content.append(b?$.empty:$.from(f))))return!1;let x=m.pos,w=x+g.nodeSize;return h.step(new Ge(x-(v?1:0),w+(b?1:0),x+1,w-1,new J((v?$.empty:$.from(f.copy($.empty))).append(b?$.empty:$.from(f.copy($.empty))),v?0:1,b?0:1),v?0:1)),u(h.scrollIntoView()),!0}(i,s,c)))})(e,n);var o},Qx=()=>({state:t,dispatch:e})=>am(t,e);function ks(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Vg(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((o,i)=>(n.includes(i)||(o[i]=t[i]),o),{})}var eC=(t,e)=>({tr:n,state:o,dispatch:i})=>{let s=null,a=null;const l=ks(typeof t=="string"?t:t.name,o.schema);return!!l&&(l==="node"&&(s=Ke(t,o.schema)),l==="mark"&&(a=mn(t,o.schema)),i&&n.selection.ranges.forEach(c=>{o.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,u)=>{s&&s===d.type&&n.setNodeMarkup(u,void 0,Vg(d.attrs,e)),a&&d.marks.length&&d.marks.forEach(p=>{a===p.type&&n.addMark(u,u+d.nodeSize,a.create(Vg(p.attrs,e)))})})}),!0)},tC=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),nC=()=>({tr:t,dispatch:e})=>{if(e){const n=new Nt(t.doc);t.setSelection(n)}return!0},oC=()=>({state:t,dispatch:e})=>om(t,e),rC=()=>({state:t,dispatch:e})=>sm(t,e),iC=()=>({state:t,dispatch:e})=>((n,o)=>{let i,{$from:s,to:a}=n.selection,l=s.sharedDepth(a);return l!=0&&(i=s.before(l),o&&o(n.tr.setSelection(ne.create(n.doc,i))),!0)})(t,e),sC=()=>({state:t,dispatch:e})=>jw(t,e),aC=()=>({state:t,dispatch:e})=>Pw(t,e);function Cc(t,e,n={},o={}){return Xr(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:o.errorOnInvalidContent})}var lC=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:o={}}={})=>({editor:i,tr:s,dispatch:a,commands:l})=>{const{doc:c}=s;if(o.preserveWhitespace!=="full"){const d=Cc(t,i.schema,o,{errorOnInvalidContent:e??i.options.enableContentCheck});return a&&s.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!n),!0}return a&&s.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:c.content.size},t,{parseOptions:o,errorOnInvalidContent:e??i.options.enableContentCheck})};function Ig(t,e){const n=mn(e,t.schema),{from:o,to:i,empty:s}=t.selection,a=[];s?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(o,i,c=>{a.push(...c.marks)});const l=a.find(c=>c.type.name===n.name);return l?{...l.attrs}:{}}function Dg(t,e){const n=new qf(t);return e.forEach(o=>{o.steps.forEach(i=>{n.step(i)})}),n}function ws(t){return e=>function(n,o){for(let i=n.depth;i>0;i-=1){const s=n.node(i);if(o(s))return{pos:i>0?n.before(i):0,start:n.start(i),depth:i,node:s}}}(e.$from,t)}function te(t,e,n){return t.config[e]===void 0&&t.parent?te(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?te(t.parent,e,n):null}):t.config[e]}function Sc(t){return t.map(e=>{const n=te(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return n?[e,...Sc(n())]:e}).flat(10)}function Ec(t,e){const n=lo.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function Rg(t){return typeof t=="function"}function ke(t,e=void 0,...n){return Rg(t)?e?t.bind(e)(...n):t(...n):t}function Zr(t){return{baseExtensions:t.filter(e=>e.type==="extension"),nodeExtensions:t.filter(e=>e.type==="node"),markExtensions:t.filter(e=>e.type==="mark")}}function Lg(t){const e=[],{nodeExtensions:n,markExtensions:o}=Zr(t),i=[...n,...o],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(a=>{const l=te(a,"addGlobalAttributes",{name:a.name,options:a.options,storage:a.storage,extensions:i});l&&l().forEach(c=>{c.types.forEach(d=>{Object.entries(c.attributes).forEach(([u,p])=>{e.push({type:d,name:u,attribute:{...s,...p}})})})})}),i.forEach(a=>{const l={name:a.name,options:a.options,storage:a.storage},c=te(a,"addAttributes",l);if(!c)return;const d=c();Object.entries(d).forEach(([u,p])=>{const h={...s,...p};typeof(h==null?void 0:h.default)=="function"&&(h.default=h.default()),h!=null&&h.isRequired&&(h==null?void 0:h.default)===void 0&&delete h.default,e.push({type:a.name,name:u,attribute:h})})}),e}function Fe(...t){return t.filter(e=>!!e).reduce((e,n)=>{const o={...e};return Object.entries(n).forEach(([i,s])=>{if(o[i])if(i==="class"){const a=s?String(s).split(" "):[],l=o[i]?o[i].split(" "):[],c=a.filter(d=>!l.includes(d));o[i]=[...l,...c].join(" ")}else if(i==="style"){const a=s?s.split(";").map(d=>d.trim()).filter(Boolean):[],l=o[i]?o[i].split(";").map(d=>d.trim()).filter(Boolean):[],c=new Map;l.forEach(d=>{const[u,p]=d.split(":").map(h=>h.trim());c.set(u,p)}),a.forEach(d=>{const[u,p]=d.split(":").map(h=>h.trim());c.set(u,p)}),o[i]=Array.from(c.entries()).map(([d,u])=>`${d}: ${u}`).join("; ")}else o[i]=s;else o[i]=s}),o},{})}function xs(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,o)=>Fe(n,o),{})}function zg(t,e){return"style"in t?t:{...t,getAttrs:n=>{const o=t.getAttrs?t.getAttrs(n):t.attrs;if(o===!1)return!1;const i=e.reduce((s,a)=>{const l=a.attribute.parseHTML?a.attribute.parseHTML(n):function(c){return typeof c!="string"?c:c.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(c):c==="true"||c!=="false"&&c}(n.getAttribute(a.name));return l==null?s:{...s,[a.name]:l}},{});return{...o,...i}}}}function $g(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>(e!=="attrs"||!function(o={}){return Object.keys(o).length===0&&o.constructor===Object}(n))&&n!=null))}function Mc(t){return t.sort((e,n)=>{const o=te(e,"priority")||100,i=te(n,"priority")||100;return o>i?-1:o<i?1:0})}function Pg(t){const e=Mc(Sc(t)),n=function(o){const i=o.filter((s,a)=>o.indexOf(s)!==a);return Array.from(new Set(i))}(e.map(o=>o.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),e}function jg(t,e,n){const{from:o,to:i}=e,{blockSeparator:s=`
|
|
46
|
+
|
|
47
|
+
`,textSerializers:a={}}=n||{};let l="";return t.nodesBetween(o,i,(c,d,u,p)=>{var h;c.isBlock&&d>o&&(l+=s);const f=a==null?void 0:a[c.type.name];if(f)return u&&(l+=f({node:c,pos:d,parent:u,index:p,range:e})),!1;c.isText&&(l+=(h=c==null?void 0:c.text)==null?void 0:h.slice(Math.max(o,d)-d,i-d))}),l}function Fg(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function Hg(t,e){const n=ks(typeof e=="string"?e:e.name,t.schema);return n==="node"?function(o,i){const s=Ke(i,o.schema),{from:a,to:l}=o.selection,c=[];o.doc.nodesBetween(a,l,u=>{c.push(u)});const d=c.reverse().find(u=>u.type.name===s.name);return d?{...d.attrs}:{}}(t,e):n==="mark"?Ig(t,e):{}}function Wg(t){const{mapping:e,steps:n}=t,o=[];return e.maps.forEach((i,s)=>{const a=[];if(i.ranges.length)i.forEach((l,c)=>{a.push({from:l,to:c})});else{const{from:l,to:c}=n[s];if(l===void 0||c===void 0)return;a.push({from:l,to:c})}a.forEach(({from:l,to:c})=>{const d=e.slice(s).map(l,-1),u=e.slice(s).map(c),p=e.invert().map(d,-1),h=e.invert().map(u);o.push({oldRange:{from:p,to:h},newRange:{from:d,to:u}})})}),function(i){const s=function(a,l=JSON.stringify){const c={};return a.filter(d=>{const u=l(d);return!Object.prototype.hasOwnProperty.call(c,u)&&(c[u]=!0)})}(i);return s.length===1?s:s.filter((a,l)=>!s.filter((d,u)=>u!==l).some(d=>a.oldRange.from>=d.oldRange.from&&a.oldRange.to<=d.oldRange.to&&a.newRange.from>=d.newRange.from&&a.newRange.to<=d.newRange.to))}(o)}function Nc(t,e,n){const o=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=wc(n.resolve(t),i.type);s&&o.push({mark:i,...s})}):n.nodesBetween(t,e,(i,s)=>{i&&(i==null?void 0:i.nodeSize)!==void 0&&o.push(...i.marks.map(a=>({from:s,to:s+i.nodeSize,mark:a})))}),o}function Bc(t,e){return e.nodes[t]||e.marks[t]||null}function Cs(t,e,n){return Object.fromEntries(Object.entries(n).filter(([o])=>{const i=t.find(s=>s.type===e&&s.name===o);return!!i&&i.attribute.keepOnSplit}))}function Tc(t,e,n={}){const{empty:o,ranges:i}=t.selection,s=e?mn(e,t.schema):null;if(o)return!!(t.storedMarks||t.selection.$from.marks()).filter(u=>!s||s.name===u.type.name).find(u=>ys(u.attrs,n,{strict:!1}));let a=0;const l=[];if(i.forEach(({$from:u,$to:p})=>{const h=u.pos,f=p.pos;t.doc.nodesBetween(h,f,(m,g)=>{if(!m.isText&&!m.marks.length)return;const v=Math.max(h,g),b=Math.min(f,g+m.nodeSize);a+=b-v,l.push(...m.marks.map(y=>({mark:y,from:v,to:b})))})}),a===0)return!1;const c=l.filter(u=>!s||s.name===u.mark.type.name).filter(u=>ys(u.mark.attrs,n,{strict:!1})).reduce((u,p)=>u+p.to-p.from,0),d=l.filter(u=>!s||u.mark.type!==s&&u.mark.type.excludes(s)).reduce((u,p)=>u+p.to-p.from,0);return(c>0?c+d:c)>=a}function Kg(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Ug(t,e){const{nodeExtensions:n}=Zr(e),o=n.find(s=>s.name===t);if(!o)return!1;const i=ke(te(o,"group",{name:o.name,options:o.options,storage:o.storage}));return typeof i=="string"&&i.split(" ").includes("list")}function Ss(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var o;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((o=t.text)!=null?o:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(Ss(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function qg(t){return t instanceof ne}var cC=(t,e={})=>({tr:n,state:o,dispatch:i})=>{const{selection:s}=n,{empty:a,ranges:l}=s,c=mn(t,o.schema);if(i)if(a){const d=Ig(o,c);n.addStoredMark(c.create({...d,...e}))}else l.forEach(d=>{const u=d.$from.pos,p=d.$to.pos;o.doc.nodesBetween(u,p,(h,f)=>{const m=Math.max(f,u),g=Math.min(f+h.nodeSize,p);h.marks.find(v=>v.type===c)?h.marks.forEach(v=>{c===v.type&&n.addMark(m,g,c.create({...v.attrs,...e}))}):n.addMark(m,g,c.create(e))})});return function(d,u,p){var h;const{selection:f}=u;let m=null;if(Tg(f)&&(m=f.$cursor),m){const v=(h=d.storedMarks)!=null?h:m.marks();return m.parent.type.allowsMarkType(p)&&(!!p.isInSet(v)||!v.some(b=>b.type.excludes(p)))}const{ranges:g}=f;return g.some(({$from:v,$to:b})=>{let y=v.depth===0&&d.doc.inlineContent&&d.doc.type.allowsMarkType(p);return d.doc.nodesBetween(v.pos,b.pos,(k,x,w)=>{if(y)return!1;if(k.isInline){const S=!w||w.type.allowsMarkType(p),C=!!p.isInSet(k.marks)||!k.marks.some(E=>E.type.excludes(p));y=S&&C}return!y}),y})}(o,n,c)},dC=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),uC=(t,e={})=>({state:n,dispatch:o,chain:i})=>{const s=Ke(t,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:l})=>!!pm(s,{...a,...e})(n)||l.clearNodes()).command(({state:l})=>pm(s,{...a,...e})(l,o)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},pC=t=>({tr:e,dispatch:n})=>{if(n){const{doc:o}=e,i=vo(t,0,o.content.size),s=ne.create(o,i);e.setSelection(s)}return!0},hC=t=>({tr:e,dispatch:n})=>{if(n){const{doc:o}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,a=se.atStart(o).from,l=se.atEnd(o).to,c=vo(i,a,l),d=vo(s,a,l),u=se.create(o,c,d);e.setSelection(u)}return!0},fC=t=>({state:e,dispatch:n})=>{return(i=Ke(t,e.schema),function(s,a){let{$from:l,$to:c}=s.selection,d=l.blockRange(c,f=>f.childCount>0&&f.firstChild.type==i);if(!d)return!1;let u=d.startIndex;if(u==0)return!1;let p=d.parent,h=p.child(u-1);if(h.type!=i)return!1;if(a){let f=h.lastChild&&h.lastChild.type==p.type,m=$.from(f?i.create():null),g=new J($.from(i.create(null,$.from(p.type.create(null,m)))),f?3:1,0),v=d.start,b=d.end;a(s.tr.step(new Ge(v-(f?3:1),b,v,b,g,1,!0)).scrollIntoView())}return!0})(e,n);var i};function Jg(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const o=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(o)}}var mC=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:o,editor:i})=>{const{selection:s,doc:a}=e,{$from:l,$to:c}=s,d=Cs(i.extensionManager.attributes,l.node().type.name,l.node().attrs);if(s instanceof ne&&s.node.isBlock)return!(!l.parentOffset||!dn(a,l.pos)||(o&&(t&&Jg(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),0));if(!l.parent.isBlock)return!1;const u=c.parentOffset===c.parent.content.size,p=l.depth===0?void 0:function(m){for(let g=0;g<m.edgeCount;g+=1){const{type:v}=m.edge(g);if(v.isTextblock&&!v.hasRequiredAttrs())return v}return null}(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=u&&p?[{type:p,attrs:d}]:void 0,f=dn(e.doc,e.mapping.map(l.pos),1,h);if(h||f||!dn(e.doc,e.mapping.map(l.pos),1,p?[{type:p}]:void 0)||(f=!0,h=p?[{type:p,attrs:d}]:void 0),o){if(f&&(s instanceof se&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,h),p&&!u&&!l.parentOffset&&l.parent.type!==p)){const m=e.mapping.map(l.before()),g=e.doc.resolve(m);l.node(-1).canReplaceWith(g.index(),g.index()+1,p)&&e.setNodeMarkup(e.mapping.map(l.before()),p)}t&&Jg(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return f},gC=(t,e={})=>({tr:n,state:o,dispatch:i,editor:s})=>{var a;const l=Ke(t,o.schema),{$from:c,$to:d}=o.selection,u=o.selection.node;if(u&&u.isBlock||c.depth<2||!c.sameParent(d))return!1;const p=c.node(-1);if(p.type!==l)return!1;const h=s.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let b=$.empty;const y=c.index(-1)?1:c.index(-2)?2:3;for(let E=c.depth-y;E>=c.depth-3;E-=1)b=$.from(c.node(E).copy(b));const k=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,x={...Cs(h,c.node().type.name,c.node().attrs),...e},w=((a=l.contentMatch.defaultType)==null?void 0:a.createAndFill(x))||void 0;b=b.append($.from(l.createAndFill(null,w)||void 0));const S=c.before(c.depth-(y-1));n.replace(S,c.after(-k),new J(b,4-y,0));let C=-1;n.doc.nodesBetween(S,n.doc.content.size,(E,M)=>{if(C>-1)return!1;E.isTextblock&&E.content.size===0&&(C=M+1)}),C>-1&&n.setSelection(se.near(n.doc.resolve(C))),n.scrollIntoView()}return!0}const f=d.pos===c.end()?p.contentMatchAt(0).defaultType:null,m={...Cs(h,p.type.name,p.attrs),...e},g={...Cs(h,c.node().type.name,c.node().attrs),...e};n.delete(c.pos,d.pos);const v=f?[{type:l,attrs:m},{type:f,attrs:g}]:[{type:l,attrs:m}];if(!dn(n.doc,c.pos,2))return!1;if(i){const{selection:b,storedMarks:y}=o,{splittableMarks:k}=s.extensionManager,x=y||b.$to.parentOffset&&b.$from.marks();if(n.split(c.pos,2,v).scrollIntoView(),!x||!i)return!0;const w=x.filter(S=>k.includes(S.type.name));n.ensureMarks(w)}return!0},Oc=(t,e)=>{const n=ws(s=>s.type===e)(t.selection);if(!n)return!0;const o=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(o===void 0)return!0;const i=t.doc.nodeAt(o);return n.node.type!==(i==null?void 0:i.type)||!_n(t.doc,n.pos)||(t.join(n.pos),!0)},_c=(t,e)=>{const n=ws(s=>s.type===e)(t.selection);if(!n)return!0;const o=t.doc.resolve(n.start).after(n.depth);if(o===void 0)return!0;const i=t.doc.nodeAt(o);return n.node.type!==(i==null?void 0:i.type)||!_n(t.doc,o)||(t.join(o),!0)},vC=(t,e,n,o={})=>({editor:i,tr:s,state:a,dispatch:l,chain:c,commands:d,can:u})=>{const{extensions:p,splittableMarks:h}=i.extensionManager,f=Ke(t,a.schema),m=Ke(e,a.schema),{selection:g,storedMarks:v}=a,{$from:b,$to:y}=g,k=b.blockRange(y),x=v||g.$to.parentOffset&&g.$from.marks();if(!k)return!1;const w=ws(S=>Ug(S.type.name,p))(g);if(k.depth>=1&&w&&k.depth-w.depth<=1){if(w.node.type===f)return d.liftListItem(m);if(Ug(w.node.type.name,p)&&f.validContent(w.node.content)&&l)return c().command(()=>(s.setNodeMarkup(w.pos,f),!0)).command(()=>Oc(s,f)).command(()=>_c(s,f)).run()}return n&&x&&l?c().command(()=>{const S=u().wrapInList(f,o),C=x.filter(E=>h.includes(E.type.name));return s.ensureMarks(C),!!S||d.clearNodes()}).wrapInList(f,o).command(()=>Oc(s,f)).command(()=>_c(s,f)).run():c().command(()=>!!u().wrapInList(f,o)||d.clearNodes()).wrapInList(f,o).command(()=>Oc(s,f)).command(()=>_c(s,f)).run()},yC=(t,e={},n={})=>({state:o,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,a=mn(t,o.schema);return Tc(o,a,e)?i.unsetMark(a,{extendEmptyMarkRange:s}):i.setMark(a,e)},bC=(t,e,n={})=>({state:o,commands:i})=>{const s=Ke(t,o.schema),a=Ke(e,o.schema),l=jn(o,s,n);let c;return o.selection.$anchor.sameParent(o.selection.$head)&&(c=o.selection.$anchor.parent.attrs),l?i.setNode(a,c):i.setNode(s,{...c,...n})},kC=(t,e={})=>({state:n,commands:o})=>{const i=Ke(t,n.schema);return jn(n,i,e)?o.lift(i):o.wrapIn(i,e)},wC=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let o=0;o<n.length;o+=1){const i=n[o];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const a=t.tr,l=s.transform;for(let c=l.steps.length-1;c>=0;c-=1)a.step(l.steps[c].invert(l.docs[c]));if(s.text){const c=a.doc.resolve(s.from).marks();a.replaceWith(s.from,s.to,t.schema.text(s.text,c))}else a.delete(s.from,s.to)}return!0}}return!1},xC=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:o,ranges:i}=n;return o||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},CC=(t,e={})=>({tr:n,state:o,dispatch:i})=>{var s;const{extendEmptyMarkRange:a=!1}=e,{selection:l}=n,c=mn(t,o.schema),{$from:d,empty:u,ranges:p}=l;if(!i)return!0;if(u&&a){let{from:h,to:f}=l;const m=(s=d.marks().find(v=>v.type===c))==null?void 0:s.attrs,g=wc(d,c,m);g&&(h=g.from,f=g.to),n.removeMark(h,f,c)}else p.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,c)});return n.removeStoredMark(c),!0},SC=(t,e={})=>({tr:n,state:o,dispatch:i})=>{let s=null,a=null;const l=ks(typeof t=="string"?t:t.name,o.schema);return!!l&&(l==="node"&&(s=Ke(t,o.schema)),l==="mark"&&(a=mn(t,o.schema)),i&&n.selection.ranges.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;let p,h,f,m;n.selection.empty?o.doc.nodesBetween(d,u,(g,v)=>{s&&s===g.type&&(f=Math.max(v,d),m=Math.min(v+g.nodeSize,u),p=v,h=g)}):o.doc.nodesBetween(d,u,(g,v)=>{v<d&&s&&s===g.type&&(f=Math.max(v,d),m=Math.min(v+g.nodeSize,u),p=v,h=g),v>=d&&v<=u&&(s&&s===g.type&&n.setNodeMarkup(v,void 0,{...g.attrs,...e}),a&&g.marks.length&&g.marks.forEach(b=>{if(a===b.type){const y=Math.max(v,d),k=Math.min(v+g.nodeSize,u);n.addMark(y,k,a.create({...b.attrs,...e}))}}))}),h&&(p!==void 0&&n.setNodeMarkup(p,void 0,{...h.attrs,...e}),a&&h.marks.length&&h.marks.forEach(g=>{a===g.type&&n.addMark(f,m,a.create({...g.attrs,...e}))}))}),!0)},EC=(t,e={})=>({state:n,dispatch:o})=>function(i,s=null){return function(a,l){let{$from:c,$to:d}=a.selection,u=c.blockRange(d),p=u&&Dl(u,i,s);return!!p&&(l&&l(a.tr.wrap(u,p).scrollIntoView()),!0)}}(Ke(t,n.schema),e)(n,o),MC=(t,e={})=>({state:n,dispatch:o})=>function(i,s=null){return function(a,l){let{$from:c,$to:d}=a.selection,u=c.blockRange(d);if(!u)return!1;let p=l?a.tr:null;return!!function(h,f,m,g=null){let v=!1,b=f,y=f.$from.doc;if(f.depth>=2&&f.$from.node(f.depth-1).type.compatibleContent(m)&&f.startIndex==0){if(f.$from.index(f.depth-1)==0)return!1;let x=y.resolve(f.start-2);b=new Qi(x,x,f.depth),f.endIndex<f.parent.childCount&&(f=new Qi(f.$from,y.resolve(f.$to.end(f.depth)),f.depth)),v=!0}let k=Dl(b,m,g,f);return!!k&&(h&&function(x,w,S,C,E){let M=$.empty;for(let _=S.length-1;_>=0;_--)M=$.from(S[_].type.create(S[_].attrs,M));x.step(new Ge(w.start-(C?2:0),w.end,w.start,w.end,new J(M,0,0),S.length,!0));let N=0;for(let _=0;_<S.length;_++)S[_].type==E&&(N=_+1);let T=S.length-N,R=w.start+S.length-(C?2:0),z=w.parent;for(let _=w.startIndex,I=w.endIndex,O=!0;_<I;_++,O=!1)!O&&dn(x.doc,R,T)&&(x.split(R,T),R+=2*T),R+=z.child(_).nodeSize}(h,f,k,v,m),!0)}(p,u,i,s)&&(l&&l(p.scrollIntoView()),!0)}}(Ke(t,n.schema),e)(n,o),NC=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(o=>o.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(o=>o!==e):delete this.callbacks[t]),this}once(t,e){const n=(...o)=>{this.off(t,n),e.apply(this,o)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},Es=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)==null||e}};function Ms(t){var e;const{editor:n,from:o,to:i,text:s,rules:a,plugin:l}=t,{view:c}=n;if(c.composing)return!1;const d=c.state.doc.resolve(o);if(d.parent.type.spec.code||(e=d.nodeBefore||d.nodeAfter)!=null&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const p=((h,f=500)=>{let m="";const g=h.parentOffset;return h.parent.nodesBetween(Math.max(0,g-f),g,(v,b,y,k)=>{var x,w;const S=((w=(x=v.type.spec).toText)==null?void 0:w.call(x,{node:v,pos:b,parent:y,index:k}))||v.textContent||"%leaf%";m+=v.isAtom&&!v.isText?S:S.slice(0,Math.max(0,g-b))}),m})(d)+s;return a.forEach(h=>{if(u)return;const f=((x,w)=>{if(kc(w))return w.exec(x);const S=w(x);if(!S)return null;const C=[S.text];return C.index=S.index,C.input=x,C.data=S.data,S.replaceWith&&(S.text.includes(S.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),C.push(S.replaceWith)),C})(p,h.find);if(!f)return;const m=c.state.tr,g=gs({state:c.state,transaction:m}),v={from:o-(f[0].length-s.length),to:i},{commands:b,chain:y,can:k}=new vs({editor:n,state:g});h.handler({state:g,range:v,match:f,commands:b,chain:y,can:k})!==null&&m.steps.length&&(h.undoable&&m.setMeta(l,{transform:m,from:o,to:i,text:s}),c.dispatch(m),u=!0)}),u}function Ns(t){return function(e){return Object.prototype.toString.call(e).slice(8,-1)}(t)==="Object"&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Gg(t,e){const n={...t};return Ns(t)&&Ns(e)&&Object.keys(e).forEach(o=>{Ns(e[o])&&Ns(t[o])?n[o]=Gg(t[o],e[o]):n[o]=e[o]}),n}var Ac=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...ke(te(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...ke(te(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>Gg(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},Fn=class ey extends Ac{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new ey(n)}static handleExit({editor:e,mark:n}){const{tr:o}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=s.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&o.removeStoredMark(l),o.insertText(" ",i.pos),e.view.dispatch(o),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},BC=class{constructor(t){this.find=t.find,this.handler=t.handler}},Bs=null,Ts=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=Pg(t),this.schema=function(n,o){var i;const s=Lg(n),{nodeExtensions:a,markExtensions:l}=Zr(n),c=(i=a.find(p=>te(p,"topNode")))==null?void 0:i.name,d=Object.fromEntries(a.map(p=>{const h=s.filter(y=>y.type===p.name),f={name:p.name,options:p.options,storage:p.storage,editor:o},m=$g({...n.reduce((y,k)=>{const x=te(k,"extendNodeSchema",f);return{...y,...x?x(p):{}}},{}),content:ke(te(p,"content",f)),marks:ke(te(p,"marks",f)),group:ke(te(p,"group",f)),inline:ke(te(p,"inline",f)),atom:ke(te(p,"atom",f)),selectable:ke(te(p,"selectable",f)),draggable:ke(te(p,"draggable",f)),code:ke(te(p,"code",f)),whitespace:ke(te(p,"whitespace",f)),linebreakReplacement:ke(te(p,"linebreakReplacement",f)),defining:ke(te(p,"defining",f)),isolating:ke(te(p,"isolating",f)),attrs:Object.fromEntries(h.map(y=>{var k,x;return[y.name,{default:(k=y==null?void 0:y.attribute)==null?void 0:k.default,validate:(x=y==null?void 0:y.attribute)==null?void 0:x.validate}]}))}),g=ke(te(p,"parseHTML",f));g&&(m.parseDOM=g.map(y=>zg(y,h)));const v=te(p,"renderHTML",f);v&&(m.toDOM=y=>v({node:y,HTMLAttributes:xs(y,h)}));const b=te(p,"renderText",f);return b&&(m.toText=b),[p.name,m]})),u=Object.fromEntries(l.map(p=>{const h=s.filter(b=>b.type===p.name),f={name:p.name,options:p.options,storage:p.storage,editor:o},m=$g({...n.reduce((b,y)=>{const k=te(y,"extendMarkSchema",f);return{...b,...k?k(p):{}}},{}),inclusive:ke(te(p,"inclusive",f)),excludes:ke(te(p,"excludes",f)),group:ke(te(p,"group",f)),spanning:ke(te(p,"spanning",f)),code:ke(te(p,"code",f)),attrs:Object.fromEntries(h.map(b=>{var y,k;return[b.name,{default:(y=b==null?void 0:b.attribute)==null?void 0:y.default,validate:(k=b==null?void 0:b.attribute)==null?void 0:k.validate}]}))}),g=ke(te(p,"parseHTML",f));g&&(m.parseDOM=g.map(b=>zg(b,h)));const v=te(p,"renderHTML",f);return v&&(m.toDOM=b=>v({mark:b,HTMLAttributes:xs(b,h)})),[p.name,m]}));return new Mf({topNode:c,nodes:d,marks:u})}(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n=te(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Bc(e.name,this.schema)});return n?{...t,...n()}:t},{})}get plugins(){const{editor:t}=this;return Mc([...this.extensions].reverse()).flatMap(n=>{const o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Bc(n.name,this.schema)},i=[],s=te(n,"addKeyboardShortcuts",o);let a={};if(n.type==="mark"&&te(n,"exitable",o)&&(a.ArrowRight=()=>Fn.handleExit({editor:t,mark:n})),s){const p=Object.fromEntries(Object.entries(s()).map(([h,f])=>[h,()=>f({editor:t})]));a={...a,...p}}const l=new Le({props:{handleKeyDown:Eg(a)}});i.push(l);const c=te(n,"addInputRules",o);if(Kg(n,t.options.enableInputRules)&&c){const p=c();if(p&&p.length){const h=function(m){const{editor:g,rules:v}=m,b=new Le({state:{init:()=>null,apply(y,k,x){const w=y.getMeta(b);if(w)return w;const S=y.getMeta("applyInputRules");return S&&setTimeout(()=>{let{text:C}=S;typeof C=="string"||(C=Ec($.from(C),x.schema));const{from:E}=S,M=E+C.length;Ms({editor:g,from:E,to:M,text:C,rules:v,plugin:b})}),y.selectionSet||y.docChanged?null:k}},props:{handleTextInput:(y,k,x,w)=>Ms({editor:g,from:k,to:x,text:w,rules:v,plugin:b}),handleDOMEvents:{compositionend:y=>(setTimeout(()=>{const{$cursor:k}=y.state.selection;k&&Ms({editor:g,from:k.pos,to:k.pos,text:"",rules:v,plugin:b})}),!1)},handleKeyDown(y,k){if(k.key!=="Enter")return!1;const{$cursor:x}=y.state.selection;return!!x&&Ms({editor:g,from:x.pos,to:x.pos,text:`
|
|
48
|
+
`,rules:v,plugin:b})}},isInputRules:!0});return b}({editor:t,rules:p}),f=Array.isArray(h)?h:[h];i.push(...f)}}const d=te(n,"addPasteRules",o);if(Kg(n,t.options.enablePasteRules)&&d){const p=d();if(p&&p.length){const h=function(f){const{editor:m,rules:g}=f;let v,b=null,y=!1,k=!1,x=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null;try{v=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{v=null}const w=({state:S,from:C,to:E,rule:M,pasteEvt:N})=>{const T=S.tr,R=gs({state:S,transaction:T});if(function(z){const{editor:_,state:I,from:O,to:V,rule:P,pasteEvent:A,dropEvent:L}=z,{commands:j,chain:K,can:H}=new vs({editor:_,state:I}),q=[];return I.doc.nodesBetween(O,V,(Y,G)=>{var Q,oe,fe,le,me;if((oe=(Q=Y.type)==null?void 0:Q.spec)!=null&&oe.code||!(Y.isText||Y.isTextblock||Y.isInline))return;const Be=(me=(le=(fe=Y.content)==null?void 0:fe.size)!=null?le:Y.nodeSize)!=null?me:0,X=Math.max(O,G),ie=Math.min(V,G+Be);if(X>=ie)return;((re,xe,nt)=>{if(kc(xe))return[...re.matchAll(xe)];const Oe=xe(re,nt);return Oe?Oe.map(_e=>{const ue=[_e.text];return ue.index=_e.index,ue.input=re,ue.data=_e.data,_e.replaceWith&&(_e.text.includes(_e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),ue.push(_e.replaceWith)),ue}):[]})(Y.isText?Y.text||"":Y.textBetween(X-G,ie-G,void 0,""),P.find,A).forEach(re=>{if(re.index===void 0)return;const xe=X+re.index+1,nt=xe+re[0].length,Oe={from:I.tr.mapping.map(xe),to:I.tr.mapping.map(nt)},_e=P.handler({state:I,range:Oe,match:re,commands:j,chain:K,can:H,pasteEvent:A,dropEvent:L});q.push(_e)})}),q.every(Y=>Y!==null)}({editor:m,state:R,from:Math.max(C-1,0),to:E.b-1,rule:M,pasteEvent:N,dropEvent:v})&&T.steps.length){try{v=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{v=null}return x=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,T}};return g.map(S=>new Le({view(C){const E=N=>{var T;b=(T=C.dom.parentElement)!=null&&T.contains(N.target)?C.dom.parentElement:null,b&&(Bs=m)},M=()=>{Bs&&(Bs=null)};return window.addEventListener("dragstart",E),window.addEventListener("dragend",M),{destroy(){window.removeEventListener("dragstart",E),window.removeEventListener("dragend",M)}}},props:{handleDOMEvents:{drop:(C,E)=>{if(k=b===C.dom.parentElement,v=E,!k){const M=Bs;M!=null&&M.isEditable&&setTimeout(()=>{const N=M.state.selection;N&&M.commands.deleteRange({from:N.from,to:N.to})},10)}return!1},paste:(C,E)=>{var M;const N=(M=E.clipboardData)==null?void 0:M.getData("text/html");return x=E,y=!!(N!=null&&N.includes("data-pm-slice")),!1}}},appendTransaction:(C,E,M)=>{const N=C[0],T=N.getMeta("uiEvent")==="paste"&&!y,R=N.getMeta("uiEvent")==="drop"&&!k,z=N.getMeta("applyPasteRules"),_=!!z;if(!T&&!R&&!_)return;if(_){let{text:V}=z;typeof V=="string"||(V=Ec($.from(V),M.schema));const{from:P}=z,A=P+V.length,L=(j=>{var K;const H=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(K=H.clipboardData)==null||K.setData("text/html",j),H})(V);return w({rule:S,state:M,from:P,to:{b:A},pasteEvt:L})}const I=E.doc.content.findDiffStart(M.doc.content),O=E.doc.content.findDiffEnd(M.doc.content);return typeof I=="number"&&O&&I!==O.b?w({rule:S,state:M,from:I,to:O,pasteEvt:x}):void 0}}))}({editor:t,rules:p});i.push(...h)}}const u=te(n,"addProseMirrorPlugins",o);if(u){const p=u();i.push(...p)}return i})}get attributes(){return Lg(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Zr(this.extensions);return Object.fromEntries(e.filter(n=>!!te(n,"addNodeView")).map(n=>{const o=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Ke(n.name,this.schema)},s=te(n,"addNodeView",i);return s?[n.name,(a,l,c,d,u)=>{const p=xs(a,o);return s()({node:a,view:l,getPos:c,decorations:d,innerDecorations:u,editor:t,extension:n,HTMLAttributes:p})}]:[]}))}get markViews(){const{editor:t}=this,{markExtensions:e}=Zr(this.extensions);return Object.fromEntries(e.filter(n=>!!te(n,"addMarkView")).map(n=>{const o=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:mn(n.name,this.schema)},s=te(n,"addMarkView",i);return s?[n.name,(a,l,c)=>{const d=xs(a,o);return s()({mark:a,view:l,inline:c,editor:t,extension:n,HTMLAttributes:d,updateAttributes:u=>{(function(p,h,f={}){const{state:m}=h,{doc:g,tr:v}=m,b=p;g.descendants((y,k)=>{const x=v.mapping.map(k),w=v.mapping.map(k)+y.nodeSize;let S=null;if(y.marks.forEach(E=>{if(E!==b)return!1;S=E}),!S)return;let C=!1;if(Object.keys(f).forEach(E=>{f[E]!==S.attrs[E]&&(C=!0)}),C){const E=p.type.create({...p.attrs,...f});v.removeMark(x,w,p.type),v.addMark(x,w,E)}}),v.docChanged&&h.view.dispatch(v)})(a,t,u)}})}]:[]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const o={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Bc(e.name,this.schema)};e.type==="mark"&&((n=ke(te(e,"keepOnSplit",o)))==null||n)&&this.splittableMarks.push(e.name);const i=te(e,"onBeforeCreate",o),s=te(e,"onCreate",o),a=te(e,"onUpdate",o),l=te(e,"onSelectionUpdate",o),c=te(e,"onTransaction",o),d=te(e,"onFocus",o),u=te(e,"onBlur",o),p=te(e,"onDestroy",o);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),a&&this.editor.on("update",a),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),u&&this.editor.on("blur",u),p&&this.editor.on("destroy",p)})}};Ts.resolve=Pg,Ts.sort=Mc,Ts.flatten=Sc,bc({},{ClipboardTextSerializer:()=>Yg,Commands:()=>Xg,Delete:()=>Zg,Drop:()=>Qg,Editable:()=>ev,FocusEvents:()=>nv,Keymap:()=>ov,Paste:()=>rv,Tabindex:()=>iv,focusEventsPluginKey:()=>tv});var Ue=class ty extends Ac{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new ty(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},Yg=Ue.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new Le({key:new Ye("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:o,selection:i}=e,{ranges:s}=i,a=Math.min(...s.map(d=>d.$from.pos)),l=Math.max(...s.map(d=>d.$to.pos)),c=Fg(n);return jg(o,{from:a,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),Xg=Ue.create({name:"commands",addCommands:()=>({...Mg})}),Zg=Ue.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,o,i;const s=()=>{var a,l,c,d;if((d=(c=(l=(a=this.editor.options.coreExtensionOptions)==null?void 0:a.delete)==null?void 0:l.filterTransaction)==null?void 0:c.call(l,t))!=null?d:t.getMeta("y-sync$"))return;const u=Dg(t.before,[t,...e]);Wg(u).forEach(h=>{u.mapping.mapResult(h.oldRange.from).deletedAfter&&u.mapping.mapResult(h.oldRange.to).deletedBefore&&u.before.nodesBetween(h.oldRange.from,h.oldRange.to,(f,m)=>{const g=m+f.nodeSize-2,v=h.oldRange.from<=m&&g<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:f,from:m,to:g,newFrom:u.mapping.map(m),newTo:u.mapping.map(g),deletedRange:h.oldRange,newRange:h.newRange,partial:!v,editor:this.editor,transaction:t,combinedTransform:u})})});const p=u.mapping;u.steps.forEach((h,f)=>{var m,g;if(h instanceof Ft){const v=p.slice(f).map(h.from,-1),b=p.slice(f).map(h.to),y=p.invert().map(v,-1),k=p.invert().map(b),x=(m=u.doc.nodeAt(v-1))==null?void 0:m.marks.some(S=>S.eq(h.mark)),w=(g=u.doc.nodeAt(b))==null?void 0:g.marks.some(S=>S.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:y,to:k},newRange:{from:v,to:b},partial:!!(w||x),editor:this.editor,transaction:t,combinedTransform:u})}})};(i=(o=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:o.async)==null||i?setTimeout(s,0):s()}}),Qg=Ue.create({name:"drop",addProseMirrorPlugins(){return[new Le({key:new Ye("tiptapDrop"),props:{handleDrop:(t,e,n,o)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:o})}}})]}}),ev=Ue.create({name:"editable",addProseMirrorPlugins(){return[new Le({key:new Ye("editable"),props:{editable:()=>this.editor.options.editable}})]}}),tv=new Ye("focusEvents"),nv=Ue.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Le({key:tv,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const o=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(o),!1},blur:(e,n)=>{t.isFocused=!1;const o=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(o),!1}}}})]}}),ov=Ue.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:d,$anchor:u}=l,{pos:p,parent:h}=u,f=u.parent.isTextblock&&p>0?a.doc.resolve(p-1):u,m=f.parent.type.spec.isolating,g=u.pos-u.parentOffset,v=m&&f.parent.childCount===1?g===u.pos:pe.atStart(c).from===p;return!(!d||!h.type.isTextblock||h.textContent.length||!v||v&&u.parent.type.name==="paragraph")&&s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...n},i={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return xc()||Ag()?i:o},addProseMirrorPlugins(){return[new Le({key:new Ye("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(f=>f.getMeta("composition")))return;const o=t.some(f=>f.docChanged)&&!e.doc.eq(n.doc),i=t.some(f=>f.getMeta("preventClearDocument"));if(!o||i)return;const{empty:s,from:a,to:l}=e.selection,c=pe.atStart(e.doc).from,d=pe.atEnd(e.doc).to;if(s||a!==c||l!==d||!Ss(n.doc))return;const u=n.tr,p=gs({state:n,transaction:u}),{commands:h}=new vs({editor:this.editor,state:p});return h.clearNodes(),u.steps.length?u:void 0}})]}}),rv=Ue.create({name:"paste",addProseMirrorPlugins(){return[new Le({key:new Ye("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),iv=Ue.create({name:"tabindex",addProseMirrorPlugins(){return[new Le({key:new Ye("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),TC=class dr{constructor(e,n,o=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=o,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,o=this.to;if(this.isBlock){if(this.content.size===0)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);n=this.from+1,o=this.to-1}this.editor.commands.insertContentAt({from:n,to:o},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new dr(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new dr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new dr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,o)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,a=this.pos+o+(s?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(a);if(!i&&l.depth<=this.depth)return;const c=new dr(l,this.editor,i,i?n:null);i&&(c.actualDepth=this.depth+1),e.push(new dr(l,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let o=null,i=this.parent;for(;i&&!o;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,a=Object.keys(n);for(let l=0;l<a.length;l+=1){const c=a[l];if(s[c]!==n[c])break}}else o=i;i=i.parent}return o}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},o=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(a=>{o&&i.length>0||(a.node.type.name===e&&s.every(l=>n[l]===a.node.attrs[l])&&i.push(a),o&&i.length>0||(i=i.concat(a.querySelectorAll(e,n,o))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},OC=class extends NC{constructor(t={}){super(),this.css=null,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:o})=>{throw o},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:o,slice:i,moved:s})=>this.options.onDrop(o,i,s)),this.on("paste",({event:o,slice:i})=>this.options.onPaste(o,i)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=Og(e,this.options.autofocus);this.editorState=Zo.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=function(t,e){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=`.ProseMirror {
|
|
49
49
|
position: relative;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -115,61 +115,61 @@ img.ProseMirror-separator {
|
|
|
115
115
|
|
|
116
116
|
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
117
117
|
display: block;
|
|
118
|
-
}`,document.getElementsByTagName("head")[0].appendChild(o),o}(0,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=
|
|
118
|
+
}`,document.getElementsByTagName("head")[0].appendChild(o),o}(0,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=Rg(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],o=this.state.reconfigure({plugins:n});return this.view.updateState(o),o}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;n=n.filter(a=>!a.key.startsWith(s))}),e.length===n.length)return;const o=this.state.reconfigure({plugins:n});return this.view.updateState(o),o}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[ev,Yg.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),Xg,nv,ov,iv,Qg,rv,Zg].filter(o=>typeof this.options.enableCoreExtensions!="object"||this.options.enableCoreExtensions[o.name]!==!1):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new Ts(n,this)}createCommandManager(){this.commandManager=new vs({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Cc(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message)))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=Cc(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){var e;this.editorView=new bg(t,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)==null?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.prependClass(),this.injectCSS(),this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void t.steps.forEach(d=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(d)}):void(this.capturedTransaction=t);const{state:e,transactions:n}=this.state.applyTransaction(t),o=!this.state.selection.eq(e.selection),i=n.includes(t),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),o&&this.emit("selectionUpdate",{editor:this,transaction:t});const a=n.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),l=a==null?void 0:a.getMeta("focus"),c=a==null?void 0:a.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:a}),c&&this.emit("blur",{editor:this,event:c.event,transaction:a}),t.getMeta("preventUpdate")||!n.some(d=>d.docChanged)||s.doc.eq(e.doc)||this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return Hg(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,o=typeof t=="string"?e:t;return function(i,s,a={}){if(!s)return jn(i,null,a)||Tc(i,null,a);const l=ks(s,i.schema);return l==="node"?jn(i,s,a):l==="mark"&&Tc(i,s,a)}(this.state,n,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Ec(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
|
|
119
119
|
|
|
120
|
-
`,textSerializers:n={}}=t||{};return function(o,
|
|
120
|
+
`,textSerializers:n={}}=t||{};return function(o,i){return jg(o,{from:0,to:o.content.size},i)}(this.state.doc,{blockSeparator:e,textSerializers:{...Fg(this.schema),...n}})}get isEmpty(){return Ss(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)==null||e}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new TC(e,this)}get $doc(){return this.$pos(0)}};function sr(t){return new Es({find:t.find,handler:({state:e,range:n,match:o})=>{const i=ke(t.getAttributes,void 0,o);if(i===!1||i===null)return null;const{tr:s}=e,a=o[o.length-1],l=o[0];if(a){const c=l.search(/\S/),d=n.from+l.indexOf(a),u=d+a.length;if(Nc(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(m=>m===t.type&&m!==f.mark.type)).filter(f=>f.to>d).length)return null;u<n.to&&s.delete(u,n.to),d>n.from&&s.delete(n.from+c,d);const h=n.from+c+a.length;s.addMark(n.from+c,h,t.type.create(i||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function sv(t){return new Es({find:t.find,handler:({state:e,range:n,match:o})=>{const i=ke(t.getAttributes,void 0,o)||{},{tr:s}=e,a=n.from;let l=n.to;const c=t.type.create(i);if(o[1]){let d=a+o[0].lastIndexOf(o[1]);d>l?d=l:l=d+o[1].length;const u=o[0][o[0].length-1];s.insertText(u,a+o[0].length-1),s.replaceWith(d,l,c)}else if(o[0]){const d=t.type.isInline?a:a-1;s.insert(d,t.type.create(i)).delete(s.mapping.map(a),s.mapping.map(l))}s.scrollIntoView()},undoable:t.undoable})}function Vc(t){return new Es({find:t.find,handler:({state:e,range:n,match:o})=>{const i=e.doc.resolve(n.from),s=ke(t.getAttributes,void 0,o)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function ar(t){return new Es({find:t.find,handler:({state:e,range:n,match:o,chain:i})=>{const s=ke(t.getAttributes,void 0,o)||{},a=e.tr.delete(n.from,n.to),l=a.doc.resolve(n.from).blockRange(),c=l&&Dl(l,t.type,s);if(!c)return null;if(a.wrap(l,c),t.keepMarks&&t.editor){const{selection:u,storedMarks:p}=e,{splittableMarks:h}=t.editor.extensionManager,f=p||u.$to.parentOffset&&u.$from.marks();if(f){const m=f.filter(g=>h.includes(g.type.name));a.ensureMarks(m)}}if(t.keepAttributes){const u=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(u,s).run()}const d=a.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&_n(a.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(o,d))&&a.join(n.from-1)},undoable:t.undoable})}function Ic(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],o=t.replace(/["']([^"']*)["']/g,l=>(n.push(l),`__QUOTED_${n.length-1}__`)),i=o.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const l=i.map(c=>c.trim().slice(1));e.class=l.join(" ")}const s=o.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(e.id=s[1]),Array.from(o.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,l,c])=>{var d;const u=parseInt(((d=c.match(/__QUOTED_(\d+)__/))==null?void 0:d[1])||"0",10),p=n[u];p&&(e[l]=p.slice(1,-1))});const a=o.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return a&&a.split(/\s+/).filter(Boolean).forEach(l=>{l.match(/^[a-zA-Z][\w-]*$/)&&(e[l]=!0)}),e}function Dc(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(n=>e.push(`.${n}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,o])=>{n!=="class"&&n!=="id"&&(o===!0?e.push(n):o!==!1&&o!=null&&e.push(`${n}="${String(o)}"`))}),e.join(" ")}function _C(t){const{nodeName:e,name:n,parseAttributes:o=Ic,serializeAttributes:i=Dc,defaultAttributes:s={},requiredAttributes:a=[],allowedAttributes:l}=t,c=n||e;return{parseMarkdown:(d,u)=>{const p={...s,...d.attributes};return u.createNode(e,p,[])},markdownTokenizer:{name:e,level:"block",start(d){var u;const p=new RegExp(`^:::${c}(?:\\s|$)`,"m"),h=(u=d.match(p))==null?void 0:u.index;return h!==void 0?h:-1},tokenize(d,u,p){const h=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),f=d.match(h);if(!f)return;const m=f[1]||"",g=o(m);return a.find(v=>!(v in g))?void 0:{type:e,raw:f[0],attributes:g}}},renderMarkdown:d=>{const u=(h=>{if(!l)return h;const f={};return l.forEach(m=>{m in h&&(f[m]=h[m])}),f})(d.attrs||{}),p=i(u);return`:::${c}${p?` {${p}}`:""} :::`}}}function AC(t){const{nodeName:e,name:n,getContent:o,parseAttributes:i=Ic,serializeAttributes:s=Dc,defaultAttributes:a={},content:l="block",allowedAttributes:c}=t,d=n||e;return{parseMarkdown:(u,p)=>{let h;if(o){const m=o(u);h=typeof m=="string"?[{type:"text",text:m}]:m}else h=l==="block"?p.parseChildren(u.tokens||[]):p.parseInline(u.tokens||[]);const f={...a,...u.attributes};return p.createNode(e,f,h)},markdownTokenizer:{name:e,level:"block",start(u){var p;const h=new RegExp(`^:::${d}`,"m"),f=(p=u.match(h))==null?void 0:p.index;return f!==void 0?f:-1},tokenize(u,p,h){var f;const m=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),g=u.match(m);if(!g)return;const[v,b=""]=g,y=i(b);let k=1;const x=v.length;let w="";const S=/^:::([\w-]*)(\s.*)?/gm,C=u.slice(x);for(S.lastIndex=0;;){const E=S.exec(C);if(E===null)break;const M=E.index,N=E[1];if(!((f=E[2])!=null&&f.endsWith(":::"))){if(N)k+=1;else if(k-=1,k===0){const T=C.slice(0,M);w=T.trim();const R=u.slice(0,x+M+E[0].length);let z=[];if(w)if(l==="block")for(z=h.blockTokens(T),z.forEach(_=>{!_.text||_.tokens&&_.tokens.length!==0||(_.tokens=h.inlineTokens(_.text))});z.length>0;){const _=z[z.length-1];if(_.type!=="paragraph"||_.text&&_.text.trim()!=="")break;z.pop()}else z=h.inlineTokens(w);return{type:e,raw:R,attributes:y,content:w,tokens:z}}}}}},renderMarkdown:(u,p)=>{const h=(v=>{if(!c)return v;const b={};return c.forEach(y=>{y in v&&(b[y]=v[y])}),b})(u.attrs||{}),f=s(h),m=f?` {${f}}`:"",g=p.renderChildren(u.content||[],`
|
|
121
121
|
|
|
122
122
|
`);return`:::${d}${m}
|
|
123
123
|
|
|
124
124
|
${g}
|
|
125
125
|
|
|
126
|
-
:::`}}}function
|
|
126
|
+
:::`}}}function VC(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let o=n.exec(t);for(;o!==null;){const[,i,s,a]=o;e[i]=s||a,o=n.exec(t)}return e}function IC(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function DC(t){const{nodeName:e,name:n,getContent:o,parseAttributes:i=VC,serializeAttributes:s=IC,defaultAttributes:a={},selfClosing:l=!1,allowedAttributes:c}=t,d=n||e,u=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(p,h)=>{const f={...a,...p.attributes};if(l)return h.createNode(e,f);const m=o?o(p):p.content||"";return m?h.createNode(e,f,[h.createTextNode(m)]):h.createNode(e,f,[])},markdownTokenizer:{name:e,level:"inline",start(p){const h=l?new RegExp(`\\[${u}\\s*[^\\]]*\\]`):new RegExp(`\\[${u}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${u}\\]`),f=p.match(h),m=f==null?void 0:f.index;return m!==void 0?m:-1},tokenize(p,h,f){const m=l?new RegExp(`^\\[${u}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${u}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${u}\\]`),g=p.match(m);if(!g)return;let v="",b="";if(l){const[,k]=g;b=k}else{const[,k,x]=g;b=k,v=x||""}const y=i(b.trim());return{type:e,raw:g[0],content:v.trim(),attributes:y}}},renderMarkdown:p=>{let h="";o?h=o(p):p.content&&p.content.length>0&&(h=p.content.filter(v=>v.type==="text").map(v=>v.text).join(""));const f=(v=>{if(!c)return v;const b={};return c.forEach(y=>{y in v&&(b[y]=v[y])}),b})(p.attrs||{}),m=s(f),g=m?` ${m}`:"";return l?`[${d}${g}]`:`[${d}${g}]${h}[/${d}]`}}}function Rc(t,e,n){var o,i,s,a;const l=t.split(`
|
|
127
127
|
`),c=[];let d="",u=0;const p=e.baseIndentSize||2;for(;u<l.length;){const h=l[u],f=h.match(e.itemPattern);if(!f){if(c.length>0)break;if(h.trim()===""){u+=1;continue}return}const m=e.extractItemData(f),{indentLevel:g,mainContent:v}=m;d=`${d}${h}
|
|
128
|
-
`;const
|
|
129
|
-
`,u+=1;continue}break}if(!((((a=(
|
|
130
|
-
`,u+=1}let y;const b
|
|
131
|
-
`);w.trim()&&(y=e.customNestedParser?e.customNestedParser(w):n.blockTokens(w))}const x=e.createToken(m,y);c.push(x)}if(c.length!==0)return{items:c,raw:d.trim()}}function
|
|
128
|
+
`;const b=[v];for(u+=1;u<l.length;){const w=l[u];if(w.trim()===""){const S=l.slice(u+1).findIndex(C=>C.trim()!=="");if(S===-1)break;if((((i=(o=l[u+1+S].match(/^(\s*)/))==null?void 0:o[1])==null?void 0:i.length)||0)>g){b.push(w),d=`${d}${w}
|
|
129
|
+
`,u+=1;continue}break}if(!((((a=(s=w.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:a.length)||0)>g))break;b.push(w),d=`${d}${w}
|
|
130
|
+
`,u+=1}let y;const k=b.slice(1);if(k.length>0){const w=k.map(S=>S.slice(g+p)).join(`
|
|
131
|
+
`);w.trim()&&(y=e.customNestedParser?e.customNestedParser(w):n.blockTokens(w))}const x=e.createToken(m,y);c.push(x)}if(c.length!==0)return{items:c,raw:d.trim()}}function Lc(t,e,n,o){if(!t||!Array.isArray(t.content))return"";const i=typeof n=="function"?n(o):n,[s,...a]=t.content,l=[`${i}${e.renderChildren([s])}`];return a&&a.length>0&&a.forEach(c=>{const d=e.renderChildren([c]);if(d){const u=d.split(`
|
|
132
132
|
`).map(p=>p?e.indent(p):"").join(`
|
|
133
133
|
`);l.push(u)}}),l.join(`
|
|
134
|
-
`)}bc({},{createAtomBlockMarkdownSpec:()=>
|
|
135
|
-
`).map(
|
|
136
|
-
`);n.push(
|
|
137
|
-
`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[ar({find:
|
|
138
|
-
`):`\`\`\`${
|
|
134
|
+
`)}bc({},{createAtomBlockMarkdownSpec:()=>_C,createBlockMarkdownSpec:()=>AC,createInlineMarkdownSpec:()=>DC,parseAttributes:()=>Ic,parseIndentedBlocks:()=>Rc,renderNestedMarkdownContent:()=>Lc,serializeAttributes:()=>Dc});var bt=class ny extends Ac{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new ny(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function yo(t){return new BC({find:t.find,handler:({state:e,range:n,match:o,pasteEvent:i})=>{const s=ke(t.getAttributes,void 0,o,i);if(s===!1||s===null)return null;const{tr:a}=e,l=o[o.length-1],c=o[0];let d=n.to;if(l){const u=c.search(/\S/),p=n.from+c.indexOf(l),h=p+l.length;if(Nc(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(g=>g===t.type&&g!==m.mark.type)).filter(m=>m.to>p).length)return null;h<n.to&&a.delete(h,n.to),p>n.from&&a.delete(n.from+u,p),d=n.from+u+l.length,a.addMark(n.from+u,d,t.type.create(s||{})),a.removeStoredMark(t.type)}}})}function av(t){return r.customRef((e,n)=>({get:()=>(e(),t),set(o){t=o,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var RC=class extends OC{constructor(t={}){return super(t),this.contentComponent=null,this.appContext=null,this.reactiveState=av(this.view.state),this.reactiveExtensionStorage=av(this.extensionStorage),this.on("beforeTransaction",({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),r.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(t,e){const n=super.registerPlugin(t,e);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(t){const e=super.unregisterPlugin(t);return this.reactiveState&&e&&(this.reactiveState.value=e),e}},LC=r.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=r.ref(),n=r.getCurrentInstance();return r.watchEffect(()=>{const o=t.editor;o&&o.options.element&&e.value&&r.nextTick(()=>{var i;if(!e.value||!((i=o.view.dom)!=null&&i.firstChild))return;const s=r.unref(e.value);e.value.append(o.view.dom),o.contentComponent=n.ctx._,n&&(o.appContext={...n.appContext,provides:n.provides}),o.setOptions({element:s}),o.createNodeViews()})}),r.onBeforeUnmount(()=>{const o=t.editor;o&&(o.contentComponent=null,o.appContext=null)}),{rootEl:e}},render(){return r.h("div",{ref:t=>{this.rootEl=t}})}});r.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return r.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),r.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return r.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)==null?void 0:e.call(t))}}),r.defineComponent({name:"MarkViewContent",props:{as:{type:String,default:"span"}},render(){return r.h(this.as,{style:{whiteSpace:"inherit"},"data-mark-view-content":""})}});var Os=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...o}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,o,n]},zC=/^\s*>\s$/,$C=bt.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:t}){return Os("blockquote",{...Fe(this.options.HTMLAttributes,t),children:Os("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const n=[];return t.content.forEach(o=>{const i=e.renderChildren(o).split(`
|
|
135
|
+
`).map(s=>`> ${s}`).join(`
|
|
136
|
+
`);n.push(i)}),n.flatMap(o=>[o,"> "]).slice(0,-1).join(`
|
|
137
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[ar({find:zC,type:this.type})]}}),PC=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,jC=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,FC=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,HC=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,WC=Fn.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return Os("strong",{...Fe(this.options.HTMLAttributes,t),children:Os("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[sr({find:PC,type:this.type}),sr({find:FC,type:this.type})]},addPasteRules(){return[yo({find:jC,type:this.type}),yo({find:HC,type:this.type})]}}),KC=/(^|[^`])`([^`]+)`(?!`)$/,UC=/(^|[^`])`([^`]+)`(?!`)/g,qC=Fn.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:t}){return["code",Fe(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[sr({find:KC,type:this.type})]},addPasteRules(){return[yo({find:UC,type:this.type})]}}),JC=/^```([a-z]+)?[\s\n]$/,GC=/^~~~([a-z]+)?[\s\n]$/,YC=bt.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;return n&&[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0]||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:t,HTMLAttributes:e}){return["pre",Fe(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let o="";const i=((n=t.attrs)==null?void 0:n.language)||"";return o=t.content?[`\`\`\`${i}`,e.renderChildren(t.content),"```"].join(`
|
|
138
|
+
`):`\`\`\`${i}
|
|
139
139
|
|
|
140
|
-
\`\`\``,o},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!(!t||e.parent.type.name!==this.name)&&!(!n&&e.parent.textContent.length)&&this.editor.commands.clearNodes()},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:4,{state:o}=t,{selection:
|
|
140
|
+
\`\`\``,o},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!(!t||e.parent.type.name!==this.name)&&!(!n&&e.parent.textContent.length)&&this.editor.commands.clearNodes()},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:4,{state:o}=t,{selection:i}=o,{$from:s,empty:a}=i;if(s.parent.type!==this.type)return!1;const l=" ".repeat(n);return a?t.commands.insertContent(l):t.commands.command(({tr:c})=>{const{from:d,to:u}=i,p=o.doc.textBetween(d,u,`
|
|
141
141
|
`,`
|
|
142
142
|
`).split(`
|
|
143
143
|
`).map(h=>l+h).join(`
|
|
144
|
-
`);return c.replaceWith(d,u,o.schema.text(p)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:4,{state:o}=t,{selection:
|
|
144
|
+
`);return c.replaceWith(d,u,o.schema.text(p)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:4,{state:o}=t,{selection:i}=o,{$from:s,empty:a}=i;return s.parent.type===this.type&&(a?t.commands.command(({tr:l})=>{var c;const{pos:d}=s,u=s.start(),p=s.end(),h=o.doc.textBetween(u,p,`
|
|
145
145
|
`,`
|
|
146
146
|
`).split(`
|
|
147
|
-
`);let f=0,m=0;const g=d-u;for(let
|
|
147
|
+
`);let f=0,m=0;const g=d-u;for(let k=0;k<h.length;k+=1){if(m+h[k].length>=g){f=k;break}m+=h[k].length+1}const v=((c=h[f].match(/^ */))==null?void 0:c[0])||"",b=Math.min(v.length,n);if(b===0)return!0;let y=u;for(let k=0;k<f;k+=1)y+=h[k].length+1;return l.delete(y,y+b),d-y<=b&&l.setSelection(se.create(l.doc,y)),!0}):t.commands.command(({tr:l})=>{const{from:c,to:d}=i,u=o.doc.textBetween(c,d,`
|
|
148
148
|
`,`
|
|
149
149
|
`).split(`
|
|
150
150
|
`).map(p=>{var h;const f=((h=p.match(/^ */))==null?void 0:h[0])||"",m=Math.min(f.length,n);return p.slice(m)}).join(`
|
|
151
|
-
`);return l.replaceWith(c,d,o.schema.text(u)),!0}))},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:o,empty:
|
|
151
|
+
`);return l.replaceWith(c,d,o.schema.text(u)),!0}))},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type)return!1;const s=o.parentOffset===o.parent.nodeSize-2,a=o.parent.textContent.endsWith(`
|
|
152
152
|
|
|
153
|
-
`);return!(!
|
|
154
|
-
`));return a.replaceSelectionWith(this.type.create({language:
|
|
153
|
+
`);return!(!s||!a)&&t.chain().command(({tr:l})=>(l.delete(o.pos-2,o.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:o}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;const a=i.after();return a!==void 0&&(o.nodeAt(a)?t.commands.command(({tr:l})=>(l.setSelection(pe.near(o.resolve(a))),!0)):t.commands.exitCode())}}},addInputRules(){return[Vc({find:JC,type:this.type,getAttributes:t=>({language:t[1]})}),Vc({find:GC,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Le({key:new Ye("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),o=e.clipboardData.getData("vscode-editor-data"),i=o?JSON.parse(o):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:a,schema:l}=t.state,c=l.text(n.replace(/\r\n?/g,`
|
|
154
|
+
`));return a.replaceSelectionWith(this.type.create({language:s},c)),a.selection.$from.parent.type!==this.type&&a.setSelection(se.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),t.dispatch(a),!0}}})]}}),XC=bt.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
155
155
|
|
|
156
|
-
`):""}),
|
|
156
|
+
`):""}),ZC=bt.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",Fe(this.options.HTMLAttributes,t)]},renderText:()=>`
|
|
157
157
|
`,renderMarkdown:(t,e)=>e.indent(`
|
|
158
|
-
`),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:o})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:s,storedMarks:i}=n;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:l}=o.extensionManager,c=i||s.$to.parentOffset&&s.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&a){const p=c.filter(h=>l.includes(h.type.name));d.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),sS=kt.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Fe(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const o=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,s="#".repeat(o);return t.content?`${s} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode(this.name,t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Ic({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),iS=kt.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:t}){return["hr",Fe(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!function(i,a){const{selection:l}=i,{$from:c}=l;if(l instanceof ne){const u=c.index();return c.parent.canReplaceWith(u,u+1,a)}let d=c.depth;for(;d>=0;){const u=c.index(d);if(c.node(d).contentMatchAt(u).matchType(a))return!0;d-=1}return!1}(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:o}=n,s=t();return Gg(n)?s.insertContentAt(o.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:i,tr:a,dispatch:l})=>{if(l){const{$to:c}=a.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?a.setSelection(ie.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(ne.create(a.doc,c.pos)):a.setSelection(ie.create(a.doc,c.pos));else{const u=i.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,p=u==null?void 0:u.create();p&&(a.insert(d,p),a.setSelection(ie.create(a.doc,d+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[av({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),aS=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,lS=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,cS=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,dS=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,uS=Hn.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ir({find:aS,type:this.type}),ir({find:cS,type:this.type})]},addPasteRules(){return[bo({find:lS,type:this.type}),bo({find:dS,type:this.type})]}});const $c="numeric",Pc="ascii",jc="alpha",Qr="asciinumeric",es="alphanumeric",Fc="domain",cv="emoji",pS="scheme",hS="slashscheme",Hc="whitespace";function fS(t,e){return t in e||(e[t]=[]),e[t]}function wo(t,e,n){e[$c]&&(e[Qr]=!0,e[es]=!0),e[Pc]&&(e[Qr]=!0,e[jc]=!0),e[Qr]&&(e[es]=!0),e[jc]&&(e[es]=!0),e[es]&&(e[Fc]=!0),e[cv]&&(e[Fc]=!0);for(const o in e){const s=fS(o,n);s.indexOf(t)<0&&s.push(t)}}function bt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}bt.groups={},bt.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let o=0;o<e.jr.length;o++){const s=e.jr[o][0],i=e.jr[o][1];if(i&&s.test(t))return i}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,o){for(let s=0;s<t.length;s++)this.tt(t[s],e,n,o)},tr(t,e,n,o){let s;return o=o||bt.groups,e&&e.j?s=e:(s=new bt(e),n&&o&&wo(e,n,o)),this.jr.push([t,s]),s},ts(t,e,n,o){let s=this;const i=t.length;if(!i)return s;for(let a=0;a<i-1;a++)s=s.tt(t[a]);return s.tt(t[i-1],e,n,o)},tt(t,e,n,o){o=o||bt.groups;const s=this;if(e&&e.j)return s.j[t]=e,e;const i=e;let a,l=s.go(t);if(l?(a=new bt,Object.assign(a.j,l.j),a.jr.push.apply(a.jr,l.jr),a.jd=l.jd,a.t=l.t):a=new bt,i){if(o)if(a.t&&typeof a.t=="string"){const c=Object.assign(function(d,u){const p={};for(const h in u)u[h].indexOf(d)>=0&&(p[h]=!0);return p}(a.t,o),n);wo(i,c,o)}else n&&wo(i,n,o);a.t=i}return s.j[t]=a,a}};const he=(t,e,n,o,s)=>t.ta(e,n,o,s),ze=(t,e,n,o,s)=>t.tr(e,n,o,s),dv=(t,e,n,o,s)=>t.ts(e,n,o,s),F=(t,e,n,o,s)=>t.tt(e,n,o,s),vn="WORD",Wc="UWORD",uv="ASCIINUMERICAL",pv="ALPHANUMERICAL",ts="LOCALHOST",Kc="TLD",qc="UTLD",_i="SCHEME",lr="SLASH_SCHEME",Uc="NUM",Gc="WS",Jc="NL",ns="OPENBRACE",rs="CLOSEBRACE",Ai="OPENBRACKET",Vi="CLOSEBRACKET",Ii="OPENPAREN",Di="CLOSEPAREN",Ri="OPENANGLEBRACKET",Li="CLOSEANGLEBRACKET",zi="FULLWIDTHLEFTPAREN",$i="FULLWIDTHRIGHTPAREN",Pi="LEFTCORNERBRACKET",ji="RIGHTCORNERBRACKET",Fi="LEFTWHITECORNERBRACKET",Hi="RIGHTWHITECORNERBRACKET",Wi="FULLWIDTHLESSTHAN",Ki="FULLWIDTHGREATERTHAN",qi="AMPERSAND",Ui="APOSTROPHE",Gi="ASTERISK",Wn="AT",Ji="BACKSLASH",Yi="BACKTICK",Xi="CARET",Kn="COLON",Yc="COMMA",Zi="DOLLAR",Zt="DOT",Qi="EQUALS",Xc="EXCLAMATION",Rt="HYPHEN",ss="PERCENT",ea="PIPE",ta="PLUS",na="POUND",is="QUERY",Zc="QUOTE",hv="FULLWIDTHMIDDLEDOT",Qc="SEMI",Qt="SLASH",as="TILDE",oa="UNDERSCORE",fv="EMOJI",ra="SYM";var mv=Object.freeze({__proto__:null,ALPHANUMERICAL:pv,AMPERSAND:qi,APOSTROPHE:Ui,ASCIINUMERICAL:uv,ASTERISK:Gi,AT:Wn,BACKSLASH:Ji,BACKTICK:Yi,CARET:Xi,CLOSEANGLEBRACKET:Li,CLOSEBRACE:rs,CLOSEBRACKET:Vi,CLOSEPAREN:Di,COLON:Kn,COMMA:Yc,DOLLAR:Zi,DOT:Zt,EMOJI:fv,EQUALS:Qi,EXCLAMATION:Xc,FULLWIDTHGREATERTHAN:Ki,FULLWIDTHLEFTPAREN:zi,FULLWIDTHLESSTHAN:Wi,FULLWIDTHMIDDLEDOT:hv,FULLWIDTHRIGHTPAREN:$i,HYPHEN:Rt,LEFTCORNERBRACKET:Pi,LEFTWHITECORNERBRACKET:Fi,LOCALHOST:ts,NL:Jc,NUM:Uc,OPENANGLEBRACKET:Ri,OPENBRACE:ns,OPENBRACKET:Ai,OPENPAREN:Ii,PERCENT:ss,PIPE:ea,PLUS:ta,POUND:na,QUERY:is,QUOTE:Zc,RIGHTCORNERBRACKET:ji,RIGHTWHITECORNERBRACKET:Hi,SCHEME:_i,SEMI:Qc,SLASH:Qt,SLASH_SCHEME:lr,SYM:ra,TILDE:as,TLD:Kc,UNDERSCORE:oa,UTLD:qc,UWORD:Wc,WORD:vn,WS:Gc});const yn=/[a-z]/,ls=new RegExp("\\p{L}","u"),ed=new RegExp("\\p{Emoji}","u"),kn=/\d/,td=/\s/;let sa=null,ia=null;function gv(t,e){const n=function(l){const c=[],d=l.length;let u=0;for(;u<d;){let p,h=l.charCodeAt(u),f=h<55296||h>56319||u+1===d||(p=l.charCodeAt(u+1))<56320||p>57343?l[u]:l.slice(u,u+2);c.push(f),u+=f.length}return c}(e.replace(/[A-Z]/g,l=>l.toLowerCase())),o=n.length,s=[];let i=0,a=0;for(;a<o;){let l=t,c=null,d=0,u=null,p=-1,h=-1;for(;a<o&&(c=l.go(n[a]));)l=c,l.accepts()?(p=0,h=0,u=l):p>=0&&(p+=n[a].length,h++),d+=n[a].length,i+=n[a].length,a++;i-=p,a-=h,d-=p,s.push({t:u.t,v:e.slice(i-d,i),s:i-d,e:i})}return s}function qn(t,e,n,o,s){let i;const a=e.length;for(let l=0;l<a-1;l++){const c=e[l];t.j[c]?i=t.j[c]:(i=new bt(o),i.jr=s.slice(),t.j[c]=i),t=i}return i=new bt(n),i.jr=s.slice(),t.j[e[a-1]]=i,i}function vv(t){const e=[],n=[];let o=0;for(;o<t.length;){let s=0;for(;"0123456789".indexOf(t[o+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let i=parseInt(t.substring(o,o+s),10);i>0;i--)n.pop();o+=s}else n.push(t[o]),o++}return e}const cs={defaultProtocol:"http",events:null,format:yv,formatHref:yv,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function nd(t,e=null){let n=Object.assign({},cs);t&&(n=Object.assign(n,t instanceof nd?t.o:t));const o=n.ignoreTags,s=[];for(let i=0;i<o.length;i++)s.push(o[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=s}function yv(t){return t}function kv(t,e){this.t="token",this.v=t,this.tk=e}function aa(t,e){class n extends kv{constructor(s,i){super(s,i),this.t=t}}for(const o in e)n.prototype[o]=e[o];return n.t=t,n}nd.prototype={o:cs,ignoreTags:[],defaultRender:t=>t,check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const o=e!=null;let s=this.o[t];return s&&(typeof s=="object"?(s=n.t in s?s[n.t]:cs[t],typeof s=="function"&&o&&(s=s(e,n))):typeof s=="function"&&o&&(s=s(e,n.t,n)),s)},getObj(t,e,n){let o=this.o[t];return typeof o=="function"&&e!=null&&(o=o(e,n.t,n)),o},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}},kv.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),o=t.get("format",e,this);return n&&o.length>n?o.substring(0,n)+"…":o},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=cs.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),o=t.get("formatHref",n,this),s=t.get("tagName",n,e),i=this.toFormattedString(t),a={},l=t.get("className",n,e),c=t.get("target",n,e),d=t.get("rel",n,e),u=t.getObj("attributes",n,e),p=t.getObj("events",n,e);return a.href=o,l&&(a.class=l),c&&(a.target=c),d&&(a.rel=d),u&&Object.assign(a,u),{tagName:s,attributes:a,content:i,eventListeners:p}}};const bv=aa("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),wv=aa("text"),mS=aa("nl"),la=aa("url",{isLink:!0,toHref(t=cs.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==ts&&t[1].t===Kn}}),Lt=t=>new bt(t);function od(t,e,n){const o=n[0].s,s=n[n.length-1].e;return new t(e.slice(o,s),n)}const gS=typeof console<"u"&&console&&console.warn||(()=>{}),De={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function xv(t,e=!1){if(De.initialized&&gS(`linkifyjs: already initialized - will not register custom scheme "${t}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
158
|
+
`),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:o})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:l}=o.extensionManager,c=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&a){const p=c.filter(h=>l.includes(h.type.name));d.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),QC=bt.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Fe(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const o=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,i="#".repeat(o);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode(this.name,t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Vc({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),eS=bt.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:t}){return["hr",Fe(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!function(s,a){const{selection:l}=s,{$from:c}=l;if(l instanceof ne){const u=c.index();return c.parent.canReplaceWith(u,u+1,a)}let d=c.depth;for(;d>=0;){const u=c.index(d);if(c.node(d).contentMatchAt(u).matchType(a))return!0;d-=1}return!1}(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:o}=n,i=t();return qg(n)?i.insertContentAt(o.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:a,dispatch:l})=>{if(l){const{$to:c}=a.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?a.setSelection(se.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(ne.create(a.doc,c.pos)):a.setSelection(se.create(a.doc,c.pos));else{const u=s.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,p=u==null?void 0:u.create();p&&(a.insert(d,p),a.setSelection(se.create(a.doc,d+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[sv({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),tS=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,nS=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,oS=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,rS=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,iS=Fn.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Fe(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[sr({find:tS,type:this.type}),sr({find:oS,type:this.type})]},addPasteRules(){return[yo({find:nS,type:this.type}),yo({find:rS,type:this.type})]}});const zc="numeric",$c="ascii",Pc="alpha",Qr="asciinumeric",ei="alphanumeric",jc="domain",lv="emoji",sS="scheme",aS="slashscheme",Fc="whitespace";function lS(t,e){return t in e||(e[t]=[]),e[t]}function bo(t,e,n){e[zc]&&(e[Qr]=!0,e[ei]=!0),e[$c]&&(e[Qr]=!0,e[Pc]=!0),e[Qr]&&(e[ei]=!0),e[Pc]&&(e[ei]=!0),e[ei]&&(e[jc]=!0),e[lv]&&(e[jc]=!0);for(const o in e){const i=lS(o,n);i.indexOf(t)<0&&i.push(t)}}function kt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}kt.groups={},kt.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let o=0;o<e.jr.length;o++){const i=e.jr[o][0],s=e.jr[o][1];if(s&&i.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,o){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,o)},tr(t,e,n,o){let i;return o=o||kt.groups,e&&e.j?i=e:(i=new kt(e),n&&o&&bo(e,n,o)),this.jr.push([t,i]),i},ts(t,e,n,o){let i=this;const s=t.length;if(!s)return i;for(let a=0;a<s-1;a++)i=i.tt(t[a]);return i.tt(t[s-1],e,n,o)},tt(t,e,n,o){o=o||kt.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const s=e;let a,l=i.go(t);if(l?(a=new kt,Object.assign(a.j,l.j),a.jr.push.apply(a.jr,l.jr),a.jd=l.jd,a.t=l.t):a=new kt,s){if(o)if(a.t&&typeof a.t=="string"){const c=Object.assign(function(d,u){const p={};for(const h in u)u[h].indexOf(d)>=0&&(p[h]=!0);return p}(a.t,o),n);bo(s,c,o)}else n&&bo(s,n,o);a.t=s}return i.j[t]=a,a}};const he=(t,e,n,o,i)=>t.ta(e,n,o,i),ze=(t,e,n,o,i)=>t.tr(e,n,o,i),cv=(t,e,n,o,i)=>t.ts(e,n,o,i),F=(t,e,n,o,i)=>t.tt(e,n,o,i),gn="WORD",Hc="UWORD",dv="ASCIINUMERICAL",uv="ALPHANUMERICAL",ti="LOCALHOST",Wc="TLD",Kc="UTLD",_s="SCHEME",lr="SLASH_SCHEME",Uc="NUM",qc="WS",Jc="NL",ni="OPENBRACE",oi="CLOSEBRACE",As="OPENBRACKET",Vs="CLOSEBRACKET",Is="OPENPAREN",Ds="CLOSEPAREN",Rs="OPENANGLEBRACKET",Ls="CLOSEANGLEBRACKET",zs="FULLWIDTHLEFTPAREN",$s="FULLWIDTHRIGHTPAREN",Ps="LEFTCORNERBRACKET",js="RIGHTCORNERBRACKET",Fs="LEFTWHITECORNERBRACKET",Hs="RIGHTWHITECORNERBRACKET",Ws="FULLWIDTHLESSTHAN",Ks="FULLWIDTHGREATERTHAN",Us="AMPERSAND",qs="APOSTROPHE",Js="ASTERISK",Hn="AT",Gs="BACKSLASH",Ys="BACKTICK",Xs="CARET",Wn="COLON",Gc="COMMA",Zs="DOLLAR",Zt="DOT",Qs="EQUALS",Yc="EXCLAMATION",Rt="HYPHEN",ri="PERCENT",ea="PIPE",ta="PLUS",na="POUND",ii="QUERY",Xc="QUOTE",pv="FULLWIDTHMIDDLEDOT",Zc="SEMI",Qt="SLASH",si="TILDE",oa="UNDERSCORE",hv="EMOJI",ra="SYM";var fv=Object.freeze({__proto__:null,ALPHANUMERICAL:uv,AMPERSAND:Us,APOSTROPHE:qs,ASCIINUMERICAL:dv,ASTERISK:Js,AT:Hn,BACKSLASH:Gs,BACKTICK:Ys,CARET:Xs,CLOSEANGLEBRACKET:Ls,CLOSEBRACE:oi,CLOSEBRACKET:Vs,CLOSEPAREN:Ds,COLON:Wn,COMMA:Gc,DOLLAR:Zs,DOT:Zt,EMOJI:hv,EQUALS:Qs,EXCLAMATION:Yc,FULLWIDTHGREATERTHAN:Ks,FULLWIDTHLEFTPAREN:zs,FULLWIDTHLESSTHAN:Ws,FULLWIDTHMIDDLEDOT:pv,FULLWIDTHRIGHTPAREN:$s,HYPHEN:Rt,LEFTCORNERBRACKET:Ps,LEFTWHITECORNERBRACKET:Fs,LOCALHOST:ti,NL:Jc,NUM:Uc,OPENANGLEBRACKET:Rs,OPENBRACE:ni,OPENBRACKET:As,OPENPAREN:Is,PERCENT:ri,PIPE:ea,PLUS:ta,POUND:na,QUERY:ii,QUOTE:Xc,RIGHTCORNERBRACKET:js,RIGHTWHITECORNERBRACKET:Hs,SCHEME:_s,SEMI:Zc,SLASH:Qt,SLASH_SCHEME:lr,SYM:ra,TILDE:si,TLD:Wc,UNDERSCORE:oa,UTLD:Kc,UWORD:Hc,WORD:gn,WS:qc});const vn=/[a-z]/,ai=new RegExp("\\p{L}","u"),Qc=new RegExp("\\p{Emoji}","u"),yn=/\d/,ed=/\s/;let ia=null,sa=null;function mv(t,e){const n=function(l){const c=[],d=l.length;let u=0;for(;u<d;){let p,h=l.charCodeAt(u),f=h<55296||h>56319||u+1===d||(p=l.charCodeAt(u+1))<56320||p>57343?l[u]:l.slice(u,u+2);c.push(f),u+=f.length}return c}(e.replace(/[A-Z]/g,l=>l.toLowerCase())),o=n.length,i=[];let s=0,a=0;for(;a<o;){let l=t,c=null,d=0,u=null,p=-1,h=-1;for(;a<o&&(c=l.go(n[a]));)l=c,l.accepts()?(p=0,h=0,u=l):p>=0&&(p+=n[a].length,h++),d+=n[a].length,s+=n[a].length,a++;s-=p,a-=h,d-=p,i.push({t:u.t,v:e.slice(s-d,s),s:s-d,e:s})}return i}function Kn(t,e,n,o,i){let s;const a=e.length;for(let l=0;l<a-1;l++){const c=e[l];t.j[c]?s=t.j[c]:(s=new kt(o),s.jr=i.slice(),t.j[c]=s),t=s}return s=new kt(n),s.jr=i.slice(),t.j[e[a-1]]=s,s}function gv(t){const e=[],n=[];let o=0;for(;o<t.length;){let i=0;for(;"0123456789".indexOf(t[o+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(o,o+i),10);s>0;s--)n.pop();o+=i}else n.push(t[o]),o++}return e}const li={defaultProtocol:"http",events:null,format:vv,formatHref:vv,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function td(t,e=null){let n=Object.assign({},li);t&&(n=Object.assign(n,t instanceof td?t.o:t));const o=n.ignoreTags,i=[];for(let s=0;s<o.length;s++)i.push(o[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}function vv(t){return t}function yv(t,e){this.t="token",this.v=t,this.tk=e}function aa(t,e){class n extends yv{constructor(i,s){super(i,s),this.t=t}}for(const o in e)n.prototype[o]=e[o];return n.t=t,n}td.prototype={o:li,ignoreTags:[],defaultRender:t=>t,check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const o=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:li[t],typeof i=="function"&&o&&(i=i(e,n))):typeof i=="function"&&o&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let o=this.o[t];return typeof o=="function"&&e!=null&&(o=o(e,n.t,n)),o},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}},yv.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),o=t.get("format",e,this);return n&&o.length>n?o.substring(0,n)+"…":o},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=li.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),o=t.get("formatHref",n,this),i=t.get("tagName",n,e),s=this.toFormattedString(t),a={},l=t.get("className",n,e),c=t.get("target",n,e),d=t.get("rel",n,e),u=t.getObj("attributes",n,e),p=t.getObj("events",n,e);return a.href=o,l&&(a.class=l),c&&(a.target=c),d&&(a.rel=d),u&&Object.assign(a,u),{tagName:i,attributes:a,content:s,eventListeners:p}}};const bv=aa("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),kv=aa("text"),cS=aa("nl"),la=aa("url",{isLink:!0,toHref(t=li.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==ti&&t[1].t===Wn}}),Lt=t=>new kt(t);function nd(t,e,n){const o=n[0].s,i=n[n.length-1].e;return new t(e.slice(o,i),n)}const dS=typeof console<"u"&&console&&console.warn||(()=>{}),De={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function wv(t,e=!1){if(De.initialized&&dS(`linkifyjs: already initialized - will not register custom scheme "${t}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
159
159
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
160
160
|
2. Cannot start or end with "-"
|
|
161
|
-
3. "-" cannot repeat`);De.customSchemes.push([t,e])}function
|
|
162
|
-
`,Jc,{[
|
|
163
|
-
`,d),F(u,"",p),ze(u,
|
|
164
|
-
`),ze(p,td,p),F(p,"",p);const h=ze(o,ed,fv,{[cv]:!0});F(h,"#"),ze(h,ed,h),F(h,"️",h);const f=F(h,"");F(f,"#"),ze(f,ed,h);const m=[[yn,l],[kn,i]],g=[[yn,null],[ls,c],[kn,a]];for(let v=0;v<sa.length;v++)qn(o,sa[v],Kc,vn,m);for(let v=0;v<ia.length;v++)qn(o,ia[v],qc,Wc,g);wo(Kc,{tld:!0,ascii:!0},n),wo(qc,{utld:!0,alpha:!0},n),qn(o,"file",_i,vn,m),qn(o,"mailto",_i,vn,m),qn(o,"http",lr,vn,m),qn(o,"https",lr,vn,m),qn(o,"ftp",lr,vn,m),qn(o,"ftps",lr,vn,m),wo(_i,{scheme:!0,ascii:!0},n),wo(lr,{slashscheme:!0,ascii:!0},n),e=e.sort((v,k)=>v[0]>k[0]?1:-1);for(let v=0;v<e.length;v++){const k=e[v][0],y=e[v][1]?{[pS]:!0}:{[hS]:!0};k.indexOf("-")>=0?y[Fc]=!0:yn.test(k)?kn.test(k)?y[Qr]=!0:y[Pc]=!0:y[$c]=!0,dv(o,k,k,y)}return dv(o,"localhost",ts,{ascii:!0}),o.jd=new bt(ra),{start:o,tokens:Object.assign({groups:n},mv)}}(De.customSchemes);for(let e=0;e<De.tokenQueue.length;e++)De.tokenQueue[e][1]({scanner:De.scanner});De.parser=function({groups:e}){const n=e.domain.concat([qi,Gi,Wn,Ji,Yi,Xi,Zi,Qi,Rt,Uc,ss,ea,ta,na,Qt,ra,as,oa]),o=[Ui,Kn,Yc,Zt,Xc,ss,is,Zc,Qc,Ri,Li,ns,rs,Vi,Ai,Ii,Di,zi,$i,Pi,ji,Fi,Hi,Wi,Ki],s=[qi,Ui,Gi,Ji,Yi,Xi,Zi,Qi,Rt,ns,rs,ss,ea,ta,na,is,Qt,ra,as,oa],i=Lt(),a=F(i,as);he(a,s,a),he(a,e.domain,a);const l=Lt(),c=Lt(),d=Lt();he(i,e.domain,l),he(i,e.scheme,c),he(i,e.slashscheme,d),he(l,s,a),he(l,e.domain,l);const u=F(l,Wn);F(a,Wn,u),F(c,Wn,u),F(d,Wn,u);const p=F(a,Zt);he(p,s,a),he(p,e.domain,a);const h=Lt();he(u,e.domain,h),he(h,e.domain,h);const f=F(h,Zt);he(f,e.domain,h);const m=Lt(bv);he(f,e.tld,m),he(f,e.utld,m),F(u,ts,m);const g=F(h,Rt);F(g,Rt,g),he(g,e.domain,h),he(m,e.domain,h),F(m,Zt,f),F(m,Rt,g);const v=F(m,Kn);he(v,e.numeric,bv);const k=F(l,Rt),y=F(l,Zt);F(k,Rt,k),he(k,e.domain,l),he(y,s,a),he(y,e.domain,l);const b=Lt(la);he(y,e.tld,b),he(y,e.utld,b),he(b,e.domain,l),he(b,s,a),F(b,Zt,y),F(b,Rt,k),F(b,Wn,u);const x=F(b,Kn),w=Lt(la);he(x,e.numeric,w);const C=Lt(la),S=Lt();he(C,n,C),he(C,o,S),he(S,n,C),he(S,o,S),F(b,Qt,C),F(w,Qt,C);const E=F(c,Kn),M=F(d,Kn),N=F(M,Qt),T=F(N,Qt);he(c,e.domain,l),F(c,Zt,y),F(c,Rt,k),he(d,e.domain,l),F(d,Zt,y),F(d,Rt,k),he(E,e.domain,C),F(E,Qt,C),F(E,is,C),he(T,e.domain,C),he(T,n,C),F(T,Qt,C);const R=[[ns,rs],[Ai,Vi],[Ii,Di],[Ri,Li],[zi,$i],[Pi,ji],[Fi,Hi],[Wi,Ki]];for(let z=0;z<R.length;z++){const[_,I]=R[z],O=F(C,_);F(S,_,O),F(O,I,C);const V=Lt(la);he(O,n,V);const P=Lt();he(O,o),he(V,n,V),he(V,o,P),he(P,n,V),he(P,o,P),F(V,I,C),F(P,I,C)}return F(i,ts,b),F(i,Jc,mS),{start:i,tokens:mv}}(De.scanner.tokens);for(let e=0;e<De.pluginQueue.length;e++)De.pluginQueue[e][1]({scanner:De.scanner,parser:De.parser});De.initialized=!0}(),function(e,n,o){let s=o.length,i=0,a=[],l=[];for(;i<s;){let c=e,d=null,u=null,p=0,h=null,f=-1;for(;i<s&&!(d=c.go(o[i].t));)l.push(o[i++]);for(;i<s&&(u=d||c.go(o[i].t));)d=null,c=u,c.accepts()?(f=0,h=c):f>=0&&f++,i++,p++;if(f<0)i-=p,i<s&&(l.push(o[i]),i++);else{l.length>0&&(a.push(od(wv,n,l)),l=[]),i-=f,p-=f;const m=h.t,g=o.slice(i-p,i);a.push(od(m,n,g))}}return l.length>0&&a.push(od(wv,n,l)),a}(De.parser.start,t,gv(De.scanner.start,t))}function Cv(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const o=new nd(n),s=rd(t),i=[];for(let a=0;a<s.length;a++){const l=s[a];!l.isLink||e&&l.t!==e||!o.check(l)||i.push(l.toFormattedObject(o))}return i}rd.scan=gv;var sd="[\0- -\u2029 ]",vS=new RegExp(sd),yS=new RegExp(`${sd}$`),kS=new RegExp(sd,"g");function xo(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(o=>{const s=typeof o=="string"?o:o.scheme;s&&n.push(s)}),!t||t.replace(kS,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var bS=Hn.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{typeof t!="string"?xv(t.scheme,t.optionalSlashes):xv(t)})},onDestroy(){bt.groups={},De.scanner=null,De.parser=null,De.tokenQueue=[],De.pluginQueue=[],De.customSchemes=[],De.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!xo(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}),addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!(!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!xo(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!xo(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Fe(this.options.HTMLAttributes,t),0]:["a",Fe(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n;const o=((n=t.attrs)==null?void 0:n.href)||"";return`[${e.renderChildren(t)}](${o})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return!!this.options.isAllowedUri(n,{defaultValidate:o=>!!xo(o,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&e().setMark(this.name,t).setMeta("preventAutolink",!0).run()},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return!(n&&!this.options.isAllowedUri(n,{defaultValidate:o=>!!xo(o,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[bo({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:o}=this.options,s=Cv(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:a=>!!xo(a,n),protocols:n,defaultProtocol:o}));s.length&&s.forEach(i=>{this.options.shouldAutoLink(i.value)&&e.push({text:i.value,data:{href:i.href},index:i.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;var o;return this.options.autolink&&t.push((o={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:s=>this.options.isAllowedUri(s,{defaultValidate:i=>!!xo(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink},new Le({key:new Ye("autolink"),appendTransaction:(s,i,a)=>{const l=s.some(u=>u.docChanged)&&!i.doc.eq(a.doc),c=s.some(u=>u.getMeta("preventAutolink"));if(!l||c)return;const{tr:d}=a;return Kg(Rg(i.doc,[...s])).forEach(({newRange:u})=>{const p=function(g,v){const k=[];return g.nodesBetween(v.from,v.to,(y,b)=>{(x=>x.isTextblock)(y)&&k.push({node:y,pos:b})}),k}(a.doc,u);let h,f;if(p.length>1)h=p[0],f=a.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(p.length){const g=a.doc.textBetween(u.from,u.to," "," ");if(!yS.test(g))return;h=p[0],f=a.doc.textBetween(h.pos,u.to,void 0," ")}if(h&&f){const g=f.split(vS).filter(Boolean);if(g.length<=0)return!1;const v=g[g.length-1],k=h.pos+f.lastIndexOf(v);if(!v)return!1;const y=rd(v).map(b=>b.toObject(o.defaultProtocol));if(!((m=y).length===1?m[0].isLink:m.length===3&&m[1].isLink&&["()","[]"].includes(m[0].value+m[2].value)))return!1;y.filter(b=>b.isLink).map(b=>({...b,from:k+b.start+1,to:k+b.end+1})).filter(b=>!a.schema.marks.code||!a.doc.rangeHasMark(b.from,b.to,a.schema.marks.code)).filter(b=>o.validate(b.value)).filter(b=>o.shouldAutoLink(b.value)).forEach(b=>{Bc(b.from,b.to,a.doc).some(x=>x.mark.type===o.type)||d.addMark(b.from,b.to,o.type.create({href:b.href}))})}var m}),d.steps.length?d:void 0}}))),this.options.openOnClick===!0&&t.push(function(s){return new Le({key:new Ye("handleClickLink"),props:{handleClick:(i,a,l)=>{var c,d;if(l.button!==0||!i.editable)return!1;let u=null;if(l.target instanceof HTMLAnchorElement)u=l.target;else{let m=l.target;const g=[];for(;m.nodeName!=="DIV";)g.push(m),m=m.parentNode;u=g.find(v=>v.nodeName==="A")}if(!u)return!1;const p=Wg(i.state,s.type.name),h=(c=u==null?void 0:u.href)!=null?c:p.href,f=(d=u==null?void 0:u.target)!=null?d:p.target;return s.enableClickSelection&&s.editor.commands.extendMarkRange(s.type.name),!(!u||!h||(window.open(h,f),0))}}})}({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(function(s){return new Le({key:new Ye("handlePasteLink"),props:{handlePaste:(i,a,l)=>{const{shouldAutoLink:c}=s,{state:d}=i,{selection:u}=d,{empty:p}=u;if(p)return!1;let h="";l.content.forEach(m=>{h+=m.textContent});const f=Cv(h,{defaultProtocol:s.defaultProtocol}).find(m=>m.isLink&&m.value===h);return!(!h||!f||c!==void 0&&!c(f.href))&&s.editor.commands.setMark(s.type,{href:f.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),wS=Object.defineProperty,Sv="textStyle",Ev=/^\s*([-+*])\s$/,Mv=kt.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",Fe(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
165
|
-
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(
|
|
161
|
+
3. "-" cannot repeat`);De.customSchemes.push([t,e])}function od(t){return De.initialized||function(){De.scanner=function(e=[]){const n={};kt.groups=n;const o=new kt;ia==null&&(ia=gv("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),sa==null&&(sa=gv("ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2")),F(o,"'",qs),F(o,"{",ni),F(o,"}",oi),F(o,"[",As),F(o,"]",Vs),F(o,"(",Is),F(o,")",Ds),F(o,"<",Rs),F(o,">",Ls),F(o,"(",zs),F(o,")",$s),F(o,"「",Ps),F(o,"」",js),F(o,"『",Fs),F(o,"』",Hs),F(o,"<",Ws),F(o,">",Ks),F(o,"&",Us),F(o,"*",Js),F(o,"@",Hn),F(o,"`",Ys),F(o,"^",Xs),F(o,":",Wn),F(o,",",Gc),F(o,"$",Zs),F(o,".",Zt),F(o,"=",Qs),F(o,"!",Yc),F(o,"-",Rt),F(o,"%",ri),F(o,"|",ea),F(o,"+",ta),F(o,"#",na),F(o,"?",ii),F(o,'"',Xc),F(o,"/",Qt),F(o,";",Zc),F(o,"~",si),F(o,"_",oa),F(o,"\\",Gs),F(o,"・",pv);const i=ze(o,yn,Uc,{[zc]:!0});ze(i,yn,i);const s=ze(i,vn,dv,{[Qr]:!0}),a=ze(i,ai,uv,{[ei]:!0}),l=ze(o,vn,gn,{[$c]:!0});ze(l,yn,s),ze(l,vn,l),ze(s,yn,s),ze(s,vn,s);const c=ze(o,ai,Hc,{[Pc]:!0});ze(c,vn),ze(c,yn,a),ze(c,ai,c),ze(a,yn,a),ze(a,vn),ze(a,ai,a);const d=F(o,`
|
|
162
|
+
`,Jc,{[Fc]:!0}),u=F(o,"\r",qc,{[Fc]:!0}),p=ze(o,ed,qc,{[Fc]:!0});F(o,"",p),F(u,`
|
|
163
|
+
`,d),F(u,"",p),ze(u,ed,p),F(p,"\r"),F(p,`
|
|
164
|
+
`),ze(p,ed,p),F(p,"",p);const h=ze(o,Qc,hv,{[lv]:!0});F(h,"#"),ze(h,Qc,h),F(h,"️",h);const f=F(h,"");F(f,"#"),ze(f,Qc,h);const m=[[vn,l],[yn,s]],g=[[vn,null],[ai,c],[yn,a]];for(let v=0;v<ia.length;v++)Kn(o,ia[v],Wc,gn,m);for(let v=0;v<sa.length;v++)Kn(o,sa[v],Kc,Hc,g);bo(Wc,{tld:!0,ascii:!0},n),bo(Kc,{utld:!0,alpha:!0},n),Kn(o,"file",_s,gn,m),Kn(o,"mailto",_s,gn,m),Kn(o,"http",lr,gn,m),Kn(o,"https",lr,gn,m),Kn(o,"ftp",lr,gn,m),Kn(o,"ftps",lr,gn,m),bo(_s,{scheme:!0,ascii:!0},n),bo(lr,{slashscheme:!0,ascii:!0},n),e=e.sort((v,b)=>v[0]>b[0]?1:-1);for(let v=0;v<e.length;v++){const b=e[v][0],y=e[v][1]?{[sS]:!0}:{[aS]:!0};b.indexOf("-")>=0?y[jc]=!0:vn.test(b)?yn.test(b)?y[Qr]=!0:y[$c]=!0:y[zc]=!0,cv(o,b,b,y)}return cv(o,"localhost",ti,{ascii:!0}),o.jd=new kt(ra),{start:o,tokens:Object.assign({groups:n},fv)}}(De.customSchemes);for(let e=0;e<De.tokenQueue.length;e++)De.tokenQueue[e][1]({scanner:De.scanner});De.parser=function({groups:e}){const n=e.domain.concat([Us,Js,Hn,Gs,Ys,Xs,Zs,Qs,Rt,Uc,ri,ea,ta,na,Qt,ra,si,oa]),o=[qs,Wn,Gc,Zt,Yc,ri,ii,Xc,Zc,Rs,Ls,ni,oi,Vs,As,Is,Ds,zs,$s,Ps,js,Fs,Hs,Ws,Ks],i=[Us,qs,Js,Gs,Ys,Xs,Zs,Qs,Rt,ni,oi,ri,ea,ta,na,ii,Qt,ra,si,oa],s=Lt(),a=F(s,si);he(a,i,a),he(a,e.domain,a);const l=Lt(),c=Lt(),d=Lt();he(s,e.domain,l),he(s,e.scheme,c),he(s,e.slashscheme,d),he(l,i,a),he(l,e.domain,l);const u=F(l,Hn);F(a,Hn,u),F(c,Hn,u),F(d,Hn,u);const p=F(a,Zt);he(p,i,a),he(p,e.domain,a);const h=Lt();he(u,e.domain,h),he(h,e.domain,h);const f=F(h,Zt);he(f,e.domain,h);const m=Lt(bv);he(f,e.tld,m),he(f,e.utld,m),F(u,ti,m);const g=F(h,Rt);F(g,Rt,g),he(g,e.domain,h),he(m,e.domain,h),F(m,Zt,f),F(m,Rt,g);const v=F(m,Wn);he(v,e.numeric,bv);const b=F(l,Rt),y=F(l,Zt);F(b,Rt,b),he(b,e.domain,l),he(y,i,a),he(y,e.domain,l);const k=Lt(la);he(y,e.tld,k),he(y,e.utld,k),he(k,e.domain,l),he(k,i,a),F(k,Zt,y),F(k,Rt,b),F(k,Hn,u);const x=F(k,Wn),w=Lt(la);he(x,e.numeric,w);const S=Lt(la),C=Lt();he(S,n,S),he(S,o,C),he(C,n,S),he(C,o,C),F(k,Qt,S),F(w,Qt,S);const E=F(c,Wn),M=F(d,Wn),N=F(M,Qt),T=F(N,Qt);he(c,e.domain,l),F(c,Zt,y),F(c,Rt,b),he(d,e.domain,l),F(d,Zt,y),F(d,Rt,b),he(E,e.domain,S),F(E,Qt,S),F(E,ii,S),he(T,e.domain,S),he(T,n,S),F(T,Qt,S);const R=[[ni,oi],[As,Vs],[Is,Ds],[Rs,Ls],[zs,$s],[Ps,js],[Fs,Hs],[Ws,Ks]];for(let z=0;z<R.length;z++){const[_,I]=R[z],O=F(S,_);F(C,_,O),F(O,I,S);const V=Lt(la);he(O,n,V);const P=Lt();he(O,o),he(V,n,V),he(V,o,P),he(P,n,V),he(P,o,P),F(V,I,S),F(P,I,S)}return F(s,ti,k),F(s,Jc,cS),{start:s,tokens:fv}}(De.scanner.tokens);for(let e=0;e<De.pluginQueue.length;e++)De.pluginQueue[e][1]({scanner:De.scanner,parser:De.parser});De.initialized=!0}(),function(e,n,o){let i=o.length,s=0,a=[],l=[];for(;s<i;){let c=e,d=null,u=null,p=0,h=null,f=-1;for(;s<i&&!(d=c.go(o[s].t));)l.push(o[s++]);for(;s<i&&(u=d||c.go(o[s].t));)d=null,c=u,c.accepts()?(f=0,h=c):f>=0&&f++,s++,p++;if(f<0)s-=p,s<i&&(l.push(o[s]),s++);else{l.length>0&&(a.push(nd(kv,n,l)),l=[]),s-=f,p-=f;const m=h.t,g=o.slice(s-p,s);a.push(nd(m,n,g))}}return l.length>0&&a.push(nd(kv,n,l)),a}(De.parser.start,t,mv(De.scanner.start,t))}function xv(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const o=new td(n),i=od(t),s=[];for(let a=0;a<i.length;a++){const l=i[a];!l.isLink||e&&l.t!==e||!o.check(l)||s.push(l.toFormattedObject(o))}return s}od.scan=mv;var rd="[\0- -\u2029 ]",uS=new RegExp(rd),pS=new RegExp(`${rd}$`),hS=new RegExp(rd,"g");function ko(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(o=>{const i=typeof o=="string"?o:o.scheme;i&&n.push(i)}),!t||t.replace(hS,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var fS=Fn.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{typeof t!="string"?wv(t.scheme,t.optionalSlashes):wv(t)})},onDestroy(){kt.groups={},De.scanner=null,De.parser=null,De.tokenQueue=[],De.pluginQueue=[],De.customSchemes=[],De.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!ko(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}),addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!(!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!ko(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!ko(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Fe(this.options.HTMLAttributes,t),0]:["a",Fe(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n;const o=((n=t.attrs)==null?void 0:n.href)||"";return`[${e.renderChildren(t)}](${o})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return!!this.options.isAllowedUri(n,{defaultValidate:o=>!!ko(o,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&e().setMark(this.name,t).setMeta("preventAutolink",!0).run()},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return!(n&&!this.options.isAllowedUri(n,{defaultValidate:o=>!!ko(o,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[yo({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:o}=this.options,i=xv(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!ko(a,n),protocols:n,defaultProtocol:o}));i.length&&i.forEach(s=>{this.options.shouldAutoLink(s.value)&&e.push({text:s.value,data:{href:s.href},index:s.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;var o;return this.options.autolink&&t.push((o={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:i=>this.options.isAllowedUri(i,{defaultValidate:s=>!!ko(s,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink},new Le({key:new Ye("autolink"),appendTransaction:(i,s,a)=>{const l=i.some(u=>u.docChanged)&&!s.doc.eq(a.doc),c=i.some(u=>u.getMeta("preventAutolink"));if(!l||c)return;const{tr:d}=a;return Wg(Dg(s.doc,[...i])).forEach(({newRange:u})=>{const p=function(g,v){const b=[];return g.nodesBetween(v.from,v.to,(y,k)=>{(x=>x.isTextblock)(y)&&b.push({node:y,pos:k})}),b}(a.doc,u);let h,f;if(p.length>1)h=p[0],f=a.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(p.length){const g=a.doc.textBetween(u.from,u.to," "," ");if(!pS.test(g))return;h=p[0],f=a.doc.textBetween(h.pos,u.to,void 0," ")}if(h&&f){const g=f.split(uS).filter(Boolean);if(g.length<=0)return!1;const v=g[g.length-1],b=h.pos+f.lastIndexOf(v);if(!v)return!1;const y=od(v).map(k=>k.toObject(o.defaultProtocol));if(!((m=y).length===1?m[0].isLink:m.length===3&&m[1].isLink&&["()","[]"].includes(m[0].value+m[2].value)))return!1;y.filter(k=>k.isLink).map(k=>({...k,from:b+k.start+1,to:b+k.end+1})).filter(k=>!a.schema.marks.code||!a.doc.rangeHasMark(k.from,k.to,a.schema.marks.code)).filter(k=>o.validate(k.value)).filter(k=>o.shouldAutoLink(k.value)).forEach(k=>{Nc(k.from,k.to,a.doc).some(x=>x.mark.type===o.type)||d.addMark(k.from,k.to,o.type.create({href:k.href}))})}var m}),d.steps.length?d:void 0}}))),this.options.openOnClick===!0&&t.push(function(i){return new Le({key:new Ye("handleClickLink"),props:{handleClick:(s,a,l)=>{var c,d;if(l.button!==0||!s.editable)return!1;let u=null;if(l.target instanceof HTMLAnchorElement)u=l.target;else{let m=l.target;const g=[];for(;m.nodeName!=="DIV";)g.push(m),m=m.parentNode;u=g.find(v=>v.nodeName==="A")}if(!u)return!1;const p=Hg(s.state,i.type.name),h=(c=u==null?void 0:u.href)!=null?c:p.href,f=(d=u==null?void 0:u.target)!=null?d:p.target;return i.enableClickSelection&&i.editor.commands.extendMarkRange(i.type.name),!(!u||!h||(window.open(h,f),0))}}})}({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(function(i){return new Le({key:new Ye("handlePasteLink"),props:{handlePaste:(s,a,l)=>{const{shouldAutoLink:c}=i,{state:d}=s,{selection:u}=d,{empty:p}=u;if(p)return!1;let h="";l.content.forEach(m=>{h+=m.textContent});const f=xv(h,{defaultProtocol:i.defaultProtocol}).find(m=>m.isLink&&m.value===h);return!(!h||!f||c!==void 0&&!c(f.href))&&i.editor.commands.setMark(i.type,{href:f.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),mS=Object.defineProperty,Cv="textStyle",Sv=/^\s*([-+*])\s$/,Ev=bt.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",Fe(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
165
|
+
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(Cv)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=ar({find:Sv,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ar({find:Sv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Cv),editor:this.editor})),[t]}}),Mv=bt.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",Fe(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{if(t.type!=="list_item")return[];let n=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(o=>o.type==="paragraph"))n=e.parseChildren(t.tokens);else{const o=t.tokens[0];if(o&&o.type==="text"&&o.tokens&&o.tokens.length>0){if(n=[{type:"paragraph",content:e.parseInline(o.tokens)}],t.tokens.length>1){const i=t.tokens.slice(1),s=e.parseChildren(i);n.push(...s)}}else n=e.parseChildren(t.tokens)}return n.length===0&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(t,e,n)=>Lc(t,e,o=>o.parentType==="bulletList"?"- ":o.parentType==="orderedList"?`${o.index+1}. `:"- ",n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});((t,e)=>{for(var n in e)mS(t,n,{get:e[n],enumerable:!0})})({},{findListItemPos:()=>ci,getNextListDepth:()=>id,handleBackspace:()=>sd,handleDelete:()=>ad,hasListBefore:()=>Nv,hasListItemAfter:()=>gS,hasListItemBefore:()=>Bv,listItemHasSubList:()=>Tv,nextListIsDeeper:()=>Ov,nextListIsHigher:()=>_v});var ci=(t,e)=>{const{$from:n}=e.selection,o=Ke(t,e.schema);let i=null,s=n.depth,a=n.pos,l=null;for(;s>0&&l===null;)i=n.node(s),i.type===o?l=s:(s-=1,a-=1);return l===null?null:{$pos:e.doc.resolve(a),depth:l}},id=(t,e)=>{const n=ci(t,e);if(!n)return!1;const[,o]=((i,s,a,l=20)=>{const c=i.doc.resolve(a);let d=l,u=null;for(;d>0&&u===null;){const p=c.node(d);(p==null?void 0:p.type.name)===s?u=p:d-=1}return[u,d]})(e,t,n.$pos.pos+4);return o},Nv=(t,e,n)=>{const{$anchor:o}=t.selection,i=Math.max(0,o.pos-2),s=t.doc.resolve(i).node();return!(!s||!n.includes(s.type.name))},Bv=(t,e)=>{var n;const{$anchor:o}=e.selection,i=e.doc.resolve(o.pos-2);return i.index()!==0&&((n=i.nodeBefore)==null?void 0:n.type.name)===t},Tv=(t,e,n)=>{if(!n)return!1;const o=Ke(t,e.schema);let i=!1;return n.descendants(s=>{s.type===o&&(i=!0)}),i},sd=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!jn(t.state,e)&&Nv(t.state,e,n)){const{$anchor:a}=t.state.selection,l=t.state.doc.resolve(a.before()-1),c=[];l.node().descendants((p,h)=>{p.type.name===e&&c.push({node:p,pos:h})});const d=c.at(-1);if(!d)return!1;const u=t.state.doc.resolve(l.start()+d.pos+1);return t.chain().cut({from:a.start()-1,to:a.end()+1},u.end()).joinForward().run()}if(!jn(t.state,e)||!(a=>{const{$from:l,$to:c}=a.selection;return!(l.parentOffset>0||l.pos!==c.pos)})(t.state))return!1;const o=ci(e,t.state);if(!o)return!1;const i=t.state.doc.resolve(o.$pos.pos-2).node(o.depth),s=Tv(e,t.state,i);return Bv(e,t.state)&&!s?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},Ov=(t,e)=>{const n=id(t,e),o=ci(t,e);return!(!o||!n)&&n>o.depth},_v=(t,e)=>{const n=id(t,e),o=ci(t,e);return!(!o||!n)&&n<o.depth},ad=(t,e)=>{if(!jn(t.state,e)||!((s,a)=>{const{$from:l,$to:c,$anchor:d}=s.selection;if(a){const u=ws(h=>h.type.name===a)(s.selection);if(!u)return!1;const p=s.doc.resolve(u.pos+1);return d.pos+1===p.end()}return!(c.parentOffset<c.parent.nodeSize-2||l.pos!==c.pos)})(t.state,e))return!1;const{selection:n}=t.state,{$from:o,$to:i}=n;return!(!n.empty&&o.sameParent(i))&&(Ov(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():_v(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward())},gS=(t,e)=>{var n;const{$anchor:o}=e.selection,i=e.doc.resolve(o.pos-o.parentOffset-2);return i.index()!==i.parent.childCount-1&&((n=i.nodeAfter)==null?void 0:n.type.name)===t},Av=Ue.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&ad(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&ad(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:o})=>{t.state.schema.nodes[n]!==void 0&&sd(t,n,o)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:o})=>{t.state.schema.nodes[n]!==void 0&&sd(t,n,o)&&(e=!0)}),e}}}}),Vv=/^(\s*)(\d+)\.\s+(.*)$/,vS=/^\s/;function Iv(t,e,n){var o;const i=[];let s=0;for(;s<t.length;){const a=t[s];if(a.indent===e){const l=a.content.split(`
|
|
166
166
|
`),c=((o=l[0])==null?void 0:o.trim())||"",d=[];c&&d.push({type:"paragraph",raw:c,tokens:n.inlineTokens(c)});const u=l.slice(1).join(`
|
|
167
|
-
`).trim();if(u){const f=n.blockTokens(u);d.push(...f)}let p=
|
|
168
|
-
`)})}
|
|
169
|
-
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=e==null?void 0:e.index;return n!==void 0?n:-1},tokenize:(t,e,n)=>{var o;const
|
|
170
|
-
`),[
|
|
171
|
-
`,
|
|
172
|
-
${w.slice(
|
|
173
|
-
`)}),p=
|
|
174
|
-
`)}:void 0}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(
|
|
175
|
-
`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const o=i=>{const a=Lc(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,c)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:c}),customNestedParser:o},n);return a?[{type:"taskList",raw:a.raw,items:a.items}]:n.blockTokens(i)},s=Lc(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,a)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:a}),customNestedParser:o},n);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});qe.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(Mv.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(Nv.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(Vv.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(zv.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(ES.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(MS.configure(this.options.taskList)),t}});var NS=kt.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",Fe(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];return n.length===1&&n[0].type==="image"?e.parseChildren([n[0]]):e.createNode("paragraph",void 0,e.parseInline(n))},renderMarkdown:(t,e)=>t&&Array.isArray(t.content)?e.renderChildren(t.content):"",addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),BS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,TS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,OS=Hn.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("line-through")&&{}}],renderHTML({HTMLAttributes:t}){return["s",Fe(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ir({find:BS,type:this.type})]},addPasteRules(){return[bo({find:TS,type:this.type})]}}),_S=kt.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),AS=Hn.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("underline")&&{}}],renderHTML({HTMLAttributes:t}){return["u",Fe(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown:(t,e)=>`++${e.renderChildren(t)}++`,markdownTokenizer:{name:"underline",level:"inline",start:t=>t.indexOf("++"),tokenize(t,e,n){const o=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!o)return;const s=o[2].trim();return{type:"underline",raw:o[0],text:s,tokens:n.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function VS(t={}){return new Le({view:e=>new IS(e,t)})}class IS{constructor(e,n){var o;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(o=n.width)!==null&&o!==void 0?o:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let i=a=>{this[s](a)};return e.dom.addEventListener(s,i),{name:s,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,n=this.editorView.state.doc.resolve(this.cursorPos),o=!n.parent.inlineContent,s=this.editorView.dom,i=s.getBoundingClientRect(),a=i.width/s.offsetWidth,l=i.height/s.offsetHeight;if(o){let p=n.nodeBefore,h=n.nodeAfter;if(p||h){let f=this.editorView.nodeDOM(this.cursorPos-(p?p.nodeSize:0));if(f){let m=f.getBoundingClientRect(),g=p?m.bottom:m.top;p&&h&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let v=this.width/2*l;e={left:m.left,right:m.right,top:g-v,bottom:g+v}}}}if(!e){let p=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*a;e={left:p.left-h,right:p.left+h,top:p.top,bottom:p.bottom}}let c,d,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",o),this.element.classList.toggle("prosemirror-dropcursor-inline",!o),!u||u==document.body&&getComputedStyle(u).position=="static")c=-pageXOffset,d=-pageYOffset;else{let p=u.getBoundingClientRect(),h=p.width/u.offsetWidth,f=p.height/u.offsetHeight;c=p.left-u.scrollLeft*h,d=p.top-u.scrollTop*f}this.element.style.left=(e.left-c)/a+"px",this.element.style.top=(e.top-d)/l+"px",this.element.style.width=(e.right-e.left)/a+"px",this.element.style.height=(e.bottom-e.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),o=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),s=o&&o.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,n,e):s;if(n&&!i){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Hf(this.editorView.state.doc,a,this.editorView.dragging.slice);l!=null&&(a=l)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class $e extends pe{constructor(e){super(e,e)}map(e,n){let o=e.resolve(n.map(this.head));return $e.valid(o)?new $e(o):pe.near(o)}content(){return G.empty}eq(e){return e instanceof $e&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new $e(e.resolve(n.pos))}getBookmark(){return new cd(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!function(i){for(let a=i.depth;a>=0;a--){let l=i.index(a),c=i.node(a);if(l!=0)for(let d=c.child(l-1);;d=d.lastChild){if(d.childCount==0&&!d.inlineContent||$v(d.type))return!0;if(d.inlineContent)return!1}else if(c.type.spec.isolating)return!0}return!0}(e)||!function(i){for(let a=i.depth;a>=0;a--){let l=i.indexAfter(a),c=i.node(a);if(l!=c.childCount)for(let d=c.child(l);;d=d.firstChild){if(d.childCount==0&&!d.inlineContent||$v(d.type))return!0;if(d.inlineContent)return!1}else if(c.type.spec.isolating)return!0}return!0}(e))return!1;let o=n.type.spec.allowGapCursor;if(o!=null)return o;let s=n.contentMatchAt(e.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(e,n,o=!1){e:for(;;){if(!o&&$e.valid(e))return e;let s=e.pos,i=null;for(let a=e.depth;;a--){let l=e.node(a);if(n>0?e.indexAfter(a)<l.childCount:e.index(a)>0){i=l.child(n>0?e.indexAfter(a):e.index(a)-1);break}if(a==0)return null;s+=n;let c=e.doc.resolve(s);if($e.valid(c))return c}for(;;){let a=n>0?i.firstChild:i.lastChild;if(!a){if(i.isAtom&&!i.isText&&!ne.isSelectable(i)){e=e.doc.resolve(s+i.nodeSize*n),o=!1;continue e}break}i=a,s+=n;let l=e.doc.resolve(s);if($e.valid(l))return l}return null}}}$e.prototype.visible=!1,$e.findFrom=$e.findGapCursorFrom,pe.jsonID("gapcursor",$e);class cd{constructor(e){this.pos=e}map(e){return new cd(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return $e.valid(n)?new $e(n):pe.near(n)}}function $v(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}const DS=Mg({ArrowLeft:ca("horiz",-1),ArrowRight:ca("horiz",1),ArrowUp:ca("vert",-1),ArrowDown:ca("vert",1)});function ca(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(o,s,i){let a=o.selection,l=e>0?a.$to:a.$from,c=a.empty;if(a instanceof ie){if(!i.endOfTextblock(n)||l.depth==0)return!1;c=!1,l=o.doc.resolve(e>0?l.after():l.before())}let d=$e.findGapCursorFrom(l,e,c);return!!d&&(s&&s(o.tr.setSelection(new $e(d))),!0)}}function RS(t,e,n){if(!t||!t.editable)return!1;let o=t.state.doc.resolve(e);if(!$e.valid(o))return!1;let s=t.posAtCoords({left:n.clientX,top:n.clientY});return!(s&&s.inside>-1&&ne.isSelectable(t.state.doc.nodeAt(s.inside))||(t.dispatch(t.state.tr.setSelection(new $e(o))),0))}function LS(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof $e))return!1;let{$from:n}=t.state.selection,o=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!o)return!1;let s=$.empty;for(let a=o.length-1;a>=0;a--)s=$.from(o[a].createAndFill(null,s));let i=t.state.tr.replace(n.pos,n.pos,new G(s,0,0));return i.setSelection(ie.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function zS(t){if(!(t.selection instanceof $e))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ie.create(t.doc,[ht.widget(t.selection.head,e,{key:"gapcursor"})])}var da=200,Xe=function(){};Xe.prototype.append=function(t){return t.length?(t=Xe.from(t),!this.length&&t||t.length<da&&this.leafAppend(t)||this.length<da&&t.leafPrepend(this)||this.appendInner(t)):this},Xe.prototype.prepend=function(t){return t.length?Xe.from(t).append(this):this},Xe.prototype.appendInner=function(t){return new $S(this,t)},Xe.prototype.slice=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.length),t>=e?Xe.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Xe.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Xe.prototype.forEach=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Xe.prototype.map=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length);var o=[];return this.forEach(function(s,i){return o.push(t(s,i))},e,n),o},Xe.from=function(t){return t instanceof Xe?t:t&&t.length?new Pv(t):Xe.empty};var Pv=function(t){function e(o){t.call(this),this.values=o}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,s){return o==0&&s==this.length?this:new e(this.values.slice(o,s))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,s,i,a){for(var l=s;l<i;l++)if(o(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(o,s,i,a){for(var l=s-1;l>=i;l--)if(o(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=da)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=da)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Xe);Xe.empty=new Pv([]);var $S=function(t){function e(n,o){t.call(this),this.left=n,this.right=o,this.length=n.length+o.length,this.depth=Math.max(n.depth,o.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,o,s,i){var a=this.left.length;return!(o<a&&this.left.forEachInner(n,o,Math.min(s,a),i)===!1)&&!(s>a&&this.right.forEachInner(n,Math.max(o-a,0),Math.min(this.length,s)-a,i+a)===!1)&&void 0},e.prototype.forEachInvertedInner=function(n,o,s,i){var a=this.left.length;return!(o>a&&this.right.forEachInvertedInner(n,o-a,Math.max(s,a)-a,i+a)===!1)&&!(s<a&&this.left.forEachInvertedInner(n,Math.min(o,a),s,i)===!1)&&void 0},e.prototype.sliceInner=function(n,o){if(n==0&&o==this.length)return this;var s=this.left.length;return o<=s?this.left.slice(n,o):n>=s?this.right.slice(n-s,o-s):this.left.slice(n,s).append(this.right.slice(0,o-s))},e.prototype.leafAppend=function(n){var o=this.right.leafAppend(n);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(n){var o=this.left.leafPrepend(n);if(o)return new e(o,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(Xe);class Ht{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let o,s,i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}n&&(o=this.remapping(i,this.items.length),s=o.maps.length);let a,l,c=e.tr,d=[],u=[];return this.items.forEach((p,h)=>{if(!p.step)return o||(o=this.remapping(i,h+1),s=o.maps.length),s--,void u.push(p);if(o){u.push(new en(p.map));let f,m=p.step.map(o.slice(s));m&&c.maybeStep(m).doc&&(f=c.mapping.maps[c.mapping.maps.length-1],d.push(new en(f,void 0,void 0,d.length+u.length))),s--,f&&o.appendMap(f,s)}else c.maybeStep(p.step);return p.selection?(a=o?p.selection.map(o.slice(s)):p.selection,l=new Ht(this.items.slice(0,i).append(u.reverse().concat(d)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:l,transform:c,selection:a}}addTransform(e,n,o,s){let i=[],a=this.eventCount,l=this.items,c=!s&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let p,h=e.steps[u].invert(e.docs[u]),f=new en(e.mapping.maps[u],h,n);(p=c&&c.merge(f))&&(f=p,u?i.pop():l=l.slice(0,l.length-1)),i.push(f),n&&(a++,n=void 0),s||(c=f)}let d=a-o.depth;return d>PS&&(l=function(u,p){let h;return u.forEach((f,m)=>{if(f.selection&&p--==0)return h=m,!1}),u.slice(h)}(l,d),a-=d),new Ht(l.append(i),a)}remapping(e,n){let o=new Rr;return this.items.forEach((s,i)=>{let a=s.mirrorOffset!=null&&i-s.mirrorOffset>=e?o.maps.length-s.mirrorOffset:void 0;o.appendMap(s.map,a)},e,n),o}addMaps(e){return this.eventCount==0?this:new Ht(this.items.append(e.map(n=>new en(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let o=[],s=Math.max(0,this.items.length-n),i=e.mapping,a=e.steps.length,l=this.eventCount;this.items.forEach(h=>{h.selection&&l--},s);let c=n;this.items.forEach(h=>{let f=i.getMirror(--c);if(f==null)return;a=Math.min(a,f);let m=i.maps[f];if(h.step){let g=e.steps[f].invert(e.docs[f]),v=h.selection&&h.selection.map(i.slice(c+1,f));v&&l++,o.push(new en(m,g,v))}else o.push(new en(m))},s);let d=[];for(let h=n;h<a;h++)d.push(new en(i.maps[h]));let u=this.items.slice(0,s).append(d).append(o),p=new Ht(u,l);return p.emptyItemCount()>500&&(p=p.compress(this.items.length-o.length)),p}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),o=n.maps.length,s=[],i=0;return this.items.forEach((a,l)=>{if(l>=e)s.push(a),a.selection&&i++;else if(a.step){let c=a.step.map(n.slice(o)),d=c&&c.getMap();if(o--,d&&n.appendMap(d,o),c){let u=a.selection&&a.selection.map(n.slice(o));u&&i++;let p,h=new en(d.invert(),c,u),f=s.length-1;(p=s.length&&s[f].merge(h))?s[f]=p:s.push(h)}}else a.map&&o--},this.items.length,0),new Ht(Xe.from(s.reverse()),i)}}Ht.empty=new Ht(Xe.empty,0);class en{constructor(e,n,o,s){this.map=e,this.step=n,this.selection=o,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new en(n.getMap().invert(),n,this.selection)}}}class Un{constructor(e,n,o,s,i){this.done=e,this.undone=n,this.prevRanges=o,this.prevTime=s,this.prevComposition=i}}const PS=20;function jv(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((o,s,i,a)=>e.push(i,a));return e}function dd(t,e){if(!t)return null;let n=[];for(let o=0;o<t.length;o+=2){let s=e.map(t[o],1),i=e.map(t[o+1],-1);s<=i&&n.push(s,i)}return n}let ud=!1,Fv=null;function ua(t){let e=t.plugins;if(Fv!=e){ud=!1,Fv=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){ud=!0;break}}return ud}const Co=new Ye("history"),jS=new Ye("closeHistory");function FS(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Le({key:Co,state:{init:()=>new Un(Ht.empty,Ht.empty,null,0,-1),apply:(e,n,o)=>function(s,i,a,l){let c,d=a.getMeta(Co);if(d)return d.historyState;a.getMeta(jS)&&(s=new Un(s.done,s.undone,null,0,-1));let u=a.getMeta("appendedTransaction");if(a.steps.length==0)return s;if(u&&u.getMeta(Co))return u.getMeta(Co).redo?new Un(s.done.addTransform(a,void 0,l,ua(i)),s.undone,jv(a.mapping.maps),s.prevTime,s.prevComposition):new Un(s.done,s.undone.addTransform(a,void 0,l,ua(i)),null,s.prevTime,s.prevComposition);if(a.getMeta("addToHistory")===!1||u&&u.getMeta("addToHistory")===!1)return(c=a.getMeta("rebased"))?new Un(s.done.rebased(a,c),s.undone.rebased(a,c),dd(s.prevRanges,a.mapping),s.prevTime,s.prevComposition):new Un(s.done.addMaps(a.mapping.maps),s.undone.addMaps(a.mapping.maps),dd(s.prevRanges,a.mapping),s.prevTime,s.prevComposition);{let p=a.getMeta("composition"),h=s.prevTime==0||!u&&s.prevComposition!=p&&(s.prevTime<(a.time||0)-l.newGroupDelay||!function(m,g){if(!g)return!1;if(!m.docChanged)return!0;let v=!1;return m.mapping.maps[0].forEach((k,y)=>{for(let b=0;b<g.length;b+=2)k<=g[b+1]&&y>=g[b]&&(v=!0)}),v}(a,s.prevRanges)),f=u?dd(s.prevRanges,a.mapping):jv(a.mapping.maps);return new Un(s.done.addTransform(a,h?i.selection.getBookmark():void 0,l,ua(i)),Ht.empty,f,a.time,p??s.prevComposition)}}(n,o,e,t)},config:t,props:{handleDOMEvents:{beforeinput(e,n){let o=n.inputType,s=o=="historyUndo"?Wv:o=="historyRedo"?Kv:null;return!!s&&(n.preventDefault(),s(e.state,e.dispatch))}}}})}function Hv(t,e){return(n,o)=>{let s=Co.getState(n);if(!s||(t?s.undone:s.done).eventCount==0)return!1;if(o){let i=function(a,l,c){let d=ua(l),u=Co.get(l).spec.config,p=(c?a.undone:a.done).popEvent(l,d);if(!p)return null;let h=p.selection.resolve(p.transform.doc),f=(c?a.done:a.undone).addTransform(p.transform,l.selection.getBookmark(),u,d),m=new Un(c?f:p.remaining,c?p.remaining:f,null,0,-1);return p.transform.setSelection(h).setMeta(Co,{redo:c,historyState:m})}(s,n,t);i&&o(e?i.scrollIntoView():i)}return!0}}const Wv=Hv(!1,!0),Kv=Hv(!0,!0);qe.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Le({key:new Ye("characterCount"),appendTransaction:(e,n,o)=>{if(t)return;const s=this.options.limit;if(s==null||s===0)return void(t=!0);const i=this.storage.characters({node:o.doc});if(i>s){const l=i-s;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const c=o.tr.deleteRange(0,l);return t=!0,c}t=!0},filterTransaction:(e,n)=>{const o=this.options.limit;if(!e.docChanged||o===0||o==null)return!0;const s=this.storage.characters({node:n.doc}),i=this.storage.characters({node:e.doc});if(i<=o||s>o&&i>o&&i<=s)return!0;if(s>o&&i>o&&i>s||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=a-(i-o),c=a;return e.deleteRange(l,c),!(this.storage.characters({node:e.doc})>o)}})]}});var HS=qe.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[VS(this.options)]}});qe.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new Le({key:new Ye("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:o}=this.editor,{anchor:s}=e,i=[];if(!n||!o)return Ie.create(t,[]);let a=0;this.options.mode==="deepest"&&t.descendants((c,d)=>{if(!c.isText)return s>=d&&s<=d+c.nodeSize-1&&void(a+=1)});let l=0;return t.descendants((c,d)=>!c.isText&&s>=d&&s<=d+c.nodeSize-1&&(l+=1,this.options.mode==="deepest"&&a-l>0||this.options.mode==="shallowest"&&l>1?this.options.mode==="deepest":void i.push(ht.node(d,d+c.nodeSize,{class:this.options.className})))),Ie.create(t,i)}}})]}});var WS=qe.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Le({props:{decorations:zS,createSelectionBetween:(t,e,n)=>e.pos==n.pos&&$e.valid(n)?new $e(n):null,handleClick:RS,handleKeyDown:DS,handleDOMEvents:{beforeinput:LS}}})],extendNodeSchema(t){var e;return{allowGapCursor:(e=be(te(t,"allowGapCursor",{name:t.name,options:t.options,storage:t.storage})))!=null?e:null}}});function qv({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}qe.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Le({key:new Ye("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=e,s=[];if(!n)return null;const i=this.editor.isEmpty;return t.descendants((a,l)=>{const c=o>=l&&o<=l+a.nodeSize,d=!a.isLeaf&&Si(a);if((c||!this.options.showOnlyCurrent)&&d){const u=[this.options.emptyNodeClass];i&&u.push(this.options.emptyEditorClass);const p=ht.node(l,l+a.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:c}):this.options.placeholder});s.push(p)}return this.options.includeChildren}),Ie.create(t,s)}}})]}}),qe.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Le({key:new Ye("selection"),props:{decorations:n=>n.selection.empty||t.isFocused||!t.isEditable||Gg(n.selection)||t.view.dragging?null:Ie.create(n.doc,[ht.inline(n.selection.from,n.selection.to,{class:e.className})])}})]}});var KS=qe.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var t;const e=new Ye(this.name),n=((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||this.options.node||"paragraph",o=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(n).includes(s.name));return[new Le({key:e,appendTransaction:(s,i,a)=>{const{doc:l,tr:c,schema:d}=a,u=e.getState(a),p=l.content.size,h=d.nodes[n];if(u)return c.insert(p,h.create())},state:{init:(s,i)=>!qv({node:i.tr.doc.lastChild,types:o}),apply:(s,i)=>s.docChanged?!qv({node:s.doc.lastChild,types:o}):i}})]}}),qS=qe.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>Wv(t,e),redo:()=>({state:t,dispatch:e})=>Kv(t,e)}),addProseMirrorPlugins(){return[FS(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),US=qe.create({name:"starterKit",addExtensions(){var t,e,n,o;const s=[];return this.options.bold!==!1&&s.push(YC.configure(this.options.bold)),this.options.blockquote!==!1&&s.push(KC.configure(this.options.blockquote)),this.options.bulletList!==!1&&s.push(Mv.configure(this.options.bulletList)),this.options.code!==!1&&s.push(QC.configure(this.options.code)),this.options.codeBlock!==!1&&s.push(nS.configure(this.options.codeBlock)),this.options.document!==!1&&s.push(oS.configure(this.options.document)),this.options.dropcursor!==!1&&s.push(HS.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&s.push(WS.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&s.push(rS.configure(this.options.hardBreak)),this.options.heading!==!1&&s.push(sS.configure(this.options.heading)),this.options.undoRedo!==!1&&s.push(qS.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&s.push(iS.configure(this.options.horizontalRule)),this.options.italic!==!1&&s.push(uS.configure(this.options.italic)),this.options.listItem!==!1&&s.push(Nv.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(Vv.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&s.push(bS.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&s.push(zv.configure(this.options.orderedList)),this.options.paragraph!==!1&&s.push(NS.configure(this.options.paragraph)),this.options.strike!==!1&&s.push(OS.configure(this.options.strike)),this.options.text!==!1&&s.push(_S.configure(this.options.text)),this.options.underline!==!1&&s.push(AS.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&s.push(KS.configure((o=this.options)==null?void 0:o.trailingNode)),s}}),GS=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,JS=kt.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Fe(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,o,s,i,a;const l=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",c=(s=(o=t.attrs)==null?void 0:o.alt)!=null?s:"",d=(a=(i=t.attrs)==null?void 0:i.title)!=null?a:"";return d?``:``},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[av({find:GS,type:this.type,getAttributes:t=>{const[,,e,n,o]=t;return{src:n,alt:e,title:o}}})]}});const Uv="mc-select-multi-option",YS={class:"mc-select-multi-option"},pd=X(r.defineComponent({name:Uv,__name:"mc-select-multi-option",props:{modelValue:{type:Boolean,default:!1},label:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=s=>{n("update:modelValue",s)};return(s,i)=>(r.openBlock(),r.createElementBlock("div",YS,[r.createVNode(r.unref(so),{"model-value":t.modelValue,content:t.label,"disable-validation":"",disabled:t.disabled,"onUpdate:modelValue":o},null,8,["model-value","content","disabled"])]))}})),hd="mc-select-option-plus",XS=["aria-selected"],ZS={key:1,class:"mc-select-option-label"},us=X(K(r.defineComponent({name:hd,__name:"mc-select-option-plus",props:{label:{},value:{type:[String,Number,Boolean]},height:{default:40},width:{default:"100%"},disabled:{type:Boolean}},setup(t){const e=t,{height:n,width:o}=$t(),s=r.inject(pa||void 0),i=r.computed(()=>!!Ro(s==null?void 0:s.filteredOptions.value,f=>f.value===e.value)),a=r.computed(()=>!!(s!=null&&s.isMulti.value)),l=r.computed(()=>{if(a.value){const f=s==null?void 0:s.selectedOption.value;return gt(f,e.value)}return(s==null?void 0:s.selectedOption.value)===e.value}),c=r.ref(!1),d=r.computed(()=>e.label),u=()=>{s==null||s.hover(e.value)},p=r.computed(()=>(s==null?void 0:s.hoverOption.value)===e.value),h=()=>{e.disabled||(s==null||s.select(e.value))};return(f,m)=>r.withDirectives((r.openBlock(),r.createElementBlock("li",{role:"option",class:r.normalizeClass(["mc-select-option",{"mc-select-option-actived":l.value&&!a.value,"mc-select-option-hover":p.value,"mc-select-option-disabled":t.disabled}]),style:r.normalizeStyle({height:r.unref(n),width:r.unref(o)}),"aria-selected":c.value,onMouseenter:u,onClick:h},[r.renderSlot(f.$slots,"default",{isActived:l.value,isDisabled:t.disabled},()=>[a.value?(r.openBlock(),r.createBlock(r.unref(pd),{key:0,"model-value":l.value,label:d.value,disabled:t.disabled},null,8,["model-value","label","disabled"])):(r.openBlock(),r.createElementBlock("span",ZS,r.toDisplayString(d.value),1))],!0)],46,XS)),[[r.vShow,i.value]])}}),[["__scopeId","data-v-5c070d19"]])),fd="mc-select-group-plus",QS={class:"mc-select-group"},eE={class:"mc-select-option-list"},Gv=X(K(r.defineComponent({name:fd,__name:"mc-select-group-plus",props:{label:{},height:{default:40},width:{default:"100%"}},setup(t){const e=t,n=r.inject(pa||void 0),{height:o,width:s}=$t(),i=r.computed(()=>gt(n==null?void 0:n.filteredGroups.value,e.label));return(a,l)=>r.withDirectives((r.openBlock(),r.createElementBlock("ul",QS,[r.createElementVNode("li",{class:"mc-select-group-label",style:r.normalizeStyle({height:r.unref(o),width:r.unref(s)})},r.toDisplayString(t.label),5),r.createElementVNode("li",null,[r.createElementVNode("ul",eE,[r.renderSlot(a.$slots,"default",{},void 0,!0)])])],512)),[[r.vShow,i.value]])}}),[["__scopeId","data-v-7d169727"]])),pa=Symbol("mc-select-plus-context"),Jv="mc-select-plus",Yv="mc-tag",tE={class:"mc-tag-content"},nE=r.defineComponent({name:Yv,__name:"mc-tag",props:{width:{},height:{},size:{default:"small"},type:{default:"basic"},emphasis:{default:"bold"},disabled:{type:Boolean,default:!1},deletable:{type:Boolean,default:!0},leftIcon:{},rightIcon:{},content:{}},emits:["delete","click"],setup(t,{expose:e,emit:n}){const o=t,s=n,i=r.ref(),a=()=>{o.deletable||s("click")},l=r.computed(()=>o.type==="selectable"&&o.deletable),c=()=>{o.disabled||s("delete")};return e({ref:i}),(d,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-tag",[`mc-tag-${t.size}`,`mc-tag-${t.type}`,`mc-tag-${t.emphasis}`,{"mc-tag-disabled":t.disabled}]]),ref_key:"_ref",ref:i,style:r.normalizeStyle({width:t.width,height:t.height}),onClick:a},[t.leftIcon?(r.openBlock(),r.createBlock(r.unref(ce),{key:0,name:t.leftIcon,class:"mc-tag-left-icon",size:16},null,8,["name"])):r.createCommentVNode("",!0),r.createElementVNode("div",tE,[r.renderSlot(d.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)]),t.rightIcon?(r.openBlock(),r.createBlock(r.unref(ce),{key:1,name:t.rightIcon,class:"mc-tag-right-icon",size:16},null,8,["name"])):r.createCommentVNode("",!0),l.value?(r.openBlock(),r.createBlock(r.unref(ce),{key:2,name:"Cross",class:"mc-tag-delete-icon",size:16,onClick:r.withModifiers(c,["stop"])})):r.createCommentVNode("",!0)],6))}}),ha=X(K(nE,[["__scopeId","data-v-044d14e5"]])),oE=["id","placeholder","readonly","disabled","onKeydown"],rE={key:0,class:"mc-select-multi-options-wrapper"},sE={key:1,class:"mc-select-selected-content-wrapper"},iE={key:1,class:"mc-select-placeholder"},aE={key:0,class:"mc-select-status-icon-wrapper"},lE={key:0,class:"mc-select-dropdown-header-content"},cE={key:0,class:"mc-select-empty"},dE=r.defineComponent({name:Jv,__name:"mc-select-plus",props:{width:{default:320},height:{default:40},placeholder:{default:"Please select"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},maxTags:{},search:{type:Boolean,default:!1},options:{},showHeader:{type:Boolean,default:!1},showFooter:{type:Boolean,default:!1},modelValue:{type:[String,Number,Boolean,Array]},placement:{default:"bottom-start"},inputGroupPosition:{},disableValidation:{type:Boolean,default:!1},hideValidationIcon:{type:Boolean,default:!1},validateProp:{}},emits:["update:modelValue","change","focus","blur","expand"],setup(t,{emit:e}){const n=t,o=e,s=r.computed(()=>n.multiple),i=r.ref(),{wrapperRef:a,isFocused:l,handleFocus:c,handleBlur:d}=$o(i,{afterBlur:async()=>{await Ga(300),await _("blur")}}),{isHovering:u}=Tp(a),{selectRef:p,width:h,height:f}=(()=>{const D=r.ref(),{width:W,height:ee}=$t(),ve=()=>{D.value&&(D.value.style.setProperty("--mc-select-width",W.value||"auto"),D.value.style.setProperty("--mc-select-height",ee.value||"auto"))};return r.onMounted(()=>{ve()}),r.watch(()=>W.value,()=>ve()),{selectRef:D,width:W,height:ee,setWidth:ve}})(),{selectOptions:m}=(()=>{let D=[];const W=r.ref([]),ee=r.getCurrentInstance().proxy;return r.watchEffect(()=>{var ye,Re;const ve=(Re=(ye=ee.$slots).default)==null?void 0:Re.call(ye);if(ve.length){const Ae=(He=>{const Pe=[],mt=(tn,ps)=>{de(tn)&&tn.forEach(Ze=>{var xn,Wt,fs,nn,Cn,ms,oy,ry;const hs=(xn=(Ze==null?void 0:Ze.type)||{})==null?void 0:xn.name;if(hs===fd){const eT=Lo(Ze.children)||de(Ze.children)||!Ve((Wt=Ze.children)==null?void 0:Wt.default)?Ze.children:(fs=Ze.children)==null?void 0:fs.default();mt(eT,(nn=Ze.props)==null?void 0:nn.label)}else hs===hd?Pe.push({label:(Cn=Ze.props)==null?void 0:Cn.label,value:(ms=Ze.props)==null?void 0:ms.value,disabled:(oy=Ze.props)==null?void 0:oy.disabled,group:ps,context:(ry=Ze.children)==null?void 0:ry.default}):Array.isArray(Ze.children)&&mt(Ze.children,ps)})};return mt(He),Pe})(ve);W.value.push(...Ae)}((Ae,He)=>{if(Ae.length!==He.length)return!1;for(const[Pe]of Ae.entries())if(Ae[Pe]!=He[Pe])return!1;return!0})(W.value,D)||(D=W.value)}),{selectOptions:W}})(),{searchValue:g,isSearch:v,hasSearchValue:k,filteredOptions:y,filteredGroups:b,clearSearchValue:x}=(D=>{const W=r.ref(""),ee=ke("search"),ve=r.computed(()=>!!ee.value),ye=r.computed(()=>ve.value&&!Ct(W.value)),Re=r.computed(()=>D!=null&&D.value.length?Mn(br(D.value,He=>gt(Ep(He.label),Ep(W.value))),He=>({value:He.value,group:He.group})):[]),Ae=r.computed(()=>{return Re.value.length?Mn((He=Re.value)&&He.length?function(Pe,mt){var tn=-1,ps=ba,Ze=Pe.length,hs=!0,xn=[],Wt=xn;if(Ze>=200){var fs=mt?null:Yk(Pe);if(fs)return ja(fs);hs=!1,ps=Pa,Wt=new Do}else Wt=mt?[]:xn;e:for(;++tn<Ze;){var nn=Pe[tn],Cn=mt?mt(nn):nn;if(nn=nn!==0?nn:0,hs&&Cn==Cn){for(var ms=Wt.length;ms--;)if(Wt[ms]===Cn)continue e;mt&&Wt.push(Cn),xn.push(nn)}else ps(Wt,Cn,void 0)||(Wt!==xn&&Wt.push(Cn),xn.push(nn))}return xn}(He,En("group")):[],Pe=>Pe.group):[];var He});return{searchValue:W,isSearch:ve,hasSearchValue:ye,filteredOptions:Re,filteredGroups:Ae,clearSearchValue:()=>{W.value=""}}})(m),{hoverOption:w,setHoverOption:C,handlePressArrow:S,clearHoverOption:E}=(D=>{const W=r.ref(),ee=()=>{W.value=void 0};return{hoverOption:W,setHoverOption:ve=>{W.value=ve},handlePressArrow:ve=>{var Re,Ae,He,Pe,mt;if(!(D!=null&&D.value.length))return void ee();if(!W.value)return void(W.value=(Re=D.value[0])==null?void 0:Re.value);const ye=an(D==null?void 0:D.value,tn=>tn.value===W.value);ve.key==="ArrowDown"?W.value=((Ae=D.value[ye+1])==null?void 0:Ae.value)||((He=D.value[0])==null?void 0:He.value):ve.key==="ArrowUp"&&(W.value=((Pe=D.value[ye-1])==null?void 0:Pe.value)||((mt=D.value[D.value.length-1])==null?void 0:mt.value))},clearHoverOption:ee}})(y),{formId:M,formDisabled:N,validateStatus:T,validateStyle:R,statusIcon:z,validateByTrigger:_}=cn(),{isDisabled:I}=((D,W)=>{const ee=r.inject(Vr,void 0),ve=r.computed(()=>!!D.value||!!(ee!=null&&ee.disabled.value));return r.watch(ve,ye=>{ye&&Ve(W)&&W()}),{isDisabled:ve}})(N,()=>{A(!1),x()}),{isExpanded:O,popperRef:V,popperOptions:P,toggleExpand:A}=(D=>{const W=r.ref(!1),ee=r.getCurrentInstance(),{emit:ve}=ee,ye=r.ref(),Re=r.inject(Vr,void 0),Ae=ke("inputGroupPosition"),He={modifiers:[{name:"offset",options:{offset:[r.computed(()=>Re&&Ae.value?Ae.value==="prefix"?-1:Ae.value==="suffix"?1:0:0).value,0]}}]};return r.watch(W,Pe=>{var mt,tn;Pe?(mt=ye.value)==null||mt.show():(tn=ye.value)==null||tn.hide()}),{isExpanded:W,popperRef:ye,popperOptions:He,toggleExpand:Pe=>{D.value?W.value=!1:W.value=Pe,ve("expand",Pe)}}})(I),{showClearIcon:L,mouseOverIcon:j,clear:q}=((D,W)=>{const ee=r.ref(!1),ve=ke("clearable");return{showClearIcon:r.computed(()=>!!ve.value&&ee.value&&!W.value),mouseOverIcon:ye=>{ee.value=ye},clear:()=>{Ve(D)&&D()}}})(async()=>{I.value||(H.value=s.value?[]:void 0,x(),A(!1),we(),await r.nextTick(),_("input"))},I);Lh({validateStatus:T,isExpanded:O,isFocused:l,isHovering:u}),$s(p,()=>{x(),A(!1)}),r.onMounted(()=>{H.value=n.modelValue}),r.watch(()=>n.modelValue,D=>{H.value=D});const H=r.ref(),U=r.computed(()=>{if(s.value){const D=n.maxTags,W=H.value;if(Ls(D)){const ee=W.length-D,ve=[];for(let ye=0;ye<D&&ye<W.length;ye++){const Re=W[ye];ve.push({label:`${Q(Re)}`,item:Re,selectable:!0})}return ee>0&&ve.push({label:`+${ee}`,item:"rest",selectable:!1}),ve}return Mn(W,ee=>({label:`${Q(ee)}`,item:ee,selectable:!0}))}return[]}),Y=r.computed(()=>{var D;return s.value?(D=H.value)==null?void 0:D.map(W=>Q(W)):Q(H.value)}),J=r.computed(()=>y.value.length>0),Q=D=>{const W=Ro(m.value,ee=>ee.value===D);return(W==null?void 0:W.label)||(W==null?void 0:W.value)},oe=async D=>{if(x(),!I.value){if(s.value){const W=H.value;gt(W,D)?H.value=cp(W,[D]):H.value=[...W,D]}else H.value=D;s.value||A(!1),we(),await r.nextTick(),_("input")}},fe=r.computed(()=>{if(!s.value){const D=Ro(m.value,W=>W.value===H.value);return D!=null&&D.context?D.context:r.h("span",{class:"mc-selected-option-label",style:{color:"inherit"}},(D==null?void 0:D.label)||(D==null?void 0:D.value))}}),le=r.computed(()=>!k.value&&!!H.value),me=r.computed(()=>!!n.placeholder&&!k.value&&ge.value),Be=r.computed(()=>l.value?"minimal":"bold");r.watch(O,()=>{E()});const Z=()=>{A(!O.value)},se=()=>{E(),A(!0)},ae=()=>{O.value?w.value?oe(w.value):s.value||A(!1):A(!0)},{isSelectAll:re,isSelectPartial:Ce,selectAll:nt}=((D,W,ee,ve)=>{const ye=r.ref(!1),Re=r.ref(!1);return r.watchEffect(()=>{var He,Pe;if(!D.value)return;const Ae=W.value;Ae!=null&&Ae.length&&((He=ee.value)!=null&&He.length)&&(Ae==null?void 0:Ae.length)===((Pe=ee.value)==null?void 0:Pe.length)?ye.value=!0:(Ae==null?void 0:Ae.length)>0?(ye.value=!1,Re.value=!0):(ye.value=!1,Re.value=!1)}),{isSelectAll:ye,isSelectPartial:Re,selectAll:()=>{D.value&&Ve(ve)&&ve()}}})(s,H,m,()=>{re.value?H.value=m.value.map(D=>D.value):H.value=[],we()}),Oe=r.ref([]);r.watch(O,()=>{O.value&&s.value&&(Oe.value=H.value)});const _e=()=>{s.value&&(H.value=Oe.value,we())},ue=()=>{s.value&&A(!1)},ge=r.computed(()=>{var D;return s.value?((D=H.value)==null?void 0:D.length)<=0:!H.value}),at=r.computed(()=>L.value&&!ge.value),ft=r.computed(()=>I.value?"not-allowed":v.value?"text":"pointer"),we=()=>{o("update:modelValue",H.value),o("change",H.value)};return r.provide(pa,{isMulti:s,selectedOption:H,filteredOptions:y,filteredGroups:b,hoverOption:w,select:oe,hover:C}),(D,W)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"selectRef",ref:p,class:r.normalizeClass(["mc-select",{"mc-select-expanded":r.unref(O)}])},[r.createVNode(r.unref(Ws),{ref_key:"popperRef",ref:V,placement:t.placement,trigger:"manual",class:"mc-select-popper",style:r.normalizeStyle({width:r.unref(h)}),"show-arrow":!1,"popper-options":r.unref(P),"hide-timeout":100},{default:r.withCtx(()=>[r.createElementVNode("div",{ref_key:"triggerRef",ref:a,class:r.normalizeClass(["mc-select-trigger",{"mc-select-trigger-focused":r.unref(l),"mc-select-trigger-disabled":r.unref(I),"mc-select-trigger-hovering":r.unref(u),[r.unref(R)]:r.unref(R)}]),style:r.normalizeStyle({width:r.unref(h),height:r.unref(f)}),onClick:Z},[r.createElementVNode("div",{class:"mc-select-input-wrapper",style:r.normalizeStyle({cursor:ft.value})},[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":W[0]||(W[0]=ee=>r.isRef(g)?g.value=ee:null),ref_key:"inputRef",ref:i,id:r.unref(M),class:"mc-select-input",style:r.normalizeStyle({width:r.unref(k)?"100%":"1px"}),placeholder:t.placeholder,readonly:!r.unref(v)||r.unref(I),disabled:r.unref(I),onFocus:W[1]||(W[1]=(...ee)=>r.unref(c)&&r.unref(c)(...ee)),onBlur:W[2]||(W[2]=(...ee)=>r.unref(d)&&r.unref(d)(...ee)),onInput:se,onKeydown:[r.withKeys(r.withModifiers(ae,["stop"]),["enter"]),W[3]||(W[3]=r.withKeys(r.withModifiers((...ee)=>r.unref(S)&&r.unref(S)(...ee),["stop"]),["arrow-down"])),W[4]||(W[4]=r.withKeys(r.withModifiers((...ee)=>r.unref(S)&&r.unref(S)(...ee),["stop"]),["arrow-up"]))]},null,44,oE),[[r.vModelText,r.unref(g)]]),le.value?r.renderSlot(D.$slots,"selected-content",{key:0,selectedOption:H.value,selectedOptionLabel:Y.value,isDisabled:r.unref(I)},()=>[s.value?(r.openBlock(),r.createElementBlock("ul",rE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(U.value,ee=>(r.openBlock(),r.createElementBlock("li",{key:`${ee.item}`,class:"mc-select-multi-option"},[r.createVNode(r.unref(ha),{size:"x-small",type:"selectable",deletable:ee.selectable,emphasis:Be.value,disabled:r.unref(I),onDelete:ve=>(ye=>{const Re=H.value;H.value=cp(Re,[ye]),we()})(ee.item)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(ee.label),1)]),_:2},1032,["deletable","emphasis","disabled","onDelete"])]))),128))])):(r.openBlock(),r.createElementBlock("div",sE,[fe.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(fe.value),{key:H.value})):r.createCommentVNode("",!0)]))],!0):r.createCommentVNode("",!0),me.value?(r.openBlock(),r.createElementBlock("p",iE,[r.renderSlot(D.$slots,"placeholder",{},()=>[r.createTextVNode(r.toDisplayString(t.placeholder),1)],!0)])):r.createCommentVNode("",!0)],4),r.unref(z)?(r.openBlock(),r.createElementBlock("div",aE,[r.unref(z)?(r.openBlock(),r.createBlock(r.unref(ce),{key:0,name:r.unref(z),size:24},null,8,["name"])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"mc-select-icon-wrapper",onMouseenter:W[5]||(W[5]=ee=>r.unref(j)(!0)),onMouseleave:W[6]||(W[6]=ee=>r.unref(j)(!1))},[r.withDirectives(r.createVNode(r.unref(ce),{name:"Reject",size:20,class:"mc-select-clear-icon",onClick:r.withModifiers(r.unref(q),["stop"])},null,8,["onClick"]),[[r.vShow,at.value]]),r.withDirectives(r.createVNode(r.unref(ce),{name:"Down-Chevron",size:24,class:r.normalizeClass(["mc-select-chevron-icon",{"mc-select-chevron-icon-rotate":r.unref(O)}])},null,8,["class"]),[[r.vShow,!at.value]])],32)],6)]),content:r.withCtx(()=>[J.value&&t.showHeader?(r.openBlock(),r.createBlock(r.unref(Ar),{key:0,class:"mc-select-dropdown-header","show-tool-bar":!1,height:"40px"},{default:r.withCtx(()=>[r.renderSlot(D.$slots,"option-header",{},()=>[s.value?(r.openBlock(),r.createElementBlock("div",lE,[r.createVNode(r.unref(so),{modelValue:r.unref(re),"onUpdate:modelValue":W[7]||(W[7]=ee=>r.isRef(re)?re.value=ee:null),content:"Select All","form-validate":!1,partial:r.unref(Ce),onChange:r.unref(nt)},null,8,["modelValue","partial","onChange"])])):r.createCommentVNode("",!0)],!0)]),_:3})):r.createCommentVNode("",!0),r.createElementVNode("ul",{class:"mc-select-list",style:r.normalizeStyle({paddingTop:t.showHeader?"40px":"0",paddingBottom:t.showFooter?"48px":"0"})},[r.renderSlot(D.$slots,"default",{},void 0,!0),J.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("li",cE,[r.renderSlot(D.$slots,"empty",{},()=>[W[8]||(W[8]=r.createElementVNode("p",{class:"mc-select-text"},"No results found",-1))],!0)]))],4),J.value&&t.showFooter?(r.openBlock(),r.createBlock(r.unref(Go),{key:1,class:"mc-select-dropdown-footer"},{"right-button-group":r.withCtx(()=>[r.renderSlot(D.$slots,"option-footer",{},()=>[s.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createVNode(r.unref(to),{type:"link",size:"small",onClick:_e},{default:r.withCtx(()=>[...W[9]||(W[9]=[r.createTextVNode(" Reset ",-1)])]),_:1}),r.createVNode(r.unref(to),{type:"plain",size:"small",onClick:ue},{default:r.withCtx(()=>[...W[10]||(W[10]=[r.createTextVNode(" Apply ",-1)])]),_:1})],64)):r.createCommentVNode("",!0)],!0)]),_:3})):r.createCommentVNode("",!0)]),_:3},8,["placement","style","popper-options"])],2))}}),md=X(K(dE,[["__scopeId","data-v-e971c45f"]])),Xv="McRichtext",Zv="McRichtextTool";var Ne=(t=>(t.NORMAL="normal",t.SMALL="small",t.FOOTNOTE="footnote",t.BOLD="bold",t.ITALIC="italic",t.LIST="list",t.ORDERED_LIST="numbering",t.LINK="link",t.IMAGE="document-image",t.CLEAR="input-reset",t))(Ne||{}),So=(t=>(t.NORMAL="mc-richtext-normal-text",t.SMALL="mc-richtext-small-text",t.FOOTNOTE="mc-richtext-footnote",t))(So||{});const Eo=K(r.defineComponent({name:Zv,__name:"mc-richtext-tool",props:{icon:{},isActive:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:e}){const n=e;return(o,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-richtext-tool",{"mc-richtext-tool-icon-actived":t.isActive}])},[r.renderSlot(o.$slots,"default",{isActive:t.isActive},()=>[(r.openBlock(),r.createBlock(fh,{class:"mc-richtext-tool-icon",key:t.icon,name:t.icon,size:24,cursor:"pointer",onClick:s[0]||(s[0]=i=>{return a=t.icon,void n("click",a);var a})},null,8,["name"]))],!0)],2))}}),[["__scopeId","data-v-341e9121"]]),uE=Hn.create({name:"custom-font",addAttributes:()=>({class:{default:null,parseHTML:t=>t.getAttribute("class"),renderHTML:t=>t.class?{class:t.class}:{}}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("class")&&null}],renderHTML:({HTMLAttributes:t})=>["span",t,0]}),pE={class:"mc-richtext-toolbar"},hE={class:"mc-richtext-font-selector"},fE={class:"mc-richtext-tool-group"},mE={class:"mc-richtext-tool-group"},gE={class:"mc-richtext-tool-group"},vE={class:"mc-richtext-attach-link"},yE=r.defineComponent({name:Xv,__name:"mc-richtext",props:{modelValue:{default:""},width:{default:"100%"},height:{}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const o=t,s=n,i=r.ref(),{width:a,height:l}=$t(),c=((M={})=>{const N=r.shallowRef();return r.onMounted(()=>{N.value=new FC(M)}),r.onBeforeUnmount(()=>{var T,R,z;const _=(T=N.value)==null?void 0:T.view.dom,I=_==null?void 0:_.cloneNode(!0);(R=_==null?void 0:_.parentNode)==null||R.replaceChild(I,_),(z=N.value)==null||z.destroy()}),N})({content:`${o.modelValue}`,extensions:[US,JS.configure({inline:!0,allowBase64:!0}),uE],onUpdate:({editor:M})=>{s("update:modelValue",M.getHTML())}});r.watch(()=>o.modelValue,M=>{const N=c.value,T=N==null?void 0:N.getHTML();N&&T!==M&&N.commands.setContent(M)});const d=r.ref(Ne.NORMAL),u=M=>{M===Ne.NORMAL?p():M===Ne.SMALL?h():M===Ne.FOOTNOTE?f():M===Ne.BOLD?m():M===Ne.ITALIC?g():M===Ne.LIST?v():M===Ne.ORDERED_LIST?k():M===Ne.LINK?w():M===Ne.IMAGE?C():M===Ne.CLEAR&&E()},p=()=>{var M;(M=c.value)==null||M.commands.setMark("custom-font",{class:So.NORMAL})},h=()=>{var M;(M=c.value)==null||M.commands.setMark("custom-font",{class:So.SMALL})},f=()=>{var M;(M=c.value)==null||M.commands.setMark("custom-font",{class:So.FOOTNOTE})},m=()=>{var M;(M=c.value)==null||M.commands.toggleBold()},g=()=>{var M;(M=c.value)==null||M.commands.toggleItalic()},v=()=>{var M;(M=c.value)==null||M.commands.toggleList("bulletList","listItem")},k=()=>{var M;(M=c.value)==null||M.commands.toggleList("orderedList","listItem")};r.watchEffect(()=>{const M=c.value;if(!M)return;const N=M.getAttributes("custom-font").class;N===So.SMALL?d.value=Ne.SMALL:N===So.FOOTNOTE?d.value=Ne.FOOTNOTE:d.value=Ne.NORMAL});const y=r.ref(),b=r.ref(""),x=()=>{var M;b.value=((M=c.value)==null?void 0:M.getAttributes("link").href)||""},w=()=>{var N,T,R;const M=b.value;M?((N=c.value)==null||N.commands.setLink({href:M}),b.value=""):((T=c.value)==null||T.commands.unsetLink(),b.value=""),(R=y.value)==null||R.hide()},C=()=>{var M;(M=i.value)==null||M.click()},S=M=>{var z;const N=M.target,T=(z=N.files)==null?void 0:z[0];if(!T||!T.type.startsWith("image/"))return;const R=new FileReader;R.onload=_=>{var O,V;const I=(O=_.target)==null?void 0:O.result;I&&((V=c.value)==null||V.commands.setImage({src:I}))},R.onerror=()=>{console.error("mc-richtext: error:read:image:",T.name)},R.readAsDataURL(T),N.value=""},E=()=>{var M;(M=c.value)==null||M.chain().focus().unsetAllMarks().clearNodes().run()};return e({editor:c.value,getText:()=>{var M;return(M=c.value)==null?void 0:M.getText()}}),(M,N)=>{var T,R,z,_,I,O;return r.openBlock(),r.createElementBlock("div",{class:"mc-richtext",style:r.normalizeStyle({width:r.unref(a),height:r.unref(l)})},[r.createElementVNode("section",pE,[r.createElementVNode("div",hE,[r.createVNode(r.unref(md),{modelValue:d.value,"onUpdate:modelValue":N[0]||(N[0]=V=>d.value=V),width:148,height:32,"disable-validation":"",onChange:N[1]||(N[1]=V=>u(V))},{"selected-content":r.withCtx(({selectedOptionLabel:V})=>[r.createElementVNode("span",{class:r.normalizeClass(["mc-richtext-font-selected",`mc-richtext-font-${d.value}`])},r.toDisplayString(V),3)]),default:r.withCtx(()=>[r.createVNode(r.unref(us),{value:r.unref(Ne).NORMAL,label:"Normal text"},{default:r.withCtx(()=>[...N[4]||(N[4]=[r.createElementVNode("span",{class:"mc-richtext-font-normal"},"Normal text",-1)])]),_:1},8,["value"]),r.createVNode(r.unref(us),{value:r.unref(Ne).SMALL,label:"Small text"},{default:r.withCtx(()=>[...N[5]||(N[5]=[r.createElementVNode("span",{class:"mc-richtext-font-small"},"Small text",-1)])]),_:1},8,["value"]),r.createVNode(r.unref(us),{value:r.unref(Ne).FOOTNOTE,label:"Footnote"},{default:r.withCtx(()=>[...N[6]||(N[6]=[r.createElementVNode("span",{class:"mc-richtext-font-footnote"},"Footnote",-1)])]),_:1},8,["value"])]),_:1},8,["modelValue"])]),r.createElementVNode("div",fE,[r.createVNode(Eo,{icon:r.unref(Ne).BOLD,"is-active":!!((T=r.unref(c))!=null&&T.isActive("bold")),onClick:u},null,8,["icon","is-active"]),r.createVNode(Eo,{icon:r.unref(Ne).ITALIC,"is-active":!!((R=r.unref(c))!=null&&R.isActive("italic")),onClick:u},null,8,["icon","is-active"])]),r.createElementVNode("div",mE,[r.createVNode(Eo,{icon:r.unref(Ne).LIST,"is-active":!!((z=r.unref(c))!=null&&z.isActive("bulletList")),onClick:u},null,8,["icon","is-active"]),r.createVNode(Eo,{icon:r.unref(Ne).ORDERED_LIST,"is-active":!!((_=r.unref(c))!=null&&_.isActive("orderedList")),onClick:u},null,8,["icon","is-active"])]),r.createElementVNode("div",gE,[r.createVNode(Eo,{icon:r.unref(Ne).LINK,"is-active":!!((I=r.unref(c))!=null&&I.isActive("link"))},{default:r.withCtx(()=>[r.createVNode(r.unref(Uo),{placement:"bottom-start",trigger:"click",ref_key:"linkTooltipRef",ref:y},{content:r.withCtx(()=>[r.createElementVNode("div",vE,[r.createVNode(r.unref(bl),{modelValue:b.value,"onUpdate:modelValue":N[2]||(N[2]=V=>b.value=V),placeholder:"Please enter the URL"},null,8,["modelValue"]),r.createVNode(r.unref(to),{width:"180px",onClick:N[3]||(N[3]=V=>u("link"))},{default:r.withCtx(()=>[...N[7]||(N[7]=[r.createTextVNode(" Attach ",-1)])]),_:1})])]),default:r.withCtx(()=>[r.createVNode(r.unref(Bn),{name:"link",cursor:"pointer",class:"mc-richtext-tool-icon-link",onClick:x})]),_:1},512)]),_:1},8,["icon","is-active"]),r.createVNode(Eo,{icon:r.unref(Ne).IMAGE,"is-active":!!((O=r.unref(c))!=null&&O.isActive("image")),onClick:u},null,8,["icon","is-active"])]),r.createVNode(Eo,{icon:r.unref(Ne).CLEAR,onClick:u},null,8,["icon"])]),r.createVNode(r.unref(HC),{editor:r.unref(c),class:"mc-richtext-content"},null,8,["editor"]),r.createElementVNode("input",{ref_key:"fileInputRef",ref:i,type:"file",accept:"image/*",style:{display:"none"},"aria-hidden":"true",onChange:S},null,544)],4)}}}),Qv=X(K(yE,[["__scopeId","data-v-c216489d"]])),e0="mc-secondary-menu",kE={class:"mc-secondary-menu"},bE=["onClick"],wE={class:"mc-secondary-menu-item-content"},xE=r.defineComponent({name:e0,__name:"mc-secondary-menu",props:{modelValue:{},options:{default:()=>[]}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,s=r.ref(),i=r.ref(),a=r.computed(()=>{const c=[];return n.options.forEach(d=>{c.push(d),d.children&&d.children.forEach(u=>{c.push({...u,parent:d.name})})}),c});r.onMounted(()=>{n.modelValue&&l(n.modelValue),setTimeout(()=>{i.value&&(i.value.style.transition="top 0.3s ease-in-out")})}),r.watch(()=>n.modelValue,()=>{n.modelValue&&l(n.modelValue)});const l=c=>{const d=an(a.value,{name:c});if(d<0||!i.value||!s.value)return;const u=Array.from(s.value.children),{top:p}=s.value.getBoundingClientRect(),{top:h}=u[d].getBoundingClientRect();i.value.style.top=h-p+"px"};return(c,d)=>(r.openBlock(),r.createElementBlock("div",kE,[r.createElementVNode("div",{class:"mc-secondary-menu-wrapper",ref_key:"wrapperRef",ref:s},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,u=>{var p;return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-secondary-menu-item",{"mc-secondary-menu-item-actived":t.modelValue===u.name,"mc-secondary-menu-item-parent":!!((p=u.children)!=null&&p.length),"mc-secondary-menu-item-child":!!u.parent}]),key:u.name,onClick:h=>{var m;return f=u,void(((m=f.children)==null?void 0:m.length)||(o("update:modelValue",f.name),o("change",f.name)));var f}},[r.createElementVNode("div",wE,r.toDisplayString(u.label),1)],10,bE)}),128)),r.createElementVNode("div",{class:"mc-secondary-menu-success-line",ref_key:"successLineRef",ref:i},null,512)],512)]))}}),t0=X(K(xE,[["__scopeId","data-v-965d2cfc"]])),fa=Symbol("mc-select-context"),n0="mc-select",CE={key:0,class:"mc-select-selected-content"},SE=["placeholder","readonly","disabled"],EE={class:"mc-select-dropdown-header-content"},ME={class:"mc-select-dropdown-content"},NE={class:"mc-select-dropdown"},BE={key:0,class:"mc-select-no-data"},TE=r.defineComponent({name:n0,__name:"mc-select",props:{modelValue:{},placeholder:{default:"Please select"},disabled:{type:Boolean},multiple:{type:Boolean,default:!1},width:{},height:{},search:{type:Boolean},allowReset:{type:Boolean,default:!0},allowSelectAll:{type:Boolean,default:!0}},emits:["update:modelValue","change","blur","focus","reset"],setup(t,{emit:e}){const n=t,o=e,s=r.ref(),i=r.ref(),a=r.ref(),l=r.computed(()=>n.multiple),c=J=>l.value&&Array.isArray(J),d=r.ref([]),u=r.computed(()=>xe(P.value)?d.value:d.value.filter(J=>gp(qt(J.label??J.value)).includes(gp(P.value)))),{wrapperRef:p,isFocused:h,handleFocus:f,handleBlur:m}=$o(s,{}),g=r.computed(()=>u.value.length===0),v=r.computed(()=>l.value&&n.allowSelectAll&&!g.value),k=r.computed(()=>l.value&&n.allowReset&&!g.value),y=r.ref(!1),b=()=>{y.value=!y.value},x=()=>c(n.modelValue)?[...n.modelValue]:[n.modelValue],w=r.ref(x());r.watch(()=>n.modelValue,()=>{w.value=x()});const C=r.computed(()=>br(d.value,J=>gt(w.value,J.value))),S=r.computed(()=>{var J;return l.value||(J=C.value)==null?void 0:J[0]}),E=r.computed(()=>l.value?Mn(C.value,J=>({label:J.label??"",value:J.value})):[]),M=r.computed(()=>h.value||q.value?"minimal":"bold"),N=r.computed(()=>""),T=r.computed(()=>N.value==="error"),R=r.computed(()=>N.value==="success"),z=r.computed(()=>!n.disabled&&(T.value||R.value));let _=[];const I=()=>{o("update:modelValue",[..._]),o("change",[..._])},O=()=>{y.value=!1,o("change",[...n.modelValue])},V=r.computed(()=>{var J;return c(n.modelValue)?!((J=n.modelValue)!=null&&J.length):!n.modelValue}),P=r.ref(""),A=()=>{y.value=!0},L=r.computed(()=>n.search&&P.value.length>0),j=r.computed(()=>({width:n.width??void 0,height:n.height??void 0}));$s(p,()=>{y.value=!1}),r.watch(()=>y.value,J=>{J?l.value&&(_=[...n.modelValue]):setTimeout(()=>{P.value=""},300)},{flush:"post"});const q=r.ref(!1),H=r.ref(!1);r.watch(()=>n.modelValue,J=>{c(J)?H.value=J.length===d.value.length:H.value=!1});const U=r.computed(()=>!!c(n.modelValue)&&n.modelValue.length>0&&n.modelValue.length<d.value.length),Y=J=>{o("update:modelValue",J?d.value.map(Q=>Q.value):[])};return r.provide(fa,{filterOptions:u,selectValues:w,handleSelect:J=>{c(n.modelValue)?(Q=>{const oe=[...n.modelValue];gt(oe,Q.value)?oe.splice(oe.indexOf(Q.value),1):oe.push(Q.value),o("update:modelValue",oe)})(J):(Q=>{y.value=!1,o("update:modelValue",Q.value),o("change",Q.value)})(J)},removeOption:J=>{d.value=d.value.filter(Q=>Q.value!==J.value)},addOption:J=>{d.value.push(J)}}),(J,Q)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-select",[y.value&&!t.disabled?"mc-select-expand":"mc-select-collapse",{"mc-select-disabled":t.disabled,"mc-input-focused":r.unref(h)&&t.search,[`mc-select--${N.value}`]:N.value,"mc-select--hover":q.value}]]),ref_key:"wrapperRef",ref:p,style:r.normalizeStyle(j.value),onMouseenter:Q[4]||(Q[4]=oe=>q.value=!0),onMouseleave:Q[5]||(Q[5]=oe=>q.value=!1)},[r.createElementVNode("div",{class:"mc-select-trigger",onClick:b,ref_key:"triggerRef",ref:a},[C.value.length&&!L.value?(r.openBlock(),r.createElementBlock("div",CE,[l.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:"mc-select-multi-wrapper",ref_key:"tagsWrapperRef",ref:i},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(E.value,oe=>(r.openBlock(),r.createBlock(r.unref(ha),{key:oe.value,size:"x-small",type:"selectable",emphasis:M.value,disabled:t.disabled,onDelete:fe=>(le=>{if(c(n.modelValue)){const me=[...n.modelValue];me.splice(me.indexOf(le.value),1),o("update:modelValue",me)}})(oe)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(oe.label),1)]),_:2},1032,["emphasis","disabled","onDelete"]))),128))],512)):(r.openBlock(),r.createBlock(r.resolveDynamicComponent(S.value._vnode),{key:S.value.value}))])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["mc-select-input-wrapper",{"mc-select-input-wrapper-search":L.value||V.value}])},[r.withDirectives(r.createElementVNode("input",{class:r.normalizeClass(["mc-select-input",{"mc-select-input-readonly":!t.search}]),ref_key:"inputRef",ref:s,type:"text",placeholder:V.value?t.placeholder:"","onUpdate:modelValue":Q[0]||(Q[0]=oe=>P.value=oe),onInput:A,onFocus:Q[1]||(Q[1]=(...oe)=>r.unref(f)&&r.unref(f)(...oe)),onBlur:Q[2]||(Q[2]=(...oe)=>r.unref(m)&&r.unref(m)(...oe)),readonly:!t.search,disabled:t.disabled},null,42,SE),[[r.vModelText,P.value]])],2),z.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mc-select__status",[T.value?"mc-select__status--error":"mc-select__status--success"]])},[r.createVNode(r.unref(ce),{name:T.value?"Reject_02":"Accept_02",size:24},null,8,["name"])],2)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["mc-select-icon-wrapper",{"mc-select-icon-wrapper-expand":y.value&&!t.disabled}])},[r.createVNode(r.unref(ce),{name:"Down-Chevron",class:"mc-select-icon"})],2)],512),r.createVNode(r.Transition,{name:"mc-select-dropdown-transition"},{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",{class:"mc-select-dropdown-wrapper",style:r.normalizeStyle({paddingTop:v.value?"40px":"0",paddingBottom:k.value?"48px":"0"})},[v.value?(r.openBlock(),r.createBlock(r.unref(Ar),{key:0,class:"mc-select-dropdown-header","show-tool-bar":!1,height:"40px"},{default:r.withCtx(()=>[r.createElementVNode("div",EE,[r.createVNode(r.unref(so),{modelValue:H.value,"onUpdate:modelValue":Q[3]||(Q[3]=oe=>H.value=oe),content:"Select All","form-validate":!1,partial:U.value,onChange:Y},null,8,["modelValue","partial"])])]),_:1})):r.createCommentVNode("",!0),r.createElementVNode("div",ME,[r.createElementVNode("div",NE,[r.renderSlot(J.$slots,"default",{},void 0,!0),g.value?(r.openBlock(),r.createElementBlock("div",BE,[r.renderSlot(J.$slots,"empty",{},()=>[Q[6]||(Q[6]=r.createTextVNode("No data",-1))],!0)])):r.createCommentVNode("",!0)])]),k.value?(r.openBlock(),r.createBlock(r.unref(Go),{key:1,class:"mc-select-dropdown-footer"},{"right-button-group":r.withCtx(()=>[r.createVNode(r.unref(to),{type:"link",size:"small",onClick:I},{default:r.withCtx(()=>[...Q[7]||(Q[7]=[r.createTextVNode(" Reset ",-1)])]),_:1}),r.createVNode(r.unref(to),{type:"plain",size:"small",onClick:O},{default:r.withCtx(()=>[...Q[8]||(Q[8]=[r.createTextVNode(" Apply ",-1)])]),_:1})]),_:1})):r.createCommentVNode("",!0)],4),[[r.vShow,y.value&&!t.disabled]])]),_:3})],38))}}),o0=X(K(TE,[["__scopeId","data-v-0096011b"]])),gd=Symbol("mc-select-group-context"),r0="mc-select-group",OE={class:"mc-select-group"},_E={class:"mc-select-group-content"},s0=X(K(r.defineComponent({name:r0,__name:"mc-select-group",props:{label:{},width:{},height:{}},setup(t){const e=t,n=r.inject(fa,void 0);r.provide(gd,{groupName:e.label});const o=r.computed(()=>n==null?void 0:n.filterOptions.value.some(a=>a._group===e.label)),s=r.toRefs(r.useAttrs()),i=r.computed(()=>{var a,l;return{...(l=(a=r.toValue(s))==null?void 0:a.style)==null?void 0:l.value,width:e.width??void 0,height:e.height??void 0}});return(a,l)=>r.withDirectives((r.openBlock(),r.createElementBlock("div",OE,[r.createElementVNode("div",{class:"mc-select-group-label",style:r.normalizeStyle(i.value)},r.toDisplayString(t.label),5),r.createElementVNode("div",_E,[r.renderSlot(a.$slots,"default",{},void 0,!0)])],512)),[[r.vShow,o.value]])}}),[["__scopeId","data-v-ff3f5179"]])),i0="mc-select-option",AE={class:"mc-select-option-content"},VE=r.defineComponent({name:i0,__name:"mc-select-option",props:{value:{},label:{},width:{},height:{},_group:{},_vnode:{}},setup(t,{expose:e}){const n=r.ref(),o=t,s=r.inject(fa,void 0),i=r.inject(gd,void 0),a=r.computed(()=>s==null?void 0:s.selectValues.value.includes(o.value)),l=r.computed(()=>!!(s!=null&&s.filterOptions.value.some(h=>h.value===o.value))),c=r.useSlots(),d=()=>{s==null||s.handleSelect(u(o))};r.onMounted(()=>{s==null||s.addOption(u(o))}),r.onBeforeUnmount(()=>{s==null||s.removeOption(u(o))});const u=h=>{var f;return{...h,_group:i==null?void 0:i.groupName,_vnode:r.h("div",{class:"mc-select-option-content"},(f=c.default)==null?void 0:f.call(c,{}))}},p=r.computed(()=>({width:o.width??void 0,height:o.height??void 0}));return e({isShow:l.value,ref:n}),(h,f)=>l.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-select-dropdown-item mc-select-option",{"mc-select-option-icon-active":a.value}]),onClick:d,ref_key:"_ref",ref:n,style:r.normalizeStyle(p.value)},[r.createElementVNode("div",AE,[r.renderSlot(h.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.label),1)],!0)])],6)):r.createCommentVNode("",!0)}}),a0=X(K(VE,[["__scopeId","data-v-8c13e012"]])),l0="mc-status",IE={class:"mc-status-icon"},DE={class:"mc-status-content"},c0=X(K(r.defineComponent({name:l0,__name:"mc-status",props:{type:{default:"info"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-status",[`mc-status-${t.type}`]])},[r.createElementVNode("div",IE,[r.createVNode(r.unref(ce),{name:"Indicator",size:12})]),r.createElementVNode("p",DE,[r.renderSlot(e.$slots,"default",{},void 0,!0)])],2))}),[["__scopeId","data-v-25f8565f"]])),d0="mc-step",RE={class:"mc-step-number-container"},LE={class:"mc-step-item-number"},zE={key:0,class:"mc-step-item-number-text"},$E={class:"mc-step-item-content"},PE={key:0,class:"mc-step-item-content-title"},jE={class:"mc-step-item-label"},FE={class:"mc-step-item-desc"},HE={key:1,class:"mc-step-item-component"},WE={key:0,class:"mc-step-item-component"},KE=r.defineComponent({name:d0,__name:"mc-step",props:{modelValue:{},steps:{},type:{default:"vertical"}},emits:["change","success"],setup(t,{expose:e,emit:n}){const o=t,s=r.computed(()=>o.type==="vertical"),i=n,a=r.ref(),l=r.ref(),c=r.ref(),d=r.ref(),u=r.computed(()=>an(o.steps,w=>w.key===o.modelValue)),p=r.computed(()=>{var w;return(w=o.steps[u.value-1])==null?void 0:w.key});r.watch(()=>o.modelValue,w=>{f(),i("change",w)},{flush:"post"});const h=r.ref(),f=(w=p.value)=>{h.value=w,i("success",w)},m=r.computed(()=>an(o.steps,w=>w.key===h.value));r.onMounted(()=>{s.value?g():(v(),k()),f()});const g=async()=>{await r.nextTick();const w=m.value,C=d.value;if(w<0)return void(C.style.height="0");const S=l.value,E=S.querySelectorAll(".mc-step-item");if(w+1>E.length-1)return void(C.style.height="100%");const M=E==null?void 0:E[w+1],N=S.getBoundingClientRect(),T=(M.getBoundingClientRect().top-N.top)/(N.height-24);C.style.height=100*T+"%"},v=()=>{var z,_;const w=l.value,C=c.value,S=w.querySelectorAll(".mc-step-item"),E=(z=S==null?void 0:S[0])==null?void 0:z.querySelector(".mc-step-item-number"),M=(_=S==null?void 0:S[S.length-1])==null?void 0:_.querySelector(".mc-step-item-number");if(!E||!M)return void(C.style.width="0px");const N=w.getBoundingClientRect(),T=E.getBoundingClientRect(),R=M.getBoundingClientRect();C.style.width=R.left-T.left-T.width+"px",C.style.left=`${T.left-N.left+T.width}px`},k=()=>{const w=d.value,C=m.value;if(C<0)return void(w.style.width="0");const S=(C+1)/(o.steps.length-1),E=S>1?1:S;w.style.width=100*E+"%"},y=w=>s.value&&w.component&&w.key===o.modelValue,b=r.computed(()=>{var w;return!s.value&&((w=Ro(o.steps,C=>C.key===o.modelValue))==null?void 0:w.component)});var x;return r.watch(()=>h.value,()=>{s.value?g():k()}),x=zo(()=>{s.value?g():(v(),k())},50),r.onMounted(()=>{window.addEventListener("resize",x)}),r.onUnmounted(()=>{window.removeEventListener("resize",x)}),e({ref:a,setSuccessStep:f}),(w,C)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-step",`mc-step-${t.type}`]),ref_key:"_ref",ref:a},[r.createElementVNode("ul",{class:"mc-step-item-container",ref_key:"stepContainerRef",ref:l},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.steps,(S,E)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-step-item",{"mc-step-item-active":t.modelValue===S.key,"mc-step-item-disabled":S.disabled,"mc-step-item-success":E<=m.value}]),key:S.key},[r.createElementVNode("div",RE,[r.createElementVNode("div",LE,[E>m.value||S.disabled?(r.openBlock(),r.createElementBlock("span",zE,r.toDisplayString(E+1),1)):(r.openBlock(),r.createBlock(r.unref(io),{key:1}))])]),r.createElementVNode("div",$E,[S.label||S.desc?(r.openBlock(),r.createElementBlock("div",PE,[r.createElementVNode("h3",jE,r.toDisplayString(S.label),1),r.createElementVNode("p",FE,r.toDisplayString(S.desc),1)])):r.createCommentVNode("",!0),y(S)?(r.openBlock(),r.createElementBlock("div",HE,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(S.component)))])):r.createCommentVNode("",!0)])],2))),128)),r.createElementVNode("div",{ref_key:"unsuccessLineRef",ref:c,class:"mc-step-line mc-step-unsuccess-line"},[r.createElementVNode("div",{ref_key:"successLineRef",ref:d,class:"mc-step-success-line"},null,512)],512)],512),b.value?(r.openBlock(),r.createElementBlock("div",WE,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(b.value)))])):r.createCommentVNode("",!0)],2))}}),u0=X(K(KE,[["__scopeId","data-v-add0e313"]])),p0="mc-step-plus",vd="mc-step-item-plus",qE={class:"mc-step-item-plus"},h0=X(r.defineComponent({name:vd,__name:"mc-step-item-plus",props:{icon:{},key:{},label:{},desc:{},showContent:{type:Boolean},success:{type:Boolean}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",qE))})),yd="mc-step-child-item-plus",UE={class:"mc-step-child-item-plus"},f0=X(r.defineComponent({name:yd,__name:"mc-step-child-item-plus",props:{key:{},label:{},desc:{},showContent:{type:Boolean},success:{type:Boolean}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",UE))})),GE={class:"mc-step-plus"},JE={class:"mc-step-container"},YE=["onClick"],XE={class:"mc-step-item-icon"},ZE={key:0,class:"mc-step-item-icon-number"},QE={key:1,class:"mc-step-item-icon-point"},eM={class:"mc-step-item-content"},tM={class:"mc-step-item-content-title"},nM={class:"mc-step-item-label"},oM={key:1,class:"mc-step-item-label-title"},rM={class:"mc-step-item-desc"},sM={key:1,class:"mc-step-item-desc-title"},iM={key:0,class:"mc-step-item-content-display"},m0=X(K(r.defineComponent({name:p0,__name:"mc-step-plus",props:{modelValue:{default:void 0},successSteps:{},successBehavior:{default:"manual"},previousBehavior:{default:"last-child"}},emits:["update:modelValue","update:successSteps","change","click:step"],setup(t,{expose:e,emit:n}){const o=t,s=n,{stepItems:i,activedStep:a,isActivedStep:l,showStep:c,isSuccessStep:d,showContent:u}=(()=>{const f=r.ref([]),m=r.useSlots();r.watchEffect(()=>{var b;f.value=(x=>{const w=[];let C=0,S=0;const E=(M,N)=>{de(M)&&M.forEach(T=>{var z,_,I,O,V,P,A,L,j,q,H,U,Y,J,Q,oe;const R=(z=(T==null?void 0:T.type)||{})==null?void 0:z.name;if(R===vd){const fe=Lo(T.children)||de(T.children)||!Ve((_=T.children)==null?void 0:_.default)?T.children:(I=T.children)==null?void 0:I.default(),le=T.children,me={parentIndex:C++,index:S++,step:((O=T.props)==null?void 0:O.step)||S,label:(V=T.props)==null?void 0:V.label,desc:(P=T.props)==null?void 0:P.desc,icon:(A=T.props)==null?void 0:A.icon,showContent:((L=T.props)==null?void 0:L.showContent)||((j=T.props)==null?void 0:j["show-content"]),success:(q=T.props)==null?void 0:q.success,content:le==null?void 0:le.default,labelContent:le==null?void 0:le.label,descContent:le==null?void 0:le.desc};w.push(me),E(fe,me)}else if(R===yd){const fe=T.children,le={index:S++,step:(H=T.props)==null?void 0:H.step,label:(U=T.props)==null?void 0:U.label,desc:(Y=T.props)==null?void 0:Y.desc,parentStep:N,isChild:!0,showContent:((J=T.props)==null?void 0:J.showContent)||((Q=T.props)==null?void 0:Q["show-content"]),success:(oe=T.props)==null?void 0:oe.success,content:fe==null?void 0:fe.default,labelContent:fe==null?void 0:fe.label,descContent:fe==null?void 0:fe.desc};N&&(N.content=void 0,N.hasChildren=!0,N.children||(N.children=[]),le.childIndex=N.children.length,N.children.push(le),N.childrenSteps||(N.childrenSteps=[]),N.childrenSteps.push(le.step)),w.push(le)}else Array.isArray(T.children)&&E(T.children,N)})};return E(x),w})((b=m.default)==null?void 0:b.call(m))});const g=ke("modelValue"),v=r.computed(()=>f.value.find(b=>b.step===g.value)),k=ke("successSteps"),y=ke("successBehavior");return{stepItems:f,activedStep:v,isActivedStep:b=>{var x,w;return!xe(b.index)&&!xe((x=v.value)==null?void 0:x.index)&&b.index<=((w=v.value)==null?void 0:w.index)},showStep:b=>{var x,w;return!b.isChild||!!((x=b.parentStep)!=null&&x.showContent)||!!b.parentStep&&v.value===b.parentStep||gt((w=b.parentStep)==null?void 0:w.childrenSteps,g.value)},isSuccessStep:b=>{var x,w,C,S,E,M;return!(!b.success&&!((x=b.parentStep)!=null&&x.success))||(y.value==="auto"?b.hasChildren?!xe(b.index)&&b.index+(((w=b.children)==null?void 0:w.length)??0)<(((C=v.value)==null?void 0:C.index)??-1):!xe(b.index)&&b.index<(((S=v.value)==null?void 0:S.index)??-1):!!((E=k.value)!=null&&E.length)&&(gt(k.value,b.step)||gt(k.value,(M=b.parentStep)==null?void 0:M.step)))},showContent:b=>!(!b.content||b.step!==g.value&&!b.showContent)}})(),p=()=>{var m;const f=((m=a.value)==null?void 0:m.index)||-1;if(f<i.value.length-1){let g=f+1,v=i.value[g];v.hasChildren&&(v=i.value[g+1]),v!=null&&v.step&&h(v.step)}},h=f=>{s("update:modelValue",f),s("change",f)};return e({goStep:f=>{f?h(f):p()},goNextStep:p,goPreviousStep:()=>{var m,g,v;const f=((m=a.value)==null?void 0:m.index)||-1;if(f>0){let k=f-1,y=i.value[k];(g=a.value)!=null&&g.isChild&&a.value.parentStep===y&&(y=i.value[k-1]),o.previousBehavior==="first-child"&&(y!=null&&y.isChild)&&!xe((v=y.parentStep)==null?void 0:v.index)&&(k=y.parentStep.index+1,y=i.value[k]),y!=null&&y.step&&h(y.step)}}}),(f,m)=>(r.openBlock(),r.createElementBlock("div",GE,[r.createElementVNode("div",JE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(i),g=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:g.step},[r.unref(c)(g)?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-step-item",{"mc-step-item-child":g.isChild,"mc-step-item-actived":r.unref(l)(g),"mc-step-item-success":r.unref(d)(g)}])},[r.createElementVNode("div",{class:"mc-step-item-indicator",onClick:v=>(k=>{s("click:step",k.step)})(g)},[r.createElementVNode("div",XE,[g.isChild||r.unref(xe)(g.parentIndex)?(r.openBlock(),r.createElementBlock("div",QE)):(r.openBlock(),r.createElementBlock("div",ZE,[r.unref(d)(g)?(r.openBlock(),r.createBlock(r.unref(io),{key:0})):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[g.iconContent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.iconContent),{key:g.step,step:g.step,isSuccess:r.unref(d)(g),isActived:r.unref(l)(g)},null,8,["step","isSuccess","isActived"])):g.icon?(r.openBlock(),r.createBlock(r.unref(ce),{key:1,name:g.icon},null,8,["name"])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createTextVNode(r.toDisplayString(g.parentIndex+1),1)],64))],64))]))])],8,YE),r.createElementVNode("div",eM,[r.createElementVNode("div",tM,[r.createElementVNode("div",nM,[g.labelContent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.labelContent),{key:g.step,step:g.step,label:g.label,isSuccess:r.unref(d)(g),isActived:r.unref(l)(g)},null,8,["step","label","isSuccess","isActived"])):(r.openBlock(),r.createElementBlock("div",oM,r.toDisplayString(g.label),1))]),r.createElementVNode("div",rM,[g.descContent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.descContent),{key:g.step,step:g.step,desc:g.desc,isSuccess:r.unref(d)(g),isActived:r.unref(l)(g)},null,8,["step","desc","isSuccess","isActived"])):(r.openBlock(),r.createElementBlock("div",sM,r.toDisplayString(g.desc),1))])]),r.unref(u)(g)?(r.openBlock(),r.createElementBlock("div",iM,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.content),{key:g.step,step:g.step,isSuccess:r.unref(d)(g),isActived:r.unref(l)(g)},null,8,["step","isSuccess","isActived"]))])):r.createCommentVNode("",!0)])],2)):r.createCommentVNode("",!0)],64))),128))])]))}}),[["__scopeId","data-v-d451c649"]])),g0=Symbol("StepV2Context"),v0=Symbol("StepItemV2Context"),aM={class:"mc-step-v2"},lM=r.defineComponent({name:"McStepV2",__name:"mc-step-v2",props:{modelValue:{},succeed:{type:Boolean,default:void 0},showContent:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{expose:e}){const n=t,o=r.ref([]),s=r.ref(-1),i=l=>{l>-1?l>o.value.length-1?s.value=o.value.length-1:s.value=l:s.value=-1},a=()=>{const l=an(o.value,c=>c.name===n.modelValue);i(l-1)};return r.onMounted(()=>{a()}),r.watch(()=>n.modelValue,()=>{a()},{flush:"post"}),r.provide(g0,{successStepIndex:s,activeStep:r.computed(()=>n.modelValue),succeed:r.computed(()=>n.succeed),showContent:r.computed(()=>n.showContent),stepItems:o.value,addStepItem:l=>{o.value.push(l)},removeStepItem:l=>{const c=an(o.value,d=>d.name===l.name);c>-1&&o.value.splice(c,1)}}),e({setSuccessIndex:i,setSuccessStep:l=>{const c=an(o.value,d=>d.name===l);i(c)}}),(l,c)=>(r.openBlock(),r.createElementBlock("div",aM,[r.renderSlot(l.$slots,"default")]))}}),cM={class:"mc-step-item-step-bar-number"},dM={key:0,class:"mc-step-item-step-bar-number-text"},uM={key:0,class:"mc-step-item-label"},pM={class:"mc-step-item-label-title"},hM={class:"mc-step-item-label-desc"},fM={key:1,class:"mc-step-item-slot"},mM=r.defineComponent({name:"McStepItemV2",__name:"mc-step-item-v2",props:{icon:{},minHeight:{default:"64px"},name:{},label:{},desc:{},disabled:{type:Boolean},succeed:{type:Boolean,default:void 0},showContent:{type:Boolean,default:!1}},setup(t){const e=t,n=r.ref(),o=r.ref(),s=r.inject(g0,void 0);r.onMounted(()=>{s==null||s.addStepItem(e)}),r.onBeforeUnmount(()=>{s==null||s.removeStepItem(e)});const i=r.computed(()=>hp(s==null?void 0:s.stepItems,e)),a=r.computed(()=>{var p;return((p=s==null?void 0:s.activeStep)==null?void 0:p.value)===e.name}),l=r.computed(()=>{var p;return((p=s==null?void 0:s.showContent)==null?void 0:p.value)||e.showContent||a.value}),c=r.computed(()=>{var p,h,f;return xe((p=s==null?void 0:s.succeed)==null?void 0:p.value)?xe(e.succeed)?(((h=s==null?void 0:s.successStepIndex)==null?void 0:h.value)??-1)>=i.value:e.succeed:(f=s==null?void 0:s.succeed)==null?void 0:f.value}),d=r.computed(()=>{var p;return((p=s==null?void 0:s.stepItems)==null?void 0:p.length)===i.value+1});Ya(n,()=>{if(d.value&&n.value&&o.value){const p=Array.from(n.value.querySelectorAll(".mc-step-child-item-v2")??[]);if(p.length>0){const h=p[p.length-1],{top:f}=h.getBoundingClientRect(),{top:m}=o.value.getBoundingClientRect();u(f-m+4)}else u(40)}});const u=p=>{o.value&&p&&(o.value.style.height=typeof p=="number"?`${p}px`:p)};return r.watch(d,p=>{u(p?40:"auto")}),r.provide(v0,{succeed:r.computed(()=>c.value),actived:r.computed(()=>a.value)}),(p,h)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-step-item-v2",{"mc-step-item-actived":a.value,"mc-step-item-success":c.value}]),style:r.normalizeStyle({minHeight:t.minHeight})},[r.createElementVNode("div",{class:"mc-step-item-step-bar",ref_key:"stepBarRef",ref:o},[r.createElementVNode("div",cM,[c.value?(r.openBlock(),r.createBlock(r.unref(io),{key:1,class:"mc-step-item-step-bar-success-icon"})):(r.openBlock(),r.createElementBlock("div",dM,[t.icon?(r.openBlock(),r.createBlock(r.unref(ce),{key:0,name:t.icon,class:"mc-step-item-step-bar-icon"},null,8,["name"])):r.renderSlot(p.$slots,"step-number",{key:1},()=>[r.createTextVNode(r.toDisplayString(i.value+1),1)],!0)]))])],512),r.createElementVNode("div",{class:"mc-step-item-content",ref_key:"contentRef",ref:n},[t.label||t.desc?(r.openBlock(),r.createElementBlock("div",uM,[r.renderSlot(p.$slots,"label",{},()=>[r.createElementVNode("span",pM,r.toDisplayString(t.label),1)],!0),r.renderSlot(p.$slots,"desc",{},()=>[r.createElementVNode("p",hM,r.toDisplayString(t.desc),1)],!0)])):r.createCommentVNode("",!0),l.value?(r.openBlock(),r.createElementBlock("div",fM,[r.renderSlot(p.$slots,"default",{},void 0,!0)])):r.createCommentVNode("",!0)],512)],6))}}),gM=K(mM,[["__scopeId","data-v-d41e82d5"]]),vM={class:"mc-step-child-item-content"},yM={key:0,class:"mc-step-child-item-label"},kM={class:"mc-step-child-item-label-title"},bM={class:"mc-step-child-item-label-desc"},wM={key:1,class:"mc-step-child-item-slot"},xM=K(r.defineComponent({name:"McStepChildItemV2",__name:"mc-step-child-item-v2",props:{name:{},label:{},desc:{},disabled:{type:Boolean},succeed:{type:Boolean,default:void 0},showContent:{type:Boolean}},setup(t){const e=t,n=r.inject(v0,void 0),o=r.computed(()=>{var i;return(i=n==null?void 0:n.actived)==null?void 0:i.value}),s=r.computed(()=>{var i,a;return(i=n==null?void 0:n.succeed)!=null&&i.value?(a=n==null?void 0:n.succeed)==null?void 0:a.value:e.succeed});return(i,a)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-step-child-item-v2",{"mc-step-child-item-actived":o.value,"mc-step-child-item-success":s.value}])},[r.createElementVNode("div",vM,[t.label||t.desc?(r.openBlock(),r.createElementBlock("div",yM,[r.createElementVNode("span",kM,r.toDisplayString(t.label),1),r.createElementVNode("p",bM,r.toDisplayString(t.desc),1)])):r.createCommentVNode("",!0),i.$slots.default?(r.openBlock(),r.createElementBlock("div",wM,[r.renderSlot(i.$slots,"default",{},void 0,!0)])):r.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-f01aecff"]]),y0=X(lM),k0=X(gM),b0=X(xM),w0="mc-switch",x0="mc-switch-label",CM={class:"mc-switch-label-wrapper"},SM={class:"mc-switch-label"},EM={class:"mc-switch-help"},C0=K(r.defineComponent({name:x0,__name:"mc-switch-label",props:{label:{},helpText:{},helpIcon:{default:"Info"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",CM,[t.label||e.$slots.label?r.renderSlot(e.$slots,"label",{key:0},()=>[r.createElementVNode("span",SM,r.toDisplayString(t.label),1)],!0):r.createCommentVNode("",!0),t.helpText||e.$slots.help?r.renderSlot(e.$slots,"help",{key:1},()=>[r.createElementVNode("div",EM,[r.createVNode(r.unref(Uo),{"icon-name":t.helpIcon,content:t.helpText,"icon-size":22},null,8,["icon-name","content"])])],!0):r.createCommentVNode("",!0)]))}),[["__scopeId","data-v-52de74a9"]]),MM={class:"mc-switch"},NM=["id","disabled","value","onKeypress"],BM={class:"mc-switch-inner"},TM={class:"mc-switch-inner-text"},OM={class:"mc-switch-inner-text"},_M=r.defineComponent({name:w0,__name:"mc-switch",props:{modelValue:{type:Boolean,default:!1},width:{},height:{},activeText:{},inactiveText:{},disabled:{type:Boolean,default:!1},size:{default:"medium"},label:{},labelPosition:{default:"right"},helpIcon:{default:"Info"},helpText:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,s=r.useSlots(),{formId:i,formDisabled:a,validateStyle:l,validateByTrigger:c}=cn(),d=r.computed(()=>n.modelValue),u=async()=>{a.value||(o("update:modelValue",!n.modelValue),o("change",!n.modelValue),c("input"))},p=r.computed(()=>s.label||n.label||s.help||n.helpText?n.labelPosition:void 0),h=r.computed(()=>p.value==="left"),f=r.computed(()=>p.value==="right");return(m,g)=>(r.openBlock(),r.createElementBlock("div",MM,[h.value?(r.openBlock(),r.createBlock(C0,{key:0,label:t.label,"help-text":t.helpText,"help-icon":t.helpIcon},r.createSlots({_:2},[m.$slots.label?{name:"label",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"label",{},void 0,!0)]),key:"0"}:void 0,m.$slots.help?{name:"help",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"help",{},void 0,!0)]),key:"1"}:void 0]),1032,["label","help-text","help-icon"])):r.createCommentVNode("",!0),r.createElementVNode("label",{class:r.normalizeClass(["mc-switch-wrapper",[d.value?"mc-switch-actived":"mc-switch-inactive",{"mc-switch-disabled":r.unref(a)},`mc-switch-${t.size}`,r.unref(l)]]),style:r.normalizeStyle({width:t.width,height:t.height})},[r.createElementVNode("input",{id:r.unref(i),type:"checkbox",class:"mc-switch-input",disabled:t.disabled,value:t.modelValue,onChange:u,onKeypress:r.withKeys(r.withModifiers(u,["prevent","stop"]),["enter"])},null,40,NM),r.createElementVNode("div",BM,[d.value?r.renderSlot(m.$slots,"active",{key:0},()=>[r.createElementVNode("span",TM,r.toDisplayString(t.activeText),1)],!0):r.renderSlot(m.$slots,"inactive",{key:1},()=>[r.createElementVNode("span",OM,r.toDisplayString(t.inactiveText),1)],!0)])],6),f.value?(r.openBlock(),r.createBlock(C0,{key:1,label:t.label,"help-text":t.helpText,"help-icon":t.helpIcon},r.createSlots({_:2},[m.$slots.label?{name:"label",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"label",{},void 0,!0)]),key:"0"}:void 0,m.$slots.help?{name:"help",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"help",{},void 0,!0)]),key:"1"}:void 0]),1032,["label","help-text","help-icon"])):r.createCommentVNode("",!0)]))}}),S0=X(K(_M,[["__scopeId","data-v-dc9c6820"]])),kd="mc-tab-item",AM={class:"mc-tab-item"},E0=X(r.defineComponent({name:kd,__name:"mc-tab-item",props:{name:{},label:{},disabled:{type:Boolean},count:{}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",AM,[r.renderSlot(e.$slots,"default")]))})),M0="mc-tab",VM=["onClick"],IM={key:0,class:"mc-tab-nav-item-count"},DM={class:"mc-tab-actived-component-wrapper"},N0=X(K(r.defineComponent({name:M0,__name:"mc-tab",props:{modelValue:{},type:{default:"plain"},wrapperPadding:{default:"0"}},emits:["update:modelValue","change"],setup(t,{expose:e,emit:n}){const o=t,s=n,i=r.ref(),a=r.ref(),l=r.ref(),c=r.ref([]),d=r.useSlots();r.watchEffect(()=>{if(!d.default)return void(c.value=[]);let v=d.default();v.length&&v[0].type===r.Fragment&&(v=[...Array.from(v[0].children)]),c.value=Mn(br(v,k=>k.type.name===kd),k=>{var b,x,w;const y=k.props;return{_vnode:r.h("div",(w=(x=(b=k.children)==null?void 0:b.default)==null?void 0:x.call(b))==null?void 0:w[0]),...y}})});const u=r.computed(()=>Ro(c.value,v=>v.name===o.modelValue)),p=r.computed(()=>o.type==="plain");r.onMounted(async()=>{h(o.modelValue),setTimeout(()=>{f()})}),r.onUnmounted(()=>{f(!1)});const h=v=>{if(!p.value)return;const k=l.value,y=a.value,b=an(c.value,E=>E.name===v);if(b<0)return void(k.style.width="0");const x=Array.from(y.children)[b],{x:w,width:C}=x.getBoundingClientRect(),{x:S}=y.getBoundingClientRect();k.style.width=`${C}px`,k.style.transform=`translateX(${w-S}px)`},f=(v=!0)=>{const k=l.value;p.value&&k&&(k.style.transition=v?"transform 0.3s ease-in-out":"")};r.watch(()=>o.modelValue,v=>{h(v)});const m=r.computed(()=>{var v;return typeof o.wrapperPadding=="string"?o.wrapperPadding:((v=o.wrapperPadding)==null?void 0:v.left)??"0"}),g=r.computed(()=>{var v;return typeof o.wrapperPadding=="string"?o.wrapperPadding:((v=o.wrapperPadding)==null?void 0:v.right)??"0"});return e({ref:i}),(v,k)=>{var y;return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-tab",`mc-tab-${t.type}`]),ref_key:"_ref",ref:i},[r.createElementVNode("div",{class:"mc-tab-nav",style:r.normalizeStyle({paddingLeft:m.value,paddingRight:g.value})},[r.createElementVNode("div",{class:"mc-tab-nav-wrapper",ref_key:"tabNavRef",ref:a},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,b=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-tab-nav-item",{"mc-tab-nav-item-active":b.name===t.modelValue,"mc-tab-nav-item-disabled":b.disabled}]),key:b.name,onClick:x=>(w=>{w.disabled||(s("update:modelValue",w.name),s("change",w.name))})(b)},[r.createElementVNode("span",null,r.toDisplayString(b.label),1),b.count?(r.openBlock(),r.createElementBlock("span",IM,r.toDisplayString(b.count),1)):r.createCommentVNode("",!0)],10,VM))),128))],512),p.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-tab-line",ref_key:"tabLineRef",ref:l},null,512)):r.createCommentVNode("",!0)],4),(y=u.value)!=null&&y._vnode?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-tab-actived-component",style:r.normalizeStyle({paddingLeft:m.value,paddingRight:g.value})},[r.createElementVNode("div",DM,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u.value._vnode),{key:u.value.name}))])],4)):r.createCommentVNode("",!0)],2)}}}),[["__scopeId","data-v-2c21b5ce"]])),RM=["rowspan","colspan"],LM=K(r.defineComponent({__name:"mc-table-cell",props:{row:{},column:{},rowIndex:{},columnIndex:{},pagination:{},spanMethod:{type:Function}},setup(t){const e=t,n=r.computed(()=>e.row[e.column.prop]),o=r.computed(()=>{const u=[e.column.className];if(e.column.align&&u.push(`is-${e.column.align}`),e.column.fixed){const h=typeof e.column.fixed=="boolean"?"left":e.column.fixed;u.push(`is-fixed-${h}`)}const p=c.value===0?"none":"table-cell";return u.push(`is-display-${p}`),u}),s=()=>{var u,p;return(u=e.pagination)!=null&&u.currentPage&&((p=e.pagination)!=null&&p.pageSize)?(e.pagination.currentPage-1)*e.pagination.pageSize+e.rowIndex:e.rowIndex},i=()=>{if(!e.spanMethod)return null;const u=s();return e.spanMethod({row:e.row,column:e.column,rowIndex:u,columnIndex:e.columnIndex})},a=(u,p)=>{var g,v;if(!((g=e.pagination)!=null&&g.currentPage)||!((v=e.pagination)!=null&&v.pageSize)||p<=1)return!0;const h=(e.pagination.currentPage-1)*e.pagination.pageSize,f=h+e.pagination.pageSize-1,m=u;return!(u+p-1<h||m>f)&&Math.max(m,h)===u},l=r.computed(()=>{const u=i();if(u){const p=s();let h;return h=Array.isArray(u)?u[0]:u.rowspan||1,h>1?a(p,h)?((f,m)=>{var x,w;if(!((x=e.pagination)!=null&&x.currentPage)||!((w=e.pagination)!=null&&w.pageSize)||m<=1)return m;const g=(e.pagination.currentPage-1)*e.pagination.pageSize,v=g+e.pagination.pageSize-1,k=f,y=f+m-1,b=Math.max(k,g);return Math.min(y,v)-b+1})(p,h):0:h}if(e.column.rowSpan)return typeof e.column.rowSpan=="function"?e.column.rowSpan(e.row,e.column,e.rowIndex):e.column.rowSpan}),c=r.computed(()=>{const u=i();return u?Array.isArray(u)?u[1]:u.colspan:e.column.colSpan?typeof e.column.colSpan=="function"?e.column.colSpan(e.row,e.column,e.rowIndex):e.column.colSpan:void 0}),d=r.computed(()=>{const u=i();if(u){const p=s();let h,f;return Array.isArray(u)?(h=u[0],f=u[1]):(h=u.rowspan||1,f=u.colspan||1),!(h>1&&!a(p,h)||h===0||f===0)}return!0});return(u,p)=>d.value?(r.openBlock(),r.createElementBlock("td",{key:0,class:r.normalizeClass(o.value),rowspan:l.value,colspan:c.value},[r.renderSlot(u.$slots,"cell",{row:t.row,column:t.column,index:t.rowIndex,value:n.value,prop:t.column.prop},()=>[r.renderSlot(u.$slots,t.column.slot||t.column.prop,{row:t.row,column:t.column,index:t.rowIndex,value:n.value},()=>[t.column.formatter?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createTextVNode(r.toDisplayString(t.column.formatter(t.row,t.column,n.value,t.rowIndex)),1)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(n.value),1)],64))],!0)],!0)],10,RM)):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-3b2b75d3"]]),zM={class:"mc-table__body",cellspacing:"0",cellpadding:"0",border:"0"},$M={key:0,width:"50"},PM=["width"],jM=["onClick"],FM={key:0,class:"mc-table__selection-column"},HM={class:"mc-table__cell"},WM={key:1},KM=["colspan"],qM={key:1},UM=K(r.defineComponent({__name:"mc-table-body",props:{data:{},columns:{},rowKey:{},emptyText:{},height:{},maxHeight:{},pagination:{},spanMethod:{},getRowClass:{},selectable:{type:Boolean,default:!1},selectedRows:{},selectOnRowClick:{type:Boolean,default:!1}},emits:["row-click","select"],setup(t,{expose:e,emit:n}){const o=t,s=r.useSlots(),i=n,a=r.ref(),l=r.computed(()=>Object.keys(s)),c=r.computed(()=>{const f={};return o.height&&(f.height=typeof o.height=="number"?`${o.height}px`:o.height),o.maxHeight&&(f.maxHeight=typeof o.maxHeight=="number"?`${o.maxHeight}px`:o.maxHeight),f}),d=r.computed(()=>o.pagination),u=(f,m)=>o.rowKey?f[o.rowKey]:m,p=(f,m)=>o.getRowClass?o.getRowClass(f,m):[],h=f=>!!o.selectedRows&&o.selectedRows.some(m=>o.rowKey?m[o.rowKey]===f[o.rowKey]:m===f);return e({bodyWrapper:a}),(f,m)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-table__body-wrapper",ref_key:"bodyWrapper",ref:a,style:r.normalizeStyle(c.value)},[r.createElementVNode("table",zM,[r.createElementVNode("colgroup",null,[t.selectable?(r.openBlock(),r.createElementBlock("col",$M)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.columns,(g,v)=>(r.openBlock(),r.createElementBlock("col",{key:v,width:g.width},null,8,PM))),128))]),r.createElementVNode("tbody",null,[t.data&&t.data.length>0?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(t.data,(g,v)=>(r.openBlock(),r.createElementBlock("tr",{key:u(g,v),class:r.normalizeClass(p(g,v)),onClick:k=>((y,b)=>{i("row-click",y,b)})(g,v)},[t.selectable?(r.openBlock(),r.createElementBlock("td",FM,[r.createElementVNode("div",HM,[r.createVNode(r.unref(so),{"model-value":h(g),onChange:k=>((y,b)=>{i("select",y,b)})(g,k)},null,8,["model-value","onChange"])])])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.columns,(k,y)=>(r.openBlock(),r.createBlock(LM,{key:y,row:g,column:k,"row-index":v,"column-index":y,"span-method":t.spanMethod,pagination:d.value},r.createSlots({_:2},[r.renderList(l.value,b=>({name:b,fn:r.withCtx(x=>[r.renderSlot(f.$slots,b,r.mergeProps({ref_for:!0},x),void 0,!0)])}))]),1032,["row","column","row-index","column-index","span-method","pagination"]))),128))],10,jM))),128)):(r.openBlock(),r.createElementBlock("tr",WM,[r.createElementVNode("td",{colspan:o.selectable?o.columns.length+1:o.columns.length,class:"mc-table__empty-cell"},[r.unref(s).empty?r.renderSlot(f.$slots,"empty",{key:0},void 0,!0):(r.openBlock(),r.createElementBlock("div",qM,r.toDisplayString(t.emptyText),1))],8,KM)]))])])],4))}}),[["__scopeId","data-v-f42c4de9"]]),GM={class:"mc-table__header",cellspacing:"0",cellpadding:"0",border:"0"},JM={key:0,width:"50"},YM=["width"],XM={key:0,class:"mc-table__selection-column"},ZM={class:"mc-table__header-cell"},QM=["onClick"],eN={class:"mc-table__header-label"},tN={key:0,class:"mc-table__sort-caret"},nN=r.defineComponent({__name:"mc-table-header",props:{columns:{},showHeader:{type:Boolean,default:!0},getSortOrder:{type:Function,default:()=>null},selectable:{type:Boolean,default:!1},isAllSelected:{type:Boolean,default:!1},isIndeterminate:{type:Boolean,default:!1}},emits:["header-click","sort-change","select-all"],setup(t,{expose:e,emit:n}){const o=t,s=n,i=r.ref(),a=d=>{const u=[];if(d.headerClassName&&u.push(d.headerClassName),d.align&&u.push(`is-${d.align}`),d.fixed){const h=typeof d.fixed=="boolean"?"left":d.fixed;u.push(`is-fixed-${h}`)}d.sortable&&u.push("is-sortable");const p=l(d.prop);return p&&u.push(p),u},l=d=>{const u=o.getSortOrder(d);return u==="asc"?"is-sort-asc":u==="desc"?"is-sort-desc":""},c=d=>{s("select-all",d)};return e({headerWrapper:i}),(d,u)=>t.showHeader?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-table__header-wrapper",ref_key:"headerWrapper",ref:i},[r.createElementVNode("table",GM,[r.createElementVNode("colgroup",null,[t.selectable?(r.openBlock(),r.createElementBlock("col",JM)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.columns,(p,h)=>(r.openBlock(),r.createElementBlock("col",{key:h,width:p.width},null,8,YM))),128))]),r.createElementVNode("thead",null,[r.createElementVNode("tr",null,[t.selectable?(r.openBlock(),r.createElementBlock("th",XM,[r.createElementVNode("div",ZM,[r.createVNode(r.unref(so),{"model-value":t.isAllSelected,partial:t.isIndeterminate,onChange:c},null,8,["model-value","partial"])])])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.columns,(p,h)=>(r.openBlock(),r.createElementBlock("th",{key:h,class:r.normalizeClass(a(p)),onClick:f=>((m,g)=>{m.sortable&&s("sort-change",m),s("header-click",m,g)})(p,f)},[r.createElementVNode("div",{class:r.normalizeClass(["mc-table__header-cell",`mc-table__header-cell-${p.align}`])},[r.createElementVNode("span",eN,[r.renderSlot(d.$slots,`header-${p.slot||p.prop}`,{column:p,index:h},()=>[r.createTextVNode(r.toDisplayString(p.label),1)],!0)]),p.sortable?(r.openBlock(),r.createElementBlock("span",tN,[t.getSortOrder(p.prop)==="asc"?(r.openBlock(),r.createBlock(eo,{key:0,name:"Up-Chevron02",class:r.normalizeClass(["mc-table__sort-icon",{"is-active":t.getSortOrder(p.prop)==="asc"}])},null,8,["class"])):(r.openBlock(),r.createBlock(eo,{key:1,name:"Down-Chevron02",class:r.normalizeClass(["mc-table__sort-icon",{"is-active":t.getSortOrder(p.prop)==="desc"}])},null,8,["class"]))])):r.createCommentVNode("",!0)],2)],10,QM))),128))])])])],512)):r.createCommentVNode("",!0)}}),oN=K(nN,[["__scopeId","data-v-990de870"]]),rN={class:"mc-table__loading-content"},sN={class:"mc-table__loading-spinner"},iN={key:0,class:"mc-table__spinner mc-table__spinner--default"},aN={key:1,class:"mc-table__spinner mc-table__spinner--circle"},lN={key:2,class:"mc-table__spinner mc-table__spinner--pulse"},cN=["innerHTML"],dN={key:0,class:"mc-table__loading-text"},uN=K(r.defineComponent({__name:"mc-table-loading",props:{loading:{type:Boolean,default:!1},loadingText:{default:"Loading..."},loadingConfig:{default:()=>({spinner:"default"})}},setup(t){const e=t,n=r.computed(()=>{var s;return((s=e.loadingConfig)==null?void 0:s.text)||e.loadingText}),o=r.computed(()=>{var i;const s={};return(i=e.loadingConfig)!=null&&i.background&&(s.backgroundColor=e.loadingConfig.background),s});return(s,i)=>{var a;return t.loading?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-table__loading-wrapper",["mc-table__loading-wrapper",(a=t.loadingConfig)==null?void 0:a.customClass]]),style:r.normalizeStyle(o.value)},[r.createElementVNode("div",rN,[r.renderSlot(s.$slots,"loading",{loading:t.loading,text:n.value},()=>{var l;return[r.createElementVNode("div",sN,[(l=t.loadingConfig)!=null&&l.spinner&&t.loadingConfig.spinner!=="default"?t.loadingConfig.spinner==="circle"?(r.openBlock(),r.createElementBlock("div",aN)):t.loadingConfig.spinner==="pulse"?(r.openBlock(),r.createElementBlock("div",lN)):(r.openBlock(),r.createElementBlock("div",{key:3,class:"mc-table__spinner mc-table__spinner--custom",innerHTML:t.loadingConfig.spinner},null,8,cN)):(r.openBlock(),r.createElementBlock("div",iN,[...i[0]||(i[0]=[r.createElementVNode("div",{class:"mc-table__spinner-dot"},null,-1),r.createElementVNode("div",{class:"mc-table__spinner-dot"},null,-1),r.createElementVNode("div",{class:"mc-table__spinner-dot"},null,-1),r.createElementVNode("div",{class:"mc-table__spinner-dot"},null,-1)])]))]),n.value?(r.openBlock(),r.createElementBlock("div",dN,r.toDisplayString(n.value),1)):r.createCommentVNode("",!0)]},!0)])],6)):r.createCommentVNode("",!0)}}}),[["__scopeId","data-v-0a275eb6"]]),pN={key:0,class:"mc-table__pagination"},hN={class:"mc-table__pagination-info"},fN={class:"mc-table__pagination-info-number"},mN={class:"mc-table__pagination-info-number"},gN={class:"mc-table__pagination-controls"},vN=["onClick"],yN={key:1,class:"mc-table__pagination-ellipsis"},kN={class:"mc-table__pagination-size"},bN={class:"mc-table-pagination-size-group"},wN=["onClick"],xN=r.defineComponent({__name:"mc-table-pagination",props:{pagination:{}},emits:["page-change"],setup(t,{emit:e}){var h,f,m;const n=t,o=e,s=r.ref(((h=n.pagination)==null?void 0:h.currentPage)||1),i=r.ref(((f=n.pagination)==null?void 0:f.pageSize)||50),a=r.ref(((m=n.pagination)==null?void 0:m.pageSizes)||[25,50,75,100]);r.watch(()=>{var g;return(g=n.pagination)==null?void 0:g.currentPage},g=>{g!==void 0&&(s.value=g)}),r.watch(()=>{var g;return(g=n.pagination)==null?void 0:g.pageSize},g=>{g!==void 0&&(i.value=g)});const l=r.computed(()=>n.pagination?Math.ceil(n.pagination.total/i.value):1),c=r.computed(()=>n.pagination&&n.pagination.total!==0?(s.value-1)*i.value+1:0),d=r.computed(()=>{if(!n.pagination)return 0;const g=s.value*i.value;return Math.min(g,n.pagination.total)}),u=r.computed(()=>{const g=l.value,v=s.value,k=[];if(g<=7)for(let y=1;y<=g;y++)k.push(y);else if(k.push(1),v<=4){for(let y=2;y<=5;y++)k.push(y);k.push("..."),k.push(g)}else if(v>=g-3){k.push("...");for(let y=g-4;y<=g;y++)k.push(y)}else{k.push("...");for(let y=v-1;y<=v+1;y++)k.push(y);k.push("..."),k.push(g)}return k}),p=(g,v)=>{g<1||g>l.value||v||(s.value=g,o("page-change",{pageSize:i.value,pageNum:g}))};return(g,v)=>t.pagination?(r.openBlock(),r.createElementBlock("div",pN,[r.createElementVNode("div",hN,[v[4]||(v[4]=r.createTextVNode(" Showing ",-1)),r.createElementVNode("span",fN,r.toDisplayString(c.value)+"-"+r.toDisplayString(d.value),1),v[5]||(v[5]=r.createTextVNode(" of ",-1)),r.createElementVNode("span",mN,r.toDisplayString(t.pagination.total),1)]),r.createElementVNode("div",gN,[r.createVNode(eo,{name:"First",class:r.normalizeClass({"mc-table__icon":!0,"is-disabled":s.value<=1}),size:24,onClick:v[0]||(v[0]=k=>p(1,s.value<=1))},null,8,["class"]),r.createVNode(eo,{name:"Left-Chevron",class:r.normalizeClass({"mc-table__icon":!0,"is-disabled":s.value<=1}),size:24,onClick:v[1]||(v[1]=k=>p(s.value-1,s.value<=1))},null,8,["class"]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,k=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:k},[k!=="..."?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass(["mc-table__pagination-button mc-table__pagination-button--page",{"is-active":k===s.value}]),onClick:y=>typeof k=="number"?p(k,!1):void 0},r.toDisplayString(k),11,vN)):(r.openBlock(),r.createElementBlock("span",yN,"..."))],64))),128)),r.createVNode(eo,{name:"Right-Chevron",class:r.normalizeClass({"mc-table__icon":!0,"is-disabled":s.value>=l.value}),size:24,onClick:v[2]||(v[2]=k=>p(s.value+1,s.value>=l.value))},null,8,["class"]),r.createVNode(eo,{name:"Last",class:r.normalizeClass({"mc-table__icon":!0,"is-disabled":s.value>=l.value}),size:24,onClick:v[3]||(v[3]=k=>p(l.value,s.value>=l.value))},null,8,["class"])]),r.createElementVNode("div",kN,[v[6]||(v[6]=r.createElementVNode("label",{class:"mc-table__pagination-size-label"},"View per page",-1)),r.createElementVNode("div",bN,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,k=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-table-pagination-size-group-item",{"is-active":k===i.value}]),key:k,onClick:y=>(b=>{i.value=b,s.value=1,o("page-change",{pageSize:i.value,pageNum:1})})(k)},r.toDisplayString(k),11,wN))),128))])])])):r.createCommentVNode("",!0)}}),CN=K(xN,[["__scopeId","data-v-6eb5fd07"]]);function B0(t,e,n){var l,c;const o=r.ref(((l=e.value)==null?void 0:l.currentPage)||1),s=r.ref(((c=e.value)==null?void 0:c.pageSize)||50);r.watch(()=>{var d;return(d=e.value)==null?void 0:d.currentPage},d=>{d!==void 0&&(o.value=d)}),r.watch(()=>{var d;return(d=e.value)==null?void 0:d.pageSize},d=>{d!==void 0&&(s.value=d)});const i=r.computed(()=>{if(!e.value)return t.value;const d=(o.value-1)*s.value,u=d+s.value;return n.value?t.value.slice(d,u):t.value}),a=r.computed(()=>{if(!e.value)return{currentPage:1,pageSize:t.value.length,total:t.value.length,totalPages:1};const d=e.value.total,u=Math.ceil(d/s.value);return{currentPage:o.value,pageSize:s.value,total:d,totalPages:u}});return{currentPage:o,pageSize:s,paginatedData:i,paginationInfo:a,updatePagination:function(d){o.value=d.pageNum,s.value=d.pageSize}}}function T0(t,e,n){const o=r.ref(!1),s=r.ref(null),i=r.computed(()=>o.value?t.value:t.value.map(d=>({...d,fixed:void 0})));function a(){s.value&&(o.value=s.value.scrollWidth>s.value.clientWidth)}function l(){var d,u;(d=e.value)!=null&&d.headerWrapper&&((u=n.value)!=null&&u.bodyWrapper)&&(e.value.headerWrapper.scrollLeft=n.value.bodyWrapper.scrollLeft)}function c(){r.nextTick(()=>{var d;(d=n.value)!=null&&d.bodyWrapper&&(s.value=n.value.bodyWrapper,a(),new ResizeObserver(()=>{a()}).observe(n.value.bodyWrapper),window.addEventListener("resize",a),n.value.bodyWrapper.addEventListener("scroll",l))})}return r.onMounted(()=>{c()}),{hasHorizontalScroll:o,columnsWithFixed:i,checkHorizontalScroll:a,syncHeaderScroll:l,initScrollSync:c}}function O0(t,e,n){const o=r.ref(n||null);return{sortedData:r.computed(()=>{if(!o.value||!o.value.order)return t.value;const{prop:i,order:a}=o.value,l=e.value.find(d=>d.prop===i);if(!l)return t.value;const c=[...t.value];return c.sort((d,u)=>{let p=d[i],h=u[i];if(l.sortMethod){const f=l.sortMethod(p,h);return a==="desc"?-f:f}return p==null&&(p=""),h==null&&(h=""),typeof p=="string"&&typeof h=="string"&&(p=p.toLowerCase(),h=h.toLowerCase()),p<h?a==="asc"?-1:1:p>h?a==="asc"?1:-1:0}),c}),currentSort:o,handleSort:function(i){if(!i.sortable)return;const{prop:a}=i;let l="asc";return o.value&&o.value.prop===a&&(l=o.value.order==="asc"?"desc":o.value.order==="desc"?null:"asc"),o.value=l===null?null:{prop:a,order:l},o.value},getSortOrder:function(i){return o.value&&o.value.prop===i?o.value.order:null}}}const _0=X(K(r.defineComponent({name:"McTable",__name:"mc-table",props:{data:{},columns:{},showHeader:{type:Boolean,default:!0},height:{},maxHeight:{},rowKey:{},emptyText:{default:"No Data"},pagination:{},loading:{type:Boolean,default:!1},loadingText:{default:"Loading..."},loadingConfig:{},highlightCurrentRow:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},selectedRows:{},selectOnRowClick:{type:Boolean,default:!1},spanMethod:{},isInitTableData:{type:Boolean,default:!0},initTableData:{},isFrontPagination:{type:Boolean,default:!1},defaultSort:{}},emits:["row-click","header-click","page-change","sort-change","current-change","selection-change","select","select-all","update:selectedRows"],setup(t,{expose:e,emit:n}){const o=t,{data:s,columns:i,pagination:a,spanMethod:l,loading:c,loadingText:d,loadingConfig:u,defaultSort:p,highlightCurrentRow:h,rowKey:f,selectable:m,selectedRows:g,selectOnRowClick:v,isFrontPagination:k}=r.toRefs(o),y=r.useSlots(),b=r.computed(()=>Object.keys(y)),x=r.ref(s.value),w=n,C=r.ref(),S=r.ref(),E=r.ref(),{columnsWithFixed:M}=T0(i,S,E),{sortedData:N,handleSort:T,getSortOrder:R}=O0(x,M,p==null?void 0:p.value),{paginatedData:z,updatePagination:_}=B0(N,a,k),I=r.computed(()=>z.value),{internalSelectedRows:O,isAllSelected:V,isIndeterminate:P,toggleRowSelection:A,toggleAllSelection:L,clearSelection:j,getSelectedRows:q}=function(Z,se,ae){const re=r.ref((ae==null?void 0:ae.value)||[]);r.watch(ae,ue=>{ue&&(re.value=[...ue])},{deep:!0,immediate:!0});const Ce=ue=>re.value.some(ge=>se.value?ge[se.value]===ue[se.value]:ge===ue),nt=()=>Z.value.filter(ue=>Ce(ue)).length,Oe=r.computed(()=>!!Z.value.length&&Z.value.every(ue=>Ce(ue))),_e=r.computed(()=>{if(!Z.value.length)return!1;const ue=nt();return ue>0&&ue<Z.value.length});return{internalSelectedRows:re,isRowSelected:Ce,isAllSelected:Oe,isIndeterminate:_e,toggleRowSelection:(ue,ge)=>{const at=ge!==void 0?ge:!Ce(ue);if(at)Ce(ue)||re.value.push(ue);else{const ft=re.value.findIndex(we=>se.value?we[se.value]===ue[se.value]:we===ue);ft>-1&&re.value.splice(ft,1)}return at},toggleAllSelection:ue=>{ue?Z.value.forEach(ge=>{Ce(ge)||re.value.push(ge)}):Z.value.forEach(ge=>{const at=re.value.findIndex(ft=>se.value?ft[se.value]===ge[se.value]:ft===ge);at>-1&&re.value.splice(at,1)})},clearSelection:()=>{re.value=[]},getSelectedRows:()=>[...re.value],getCurrentPageSelectionInfo:()=>{const ue=Z.value.length,ge=nt();return{totalCount:ue,selectedCount:ge,isAllSelected:ue>0&&ge===ue,isIndeterminate:ge>0&&ge<ue}}}}(I,f,g),{setCurrentRow:H,getRowClass:U}=function(Z){const se=r.ref(null);return{currentRow:se,setCurrentRow:ae=>(se.value=ae,se.value),getRowClass:ae=>{const re=[];return Z.value&&se.value===ae&&re.push("is-current"),re},clearCurrentRow:()=>{se.value=null}}}(h);r.watch(()=>s.value,Z=>{x.value=Z},{deep:!0,immediate:!0});const Y=(Z,se)=>{if(h.value){const ae=H(Z);w("current-change",ae)}if(m.value&&v.value){const ae=A(Z);me(Z,ae)}w("row-click",Z,se)},J=(Z,se)=>{w("header-click",Z,se)},Q=Z=>{const se=T(Z);se&&w("sort-change",se)},oe=(Z,se)=>{const ae=A(Z,se);me(Z,ae)},fe=Z=>{L(Z),me(null,Z)},le=async Z=>{_(Z),r.nextTick(()=>{var se;(se=E.value)!=null&&se.bodyWrapper&&(E.value.bodyWrapper.scrollTop=0)}),w("page-change",Z),await Be()},me=(Z,se)=>{w("update:selectedRows",[...O.value]),w("selection-change",[...O.value]),Z?w("select",Z,se):w("select-all",se)},Be=async()=>{if(o.isInitTableData&&o.initTableData&&typeof o.initTableData=="function"){const{data:Z,total:se}=await o.initTableData({pageSize:a.value.pageSize||10,pageNum:a.value.currentPage||1});x.value=Z,a.value.total=se}};return r.onMounted(()=>{Be()}),e({ref:C,clearSort:()=>{i.value.forEach(Z=>{Z.sortable&&(Z.sortOrder=null)})},toggleRowSelection:(Z,se)=>{const ae=A(Z,se);me(Z,ae)},refresh:async()=>{a.value.currentPage=1,await Be()},toggleAllSelection:Z=>{L(Z),me(null,Z)},clearSelection:()=>{j(),w("update:selectedRows",[]),w("selection-change",[])},getSelectedRows:q}),(Z,se)=>{var ae;return r.openBlock(),r.createElementBlock("div",{ref_key:"_ref",ref:C,class:r.normalizeClass(["mc-table",{"mc-table--loading":r.unref(c)}])},[r.createVNode(oN,{ref_key:"headerRef",ref:S,columns:r.unref(M),"show-header":t.showHeader,"get-sort-order":r.unref(R),selectable:r.unref(m),"is-all-selected":r.unref(V),"is-indeterminate":r.unref(P),onHeaderClick:J,onSortChange:Q,onSelectAll:fe},r.createSlots({_:2},[r.renderList(b.value,re=>({name:re,fn:r.withCtx(Ce=>[r.renderSlot(Z.$slots,re,r.normalizeProps(r.guardReactiveProps(Ce)),void 0,!0)])}))]),1032,["columns","show-header","get-sort-order","selectable","is-all-selected","is-indeterminate"]),r.createVNode(UM,{ref_key:"bodyRef",ref:E,data:I.value,columns:r.unref(M),"row-key":r.unref(f),"empty-text":t.emptyText,height:t.height,"max-height":t.maxHeight,"span-method":r.unref(l),pagination:r.unref(a),"get-row-class":r.unref(U),selectable:r.unref(m),"selected-rows":r.unref(O),"select-on-row-click":r.unref(v),onRowClick:Y,onSelect:oe},r.createSlots({_:2},[r.renderList(b.value,re=>({name:re,fn:r.withCtx(Ce=>[r.renderSlot(Z.$slots,re,r.normalizeProps(r.guardReactiveProps(Ce)),void 0,!0)])}))]),1032,["data","columns","row-key","empty-text","height","max-height","span-method","pagination","get-row-class","selectable","selected-rows","select-on-row-click"]),r.unref(a)&&((ae=r.unref(a))==null?void 0:ae.total)>0?(r.openBlock(),r.createBlock(CN,{key:0,pagination:r.unref(a),onPageChange:le},null,8,["pagination"])):r.createCommentVNode("",!0),r.createVNode(uN,{class:"mc-table__loading",loading:r.unref(c),"loading-text":r.unref(d),"loading-config":r.unref(u)},{loading:r.withCtx(re=>[r.renderSlot(Z.$slots,"loading",r.normalizeProps(r.guardReactiveProps(re)),void 0,!0)]),_:3},8,["loading","loading-text","loading-config"])],2)}}}),[["__scopeId","data-v-fa1a6ad5"]])),A0="mc-table-plus",V0="mc-table-header",I0="mc-table-sort",D0="mc-table-body",R0="mc-table-row",L0="mc-table-cell",z0="mc-table-empty",$0="mc-table-loading",P0="mc-table-scroll",j0="mc-table-footer",F0="mc-table-total",H0="mc-page-size",W0="mc-table-pagination",K0="mc-table-pagination-item",q0="mc-table-ellipsis",cr={fixed:"none",sortable:!1,columnAlign:"left",rowAlign:"center",sortType:"string"},bd=Symbol("mc-table-context"),Gn=()=>{const t=r.inject(bd,void 0);return{tableCtx:t,data:t.data,tableWidth:t.tableWidth,isLoading:r.computed(()=>!!t.isLoading.value),columnWidth:t.columnWidth,leftColumns:t.leftColumns,rightColumns:t.rightColumns,centerColumns:t.centerColumns,scroll:t.scroll,setScroll:t.setScroll,pagination:t.pagination,handlePagination:t.handlePagination,doSort:t.handleSort,isExpanded:t.isExpanded,getExpandData:t.getExpandData,setExpandData:t.setExpandData,removeExpandData:t.removeExpandData,getCurrentSort:t.getCurrentSort,expandCondition:t.expandCondition,fetchExpandData:t.fetchExpandData,leftWidth:t.leftWidth,rightWidth:t.rightWidth,centerWidth:t.centerWidth,viewWidth:t.viewWidth}},wd={pageNum:1,pageSize:25,total:1,pageSizes:[25,50,75,100]},xd="mc-table-column-plus",SN={class:"mc-table-column"},U0=X(r.defineComponent({name:xd,__name:"mc-table-column-plus",props:{prop:{},label:{},desc:{},width:{},fixed:{},sortable:{type:Boolean},columnAlign:{},rowAlign:{},sortType:{type:[String,Function]},defaultValue:{type:[String,Number,Boolean]}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",SN))})),EN=(t=ct)=>{switch(t){case"left":return"flex-start";case"center":return"center";case"right":return"flex-end"}},MN={key:0,class:"mc-table-row-tr mc-table-row-left"},NN={class:"mc-table-row-center-content"},BN={key:3,class:"mc-table-row-tr mc-table-row-right"},TN=r.defineComponent({name:R0,__name:"mc-table-row",props:{type:{default:"body"},leftColumns:{default:()=>[]},rightColumns:{default:()=>[]},centerColumns:{default:()=>[]}},setup(t){const e=t,n=r.ref(),{scroll:o,setScroll:s,leftWidth:i,rightWidth:a,centerWidth:l,viewWidth:c}=Gn();r.onMounted(()=>{p(o.value)}),r.watch(()=>o.value,h=>{p(h)});const d=r.computed(()=>e.rightColumns.length>0&&o.value>0),u=r.computed(()=>{const h=Rs(c.value)+Rs(o.value)+5<Rs(l.value);return e.leftColumns.length>0&&h}),p=h=>{n.value&&n.value.scrollTo({left:h})};return zs(n,"scroll",h=>{const f=h.target.scrollLeft||0;s(f)}),(h,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-table-row",[`mc-table-row-${t.type}`]])},[t.leftColumns.length?(r.openBlock(),r.createElementBlock("tr",MN,[r.renderSlot(h.$slots,"left",{columns:t.leftColumns},void 0,!0)])):r.createCommentVNode("",!0),d.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:"mc-table-border mc-table-row-left-border",style:r.normalizeStyle({left:r.unref(Ja)(r.unref(i))})},null,4)):r.createCommentVNode("",!0),r.createElementVNode("div",{ref_key:"rowRef",ref:n,class:"mc-table-row-tr mc-table-row-center"},[r.createElementVNode("div",NN,[r.renderSlot(h.$slots,"default",{columns:t.centerColumns},void 0,!0)])],512),u.value?(r.openBlock(),r.createElementBlock("div",{key:2,class:"mc-table-border mc-table-row-right-border",style:r.normalizeStyle({right:r.unref(Ja)(r.unref(a))})},null,4)):r.createCommentVNode("",!0),t.rightColumns.length?(r.openBlock(),r.createElementBlock("tr",BN,[r.renderSlot(h.$slots,"right",{columns:t.rightColumns},void 0,!0)])):r.createCommentVNode("",!0)],2))}}),Cd=K(TN,[["__scopeId","data-v-07610e84"]]),ON=K(r.defineComponent({name:I0,__name:"mc-table-sort",props:{sort:{default:"normal"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-table-sort",`mc-table-sort-${t.sort}`])},[r.createVNode(r.unref(ce),{name:"Up-Chevron02",class:r.normalizeClass({"mc-table-sort-actived":t.sort==="asc"}),style:{height:"8px"}},null,8,["class"]),r.createVNode(r.unref(ce),{name:"Down-Chevron02",class:r.normalizeClass({"mc-table-sort-actived":t.sort==="desc"}),style:{height:"8px"}},null,8,["class"])],2))}),[["__scopeId","data-v-b687f674"]]),_N={class:"mc-table-header-cell-title"},AN={class:"mc-table-header-cell-title-text"},VN={key:0,class:"mc-table-header-cell-sort"},IN={class:"mc-table-header-cell-desc"},DN={class:"mc-table-body-cell-value"},bn=K(r.defineComponent({name:L0,__name:"mc-table-cell",props:{column:{},width:{},type:{default:"body"},row:{},rowIndex:{}},setup(t){const e=r.ref(),{isHeader:n,isExpand:o,isExpandIcon:s,cellStyle:i,headerCtx:a,bodyCtx:l,expandIconCtx:c}=(d=>{var z;const{columnWidth:u,doSort:p,isExpanded:h,setExpandData:f,removeExpandData:m,getCurrentSort:g,expandCondition:v,fetchExpandData:k}=Gn(),y=ke("column"),b=ke("type"),x=ke("width"),w=r.computed(()=>b.value==="header"),C=r.computed(()=>b.value==="body"),S=r.computed(()=>b.value==="expand"),E=r.computed(()=>b.value==="expand-icon"),M=r.computed(()=>{var O,V;const _=x.value?`${x.value}px`:u!=null&&u.value?`${u.value}px`:"auto";let I="default";return w.value&&((O=y==null?void 0:y.value)!=null&&O.sortable)&&(I="pointer"),{width:_,cursor:I,alignItems:E.value?"center":EN((V=y==null?void 0:y.value)==null?void 0:V.columnAlign)}});let N={},T={},R={};if(w.value){const _=r.computed(()=>{var I;return Ve(g)?g(((I=y==null?void 0:y.value)==null?void 0:I.prop)||""):"normal"});if((z=y==null?void 0:y.value)!=null&&z.sortable){const I=zo(()=>{var O;p(((O=y==null?void 0:y.value)==null?void 0:O.prop)||"",(V=>{switch(V){case"normal":return"desc";case"desc":return"asc";default:return"normal"}})(_.value))},500);zs(d,"click",I)}N={currentSort:_}}else if(E.value){const _=ke("row"),I=ke("rowIndex"),O=r.computed(()=>!Ve(v)||r.unref(v(_==null?void 0:_.value))),V=r.computed(()=>{const A=I==null?void 0:I.value;return!xe(A)&&h(A)}),P=zo(async()=>{if(xe(I==null?void 0:I.value))return;let A=[];Ve(k)&&!V.value?(A=r.unref(await k(_==null?void 0:_.value)),f(I.value,A)):m(I.value)},500);r.watchEffect(()=>{var A,L;O.value?(A=d.value)==null||A.addEventListener("click",P):(L=d.value)==null||L.removeEventListener("click",P)}),r.onBeforeMount(()=>{var A;(A=d.value)==null||A.removeEventListener("click",P)}),R={allowExpand:O,isExpanded:V}}else if(C.value){const _=ke("row");T={displayValue:r.computed(()=>{var V,P;const I=((V=y==null?void 0:y.value)==null?void 0:V.defaultValue)||"--",O=(P=y==null?void 0:y.value)==null?void 0:P.prop;return xe(O)||xe(_==null?void 0:_.value)||xe(_.value[O])?I:_.value[O]})}}return{isHeader:w,isBody:C,isExpand:S,isExpandIcon:E,cellStyle:M,headerCtx:N,bodyCtx:T,expandIconCtx:R}})(e);return(d,u)=>r.unref(n)?(r.openBlock(),r.createElementBlock("th",{key:0,ref_key:"cellRef",ref:e,class:r.normalizeClass(`mc-table-${t.type}-cell`),style:r.normalizeStyle(r.unref(i))},[r.renderSlot(d.$slots,"header",{},()=>{var p;return[r.createElementVNode("div",_N,[r.createElementVNode("div",AN,[r.renderSlot(d.$slots,"title",{},()=>[r.createTextVNode(r.toDisplayString(t.column.label),1)],!0)]),t.column.sortable?(r.openBlock(),r.createElementBlock("div",VN,[r.createVNode(ON,{sort:(p=r.unref(a).currentSort)==null?void 0:p.value},null,8,["sort"])])):r.createCommentVNode("",!0)]),t.column.desc||d.$slots.desc?r.renderSlot(d.$slots,"desc",{key:0},()=>[r.createElementVNode("div",IN,r.toDisplayString(t.column.desc),1)],!0):r.createCommentVNode("",!0)]},!0)],6)):r.unref(o)?(r.openBlock(),r.createElementBlock("td",{key:1,ref_key:"cellRef",ref:e,class:r.normalizeClass(`mc-table-${t.type}-cell`),style:r.normalizeStyle(r.unref(i))},[r.renderSlot(d.$slots,"default",{},void 0,!0)],6)):r.unref(s)?(r.openBlock(),r.createElementBlock("td",{key:2,ref_key:"cellRef",ref:e,class:r.normalizeClass(`mc-table-${t.type}-cell`),style:r.normalizeStyle(r.unref(i))},[r.renderSlot(d.$slots,"default",{},()=>{var p,h,f;return[(p=r.unref(c).allowExpand)!=null&&p.value?(r.openBlock(),r.createBlock(r.unref(Bn),{key:0,class:r.normalizeClass(["mc-table-expand-icon",{"mc-table-expand-icon-active":(h=r.unref(c).isExpanded)==null?void 0:h.value}]),cursor:(f=r.unref(c).allowExpand)!=null&&f.value?"pointer":"default",name:"down-chevron"},null,8,["class","cursor"])):r.createCommentVNode("",!0)]},!0)],6)):(r.openBlock(),r.createElementBlock("td",{key:3,ref_key:"cellRef",ref:e,class:r.normalizeClass([`mc-table-${t.type}-cell`,`mc-table-${t.type}-cell-row-align-${t.column.rowAlign}`]),style:r.normalizeStyle(r.unref(i))},[r.renderSlot(d.$slots,"default",{},()=>{var p;return[r.createElementVNode("span",DN,r.toDisplayString((p=r.unref(l).displayValue)==null?void 0:p.value),1)]},!0)],6))}}),[["__scopeId","data-v-2ac704bd"]]),RN={class:"mc-table-header"},LN={class:"mc-table-header-thead"},zN=K(r.defineComponent({name:V0,__name:"mc-table-header",setup(t){const{leftColumns:e,rightColumns:n,centerColumns:o}=Gn();return(s,i)=>(r.openBlock(),r.createElementBlock("table",RN,[r.createElementVNode("thead",LN,[r.createVNode(Cd,{type:"header","left-columns":r.unref(e),"right-columns":r.unref(n),"center-columns":r.unref(o)},{left:r.withCtx(({columns:a})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a,l=>(r.openBlock(),r.createBlock(bn,{key:l.prop,column:l,width:l.width,type:"header"},r.createSlots({_:2},[l.header?{name:"header",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.header)))]),key:"0"}:void 0,l.headerTitle?{name:"title",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerTitle)))]),key:"1"}:void 0,l.headerDesc?{name:"desc",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerDesc)))]),key:"2"}:void 0]),1032,["column","width"]))),128))]),default:r.withCtx(({columns:a})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a,l=>(r.openBlock(),r.createBlock(bn,{key:l.prop,column:l,width:l.width,type:"header"},r.createSlots({_:2},[l.header?{name:"header",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.header)))]),key:"0"}:void 0,l.headerTitle?{name:"title",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerTitle)))]),key:"1"}:void 0,l.headerDesc?{name:"desc",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerDesc)))]),key:"2"}:void 0]),1032,["column","width"]))),128))]),right:r.withCtx(({columns:a})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a,l=>(r.openBlock(),r.createBlock(bn,{key:l.prop,column:l,width:l.width,type:"header"},r.createSlots({_:2},[l.header?{name:"header",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.header)))]),key:"0"}:void 0,l.headerTitle?{name:"title",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerTitle)))]),key:"1"}:void 0,l.headerDesc?{name:"desc",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerDesc)))]),key:"2"}:void 0]),1032,["column","width"]))),128))]),_:1},8,["left-columns","right-columns","center-columns"])])]))}}),[["__scopeId","data-v-f42fcd80"]]),$N={key:0,class:"mc-table-total"},PN={class:"mc-table-total-number"},jN={class:"mc-table-total-number"},FN=K(r.defineComponent({name:F0,__name:"mc-table-total",setup(t){const{pagination:e}=Gn(),n=r.computed(()=>{if(!e)return;const{pageNum:o,pageSize:s,total:i}=e;return{range:`${(o-1)*s+1}-${Math.min(o*s,i)}`,total:i}});return(o,s)=>n.value?(r.openBlock(),r.createElementBlock("div",$N,[s[0]||(s[0]=r.createElementVNode("span",null,"Showing",-1)),r.createElementVNode("span",PN,r.toDisplayString(n.value.range),1),s[1]||(s[1]=r.createElementVNode("span",null,"of",-1)),r.createElementVNode("span",jN,r.toDisplayString(n.value.total),1)])):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-f242f0b2"]]),HN={class:"mc-table-ellipsis"},WN=K(r.defineComponent({name:q0,__name:"mc-table-ellipsis",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",HN,[...n[0]||(n[0]=[r.createElementVNode("i",{class:"mc-table-ellipsis-dot"},null,-1),r.createElementVNode("i",{class:"mc-table-ellipsis-dot"},null,-1),r.createElementVNode("i",{class:"mc-table-ellipsis-dot"},null,-1)])]))}),[["__scopeId","data-v-3c0b84f7"]]),wn=K(r.defineComponent({name:K0,__name:"mc-table-pagination-item",props:{type:{default:"page"},value:{default:1},isActive:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>{switch(e.type){case"page":return"mc-table-pagination-item-page";case"prev":return"mc-table-pagination-item-prev";case"next":return"mc-table-pagination-item-next";case"first":return"mc-table-pagination-item-first";case"last":return"mc-table-pagination-item-last";case"ellipsis":return"mc-table-pagination-item-ellipsis";default:return"mc-table-pagination-item"}});return(o,s)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-table-pagination-item",[{"mc-table-pagination-item-active":t.isActive,"mc-table-pagination-item-disabled":t.isDisabled},n.value]])},[t.type==="page"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createTextVNode(r.toDisplayString(t.value),1)],64)):t.type==="prev"?(r.openBlock(),r.createBlock(r.unref(ce),{key:1,name:"Left-Chevron"})):t.type==="next"?(r.openBlock(),r.createBlock(r.unref(ce),{key:2,name:"Right-Chevron"})):t.type==="first"?(r.openBlock(),r.createBlock(r.unref(ce),{key:3,name:"First"})):t.type==="last"?(r.openBlock(),r.createBlock(r.unref(ce),{key:4,name:"Last"})):t.type==="ellipsis"?(r.openBlock(),r.createBlock(WN,{key:5})):r.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-f2d32b30"]]),KN={key:0,class:"mc-table-pagination"},qN=r.defineComponent({name:W0,__name:"mc-table-pagination",setup(t){const{pagination:e,isLoading:n,handlePagination:o}=Gn(),s=r.computed(()=>e?Math.ceil(e.total/e.pageSize):0),i=r.computed(()=>{if(!e||s.value<=1)return[];const h=[];if(s.value<=5)for(let f=2;f<s.value;f++)h.push(f);else e.pageNum<=2?h.push(2,3,4,5):e.pageNum>=s.value-1?h.push(s.value-4,s.value-3,s.value-2,s.value-1):h.push(e.pageNum-1,e.pageNum,e.pageNum+1);return h}),a=r.computed(()=>!e||e.pageNum<=1),l=r.computed(()=>!e||e.pageNum>=s.value),c=r.computed(()=>!e||s.value<=1),d=r.computed(()=>!!e&&s.value>5&&e.pageNum>2),u=r.computed(()=>!!e&&s.value>5&&e.pageNum<s.value-1),p=h=>{Ve(o)&&!n.value&&(h==="first"?a.value||o({pageNum:1}):h==="prev"?e&&e.pageNum>1&&!a.value&&o({pageNum:e.pageNum-1}):h==="next"?e&&e.pageNum<s.value&&!l.value&&o({pageNum:e.pageNum+1}):h==="last"?l.value||o({pageNum:s.value}):h!==(e==null?void 0:e.pageNum)&&o({pageNum:h}))};return(h,f)=>{var m,g;return c.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("ul",KN,[r.createVNode(wn,{type:"first","is-disabled":a.value,onClick:f[0]||(f[0]=v=>p("first"))},null,8,["is-disabled"]),r.createVNode(wn,{type:"prev","is-disabled":a.value,onClick:f[1]||(f[1]=v=>p("prev"))},null,8,["is-disabled"]),r.createVNode(wn,{value:1,"is-active":((m=r.unref(e))==null?void 0:m.pageNum)===1,onClick:f[2]||(f[2]=v=>p(1))},null,8,["is-active"]),d.value?(r.openBlock(),r.createBlock(wn,{key:0,type:"ellipsis"})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,v=>{var k;return r.openBlock(),r.createBlock(wn,{key:v,value:v,"is-active":((k=r.unref(e))==null?void 0:k.pageNum)===v,onClick:y=>p(v)},null,8,["value","is-active","onClick"])}),128)),u.value?(r.openBlock(),r.createBlock(wn,{key:1,type:"ellipsis"})):r.createCommentVNode("",!0),r.createVNode(wn,{value:s.value,"is-active":((g=r.unref(e))==null?void 0:g.pageNum)===s.value,onClick:f[3]||(f[3]=v=>p(s.value))},null,8,["value","is-active"]),r.createVNode(wn,{type:"next","is-disabled":l.value,onClick:f[4]||(f[4]=v=>p("next"))},null,8,["is-disabled"]),r.createVNode(wn,{type:"last","is-disabled":l.value,onClick:f[5]||(f[5]=v=>p("last"))},null,8,["is-disabled"])]))}}}),UN=K(qN,[["__scopeId","data-v-df311846"]]),GN={class:"mc-table-page-size"},JN={class:"mc-table-page-size-group"},YN=["onClick"],XN=K(r.defineComponent({name:H0,__name:"mc-table-page-size",setup(t){const{pagination:e,isLoading:n,handlePagination:o}=Gn();return(s,i)=>{var a;return r.openBlock(),r.createElementBlock("div",GN,[i[0]||(i[0]=r.createElementVNode("span",{class:"mc-table-page-size-text"},"View per page",-1)),r.createElementVNode("ul",JN,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList((a=r.unref(e))==null?void 0:a.pageSizes,l=>{var c;return r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-table-page-size-group-item",{"mc-table-page-size-group-item-active":l===((c=r.unref(e))==null?void 0:c.pageSize)}]),key:l,onClick:d=>(u=>{Ve(o)&&!n.value&&o({pageSize:u,pageNum:1})})(l)},r.toDisplayString(l),11,YN)}),128))])])}}}),[["__scopeId","data-v-180a8b6e"]]),ZN={class:"mc-table-footer"},QN=K(r.defineComponent({name:j0,__name:"mc-table-footer",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",ZN,[r.createVNode(FN),r.createVNode(UN),r.createVNode(XN)]))}),[["__scopeId","data-v-1fc62add"]]),eB={class:"mc-table-loading"},tB=K(r.defineComponent({name:$0,__name:"mc-table-loading",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",eB,[r.renderSlot(e.$slots,"default",{},()=>[r.createVNode(r.unref(wl),{loading:!0,type:"pulse",size:"small"})],!0)]))}),[["__scopeId","data-v-fb443fd0"]]),nB={class:"mc-table-body"},oB={class:"mc-table-body-tbody"},rB=K(r.defineComponent({name:D0,__name:"mc-table-body",props:{loading:{type:Boolean,default:!1}},setup(t){const{data:e,leftColumns:n,rightColumns:o,centerColumns:s,isExpanded:i,getExpandData:a}=Gn();return(l,c)=>(r.openBlock(),r.createElementBlock("table",nB,[r.createElementVNode("tbody",oB,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(e),(d,u)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:u},[r.createVNode(Cd,{"left-columns":r.unref(n),"right-columns":r.unref(o),"center-columns":r.unref(s)},{left:r.withCtx(({columns:p})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,h=>(r.openBlock(),r.createBlock(bn,{key:h.prop,column:h,row:d,rowIndex:u,width:h.width,type:h.isExpand?"expand-icon":"body"},r.createSlots({_:2},[h.tableValue?{name:"default",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(h.tableValue),{value:d==null?void 0:d[h.prop],row:d,rowIndex:u},null,8,["value","row","rowIndex"]))]),key:"0"}:void 0]),1032,["column","row","rowIndex","width","type"]))),128))]),default:r.withCtx(({columns:p})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,h=>(r.openBlock(),r.createBlock(bn,{key:h.prop,column:h,row:d,rowIndex:u,width:h.width,type:h.isExpand?"expand-icon":"body"},r.createSlots({_:2},[h.tableValue?{name:"default",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(h.tableValue),{value:d==null?void 0:d[h.prop],row:d,rowIndex:u},null,8,["value","row","rowIndex"]))]),key:"0"}:void 0]),1032,["column","row","rowIndex","width","type"]))),128))]),right:r.withCtx(({columns:p})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,h=>(r.openBlock(),r.createBlock(bn,{key:h.prop,column:h,row:d,rowIndex:u,width:h.width,type:h.isExpand?"expand-icon":"body"},r.createSlots({_:2},[h.tableValue?{name:"default",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(h.tableValue),{value:d==null?void 0:d[h.prop],row:d,rowIndex:u},null,8,["value","row","rowIndex"]))]),key:"0"}:void 0]),1032,["column","row","rowIndex","width","type"]))),128))]),_:2},1032,["left-columns","right-columns","center-columns"]),r.unref(i)(u)?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(a)(u),(p,h)=>(r.openBlock(),r.createBlock(Cd,{key:h,"left-columns":r.unref(n),"right-columns":r.unref(o),"center-columns":r.unref(s),type:"expand"},{left:r.withCtx(({columns:f})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f,m=>(r.openBlock(),r.createBlock(bn,{key:m.prop,column:m,width:m.width,type:"expand"},{default:r.withCtx(()=>[m.expand?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.expand),{key:0,expandRow:p,expandRowIndex:h},null,8,["expandRow","expandRowIndex"])):r.createCommentVNode("",!0)]),_:2},1032,["column","width"]))),128))]),default:r.withCtx(({columns:f})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f,m=>(r.openBlock(),r.createBlock(bn,{key:m.prop,column:m,width:m.width,type:"expand"},{default:r.withCtx(()=>[m.expand?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.expand),{key:0,expandRow:p,expandRowIndex:h},null,8,["expandRow","expandRowIndex"])):r.createCommentVNode("",!0)]),_:2},1032,["column","width"]))),128))]),right:r.withCtx(({columns:f})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f,m=>(r.openBlock(),r.createBlock(bn,{key:m.prop,column:m,width:m.width,type:"expand"},{default:r.withCtx(()=>[m.expand?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.expand),{key:0,expandRow:p,expandRowIndex:h},null,8,["expandRow","expandRowIndex"])):r.createCommentVNode("",!0)]),_:2},1032,["column","width"]))),128))]),_:2},1032,["left-columns","right-columns","center-columns"]))),128)):r.createCommentVNode("",!0)],64))),128))]),t.loading?(r.openBlock(),r.createBlock(tB,{key:0},{default:r.withCtx(()=>[r.renderSlot(l.$slots,"loading",{},void 0,!0)]),_:3})):r.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-68cb46c9"]]),sB={class:"mc-table-empty"},iB=K(r.defineComponent({name:z0,__name:"mc-table-empty",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",sB,[r.renderSlot(e.$slots,"default",{},()=>[n[0]||(n[0]=r.createElementVNode("p",{class:"mc-table-empty-content"},"No available data",-1))],!0)]))}),[["__scopeId","data-v-f58471d5"]]),aB=r.defineComponent({name:P0,__name:"mc-table-scroll",setup(t){const{scroll:e,centerWidth:n,viewWidth:o,tableWidth:s,setScroll:i}=Gn(),a=r.ref(),l=r.ref(),c=r.computed(()=>Au(o.value/n.value*100)),d=r.computed(()=>Rs(c.value)<=95),u=r.computed(()=>`${c.value}%`),p=r.ref(0);r.watchEffect(()=>{p.value=n.value?e.value*s.value/n.value:0});let h=0,f=0;const m=y=>{a.value&&(h=y.clientX,f=p.value,window.addEventListener("mousemove",g),window.addEventListener("mouseup",v))},g=y=>{var S,E;let b=y.clientX-h+f;b<0&&(b=0);const x=((E=(S=l.value)==null?void 0:S.getBoundingClientRect())==null?void 0:E.width)||0,w=s.value-x+2;b>w&&(b=w),p.value=b;const C=p.value*n.value/s.value;i(C)},v=()=>{k()},k=()=>{window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",v)};return r.onBeforeUnmount(()=>{k()}),(y,b)=>d.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:a,class:"mc-table-scroll",onMousedown:m},[r.createElementVNode("div",{ref_key:"thumbRef",ref:l,class:"mc-table-scroll-thumb",style:r.normalizeStyle({width:u.value,transform:`translateX(${r.unref(Ja)(p.value)})`})},null,4)],544)):r.createCommentVNode("",!0)}}),lB=K(aB,[["__scopeId","data-v-3b46e14e"]]),cB=r.defineComponent({name:A0,__name:"mc-table-plus",props:{data:{default:()=>[]},loading:{type:Boolean,default:!1},sortType:{default:"back"},pagination:{},width:{default:"100%"},height:{},expandCondition:{},fetchExpandData:{}},emits:["change:sort","change:pagination","change:expand"],setup(t,{emit:e}){const n=t,o=e,s=r.ref(),{width:i,height:a}=$t(),l=r.ref(n.data),{columns:c,leftColumns:d,centerColumns:u,rightColumns:p,tableWidth:h,columnWidth:f}=(A=>{const L=r.ref([]),j=r.ref([]),q=r.ref([]),H=r.ref([]),U=r.ref(0),Y=r.reactive({tableWidth:0,fixedWidth:0,restColumns:0}),J=r.useSlots();r.watch(()=>{var oe;return(oe=J.default)==null?void 0:oe.call(J)},()=>{var Z;const{columns:oe,columnWidthInfo:fe,leftColumns:le,centerColumns:me,rightColumns:Be}=(se=>{const ae=[],re=[],Ce=[],nt=[],Oe={tableWidth:0,fixedWidth:0,restColumns:0},_e=ue=>{de(ue)&&ue.forEach(ge=>{var ft;if(((ft=(ge==null?void 0:ge.type)||{})==null?void 0:ft.name)===xd){const we=ge.children,D=ge.props,W=Lo(D==null?void 0:D.sortable)&&D.sortable===""||(D==null?void 0:D.sortable)||cr.sortable,ee={prop:D==null?void 0:D.prop,label:D==null?void 0:D.label,desc:D==null?void 0:D.desc,width:(D==null?void 0:D.prop)==="expand"?40:D==null?void 0:D.width,fixed:(D==null?void 0:D.fixed)||cr.fixed,defaultValue:D==null?void 0:D.defaultValue,sortable:W,isExpand:(D==null?void 0:D.prop)==="expand",sortType:(D==null?void 0:D.sortType)||(D==null?void 0:D["sort-type"])||cr.sortType,columnAlign:(D==null?void 0:D.columnAlign)||(D==null?void 0:D["column-align"])||cr.columnAlign,rowAlign:(D==null?void 0:D.rowAlign)||(D==null?void 0:D["row-align"])||cr.rowAlign,headerTitle:we==null?void 0:we["header-title"],headerDesc:we==null?void 0:we["header-desc"],header:we==null?void 0:we.header,expand:we==null?void 0:we.expand,tableValue:we==null?void 0:we.default};ee.width?Oe.fixedWidth+=ee.width:Oe.restColumns+=1,ee.fixed==="left"?re.push(ee):ee.fixed==="right"?nt.push(ee):Ce.push(ee),ae.push(ee)}else Array.isArray(ge.children)&&_e(ge.children)})};return _e(se),{columns:ae,columnWidthInfo:Oe,leftColumns:re,centerColumns:Ce,rightColumns:nt}})((Z=J.default)==null?void 0:Z.call(J));L.value=oe,Y.fixedWidth=fe.fixedWidth,Y.restColumns=fe.restColumns,j.value=le,q.value=me,H.value=Be},{immediate:!0}),Ya(A,({width:oe})=>{let fe=oe;j.value.length>0&&(fe-=1),H.value.length>0&&(fe-=1),U.value=fe});const Q=r.computed(()=>{const oe=(U.value-Y.fixedWidth)/Y.restColumns;return oe<=0?240:oe});return{columns:L,leftColumns:j,centerColumns:q,rightColumns:H,tableWidth:U,columnWidth:Q}})(s),{scroll:m,setScroll:g,resetScroll:v}=(()=>{const A=r.ref(0);return{scroll:A,setScroll:L=>{A.value=L},resetScroll:()=>{A.value=0}}})(),{setSort:k,resetSort:y,getCurrentSort:b,sortData:x}=(()=>{const A=r.ref({sort:"normal",sortColumn:""}),L=(q,H)=>{A.value={sort:H,sortColumn:q}},j=q=>A.value.sortColumn===q?A.value.sort:"normal";return{sortInfo:A,setSort:L,resetSort:()=>L("","normal"),getCurrentSort:j,sortData:(q,H)=>{let U=[...q];const Y=H.prop,J=j(Y),Q=H.sortType||"string";return J!=="normal"&&(Ve(Q)||(fe=Q==="number"?me=>Number(me[Y]):[Y],le=[J],U=(oe=U)==null?[]:(de(fe)||(fe=fe==null?[]:[fe]),de(le)||(le=le==null?[]:[le]),function(me,Be,Z){Be=Be.length?No(Be,function(ae){return de(ae)?function(re){return Ia(re,ae.length===1?ae[0]:ae)}:ae}):[Bo];var se=-1;return Be=No(Be,Ms(En)),function(ae){var re=ae.length;for(ae.sort(function(Ce,nt){return function(Oe,_e,ue){for(var ge=-1,at=Oe.criteria,ft=_e.criteria,we=at.length,D=ue.length;++ge<we;){var W=Hk(at[ge],ft[ge]);if(W)return ge>=D?W:W*(ue[ge]=="desc"?-1:1)}return Oe.index-_e.index}(Ce,nt,Z)});re--;)ae[re]=ae[re].value;return ae}(pp(me,function(ae,re,Ce){return{criteria:No(Be,function(nt){return nt(ae)}),index:++se,value:ae}}))}(oe,fe,le)))),U;var oe,fe,le}}})(),{pagination:w,hasPagination:C,handlePagination:S}=(()=>{const A=ke("pagination"),L=r.reactive({...wd});r.onMounted(()=>{j(A.value||wd)});const j=Y=>{Jy(L,{...Y})};r.watch(()=>A.value,Y=>{j(Y||wd)},{deep:!0});const q=r.getCurrentInstance(),H=Is(()=>{q==null||q.emit("change:pagination",L)},500),U=r.computed(()=>{var Y;return!!((Y=A.value)!=null&&Y.pageNum)});return{pagination:L,hasPagination:U,handlePagination:Y=>{j(Y),H()}}})(),{isExpanded:E,getExpandData:M,resetExpandData:N,setExpandData:T,removeExpandData:R}=(()=>{const A=r.reactive(new Map);return{expandData:A,isExpanded:L=>A.has(L),getExpandData:L=>A.get(L)||[],resetExpandData:()=>{A.clear()},setExpandData:(L,j)=>{A.set(L,j)},removeExpandData:L=>{A.delete(L)}}})(),{leftWidth:z,rightWidth:_,centerWidth:I,viewWidth:O}=(A=>{const{leftColumns:L,rightColumns:j,centerColumns:q,tableWidth:H,columnWidth:U}=A,Y=le=>function(me,Be,Z){var se=de(me)?fu:Gk,ae=arguments.length<3;return se(me,En(Be),Z,ae,kr)}(le,(me,Be)=>me+(Be.width||U.value),0),J=r.computed(()=>Y(L.value)),Q=r.computed(()=>Y(j.value)),oe=r.computed(()=>Y(q.value)),fe=r.computed(()=>H.value-J.value-Q.value);return{leftWidth:J,rightWidth:Q,centerWidth:oe,viewWidth:fe}})({leftColumns:d,rightColumns:p,centerColumns:u,tableWidth:h,columnWidth:f});r.watch(()=>n.data,()=>{l.value=n.data,N(),y(),v()});const V=r.computed(()=>{var A;return!n.loading&&!((A=l.value)!=null&&A.length)}),P=r.computed(()=>C.value&&!V.value);return r.provide(bd,{data:l,tableWidth:h,isLoading:r.computed(()=>!!n.loading),columns:c,columnWidth:f,leftColumns:d,rightColumns:p,centerColumns:u,scroll:m,setScroll:g,pagination:w,handlePagination:S,handleSort:(A,L)=>{if(N(),k(A,L),n.sortType==="front"){const j=Ro(c.value,q=>q.prop===A);j&&(l.value=x(n.data,j))}else o("change:sort",A,L)},getCurrentSort:b,isExpanded:E,getExpandData:M,setExpandData:(A,L)=>{T(A,L),o("change:expand",l.value[A],!0)},removeExpandData:A=>{R(A),o("change:expand",l.value[A],!1)},expandCondition:n.expandCondition,fetchExpandData:n.fetchExpandData,leftWidth:z,rightWidth:_,centerWidth:I,viewWidth:O}),(A,L)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-table-plus",style:r.normalizeStyle({width:r.unref(i),height:r.unref(a)}),ref_key:"tableRef",ref:s},[r.createElementVNode("div",null,[r.createVNode(zN),V.value?(r.openBlock(),r.createBlock(iB,{key:1},{default:r.withCtx(()=>[r.renderSlot(A.$slots,"empty",{},void 0,!0)]),_:3})):(r.openBlock(),r.createBlock(rB,{key:0,loading:t.loading},null,8,["loading"]))]),r.createVNode(lB),P.value?(r.openBlock(),r.createBlock(QN,{key:0})):r.createCommentVNode("",!0)],4))}}),G0=X(K(cB,[["__scopeId","data-v-acae2d99"]])),J0="mc-textarea",dB=["value","id","disabled","maxlength","placeholder"],uB={class:"mc-textarea-count"},pB=r.defineComponent({name:J0,__name:"mc-textarea",props:{modelValue:{default:""},placeholder:{default:"Please input"},disabled:{type:Boolean,default:!1},showCount:{type:Boolean,default:!0},width:{default:"100%"},height:{default:88},resize:{default:"vertical"},maxLength:{default:255}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:e}){const n=t,o=e,{width:s,height:i}=$t(),a=r.ref(),{wrapperRef:l,isFocused:c,handleFocus:d,handleBlur:u}=$o(a),{formId:p,validateStyle:h,formDisabled:f,validateByTrigger:m}=cn(),g=async b=>{let x=b.target.value;n.maxLength>0&&x.length>n.maxLength&&(x=x.slice(0,n.maxLength)),o("update:modelValue",x),o("change",x),await r.nextTick(),m("input")},v=r.useSlots(),k=r.computed(()=>!!n.showCount&&n.maxLength>0||!!v.count),y=r.computed(()=>{var b;return((b=n.modelValue)==null?void 0:b.length)??0});return(b,x)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"textareaWrapperRef",ref:l,class:r.normalizeClass(["mc-textarea",{"mc-textarea-disabled":r.unref(f),"mc-textarea-focused":r.unref(c),[r.unref(h)]:r.unref(h)}]),style:r.normalizeStyle({width:r.unref(s)})},[r.createElementVNode("textarea",{ref_key:"textareaRef",ref:a,value:t.modelValue,id:r.unref(p),class:"mc-textarea-input",style:r.normalizeStyle({width:r.unref(s),height:r.unref(i),resize:t.resize}),disabled:r.unref(f),maxlength:t.maxLength,placeholder:t.placeholder,onFocus:x[0]||(x[0]=(...w)=>r.unref(d)&&r.unref(d)(...w)),onBlur:x[1]||(x[1]=(...w)=>r.unref(u)&&r.unref(u)(...w)),onInput:g},null,44,dB),k.value?r.renderSlot(b.$slots,"count",{key:0,maxLength:t.maxLength,currentLength:y.value},()=>[r.createElementVNode("div",uB,[r.createElementVNode("span",null,r.toDisplayString(`${y.value} / ${t.maxLength} characters`),1)])],!0):r.createCommentVNode("",!0)],6))}}),Y0=X(K(pB,[["__scopeId","data-v-1f25cddc"]])),Sd=t=>parseFloat(t).toString(),Ed=(t,e=2)=>t<1024?`${t} B`:t<1048576?`${Sd((t/1024).toFixed(e))} KB`:t<1073741824?`${Sd((t/1048576).toFixed(e))} MB`:`${Sd((t/1073741824).toFixed(e))} GB`,X0=t=>{if(!t)return"--";const e=new Date(t);return`${e.getFullYear()}/${String(e.getMonth()+1).padStart(2,"0")}/${String(e.getDate()).padStart(2,"0")} ${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`},Md=(t,e,n)=>{const o=t.get(e);t.set(e,{...o,...n})},Z0="mc-upload",Q0="mc-upload-dropzone",zt="[?]",Nd=["jpg","jpeg","png","doc","docx","xls","xlsx","pdf"],hB={upload_note:"Click to upload or drag and drop your files here",max_size:"Max file size:",max_count:"No limit on maximum number of documents but recommend that upload then in pdf if more than 5 files are to be upload.",uploaded_by:"Uploaded by",uploaded_on:"Uploaded on",limit_count:`The number of files cannot exceed ${zt} .`,limit_size:`The file size cannot exceed ${zt} .`,limit_type:`${zt} only`,limit_count_reached:`You can only upload ${zt} files.`},fB={upload_note:"单击即可上传或将文件拖放到此处",max_size:"最大文件大小:",max_count:"No limit on maximum number of documents but recommend that upload then in pdf if more than 5 files are to be upload.",uploaded_by:"上传用户",uploaded_on:"上传时间",limit_count:`文件数量不能超过 ${zt} 。`,limit_size:`最大文件大小:${zt} 。`,limit_type:`只接受文件格式:${zt}`,limit_count_reached:`您只能上传 ${zt} 个文件。`},Bd=()=>{const t=ke("lang");return{langMap:r.computed(()=>t.value==="zh"?fB:hB)}},mB={class:"mc-upload-dropzone-area"},gB={class:"mc-upload-dropzone-title"},vB={class:"mc-upload-dropzone-title-text"},yB={key:0,class:"mc-upload-dropzone-desc"},kB={key:0},bB={key:1},wB=r.defineComponent({name:Q0,__name:"mc-upload-dropzone",props:{title:{},icon:{default:"Document_Upload"},allowedFileTypes:{default:()=>Nd},fileSize:{default:15728640},uploadUser:{default:"--"},lang:{default:"en"},hideDesc:{type:Boolean,default:!1},fileCount:{}},emits:["upload","error:type","error:size"],setup(t,{expose:e,emit:n}){const o=t,s=n,{langMap:i}=Bd(),a=r.ref(),l=r.computed(()=>{var m;return(m=o.allowedFileTypes)!=null&&m.length?i.value.limit_type.replace(zt,Mn(o.allowedFileTypes,g=>g.toUpperCase()).join(", ")):void 0}),{isDragover:c}=((m,g)=>{const v=r.ref(!1),k=C=>{C!==v.value&&(v.value=C)},y=C=>{C.preventDefault(),k(!0),Ve(g.onDragEnter)&&g.onDragEnter(C)},b=C=>{C.preventDefault(),k(!1),Ve(g.onDragLeave)&&g.onDragLeave(C)},x=C=>{C.preventDefault(),Ve(g.onDragover)&&g.onDragover(C)},w=C=>{C.preventDefault(),k(!1),Ve(g.onDrop)&&g.onDrop(C)};return r.onMounted(()=>{var C,S,E,M;(C=m.value)==null||C.addEventListener("dragenter",y),(S=m.value)==null||S.addEventListener("dragleave",b),(E=m.value)==null||E.addEventListener("dragover",x),(M=m.value)==null||M.addEventListener("drop",w)}),r.onBeforeUnmount(()=>{var C,S,E,M;(C=m.value)==null||C.removeEventListener("dragenter",y),(S=m.value)==null||S.removeEventListener("dragleave",b),(E=m.value)==null||E.removeEventListener("dragover",x),(M=m.value)==null||M.removeEventListener("drop",w)}),{isDragover:v}})(a,{onDrop:m=>{var v;const g=(v=m.dataTransfer)==null?void 0:v.files;g&&f(g)}}),d=r.ref(),u=()=>{d.value&&(d.value.value="")},p=()=>{var m;(m=d.value)==null||m.click()},h=m=>{const g=m.target.files;g&&f(g)},f=async m=>{let g=Array.from(m);const v=new Map;g.forEach(k=>{Md(v,k.name,{name:k.name,size:k.size,status:"loading",uploadBy:o.uploadUser,uploadTime:Date.now(),file:k})}),((k,y)=>{const b=o.fileSize;if(b<=0)return!0;let x=!1;for(let w=0;w<k.length;w++){const C=k[w];C.size>b?(Md(y,C.name,{status:"failed",errorMessage:i.value.limit_size.replace(zt,`${Ed(b)}`)}),s("error:size",C.name)):x=!0}})(g,v),((k,y)=>{var C;const b=o.allowedFileTypes;if(!(b!=null&&b.length))return!0;let x=!1;const w=Mn(b,S=>S.toUpperCase());for(let S=0;S<k.length;S++)gt(w,((C=k[S].name.split(".").pop())==null?void 0:C.toUpperCase())??"--")?x=!0:(Md(y,k[S].name,{status:"failed",errorMessage:l.value}),s("error:type",k[S].name))})(g,v),s("upload",v),u()};return e({clearUploadInput:u}),(m,g)=>(r.openBlock(),r.createElementBlock("div",{ref:"wrapperRef",class:r.normalizeClass(["mc-upload-dropzone",{"mc-upload-dropzone-dragover":r.unref(c)}]),onClick:p},[r.createElementVNode("div",mB,[r.renderSlot(m.$slots,"default",{},()=>[r.createElementVNode("div",gB,[r.renderSlot(m.$slots,"title",{},()=>[r.createVNode(r.unref(ce),{name:t.icon},null,8,["name"]),r.createElementVNode("span",vB,r.toDisplayString(t.title||r.unref(i).upload_note),1)],!0)]),t.hideDesc?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",yB,[r.renderSlot(m.$slots,"desc",{},()=>[t.fileSize>0?(r.openBlock(),r.createElementBlock("span",kB,r.toDisplayString(r.unref(i).max_size)+" "+r.toDisplayString(r.unref(Ed)(t.fileSize)),1)):r.createCommentVNode("",!0),l.value?(r.openBlock(),r.createElementBlock("span",bB,r.toDisplayString(l.value),1)):r.createCommentVNode("",!0)],!0)]))],!0)]),r.createElementVNode("input",{ref_key:"uploadInputRef",ref:d,type:"file",multiple:"",style:{display:"none"},onChange:h},null,544),r.createElementVNode("div",{class:"mc-upload-dropzone-cover",ref_key:"coverRef",ref:a},null,512)],2))}}),xB=K(wB,[["__scopeId","data-v-39652196"]]),ey="mc-file-list",CB={class:"mc-file-list-item-content"},SB={class:"mc-file-list-item-file mc-file-list-item-info"},EB=["onClick"],MB={class:"mc-file-list-item-file-name-text"},NB={class:"mc-file-list-item-file-desc"},BB={class:"mc-file-list-item-file-size-text"},TB={key:0,class:"mc-file-list-item-file-progress-bar"},OB={key:1,class:"mc-file-list-item-file-error"},_B={class:"mc-file-list-item-info"},AB={class:"mc-file-list-item-label"},VB={class:"mc-file-list-item-value"},IB={class:"mc-file-list-item-info"},DB={class:"mc-file-list-item-label"},RB={class:"mc-file-list-item-value"},LB={class:"mc-file-list-item-actions"},zB={class:"mc-file-list-item-compact-content"},$B={class:"mc-file-list-item-info"},PB={class:"mc-file-list-item-label"},jB={class:"mc-file-list-item-value"},FB={class:"mc-file-list-item-info"},HB={class:"mc-file-list-item-label"},WB={class:"mc-file-list-item-value"},Td=X(K(r.defineComponent({name:ey,__name:"mc-file-list",props:{modelValue:{default:()=>[]},theme:{default:"light"},lang:{default:"en"},downloadable:{type:Boolean,default:!1},allowCancel:{type:Boolean,default:!1},deletable:{type:Boolean,default:!0}},emits:["update:modelValue","change","delete","download","preview","cancel"],setup(t,{emit:e}){const n=t,o=e,{langMap:s}=Bd(),i=r.ref(!1),a=r.ref();Ya(a,({width:c})=>{i.value=c<=600});const l=c=>{o("update:modelValue",n.modelValue.filter(d=>d.name!==c.name))};return(c,d)=>(r.openBlock(),r.createElementBlock("ul",{class:r.normalizeClass(["mc-file-list",[`mc-file-list-${t.theme}`,{"mc-file-list-compact":i.value}]]),ref_key:"fileListRef",ref:a},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.modelValue,u=>(r.openBlock(),r.createElementBlock("li",{class:"mc-file-list-item",key:u.name},[r.createElementVNode("div",CB,[r.createElementVNode("div",SB,[r.createElementVNode("div",{class:"mc-file-list-item-file-name",onClick:p=>(h=>{o("preview",h)})(u)},[r.createVNode(r.unref(ce),{name:"Document"}),r.createElementVNode("span",MB,r.toDisplayString(u.name),1)],8,EB),r.createElementVNode("div",NB,[u.status!=="failed"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("span",BB,r.toDisplayString(u.size?r.unref(Ed)(u.size):"--"),1),u.status==="loading"?(r.openBlock(),r.createElementBlock("div",TB,[r.createVNode(r.unref(Cl),{percentage:u.progress,"transition-duration":1e3},null,8,["percentage"])])):r.createCommentVNode("",!0)],64)):(r.openBlock(),r.createElementBlock("span",OB,r.toDisplayString(u.errorMessage||"failed to upload"),1))])]),i.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("div",_B,[r.createElementVNode("span",AB,r.toDisplayString(r.unref(s).uploaded_by),1),r.createElementVNode("span",VB,r.toDisplayString(u.uploadBy||"--"),1)]),r.createElementVNode("div",IB,[r.createElementVNode("span",DB,r.toDisplayString(r.unref(s).uploaded_on),1),r.createElementVNode("span",RB,r.toDisplayString(r.unref(X0)(u.uploadTime)||"--"),1)])],64)),r.createElementVNode("div",LB,[u.status==="loading"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[t.allowCancel?(r.openBlock(),r.createBlock(r.unref(ce),{key:0,name:"Cross",class:"mc-file-list-item-icon",onClick:p=>(h=>{o("cancel",h),l(h)})(u)},null,8,["onClick"])):r.createCommentVNode("",!0)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[t.downloadable?(r.openBlock(),r.createBlock(r.unref(ce),{key:0,name:"Download",class:"mc-file-list-item-icon",onClick:p=>(h=>{o("download",h)})(u)},null,8,["onClick"])):r.createCommentVNode("",!0),t.deletable?(r.openBlock(),r.createBlock(r.unref(ce),{key:1,name:"Trash",class:"mc-file-list-item-icon",onClick:p=>(h=>{o("delete",h),l(h)})(u)},null,8,["onClick"])):r.createCommentVNode("",!0)],64))])]),i.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createVNode(r.unref(vl)),r.createElementVNode("div",zB,[r.createElementVNode("div",$B,[r.createElementVNode("span",PB,r.toDisplayString(r.unref(s).uploaded_by),1),r.createElementVNode("span",jB,r.toDisplayString(u.uploadBy||"--"),1)]),r.createElementVNode("div",FB,[r.createElementVNode("span",HB,r.toDisplayString(r.unref(s).uploaded_on),1),r.createElementVNode("span",WB,r.toDisplayString(r.unref(X0)(u.uploadTime)||"--"),1)])])],64)):r.createCommentVNode("",!0)]))),128))],2))}}),[["__scopeId","data-v-df197365"]])),KB={key:0,class:"mc-upload-content"},qB={class:"mc-upload-content-icon"},UB={class:"mc-upload-content-text"},GB={class:"mc-upload-component"},JB={key:0,class:"mc-upload-dropzone-wrapper"},YB={class:"mc-upload-file-list-wrapper"},XB=r.defineComponent({name:Z0,__name:"mc-upload",props:{modelValue:{default:()=>[]},downloadable:{type:Boolean,default:!1},allowCancel:{type:Boolean,default:!1},deletable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},theme:{default:"light"},width:{default:"100%"},succeed:{type:Boolean,default:!1},title:{},icon:{default:"Document_Upload"},allowedFileTypes:{default:()=>Nd},fileSize:{default:15728640},uploadUser:{default:"--"},lang:{default:"en"},hideDesc:{type:Boolean,default:!1},fileCount:{}},emits:["update:modelValue","download:all","clear","error:type","error:size","upload","change","delete","download","preview","cancel"],setup(t,{expose:e,emit:n}){const o=t,s=n,{width:i}=$t(),a=r.useSlots(),l=r.computed(()=>!!a.content),c=r.ref(),d=r.reactive(new Map),{langMap:u}=Bd(),p=S=>(S=(E=>{if(o.fileCount&&E.length>o.fileCount){const M=u.value.limit_count_reached.replace(zt,o.fileCount.toString());return qs.error(M),E.slice(0,o.fileCount)}return E})(S)).length!==0&&(d.clear(),S.forEach(E=>{d.set(E.name,E)}),!0);r.watch(()=>o.modelValue,S=>{p(S)},{immediate:!0});const h=S=>Array.from([...S.values()]),f=S=>{s("update:modelValue",S)},m=S=>{var N;(N=c.value)==null||N.clearUploadInput();const E=h(S);if(!p([...o.modelValue,...E]))return;const M=h(d);s("update:modelValue",M),s("upload",M),s("change",M),w()},g=S=>{console.error("mc-upload: error:type:",S),s("error:type",S)},v=S=>{console.error("mc-upload: error:size:",S),s("error:size",S)},k=S=>{s("preview",S)},y=S=>{s("delete",S)},b=S=>{s("download",S)},x=S=>{s("cancel",S)},w=(S=99,E=100)=>{setTimeout(()=>{o.modelValue.forEach(M=>{M.status==="loading"&&(M.progress=S)})},E)},C=r.computed(()=>o.deletable&&!o.disabled);return e({clearFiles:()=>{d.clear(),s("clear"),s("update:modelValue",[]),s("change",[])},downloadAllFiles:()=>{s("download:all",h(d))}}),(S,E)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-upload",style:r.normalizeStyle({width:r.unref(i)})},[r.createElementVNode("div",{class:r.normalizeClass([{"mc-upload-wrapper":l.value},`mc-upload-wrapper-${t.theme}`])},[l.value?(r.openBlock(),r.createElementBlock("div",KB,[r.createElementVNode("div",qB,[t.succeed?(r.openBlock(),r.createBlock(r.unref(io),{key:1,width:"24px",height:"24px"})):(r.openBlock(),r.createBlock(r.unref(ce),{key:0,name:"Accept"}))]),r.createElementVNode("div",UB,[r.renderSlot(S.$slots,"content",{},void 0,!0)])])):r.createCommentVNode("",!0),r.createElementVNode("div",GB,[t.disabled?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",JB,[r.createVNode(xB,{ref_key:"uploadDropzoneRef",ref:c,"upload-user":t.uploadUser,"allowed-file-types":t.allowedFileTypes,"file-size":t.fileSize,icon:t.icon,lang:t.lang,theme:t.theme,"hide-desc":t.hideDesc,"file-count":t.fileCount,onUpload:m,"onError:type":g,"onError:size":v},{default:r.withCtx(()=>[r.renderSlot(S.$slots,"default",{},void 0,!0)]),title:r.withCtx(()=>[r.renderSlot(S.$slots,"title",{},void 0,!0)]),desc:r.withCtx(()=>[r.renderSlot(S.$slots,"desc",{},void 0,!0)]),_:3},8,["upload-user","allowed-file-types","file-size","icon","lang","theme","hide-desc","file-count"])])),r.createElementVNode("div",YB,[r.createVNode(r.unref(Td),{"model-value":t.modelValue,"allow-cancel":t.allowCancel,downloadable:t.downloadable,lang:t.lang,theme:t.theme,deletable:C.value,"onUpdate:modelValue":f,onPreview:k,onDelete:y,onDownload:b,onCancel:x},null,8,["model-value","allow-cancel","downloadable","lang","theme","deletable"])])])],2)],4))}}),ty=X(K(XB,[["__scopeId","data-v-92f6b3db"]])),ZB=[Bp,to,so,dh,ph,gh,wh,Ch,Eh,vl,Dh,Go,rh,ih,ce,Bn,bl,$h,jh,wl,Gs,Kh,Uh,Us,Ws,Cl,of,ef,tf,lf,sf,xl,yl,Qv,t0,o0,s0,a0,Gv,pd,us,md,c0,u0,f0,h0,m0,b0,k0,y0,io,S0,N0,E0,_0,U0,G0,ha,Y0,Ar,kl,kh,Uo,Td,ty];console.info("contact us with ayachinenesanobauxichi@gmail.com");const QB=(ny=ZB,t=>Ds(ny,e=>t.use(e)));var ny;B.ALLOW_FILE_TYPES=Nd,B.CHECKBOX_GROUP_INJECTION_KEY=ml,B.COLLAPSE_CONTEXT_KEY=gl,B.FONT_STYLE=So,B.FORM_CTX_KEY=Po,B.FORM_ITEM_CTX_KEY=fl,B.INPUT_GROUP_INJECTION_KEY=Vr,B.MC_ALERT_MESSAGE=Np,B.MC_BUTTON=Op,B.MC_CHECKBOX=lh,B.MC_CHECKBOX_GROUP=ch,B.MC_COLLAPSE=uh,B.MC_COLLAPSE_ITEM=mh,B.MC_COPY=bh,B.MC_COUNT=xh,B.MC_CURRENCY_ICON=Sh,B.MC_DIVIDER=Mh,B.MC_DRAWER=Ih,B.MC_FILE_LIST=ey,B.MC_FOOTER=Ah,B.MC_FORM=_p,B.MC_FORM_ITEM=sh,B.MC_ICON=Mp,B.MC_ICON_PLUS=hh,B.MC_INPUT=zh,B.MC_INPUT_GROUP=Rh,B.MC_LIGHTBOX=Ph,B.MC_LOADING=Fh,B.MC_MODAL_HEADER=_h,B.MC_MULTI_TAG=Wh,B.MC_OTP=qh,B.MC_OVERLAY=Nh,B.MC_POPPER=nh,B.MC_PROGRESS_BAR=Gh,B.MC_PROGRESS_INDICATOR=Yh,B.MC_PROGRESS_INDICATOR_CHILD_ITEM=El,B.MC_PROGRESS_INDICATOR_ITEM=Sl,B.MC_PROGRESS_INDICATOR_STEP=Xh,B.MC_PROGRESS_INDICATOR_STEP_NUM=Zh,B.MC_RADIO=af,B.MC_RADIO_GROUP=rf,B.MC_RADIO_GROUP_CTX=Ml,B.MC_REMOVABLE_TAG=Hh,B.MC_RESET=Bh,B.MC_RICHTEXT=Xv,B.MC_RICHTEXT_TOOL=Zv,B.MC_SECONDARY_MENU=e0,B.MC_SELECT=n0,B.MC_SELECT_GROUP=r0,B.MC_SELECT_GROUP_PLUS=fd,B.MC_SELECT_MULTI_OPTION=Uv,B.MC_SELECT_OPTION=i0,B.MC_SELECT_OPTION_PLUS=hd,B.MC_SELECT_PLUS=Jv,B.MC_SELECT_PLUS_CTX=pa,B.MC_STATUS=l0,B.MC_STEP=d0,B.MC_STEP_CHILD_ITEM_PLUS=yd,B.MC_STEP_ITEM_PLUS=vd,B.MC_STEP_PLUS=p0,B.MC_SUCCESS_ICON=Jh,B.MC_SWITCH=w0,B.MC_SWITCH_LABEL=x0,B.MC_TAB=M0,B.MC_TABLE_BODY=D0,B.MC_TABLE_CELL=L0,B.MC_TABLE_COLUMN_PLUS=xd,B.MC_TABLE_CTX_KEY=bd,B.MC_TABLE_DEFAULT_PROPS=cr,B.MC_TABLE_DEFAULT_VALUE="--",B.MC_TABLE_ELLIPSIS=q0,B.MC_TABLE_EMPTY=z0,B.MC_TABLE_FOOTER=j0,B.MC_TABLE_HEADER=V0,B.MC_TABLE_LOADING=$0,B.MC_TABLE_PAGE_SIZE=H0,B.MC_TABLE_PAGINATION=W0,B.MC_TABLE_PAGINATION_ITEM=K0,B.MC_TABLE_PLUS=A0,B.MC_TABLE_ROW=R0,B.MC_TABLE_SCROLL=P0,B.MC_TABLE_SORT=I0,B.MC_TABLE_TOTAL=F0,B.MC_TAB_ITEM=kd,B.MC_TAG=Yv,B.MC_TEXTAREA=J0,B.MC_TITLE=Oh,B.MC_TITLE_TOOL_BAR=Th,B.MC_TOAST=vh,B.MC_TOOLTIP=oh,B.MC_UPLOAD=Z0,B.MC_UPLOAD_DROPZONE=Q0,B.McAlertMessage=Bp,B.McButton=to,B.McCheckbox=so,B.McCheckboxGroup=dh,B.McCollapse=ph,B.McCollapseItem=gh,B.McCopy=wh,B.McCount=Ch,B.McCurrencyIcon=Eh,B.McDivider=vl,B.McDrawer=Dh,B.McFileList=Td,B.McFooter=Go,B.McForm=rh,B.McFormItem=ih,B.McIcon=ce,B.McIconPlus=Bn,B.McInput=bl,B.McInputGroup=$h,B.McLightbox=jh,B.McLoading=wl,B.McModalHeader=Gs,B.McMultiTag=Kh,B.McOtp=Uh,B.McOverlay=Us,B.McPopper=Ws,B.McProgressBar=Cl,B.McProgressIndicator=of,B.McProgressIndicatorChildItem=tf,B.McProgressIndicatorItem=ef,B.McRadio=lf,B.McRadioGroup=sf,B.McRemovableTag=xl,B.McReset=yl,B.McRichtext=Qv,B.McSecondaryMenu=t0,B.McSelect=o0,B.McSelectGroup=s0,B.McSelectGroupPlus=Gv,B.McSelectMultiOption=pd,B.McSelectOption=a0,B.McSelectOptionPlus=us,B.McSelectPlus=md,B.McStatus=c0,B.McStep=u0,B.McStepChildItemPlus=f0,B.McStepChildItemV2=b0,B.McStepItemPlus=h0,B.McStepItemV2=k0,B.McStepPlus=m0,B.McStepV2=y0,B.McSuccessIcon=io,B.McSwitch=S0,B.McTab=N0,B.McTabItem=E0,B.McTable=_0,B.McTableColumnPlus=U0,B.McTablePlus=G0,B.McTag=ha,B.McTextarea=Y0,B.McTitle=Ar,B.McTitleToolBar=kl,B.McToast=kh,B.McTooltip=Uo,B.McUpload=ty,B.SELECT_GROUP_INJECTION_KEY=gd,B.SELECT_INJECTION_KEY=fa,B.TOOL_ICON=Ne,B.WILDCARD=zt,B.default=QB,B.toast=qs,B.usePagination=B0,B.useTableScroll=T0,B.useTableSort=O0,Object.defineProperties(B,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
167
|
+
`).trim();if(u){const f=n.blockTokens(u);d.push(...f)}let p=s+1;const h=[];for(;p<t.length&&t[p].indent>e;)h.push(t[p]),p+=1;if(h.length>0){const f=Math.min(...h.map(g=>g.indent)),m=Iv(h,f,n);d.push({type:"list",ordered:!0,start:h[0].number,items:m,raw:h.map(g=>g.raw).join(`
|
|
168
|
+
`)})}i.push({type:"list_item",raw:a.raw,tokens:d}),s=p}else s+=1}return i}var Dv="textStyle",Rv=/^(\d+)\.\s$/,Lv=bt.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Fe(this.options.HTMLAttributes,n),0]:["ol",Fe(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,o=t.items?function(i,s){return i.map(a=>{if(a.type!=="list_item")return s.parseChildren([a])[0];const l=[];return a.tokens&&a.tokens.length>0&&a.tokens.forEach(c=>{if(c.type==="paragraph"||c.type==="list"||c.type==="blockquote"||c.type==="code")l.push(...s.parseChildren([c]));else if(c.type==="text"&&c.tokens){const d=s.parseChildren([c]);l.push({type:"paragraph",content:d})}else{const d=s.parseChildren([c]);d.length>0&&l.push(...d)}}),{type:"listItem",content:l}})}(t.items,e):[];return n!==1?{type:"orderedList",attrs:{start:n},content:o}:{type:"orderedList",content:o}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
169
|
+
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=e==null?void 0:e.index;return n!==void 0?n:-1},tokenize:(t,e,n)=>{var o;const i=t.split(`
|
|
170
|
+
`),[s,a]=function(c){const d=[];let u=0,p=0;for(;u<c.length;){const h=c[u],f=h.match(Vv);if(!f)break;const[,m,g,v]=f,b=m.length;let y=v,k=u+1;const x=[h];for(;k<c.length;){const w=c[k];if(w.match(Vv))break;if(w.trim()==="")x.push(w),y+=`
|
|
171
|
+
`,k+=1;else{if(!w.match(vS))break;x.push(w),y+=`
|
|
172
|
+
${w.slice(b+2)}`,k+=1}}d.push({indent:b,number:parseInt(g,10),content:y.trim(),raw:x.join(`
|
|
173
|
+
`)}),p=k,u=k}return[d,p]}(i);if(s.length===0)return;const l=Iv(s,0,n);return l.length!==0?{type:"list",ordered:!0,start:((o=s[0])==null?void 0:o.number)||1,items:l,raw:i.slice(0,a).join(`
|
|
174
|
+
`)}:void 0}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(Dv)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=ar({find:Rv,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ar({find:Rv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Dv)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),yS=/^\s*(\[([( |x])?\])\s$/,bS=bt.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Fe(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const o=e.parseChildren(t.nestedTokens);n.push(...o)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;return Lc(t,e,`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:o})=>{const i=document.createElement("li"),s=document.createElement("label"),a=document.createElement("span"),l=document.createElement("input"),c=document.createElement("div"),d=u=>{var p,h;l.ariaLabel=((h=(p=this.options.a11y)==null?void 0:p.checkboxLabel)==null?void 0:h.call(p,u,l.checked))||`Task item checkbox for ${u.textContent||"empty task item"}`};return d(t),s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",u=>u.preventDefault()),l.addEventListener("change",u=>{if(!o.isEditable&&!this.options.onReadOnlyChecked)return void(l.checked=!l.checked);const{checked:p}=u.target;o.isEditable&&typeof n=="function"&&o.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const f=n();if(typeof f!="number")return!1;const m=h.doc.nodeAt(f);return h.setNodeMarkup(f,void 0,{...m==null?void 0:m.attrs,checked:p}),!0}).run(),!o.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,p)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,p])=>{i.setAttribute(u,p)}),i.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,s.append(l,a),i.append(s,c),Object.entries(e).forEach(([u,p])=>{i.setAttribute(u,p)}),{dom:i,contentDOM:c,update:u=>u.type===this.type&&(i.dataset.checked=u.attrs.checked,l.checked=u.attrs.checked,d(u),!0)}}},addInputRules(){return[ar({find:yS,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),kS=bt.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Fe(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
175
|
+
`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const o=s=>{const a=Rc(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,c)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:c}),customNestedParser:o},n);return a?[{type:"taskList",raw:a.raw,items:a.items}]:n.blockTokens(s)},i=Rc(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,a)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:a}),customNestedParser:o},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Ue.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(Ev.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(Mv.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(Av.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(Lv.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(bS.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(kS.configure(this.options.taskList)),t}});var wS=bt.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",Fe(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];return n.length===1&&n[0].type==="image"?e.parseChildren([n[0]]):e.createNode("paragraph",void 0,e.parseInline(n))},renderMarkdown:(t,e)=>t&&Array.isArray(t.content)?e.renderChildren(t.content):"",addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),xS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,CS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,SS=Fn.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("line-through")&&{}}],renderHTML({HTMLAttributes:t}){return["s",Fe(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[sr({find:xS,type:this.type})]},addPasteRules(){return[yo({find:CS,type:this.type})]}}),ES=bt.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),MS=Fn.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("underline")&&{}}],renderHTML({HTMLAttributes:t}){return["u",Fe(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown:(t,e)=>`++${e.renderChildren(t)}++`,markdownTokenizer:{name:"underline",level:"inline",start:t=>t.indexOf("++"),tokenize(t,e,n){const o=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!o)return;const i=o[2].trim();return{type:"underline",raw:o[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function NS(t={}){return new Le({view:e=>new BS(e,t)})}class BS{constructor(e,n){var o;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(o=n.width)!==null&&o!==void 0?o:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=a=>{this[i](a)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,n=this.editorView.state.doc.resolve(this.cursorPos),o=!n.parent.inlineContent,i=this.editorView.dom,s=i.getBoundingClientRect(),a=s.width/i.offsetWidth,l=s.height/i.offsetHeight;if(o){let p=n.nodeBefore,h=n.nodeAfter;if(p||h){let f=this.editorView.nodeDOM(this.cursorPos-(p?p.nodeSize:0));if(f){let m=f.getBoundingClientRect(),g=p?m.bottom:m.top;p&&h&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let v=this.width/2*l;e={left:m.left,right:m.right,top:g-v,bottom:g+v}}}}if(!e){let p=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*a;e={left:p.left-h,right:p.left+h,top:p.top,bottom:p.bottom}}let c,d,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",o),this.element.classList.toggle("prosemirror-dropcursor-inline",!o),!u||u==document.body&&getComputedStyle(u).position=="static")c=-pageXOffset,d=-pageYOffset;else{let p=u.getBoundingClientRect(),h=p.width/u.offsetWidth,f=p.height/u.offsetHeight;c=p.left-u.scrollLeft*h,d=p.top-u.scrollTop*f}this.element.style.left=(e.left-c)/a+"px",this.element.style.top=(e.top-d)/l+"px",this.element.style.width=(e.right-e.left)/a+"px",this.element.style.height=(e.bottom-e.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),o=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=o&&o.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!s){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Ff(this.editorView.state.doc,a,this.editorView.dragging.slice);l!=null&&(a=l)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class $e extends pe{constructor(e){super(e,e)}map(e,n){let o=e.resolve(n.map(this.head));return $e.valid(o)?new $e(o):pe.near(o)}content(){return J.empty}eq(e){return e instanceof $e&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new $e(e.resolve(n.pos))}getBookmark(){return new ld(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!function(s){for(let a=s.depth;a>=0;a--){let l=s.index(a),c=s.node(a);if(l!=0)for(let d=c.child(l-1);;d=d.lastChild){if(d.childCount==0&&!d.inlineContent||zv(d.type))return!0;if(d.inlineContent)return!1}else if(c.type.spec.isolating)return!0}return!0}(e)||!function(s){for(let a=s.depth;a>=0;a--){let l=s.indexAfter(a),c=s.node(a);if(l!=c.childCount)for(let d=c.child(l);;d=d.firstChild){if(d.childCount==0&&!d.inlineContent||zv(d.type))return!0;if(d.inlineContent)return!1}else if(c.type.spec.isolating)return!0}return!0}(e))return!1;let o=n.type.spec.allowGapCursor;if(o!=null)return o;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,o=!1){e:for(;;){if(!o&&$e.valid(e))return e;let i=e.pos,s=null;for(let a=e.depth;;a--){let l=e.node(a);if(n>0?e.indexAfter(a)<l.childCount:e.index(a)>0){s=l.child(n>0?e.indexAfter(a):e.index(a)-1);break}if(a==0)return null;i+=n;let c=e.doc.resolve(i);if($e.valid(c))return c}for(;;){let a=n>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!ne.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),o=!1;continue e}break}s=a,i+=n;let l=e.doc.resolve(i);if($e.valid(l))return l}return null}}}$e.prototype.visible=!1,$e.findFrom=$e.findGapCursorFrom,pe.jsonID("gapcursor",$e);class ld{constructor(e){this.pos=e}map(e){return new ld(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return $e.valid(n)?new $e(n):pe.near(n)}}function zv(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}const TS=Eg({ArrowLeft:ca("horiz",-1),ArrowRight:ca("horiz",1),ArrowUp:ca("vert",-1),ArrowDown:ca("vert",1)});function ca(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(o,i,s){let a=o.selection,l=e>0?a.$to:a.$from,c=a.empty;if(a instanceof se){if(!s.endOfTextblock(n)||l.depth==0)return!1;c=!1,l=o.doc.resolve(e>0?l.after():l.before())}let d=$e.findGapCursorFrom(l,e,c);return!!d&&(i&&i(o.tr.setSelection(new $e(d))),!0)}}function OS(t,e,n){if(!t||!t.editable)return!1;let o=t.state.doc.resolve(e);if(!$e.valid(o))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&ne.isSelectable(t.state.doc.nodeAt(i.inside))||(t.dispatch(t.state.tr.setSelection(new $e(o))),0))}function _S(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof $e))return!1;let{$from:n}=t.state.selection,o=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!o)return!1;let i=$.empty;for(let a=o.length-1;a>=0;a--)i=$.from(o[a].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new J(i,0,0));return s.setSelection(se.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function AS(t){if(!(t.selection instanceof $e))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ie.create(t.doc,[ht.widget(t.selection.head,e,{key:"gapcursor"})])}var da=200,Xe=function(){};Xe.prototype.append=function(t){return t.length?(t=Xe.from(t),!this.length&&t||t.length<da&&this.leafAppend(t)||this.length<da&&t.leafPrepend(this)||this.appendInner(t)):this},Xe.prototype.prepend=function(t){return t.length?Xe.from(t).append(this):this},Xe.prototype.appendInner=function(t){return new VS(this,t)},Xe.prototype.slice=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.length),t>=e?Xe.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Xe.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Xe.prototype.forEach=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Xe.prototype.map=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},e,n),o},Xe.from=function(t){return t instanceof Xe?t:t&&t.length?new $v(t):Xe.empty};var $v=function(t){function e(o){t.call(this),this.values=o}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new e(this.values.slice(o,i))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,i,s,a){for(var l=i;l<s;l++)if(o(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(o,i,s,a){for(var l=i-1;l>=s;l--)if(o(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=da)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=da)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Xe);Xe.empty=new $v([]);var VS=function(t){function e(n,o){t.call(this),this.left=n,this.right=o,this.length=n.length+o.length,this.depth=Math.max(n.depth,o.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,o,i,s){var a=this.left.length;return!(o<a&&this.left.forEachInner(n,o,Math.min(i,a),s)===!1)&&!(i>a&&this.right.forEachInner(n,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)&&void 0},e.prototype.forEachInvertedInner=function(n,o,i,s){var a=this.left.length;return!(o>a&&this.right.forEachInvertedInner(n,o-a,Math.max(i,a)-a,s+a)===!1)&&!(i<a&&this.left.forEachInvertedInner(n,Math.min(o,a),i,s)===!1)&&void 0},e.prototype.sliceInner=function(n,o){if(n==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(n,o):n>=i?this.right.slice(n-i,o-i):this.left.slice(n,i).append(this.right.slice(0,o-i))},e.prototype.leafAppend=function(n){var o=this.right.leafAppend(n);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(n){var o=this.left.leafPrepend(n);if(o)return new e(o,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(Xe);class Ht{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let o,i,s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}n&&(o=this.remapping(s,this.items.length),i=o.maps.length);let a,l,c=e.tr,d=[],u=[];return this.items.forEach((p,h)=>{if(!p.step)return o||(o=this.remapping(s,h+1),i=o.maps.length),i--,void u.push(p);if(o){u.push(new en(p.map));let f,m=p.step.map(o.slice(i));m&&c.maybeStep(m).doc&&(f=c.mapping.maps[c.mapping.maps.length-1],d.push(new en(f,void 0,void 0,d.length+u.length))),i--,f&&o.appendMap(f,i)}else c.maybeStep(p.step);return p.selection?(a=o?p.selection.map(o.slice(i)):p.selection,l=new Ht(this.items.slice(0,s).append(u.reverse().concat(d)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:l,transform:c,selection:a}}addTransform(e,n,o,i){let s=[],a=this.eventCount,l=this.items,c=!i&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let p,h=e.steps[u].invert(e.docs[u]),f=new en(e.mapping.maps[u],h,n);(p=c&&c.merge(f))&&(f=p,u?s.pop():l=l.slice(0,l.length-1)),s.push(f),n&&(a++,n=void 0),i||(c=f)}let d=a-o.depth;return d>IS&&(l=function(u,p){let h;return u.forEach((f,m)=>{if(f.selection&&p--==0)return h=m,!1}),u.slice(h)}(l,d),a-=d),new Ht(l.append(s),a)}remapping(e,n){let o=new Rr;return this.items.forEach((i,s)=>{let a=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?o.maps.length-i.mirrorOffset:void 0;o.appendMap(i.map,a)},e,n),o}addMaps(e){return this.eventCount==0?this:new Ht(this.items.append(e.map(n=>new en(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let o=[],i=Math.max(0,this.items.length-n),s=e.mapping,a=e.steps.length,l=this.eventCount;this.items.forEach(h=>{h.selection&&l--},i);let c=n;this.items.forEach(h=>{let f=s.getMirror(--c);if(f==null)return;a=Math.min(a,f);let m=s.maps[f];if(h.step){let g=e.steps[f].invert(e.docs[f]),v=h.selection&&h.selection.map(s.slice(c+1,f));v&&l++,o.push(new en(m,g,v))}else o.push(new en(m))},i);let d=[];for(let h=n;h<a;h++)d.push(new en(s.maps[h]));let u=this.items.slice(0,i).append(d).append(o),p=new Ht(u,l);return p.emptyItemCount()>500&&(p=p.compress(this.items.length-o.length)),p}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),o=n.maps.length,i=[],s=0;return this.items.forEach((a,l)=>{if(l>=e)i.push(a),a.selection&&s++;else if(a.step){let c=a.step.map(n.slice(o)),d=c&&c.getMap();if(o--,d&&n.appendMap(d,o),c){let u=a.selection&&a.selection.map(n.slice(o));u&&s++;let p,h=new en(d.invert(),c,u),f=i.length-1;(p=i.length&&i[f].merge(h))?i[f]=p:i.push(h)}}else a.map&&o--},this.items.length,0),new Ht(Xe.from(i.reverse()),s)}}Ht.empty=new Ht(Xe.empty,0);class en{constructor(e,n,o,i){this.map=e,this.step=n,this.selection=o,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new en(n.getMap().invert(),n,this.selection)}}}class Un{constructor(e,n,o,i,s){this.done=e,this.undone=n,this.prevRanges=o,this.prevTime=i,this.prevComposition=s}}const IS=20;function Pv(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((o,i,s,a)=>e.push(s,a));return e}function cd(t,e){if(!t)return null;let n=[];for(let o=0;o<t.length;o+=2){let i=e.map(t[o],1),s=e.map(t[o+1],-1);i<=s&&n.push(i,s)}return n}let dd=!1,jv=null;function ua(t){let e=t.plugins;if(jv!=e){dd=!1,jv=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){dd=!0;break}}return dd}const wo=new Ye("history"),DS=new Ye("closeHistory");function RS(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Le({key:wo,state:{init:()=>new Un(Ht.empty,Ht.empty,null,0,-1),apply:(e,n,o)=>function(i,s,a,l){let c,d=a.getMeta(wo);if(d)return d.historyState;a.getMeta(DS)&&(i=new Un(i.done,i.undone,null,0,-1));let u=a.getMeta("appendedTransaction");if(a.steps.length==0)return i;if(u&&u.getMeta(wo))return u.getMeta(wo).redo?new Un(i.done.addTransform(a,void 0,l,ua(s)),i.undone,Pv(a.mapping.maps),i.prevTime,i.prevComposition):new Un(i.done,i.undone.addTransform(a,void 0,l,ua(s)),null,i.prevTime,i.prevComposition);if(a.getMeta("addToHistory")===!1||u&&u.getMeta("addToHistory")===!1)return(c=a.getMeta("rebased"))?new Un(i.done.rebased(a,c),i.undone.rebased(a,c),cd(i.prevRanges,a.mapping),i.prevTime,i.prevComposition):new Un(i.done.addMaps(a.mapping.maps),i.undone.addMaps(a.mapping.maps),cd(i.prevRanges,a.mapping),i.prevTime,i.prevComposition);{let p=a.getMeta("composition"),h=i.prevTime==0||!u&&i.prevComposition!=p&&(i.prevTime<(a.time||0)-l.newGroupDelay||!function(m,g){if(!g)return!1;if(!m.docChanged)return!0;let v=!1;return m.mapping.maps[0].forEach((b,y)=>{for(let k=0;k<g.length;k+=2)b<=g[k+1]&&y>=g[k]&&(v=!0)}),v}(a,i.prevRanges)),f=u?cd(i.prevRanges,a.mapping):Pv(a.mapping.maps);return new Un(i.done.addTransform(a,h?s.selection.getBookmark():void 0,l,ua(s)),Ht.empty,f,a.time,p??i.prevComposition)}}(n,o,e,t)},config:t,props:{handleDOMEvents:{beforeinput(e,n){let o=n.inputType,i=o=="historyUndo"?Hv:o=="historyRedo"?Wv:null;return!!i&&(n.preventDefault(),i(e.state,e.dispatch))}}}})}function Fv(t,e){return(n,o)=>{let i=wo.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(o){let s=function(a,l,c){let d=ua(l),u=wo.get(l).spec.config,p=(c?a.undone:a.done).popEvent(l,d);if(!p)return null;let h=p.selection.resolve(p.transform.doc),f=(c?a.done:a.undone).addTransform(p.transform,l.selection.getBookmark(),u,d),m=new Un(c?f:p.remaining,c?p.remaining:f,null,0,-1);return p.transform.setSelection(h).setMeta(wo,{redo:c,historyState:m})}(i,n,t);s&&o(e?s.scrollIntoView():s)}return!0}}const Hv=Fv(!1,!0),Wv=Fv(!0,!0);Ue.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Le({key:new Ye("characterCount"),appendTransaction:(e,n,o)=>{if(t)return;const i=this.options.limit;if(i==null||i===0)return void(t=!0);const s=this.storage.characters({node:o.doc});if(s>i){const l=s-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const c=o.tr.deleteRange(0,l);return t=!0,c}t=!0},filterTransaction:(e,n)=>{const o=this.options.limit;if(!e.docChanged||o===0||o==null)return!0;const i=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=o||i>o&&s>o&&s<=i)return!0;if(i>o&&s>o&&s>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=a-(s-o),c=a;return e.deleteRange(l,c),!(this.storage.characters({node:e.doc})>o)}})]}});var LS=Ue.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[NS(this.options)]}});Ue.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new Le({key:new Ye("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:o}=this.editor,{anchor:i}=e,s=[];if(!n||!o)return Ie.create(t,[]);let a=0;this.options.mode==="deepest"&&t.descendants((c,d)=>{if(!c.isText)return i>=d&&i<=d+c.nodeSize-1&&void(a+=1)});let l=0;return t.descendants((c,d)=>!c.isText&&i>=d&&i<=d+c.nodeSize-1&&(l+=1,this.options.mode==="deepest"&&a-l>0||this.options.mode==="shallowest"&&l>1?this.options.mode==="deepest":void s.push(ht.node(d,d+c.nodeSize,{class:this.options.className})))),Ie.create(t,s)}}})]}});var zS=Ue.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Le({props:{decorations:AS,createSelectionBetween:(t,e,n)=>e.pos==n.pos&&$e.valid(n)?new $e(n):null,handleClick:OS,handleKeyDown:TS,handleDOMEvents:{beforeinput:_S}}})],extendNodeSchema(t){var e;return{allowGapCursor:(e=ke(te(t,"allowGapCursor",{name:t.name,options:t.options,storage:t.storage})))!=null?e:null}}});function Kv({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}Ue.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Le({key:new Ye("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=e,i=[];if(!n)return null;const s=this.editor.isEmpty;return t.descendants((a,l)=>{const c=o>=l&&o<=l+a.nodeSize,d=!a.isLeaf&&Ss(a);if((c||!this.options.showOnlyCurrent)&&d){const u=[this.options.emptyNodeClass];s&&u.push(this.options.emptyEditorClass);const p=ht.node(l,l+a.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:c}):this.options.placeholder});i.push(p)}return this.options.includeChildren}),Ie.create(t,i)}}})]}}),Ue.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Le({key:new Ye("selection"),props:{decorations:n=>n.selection.empty||t.isFocused||!t.isEditable||qg(n.selection)||t.view.dragging?null:Ie.create(n.doc,[ht.inline(n.selection.from,n.selection.to,{class:e.className})])}})]}});var $S=Ue.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var t;const e=new Ye(this.name),n=((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||this.options.node||"paragraph",o=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new Le({key:e,appendTransaction:(i,s,a)=>{const{doc:l,tr:c,schema:d}=a,u=e.getState(a),p=l.content.size,h=d.nodes[n];if(u)return c.insert(p,h.create())},state:{init:(i,s)=>!Kv({node:s.tr.doc.lastChild,types:o}),apply:(i,s)=>i.docChanged?!Kv({node:i.doc.lastChild,types:o}):s}})]}}),PS=Ue.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>Hv(t,e),redo:()=>({state:t,dispatch:e})=>Wv(t,e)}),addProseMirrorPlugins(){return[RS(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),jS=Ue.create({name:"starterKit",addExtensions(){var t,e,n,o;const i=[];return this.options.bold!==!1&&i.push(WC.configure(this.options.bold)),this.options.blockquote!==!1&&i.push($C.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(Ev.configure(this.options.bulletList)),this.options.code!==!1&&i.push(qC.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(YC.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(XC.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(LS.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(zS.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(ZC.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(QC.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(PS.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(eS.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(iS.configure(this.options.italic)),this.options.listItem!==!1&&i.push(Mv.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(Av.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&i.push(fS.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(Lv.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(wS.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(SS.configure(this.options.strike)),this.options.text!==!1&&i.push(ES.configure(this.options.text)),this.options.underline!==!1&&i.push(MS.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push($S.configure((o=this.options)==null?void 0:o.trailingNode)),i}}),FS=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,HS=bt.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Fe(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,o,i,s,a;const l=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",c=(i=(o=t.attrs)==null?void 0:o.alt)!=null?i:"",d=(a=(s=t.attrs)==null?void 0:s.title)!=null?a:"";return d?``:``},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[sv({find:FS,type:this.type,getAttributes:t=>{const[,,e,n,o]=t;return{src:n,alt:e,title:o}}})]}});const Uv="mc-select-multi-option",WS={class:"mc-select-multi-option"},ud=Z(r.defineComponent({name:Uv,__name:"mc-select-multi-option",props:{modelValue:{type:Boolean,default:!1},label:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=i=>{n("update:modelValue",i)};return(i,s)=>(r.openBlock(),r.createElementBlock("div",WS,[r.createVNode(r.unref(ro),{"model-value":t.modelValue,content:t.label,"disable-validation":"",disabled:t.disabled,"onUpdate:modelValue":o},null,8,["model-value","content","disabled"])]))}})),pd="mc-select-option-plus",KS=["aria-selected"],US={key:1,class:"mc-select-option-label"},di=Z(U(r.defineComponent({name:pd,__name:"mc-select-option-plus",props:{label:{},value:{type:[String,Number,Boolean]},height:{default:40},width:{default:"100%"},disabled:{type:Boolean}},setup(t){const e=t,{height:n,width:o}=$t(),i=r.inject(pa||void 0),s=r.computed(()=>!!Do(i==null?void 0:i.filteredOptions.value,f=>f.value===e.value)),a=r.computed(()=>!!(i!=null&&i.isMulti.value)),l=r.computed(()=>{if(a.value){const f=i==null?void 0:i.selectedOption.value;return gt(f,e.value)}return(i==null?void 0:i.selectedOption.value)===e.value}),c=r.ref(!1),d=r.computed(()=>e.label),u=()=>{i==null||i.hover(e.value)},p=r.computed(()=>(i==null?void 0:i.hoverOption.value)===e.value),h=()=>{e.disabled||(i==null||i.select(e.value))};return(f,m)=>r.withDirectives((r.openBlock(),r.createElementBlock("li",{role:"option",class:r.normalizeClass(["mc-select-option",{"mc-select-option-actived":l.value&&!a.value,"mc-select-option-hover":p.value,"mc-select-option-disabled":t.disabled}]),style:r.normalizeStyle({height:r.unref(n),width:r.unref(o)}),"aria-selected":c.value,onMouseenter:u,onClick:h},[r.renderSlot(f.$slots,"default",{isActived:l.value,isDisabled:t.disabled},()=>[a.value?(r.openBlock(),r.createBlock(r.unref(ud),{key:0,"model-value":l.value,label:d.value,disabled:t.disabled},null,8,["model-value","label","disabled"])):(r.openBlock(),r.createElementBlock("span",US,r.toDisplayString(d.value),1))],!0)],46,KS)),[[r.vShow,s.value]])}}),[["__scopeId","data-v-5c070d19"]])),hd="mc-select-group-plus",qS={class:"mc-select-group"},JS={class:"mc-select-option-list"},qv=Z(U(r.defineComponent({name:hd,__name:"mc-select-group-plus",props:{label:{},height:{default:40},width:{default:"100%"}},setup(t){const e=t,n=r.inject(pa||void 0),{height:o,width:i}=$t(),s=r.computed(()=>gt(n==null?void 0:n.filteredGroups.value,e.label));return(a,l)=>r.withDirectives((r.openBlock(),r.createElementBlock("ul",qS,[r.createElementVNode("li",{class:"mc-select-group-label",style:r.normalizeStyle({height:r.unref(o),width:r.unref(i)})},r.toDisplayString(t.label),5),r.createElementVNode("li",null,[r.createElementVNode("ul",JS,[r.renderSlot(a.$slots,"default",{},void 0,!0)])])],512)),[[r.vShow,s.value]])}}),[["__scopeId","data-v-7d169727"]])),pa=Symbol("mc-select-plus-context"),Jv="mc-select-plus",Gv="mc-tag",GS={class:"mc-tag-content"},YS=r.defineComponent({name:Gv,__name:"mc-tag",props:{width:{},height:{},size:{default:"small"},type:{default:"basic"},emphasis:{default:"bold"},disabled:{type:Boolean,default:!1},deletable:{type:Boolean,default:!0},leftIcon:{},rightIcon:{},content:{}},emits:["delete","click"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),a=()=>{o.deletable||i("click")},l=r.computed(()=>o.type==="selectable"&&o.deletable),c=()=>{o.disabled||i("delete")};return e({ref:s}),(d,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-tag",[`mc-tag-${t.size}`,`mc-tag-${t.type}`,`mc-tag-${t.emphasis}`,{"mc-tag-disabled":t.disabled}]]),ref_key:"_ref",ref:s,style:r.normalizeStyle({width:t.width,height:t.height}),onClick:a},[t.leftIcon?(r.openBlock(),r.createBlock(r.unref(de),{key:0,name:t.leftIcon,class:"mc-tag-left-icon",size:16},null,8,["name"])):r.createCommentVNode("",!0),r.createElementVNode("div",GS,[r.renderSlot(d.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)]),t.rightIcon?(r.openBlock(),r.createBlock(r.unref(de),{key:1,name:t.rightIcon,class:"mc-tag-right-icon",size:16},null,8,["name"])):r.createCommentVNode("",!0),l.value?(r.openBlock(),r.createBlock(r.unref(de),{key:2,name:"Cross",class:"mc-tag-delete-icon",size:16,onClick:r.withModifiers(c,["stop"])})):r.createCommentVNode("",!0)],6))}}),ha=Z(U(YS,[["__scopeId","data-v-044d14e5"]])),XS=["id","placeholder","readonly","disabled","onKeydown"],ZS={key:0,class:"mc-select-multi-options-wrapper"},QS={key:1,class:"mc-select-selected-content-wrapper"},eE={key:1,class:"mc-select-placeholder"},tE={key:0,class:"mc-select-status-icon-wrapper"},nE={key:0,class:"mc-select-dropdown-header-content"},oE={key:0,class:"mc-select-empty"},rE=r.defineComponent({name:Jv,__name:"mc-select-plus",props:{width:{default:320},height:{default:40},placeholder:{default:"Please select"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},maxTags:{},search:{type:Boolean,default:!1},options:{},showHeader:{type:Boolean,default:!1},showFooter:{type:Boolean,default:!1},modelValue:{type:[String,Number,Boolean,Array]},placement:{default:"bottom-start"},inputGroupPosition:{},disableValidation:{type:Boolean,default:!1},hideValidationIcon:{type:Boolean,default:!1},validateProp:{}},emits:["update:modelValue","change","focus","blur","expand"],setup(t,{emit:e}){const n=t,o=e,i=r.computed(()=>n.multiple),s=r.ref(),{wrapperRef:a,isFocused:l,handleFocus:c,handleBlur:d}=zo(s,{afterBlur:async()=>{await Ja(300),await _("blur")}}),{isHovering:u}=Bp(a),{selectRef:p,width:h,height:f}=(()=>{const D=r.ref(),{width:W,height:ee}=$t(),ve=()=>{D.value&&(D.value.style.setProperty("--mc-select-width",W.value||"auto"),D.value.style.setProperty("--mc-select-height",ee.value||"auto"))};return r.onMounted(()=>{ve()}),r.watch(()=>W.value,()=>ve()),{selectRef:D,width:W,height:ee,setWidth:ve}})(),{selectOptions:m}=(()=>{let D=[];const W=r.ref([]),ee=r.getCurrentInstance().proxy;return r.watchEffect(()=>{var ye,Re;const ve=(Re=(ye=ee.$slots).default)==null?void 0:Re.call(ye);if(ve.length){const Ae=(He=>{const Pe=[],mt=(tn,ui)=>{ce(tn)&&tn.forEach(Ze=>{var wn,Wt,hi,nn,xn,fi,X0,Z0;const pi=(wn=(Ze==null?void 0:Ze.type)||{})==null?void 0:wn.name;if(pi===hd){const AB=Ro(Ze.children)||ce(Ze.children)||!Ve((Wt=Ze.children)==null?void 0:Wt.default)?Ze.children:(hi=Ze.children)==null?void 0:hi.default();mt(AB,(nn=Ze.props)==null?void 0:nn.label)}else pi===pd?Pe.push({label:(xn=Ze.props)==null?void 0:xn.label,value:(fi=Ze.props)==null?void 0:fi.value,disabled:(X0=Ze.props)==null?void 0:X0.disabled,group:ui,context:(Z0=Ze.children)==null?void 0:Z0.default}):Array.isArray(Ze.children)&&mt(Ze.children,ui)})};return mt(He),Pe})(ve);W.value.push(...Ae)}((Ae,He)=>{if(Ae.length!==He.length)return!1;for(const[Pe]of Ae.entries())if(Ae[Pe]!=He[Pe])return!1;return!0})(W.value,D)||(D=W.value)}),{selectOptions:W}})(),{searchValue:g,isSearch:v,hasSearchValue:b,filteredOptions:y,filteredGroups:k,clearSearchValue:x}=(D=>{const W=r.ref(""),ee=be("search"),ve=r.computed(()=>!!ee.value),ye=r.computed(()=>ve.value&&!Ct(W.value)),Re=r.computed(()=>D!=null&&D.value.length?En(kr(D.value,He=>gt(Cp(He.label),Cp(W.value))),He=>({value:He.value,group:He.group})):[]),Ae=r.computed(()=>{return Re.value.length?En((He=Re.value)&&He.length?function(Pe,mt){var tn=-1,ui=ka,Ze=Pe.length,pi=!0,wn=[],Wt=wn;if(Ze>=200){var hi=mt?null:Wb(Pe);if(hi)return ja(hi);pi=!1,ui=Pa,Wt=new Vo}else Wt=mt?[]:wn;e:for(;++tn<Ze;){var nn=Pe[tn],xn=mt?mt(nn):nn;if(nn=nn!==0?nn:0,pi&&xn==xn){for(var fi=Wt.length;fi--;)if(Wt[fi]===xn)continue e;mt&&Wt.push(xn),wn.push(nn)}else ui(Wt,xn,void 0)||(Wt!==wn&&Wt.push(xn),wn.push(nn))}return wn}(He,Sn("group")):[],Pe=>Pe.group):[];var He});return{searchValue:W,isSearch:ve,hasSearchValue:ye,filteredOptions:Re,filteredGroups:Ae,clearSearchValue:()=>{W.value=""}}})(m),{hoverOption:w,setHoverOption:S,handlePressArrow:C,clearHoverOption:E}=(D=>{const W=r.ref(),ee=()=>{W.value=void 0};return{hoverOption:W,setHoverOption:ve=>{W.value=ve},handlePressArrow:ve=>{var Re,Ae,He,Pe,mt;if(!(D!=null&&D.value.length))return void ee();if(!W.value)return void(W.value=(Re=D.value[0])==null?void 0:Re.value);const ye=Io(D==null?void 0:D.value,tn=>tn.value===W.value);ve.key==="ArrowDown"?W.value=((Ae=D.value[ye+1])==null?void 0:Ae.value)||((He=D.value[0])==null?void 0:He.value):ve.key==="ArrowUp"&&(W.value=((Pe=D.value[ye-1])==null?void 0:Pe.value)||((mt=D.value[D.value.length-1])==null?void 0:mt.value))},clearHoverOption:ee}})(y),{formId:M,formDisabled:N,validateStatus:T,validateStyle:R,statusIcon:z,validateByTrigger:_}=ln(),{isDisabled:I}=((D,W)=>{const ee=r.inject(Vr,void 0),ve=r.computed(()=>!!D.value||!!(ee!=null&&ee.disabled.value));return r.watch(ve,ye=>{ye&&Ve(W)&&W()}),{isDisabled:ve}})(N,()=>{A(!1),x()}),{isExpanded:O,popperRef:V,popperOptions:P,toggleExpand:A}=(D=>{const W=r.ref(!1),ee=r.getCurrentInstance(),{emit:ve}=ee,ye=r.ref(),Re=r.inject(Vr,void 0),Ae=be("inputGroupPosition"),He={modifiers:[{name:"offset",options:{offset:[r.computed(()=>Re&&Ae.value?Ae.value==="prefix"?-1:Ae.value==="suffix"?1:0:0).value,0]}}]};return r.watch(W,Pe=>{var mt,tn;Pe?(mt=ye.value)==null||mt.show():(tn=ye.value)==null||tn.hide()}),{isExpanded:W,popperRef:ye,popperOptions:He,toggleExpand:Pe=>{D.value?W.value=!1:W.value=Pe,ve("expand",Pe)}}})(I),{showClearIcon:L,mouseOverIcon:j,clear:K}=((D,W)=>{const ee=r.ref(!1),ve=be("clearable");return{showClearIcon:r.computed(()=>!!ve.value&&ee.value&&!W.value),mouseOverIcon:ye=>{ee.value=ye},clear:()=>{Ve(D)&&D()}}})(async()=>{I.value||(H.value=i.value?[]:void 0,x(),A(!1),we(),await r.nextTick(),_("input"))},I);Rh({validateStatus:T,isExpanded:O,isFocused:l,isHovering:u}),zi(p,()=>{x(),A(!1)}),r.onMounted(()=>{H.value=n.modelValue}),r.watch(()=>n.modelValue,D=>{H.value=D});const H=r.ref(),q=r.computed(()=>{if(i.value){const D=n.maxTags,W=H.value;if(Ri(D)){const ee=W.length-D,ve=[];for(let ye=0;ye<D&&ye<W.length;ye++){const Re=W[ye];ve.push({label:`${Q(Re)}`,item:Re,selectable:!0})}return ee>0&&ve.push({label:`+${ee}`,item:"rest",selectable:!1}),ve}return En(W,ee=>({label:`${Q(ee)}`,item:ee,selectable:!0}))}return[]}),Y=r.computed(()=>{var D;return i.value?(D=H.value)==null?void 0:D.map(W=>Q(W)):Q(H.value)}),G=r.computed(()=>y.value.length>0),Q=D=>{const W=Do(m.value,ee=>ee.value===D);return(W==null?void 0:W.label)||(W==null?void 0:W.value)},oe=async D=>{if(x(),!I.value){if(i.value){const W=H.value;gt(W,D)?H.value=lp(W,[D]):H.value=[...W,D]}else H.value=D;i.value||A(!1),we(),await r.nextTick(),_("input")}},fe=r.computed(()=>{if(!i.value){const D=Do(m.value,W=>W.value===H.value);return D!=null&&D.context?D.context:r.h("span",{class:"mc-selected-option-label",style:{color:"inherit"}},(D==null?void 0:D.label)||(D==null?void 0:D.value))}}),le=r.computed(()=>!b.value&&!!H.value),me=r.computed(()=>!!n.placeholder&&!b.value&&ge.value),Be=r.computed(()=>l.value?"minimal":"bold");r.watch(O,()=>{E()});const X=()=>{A(!O.value)},ie=()=>{E(),A(!0)},ae=()=>{O.value?w.value?oe(w.value):i.value||A(!1):A(!0)},{isSelectAll:re,isSelectPartial:xe,selectAll:nt}=((D,W,ee,ve)=>{const ye=r.ref(!1),Re=r.ref(!1);return r.watchEffect(()=>{var He,Pe;if(!D.value)return;const Ae=W.value;Ae!=null&&Ae.length&&((He=ee.value)!=null&&He.length)&&(Ae==null?void 0:Ae.length)===((Pe=ee.value)==null?void 0:Pe.length)?ye.value=!0:(Ae==null?void 0:Ae.length)>0?(ye.value=!1,Re.value=!0):(ye.value=!1,Re.value=!1)}),{isSelectAll:ye,isSelectPartial:Re,selectAll:()=>{D.value&&Ve(ve)&&ve()}}})(i,H,m,()=>{re.value?H.value=m.value.map(D=>D.value):H.value=[],we()}),Oe=r.ref([]);r.watch(O,()=>{O.value&&i.value&&(Oe.value=H.value)});const _e=()=>{i.value&&(H.value=Oe.value,we())},ue=()=>{i.value&&A(!1)},ge=r.computed(()=>{var D;return i.value?((D=H.value)==null?void 0:D.length)<=0:!H.value}),at=r.computed(()=>L.value&&!ge.value),ft=r.computed(()=>I.value?"not-allowed":v.value?"text":"pointer"),we=()=>{o("update:modelValue",H.value),o("change",H.value)};return r.provide(pa,{isMulti:i,selectedOption:H,filteredOptions:y,filteredGroups:k,hoverOption:w,select:oe,hover:S}),(D,W)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"selectRef",ref:p,class:r.normalizeClass(["mc-select",{"mc-select-expanded":r.unref(O)}])},[r.createVNode(r.unref(Hi),{ref_key:"popperRef",ref:V,placement:t.placement,trigger:"manual",class:"mc-select-popper",style:r.normalizeStyle({width:r.unref(h)}),"show-arrow":!1,"popper-options":r.unref(P),"hide-timeout":100},{default:r.withCtx(()=>[r.createElementVNode("div",{ref_key:"triggerRef",ref:a,class:r.normalizeClass(["mc-select-trigger",{"mc-select-trigger-focused":r.unref(l),"mc-select-trigger-disabled":r.unref(I),"mc-select-trigger-hovering":r.unref(u),[r.unref(R)]:r.unref(R)}]),style:r.normalizeStyle({width:r.unref(h),height:r.unref(f)}),onClick:X},[r.createElementVNode("div",{class:"mc-select-input-wrapper",style:r.normalizeStyle({cursor:ft.value})},[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":W[0]||(W[0]=ee=>r.isRef(g)?g.value=ee:null),ref_key:"inputRef",ref:s,id:r.unref(M),class:"mc-select-input",style:r.normalizeStyle({width:r.unref(b)?"100%":"1px"}),placeholder:t.placeholder,readonly:!r.unref(v)||r.unref(I),disabled:r.unref(I),onFocus:W[1]||(W[1]=(...ee)=>r.unref(c)&&r.unref(c)(...ee)),onBlur:W[2]||(W[2]=(...ee)=>r.unref(d)&&r.unref(d)(...ee)),onInput:ie,onKeydown:[r.withKeys(r.withModifiers(ae,["stop"]),["enter"]),W[3]||(W[3]=r.withKeys(r.withModifiers((...ee)=>r.unref(C)&&r.unref(C)(...ee),["stop"]),["arrow-down"])),W[4]||(W[4]=r.withKeys(r.withModifiers((...ee)=>r.unref(C)&&r.unref(C)(...ee),["stop"]),["arrow-up"]))]},null,44,XS),[[r.vModelText,r.unref(g)]]),le.value?r.renderSlot(D.$slots,"selected-content",{key:0,selectedOption:H.value,selectedOptionLabel:Y.value,isDisabled:r.unref(I)},()=>[i.value?(r.openBlock(),r.createElementBlock("ul",ZS,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(q.value,ee=>(r.openBlock(),r.createElementBlock("li",{key:`${ee.item}`,class:"mc-select-multi-option"},[r.createVNode(r.unref(ha),{size:"x-small",type:"selectable",deletable:ee.selectable,emphasis:Be.value,disabled:r.unref(I),onDelete:ve=>(ye=>{const Re=H.value;H.value=lp(Re,[ye]),we()})(ee.item)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(ee.label),1)]),_:2},1032,["deletable","emphasis","disabled","onDelete"])]))),128))])):(r.openBlock(),r.createElementBlock("div",QS,[fe.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(fe.value),{key:H.value})):r.createCommentVNode("",!0)]))],!0):r.createCommentVNode("",!0),me.value?(r.openBlock(),r.createElementBlock("p",eE,[r.renderSlot(D.$slots,"placeholder",{},()=>[r.createTextVNode(r.toDisplayString(t.placeholder),1)],!0)])):r.createCommentVNode("",!0)],4),r.unref(z)?(r.openBlock(),r.createElementBlock("div",tE,[r.unref(z)?(r.openBlock(),r.createBlock(r.unref(de),{key:0,name:r.unref(z),size:24},null,8,["name"])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"mc-select-icon-wrapper",onMouseenter:W[5]||(W[5]=ee=>r.unref(j)(!0)),onMouseleave:W[6]||(W[6]=ee=>r.unref(j)(!1))},[r.withDirectives(r.createVNode(r.unref(de),{name:"Reject",size:20,class:"mc-select-clear-icon",onClick:r.withModifiers(r.unref(K),["stop"])},null,8,["onClick"]),[[r.vShow,at.value]]),r.withDirectives(r.createVNode(r.unref(de),{name:"Down-Chevron",size:24,class:r.normalizeClass(["mc-select-chevron-icon",{"mc-select-chevron-icon-rotate":r.unref(O)}])},null,8,["class"]),[[r.vShow,!at.value]])],32)],6)]),content:r.withCtx(()=>[G.value&&t.showHeader?(r.openBlock(),r.createBlock(r.unref(Ar),{key:0,class:"mc-select-dropdown-header","show-tool-bar":!1,height:"40px"},{default:r.withCtx(()=>[r.renderSlot(D.$slots,"option-header",{},()=>[i.value?(r.openBlock(),r.createElementBlock("div",nE,[r.createVNode(r.unref(ro),{modelValue:r.unref(re),"onUpdate:modelValue":W[7]||(W[7]=ee=>r.isRef(re)?re.value=ee:null),content:"Select All","form-validate":!1,partial:r.unref(xe),onChange:r.unref(nt)},null,8,["modelValue","partial","onChange"])])):r.createCommentVNode("",!0)],!0)]),_:3})):r.createCommentVNode("",!0),r.createElementVNode("ul",{class:"mc-select-list",style:r.normalizeStyle({paddingTop:t.showHeader?"40px":"0",paddingBottom:t.showFooter?"48px":"0"})},[r.renderSlot(D.$slots,"default",{},void 0,!0),G.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("li",oE,[r.renderSlot(D.$slots,"empty",{},()=>[W[8]||(W[8]=r.createElementVNode("p",{class:"mc-select-text"},"No results found",-1))],!0)]))],4),G.value&&t.showFooter?(r.openBlock(),r.createBlock(r.unref(qo),{key:1,class:"mc-select-dropdown-footer"},{"right-button-group":r.withCtx(()=>[r.renderSlot(D.$slots,"option-footer",{},()=>[i.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createVNode(r.unref(eo),{type:"link",size:"small",onClick:_e},{default:r.withCtx(()=>[...W[9]||(W[9]=[r.createTextVNode(" Reset ",-1)])]),_:1}),r.createVNode(r.unref(eo),{type:"plain",size:"small",onClick:ue},{default:r.withCtx(()=>[...W[10]||(W[10]=[r.createTextVNode(" Apply ",-1)])]),_:1})],64)):r.createCommentVNode("",!0)],!0)]),_:3})):r.createCommentVNode("",!0)]),_:3},8,["placement","style","popper-options"])],2))}}),fd=Z(U(rE,[["__scopeId","data-v-e971c45f"]])),Yv="McRichtext",Xv="McRichtextTool";var Ne=(t=>(t.NORMAL="normal",t.SMALL="small",t.FOOTNOTE="footnote",t.BOLD="bold",t.ITALIC="italic",t.LIST="list",t.ORDERED_LIST="numbering",t.LINK="link",t.IMAGE="document-image",t.CLEAR="input-reset",t))(Ne||{}),xo=(t=>(t.NORMAL="mc-richtext-normal-text",t.SMALL="mc-richtext-small-text",t.FOOTNOTE="mc-richtext-footnote",t))(xo||{});const Co=U(r.defineComponent({name:Xv,__name:"mc-richtext-tool",props:{icon:{},isActive:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:e}){const n=e;return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-richtext-tool",{"mc-richtext-tool-icon-actived":t.isActive}])},[r.renderSlot(o.$slots,"default",{isActive:t.isActive},()=>[(r.openBlock(),r.createBlock(hh,{class:"mc-richtext-tool-icon",key:t.icon,name:t.icon,size:24,cursor:"pointer",onClick:i[0]||(i[0]=s=>{return a=t.icon,void n("click",a);var a})},null,8,["name"]))],!0)],2))}}),[["__scopeId","data-v-341e9121"]]),iE=Fn.create({name:"custom-font",addAttributes:()=>({class:{default:null,parseHTML:t=>t.getAttribute("class"),renderHTML:t=>t.class?{class:t.class}:{}}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("class")&&null}],renderHTML:({HTMLAttributes:t})=>["span",t,0]}),sE={class:"mc-richtext-toolbar"},aE={class:"mc-richtext-font-selector"},lE={class:"mc-richtext-tool-group"},cE={class:"mc-richtext-tool-group"},dE={class:"mc-richtext-tool-group"},uE={class:"mc-richtext-attach-link"},pE=r.defineComponent({name:Yv,__name:"mc-richtext",props:{modelValue:{default:""},width:{default:"100%"},height:{}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),{width:a,height:l}=$t(),c=((M={})=>{const N=r.shallowRef();return r.onMounted(()=>{N.value=new RC(M)}),r.onBeforeUnmount(()=>{var T,R,z;const _=(T=N.value)==null?void 0:T.view.dom,I=_==null?void 0:_.cloneNode(!0);(R=_==null?void 0:_.parentNode)==null||R.replaceChild(I,_),(z=N.value)==null||z.destroy()}),N})({content:`${o.modelValue}`,extensions:[jS,HS.configure({inline:!0,allowBase64:!0}),iE],onUpdate:({editor:M})=>{i("update:modelValue",M.getHTML())}});r.watch(()=>o.modelValue,M=>{const N=c.value,T=N==null?void 0:N.getHTML();N&&T!==M&&N.commands.setContent(M)});const d=r.ref(Ne.NORMAL),u=M=>{M===Ne.NORMAL?p():M===Ne.SMALL?h():M===Ne.FOOTNOTE?f():M===Ne.BOLD?m():M===Ne.ITALIC?g():M===Ne.LIST?v():M===Ne.ORDERED_LIST?b():M===Ne.LINK?w():M===Ne.IMAGE?S():M===Ne.CLEAR&&E()},p=()=>{var M;(M=c.value)==null||M.commands.setMark("custom-font",{class:xo.NORMAL})},h=()=>{var M;(M=c.value)==null||M.commands.setMark("custom-font",{class:xo.SMALL})},f=()=>{var M;(M=c.value)==null||M.commands.setMark("custom-font",{class:xo.FOOTNOTE})},m=()=>{var M;(M=c.value)==null||M.commands.toggleBold()},g=()=>{var M;(M=c.value)==null||M.commands.toggleItalic()},v=()=>{var M;(M=c.value)==null||M.commands.toggleList("bulletList","listItem")},b=()=>{var M;(M=c.value)==null||M.commands.toggleList("orderedList","listItem")};r.watchEffect(()=>{const M=c.value;if(!M)return;const N=M.getAttributes("custom-font").class;N===xo.SMALL?d.value=Ne.SMALL:N===xo.FOOTNOTE?d.value=Ne.FOOTNOTE:d.value=Ne.NORMAL});const y=r.ref(),k=r.ref(""),x=()=>{var M;k.value=((M=c.value)==null?void 0:M.getAttributes("link").href)||""},w=()=>{var N,T,R;const M=k.value;M?((N=c.value)==null||N.commands.setLink({href:M}),k.value=""):((T=c.value)==null||T.commands.unsetLink(),k.value=""),(R=y.value)==null||R.hide()},S=()=>{var M;(M=s.value)==null||M.click()},C=M=>{var z;const N=M.target,T=(z=N.files)==null?void 0:z[0];if(!T||!T.type.startsWith("image/"))return;const R=new FileReader;R.onload=_=>{var O,V;const I=(O=_.target)==null?void 0:O.result;I&&((V=c.value)==null||V.commands.setImage({src:I}))},R.onerror=()=>{console.error("mc-richtext: error:read:image:",T.name)},R.readAsDataURL(T),N.value=""},E=()=>{var M;(M=c.value)==null||M.chain().focus().unsetAllMarks().clearNodes().run()};return e({editor:c.value,getText:()=>{var M;return(M=c.value)==null?void 0:M.getText()}}),(M,N)=>{var T,R,z,_,I,O;return r.openBlock(),r.createElementBlock("div",{class:"mc-richtext",style:r.normalizeStyle({width:r.unref(a),height:r.unref(l)})},[r.createElementVNode("section",sE,[r.createElementVNode("div",aE,[r.createVNode(r.unref(fd),{modelValue:d.value,"onUpdate:modelValue":N[0]||(N[0]=V=>d.value=V),width:148,height:32,"disable-validation":"",onChange:N[1]||(N[1]=V=>u(V))},{"selected-content":r.withCtx(({selectedOptionLabel:V})=>[r.createElementVNode("span",{class:r.normalizeClass(["mc-richtext-font-selected",`mc-richtext-font-${d.value}`])},r.toDisplayString(V),3)]),default:r.withCtx(()=>[r.createVNode(r.unref(di),{value:r.unref(Ne).NORMAL,label:"Normal text"},{default:r.withCtx(()=>[...N[4]||(N[4]=[r.createElementVNode("span",{class:"mc-richtext-font-normal"},"Normal text",-1)])]),_:1},8,["value"]),r.createVNode(r.unref(di),{value:r.unref(Ne).SMALL,label:"Small text"},{default:r.withCtx(()=>[...N[5]||(N[5]=[r.createElementVNode("span",{class:"mc-richtext-font-small"},"Small text",-1)])]),_:1},8,["value"]),r.createVNode(r.unref(di),{value:r.unref(Ne).FOOTNOTE,label:"Footnote"},{default:r.withCtx(()=>[...N[6]||(N[6]=[r.createElementVNode("span",{class:"mc-richtext-font-footnote"},"Footnote",-1)])]),_:1},8,["value"])]),_:1},8,["modelValue"])]),r.createElementVNode("div",lE,[r.createVNode(Co,{icon:r.unref(Ne).BOLD,"is-active":!!((T=r.unref(c))!=null&&T.isActive("bold")),onClick:u},null,8,["icon","is-active"]),r.createVNode(Co,{icon:r.unref(Ne).ITALIC,"is-active":!!((R=r.unref(c))!=null&&R.isActive("italic")),onClick:u},null,8,["icon","is-active"])]),r.createElementVNode("div",cE,[r.createVNode(Co,{icon:r.unref(Ne).LIST,"is-active":!!((z=r.unref(c))!=null&&z.isActive("bulletList")),onClick:u},null,8,["icon","is-active"]),r.createVNode(Co,{icon:r.unref(Ne).ORDERED_LIST,"is-active":!!((_=r.unref(c))!=null&&_.isActive("orderedList")),onClick:u},null,8,["icon","is-active"])]),r.createElementVNode("div",dE,[r.createVNode(Co,{icon:r.unref(Ne).LINK,"is-active":!!((I=r.unref(c))!=null&&I.isActive("link"))},{default:r.withCtx(()=>[r.createVNode(r.unref(Uo),{placement:"bottom-start",trigger:"click",ref_key:"linkTooltipRef",ref:y},{content:r.withCtx(()=>[r.createElementVNode("div",uE,[r.createVNode(r.unref(bl),{modelValue:k.value,"onUpdate:modelValue":N[2]||(N[2]=V=>k.value=V),placeholder:"Please enter the URL"},null,8,["modelValue"]),r.createVNode(r.unref(eo),{width:"180px",onClick:N[3]||(N[3]=V=>u("link"))},{default:r.withCtx(()=>[...N[7]||(N[7]=[r.createTextVNode(" Attach ",-1)])]),_:1})])]),default:r.withCtx(()=>[r.createVNode(r.unref(Nn),{name:"link",cursor:"pointer",class:"mc-richtext-tool-icon-link",onClick:x})]),_:1},512)]),_:1},8,["icon","is-active"]),r.createVNode(Co,{icon:r.unref(Ne).IMAGE,"is-active":!!((O=r.unref(c))!=null&&O.isActive("image")),onClick:u},null,8,["icon","is-active"])]),r.createVNode(Co,{icon:r.unref(Ne).CLEAR,onClick:u},null,8,["icon"])]),r.createVNode(r.unref(LC),{editor:r.unref(c),class:"mc-richtext-content"},null,8,["editor"]),r.createElementVNode("input",{ref_key:"fileInputRef",ref:s,type:"file",accept:"image/*",style:{display:"none"},"aria-hidden":"true",onChange:C},null,544)],4)}}}),Zv=Z(U(pE,[["__scopeId","data-v-c216489d"]])),Qv="mc-secondary-menu",hE={class:"mc-secondary-menu"},fE=["onClick"],mE={class:"mc-secondary-menu-item-content"},gE=r.defineComponent({name:Qv,__name:"mc-secondary-menu",props:{modelValue:{},options:{default:()=>[]}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(),s=r.ref(),a=r.computed(()=>{const c=[];return n.options.forEach(d=>{c.push(d),d.children&&d.children.forEach(u=>{c.push({...u,parent:d.name})})}),c});r.onMounted(()=>{n.modelValue&&l(n.modelValue),setTimeout(()=>{s.value&&(s.value.style.transition="top 0.3s ease-in-out")})}),r.watch(()=>n.modelValue,()=>{n.modelValue&&l(n.modelValue)});const l=c=>{const d=Io(a.value,{name:c});if(d<0||!s.value||!i.value)return;const u=Array.from(i.value.children),{top:p}=i.value.getBoundingClientRect(),{top:h}=u[d].getBoundingClientRect();s.value.style.top=h-p+"px"};return(c,d)=>(r.openBlock(),r.createElementBlock("div",hE,[r.createElementVNode("div",{class:"mc-secondary-menu-wrapper",ref_key:"wrapperRef",ref:i},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,u=>{var p;return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-secondary-menu-item",{"mc-secondary-menu-item-actived":t.modelValue===u.name,"mc-secondary-menu-item-parent":!!((p=u.children)!=null&&p.length),"mc-secondary-menu-item-child":!!u.parent}]),key:u.name,onClick:h=>{var m;return f=u,void(((m=f.children)==null?void 0:m.length)||(o("update:modelValue",f.name),o("change",f.name)));var f}},[r.createElementVNode("div",mE,r.toDisplayString(u.label),1)],10,fE)}),128)),r.createElementVNode("div",{class:"mc-secondary-menu-success-line",ref_key:"successLineRef",ref:s},null,512)],512)]))}}),e0=Z(U(gE,[["__scopeId","data-v-965d2cfc"]])),fa=Symbol("mc-select-context"),t0="mc-select",vE={key:0,class:"mc-select-selected-content"},yE=["placeholder","readonly","disabled"],bE={class:"mc-select-dropdown-header-content"},kE={class:"mc-select-dropdown-content"},wE={class:"mc-select-dropdown"},xE={key:0,class:"mc-select-no-data"},CE=r.defineComponent({name:t0,__name:"mc-select",props:{modelValue:{},placeholder:{default:"Please select"},disabled:{type:Boolean},multiple:{type:Boolean,default:!1},width:{},height:{},search:{type:Boolean},allowReset:{type:Boolean,default:!0},allowSelectAll:{type:Boolean,default:!0}},emits:["update:modelValue","change","blur","focus","reset"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(),s=r.ref(),a=r.ref(),l=r.computed(()=>n.multiple),c=G=>l.value&&Array.isArray(G),d=r.ref([]),u=r.computed(()=>Ee(P.value)?d.value:d.value.filter(G=>fp(Ut(G.label??G.value)).includes(fp(P.value)))),{wrapperRef:p,isFocused:h,handleFocus:f,handleBlur:m}=zo(i,{}),g=r.computed(()=>u.value.length===0),v=r.computed(()=>l.value&&n.allowSelectAll&&!g.value),b=r.computed(()=>l.value&&n.allowReset&&!g.value),y=r.ref(!1),k=()=>{y.value=!y.value},x=()=>c(n.modelValue)?[...n.modelValue]:[n.modelValue],w=r.ref(x());r.watch(()=>n.modelValue,()=>{w.value=x()});const S=r.computed(()=>kr(d.value,G=>gt(w.value,G.value))),C=r.computed(()=>{var G;return l.value||(G=S.value)==null?void 0:G[0]}),E=r.computed(()=>l.value?En(S.value,G=>({label:G.label??"",value:G.value})):[]),M=r.computed(()=>h.value||K.value?"minimal":"bold"),N=r.computed(()=>""),T=r.computed(()=>N.value==="error"),R=r.computed(()=>N.value==="success"),z=r.computed(()=>!n.disabled&&(T.value||R.value));let _=[];const I=()=>{o("update:modelValue",[..._]),o("change",[..._])},O=()=>{y.value=!1,o("change",[...n.modelValue])},V=r.computed(()=>{var G;return c(n.modelValue)?!((G=n.modelValue)!=null&&G.length):!n.modelValue}),P=r.ref(""),A=()=>{y.value=!0},L=r.computed(()=>n.search&&P.value.length>0),j=r.computed(()=>({width:n.width??void 0,height:n.height??void 0}));zi(p,()=>{y.value=!1}),r.watch(()=>y.value,G=>{G?l.value&&(_=[...n.modelValue]):setTimeout(()=>{P.value=""},300)},{flush:"post"});const K=r.ref(!1),H=r.ref(!1);r.watch(()=>n.modelValue,G=>{c(G)?H.value=G.length===d.value.length:H.value=!1});const q=r.computed(()=>!!c(n.modelValue)&&n.modelValue.length>0&&n.modelValue.length<d.value.length),Y=G=>{o("update:modelValue",G?d.value.map(Q=>Q.value):[])};return r.provide(fa,{filterOptions:u,selectValues:w,handleSelect:G=>{c(n.modelValue)?(Q=>{const oe=[...n.modelValue];gt(oe,Q.value)?oe.splice(oe.indexOf(Q.value),1):oe.push(Q.value),o("update:modelValue",oe)})(G):(Q=>{y.value=!1,o("update:modelValue",Q.value),o("change",Q.value)})(G)},removeOption:G=>{d.value=d.value.filter(Q=>Q.value!==G.value)},addOption:G=>{d.value.push(G)}}),(G,Q)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-select",[y.value&&!t.disabled?"mc-select-expand":"mc-select-collapse",{"mc-select-disabled":t.disabled,"mc-input-focused":r.unref(h)&&t.search,[`mc-select--${N.value}`]:N.value,"mc-select--hover":K.value}]]),ref_key:"wrapperRef",ref:p,style:r.normalizeStyle(j.value),onMouseenter:Q[4]||(Q[4]=oe=>K.value=!0),onMouseleave:Q[5]||(Q[5]=oe=>K.value=!1)},[r.createElementVNode("div",{class:"mc-select-trigger",onClick:k,ref_key:"triggerRef",ref:a},[S.value.length&&!L.value?(r.openBlock(),r.createElementBlock("div",vE,[l.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:"mc-select-multi-wrapper",ref_key:"tagsWrapperRef",ref:s},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(E.value,oe=>(r.openBlock(),r.createBlock(r.unref(ha),{key:oe.value,size:"x-small",type:"selectable",emphasis:M.value,disabled:t.disabled,onDelete:fe=>(le=>{if(c(n.modelValue)){const me=[...n.modelValue];me.splice(me.indexOf(le.value),1),o("update:modelValue",me)}})(oe)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(oe.label),1)]),_:2},1032,["emphasis","disabled","onDelete"]))),128))],512)):(r.openBlock(),r.createBlock(r.resolveDynamicComponent(C.value._vnode),{key:C.value.value}))])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["mc-select-input-wrapper",{"mc-select-input-wrapper-search":L.value||V.value}])},[r.withDirectives(r.createElementVNode("input",{class:r.normalizeClass(["mc-select-input",{"mc-select-input-readonly":!t.search}]),ref_key:"inputRef",ref:i,type:"text",placeholder:V.value?t.placeholder:"","onUpdate:modelValue":Q[0]||(Q[0]=oe=>P.value=oe),onInput:A,onFocus:Q[1]||(Q[1]=(...oe)=>r.unref(f)&&r.unref(f)(...oe)),onBlur:Q[2]||(Q[2]=(...oe)=>r.unref(m)&&r.unref(m)(...oe)),readonly:!t.search,disabled:t.disabled},null,42,yE),[[r.vModelText,P.value]])],2),z.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mc-select__status",[T.value?"mc-select__status--error":"mc-select__status--success"]])},[r.createVNode(r.unref(de),{name:T.value?"Reject_02":"Accept_02",size:24},null,8,["name"])],2)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["mc-select-icon-wrapper",{"mc-select-icon-wrapper-expand":y.value&&!t.disabled}])},[r.createVNode(r.unref(de),{name:"Down-Chevron",class:"mc-select-icon"})],2)],512),r.createVNode(r.Transition,{name:"mc-select-dropdown-transition"},{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",{class:"mc-select-dropdown-wrapper",style:r.normalizeStyle({paddingTop:v.value?"40px":"0",paddingBottom:b.value?"48px":"0"})},[v.value?(r.openBlock(),r.createBlock(r.unref(Ar),{key:0,class:"mc-select-dropdown-header","show-tool-bar":!1,height:"40px"},{default:r.withCtx(()=>[r.createElementVNode("div",bE,[r.createVNode(r.unref(ro),{modelValue:H.value,"onUpdate:modelValue":Q[3]||(Q[3]=oe=>H.value=oe),content:"Select All","form-validate":!1,partial:q.value,onChange:Y},null,8,["modelValue","partial"])])]),_:1})):r.createCommentVNode("",!0),r.createElementVNode("div",kE,[r.createElementVNode("div",wE,[r.renderSlot(G.$slots,"default",{},void 0,!0),g.value?(r.openBlock(),r.createElementBlock("div",xE,[r.renderSlot(G.$slots,"empty",{},()=>[Q[6]||(Q[6]=r.createTextVNode("No data",-1))],!0)])):r.createCommentVNode("",!0)])]),b.value?(r.openBlock(),r.createBlock(r.unref(qo),{key:1,class:"mc-select-dropdown-footer"},{"right-button-group":r.withCtx(()=>[r.createVNode(r.unref(eo),{type:"link",size:"small",onClick:I},{default:r.withCtx(()=>[...Q[7]||(Q[7]=[r.createTextVNode(" Reset ",-1)])]),_:1}),r.createVNode(r.unref(eo),{type:"plain",size:"small",onClick:O},{default:r.withCtx(()=>[...Q[8]||(Q[8]=[r.createTextVNode(" Apply ",-1)])]),_:1})]),_:1})):r.createCommentVNode("",!0)],4),[[r.vShow,y.value&&!t.disabled]])]),_:3})],38))}}),n0=Z(U(CE,[["__scopeId","data-v-0096011b"]])),md=Symbol("mc-select-group-context"),o0="mc-select-group",SE={class:"mc-select-group"},EE={class:"mc-select-group-content"},r0=Z(U(r.defineComponent({name:o0,__name:"mc-select-group",props:{label:{},width:{},height:{}},setup(t){const e=t,n=r.inject(fa,void 0);r.provide(md,{groupName:e.label});const o=r.computed(()=>n==null?void 0:n.filterOptions.value.some(a=>a._group===e.label)),i=r.toRefs(r.useAttrs()),s=r.computed(()=>{var a,l;return{...(l=(a=r.toValue(i))==null?void 0:a.style)==null?void 0:l.value,width:e.width??void 0,height:e.height??void 0}});return(a,l)=>r.withDirectives((r.openBlock(),r.createElementBlock("div",SE,[r.createElementVNode("div",{class:"mc-select-group-label",style:r.normalizeStyle(s.value)},r.toDisplayString(t.label),5),r.createElementVNode("div",EE,[r.renderSlot(a.$slots,"default",{},void 0,!0)])],512)),[[r.vShow,o.value]])}}),[["__scopeId","data-v-ff3f5179"]])),i0="mc-select-option",ME={class:"mc-select-option-content"},NE=r.defineComponent({name:i0,__name:"mc-select-option",props:{value:{},label:{},width:{},height:{},_group:{},_vnode:{}},setup(t,{expose:e}){const n=r.ref(),o=t,i=r.inject(fa,void 0),s=r.inject(md,void 0),a=r.computed(()=>i==null?void 0:i.selectValues.value.includes(o.value)),l=r.computed(()=>!!(i!=null&&i.filterOptions.value.some(h=>h.value===o.value))),c=r.useSlots(),d=()=>{i==null||i.handleSelect(u(o))};r.onMounted(()=>{i==null||i.addOption(u(o))}),r.onBeforeUnmount(()=>{i==null||i.removeOption(u(o))});const u=h=>{var f;return{...h,_group:s==null?void 0:s.groupName,_vnode:r.h("div",{class:"mc-select-option-content"},(f=c.default)==null?void 0:f.call(c,{}))}},p=r.computed(()=>({width:o.width??void 0,height:o.height??void 0}));return e({isShow:l.value,ref:n}),(h,f)=>l.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-select-dropdown-item mc-select-option",{"mc-select-option-icon-active":a.value}]),onClick:d,ref_key:"_ref",ref:n,style:r.normalizeStyle(p.value)},[r.createElementVNode("div",ME,[r.renderSlot(h.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.label),1)],!0)])],6)):r.createCommentVNode("",!0)}}),s0=Z(U(NE,[["__scopeId","data-v-8c13e012"]])),a0="mc-status",BE={class:"mc-status-icon"},TE={class:"mc-status-content"},l0=Z(U(r.defineComponent({name:a0,__name:"mc-status",props:{type:{default:"info"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-status",[`mc-status-${t.type}`]])},[r.createElementVNode("div",BE,[r.createVNode(r.unref(de),{name:"Indicator",size:12})]),r.createElementVNode("p",TE,[r.renderSlot(e.$slots,"default",{},void 0,!0)])],2))}),[["__scopeId","data-v-25f8565f"]])),c0="mc-step",OE={class:"mc-step-number-container"},_E={class:"mc-step-item-number"},AE={key:0,class:"mc-step-item-number-text"},VE={class:"mc-step-item-content"},IE={key:0,class:"mc-step-item-content-title"},DE={class:"mc-step-item-label"},RE={class:"mc-step-item-desc"},LE={key:1,class:"mc-step-item-component"},zE={key:0,class:"mc-step-item-component"},$E=r.defineComponent({name:c0,__name:"mc-step",props:{modelValue:{},steps:{},type:{default:"vertical"}},emits:["change","success"],setup(t,{expose:e,emit:n}){const o=t,i=r.computed(()=>o.type==="vertical"),s=n,a=r.ref(),l=r.ref(),c=r.ref(),d=r.ref(),u=r.computed(()=>Io(o.steps,w=>w.key===o.modelValue)),p=r.computed(()=>{var w;return(w=o.steps[u.value-1])==null?void 0:w.key});r.watch(()=>o.modelValue,w=>{f(),s("change",w)},{flush:"post"});const h=r.ref(),f=(w=p.value)=>{h.value=w,s("success",w)},m=r.computed(()=>Io(o.steps,w=>w.key===h.value));r.onMounted(()=>{i.value?g():(v(),b()),f()});const g=async()=>{await r.nextTick();const w=m.value,S=d.value;if(w<0)return void(S.style.height="0");const C=l.value,E=C.querySelectorAll(".mc-step-item");if(w+1>E.length-1)return void(S.style.height="100%");const M=E==null?void 0:E[w+1],N=C.getBoundingClientRect(),T=(M.getBoundingClientRect().top-N.top)/(N.height-24);S.style.height=100*T+"%"},v=()=>{var z,_;const w=l.value,S=c.value,C=w.querySelectorAll(".mc-step-item"),E=(z=C==null?void 0:C[0])==null?void 0:z.querySelector(".mc-step-item-number"),M=(_=C==null?void 0:C[C.length-1])==null?void 0:_.querySelector(".mc-step-item-number");if(!E||!M)return void(S.style.width="0px");const N=w.getBoundingClientRect(),T=E.getBoundingClientRect(),R=M.getBoundingClientRect();S.style.width=R.left-T.left-T.width+"px",S.style.left=`${T.left-N.left+T.width}px`},b=()=>{const w=d.value,S=m.value;if(S<0)return void(w.style.width="0");const C=(S+1)/(o.steps.length-1),E=C>1?1:C;w.style.width=100*E+"%"},y=w=>i.value&&w.component&&w.key===o.modelValue,k=r.computed(()=>{var w;return!i.value&&((w=Do(o.steps,S=>S.key===o.modelValue))==null?void 0:w.component)});var x;return r.watch(()=>h.value,()=>{i.value?g():b()}),x=Lo(()=>{i.value?g():(v(),b())},50),r.onMounted(()=>{window.addEventListener("resize",x)}),r.onUnmounted(()=>{window.removeEventListener("resize",x)}),e({ref:a,setSuccessStep:f}),(w,S)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-step",`mc-step-${t.type}`]),ref_key:"_ref",ref:a},[r.createElementVNode("ul",{class:"mc-step-item-container",ref_key:"stepContainerRef",ref:l},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.steps,(C,E)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-step-item",{"mc-step-item-active":t.modelValue===C.key,"mc-step-item-disabled":C.disabled,"mc-step-item-success":E<=m.value}]),key:C.key},[r.createElementVNode("div",OE,[r.createElementVNode("div",_E,[E>m.value||C.disabled?(r.openBlock(),r.createElementBlock("span",AE,r.toDisplayString(E+1),1)):(r.openBlock(),r.createBlock(r.unref(Jo),{key:1}))])]),r.createElementVNode("div",VE,[C.label||C.desc?(r.openBlock(),r.createElementBlock("div",IE,[r.createElementVNode("h3",DE,r.toDisplayString(C.label),1),r.createElementVNode("p",RE,r.toDisplayString(C.desc),1)])):r.createCommentVNode("",!0),y(C)?(r.openBlock(),r.createElementBlock("div",LE,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(C.component)))])):r.createCommentVNode("",!0)])],2))),128)),r.createElementVNode("div",{ref_key:"unsuccessLineRef",ref:c,class:"mc-step-line mc-step-unsuccess-line"},[r.createElementVNode("div",{ref_key:"successLineRef",ref:d,class:"mc-step-success-line"},null,512)],512)],512),k.value?(r.openBlock(),r.createElementBlock("div",zE,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(k.value)))])):r.createCommentVNode("",!0)],2))}}),d0=Z(U($E,[["__scopeId","data-v-add0e313"]])),u0="mc-step-plus",gd="mc-step-item-plus",PE={class:"mc-step-item-plus"},p0=Z(r.defineComponent({name:gd,__name:"mc-step-item-plus",props:{icon:{},key:{},label:{},desc:{},showContent:{type:Boolean},success:{type:Boolean}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",PE))})),vd="mc-step-child-item-plus",jE={class:"mc-step-child-item-plus"},h0=Z(r.defineComponent({name:vd,__name:"mc-step-child-item-plus",props:{key:{},label:{},desc:{},showContent:{type:Boolean},success:{type:Boolean}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",jE))})),FE={class:"mc-step-plus"},HE={class:"mc-step-container"},WE=["onClick"],KE={class:"mc-step-item-icon"},UE={key:0,class:"mc-step-item-icon-number"},qE={key:1,class:"mc-step-item-icon-point"},JE={class:"mc-step-item-content"},GE={class:"mc-step-item-content-title"},YE={class:"mc-step-item-label"},XE={key:1,class:"mc-step-item-label-title"},ZE={class:"mc-step-item-desc"},QE={key:1,class:"mc-step-item-desc-title"},eM={key:0,class:"mc-step-item-content-display"},f0=Z(U(r.defineComponent({name:u0,__name:"mc-step-plus",props:{modelValue:{default:void 0},successSteps:{},successBehavior:{default:"manual"},previousBehavior:{default:"last-child"}},emits:["update:modelValue","update:successSteps","change","click:step"],setup(t,{expose:e,emit:n}){const o=t,i=n,{stepItems:s,activedStep:a,isActivedStep:l,showStep:c,isSuccessStep:d,showContent:u}=(()=>{const f=r.ref([]),m=r.useSlots();r.watchEffect(()=>{var k;f.value=(x=>{const w=[];let S=0,C=0;const E=(M,N)=>{ce(M)&&M.forEach(T=>{var z,_,I,O,V,P,A,L,j,K,H,q,Y,G,Q,oe;const R=(z=(T==null?void 0:T.type)||{})==null?void 0:z.name;if(R===gd){const fe=Ro(T.children)||ce(T.children)||!Ve((_=T.children)==null?void 0:_.default)?T.children:(I=T.children)==null?void 0:I.default(),le=T.children,me={parentIndex:S++,index:C++,step:((O=T.props)==null?void 0:O.step)||C,label:(V=T.props)==null?void 0:V.label,desc:(P=T.props)==null?void 0:P.desc,icon:(A=T.props)==null?void 0:A.icon,showContent:((L=T.props)==null?void 0:L.showContent)||((j=T.props)==null?void 0:j["show-content"]),success:(K=T.props)==null?void 0:K.success,content:le==null?void 0:le.default,labelContent:le==null?void 0:le.label,descContent:le==null?void 0:le.desc};w.push(me),E(fe,me)}else if(R===vd){const fe=T.children,le={index:C++,step:(H=T.props)==null?void 0:H.step,label:(q=T.props)==null?void 0:q.label,desc:(Y=T.props)==null?void 0:Y.desc,parentStep:N,isChild:!0,showContent:((G=T.props)==null?void 0:G.showContent)||((Q=T.props)==null?void 0:Q["show-content"]),success:(oe=T.props)==null?void 0:oe.success,content:fe==null?void 0:fe.default,labelContent:fe==null?void 0:fe.label,descContent:fe==null?void 0:fe.desc};N&&(N.content=void 0,N.hasChildren=!0,N.children||(N.children=[]),le.childIndex=N.children.length,N.children.push(le),N.childrenSteps||(N.childrenSteps=[]),N.childrenSteps.push(le.step)),w.push(le)}else Array.isArray(T.children)&&E(T.children,N)})};return E(x),w})((k=m.default)==null?void 0:k.call(m))});const g=be("modelValue"),v=r.computed(()=>f.value.find(k=>k.step===g.value)),b=be("successSteps"),y=be("successBehavior");return{stepItems:f,activedStep:v,isActivedStep:k=>{var x,w;return!Ee(k.index)&&!Ee((x=v.value)==null?void 0:x.index)&&k.index<=((w=v.value)==null?void 0:w.index)},showStep:k=>{var x,w;return!k.isChild||!!((x=k.parentStep)!=null&&x.showContent)||!!k.parentStep&&v.value===k.parentStep||gt((w=k.parentStep)==null?void 0:w.childrenSteps,g.value)},isSuccessStep:k=>{var x,w,S,C,E,M;return!(!k.success&&!((x=k.parentStep)!=null&&x.success))||(y.value==="auto"?k.hasChildren?!Ee(k.index)&&k.index+(((w=k.children)==null?void 0:w.length)??0)<(((S=v.value)==null?void 0:S.index)??-1):!Ee(k.index)&&k.index<(((C=v.value)==null?void 0:C.index)??-1):!!((E=b.value)!=null&&E.length)&&(gt(b.value,k.step)||gt(b.value,(M=k.parentStep)==null?void 0:M.step)))},showContent:k=>!(!k.content||k.step!==g.value&&!k.showContent)}})(),p=()=>{var m;const f=((m=a.value)==null?void 0:m.index)||-1;if(f<s.value.length-1){let g=f+1,v=s.value[g];v.hasChildren&&(v=s.value[g+1]),v!=null&&v.step&&h(v.step)}},h=f=>{i("update:modelValue",f),i("change",f)};return e({goStep:f=>{f?h(f):p()},goNextStep:p,goPreviousStep:()=>{var m,g,v;const f=((m=a.value)==null?void 0:m.index)||-1;if(f>0){let b=f-1,y=s.value[b];(g=a.value)!=null&&g.isChild&&a.value.parentStep===y&&(y=s.value[b-1]),o.previousBehavior==="first-child"&&(y!=null&&y.isChild)&&!Ee((v=y.parentStep)==null?void 0:v.index)&&(b=y.parentStep.index+1,y=s.value[b]),y!=null&&y.step&&h(y.step)}}}),(f,m)=>(r.openBlock(),r.createElementBlock("div",FE,[r.createElementVNode("div",HE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(s),g=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:g.step},[r.unref(c)(g)?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-step-item",{"mc-step-item-child":g.isChild,"mc-step-item-actived":r.unref(l)(g),"mc-step-item-success":r.unref(d)(g)}])},[r.createElementVNode("div",{class:"mc-step-item-indicator",onClick:v=>(b=>{i("click:step",b.step)})(g)},[r.createElementVNode("div",KE,[g.isChild||r.unref(Ee)(g.parentIndex)?(r.openBlock(),r.createElementBlock("div",qE)):(r.openBlock(),r.createElementBlock("div",UE,[r.unref(d)(g)?(r.openBlock(),r.createBlock(r.unref(Jo),{key:0})):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[g.iconContent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.iconContent),{key:g.step,step:g.step,isSuccess:r.unref(d)(g),isActived:r.unref(l)(g)},null,8,["step","isSuccess","isActived"])):g.icon?(r.openBlock(),r.createBlock(r.unref(de),{key:1,name:g.icon},null,8,["name"])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createTextVNode(r.toDisplayString(g.parentIndex+1),1)],64))],64))]))])],8,WE),r.createElementVNode("div",JE,[r.createElementVNode("div",GE,[r.createElementVNode("div",YE,[g.labelContent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.labelContent),{key:g.step,step:g.step,label:g.label,isSuccess:r.unref(d)(g),isActived:r.unref(l)(g)},null,8,["step","label","isSuccess","isActived"])):(r.openBlock(),r.createElementBlock("div",XE,r.toDisplayString(g.label),1))]),r.createElementVNode("div",ZE,[g.descContent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.descContent),{key:g.step,step:g.step,desc:g.desc,isSuccess:r.unref(d)(g),isActived:r.unref(l)(g)},null,8,["step","desc","isSuccess","isActived"])):(r.openBlock(),r.createElementBlock("div",QE,r.toDisplayString(g.desc),1))])]),r.unref(u)(g)?(r.openBlock(),r.createElementBlock("div",eM,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.content),{key:g.step,step:g.step,isSuccess:r.unref(d)(g),isActived:r.unref(l)(g)},null,8,["step","isSuccess","isActived"]))])):r.createCommentVNode("",!0)])],2)):r.createCommentVNode("",!0)],64))),128))])]))}}),[["__scopeId","data-v-d451c649"]])),m0="mc-switch",g0="mc-switch-label",tM={class:"mc-switch-label-wrapper"},nM={class:"mc-switch-label"},oM={class:"mc-switch-help"},v0=U(r.defineComponent({name:g0,__name:"mc-switch-label",props:{label:{},helpText:{},helpIcon:{default:"Info"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",tM,[t.label||e.$slots.label?r.renderSlot(e.$slots,"label",{key:0},()=>[r.createElementVNode("span",nM,r.toDisplayString(t.label),1)],!0):r.createCommentVNode("",!0),t.helpText||e.$slots.help?r.renderSlot(e.$slots,"help",{key:1},()=>[r.createElementVNode("div",oM,[r.createVNode(r.unref(Uo),{"icon-name":t.helpIcon,content:t.helpText,"icon-size":22},null,8,["icon-name","content"])])],!0):r.createCommentVNode("",!0)]))}),[["__scopeId","data-v-52de74a9"]]),rM={class:"mc-switch"},iM=["id","disabled","value","onKeypress"],sM={class:"mc-switch-inner"},aM={class:"mc-switch-inner-text"},lM={class:"mc-switch-inner-text"},cM=r.defineComponent({name:m0,__name:"mc-switch",props:{modelValue:{type:Boolean,default:!1},width:{},height:{},activeText:{},inactiveText:{},disabled:{type:Boolean,default:!1},size:{default:"medium"},label:{},labelPosition:{default:"right"},helpIcon:{default:"Info"},helpText:{},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,i=r.useSlots(),{formId:s,formDisabled:a,validateStyle:l,validateByTrigger:c}=ln(),d=r.computed(()=>n.modelValue),u=async()=>{a.value||(o("update:modelValue",!n.modelValue),o("change",!n.modelValue),c("input"))},p=r.computed(()=>i.label||n.label||i.help||n.helpText?n.labelPosition:void 0),h=r.computed(()=>p.value==="left"),f=r.computed(()=>p.value==="right");return(m,g)=>(r.openBlock(),r.createElementBlock("div",rM,[h.value?(r.openBlock(),r.createBlock(v0,{key:0,label:t.label,"help-text":t.helpText,"help-icon":t.helpIcon},r.createSlots({_:2},[m.$slots.label?{name:"label",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"label",{},void 0,!0)]),key:"0"}:void 0,m.$slots.help?{name:"help",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"help",{},void 0,!0)]),key:"1"}:void 0]),1032,["label","help-text","help-icon"])):r.createCommentVNode("",!0),r.createElementVNode("label",{class:r.normalizeClass(["mc-switch-wrapper",[d.value?"mc-switch-actived":"mc-switch-inactive",{"mc-switch-disabled":r.unref(a)},`mc-switch-${t.size}`,r.unref(l)]]),style:r.normalizeStyle({width:t.width,height:t.height})},[r.createElementVNode("input",{id:r.unref(s),type:"checkbox",class:"mc-switch-input",disabled:t.disabled,value:t.modelValue,onChange:u,onKeypress:r.withKeys(r.withModifiers(u,["prevent","stop"]),["enter"])},null,40,iM),r.createElementVNode("div",sM,[d.value?r.renderSlot(m.$slots,"active",{key:0},()=>[r.createElementVNode("span",aM,r.toDisplayString(t.activeText),1)],!0):r.renderSlot(m.$slots,"inactive",{key:1},()=>[r.createElementVNode("span",lM,r.toDisplayString(t.inactiveText),1)],!0)])],6),f.value?(r.openBlock(),r.createBlock(v0,{key:1,label:t.label,"help-text":t.helpText,"help-icon":t.helpIcon},r.createSlots({_:2},[m.$slots.label?{name:"label",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"label",{},void 0,!0)]),key:"0"}:void 0,m.$slots.help?{name:"help",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"help",{},void 0,!0)]),key:"1"}:void 0]),1032,["label","help-text","help-icon"])):r.createCommentVNode("",!0)]))}}),y0=Z(U(cM,[["__scopeId","data-v-dc9c6820"]])),yd="mc-tab-item",dM={class:"mc-tab-item"},b0=Z(r.defineComponent({name:yd,__name:"mc-tab-item",props:{name:{},label:{},disabled:{type:Boolean},count:{}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",dM,[r.renderSlot(e.$slots,"default")]))})),k0="mc-tab",uM=["onClick"],pM={key:0,class:"mc-tab-nav-item-count"},hM={class:"mc-tab-actived-component-wrapper"},w0=Z(U(r.defineComponent({name:k0,__name:"mc-tab",props:{modelValue:{},type:{default:"plain"},wrapperPadding:{default:"0"}},emits:["update:modelValue","change"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),a=r.ref(),l=r.ref(),c=r.ref([]),d=r.useSlots();r.watchEffect(()=>{if(!d.default)return void(c.value=[]);let v=d.default();v.length&&v[0].type===r.Fragment&&(v=[...Array.from(v[0].children)]),c.value=En(kr(v,b=>b.type.name===yd),b=>{var k,x,w;const y=b.props;return{_vnode:r.h("div",(w=(x=(k=b.children)==null?void 0:k.default)==null?void 0:x.call(k))==null?void 0:w[0]),...y}})});const u=r.computed(()=>Do(c.value,v=>v.name===o.modelValue)),p=r.computed(()=>o.type==="plain");r.onMounted(async()=>{h(o.modelValue),setTimeout(()=>{f()})}),r.onUnmounted(()=>{f(!1)});const h=v=>{if(!p.value)return;const b=l.value,y=a.value,k=Io(c.value,E=>E.name===v);if(k<0)return void(b.style.width="0");const x=Array.from(y.children)[k],{x:w,width:S}=x.getBoundingClientRect(),{x:C}=y.getBoundingClientRect();b.style.width=`${S}px`,b.style.transform=`translateX(${w-C}px)`},f=(v=!0)=>{const b=l.value;p.value&&b&&(b.style.transition=v?"transform 0.3s ease-in-out":"")};r.watch(()=>o.modelValue,v=>{h(v)});const m=r.computed(()=>{var v;return typeof o.wrapperPadding=="string"?o.wrapperPadding:((v=o.wrapperPadding)==null?void 0:v.left)??"0"}),g=r.computed(()=>{var v;return typeof o.wrapperPadding=="string"?o.wrapperPadding:((v=o.wrapperPadding)==null?void 0:v.right)??"0"});return e({ref:s}),(v,b)=>{var y;return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-tab",`mc-tab-${t.type}`]),ref_key:"_ref",ref:s},[r.createElementVNode("div",{class:"mc-tab-nav",style:r.normalizeStyle({paddingLeft:m.value,paddingRight:g.value})},[r.createElementVNode("div",{class:"mc-tab-nav-wrapper",ref_key:"tabNavRef",ref:a},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,k=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-tab-nav-item",{"mc-tab-nav-item-active":k.name===t.modelValue,"mc-tab-nav-item-disabled":k.disabled}]),key:k.name,onClick:x=>(w=>{w.disabled||(i("update:modelValue",w.name),i("change",w.name))})(k)},[r.createElementVNode("span",null,r.toDisplayString(k.label),1),k.count?(r.openBlock(),r.createElementBlock("span",pM,r.toDisplayString(k.count),1)):r.createCommentVNode("",!0)],10,uM))),128))],512),p.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-tab-line",ref_key:"tabLineRef",ref:l},null,512)):r.createCommentVNode("",!0)],4),(y=u.value)!=null&&y._vnode?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-tab-actived-component",style:r.normalizeStyle({paddingLeft:m.value,paddingRight:g.value})},[r.createElementVNode("div",hM,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u.value._vnode),{key:u.value.name}))])],4)):r.createCommentVNode("",!0)],2)}}}),[["__scopeId","data-v-2c21b5ce"]])),fM=["rowspan","colspan"],mM=U(r.defineComponent({__name:"mc-table-cell",props:{row:{},column:{},rowIndex:{},columnIndex:{},pagination:{},spanMethod:{type:Function}},setup(t){const e=t,n=r.computed(()=>e.row[e.column.prop]),o=r.computed(()=>{const u=[e.column.className];if(e.column.align&&u.push(`is-${e.column.align}`),e.column.fixed){const h=typeof e.column.fixed=="boolean"?"left":e.column.fixed;u.push(`is-fixed-${h}`)}const p=c.value===0?"none":"table-cell";return u.push(`is-display-${p}`),u}),i=()=>{var u,p;return(u=e.pagination)!=null&&u.currentPage&&((p=e.pagination)!=null&&p.pageSize)?(e.pagination.currentPage-1)*e.pagination.pageSize+e.rowIndex:e.rowIndex},s=()=>{if(!e.spanMethod)return null;const u=i();return e.spanMethod({row:e.row,column:e.column,rowIndex:u,columnIndex:e.columnIndex})},a=(u,p)=>{var g,v;if(!((g=e.pagination)!=null&&g.currentPage)||!((v=e.pagination)!=null&&v.pageSize)||p<=1)return!0;const h=(e.pagination.currentPage-1)*e.pagination.pageSize,f=h+e.pagination.pageSize-1,m=u;return!(u+p-1<h||m>f)&&Math.max(m,h)===u},l=r.computed(()=>{const u=s();if(u){const p=i();let h;return h=Array.isArray(u)?u[0]:u.rowspan||1,h>1?a(p,h)?((f,m)=>{var x,w;if(!((x=e.pagination)!=null&&x.currentPage)||!((w=e.pagination)!=null&&w.pageSize)||m<=1)return m;const g=(e.pagination.currentPage-1)*e.pagination.pageSize,v=g+e.pagination.pageSize-1,b=f,y=f+m-1,k=Math.max(b,g);return Math.min(y,v)-k+1})(p,h):0:h}if(e.column.rowSpan)return typeof e.column.rowSpan=="function"?e.column.rowSpan(e.row,e.column,e.rowIndex):e.column.rowSpan}),c=r.computed(()=>{const u=s();return u?Array.isArray(u)?u[1]:u.colspan:e.column.colSpan?typeof e.column.colSpan=="function"?e.column.colSpan(e.row,e.column,e.rowIndex):e.column.colSpan:void 0}),d=r.computed(()=>{const u=s();if(u){const p=i();let h,f;return Array.isArray(u)?(h=u[0],f=u[1]):(h=u.rowspan||1,f=u.colspan||1),!(h>1&&!a(p,h)||h===0||f===0)}return!0});return(u,p)=>d.value?(r.openBlock(),r.createElementBlock("td",{key:0,class:r.normalizeClass(o.value),rowspan:l.value,colspan:c.value},[r.renderSlot(u.$slots,"cell",{row:t.row,column:t.column,index:t.rowIndex,value:n.value,prop:t.column.prop},()=>[r.renderSlot(u.$slots,t.column.slot||t.column.prop,{row:t.row,column:t.column,index:t.rowIndex,value:n.value},()=>[t.column.formatter?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createTextVNode(r.toDisplayString(t.column.formatter(t.row,t.column,n.value,t.rowIndex)),1)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(n.value),1)],64))],!0)],!0)],10,fM)):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-3b2b75d3"]]),gM={class:"mc-table__body",cellspacing:"0",cellpadding:"0",border:"0"},vM={key:0,width:"50"},yM=["width"],bM=["onClick"],kM={key:0,class:"mc-table__selection-column"},wM={class:"mc-table__cell"},xM={key:1},CM=["colspan"],SM={key:1},EM=U(r.defineComponent({__name:"mc-table-body",props:{data:{},columns:{},rowKey:{},emptyText:{},height:{},maxHeight:{},pagination:{},spanMethod:{},getRowClass:{},selectable:{type:Boolean,default:!1},selectedRows:{},selectOnRowClick:{type:Boolean,default:!1}},emits:["row-click","select"],setup(t,{expose:e,emit:n}){const o=t,i=r.useSlots(),s=n,a=r.ref(),l=r.computed(()=>Object.keys(i)),c=r.computed(()=>{const f={};return o.height&&(f.height=typeof o.height=="number"?`${o.height}px`:o.height),o.maxHeight&&(f.maxHeight=typeof o.maxHeight=="number"?`${o.maxHeight}px`:o.maxHeight),f}),d=r.computed(()=>o.pagination),u=(f,m)=>o.rowKey?f[o.rowKey]:m,p=(f,m)=>o.getRowClass?o.getRowClass(f,m):[],h=f=>!!o.selectedRows&&o.selectedRows.some(m=>o.rowKey?m[o.rowKey]===f[o.rowKey]:m===f);return e({bodyWrapper:a}),(f,m)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-table__body-wrapper",ref_key:"bodyWrapper",ref:a,style:r.normalizeStyle(c.value)},[r.createElementVNode("table",gM,[r.createElementVNode("colgroup",null,[t.selectable?(r.openBlock(),r.createElementBlock("col",vM)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.columns,(g,v)=>(r.openBlock(),r.createElementBlock("col",{key:v,width:g.width},null,8,yM))),128))]),r.createElementVNode("tbody",null,[t.data&&t.data.length>0?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(t.data,(g,v)=>(r.openBlock(),r.createElementBlock("tr",{key:u(g,v),class:r.normalizeClass(p(g,v)),onClick:b=>((y,k)=>{s("row-click",y,k)})(g,v)},[t.selectable?(r.openBlock(),r.createElementBlock("td",kM,[r.createElementVNode("div",wM,[r.createVNode(r.unref(ro),{"model-value":h(g),onChange:b=>((y,k)=>{s("select",y,k)})(g,b)},null,8,["model-value","onChange"])])])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.columns,(b,y)=>(r.openBlock(),r.createBlock(mM,{key:y,row:g,column:b,"row-index":v,"column-index":y,"span-method":t.spanMethod,pagination:d.value},r.createSlots({_:2},[r.renderList(l.value,k=>({name:k,fn:r.withCtx(x=>[r.renderSlot(f.$slots,k,r.mergeProps({ref_for:!0},x),void 0,!0)])}))]),1032,["row","column","row-index","column-index","span-method","pagination"]))),128))],10,bM))),128)):(r.openBlock(),r.createElementBlock("tr",xM,[r.createElementVNode("td",{colspan:o.selectable?o.columns.length+1:o.columns.length,class:"mc-table__empty-cell"},[r.unref(i).empty?r.renderSlot(f.$slots,"empty",{key:0},void 0,!0):(r.openBlock(),r.createElementBlock("div",SM,r.toDisplayString(t.emptyText),1))],8,CM)]))])])],4))}}),[["__scopeId","data-v-f42c4de9"]]),MM={class:"mc-table__header",cellspacing:"0",cellpadding:"0",border:"0"},NM={key:0,width:"50"},BM=["width"],TM={key:0,class:"mc-table__selection-column"},OM={class:"mc-table__header-cell"},_M=["onClick"],AM={class:"mc-table__header-label"},VM={key:0,class:"mc-table__sort-caret"},IM=r.defineComponent({__name:"mc-table-header",props:{columns:{},showHeader:{type:Boolean,default:!0},getSortOrder:{type:Function,default:()=>null},selectable:{type:Boolean,default:!1},isAllSelected:{type:Boolean,default:!1},isIndeterminate:{type:Boolean,default:!1}},emits:["header-click","sort-change","select-all"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),a=d=>{const u=[];if(d.headerClassName&&u.push(d.headerClassName),d.align&&u.push(`is-${d.align}`),d.fixed){const h=typeof d.fixed=="boolean"?"left":d.fixed;u.push(`is-fixed-${h}`)}d.sortable&&u.push("is-sortable");const p=l(d.prop);return p&&u.push(p),u},l=d=>{const u=o.getSortOrder(d);return u==="asc"?"is-sort-asc":u==="desc"?"is-sort-desc":""},c=d=>{i("select-all",d)};return e({headerWrapper:s}),(d,u)=>t.showHeader?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-table__header-wrapper",ref_key:"headerWrapper",ref:s},[r.createElementVNode("table",MM,[r.createElementVNode("colgroup",null,[t.selectable?(r.openBlock(),r.createElementBlock("col",NM)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.columns,(p,h)=>(r.openBlock(),r.createElementBlock("col",{key:h,width:p.width},null,8,BM))),128))]),r.createElementVNode("thead",null,[r.createElementVNode("tr",null,[t.selectable?(r.openBlock(),r.createElementBlock("th",TM,[r.createElementVNode("div",OM,[r.createVNode(r.unref(ro),{"model-value":t.isAllSelected,partial:t.isIndeterminate,onChange:c},null,8,["model-value","partial"])])])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.columns,(p,h)=>(r.openBlock(),r.createElementBlock("th",{key:h,class:r.normalizeClass(a(p)),onClick:f=>((m,g)=>{m.sortable&&i("sort-change",m),i("header-click",m,g)})(p,f)},[r.createElementVNode("div",{class:r.normalizeClass(["mc-table__header-cell",`mc-table__header-cell-${p.align}`])},[r.createElementVNode("span",AM,[r.renderSlot(d.$slots,`header-${p.slot||p.prop}`,{column:p,index:h},()=>[r.createTextVNode(r.toDisplayString(p.label),1)],!0)]),p.sortable?(r.openBlock(),r.createElementBlock("span",VM,[t.getSortOrder(p.prop)==="asc"?(r.openBlock(),r.createBlock(Qn,{key:0,name:"Up-Chevron02",class:r.normalizeClass(["mc-table__sort-icon",{"is-active":t.getSortOrder(p.prop)==="asc"}])},null,8,["class"])):(r.openBlock(),r.createBlock(Qn,{key:1,name:"Down-Chevron02",class:r.normalizeClass(["mc-table__sort-icon",{"is-active":t.getSortOrder(p.prop)==="desc"}])},null,8,["class"]))])):r.createCommentVNode("",!0)],2)],10,_M))),128))])])])],512)):r.createCommentVNode("",!0)}}),DM=U(IM,[["__scopeId","data-v-990de870"]]),RM={class:"mc-table__loading-content"},LM={class:"mc-table__loading-spinner"},zM={key:0,class:"mc-table__spinner mc-table__spinner--default"},$M={key:1,class:"mc-table__spinner mc-table__spinner--circle"},PM={key:2,class:"mc-table__spinner mc-table__spinner--pulse"},jM=["innerHTML"],FM={key:0,class:"mc-table__loading-text"},HM=U(r.defineComponent({__name:"mc-table-loading",props:{loading:{type:Boolean,default:!1},loadingText:{default:"Loading..."},loadingConfig:{default:()=>({spinner:"default"})}},setup(t){const e=t,n=r.computed(()=>{var i;return((i=e.loadingConfig)==null?void 0:i.text)||e.loadingText}),o=r.computed(()=>{var s;const i={};return(s=e.loadingConfig)!=null&&s.background&&(i.backgroundColor=e.loadingConfig.background),i});return(i,s)=>{var a;return t.loading?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-table__loading-wrapper",["mc-table__loading-wrapper",(a=t.loadingConfig)==null?void 0:a.customClass]]),style:r.normalizeStyle(o.value)},[r.createElementVNode("div",RM,[r.renderSlot(i.$slots,"loading",{loading:t.loading,text:n.value},()=>{var l;return[r.createElementVNode("div",LM,[(l=t.loadingConfig)!=null&&l.spinner&&t.loadingConfig.spinner!=="default"?t.loadingConfig.spinner==="circle"?(r.openBlock(),r.createElementBlock("div",$M)):t.loadingConfig.spinner==="pulse"?(r.openBlock(),r.createElementBlock("div",PM)):(r.openBlock(),r.createElementBlock("div",{key:3,class:"mc-table__spinner mc-table__spinner--custom",innerHTML:t.loadingConfig.spinner},null,8,jM)):(r.openBlock(),r.createElementBlock("div",zM,[...s[0]||(s[0]=[r.createElementVNode("div",{class:"mc-table__spinner-dot"},null,-1),r.createElementVNode("div",{class:"mc-table__spinner-dot"},null,-1),r.createElementVNode("div",{class:"mc-table__spinner-dot"},null,-1),r.createElementVNode("div",{class:"mc-table__spinner-dot"},null,-1)])]))]),n.value?(r.openBlock(),r.createElementBlock("div",FM,r.toDisplayString(n.value),1)):r.createCommentVNode("",!0)]},!0)])],6)):r.createCommentVNode("",!0)}}}),[["__scopeId","data-v-0a275eb6"]]),WM={key:0,class:"mc-table__pagination"},KM={class:"mc-table__pagination-info"},UM={class:"mc-table__pagination-info-number"},qM={class:"mc-table__pagination-info-number"},JM={class:"mc-table__pagination-controls"},GM=["onClick"],YM={key:1,class:"mc-table__pagination-ellipsis"},XM={class:"mc-table__pagination-size"},ZM={class:"mc-table-pagination-size-group"},QM=["onClick"],eN=r.defineComponent({__name:"mc-table-pagination",props:{pagination:{}},emits:["page-change"],setup(t,{emit:e}){var h,f,m;const n=t,o=e,i=r.ref(((h=n.pagination)==null?void 0:h.currentPage)||1),s=r.ref(((f=n.pagination)==null?void 0:f.pageSize)||50),a=r.ref(((m=n.pagination)==null?void 0:m.pageSizes)||[25,50,75,100]);r.watch(()=>{var g;return(g=n.pagination)==null?void 0:g.currentPage},g=>{g!==void 0&&(i.value=g)}),r.watch(()=>{var g;return(g=n.pagination)==null?void 0:g.pageSize},g=>{g!==void 0&&(s.value=g)});const l=r.computed(()=>n.pagination?Math.ceil(n.pagination.total/s.value):1),c=r.computed(()=>n.pagination&&n.pagination.total!==0?(i.value-1)*s.value+1:0),d=r.computed(()=>{if(!n.pagination)return 0;const g=i.value*s.value;return Math.min(g,n.pagination.total)}),u=r.computed(()=>{const g=l.value,v=i.value,b=[];if(g<=7)for(let y=1;y<=g;y++)b.push(y);else if(b.push(1),v<=4){for(let y=2;y<=5;y++)b.push(y);b.push("..."),b.push(g)}else if(v>=g-3){b.push("...");for(let y=g-4;y<=g;y++)b.push(y)}else{b.push("...");for(let y=v-1;y<=v+1;y++)b.push(y);b.push("..."),b.push(g)}return b}),p=(g,v)=>{g<1||g>l.value||v||(i.value=g,o("page-change",{pageSize:s.value,pageNum:g}))};return(g,v)=>t.pagination?(r.openBlock(),r.createElementBlock("div",WM,[r.createElementVNode("div",KM,[v[4]||(v[4]=r.createTextVNode(" Showing ",-1)),r.createElementVNode("span",UM,r.toDisplayString(c.value)+"-"+r.toDisplayString(d.value),1),v[5]||(v[5]=r.createTextVNode(" of ",-1)),r.createElementVNode("span",qM,r.toDisplayString(t.pagination.total),1)]),r.createElementVNode("div",JM,[r.createVNode(Qn,{name:"First",class:r.normalizeClass({"mc-table__icon":!0,"is-disabled":i.value<=1}),size:24,onClick:v[0]||(v[0]=b=>p(1,i.value<=1))},null,8,["class"]),r.createVNode(Qn,{name:"Left-Chevron",class:r.normalizeClass({"mc-table__icon":!0,"is-disabled":i.value<=1}),size:24,onClick:v[1]||(v[1]=b=>p(i.value-1,i.value<=1))},null,8,["class"]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,b=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:b},[b!=="..."?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass(["mc-table__pagination-button mc-table__pagination-button--page",{"is-active":b===i.value}]),onClick:y=>typeof b=="number"?p(b,!1):void 0},r.toDisplayString(b),11,GM)):(r.openBlock(),r.createElementBlock("span",YM,"..."))],64))),128)),r.createVNode(Qn,{name:"Right-Chevron",class:r.normalizeClass({"mc-table__icon":!0,"is-disabled":i.value>=l.value}),size:24,onClick:v[2]||(v[2]=b=>p(i.value+1,i.value>=l.value))},null,8,["class"]),r.createVNode(Qn,{name:"Last",class:r.normalizeClass({"mc-table__icon":!0,"is-disabled":i.value>=l.value}),size:24,onClick:v[3]||(v[3]=b=>p(l.value,i.value>=l.value))},null,8,["class"])]),r.createElementVNode("div",XM,[v[6]||(v[6]=r.createElementVNode("label",{class:"mc-table__pagination-size-label"},"View per page",-1)),r.createElementVNode("div",ZM,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,b=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-table-pagination-size-group-item",{"is-active":b===s.value}]),key:b,onClick:y=>(k=>{s.value=k,i.value=1,o("page-change",{pageSize:s.value,pageNum:1})})(b)},r.toDisplayString(b),11,QM))),128))])])])):r.createCommentVNode("",!0)}}),tN=U(eN,[["__scopeId","data-v-6eb5fd07"]]);function x0(t,e,n){var l,c;const o=r.ref(((l=e.value)==null?void 0:l.currentPage)||1),i=r.ref(((c=e.value)==null?void 0:c.pageSize)||50);r.watch(()=>{var d;return(d=e.value)==null?void 0:d.currentPage},d=>{d!==void 0&&(o.value=d)}),r.watch(()=>{var d;return(d=e.value)==null?void 0:d.pageSize},d=>{d!==void 0&&(i.value=d)});const s=r.computed(()=>{if(!e.value)return t.value;const d=(o.value-1)*i.value,u=d+i.value;return n.value?t.value.slice(d,u):t.value}),a=r.computed(()=>{if(!e.value)return{currentPage:1,pageSize:t.value.length,total:t.value.length,totalPages:1};const d=e.value.total,u=Math.ceil(d/i.value);return{currentPage:o.value,pageSize:i.value,total:d,totalPages:u}});return{currentPage:o,pageSize:i,paginatedData:s,paginationInfo:a,updatePagination:function(d){o.value=d.pageNum,i.value=d.pageSize}}}function C0(t,e,n){const o=r.ref(!1),i=r.ref(null),s=r.computed(()=>o.value?t.value:t.value.map(d=>({...d,fixed:void 0})));function a(){i.value&&(o.value=i.value.scrollWidth>i.value.clientWidth)}function l(){var d,u;(d=e.value)!=null&&d.headerWrapper&&((u=n.value)!=null&&u.bodyWrapper)&&(e.value.headerWrapper.scrollLeft=n.value.bodyWrapper.scrollLeft)}function c(){r.nextTick(()=>{var d;(d=n.value)!=null&&d.bodyWrapper&&(i.value=n.value.bodyWrapper,a(),new ResizeObserver(()=>{a()}).observe(n.value.bodyWrapper),window.addEventListener("resize",a),n.value.bodyWrapper.addEventListener("scroll",l))})}return r.onMounted(()=>{c()}),{hasHorizontalScroll:o,columnsWithFixed:s,checkHorizontalScroll:a,syncHeaderScroll:l,initScrollSync:c}}function S0(t,e,n){const o=r.ref(n||null);return{sortedData:r.computed(()=>{if(!o.value||!o.value.order)return t.value;const{prop:s,order:a}=o.value,l=e.value.find(d=>d.prop===s);if(!l)return t.value;const c=[...t.value];return c.sort((d,u)=>{let p=d[s],h=u[s];if(l.sortMethod){const f=l.sortMethod(p,h);return a==="desc"?-f:f}return p==null&&(p=""),h==null&&(h=""),typeof p=="string"&&typeof h=="string"&&(p=p.toLowerCase(),h=h.toLowerCase()),p<h?a==="asc"?-1:1:p>h?a==="asc"?1:-1:0}),c}),currentSort:o,handleSort:function(s){if(!s.sortable)return;const{prop:a}=s;let l="asc";return o.value&&o.value.prop===a&&(l=o.value.order==="asc"?"desc":o.value.order==="desc"?null:"asc"),o.value=l===null?null:{prop:a,order:l},o.value},getSortOrder:function(s){return o.value&&o.value.prop===s?o.value.order:null}}}const E0=Z(U(r.defineComponent({name:"McTable",__name:"mc-table",props:{data:{},columns:{},showHeader:{type:Boolean,default:!0},height:{},maxHeight:{},rowKey:{},emptyText:{default:"No Data"},pagination:{},loading:{type:Boolean,default:!1},loadingText:{default:"Loading..."},loadingConfig:{},highlightCurrentRow:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},selectedRows:{},selectOnRowClick:{type:Boolean,default:!1},spanMethod:{},isInitTableData:{type:Boolean,default:!0},initTableData:{},isFrontPagination:{type:Boolean,default:!1},defaultSort:{}},emits:["row-click","header-click","page-change","sort-change","current-change","selection-change","select","select-all","update:selectedRows"],setup(t,{expose:e,emit:n}){const o=t,{data:i,columns:s,pagination:a,spanMethod:l,loading:c,loadingText:d,loadingConfig:u,defaultSort:p,highlightCurrentRow:h,rowKey:f,selectable:m,selectedRows:g,selectOnRowClick:v,isFrontPagination:b}=r.toRefs(o),y=r.useSlots(),k=r.computed(()=>Object.keys(y)),x=r.ref(i.value),w=n,S=r.ref(),C=r.ref(),E=r.ref(),{columnsWithFixed:M}=C0(s,C,E),{sortedData:N,handleSort:T,getSortOrder:R}=S0(x,M,p==null?void 0:p.value),{paginatedData:z,updatePagination:_}=x0(N,a,b),I=r.computed(()=>z.value),{internalSelectedRows:O,isAllSelected:V,isIndeterminate:P,toggleRowSelection:A,toggleAllSelection:L,clearSelection:j,getSelectedRows:K}=function(X,ie,ae){const re=r.ref((ae==null?void 0:ae.value)||[]);r.watch(ae,ue=>{ue&&(re.value=[...ue])},{deep:!0,immediate:!0});const xe=ue=>re.value.some(ge=>ie.value?ge[ie.value]===ue[ie.value]:ge===ue),nt=()=>X.value.filter(ue=>xe(ue)).length,Oe=r.computed(()=>!!X.value.length&&X.value.every(ue=>xe(ue))),_e=r.computed(()=>{if(!X.value.length)return!1;const ue=nt();return ue>0&&ue<X.value.length});return{internalSelectedRows:re,isRowSelected:xe,isAllSelected:Oe,isIndeterminate:_e,toggleRowSelection:(ue,ge)=>{const at=ge!==void 0?ge:!xe(ue);if(at)xe(ue)||re.value.push(ue);else{const ft=re.value.findIndex(we=>ie.value?we[ie.value]===ue[ie.value]:we===ue);ft>-1&&re.value.splice(ft,1)}return at},toggleAllSelection:ue=>{ue?X.value.forEach(ge=>{xe(ge)||re.value.push(ge)}):X.value.forEach(ge=>{const at=re.value.findIndex(ft=>ie.value?ft[ie.value]===ge[ie.value]:ft===ge);at>-1&&re.value.splice(at,1)})},clearSelection:()=>{re.value=[]},getSelectedRows:()=>[...re.value],getCurrentPageSelectionInfo:()=>{const ue=X.value.length,ge=nt();return{totalCount:ue,selectedCount:ge,isAllSelected:ue>0&&ge===ue,isIndeterminate:ge>0&&ge<ue}}}}(I,f,g),{setCurrentRow:H,getRowClass:q}=function(X){const ie=r.ref(null);return{currentRow:ie,setCurrentRow:ae=>(ie.value=ae,ie.value),getRowClass:ae=>{const re=[];return X.value&&ie.value===ae&&re.push("is-current"),re},clearCurrentRow:()=>{ie.value=null}}}(h);r.watch(()=>i.value,X=>{x.value=X},{deep:!0,immediate:!0});const Y=(X,ie)=>{if(h.value){const ae=H(X);w("current-change",ae)}if(m.value&&v.value){const ae=A(X);me(X,ae)}w("row-click",X,ie)},G=(X,ie)=>{w("header-click",X,ie)},Q=X=>{const ie=T(X);ie&&w("sort-change",ie)},oe=(X,ie)=>{const ae=A(X,ie);me(X,ae)},fe=X=>{L(X),me(null,X)},le=async X=>{_(X),r.nextTick(()=>{var ie;(ie=E.value)!=null&&ie.bodyWrapper&&(E.value.bodyWrapper.scrollTop=0)}),w("page-change",X),await Be()},me=(X,ie)=>{w("update:selectedRows",[...O.value]),w("selection-change",[...O.value]),X?w("select",X,ie):w("select-all",ie)},Be=async()=>{if(o.isInitTableData&&o.initTableData&&typeof o.initTableData=="function"){const{data:X,total:ie}=await o.initTableData({pageSize:a.value.pageSize||10,pageNum:a.value.currentPage||1});x.value=X,a.value.total=ie}};return r.onMounted(()=>{Be()}),e({ref:S,clearSort:()=>{s.value.forEach(X=>{X.sortable&&(X.sortOrder=null)})},toggleRowSelection:(X,ie)=>{const ae=A(X,ie);me(X,ae)},refresh:async()=>{a.value.currentPage=1,await Be()},toggleAllSelection:X=>{L(X),me(null,X)},clearSelection:()=>{j(),w("update:selectedRows",[]),w("selection-change",[])},getSelectedRows:K}),(X,ie)=>{var ae;return r.openBlock(),r.createElementBlock("div",{ref_key:"_ref",ref:S,class:r.normalizeClass(["mc-table",{"mc-table--loading":r.unref(c)}])},[r.createVNode(DM,{ref_key:"headerRef",ref:C,columns:r.unref(M),"show-header":t.showHeader,"get-sort-order":r.unref(R),selectable:r.unref(m),"is-all-selected":r.unref(V),"is-indeterminate":r.unref(P),onHeaderClick:G,onSortChange:Q,onSelectAll:fe},r.createSlots({_:2},[r.renderList(k.value,re=>({name:re,fn:r.withCtx(xe=>[r.renderSlot(X.$slots,re,r.normalizeProps(r.guardReactiveProps(xe)),void 0,!0)])}))]),1032,["columns","show-header","get-sort-order","selectable","is-all-selected","is-indeterminate"]),r.createVNode(EM,{ref_key:"bodyRef",ref:E,data:I.value,columns:r.unref(M),"row-key":r.unref(f),"empty-text":t.emptyText,height:t.height,"max-height":t.maxHeight,"span-method":r.unref(l),pagination:r.unref(a),"get-row-class":r.unref(q),selectable:r.unref(m),"selected-rows":r.unref(O),"select-on-row-click":r.unref(v),onRowClick:Y,onSelect:oe},r.createSlots({_:2},[r.renderList(k.value,re=>({name:re,fn:r.withCtx(xe=>[r.renderSlot(X.$slots,re,r.normalizeProps(r.guardReactiveProps(xe)),void 0,!0)])}))]),1032,["data","columns","row-key","empty-text","height","max-height","span-method","pagination","get-row-class","selectable","selected-rows","select-on-row-click"]),r.unref(a)&&((ae=r.unref(a))==null?void 0:ae.total)>0?(r.openBlock(),r.createBlock(tN,{key:0,pagination:r.unref(a),onPageChange:le},null,8,["pagination"])):r.createCommentVNode("",!0),r.createVNode(HM,{class:"mc-table__loading",loading:r.unref(c),"loading-text":r.unref(d),"loading-config":r.unref(u)},{loading:r.withCtx(re=>[r.renderSlot(X.$slots,"loading",r.normalizeProps(r.guardReactiveProps(re)),void 0,!0)]),_:3},8,["loading","loading-text","loading-config"])],2)}}}),[["__scopeId","data-v-fa1a6ad5"]])),M0="mc-table-plus",N0="mc-table-header",B0="mc-table-sort",T0="mc-table-body",O0="mc-table-row",_0="mc-table-cell",A0="mc-table-empty",V0="mc-table-loading",I0="mc-table-scroll",D0="mc-table-footer",R0="mc-table-total",L0="mc-page-size",z0="mc-table-pagination",$0="mc-table-pagination-item",P0="mc-table-ellipsis",cr={fixed:"none",sortable:!1,columnAlign:"left",rowAlign:"center",sortType:"string"},bd=Symbol("mc-table-context"),qn=()=>{const t=r.inject(bd,void 0);return{tableCtx:t,data:t.data,tableWidth:t.tableWidth,isLoading:r.computed(()=>!!t.isLoading.value),columnWidth:t.columnWidth,leftColumns:t.leftColumns,rightColumns:t.rightColumns,centerColumns:t.centerColumns,scroll:t.scroll,setScroll:t.setScroll,pagination:t.pagination,handlePagination:t.handlePagination,doSort:t.handleSort,isExpanded:t.isExpanded,getExpandData:t.getExpandData,setExpandData:t.setExpandData,removeExpandData:t.removeExpandData,getCurrentSort:t.getCurrentSort,expandCondition:t.expandCondition,fetchExpandData:t.fetchExpandData,leftWidth:t.leftWidth,rightWidth:t.rightWidth,centerWidth:t.centerWidth,viewWidth:t.viewWidth}},kd={pageNum:1,pageSize:25,total:1,pageSizes:[25,50,75,100]},wd="mc-table-column-plus",nN={class:"mc-table-column"},j0=Z(r.defineComponent({name:wd,__name:"mc-table-column-plus",props:{prop:{},label:{},desc:{},width:{},fixed:{},sortable:{type:Boolean},columnAlign:{},rowAlign:{},sortType:{type:[String,Function]},defaultValue:{type:[String,Number,Boolean]}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",nN))})),oN=(t=ct)=>{switch(t){case"left":return"flex-start";case"center":return"center";case"right":return"flex-end"}},rN={key:0,class:"mc-table-row-tr mc-table-row-left"},iN={class:"mc-table-row-center-content"},sN={key:3,class:"mc-table-row-tr mc-table-row-right"},aN=r.defineComponent({name:O0,__name:"mc-table-row",props:{type:{default:"body"},leftColumns:{default:()=>[]},rightColumns:{default:()=>[]},centerColumns:{default:()=>[]}},setup(t){const e=t,n=r.ref(),{scroll:o,setScroll:i,leftWidth:s,rightWidth:a,centerWidth:l,viewWidth:c}=qn();r.onMounted(()=>{p(o.value)}),r.watch(()=>o.value,h=>{p(h)});const d=r.computed(()=>e.rightColumns.length>0&&o.value>0),u=r.computed(()=>{const h=Di(c.value)+Di(o.value)+5<Di(l.value);return e.leftColumns.length>0&&h}),p=h=>{n.value&&n.value.scrollTo({left:h})};return Li(n,"scroll",h=>{const f=h.target.scrollLeft||0;i(f)}),(h,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-table-row",[`mc-table-row-${t.type}`]])},[t.leftColumns.length?(r.openBlock(),r.createElementBlock("tr",rN,[r.renderSlot(h.$slots,"left",{columns:t.leftColumns},void 0,!0)])):r.createCommentVNode("",!0),d.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:"mc-table-border mc-table-row-left-border",style:r.normalizeStyle({left:r.unref(Ga)(r.unref(s))})},null,4)):r.createCommentVNode("",!0),r.createElementVNode("div",{ref_key:"rowRef",ref:n,class:"mc-table-row-tr mc-table-row-center"},[r.createElementVNode("div",iN,[r.renderSlot(h.$slots,"default",{columns:t.centerColumns},void 0,!0)])],512),u.value?(r.openBlock(),r.createElementBlock("div",{key:2,class:"mc-table-border mc-table-row-right-border",style:r.normalizeStyle({right:r.unref(Ga)(r.unref(a))})},null,4)):r.createCommentVNode("",!0),t.rightColumns.length?(r.openBlock(),r.createElementBlock("tr",sN,[r.renderSlot(h.$slots,"right",{columns:t.rightColumns},void 0,!0)])):r.createCommentVNode("",!0)],2))}}),xd=U(aN,[["__scopeId","data-v-07610e84"]]),lN=U(r.defineComponent({name:B0,__name:"mc-table-sort",props:{sort:{default:"normal"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-table-sort",`mc-table-sort-${t.sort}`])},[r.createVNode(r.unref(de),{name:"Up-Chevron02",class:r.normalizeClass({"mc-table-sort-actived":t.sort==="asc"}),style:{height:"8px"}},null,8,["class"]),r.createVNode(r.unref(de),{name:"Down-Chevron02",class:r.normalizeClass({"mc-table-sort-actived":t.sort==="desc"}),style:{height:"8px"}},null,8,["class"])],2))}),[["__scopeId","data-v-b687f674"]]),cN={class:"mc-table-header-cell-title"},dN={class:"mc-table-header-cell-title-text"},uN={key:0,class:"mc-table-header-cell-sort"},pN={class:"mc-table-header-cell-desc"},hN={class:"mc-table-body-cell-value"},bn=U(r.defineComponent({name:_0,__name:"mc-table-cell",props:{column:{},width:{},type:{default:"body"},row:{},rowIndex:{}},setup(t){const e=r.ref(),{isHeader:n,isExpand:o,isExpandIcon:i,cellStyle:s,headerCtx:a,bodyCtx:l,expandIconCtx:c}=(d=>{var z;const{columnWidth:u,doSort:p,isExpanded:h,setExpandData:f,removeExpandData:m,getCurrentSort:g,expandCondition:v,fetchExpandData:b}=qn(),y=be("column"),k=be("type"),x=be("width"),w=r.computed(()=>k.value==="header"),S=r.computed(()=>k.value==="body"),C=r.computed(()=>k.value==="expand"),E=r.computed(()=>k.value==="expand-icon"),M=r.computed(()=>{var O,V;const _=x.value?`${x.value}px`:u!=null&&u.value?`${u.value}px`:"auto";let I="default";return w.value&&((O=y==null?void 0:y.value)!=null&&O.sortable)&&(I="pointer"),{width:_,cursor:I,alignItems:E.value?"center":oN((V=y==null?void 0:y.value)==null?void 0:V.columnAlign)}});let N={},T={},R={};if(w.value){const _=r.computed(()=>{var I;return Ve(g)?g(((I=y==null?void 0:y.value)==null?void 0:I.prop)||""):"normal"});if((z=y==null?void 0:y.value)!=null&&z.sortable){const I=Lo(()=>{var O;p(((O=y==null?void 0:y.value)==null?void 0:O.prop)||"",(V=>{switch(V){case"normal":return"desc";case"desc":return"asc";default:return"normal"}})(_.value))},500);Li(d,"click",I)}N={currentSort:_}}else if(E.value){const _=be("row"),I=be("rowIndex"),O=r.computed(()=>!Ve(v)||r.unref(v(_==null?void 0:_.value))),V=r.computed(()=>{const A=I==null?void 0:I.value;return!Ee(A)&&h(A)}),P=Lo(async()=>{if(Ee(I==null?void 0:I.value))return;let A=[];Ve(b)&&!V.value?(A=r.unref(await b(_==null?void 0:_.value)),f(I.value,A)):m(I.value)},500);r.watchEffect(()=>{var A,L;O.value?(A=d.value)==null||A.addEventListener("click",P):(L=d.value)==null||L.removeEventListener("click",P)}),r.onBeforeMount(()=>{var A;(A=d.value)==null||A.removeEventListener("click",P)}),R={allowExpand:O,isExpanded:V}}else if(S.value){const _=be("row");T={displayValue:r.computed(()=>{var V,P;const I=((V=y==null?void 0:y.value)==null?void 0:V.defaultValue)||"--",O=(P=y==null?void 0:y.value)==null?void 0:P.prop;return Ee(O)||Ee(_==null?void 0:_.value)||Ee(_.value[O])?I:_.value[O]})}}return{isHeader:w,isBody:S,isExpand:C,isExpandIcon:E,cellStyle:M,headerCtx:N,bodyCtx:T,expandIconCtx:R}})(e);return(d,u)=>r.unref(n)?(r.openBlock(),r.createElementBlock("th",{key:0,ref_key:"cellRef",ref:e,class:r.normalizeClass(`mc-table-${t.type}-cell`),style:r.normalizeStyle(r.unref(s))},[r.renderSlot(d.$slots,"header",{},()=>{var p;return[r.createElementVNode("div",cN,[r.createElementVNode("div",dN,[r.renderSlot(d.$slots,"title",{},()=>[r.createTextVNode(r.toDisplayString(t.column.label),1)],!0)]),t.column.sortable?(r.openBlock(),r.createElementBlock("div",uN,[r.createVNode(lN,{sort:(p=r.unref(a).currentSort)==null?void 0:p.value},null,8,["sort"])])):r.createCommentVNode("",!0)]),t.column.desc||d.$slots.desc?r.renderSlot(d.$slots,"desc",{key:0},()=>[r.createElementVNode("div",pN,r.toDisplayString(t.column.desc),1)],!0):r.createCommentVNode("",!0)]},!0)],6)):r.unref(o)?(r.openBlock(),r.createElementBlock("td",{key:1,ref_key:"cellRef",ref:e,class:r.normalizeClass(`mc-table-${t.type}-cell`),style:r.normalizeStyle(r.unref(s))},[r.renderSlot(d.$slots,"default",{},void 0,!0)],6)):r.unref(i)?(r.openBlock(),r.createElementBlock("td",{key:2,ref_key:"cellRef",ref:e,class:r.normalizeClass(`mc-table-${t.type}-cell`),style:r.normalizeStyle(r.unref(s))},[r.renderSlot(d.$slots,"default",{},()=>{var p,h,f;return[(p=r.unref(c).allowExpand)!=null&&p.value?(r.openBlock(),r.createBlock(r.unref(Nn),{key:0,class:r.normalizeClass(["mc-table-expand-icon",{"mc-table-expand-icon-active":(h=r.unref(c).isExpanded)==null?void 0:h.value}]),cursor:(f=r.unref(c).allowExpand)!=null&&f.value?"pointer":"default",name:"down-chevron"},null,8,["class","cursor"])):r.createCommentVNode("",!0)]},!0)],6)):(r.openBlock(),r.createElementBlock("td",{key:3,ref_key:"cellRef",ref:e,class:r.normalizeClass([`mc-table-${t.type}-cell`,`mc-table-${t.type}-cell-row-align-${t.column.rowAlign}`]),style:r.normalizeStyle(r.unref(s))},[r.renderSlot(d.$slots,"default",{},()=>{var p;return[r.createElementVNode("span",hN,r.toDisplayString((p=r.unref(l).displayValue)==null?void 0:p.value),1)]},!0)],6))}}),[["__scopeId","data-v-2ac704bd"]]),fN={class:"mc-table-header"},mN={class:"mc-table-header-thead"},gN=U(r.defineComponent({name:N0,__name:"mc-table-header",setup(t){const{leftColumns:e,rightColumns:n,centerColumns:o}=qn();return(i,s)=>(r.openBlock(),r.createElementBlock("table",fN,[r.createElementVNode("thead",mN,[r.createVNode(xd,{type:"header","left-columns":r.unref(e),"right-columns":r.unref(n),"center-columns":r.unref(o)},{left:r.withCtx(({columns:a})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a,l=>(r.openBlock(),r.createBlock(bn,{key:l.prop,column:l,width:l.width,type:"header"},r.createSlots({_:2},[l.header?{name:"header",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.header)))]),key:"0"}:void 0,l.headerTitle?{name:"title",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerTitle)))]),key:"1"}:void 0,l.headerDesc?{name:"desc",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerDesc)))]),key:"2"}:void 0]),1032,["column","width"]))),128))]),default:r.withCtx(({columns:a})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a,l=>(r.openBlock(),r.createBlock(bn,{key:l.prop,column:l,width:l.width,type:"header"},r.createSlots({_:2},[l.header?{name:"header",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.header)))]),key:"0"}:void 0,l.headerTitle?{name:"title",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerTitle)))]),key:"1"}:void 0,l.headerDesc?{name:"desc",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerDesc)))]),key:"2"}:void 0]),1032,["column","width"]))),128))]),right:r.withCtx(({columns:a})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a,l=>(r.openBlock(),r.createBlock(bn,{key:l.prop,column:l,width:l.width,type:"header"},r.createSlots({_:2},[l.header?{name:"header",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.header)))]),key:"0"}:void 0,l.headerTitle?{name:"title",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerTitle)))]),key:"1"}:void 0,l.headerDesc?{name:"desc",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerDesc)))]),key:"2"}:void 0]),1032,["column","width"]))),128))]),_:1},8,["left-columns","right-columns","center-columns"])])]))}}),[["__scopeId","data-v-f42fcd80"]]),vN={key:0,class:"mc-table-total"},yN={class:"mc-table-total-number"},bN={class:"mc-table-total-number"},kN=U(r.defineComponent({name:R0,__name:"mc-table-total",setup(t){const{pagination:e}=qn(),n=r.computed(()=>{if(!e)return;const{pageNum:o,pageSize:i,total:s}=e;return{range:`${(o-1)*i+1}-${Math.min(o*i,s)}`,total:s}});return(o,i)=>n.value?(r.openBlock(),r.createElementBlock("div",vN,[i[0]||(i[0]=r.createElementVNode("span",null,"Showing",-1)),r.createElementVNode("span",yN,r.toDisplayString(n.value.range),1),i[1]||(i[1]=r.createElementVNode("span",null,"of",-1)),r.createElementVNode("span",bN,r.toDisplayString(n.value.total),1)])):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-f242f0b2"]]),wN={class:"mc-table-ellipsis"},xN=U(r.defineComponent({name:P0,__name:"mc-table-ellipsis",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",wN,[...n[0]||(n[0]=[r.createElementVNode("i",{class:"mc-table-ellipsis-dot"},null,-1),r.createElementVNode("i",{class:"mc-table-ellipsis-dot"},null,-1),r.createElementVNode("i",{class:"mc-table-ellipsis-dot"},null,-1)])]))}),[["__scopeId","data-v-3c0b84f7"]]),kn=U(r.defineComponent({name:$0,__name:"mc-table-pagination-item",props:{type:{default:"page"},value:{default:1},isActive:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>{switch(e.type){case"page":return"mc-table-pagination-item-page";case"prev":return"mc-table-pagination-item-prev";case"next":return"mc-table-pagination-item-next";case"first":return"mc-table-pagination-item-first";case"last":return"mc-table-pagination-item-last";case"ellipsis":return"mc-table-pagination-item-ellipsis";default:return"mc-table-pagination-item"}});return(o,i)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-table-pagination-item",[{"mc-table-pagination-item-active":t.isActive,"mc-table-pagination-item-disabled":t.isDisabled},n.value]])},[t.type==="page"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createTextVNode(r.toDisplayString(t.value),1)],64)):t.type==="prev"?(r.openBlock(),r.createBlock(r.unref(de),{key:1,name:"Left-Chevron"})):t.type==="next"?(r.openBlock(),r.createBlock(r.unref(de),{key:2,name:"Right-Chevron"})):t.type==="first"?(r.openBlock(),r.createBlock(r.unref(de),{key:3,name:"First"})):t.type==="last"?(r.openBlock(),r.createBlock(r.unref(de),{key:4,name:"Last"})):t.type==="ellipsis"?(r.openBlock(),r.createBlock(xN,{key:5})):r.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-f2d32b30"]]),CN={key:0,class:"mc-table-pagination"},SN=r.defineComponent({name:z0,__name:"mc-table-pagination",setup(t){const{pagination:e,isLoading:n,handlePagination:o}=qn(),i=r.computed(()=>e?Math.ceil(e.total/e.pageSize):0),s=r.computed(()=>{if(!e||i.value<=1)return[];const h=[];if(i.value<=5)for(let f=2;f<i.value;f++)h.push(f);else e.pageNum<=2?h.push(2,3,4,5):e.pageNum>=i.value-1?h.push(i.value-4,i.value-3,i.value-2,i.value-1):h.push(e.pageNum-1,e.pageNum,e.pageNum+1);return h}),a=r.computed(()=>!e||e.pageNum<=1),l=r.computed(()=>!e||e.pageNum>=i.value),c=r.computed(()=>!e||i.value<=1),d=r.computed(()=>!!e&&i.value>5&&e.pageNum>2),u=r.computed(()=>!!e&&i.value>5&&e.pageNum<i.value-1),p=h=>{Ve(o)&&!n.value&&(h==="first"?a.value||o({pageNum:1}):h==="prev"?e&&e.pageNum>1&&!a.value&&o({pageNum:e.pageNum-1}):h==="next"?e&&e.pageNum<i.value&&!l.value&&o({pageNum:e.pageNum+1}):h==="last"?l.value||o({pageNum:i.value}):h!==(e==null?void 0:e.pageNum)&&o({pageNum:h}))};return(h,f)=>{var m,g;return c.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("ul",CN,[r.createVNode(kn,{type:"first","is-disabled":a.value,onClick:f[0]||(f[0]=v=>p("first"))},null,8,["is-disabled"]),r.createVNode(kn,{type:"prev","is-disabled":a.value,onClick:f[1]||(f[1]=v=>p("prev"))},null,8,["is-disabled"]),r.createVNode(kn,{value:1,"is-active":((m=r.unref(e))==null?void 0:m.pageNum)===1,onClick:f[2]||(f[2]=v=>p(1))},null,8,["is-active"]),d.value?(r.openBlock(),r.createBlock(kn,{key:0,type:"ellipsis"})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,v=>{var b;return r.openBlock(),r.createBlock(kn,{key:v,value:v,"is-active":((b=r.unref(e))==null?void 0:b.pageNum)===v,onClick:y=>p(v)},null,8,["value","is-active","onClick"])}),128)),u.value?(r.openBlock(),r.createBlock(kn,{key:1,type:"ellipsis"})):r.createCommentVNode("",!0),r.createVNode(kn,{value:i.value,"is-active":((g=r.unref(e))==null?void 0:g.pageNum)===i.value,onClick:f[3]||(f[3]=v=>p(i.value))},null,8,["value","is-active"]),r.createVNode(kn,{type:"next","is-disabled":l.value,onClick:f[4]||(f[4]=v=>p("next"))},null,8,["is-disabled"]),r.createVNode(kn,{type:"last","is-disabled":l.value,onClick:f[5]||(f[5]=v=>p("last"))},null,8,["is-disabled"])]))}}}),EN=U(SN,[["__scopeId","data-v-df311846"]]),MN={class:"mc-table-page-size"},NN={class:"mc-table-page-size-group"},BN=["onClick"],TN=U(r.defineComponent({name:L0,__name:"mc-table-page-size",setup(t){const{pagination:e,isLoading:n,handlePagination:o}=qn();return(i,s)=>{var a;return r.openBlock(),r.createElementBlock("div",MN,[s[0]||(s[0]=r.createElementVNode("span",{class:"mc-table-page-size-text"},"View per page",-1)),r.createElementVNode("ul",NN,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList((a=r.unref(e))==null?void 0:a.pageSizes,l=>{var c;return r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-table-page-size-group-item",{"mc-table-page-size-group-item-active":l===((c=r.unref(e))==null?void 0:c.pageSize)}]),key:l,onClick:d=>(u=>{Ve(o)&&!n.value&&o({pageSize:u,pageNum:1})})(l)},r.toDisplayString(l),11,BN)}),128))])])}}}),[["__scopeId","data-v-180a8b6e"]]),ON={class:"mc-table-footer"},_N=U(r.defineComponent({name:D0,__name:"mc-table-footer",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",ON,[r.createVNode(kN),r.createVNode(EN),r.createVNode(TN)]))}),[["__scopeId","data-v-1fc62add"]]),AN={class:"mc-table-loading"},VN=U(r.defineComponent({name:V0,__name:"mc-table-loading",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",AN,[r.renderSlot(e.$slots,"default",{},()=>[r.createVNode(r.unref(kl),{loading:!0,type:"pulse",size:"small"})],!0)]))}),[["__scopeId","data-v-fb443fd0"]]),IN={class:"mc-table-body"},DN={class:"mc-table-body-tbody"},RN=U(r.defineComponent({name:T0,__name:"mc-table-body",props:{loading:{type:Boolean,default:!1}},setup(t){const{data:e,leftColumns:n,rightColumns:o,centerColumns:i,isExpanded:s,getExpandData:a}=qn();return(l,c)=>(r.openBlock(),r.createElementBlock("table",IN,[r.createElementVNode("tbody",DN,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(e),(d,u)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:u},[r.createVNode(xd,{"left-columns":r.unref(n),"right-columns":r.unref(o),"center-columns":r.unref(i)},{left:r.withCtx(({columns:p})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,h=>(r.openBlock(),r.createBlock(bn,{key:h.prop,column:h,row:d,rowIndex:u,width:h.width,type:h.isExpand?"expand-icon":"body"},r.createSlots({_:2},[h.tableValue?{name:"default",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(h.tableValue),{value:d==null?void 0:d[h.prop],row:d,rowIndex:u},null,8,["value","row","rowIndex"]))]),key:"0"}:void 0]),1032,["column","row","rowIndex","width","type"]))),128))]),default:r.withCtx(({columns:p})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,h=>(r.openBlock(),r.createBlock(bn,{key:h.prop,column:h,row:d,rowIndex:u,width:h.width,type:h.isExpand?"expand-icon":"body"},r.createSlots({_:2},[h.tableValue?{name:"default",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(h.tableValue),{value:d==null?void 0:d[h.prop],row:d,rowIndex:u},null,8,["value","row","rowIndex"]))]),key:"0"}:void 0]),1032,["column","row","rowIndex","width","type"]))),128))]),right:r.withCtx(({columns:p})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,h=>(r.openBlock(),r.createBlock(bn,{key:h.prop,column:h,row:d,rowIndex:u,width:h.width,type:h.isExpand?"expand-icon":"body"},r.createSlots({_:2},[h.tableValue?{name:"default",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(h.tableValue),{value:d==null?void 0:d[h.prop],row:d,rowIndex:u},null,8,["value","row","rowIndex"]))]),key:"0"}:void 0]),1032,["column","row","rowIndex","width","type"]))),128))]),_:2},1032,["left-columns","right-columns","center-columns"]),r.unref(s)(u)?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(a)(u),(p,h)=>(r.openBlock(),r.createBlock(xd,{key:h,"left-columns":r.unref(n),"right-columns":r.unref(o),"center-columns":r.unref(i),type:"expand"},{left:r.withCtx(({columns:f})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f,m=>(r.openBlock(),r.createBlock(bn,{key:m.prop,column:m,width:m.width,type:"expand"},{default:r.withCtx(()=>[m.expand?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.expand),{key:0,expandRow:p,expandRowIndex:h},null,8,["expandRow","expandRowIndex"])):r.createCommentVNode("",!0)]),_:2},1032,["column","width"]))),128))]),default:r.withCtx(({columns:f})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f,m=>(r.openBlock(),r.createBlock(bn,{key:m.prop,column:m,width:m.width,type:"expand"},{default:r.withCtx(()=>[m.expand?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.expand),{key:0,expandRow:p,expandRowIndex:h},null,8,["expandRow","expandRowIndex"])):r.createCommentVNode("",!0)]),_:2},1032,["column","width"]))),128))]),right:r.withCtx(({columns:f})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f,m=>(r.openBlock(),r.createBlock(bn,{key:m.prop,column:m,width:m.width,type:"expand"},{default:r.withCtx(()=>[m.expand?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.expand),{key:0,expandRow:p,expandRowIndex:h},null,8,["expandRow","expandRowIndex"])):r.createCommentVNode("",!0)]),_:2},1032,["column","width"]))),128))]),_:2},1032,["left-columns","right-columns","center-columns"]))),128)):r.createCommentVNode("",!0)],64))),128))]),t.loading?(r.openBlock(),r.createBlock(VN,{key:0},{default:r.withCtx(()=>[r.renderSlot(l.$slots,"loading",{},void 0,!0)]),_:3})):r.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-68cb46c9"]]),LN={class:"mc-table-empty"},zN=U(r.defineComponent({name:A0,__name:"mc-table-empty",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",LN,[r.renderSlot(e.$slots,"default",{},()=>[n[0]||(n[0]=r.createElementVNode("p",{class:"mc-table-empty-content"},"No available data",-1))],!0)]))}),[["__scopeId","data-v-f58471d5"]]),$N=r.defineComponent({name:I0,__name:"mc-table-scroll",setup(t){const{scroll:e,centerWidth:n,viewWidth:o,tableWidth:i,setScroll:s}=qn(),a=r.ref(),l=r.ref(),c=r.computed(()=>_u(o.value/n.value*100)),d=r.computed(()=>Di(c.value)<=95),u=r.computed(()=>`${c.value}%`),p=r.ref(0);r.watchEffect(()=>{p.value=n.value?e.value*i.value/n.value:0});let h=0,f=0;const m=y=>{a.value&&(h=y.clientX,f=p.value,window.addEventListener("mousemove",g),window.addEventListener("mouseup",v))},g=y=>{var C,E;let k=y.clientX-h+f;k<0&&(k=0);const x=((E=(C=l.value)==null?void 0:C.getBoundingClientRect())==null?void 0:E.width)||0,w=i.value-x+2;k>w&&(k=w),p.value=k;const S=p.value*n.value/i.value;s(S)},v=()=>{b()},b=()=>{window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",v)};return r.onBeforeUnmount(()=>{b()}),(y,k)=>d.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:a,class:"mc-table-scroll",onMousedown:m},[r.createElementVNode("div",{ref_key:"thumbRef",ref:l,class:"mc-table-scroll-thumb",style:r.normalizeStyle({width:u.value,transform:`translateX(${r.unref(Ga)(p.value)})`})},null,4)],544)):r.createCommentVNode("",!0)}}),PN=U($N,[["__scopeId","data-v-3b46e14e"]]),jN=r.defineComponent({name:M0,__name:"mc-table-plus",props:{data:{default:()=>[]},loading:{type:Boolean,default:!1},sortType:{default:"back"},pagination:{},width:{default:"100%"},height:{},expandCondition:{},fetchExpandData:{}},emits:["change:sort","change:pagination","change:expand"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(),{width:s,height:a}=$t(),l=r.ref(n.data),{columns:c,leftColumns:d,centerColumns:u,rightColumns:p,tableWidth:h,columnWidth:f}=(A=>{const L=r.ref([]),j=r.ref([]),K=r.ref([]),H=r.ref([]),q=r.ref(0),Y=r.reactive({tableWidth:0,fixedWidth:0,restColumns:0}),G=r.useSlots();r.watch(()=>{var oe;return(oe=G.default)==null?void 0:oe.call(G)},()=>{var X;const{columns:oe,columnWidthInfo:fe,leftColumns:le,centerColumns:me,rightColumns:Be}=(ie=>{const ae=[],re=[],xe=[],nt=[],Oe={tableWidth:0,fixedWidth:0,restColumns:0},_e=ue=>{ce(ue)&&ue.forEach(ge=>{var ft;if(((ft=(ge==null?void 0:ge.type)||{})==null?void 0:ft.name)===wd){const we=ge.children,D=ge.props,W=Ro(D==null?void 0:D.sortable)&&D.sortable===""||(D==null?void 0:D.sortable)||cr.sortable,ee={prop:D==null?void 0:D.prop,label:D==null?void 0:D.label,desc:D==null?void 0:D.desc,width:(D==null?void 0:D.prop)==="expand"?40:D==null?void 0:D.width,fixed:(D==null?void 0:D.fixed)||cr.fixed,defaultValue:D==null?void 0:D.defaultValue,sortable:W,isExpand:(D==null?void 0:D.prop)==="expand",sortType:(D==null?void 0:D.sortType)||(D==null?void 0:D["sort-type"])||cr.sortType,columnAlign:(D==null?void 0:D.columnAlign)||(D==null?void 0:D["column-align"])||cr.columnAlign,rowAlign:(D==null?void 0:D.rowAlign)||(D==null?void 0:D["row-align"])||cr.rowAlign,headerTitle:we==null?void 0:we["header-title"],headerDesc:we==null?void 0:we["header-desc"],header:we==null?void 0:we.header,expand:we==null?void 0:we.expand,tableValue:we==null?void 0:we.default};ee.width?Oe.fixedWidth+=ee.width:Oe.restColumns+=1,ee.fixed==="left"?re.push(ee):ee.fixed==="right"?nt.push(ee):xe.push(ee),ae.push(ee)}else Array.isArray(ge.children)&&_e(ge.children)})};return _e(ie),{columns:ae,columnWidthInfo:Oe,leftColumns:re,centerColumns:xe,rightColumns:nt}})((X=G.default)==null?void 0:X.call(G));L.value=oe,Y.fixedWidth=fe.fixedWidth,Y.restColumns=fe.restColumns,j.value=le,K.value=me,H.value=Be},{immediate:!0}),Np(A,({width:oe})=>{let fe=oe;j.value.length>0&&(fe-=1),H.value.length>0&&(fe-=1),q.value=fe});const Q=r.computed(()=>{const oe=(q.value-Y.fixedWidth)/Y.restColumns;return oe<=0?240:oe});return{columns:L,leftColumns:j,centerColumns:K,rightColumns:H,tableWidth:q,columnWidth:Q}})(i),{scroll:m,setScroll:g,resetScroll:v}=(()=>{const A=r.ref(0);return{scroll:A,setScroll:L=>{A.value=L},resetScroll:()=>{A.value=0}}})(),{setSort:b,resetSort:y,getCurrentSort:k,sortData:x}=(()=>{const A=r.ref({sort:"normal",sortColumn:""}),L=(K,H)=>{A.value={sort:H,sortColumn:K}},j=K=>A.value.sortColumn===K?A.value.sort:"normal";return{sortInfo:A,setSort:L,resetSort:()=>L("","normal"),getCurrentSort:j,sortData:(K,H)=>{let q=[...K];const Y=H.prop,G=j(Y),Q=H.sortType||"string";return G!=="normal"&&(Ve(Q)||(fe=Q==="number"?me=>Number(me[Y]):[Y],le=[G],q=(oe=q)==null?[]:(ce(fe)||(fe=fe==null?[]:[fe]),ce(le)||(le=le==null?[]:[le]),function(me,Be,X){Be=Be.length?Eo(Be,function(ae){return ce(ae)?function(re){return Ia(re,ae.length===1?ae[0]:ae)}:ae}):[Mo];var ie=-1;return Be=Eo(Be,Ei(Sn)),function(ae){var re=ae.length;for(ae.sort(function(xe,nt){return function(Oe,_e,ue){for(var ge=-1,at=Oe.criteria,ft=_e.criteria,we=at.length,D=ue.length;++ge<we;){var W=Lb(at[ge],ft[ge]);if(W)return ge>=D?W:W*(ue[ge]=="desc"?-1:1)}return Oe.index-_e.index}(xe,nt,X)});re--;)ae[re]=ae[re].value;return ae}(up(me,function(ae,re,xe){return{criteria:Eo(Be,function(nt){return nt(ae)}),index:++ie,value:ae}}))}(oe,fe,le)))),q;var oe,fe,le}}})(),{pagination:w,hasPagination:S,handlePagination:C}=(()=>{const A=be("pagination"),L=r.reactive({...kd});r.onMounted(()=>{j(A.value||kd)});const j=Y=>{Hy(L,{...Y})};r.watch(()=>A.value,Y=>{j(Y||kd)},{deep:!0});const K=r.getCurrentInstance(),H=Vi(()=>{K==null||K.emit("change:pagination",L)},500),q=r.computed(()=>{var Y;return!!((Y=A.value)!=null&&Y.pageNum)});return{pagination:L,hasPagination:q,handlePagination:Y=>{j(Y),H()}}})(),{isExpanded:E,getExpandData:M,resetExpandData:N,setExpandData:T,removeExpandData:R}=(()=>{const A=r.reactive(new Map);return{expandData:A,isExpanded:L=>A.has(L),getExpandData:L=>A.get(L)||[],resetExpandData:()=>{A.clear()},setExpandData:(L,j)=>{A.set(L,j)},removeExpandData:L=>{A.delete(L)}}})(),{leftWidth:z,rightWidth:_,centerWidth:I,viewWidth:O}=(A=>{const{leftColumns:L,rightColumns:j,centerColumns:K,tableWidth:H,columnWidth:q}=A,Y=le=>function(me,Be,X){var ie=ce(me)?hu:Fb,ae=arguments.length<3;return ie(me,Sn(Be),X,ae,br)}(le,(me,Be)=>me+(Be.width||q.value),0),G=r.computed(()=>Y(L.value)),Q=r.computed(()=>Y(j.value)),oe=r.computed(()=>Y(K.value)),fe=r.computed(()=>H.value-G.value-Q.value);return{leftWidth:G,rightWidth:Q,centerWidth:oe,viewWidth:fe}})({leftColumns:d,rightColumns:p,centerColumns:u,tableWidth:h,columnWidth:f});r.watch(()=>n.data,()=>{l.value=n.data,N(),y(),v()});const V=r.computed(()=>{var A;return!n.loading&&!((A=l.value)!=null&&A.length)}),P=r.computed(()=>S.value&&!V.value);return r.provide(bd,{data:l,tableWidth:h,isLoading:r.computed(()=>!!n.loading),columns:c,columnWidth:f,leftColumns:d,rightColumns:p,centerColumns:u,scroll:m,setScroll:g,pagination:w,handlePagination:C,handleSort:(A,L)=>{if(N(),b(A,L),n.sortType==="front"){const j=Do(c.value,K=>K.prop===A);j&&(l.value=x(n.data,j))}else o("change:sort",A,L)},getCurrentSort:k,isExpanded:E,getExpandData:M,setExpandData:(A,L)=>{T(A,L),o("change:expand",l.value[A],!0)},removeExpandData:A=>{R(A),o("change:expand",l.value[A],!1)},expandCondition:n.expandCondition,fetchExpandData:n.fetchExpandData,leftWidth:z,rightWidth:_,centerWidth:I,viewWidth:O}),(A,L)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-table-plus",style:r.normalizeStyle({width:r.unref(s),height:r.unref(a)}),ref_key:"tableRef",ref:i},[r.createElementVNode("div",null,[r.createVNode(gN),V.value?(r.openBlock(),r.createBlock(zN,{key:1},{default:r.withCtx(()=>[r.renderSlot(A.$slots,"empty",{},void 0,!0)]),_:3})):(r.openBlock(),r.createBlock(RN,{key:0,loading:t.loading},null,8,["loading"]))]),r.createVNode(PN),P.value?(r.openBlock(),r.createBlock(_N,{key:0})):r.createCommentVNode("",!0)],4))}}),F0=Z(U(jN,[["__scopeId","data-v-acae2d99"]])),H0="mc-textarea",FN=["value","id","disabled","maxlength","placeholder"],HN={class:"mc-textarea-count"},WN=r.defineComponent({name:H0,__name:"mc-textarea",props:{modelValue:{default:""},placeholder:{default:"Please input"},disabled:{type:Boolean,default:!1},showCount:{type:Boolean,default:!0},width:{default:"100%"},height:{default:88},resize:{default:"vertical"},maxLength:{default:255},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:e}){const n=t,o=e,{width:i,height:s}=$t(),a=r.ref(),{wrapperRef:l,isFocused:c,handleFocus:d,handleBlur:u}=zo(a),{formId:p,validateStyle:h,formDisabled:f,validateByTrigger:m}=ln(),g=async k=>{let x=k.target.value;n.maxLength>0&&x.length>n.maxLength&&(x=x.slice(0,n.maxLength)),o("update:modelValue",x),o("change",x),await r.nextTick(),m("input")},v=r.useSlots(),b=r.computed(()=>!!n.showCount&&n.maxLength>0||!!v.count),y=r.computed(()=>{var k;return((k=n.modelValue)==null?void 0:k.length)??0});return(k,x)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"textareaWrapperRef",ref:l,class:r.normalizeClass(["mc-textarea",{"mc-textarea-disabled":r.unref(f),"mc-textarea-focused":r.unref(c),[r.unref(h)]:r.unref(h)}]),style:r.normalizeStyle({width:r.unref(i)})},[r.createElementVNode("textarea",{ref_key:"textareaRef",ref:a,value:t.modelValue,id:r.unref(p),class:"mc-textarea-input",style:r.normalizeStyle({width:r.unref(i),height:r.unref(s),resize:t.resize}),disabled:r.unref(f),maxlength:t.maxLength,placeholder:t.placeholder,onFocus:x[0]||(x[0]=(...w)=>r.unref(d)&&r.unref(d)(...w)),onBlur:x[1]||(x[1]=(...w)=>r.unref(u)&&r.unref(u)(...w)),onInput:g},null,44,FN),b.value?r.renderSlot(k.$slots,"count",{key:0,maxLength:t.maxLength,currentLength:y.value},()=>[r.createElementVNode("div",HN,[r.createElementVNode("span",null,r.toDisplayString(`${y.value} / ${t.maxLength} characters`),1)])],!0):r.createCommentVNode("",!0)],6))}}),W0=Z(U(WN,[["__scopeId","data-v-1f25cddc"]])),Cd=t=>parseFloat(t).toString(),Sd=(t,e=2)=>t<1024?`${t} B`:t<1048576?`${Cd((t/1024).toFixed(e))} KB`:t<1073741824?`${Cd((t/1048576).toFixed(e))} MB`:`${Cd((t/1073741824).toFixed(e))} GB`,K0=t=>{if(!t)return"--";const e=new Date(t);return`${e.getFullYear()}/${String(e.getMonth()+1).padStart(2,"0")}/${String(e.getDate()).padStart(2,"0")} ${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`},Ed=(t,e,n)=>{const o=t.get(e);t.set(e,{...o,...n})},U0="mc-upload",q0="mc-upload-dropzone",zt="[?]",Md=["jpg","jpeg","png","doc","docx","xls","xlsx","pdf"],KN={upload_note:"Click to upload or drag and drop your files here",max_size:"Max file size:",max_count:"No limit on maximum number of documents but recommend that upload then in pdf if more than 5 files are to be upload.",uploaded_by:"Uploaded by",uploaded_on:"Uploaded on",limit_count:`The number of files cannot exceed ${zt} .`,limit_size:`The file size cannot exceed ${zt} .`,limit_type:`${zt} only`,limit_count_reached:`You can only upload ${zt} files.`},UN={upload_note:"单击即可上传或将文件拖放到此处",max_size:"最大文件大小:",max_count:"No limit on maximum number of documents but recommend that upload then in pdf if more than 5 files are to be upload.",uploaded_by:"上传用户",uploaded_on:"上传时间",limit_count:`文件数量不能超过 ${zt} 。`,limit_size:`最大文件大小:${zt} 。`,limit_type:`只接受文件格式:${zt}`,limit_count_reached:`您只能上传 ${zt} 个文件。`},Nd=()=>{const t=be("lang");return{langMap:r.computed(()=>t.value==="zh"?UN:KN)}},qN={class:"mc-upload-dropzone-area"},JN={class:"mc-upload-dropzone-title"},GN={class:"mc-upload-dropzone-title-text"},YN={key:0,class:"mc-upload-dropzone-desc"},XN={key:0},ZN={key:1},QN=r.defineComponent({name:q0,__name:"mc-upload-dropzone",props:{title:{},icon:{default:"Document_Upload"},allowedFileTypes:{default:()=>Md},fileSize:{default:15728640},uploadUser:{default:"--"},lang:{default:"en"},hideDesc:{type:Boolean,default:!1},fileCount:{}},emits:["upload","error:type","error:size"],setup(t,{expose:e,emit:n}){const o=t,i=n,{langMap:s}=Nd(),a=r.ref(),l=r.computed(()=>{var m;return(m=o.allowedFileTypes)!=null&&m.length?s.value.limit_type.replace(zt,En(o.allowedFileTypes,g=>g.toUpperCase()).join(", ")):void 0}),{isDragover:c}=((m,g)=>{const v=r.ref(!1),b=S=>{S!==v.value&&(v.value=S)},y=S=>{S.preventDefault(),b(!0),Ve(g.onDragEnter)&&g.onDragEnter(S)},k=S=>{S.preventDefault(),b(!1),Ve(g.onDragLeave)&&g.onDragLeave(S)},x=S=>{S.preventDefault(),Ve(g.onDragover)&&g.onDragover(S)},w=S=>{S.preventDefault(),b(!1),Ve(g.onDrop)&&g.onDrop(S)};return r.onMounted(()=>{var S,C,E,M;(S=m.value)==null||S.addEventListener("dragenter",y),(C=m.value)==null||C.addEventListener("dragleave",k),(E=m.value)==null||E.addEventListener("dragover",x),(M=m.value)==null||M.addEventListener("drop",w)}),r.onBeforeUnmount(()=>{var S,C,E,M;(S=m.value)==null||S.removeEventListener("dragenter",y),(C=m.value)==null||C.removeEventListener("dragleave",k),(E=m.value)==null||E.removeEventListener("dragover",x),(M=m.value)==null||M.removeEventListener("drop",w)}),{isDragover:v}})(a,{onDrop:m=>{var v;const g=(v=m.dataTransfer)==null?void 0:v.files;g&&f(g)}}),d=r.ref(),u=()=>{d.value&&(d.value.value="")},p=()=>{var m;(m=d.value)==null||m.click()},h=m=>{const g=m.target.files;g&&f(g)},f=async m=>{let g=Array.from(m);const v=new Map;g.forEach(b=>{Ed(v,b.name,{name:b.name,size:b.size,status:"loading",uploadBy:o.uploadUser,uploadTime:Date.now(),file:b})}),((b,y)=>{const k=o.fileSize;if(k<=0)return!0;let x=!1;for(let w=0;w<b.length;w++){const S=b[w];S.size>k?(Ed(y,S.name,{status:"failed",errorMessage:s.value.limit_size.replace(zt,`${Sd(k)}`)}),i("error:size",S.name)):x=!0}})(g,v),((b,y)=>{var S;const k=o.allowedFileTypes;if(!(k!=null&&k.length))return!0;let x=!1;const w=En(k,C=>C.toUpperCase());for(let C=0;C<b.length;C++)gt(w,((S=b[C].name.split(".").pop())==null?void 0:S.toUpperCase())??"--")?x=!0:(Ed(y,b[C].name,{status:"failed",errorMessage:l.value}),i("error:type",b[C].name))})(g,v),i("upload",v),u()};return e({clearUploadInput:u}),(m,g)=>(r.openBlock(),r.createElementBlock("div",{ref:"wrapperRef",class:r.normalizeClass(["mc-upload-dropzone",{"mc-upload-dropzone-dragover":r.unref(c)}]),onClick:p},[r.createElementVNode("div",qN,[r.renderSlot(m.$slots,"default",{},()=>[r.createElementVNode("div",JN,[r.renderSlot(m.$slots,"title",{},()=>[r.createVNode(r.unref(de),{name:t.icon},null,8,["name"]),r.createElementVNode("span",GN,r.toDisplayString(t.title||r.unref(s).upload_note),1)],!0)]),t.hideDesc?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",YN,[r.renderSlot(m.$slots,"desc",{},()=>[t.fileSize>0?(r.openBlock(),r.createElementBlock("span",XN,r.toDisplayString(r.unref(s).max_size)+" "+r.toDisplayString(r.unref(Sd)(t.fileSize)),1)):r.createCommentVNode("",!0),l.value?(r.openBlock(),r.createElementBlock("span",ZN,r.toDisplayString(l.value),1)):r.createCommentVNode("",!0)],!0)]))],!0)]),r.createElementVNode("input",{ref_key:"uploadInputRef",ref:d,type:"file",multiple:"",style:{display:"none"},onChange:h},null,544),r.createElementVNode("div",{class:"mc-upload-dropzone-cover",ref_key:"coverRef",ref:a},null,512)],2))}}),eB=U(QN,[["__scopeId","data-v-39652196"]]),J0="mc-file-list",tB={class:"mc-file-list-item-content"},nB={class:"mc-file-list-item-file mc-file-list-item-info"},oB=["onClick"],rB={class:"mc-file-list-item-file-name-text"},iB={class:"mc-file-list-item-file-desc"},sB={class:"mc-file-list-item-file-size-text"},aB={key:0,class:"mc-file-list-item-file-progress-bar"},lB={key:1,class:"mc-file-list-item-file-error"},cB={class:"mc-file-list-item-info"},dB={class:"mc-file-list-item-label"},uB={class:"mc-file-list-item-value"},pB={class:"mc-file-list-item-info"},hB={class:"mc-file-list-item-label"},fB={class:"mc-file-list-item-value"},mB={class:"mc-file-list-item-actions"},gB={class:"mc-file-list-item-compact-content"},vB={class:"mc-file-list-item-info"},yB={class:"mc-file-list-item-label"},bB={class:"mc-file-list-item-value"},kB={class:"mc-file-list-item-info"},wB={class:"mc-file-list-item-label"},xB={class:"mc-file-list-item-value"},Bd=Z(U(r.defineComponent({name:J0,__name:"mc-file-list",props:{modelValue:{default:()=>[]},theme:{default:"light"},lang:{default:"en"},downloadable:{type:Boolean,default:!1},allowCancel:{type:Boolean,default:!1},deletable:{type:Boolean,default:!0}},emits:["update:modelValue","change","delete","download","preview","cancel"],setup(t,{emit:e}){const n=t,o=e,{langMap:i}=Nd(),s=r.ref(!1),a=r.ref();Np(a,({width:c})=>{s.value=c<=600});const l=c=>{o("update:modelValue",n.modelValue.filter(d=>d.name!==c.name))};return(c,d)=>(r.openBlock(),r.createElementBlock("ul",{class:r.normalizeClass(["mc-file-list",[`mc-file-list-${t.theme}`,{"mc-file-list-compact":s.value}]]),ref_key:"fileListRef",ref:a},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.modelValue,u=>(r.openBlock(),r.createElementBlock("li",{class:"mc-file-list-item",key:u.name},[r.createElementVNode("div",tB,[r.createElementVNode("div",nB,[r.createElementVNode("div",{class:"mc-file-list-item-file-name",onClick:p=>(h=>{o("preview",h)})(u)},[r.createVNode(r.unref(de),{name:"Document"}),r.createElementVNode("span",rB,r.toDisplayString(u.name),1)],8,oB),r.createElementVNode("div",iB,[u.status!=="failed"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("span",sB,r.toDisplayString(u.size?r.unref(Sd)(u.size):"--"),1),u.status==="loading"?(r.openBlock(),r.createElementBlock("div",aB,[r.createVNode(r.unref(xl),{percentage:u.progress,"transition-duration":1e3},null,8,["percentage"])])):r.createCommentVNode("",!0)],64)):(r.openBlock(),r.createElementBlock("span",lB,r.toDisplayString(u.errorMessage||"failed to upload"),1))])]),s.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("div",cB,[r.createElementVNode("span",dB,r.toDisplayString(r.unref(i).uploaded_by),1),r.createElementVNode("span",uB,r.toDisplayString(u.uploadBy||"--"),1)]),r.createElementVNode("div",pB,[r.createElementVNode("span",hB,r.toDisplayString(r.unref(i).uploaded_on),1),r.createElementVNode("span",fB,r.toDisplayString(r.unref(K0)(u.uploadTime)||"--"),1)])],64)),r.createElementVNode("div",mB,[u.status==="loading"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[t.allowCancel?(r.openBlock(),r.createBlock(r.unref(de),{key:0,name:"Cross",class:"mc-file-list-item-icon",onClick:p=>(h=>{o("cancel",h),l(h)})(u)},null,8,["onClick"])):r.createCommentVNode("",!0)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[t.downloadable?(r.openBlock(),r.createBlock(r.unref(de),{key:0,name:"Download",class:"mc-file-list-item-icon",onClick:p=>(h=>{o("download",h)})(u)},null,8,["onClick"])):r.createCommentVNode("",!0),t.deletable?(r.openBlock(),r.createBlock(r.unref(de),{key:1,name:"Trash",class:"mc-file-list-item-icon",onClick:p=>(h=>{o("delete",h),l(h)})(u)},null,8,["onClick"])):r.createCommentVNode("",!0)],64))])]),s.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createVNode(r.unref(gl)),r.createElementVNode("div",gB,[r.createElementVNode("div",vB,[r.createElementVNode("span",yB,r.toDisplayString(r.unref(i).uploaded_by),1),r.createElementVNode("span",bB,r.toDisplayString(u.uploadBy||"--"),1)]),r.createElementVNode("div",kB,[r.createElementVNode("span",wB,r.toDisplayString(r.unref(i).uploaded_on),1),r.createElementVNode("span",xB,r.toDisplayString(r.unref(K0)(u.uploadTime)||"--"),1)])])],64)):r.createCommentVNode("",!0)]))),128))],2))}}),[["__scopeId","data-v-df197365"]])),CB={key:0,class:"mc-upload-content"},SB={class:"mc-upload-content-icon"},EB={class:"mc-upload-content-text"},MB={class:"mc-upload-component"},NB={key:0,class:"mc-upload-dropzone-wrapper"},BB={class:"mc-upload-file-list-wrapper"},TB=r.defineComponent({name:U0,__name:"mc-upload",props:{modelValue:{default:()=>[]},downloadable:{type:Boolean,default:!1},allowCancel:{type:Boolean,default:!1},deletable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},theme:{default:"light"},width:{default:"100%"},succeed:{type:Boolean,default:!1},title:{},icon:{default:"Document_Upload"},allowedFileTypes:{default:()=>Md},fileSize:{default:15728640},uploadUser:{default:"--"},lang:{default:"en"},hideDesc:{type:Boolean,default:!1},fileCount:{}},emits:["update:modelValue","download:all","clear","error:type","error:size","upload","change","delete","download","preview","cancel"],setup(t,{expose:e,emit:n}){const o=t,i=n,{width:s}=$t(),a=r.useSlots(),l=r.computed(()=>!!a.content),c=r.ref(),d=r.reactive(new Map),{langMap:u}=Nd(),p=C=>(C=(E=>{if(o.fileCount&&E.length>o.fileCount){const M=u.value.limit_count_reached.replace(zt,o.fileCount.toString());return Ki.error(M),E.slice(0,o.fileCount)}return E})(C)).length!==0&&(d.clear(),C.forEach(E=>{d.set(E.name,E)}),!0);r.watch(()=>o.modelValue,C=>{p(C)},{immediate:!0});const h=C=>Array.from([...C.values()]),f=C=>{i("update:modelValue",C)},m=C=>{var N;(N=c.value)==null||N.clearUploadInput();const E=h(C);if(!p([...o.modelValue,...E]))return;const M=h(d);i("update:modelValue",M),i("upload",M),i("change",M),w()},g=C=>{console.error("mc-upload: error:type:",C),i("error:type",C)},v=C=>{console.error("mc-upload: error:size:",C),i("error:size",C)},b=C=>{i("preview",C)},y=C=>{i("delete",C)},k=C=>{i("download",C)},x=C=>{i("cancel",C)},w=(C=99,E=100)=>{setTimeout(()=>{o.modelValue.forEach(M=>{M.status==="loading"&&(M.progress=C)})},E)},S=r.computed(()=>o.deletable&&!o.disabled);return e({clearFiles:()=>{d.clear(),i("clear"),i("update:modelValue",[]),i("change",[])},downloadAllFiles:()=>{i("download:all",h(d))}}),(C,E)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-upload",style:r.normalizeStyle({width:r.unref(s)})},[r.createElementVNode("div",{class:r.normalizeClass([{"mc-upload-wrapper":l.value},`mc-upload-wrapper-${t.theme}`])},[l.value?(r.openBlock(),r.createElementBlock("div",CB,[r.createElementVNode("div",SB,[t.succeed?(r.openBlock(),r.createBlock(r.unref(Jo),{key:1,width:"24px",height:"24px"})):(r.openBlock(),r.createBlock(r.unref(de),{key:0,name:"Accept"}))]),r.createElementVNode("div",EB,[r.renderSlot(C.$slots,"content",{},void 0,!0)])])):r.createCommentVNode("",!0),r.createElementVNode("div",MB,[t.disabled?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",NB,[r.createVNode(eB,{ref_key:"uploadDropzoneRef",ref:c,"upload-user":t.uploadUser,"allowed-file-types":t.allowedFileTypes,"file-size":t.fileSize,icon:t.icon,lang:t.lang,theme:t.theme,"hide-desc":t.hideDesc,"file-count":t.fileCount,onUpload:m,"onError:type":g,"onError:size":v},{default:r.withCtx(()=>[r.renderSlot(C.$slots,"default",{},void 0,!0)]),title:r.withCtx(()=>[r.renderSlot(C.$slots,"title",{},void 0,!0)]),desc:r.withCtx(()=>[r.renderSlot(C.$slots,"desc",{},void 0,!0)]),_:3},8,["upload-user","allowed-file-types","file-size","icon","lang","theme","hide-desc","file-count"])])),r.createElementVNode("div",BB,[r.createVNode(r.unref(Bd),{"model-value":t.modelValue,"allow-cancel":t.allowCancel,downloadable:t.downloadable,lang:t.lang,theme:t.theme,deletable:S.value,"onUpdate:modelValue":f,onPreview:b,onDelete:y,onDownload:k,onCancel:x},null,8,["model-value","allow-cancel","downloadable","lang","theme","deletable"])])])],2)],4))}}),G0=Z(U(TB,[["__scopeId","data-v-92f6b3db"]])),OB=[Mp,eo,ro,ch,uh,mh,kh,xh,Sh,gl,Ih,qo,oh,ih,de,Nn,bl,zh,Ph,kl,qi,Wh,Uh,Ui,Hi,xl,nf,Qh,ef,af,rf,wl,vl,Zv,e0,n0,r0,s0,qv,ud,di,fd,l0,d0,h0,p0,f0,Jo,y0,w0,b0,E0,j0,F0,ha,W0,Ar,yl,yh,Uo,Bd,G0];console.info("contact us with ayachinenesanobauxichi@gmail.com");const _B=(Y0=OB,t=>Ii(Y0,e=>t.use(e)));var Y0;B.ALLOW_FILE_TYPES=Md,B.CHECKBOX_GROUP_INJECTION_KEY=fl,B.COLLAPSE_CONTEXT_KEY=ml,B.FONT_STYLE=xo,B.FORM_CTX_KEY=$o,B.FORM_ITEM_CTX_KEY=hl,B.INPUT_GROUP_INJECTION_KEY=Vr,B.MC_ALERT_MESSAGE=Ep,B.MC_BUTTON=Tp,B.MC_CHECKBOX=ah,B.MC_CHECKBOX_GROUP=lh,B.MC_COLLAPSE=dh,B.MC_COLLAPSE_ITEM=fh,B.MC_COPY=bh,B.MC_COUNT=wh,B.MC_CURRENCY_ICON=Ch,B.MC_DIVIDER=Eh,B.MC_DRAWER=Vh,B.MC_FILE_LIST=J0,B.MC_FOOTER=_h,B.MC_FORM=Op,B.MC_FORM_ITEM=rh,B.MC_ICON=Sp,B.MC_ICON_PLUS=ph,B.MC_INPUT=Lh,B.MC_INPUT_GROUP=Dh,B.MC_LIGHTBOX=$h,B.MC_LOADING=jh,B.MC_MODAL_HEADER=Oh,B.MC_MULTI_TAG=Hh,B.MC_OTP=Kh,B.MC_OVERLAY=Mh,B.MC_POPPER=th,B.MC_PROGRESS_BAR=qh,B.MC_PROGRESS_INDICATOR=Gh,B.MC_PROGRESS_INDICATOR_CHILD_ITEM=Sl,B.MC_PROGRESS_INDICATOR_ITEM=Cl,B.MC_PROGRESS_INDICATOR_STEP=Yh,B.MC_PROGRESS_INDICATOR_STEP_NUM=Xh,B.MC_RADIO=sf,B.MC_RADIO_GROUP=of,B.MC_RADIO_GROUP_CTX=El,B.MC_REMOVABLE_TAG=Fh,B.MC_RESET=Nh,B.MC_RICHTEXT=Yv,B.MC_RICHTEXT_TOOL=Xv,B.MC_SECONDARY_MENU=Qv,B.MC_SELECT=t0,B.MC_SELECT_GROUP=o0,B.MC_SELECT_GROUP_PLUS=hd,B.MC_SELECT_MULTI_OPTION=Uv,B.MC_SELECT_OPTION=i0,B.MC_SELECT_OPTION_PLUS=pd,B.MC_SELECT_PLUS=Jv,B.MC_SELECT_PLUS_CTX=pa,B.MC_STATUS=a0,B.MC_STEP=c0,B.MC_STEP_CHILD_ITEM_PLUS=vd,B.MC_STEP_ITEM_PLUS=gd,B.MC_STEP_PLUS=u0,B.MC_SUCCESS_ICON=Jh,B.MC_SWITCH=m0,B.MC_SWITCH_LABEL=g0,B.MC_TAB=k0,B.MC_TABLE_BODY=T0,B.MC_TABLE_CELL=_0,B.MC_TABLE_COLUMN_PLUS=wd,B.MC_TABLE_CTX_KEY=bd,B.MC_TABLE_DEFAULT_PROPS=cr,B.MC_TABLE_DEFAULT_VALUE="--",B.MC_TABLE_ELLIPSIS=P0,B.MC_TABLE_EMPTY=A0,B.MC_TABLE_FOOTER=D0,B.MC_TABLE_HEADER=N0,B.MC_TABLE_LOADING=V0,B.MC_TABLE_PAGE_SIZE=L0,B.MC_TABLE_PAGINATION=z0,B.MC_TABLE_PAGINATION_ITEM=$0,B.MC_TABLE_PLUS=M0,B.MC_TABLE_ROW=O0,B.MC_TABLE_SCROLL=I0,B.MC_TABLE_SORT=B0,B.MC_TABLE_TOTAL=R0,B.MC_TAB_ITEM=yd,B.MC_TAG=Gv,B.MC_TEXTAREA=H0,B.MC_TITLE=Th,B.MC_TITLE_TOOL_BAR=Bh,B.MC_TOAST=gh,B.MC_TOOLTIP=nh,B.MC_UPLOAD=U0,B.MC_UPLOAD_DROPZONE=q0,B.McAlertMessage=Mp,B.McButton=eo,B.McCheckbox=ro,B.McCheckboxGroup=ch,B.McCollapse=uh,B.McCollapseItem=mh,B.McCopy=kh,B.McCount=xh,B.McCurrencyIcon=Sh,B.McDivider=gl,B.McDrawer=Ih,B.McFileList=Bd,B.McFooter=qo,B.McForm=oh,B.McFormItem=ih,B.McIcon=de,B.McIconPlus=Nn,B.McInput=bl,B.McInputGroup=zh,B.McLightbox=Ph,B.McLoading=kl,B.McModalHeader=qi,B.McMultiTag=Wh,B.McOtp=Uh,B.McOverlay=Ui,B.McPopper=Hi,B.McProgressBar=xl,B.McProgressIndicator=nf,B.McProgressIndicatorChildItem=ef,B.McProgressIndicatorItem=Qh,B.McRadio=af,B.McRadioGroup=rf,B.McRemovableTag=wl,B.McReset=vl,B.McRichtext=Zv,B.McSecondaryMenu=e0,B.McSelect=n0,B.McSelectGroup=r0,B.McSelectGroupPlus=qv,B.McSelectMultiOption=ud,B.McSelectOption=s0,B.McSelectOptionPlus=di,B.McSelectPlus=fd,B.McStatus=l0,B.McStep=d0,B.McStepChildItemPlus=h0,B.McStepItemPlus=p0,B.McStepPlus=f0,B.McSuccessIcon=Jo,B.McSwitch=y0,B.McTab=w0,B.McTabItem=b0,B.McTable=E0,B.McTableColumnPlus=j0,B.McTablePlus=F0,B.McTag=ha,B.McTextarea=W0,B.McTitle=Ar,B.McTitleToolBar=yl,B.McToast=yh,B.McTooltip=Uo,B.McUpload=G0,B.SELECT_GROUP_INJECTION_KEY=md,B.SELECT_INJECTION_KEY=fa,B.TOOL_ICON=Ne,B.WILDCARD=zt,B.default=_B,B.toast=Ki,B.usePagination=x0,B.useTableScroll=C0,B.useTableSort=S0,Object.defineProperties(B,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|