mc-plus 1.0.87 → 1.0.89
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 +44 -44
- package/dist/es/{mc-checkbox-B1TdSTOe.js → mc-checkbox-BbtQA-ct.js} +2 -2
- package/dist/es/{mc-checkbox-group-CV3t9fLg.js → mc-checkbox-group-DYUFk58Z.js} +1 -1
- package/dist/es/mc-collapse-24CttFhq.js +22 -0
- package/dist/es/mc-collapse-item-DXdUuYdt.js +17 -0
- package/dist/es/{mc-form-DRr7RgpN.js → mc-form-CzrT7EJQ.js} +12 -12
- package/dist/es/{mc-form-item-BiMxL4yc.js → mc-form-item-DB5P_tJG.js} +3 -3
- package/dist/es/{mc-input-group-CwydNXEc.js → mc-input-group-BVInIbfD.js} +1 -1
- package/dist/es/{mc-input-cg0V2THi.js → mc-input-qt44a-BA.js} +2 -2
- package/dist/es/{mc-otp-DiW_v18j.js → mc-otp-oPzld7i2.js} +1 -1
- package/dist/es/{mc-radio-Dp0nSsYD.js → mc-radio-BvJudWMS.js} +2 -2
- package/dist/es/{mc-radio-group-BW6n6px7.js → mc-radio-group-Cu_zrby6.js} +1 -1
- package/dist/es/{mc-richtext-y1Wp1wyV.js → mc-richtext-cCvk3_YC.js} +3 -3
- package/dist/es/{mc-select-group-Df1k44gm.js → mc-select-group-Ssi6Fqxg.js} +1 -1
- package/dist/es/{mc-select-group-plus-DVrTKzF7.js → mc-select-group-plus--I98oCQp.js} +1 -1
- package/dist/es/{mc-select-multi-option-Crf28MU7.js → mc-select-multi-option-C88bpVmy.js} +1 -1
- package/dist/es/{mc-select-option-B0PhpAso.js → mc-select-option-CC72eawi.js} +2 -2
- package/dist/es/{mc-select-option-plus-C1NWVaLm.js → mc-select-option-plus-C8tF0LmF.js} +2 -2
- package/dist/es/{mc-select-plus-Cy22bhd8.js → mc-select-plus-CuCSyBFq.js} +5 -5
- package/dist/es/{mc-select-D-WV07K4.js → mc-select-tQeJEpzP.js} +1 -1
- package/dist/es/{mc-switch-Cz_Sco3l.js → mc-switch-lTGTJv17.js} +1 -1
- package/dist/es/{mc-table-B3hK9g5i.js → mc-table-B2e9bH-x.js} +1 -1
- package/dist/es/{mc-textarea-Q-BOd06j.js → mc-textarea-DIfCDzeM.js} +1 -1
- package/dist/es/theme/mc-collapse-item.css +1 -1
- package/dist/es/theme/mc-collapse.css +1 -1
- package/dist/es/theme/mc-form-item.css +1 -1
- package/dist/index.css +1 -1
- package/dist/types/mc-collapse/types.d.ts +2 -0
- package/dist/types/mc-collapse-item/index.d.ts +1 -1
- package/dist/types/mc-collapse-item/mc-collapse-item.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 +17 -17
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/package.json +1 -1
- package/dist/es/mc-collapse-item-2e2DVBS5.js +0 -17
- package/dist/es/mc-collapse-jVQrUZMK.js +0 -22
package/dist/umd/index.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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 eT=Object.defineProperty;var tT=(B,r,Gn)=>r in B?eT(B,r,{enumerable:!0,configurable:!0,writable:!0,value:Gn}):B[r]=Gn;var Se=(B,r,Gn)=>tT(B,typeof r!="symbol"?r+"":r,Gn);var Gn=typeof global=="object"&&global&&global.Object===Object&&global,cy=typeof self=="object"&&self&&self.Object===Object&&self,ot=Gn||cy||Function("return this")(),Bt=ot.Symbol,_d=Object.prototype,dy=_d.hasOwnProperty,uy=_d.toString,
|
|
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 eT=Object.defineProperty;var tT=(B,r,Gn)=>r in B?eT(B,r,{enumerable:!0,configurable:!0,writable:!0,value:Gn}):B[r]=Gn;var Se=(B,r,Gn)=>tT(B,typeof r!="symbol"?r+"":r,Gn);var Gn=typeof global=="object"&&global&&global.Object===Object&&global,cy=typeof self=="object"&&self&&self.Object===Object&&self,ot=Gn||cy||Function("return this")(),Bt=ot.Symbol,_d=Object.prototype,dy=_d.hasOwnProperty,uy=_d.toString,pr=Bt?Bt.toStringTag:void 0,py=Object.prototype.toString,Ad=Bt?Bt.toStringTag:void 0;function on(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Ad&&Ad in Object(t)?function(e){var n=dy.call(e,pr),o=e[pr];try{e[pr]=void 0;var i=!0}catch{}var s=uy.call(e);return i&&(n?e[pr]=o:delete e[pr]),s}(t):function(e){return py.call(e)}(t)}function wt(t){return t!=null&&typeof t=="object"}function Mo(t){return typeof t=="symbol"||wt(t)&&on(t)=="[object Symbol]"}function No(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 de=Array.isArray,Vd=Bt?Bt.prototype:void 0,Id=Vd?Vd.toString:void 0;function gi(t){if(typeof t=="string")return t;if(de(t))return No(t,gi)+"";if(Mo(t))return Id?Id.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var hy=/\s/,fy=/^\s+/;function Tt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var my=/^[-+]0x[0-9a-f]+$/i,gy=/^0b[01]+$/i,vy=/^0o[0-7]+$/i,yy=parseInt;function vi(t){if(typeof t=="number")return t;if(Mo(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--&&hy.test(i.charAt(s)););return s}(n)+1).replace(fy,""):n;var o=gy.test(t);return o||vy.test(t)?yy(t.slice(2),o?2:8):my.test(t)?NaN:+t}var by=1/0;function Yn(t){var e=function(o){return o?(o=vi(o))===by||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 Bo(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 Dd,ga=ot["__core-js_shared__"],Rd=(Dd=/[^.]+$/.exec(ga&&ga.keys&&ga.keys.IE_PROTO||""))?"Symbol(src)_1."+Dd:"",ky=Function.prototype.toString;function Xn(t){if(t!=null){try{return ky.call(t)}catch{}try{return t+""}catch{}}return""}var wy=/^\[object .+?Constructor\]$/,xy=Function.prototype,Cy=Object.prototype,Sy=xy.toString,Ey=Cy.hasOwnProperty,My=RegExp("^"+Sy.call(Ey).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Zn(t,e){var n=function(o,i){return o==null?void 0:o[i]}(t,e);return function(o){return!(!Tt(o)||(i=o,Rd&&Rd in i))&&(Ve(o)?My:wy).test(Xn(o));var i}(n)?n:void 0}var hr=Zn(ot,"WeakMap"),yi=hr&&new hr,Ld=yi?function(t,e){return yi.set(t,e),t}:Bo,zd=Object.create,bi=function(){function t(){}return function(e){if(!Tt(e))return{};if(zd)return zd(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function fr(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=bi(t.prototype),o=t.apply(n,e);return Tt(o)?o:n}}function va(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 Ny=Math.max;function $d(t,e,n,o){for(var i=-1,s=t.length,a=n.length,l=-1,c=e.length,d=Ny(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 By=Math.max;function Pd(t,e,n,o){for(var i=-1,s=t.length,a=-1,l=n.length,c=-1,d=e.length,u=By(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 ya(){}function To(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function jd(){}To.prototype=bi(ya.prototype),To.prototype.constructor=To;var Fd=yi?function(t){return yi.get(t)}:jd,Hd={},Ty=Object.prototype.hasOwnProperty;function Oo(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Wd(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}Oo.prototype=bi(ya.prototype),Oo.prototype.constructor=Oo;var Oy=Object.prototype.hasOwnProperty;function ki(t){if(wt(t)&&!de(t)&&!(t instanceof To)){if(t instanceof Oo)return t;if(Oy.call(t,"__wrapped__"))return function(e){if(e instanceof To)return e.clone();var n=new Oo(e.__wrapped__,e.__chain__);return n.__actions__=Wd(e.__actions__),n.__index__=e.__index__,n.__values__=e.__values__,n}(t)}return new Oo(t)}ki.prototype=ya.prototype,ki.prototype.constructor=ki;var _y=Date.now;function Kd(t){var e=0,n=0;return function(){var o=_y(),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 qd=Kd(Ld),Ay=/\{\n\/\* \[wrapped with (.+)\] \*/,Vy=/,? & /,Iy=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,wi=function(){try{var t=Zn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Dy=wi?function(t,e){return wi(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:Bo,Ud=Kd(Dy);function ba(t,e){for(var n=-1,o=t==null?0:t.length;++n<o&&e(t[n],n,t)!==!1;);return t}function Jd(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 Ry(t){return t!=t}function ka(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):Jd(t,Ry,n)}function wa(t,e){return!(t==null||!t.length)&&ka(t,e,0)>-1}var Ly=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function Gd(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(Iy,`{
|
|
2
2
|
/* [wrapped with `+s+`] */
|
|
3
|
-
`)}(o,function(i,s){return ba(Ly,function(a){var l="_."+a[0];s&a[1]&&!wa(i,l)&&i.push(l)}),i.sort()}(function(i){var s=i.match(Ay);return s?s[1].split(Vy):[]}(o),n)))}function Yd(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=Hd[y],w=Ty.call(Hd,y)?k.length:0;w--;){var x=k[w],C=x.func;if(C==null||C==b)return x.name}return y}(f),g=ki[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,Gd(h,t,e)}function xa(t){return t.placeholder}var zy=/^(?:0|[1-9]\d*)$/;function xi(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,i=0,s=[];++n<o;){var a=t[n];a!==e&&a!==Xd||(t[n]=Xd,s[i++]=n)}return s}function Ca(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 w=xa(v),x=function(M,N){for(var O=M.length,R=0;O--;)M[O]===N&&++R;return R}(y,w);if(o&&(y=$d(y,o,i,f)),s&&(y=Pd(y,s,a,f)),b-=x,f&&b<d){var C=fr(y,w);return Yd(t,e,Ca,v.placeholder,n,y,C,l,c,d-b)}var S=p?n:this,E=h?S[t]:t;return b=y.length,l?y=function(M,N){for(var O=M.length,R=$y(N.length,O),z=Wd(M);R--;){var _=N[R];M[R]=xi(_,O)?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(S,y)}}var Zd="__lodash_placeholder__",Py=Math.min,Qd=Math.max;function eu(t,e,n){e=="__proto__"&&wi?wi(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Ci(t,e){return t===e||t!=t&&e!=e}var jy=Object.prototype.hasOwnProperty;function Sa(t,e,n){var o=t[e];jy.call(t,e)&&Ci(o,n)&&(n!==void 0||e in t)||eu(t,e,n)}var tu=Math.max;function Ea(t,e){return Ud(function(n,o,i){return o=tu(o===void 0?n.length-1:o,0),function(){for(var s=arguments,a=-1,l=tu(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),va(n,this,d)}}(t,e,Bo),t+"")}function Ma(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=9007199254740991}function Kt(t){return t!=null&&Ma(t.length)&&!Ve(t)}var Fy=Object.prototype;function Si(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,Ei=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,iu=ru&&typeof module=="object"&&module&&!module.nodeType&&module,su=iu&&iu.exports===ru?ot.Buffer:void 0,mr=(su?su.isBuffer:void 0)||function(){return!1},Te={};function Mi(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,Na=gr&&gr.exports===au&&Gn.process,_o=function(){try{return gr&&gr.require&&gr.require("util").types||Na&&Na.binding&&Na.binding("util")}catch{}}(),lu=_o&&_o.isTypedArray,Ba=lu?Mi(lu):function(t){return wt(t)&&Ma(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 Ta(t){if(!Si(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&&Ei(e),i=!n&&!o&&mr(e),s=!n&&!o&&!i&&Ba(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)!Ky.call(e,d)||a&&(d=="length"||i&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||xi(d,c))||l.push(d);return l}(t):Ta(t)}var Oa,Jy=Object.prototype.hasOwnProperty,Gy=(Oa=function(t,e){if(Si(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?eu(s,d,u):Sa(s,d,u)}})(e,Sn(e),t);else for(var n in e)Jy.call(e,n)&&Sa(t,n,e[n])},Ea(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=Oa.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)&&xi(c,d.length):u=="string"&&c in d)&&Ci(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&&Oa(t,a)}return t})),Yy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xy=/^\w*$/;function _a(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 Ni(t,e){for(var n=t.length;n--;)if(Ci(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 eb=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=Ni(e,t);return!(n<0||(n==e.length-1?e.pop():eb.call(e,n,1),--this.size,0))},rn.prototype.get=function(t){var e=this.__data__,n=Ni(e,t);return n<0?void 0:e[n][1]},rn.prototype.has=function(t){return Ni(this.__data__,t)>-1},rn.prototype.set=function(t,e){var n=this.__data__,o=Ni(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};var yr=Zn(ot,"Map");function Bi(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 Aa(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(Aa.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=Bi(this,t).delete(t);return this.size-=e?1:0,e},sn.prototype.get=function(t){return Bi(this,t).get(t)},sn.prototype.has=function(t){return Bi(this,t).has(t)},sn.prototype.set=function(t,e){var n=Bi(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this},Aa.Cache=sn;var du,Va,Ia,tb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nb=/\\(\\)?/g,ob=(du=function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(tb,function(n,o,i,s){e.push(i?s.replace(nb,"$1"):o||n)}),e},Va=Aa(du,function(t){return Ia.size===500&&Ia.clear(),t}),Ia=Va.cache,Va);function qt(t){return t==null?"":gi(t)}function uu(t,e){return de(t)?t:_a(t,e)?[t]:ob(qt(t))}function Ti(t){if(typeof t=="string"||Mo(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Da(t,e){for(var n=0,o=(e=uu(e,t)).length;t!=null&&n<o;)t=t[Ti(e[n++])];return n&&n==o?t:void 0}function br(t,e,n){var o=t==null?void 0:Da(t,e);return o===void 0?n:o}function pu(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t}var hu=Bt?Bt.isConcatSpreadable:void 0;function rb(t){return de(t)||Ei(t)||!!(hu&&t&&t[hu])}var ib=cu(Object.getPrototypeOf,Object),Oi=Ea(function(t,e,n){var o=1;if(n.length){var i=fr(n,xa(Oi));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: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 b=f?void 0:Fd(s),y=[s,a,l,c,d,g,v,void 0,p,h];if(b&&function(w,x){var C=w[1],S=x[1],E=C|S,M=E<131,N=S==128&&C==8||S==128&&C==256&&w[7].length<=x[8]||S==384&&x[7].length<=x[8]&&C==8;if(!M&&!N)return w;1&S&&(w[2]=x[2],E|=1&C?0:4);var O=x[3];if(O){var R=w[3];w[3]=R?$d(R,O,x[4]):O,w[4]=R?fr(w[3],Zd):x[4]}(O=x[5])&&(R=w[5],w[5]=R?Pd(R,O,x[6]):O,w[6]=R?fr(w[5],Zd):x[6]),(O=x[7])&&(w[7]=O),128&S&&(w[8]=w[8]==null?x[8]:Py(w[8],x[8])),w[9]==null&&(w[9]=x[9]),w[0]=x[0],w[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:Qd(y[9]-m,0))&&24&a&&(a&=-25),a&&a!=1)k=a==8||a==16?function(w,x,C){var S=hr(w);return function E(){for(var M=arguments.length,N=Array(M),O=M,R=xa(E);O--;)N[O]=arguments[O];var z=M<3&&N[0]!==R&&N[M-1]!==R?[]:fr(N,R);return(M-=z.length)<C?Yd(w,x,Ca,E.placeholder,void 0,N,z,void 0,void 0,C-M):va(this&&this!==ot&&this instanceof E?S:w,this,N)}}(s,a,h):a!=32&&a!=33||d.length?Ca.apply(void 0,y):function(w,x,C,S){var E=1&x,M=hr(w);return function N(){for(var O=-1,R=arguments.length,z=-1,_=S.length,I=Array(_+R),T=this&&this!==ot&&this instanceof N?M:w;++z<_;)I[z]=S[z];for(;R--;)I[z++]=arguments[++O];return va(T,E?C:this,I)}}(s,a,l,c);else var k=function(w,x,C){var S=1&x,E=hr(w);return function M(){return(this&&this!==ot&&this instanceof M?E:w).apply(S?C:this,arguments)}}(s,a,l);return Gd((b?Ld:qd)(k,y),s,a)}(t,o,e,n,i)});Oi.placeholder={};var sb=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function fu(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 Ra,ab=(Ra={À:"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 Ra==null?void 0:Ra[t]}),lb=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,cb=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),db=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ub=/[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",bu="\\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",ku="["+bu+"]",wu="\\d+",pb="["+gu+"]",xu="["+vu+"]",Cu="[^"+mu+bu+wu+gu+vu+yu+"]",Su="(?:\\ud83c[\\udde6-\\uddff]){2}",Eu="[\\ud800-\\udbff][\\udc00-\\udfff]",Ao="["+yu+"]",Mu="(?:"+xu+"|"+Cu+")",hb="(?:"+Ao+"|"+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]?",fb=Ou+Tu+"(?:\\u200d(?:"+["[^"+mu+"]",Su,Eu].join("|")+")"+Ou+Tu+")*",mb="(?:"+[pb,Su,Eu].join("|")+")"+fb,gb=RegExp([Ao+"?"+xu+"+"+Nu+"(?="+[ku,Ao,"$"].join("|")+")",hb+"+"+Bu+"(?="+[ku,Ao+Mu,"$"].join("|")+")",Ao+"?"+Mu+"+"+Nu,Ao+"+"+Bu,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",wu,mb].join("|"),"g"),vb=RegExp("['’]","g"),yb=ot.isFinite,bb=Math.min;function _u(t){var e=Math[t];return function(n,o){if(n=vi(n),(o=o==null?0:bb(Yn(o),292))&&yb(n)){var i=(qt(n)+"e").split("e");return+((i=(qt(e(i[0]+"e"+(+i[1]+o)))+"e").split("e"))[0]+"e"+(+i[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,i=0,s=[];++n<o;){var a=t[n];e(a,n,t)&&(s[i++]=a)}return s}Ru&&Ru.allocUnsafe;var kb=Object.prototype.propertyIsEnumerable,zu=Object.getOwnPropertySymbols,wb=zu?function(t){return t==null?[]:(t=Object(t),Lu(zu(t),function(e){return kb.call(t,e)}))}:function(){return[]};function La(t){return function(e,n,o){var i=n(e);return de(e)?i:pu(i,o(e))}(t,Sn,wb)}var za=Zn(ot,"DataView"),$a=Zn(ot,"Promise"),Vo=Zn(ot,"Set"),$u="[object Map]",Pu="[object Promise]",ju="[object Set]",Fu="[object WeakMap]",Hu="[object DataView]",xb=Xn(za),Cb=Xn(yr),Sb=Xn($a),Eb=Xn(Vo),Mb=Xn(pr),xt=on;(za&&xt(new za(new ArrayBuffer(1)))!=Hu||yr&&xt(new yr)!=$u||$a&&xt($a.resolve())!=Pu||Vo&&xt(new Vo)!=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 xb:return Hu;case Cb:return $u;case Sb:return Pu;case Eb:return ju;case Mb:return Fu}return e});var Nb=Object.prototype.hasOwnProperty,_i=ot.Uint8Array;function Pa(t){var e=new t.constructor(t.byteLength);return new _i(e).set(new _i(t)),e}var Bb=/\w*$/,Wu=Bt?Bt.prototype:void 0,Ku=Wu?Wu.valueOf:void 0,qu=_o&&_o.isMap,Tb=qu?Mi(qu):function(t){return wt(t)&&xt(t)=="[object Map]"},Uu=_o&&_o.isSet,Ob=Uu?Mi(Uu):function(t){return wt(t)&&xt(t)=="[object Set]"},Ju="[object Arguments]",Gu="[object Function]",Yu="[object Object]",Ee={};function Ai(t,e,n,o,i,s){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"&&Nb.call(h,"index")&&(m.index=h.index,m.input=h.input),m}(t);else{var c=xt(t),d=c==Gu||c=="[object GeneratorFunction]";if(mr(t))return t.slice();if(c==Yu||c==Ju||d&&!i)a=d?{}:function(h){return typeof h.constructor!="function"||Si(h)?{}:bi(ib(h))}(t);else{if(!Ee[c])return i?t:{};a=function(h,f){var m,g,v,b=h.constructor;switch(f){case"[object ArrayBuffer]":return Pa(h);case"[object Boolean]":case"[object Date]":return new b(+h);case"[object DataView]":return v=Pa((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=Pa(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,Bb.exec(y));return k.lastIndex=y.lastIndex,k}(h);case"[object Symbol]":return m=h,Ku?Object(Ku.call(m)):{}}}(t,c)}}s||(s=new Ut);var u=s.get(t);if(u)return u;s.set(t,a),Ob(t)?t.forEach(function(h){a.add(Ai(h,e,n,0,t,s))}):Tb(t)&&t.forEach(function(h,f){a.set(f,Ai(h,e,n,0,t,s))});var p=l?void 0:La(t);return ba(p||t,function(h,f){p&&(h=t[f=h]),Sa(a,f,Ai(h,e,n,0,t,s))}),a}function Io(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 ja(t,e){return t.has(e)}function Zu(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 Io: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(!Xu(e,function(b,y){if(!ja(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 _b(t){var e=-1,n=Array(t.size);return t.forEach(function(o,i){n[++e]=[i,o]}),n}function Fa(t){var e=-1,n=Array(t.size);return t.forEach(function(o){n[++e]=o}),n}Ee[Ju]=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[Gu]=Ee["[object WeakMap]"]=!1,Io.prototype.add=Io.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Io.prototype.has=function(t){return this.__data__.has(t)};var Qu=Bt?Bt.prototype:void 0,Ha=Qu?Qu.valueOf:void 0,Ab=Object.prototype.hasOwnProperty,ep="[object Arguments]",tp="[object Array]",Vi="[object Object]",np=Object.prototype.hasOwnProperty;function Wa(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=de(s),h=de(a),f=p?tp:xt(s),m=h?tp:xt(a),g=(f=f==ep?Vi:f)==Vi,v=(m=m==ep?Vi:m)==Vi,b=f==m;if(b&&mr(s)){if(!mr(a))return!1;p=!0,g=!1}if(b&&!g)return u||(u=new Ut),p||Ba(s)?Zu(s,a,l,c,d,u):function(C,S,E,M,N,O,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||!O(new _i(C),new _i(S)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ci(+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=_b;case"[object Set]":var _=1&M;if(z||(z=Fa),C.size!=S.size&&!_)return!1;var I=R.get(C);if(I)return I==S;M|=2,R.set(C,S);var T=Zu(z(C),z(S),M,N,O,R);return R.delete(C),T;case"[object Symbol]":if(Ha)return Ha.call(C)==Ha.call(S)}return!1}(s,a,f,l,c,d,u);if(!(1&l)){var y=g&&np.call(s,"__wrapped__"),k=v&&np.call(a,"__wrapped__");if(y||k){var w=y?s.value():s,x=k?a.value():a;return u||(u=new Ut),d(w,x,l,c,u)}}return!!b&&(u||(u=new Ut),function(C,S,E,M,N,O){var R=1&E,z=La(C),_=z.length;if(_!=La(S).length&&!R)return!1;for(var I=_;I--;){var T=z[I];if(!(R?T in S:Ab.call(S,T)))return!1}var V=O.get(C),P=O.get(S);if(V&&P)return V==S&&P==C;var A=!0;O.set(C,S),O.set(S,C);for(var L=R;++I<_;){var j=C[T=z[I]],q=S[T];if(M)var H=R?M(q,j,T,S,C,O):M(j,q,T,C,S,O);if(!(H===void 0?j===q||N(j,q,E,M,O):H)){A=!1;break}L||(L=T=="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 O.delete(C),O.delete(S),A}(s,a,l,c,d,u))}(t,e,n,o,Wa,i))}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 Vb(t,e){return t!=null&&e in Object(t)}function ip(t,e,n){for(var o=-1,i=(e=uu(e,t)).length,s=!1;++o<i;){var a=Ti(e[o]);if(!(s=t!=null&&n(t,a)))break;t=t[a]}return s||++o!=i?s:!!(i=t==null?0:t.length)&&Ma(i)&&xi(a,i)&&(de(t)||Ei(t))}function sp(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],i=t[1],_a(o)&&op(i)?rp(Ti(o),i):function(s){var a=br(s,o);return a===void 0&&a===i?function(l,c){return l!=null&&ip(l,c,Vb)}(s,o):Wa(i,a,3)}):(n=function(s){for(var a=Sn(s),l=a.length;l--;){var c=a[l],d=s[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(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(!Wa(m,f,3,void 0,new Ut))return!1}return!0}(s,0,n)}):function(s){return _a(s)?sp(Ti(s)):function(a){return function(l){return Da(l,a)}}(s)}(t);var e,n,o,i}var ap,kr=(ap=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,Sn)},function(t,e){if(t==null)return t;if(!Kt(t))return ap(t,e);for(var n=t.length,o=-1,i=Object(t);++o<n&&e(i[o],o,i)!==!1;);return t}),Ka=function(){return ot.Date.now()},Ib=Math.max,Db=Math.min;function Ii(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,w=i;return o=i=void 0,d=y,a=t.apply(w,k)}function m(y){var k=y-c;return c===void 0||k>=e||k<0||p&&y-d>=s}function g(){var y=Ka();if(m(y))return v(y);l=setTimeout(g,function(k){var w=e-(k-c);return p?Db(w,s-(k-d)):w}(y))}function v(y){return l=void 0,h&&o?f(y):(o=i=void 0,a)}function b(){var y=Ka(),k=m(y);if(o=arguments,i=this,c=y,k){if(l===void 0)return function(w){return d=w,l=setTimeout(g,e),u?f(w):a}(c);if(p)return clearTimeout(l),l=setTimeout(g,e),f(c)}return l===void 0&&(l=setTimeout(g,e)),a}return e=vi(e)||0,Tt(n)&&(u=!!n.leading,s=(p="maxWait"in n)?Ib(vi(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(Ka())},b}function lp(t){return wt(t)&&Kt(t)}var cp=Ea(function(t,e){return lp(t)?function(n,o){var i=-1,s=wa,a=!0,l=n.length,c=[],d=o.length;if(!l)return c;o.length>=200&&(s=ja,a=!1,o=new Io(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=rb),a||(a=[]);++l<c;){var d=n[l];i(d)&&pu(a,d)}return a}(e,0,lp)):[]});function Di(t,e){var n;return(de(t)?ba:kr)(t,typeof(n=e)=="function"?n:Bo)}function Rb(t,e){var n=[];return kr(t,function(o,i,s){e(o,i,s)&&n.push(o)}),n}function wr(t,e){return(de(t)?Lu:Rb)(t,En(e))}var Lb=Math.max;function an(t,e,n){var o=t==null?0:t.length;if(!o)return-1;var i=n==null?0:Yn(n);return i<0&&(i=Lb(o+i,0)),Jd(t,En(e),i)}var dp,Do=(dp=an,function(t,e,n){var o=Object(t);if(!Kt(t)){var i=En(e);t=Sn(t),e=function(a){return i(o[a],a,o)}}var s=dp(t,e,n);return s>-1?o[i?t[s]:s]: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(i,s,a){o[++n]=e(i,s,a)}),o}function Mn(t,e){return(de(t)?No:pp)(t,En(e))}var Ri=_u("floor"),zb=Object.prototype.hasOwnProperty;function $b(t,e){return t!=null&&zb.call(t,e)}function Pb(t,e){return t!=null&&ip(t,e,$b)}function Ro(t){return typeof t=="string"||!de(t)&&wt(t)&&on(t)=="[object String]"}var jb=Math.max;function gt(t,e,n,o){t=Kt(t)?t:function(s){return s==null?[]:function(a,l){return No(l,function(c){return a[c]})}(s,Sn(s))}(t),n=n?Yn(n):0;var i=t.length;return n<0&&(n=jb(i+n,0)),Ro(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&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 Fb=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)||Ba(t)||Ei(t)))return!t.length;var e=xt(t);if(e=="[object Map]"||e=="[object Set]")return!t.size;if(Si(t))return!Ta(t).length;for(var n in t)if(Fb.call(t,n))return!1;return!0}function Li(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 ub.test(n)}(e=qt(e))?function(n){return n.match(gb)||[]}(e):function(n){return n.match(db)||[]}(e)}(function(e){return(e=qt(e))&&e.replace(lb,ab).replace(cb,"")}(t).replace(vb,"")),mp,"")});function Hb(t,e){if(t!==e){var n=t!==void 0,o=t===null,i=t==t,s=Mo(t),a=e!==void 0,l=e===null,c=e==e,d=Mo(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 Wb=sp("length"),vp="\\ud800-\\udfff",Kb="["+vp+"]",qa="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ua="\\ud83c[\\udffb-\\udfff]",yp="[^"+vp+"]",bp="(?:\\ud83c[\\udde6-\\uddff]){2}",kp="[\\ud800-\\udbff][\\udc00-\\udfff]",wp="(?:"+qa+"|"+Ua+")?",xp="[\\ufe0e\\ufe0f]?",qb=xp+wp+"(?:\\u200d(?:"+[yp,bp,kp].join("|")+")"+xp+wp+")*",Ub="(?:"+[yp+qa+"?",qa,bp,kp,Kb].join("|")+")",Cp=RegExp(Ua+"(?="+Ua+")|"+Ub+qb,"g");function Jb(t,e,n,o,i){return i(t,function(s,a,l){n=o?(o=!1,s):e(n,s,a,l)}),n}function Ja(t){if(t==null)return 0;if(Kt(t))return Ro(t)?function(o){return sb.test(o)}(e=t)?function(o){for(var i=Cp.lastIndex=0;Cp.test(o);)++i;return i}(e):Wb(e):t.length;var e,n=xt(t);return n=="[object Map]"||n=="[object Set]"?t.size:Ta(t).length}function Gb(t,e){var n;return kr(t,function(o,i,s){return!(n=e(o,i,s))}),!!n}function Sp(t,e,n){return(de(t)?Xu:Gb)(t,En(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),Ii(t,e,{leading:o,maxWait:e,trailing:i})}function Ep(t){return qt(t).toLowerCase()}var Yb=Vo&&1/Fa(new Vo([,-0]))[1]==1/0?function(t){return new Vo(t)}:jd;const X=t=>(t.install=e=>{e.component(t.name,t)},t),Ga=(t=0)=>new Promise(e=>setTimeout(e,t)),Ya=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())]},Mp="mc-icon",Xb=r.defineComponent({name:Mp,__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))}}),K=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},eo=K(Xb,[["__scopeId","data-v-24abf3b0"]]),ce=X(eo),Np="mc-alert-message",Zb={class:"mc-alert-message-header"},Qb={class:"mc-alert-message-title-container"},ek={key:0,class:"mc-alert-message-icon-group"},tk={class:"mc-alert-message-icon-wrapper"},nk={class:"mc-alert-message-icon-wrapper"},ok={key:0,class:"mc-alert-message-body"},rk=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,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",Zb,[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(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",ek,[r.createElementVNode("div",tk,[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",nk,[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",ok,[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(rk,[["__scopeId","data-v-26d43a1b"]])),zi=(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)})},$i=(t,e)=>{zi(document,"click",n=>{if(t.value&&n.target)if(de(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 zi(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(!de(t))return n==null?void 0:n[t];for(const i of t)if(Pb(n,i))return n==null?void 0:n[i]})}const $o=(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}},Tp=t=>{r.onMounted(()=>{window.addEventListener("resize",t)}),r.onUnmounted(()=>{window.removeEventListener("resize",t)})},$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)}},Op=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}},_p="mc-button",ik=["type","disabled"],sk={key:1,class:"loading-icon"},ak={class:"mc-button-text"},lk=r.defineComponent({name:_p,__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(ce),{key:0,name:t.leftIcon},null,8,["name"])):r.createCommentVNode("",!0),t.loading&&!t.disabled?(r.openBlock(),r.createElementBlock("span",sk,[r.createVNode(r.unref(ce),{name:"Loading",size:16})])):r.createCommentVNode("",!0),r.createElementVNode("div",ak,[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,ik))}}),to=X(K(lk,[["__scopeId","data-v-dfec08a5"]])),Po=Symbol("mc-form-context"),Ap="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 xr(t,e){return xr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},xr(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,i,s){var a=[null];a.push.apply(a,i);var l=new(Function.bind.apply(o,a));return s&&xr(l,s.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,i)}function i(){return Za(n,arguments,Xa(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),xr(i,n)},Qa(t)}var ck=/%[sdj%]/g,Vp=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 i=0,s=n.length;if(typeof t=="function")return t.apply(null,n);if(typeof t=="string"){var a=t.replace(ck,function(l){if(l==="%%")return"%";if(i>=s)return l;switch(l){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 l}});return a}return 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 Ip(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"&&(Vp=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 Dp=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,xr(e,n),o}(Qa(Error));function Rp(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 Lp(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,zp=function(t,e,n,o,i,s){!t.required||n.hasOwnProperty(t.field)&&!Ue(e,s||t.type)||o.push(St(i.messages.required,t.fullField))},dk=/^(([^<>()\[\]\\.,;:\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,}))$/,uk=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,Cr={integer:function(t){return Cr.number(t)&&parseInt(t,10)===t},float:function(t){return Cr.number(t)&&!Cr.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"&&!Cr.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(dk)},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}",i="[a-fA-F\\d]{1,4}",s=(`
|
|
3
|
+
`)}(o,function(i,s){return ba(Ly,function(a){var l="_."+a[0];s&a[1]&&!wa(i,l)&&i.push(l)}),i.sort()}(function(i){var s=i.match(Ay);return s?s[1].split(Vy):[]}(o),n)))}function Yd(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=Hd[y],w=Ty.call(Hd,y)?k.length:0;w--;){var x=k[w],C=x.func;if(C==null||C==b)return x.name}return y}(f),g=ki[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,Gd(h,t,e)}function xa(t){return t.placeholder}var zy=/^(?:0|[1-9]\d*)$/;function xi(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 mr(t,e){for(var n=-1,o=t.length,i=0,s=[];++n<o;){var a=t[n];a!==e&&a!==Xd||(t[n]=Xd,s[i++]=n)}return s}function Ca(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:fr(t);return function v(){for(var b=arguments.length,y=Array(b),k=b;k--;)y[k]=arguments[k];if(f)var w=xa(v),x=function(M,N){for(var O=M.length,R=0;O--;)M[O]===N&&++R;return R}(y,w);if(o&&(y=$d(y,o,i,f)),s&&(y=Pd(y,s,a,f)),b-=x,f&&b<d){var C=mr(y,w);return Yd(t,e,Ca,v.placeholder,n,y,C,l,c,d-b)}var S=p?n:this,E=h?S[t]:t;return b=y.length,l?y=function(M,N){for(var O=M.length,R=$y(N.length,O),z=Wd(M);R--;){var _=N[R];M[R]=xi(_,O)?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||fr(E)),E.apply(S,y)}}var Zd="__lodash_placeholder__",Py=Math.min,Qd=Math.max;function eu(t,e,n){e=="__proto__"&&wi?wi(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Ci(t,e){return t===e||t!=t&&e!=e}var jy=Object.prototype.hasOwnProperty;function Sa(t,e,n){var o=t[e];jy.call(t,e)&&Ci(o,n)&&(n!==void 0||e in t)||eu(t,e,n)}var tu=Math.max;function Ea(t,e){return Ud(function(n,o,i){return o=tu(o===void 0?n.length-1:o,0),function(){for(var s=arguments,a=-1,l=tu(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),va(n,this,d)}}(t,e,Bo),t+"")}function Ma(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=9007199254740991}function Kt(t){return t!=null&&Ma(t.length)&&!Ve(t)}var Fy=Object.prototype;function Si(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,Ei=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,iu=ru&&typeof module=="object"&&module&&!module.nodeType&&module,su=iu&&iu.exports===ru?ot.Buffer:void 0,gr=(su?su.isBuffer:void 0)||function(){return!1},Te={};function Mi(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,vr=au&&typeof module=="object"&&module&&!module.nodeType&&module,Na=vr&&vr.exports===au&&Gn.process,_o=function(){try{return vr&&vr.require&&vr.require("util").types||Na&&Na.binding&&Na.binding("util")}catch{}}(),lu=_o&&_o.isTypedArray,Ba=lu?Mi(lu):function(t){return wt(t)&&Ma(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 Ta(t){if(!Si(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&&Ei(e),i=!n&&!o&&gr(e),s=!n&&!o&&!i&&Ba(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)!Ky.call(e,d)||a&&(d=="length"||i&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||xi(d,c))||l.push(d);return l}(t):Ta(t)}var Oa,Jy=Object.prototype.hasOwnProperty,Gy=(Oa=function(t,e){if(Si(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?eu(s,d,u):Sa(s,d,u)}})(e,Sn(e),t);else for(var n in e)Jy.call(e,n)&&Sa(t,n,e[n])},Ea(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=Oa.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)&&xi(c,d.length):u=="string"&&c in d)&&Ci(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&&Oa(t,a)}return t})),Yy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xy=/^\w*$/;function _a(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 yr=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 Ni(t,e){for(var n=t.length;n--;)if(Ci(t[n][0],e))return n;return-1}Qn.prototype.clear=function(){this.__data__=yr?yr(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(yr){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 yr?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]=yr&&e===void 0?"__lodash_hash_undefined__":e,this};var eb=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=Ni(e,t);return!(n<0||(n==e.length-1?e.pop():eb.call(e,n,1),--this.size,0))},rn.prototype.get=function(t){var e=this.__data__,n=Ni(e,t);return n<0?void 0:e[n][1]},rn.prototype.has=function(t){return Ni(this.__data__,t)>-1},rn.prototype.set=function(t,e){var n=this.__data__,o=Ni(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};var br=Zn(ot,"Map");function Bi(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 Aa(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(Aa.Cache||sn),n}sn.prototype.clear=function(){this.size=0,this.__data__={hash:new Qn,map:new(br||rn),string:new Qn}},sn.prototype.delete=function(t){var e=Bi(this,t).delete(t);return this.size-=e?1:0,e},sn.prototype.get=function(t){return Bi(this,t).get(t)},sn.prototype.has=function(t){return Bi(this,t).has(t)},sn.prototype.set=function(t,e){var n=Bi(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this},Aa.Cache=sn;var du,Va,Ia,tb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nb=/\\(\\)?/g,ob=(du=function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(tb,function(n,o,i,s){e.push(i?s.replace(nb,"$1"):o||n)}),e},Va=Aa(du,function(t){return Ia.size===500&&Ia.clear(),t}),Ia=Va.cache,Va);function qt(t){return t==null?"":gi(t)}function uu(t,e){return de(t)?t:_a(t,e)?[t]:ob(qt(t))}function Ti(t){if(typeof t=="string"||Mo(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Da(t,e){for(var n=0,o=(e=uu(e,t)).length;t!=null&&n<o;)t=t[Ti(e[n++])];return n&&n==o?t:void 0}function Ao(t,e,n){var o=t==null?void 0:Da(t,e);return o===void 0?n:o}function pu(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t}var hu=Bt?Bt.isConcatSpreadable:void 0;function rb(t){return de(t)||Ei(t)||!!(hu&&t&&t[hu])}var ib=cu(Object.getPrototypeOf,Object),Oi=Ea(function(t,e,n){var o=1;if(n.length){var i=mr(n,xa(Oi));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: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 b=f?void 0:Fd(s),y=[s,a,l,c,d,g,v,void 0,p,h];if(b&&function(w,x){var C=w[1],S=x[1],E=C|S,M=E<131,N=S==128&&C==8||S==128&&C==256&&w[7].length<=x[8]||S==384&&x[7].length<=x[8]&&C==8;if(!M&&!N)return w;1&S&&(w[2]=x[2],E|=1&C?0:4);var O=x[3];if(O){var R=w[3];w[3]=R?$d(R,O,x[4]):O,w[4]=R?mr(w[3],Zd):x[4]}(O=x[5])&&(R=w[5],w[5]=R?Pd(R,O,x[6]):O,w[6]=R?mr(w[5],Zd):x[6]),(O=x[7])&&(w[7]=O),128&S&&(w[8]=w[8]==null?x[8]:Py(w[8],x[8])),w[9]==null&&(w[9]=x[9]),w[0]=x[0],w[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:Qd(y[9]-m,0))&&24&a&&(a&=-25),a&&a!=1)k=a==8||a==16?function(w,x,C){var S=fr(w);return function E(){for(var M=arguments.length,N=Array(M),O=M,R=xa(E);O--;)N[O]=arguments[O];var z=M<3&&N[0]!==R&&N[M-1]!==R?[]:mr(N,R);return(M-=z.length)<C?Yd(w,x,Ca,E.placeholder,void 0,N,z,void 0,void 0,C-M):va(this&&this!==ot&&this instanceof E?S:w,this,N)}}(s,a,h):a!=32&&a!=33||d.length?Ca.apply(void 0,y):function(w,x,C,S){var E=1&x,M=fr(w);return function N(){for(var O=-1,R=arguments.length,z=-1,_=S.length,I=Array(_+R),T=this&&this!==ot&&this instanceof N?M:w;++z<_;)I[z]=S[z];for(;R--;)I[z++]=arguments[++O];return va(T,E?C:this,I)}}(s,a,l,c);else var k=function(w,x,C){var S=1&x,E=fr(w);return function M(){return(this&&this!==ot&&this instanceof M?E:w).apply(S?C:this,arguments)}}(s,a,l);return Gd((b?Ld:qd)(k,y),s,a)}(t,o,e,n,i)});Oi.placeholder={};var sb=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function fu(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 Ra,ab=(Ra={À:"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 Ra==null?void 0:Ra[t]}),lb=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,cb=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),db=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ub=/[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",bu="\\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",ku="["+bu+"]",wu="\\d+",pb="["+gu+"]",xu="["+vu+"]",Cu="[^"+mu+bu+wu+gu+vu+yu+"]",Su="(?:\\ud83c[\\udde6-\\uddff]){2}",Eu="[\\ud800-\\udbff][\\udc00-\\udfff]",Vo="["+yu+"]",Mu="(?:"+xu+"|"+Cu+")",hb="(?:"+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]?",fb=Ou+Tu+"(?:\\u200d(?:"+["[^"+mu+"]",Su,Eu].join("|")+")"+Ou+Tu+")*",mb="(?:"+[pb,Su,Eu].join("|")+")"+fb,gb=RegExp([Vo+"?"+xu+"+"+Nu+"(?="+[ku,Vo,"$"].join("|")+")",hb+"+"+Bu+"(?="+[ku,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,mb].join("|"),"g"),vb=RegExp("['’]","g"),yb=ot.isFinite,bb=Math.min;function _u(t){var e=Math[t];return function(n,o){if(n=vi(n),(o=o==null?0:bb(Yn(o),292))&&yb(n)){var i=(qt(n)+"e").split("e");return+((i=(qt(e(i[0]+"e"+(+i[1]+o)))+"e").split("e"))[0]+"e"+(+i[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(!br||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,i=0,s=[];++n<o;){var a=t[n];e(a,n,t)&&(s[i++]=a)}return s}Ru&&Ru.allocUnsafe;var kb=Object.prototype.propertyIsEnumerable,zu=Object.getOwnPropertySymbols,wb=zu?function(t){return t==null?[]:(t=Object(t),Lu(zu(t),function(e){return kb.call(t,e)}))}:function(){return[]};function La(t){return function(e,n,o){var i=n(e);return de(e)?i:pu(i,o(e))}(t,Sn,wb)}var za=Zn(ot,"DataView"),$a=Zn(ot,"Promise"),Io=Zn(ot,"Set"),$u="[object Map]",Pu="[object Promise]",ju="[object Set]",Fu="[object WeakMap]",Hu="[object DataView]",xb=Xn(za),Cb=Xn(br),Sb=Xn($a),Eb=Xn(Io),Mb=Xn(hr),xt=on;(za&&xt(new za(new ArrayBuffer(1)))!=Hu||br&&xt(new br)!=$u||$a&&xt($a.resolve())!=Pu||Io&&xt(new Io)!=ju||hr&&xt(new hr)!=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 xb:return Hu;case Cb:return $u;case Sb:return Pu;case Eb:return ju;case Mb:return Fu}return e});var Nb=Object.prototype.hasOwnProperty,_i=ot.Uint8Array;function Pa(t){var e=new t.constructor(t.byteLength);return new _i(e).set(new _i(t)),e}var Bb=/\w*$/,Wu=Bt?Bt.prototype:void 0,Ku=Wu?Wu.valueOf:void 0,qu=_o&&_o.isMap,Tb=qu?Mi(qu):function(t){return wt(t)&&xt(t)=="[object Map]"},Uu=_o&&_o.isSet,Ob=Uu?Mi(Uu):function(t){return wt(t)&&xt(t)=="[object Set]"},Ju="[object Arguments]",Gu="[object Function]",Yu="[object Object]",Ee={};function Ai(t,e,n,o,i,s){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"&&Nb.call(h,"index")&&(m.index=h.index,m.input=h.input),m}(t);else{var c=xt(t),d=c==Gu||c=="[object GeneratorFunction]";if(gr(t))return t.slice();if(c==Yu||c==Ju||d&&!i)a=d?{}:function(h){return typeof h.constructor!="function"||Si(h)?{}:bi(ib(h))}(t);else{if(!Ee[c])return i?t:{};a=function(h,f){var m,g,v,b=h.constructor;switch(f){case"[object ArrayBuffer]":return Pa(h);case"[object Boolean]":case"[object Date]":return new b(+h);case"[object DataView]":return v=Pa((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=Pa(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,Bb.exec(y));return k.lastIndex=y.lastIndex,k}(h);case"[object Symbol]":return m=h,Ku?Object(Ku.call(m)):{}}}(t,c)}}s||(s=new Ut);var u=s.get(t);if(u)return u;s.set(t,a),Ob(t)?t.forEach(function(h){a.add(Ai(h,e,n,0,t,s))}):Tb(t)&&t.forEach(function(h,f){a.set(f,Ai(h,e,n,0,t,s))});var p=l?void 0:La(t);return ba(p||t,function(h,f){p&&(h=t[f=h]),Sa(a,f,Ai(h,e,n,0,t,s))}),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 ja(t,e){return t.has(e)}function Zu(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 Do: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(!Xu(e,function(b,y){if(!ja(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 _b(t){var e=-1,n=Array(t.size);return t.forEach(function(o,i){n[++e]=[i,o]}),n}function Fa(t){var e=-1,n=Array(t.size);return t.forEach(function(o){n[++e]=o}),n}Ee[Ju]=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[Gu]=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,Ha=Qu?Qu.valueOf:void 0,Ab=Object.prototype.hasOwnProperty,ep="[object Arguments]",tp="[object Array]",Vi="[object Object]",np=Object.prototype.hasOwnProperty;function Wa(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=de(s),h=de(a),f=p?tp:xt(s),m=h?tp:xt(a),g=(f=f==ep?Vi:f)==Vi,v=(m=m==ep?Vi:m)==Vi,b=f==m;if(b&&gr(s)){if(!gr(a))return!1;p=!0,g=!1}if(b&&!g)return u||(u=new Ut),p||Ba(s)?Zu(s,a,l,c,d,u):function(C,S,E,M,N,O,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||!O(new _i(C),new _i(S)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ci(+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=_b;case"[object Set]":var _=1&M;if(z||(z=Fa),C.size!=S.size&&!_)return!1;var I=R.get(C);if(I)return I==S;M|=2,R.set(C,S);var T=Zu(z(C),z(S),M,N,O,R);return R.delete(C),T;case"[object Symbol]":if(Ha)return Ha.call(C)==Ha.call(S)}return!1}(s,a,f,l,c,d,u);if(!(1&l)){var y=g&&np.call(s,"__wrapped__"),k=v&&np.call(a,"__wrapped__");if(y||k){var w=y?s.value():s,x=k?a.value():a;return u||(u=new Ut),d(w,x,l,c,u)}}return!!b&&(u||(u=new Ut),function(C,S,E,M,N,O){var R=1&E,z=La(C),_=z.length;if(_!=La(S).length&&!R)return!1;for(var I=_;I--;){var T=z[I];if(!(R?T in S:Ab.call(S,T)))return!1}var V=O.get(C),P=O.get(S);if(V&&P)return V==S&&P==C;var A=!0;O.set(C,S),O.set(S,C);for(var L=R;++I<_;){var j=C[T=z[I]],q=S[T];if(M)var H=R?M(q,j,T,S,C,O):M(j,q,T,C,S,O);if(!(H===void 0?j===q||N(j,q,E,M,O):H)){A=!1;break}L||(L=T=="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 O.delete(C),O.delete(S),A}(s,a,l,c,d,u))}(t,e,n,o,Wa,i))}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 Vb(t,e){return t!=null&&e in Object(t)}function ip(t,e,n){for(var o=-1,i=(e=uu(e,t)).length,s=!1;++o<i;){var a=Ti(e[o]);if(!(s=t!=null&&n(t,a)))break;t=t[a]}return s||++o!=i?s:!!(i=t==null?0:t.length)&&Ma(i)&&xi(a,i)&&(de(t)||Ei(t))}function sp(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],i=t[1],_a(o)&&op(i)?rp(Ti(o),i):function(s){var a=Ao(s,o);return a===void 0&&a===i?function(l,c){return l!=null&&ip(l,c,Vb)}(s,o):Wa(i,a,3)}):(n=function(s){for(var a=Sn(s),l=a.length;l--;){var c=a[l],d=s[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(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(!Wa(m,f,3,void 0,new Ut))return!1}return!0}(s,0,n)}):function(s){return _a(s)?sp(Ti(s)):function(a){return function(l){return Da(l,a)}}(s)}(t);var e,n,o,i}var ap,kr=(ap=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,Sn)},function(t,e){if(t==null)return t;if(!Kt(t))return ap(t,e);for(var n=t.length,o=-1,i=Object(t);++o<n&&e(i[o],o,i)!==!1;);return t}),Ka=function(){return ot.Date.now()},Ib=Math.max,Db=Math.min;function Ii(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,w=i;return o=i=void 0,d=y,a=t.apply(w,k)}function m(y){var k=y-c;return c===void 0||k>=e||k<0||p&&y-d>=s}function g(){var y=Ka();if(m(y))return v(y);l=setTimeout(g,function(k){var w=e-(k-c);return p?Db(w,s-(k-d)):w}(y))}function v(y){return l=void 0,h&&o?f(y):(o=i=void 0,a)}function b(){var y=Ka(),k=m(y);if(o=arguments,i=this,c=y,k){if(l===void 0)return function(w){return d=w,l=setTimeout(g,e),u?f(w):a}(c);if(p)return clearTimeout(l),l=setTimeout(g,e),f(c)}return l===void 0&&(l=setTimeout(g,e)),a}return e=vi(e)||0,Tt(n)&&(u=!!n.leading,s=(p="maxWait"in n)?Ib(vi(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(Ka())},b}function lp(t){return wt(t)&&Kt(t)}var cp=Ea(function(t,e){return lp(t)?function(n,o){var i=-1,s=wa,a=!0,l=n.length,c=[],d=o.length;if(!l)return c;o.length>=200&&(s=ja,a=!1,o=new Do(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=rb),a||(a=[]);++l<c;){var d=n[l];i(d)&&pu(a,d)}return a}(e,0,lp)):[]});function Di(t,e){var n;return(de(t)?ba:kr)(t,typeof(n=e)=="function"?n:Bo)}function Rb(t,e){var n=[];return kr(t,function(o,i,s){e(o,i,s)&&n.push(o)}),n}function wr(t,e){return(de(t)?Lu:Rb)(t,En(e))}var Lb=Math.max;function an(t,e,n){var o=t==null?0:t.length;if(!o)return-1;var i=n==null?0:Yn(n);return i<0&&(i=Lb(o+i,0)),Jd(t,En(e),i)}var dp,Ro=(dp=an,function(t,e,n){var o=Object(t);if(!Kt(t)){var i=En(e);t=Sn(t),e=function(a){return i(o[a],a,o)}}var s=dp(t,e,n);return s>-1?o[i?t[s]:s]: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(i,s,a){o[++n]=e(i,s,a)}),o}function Mn(t,e){return(de(t)?No:pp)(t,En(e))}var Ri=_u("floor"),zb=Object.prototype.hasOwnProperty;function $b(t,e){return t!=null&&zb.call(t,e)}function Pb(t,e){return t!=null&&ip(t,e,$b)}function Lo(t){return typeof t=="string"||!de(t)&&wt(t)&&on(t)=="[object String]"}var jb=Math.max;function gt(t,e,n,o){t=Kt(t)?t:function(s){return s==null?[]:function(a,l){return No(l,function(c){return a[c]})}(s,Sn(s))}(t),n=n?Yn(n):0;var i=t.length;return n<0&&(n=jb(i+n,0)),Lo(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&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 Fb=Object.prototype.hasOwnProperty;function Ct(t){if(t==null)return!0;if(Kt(t)&&(de(t)||typeof t=="string"||typeof t.splice=="function"||gr(t)||Ba(t)||Ei(t)))return!t.length;var e=xt(t);if(e=="[object Map]"||e=="[object Set]")return!t.size;if(Si(t))return!Ta(t).length;for(var n in t)if(Fb.call(t,n))return!1;return!0}function Li(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 ub.test(n)}(e=qt(e))?function(n){return n.match(gb)||[]}(e):function(n){return n.match(db)||[]}(e)}(function(e){return(e=qt(e))&&e.replace(lb,ab).replace(cb,"")}(t).replace(vb,"")),mp,"")});function Hb(t,e){if(t!==e){var n=t!==void 0,o=t===null,i=t==t,s=Mo(t),a=e!==void 0,l=e===null,c=e==e,d=Mo(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 Wb=sp("length"),vp="\\ud800-\\udfff",Kb="["+vp+"]",qa="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ua="\\ud83c[\\udffb-\\udfff]",yp="[^"+vp+"]",bp="(?:\\ud83c[\\udde6-\\uddff]){2}",kp="[\\ud800-\\udbff][\\udc00-\\udfff]",wp="(?:"+qa+"|"+Ua+")?",xp="[\\ufe0e\\ufe0f]?",qb=xp+wp+"(?:\\u200d(?:"+[yp,bp,kp].join("|")+")"+xp+wp+")*",Ub="(?:"+[yp+qa+"?",qa,bp,kp,Kb].join("|")+")",Cp=RegExp(Ua+"(?="+Ua+")|"+Ub+qb,"g");function Jb(t,e,n,o,i){return i(t,function(s,a,l){n=o?(o=!1,s):e(n,s,a,l)}),n}function Ja(t){if(t==null)return 0;if(Kt(t))return Lo(t)?function(o){return sb.test(o)}(e=t)?function(o){for(var i=Cp.lastIndex=0;Cp.test(o);)++i;return i}(e):Wb(e):t.length;var e,n=xt(t);return n=="[object Map]"||n=="[object Set]"?t.size:Ta(t).length}function Gb(t,e){var n;return kr(t,function(o,i,s){return!(n=e(o,i,s))}),!!n}function Sp(t,e,n){return(de(t)?Xu:Gb)(t,En(e))}function zo(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),Ii(t,e,{leading:o,maxWait:e,trailing:i})}function Ep(t){return qt(t).toLowerCase()}var Yb=Io&&1/Fa(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)),Ya=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())]},Mp="mc-icon",Xb=r.defineComponent({name:Mp,__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))}}),K=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},eo=K(Xb,[["__scopeId","data-v-24abf3b0"]]),ce=X(eo),Np="mc-alert-message",Zb={class:"mc-alert-message-header"},Qb={class:"mc-alert-message-title-container"},ek={key:0,class:"mc-alert-message-icon-group"},tk={class:"mc-alert-message-icon-wrapper"},nk={class:"mc-alert-message-icon-wrapper"},ok={key:0,class:"mc-alert-message-body"},rk=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,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",Zb,[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(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",ek,[r.createElementVNode("div",tk,[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",nk,[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",ok,[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(rk,[["__scopeId","data-v-26d43a1b"]])),zi=(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)})},$i=(t,e)=>{zi(document,"click",n=>{if(t.value&&n.target)if(de(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)})},$o=(t,{afterFocus:e,beforeBlur:n,afterBlur:o}={})=>{const i=r.getCurrentInstance(),{emit:s}=i,a=r.ref(),l=r.ref(!1);return zi(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(!de(t))return n==null?void 0:n[t];for(const i of t)if(Pb(n,i))return n==null?void 0:n[i]})}const Po=(t,e,n=300)=>{const o=new ResizeObserver(zo(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}},Tp=t=>{r.onMounted(()=>{window.addEventListener("resize",t)}),r.onUnmounted(()=>{window.removeEventListener("resize",t)})},$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)}},Op=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}},_p="mc-button",ik=["type","disabled"],sk={key:1,class:"loading-icon"},ak={class:"mc-button-text"},lk=r.defineComponent({name:_p,__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=zo(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(ce),{key:0,name:t.leftIcon},null,8,["name"])):r.createCommentVNode("",!0),t.loading&&!t.disabled?(r.openBlock(),r.createElementBlock("span",sk,[r.createVNode(r.unref(ce),{name:"Loading",size:16})])):r.createCommentVNode("",!0),r.createElementVNode("div",ak,[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,ik))}}),to=X(K(lk,[["__scopeId","data-v-dfec08a5"]])),jo=Symbol("mc-form-context"),Ap="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 xr(t,e){return xr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},xr(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,i,s){var a=[null];a.push.apply(a,i);var l=new(Function.bind.apply(o,a));return s&&xr(l,s.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,i)}function i(){return Za(n,arguments,Xa(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),xr(i,n)},Qa(t)}var ck=/%[sdj%]/g,Vp=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 i=0,s=n.length;if(typeof t=="function")return t.apply(null,n);if(typeof t=="string"){var a=t.replace(ck,function(l){if(l==="%%")return"%";if(i>=s)return l;switch(l){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 l}});return a}return 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 Ip(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"&&(Vp=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 Dp=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,xr(e,n),o}(Qa(Error));function Rp(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 Lp(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,zp=function(t,e,n,o,i,s){!t.required||n.hasOwnProperty(t.field)&&!Ue(e,s||t.type)||o.push(St(i.messages.required,t.fullField))},dk=/^(([^<>()\[\]\\.,;:\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,}))$/,uk=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,Cr={integer:function(t){return Cr.number(t)&&parseInt(t,10)===t},float:function(t){return Cr.number(t)&&!Cr.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"&&!Cr.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(dk)},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}",i="[a-fA-F\\d]{1,4}",s=(`
|
|
4
4
|
(?:
|
|
5
5
|
(?:`+i+":){7}(?:"+i+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
6
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
|
|
@@ -11,7 +11,7 @@
|
|
|
11
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
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+"$)|(?:^"+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 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(uk)}},jo="enum",lt=zp,Pt=function(t,e,n,o,i){if(t.required&&e===void 0)zp(t,e,n,o,i);else{var s=t.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(s)>-1?Cr[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))}},Fo=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))},$p=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))))},nl=function(t,e,n,o,i){var s=t.type,a=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(Ue(e,s)&&!t.required)return n();lt(t,e,o,a,i,s),Ue(e,s)||Pt(t,e,o,a,i)}n(a)},Sr={string:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(Ue(e,"string")&&!t.required)return n();lt(t,e,o,s,i,"string"),Ue(e,"string")||(Pt(t,e,o,s,i),Fo(t,e,0,s,i),$p(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(Ue(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),Ue(e)&&!t.required)return n();lt(t,e,o,s,i),e!==void 0&&(Pt(t,e,o,s,i),Fo(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(Ue(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(Ue(e)&&!t.required)return n();lt(t,e,o,s,i),Ue(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(Ue(e)&&!t.required)return n();lt(t,e,o,s,i),e!==void 0&&(Pt(t,e,o,s,i),Fo(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(Ue(e)&&!t.required)return n();lt(t,e,o,s,i),e!==void 0&&(Pt(t,e,o,s,i),Fo(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),Fo(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(Ue(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(Ue(e)&&!t.required)return n();lt(t,e,o,s,i),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,s,i)}n(s)},pattern:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(Ue(e,"string")&&!t.required)return n();lt(t,e,o,s,i),Ue(e,"string")||$p(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(Ue(e,"date")&&!t.required)return n();var a;lt(t,e,o,s,i),Ue(e,"date")||(a=e instanceof Date?e:new Date(e),Pt(t,a,o,s,i),a&&Fo(t,a.getTime(),0,s,i))}n(s)},url:nl,hex:nl,email:nl,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(Ue(e)&&!t.required)return n();lt(t,e,o,s,i)}n(s)}};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(),Er=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(i){var s=n[i];o.rules[i]=Array.isArray(s)?s:[s]})},e.messages=function(n){return n&&(this._messages=Lp(ol(),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===rl&&(d=ol()),Lp(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=no({},a)),m=a[h]=v.transform(m)),(v=typeof v=="function"?{validator:v}:no({},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(O){var R=[];return Object.keys(O).forEach(function(z){R.push.apply(R,O[z]||[])}),R}(h);Ip(N,m,function(O){return g(O),O.length?M(new Dp(O,el(O))):E(v)})});return b.catch(function(E){return E}),b}var y=f.firstFields===!0?Object.keys(h):f.firstFields||[],k=Object.keys(h),w=k.length,x=0,C=[],S=new Promise(function(E,M){var N=function(O){if(C.push.apply(C,O),++x===w)return g(C),C.length?M(new Dp(C,el(C))):E(v)};k.length||(g(C),E(v)),k.forEach(function(O){var R=h[O];y.indexOf(O)!==-1?Ip(R,m,N):function(z,_,I){var T=[],V=0,P=z.length;function A(L){T.push.apply(T,L||[]),++V===P&&I(T)}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 b(k,w){return no({},w,{fullField:g.fullField+"."+k,fullFields:g.fullFields?[].concat(g.fullFields,[k]):[k]})}function y(k){k===void 0&&(k=[]);var w=Array.isArray(k)?k:[k];!l.suppressWarning&&w.length&&t.warning("async-validator:",w),w.length&&g.message!==void 0&&(w=[].concat(g.message));var x=w.map(Rp(g,a));if(l.first&&x.length)return p[g.field]=1,f(x);if(v){if(g.required&&!h.value)return g.message!==void 0?x=[].concat(g.message).map(Rp(g,a)):l.error&&(x=[l.error(g,St(l.messages.required,g.field))]),f(x);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],O=Array.isArray(N)?N:[N];S[M]=O.map(b.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=[];x&&x.length&&N.push.apply(N,x),M&&M.length&&N.push.apply(N,M),f(N.length?N:null)})}else f(x)}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=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&&!Sr.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"?Sr.required:Sr[this.getType(n)]||void 0},t}();Er.register=function(t,e){if(typeof e!="function")throw new Error("Cannot register a validator by type, validator is not a function");Sr[t]=e},Er.warning=Vp,Er.messages=rl,Er.validators=Sr;var vt="top",Ot="bottom",_t="right",ct="left",il="auto",Mr=[vt,Ot,_t,ct],Ho="start",Nr="end",Pp="viewport",Br="popper",jp=Mr.reduce(function(t,e){return t.concat([e+"-"+Ho,e+"-"+Nr])},[]),Fp=[].concat(Mr,[il]).reduce(function(t,e){return t.concat([e,e+"-"+Ho,e+"-"+Nr])},[]),pk=["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 oo(t){return t instanceof Et(t).Element||t instanceof Element}function At(t){return t instanceof Et(t).HTMLElement||t instanceof HTMLElement}function sl(t){return typeof ShadowRoot<"u"&&(t instanceof Et(t).ShadowRoot||t instanceof ShadowRoot)}const hk={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 ro=Math.max,Pi=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 Hp(){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(),i=1,s=1;e&&At(t)&&(i=t.offsetWidth>0&&Wo(o.width)/t.offsetWidth||1,s=t.offsetHeight>0&&Wo(o.height)/t.offsetHeight||1);var a=(oo(t)?Et(t):window).visualViewport,l=!Hp()&&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 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 Wp(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&sl(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 fk(t){return["table","td","th"].indexOf(Gt(t))>=0}function Nn(t){return((oo(t)?t.ownerDocument:t.document)||window.document).documentElement}function ji(t){return Gt(t)==="html"?t:t.assignedSlot||t.parentNode||(sl(t)?t.host:null)||Nn(t)}function Kp(t){return At(t)&&ln(t).position!=="fixed"?t.offsetParent:null}function Tr(t){for(var e=Et(t),n=Kp(t);n&&fk(n)&&ln(n).position==="static";)n=Kp(n);return n&&(Gt(n)==="html"||Gt(n)==="body"&&ln(n).position==="static")?e:n||function(o){var i=/firefox/i.test(al());if(/Trident/i.test(al())&&At(o)&&ln(o).position==="fixed")return null;var s=ji(o);for(sl(s)&&(s=s.host);At(s)&&["html","body"].indexOf(Gt(s))<0;){var a=ln(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 cl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Or(t,e,n){return ro(t,Pi(e,n))}function qp(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Up(t,e){return e.reduce(function(n,o){return n[o]=t,n},{})}const mk={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=cl(l),d=[ct,_t].indexOf(l)>=0?"height":"width";if(s&&a){var u=function(E,M){return qp(typeof(E=typeof E=="function"?E(Object.assign({},M.rects,{placement:M.placement})):E)!="number"?E:Up(E,Mr))}(i.padding,n),p=ll(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=Tr(s),b=v?c==="y"?v.clientHeight||0:v.clientWidth||0:0,y=m/2-g/2,k=u[h],w=b-p[d]-u[f],x=b/2-p[d]/2+y,C=Or(k,x,w),S=c;n.modifiersData[o]=((e={})[S]=C,e.centerOffset=C-x,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)))&&Wp(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qo(t){return t.split("-")[1]}var gk={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Jp(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,w=vt,x=window;if(d){var C=Tr(n),S="clientHeight",E="clientWidth";C===Et(n)&&ln(C=Nn(n)).position!=="static"&&l==="absolute"&&(S="scrollHeight",E="scrollWidth"),(i===vt||(i===ct||i===_t)&&s===Nr)&&(w=Ot,g-=(p&&C===x&&x.visualViewport?x.visualViewport.height:C[S])-o.height,g*=c?1:-1),i!==ct&&(i!==vt&&i!==Ot||s!==Nr)||(k=_t,f-=(p&&C===x&&x.visualViewport?x.visualViewport.width:C[E])-o.width,f*=c?1:-1)}var M,N=Object.assign({position:l},d&&gk),O=u===!0?function(R,z){var _=R.x,I=R.y,T=z.devicePixelRatio||1;return{x:Wo(_*T)/T||0,y:Wo(I*T)/T||0}}({x:f,y:g},Et(n)):{x:f,y:g};return f=O.x,g=O.y,c?Object.assign({},N,((M={})[w]=y?"0":"",M[k]=b?"0":"",M.transform=(x.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",M)):Object.assign({},N,((e={})[w]=y?g+"px":"",e[k]=b?f+"px":"",e.transform="",e))}var Fi={passive:!0},vk={left:"right",right:"left",bottom:"top",top:"bottom"};function Hi(t){return t.replace(/left|right|bottom|top/g,function(e){return vk[e]})}var yk={start:"end",end:"start"};function Gp(t){return t.replace(/start|end/g,function(e){return yk[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,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+o)}function Yp(t){return["html","body","#document"].indexOf(Gt(t))>=0?t.ownerDocument.body:At(t)&&pl(t)?t:Yp(ji(t))}function _r(t,e){var n;e===void 0&&(e=[]);var o=Yp(t),i=o===((n=t.ownerDocument)==null?void 0:n.body),s=Et(o),a=i?[s].concat(s.visualViewport||[],pl(o)?o:[]):o,l=e.concat(a);return i?l:l.concat(_r(ji(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 Xp(t,e,n){return e===Pp?hl(function(o,i){var s=Et(o),a=Nn(o),l=s.visualViewport,c=a.clientWidth,d=a.clientHeight,u=0,p=0;if(l){c=l.width,d=l.height;var h=Hp();(h||!h&&i==="fixed")&&(u=l.offsetLeft,p=l.offsetTop)}return{width:c,height:d,x:u+ul(o),y:p}}(t,n)):oo(e)?function(o,i){var s=Ko(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):hl(function(o){var i,s=Nn(o),a=dl(o),l=(i=o.ownerDocument)==null?void 0:i.body,c=ro(s.scrollWidth,s.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),d=ro(s.scrollHeight,s.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),u=-a.scrollLeft+ul(o),p=-a.scrollTop;return ln(l||s).direction==="rtl"&&(u+=ro(s.clientWidth,l?l.clientWidth:0)-c),{width:c,height:d,x:u,y:p}}(Nn(t)))}function Zp(t){var e,n=t.reference,o=t.element,i=t.placement,s=i?Yt(i):null,a=i?qo(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?cl(s):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 Nr:e[d]=e[d]+(n[u]/2-o[u]/2)}}return e}function Ar(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?Pp:d,p=n.elementContext,h=p===void 0?Br:p,f=n.altBoundary,m=f!==void 0&&f,g=n.padding,v=g===void 0?0:g,b=qp(typeof v!="number"?v:Up(v,Mr)),y=h===Br?"reference":Br,k=t.rects.popper,w=t.elements[m?y:h],x=function(z,_,I,T){var V=_==="clippingParents"?function(j){var q=_r(ji(j)),H=["absolute","fixed"].indexOf(ln(j).position)>=0&&At(j)?Tr(j):j;return oo(H)?q.filter(function(U){return oo(U)&&Wp(U,H)&&Gt(U)!=="body"}):[]}(z):[].concat(_),P=[].concat(V,[I]),A=P[0],L=P.reduce(function(j,q){var H=Xp(z,q,T);return j.top=ro(H.top,j.top),j.right=Pi(H.right,j.right),j.bottom=Pi(H.bottom,j.bottom),j.left=ro(H.left,j.left),j},Xp(z,A,T));return L.width=L.right-L.left,L.height=L.bottom-L.top,L.x=L.left,L.y=L.top,L}(oo(w)?w:w.contextElement||Nn(t.elements.popper),c,u,a),C=Ko(t.elements.reference),S=Zp({reference:C,element:k,placement:i}),E=hl(Object.assign({},k,S)),M=h===Br?E:C,N={top:x.top-M.top+b.top,bottom:M.bottom-x.bottom+b.bottom,left:x.left-M.left+b.left,right:M.right-x.right+b.right},O=t.modifiersData.offset;if(h===Br&&O){var R=O[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 bk(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?Fp:c,u=qo(o),p=u?l?jp:jp.filter(function(m){return qo(m)===u}):Mr,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]=Ar(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 kk={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)===il)return[];var q=Hi(j);return[Gp(j),q,Gp(q)]}(v):[Hi(v)]),k=[v].concat(y).reduce(function(j,q){return j.concat(Yt(q)===il?bk(e,{placement:q,boundary:u,rootBoundary:p,padding:d,flipVariations:m,allowedAutoPlacements:g}):q)},[]),w=e.rects.reference,x=e.rects.popper,C=new Map,S=!0,E=k[0],M=0;M<k.length;M++){var N=k[M],O=Yt(N),R=qo(N)===Ho,z=[vt,Ot].indexOf(O)>=0,_=z?"width":"height",I=Ar(e,{placement:N,boundary:u,rootBoundary:p,altBoundary:h,padding:d}),T=z?R?_t:ct:R?Ot:vt;w[_]>x[_]&&(T=Hi(T));var V=Hi(T),P=[];if(s&&P.push(I[O]<=0),l&&P.push(I[T]<=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=k.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 Qp(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 eh(t){return[vt,_t,Ot,ct].some(function(e){return t[e]>=0})}const wk={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=Fp.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}};function xk(t,e,n){n===void 0&&(n=!1);var o,i,s=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(s||!s&&!n)&&((Gt(e)!=="body"||pl(l))&&(d=(o=e)!==Et(o)&&At(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.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 Ck(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 th={placement:"bottom",modifiers:[],strategy:"absolute"};function nh(){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 Sk(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,o=n===void 0?[]:n,i=e.defaultOptions,s=i===void 0?th:i;return function(a,l,c){c===void 0&&(c=s);var d,u,p={placement:"bottom",orderedModifiers:[],options:Object.assign({},th,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:oo(a)?_r(a):a.contextElement?_r(a.contextElement):[],popper:_r(l)};var y=function(k){var w=Ck(k);return pk.reduce(function(x,C){return x.concat(w.filter(function(S){return S.phase===C}))},[])}(function(k){var w=k.reduce(function(x,C){var S=x[C.name];return x[C.name]=S?Object.assign({},S,C,{options:Object.assign({},S.options,C.options),data:Object.assign({},S.data,C.data)}):C,x},{});return Object.keys(w).map(function(x){return w[x]})}([].concat(o,p.options.modifiers)));return p.orderedModifiers=y.filter(function(k){return k.enabled}),p.orderedModifiers.forEach(function(k){var w=k.name,x=k.options,C=x===void 0?{}:x,S=k.effect;if(typeof S=="function"){var E=S({state:p,name:w,instance:m,options:C});h.push(E||function(){})}}),m.update()},forceUpdate:function(){if(!f){var v=p.elements,b=v.reference,y=v.popper;if(nh(b,y)){p.rects={reference:xk(b,Tr(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 k=0;k<p.orderedModifiers.length;k++)if(p.reset!==!0){var w=p.orderedModifiers[k],x=w.fn,C=w.options,S=C===void 0?{}:C,E=w.name;typeof x=="function"&&(p=x({state:p,options:S,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(!nh(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 Ek=Sk({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,Fi)}),l&&c.addEventListener("resize",n.update,Fi),function(){s&&d.forEach(function(u){u.removeEventListener("scroll",n.update,Fi)}),l&&c.removeEventListener("resize",n.update,Fi)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=Zp({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:qo(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,Jp(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,Jp(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:{}},hk,wk,kk,{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=Ar(e,{boundary:c,rootBoundary:d,padding:p,altBoundary:u}),b=Yt(e.placement),y=qo(e.placement),k=!y,w=cl(b),x=w==="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),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,R={x:0,y:0};if(C){if(s){var z,_=w==="y"?vt:ct,I=w==="y"?Ot:_t,T=w==="y"?"height":"width",V=C[w],P=V+v[_],A=V-v[I],L=f?-E[T]/2:0,j=y===Ho?S[T]:E[T],q=y===Ho?-E[T]:-S[T],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},G=Y[_],Q=Y[I],oe=Or(0,S[T],U[T]),fe=k?S[T]/2-L-oe-G-N.mainAxis:j-oe-G-N.mainAxis,le=k?-S[T]/2+L+oe+Q+N.mainAxis:q+oe+Q+N.mainAxis,me=e.elements.arrow&&Tr(e.elements.arrow),Be=me?w==="y"?me.clientTop||0:me.clientLeft||0:0,Z=(z=O==null?void 0:O[w])!=null?z:0,ie=V+le-Z,ae=Or(f?Pi(P,V+fe-Z-Be):P,V,f?ro(A,ie):A);C[w]=ae,R[w]=ae-V}if(l){var re,Ce=w==="x"?vt:ct,nt=w==="x"?Ot:_t,Oe=C[x],_e=x==="y"?"height":"width",ue=Oe+v[Ce],ge=Oe-v[nt],at=[vt,ct].indexOf(b)!==-1,ft=(re=O==null?void 0:O[x])!=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=Or(ee,ve,ye);return Re>ye?ye:Re}(we,Oe,D):Or(f?we:ue,Oe,f?D:ge);C[x]=W,R[x]=W-Oe}e.modifiersData[o]=R}},requiresIfExists:["offset"]},mk,{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=Ar(e,{elementContext:"reference"}),l=Ar(e,{altBoundary:!0}),c=Qp(a,o),d=Qp(l,i,s),u=eh(c),p=eh(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 oh="mc-popper",Mk={key:0,id:"arrow",class:"mc-popper-arrow","data-popper-arrow":""},Wi=X(K(r.defineComponent({name:oh,__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=x=>{o.disabled&&(x=!1),p.value=x,i("visible:change",x)},f=r.computed(()=>({placement:o.placement,modifiers:[{name:"offset",options:{offset:[0,8]}}],...o.popperOptions}));let m,g,v;r.watch(p,x=>{x&&d.value&&u.value&&(m=Ek(d.value,u.value,f.value))},{flush:"post"}),r.onUnmounted(()=>{xe(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?w(!1):o.trigger==="click"?s.value.click=()=>{p.value?w():k()}:o.trigger==="hover"&&(s.value.mouseenter=()=>k(),a.value.mouseleave=()=>w(),l.value.mouseenter=()=>k()),g=Ii(Oi(h,null,!0),b.value),v=Ii(Oi(h,null,!1),y.value)});const k=(x=!0)=>{v==null||v.cancel(),x?g==null||g():h(!0)},w=(x=!0)=>{g==null||g.cancel(),x?v==null||v():h(!1)};return $i(c,()=>{i("click:outside"),o.trigger==="click"&&p.value&&w(!1)}),e({show:()=>k(!1),hide:()=>w(!1)}),(x,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(s.value,!0)),[r.renderSlot(x.$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(x.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0),t.showArrow?(r.openBlock(),r.createElementBlock("div",Mk)):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0)]),_:3},8,["name"])],16))}}),[["__scopeId","data-v-10213bd3"]])),rh="mc-tooltip",Nk={class:"mc-tooltip"},Uo=X(K(r.defineComponent({name:rh,__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",Nk,[r.createVNode(r.unref(Wi),{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(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"]])),Bk={class:"mc-form"},Tk=r.defineComponent({name:Ap,__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,i=a=>{if(de(a)){if(Ct(a))return Array.from(o.values());{const l=[];return Di(a,c=>{const d=o.get(c);d&&l.push(d)}),l}}return o.get(a)},s=(a=[])=>{const l=i(a);Ct(l)||(de(l)?Di(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 s(),await(async(c,d)=>{const u=i(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!Ja(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=i(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=i(a);Ct(l)||(de(l)?Di(l,c=>c.resetField()):l.resetField())},clearValidate:s}),(a,l)=>(r.openBlock(),r.createElementBlock("div",Bk,[r.createElementVNode("form",{onSubmit:l[0]||(l[0]=r.withModifiers(()=>{},["prevent"]))},[r.renderSlot(a.$slots,"default",{},void 0,!0)],32)]))}}),ih=X(K(Tk,[["__scopeId","data-v-291b4bdb"]])),fl=Symbol("mc-form-item-context"),sh="mc-form-item",Ok={class:"mc-form-item-label-wrapper"},_k={key:0,class:"mc-form-item-label"},Ak={key:0,class:"mc-form-item-help"},Vk={key:0,class:"mc-form-item-desc"},Ik={class:"mc-form-item__content"},Dk={key:0,class:"mc-form-item__error"},Rk=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),i=r.computed(()=>o.values().next().value),s=r.inject(Po,void 0),{addFormId:a,removeFormId:l}=(v=>{const b=r.inject(Po,void 0),y=new Map,k=be("prop"),w=()=>{if(xe(k.value))return;const C=de(k.value)?k.value:[k.value];for(const S of C){const E=v(S);y.set(S,E),b==null||b.addFormItem(E)}},x=()=>{for(const C of y.values())b==null||b.removeFormItem(C)};return r.onBeforeMount(()=>{w()}),r.onUnmounted(()=>{x()}),r.watch(()=>k.value,C=>{x(),Ct(C)||w()},{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(b,y)=>f(v,b,y),d=v=>async()=>{const b=s==null?void 0:s.model.value;xe(b)||(b[v]=u(v),await r.nextTick(),h())},{getInitialValue:u}=(()=>{const v=r.inject(Po,void 0),b=be("prop"),y=new Map;return r.watch(()=>b.value,k=>{(w=>{const x=v==null?void 0:v.model.value;if(xe(w)||Ct(w))y.clear();else if(de(w))for(const C of w)y.set(C,br(x,C));else y.set(w,br(x,w))})(k)}),{getInitialValue:k=>{if(!xe(k))return Ai(y.get(k),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=(C=>{const S=[],E=!!e.required;E&&S.push({required:!0}),e.rules&&S.push(...e.rules);const M=s==null?void 0:s.rules.value;if(M){const N=br(M,C);N&&S.push(...N)}if(E){const N=wr(Mn(S,(O,R)=>[O,R]),O=>gt(Sn(O[0]),"required"));if(Ja(N))for(const O of N){const[R,z]=O;R.required!==E&&(S[z]={...R,required:E})}else S.push({required:E})}return S})(v),w=((C,S)=>wr(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))(k,b);if(Ct(w))return y==null||y(!0),Promise.resolve(!0);n.set(v,"validating");const x=((C,S)=>{const E=new Er({[C]:S}),M=s==null?void 0:s.model.value;return E.validate({[C]:M==null?void 0:M[C]},{firstFields:!0})})(v,w);try{return await x,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&&Ja(S)>0?S[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 Sp(e.rules,w=>!!w.required);const v=s==null?void 0:s.rules.value,b=de(e.prop)?e.prop:[e.prop],y=[];for(const w of b){const x=br(v,w);x&&y.push(...x)}return Sp(y,w=>!!w.required)});return r.provide(fl,{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",Ok,[t.label?(r.openBlock(),r.createElementBlock("label",_k,[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",Ak,[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",Vk,[r.renderSlot(v.$slots,"desc",{},()=>[r.createTextVNode(r.toDisplayString(t.desc),1)],!0)])):r.createCommentVNode("",!0)])],!0),r.createElementVNode("div",Ik,[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",Dk,r.toDisplayString(i.value),1)):r.createCommentVNode("",!0)]),_:1})])],2))}}),ah=X(K(Rk,[["__scopeId","data-v-1ab8d6b8"]])),lh=({externalId:t,externalDisabled:e}={})=>{const n=r.inject(Po,void 0),o=r.inject(fl,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=de(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}},cn=({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}=lh({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 w=c==null?void 0:c.prop.value;if(w){const x=de(w)?w:[w],C=[];for(const S of x)C.push(c==null?void 0:c.validate(S,k));await Promise.all(C)}}}catch(w){console.error("[mc-form] validate error: ",w)}};return{formCtx:l,formItemCtx:c,formId:d,formDisabled:u,validateStatus:p,validateStyle:h,isError:f,isSuccess:m,statusIcon:v,validateByTrigger:y}},ch="mc-checkbox",ml=Symbol("mc-checkbox-group-context"),dh="mc-checkbox-group",Lk={class:"mc-checkbox"},zk=["id","value","disabled","onKeypress"],$k={key:0,class:"mc-checkbox-content"},Pk={key:0,class:"mc-checkbox-remarks"},jk=r.defineComponent({name:ch,__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,i=r.ref(),{wrapperRef:s,isFocused:a,handleFocus:l,handleBlur:c}=zo(i),{checkboxGroupDisabled:d,isCheckboxGroup:u,isCheckboxSelected:p,handleCheckboxSelect:h}=(()=>{const k=r.inject(ml,void 0),w=r.computed(()=>{var C;return!!((C=k==null?void 0:k.disabled)!=null&&C.value)}),x=r.computed(()=>!!k&&Ve(k==null?void 0:k.handleSelect));return{checkboxGroupCtx:k,checkboxGroupDisabled:w,isCheckboxGroup:x,isCheckboxSelected:C=>{var S;return!xe(C)&>((S=k==null?void 0:k.modelValue)==null?void 0:S.value,C)},handleCheckboxSelect:C=>{k==null||k.handleSelect(C)}}})(),{formId:f,formDisabled:m,validateStyle:g,validateByTrigger:v}=cn({externalDisabled:d}),b=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(k,w)=>(r.openBlock(),r.createElementBlock("div",Lk,[r.createElementVNode("label",{ref_key:"checkboxRef",ref:s,class:r.normalizeClass(["mc-checkbox-wrapper",{"mc-checkbox-disabled":r.unref(m),"mc-checkbox-checked":b.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:i,id:r.unref(f),type:"checkbox",class:"mc-checkbox-input",value:b.value,disabled:r.unref(m),onKeypress:r.withKeys(r.withModifiers(y,["prevent","stop"]),["enter"]),onFocus:w[0]||(w[0]=(...x)=>r.unref(l)&&r.unref(l)(...x)),onBlur:w[1]||(w[1]=(...x)=>r.unref(c)&&r.unref(c)(...x))},null,40,zk),w[2]||(w[2]=r.createElementVNode("div",{class:"mc-checkbox-box"},null,-1)),t.content||k.$slots.default?(r.openBlock(),r.createElementBlock("div",$k,[r.renderSlot(k.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)])):r.createCommentVNode("",!0)],2),t.remarks||k.$slots.remarks?(r.openBlock(),r.createElementBlock("div",Pk,[r.renderSlot(k.$slots,"remarks",{},()=>[r.createTextVNode(r.toDisplayString(t.remarks),1)],!0)])):r.createCommentVNode("",!0)]))}}),io=X(K(jk,[["__scopeId","data-v-7a17545f"]])),Fk=["id"],uh=X(r.defineComponent({name:dh,__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:i,validateByTrigger:s}=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(),s("input")}}),(a,l)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-checkbox-group",id:r.unref(i)},[r.renderSlot(a.$slots,"default")],8,Fk))}})),gl=Symbol("mc-collapse-context"),ph="mc-collapse",Hk={class:"mc-collapse"},hh=X(K(r.defineComponent({name:ph,__name:"mc-collapse",props:{modelValue:{default:()=>[]},accordion:{type:Boolean,default:!1},transition:{type:Boolean,default:!1}},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),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",Hk,[r.renderSlot(i.$slots,"default",{},void 0,!0)]))}}),[["__scopeId","data-v-1045351d"]])),fh="mc-icon-plus",Wk=r.defineComponent({name:fh,__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))}}),mh=K(Wk,[["__scopeId","data-v-779c77bf"]]),Bn=X(mh),gh="mc-collapse-item",Kk={class:"mc-collapse-item-header"},qk={class:"mc-collapse-item-title"},Uk={key:0,class:"mc-collapse-item-content"},Jk=r.defineComponent({name:gh,__name:"mc-collapse-item",props:{name:{},title:{},disabled:{type:Boolean}},setup(t){const e=r.inject(gl,void 0),n=r.computed(()=>{var s;return!!((s=e==null?void 0:e.activeNames.value)!=null&&s.includes(t.name))}),o=r.computed(()=>!!(e!=null&&e.transition.value)),i=()=>{t.disabled||(e==null||e.handleItemClick(t.name))};return(s,a)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-collapse-item",onClick:i},[r.createElementVNode("div",Kk,[r.createElementVNode("span",qk,[r.renderSlot(s.$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(()=>[n.value?(r.openBlock(),r.createElementBlock("div",Uk,[r.renderSlot(s.$slots,"default",{isActive:n.value},void 0,!0)])):r.createCommentVNode("",!0)]),_:3},8,["name"])]))}}),vh=X(K(Jk,[["__scopeId","data-v-45ae8722"]])),yh="mc-toast",Gk={key:0,class:"mc-toast-msg-icon"},Yk={key:1,class:"mc-toast-msg-text"},Xk={class:"mc-toast-msg-close-container"},Zk={key:0,class:"mc-toast-countdown"},Qk={key:1,class:"mc-toast-msg-close"},e1={key:0,class:"mc-toast-content-container"},bh=K(r.defineComponent({name:yh,__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",Gk,[r.createVNode(r.unref(ce),{name:s.value},null,8,["name"])])):r.createCommentVNode("",!0),t.message||h.$slots.default?(r.openBlock(),r.createElementBlock("div",Yk,[r.renderSlot(h.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.message),1)],!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",Xk,[a.value?(r.openBlock(),r.createElementBlock("div",Zk,r.toDisplayString(c.value),1)):r.createCommentVNode("",!0),t.closable?(r.openBlock(),r.createElementBlock("div",Qk,[r.createVNode(r.unref(ce),{name:"Cross",onClick:u})])):r.createCommentVNode("",!0)])],2),t.content||h.$slots.content?(r.openBlock(),r.createElementBlock("div",e1,[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 Ki=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 i=Date.now().toString(36)+Math.random().toString(36).slice(2),s=r.createVNode(bh,{...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)}})(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 dn.push(a),{...a}},qi={success:t=>Ki(typeof t=="string"?{message:t,type:"success"}:{...t,type:"success"}),error:t=>Ki(typeof t=="string"?{message:t,type:"error"}:{...t,type:"error"}),warning:t=>Ki(typeof t=="string"?{message:t,type:"warning"}:{...t,type:"warning"}),info:t=>Ki(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 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(uk)}},Fo="enum",lt=zp,Pt=function(t,e,n,o,i){if(t.required&&e===void 0)zp(t,e,n,o,i);else{var s=t.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(s)>-1?Cr[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))}},Ho=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))},$p=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))))},nl=function(t,e,n,o,i){var s=t.type,a=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(Ue(e,s)&&!t.required)return n();lt(t,e,o,a,i,s),Ue(e,s)||Pt(t,e,o,a,i)}n(a)},Sr={string:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(Ue(e,"string")&&!t.required)return n();lt(t,e,o,s,i,"string"),Ue(e,"string")||(Pt(t,e,o,s,i),Ho(t,e,0,s,i),$p(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(Ue(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),Ue(e)&&!t.required)return n();lt(t,e,o,s,i),e!==void 0&&(Pt(t,e,o,s,i),Ho(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(Ue(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(Ue(e)&&!t.required)return n();lt(t,e,o,s,i),Ue(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(Ue(e)&&!t.required)return n();lt(t,e,o,s,i),e!==void 0&&(Pt(t,e,o,s,i),Ho(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(Ue(e)&&!t.required)return n();lt(t,e,o,s,i),e!==void 0&&(Pt(t,e,o,s,i),Ho(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),Ho(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(Ue(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(Ue(e)&&!t.required)return n();lt(t,e,o,s,i),e!==void 0&&function(a,l,c,d,u){a[Fo]=Array.isArray(a[Fo])?a[Fo]:[],a[Fo].indexOf(l)===-1&&d.push(St(u.messages[Fo],a.fullField,a[Fo].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(Ue(e,"string")&&!t.required)return n();lt(t,e,o,s,i),Ue(e,"string")||$p(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(Ue(e,"date")&&!t.required)return n();var a;lt(t,e,o,s,i),Ue(e,"date")||(a=e instanceof Date?e:new Date(e),Pt(t,a,o,s,i),a&&Ho(t,a.getTime(),0,s,i))}n(s)},url:nl,hex:nl,email:nl,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(Ue(e)&&!t.required)return n();lt(t,e,o,s,i)}n(s)}};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(),Er=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(i){var s=n[i];o.rules[i]=Array.isArray(s)?s:[s]})},e.messages=function(n){return n&&(this._messages=Lp(ol(),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===rl&&(d=ol()),Lp(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=no({},a)),m=a[h]=v.transform(m)),(v=typeof v=="function"?{validator:v}:no({},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(O){var R=[];return Object.keys(O).forEach(function(z){R.push.apply(R,O[z]||[])}),R}(h);Ip(N,m,function(O){return g(O),O.length?M(new Dp(O,el(O))):E(v)})});return b.catch(function(E){return E}),b}var y=f.firstFields===!0?Object.keys(h):f.firstFields||[],k=Object.keys(h),w=k.length,x=0,C=[],S=new Promise(function(E,M){var N=function(O){if(C.push.apply(C,O),++x===w)return g(C),C.length?M(new Dp(C,el(C))):E(v)};k.length||(g(C),E(v)),k.forEach(function(O){var R=h[O];y.indexOf(O)!==-1?Ip(R,m,N):function(z,_,I){var T=[],V=0,P=z.length;function A(L){T.push.apply(T,L||[]),++V===P&&I(T)}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 b(k,w){return no({},w,{fullField:g.fullField+"."+k,fullFields:g.fullFields?[].concat(g.fullFields,[k]):[k]})}function y(k){k===void 0&&(k=[]);var w=Array.isArray(k)?k:[k];!l.suppressWarning&&w.length&&t.warning("async-validator:",w),w.length&&g.message!==void 0&&(w=[].concat(g.message));var x=w.map(Rp(g,a));if(l.first&&x.length)return p[g.field]=1,f(x);if(v){if(g.required&&!h.value)return g.message!==void 0?x=[].concat(g.message).map(Rp(g,a)):l.error&&(x=[l.error(g,St(l.messages.required,g.field))]),f(x);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],O=Array.isArray(N)?N:[N];S[M]=O.map(b.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=[];x&&x.length&&N.push.apply(N,x),M&&M.length&&N.push.apply(N,M),f(N.length?N:null)})}else f(x)}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=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&&!Sr.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"?Sr.required:Sr[this.getType(n)]||void 0},t}();Er.register=function(t,e){if(typeof e!="function")throw new Error("Cannot register a validator by type, validator is not a function");Sr[t]=e},Er.warning=Vp,Er.messages=rl,Er.validators=Sr;var vt="top",Ot="bottom",_t="right",ct="left",il="auto",Mr=[vt,Ot,_t,ct],Wo="start",Nr="end",Pp="viewport",Br="popper",jp=Mr.reduce(function(t,e){return t.concat([e+"-"+Wo,e+"-"+Nr])},[]),Fp=[].concat(Mr,[il]).reduce(function(t,e){return t.concat([e,e+"-"+Wo,e+"-"+Nr])},[]),pk=["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 oo(t){return t instanceof Et(t).Element||t instanceof Element}function At(t){return t instanceof Et(t).HTMLElement||t instanceof HTMLElement}function sl(t){return typeof ShadowRoot<"u"&&(t instanceof Et(t).ShadowRoot||t instanceof ShadowRoot)}const hk={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 ro=Math.max,Pi=Math.min,Ko=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 Hp(){return!/^((?!chrome|android).)*safari/i.test(al())}function qo(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&&Ko(o.width)/t.offsetWidth||1,s=t.offsetHeight>0&&Ko(o.height)/t.offsetHeight||1);var a=(oo(t)?Et(t):window).visualViewport,l=!Hp()&&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 ll(t){var e=qo(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 Wp(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&sl(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 fk(t){return["table","td","th"].indexOf(Gt(t))>=0}function Nn(t){return((oo(t)?t.ownerDocument:t.document)||window.document).documentElement}function ji(t){return Gt(t)==="html"?t:t.assignedSlot||t.parentNode||(sl(t)?t.host:null)||Nn(t)}function Kp(t){return At(t)&&ln(t).position!=="fixed"?t.offsetParent:null}function Tr(t){for(var e=Et(t),n=Kp(t);n&&fk(n)&&ln(n).position==="static";)n=Kp(n);return n&&(Gt(n)==="html"||Gt(n)==="body"&&ln(n).position==="static")?e:n||function(o){var i=/firefox/i.test(al());if(/Trident/i.test(al())&&At(o)&&ln(o).position==="fixed")return null;var s=ji(o);for(sl(s)&&(s=s.host);At(s)&&["html","body"].indexOf(Gt(s))<0;){var a=ln(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 cl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Or(t,e,n){return ro(t,Pi(e,n))}function qp(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Up(t,e){return e.reduce(function(n,o){return n[o]=t,n},{})}const mk={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=cl(l),d=[ct,_t].indexOf(l)>=0?"height":"width";if(s&&a){var u=function(E,M){return qp(typeof(E=typeof E=="function"?E(Object.assign({},M.rects,{placement:M.placement})):E)!="number"?E:Up(E,Mr))}(i.padding,n),p=ll(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=Tr(s),b=v?c==="y"?v.clientHeight||0:v.clientWidth||0:0,y=m/2-g/2,k=u[h],w=b-p[d]-u[f],x=b/2-p[d]/2+y,C=Or(k,x,w),S=c;n.modifiersData[o]=((e={})[S]=C,e.centerOffset=C-x,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)))&&Wp(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Uo(t){return t.split("-")[1]}var gk={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Jp(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,w=vt,x=window;if(d){var C=Tr(n),S="clientHeight",E="clientWidth";C===Et(n)&&ln(C=Nn(n)).position!=="static"&&l==="absolute"&&(S="scrollHeight",E="scrollWidth"),(i===vt||(i===ct||i===_t)&&s===Nr)&&(w=Ot,g-=(p&&C===x&&x.visualViewport?x.visualViewport.height:C[S])-o.height,g*=c?1:-1),i!==ct&&(i!==vt&&i!==Ot||s!==Nr)||(k=_t,f-=(p&&C===x&&x.visualViewport?x.visualViewport.width:C[E])-o.width,f*=c?1:-1)}var M,N=Object.assign({position:l},d&&gk),O=u===!0?function(R,z){var _=R.x,I=R.y,T=z.devicePixelRatio||1;return{x:Ko(_*T)/T||0,y:Ko(I*T)/T||0}}({x:f,y:g},Et(n)):{x:f,y:g};return f=O.x,g=O.y,c?Object.assign({},N,((M={})[w]=y?"0":"",M[k]=b?"0":"",M.transform=(x.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",M)):Object.assign({},N,((e={})[w]=y?g+"px":"",e[k]=b?f+"px":"",e.transform="",e))}var Fi={passive:!0},vk={left:"right",right:"left",bottom:"top",top:"bottom"};function Hi(t){return t.replace(/left|right|bottom|top/g,function(e){return vk[e]})}var yk={start:"end",end:"start"};function Gp(t){return t.replace(/start|end/g,function(e){return yk[e]})}function dl(t){var e=Et(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ul(t){return qo(Nn(t)).left+dl(t).scrollLeft}function pl(t){var e=ln(t),n=e.overflow,o=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+o)}function Yp(t){return["html","body","#document"].indexOf(Gt(t))>=0?t.ownerDocument.body:At(t)&&pl(t)?t:Yp(ji(t))}function _r(t,e){var n;e===void 0&&(e=[]);var o=Yp(t),i=o===((n=t.ownerDocument)==null?void 0:n.body),s=Et(o),a=i?[s].concat(s.visualViewport||[],pl(o)?o:[]):o,l=e.concat(a);return i?l:l.concat(_r(ji(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 Xp(t,e,n){return e===Pp?hl(function(o,i){var s=Et(o),a=Nn(o),l=s.visualViewport,c=a.clientWidth,d=a.clientHeight,u=0,p=0;if(l){c=l.width,d=l.height;var h=Hp();(h||!h&&i==="fixed")&&(u=l.offsetLeft,p=l.offsetTop)}return{width:c,height:d,x:u+ul(o),y:p}}(t,n)):oo(e)?function(o,i){var s=qo(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):hl(function(o){var i,s=Nn(o),a=dl(o),l=(i=o.ownerDocument)==null?void 0:i.body,c=ro(s.scrollWidth,s.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),d=ro(s.scrollHeight,s.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),u=-a.scrollLeft+ul(o),p=-a.scrollTop;return ln(l||s).direction==="rtl"&&(u+=ro(s.clientWidth,l?l.clientWidth:0)-c),{width:c,height:d,x:u,y:p}}(Nn(t)))}function Zp(t){var e,n=t.reference,o=t.element,i=t.placement,s=i?Yt(i):null,a=i?Uo(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?cl(s):null;if(d!=null){var u=d==="y"?"height":"width";switch(a){case Wo:e[d]=e[d]-(n[u]/2-o[u]/2);break;case Nr:e[d]=e[d]+(n[u]/2-o[u]/2)}}return e}function Ar(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?Pp:d,p=n.elementContext,h=p===void 0?Br:p,f=n.altBoundary,m=f!==void 0&&f,g=n.padding,v=g===void 0?0:g,b=qp(typeof v!="number"?v:Up(v,Mr)),y=h===Br?"reference":Br,k=t.rects.popper,w=t.elements[m?y:h],x=function(z,_,I,T){var V=_==="clippingParents"?function(j){var q=_r(ji(j)),H=["absolute","fixed"].indexOf(ln(j).position)>=0&&At(j)?Tr(j):j;return oo(H)?q.filter(function(U){return oo(U)&&Wp(U,H)&&Gt(U)!=="body"}):[]}(z):[].concat(_),P=[].concat(V,[I]),A=P[0],L=P.reduce(function(j,q){var H=Xp(z,q,T);return j.top=ro(H.top,j.top),j.right=Pi(H.right,j.right),j.bottom=Pi(H.bottom,j.bottom),j.left=ro(H.left,j.left),j},Xp(z,A,T));return L.width=L.right-L.left,L.height=L.bottom-L.top,L.x=L.left,L.y=L.top,L}(oo(w)?w:w.contextElement||Nn(t.elements.popper),c,u,a),C=qo(t.elements.reference),S=Zp({reference:C,element:k,placement:i}),E=hl(Object.assign({},k,S)),M=h===Br?E:C,N={top:x.top-M.top+b.top,bottom:M.bottom-x.bottom+b.bottom,left:x.left-M.left+b.left,right:M.right-x.right+b.right},O=t.modifiersData.offset;if(h===Br&&O){var R=O[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 bk(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?Fp:c,u=Uo(o),p=u?l?jp:jp.filter(function(m){return Uo(m)===u}):Mr,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]=Ar(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 kk={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)===il)return[];var q=Hi(j);return[Gp(j),q,Gp(q)]}(v):[Hi(v)]),k=[v].concat(y).reduce(function(j,q){return j.concat(Yt(q)===il?bk(e,{placement:q,boundary:u,rootBoundary:p,padding:d,flipVariations:m,allowedAutoPlacements:g}):q)},[]),w=e.rects.reference,x=e.rects.popper,C=new Map,S=!0,E=k[0],M=0;M<k.length;M++){var N=k[M],O=Yt(N),R=Uo(N)===Wo,z=[vt,Ot].indexOf(O)>=0,_=z?"width":"height",I=Ar(e,{placement:N,boundary:u,rootBoundary:p,altBoundary:h,padding:d}),T=z?R?_t:ct:R?Ot:vt;w[_]>x[_]&&(T=Hi(T));var V=Hi(T),P=[];if(s&&P.push(I[O]<=0),l&&P.push(I[T]<=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=k.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 Qp(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 eh(t){return[vt,_t,Ot,ct].some(function(e){return t[e]>=0})}const wk={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=Fp.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}};function xk(t,e,n){n===void 0&&(n=!1);var o,i,s=At(e),a=At(e)&&function(p){var h=p.getBoundingClientRect(),f=Ko(h.width)/p.offsetWidth||1,m=Ko(h.height)/p.offsetHeight||1;return f!==1||m!==1}(e),l=Nn(e),c=qo(t,a,n),d={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(s||!s&&!n)&&((Gt(e)!=="body"||pl(l))&&(d=(o=e)!==Et(o)&&At(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:dl(o)),At(e)?((u=qo(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 Ck(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 th={placement:"bottom",modifiers:[],strategy:"absolute"};function nh(){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 Sk(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,o=n===void 0?[]:n,i=e.defaultOptions,s=i===void 0?th:i;return function(a,l,c){c===void 0&&(c=s);var d,u,p={placement:"bottom",orderedModifiers:[],options:Object.assign({},th,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:oo(a)?_r(a):a.contextElement?_r(a.contextElement):[],popper:_r(l)};var y=function(k){var w=Ck(k);return pk.reduce(function(x,C){return x.concat(w.filter(function(S){return S.phase===C}))},[])}(function(k){var w=k.reduce(function(x,C){var S=x[C.name];return x[C.name]=S?Object.assign({},S,C,{options:Object.assign({},S.options,C.options),data:Object.assign({},S.data,C.data)}):C,x},{});return Object.keys(w).map(function(x){return w[x]})}([].concat(o,p.options.modifiers)));return p.orderedModifiers=y.filter(function(k){return k.enabled}),p.orderedModifiers.forEach(function(k){var w=k.name,x=k.options,C=x===void 0?{}:x,S=k.effect;if(typeof S=="function"){var E=S({state:p,name:w,instance:m,options:C});h.push(E||function(){})}}),m.update()},forceUpdate:function(){if(!f){var v=p.elements,b=v.reference,y=v.popper;if(nh(b,y)){p.rects={reference:xk(b,Tr(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 k=0;k<p.orderedModifiers.length;k++)if(p.reset!==!0){var w=p.orderedModifiers[k],x=w.fn,C=w.options,S=C===void 0?{}:C,E=w.name;typeof x=="function"&&(p=x({state:p,options:S,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(!nh(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 Ek=Sk({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,Fi)}),l&&c.addEventListener("resize",n.update,Fi),function(){s&&d.forEach(function(u){u.removeEventListener("scroll",n.update,Fi)}),l&&c.removeEventListener("resize",n.update,Fi)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=Zp({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:Uo(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,Jp(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,Jp(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:{}},hk,wk,kk,{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=Ar(e,{boundary:c,rootBoundary:d,padding:p,altBoundary:u}),b=Yt(e.placement),y=Uo(e.placement),k=!y,w=cl(b),x=w==="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),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,R={x:0,y:0};if(C){if(s){var z,_=w==="y"?vt:ct,I=w==="y"?Ot:_t,T=w==="y"?"height":"width",V=C[w],P=V+v[_],A=V-v[I],L=f?-E[T]/2:0,j=y===Wo?S[T]:E[T],q=y===Wo?-E[T]:-S[T],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},G=Y[_],Q=Y[I],oe=Or(0,S[T],U[T]),fe=k?S[T]/2-L-oe-G-N.mainAxis:j-oe-G-N.mainAxis,le=k?-S[T]/2+L+oe+Q+N.mainAxis:q+oe+Q+N.mainAxis,me=e.elements.arrow&&Tr(e.elements.arrow),Be=me?w==="y"?me.clientTop||0:me.clientLeft||0:0,Z=(z=O==null?void 0:O[w])!=null?z:0,ie=V+le-Z,ae=Or(f?Pi(P,V+fe-Z-Be):P,V,f?ro(A,ie):A);C[w]=ae,R[w]=ae-V}if(l){var re,Ce=w==="x"?vt:ct,nt=w==="x"?Ot:_t,Oe=C[x],_e=x==="y"?"height":"width",ue=Oe+v[Ce],ge=Oe-v[nt],at=[vt,ct].indexOf(b)!==-1,ft=(re=O==null?void 0:O[x])!=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=Or(ee,ve,ye);return Re>ye?ye:Re}(we,Oe,D):Or(f?we:ue,Oe,f?D:ge);C[x]=W,R[x]=W-Oe}e.modifiersData[o]=R}},requiresIfExists:["offset"]},mk,{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=Ar(e,{elementContext:"reference"}),l=Ar(e,{altBoundary:!0}),c=Qp(a,o),d=Qp(l,i,s),u=eh(c),p=eh(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 oh="mc-popper",Mk={key:0,id:"arrow",class:"mc-popper-arrow","data-popper-arrow":""},Wi=X(K(r.defineComponent({name:oh,__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=x=>{o.disabled&&(x=!1),p.value=x,i("visible:change",x)},f=r.computed(()=>({placement:o.placement,modifiers:[{name:"offset",options:{offset:[0,8]}}],...o.popperOptions}));let m,g,v;r.watch(p,x=>{x&&d.value&&u.value&&(m=Ek(d.value,u.value,f.value))},{flush:"post"}),r.onUnmounted(()=>{xe(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?w(!1):o.trigger==="click"?s.value.click=()=>{p.value?w():k()}:o.trigger==="hover"&&(s.value.mouseenter=()=>k(),a.value.mouseleave=()=>w(),l.value.mouseenter=()=>k()),g=Ii(Oi(h,null,!0),b.value),v=Ii(Oi(h,null,!1),y.value)});const k=(x=!0)=>{v==null||v.cancel(),x?g==null||g():h(!0)},w=(x=!0)=>{g==null||g.cancel(),x?v==null||v():h(!1)};return $i(c,()=>{i("click:outside"),o.trigger==="click"&&p.value&&w(!1)}),e({show:()=>k(!1),hide:()=>w(!1)}),(x,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(s.value,!0)),[r.renderSlot(x.$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(x.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0),t.showArrow?(r.openBlock(),r.createElementBlock("div",Mk)):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0)]),_:3},8,["name"])],16))}}),[["__scopeId","data-v-10213bd3"]])),rh="mc-tooltip",Nk={class:"mc-tooltip"},Jo=X(K(r.defineComponent({name:rh,__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",Nk,[r.createVNode(r.unref(Wi),{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(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"]])),Bk={class:"mc-form"},Tk=r.defineComponent({name:Ap,__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,i=a=>{if(de(a)){if(Ct(a))return Array.from(o.values());{const l=[];return Di(a,c=>{const d=o.get(c);d&&l.push(d)}),l}}return o.get(a)},s=(a=[])=>{const l=i(a);Ct(l)||(de(l)?Di(l,c=>c.clearValidate()):l.clearValidate())};return r.provide(jo,{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 s(),await(async(c,d)=>{const u=i(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!Ja(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=i(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=i(a);Ct(l)||(de(l)?Di(l,c=>c.resetField()):l.resetField())},clearValidate:s}),(a,l)=>(r.openBlock(),r.createElementBlock("div",Bk,[r.createElementVNode("form",{onSubmit:l[0]||(l[0]=r.withModifiers(()=>{},["prevent"]))},[r.renderSlot(a.$slots,"default",{},void 0,!0)],32)]))}}),ih=X(K(Tk,[["__scopeId","data-v-67e22718"]])),fl=Symbol("mc-form-item-context"),sh="mc-form-item",Ok={class:"mc-form-item-label-wrapper"},_k={key:0,class:"mc-form-item-label"},Ak={key:0,class:"mc-form-item-help"},Vk={key:0,class:"mc-form-item-desc"},Ik={class:"mc-form-item__content"},Dk={key:0,class:"mc-form-item__error"},Rk=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),i=r.computed(()=>o.values().next().value),s=r.inject(jo,void 0),{addFormId:a,removeFormId:l}=(v=>{const b=r.inject(jo,void 0),y=new Map,k=be("prop"),w=()=>{if(xe(k.value))return;const C=de(k.value)?k.value:[k.value];for(const S of C){const E=v(S);y.set(S,E),b==null||b.addFormItem(E)}},x=()=>{for(const C of y.values())b==null||b.removeFormItem(C)};return r.onBeforeMount(()=>{w()}),r.onUnmounted(()=>{x()}),r.watch(()=>k.value,C=>{x(),Ct(C)||w()},{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(b,y)=>f(v,b,y),d=v=>async()=>{const b=s==null?void 0:s.model.value;xe(b)||(b[v]=u(v),await r.nextTick(),h())},{getInitialValue:u}=(()=>{const v=r.inject(jo,void 0),b=be("prop"),y=new Map;return r.watch(()=>b.value,k=>{(w=>{const x=v==null?void 0:v.model.value;if(xe(w)||Ct(w))y.clear();else if(de(w))for(const C of w)y.set(C,Ao(x,C));else y.set(w,Ao(x,w))})(k)}),{getInitialValue:k=>{if(!xe(k))return Ai(y.get(k),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=(C=>{const S=[],E=!!e.required;E&&S.push({required:!0}),e.rules&&S.push(...e.rules);const M=s==null?void 0:s.rules.value;if(M){const N=Ao(M,C);N&&S.push(...N)}if(E){const N=wr(Mn(S,(O,R)=>[O,R]),O=>gt(Sn(O[0]),"required"));if(Ja(N))for(const O of N){const[R,z]=O;R.required!==E&&(S[z]={...R,required:E})}else S.push({required:E})}return S})(v),w=((C,S)=>wr(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))(k,b);if(Ct(w))return y==null||y(!0),Promise.resolve(!0);n.set(v,"validating");const x=((C,S)=>{const E=new Er({[C]:S}),M=s==null?void 0:s.model.value;return E.validate({[C]:Ao(M,C)},{firstFields:!0})})(v,w);try{return await x,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&&Ja(S)>0?S[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 Sp(e.rules,w=>!!w.required);const v=s==null?void 0:s.rules.value,b=de(e.prop)?e.prop:[e.prop],y=[];for(const w of b){const x=Ao(v,w);x&&y.push(...x)}return Sp(y,w=>!!w.required)});return r.provide(fl,{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",Ok,[t.label?(r.openBlock(),r.createElementBlock("label",_k,[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",Ak,[r.renderSlot(v.$slots,"help",{},()=>[r.createVNode(r.unref(Jo),{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",Vk,[r.renderSlot(v.$slots,"desc",{},()=>[r.createTextVNode(r.toDisplayString(t.desc),1)],!0)])):r.createCommentVNode("",!0)])],!0),r.createElementVNode("div",Ik,[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",Dk,r.toDisplayString(i.value),1)):r.createCommentVNode("",!0)]),_:1})])],2))}}),ah=X(K(Rk,[["__scopeId","data-v-09bf5320"]])),lh=({externalId:t,externalDisabled:e}={})=>{const n=r.inject(jo,void 0),o=r.inject(fl,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=de(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}},cn=({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}=lh({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 w=c==null?void 0:c.prop.value;if(w){const x=de(w)?w:[w],C=[];for(const S of x)C.push(c==null?void 0:c.validate(S,k));await Promise.all(C)}}}catch(w){console.error("[mc-form] validate error: ",w)}};return{formCtx:l,formItemCtx:c,formId:d,formDisabled:u,validateStatus:p,validateStyle:h,isError:f,isSuccess:m,statusIcon:v,validateByTrigger:y}},ch="mc-checkbox",ml=Symbol("mc-checkbox-group-context"),dh="mc-checkbox-group",Lk={class:"mc-checkbox"},zk=["id","value","disabled","onKeypress"],$k={key:0,class:"mc-checkbox-content"},Pk={key:0,class:"mc-checkbox-remarks"},jk=r.defineComponent({name:ch,__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,i=r.ref(),{wrapperRef:s,isFocused:a,handleFocus:l,handleBlur:c}=$o(i),{checkboxGroupDisabled:d,isCheckboxGroup:u,isCheckboxSelected:p,handleCheckboxSelect:h}=(()=>{const k=r.inject(ml,void 0),w=r.computed(()=>{var C;return!!((C=k==null?void 0:k.disabled)!=null&&C.value)}),x=r.computed(()=>!!k&&Ve(k==null?void 0:k.handleSelect));return{checkboxGroupCtx:k,checkboxGroupDisabled:w,isCheckboxGroup:x,isCheckboxSelected:C=>{var S;return!xe(C)&>((S=k==null?void 0:k.modelValue)==null?void 0:S.value,C)},handleCheckboxSelect:C=>{k==null||k.handleSelect(C)}}})(),{formId:f,formDisabled:m,validateStyle:g,validateByTrigger:v}=cn({externalDisabled:d}),b=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(k,w)=>(r.openBlock(),r.createElementBlock("div",Lk,[r.createElementVNode("label",{ref_key:"checkboxRef",ref:s,class:r.normalizeClass(["mc-checkbox-wrapper",{"mc-checkbox-disabled":r.unref(m),"mc-checkbox-checked":b.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:i,id:r.unref(f),type:"checkbox",class:"mc-checkbox-input",value:b.value,disabled:r.unref(m),onKeypress:r.withKeys(r.withModifiers(y,["prevent","stop"]),["enter"]),onFocus:w[0]||(w[0]=(...x)=>r.unref(l)&&r.unref(l)(...x)),onBlur:w[1]||(w[1]=(...x)=>r.unref(c)&&r.unref(c)(...x))},null,40,zk),w[2]||(w[2]=r.createElementVNode("div",{class:"mc-checkbox-box"},null,-1)),t.content||k.$slots.default?(r.openBlock(),r.createElementBlock("div",$k,[r.renderSlot(k.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)])):r.createCommentVNode("",!0)],2),t.remarks||k.$slots.remarks?(r.openBlock(),r.createElementBlock("div",Pk,[r.renderSlot(k.$slots,"remarks",{},()=>[r.createTextVNode(r.toDisplayString(t.remarks),1)],!0)])):r.createCommentVNode("",!0)]))}}),io=X(K(jk,[["__scopeId","data-v-7a17545f"]])),Fk=["id"],uh=X(r.defineComponent({name:dh,__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:i,validateByTrigger:s}=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(),s("input")}}),(a,l)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-checkbox-group",id:r.unref(i)},[r.renderSlot(a.$slots,"default")],8,Fk))}})),gl=Symbol("mc-collapse-context"),ph="mc-collapse",Hk={class:"mc-collapse"},hh=X(K(r.defineComponent({name:ph,__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: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",Hk,[r.renderSlot(i.$slots,"default",{},void 0,!0)]))}}),[["__scopeId","data-v-b551884b"]])),fh="mc-icon-plus",Wk=r.defineComponent({name:fh,__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))}}),mh=K(Wk,[["__scopeId","data-v-779c77bf"]]),Bn=X(mh),gh="mc-collapse-item",Kk={class:"mc-collapse-item-header"},qk={class:"mc-collapse-item-title"},Uk={key:0,class:"mc-collapse-item-content"},Jk=r.defineComponent({name:gh,__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)),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",Kk,[r.createElementVNode("span",qk,[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(()=>[s.value?r.withDirectives((r.openBlock(),r.createElementBlock("div",Uk,[r.renderSlot(l.$slots,"default",{isActive:n.value},void 0,!0)],512)),[[r.vShow,n.value]]):r.createCommentVNode("",!0)]),_:3},8,["name"])]))}}),vh=X(K(Jk,[["__scopeId","data-v-4d4a75b5"]])),yh="mc-toast",Gk={key:0,class:"mc-toast-msg-icon"},Yk={key:1,class:"mc-toast-msg-text"},Xk={class:"mc-toast-msg-close-container"},Zk={key:0,class:"mc-toast-countdown"},Qk={key:1,class:"mc-toast-msg-close"},e1={key:0,class:"mc-toast-content-container"},bh=K(r.defineComponent({name:yh,__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",Gk,[r.createVNode(r.unref(ce),{name:s.value},null,8,["name"])])):r.createCommentVNode("",!0),t.message||h.$slots.default?(r.openBlock(),r.createElementBlock("div",Yk,[r.renderSlot(h.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.message),1)],!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",Xk,[a.value?(r.openBlock(),r.createElementBlock("div",Zk,r.toDisplayString(c.value),1)):r.createCommentVNode("",!0),t.closable?(r.openBlock(),r.createElementBlock("div",Qk,[r.createVNode(r.unref(ce),{name:"Cross",onClick:u})])):r.createCommentVNode("",!0)])],2),t.content||h.$slots.content?(r.openBlock(),r.createElementBlock("div",e1,[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 Ki=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 i=Date.now().toString(36)+Math.random().toString(36).slice(2),s=r.createVNode(bh,{...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)}})(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 dn.push(a),{...a}},qi={success:t=>Ki(typeof t=="string"?{message:t,type:"success"}:{...t,type:"success"}),error:t=>Ki(typeof t=="string"?{message:t,type:"error"}:{...t,type:"error"}),warning:t=>Ki(typeof t=="string"?{message:t,type:"warning"}:{...t,type:"warning"}),info:t=>Ki(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=`
|
|
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(bh),wh="mc-copy",t1={class:"mc-copy"},n1={class:"mc-copy-text"},xh=X(K(r.defineComponent({name:wh,__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&&qi.success(n.toastSuccessText)}catch(s){console.error(s),o("error",n.text,s),n.showToast&&qi.error(n.toastErrorText)}};return(s,a)=>(r.openBlock(),r.createElementBlock("div",t1,[r.renderSlot(s.$slots,"default",{},()=>[r.createElementVNode("span",n1,r.toDisplayString(t.text),1)],!0),r.createVNode(r.unref(ce),{name:"Duplicate",class:"mc-copy-icon",onClick:i})]))}}),[["__scopeId","data-v-93e0e595"]])),Ch="mc-count",o1={key:0,class:"mc-count-number"},Sh=X(K(r.defineComponent({name:Ch,__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",o1,r.toDisplayString(a.value),1))],2)):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-58404c8a"]])),Eh="mc-currency-icon",r1={class:"mc-currency-icon-img-wrapper"},i1=["src","alt"],s1={class:"mc-currency-icon-label"},a1={class:"mc-currency-icon-text"},l1=r.defineComponent({name:Eh,__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",r1,[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,i1)],!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",a1,[r.renderSlot(l.$slots,"desc",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.desc),1)],!0)])],2)],4))}}),Mh=X(K(l1,[["__scopeId","data-v-56ce704b"]])),Nh="mc-divider",vl=X(K(r.defineComponent({name:Nh,__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"]])),Bh="mc-overlay",c1=r.defineComponent({name:Bh,__name:"mc-overlay",props:{visible:{type:Boolean},fixed:{type:Boolean,default:!0}},emits:["click"],setup(t,{expose:e,emit:n}){const o=n,i=r.ref();return e({ref:i}),(s,a)=>t.visible?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-overlay",ref_key:"_ref",ref:i,onClick:a[0]||(a[0]=l=>(c=>{c.target===i.value&&o("click")})(l)),style:r.normalizeStyle({position:t.fixed?"fixed":"absolute"})},[r.renderSlot(s.$slots,"default",{},void 0,!0)],4)):r.createCommentVNode("",!0)}}),Ui=X(K(c1,[["__scopeId","data-v-9486332c"]])),Th="mc-reset",yl=X(K(r.defineComponent({name:Th,__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 Ga(n.duration),i.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":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"]])),Oh="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"},bl=X(K(r.defineComponent({name:Oh,__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",d1,[r.createVNode(r.unref(yl),{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",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"]])),_h="mc-title",h1={class:"mc-title-content"},f1={class:"mc-title-text"},m1={class:"mc-title-tool-bar"},Vr=X(K(r.defineComponent({name:_h,__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",h1,[r.renderSlot(s.$slots,"default",{},()=>[r.createElementVNode("h1",f1,r.toDisplayString(t.title),1)],!0)]),r.createElementVNode("div",m1,[r.renderSlot(s.$slots,"tool-bar",{},()=>[t.showToolBar?(r.openBlock(),r.createBlock(r.unref(bl),{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"]])),Ah="mc-modal-header",g1={class:"mc-modal-header"},Ji=X(K(r.defineComponent({name:Ah,__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",g1,[r.createVNode(r.unref(Vr),{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: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"]])),Vh="mc-footer",v1={key:0,class:"mc-footer-content"},y1={class:"mc-footer-bottom"},b1={class:"mc-footer-bottom-content"},k1={class:"mc-footer-left"},w1={class:"mc-footer-right"},x1={class:"mc-footer-right-button-group"},Jo=X(K(r.defineComponent({name:Vh,__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",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",b1,[r.createElementVNode("div",k1,[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"]])),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=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,i=r.ref(!1),s=r.ref(!1),a=r.ref(!1),l=async()=>{i.value=!0,s.value=!0,await r.nextTick(),a.value=!0},c=async()=>{a.value=!1,await r.nextTick(),s.value=!1,await r.nextTick(),i.value=!1,d("close"),d("update:modelValue",!1)};r.watch(()=>o.modelValue,(m,g)=>{!g&&m?l():c()},{immediate:!0,flush:"post"});const d=n,u=()=>{o.maskClosable&&c()},p=()=>{c()},h=r.ref(),f=r.ref();return $o(f,({height:m})=>{const g=h.value;g&&(g.style.paddingBottom=`${m}px`)}),e({ref:h,open:l,close:c}),(m,g)=>i.value?(r.openBlock(),r.createElementBlock("div",C1,[(r.openBlock(),r.createBlock(r.Teleport,{to:t.portCssSelector},[r.createVNode(r.Transition,{name:"mc-drawer-overlay"},{default:r.withCtx(()=>[r.createVNode(r.unref(Ui),{visible:s.value,fixed:t.fixed,onClick:u},{default:r.withCtx(()=>[r.createVNode(r.Transition,{name:`mc-drawer-content-${t.position}`},{default:r.withCtx(()=>[a.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-drawer",[`mc-drawer-${t.size}`,`mc-drawer-${t.position}`]]),ref_key:"_ref",ref:h},[r.createElementVNode("div",S1,[r.renderSlot(m.$slots,"header",{},()=>[r.createVNode(r.unref(Ji),{title:t.title,"show-border":t.showBorder,onClose:p},{default:r.withCtx(()=>[r.renderSlot(m.$slots,"header-title",{},void 0,!0)]),_:3},8,["title","show-border"])],!0)]),r.createElementVNode("div",E1,[r.createElementVNode("div",M1,[r.renderSlot(m.$slots,"default",{},void 0,!0)])]),t.hideFooter?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-drawer-footer",ref_key:"footerRef",ref:f},[r.renderSlot(m.$slots,"footer",{},()=>[r.createVNode(r.unref(Jo),null,{left:r.withCtx(()=>[r.renderSlot(m.$slots,"footer-left",{},void 0,!0)]),right:r.withCtx(()=>[r.renderSlot(m.$slots,"footer-right",{},void 0,!0)]),"right-button-group":r.withCtx(()=>[r.renderSlot(m.$slots,"footer-right-button-group",{},void 0,!0)]),desc:r.withCtx(()=>[r.renderSlot(m.$slots,"footer-desc",{},void 0,!0)]),_:3})],!0)],512))],2)):r.createCommentVNode("",!0)]),_:3},8,["name"])]),_:3},8,["visible","fixed"])]),_:3})],8,["to"]))])):r.createCommentVNode("",!0)}}),Dh=X(K(N1,[["__scopeId","data-v-07bbb569"]])),Ir=Symbol("mc-input-group-context"),Rh="mc-input-group",Lh=t=>{const e=r.inject(Ir,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}},zh="mc-input",B1={key:0,class:"mc-input__prefix"},T1=["id","type","disabled","readonly","autocomplete","placeholder","autofocus","maxlength"],O1={key:2,class:"mc-input__password"},_1={key:0,class:"mc-input__suffix"},A1={key:4,class:"mc-input-append"},V1={class:"mc-input-append-text"},I1=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:i,parser:s}=o,a=n,l=r.ref(),c=r.computed(()=>xe(o.modelValue)?"":qt(o.modelValue)),d=T=>(o.type==="number"?T=(V=>V.replace(/[^\d]/g,""))(T):o.type==="currency"&&(T=((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})(T,o.currencyAccuracy)),Ve(s)&&(T=s(T)),T),u=()=>{const T=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(i)&&(P=i(P)),P);var P;T&&T.value!==V&&(T.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}=cn({externalDisabled:r.computed(()=>!!(E!=null&&E.inputGroupDisabled.value))}),{wrapperRef:k,isFocused:w,handleFocus:x,handleBlur:C}=zo(l,{afterBlur(){y("blur")}}),{isHovering:S}=Op(k),E=Lh({validateStatus:g,isFocused:w,isHovering:S}),M=()=>{a("delete")},N=T=>{a("paste",T)};r.watch(()=>o.currencyAccuracy,()=>{a("update:modelValue",d(c.value))});const{recordCursor:O,setCursor:R}=function(T){const V=r.ref();return{recordCursor:()=>{if(!T.value)return;const{selectionStart:P,selectionEnd:A,value:L}=T.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(!T.value||!V.value)return;const{value:P}=T.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=gi(U);var G=H.length,Q=Y=Y===void 0?G:Vu(Yn(Y),0,G);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=gi(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)}T.value.setSelectionRange(q,q)}}}(l),z=async T=>{const{value:V}=T.target;O(),a("update:modelValue",d(V)),a("input",d(V)),await r.nextTick(),u(),R(),y("input")},_=T=>{const{value:V}=T.target;a("change",d(V))},I=()=>{m.value||(p.value=!p.value)};return r.watch(()=>m.value,T=>{T&&(p.value=!1)}),r.watch(c,()=>{u()}),e({ref:l,focus:async()=>{var T;await r.nextTick(),(T=l.value)==null||T.focus()},blur:async()=>{var T;(T=l.value)==null||T.blur()},select:()=>{var T;(T=l.value)==null||T.select()},clear:()=>{a("update:modelValue",""),a("input",""),a("change",""),a("clear")}}),(T,V)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-input",{"mc-input--disabled":r.unref(m),"mc-input--focused":r.unref(w),"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:k},[T.$slots.prefix||t.prefixIcon?(r.openBlock(),r.createElementBlock("div",B1,[r.renderSlot(T.$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(x)&&r.unref(x)(...P)),onBlur:V[1]||(V[1]=(...P)=>r.unref(C)&&r.unref(C)(...P)),onKeydown:r.withKeys(M,["delete"]),onPaste:N},null,44,T1),r.unref(b)?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mc-input__status",r.unref(v)])},[r.createVNode(r.unref(ce),{name:r.unref(b),size:24},null,8,["name"])],2)):r.createCommentVNode("",!0),t.type==="password"?(r.openBlock(),r.createElementBlock("div",O1,[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},[T.$slots.suffix||t.suffixIcon?(r.openBlock(),r.createElementBlock("div",_1,[r.renderSlot(T.$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)),T.$slots.append?(r.openBlock(),r.createElementBlock("div",A1,[r.createElementVNode("div",V1,[r.renderSlot(T.$slots,"append",{},void 0,!0)])])):r.createCommentVNode("",!0)],6))}}),kl=X(K(I1,[["__scopeId","data-v-83786ea1"]])),D1=["id"],R1={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: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}=lh(),u=r.computed(()=>!o.value&&!i.value&&!n.value||d.value);return r.provide(Ir,{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",R1)):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,D1))}}),[["__scopeId","data-v-a61c5f3e"]])),Ph="mc-lightbox",L1={key:0,class:"mc-lightbox-container"},z1={class:"mc-lightbox-header"},$1={key:0,class:"mc-lightbox-bottom-padding"},P1=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,i=n,s=r.ref(),a=r.ref(),l=r.ref(),c=r.ref(),d=r.ref(!1),u=r.ref(!1),p=r.ref(!1),h=()=>{o.maskClosable&&g()},f=()=>{g()},m=async(b=!0)=>{d.value=!0,u.value=!0,await r.nextTick(),p.value=!0,b&&(i("open"),i("update:modelValue",!0))},g=async(b=!0)=>{p.value=!1,await r.nextTick(),u.value=!1,await r.nextTick(),d.value=!1,b&&(i("close"),i("update:modelValue",!1))};r.watch(()=>o.modelValue,(b,y)=>{!y&&b?m(!1):y&&!b&&g(!1)},{immediate:!0});const v=()=>{var w,x;if(!l.value)return;const b=((w=a.value)==null?void 0:w.offsetHeight)??0,y=.7*window.innerHeight-84-b,k=((x=c.value)==null?void 0:x.offsetHeight)??40;l.value.style.height=`${k>y?y:k}px`};return Tp(()=>{v()}),$o(a,async({height:b})=>{const y=s.value;y&&(y.style.paddingBottom=`${b}px`,await r.nextTick(),v())}),$o(c,()=>{v()}),e({ref:s,open:m,close:g}),(b,y)=>d.value?(r.openBlock(),r.createElementBlock("div",L1,[(r.openBlock(),r.createBlock(r.Teleport,{to:t.portCssSelector},[r.createVNode(r.Transition,{name:"mc-lightbox-overlay"},{default:r.withCtx(()=>[r.createVNode(r.unref(Ui),{visible:u.value,fixed:t.fixed,onClick:h},{default:r.withCtx(()=>[r.createVNode(r.Transition,{name:"mc-lightbox-content"},{default:r.withCtx(()=>[p.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-lightbox",[`mc-lightbox-${t.size}`]]),ref_key:"lightboxRef",ref:s},[r.createElementVNode("div",z1,[r.renderSlot(b.$slots,"header",{},()=>[r.createVNode(r.unref(Ji),{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",{class:"mc-lightbox-content-wrapper",ref_key:"wrapperRef",ref:l},[r.createElementVNode("div",{class:"mc-lightbox-content",style:r.normalizeStyle({minHeight:t.minHeight?`${t.minHeight}px`:void 0}),ref_key:"contentRef",ref:c},[r.renderSlot(b.$slots,"default",{},void 0,!0)],4)],512),r.createElementVNode("div",{class:"mc-lightbox-footer",ref_key:"footerRef",ref:a},[t.hideFooter?(r.openBlock(),r.createElementBlock("div",$1)):r.renderSlot(b.$slots,"footer",{key:1},()=>[r.createVNode(r.unref(Jo),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)],512)],2)):r.createCommentVNode("",!0)]),_:3})]),_:3},8,["visible","fixed"])]),_:3})],8,["to"]))])):r.createCommentVNode("",!0)}}),jh=X(K(P1,[["__scopeId","data-v-3f584a4e"]])),Fh="mc-loading",j1={key:0,class:"mc-loading-pulse"},F1={key:1,class:"mc-loading-spin"},H1={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,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",j1,[...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",F1,[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",H1,r.toDisplayString(t.loadingText),1)],!0):r.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-d1cc3cc8"]])),Hh="mc-removable-tag",W1={class:"mc-removable-tag-content"},K1=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,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",W1,[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(Bn),{key:0,class:"mc-removable-tag-close-icon",name:"cross",cursor:t.disabled?"not-allowed":"pointer",onClick:i},null,8,["cursor"]))],2))}}),xl=X(K(K1,[["__scopeId","data-v-fec756a7"]])),Wh="mc-multi-tag",q1={class:"mc-multi-tag-label"},U1={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,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(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",q1,r.toDisplayString(`${t.label} :`),1),r.createElementVNode("ul",U1,[(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:s(u),onRemove:a},null,8,["label","disabled"]))),128))])],2))}}),[["__scopeId","data-v-0a31c60a"]])),qh="mc-otp",J1=["id"],G1={class:"mc-otp-input-list"},Y1=["onClick"],X1=["onUpdate:modelValue","disabled","onInput","onKeydown"],Z1=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,i=r.ref([]),s=r.reactive(new Array(n.length)),{focusIndex:a,setFocus:l,nextFocus:c,prevFocus:d}=(b=>{const y=r.ref(),k=S=>{y.value=S};$i(b,()=>{xe(y.value)||m("blur"),k(void 0)});const w=be("length"),x=S=>{var O;const E=w.value??0;S<0&&(S=0),S>E-1&&(S=E-1),y.value=S;const M=b.value[S],N=(O=M==null?void 0:M.children)==null?void 0:O[0];N==null||N.focus()},C=be("modelValue");return{focusIndex:y,setFocusIndex:k,setFocus:x,nextFocus:()=>{r.nextTick(()=>{var E;const S=((E=C.value)==null?void 0:E.length)??0;S<(w.value??0)&&x(S)})},prevFocus:()=>{r.nextTick(()=>{var E;const S=((E=C.value)==null?void 0:E.length)??0;S-1>=0&&x(S-1)})}}})(i),{formId:u,formDisabled:p,validateStyle:h,statusIcon:f,validateByTrigger:m}=cn({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",G1,[(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:w=>((x,C)=>{C&&(i.value[x]=C)})(k-1,w),onClick:w=>(async x=>{Ct(s[x])?c():l(x)})(k-1)},[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":w=>s[k-1]=w,class:"mc-otp-input",type:"number",disabled:r.unref(p),onInput:w=>(async(x,C)=>{if(p.value)return;const S=C.target;let E=S.value.slice(0,1);S.value=E,s[x]=E,v(),E&&c()})(k-1,w),onPaste:y[0]||(y[0]=w=>(async x=>{var S;if(x.preventDefault(),p.value)return;const C=((S=x.clipboardData)==null?void 0:S.getData("text").slice(0,n.length))||"";g(C),v(),c()})(w)),onKeydown:[r.withKeys(r.withModifiers(w=>(async x=>{s[x]="",v(),d()})(k-1),["prevent","stop"]),["backspace"]),r.withKeys(r.withModifiers(w=>r.unref(l)(k-2),["prevent","stop"]),["left"]),r.withKeys(r.withModifiers(w=>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,X1),[[r.vModelText,s[k-1]]])],10,Y1))),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,J1))}}),Uh=X(K(Z1,[["__scopeId","data-v-d04352a4"]])),Jh="mc-progress-bar",Q1={key:0,class:"mc-progress-bar-shimmer"},ew={key:0,class:"mc-progress-bar-remarks"},Cl=X(K(r.defineComponent({name:Jh,__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",Q1)):r.createCommentVNode("",!0)],4),u.value?(r.openBlock(),r.createElementBlock("div",ew,[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"]])),Gh="mc-success-icon",so=X(K(r.defineComponent({name:Gh,__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",tw={key:0,class:"mc-progress-indicator-step-num-icon"},nw={key:1},ow=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,i)=>n.value?(r.openBlock(),r.createBlock(r.unref(so),{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",tw,[t.icon?(r.openBlock(),r.createBlock(r.unref(Bn),{key:0,name:t.icon},null,8,["name"])):(r.openBlock(),r.createElementBlock("span",nw,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 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 Sl="mc-progress-indicator-item",rw={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",rw))})),El="mc-progress-indicator-child-item",iw={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",iw))})),sw=(t,e)=>t===0?"first":t===e-1?"last":"middle",Gi=(t,e,n="manual")=>{const o=r.unref(e);if(fp(t==null?void 0:t.success)&&t.success||t!=null&&t.parentStep&&Gi(t.parentStep,e)==="success")return"success";if(!(o&&t&&Li(o.index)&&Li(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(Gi(s,e,n)!=="success"){i=!1;break}if(i)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),aw=["id"],lw={key:0,class:"mc-progress-indicator-step-container"},cw={class:"mc-progress-indicator-step-content"},dw={key:0,class:"mc-progress-indicator-step-content-header"},uw={key:0,class:"mc-progress-indicator-step-content-footer-container"},pw={class:"mc-progress-indicator-step-content-footer"},hw={class:"mc-progress-indicator-step-content-footer-left-container"},fw={key:0,class:"mc-progress-indicator-step-content-footer-left"},mw={class:"mc-progress-indicator-step-content-footer-right-container"},gw={key:0,class:"mc-progress-indicator-step-content-footer-right"},vw=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))),i=r.computed(()=>!!e.step.isChild),s=r.computed(()=>Gi(e.step,e.currentStep,e.successBehavior)),a=r.computed(()=>Gi(e.step.previousStep,e.currentStep,e.successBehavior)),l=r.computed(()=>Li(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(ow,{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",lw,[r.renderSlot(c.$slots,"default",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createElementVNode("div",cw,[t.step.hiddenHeader?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",dw,[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",uw,[r.renderSlot(c.$slots,"content-footer",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createElementVNode("div",pw,[r.createElementVNode("div",hw,[t.step.hiddenFooterLeft?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",fw,[r.renderSlot(c.$slots,"content-footer-left",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},void 0,!0)]))]),r.createElementVNode("div",mw,[t.step.hiddenFooterRight?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",gw,[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,aw))}}),[["__scopeId","data-v-150dfe0a"]]),yw={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,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 w,x=0,C=0;const S=(E,M)=>{de(E)&&E.forEach(N=>{var R,z,_;const O=(R=(N==null?void 0:N.type)||{})==null?void 0:R.name;if(O===Sl){const I=Ro(N.children)||de(N.children)||!Ve((z=N.children)==null?void 0:z.default)?N.children:(_=N.children)==null?void 0:_.default(),T=N.props,V=N.children,P=new Qh(T,V);P.parentIndex=x++,P.index=C++,w&&(P.previousStep=w,w.nextStep=P),w=P,y.push(P),k.set(P.stepKey,P),S(I,P)}else if(O===El){const I=N.props,T=N.children,V=new Qh(I,T);V.index=C++,M&&(M.clearContent(),M.appendChildStep(V),V.parentIndex=M.parentIndex,V.parentStep=M,V.childIndex=M.getChildrenSteps().length),w&&(V.previousStep=w,w.nextStep=V),k.set(V.stepKey,V),y.push(V),w=V}else de(N.children)&&S(N.children,M)})};return S(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=>{xe(d)||i("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",yw,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(s),(p,h)=>(r.openBlock(),r.createBlock(vw,{key:p.stepKey,position:r.unref(sw)(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"]])),Ml=Symbol("mc-radio-group-context"),rf="mc-radio-group",bw=["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:i}=cn();return r.provide(Ml,{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,bw))}}),[["__scopeId","data-v-e40c3cfa"]])),af="mc-radio",kw=["disabled","onKeypress"],ww={class:"mc-radio-wrapper"},xw={class:"mc-radio-content"},Cw={key:0,class:"mc-radio-help"},Sw={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: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}=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: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,kw),r.createElementVNode("div",ww,[m[2]||(m[2]=r.createElementVNode("span",{class:"mc-radio-circle"},null,-1)),r.createElementVNode("div",xw,[r.renderSlot(f.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.label),1)],!0)]),t.help||f.$slots.help?(r.openBlock(),r.createElementBlock("div",Cw,[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",Sw,[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 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=cf(i.content,s.content,n+1);if(a!=null)return a}n+=i.nodeSize}else n+=i.nodeSize}}function df(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=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,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 cf(this,e,n)}findDiffEnd(e,n=this.size,o=e.size){return df(this,e,n,o)}findIndex(e){if(e==0)return Yi(0,e);if(e==this.size)return Yi(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?Yi(n+1,i):Yi(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 Nl={index:0,offset:0};function Yi(t,e){return Nl.index=t,Nl.offset=e,Nl}function Xi(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(!Xi(t[o],e[o]))return!1}else{for(let o in t)if(!(o in e)||!Xi(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 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&&Xi(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 Od.none;if(e instanceof Od)return[e];let n=e.slice();return n.sort((o,i)=>o.type.rank-i.type.rank),n}};Me.none=[];class Zi 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=pf(this.content,e+this.openStart,n);return o&&new J(o,this.openStart,this.openEnd)}removeBetween(e,n){return new J(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 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 uf(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(uf(s.content,e-i-1,n-i-1)))}function pf(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=pf(a.content,e-s-1,n,a);return l&&t.replaceChild(i,a.copy(l))}function Ew(t,e,n){if(n.openStart>t.depth)throw new Zi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Zi("Inconsistent open depths");return hf(t,e,n,0)}function hf(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=hf(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 lo(s,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(s,Qi(t,e,o))}function ff(t,e){if(!e.type.compatibleContent(t.type))throw new Zi("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 Dr(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&&(ao(t.nodeAfter,o),s++));for(let l=s;l<a;l++)ao(i.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,i){let s=t.depth>i&&Bl(t,e,i+1),a=o.depth>i&&Bl(n,o,i+1),l=[];return Dr(null,t,i,l),s&&a&&e.index(i)==n.index(i)?(ff(s,a),ao(lo(s,mf(t,e,n,o,i+1)),l)):(s&&ao(lo(s,Qi(t,e,i+1)),l),Dr(e,n,i,l),a&&ao(lo(a,Qi(n,o,i+1)),l)),Dr(o,null,i,l),new $(l)}function Qi(t,e,n){let o=[];return Dr(null,t,n,o),t.depth>n&&ao(lo(Bl(t,e,n+1),Qi(t,e,n+1)),o),Dr(e,null,n,o),new $(o)}J.empty=new J($.empty,0,0);class Rr{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 es(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 Rr(n,o,s)}static resolveCached(e,n){let o=gf.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 gf.set(e,o=new Mw);let i=o.elts[o.i]=Rr.resolve(e,n);return o.i=(o.i+1)%Nw,i}}class Mw{constructor(){this.elts=[],this.i=0}}const Nw=12,gf=new WeakMap;class es{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 Bw=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&&Xi(this.attrs,n||e.defaultAttrs||Bw)&&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 Ew(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 Rr.resolveCached(this,e)}resolveNoCache(e){return Rr.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()+")"),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,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 ts 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):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 ts(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ts(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 Tw(e,n);if(o.next==null)return co.empty;let i=yf(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]);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(kf);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)}}(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(`
|
|
36
|
+
`,document.head.appendChild(t)})();const kh=X(bh),wh="mc-copy",t1={class:"mc-copy"},n1={class:"mc-copy-text"},xh=X(K(r.defineComponent({name:wh,__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&&qi.success(n.toastSuccessText)}catch(s){console.error(s),o("error",n.text,s),n.showToast&&qi.error(n.toastErrorText)}};return(s,a)=>(r.openBlock(),r.createElementBlock("div",t1,[r.renderSlot(s.$slots,"default",{},()=>[r.createElementVNode("span",n1,r.toDisplayString(t.text),1)],!0),r.createVNode(r.unref(ce),{name:"Duplicate",class:"mc-copy-icon",onClick:i})]))}}),[["__scopeId","data-v-93e0e595"]])),Ch="mc-count",o1={key:0,class:"mc-count-number"},Sh=X(K(r.defineComponent({name:Ch,__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",o1,r.toDisplayString(a.value),1))],2)):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-58404c8a"]])),Eh="mc-currency-icon",r1={class:"mc-currency-icon-img-wrapper"},i1=["src","alt"],s1={class:"mc-currency-icon-label"},a1={class:"mc-currency-icon-text"},l1=r.defineComponent({name:Eh,__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",r1,[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,i1)],!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",a1,[r.renderSlot(l.$slots,"desc",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.desc),1)],!0)])],2)],4))}}),Mh=X(K(l1,[["__scopeId","data-v-56ce704b"]])),Nh="mc-divider",vl=X(K(r.defineComponent({name:Nh,__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"]])),Bh="mc-overlay",c1=r.defineComponent({name:Bh,__name:"mc-overlay",props:{visible:{type:Boolean},fixed:{type:Boolean,default:!0}},emits:["click"],setup(t,{expose:e,emit:n}){const o=n,i=r.ref();return e({ref:i}),(s,a)=>t.visible?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-overlay",ref_key:"_ref",ref:i,onClick:a[0]||(a[0]=l=>(c=>{c.target===i.value&&o("click")})(l)),style:r.normalizeStyle({position:t.fixed?"fixed":"absolute"})},[r.renderSlot(s.$slots,"default",{},void 0,!0)],4)):r.createCommentVNode("",!0)}}),Ui=X(K(c1,[["__scopeId","data-v-9486332c"]])),Th="mc-reset",yl=X(K(r.defineComponent({name:Th,__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 Ga(n.duration),i.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":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"]])),Oh="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"},bl=X(K(r.defineComponent({name:Oh,__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=zo(()=>{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",d1,[r.createVNode(r.unref(yl),{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",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"]])),_h="mc-title",h1={class:"mc-title-content"},f1={class:"mc-title-text"},m1={class:"mc-title-tool-bar"},Vr=X(K(r.defineComponent({name:_h,__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",h1,[r.renderSlot(s.$slots,"default",{},()=>[r.createElementVNode("h1",f1,r.toDisplayString(t.title),1)],!0)]),r.createElementVNode("div",m1,[r.renderSlot(s.$slots,"tool-bar",{},()=>[t.showToolBar?(r.openBlock(),r.createBlock(r.unref(bl),{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"]])),Ah="mc-modal-header",g1={class:"mc-modal-header"},Ji=X(K(r.defineComponent({name:Ah,__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",g1,[r.createVNode(r.unref(Vr),{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: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"]])),Vh="mc-footer",v1={key:0,class:"mc-footer-content"},y1={class:"mc-footer-bottom"},b1={class:"mc-footer-bottom-content"},k1={class:"mc-footer-left"},w1={class:"mc-footer-right"},x1={class:"mc-footer-right-button-group"},Go=X(K(r.defineComponent({name:Vh,__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",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",b1,[r.createElementVNode("div",k1,[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"]])),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=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,i=r.ref(!1),s=r.ref(!1),a=r.ref(!1),l=async()=>{i.value=!0,s.value=!0,await r.nextTick(),a.value=!0},c=async()=>{a.value=!1,await r.nextTick(),s.value=!1,await r.nextTick(),i.value=!1,d("close"),d("update:modelValue",!1)};r.watch(()=>o.modelValue,(m,g)=>{!g&&m?l():c()},{immediate:!0,flush:"post"});const d=n,u=()=>{o.maskClosable&&c()},p=()=>{c()},h=r.ref(),f=r.ref();return Po(f,({height:m})=>{const g=h.value;g&&(g.style.paddingBottom=`${m}px`)}),e({ref:h,open:l,close:c}),(m,g)=>i.value?(r.openBlock(),r.createElementBlock("div",C1,[(r.openBlock(),r.createBlock(r.Teleport,{to:t.portCssSelector},[r.createVNode(r.Transition,{name:"mc-drawer-overlay"},{default:r.withCtx(()=>[r.createVNode(r.unref(Ui),{visible:s.value,fixed:t.fixed,onClick:u},{default:r.withCtx(()=>[r.createVNode(r.Transition,{name:`mc-drawer-content-${t.position}`},{default:r.withCtx(()=>[a.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-drawer",[`mc-drawer-${t.size}`,`mc-drawer-${t.position}`]]),ref_key:"_ref",ref:h},[r.createElementVNode("div",S1,[r.renderSlot(m.$slots,"header",{},()=>[r.createVNode(r.unref(Ji),{title:t.title,"show-border":t.showBorder,onClose:p},{default:r.withCtx(()=>[r.renderSlot(m.$slots,"header-title",{},void 0,!0)]),_:3},8,["title","show-border"])],!0)]),r.createElementVNode("div",E1,[r.createElementVNode("div",M1,[r.renderSlot(m.$slots,"default",{},void 0,!0)])]),t.hideFooter?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-drawer-footer",ref_key:"footerRef",ref:f},[r.renderSlot(m.$slots,"footer",{},()=>[r.createVNode(r.unref(Go),null,{left:r.withCtx(()=>[r.renderSlot(m.$slots,"footer-left",{},void 0,!0)]),right:r.withCtx(()=>[r.renderSlot(m.$slots,"footer-right",{},void 0,!0)]),"right-button-group":r.withCtx(()=>[r.renderSlot(m.$slots,"footer-right-button-group",{},void 0,!0)]),desc:r.withCtx(()=>[r.renderSlot(m.$slots,"footer-desc",{},void 0,!0)]),_:3})],!0)],512))],2)):r.createCommentVNode("",!0)]),_:3},8,["name"])]),_:3},8,["visible","fixed"])]),_:3})],8,["to"]))])):r.createCommentVNode("",!0)}}),Dh=X(K(N1,[["__scopeId","data-v-07bbb569"]])),Ir=Symbol("mc-input-group-context"),Rh="mc-input-group",Lh=t=>{const e=r.inject(Ir,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}},zh="mc-input",B1={key:0,class:"mc-input__prefix"},T1=["id","type","disabled","readonly","autocomplete","placeholder","autofocus","maxlength"],O1={key:2,class:"mc-input__password"},_1={key:0,class:"mc-input__suffix"},A1={key:4,class:"mc-input-append"},V1={class:"mc-input-append-text"},I1=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:i,parser:s}=o,a=n,l=r.ref(),c=r.computed(()=>xe(o.modelValue)?"":qt(o.modelValue)),d=T=>(o.type==="number"?T=(V=>V.replace(/[^\d]/g,""))(T):o.type==="currency"&&(T=((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})(T,o.currencyAccuracy)),Ve(s)&&(T=s(T)),T),u=()=>{const T=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(i)&&(P=i(P)),P);var P;T&&T.value!==V&&(T.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}=cn({externalDisabled:r.computed(()=>!!(E!=null&&E.inputGroupDisabled.value))}),{wrapperRef:k,isFocused:w,handleFocus:x,handleBlur:C}=$o(l,{afterBlur(){y("blur")}}),{isHovering:S}=Op(k),E=Lh({validateStatus:g,isFocused:w,isHovering:S}),M=()=>{a("delete")},N=T=>{a("paste",T)};r.watch(()=>o.currencyAccuracy,()=>{a("update:modelValue",d(c.value))});const{recordCursor:O,setCursor:R}=function(T){const V=r.ref();return{recordCursor:()=>{if(!T.value)return;const{selectionStart:P,selectionEnd:A,value:L}=T.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(!T.value||!V.value)return;const{value:P}=T.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=gi(U);var G=H.length,Q=Y=Y===void 0?G:Vu(Yn(Y),0,G);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=gi(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)}T.value.setSelectionRange(q,q)}}}(l),z=async T=>{const{value:V}=T.target;O(),a("update:modelValue",d(V)),a("input",d(V)),await r.nextTick(),u(),R(),y("input")},_=T=>{const{value:V}=T.target;a("change",d(V))},I=()=>{m.value||(p.value=!p.value)};return r.watch(()=>m.value,T=>{T&&(p.value=!1)}),r.watch(c,()=>{u()}),e({ref:l,focus:async()=>{var T;await r.nextTick(),(T=l.value)==null||T.focus()},blur:async()=>{var T;(T=l.value)==null||T.blur()},select:()=>{var T;(T=l.value)==null||T.select()},clear:()=>{a("update:modelValue",""),a("input",""),a("change",""),a("clear")}}),(T,V)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-input",{"mc-input--disabled":r.unref(m),"mc-input--focused":r.unref(w),"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:k},[T.$slots.prefix||t.prefixIcon?(r.openBlock(),r.createElementBlock("div",B1,[r.renderSlot(T.$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(x)&&r.unref(x)(...P)),onBlur:V[1]||(V[1]=(...P)=>r.unref(C)&&r.unref(C)(...P)),onKeydown:r.withKeys(M,["delete"]),onPaste:N},null,44,T1),r.unref(b)?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mc-input__status",r.unref(v)])},[r.createVNode(r.unref(ce),{name:r.unref(b),size:24},null,8,["name"])],2)):r.createCommentVNode("",!0),t.type==="password"?(r.openBlock(),r.createElementBlock("div",O1,[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},[T.$slots.suffix||t.suffixIcon?(r.openBlock(),r.createElementBlock("div",_1,[r.renderSlot(T.$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)),T.$slots.append?(r.openBlock(),r.createElementBlock("div",A1,[r.createElementVNode("div",V1,[r.renderSlot(T.$slots,"append",{},void 0,!0)])])):r.createCommentVNode("",!0)],6))}}),kl=X(K(I1,[["__scopeId","data-v-83786ea1"]])),D1=["id"],R1={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: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}=lh(),u=r.computed(()=>!o.value&&!i.value&&!n.value||d.value);return r.provide(Ir,{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",R1)):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,D1))}}),[["__scopeId","data-v-a61c5f3e"]])),Ph="mc-lightbox",L1={key:0,class:"mc-lightbox-container"},z1={class:"mc-lightbox-header"},$1={key:0,class:"mc-lightbox-bottom-padding"},P1=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,i=n,s=r.ref(),a=r.ref(),l=r.ref(),c=r.ref(),d=r.ref(!1),u=r.ref(!1),p=r.ref(!1),h=()=>{o.maskClosable&&g()},f=()=>{g()},m=async(b=!0)=>{d.value=!0,u.value=!0,await r.nextTick(),p.value=!0,b&&(i("open"),i("update:modelValue",!0))},g=async(b=!0)=>{p.value=!1,await r.nextTick(),u.value=!1,await r.nextTick(),d.value=!1,b&&(i("close"),i("update:modelValue",!1))};r.watch(()=>o.modelValue,(b,y)=>{!y&&b?m(!1):y&&!b&&g(!1)},{immediate:!0});const v=()=>{var w,x;if(!l.value)return;const b=((w=a.value)==null?void 0:w.offsetHeight)??0,y=.7*window.innerHeight-84-b,k=((x=c.value)==null?void 0:x.offsetHeight)??40;l.value.style.height=`${k>y?y:k}px`};return Tp(()=>{v()}),Po(a,async({height:b})=>{const y=s.value;y&&(y.style.paddingBottom=`${b}px`,await r.nextTick(),v())}),Po(c,()=>{v()}),e({ref:s,open:m,close:g}),(b,y)=>d.value?(r.openBlock(),r.createElementBlock("div",L1,[(r.openBlock(),r.createBlock(r.Teleport,{to:t.portCssSelector},[r.createVNode(r.Transition,{name:"mc-lightbox-overlay"},{default:r.withCtx(()=>[r.createVNode(r.unref(Ui),{visible:u.value,fixed:t.fixed,onClick:h},{default:r.withCtx(()=>[r.createVNode(r.Transition,{name:"mc-lightbox-content"},{default:r.withCtx(()=>[p.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-lightbox",[`mc-lightbox-${t.size}`]]),ref_key:"lightboxRef",ref:s},[r.createElementVNode("div",z1,[r.renderSlot(b.$slots,"header",{},()=>[r.createVNode(r.unref(Ji),{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",{class:"mc-lightbox-content-wrapper",ref_key:"wrapperRef",ref:l},[r.createElementVNode("div",{class:"mc-lightbox-content",style:r.normalizeStyle({minHeight:t.minHeight?`${t.minHeight}px`:void 0}),ref_key:"contentRef",ref:c},[r.renderSlot(b.$slots,"default",{},void 0,!0)],4)],512),r.createElementVNode("div",{class:"mc-lightbox-footer",ref_key:"footerRef",ref:a},[t.hideFooter?(r.openBlock(),r.createElementBlock("div",$1)):r.renderSlot(b.$slots,"footer",{key:1},()=>[r.createVNode(r.unref(Go),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)],512)],2)):r.createCommentVNode("",!0)]),_:3})]),_:3},8,["visible","fixed"])]),_:3})],8,["to"]))])):r.createCommentVNode("",!0)}}),jh=X(K(P1,[["__scopeId","data-v-3f584a4e"]])),Fh="mc-loading",j1={key:0,class:"mc-loading-pulse"},F1={key:1,class:"mc-loading-spin"},H1={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,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",j1,[...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",F1,[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",H1,r.toDisplayString(t.loadingText),1)],!0):r.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-d1cc3cc8"]])),Hh="mc-removable-tag",W1={class:"mc-removable-tag-content"},K1=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,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",W1,[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(Bn),{key:0,class:"mc-removable-tag-close-icon",name:"cross",cursor:t.disabled?"not-allowed":"pointer",onClick:i},null,8,["cursor"]))],2))}}),xl=X(K(K1,[["__scopeId","data-v-fec756a7"]])),Wh="mc-multi-tag",q1={class:"mc-multi-tag-label"},U1={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,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(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",q1,r.toDisplayString(`${t.label} :`),1),r.createElementVNode("ul",U1,[(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:s(u),onRemove:a},null,8,["label","disabled"]))),128))])],2))}}),[["__scopeId","data-v-0a31c60a"]])),qh="mc-otp",J1=["id"],G1={class:"mc-otp-input-list"},Y1=["onClick"],X1=["onUpdate:modelValue","disabled","onInput","onKeydown"],Z1=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,i=r.ref([]),s=r.reactive(new Array(n.length)),{focusIndex:a,setFocus:l,nextFocus:c,prevFocus:d}=(b=>{const y=r.ref(),k=S=>{y.value=S};$i(b,()=>{xe(y.value)||m("blur"),k(void 0)});const w=be("length"),x=S=>{var O;const E=w.value??0;S<0&&(S=0),S>E-1&&(S=E-1),y.value=S;const M=b.value[S],N=(O=M==null?void 0:M.children)==null?void 0:O[0];N==null||N.focus()},C=be("modelValue");return{focusIndex:y,setFocusIndex:k,setFocus:x,nextFocus:()=>{r.nextTick(()=>{var E;const S=((E=C.value)==null?void 0:E.length)??0;S<(w.value??0)&&x(S)})},prevFocus:()=>{r.nextTick(()=>{var E;const S=((E=C.value)==null?void 0:E.length)??0;S-1>=0&&x(S-1)})}}})(i),{formId:u,formDisabled:p,validateStyle:h,statusIcon:f,validateByTrigger:m}=cn({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",G1,[(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:w=>((x,C)=>{C&&(i.value[x]=C)})(k-1,w),onClick:w=>(async x=>{Ct(s[x])?c():l(x)})(k-1)},[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":w=>s[k-1]=w,class:"mc-otp-input",type:"number",disabled:r.unref(p),onInput:w=>(async(x,C)=>{if(p.value)return;const S=C.target;let E=S.value.slice(0,1);S.value=E,s[x]=E,v(),E&&c()})(k-1,w),onPaste:y[0]||(y[0]=w=>(async x=>{var S;if(x.preventDefault(),p.value)return;const C=((S=x.clipboardData)==null?void 0:S.getData("text").slice(0,n.length))||"";g(C),v(),c()})(w)),onKeydown:[r.withKeys(r.withModifiers(w=>(async x=>{s[x]="",v(),d()})(k-1),["prevent","stop"]),["backspace"]),r.withKeys(r.withModifiers(w=>r.unref(l)(k-2),["prevent","stop"]),["left"]),r.withKeys(r.withModifiers(w=>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,X1),[[r.vModelText,s[k-1]]])],10,Y1))),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,J1))}}),Uh=X(K(Z1,[["__scopeId","data-v-d04352a4"]])),Jh="mc-progress-bar",Q1={key:0,class:"mc-progress-bar-shimmer"},ew={key:0,class:"mc-progress-bar-remarks"},Cl=X(K(r.defineComponent({name:Jh,__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",Q1)):r.createCommentVNode("",!0)],4),u.value?(r.openBlock(),r.createElementBlock("div",ew,[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"]])),Gh="mc-success-icon",so=X(K(r.defineComponent({name:Gh,__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",tw={key:0,class:"mc-progress-indicator-step-num-icon"},nw={key:1},ow=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,i)=>n.value?(r.openBlock(),r.createBlock(r.unref(so),{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",tw,[t.icon?(r.openBlock(),r.createBlock(r.unref(Bn),{key:0,name:t.icon},null,8,["name"])):(r.openBlock(),r.createElementBlock("span",nw,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 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 Sl="mc-progress-indicator-item",rw={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",rw))})),El="mc-progress-indicator-child-item",iw={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",iw))})),sw=(t,e)=>t===0?"first":t===e-1?"last":"middle",Gi=(t,e,n="manual")=>{const o=r.unref(e);if(fp(t==null?void 0:t.success)&&t.success||t!=null&&t.parentStep&&Gi(t.parentStep,e)==="success")return"success";if(!(o&&t&&Li(o.index)&&Li(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(Gi(s,e,n)!=="success"){i=!1;break}if(i)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),aw=["id"],lw={key:0,class:"mc-progress-indicator-step-container"},cw={class:"mc-progress-indicator-step-content"},dw={key:0,class:"mc-progress-indicator-step-content-header"},uw={key:0,class:"mc-progress-indicator-step-content-footer-container"},pw={class:"mc-progress-indicator-step-content-footer"},hw={class:"mc-progress-indicator-step-content-footer-left-container"},fw={key:0,class:"mc-progress-indicator-step-content-footer-left"},mw={class:"mc-progress-indicator-step-content-footer-right-container"},gw={key:0,class:"mc-progress-indicator-step-content-footer-right"},vw=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))),i=r.computed(()=>!!e.step.isChild),s=r.computed(()=>Gi(e.step,e.currentStep,e.successBehavior)),a=r.computed(()=>Gi(e.step.previousStep,e.currentStep,e.successBehavior)),l=r.computed(()=>Li(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(ow,{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",lw,[r.renderSlot(c.$slots,"default",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createElementVNode("div",cw,[t.step.hiddenHeader?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",dw,[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",uw,[r.renderSlot(c.$slots,"content-footer",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createElementVNode("div",pw,[r.createElementVNode("div",hw,[t.step.hiddenFooterLeft?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",fw,[r.renderSlot(c.$slots,"content-footer-left",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},void 0,!0)]))]),r.createElementVNode("div",mw,[t.step.hiddenFooterRight?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",gw,[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,aw))}}),[["__scopeId","data-v-150dfe0a"]]),yw={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,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 w,x=0,C=0;const S=(E,M)=>{de(E)&&E.forEach(N=>{var R,z,_;const O=(R=(N==null?void 0:N.type)||{})==null?void 0:R.name;if(O===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(),T=N.props,V=N.children,P=new Qh(T,V);P.parentIndex=x++,P.index=C++,w&&(P.previousStep=w,w.nextStep=P),w=P,y.push(P),k.set(P.stepKey,P),S(I,P)}else if(O===El){const I=N.props,T=N.children,V=new Qh(I,T);V.index=C++,M&&(M.clearContent(),M.appendChildStep(V),V.parentIndex=M.parentIndex,V.parentStep=M,V.childIndex=M.getChildrenSteps().length),w&&(V.previousStep=w,w.nextStep=V),k.set(V.stepKey,V),y.push(V),w=V}else de(N.children)&&S(N.children,M)})};return S(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=>{xe(d)||i("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",yw,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(s),(p,h)=>(r.openBlock(),r.createBlock(vw,{key:p.stepKey,position:r.unref(sw)(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"]])),Ml=Symbol("mc-radio-group-context"),rf="mc-radio-group",bw=["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:i}=cn();return r.provide(Ml,{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,bw))}}),[["__scopeId","data-v-e40c3cfa"]])),af="mc-radio",kw=["disabled","onKeypress"],ww={class:"mc-radio-wrapper"},xw={class:"mc-radio-content"},Cw={key:0,class:"mc-radio-help"},Sw={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:i,isFocused:s,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: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,kw),r.createElementVNode("div",ww,[m[2]||(m[2]=r.createElementVNode("span",{class:"mc-radio-circle"},null,-1)),r.createElementVNode("div",xw,[r.renderSlot(f.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.label),1)],!0)]),t.help||f.$slots.help?(r.openBlock(),r.createElementBlock("div",Cw,[r.renderSlot(f.$slots,"help",{},()=>[r.createVNode(r.unref(Jo),{content:t.help,"icon-size":24},null,8,["content"])],!0)])):r.createCommentVNode("",!0)])],2),r.createElementVNode("div",Sw,[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 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=cf(i.content,s.content,n+1);if(a!=null)return a}n+=i.nodeSize}else n+=i.nodeSize}}function df(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=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,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 cf(this,e,n)}findDiffEnd(e,n=this.size,o=e.size){return df(this,e,n,o)}findIndex(e){if(e==0)return Yi(0,e);if(e==this.size)return Yi(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?Yi(n+1,i):Yi(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 Nl={index:0,offset:0};function Yi(t,e){return Nl.index=t,Nl.offset=e,Nl}function Xi(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(!Xi(t[o],e[o]))return!1}else{for(let o in t)if(!(o in e)||!Xi(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 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&&Xi(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 Od.none;if(e instanceof Od)return[e];let n=e.slice();return n.sort((o,i)=>o.type.rank-i.type.rank),n}};Me.none=[];class Zi 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=pf(this.content,e+this.openStart,n);return o&&new J(o,this.openStart,this.openEnd)}removeBetween(e,n){return new J(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 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 uf(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(uf(s.content,e-i-1,n-i-1)))}function pf(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=pf(a.content,e-s-1,n,a);return l&&t.replaceChild(i,a.copy(l))}function Ew(t,e,n){if(n.openStart>t.depth)throw new Zi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Zi("Inconsistent open depths");return hf(t,e,n,0)}function hf(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=hf(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 lo(s,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(s,Qi(t,e,o))}function ff(t,e){if(!e.type.compatibleContent(t.type))throw new Zi("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 Dr(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&&(ao(t.nodeAfter,o),s++));for(let l=s;l<a;l++)ao(i.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,i){let s=t.depth>i&&Bl(t,e,i+1),a=o.depth>i&&Bl(n,o,i+1),l=[];return Dr(null,t,i,l),s&&a&&e.index(i)==n.index(i)?(ff(s,a),ao(lo(s,mf(t,e,n,o,i+1)),l)):(s&&ao(lo(s,Qi(t,e,i+1)),l),Dr(e,n,i,l),a&&ao(lo(a,Qi(n,o,i+1)),l)),Dr(o,null,i,l),new $(l)}function Qi(t,e,n){let o=[];return Dr(null,t,n,o),t.depth>n&&ao(lo(Bl(t,e,n+1),Qi(t,e,n+1)),o),Dr(e,null,n,o),new $(o)}J.empty=new J($.empty,0,0);class Rr{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 es(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 Rr(n,o,s)}static resolveCached(e,n){let o=gf.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 gf.set(e,o=new Mw);let i=o.elts[o.i]=Rr.resolve(e,n);return o.i=(o.i+1)%Nw,i}}class Mw{constructor(){this.elts=[],this.i=0}}const Nw=12,gf=new WeakMap;class es{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 Bw=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&&Xi(this.attrs,n||e.defaultAttrs||Bw)&&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 Ew(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 Rr.resolveCached(this,e)}resolveNoCache(e){return Rr.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()+")"),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,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 ts 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):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 ts(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ts(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 Tw(e,n);if(o.next==null)return co.empty;let i=yf(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]);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(kf);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)}}(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
37
|
`)}}co.empty=new co(!0);class Tw{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(Ow(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Ow(t){let e=[];do e.push(_w(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function _w(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(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=Aw(t,e)}return e}function bf(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Aw(t,e){let n=bf(t),o=n;return t.eat(",")&&(o=t.next!="}"?bf(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:o,expr:e}}function kf(t,e){return e-t}function wf(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(kf)}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 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 Sf(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 Ef(t,e){let n=Object.create(null);if(e)for(let o in e)n[o]=new Vw(t,o,e[o]);return n}let Mf=class iy{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 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){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((s,a)=>o[s]=new iy(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 Vw{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 ns{constructor(e,n,o,i){this.name=e,this.rank=n,this.schema=o,this.spec=i,this.attrs=Ef(e,i.attrs),this.excluded=null;let s=xf(this.attrs);this.instance=s?new Me(this,s):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),i=0;return e.forEach((s,a)=>o[s]=new ns(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){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 i in e)n[i]=e[i];n.nodes=Qe.from(e.nodes),n.marks=Qe.from(e.marks||{}),this.nodes=Mf.compile(this.spec.nodes,this),this.marks=ns.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]=co.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?Bf(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==""?[]:Bf(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 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,i)}text(e,n){let o=this.nodes.text;return new ts(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 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 Tn{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 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),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(Dw(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=Vf(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=Vf(a)),a.node||a.ignore||a.mark||(a.node=i)})}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},Iw={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,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&&!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 i,s=n.topNode,a=_f(null,n.preserveWhitespace,0)|(o?4:0);i=s?new Tl(s.type,s.attrs,Me.none,!0,n.topMatch||s.type.contentMatch,a):new Tl(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
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();Of.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&&Of.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:Iw.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(Tf.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):If(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=_f(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):If(d.type,e))||(c=d.addToSet(c),!1)),this.nodes.push(new Tl(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 Dw(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 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 uo{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},o){o||(o=Ol(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}=rs(Ol(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&&rs(Ol(o),i(e,n),null,e.attrs)}static renderSpec(e,n,o=null,i){return rs(e,n,o,i)}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 rs(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=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 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}=rs(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 Rw(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 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))/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 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:Rw(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)}i+=u-d}return o?e+i:new _l(e+i,0,null)}touches(e,n){let o=0,i=zf(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 Lr{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 Lr(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 Lr;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 _l(e,i,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,i){try{return We.ok(e.replace(n,o,i))}catch(s){if(s instanceof Zi)return We.fail(s.message);throw s}}}function Vl(t,e,n){let o=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(Vl(s.content,e,s))),s.isInline&&(s=e(s,n,i)),o.push(s)}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),i=o.node(o.sharedDepth(this.to)),s=new J(Vl(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 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 J(Vl(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 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 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 _n(this.pos,n.marks[i]);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 J($.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 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&&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 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&&(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 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 Il(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 Dl(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 Lw(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||!Lw(o,i,s))break}return null}function Rl(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($f).concat({type:e,attrs:n}).concat(s.map($f)):null}function $f(t){return{type:t,attrs:null}}function Pf(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 jf(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 un(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 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 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 is(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&&Ff(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 Hf(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 ss(t,e,n=e,o=J.empty){if(e==n&&!o.size)return null;let i=t.resolve(e),s=t.resolve(n);return Wf(i,s,o)?new Je(e,n,o):new zw(i,s,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",Ge);class zw{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=Ll(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=Ll(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=Ll(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new J(zr(e,n-1,1),n-1,s?n-1:o)}else this.unplaced=new J(zr(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(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=$r(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(zr(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new J(zr(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,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=zl(e,n,i,o,s);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: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=$r(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=$r(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=$r(this.placed,this.frontier.length,e))}}function zr(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(zr(t.firstChild.content,e-1,n)))}function $r(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy($r(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,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 $w(t){return t.spec.defining||t.spec.definingForContent}function qf(t,e,n,o,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(qf(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 Pr 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 Pr(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 Pr(n.attr,n.value)}}rt.jsonID("docAttr",Pr);let jr=class extends Error{};jr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(jr.prototype=Object.create(Error.prototype)).constructor=jr,jr.prototype.name="TransformError";class Jf{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Lr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new jr(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=ss(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(Wf(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=$w(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 w=u[(k+h)%u.length],x=!0;w<0&&(x=!1,w=-w);let C=c.node(w-1),S=c.index(w-1);if(C.canReplaceWith(S,S,y.type,y.marks))return i.replace(c.before(w),x?d.after(w):a,new J(qf(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);jf(o,f.node(),f.before(),u)}d.inlineContent&&Dl(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);Pf(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&&jf(s,p,h,u),Dl(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&&Pf(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 Pr(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 i,s=o.marks,a=[];for(;i=n.isInSet(s);)a.push(new po(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 On(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 ns){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 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 Pw(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&&Xf(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),Xf(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=$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 se.between(this.$anchor,this.$head).getBookmark()}}pe.prototype.visible=!0;class Pw{constructor(e,n){this.$from=e,this.$to=n}}let Gf=!1;function Yf(t){Gf||t.parent.inlineContent||(Gf=!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){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 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 as(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 as{constructor(e,n){this.anchor=e,this.head=n}map(e){return new as(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 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 as(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=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 jw}}pe.jsonID("all",Nt);const jw={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 Xf(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 Fw extends Jf{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 Zf(t,e){return e&&t?t.bind(e):t}class Fr{constructor(e,n,o){this.name=e,this.init=Zf(n.init,o),this.apply=Zf(n.apply,o)}}const Hw=[new Fr("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new Fr("selection",{init:(t,e)=>t.selection||pe.atStart(e.doc),apply:t=>t.selection}),new Fr("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,o)=>o.selection.$cursor?t.storedMarks:null}),new Fr("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=Hw.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 Fr(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 Fw(this)}static create(e){let n=new jl(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 jl(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 jl(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 Qf(t,e,n){for(let o in t){let i=t[o];i instanceof Function?i=i.bind(e):o=="handleDOMEvents"&&(i=Qf(i,e,{})),n[o]=i}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 i=Wl(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(um(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=ss(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 om(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=ss(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 rm=(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=Wl(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 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 im(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const sm=(t,e,n)=>{let o=im(t,n);if(!o)return!1;let i=Kl(o);if(!i)return!1;let s=i.nodeAfter;if(um(t,i,e,1))return!0;if(o.parent.content.size==0&&(Qo(s,"start")||ne.isSelectable(s))){let a=ss(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))},am=(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=Kl(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 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:i}=n;if(n instanceof Nt||o.parent.inlineContent||i.parent.inlineContent)return!1;let s=ql(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},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 s=n.before();if(un(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 um(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&&!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&&(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&&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&&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 pm(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 Ww=pm(-1),Kw=pm(1);function hm(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(Hl,nm,rm),Ul(Hl,sm,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 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=ql(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=un(d.doc,u,a.length,a);if(p||(a[0]=s?{type:s}:null,p=un(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 Jl=null;const pn=function(t,e,n){let o=Jl||(Jl=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))},qw=/^(img|br|input|textarea|hr)$/i;function fm(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||Hr(t)||qw.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 Hr(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 ls=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||"",Gl=/Edge\/(\d+)/.exec(Vn),gm=/MSIE \d/.exec(Vn),Yl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Vn),yt=!!(gm||Yl||Gl),In=gm?document.documentMode:Yl?+Yl[1]:Gl?+Gl[1]:0,It=!yt&&/gecko\/(\d+)/i.test(Vn);It&&(/Firefox\/(\d+)/.exec(Vn)||[0,0])[1];const Xl=!yt&&/Chrome\/(\d+)/.exec(Vn),it=!!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),Uw=!!Xt&&/Win/.test(Xt.platform),hn=/Android \d/.test(Vn),Wr=!!mm&&"webkitFontSmoothing"in mm.documentElement.style,Jw=Wr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Gw(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 Yw(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,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?Gw(s):Yw(l),u=0,p=0;if(e.top<d.top+fn(o,"top")?p=-(d.top-e.top+fn(i,"top")):e.bottom>d.bottom-fn(o,"bottom")&&(p=e.bottom-e.top>d.bottom-d.top?e.top+fn(i,"top")-d.top:e.bottom-d.bottom+fn(i,"bottom")),e.left<d.left+fn(o,"left")?u=-(d.left-e.left+fn(i,"left")):e.right>d.right-fn(o,"right")&&(u=e.right-d.right+fn(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 bm(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 km(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 wm(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=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&&!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=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 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(Zl(e,d))return xm(a,e,d)}}if((s=(s+1)%o)==i)break}return t}function Xw(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(!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&&(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;Wr&&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}=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 Zw=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Sm(t,e,n){let{node:o,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),a=Wr||It;if(o.nodeType==3){if(!a||!Zw.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++,Kr(Dn(pn(o,l,c),d),d<0)}{let l=Dn(pn(o,i,i),n);if(It&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){let c=Dn(pn(o,i-1,i-1),-1);if(c.top==l.top){let d=Dn(pn(o,i,i+1),-1);if(d.top!=l.top)return Kr(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 Ql(l.getBoundingClientRect(),!1)}if(s==null&&i<Vt(o)){let l=o.childNodes[i];if(l.nodeType==1)return Ql(l.getBoundingClientRect(),!0)}return Ql(o.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==Vt(o))){let l=o.childNodes[i-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 Kr(Dn(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?pn(l,0,a?0:1):l.nodeType==1?l:null:null;if(c)return Kr(Dn(c,-1),!0)}return Kr(Dn(o.nodeType==3?pn(o):o,-n),n>=0)}function Kr(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,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 Qw=/[\u0590-\u08ac]/;let Mm=null,Nm=null,Bm=!1;class qr{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 _m){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 Tm&&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)&&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,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 Tm extends qr{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 ex extends qr{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 mo extends qr{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=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 i=mo.create(this.parent,this.mark,!0,o),s=this.children,a=this.size;n<a&&(s=tc(s,n,a,o)),e>0&&(s=tc(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 Rn extends qr{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}=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 tx(e,n,o,i,u,p||null,h,d,s,a+1):n.isText?new cs(e,n,o,i,u,h,s):new Rn(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)&&ds(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 ox(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,w,x,C;for(;g<f.length&&f[g].to==m;){let E=f[g++];E.widget&&(k?(w||(w=[k])).push(E):k=E)}if(k)if(w){w.sort(rx);for(let E=0;E<w.length;E++)p(w[E],y,!!b)}else p(k,y,!!b);if(b)C=-1,x=b,b=null;else{if(!(y<d.childCount))break;C=y,x=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+x.nodeSize;if(x.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&&(b=x.cut(E-m),x=x.cut(0,E-m),S=E,C=-1)}else for(;g<f.length&&f[g].to<S;)g++;h(x,x.isInline&&!x.isLeaf?v.filter(E=>!E.inline):v.slice(),u.forChild(m,x),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,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),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: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 ex(this,s,n,i);e.input.compositionNodes.push(a),this.children=tc(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(ds(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,i){Im(o,e,t);let s=new Rn(void 0,t,e,n,o,o,o,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class cs extends Rn{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 cs(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 _m extends qr{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 tx extends Rn{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 Am(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=Dm(o),i=!0;o=o.nextSibling}else i=!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),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Ur=function(t){t&&(this.nodeName=t)};Ur.prototype=Object.create(null);const go=[new Ur];function ec(t,e,n){if(t.length==0)return go;let o=n?go[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 Vm(t,e,n,o){if(n==go&&o==go)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=go[0]),i=c}nx(i,l||go[0],a)}return i}function nx(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 Im(t,e,n){return Vm(t,t,go,ec(e,n,t.nodeType!=1))}function ds(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 ox{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 mo)){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=mo.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 Rn){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&&ds(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)||!ds(o,e.outerDeco)||!i.eq(e.innerDeco))return null;let l=Rn.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=Rn.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 Tm(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 mo;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof cs)||/\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 _m(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 rx(t,e){return t.type.side-e.type.side}function tc(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 nc(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(ls(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=rc(t,u,d,e=="pointer"||t.state.selection.head<d.pos&&!s?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&&it){let o=t.domSelectionRange(),i=t.domObserver.currentSelection;if(o.anchorNode&&i.anchorNode&&ho(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&&In<=11&&(s.disabled=!0,s.disabled=!1)})(t);else{let o,i,{anchor:s,head:a}=n;!Lm||n instanceof se||(n.$from.parent.inlineContent||(o=zm(t,n.from)),n.empty||n.$from.parent.inlineContent||(i=zm(t,n.to))),t.docView.setSelection(s,a,t,e),Lm&&(o&&$m(o),i&&$m(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(()=>{Rm(l)&&!l.state.selection.visible||l.dom.classList.remove("ProseMirror-hideselection")},20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Lm=dt||it&&vm<63;function zm(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 oc(i);if(!(i&&i.contentEditable!="false"||s&&s.contentEditable!="false")){if(i)return oc(i);if(s)return oc(s)}}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",i=>i(t,e,n))||se.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 ic(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 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 se)){if(o instanceof ne&&o.node.isInline)return Ln(t,new se(e>0?o.$to:o.$from));{let i=ic(t.state,e);return!!i&&Ln(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 Ln(t,new se(o.$anchor,a))}if(!o.empty)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let i=ic(t.state,e);return!!(i&&i instanceof ne)&&Ln(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)?Ln(t,new ne(e<0?t.state.doc.resolve(s.pos-a.nodeSize):s)):!!Wr&&Ln(t,new se(t.state.doc.resolve(e<0?l:l+a.nodeSize))))}}function us(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Jr(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<us(i)&&Jr(i.childNodes[s],-1)&&(c=!0);;)if(s>0){if(i.nodeType!=1)break;{let d=i.childNodes[s-1];if(Jr(d,-1))a=i,l=--s;else{if(d.nodeType!=3)break;i=d,s=i.nodeValue.length}}}else{if(Km(i))break;{let d=i.previousSibling;for(;d&&Jr(d,-1);)a=i.parentNode,l=et(d),d=d.previousSibling;if(d)i=d,s=us(i);else{if(i=i.parentNode,i==n.dom)break;s=0}}}c?sc(n,i,s):a&&sc(n,a,l)}(t):function(n){let o=n.domSelectionRange(),i=o.focusNode,s=o.focusOffset;if(!i)return;let a,l,c=us(i);for(;;)if(s<c){if(i.nodeType!=1||!Jr(i.childNodes[s],1))break;a=i,l=++s}else{if(Km(i))break;{let d=i.nextSibling;for(;d&&Jr(d,1);)a=d.parentNode,l=et(d)+1,d=d.nextSibling;if(d)i=d,s=0,c=us(i);else{if(i=i.parentNode,i==n.dom)break;s=c=0}}}a&&sc(n,a,l)}(t)}function Km(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function sc(t,e,n){if(e.nodeType!=3){let s,a;(a=function(l,c){for(;l&&c==l.childNodes.length&&!Hr(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&&!Hr(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(ls(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&&mn(t)},50)}function qm(t,e){let n=t.state.doc.resolve(e);if(!it&&!Uw&&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=ic(t.state,e);if(a&&a instanceof ne)return Ln(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&&Ln(t,l)}return!1}function Jm(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 Gm(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: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")||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",`${i} ${s}${p?` -${p}`:""} ${JSON.stringify(n)}`),{dom:c,text:t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
|
|
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):If(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=_f(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):If(d.type,e))||(c=d.addToSet(c),!1)),this.nodes.push(new Tl(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 Dw(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 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 uo{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},o){o||(o=Ol(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}=rs(Ol(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&&rs(Ol(o),i(e,n),null,e.attrs)}static renderSpec(e,n,o=null,i){return rs(e,n,o,i)}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 rs(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=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 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}=rs(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 Rw(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 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))/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 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:Rw(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)}i+=u-d}return o?e+i:new _l(e+i,0,null)}touches(e,n){let o=0,i=zf(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 Lr{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 Lr(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 Lr;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 _l(e,i,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,i){try{return We.ok(e.replace(n,o,i))}catch(s){if(s instanceof Zi)return We.fail(s.message);throw s}}}function Vl(t,e,n){let o=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(Vl(s.content,e,s))),s.isInline&&(s=e(s,n,i)),o.push(s)}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),i=o.node(o.sharedDepth(this.to)),s=new J(Vl(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 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 J(Vl(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 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 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 _n(this.pos,n.marks[i]);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 J($.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 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&&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 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&&(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 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 Il(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 Dl(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 Lw(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Yo(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||!Lw(o,i,s))break}return null}function Rl(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($f).concat({type:e,attrs:n}).concat(s.map($f)):null}function $f(t){return{type:t,attrs:null}}function Pf(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 jf(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 un(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 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 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 is(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&&Ff(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 Hf(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 ss(t,e,n=e,o=J.empty){if(e==n&&!o.size)return null;let i=t.resolve(e),s=t.resolve(n);return Wf(i,s,o)?new Je(e,n,o):new zw(i,s,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",Ge);class zw{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=Ll(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=Ll(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=Ll(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new J(zr(e,n-1,1),n-1,s?n-1:o)}else this.unplaced=new J(zr(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(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=$r(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(zr(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new J(zr(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,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=zl(e,n,i,o,s);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: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=$r(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=$r(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=$r(this.placed,this.frontier.length,e))}}function zr(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(zr(t.firstChild.content,e-1,n)))}function $r(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy($r(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,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 $w(t){return t.spec.defining||t.spec.definingForContent}function qf(t,e,n,o,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(qf(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 Xo 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 Xo(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 Xo(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 Xo(n.pos,n.attr,n.value)}}rt.jsonID("attr",Xo);class Pr 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 Pr(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 Pr(n.attr,n.value)}}rt.jsonID("docAttr",Pr);let jr=class extends Error{};jr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(jr.prototype=Object.create(Error.prototype)).constructor=jr,jr.prototype.name="TransformError";class Jf{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Lr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new jr(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=ss(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(Wf(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=$w(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 w=u[(k+h)%u.length],x=!0;w<0&&(x=!1,w=-w);let C=c.node(w-1),S=c.index(w-1);if(C.canReplaceWith(S,S,y.type,y.marks))return i.replace(c.before(w),x?d.after(w):a,new J(qf(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);jf(o,f.node(),f.before(),u)}d.inlineContent&&Dl(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);Pf(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&&jf(s,p,h,u),Dl(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&&Pf(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 Xo(e,n,o)),this}setDocAttribute(e,n){return this.step(new Pr(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 i,s=o.marks,a=[];for(;i=n.isInSet(s);)a.push(new po(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 On(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 ns){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 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 Pw(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&&Xf(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),Xf(e,o,n.isInline?-1:1))}}static findFrom(e,n,o=!1){let i=e.parent.inlineContent?new se(e):Zo(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?Zo(e.node(0),e.node(s),e.before(s+1),e.index(s),n,o):Zo(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 Zo(e,e,0,0,1)||new Nt(e)}static atEnd(e){return Zo(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 se.between(this.$anchor,this.$head).getBookmark()}}pe.prototype.visible=!0;class Pw{constructor(e,n){this.$from=e,this.$to=n}}let Gf=!1;function Yf(t){Gf||t.parent.inlineContent||(Gf=!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){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 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 as(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 as{constructor(e,n){this.anchor=e,this.head=n}map(e){return new as(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 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 as(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=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 jw}}pe.jsonID("all",Nt);const jw={map(){return this},resolve:t=>new Nt(t)};function Zo(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=Zo(t,l,n+i,i<0?l.childCount:0,i,s);if(c)return c}n+=l.nodeSize*i}return null}function Xf(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 Fw extends Jf{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 Zf(t,e){return e&&t?t.bind(e):t}class Fr{constructor(e,n,o){this.name=e,this.init=Zf(n.init,o),this.apply=Zf(n.apply,o)}}const Hw=[new Fr("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new Fr("selection",{init:(t,e)=>t.selection||pe.atStart(e.doc),apply:t=>t.selection}),new Fr("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,o)=>o.selection.$cursor?t.storedMarks:null}),new Fr("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=Hw.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 Fr(o.key,o.spec.state,o))})}}class Qo{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 Qo(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 Fw(this)}static create(e){let n=new jl(e.doc?e.doc.type.schema:e.schema,e.plugins),o=new Qo(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 jl(this.schema,e.plugins),o=n.fields,i=new Qo(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 jl(e.schema,e.plugins),s=new Qo(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 Qf(t,e,n){for(let o in t){let i=t[o];i instanceof Function?i=i.bind(e):o=="handleDOMEvents"&&(i=Qf(i,e,{})),n[o]=i}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 i=Wl(o);if(!i){let a=o.blockRange(),l=a&&Yo(a);return l!=null&&(e&&e(t.tr.lift(a,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(um(t,i,e,-1))return!0;if(o.parent.content.size==0&&(er(s,"end")||ne.isSelectable(s)))for(let a=o.depth;;a--){let l=ss(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(er(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 om(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=ss(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 er(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: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=Wl(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 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 im(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const sm=(t,e,n)=>{let o=im(t,n);if(!o)return!1;let i=Kl(o);if(!i)return!1;let s=i.nodeAfter;if(um(t,i,e,1))return!0;if(o.parent.content.size==0&&(er(s,"start")||ne.isSelectable(s))){let a=ss(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(er(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))},am=(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=Kl(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 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:i}=n;if(n instanceof Nt||o.parent.inlineContent||i.parent.inlineContent)return!1;let s=ql(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},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 s=n.before();if(un(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let o=n.blockRange(),i=o&&Yo(o);return i!=null&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)};function um(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&&!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&&(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&&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&&Yo(p);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(p,h).scrollIntoView()),!0;if(d&&er(l,"start",!0)&&er(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 pm(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 Ww=pm(-1),Kw=pm(1);function hm(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(Hl,nm,rm),Ul(Hl,sm,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 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=ql(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=un(d.doc,u,a.length,a);if(p||(a[0]=s?{type:s}:null,p=un(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},tr=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Jl=null;const pn=function(t,e,n){let o=Jl||(Jl=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))},qw=/^(img|br|input|textarea|hr)$/i;function fm(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||Hr(t)||qw.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 Hr(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 ls=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||"",Gl=/Edge\/(\d+)/.exec(Vn),gm=/MSIE \d/.exec(Vn),Yl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Vn),yt=!!(gm||Yl||Gl),In=gm?document.documentMode:Yl?+Yl[1]:Gl?+Gl[1]:0,It=!yt&&/gecko\/(\d+)/i.test(Vn);It&&(/Firefox\/(\d+)/.exec(Vn)||[0,0])[1];const Xl=!yt&&/Chrome\/(\d+)/.exec(Vn),it=!!Xl,vm=Xl?+Xl[1]:0,dt=!yt&&!!Xt&&/Apple Computer/.test(Xt.vendor),nr=dt&&(/Mobile\/\w+/.test(Vn)||!!Xt&&Xt.maxTouchPoints>2),Dt=nr||!!Xt&&/Mac/.test(Xt.platform),Uw=!!Xt&&/Win/.test(Xt.platform),hn=/Android \d/.test(Vn),Wr=!!mm&&"webkitFontSmoothing"in mm.documentElement.style,Jw=Wr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Gw(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 Yw(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,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let a=n||t.dom;a;){if(a.nodeType!=1){a=tr(a);continue}let l=a,c=l==s.body,d=c?Gw(s):Yw(l),u=0,p=0;if(e.top<d.top+fn(o,"top")?p=-(d.top-e.top+fn(i,"top")):e.bottom>d.bottom-fn(o,"bottom")&&(p=e.bottom-e.top>d.bottom-d.top?e.top+fn(i,"top")-d.top:e.bottom-d.bottom+fn(i,"bottom")),e.left<d.left+fn(o,"left")?u=-(d.left-e.left+fn(i,"left")):e.right>d.right-fn(o,"right")&&(u=e.right-d.right+fn(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:tr(a)}}function bm(t){let e=[],n=t.ownerDocument;for(let o=t;o&&(e.push({dom:o,top:o.scrollTop,left:o.scrollLeft}),t!=n);o=tr(o));return e}function km(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 or=null;function wm(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=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&&!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=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 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(Zl(e,d))return xm(a,e,d)}}if((s=(s+1)%o)==i)break}return t}function Xw(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(!Zl(e,d)||(l=xm(t.dom,e,d),!l))return null}if(dt)for(let d=l;n&&d;d=tr(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;Wr&&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}=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 Zw=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Sm(t,e,n){let{node:o,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),a=Wr||It;if(o.nodeType==3){if(!a||!Zw.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++,Kr(Dn(pn(o,l,c),d),d<0)}{let l=Dn(pn(o,i,i),n);if(It&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){let c=Dn(pn(o,i-1,i-1),-1);if(c.top==l.top){let d=Dn(pn(o,i,i+1),-1);if(d.top!=l.top)return Kr(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 Ql(l.getBoundingClientRect(),!1)}if(s==null&&i<Vt(o)){let l=o.childNodes[i];if(l.nodeType==1)return Ql(l.getBoundingClientRect(),!0)}return Ql(o.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==Vt(o))){let l=o.childNodes[i-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 Kr(Dn(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?pn(l,0,a?0:1):l.nodeType==1?l:null:null;if(c)return Kr(Dn(c,-1),!0)}return Kr(Dn(o.nodeType==3?pn(o):o,-n),n>=0)}function Kr(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,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 Qw=/[\u0590-\u08ac]/;let Mm=null,Nm=null,Bm=!1;class qr{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 _m){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 Tm&&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)&&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,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 Tm extends qr{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 ex extends qr{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 mo extends qr{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=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 i=mo.create(this.parent,this.mark,!0,o),s=this.children,a=this.size;n<a&&(s=tc(s,n,a,o)),e>0&&(s=tc(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 Rn extends qr{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}=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 tx(e,n,o,i,u,p||null,h,d,s,a+1):n.isText?new cs(e,n,o,i,u,h,s):new Rn(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)&&ds(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 ox(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,w,x,C;for(;g<f.length&&f[g].to==m;){let E=f[g++];E.widget&&(k?(w||(w=[k])).push(E):k=E)}if(k)if(w){w.sort(rx);for(let E=0;E<w.length;E++)p(w[E],y,!!b)}else p(k,y,!!b);if(b)C=-1,x=b,b=null;else{if(!(y<d.childCount))break;C=y,x=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+x.nodeSize;if(x.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&&(b=x.cut(E-m),x=x.cut(0,E-m),S=E,C=-1)}else for(;g<f.length&&f[g].to<S;)g++;h(x,x.isInline&&!x.isLeaf?v.filter(E=>!E.inline):v.slice(),u.forChild(m,x),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,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),Am(this.contentDOM,this.children,e),nr&&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 ex(this,s,n,i);e.input.compositionNodes.push(a),this.children=tc(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(ds(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,i){Im(o,e,t);let s=new Rn(void 0,t,e,n,o,o,o,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class cs extends Rn{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 cs(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 _m extends qr{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 tx extends Rn{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 Am(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=Dm(o),i=!0;o=o.nextSibling}else i=!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),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Ur=function(t){t&&(this.nodeName=t)};Ur.prototype=Object.create(null);const go=[new Ur];function ec(t,e,n){if(t.length==0)return go;let o=n?go[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 Vm(t,e,n,o){if(n==go&&o==go)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=go[0]),i=c}nx(i,l||go[0],a)}return i}function nx(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 Im(t,e,n){return Vm(t,t,go,ec(e,n,t.nodeType!=1))}function ds(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 ox{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 mo)){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=mo.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 Rn){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&&ds(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)||!ds(o,e.outerDeco)||!i.eq(e.innerDeco))return null;let l=Rn.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=Rn.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 Tm(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 mo;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof cs)||/\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 _m(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 rx(t,e){return t.type.side-e.type.side}function tc(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 nc(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(ls(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=rc(t,u,d,e=="pointer"||t.state.selection.head<d.pos&&!s?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&&it){let o=t.domSelectionRange(),i=t.domObserver.currentSelection;if(o.anchorNode&&i.anchorNode&&ho(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&&In<=11&&(s.disabled=!0,s.disabled=!1)})(t);else{let o,i,{anchor:s,head:a}=n;!Lm||n instanceof se||(n.$from.parent.inlineContent||(o=zm(t,n.from)),n.empty||n.$from.parent.inlineContent||(i=zm(t,n.to))),t.docView.setSelection(s,a,t,e),Lm&&(o&&$m(o),i&&$m(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(()=>{Rm(l)&&!l.state.selection.visible||l.dom.classList.remove("ProseMirror-hideselection")},20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Lm=dt||it&&vm<63;function zm(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 oc(i);if(!(i&&i.contentEditable!="false"||s&&s.contentEditable!="false")){if(i)return oc(i);if(s)return oc(s)}}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",i=>i(t,e,n))||se.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 ic(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 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 se)){if(o instanceof ne&&o.node.isInline)return Ln(t,new se(e>0?o.$to:o.$from));{let i=ic(t.state,e);return!!i&&Ln(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 Ln(t,new se(o.$anchor,a))}if(!o.empty)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let i=ic(t.state,e);return!!(i&&i instanceof ne)&&Ln(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)?Ln(t,new ne(e<0?t.state.doc.resolve(s.pos-a.nodeSize):s)):!!Wr&&Ln(t,new se(t.state.doc.resolve(e<0?l:l+a.nodeSize))))}}function us(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Jr(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function rr(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<us(i)&&Jr(i.childNodes[s],-1)&&(c=!0);;)if(s>0){if(i.nodeType!=1)break;{let d=i.childNodes[s-1];if(Jr(d,-1))a=i,l=--s;else{if(d.nodeType!=3)break;i=d,s=i.nodeValue.length}}}else{if(Km(i))break;{let d=i.previousSibling;for(;d&&Jr(d,-1);)a=i.parentNode,l=et(d),d=d.previousSibling;if(d)i=d,s=us(i);else{if(i=i.parentNode,i==n.dom)break;s=0}}}c?sc(n,i,s):a&&sc(n,a,l)}(t):function(n){let o=n.domSelectionRange(),i=o.focusNode,s=o.focusOffset;if(!i)return;let a,l,c=us(i);for(;;)if(s<c){if(i.nodeType!=1||!Jr(i.childNodes[s],1))break;a=i,l=++s}else{if(Km(i))break;{let d=i.nextSibling;for(;d&&Jr(d,1);)a=d.parentNode,l=et(d)+1,d=d.nextSibling;if(d)i=d,s=0,c=us(i);else{if(i=i.parentNode,i==n.dom)break;s=c=0}}}a&&sc(n,a,l)}(t)}function Km(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function sc(t,e,n){if(e.nodeType!=3){let s,a;(a=function(l,c){for(;l&&c==l.childNodes.length&&!Hr(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&&!Hr(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(ls(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&&mn(t)},50)}function qm(t,e){let n=t.state.doc.resolve(e);if(!it&&!Uw&&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=ic(t.state,e);if(a&&a instanceof ne)return Ln(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&&Ln(t,l)}return!1}function Jm(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 Gm(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: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")||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",`${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
43
|
|
|
44
44
|
`),slice:e}}function Ym(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=uo.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=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 b=window.trustedTypes;return b?(cc||(cc=b.defaultPolicy||b.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),Wr&&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")||Tn.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!(!c&&!u),context:i,ruleFromNode:h=>h.nodeName!="BR"||h.nextSibling||!h.parentNode||ix.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)}(eg(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&&Zm(k,m,b,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 w=Xm(b,k);v.push(w),g=g.matchType(w.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=eg(a,p,h)}return t.someProp("transformPasted",p=>{a=p(a,t,c)}),a}const ix=/^(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,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=Zm(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(Xm(n,t,i+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,i,s){let a=e<0?t.firstChild:t.lastChild,l=a.content;return t.childCount>1&&(s=0),i<o-1&&(l=lc(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 eg(t,e,n){return e<t.openStart&&(t=new J(lc(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new J(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={},sx={touchstart:!0,touchmove:!0};class ax{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 lx(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 ps(t){return{left:t.clientX,top:t.clientY}}function pc(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 cx(t,e,n,o){return pc(t,"handleDoubleClickOn",e,n,o)||t.someProp("handleDoubleClick",i=>i(t,e,o))}function dx(t,e,n,o){return pc(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 hc(t){return hs(t)}pt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!ig(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!hn||!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 Jm(o,-1)||or(o,-1);if(s==46&&!i.shiftKey||Dt&&s==68&&a=="c")return Jm(o,1)||or(o,1);if(s==13||s==27)return!0;if(s==37||Dt&&s==66&&a=="c"){let l=s==37?qm(o,o.state.selection.from)=="ltr"?-1:1:-1;return Wm(o,l,a)||or(o,l)}if(s==39||Dt&&s==70&&a=="c"){let l=s==39?qm(o,o.state.selection.from)=="ltr"?1:-1:1;return Wm(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;Gm(l,u,"true"),setTimeout(()=>Gm(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():zn(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,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(ig(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 rg=Dt?"metaKey":"ctrlKey";ut.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let o=hc(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[rg]&&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(ps(n));a&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new ux(t,a,n,!!o)):(s=="doubleClick"?cx:dx)(t,a.pos,a.inside,n)?n.preventDefault():zn(t,"pointer"))};class ux{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[rg],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)),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(ps(e))),this.updateAllowDefault(e),this.allowDefault||!n?zn(this.view,"pointer"):function(o,i,s,a,l){return pc(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()):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 ig(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 px=hn?5e3:-1;function sg(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>hs(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 hs(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 se&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(o=>o.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),hs(t,!0),t.markCursor=null;else if(hs(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}sg(t,px)},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++,sg(t,20))};const Gr=yt&&In<15||tr&&Jw<604;function Yr(t,e,n,o,i){let s=Ym(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 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,i=n.type=="cut";if(o.empty)return;let s=Gr?null:n.clipboardData,a=o.content(),{dom:l,text:c}=ac(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&&!hn)return;let o=Gr?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;o&&Yr(t,lg(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?Yr(s,c.value,null,d,a):Yr(s,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 hx=Dt?"altKey":"ctrlKey";function dg(t,e){let n=t.someProp("dragCopies",o=>!o(e));return n??!e[hx]}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(ps(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}=ac(t,l);(!n.dataTransfer.files.length||!it||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),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(ps(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=Ym(t,lg(n.dataTransfer),Gr?null:n.dataTransfer.getData("text/html"),!1,s);let l=!(!o||!dg(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?Hf(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(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(it&&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",i=>i(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 Xr(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 fs{constructor(e,n){this.toDOM=e,this.spec=n||vo,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 fs&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Xr(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,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 $n&&Xr(this.attrs,e.attrs)&&Xr(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,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 fc&&Xr(this.attrs,e.attrs)&&Xr(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 fs(n,o))}static inline(e,n,o,i){return new ht(e,n,new $n(o,i))}static node(e,n,o,i){return new ht(e,n,new fc(o,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof $n}get widget(){return this.type instanceof fs}}const ir=[],vo={};class Ie{constructor(e,n){this.local=e.length?e:ir,this.children=n.length?n:ir}static create(e,n){return n.length?ms(n,e,0,vo):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||vo)}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,w,x,C)=>{let S=C-x-(w-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;w>=N?m[E+1]=k<=N?-2:-1:k>=b&&S&&(m[E]+=S,m[E+1]+=S)}y+=S}),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:w,offset:x}=u.content.findIndex(y),C=u.maybeChild(w);if(C&&x==y&&x+C.nodeSize==k){let S=m[v+2].mapInner(d,C,b+1,l[v]+h+1,f);S!=st?(m[v]=y,m[v+1]=k,m[v+2]=S):(m[v+1]=-2,g=!0)}else g=!0}if(g){let v=function(y,k,w,x,C,S,E){function M(N,O){for(let R=0;R<N.local.length;R++){let z=N.local[R].map(x,C,O);z?w.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]+O+1)}for(let N=0;N<y.length;N+=3)y[N+1]==-1&&M(y[N+2],k[N]+S+1);return w}(m,l,c,d,p,h,f),b=ms(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 w=b.children[y];for(;k<m.length&&m[k]<w;)k+=3;m.splice(k,0,b.children[y],b.children[y+1],b.children[y+2])}}return new Ie(c.sort(yo),m)}(this.children,a||[],e,n,o,i,s):a?new Ie(a.sort(yo),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=pg(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,ms(d,l,u+1,vo)),s+=3}});let a=ug(s?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,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 $n){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(yo),ir);return o?new Pn([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 mc(this.localsInner(e))}localsInner(e){if(this==st)return ir;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 st=Ie.empty;class Pn{constructor(e){this.members=e}map(e,n){const o=this.members.map(i=>i.map(e,n,vo));return Pn.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 Pn?o=o.concat(s.members):o.push(s))}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 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?mc(o?n:n.sort(yo)):ir}static from(e){switch(e.length){case 0:return st;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 i=t[o];n.push(new ht(i.from+e,i.to+e,i.type))}return n}function pg(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 hg(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function ms(t,e,n,o){let i=[],s=!1;e.forEach((l,c)=>{let d=pg(t,l,c+n);if(d){s=!0;let u=ms(d,l,n+c+1,o);u!=st&&i.push(c,c+l.nodeSize,u)}});let a=ug(s?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||i.length?new Ie(a,i):st}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 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),fg(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),fg(e,i+1,s.copy(o.to,s.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!=st&&e.push(o)}),t.cursorWrapper&&e.push(Ie.create(t.state.doc,[t.cursorWrapper.deco])),Pn.from(e)}const fx={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},mx=yt&&In<=11;class gx{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 vx{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new gx,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&&In<=11&&o.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),mx&&(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,fx)),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 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)&&Fm(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&&yx(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&&ls(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()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,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(s,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 i=e.previousSibling,s=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)&&(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 mg=new WeakMap,gg=!1;function vg(t,e){let n=e.startContainer,o=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return ho(a.node,a.offset,i,s)&&([n,o,i,s]=[i,s,n,o]),{anchorNode:n,anchorOffset:o,focusNode:i,focusOffset:s}}function yx(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 bx(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 kx=/^(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,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 bg(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 kg{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 ax,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 vx(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=nc(l,_);if(I&&!l.state.selection.eq(I)){if(it&&hn&&l.input.lastKeyCode===13&&Date.now()-100<l.input.lastKeyCodeTime&&l.someProp("handleKeyDown",V=>V(l,fo(13,"Enter"))))return;let T=l.state.tr.setSelection(I);_=="pointer"?T.setMeta("pointer",!0):_=="key"&&T.scrollIntoView(),h&&T.setMeta("composition",h),l.dispatch(T)}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,T){let V,{node:P,fromOffset:A,toOffset:L,from:j,to:q}=_.docView.parseRange(I,T),H=_.domSelectionRange(),U=H.anchorNode;if(U&&_.dom.contains(U.nodeType==1?U:U.parentNode)&&(V=[{node:U,offset:H.anchorOffset}],ls(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")||Tn.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:bx,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),k=l.state.doc,w=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 x=function(_,I,T,V,P){let A=_.findDiffStart(I,T);if(A==null)return null;let{a:L,b:j}=_.findDiffEnd(I,T+_.size,T+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&&bg(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&&bg(_.textBetween(A-1,A+1))&&(A+=q?1:-1),L=A+(L-j),j=A}return{start:A,endA:L,endB:j}}(w.content,y.doc.content,y.from,g,v);if(x&&l.input.domChangeCount++,(tr&&l.input.lastIOSEnter>Date.now()-225||hn)&&p.some(_=>_.nodeType==1&&!kx.test(_.nodeName))&&(!x||x.endA>=x.endB)&&l.someProp("handleKeyDown",_=>_(l,fo(13,"Enter"))))return void(l.input.lastIOSEnter=0);if(!x){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 _=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}x={start:b.from,endA:b.to,endB:b.to}}l.state.selection.from<l.state.selection.to&&x.start==x.endB&&l.state.selection instanceof se&&(x.start>l.state.selection.from&&x.start<=l.state.selection.from+2&&l.state.selection.from>=y.from?x.start=l.state.selection.from:x.endA<l.state.selection.to&&x.endA>=l.state.selection.to-2&&l.state.selection.to<=y.to&&(x.endB+=l.state.selection.to-x.endA,x.endA=l.state.selection.to)),yt&&In<=11&&x.endB==x.start+1&&x.endA==x.start&&x.start>y.from&&y.doc.textBetween(x.start-y.from-1,x.start-y.from+1)==" "&&(x.start--,x.endA--,x.endB--);let C=y.doc.resolveNoCache(x.start-y.from),S=y.doc.resolveNoCache(x.endB-y.from),E=k.resolve(x.start),M=C.sameParent(S)&&C.parent.inlineContent&&E.end()>=x.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>x.start&&function(_,I,T,V,P){if(T-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&&T==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>T||vc(L,!0,!1)<T)&&V.parent.content.cut(V.parentOffset).eq(L.parent.content)}(k,x.start,x.endA,C,S)&&l.someProp("handleKeyDown",_=>_(l,fo(8,"Backspace"))))return void(hn&&it&&l.domObserver.suppressSelectionUpdates());it&&x.endB==x.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==x.endA&&(x.endB-=2,S=y.doc.resolveNoCache(x.endB-y.from),setTimeout(()=>{l.someProp("handleKeyDown",function(_){return _(l,fo(13,"Enter"))})},20));let N,O=x.start,R=x.endA,z=_=>{let I=_||l.state.tr.replace(O,R,y.doc.slice(x.start-y.from,x.endB-y.from));if(y.sel){let T=yg(l,I.doc,y.sel);T&&!(it&&l.composing&&T.empty&&(x.start!=x.endB||l.input.lastChromeDelete<Date.now()-100)&&(T.head==O||T.head==I.mapping.map(R)-1)||yt&&T.empty&&T.head==O)&&I.setSelection(T)}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(O,R)),I=k.resolve(x.start).marksAcross(k.resolve(x.endA));I&&_.ensureMarks(I),l.dispatch(_)}else if(x.endA==x.endB&&(N=function(_,I){let T,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],T="add",P=U=>U.mark(V.addToSet(U.marks));else{if(j.length!=0||q.length!=1)return null;V=q[0],T="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:T}}(C.parent.content.cut(C.parentOffset,S.parentOffset),E.parent.content.cut(E.parentOffset,x.endA-E.start())))){let _=z(l.state.tr);N.type=="add"?_.addMark(O,R,N.mark):_.removeMark(O,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(_,O,R));l.someProp("handleTextInput",T=>T(l,O,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=>{!lx(o,a)||uc(o,a)||!o.editable&&a.type in pt||s(o,a)},sx[i]?{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 i=this.state,s=!1,a=!1;e.storedMarks&&this.composing&&(ag(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=Sg(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)&&dc(this),this.editable=Cg(this),xg(this);let c=gc(this),d=wg(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 w=f.root.elementFromPoint(y,k);if(!w||w==f.dom||!f.dom.contains(w))continue;let x=w.getBoundingClientRect();if(x.top>=b-20){m=w,g=x.top;break}}return{refDOM:m,refTop:g,stack:bm(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,w){for(;;){if(k.nodeType==3&&w)return k;if(k.nodeType==1&&w>0){if(k.contentEditable=="false")return null;w=Vt(k=k.childNodes[w-1])}else{if(!k.parentNode||Hr(k))return null;w=et(k),k=k.parentNode}}}(v.focusNode,v.focusOffset),y=function(k,w){for(;;){if(k.nodeType==3&&w<k.nodeValue.length)return k;if(k.nodeType==1&&w<k.childNodes.length){if(k.contentEditable=="false")return null;k=k.childNodes[w],w=0}else{if(!k.parentNode||Hr(k))return null;w=et(k)+1,k=k.parentNode}}}(v.focusNode,v.focusOffset);if(b&&y&&b!=y){let k=y.pmViewDesc,w=g.domObserver.lastChangedTextNode;if(b==w||y==w)return w;if(!k||!k.isText(y.nodeValue))return y;if(g.input.compositionNode==y){let x=b.pmViewDesc;if(x&&x.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=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(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;km(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,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 cg(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=bm(e);e.focus(nr==null?{get preventScroll(){return nr={preventScroll:!0},!0}}:void 0),nr||(nr=!1,km(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 Xw(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 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 Mm==i&&Nm==s?Bm:(Mm=i,Nm=s,Bm=s=="up"||s=="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,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?Qw.test(d.parent.textContent)&&f.modify?Em(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:w,focusOffset:x}=a.domSelectionRange(),C=w&&!k.contains(w.nodeType==1?w:w.parentNode)||m==w&&g==x;try{f.collapse(v,b),m&&(m!=v||g!=b)&&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,i,s))}(this,n||this.state,e)}pasteHTML(e,n){return Yr(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Yr(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,Jl=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 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?vg(n,i):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 i in o)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=o[i])}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")}kg.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:"'"},gs={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},wx=typeof navigator<"u"&&/Mac/.test(navigator.platform),xx=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),gs[tt]=String.fromCharCode(tt);for(var yc in jn)gs.hasOwnProperty(yc)||(gs[yc]=jn[yc]);const Cx=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Sx=typeof navigator<"u"&&/Win/.test(navigator.platform);function Ex(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);Cx?i=!0:n=!0}}return e&&(a="Alt-"+a),n&&(a="Ctrl-"+a),i&&(a="Meta-"+a),o&&(a="Shift-"+a),a}function bc(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 i in n)o[Ex(i)]=n[i];return o}(t);return function(n,o){let i,s=function(l){var c=!(wx&&l.metaKey&&l.shiftKey&&!l.ctrlKey&&!l.altKey||xx&&l.shiftKey&&l.key&&l.key.length==1||l.key=="Unidentified")&&l.key||(l.shiftKey?gs: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[bc(s,o)];if(a&&a(n.state,n.dispatch,n))return!0;if(s.length==1&&s!=" "){if(o.shiftKey){let l=e[bc(s,o,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((o.altKey||o.metaKey||o.ctrlKey)&&!(Sx&&o.ctrlKey&&o.altKey)&&(i=jn[o.keyCode])&&i!=s){let l=e[bc(i,o)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var Mx=Object.defineProperty,kc=(t,e)=>{for(var n in e)Mx(t,n,{get:e[n],enumerable:!0})};function vs(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 ys=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:vs({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}},Ng={};kc(Ng,{blur:()=>Nx,clearContent:()=>Bx,clearNodes:()=>Tx,command:()=>Ox,createParagraphNear:()=>_x,cut:()=>Ax,deleteCurrentNode:()=>Vx,deleteNode:()=>Ix,deleteRange:()=>Dx,deleteSelection:()=>Rx,enter:()=>Lx,exitCode:()=>zx,extendMarkRange:()=>$x,first:()=>Px,focus:()=>jx,forEach:()=>Fx,insertContent:()=>Hx,insertContentAt:()=>Wx,joinBackward:()=>Ux,joinDown:()=>qx,joinForward:()=>Jx,joinItemBackward:()=>Gx,joinItemForward:()=>Yx,joinTextblockBackward:()=>Xx,joinTextblockForward:()=>Zx,joinUp:()=>Kx,keyboardShortcut:()=>Qx,lift:()=>eC,liftEmptyBlock:()=>tC,liftListItem:()=>nC,newlineInCode:()=>oC,resetAttributes:()=>rC,scrollIntoView:()=>iC,selectAll:()=>sC,selectNodeBackward:()=>aC,selectNodeForward:()=>lC,selectParentNode:()=>cC,selectTextblockEnd:()=>dC,selectTextblockStart:()=>uC,setContent:()=>pC,setMark:()=>hC,setMeta:()=>fC,setNode:()=>mC,setNodeSelection:()=>gC,setTextSelection:()=>vC,sinkListItem:()=>yC,splitBlock:()=>bC,splitListItem:()=>kC,toggleList:()=>wC,toggleMark:()=>xC,toggleNode:()=>CC,toggleWrap:()=>SC,undoInputRule:()=>EC,unsetAllMarks:()=>MC,unsetMark:()=>NC,updateAttributes:()=>BC,wrapIn:()=>TC,wrapInList:()=>OC});var Nx=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),Bx=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),Tx=()=>({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)},Ox=t=>e=>t(e),_x=()=>({state:t,dispatch:e})=>cm(t,e),Ax=(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},Vx=()=>({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 Ix=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},Dx=t=>({tr:e,dispatch:n})=>{const{from:o,to:i}=t;return n&&e.delete(o,i),!0},Rx=()=>({state:t,dispatch:e})=>Hl(t,e),Lx=()=>({commands:t})=>t.keyboardShortcut("Enter"),zx=()=>({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=ql(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 wc(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function bs(t,e,n={strict:!0}){const o=Object.keys(e);return!o.length||o.every(i=>n.strict?e[i]===t[i]:wc(e[i])?e[i].test(t[i]):e[i]===t[i])}function Bg(t,e,n={}){return t.find(o=>o.type===e&&bs(Object.fromEntries(Object.keys(n).map(i=>[i,o.attrs[i]])),n))}function Tg(t,e,n={}){return!!Bg(t,e,n)}function xc(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),!Bg([...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&&Tg([...t.parent.child(s-1).marks],e,n);)s-=1,a-=t.parent.child(s).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 $x=(t,e={})=>({tr:n,state:o,dispatch:i})=>{const s=gn(t,o.schema),{doc:a,selection:l}=n,{$from:c,from:d,to:u}=l;if(i){const p=xc(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},Px=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 se}function bo(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 i=n.from,s=o.to;return e==="all"?se.create(t,bo(0,i,s),bo(t.content.size,i,s)):se.create(t,bo(e,i,s),bo(e,i,s))}function Cc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var jx=(t=null,e={})=>({editor:n,view:o,tr:i,dispatch:s})=>{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(s&&t===null&&!Og(n.state.selection))return a(),!0;const l=_g(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},Fx=(t,e)=>n=>t.every((o,i)=>e(o,{...n,index:i})),Hx=(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 ks(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 Zr(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),Zr("",e,n)}if(o){if(n.errorOnInvalidContent){let s=!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=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Tn.fromSchema(l).parseSlice(ks(t),n.parseOptions):Tn.fromSchema(l).parse(ks(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=Tn.fromSchema(e);return n.slice?i.parseSlice(ks(t),n.parseOptions).content:i.parse(ks(t),n.parseOptions)}return Zr("",e,n)}var Wx=(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{Zr(e,s.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(g){c(g)}try{l=Zr(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 w=0;k.forEach((x,C,S,E)=>{w===0&&(w=E)}),g.setSelection(pe.near(g.doc.resolve(w),-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},Kx=()=>({state:t,dispatch:e})=>((n,o)=>{let i,s=n.selection,a=s instanceof ne;if(a){if(s.node.isTextblock||!An(n.doc,s.from))return!1;i=s.from}else if(i=is(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),qx=()=>({state:t,dispatch:e})=>((n,o)=>{let i,s=n.selection;if(s instanceof ne){if(s.node.isTextblock||!An(n.doc,s.to))return!1;i=s.to}else if(i=is(n.doc,s.to,1),i==null)return!1;return o&&o(n.tr.join(i).scrollIntoView()),!0})(t,e),Ux=()=>({state:t,dispatch:e})=>nm(t,e),Jx=()=>({state:t,dispatch:e})=>sm(t,e),Gx=()=>({state:t,dispatch:e,tr:n})=>{try{const o=is(t.doc,t.selection.$from.pos,-1);return o!=null&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},Yx=()=>({state:t,dispatch:e,tr:n})=>{try{const o=is(t.doc,t.selection.$from.pos,1);return o!=null&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},Xx=()=>({state:t,dispatch:e})=>((n,o)=>{let i=tm(n,void 0);if(!i)return!1;let s=Wl(i);return!!s&&om(n,s,o)})(t,e),Zx=()=>({state:t,dispatch:e})=>((n,o)=>{let i=im(n,void 0);if(!i)return!1;let s=Kl(i);return!!s&&om(n,s,o)})(t,e);function Vg(){return typeof navigator<"u"&&/Mac/.test(navigator.platform)}var Qx=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}`);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=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 Fn(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=>bs(u.node.attrs,n,{strict:!1}));return s?!!d.length:d.reduce((u,p)=>u+p.to-p.from,0)>=c}var eC=(t,e={})=>({state:n,dispatch:o})=>!!Fn(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),tC=()=>({state:t,dispatch:e})=>dm(t,e),nC=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 es(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 An(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 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,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 w=m.pos,x=w+g.nodeSize;return h.step(new Ge(w-(v?1:0),x+(b?1:0),w+1,x-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},oC=()=>({state:t,dispatch:e})=>lm(t,e);function ws(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,i)=>(n.includes(i)||(o[i]=t[i]),o),{})}var rC=(t,e)=>({tr:n,state:o,dispatch:i})=>{let s=null,a=null;const l=ws(typeof t=="string"?t:t.name,o.schema);return!!l&&(l==="node"&&(s=Ke(t,o.schema)),l==="mark"&&(a=gn(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,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)},iC=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),sC=()=>({tr:t,dispatch:e})=>{if(e){const n=new Nt(t.doc);t.setSelection(n)}return!0},aC=()=>({state:t,dispatch:e})=>rm(t,e),lC=()=>({state:t,dispatch:e})=>am(t,e),cC=()=>({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),dC=()=>({state:t,dispatch:e})=>Kw(t,e),uC=()=>({state:t,dispatch:e})=>Ww(t,e);function Sc(t,e,n={},o={}){return Zr(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:o.errorOnInvalidContent})}var pC=(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=Sc(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 Dg(t,e){const n=gn(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 Rg(t,e){const n=new Jf(t);return e.forEach(o=>{o.steps.forEach(i=>{n.step(i)})}),n}function xs(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 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 ke(t,e=void 0,...n){return Lg(t)?e?t.bind(e)(...n):t(...n):t}function Qr(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}=Qr(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 Cs(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 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 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,i=te(n,"priority")||100;return o>i?-1:o<i?1:0})}function jg(t){const e=Nc(Ec(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 Fg(t,e,n){const{from:o,to:i}=e,{blockSeparator:s=`
|
|
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=uo.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=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 b=window.trustedTypes;return b?(cc||(cc=b.defaultPolicy||b.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),Wr&&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")||Tn.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!(!c&&!u),context:i,ruleFromNode:h=>h.nodeName!="BR"||h.nextSibling||!h.parentNode||ix.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)}(eg(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&&Zm(k,m,b,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 w=Xm(b,k);v.push(w),g=g.matchType(w.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=eg(a,p,h)}return t.someProp("transformPasted",p=>{a=p(a,t,c)}),a}const ix=/^(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,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=Zm(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(Xm(n,t,i+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,i,s){let a=e<0?t.firstChild:t.lastChild,l=a.content;return t.childCount>1&&(s=0),i<o-1&&(l=lc(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 eg(t,e,n){return e<t.openStart&&(t=new J(lc(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new J(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={},sx={touchstart:!0,touchmove:!0};class ax{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 lx(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 ps(t){return{left:t.clientX,top:t.clientY}}function pc(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 ir(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 cx(t,e,n,o){return pc(t,"handleDoubleClickOn",e,n,o)||t.someProp("handleDoubleClick",i=>i(t,e,o))}function dx(t,e,n,o){return pc(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&&(ir(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)ir(i,se.create(l,p+1,p+1+u.content.size));else{if(!ne.isSelectable(u))continue;ir(i,ne.create(l,p))}return!0}}(t,n,o)}function hc(t){return hs(t)}pt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!ig(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!hn||!it||n.keyCode!=13))if(n.keyCode!=229&&t.domObserver.forceFlush(),!nr||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 Jm(o,-1)||rr(o,-1);if(s==46&&!i.shiftKey||Dt&&s==68&&a=="c")return Jm(o,1)||rr(o,1);if(s==13||s==27)return!0;if(s==37||Dt&&s==66&&a=="c"){let l=s==37?qm(o,o.state.selection.from)=="ltr"?-1:1:-1;return Wm(o,l,a)||rr(o,l)}if(s==39||Dt&&s==70&&a=="c"){let l=s==39?qm(o,o.state.selection.from)=="ltr"?1:-1:1;return Wm(o,l,a)||rr(o,l)}return s==38||Dt&&s==80&&a=="c"?Um(o,-1,a)||rr(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;Gm(l,u,"true"),setTimeout(()=>Gm(l,u,"false"),20)}return!1}(o)||Um(o,1,a)||rr(o,1):a==(Dt?"m":"c")&&(s==66||s==73||s==89||s==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",i=>i(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(ig(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 rg=Dt?"metaKey":"ctrlKey";ut.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let o=hc(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[rg]&&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(ps(n));a&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new ux(t,a,n,!!o)):(s=="doubleClick"?cx:dx)(t,a.pos,a.inside,n)?n.preventDefault():zn(t,"pointer"))};class ux{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[rg],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)),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(ps(e))),this.updateAllowDefault(e),this.allowDefault||!n?zn(this.view,"pointer"):function(o,i,s,a,l){return pc(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&&(ir(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))&&(ir(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)?(ir(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 ig(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 px=hn?5e3:-1;function sg(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>hs(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 hs(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 se&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(o=>o.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),hs(t,!0),t.markCursor=null;else if(hs(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}sg(t,px)},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++,sg(t,20))};const Gr=yt&&In<15||nr&&Jw<604;function Yr(t,e,n,o,i){let s=Ym(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 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,i=n.type=="cut";if(o.empty)return;let s=Gr?null:n.clipboardData,a=o.content(),{dom:l,text:c}=ac(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&&!hn)return;let o=Gr?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;o&&Yr(t,lg(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?Yr(s,c.value,null,d,a):Yr(s,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 hx=Dt?"altKey":"ctrlKey";function dg(t,e){let n=t.someProp("dragCopies",o=>!o(e));return n??!e[hx]}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(ps(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}=ac(t,l);(!n.dataTransfer.files.length||!it||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),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(ps(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=Ym(t,lg(n.dataTransfer),Gr?null:n.dataTransfer.getData("text/html"),!1,s);let l=!(!o||!dg(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?Hf(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(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(it&&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",i=>i(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 Xr(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 fs{constructor(e,n){this.toDOM=e,this.spec=n||vo,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 fs&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Xr(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,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 $n&&Xr(this.attrs,e.attrs)&&Xr(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,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 fc&&Xr(this.attrs,e.attrs)&&Xr(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 fs(n,o))}static inline(e,n,o,i){return new ht(e,n,new $n(o,i))}static node(e,n,o,i){return new ht(e,n,new fc(o,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof $n}get widget(){return this.type instanceof fs}}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?ms(n,e,0,vo):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||vo)}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,w,x,C)=>{let S=C-x-(w-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;w>=N?m[E+1]=k<=N?-2:-1:k>=b&&S&&(m[E]+=S,m[E+1]+=S)}y+=S}),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:w,offset:x}=u.content.findIndex(y),C=u.maybeChild(w);if(C&&x==y&&x+C.nodeSize==k){let S=m[v+2].mapInner(d,C,b+1,l[v]+h+1,f);S!=st?(m[v]=y,m[v+1]=k,m[v+2]=S):(m[v+1]=-2,g=!0)}else g=!0}if(g){let v=function(y,k,w,x,C,S,E){function M(N,O){for(let R=0;R<N.local.length;R++){let z=N.local[R].map(x,C,O);z?w.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]+O+1)}for(let N=0;N<y.length;N+=3)y[N+1]==-1&&M(y[N+2],k[N]+S+1);return w}(m,l,c,d,p,h,f),b=ms(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 w=b.children[y];for(;k<m.length&&m[k]<w;)k+=3;m.splice(k,0,b.children[y],b.children[y+1],b.children[y+2])}}return new Ie(c.sort(yo),m)}(this.children,a||[],e,n,o,i,s):a?new Ie(a.sort(yo),sr):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=pg(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,ms(d,l,u+1,vo)),s+=3}});let a=ug(s?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,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 $n){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(yo),sr);return o?new Pn([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 mc(this.localsInner(e))}localsInner(e){if(this==st)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 st=Ie.empty;class Pn{constructor(e){this.members=e}map(e,n){const o=this.members.map(i=>i.map(e,n,vo));return Pn.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 Pn?o=o.concat(s.members):o.push(s))}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 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?mc(o?n:n.sort(yo)):sr}static from(e){switch(e.length){case 0:return st;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 i=t[o];n.push(new ht(i.from+e,i.to+e,i.type))}return n}function pg(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 hg(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function ms(t,e,n,o){let i=[],s=!1;e.forEach((l,c)=>{let d=pg(t,l,c+n);if(d){s=!0;let u=ms(d,l,n+c+1,o);u!=st&&i.push(c,c+l.nodeSize,u)}});let a=ug(s?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||i.length?new Ie(a,i):st}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 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),fg(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),fg(e,i+1,s.copy(o.to,s.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!=st&&e.push(o)}),t.cursorWrapper&&e.push(Ie.create(t.state.doc,[t.cursorWrapper.deco])),Pn.from(e)}const fx={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},mx=yt&&In<=11;class gx{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 vx{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new gx,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&&In<=11&&o.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),mx&&(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,fx)),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 s=e.focusNode;s;s=tr(s))o.add(s);for(let s=e.anchorNode;s;s=tr(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)&&Fm(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&&yx(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&&ls(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()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,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(s,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 i=e.previousSibling,s=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)&&(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 mg=new WeakMap,gg=!1;function vg(t,e){let n=e.startContainer,o=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return ho(a.node,a.offset,i,s)&&([n,o,i,s]=[i,s,n,o]),{anchorNode:n,anchorOffset:o,focusNode:i,focusOffset:s}}function yx(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 bx(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 kx=/^(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,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 bg(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 kg{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 ax,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 vx(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=nc(l,_);if(I&&!l.state.selection.eq(I)){if(it&&hn&&l.input.lastKeyCode===13&&Date.now()-100<l.input.lastKeyCodeTime&&l.someProp("handleKeyDown",V=>V(l,fo(13,"Enter"))))return;let T=l.state.tr.setSelection(I);_=="pointer"?T.setMeta("pointer",!0):_=="key"&&T.scrollIntoView(),h&&T.setMeta("composition",h),l.dispatch(T)}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,T){let V,{node:P,fromOffset:A,toOffset:L,from:j,to:q}=_.docView.parseRange(I,T),H=_.domSelectionRange(),U=H.anchorNode;if(U&&_.dom.contains(U.nodeType==1?U:U.parentNode)&&(V=[{node:U,offset:H.anchorOffset}],ls(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")||Tn.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:bx,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),k=l.state.doc,w=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 x=function(_,I,T,V,P){let A=_.findDiffStart(I,T);if(A==null)return null;let{a:L,b:j}=_.findDiffEnd(I,T+_.size,T+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&&bg(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&&bg(_.textBetween(A-1,A+1))&&(A+=q?1:-1),L=A+(L-j),j=A}return{start:A,endA:L,endB:j}}(w.content,y.doc.content,y.from,g,v);if(x&&l.input.domChangeCount++,(nr&&l.input.lastIOSEnter>Date.now()-225||hn)&&p.some(_=>_.nodeType==1&&!kx.test(_.nodeName))&&(!x||x.endA>=x.endB)&&l.someProp("handleKeyDown",_=>_(l,fo(13,"Enter"))))return void(l.input.lastIOSEnter=0);if(!x){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 _=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}x={start:b.from,endA:b.to,endB:b.to}}l.state.selection.from<l.state.selection.to&&x.start==x.endB&&l.state.selection instanceof se&&(x.start>l.state.selection.from&&x.start<=l.state.selection.from+2&&l.state.selection.from>=y.from?x.start=l.state.selection.from:x.endA<l.state.selection.to&&x.endA>=l.state.selection.to-2&&l.state.selection.to<=y.to&&(x.endB+=l.state.selection.to-x.endA,x.endA=l.state.selection.to)),yt&&In<=11&&x.endB==x.start+1&&x.endA==x.start&&x.start>y.from&&y.doc.textBetween(x.start-y.from-1,x.start-y.from+1)==" "&&(x.start--,x.endA--,x.endB--);let C=y.doc.resolveNoCache(x.start-y.from),S=y.doc.resolveNoCache(x.endB-y.from),E=k.resolve(x.start),M=C.sameParent(S)&&C.parent.inlineContent&&E.end()>=x.endA;if((nr&&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>x.start&&function(_,I,T,V,P){if(T-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&&T==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>T||vc(L,!0,!1)<T)&&V.parent.content.cut(V.parentOffset).eq(L.parent.content)}(k,x.start,x.endA,C,S)&&l.someProp("handleKeyDown",_=>_(l,fo(8,"Backspace"))))return void(hn&&it&&l.domObserver.suppressSelectionUpdates());it&&x.endB==x.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==x.endA&&(x.endB-=2,S=y.doc.resolveNoCache(x.endB-y.from),setTimeout(()=>{l.someProp("handleKeyDown",function(_){return _(l,fo(13,"Enter"))})},20));let N,O=x.start,R=x.endA,z=_=>{let I=_||l.state.tr.replace(O,R,y.doc.slice(x.start-y.from,x.endB-y.from));if(y.sel){let T=yg(l,I.doc,y.sel);T&&!(it&&l.composing&&T.empty&&(x.start!=x.endB||l.input.lastChromeDelete<Date.now()-100)&&(T.head==O||T.head==I.mapping.map(R)-1)||yt&&T.empty&&T.head==O)&&I.setSelection(T)}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(O,R)),I=k.resolve(x.start).marksAcross(k.resolve(x.endA));I&&_.ensureMarks(I),l.dispatch(_)}else if(x.endA==x.endB&&(N=function(_,I){let T,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],T="add",P=U=>U.mark(V.addToSet(U.marks));else{if(j.length!=0||q.length!=1)return null;V=q[0],T="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:T}}(C.parent.content.cut(C.parentOffset,S.parentOffset),E.parent.content.cut(E.parentOffset,x.endA-E.start())))){let _=z(l.state.tr);N.type=="add"?_.addMark(O,R,N.mark):_.removeMark(O,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(_,O,R));l.someProp("handleTextInput",T=>T(l,O,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=>{!lx(o,a)||uc(o,a)||!o.editable&&a.type in pt||s(o,a)},sx[i]?{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 i=this.state,s=!1,a=!1;e.storedMarks&&this.composing&&(ag(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=Sg(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)&&dc(this),this.editable=Cg(this),xg(this);let c=gc(this),d=wg(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 w=f.root.elementFromPoint(y,k);if(!w||w==f.dom||!f.dom.contains(w))continue;let x=w.getBoundingClientRect();if(x.top>=b-20){m=w,g=x.top;break}}return{refDOM:m,refTop:g,stack:bm(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,w){for(;;){if(k.nodeType==3&&w)return k;if(k.nodeType==1&&w>0){if(k.contentEditable=="false")return null;w=Vt(k=k.childNodes[w-1])}else{if(!k.parentNode||Hr(k))return null;w=et(k),k=k.parentNode}}}(v.focusNode,v.focusOffset),y=function(k,w){for(;;){if(k.nodeType==3&&w<k.nodeValue.length)return k;if(k.nodeType==1&&w<k.childNodes.length){if(k.contentEditable=="false")return null;k=k.childNodes[w],w=0}else{if(!k.parentNode||Hr(k))return null;w=et(k)+1,k=k.parentNode}}}(v.focusNode,v.focusOffset);if(b&&y&&b!=y){let k=y.pmViewDesc,w=g.domObserver.lastChangedTextNode;if(b==w||y==w)return w;if(!k||!k.isText(y.nodeValue))return y;if(g.input.compositionNode==y){let x=b.pmViewDesc;if(x&&x.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=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(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;km(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,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 cg(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(or)return e.focus(or);let n=bm(e);e.focus(or==null?{get preventScroll(){return or={preventScroll:!0},!0}}:void 0),or||(or=!1,km(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 Xw(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 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 Mm==i&&Nm==s?Bm:(Mm=i,Nm=s,Bm=s=="up"||s=="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,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?Qw.test(d.parent.textContent)&&f.modify?Em(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:w,focusOffset:x}=a.domSelectionRange(),C=w&&!k.contains(w.nodeType==1?w:w.parentNode)||m==w&&g==x;try{f.collapse(v,b),m&&(m!=v||g!=b)&&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,i,s))}(this,n||this.state,e)}pasteHTML(e,n){return Yr(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Yr(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,Jl=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 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?vg(n,i):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 i in o)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=o[i])}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")}kg.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:"'"},gs={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},wx=typeof navigator<"u"&&/Mac/.test(navigator.platform),xx=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),gs[tt]=String.fromCharCode(tt);for(var yc in jn)gs.hasOwnProperty(yc)||(gs[yc]=jn[yc]);const Cx=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Sx=typeof navigator<"u"&&/Win/.test(navigator.platform);function Ex(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);Cx?i=!0:n=!0}}return e&&(a="Alt-"+a),n&&(a="Ctrl-"+a),i&&(a="Meta-"+a),o&&(a="Shift-"+a),a}function bc(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 i in n)o[Ex(i)]=n[i];return o}(t);return function(n,o){let i,s=function(l){var c=!(wx&&l.metaKey&&l.shiftKey&&!l.ctrlKey&&!l.altKey||xx&&l.shiftKey&&l.key&&l.key.length==1||l.key=="Unidentified")&&l.key||(l.shiftKey?gs: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[bc(s,o)];if(a&&a(n.state,n.dispatch,n))return!0;if(s.length==1&&s!=" "){if(o.shiftKey){let l=e[bc(s,o,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((o.altKey||o.metaKey||o.ctrlKey)&&!(Sx&&o.ctrlKey&&o.altKey)&&(i=jn[o.keyCode])&&i!=s){let l=e[bc(i,o)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var Mx=Object.defineProperty,kc=(t,e)=>{for(var n in e)Mx(t,n,{get:e[n],enumerable:!0})};function vs(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 ys=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:vs({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}},Ng={};kc(Ng,{blur:()=>Nx,clearContent:()=>Bx,clearNodes:()=>Tx,command:()=>Ox,createParagraphNear:()=>_x,cut:()=>Ax,deleteCurrentNode:()=>Vx,deleteNode:()=>Ix,deleteRange:()=>Dx,deleteSelection:()=>Rx,enter:()=>Lx,exitCode:()=>zx,extendMarkRange:()=>$x,first:()=>Px,focus:()=>jx,forEach:()=>Fx,insertContent:()=>Hx,insertContentAt:()=>Wx,joinBackward:()=>Ux,joinDown:()=>qx,joinForward:()=>Jx,joinItemBackward:()=>Gx,joinItemForward:()=>Yx,joinTextblockBackward:()=>Xx,joinTextblockForward:()=>Zx,joinUp:()=>Kx,keyboardShortcut:()=>Qx,lift:()=>eC,liftEmptyBlock:()=>tC,liftListItem:()=>nC,newlineInCode:()=>oC,resetAttributes:()=>rC,scrollIntoView:()=>iC,selectAll:()=>sC,selectNodeBackward:()=>aC,selectNodeForward:()=>lC,selectParentNode:()=>cC,selectTextblockEnd:()=>dC,selectTextblockStart:()=>uC,setContent:()=>pC,setMark:()=>hC,setMeta:()=>fC,setNode:()=>mC,setNodeSelection:()=>gC,setTextSelection:()=>vC,sinkListItem:()=>yC,splitBlock:()=>bC,splitListItem:()=>kC,toggleList:()=>wC,toggleMark:()=>xC,toggleNode:()=>CC,toggleWrap:()=>SC,undoInputRule:()=>EC,unsetAllMarks:()=>MC,unsetMark:()=>NC,updateAttributes:()=>BC,wrapIn:()=>TC,wrapInList:()=>OC});var Nx=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),Bx=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),Tx=()=>({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=Yo(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)},Ox=t=>e=>t(e),_x=()=>({state:t,dispatch:e})=>cm(t,e),Ax=(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},Vx=()=>({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 Ix=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},Dx=t=>({tr:e,dispatch:n})=>{const{from:o,to:i}=t;return n&&e.delete(o,i),!0},Rx=()=>({state:t,dispatch:e})=>Hl(t,e),Lx=()=>({commands:t})=>t.keyboardShortcut("Enter"),zx=()=>({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=ql(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 wc(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function bs(t,e,n={strict:!0}){const o=Object.keys(e);return!o.length||o.every(i=>n.strict?e[i]===t[i]:wc(e[i])?e[i].test(t[i]):e[i]===t[i])}function Bg(t,e,n={}){return t.find(o=>o.type===e&&bs(Object.fromEntries(Object.keys(n).map(i=>[i,o.attrs[i]])),n))}function Tg(t,e,n={}){return!!Bg(t,e,n)}function xc(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),!Bg([...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&&Tg([...t.parent.child(s-1).marks],e,n);)s-=1,a-=t.parent.child(s).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 $x=(t,e={})=>({tr:n,state:o,dispatch:i})=>{const s=gn(t,o.schema),{doc:a,selection:l}=n,{$from:c,from:d,to:u}=l;if(i){const p=xc(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},Px=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 se}function bo(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 i=n.from,s=o.to;return e==="all"?se.create(t,bo(0,i,s),bo(t.content.size,i,s)):se.create(t,bo(e,i,s),bo(e,i,s))}function Cc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var jx=(t=null,e={})=>({editor:n,view:o,tr:i,dispatch:s})=>{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(s&&t===null&&!Og(n.state.selection))return a(),!0;const l=_g(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},Fx=(t,e)=>n=>t.every((o,i)=>e(o,{...n,index:i})),Hx=(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 ks(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 Zr(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),Zr("",e,n)}if(o){if(n.errorOnInvalidContent){let s=!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=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Tn.fromSchema(l).parseSlice(ks(t),n.parseOptions):Tn.fromSchema(l).parse(ks(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=Tn.fromSchema(e);return n.slice?i.parseSlice(ks(t),n.parseOptions).content:i.parse(ks(t),n.parseOptions)}return Zr("",e,n)}var Wx=(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{Zr(e,s.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(g){c(g)}try{l=Zr(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 w=0;k.forEach((x,C,S,E)=>{w===0&&(w=E)}),g.setSelection(pe.near(g.doc.resolve(w),-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},Kx=()=>({state:t,dispatch:e})=>((n,o)=>{let i,s=n.selection,a=s instanceof ne;if(a){if(s.node.isTextblock||!An(n.doc,s.from))return!1;i=s.from}else if(i=is(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),qx=()=>({state:t,dispatch:e})=>((n,o)=>{let i,s=n.selection;if(s instanceof ne){if(s.node.isTextblock||!An(n.doc,s.to))return!1;i=s.to}else if(i=is(n.doc,s.to,1),i==null)return!1;return o&&o(n.tr.join(i).scrollIntoView()),!0})(t,e),Ux=()=>({state:t,dispatch:e})=>nm(t,e),Jx=()=>({state:t,dispatch:e})=>sm(t,e),Gx=()=>({state:t,dispatch:e,tr:n})=>{try{const o=is(t.doc,t.selection.$from.pos,-1);return o!=null&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},Yx=()=>({state:t,dispatch:e,tr:n})=>{try{const o=is(t.doc,t.selection.$from.pos,1);return o!=null&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},Xx=()=>({state:t,dispatch:e})=>((n,o)=>{let i=tm(n,void 0);if(!i)return!1;let s=Wl(i);return!!s&&om(n,s,o)})(t,e),Zx=()=>({state:t,dispatch:e})=>((n,o)=>{let i=im(n,void 0);if(!i)return!1;let s=Kl(i);return!!s&&om(n,s,o)})(t,e);function Vg(){return typeof navigator<"u"&&/Mac/.test(navigator.platform)}var Qx=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}`);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=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 Fn(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=>bs(u.node.attrs,n,{strict:!1}));return s?!!d.length:d.reduce((u,p)=>u+p.to-p.from,0)>=c}var eC=(t,e={})=>({state:n,dispatch:o})=>!!Fn(n,Ke(t,n.schema),e)&&((i,s)=>{let{$from:a,$to:l}=i.selection,c=a.blockRange(l),d=c&&Yo(c);return d!=null&&(s&&s(i.tr.lift(c,d).scrollIntoView()),!0)})(n,o),tC=()=>({state:t,dispatch:e})=>dm(t,e),nC=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 es(f.doc.resolve(h.$from.pos),f.doc.resolve(g),h.depth));const v=Yo(h);if(v==null)return!1;f.lift(h,v);let b=f.doc.resolve(f.mapping.map(m,-1)-1);return An(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 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,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 w=m.pos,x=w+g.nodeSize;return h.step(new Ge(w-(v?1:0),x+(b?1:0),w+1,x-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},oC=()=>({state:t,dispatch:e})=>lm(t,e);function ws(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,i)=>(n.includes(i)||(o[i]=t[i]),o),{})}var rC=(t,e)=>({tr:n,state:o,dispatch:i})=>{let s=null,a=null;const l=ws(typeof t=="string"?t:t.name,o.schema);return!!l&&(l==="node"&&(s=Ke(t,o.schema)),l==="mark"&&(a=gn(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,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)},iC=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),sC=()=>({tr:t,dispatch:e})=>{if(e){const n=new Nt(t.doc);t.setSelection(n)}return!0},aC=()=>({state:t,dispatch:e})=>rm(t,e),lC=()=>({state:t,dispatch:e})=>am(t,e),cC=()=>({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),dC=()=>({state:t,dispatch:e})=>Kw(t,e),uC=()=>({state:t,dispatch:e})=>Ww(t,e);function Sc(t,e,n={},o={}){return Zr(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:o.errorOnInvalidContent})}var pC=(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=Sc(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 Dg(t,e){const n=gn(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 Rg(t,e){const n=new Jf(t);return e.forEach(o=>{o.steps.forEach(i=>{n.step(i)})}),n}function xs(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 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 ke(t,e=void 0,...n){return Lg(t)?e?t.bind(e)(...n):t(...n):t}function Qr(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}=Qr(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 Cs(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 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 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,i=te(n,"priority")||100;return o>i?-1:o<i?1:0})}function jg(t){const e=Nc(Ec(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 Fg(t,e,n){const{from:o,to:i}=e,{blockSeparator:s=`
|
|
46
46
|
|
|
47
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 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=ws(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"?Dg(t,e):{}}function Kg(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 Bc(t,e,n){const o=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=xc(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 Tc(t,e){return e.nodes[t]||e.marks[t]||null}function Ss(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 Oc(t,e,n={}){const{empty:o,ranges:i}=t.selection,s=e?gn(e,t.schema):null;if(o)return!!(t.storedMarks||t.selection.$from.marks()).filter(u=>!s||s.name===u.type.name).find(u=>bs(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=>bs(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 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}=Qr(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 Es(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&&(Es(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function Jg(t){return t instanceof ne}var hC=(t,e={})=>({tr:n,state:o,dispatch:i})=>{const{selection:s}=n,{empty:a,ranges:l}=s,c=gn(t,o.schema);if(i)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(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,w,x)=>{if(y)return!1;if(k.isInline){const C=!x||x.type.allowsMarkType(p),S=!!p.isInSet(k.marks)||!k.marks.some(E=>E.type.excludes(p));y=C&&S}return!y}),y})}(o,n,c)},fC=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),mC=(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})=>!!hm(s,{...a,...e})(n)||l.clearNodes()).command(({state:l})=>hm(s,{...a,...e})(l,o)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},gC=t=>({tr:e,dispatch:n})=>{if(n){const{doc:o}=e,i=bo(t,0,o.content.size),s=ne.create(o,i);e.setSelection(s)}return!0},vC=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=bo(i,a,l),d=bo(s,a,l),u=se.create(o,c,d);e.setSelection(u)}return!0},yC=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 Gg(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 bC=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:o,editor:i})=>{const{selection:s,doc:a}=e,{$from:l,$to:c}=s,d=Ss(i.extensionManager.attributes,l.node().type.name,l.node().attrs);if(s instanceof ne&&s.node.isBlock)return!(!l.parentOffset||!un(a,l.pos)||(o&&(t&&Gg(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=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&&(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&&Gg(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return f},kC=(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,w={...Ss(h,c.node().type.name,c.node().attrs),...e},x=((a=l.contentMatch.defaultType)==null?void 0:a.createAndFill(w))||void 0;b=b.append($.from(l.createAndFill(null,x)||void 0));const C=c.before(c.depth-(y-1));n.replace(C,c.after(-k),new J(b,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(se.near(n.doc.resolve(S))),n.scrollIntoView()}return!0}const f=d.pos===c.end()?p.contentMatchAt(0).defaultType:null,m={...Ss(h,p.type.name,p.attrs),...e},g={...Ss(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(i){const{selection:b,storedMarks:y}=o,{splittableMarks:k}=s.extensionManager,w=y||b.$to.parentOffset&&b.$from.marks();if(n.split(c.pos,2,v).scrollIntoView(),!w||!i)return!0;const x=w.filter(C=>k.includes(C.type.name));n.ensureMarks(x)}return!0},_c=(t,e)=>{const n=xs(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)||!An(t.doc,n.pos)||(t.join(n.pos),!0)},Ac=(t,e)=>{const n=xs(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)||!An(t.doc,o)||(t.join(o),!0)},wC=(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),w=v||g.$to.parentOffset&&g.$from.marks();if(!k)return!1;const x=xs(C=>Ug(C.type.name,p))(g);if(k.depth>=1&&x&&k.depth-x.depth<=1){if(x.node.type===f)return d.liftListItem(m);if(Ug(x.node.type.name,p)&&f.validContent(x.node.content)&&l)return c().command(()=>(s.setNodeMarkup(x.pos,f),!0)).command(()=>_c(s,f)).command(()=>Ac(s,f)).run()}return n&&w&&l?c().command(()=>{const C=u().wrapInList(f,o),S=w.filter(E=>h.includes(E.type.name));return s.ensureMarks(S),!!C||d.clearNodes()}).wrapInList(f,o).command(()=>_c(s,f)).command(()=>Ac(s,f)).run():c().command(()=>!!u().wrapInList(f,o)||d.clearNodes()).wrapInList(f,o).command(()=>_c(s,f)).command(()=>Ac(s,f)).run()},xC=(t,e={},n={})=>({state:o,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,a=gn(t,o.schema);return Oc(o,a,e)?i.unsetMark(a,{extendEmptyMarkRange:s}):i.setMark(a,e)},CC=(t,e,n={})=>({state:o,commands:i})=>{const s=Ke(t,o.schema),a=Ke(e,o.schema),l=Fn(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})},SC=(t,e={})=>({state:n,commands:o})=>{const i=Ke(t,n.schema);return Fn(n,i,e)?o.lift(i):o.wrapIn(i,e)},EC=()=>({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},MC=()=>({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},NC=(t,e={})=>({tr:n,state:o,dispatch:i})=>{var s;const{extendEmptyMarkRange:a=!1}=e,{selection:l}=n,c=gn(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=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},BC=(t,e={})=>({tr:n,state:o,dispatch:i})=>{let s=null,a=null;const l=ws(typeof t=="string"?t:t.name,o.schema);return!!l&&(l==="node"&&(s=Ke(t,o.schema)),l==="mark"&&(a=gn(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)},TC=(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&&Rl(u,i,s);return!!p&&(l&&l(a.tr.wrap(u,p).scrollIntoView()),!0)}}(Ke(t,n.schema),e)(n,o),OC=(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 w=y.resolve(f.start-2);b=new es(w,w,f.depth),f.endIndex<f.parent.childCount&&(f=new es(f.$from,y.resolve(f.$to.end(f.depth)),f.depth)),v=!0}let k=Rl(b,m,g,f);return!!k&&(h&&function(w,x,C,S,E){let M=$.empty;for(let _=C.length-1;_>=0;_--)M=$.from(C[_].type.create(C[_].attrs,M));w.step(new Ge(x.start-(S?2:0),x.end,x.start,x.end,new J(M,0,0),C.length,!0));let N=0;for(let _=0;_<C.length;_++)C[_].type==E&&(N=_+1);let O=C.length-N,R=x.start+C.length-(S?2:0),z=x.parent;for(let _=x.startIndex,I=x.endIndex,T=!0;_<I;_++,T=!1)!T&&un(w.doc,R,O)&&(w.split(R,O),R+=2*O),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),_C=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={}}},Ms=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)==null||e}};function Ns(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 w,x;const C=((x=(w=v.type.spec).toText)==null?void 0:x.call(w,{node:v,pos:b,parent:y,index:k}))||v.textContent||"%leaf%";m+=v.isAtom&&!v.isText?C:C.slice(0,Math.max(0,g-b))}),m})(d)+s;return a.forEach(h=>{if(u)return;const f=((w,x)=>{if(wc(x))return x.exec(w);const C=x(w);if(!C)return null;const S=[C.text];return S.index=C.index,S.input=w,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=vs({state:c.state,transaction:m}),v={from:o-(f[0].length-s.length),to:i},{commands:b,chain:y,can:k}=new ys({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 Bs(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 Bs(t)&&Bs(e)&&Object.keys(e).forEach(o=>{Bs(e[o])&&Bs(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{...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:()=>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 sy extends Vc{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new sy(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)}},AC=class{constructor(t){this.find=t.find,this.handler=t.handler}},Ts=null,Os=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=jg(t),this.schema=function(n,o){var i;const s=zg(n),{nodeExtensions:a,markExtensions:l}=Qr(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=Pg({...n.reduce((y,k)=>{const w=te(k,"extendNodeSchema",f);return{...y,...w?w(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,w;return[y.name,{default:(k=y==null?void 0:y.attribute)==null?void 0:k.default,validate:(w=y==null?void 0:y.attribute)==null?void 0:w.validate}]}))}),g=ke(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:Cs(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=Pg({...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=>$g(b,h)));const v=te(p,"renderHTML",f);return v&&(m.toDOM=b=>v({mark:b,HTMLAttributes:Cs(b,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)},i=[],s=te(n,"addKeyboardShortcuts",o);let a={};if(n.type==="mark"&&te(n,"exitable",o)&&(a.ArrowRight=()=>Hn.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:Mg(a)}});i.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,b=new Le({state:{init:()=>null,apply(y,k,w){const x=y.getMeta(b);if(x)return x;const C=y.getMeta("applyInputRules");return C&&setTimeout(()=>{let{text:S}=C;typeof S=="string"||(S=Mc($.from(S),w.schema));const{from:E}=C,M=E+S.length;Ns({editor:g,from:E,to:M,text:S,rules:v,plugin:b})}),y.selectionSet||y.docChanged?null:k}},props:{handleTextInput:(y,k,w,x)=>Ns({editor:g,from:k,to:w,text:x,rules:v,plugin:b}),handleDOMEvents:{compositionend:y=>(setTimeout(()=>{const{$cursor:k}=y.state.selection;k&&Ns({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:w}=y.state.selection;return!!w&&Ns({editor:g,from:w.pos,to:w.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(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,b=null,y=!1,k=!1,w=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null;try{v=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{v=null}const x=({state:C,from:S,to:E,rule:M,pasteEvt:N})=>{const O=C.tr,R=vs({state:C,transaction:O});if(function(z){const{editor:_,state:I,from:T,to:V,rule:P,pasteEvent:A,dropEvent:L}=z,{commands:j,chain:q,can:H}=new ys({editor:_,state:I}),U=[];return I.doc.nodesBetween(T,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,Z=Math.max(T,G),ie=Math.min(V,G+Be);if(Z>=ie)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-G,ie-G,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})&&O.steps.length){try{v=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{v=null}return w=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,O}};return g.map(C=>new Le({view(S){const E=N=>{var O;b=(O=S.dom.parentElement)!=null&&O.contains(N.target)?S.dom.parentElement:null,b&&(Ts=m)},M=()=>{Ts&&(Ts=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(k=b===S.dom.parentElement,v=E,!k){const M=Ts;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 w=E,y=!!(N!=null&&N.includes("data-pm-slice")),!1}}},appendTransaction:(S,E,M)=>{const N=S[0],O=N.getMeta("uiEvent")==="paste"&&!y,R=N.getMeta("uiEvent")==="drop"&&!k,z=N.getMeta("applyPasteRules"),_=!!z;if(!O&&!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 x({rule:C,state:M,from:P,to:{b:A},pasteEvt:L})}const I=E.doc.content.findDiffStart(M.doc.content),T=E.doc.content.findDiffEnd(M.doc.content);return typeof I=="number"&&T&&I!==T.b?x({rule:C,state:M,from:I,to:T,pasteEvt:w}):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 zg(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Qr(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=Cs(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}=Qr(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:gn(n.name,this.schema)},s=te(n,"addMarkView",i);return s?[n.name,(a,l,c)=>{const d=Cs(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 w=v.mapping.map(k),x=v.mapping.map(k)+y.nodeSize;let C=null;if(y.marks.forEach(E=>{if(E!==b)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(w,x,p.type),v.addMark(w,x,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=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)})}};Os.resolve=jg,Os.sort=Nc,Os.flatten=Ec,kc({},{ClipboardTextSerializer:()=>Xg,Commands:()=>Zg,Delete:()=>Qg,Drop:()=>ev,Editable:()=>tv,FocusEvents:()=>ov,Keymap:()=>rv,Paste:()=>iv,Tabindex:()=>sv,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:i}=e,{ranges:s}=i,a=Math.min(...s.map(d=>d.$from.pos)),l=Math.max(...s.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,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=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),b=p.slice(f).map(h.to),y=p.invert().map(v,-1),k=p.invert().map(b),w=(m=u.doc.nodeAt(v-1))==null?void 0:m.marks.some(C=>C.eq(h.mark)),x=(g=u.doc.nodeAt(b))==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:k},newRange:{from:v,to:b},partial:!!(x||w),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()}}),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: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 Cc()||Vg()?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||!Es(n.doc))return;const u=n.tr,p=vs({state:n,transaction:u}),{commands:h}=new ys({editor:this.editor,state:p});return h.clearNodes(),u.steps.length?u:void 0}})]}}),iv=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})}}})]}}),sv=qe.create({name:"tabindex",addProseMirrorPlugins(){return[new Le({key:new Ye("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),VC=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)}},IC=class extends _C{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=_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 {
|
|
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(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,b=null,y=!1,k=!1,w=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null;try{v=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{v=null}const x=({state:C,from:S,to:E,rule:M,pasteEvt:N})=>{const O=C.tr,R=vs({state:C,transaction:O});if(function(z){const{editor:_,state:I,from:T,to:V,rule:P,pasteEvent:A,dropEvent:L}=z,{commands:j,chain:q,can:H}=new ys({editor:_,state:I}),U=[];return I.doc.nodesBetween(T,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,Z=Math.max(T,G),ie=Math.min(V,G+Be);if(Z>=ie)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-G,ie-G,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})&&O.steps.length){try{v=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{v=null}return w=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,O}};return g.map(C=>new Le({view(S){const E=N=>{var O;b=(O=S.dom.parentElement)!=null&&O.contains(N.target)?S.dom.parentElement:null,b&&(Ts=m)},M=()=>{Ts&&(Ts=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(k=b===S.dom.parentElement,v=E,!k){const M=Ts;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 w=E,y=!!(N!=null&&N.includes("data-pm-slice")),!1}}},appendTransaction:(S,E,M)=>{const N=S[0],O=N.getMeta("uiEvent")==="paste"&&!y,R=N.getMeta("uiEvent")==="drop"&&!k,z=N.getMeta("applyPasteRules"),_=!!z;if(!O&&!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 x({rule:C,state:M,from:P,to:{b:A},pasteEvt:L})}const I=E.doc.content.findDiffStart(M.doc.content),T=E.doc.content.findDiffEnd(M.doc.content);return typeof I=="number"&&T&&I!==T.b?x({rule:C,state:M,from:I,to:T,pasteEvt:w}):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 zg(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Qr(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=Cs(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}=Qr(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:gn(n.name,this.schema)},s=te(n,"addMarkView",i);return s?[n.name,(a,l,c)=>{const d=Cs(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 w=v.mapping.map(k),x=v.mapping.map(k)+y.nodeSize;let C=null;if(y.marks.forEach(E=>{if(E!==b)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(w,x,p.type),v.addMark(w,x,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=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)})}};Os.resolve=jg,Os.sort=Nc,Os.flatten=Ec,kc({},{ClipboardTextSerializer:()=>Xg,Commands:()=>Zg,Delete:()=>Qg,Drop:()=>ev,Editable:()=>tv,FocusEvents:()=>ov,Keymap:()=>rv,Paste:()=>iv,Tabindex:()=>sv,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:i}=e,{ranges:s}=i,a=Math.min(...s.map(d=>d.$from.pos)),l=Math.max(...s.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,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=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),b=p.slice(f).map(h.to),y=p.invert().map(v,-1),k=p.invert().map(b),w=(m=u.doc.nodeAt(v-1))==null?void 0:m.marks.some(C=>C.eq(h.mark)),x=(g=u.doc.nodeAt(b))==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:k},newRange:{from:v,to:b},partial:!!(x||w),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()}}),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: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 Cc()||Vg()?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||!Es(n.doc))return;const u=n.tr,p=vs({state:n,transaction:u}),{commands:h}=new ys({editor:this.editor,state:p});return h.clearNodes(),u.steps.length?u:void 0}})]}}),iv=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})}}})]}}),sv=qe.create({name:"tabindex",addProseMirrorPlugins(){return[new Le({key:new Ye("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),VC=class ur{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 ur(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 ur(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 ur(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 ur(l,this.editor,i,i?n:null);i&&(c.actualDepth=this.depth+1),e.push(new ur(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)}},IC=class extends _C{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=_g(e,this.options.autofocus);this.editorState=Qo.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
|
|
|
@@ -117,7 +117,7 @@ img.ProseMirror-separator {
|
|
|
117
117
|
display: block;
|
|
118
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=Lg(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?[tv,Xg.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),Zg,ov,rv,sv,ev,iv,Qg].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 Os(n,this)}createCommandManager(){this.commandManager=new ys({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Sc(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=Sc(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){var e;this.editorView=new kg(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 Wg(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 Fn(i,null,a)||Oc(i,null,a);const l=ws(s,i.schema);return l==="node"?Fn(i,s,a):l==="mark"&&Oc(i,s,a)}(this.state,n,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Mc(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
|
|
119
119
|
|
|
120
|
-
`,textSerializers:n={}}=t||{};return function(o,i){return Fg(o,{from:0,to:o.content.size},i)}(this.state.doc,{blockSeparator:e,textSerializers:{...Hg(this.schema),...n}})}get isEmpty(){return Es(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 VC(e,this)}get $doc(){return this.$pos(0)}};function
|
|
120
|
+
`,textSerializers:n={}}=t||{};return function(o,i){return Fg(o,{from:0,to:o.content.size},i)}(this.state.doc,{blockSeparator:e,textSerializers:{...Hg(this.schema),...n}})}get isEmpty(){return Es(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 VC(e,this)}get $doc(){return this.$pos(0)}};function ar(t){return new Ms({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(Bc(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 av(t){return new Ms({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 Ic(t){return new Ms({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 lr(t){return new Ms({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&&Rl(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&&An(a.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(o,d))&&a.join(n.from-1)},undoable:t.undoable})}function Dc(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 Rc(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 DC(t){const{nodeName:e,name:n,parseAttributes:o=Dc,serializeAttributes:i=Rc,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 RC(t){const{nodeName:e,name:n,getContent:o,parseAttributes:i=Dc,serializeAttributes:s=Rc,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 w=v.length;let x="";const C=/^:::([\w-]*)(\s.*)?/gm,S=u.slice(w);for(C.lastIndex=0;;){const E=C.exec(S);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 O=S.slice(0,M);x=O.trim();const R=u.slice(0,w+M+E[0].length);let z=[];if(x)if(l==="block")for(z=h.blockTokens(O),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(x);return{type:e,raw:R,attributes:y,content:x,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
|
|
|
@@ -134,7 +134,7 @@ ${g}
|
|
|
134
134
|
`)}kc({},{createAtomBlockMarkdownSpec:()=>DC,createBlockMarkdownSpec:()=>RC,createInlineMarkdownSpec:()=>$C,parseAttributes:()=>Dc,parseIndentedBlocks:()=>Lc,renderNestedMarkdownContent:()=>zc,serializeAttributes:()=>Rc});var bt=class ly extends Vc{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new ly(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function ko(t){return new AC({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(Bc(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 lv(t){return r.customRef((e,n)=>({get:()=>(e(),t),set(o){t=o,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var PC=class extends IC{constructor(t={}){return super(t),this.contentComponent=null,this.appContext=null,this.reactiveState=lv(this.view.state),this.reactiveExtensionStorage=lv(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}},jC=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 _s=(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]},FC=/^\s*>\s$/,HC=bt.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:t}){return _s("blockquote",{...Fe(this.options.HTMLAttributes,t),children:_s("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
135
|
`).map(s=>`> ${s}`).join(`
|
|
136
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[
|
|
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[lr({find:FC,type:this.type})]}}),WC=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,KC=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,qC=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,UC=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,JC=Hn.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 _s("strong",{...Fe(this.options.HTMLAttributes,t),children:_s("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[ar({find:WC,type:this.type}),ar({find:qC,type:this.type})]},addPasteRules(){return[ko({find:KC,type:this.type}),ko({find:UC,type:this.type})]}}),GC=/(^|[^`])`([^`]+)`(?!`)$/,YC=/(^|[^`])`([^`]+)`(?!`)/g,XC=Hn.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[ar({find:GC,type:this.type})]},addPasteRules(){return[ko({find:YC,type:this.type})]}}),ZC=/^```([a-z]+)?[\s\n]$/,QC=/^~~~([a-z]+)?[\s\n]$/,eS=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
138
|
`):`\`\`\`${i}
|
|
139
139
|
|
|
140
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,`
|
|
@@ -155,14 +155,14 @@ ${g}
|
|
|
155
155
|
|
|
156
156
|
`):""}),nS=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: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()}}}),oS=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=>Ic({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),rS=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 Jg(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[av({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),iS=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,sS=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,aS=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,lS=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,cS=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[sr({find:iS,type:this.type}),sr({find:aS,type:this.type})]},addPasteRules(){return[ko({find:sS,type:this.type}),ko({find:lS,type:this.type})]}});const $c="numeric",Pc="ascii",jc="alpha",ei="asciinumeric",ti="alphanumeric",Fc="domain",cv="emoji",dS="scheme",uS="slashscheme",Hc="whitespace";function pS(t,e){return t in e||(e[t]=[]),e[t]}function wo(t,e,n){e[$c]&&(e[ei]=!0,e[ti]=!0),e[Pc]&&(e[ei]=!0,e[jc]=!0),e[ei]&&(e[ti]=!0),e[jc]&&(e[ti]=!0),e[ti]&&(e[Fc]=!0),e[cv]&&(e[Fc]=!0);for(const o in e){const i=pS(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&&wo(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);wo(s,c,o)}else n&&wo(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),dv=(t,e,n,o,i)=>t.ts(e,n,o,i),F=(t,e,n,o,i)=>t.tt(e,n,o,i),vn="WORD",Wc="UWORD",uv="ASCIINUMERICAL",pv="ALPHANUMERICAL",ni="LOCALHOST",Kc="TLD",qc="UTLD",As="SCHEME",lr="SLASH_SCHEME",Uc="NUM",Jc="WS",Gc="NL",oi="OPENBRACE",ri="CLOSEBRACE",Vs="OPENBRACKET",Is="CLOSEBRACKET",Ds="OPENPAREN",Rs="CLOSEPAREN",Ls="OPENANGLEBRACKET",zs="CLOSEANGLEBRACKET",$s="FULLWIDTHLEFTPAREN",Ps="FULLWIDTHRIGHTPAREN",js="LEFTCORNERBRACKET",Fs="RIGHTCORNERBRACKET",Hs="LEFTWHITECORNERBRACKET",Ws="RIGHTWHITECORNERBRACKET",Ks="FULLWIDTHLESSTHAN",qs="FULLWIDTHGREATERTHAN",Us="AMPERSAND",Js="APOSTROPHE",Gs="ASTERISK",Wn="AT",Ys="BACKSLASH",Xs="BACKTICK",Zs="CARET",Kn="COLON",Yc="COMMA",Qs="DOLLAR",Zt="DOT",ea="EQUALS",Xc="EXCLAMATION",Rt="HYPHEN",ii="PERCENT",ta="PIPE",na="PLUS",oa="POUND",si="QUERY",Zc="QUOTE",hv="FULLWIDTHMIDDLEDOT",Qc="SEMI",Qt="SLASH",ai="TILDE",ra="UNDERSCORE",fv="EMOJI",ia="SYM";var mv=Object.freeze({__proto__:null,ALPHANUMERICAL:pv,AMPERSAND:Us,APOSTROPHE:Js,ASCIINUMERICAL:uv,ASTERISK:Gs,AT:Wn,BACKSLASH:Ys,BACKTICK:Xs,CARET:Zs,CLOSEANGLEBRACKET:zs,CLOSEBRACE:ri,CLOSEBRACKET:Is,CLOSEPAREN:Rs,COLON:Kn,COMMA:Yc,DOLLAR:Qs,DOT:Zt,EMOJI:fv,EQUALS:ea,EXCLAMATION:Xc,FULLWIDTHGREATERTHAN:qs,FULLWIDTHLEFTPAREN:$s,FULLWIDTHLESSTHAN:Ks,FULLWIDTHMIDDLEDOT:hv,FULLWIDTHRIGHTPAREN:Ps,HYPHEN:Rt,LEFTCORNERBRACKET:js,LEFTWHITECORNERBRACKET:Hs,LOCALHOST:ni,NL:Gc,NUM:Uc,OPENANGLEBRACKET:Ls,OPENBRACE:oi,OPENBRACKET:Vs,OPENPAREN:Ds,PERCENT:ii,PIPE:ta,PLUS:na,POUND:oa,QUERY:si,QUOTE:Zc,RIGHTCORNERBRACKET:Fs,RIGHTWHITECORNERBRACKET:Ws,SCHEME:As,SEMI:Qc,SLASH:Qt,SLASH_SCHEME:lr,SYM:ia,TILDE:ai,TLD:Kc,UNDERSCORE:ra,UTLD:qc,UWORD:Wc,WORD:vn,WS:Jc});const yn=/[a-z]/,li=new RegExp("\\p{L}","u"),ed=new RegExp("\\p{Emoji}","u"),bn=/\d/,td=/\s/;let sa=null,aa=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,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 qn(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 vv(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 ci={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({},ci);t&&(n=Object.assign(n,t instanceof nd?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 yv(t){return t}function bv(t,e){this.t="token",this.v=t,this.tk=e}function la(t,e){class n extends bv{constructor(i,s){super(i,s),this.t=t}}for(const o in e)n.prototype[o]=e[o];return n.t=t,n}nd.prototype={o:ci,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]:ci[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)}},bv.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=ci.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 kv=la("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),wv=la("text"),hS=la("nl"),ca=la("url",{isLink:!0,toHref(t=ci.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==ni&&t[1].t===Kn}}),Lt=t=>new kt(t);function od(t,e,n){const o=n[0].s,i=n[n.length-1].e;return new t(e.slice(o,i),n)}const fS=typeof console<"u"&&console&&console.warn||(()=>{}),De={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function xv(t,e=!1){if(De.initialized&&fS(`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()}}}),oS=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=>Ic({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),rS=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 Jg(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[av({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),iS=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,sS=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,aS=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,lS=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,cS=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[ar({find:iS,type:this.type}),ar({find:aS,type:this.type})]},addPasteRules(){return[ko({find:sS,type:this.type}),ko({find:lS,type:this.type})]}});const $c="numeric",Pc="ascii",jc="alpha",ei="asciinumeric",ti="alphanumeric",Fc="domain",cv="emoji",dS="scheme",uS="slashscheme",Hc="whitespace";function pS(t,e){return t in e||(e[t]=[]),e[t]}function wo(t,e,n){e[$c]&&(e[ei]=!0,e[ti]=!0),e[Pc]&&(e[ei]=!0,e[jc]=!0),e[ei]&&(e[ti]=!0),e[jc]&&(e[ti]=!0),e[ti]&&(e[Fc]=!0),e[cv]&&(e[Fc]=!0);for(const o in e){const i=pS(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&&wo(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);wo(s,c,o)}else n&&wo(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),dv=(t,e,n,o,i)=>t.ts(e,n,o,i),F=(t,e,n,o,i)=>t.tt(e,n,o,i),vn="WORD",Wc="UWORD",uv="ASCIINUMERICAL",pv="ALPHANUMERICAL",ni="LOCALHOST",Kc="TLD",qc="UTLD",As="SCHEME",cr="SLASH_SCHEME",Uc="NUM",Jc="WS",Gc="NL",oi="OPENBRACE",ri="CLOSEBRACE",Vs="OPENBRACKET",Is="CLOSEBRACKET",Ds="OPENPAREN",Rs="CLOSEPAREN",Ls="OPENANGLEBRACKET",zs="CLOSEANGLEBRACKET",$s="FULLWIDTHLEFTPAREN",Ps="FULLWIDTHRIGHTPAREN",js="LEFTCORNERBRACKET",Fs="RIGHTCORNERBRACKET",Hs="LEFTWHITECORNERBRACKET",Ws="RIGHTWHITECORNERBRACKET",Ks="FULLWIDTHLESSTHAN",qs="FULLWIDTHGREATERTHAN",Us="AMPERSAND",Js="APOSTROPHE",Gs="ASTERISK",Wn="AT",Ys="BACKSLASH",Xs="BACKTICK",Zs="CARET",Kn="COLON",Yc="COMMA",Qs="DOLLAR",Zt="DOT",ea="EQUALS",Xc="EXCLAMATION",Rt="HYPHEN",ii="PERCENT",ta="PIPE",na="PLUS",oa="POUND",si="QUERY",Zc="QUOTE",hv="FULLWIDTHMIDDLEDOT",Qc="SEMI",Qt="SLASH",ai="TILDE",ra="UNDERSCORE",fv="EMOJI",ia="SYM";var mv=Object.freeze({__proto__:null,ALPHANUMERICAL:pv,AMPERSAND:Us,APOSTROPHE:Js,ASCIINUMERICAL:uv,ASTERISK:Gs,AT:Wn,BACKSLASH:Ys,BACKTICK:Xs,CARET:Zs,CLOSEANGLEBRACKET:zs,CLOSEBRACE:ri,CLOSEBRACKET:Is,CLOSEPAREN:Rs,COLON:Kn,COMMA:Yc,DOLLAR:Qs,DOT:Zt,EMOJI:fv,EQUALS:ea,EXCLAMATION:Xc,FULLWIDTHGREATERTHAN:qs,FULLWIDTHLEFTPAREN:$s,FULLWIDTHLESSTHAN:Ks,FULLWIDTHMIDDLEDOT:hv,FULLWIDTHRIGHTPAREN:Ps,HYPHEN:Rt,LEFTCORNERBRACKET:js,LEFTWHITECORNERBRACKET:Hs,LOCALHOST:ni,NL:Gc,NUM:Uc,OPENANGLEBRACKET:Ls,OPENBRACE:oi,OPENBRACKET:Vs,OPENPAREN:Ds,PERCENT:ii,PIPE:ta,PLUS:na,POUND:oa,QUERY:si,QUOTE:Zc,RIGHTCORNERBRACKET:Fs,RIGHTWHITECORNERBRACKET:Ws,SCHEME:As,SEMI:Qc,SLASH:Qt,SLASH_SCHEME:cr,SYM:ia,TILDE:ai,TLD:Kc,UNDERSCORE:ra,UTLD:qc,UWORD:Wc,WORD:vn,WS:Jc});const yn=/[a-z]/,li=new RegExp("\\p{L}","u"),ed=new RegExp("\\p{Emoji}","u"),bn=/\d/,td=/\s/;let sa=null,aa=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,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 qn(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 vv(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 ci={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({},ci);t&&(n=Object.assign(n,t instanceof nd?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 yv(t){return t}function bv(t,e){this.t="token",this.v=t,this.tk=e}function la(t,e){class n extends bv{constructor(i,s){super(i,s),this.t=t}}for(const o in e)n.prototype[o]=e[o];return n.t=t,n}nd.prototype={o:ci,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]:ci[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)}},bv.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=ci.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 kv=la("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),wv=la("text"),hS=la("nl"),ca=la("url",{isLink:!0,toHref(t=ci.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==ni&&t[1].t===Kn}}),Lt=t=>new kt(t);function od(t,e,n){const o=n[0].s,i=n[n.length-1].e;return new t(e.slice(o,i),n)}const fS=typeof console<"u"&&console&&console.warn||(()=>{}),De={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function xv(t,e=!1){if(De.initialized&&fS(`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
161
|
3. "-" cannot repeat`);De.customSchemes.push([t,e])}function rd(t){return De.initialized||function(){De.scanner=function(e=[]){const n={};kt.groups=n;const o=new kt;sa==null&&(sa=vv("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),aa==null&&(aa=vv("ελ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,"'",Js),F(o,"{",oi),F(o,"}",ri),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,">",qs),F(o,"&",Us),F(o,"*",Gs),F(o,"@",Wn),F(o,"`",Xs),F(o,"^",Zs),F(o,":",Kn),F(o,",",Yc),F(o,"$",Qs),F(o,".",Zt),F(o,"=",ea),F(o,"!",Xc),F(o,"-",Rt),F(o,"%",ii),F(o,"|",ta),F(o,"+",na),F(o,"#",oa),F(o,"?",si),F(o,'"',Zc),F(o,"/",Qt),F(o,";",Qc),F(o,"~",ai),F(o,"_",ra),F(o,"\\",Ys),F(o,"・",hv);const i=ze(o,bn,Uc,{[$c]:!0});ze(i,bn,i);const s=ze(i,yn,uv,{[ei]:!0}),a=ze(i,li,pv,{[ti]:!0}),l=ze(o,yn,vn,{[Pc]:!0});ze(l,bn,s),ze(l,yn,l),ze(s,bn,s),ze(s,yn,s);const c=ze(o,li,Wc,{[jc]:!0});ze(c,yn),ze(c,bn,a),ze(c,li,c),ze(a,bn,a),ze(a,yn),ze(a,li,a);const d=F(o,`
|
|
162
162
|
`,Gc,{[Hc]:!0}),u=F(o,"\r",Jc,{[Hc]:!0}),p=ze(o,td,Jc,{[Hc]:!0});F(o,"",p),F(u,`
|
|
163
163
|
`,d),F(u,"",p),ze(u,td,p),F(p,"\r"),F(p,`
|
|
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],[bn,s]],g=[[yn,null],[li,c],[bn,a]];for(let v=0;v<sa.length;v++)qn(o,sa[v],Kc,vn,m);for(let v=0;v<aa.length;v++)qn(o,aa[v],qc,Wc,g);wo(Kc,{tld:!0,ascii:!0},n),wo(qc,{utld:!0,alpha:!0},n),qn(o,"file",As,vn,m),qn(o,"mailto",As,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(As,{scheme:!0,ascii:!0},n),wo(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]?{[dS]:!0}:{[uS]:!0};b.indexOf("-")>=0?y[Fc]=!0:yn.test(b)?bn.test(b)?y[ei]=!0:y[Pc]=!0:y[$c]=!0,dv(o,b,b,y)}return dv(o,"localhost",ni,{ascii:!0}),o.jd=new kt(ia),{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([Us,Gs,Wn,Ys,Xs,Zs,Qs,ea,Rt,Uc,ii,ta,na,oa,Qt,ia,ai,ra]),o=[Js,Kn,Yc,Zt,Xc,ii,si,Zc,Qc,Ls,zs,oi,ri,Is,Vs,Ds,Rs,$s,Ps,js,Fs,Hs,Ws,Ks,qs],i=[Us,Js,Gs,Ys,Xs,Zs,Qs,ea,Rt,oi,ri,ii,ta,na,oa,si,Qt,ia,ai,ra],s=Lt(),a=F(s,ai);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,Wn);F(a,Wn,u),F(c,Wn,u),F(d,Wn,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(kv);he(f,e.tld,m),he(f,e.utld,m),F(u,ni,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,kv);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(ca);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,Wn,u);const w=F(k,Kn),x=Lt(ca);he(w,e.numeric,x);const C=Lt(ca),S=Lt();he(C,n,C),he(C,o,S),he(S,n,C),he(S,o,S),F(k,Qt,C),F(x,Qt,C);const E=F(c,Kn),M=F(d,Kn),N=F(M,Qt),O=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,C),F(E,Qt,C),F(E,si,C),he(O,e.domain,C),he(O,n,C),F(O,Qt,C);const R=[[oi,ri],[Vs,Is],[Ds,Rs],[Ls,zs],[$s,Ps],[js,Fs],[Hs,Ws],[Ks,qs]];for(let z=0;z<R.length;z++){const[_,I]=R[z],T=F(C,_);F(S,_,T),F(T,I,C);const V=Lt(ca);he(T,n,V);const P=Lt();he(T,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(s,ni,k),F(s,Gc,hS),{start:s,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 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(od(wv,n,l)),l=[]),s-=f,p-=f;const m=h.t,g=o.slice(s-p,s);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),i=rd(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}rd.scan=gv;var id="[\0- -\u2029 ]",mS=new RegExp(id),gS=new RegExp(`${id}$`),vS=new RegExp(id,"g");function xo(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(vS,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var yS=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(){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)=>!!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[ko({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:o}=this.options,i=Cv(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!xo(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=>!!xo(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 Kg(Rg(s.doc,[...i])).forEach(({newRange:u})=>{const p=function(g,v){const b=[];return g.nodesBetween(v.from,v.to,(y,k)=>{(w=>w.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(!gS.test(g))return;h=p[0],f=a.doc.textBetween(h.pos,u.to,void 0," ")}if(h&&f){const g=f.split(mS).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=rd(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=>{Bc(k.from,k.to,a.doc).some(w=>w.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=Wg(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=Cv(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}}),bS=Object.defineProperty,Sv="textStyle",Ev=/^\s*([-+*])\s$/,Mv=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(Sv)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=
|
|
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],[bn,s]],g=[[yn,null],[li,c],[bn,a]];for(let v=0;v<sa.length;v++)qn(o,sa[v],Kc,vn,m);for(let v=0;v<aa.length;v++)qn(o,aa[v],qc,Wc,g);wo(Kc,{tld:!0,ascii:!0},n),wo(qc,{utld:!0,alpha:!0},n),qn(o,"file",As,vn,m),qn(o,"mailto",As,vn,m),qn(o,"http",cr,vn,m),qn(o,"https",cr,vn,m),qn(o,"ftp",cr,vn,m),qn(o,"ftps",cr,vn,m),wo(As,{scheme:!0,ascii:!0},n),wo(cr,{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]?{[dS]:!0}:{[uS]:!0};b.indexOf("-")>=0?y[Fc]=!0:yn.test(b)?bn.test(b)?y[ei]=!0:y[Pc]=!0:y[$c]=!0,dv(o,b,b,y)}return dv(o,"localhost",ni,{ascii:!0}),o.jd=new kt(ia),{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([Us,Gs,Wn,Ys,Xs,Zs,Qs,ea,Rt,Uc,ii,ta,na,oa,Qt,ia,ai,ra]),o=[Js,Kn,Yc,Zt,Xc,ii,si,Zc,Qc,Ls,zs,oi,ri,Is,Vs,Ds,Rs,$s,Ps,js,Fs,Hs,Ws,Ks,qs],i=[Us,Js,Gs,Ys,Xs,Zs,Qs,ea,Rt,oi,ri,ii,ta,na,oa,si,Qt,ia,ai,ra],s=Lt(),a=F(s,ai);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,Wn);F(a,Wn,u),F(c,Wn,u),F(d,Wn,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(kv);he(f,e.tld,m),he(f,e.utld,m),F(u,ni,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,kv);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(ca);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,Wn,u);const w=F(k,Kn),x=Lt(ca);he(w,e.numeric,x);const C=Lt(ca),S=Lt();he(C,n,C),he(C,o,S),he(S,n,C),he(S,o,S),F(k,Qt,C),F(x,Qt,C);const E=F(c,Kn),M=F(d,Kn),N=F(M,Qt),O=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,C),F(E,Qt,C),F(E,si,C),he(O,e.domain,C),he(O,n,C),F(O,Qt,C);const R=[[oi,ri],[Vs,Is],[Ds,Rs],[Ls,zs],[$s,Ps],[js,Fs],[Hs,Ws],[Ks,qs]];for(let z=0;z<R.length;z++){const[_,I]=R[z],T=F(C,_);F(S,_,T),F(T,I,C);const V=Lt(ca);he(T,n,V);const P=Lt();he(T,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(s,ni,k),F(s,Gc,hS),{start:s,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 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(od(wv,n,l)),l=[]),s-=f,p-=f;const m=h.t,g=o.slice(s-p,s);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),i=rd(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}rd.scan=gv;var id="[\0- -\u2029 ]",mS=new RegExp(id),gS=new RegExp(`${id}$`),vS=new RegExp(id,"g");function xo(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(vS,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var yS=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(){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)=>!!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[ko({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:o}=this.options,i=Cv(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!xo(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=>!!xo(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 Kg(Rg(s.doc,[...i])).forEach(({newRange:u})=>{const p=function(g,v){const b=[];return g.nodesBetween(v.from,v.to,(y,k)=>{(w=>w.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(!gS.test(g))return;h=p[0],f=a.doc.textBetween(h.pos,u.to,void 0," ")}if(h&&f){const g=f.split(mS).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=rd(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=>{Bc(k.from,k.to,a.doc).some(w=>w.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=Wg(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=Cv(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}}),bS=Object.defineProperty,Sv="textStyle",Ev=/^\s*([-+*])\s$/,Mv=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(Sv)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=lr({find:Ev,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=lr({find:Ev,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Sv),editor:this.editor})),[t]}}),Nv=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)=>zc(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)bS(t,n,{get:e[n],enumerable:!0})})({},{findListItemPos:()=>di,getNextListDepth:()=>sd,handleBackspace:()=>ad,handleDelete:()=>ld,hasListBefore:()=>Bv,hasListItemAfter:()=>kS,hasListItemBefore:()=>Tv,listItemHasSubList:()=>Ov,nextListIsDeeper:()=>_v,nextListIsHigher:()=>Av});var di=(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}},sd=(t,e)=>{const n=di(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},Bv=(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))},Tv=(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},Ov=(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},ad=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Fn(t.state,e)&&Bv(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(!Fn(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=di(e,t.state);if(!o)return!1;const i=t.state.doc.resolve(o.$pos.pos-2).node(o.depth),s=Ov(e,t.state,i);return Tv(e,t.state)&&!s?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},_v=(t,e)=>{const n=sd(t,e),o=di(t,e);return!(!o||!n)&&n>o.depth},Av=(t,e)=>{const n=sd(t,e),o=di(t,e);return!(!o||!n)&&n<o.depth},ld=(t,e)=>{if(!Fn(t.state,e)||!((s,a)=>{const{$from:l,$to:c,$anchor:d}=s.selection;if(a){const u=xs(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))&&(_v(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():Av(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward())},kS=(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},Vv=qe.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&&ld(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&&ld(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&&ad(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&&ad(t,n,o)&&(e=!0)}),e}}}}),Iv=/^(\s*)(\d+)\.\s+(.*)$/,wS=/^\s/;function Dv(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
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=Dv(h,f,n);d.push({type:"list",ordered:!0,start:h[0].number,items:m,raw:h.map(g=>g.raw).join(`
|
|
168
168
|
`)})}i.push({type:"list_item",raw:a.raw,tokens:d}),s=p}else s+=1}return i}var Rv="textStyle",Lv=/^(\d+)\.\s$/,zv=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,`
|
|
@@ -171,5 +171,5 @@ ${g}
|
|
|
171
171
|
`,k+=1;else{if(!x.match(wS))break;w.push(x),y+=`
|
|
172
172
|
${x.slice(b+2)}`,k+=1}}d.push({indent:b,number:parseInt(g,10),content:y.trim(),raw:w.join(`
|
|
173
173
|
`)}),p=k,u=k}return[d,p]}(i);if(s.length===0)return;const l=Dv(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(Rv)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=
|
|
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=Lc(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=Lc(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()}}});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(CS.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(SS.configure(this.options.taskList)),t}});var ES=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()}}}),MS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,NS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,BS=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[sr({find:MS,type:this.type})]},addPasteRules(){return[ko({find:NS,type:this.type})]}}),TS=bt.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),OS=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 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 _S(t={}){return new Le({view:e=>new AS(e,t)})}class AS{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=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 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 cd(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||$v(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||$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 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 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 VS=Mg({ArrowLeft:da("horiz",-1),ArrowRight:da("horiz",1),ArrowUp:da("vert",-1),ArrowDown:da("vert",1)});function da(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 IS(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 DS(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 RS(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 ua=200,Xe=function(){};Xe.prototype.append=function(t){return t.length?(t=Xe.from(t),!this.length&&t||t.length<ua&&this.leafAppend(t)||this.length<ua&&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 LS(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 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,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<=ua)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=ua)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 LS=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>zS&&(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 Lr;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 zS=20;function jv(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 dd(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 ud=!1,Fv=null;function pa(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"),$S=new Ye("closeHistory");function PS(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(i,s,a,l){let c,d=a.getMeta(Co);if(d)return d.historyState;a.getMeta($S)&&(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(Co))return u.getMeta(Co).redo?new Un(i.done.addTransform(a,void 0,l,pa(s)),i.undone,jv(a.mapping.maps),i.prevTime,i.prevComposition):new Un(i.done,i.undone.addTransform(a,void 0,l,pa(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),dd(i.prevRanges,a.mapping),i.prevTime,i.prevComposition):new Un(i.done.addMaps(a.mapping.maps),i.undone.addMaps(a.mapping.maps),dd(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?dd(i.prevRanges,a.mapping):jv(a.mapping.maps);return new Un(i.done.addTransform(a,h?s.selection.getBookmark():void 0,l,pa(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"?Wv:o=="historyRedo"?Kv:null;return!!i&&(n.preventDefault(),i(e.state,e.dispatch))}}}})}function Hv(t,e){return(n,o)=>{let i=Co.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(o){let s=function(a,l,c){let d=pa(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})}(i,n,t);s&&o(e?s.scrollIntoView():s)}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 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 jS=qe.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[_S(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: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 FS=qe.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Le({props:{decorations:RS,createSelectionBetween:(t,e,n)=>e.pos==n.pos&&$e.valid(n)?new $e(n):null,handleClick:IS,handleKeyDown:VS,handleDOMEvents:{beforeinput:DS}}})],extendNodeSchema(t){var e;return{allowGapCursor:(e=ke(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,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&&Es(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)}}})]}}),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||Jg(n.selection)||t.view.dragging?null:Ie.create(n.doc,[ht.inline(n.selection.from,n.selection.to,{class:e.className})])}})]}});var HS=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(([,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)=>!qv({node:s.tr.doc.lastChild,types:o}),apply:(i,s)=>i.docChanged?!qv({node:i.doc.lastChild,types:o}):s}})]}}),WS=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[PS(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()}}}),KS=qe.create({name:"starterKit",addExtensions(){var t,e,n,o;const i=[];return this.options.bold!==!1&&i.push(JC.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(HC.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(Mv.configure(this.options.bulletList)),this.options.code!==!1&&i.push(XC.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(eS.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(tS.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(jS.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(FS.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(nS.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(oS.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(WS.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(rS.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(cS.configure(this.options.italic)),this.options.listItem!==!1&&i.push(Nv.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(Vv.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&i.push(yS.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(zv.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(ES.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(BS.configure(this.options.strike)),this.options.text!==!1&&i.push(TS.configure(this.options.text)),this.options.underline!==!1&&i.push(OS.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(HS.configure((o=this.options)==null?void 0:o.trailingNode)),i}}),qS=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,US=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[av({find:qS,type:this.type,getAttributes:t=>{const[,,e,n,o]=t;return{src:n,alt:e,title:o}}})]}});const Uv="mc-select-multi-option",JS={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=i=>{n("update:modelValue",i)};return(i,s)=>(r.openBlock(),r.createElementBlock("div",JS,[r.createVNode(r.unref(io),{"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",GS=["aria-selected"],YS={key:1,class:"mc-select-option-label"},ui=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(),i=r.inject(ha||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(pd),{key:0,"model-value":l.value,label:d.value,disabled:t.disabled},null,8,["model-value","label","disabled"])):(r.openBlock(),r.createElementBlock("span",YS,r.toDisplayString(d.value),1))],!0)],46,GS)),[[r.vShow,s.value]])}}),[["__scopeId","data-v-5c070d19"]])),fd="mc-select-group-plus",XS={class:"mc-select-group"},ZS={class:"mc-select-option-list"},Jv=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(ha||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",XS,[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",ZS,[r.renderSlot(a.$slots,"default",{},void 0,!0)])])],512)),[[r.vShow,s.value]])}}),[["__scopeId","data-v-7d169727"]])),ha=Symbol("mc-select-plus-context"),Gv="mc-select-plus",Yv="mc-tag",QS={class:"mc-tag-content"},eE=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,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(ce),{key:0,name:t.leftIcon,class:"mc-tag-left-icon",size:16},null,8,["name"])):r.createCommentVNode("",!0),r.createElementVNode("div",QS,[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))}}),fa=X(K(eE,[["__scopeId","data-v-044d14e5"]])),tE=["id","placeholder","readonly","disabled","onKeydown"],nE={key:0,class:"mc-select-multi-options-wrapper"},oE={key:1,class:"mc-select-selected-content-wrapper"},rE={key:1,class:"mc-select-placeholder"},iE={key:0,class:"mc-select-status-icon-wrapper"},sE={key:0,class:"mc-select-dropdown-header-content"},aE={key:0,class:"mc-select-empty"},lE=r.defineComponent({name:Gv,__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 Ga(300),await _("blur")}}),{isHovering:u}=Op(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,pi)=>{de(tn)&&tn.forEach(Ze=>{var xn,Wt,fi,nn,Cn,mi,oy,ry;const hi=(xn=(Ze==null?void 0:Ze.type)||{})==null?void 0:xn.name;if(hi===fd){const QB=Ro(Ze.children)||de(Ze.children)||!Ve((Wt=Ze.children)==null?void 0:Wt.default)?Ze.children:(fi=Ze.children)==null?void 0:fi.default();mt(QB,(nn=Ze.props)==null?void 0:nn.label)}else hi===hd?Pe.push({label:(Cn=Ze.props)==null?void 0:Cn.label,value:(mi=Ze.props)==null?void 0:mi.value,disabled:(oy=Ze.props)==null?void 0:oy.disabled,group:pi,context:(ry=Ze.children)==null?void 0:ry.default}):Array.isArray(Ze.children)&&mt(Ze.children,pi)})};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:w}=(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?Mn(wr(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,pi=wa,Ze=Pe.length,hi=!0,xn=[],Wt=xn;if(Ze>=200){var fi=mt?null:Yb(Pe);if(fi)return Fa(fi);hi=!1,pi=ja,Wt=new Io}else Wt=mt?[]:xn;e:for(;++tn<Ze;){var nn=Pe[tn],Cn=mt?mt(nn):nn;if(nn=nn!==0?nn:0,hi&&Cn==Cn){for(var mi=Wt.length;mi--;)if(Wt[mi]===Cn)continue e;mt&&Wt.push(Cn),xn.push(nn)}else pi(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:x,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:O,validateStyle:R,statusIcon:z,validateByTrigger:_}=cn(),{isDisabled:I}=((D,W)=>{const ee=r.inject(Ir,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),w()}),{isExpanded:T,popperRef:V,popperOptions:P,toggleExpand:A}=(D=>{const W=r.ref(!1),ee=r.getCurrentInstance(),{emit:ve}=ee,ye=r.ref(),Re=r.inject(Ir,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:q}=((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,w(),A(!1),we(),await r.nextTick(),_("input"))},I);Lh({validateStatus:O,isExpanded:T,isFocused:l,isHovering:u}),$i(p,()=>{w(),A(!1)}),r.onMounted(()=>{H.value=n.modelValue}),r.watch(()=>n.modelValue,D=>{H.value=D});const H=r.ref(),U=r.computed(()=>{if(i.value){const D=n.maxTags,W=H.value;if(Li(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 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(w(),!I.value){if(i.value){const W=H.value;gt(W,D)?H.value=cp(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(T,()=>{E()});const Z=()=>{A(!T.value)},ie=()=>{E(),A(!0)},ae=()=>{T.value?x.value?oe(x.value):i.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()}}})(i,H,m,()=>{re.value?H.value=m.value.map(D=>D.value):H.value=[],we()}),Oe=r.ref([]);r.watch(T,()=>{T.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(ha,{isMulti:i,selectedOption:H,filteredOptions:y,filteredGroups:k,hoverOption:x,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(T)}])},[r.createVNode(r.unref(Wi),{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: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(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,tE),[[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",nE,[(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(fa),{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",oE,[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",rE,[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",iE,[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(T)}])},null,8,["class"]),[[r.vShow,!at.value]])],32)],6)]),content:r.withCtx(()=>[G.value&&t.showHeader?(r.openBlock(),r.createBlock(r.unref(Vr),{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",sE,[r.createVNode(r.unref(io),{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),G.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("li",aE,[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(Jo),{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(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(lE,[["__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,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(mh,{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"]]),cE=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]}),dE={class:"mc-richtext-toolbar"},uE={class:"mc-richtext-font-selector"},pE={class:"mc-richtext-tool-group"},hE={class:"mc-richtext-tool-group"},fE={class:"mc-richtext-tool-group"},mE={class:"mc-richtext-attach-link"},gE=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,i=n,s=r.ref(),{width:a,height:l}=$t(),c=((M={})=>{const N=r.shallowRef();return r.onMounted(()=>{N.value=new PC(M)}),r.onBeforeUnmount(()=>{var O,R,z;const _=(O=N.value)==null?void 0:O.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:[KS,US.configure({inline:!0,allowBase64:!0}),cE],onUpdate:({editor:M})=>{i("update:modelValue",M.getHTML())}});r.watch(()=>o.modelValue,M=>{const N=c.value,O=N==null?void 0:N.getHTML();N&&O!==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?x():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")},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===So.SMALL?d.value=Ne.SMALL:N===So.FOOTNOTE?d.value=Ne.FOOTNOTE:d.value=Ne.NORMAL});const y=r.ref(),k=r.ref(""),w=()=>{var M;k.value=((M=c.value)==null?void 0:M.getAttributes("link").href)||""},x=()=>{var N,O,R;const M=k.value;M?((N=c.value)==null||N.commands.setLink({href:M}),k.value=""):((O=c.value)==null||O.commands.unsetLink(),k.value=""),(R=y.value)==null||R.hide()},C=()=>{var M;(M=s.value)==null||M.click()},S=M=>{var z;const N=M.target,O=(z=N.files)==null?void 0:z[0];if(!O||!O.type.startsWith("image/"))return;const R=new FileReader;R.onload=_=>{var T,V;const I=(T=_.target)==null?void 0:T.result;I&&((V=c.value)==null||V.commands.setImage({src:I}))},R.onerror=()=>{console.error("mc-richtext: error:read:image:",O.name)},R.readAsDataURL(O),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 O,R,z,_,I,T;return r.openBlock(),r.createElementBlock("div",{class:"mc-richtext",style:r.normalizeStyle({width:r.unref(a),height:r.unref(l)})},[r.createElementVNode("section",dE,[r.createElementVNode("div",uE,[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(ui),{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(ui),{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(ui),{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",pE,[r.createVNode(Eo,{icon:r.unref(Ne).BOLD,"is-active":!!((O=r.unref(c))!=null&&O.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",hE,[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",fE,[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",mE,[r.createVNode(r.unref(kl),{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(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:w})]),_:1},512)]),_:1},8,["icon","is-active"]),r.createVNode(Eo,{icon:r.unref(Ne).IMAGE,"is-active":!!((T=r.unref(c))!=null&&T.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(jC),{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:S},null,544)],4)}}}),Qv=X(K(gE,[["__scopeId","data-v-c216489d"]])),e0="mc-secondary-menu",vE={class:"mc-secondary-menu"},yE=["onClick"],bE={class:"mc-secondary-menu-item-content"},kE=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,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=an(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",vE,[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",bE,r.toDisplayString(u.label),1)],10,yE)}),128)),r.createElementVNode("div",{class:"mc-secondary-menu-success-line",ref_key:"successLineRef",ref:s},null,512)],512)]))}}),t0=X(K(kE,[["__scopeId","data-v-965d2cfc"]])),ma=Symbol("mc-select-context"),n0="mc-select",wE={key:0,class:"mc-select-selected-content"},xE=["placeholder","readonly","disabled"],CE={class:"mc-select-dropdown-header-content"},SE={class:"mc-select-dropdown-content"},EE={class:"mc-select-dropdown"},ME={key:0,class:"mc-select-no-data"},NE=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,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(()=>xe(P.value)?d.value:d.value.filter(G=>gp(qt(G.label??G.value)).includes(gp(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},w=()=>c(n.modelValue)?[...n.modelValue]:[n.modelValue],x=r.ref(w());r.watch(()=>n.modelValue,()=>{x.value=w()});const C=r.computed(()=>wr(d.value,G=>gt(x.value,G.value))),S=r.computed(()=>{var G;return l.value||(G=C.value)==null?void 0:G[0]}),E=r.computed(()=>l.value?Mn(C.value,G=>({label:G.label??"",value:G.value})):[]),M=r.computed(()=>h.value||q.value?"minimal":"bold"),N=r.computed(()=>""),O=r.computed(()=>N.value==="error"),R=r.computed(()=>N.value==="success"),z=r.computed(()=>!n.disabled&&(O.value||R.value));let _=[];const I=()=>{o("update:modelValue",[..._]),o("change",[..._])},T=()=>{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}));$i(p,()=>{y.value=!1}),r.watch(()=>y.value,G=>{G?l.value&&(_=[...n.modelValue]):setTimeout(()=>{P.value=""},300)},{flush:"post"});const q=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 U=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(ma,{filterOptions:u,selectValues:x,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":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:k,ref_key:"triggerRef",ref:a},[C.value.length&&!L.value?(r.openBlock(),r.createElementBlock("div",wE,[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(fa),{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: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,xE),[[r.vModelText,P.value]])],2),z.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mc-select__status",[O.value?"mc-select__status--error":"mc-select__status--success"]])},[r.createVNode(r.unref(ce),{name:O.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:b.value?"48px":"0"})},[v.value?(r.openBlock(),r.createBlock(r.unref(Vr),{key:0,class:"mc-select-dropdown-header","show-tool-bar":!1,height:"40px"},{default:r.withCtx(()=>[r.createElementVNode("div",CE,[r.createVNode(r.unref(io),{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",SE,[r.createElementVNode("div",EE,[r.renderSlot(G.$slots,"default",{},void 0,!0),g.value?(r.openBlock(),r.createElementBlock("div",ME,[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(Jo),{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:T},{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(NE,[["__scopeId","data-v-0096011b"]])),gd=Symbol("mc-select-group-context"),r0="mc-select-group",BE={class:"mc-select-group"},TE={class:"mc-select-group-content"},i0=X(K(r.defineComponent({name:r0,__name:"mc-select-group",props:{label:{},width:{},height:{}},setup(t){const e=t,n=r.inject(ma,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)),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",BE,[r.createElementVNode("div",{class:"mc-select-group-label",style:r.normalizeStyle(s.value)},r.toDisplayString(t.label),5),r.createElementVNode("div",TE,[r.renderSlot(a.$slots,"default",{},void 0,!0)])],512)),[[r.vShow,o.value]])}}),[["__scopeId","data-v-ff3f5179"]])),s0="mc-select-option",OE={class:"mc-select-option-content"},_E=r.defineComponent({name:s0,__name:"mc-select-option",props:{value:{},label:{},width:{},height:{},_group:{},_vnode:{}},setup(t,{expose:e}){const n=r.ref(),o=t,i=r.inject(ma,void 0),s=r.inject(gd,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",OE,[r.renderSlot(h.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.label),1)],!0)])],6)):r.createCommentVNode("",!0)}}),a0=X(K(_E,[["__scopeId","data-v-8c13e012"]])),l0="mc-status",AE={class:"mc-status-icon"},VE={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",AE,[r.createVNode(r.unref(ce),{name:"Indicator",size:12})]),r.createElementVNode("p",VE,[r.renderSlot(e.$slots,"default",{},void 0,!0)])],2))}),[["__scopeId","data-v-25f8565f"]])),d0="mc-step",IE={class:"mc-step-number-container"},DE={class:"mc-step-item-number"},RE={key:0,class:"mc-step-item-number-text"},LE={class:"mc-step-item-content"},zE={key:0,class:"mc-step-item-content-title"},$E={class:"mc-step-item-label"},PE={class:"mc-step-item-desc"},jE={key:1,class:"mc-step-item-component"},FE={key:0,class:"mc-step-item-component"},HE=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,i=r.computed(()=>o.type==="vertical"),s=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(),s("change",w)},{flush:"post"});const h=r.ref(),f=(w=p.value)=>{h.value=w,s("success",w)},m=r.computed(()=>an(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,x=d.value;if(w<0)return void(x.style.height="0");const C=l.value,S=C.querySelectorAll(".mc-step-item");if(w+1>S.length-1)return void(x.style.height="100%");const E=S==null?void 0:S[w+1],M=C.getBoundingClientRect(),N=(E.getBoundingClientRect().top-M.top)/(M.height-24);x.style.height=100*N+"%"},v=()=>{var R,z;const w=l.value,x=c.value,C=w.querySelectorAll(".mc-step-item"),S=(R=C==null?void 0:C[0])==null?void 0:R.querySelector(".mc-step-item-number"),E=(z=C==null?void 0:C[C.length-1])==null?void 0:z.querySelector(".mc-step-item-number");if(!S||!E)return void(x.style.width="0px");const M=w.getBoundingClientRect(),N=S.getBoundingClientRect(),O=E.getBoundingClientRect();x.style.width=O.left-N.left-N.width+"px",x.style.left=`${N.left-M.left+N.width}px`},b=()=>{const w=d.value,x=m.value;if(x<0)return void(w.style.width="0");const C=(x+1)/(o.steps.length-1),S=C>1?1:C;w.style.width=100*S+"%"},y=w=>i.value&&w.component&&w.key===o.modelValue,k=r.computed(()=>{var w;return!i.value&&((w=Do(o.steps,x=>x.key===o.modelValue))==null?void 0:w.component)});return r.watch(()=>h.value,()=>{i.value?g():b()}),Tp(Lo(()=>{i.value?g():(v(),b())},50)),e({ref:a,setSuccessStep:f}),(w,x)=>(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,S)=>(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":S<=m.value}]),key:C.key},[r.createElementVNode("div",IE,[r.createElementVNode("div",DE,[S>m.value||C.disabled?(r.openBlock(),r.createElementBlock("span",RE,r.toDisplayString(S+1),1)):(r.openBlock(),r.createBlock(r.unref(so),{key:1}))])]),r.createElementVNode("div",LE,[C.label||C.desc?(r.openBlock(),r.createElementBlock("div",zE,[r.createElementVNode("h3",$E,r.toDisplayString(C.label),1),r.createElementVNode("p",PE,r.toDisplayString(C.desc),1)])):r.createCommentVNode("",!0),y(C)?(r.openBlock(),r.createElementBlock("div",jE,[(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",FE,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(k.value)))])):r.createCommentVNode("",!0)],2))}}),u0=X(K(HE,[["__scopeId","data-v-add0e313"]])),p0="mc-step-plus",vd="mc-step-item-plus",WE={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",WE))})),yd="mc-step-child-item-plus",KE={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",KE))})),qE={class:"mc-step-plus"},UE={class:"mc-step-container"},JE=["onClick"],GE={class:"mc-step-item-icon"},YE={key:0,class:"mc-step-item-icon-number"},XE={key:1,class:"mc-step-item-icon-point"},ZE={class:"mc-step-item-content"},QE={class:"mc-step-item-content-title"},eM={class:"mc-step-item-label"},tM={key:1,class:"mc-step-item-label-title"},nM={class:"mc-step-item-desc"},oM={key:1,class:"mc-step-item-desc-title"},rM={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,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=(w=>{const x=[];let C=0,S=0;const E=(M,N)=>{de(M)&&M.forEach(O=>{var z,_,I,T,V,P,A,L,j,q,H,U,Y,G,Q,oe;const R=(z=(O==null?void 0:O.type)||{})==null?void 0:z.name;if(R===vd){const fe=Ro(O.children)||de(O.children)||!Ve((_=O.children)==null?void 0:_.default)?O.children:(I=O.children)==null?void 0:I.default(),le=O.children,me={parentIndex:C++,index:S++,step:((T=O.props)==null?void 0:T.step)||S,label:(V=O.props)==null?void 0:V.label,desc:(P=O.props)==null?void 0:P.desc,icon:(A=O.props)==null?void 0:A.icon,showContent:((L=O.props)==null?void 0:L.showContent)||((j=O.props)==null?void 0:j["show-content"]),success:(q=O.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};x.push(me),E(fe,me)}else if(R===yd){const fe=O.children,le={index:S++,step:(H=O.props)==null?void 0:H.step,label:(U=O.props)==null?void 0:U.label,desc:(Y=O.props)==null?void 0:Y.desc,parentStep:N,isChild:!0,showContent:((G=O.props)==null?void 0:G.showContent)||((Q=O.props)==null?void 0:Q["show-content"]),success:(oe=O.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)),x.push(le)}else Array.isArray(O.children)&&E(O.children,N)})};return E(w),x})((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 w,x;return!xe(k.index)&&!xe((w=v.value)==null?void 0:w.index)&&k.index<=((x=v.value)==null?void 0:x.index)},showStep:k=>{var w,x;return!k.isChild||!!((w=k.parentStep)!=null&&w.showContent)||!!k.parentStep&&v.value===k.parentStep||gt((x=k.parentStep)==null?void 0:x.childrenSteps,g.value)},isSuccessStep:k=>{var w,x,C,S,E,M;return!(!k.success&&!((w=k.parentStep)!=null&&w.success))||(y.value==="auto"?k.hasChildren?!xe(k.index)&&k.index+(((x=k.children)==null?void 0:x.length)??0)<(((C=v.value)==null?void 0:C.index)??-1):!xe(k.index)&&k.index<(((S=v.value)==null?void 0:S.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)&&!xe((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",qE,[r.createElementVNode("div",UE,[(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",GE,[g.isChild||r.unref(xe)(g.parentIndex)?(r.openBlock(),r.createElementBlock("div",XE)):(r.openBlock(),r.createElementBlock("div",YE,[r.unref(d)(g)?(r.openBlock(),r.createBlock(r.unref(so),{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,JE),r.createElementVNode("div",ZE,[r.createElementVNode("div",QE,[r.createElementVNode("div",eM,[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",tM,r.toDisplayString(g.label),1))]),r.createElementVNode("div",nM,[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",oM,r.toDisplayString(g.desc),1))])]),r.unref(u)(g)?(r.openBlock(),r.createElementBlock("div",rM,[(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"),iM={class:"mc-step-v2"},sM=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([]),i=r.ref(-1),s=l=>{l>-1?l>o.value.length-1?i.value=o.value.length-1:i.value=l:i.value=-1},a=()=>{const l=an(o.value,c=>c.name===n.modelValue);s(l-1)};return r.onMounted(()=>{a()}),r.watch(()=>n.modelValue,()=>{a()},{flush:"post"}),r.provide(g0,{successStepIndex:i,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:s,setSuccessStep:l=>{const c=an(o.value,d=>d.name===l);s(c)}}),(l,c)=>(r.openBlock(),r.createElementBlock("div",iM,[r.renderSlot(l.$slots,"default")]))}}),aM={class:"mc-step-item-step-bar-number"},lM={key:0,class:"mc-step-item-step-bar-number-text"},cM={key:0,class:"mc-step-item-label"},dM={class:"mc-step-item-label-title"},uM={class:"mc-step-item-label-desc"},pM={key:1,class:"mc-step-item-slot"},hM=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(),i=r.inject(g0,void 0);r.onMounted(()=>{i==null||i.addStepItem(e)}),r.onBeforeUnmount(()=>{i==null||i.removeStepItem(e)});const s=r.computed(()=>hp(i==null?void 0:i.stepItems,e)),a=r.computed(()=>{var p;return((p=i==null?void 0:i.activeStep)==null?void 0:p.value)===e.name}),l=r.computed(()=>{var p;return((p=i==null?void 0:i.showContent)==null?void 0:p.value)||e.showContent||a.value}),c=r.computed(()=>{var p,h,f;return xe((p=i==null?void 0:i.succeed)==null?void 0:p.value)?xe(e.succeed)?(((h=i==null?void 0:i.successStepIndex)==null?void 0:h.value)??-1)>=s.value:e.succeed:(f=i==null?void 0:i.succeed)==null?void 0:f.value}),d=r.computed(()=>{var p;return((p=i==null?void 0:i.stepItems)==null?void 0:p.length)===s.value+1});$o(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",aM,[c.value?(r.openBlock(),r.createBlock(r.unref(so),{key:1,class:"mc-step-item-step-bar-success-icon"})):(r.openBlock(),r.createElementBlock("div",lM,[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(s.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",cM,[r.renderSlot(p.$slots,"label",{},()=>[r.createElementVNode("span",dM,r.toDisplayString(t.label),1)],!0),r.renderSlot(p.$slots,"desc",{},()=>[r.createElementVNode("p",uM,r.toDisplayString(t.desc),1)],!0)])):r.createCommentVNode("",!0),l.value?(r.openBlock(),r.createElementBlock("div",pM,[r.renderSlot(p.$slots,"default",{},void 0,!0)])):r.createCommentVNode("",!0)],512)],6))}}),fM=K(hM,[["__scopeId","data-v-d41e82d5"]]),mM={class:"mc-step-child-item-content"},gM={key:0,class:"mc-step-child-item-label"},vM={class:"mc-step-child-item-label-title"},yM={class:"mc-step-child-item-label-desc"},bM={key:1,class:"mc-step-child-item-slot"},kM=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 s;return(s=n==null?void 0:n.actived)==null?void 0:s.value}),i=r.computed(()=>{var s,a;return(s=n==null?void 0:n.succeed)!=null&&s.value?(a=n==null?void 0:n.succeed)==null?void 0:a.value:e.succeed});return(s,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":i.value}])},[r.createElementVNode("div",mM,[t.label||t.desc?(r.openBlock(),r.createElementBlock("div",gM,[r.createElementVNode("span",vM,r.toDisplayString(t.label),1),r.createElementVNode("p",yM,r.toDisplayString(t.desc),1)])):r.createCommentVNode("",!0),s.$slots.default?(r.openBlock(),r.createElementBlock("div",bM,[r.renderSlot(s.$slots,"default",{},void 0,!0)])):r.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-f01aecff"]]),y0=X(sM),b0=X(fM),k0=X(kM),w0="mc-switch",x0="mc-switch-label",wM={class:"mc-switch-label-wrapper"},xM={class:"mc-switch-label"},CM={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",wM,[t.label||e.$slots.label?r.renderSlot(e.$slots,"label",{key:0},()=>[r.createElementVNode("span",xM,r.toDisplayString(t.label),1)],!0):r.createCommentVNode("",!0),t.helpText||e.$slots.help?r.renderSlot(e.$slots,"help",{key:1},()=>[r.createElementVNode("div",CM,[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"]]),SM={class:"mc-switch"},EM=["id","disabled","value","onKeypress"],MM={class:"mc-switch-inner"},NM={class:"mc-switch-inner-text"},BM={class:"mc-switch-inner-text"},TM=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,i=r.useSlots(),{formId:s,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(()=>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",SM,[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(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,EM),r.createElementVNode("div",MM,[d.value?r.renderSlot(m.$slots,"active",{key:0},()=>[r.createElementVNode("span",NM,r.toDisplayString(t.activeText),1)],!0):r.renderSlot(m.$slots,"inactive",{key:1},()=>[r.createElementVNode("span",BM,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(TM,[["__scopeId","data-v-dc9c6820"]])),bd="mc-tab-item",OM={class:"mc-tab-item"},E0=X(r.defineComponent({name:bd,__name:"mc-tab-item",props:{name:{},label:{},disabled:{type:Boolean},count:{}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",OM,[r.renderSlot(e.$slots,"default")]))})),M0="mc-tab",_M=["onClick"],AM={key:0,class:"mc-tab-nav-item-count"},VM={class:"mc-tab-actived-component-wrapper"},IM=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,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=Mn(wr(v,b=>b.type.name===bd),b=>{var k,w,x;const y=b.props;return{_vnode:r.h("div",(x=(w=(k=b.children)==null?void 0:k.default)==null?void 0:w.call(k))==null?void 0:x[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=an(c.value,E=>E.name===v);if(k<0)return void(b.style.width="0");const w=Array.from(y.children)[k],{x,width:C}=w.getBoundingClientRect(),{x:S}=y.getBoundingClientRect();b.style.width=`${C}px`,b.style.transform=`translateX(${x-S}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:w=>(x=>{x.disabled||(i("update:modelValue",x.name),i("change",x.name))})(k)},[r.createElementVNode("span",null,r.toDisplayString(k.label),1),k.count?(r.openBlock(),r.createElementBlock("span",AM,r.toDisplayString(k.count),1)):r.createCommentVNode("",!0)],10,_M))),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",VM,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u.value._vnode),{key:u.value.name}))])],4)):r.createCommentVNode("",!0)],2)}}}),N0=X(K(IM,[["__scopeId","data-v-2c21b5ce"]])),DM=["rowspan","colspan"],RM=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}),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 w,x;if(!((w=e.pagination)!=null&&w.currentPage)||!((x=e.pagination)!=null&&x.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,DM)):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-3b2b75d3"]]),LM={class:"mc-table__body",cellspacing:"0",cellpadding:"0",border:"0"},zM={key:0,width:"50"},$M=["width"],PM=["onClick"],jM={key:0,class:"mc-table__selection-column"},FM={class:"mc-table__cell"},HM={key:1},WM=["colspan"],KM={key:1},qM=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,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",LM,[r.createElementVNode("colgroup",null,[t.selectable?(r.openBlock(),r.createElementBlock("col",zM)):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,$M))),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",jM,[r.createElementVNode("div",FM,[r.createVNode(r.unref(io),{"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(RM,{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(w=>[r.renderSlot(f.$slots,k,r.mergeProps({ref_for:!0},w),void 0,!0)])}))]),1032,["row","column","row-index","column-index","span-method","pagination"]))),128))],10,PM))),128)):(r.openBlock(),r.createElementBlock("tr",HM,[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",KM,r.toDisplayString(t.emptyText),1))],8,WM)]))])])],4))}}),[["__scopeId","data-v-f42c4de9"]]),UM={class:"mc-table__header",cellspacing:"0",cellpadding:"0",border:"0"},JM={key:0,width:"50"},GM=["width"],YM={key:0,class:"mc-table__selection-column"},XM={class:"mc-table__header-cell"},ZM=["onClick"],QM={class:"mc-table__header-label"},eN={key:0,class:"mc-table__sort-caret"},tN=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",UM,[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,GM))),128))]),r.createElementVNode("thead",null,[r.createElementVNode("tr",null,[t.selectable?(r.openBlock(),r.createElementBlock("th",YM,[r.createElementVNode("div",XM,[r.createVNode(r.unref(io),{"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",QM,[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",eN,[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,ZM))),128))])])])],512)):r.createCommentVNode("",!0)}}),nN=K(tN,[["__scopeId","data-v-990de870"]]),oN={class:"mc-table__loading-content"},rN={class:"mc-table__loading-spinner"},iN={key:0,class:"mc-table__spinner mc-table__spinner--default"},sN={key:1,class:"mc-table__spinner mc-table__spinner--circle"},aN={key:2,class:"mc-table__spinner mc-table__spinner--pulse"},lN=["innerHTML"],cN={key:0,class:"mc-table__loading-text"},dN=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 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",oN,[r.renderSlot(i.$slots,"loading",{loading:t.loading,text:n.value},()=>{var l;return[r.createElementVNode("div",rN,[(l=t.loadingConfig)!=null&&l.spinner&&t.loadingConfig.spinner!=="default"?t.loadingConfig.spinner==="circle"?(r.openBlock(),r.createElementBlock("div",sN)):t.loadingConfig.spinner==="pulse"?(r.openBlock(),r.createElementBlock("div",aN)):(r.openBlock(),r.createElementBlock("div",{key:3,class:"mc-table__spinner mc-table__spinner--custom",innerHTML:t.loadingConfig.spinner},null,8,lN)):(r.openBlock(),r.createElementBlock("div",iN,[...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",cN,r.toDisplayString(n.value),1)):r.createCommentVNode("",!0)]},!0)])],6)):r.createCommentVNode("",!0)}}}),[["__scopeId","data-v-0a275eb6"]]),uN={key:0,class:"mc-table__pagination"},pN={class:"mc-table__pagination-info"},hN={class:"mc-table__pagination-info-number"},fN={class:"mc-table__pagination-info-number"},mN={class:"mc-table__pagination-controls"},gN=["onClick"],vN={key:1,class:"mc-table__pagination-ellipsis"},yN={class:"mc-table__pagination-size"},bN={class:"mc-table-pagination-size-group"},kN=["onClick"],wN=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",uN,[r.createElementVNode("div",pN,[v[4]||(v[4]=r.createTextVNode(" Showing ",-1)),r.createElementVNode("span",hN,r.toDisplayString(c.value)+"-"+r.toDisplayString(d.value),1),v[5]||(v[5]=r.createTextVNode(" of ",-1)),r.createElementVNode("span",fN,r.toDisplayString(t.pagination.total),1)]),r.createElementVNode("div",mN,[r.createVNode(eo,{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(eo,{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,gN)):(r.openBlock(),r.createElementBlock("span",vN,"..."))],64))),128)),r.createVNode(eo,{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(eo,{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",yN,[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,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,kN))),128))])])])):r.createCommentVNode("",!0)}}),xN=K(wN,[["__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),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 T0(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 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: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 _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: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)),w=r.ref(i.value),x=n,C=r.ref(),S=r.ref(),E=r.ref(),{columnsWithFixed:M}=T0(s,S,E),{sortedData:N,handleSort:O,getSortOrder:R}=O0(w,M,p==null?void 0:p.value),{paginatedData:z,updatePagination:_}=B0(N,a,b),I=r.computed(()=>z.value),{internalSelectedRows:T,isAllSelected:V,isIndeterminate:P,toggleRowSelection:A,toggleAllSelection:L,clearSelection:j,getSelectedRows:q}=function(Z,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 Ce=ue=>re.value.some(ge=>ie.value?ge[ie.value]===ue[ie.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=>ie.value?we[ie.value]===ue[ie.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=>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=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 ie=r.ref(null);return{currentRow:ie,setCurrentRow:ae=>(ie.value=ae,ie.value),getRowClass:ae=>{const re=[];return Z.value&&ie.value===ae&&re.push("is-current"),re},clearCurrentRow:()=>{ie.value=null}}}(h);r.watch(()=>i.value,Z=>{w.value=Z},{deep:!0,immediate:!0});const Y=(Z,ie)=>{if(h.value){const ae=H(Z);x("current-change",ae)}if(m.value&&v.value){const ae=A(Z);me(Z,ae)}x("row-click",Z,ie)},G=(Z,ie)=>{x("header-click",Z,ie)},Q=Z=>{const ie=O(Z);ie&&x("sort-change",ie)},oe=(Z,ie)=>{const ae=A(Z,ie);me(Z,ae)},fe=Z=>{L(Z),me(null,Z)},le=async Z=>{_(Z),r.nextTick(()=>{var ie;(ie=E.value)!=null&&ie.bodyWrapper&&(E.value.bodyWrapper.scrollTop=0)}),x("page-change",Z),await Be()},me=(Z,ie)=>{x("update:selectedRows",[...T.value]),x("selection-change",[...T.value]),Z?x("select",Z,ie):x("select-all",ie)},Be=async()=>{if(o.isInitTableData&&o.initTableData&&typeof o.initTableData=="function"){const{data:Z,total:ie}=await o.initTableData({pageSize:a.value.pageSize||10,pageNum:a.value.currentPage||1});w.value=Z,a.value.total=ie}};return r.onMounted(()=>{Be()}),e({ref:C,clearSort:()=>{s.value.forEach(Z=>{Z.sortable&&(Z.sortOrder=null)})},toggleRowSelection:(Z,ie)=>{const ae=A(Z,ie);me(Z,ae)},refresh:async()=>{a.value.currentPage=1,await Be()},toggleAllSelection:Z=>{L(Z),me(null,Z)},clearSelection:()=>{j(),x("update:selectedRows",[]),x("selection-change",[])},getSelectedRows:q}),(Z,ie)=>{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(nN,{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:G,onSortChange:Q,onSelectAll:fe},r.createSlots({_:2},[r.renderList(k.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(qM,{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(T),"select-on-row-click":r.unref(v),onRowClick:Y,onSelect:oe},r.createSlots({_:2},[r.renderList(k.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(xN,{key:0,pagination:r.unref(a),onPageChange:le},null,8,["pagination"])):r.createCommentVNode("",!0),r.createVNode(dN,{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"},kd=Symbol("mc-table-context"),Jn=()=>{const t=r.inject(kd,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",CN={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",CN))})),SN=(t=ct)=>{switch(t){case"left":return"flex-start";case"center":return"center";case"right":return"flex-end"}},EN={key:0,class:"mc-table-row-tr mc-table-row-left"},MN={class:"mc-table-row-center-content"},NN={key:3,class:"mc-table-row-tr mc-table-row-right"},BN=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:i,leftWidth:s,rightWidth:a,centerWidth:l,viewWidth:c}=Jn();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=Ri(c.value)+Ri(o.value)+5<Ri(l.value);return e.leftColumns.length>0&&h}),p=h=>{n.value&&n.value.scrollTo({left:h})};return zi(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",EN,[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(Ya)(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",MN,[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(Ya)(r.unref(a))})},null,4)):r.createCommentVNode("",!0),t.rightColumns.length?(r.openBlock(),r.createElementBlock("tr",NN,[r.renderSlot(h.$slots,"right",{columns:t.rightColumns},void 0,!0)])):r.createCommentVNode("",!0)],2))}}),Cd=K(BN,[["__scopeId","data-v-07610e84"]]),TN=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"]]),ON={class:"mc-table-header-cell-title"},_N={class:"mc-table-header-cell-title-text"},AN={key:0,class:"mc-table-header-cell-sort"},VN={class:"mc-table-header-cell-desc"},IN={class:"mc-table-body-cell-value"},kn=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: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}=Jn(),y=be("column"),k=be("type"),w=be("width"),x=r.computed(()=>k.value==="header"),C=r.computed(()=>k.value==="body"),S=r.computed(()=>k.value==="expand"),E=r.computed(()=>k.value==="expand-icon"),M=r.computed(()=>{var T,V;const _=w.value?`${w.value}px`:u!=null&&u.value?`${u.value}px`:"auto";let I="default";return x.value&&((T=y==null?void 0:y.value)!=null&&T.sortable)&&(I="pointer"),{width:_,cursor:I,alignItems:E.value?"center":SN((V=y==null?void 0:y.value)==null?void 0:V.columnAlign)}});let N={},O={},R={};if(x.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 T;p(((T=y==null?void 0:y.value)==null?void 0:T.prop)||"",(V=>{switch(V){case"normal":return"desc";case"desc":return"asc";default:return"normal"}})(_.value))},500);zi(d,"click",I)}N={currentSort:_}}else if(E.value){const _=be("row"),I=be("rowIndex"),T=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=Lo(async()=>{if(xe(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;T.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:T,isExpanded:V}}else if(C.value){const _=be("row");O={displayValue:r.computed(()=>{var V,P;const I=((V=y==null?void 0:y.value)==null?void 0:V.defaultValue)||"--",T=(P=y==null?void 0:y.value)==null?void 0:P.prop;return xe(T)||xe(_==null?void 0:_.value)||xe(_.value[T])?I:_.value[T]})}}return{isHeader:x,isBody:C,isExpand:S,isExpandIcon:E,cellStyle:M,headerCtx:N,bodyCtx:O,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",ON,[r.createElementVNode("div",_N,[r.renderSlot(d.$slots,"title",{},()=>[r.createTextVNode(r.toDisplayString(t.column.label),1)],!0)]),t.column.sortable?(r.openBlock(),r.createElementBlock("div",AN,[r.createVNode(TN,{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",VN,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(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(s))},[r.renderSlot(d.$slots,"default",{},()=>{var p;return[r.createElementVNode("span",IN,r.toDisplayString((p=r.unref(l).displayValue)==null?void 0:p.value),1)]},!0)],6))}}),[["__scopeId","data-v-2ac704bd"]]),DN={class:"mc-table-header"},RN={class:"mc-table-header-thead"},LN=K(r.defineComponent({name:V0,__name:"mc-table-header",setup(t){const{leftColumns:e,rightColumns:n,centerColumns:o}=Jn();return(i,s)=>(r.openBlock(),r.createElementBlock("table",DN,[r.createElementVNode("thead",RN,[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(kn,{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(kn,{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(kn,{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"]]),zN={key:0,class:"mc-table-total"},$N={class:"mc-table-total-number"},PN={class:"mc-table-total-number"},jN=K(r.defineComponent({name:F0,__name:"mc-table-total",setup(t){const{pagination:e}=Jn(),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",zN,[i[0]||(i[0]=r.createElementVNode("span",null,"Showing",-1)),r.createElementVNode("span",$N,r.toDisplayString(n.value.range),1),i[1]||(i[1]=r.createElementVNode("span",null,"of",-1)),r.createElementVNode("span",PN,r.toDisplayString(n.value.total),1)])):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-f242f0b2"]]),FN={class:"mc-table-ellipsis"},HN=K(r.defineComponent({name:q0,__name:"mc-table-ellipsis",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",FN,[...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,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(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(HN,{key:5})):r.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-f2d32b30"]]),WN={key:0,class:"mc-table-pagination"},KN=r.defineComponent({name:W0,__name:"mc-table-pagination",setup(t){const{pagination:e,isLoading:n,handlePagination:o}=Jn(),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",WN,[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(s.value,v=>{var b;return r.openBlock(),r.createBlock(wn,{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(wn,{key:1,type:"ellipsis"})):r.createCommentVNode("",!0),r.createVNode(wn,{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(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"])]))}}}),qN=K(KN,[["__scopeId","data-v-df311846"]]),UN={class:"mc-table-page-size"},JN={class:"mc-table-page-size-group"},GN=["onClick"],YN=K(r.defineComponent({name:H0,__name:"mc-table-page-size",setup(t){const{pagination:e,isLoading:n,handlePagination:o}=Jn();return(i,s)=>{var a;return r.openBlock(),r.createElementBlock("div",UN,[s[0]||(s[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,GN)}),128))])])}}}),[["__scopeId","data-v-180a8b6e"]]),XN={class:"mc-table-footer"},ZN=K(r.defineComponent({name:j0,__name:"mc-table-footer",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",XN,[r.createVNode(jN),r.createVNode(qN),r.createVNode(YN)]))}),[["__scopeId","data-v-1fc62add"]]),QN={class:"mc-table-loading"},eB=K(r.defineComponent({name:$0,__name:"mc-table-loading",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",QN,[r.renderSlot(e.$slots,"default",{},()=>[r.createVNode(r.unref(wl),{loading:!0,type:"pulse",size:"small"})],!0)]))}),[["__scopeId","data-v-fb443fd0"]]),tB={class:"mc-table-body"},nB={class:"mc-table-body-tbody"},oB=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:i,isExpanded:s,getExpandData:a}=Jn();return(l,c)=>(r.openBlock(),r.createElementBlock("table",tB,[r.createElementVNode("tbody",nB,[(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(i)},{left:r.withCtx(({columns:p})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,h=>(r.openBlock(),r.createBlock(kn,{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(kn,{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(kn,{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(Cd,{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(kn,{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(kn,{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(kn,{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(eB,{key:0},{default:r.withCtx(()=>[r.renderSlot(l.$slots,"loading",{},void 0,!0)]),_:3})):r.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-68cb46c9"]]),rB={class:"mc-table-empty"},iB=K(r.defineComponent({name:z0,__name:"mc-table-empty",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",rB,[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"]]),sB=r.defineComponent({name:P0,__name:"mc-table-scroll",setup(t){const{scroll:e,centerWidth:n,viewWidth:o,tableWidth:i,setScroll:s}=Jn(),a=r.ref(),l=r.ref(),c=r.computed(()=>Au(o.value/n.value*100)),d=r.computed(()=>Ri(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 S,E;let k=y.clientX-h+f;k<0&&(k=0);const w=((E=(S=l.value)==null?void 0:S.getBoundingClientRect())==null?void 0:E.width)||0,x=i.value-w+2;k>x&&(k=x),p.value=k;const C=p.value*n.value/i.value;s(C)},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(Ya)(p.value)})`})},null,4)],544)):r.createCommentVNode("",!0)}}),aB=K(sB,[["__scopeId","data-v-3b46e14e"]]),lB=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,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([]),q=r.ref([]),H=r.ref([]),U=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 Z;const{columns:oe,columnWidthInfo:fe,leftColumns:le,centerColumns:me,rightColumns:Be}=(ie=>{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=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):Ce.push(ee),ae.push(ee)}else Array.isArray(ge.children)&&_e(ge.children)})};return _e(ie),{columns:ae,columnWidthInfo:Oe,leftColumns:re,centerColumns:Ce,rightColumns:nt}})((Z=G.default)==null?void 0:Z.call(G));L.value=oe,Y.fixedWidth=fe.fixedWidth,Y.restColumns=fe.restColumns,j.value=le,q.value=me,H.value=Be},{immediate:!0}),$o(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}})(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:w}=(()=>{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,G=j(Y),Q=H.sortType||"string";return G!=="normal"&&(Ve(Q)||(fe=Q==="number"?me=>Number(me[Y]):[Y],le=[G],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 Da(re,ae.length===1?ae[0]:ae)}:ae}):[Bo];var ie=-1;return Be=No(Be,Mi(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=Hb(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:++ie,value:ae}}))}(oe,fe,le)))),U;var oe,fe,le}}})(),{pagination:x,hasPagination:C,handlePagination:S}=(()=>{const A=be("pagination"),L=r.reactive({...wd});r.onMounted(()=>{j(A.value||wd)});const j=Y=>{Gy(L,{...Y})};r.watch(()=>A.value,Y=>{j(Y||wd)},{deep:!0});const q=r.getCurrentInstance(),H=Ii(()=>{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:O,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:T}=(A=>{const{leftColumns:L,rightColumns:j,centerColumns:q,tableWidth:H,columnWidth:U}=A,Y=le=>function(me,Be,Z){var ie=de(me)?fu:Jb,ae=arguments.length<3;return ie(me,En(Be),Z,ae,kr)}(le,(me,Be)=>me+(Be.width||U.value),0),G=r.computed(()=>Y(L.value)),Q=r.computed(()=>Y(j.value)),oe=r.computed(()=>Y(q.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(()=>C.value&&!V.value);return r.provide(kd,{data:l,tableWidth:h,isLoading:r.computed(()=>!!n.loading),columns:c,columnWidth:f,leftColumns:d,rightColumns:p,centerColumns:u,scroll:m,setScroll:g,pagination:x,handlePagination:S,handleSort:(A,L)=>{if(N(),b(A,L),n.sortType==="front"){const j=Do(c.value,q=>q.prop===A);j&&(l.value=w(n.data,j))}else o("change:sort",A,L)},getCurrentSort:k,isExpanded:E,getExpandData:M,setExpandData:(A,L)=>{O(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:T}),(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(LN),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(oB,{key:0,loading:t.loading},null,8,["loading"]))]),r.createVNode(aB),P.value?(r.openBlock(),r.createBlock(ZN,{key:0})):r.createCommentVNode("",!0)],4))}}),J0=X(K(lB,[["__scopeId","data-v-acae2d99"]])),G0="mc-textarea",cB=["value","id","disabled","maxlength","placeholder"],dB={class:"mc-textarea-count"},uB=r.defineComponent({name:G0,__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: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}=cn(),g=async k=>{let w=k.target.value;n.maxLength>0&&w.length>n.maxLength&&(w=w.slice(0,n.maxLength)),o("update:modelValue",w),o("change",w),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,w)=>(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:w[0]||(w[0]=(...x)=>r.unref(d)&&r.unref(d)(...x)),onBlur:w[1]||(w[1]=(...x)=>r.unref(u)&&r.unref(u)(...x)),onInput:g},null,44,cB),b.value?r.renderSlot(k.$slots,"count",{key:0,maxLength:t.maxLength,currentLength:y.value},()=>[r.createElementVNode("div",dB,[r.createElementVNode("span",null,r.toDisplayString(`${y.value} / ${t.maxLength} characters`),1)])],!0):r.createCommentVNode("",!0)],6))}}),Y0=X(K(uB,[["__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"],pB={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.`},hB={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=be("lang");return{langMap:r.computed(()=>t.value==="zh"?hB:pB)}},fB={class:"mc-upload-dropzone-area"},mB={class:"mc-upload-dropzone-title"},gB={class:"mc-upload-dropzone-title-text"},vB={key:0,class:"mc-upload-dropzone-desc"},yB={key:0},bB={key:1},kB=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,i=n,{langMap:s}=Bd(),a=r.ref(),l=r.computed(()=>{var m;return(m=o.allowedFileTypes)!=null&&m.length?s.value.limit_type.replace(zt,Mn(o.allowedFileTypes,g=>g.toUpperCase()).join(", ")):void 0}),{isDragover:c}=((m,g)=>{const v=r.ref(!1),b=C=>{C!==v.value&&(v.value=C)},y=C=>{C.preventDefault(),b(!0),Ve(g.onDragEnter)&&g.onDragEnter(C)},k=C=>{C.preventDefault(),b(!1),Ve(g.onDragLeave)&&g.onDragLeave(C)},w=C=>{C.preventDefault(),Ve(g.onDragover)&&g.onDragover(C)},x=C=>{C.preventDefault(),b(!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",k),(E=m.value)==null||E.addEventListener("dragover",w),(M=m.value)==null||M.addEventListener("drop",x)}),r.onBeforeUnmount(()=>{var C,S,E,M;(C=m.value)==null||C.removeEventListener("dragenter",y),(S=m.value)==null||S.removeEventListener("dragleave",k),(E=m.value)==null||E.removeEventListener("dragover",w),(M=m.value)==null||M.removeEventListener("drop",x)}),{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=>{Md(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 w=!1;for(let x=0;x<b.length;x++){const C=b[x];C.size>k?(Md(y,C.name,{status:"failed",errorMessage:s.value.limit_size.replace(zt,`${Ed(k)}`)}),i("error:size",C.name)):w=!0}})(g,v),((b,y)=>{var C;const k=o.allowedFileTypes;if(!(k!=null&&k.length))return!0;let w=!1;const x=Mn(k,S=>S.toUpperCase());for(let S=0;S<b.length;S++)gt(x,((C=b[S].name.split(".").pop())==null?void 0:C.toUpperCase())??"--")?w=!0:(Md(y,b[S].name,{status:"failed",errorMessage:l.value}),i("error:type",b[S].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",fB,[r.renderSlot(m.$slots,"default",{},()=>[r.createElementVNode("div",mB,[r.renderSlot(m.$slots,"title",{},()=>[r.createVNode(r.unref(ce),{name:t.icon},null,8,["name"]),r.createElementVNode("span",gB,r.toDisplayString(t.title||r.unref(s).upload_note),1)],!0)]),t.hideDesc?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",vB,[r.renderSlot(m.$slots,"desc",{},()=>[t.fileSize>0?(r.openBlock(),r.createElementBlock("span",yB,r.toDisplayString(r.unref(s).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))}}),wB=K(kB,[["__scopeId","data-v-39652196"]]),ey="mc-file-list",xB={class:"mc-file-list-item-content"},CB={class:"mc-file-list-item-file mc-file-list-item-info"},SB=["onClick"],EB={class:"mc-file-list-item-file-name-text"},MB={class:"mc-file-list-item-file-desc"},NB={class:"mc-file-list-item-file-size-text"},BB={key:0,class:"mc-file-list-item-file-progress-bar"},TB={key:1,class:"mc-file-list-item-file-error"},OB={class:"mc-file-list-item-info"},_B={class:"mc-file-list-item-label"},AB={class:"mc-file-list-item-value"},VB={class:"mc-file-list-item-info"},IB={class:"mc-file-list-item-label"},DB={class:"mc-file-list-item-value"},RB={class:"mc-file-list-item-actions"},LB={class:"mc-file-list-item-compact-content"},zB={class:"mc-file-list-item-info"},$B={class:"mc-file-list-item-label"},PB={class:"mc-file-list-item-value"},jB={class:"mc-file-list-item-info"},FB={class:"mc-file-list-item-label"},HB={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:i}=Bd(),s=r.ref(!1),a=r.ref();$o(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",xB,[r.createElementVNode("div",CB,[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",EB,r.toDisplayString(u.name),1)],8,SB),r.createElementVNode("div",MB,[u.status!=="failed"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("span",NB,r.toDisplayString(u.size?r.unref(Ed)(u.size):"--"),1),u.status==="loading"?(r.openBlock(),r.createElementBlock("div",BB,[r.createVNode(r.unref(Cl),{percentage:u.progress,"transition-duration":1e3},null,8,["percentage"])])):r.createCommentVNode("",!0)],64)):(r.openBlock(),r.createElementBlock("span",TB,r.toDisplayString(u.errorMessage||"failed to upload"),1))])]),s.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("div",OB,[r.createElementVNode("span",_B,r.toDisplayString(r.unref(i).uploaded_by),1),r.createElementVNode("span",AB,r.toDisplayString(u.uploadBy||"--"),1)]),r.createElementVNode("div",VB,[r.createElementVNode("span",IB,r.toDisplayString(r.unref(i).uploaded_on),1),r.createElementVNode("span",DB,r.toDisplayString(r.unref(X0)(u.uploadTime)||"--"),1)])],64)),r.createElementVNode("div",RB,[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))])]),s.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createVNode(r.unref(vl)),r.createElementVNode("div",LB,[r.createElementVNode("div",zB,[r.createElementVNode("span",$B,r.toDisplayString(r.unref(i).uploaded_by),1),r.createElementVNode("span",PB,r.toDisplayString(u.uploadBy||"--"),1)]),r.createElementVNode("div",jB,[r.createElementVNode("span",FB,r.toDisplayString(r.unref(i).uploaded_on),1),r.createElementVNode("span",HB,r.toDisplayString(r.unref(X0)(u.uploadTime)||"--"),1)])])],64)):r.createCommentVNode("",!0)]))),128))],2))}}),[["__scopeId","data-v-df197365"]])),WB={key:0,class:"mc-upload-content"},KB={class:"mc-upload-content-icon"},qB={class:"mc-upload-content-text"},UB={class:"mc-upload-component"},JB={key:0,class:"mc-upload-dropzone-wrapper"},GB={class:"mc-upload-file-list-wrapper"},YB=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,i=n,{width:s}=$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 qi.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=>{i("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);i("update:modelValue",M),i("upload",M),i("change",M),x()},g=S=>{console.error("mc-upload: error:type:",S),i("error:type",S)},v=S=>{console.error("mc-upload: error:size:",S),i("error:size",S)},b=S=>{i("preview",S)},y=S=>{i("delete",S)},k=S=>{i("download",S)},w=S=>{i("cancel",S)},x=(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(),i("clear"),i("update:modelValue",[]),i("change",[])},downloadAllFiles:()=>{i("download:all",h(d))}}),(S,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",WB,[r.createElementVNode("div",KB,[t.succeed?(r.openBlock(),r.createBlock(r.unref(so),{key:1,width:"24px",height:"24px"})):(r.openBlock(),r.createBlock(r.unref(ce),{key:0,name:"Accept"}))]),r.createElementVNode("div",qB,[r.renderSlot(S.$slots,"content",{},void 0,!0)])])):r.createCommentVNode("",!0),r.createElementVNode("div",UB,[t.disabled?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",JB,[r.createVNode(wB,{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",GB,[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:b,onDelete:y,onDownload:k,onCancel:w},null,8,["model-value","allow-cancel","downloadable","lang","theme","deletable"])])])],2)],4))}}),ty=X(K(YB,[["__scopeId","data-v-92f6b3db"]])),XB=[Bp,to,io,uh,hh,vh,xh,Sh,Mh,vl,Dh,Jo,ih,ah,ce,Bn,kl,$h,jh,wl,Ji,Kh,Uh,Ui,Wi,Cl,of,ef,tf,lf,sf,xl,yl,Qv,t0,o0,i0,a0,Jv,pd,ui,md,c0,u0,f0,h0,m0,k0,b0,y0,so,S0,N0,E0,_0,U0,J0,fa,Y0,Vr,bl,kh,Uo,Td,ty];console.info("contact us with ayachinenesanobauxichi@gmail.com");const ZB=(ny=XB,t=>Di(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=Ir,B.MC_ALERT_MESSAGE=Np,B.MC_BUTTON=_p,B.MC_CHECKBOX=ch,B.MC_CHECKBOX_GROUP=dh,B.MC_COLLAPSE=ph,B.MC_COLLAPSE_ITEM=gh,B.MC_COPY=wh,B.MC_COUNT=Ch,B.MC_CURRENCY_ICON=Eh,B.MC_DIVIDER=Nh,B.MC_DRAWER=Ih,B.MC_FILE_LIST=ey,B.MC_FOOTER=Vh,B.MC_FORM=Ap,B.MC_FORM_ITEM=sh,B.MC_ICON=Mp,B.MC_ICON_PLUS=fh,B.MC_INPUT=zh,B.MC_INPUT_GROUP=Rh,B.MC_LIGHTBOX=Ph,B.MC_LOADING=Fh,B.MC_MODAL_HEADER=Ah,B.MC_MULTI_TAG=Wh,B.MC_OTP=qh,B.MC_OVERLAY=Bh,B.MC_POPPER=oh,B.MC_PROGRESS_BAR=Jh,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=Th,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=s0,B.MC_SELECT_OPTION_PLUS=hd,B.MC_SELECT_PLUS=Gv,B.MC_SELECT_PLUS_CTX=ha,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=Gh,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=kd,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=bd,B.MC_TAG=Yv,B.MC_TEXTAREA=G0,B.MC_TITLE=_h,B.MC_TITLE_TOOL_BAR=Oh,B.MC_TOAST=yh,B.MC_TOOLTIP=rh,B.MC_UPLOAD=Z0,B.MC_UPLOAD_DROPZONE=Q0,B.McAlertMessage=Bp,B.McButton=to,B.McCheckbox=io,B.McCheckboxGroup=uh,B.McCollapse=hh,B.McCollapseItem=vh,B.McCopy=xh,B.McCount=Sh,B.McCurrencyIcon=Mh,B.McDivider=vl,B.McDrawer=Dh,B.McFileList=Td,B.McFooter=Jo,B.McForm=ih,B.McFormItem=ah,B.McIcon=ce,B.McIconPlus=Bn,B.McInput=kl,B.McInputGroup=$h,B.McLightbox=jh,B.McLoading=wl,B.McModalHeader=Ji,B.McMultiTag=Kh,B.McOtp=Uh,B.McOverlay=Ui,B.McPopper=Wi,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=i0,B.McSelectGroupPlus=Jv,B.McSelectMultiOption=pd,B.McSelectOption=a0,B.McSelectOptionPlus=ui,B.McSelectPlus=md,B.McStatus=c0,B.McStep=u0,B.McStepChildItemPlus=f0,B.McStepChildItemV2=k0,B.McStepItemPlus=h0,B.McStepItemV2=b0,B.McStepPlus=m0,B.McStepV2=y0,B.McSuccessIcon=so,B.McSwitch=S0,B.McTab=N0,B.McTabItem=E0,B.McTable=_0,B.McTableColumnPlus=U0,B.McTablePlus=J0,B.McTag=fa,B.McTextarea=Y0,B.McTitle=Vr,B.McTitleToolBar=bl,B.McToast=kh,B.McTooltip=Uo,B.McUpload=ty,B.SELECT_GROUP_INJECTION_KEY=gd,B.SELECT_INJECTION_KEY=ma,B.TOOL_ICON=Ne,B.WILDCARD=zt,B.default=ZB,B.toast=qi,B.usePagination=B0,B.useTableScroll=T0,B.useTableSort=O0,Object.defineProperties(B,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
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(Rv)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=lr({find:Lv,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=lr({find:Lv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Rv)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),xS=/^\s*(\[([( |x])?\])\s$/,CS=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 zc(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[lr({find:xS,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),SS=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=Lc(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=Lc(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()}}});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(CS.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(SS.configure(this.options.taskList)),t}});var ES=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()}}}),MS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,NS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,BS=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[ar({find:MS,type:this.type})]},addPasteRules(){return[ko({find:NS,type:this.type})]}}),TS=bt.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),OS=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 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 _S(t={}){return new Le({view:e=>new AS(e,t)})}class AS{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=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 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 cd(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||$v(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||$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 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 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 VS=Mg({ArrowLeft:da("horiz",-1),ArrowRight:da("horiz",1),ArrowUp:da("vert",-1),ArrowDown:da("vert",1)});function da(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 IS(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 DS(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 RS(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 ua=200,Xe=function(){};Xe.prototype.append=function(t){return t.length?(t=Xe.from(t),!this.length&&t||t.length<ua&&this.leafAppend(t)||this.length<ua&&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 LS(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 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,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<=ua)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=ua)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 LS=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>zS&&(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 Lr;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 zS=20;function jv(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 dd(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 ud=!1,Fv=null;function pa(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"),$S=new Ye("closeHistory");function PS(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(i,s,a,l){let c,d=a.getMeta(Co);if(d)return d.historyState;a.getMeta($S)&&(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(Co))return u.getMeta(Co).redo?new Un(i.done.addTransform(a,void 0,l,pa(s)),i.undone,jv(a.mapping.maps),i.prevTime,i.prevComposition):new Un(i.done,i.undone.addTransform(a,void 0,l,pa(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),dd(i.prevRanges,a.mapping),i.prevTime,i.prevComposition):new Un(i.done.addMaps(a.mapping.maps),i.undone.addMaps(a.mapping.maps),dd(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?dd(i.prevRanges,a.mapping):jv(a.mapping.maps);return new Un(i.done.addTransform(a,h?s.selection.getBookmark():void 0,l,pa(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"?Wv:o=="historyRedo"?Kv:null;return!!i&&(n.preventDefault(),i(e.state,e.dispatch))}}}})}function Hv(t,e){return(n,o)=>{let i=Co.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(o){let s=function(a,l,c){let d=pa(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})}(i,n,t);s&&o(e?s.scrollIntoView():s)}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 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 jS=qe.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[_S(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: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 FS=qe.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Le({props:{decorations:RS,createSelectionBetween:(t,e,n)=>e.pos==n.pos&&$e.valid(n)?new $e(n):null,handleClick:IS,handleKeyDown:VS,handleDOMEvents:{beforeinput:DS}}})],extendNodeSchema(t){var e;return{allowGapCursor:(e=ke(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,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&&Es(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)}}})]}}),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||Jg(n.selection)||t.view.dragging?null:Ie.create(n.doc,[ht.inline(n.selection.from,n.selection.to,{class:e.className})])}})]}});var HS=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(([,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)=>!qv({node:s.tr.doc.lastChild,types:o}),apply:(i,s)=>i.docChanged?!qv({node:i.doc.lastChild,types:o}):s}})]}}),WS=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[PS(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()}}}),KS=qe.create({name:"starterKit",addExtensions(){var t,e,n,o;const i=[];return this.options.bold!==!1&&i.push(JC.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(HC.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(Mv.configure(this.options.bulletList)),this.options.code!==!1&&i.push(XC.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(eS.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(tS.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(jS.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(FS.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(nS.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(oS.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(WS.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(rS.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(cS.configure(this.options.italic)),this.options.listItem!==!1&&i.push(Nv.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(Vv.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&i.push(yS.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(zv.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(ES.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(BS.configure(this.options.strike)),this.options.text!==!1&&i.push(TS.configure(this.options.text)),this.options.underline!==!1&&i.push(OS.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(HS.configure((o=this.options)==null?void 0:o.trailingNode)),i}}),qS=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,US=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[av({find:qS,type:this.type,getAttributes:t=>{const[,,e,n,o]=t;return{src:n,alt:e,title:o}}})]}});const Uv="mc-select-multi-option",JS={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=i=>{n("update:modelValue",i)};return(i,s)=>(r.openBlock(),r.createElementBlock("div",JS,[r.createVNode(r.unref(io),{"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",GS=["aria-selected"],YS={key:1,class:"mc-select-option-label"},ui=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(),i=r.inject(ha||void 0),s=r.computed(()=>!!Ro(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(pd),{key:0,"model-value":l.value,label:d.value,disabled:t.disabled},null,8,["model-value","label","disabled"])):(r.openBlock(),r.createElementBlock("span",YS,r.toDisplayString(d.value),1))],!0)],46,GS)),[[r.vShow,s.value]])}}),[["__scopeId","data-v-5c070d19"]])),fd="mc-select-group-plus",XS={class:"mc-select-group"},ZS={class:"mc-select-option-list"},Jv=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(ha||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",XS,[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",ZS,[r.renderSlot(a.$slots,"default",{},void 0,!0)])])],512)),[[r.vShow,s.value]])}}),[["__scopeId","data-v-7d169727"]])),ha=Symbol("mc-select-plus-context"),Gv="mc-select-plus",Yv="mc-tag",QS={class:"mc-tag-content"},eE=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,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(ce),{key:0,name:t.leftIcon,class:"mc-tag-left-icon",size:16},null,8,["name"])):r.createCommentVNode("",!0),r.createElementVNode("div",QS,[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))}}),fa=X(K(eE,[["__scopeId","data-v-044d14e5"]])),tE=["id","placeholder","readonly","disabled","onKeydown"],nE={key:0,class:"mc-select-multi-options-wrapper"},oE={key:1,class:"mc-select-selected-content-wrapper"},rE={key:1,class:"mc-select-placeholder"},iE={key:0,class:"mc-select-status-icon-wrapper"},sE={key:0,class:"mc-select-dropdown-header-content"},aE={key:0,class:"mc-select-empty"},lE=r.defineComponent({name:Gv,__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}=$o(s,{afterBlur:async()=>{await Ga(300),await _("blur")}}),{isHovering:u}=Op(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,pi)=>{de(tn)&&tn.forEach(Ze=>{var xn,Wt,fi,nn,Cn,mi,oy,ry;const hi=(xn=(Ze==null?void 0:Ze.type)||{})==null?void 0:xn.name;if(hi===fd){const QB=Lo(Ze.children)||de(Ze.children)||!Ve((Wt=Ze.children)==null?void 0:Wt.default)?Ze.children:(fi=Ze.children)==null?void 0:fi.default();mt(QB,(nn=Ze.props)==null?void 0:nn.label)}else hi===hd?Pe.push({label:(Cn=Ze.props)==null?void 0:Cn.label,value:(mi=Ze.props)==null?void 0:mi.value,disabled:(oy=Ze.props)==null?void 0:oy.disabled,group:pi,context:(ry=Ze.children)==null?void 0:ry.default}):Array.isArray(Ze.children)&&mt(Ze.children,pi)})};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:w}=(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?Mn(wr(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,pi=wa,Ze=Pe.length,hi=!0,xn=[],Wt=xn;if(Ze>=200){var fi=mt?null:Yb(Pe);if(fi)return Fa(fi);hi=!1,pi=ja,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,hi&&Cn==Cn){for(var mi=Wt.length;mi--;)if(Wt[mi]===Cn)continue e;mt&&Wt.push(Cn),xn.push(nn)}else pi(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:x,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:O,validateStyle:R,statusIcon:z,validateByTrigger:_}=cn(),{isDisabled:I}=((D,W)=>{const ee=r.inject(Ir,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),w()}),{isExpanded:T,popperRef:V,popperOptions:P,toggleExpand:A}=(D=>{const W=r.ref(!1),ee=r.getCurrentInstance(),{emit:ve}=ee,ye=r.ref(),Re=r.inject(Ir,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:q}=((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,w(),A(!1),we(),await r.nextTick(),_("input"))},I);Lh({validateStatus:O,isExpanded:T,isFocused:l,isHovering:u}),$i(p,()=>{w(),A(!1)}),r.onMounted(()=>{H.value=n.modelValue}),r.watch(()=>n.modelValue,D=>{H.value=D});const H=r.ref(),U=r.computed(()=>{if(i.value){const D=n.maxTags,W=H.value;if(Li(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 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=Ro(m.value,ee=>ee.value===D);return(W==null?void 0:W.label)||(W==null?void 0:W.value)},oe=async D=>{if(w(),!I.value){if(i.value){const W=H.value;gt(W,D)?H.value=cp(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=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(()=>!b.value&&!!H.value),me=r.computed(()=>!!n.placeholder&&!b.value&&ge.value),Be=r.computed(()=>l.value?"minimal":"bold");r.watch(T,()=>{E()});const Z=()=>{A(!T.value)},ie=()=>{E(),A(!0)},ae=()=>{T.value?x.value?oe(x.value):i.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()}}})(i,H,m,()=>{re.value?H.value=m.value.map(D=>D.value):H.value=[],we()}),Oe=r.ref([]);r.watch(T,()=>{T.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(ha,{isMulti:i,selectedOption:H,filteredOptions:y,filteredGroups:k,hoverOption:x,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(T)}])},[r.createVNode(r.unref(Wi),{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: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(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,tE),[[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",nE,[(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(fa),{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",oE,[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",rE,[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",iE,[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(T)}])},null,8,["class"]),[[r.vShow,!at.value]])],32)],6)]),content:r.withCtx(()=>[G.value&&t.showHeader?(r.openBlock(),r.createBlock(r.unref(Vr),{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",sE,[r.createVNode(r.unref(io),{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),G.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("li",aE,[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(Go),{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(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(lE,[["__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,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(mh,{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"]]),cE=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]}),dE={class:"mc-richtext-toolbar"},uE={class:"mc-richtext-font-selector"},pE={class:"mc-richtext-tool-group"},hE={class:"mc-richtext-tool-group"},fE={class:"mc-richtext-tool-group"},mE={class:"mc-richtext-attach-link"},gE=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,i=n,s=r.ref(),{width:a,height:l}=$t(),c=((M={})=>{const N=r.shallowRef();return r.onMounted(()=>{N.value=new PC(M)}),r.onBeforeUnmount(()=>{var O,R,z;const _=(O=N.value)==null?void 0:O.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:[KS,US.configure({inline:!0,allowBase64:!0}),cE],onUpdate:({editor:M})=>{i("update:modelValue",M.getHTML())}});r.watch(()=>o.modelValue,M=>{const N=c.value,O=N==null?void 0:N.getHTML();N&&O!==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?x():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")},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===So.SMALL?d.value=Ne.SMALL:N===So.FOOTNOTE?d.value=Ne.FOOTNOTE:d.value=Ne.NORMAL});const y=r.ref(),k=r.ref(""),w=()=>{var M;k.value=((M=c.value)==null?void 0:M.getAttributes("link").href)||""},x=()=>{var N,O,R;const M=k.value;M?((N=c.value)==null||N.commands.setLink({href:M}),k.value=""):((O=c.value)==null||O.commands.unsetLink(),k.value=""),(R=y.value)==null||R.hide()},C=()=>{var M;(M=s.value)==null||M.click()},S=M=>{var z;const N=M.target,O=(z=N.files)==null?void 0:z[0];if(!O||!O.type.startsWith("image/"))return;const R=new FileReader;R.onload=_=>{var T,V;const I=(T=_.target)==null?void 0:T.result;I&&((V=c.value)==null||V.commands.setImage({src:I}))},R.onerror=()=>{console.error("mc-richtext: error:read:image:",O.name)},R.readAsDataURL(O),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 O,R,z,_,I,T;return r.openBlock(),r.createElementBlock("div",{class:"mc-richtext",style:r.normalizeStyle({width:r.unref(a),height:r.unref(l)})},[r.createElementVNode("section",dE,[r.createElementVNode("div",uE,[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(ui),{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(ui),{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(ui),{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",pE,[r.createVNode(Eo,{icon:r.unref(Ne).BOLD,"is-active":!!((O=r.unref(c))!=null&&O.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",hE,[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",fE,[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(Jo),{placement:"bottom-start",trigger:"click",ref_key:"linkTooltipRef",ref:y},{content:r.withCtx(()=>[r.createElementVNode("div",mE,[r.createVNode(r.unref(kl),{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(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:w})]),_:1},512)]),_:1},8,["icon","is-active"]),r.createVNode(Eo,{icon:r.unref(Ne).IMAGE,"is-active":!!((T=r.unref(c))!=null&&T.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(jC),{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:S},null,544)],4)}}}),Qv=X(K(gE,[["__scopeId","data-v-c216489d"]])),e0="mc-secondary-menu",vE={class:"mc-secondary-menu"},yE=["onClick"],bE={class:"mc-secondary-menu-item-content"},kE=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,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=an(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",vE,[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",bE,r.toDisplayString(u.label),1)],10,yE)}),128)),r.createElementVNode("div",{class:"mc-secondary-menu-success-line",ref_key:"successLineRef",ref:s},null,512)],512)]))}}),t0=X(K(kE,[["__scopeId","data-v-965d2cfc"]])),ma=Symbol("mc-select-context"),n0="mc-select",wE={key:0,class:"mc-select-selected-content"},xE=["placeholder","readonly","disabled"],CE={class:"mc-select-dropdown-header-content"},SE={class:"mc-select-dropdown-content"},EE={class:"mc-select-dropdown"},ME={key:0,class:"mc-select-no-data"},NE=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,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(()=>xe(P.value)?d.value:d.value.filter(G=>gp(qt(G.label??G.value)).includes(gp(P.value)))),{wrapperRef:p,isFocused:h,handleFocus:f,handleBlur:m}=$o(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},w=()=>c(n.modelValue)?[...n.modelValue]:[n.modelValue],x=r.ref(w());r.watch(()=>n.modelValue,()=>{x.value=w()});const C=r.computed(()=>wr(d.value,G=>gt(x.value,G.value))),S=r.computed(()=>{var G;return l.value||(G=C.value)==null?void 0:G[0]}),E=r.computed(()=>l.value?Mn(C.value,G=>({label:G.label??"",value:G.value})):[]),M=r.computed(()=>h.value||q.value?"minimal":"bold"),N=r.computed(()=>""),O=r.computed(()=>N.value==="error"),R=r.computed(()=>N.value==="success"),z=r.computed(()=>!n.disabled&&(O.value||R.value));let _=[];const I=()=>{o("update:modelValue",[..._]),o("change",[..._])},T=()=>{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}));$i(p,()=>{y.value=!1}),r.watch(()=>y.value,G=>{G?l.value&&(_=[...n.modelValue]):setTimeout(()=>{P.value=""},300)},{flush:"post"});const q=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 U=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(ma,{filterOptions:u,selectValues:x,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":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:k,ref_key:"triggerRef",ref:a},[C.value.length&&!L.value?(r.openBlock(),r.createElementBlock("div",wE,[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(fa),{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: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,xE),[[r.vModelText,P.value]])],2),z.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mc-select__status",[O.value?"mc-select__status--error":"mc-select__status--success"]])},[r.createVNode(r.unref(ce),{name:O.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:b.value?"48px":"0"})},[v.value?(r.openBlock(),r.createBlock(r.unref(Vr),{key:0,class:"mc-select-dropdown-header","show-tool-bar":!1,height:"40px"},{default:r.withCtx(()=>[r.createElementVNode("div",CE,[r.createVNode(r.unref(io),{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",SE,[r.createElementVNode("div",EE,[r.renderSlot(G.$slots,"default",{},void 0,!0),g.value?(r.openBlock(),r.createElementBlock("div",ME,[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(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:T},{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(NE,[["__scopeId","data-v-0096011b"]])),gd=Symbol("mc-select-group-context"),r0="mc-select-group",BE={class:"mc-select-group"},TE={class:"mc-select-group-content"},i0=X(K(r.defineComponent({name:r0,__name:"mc-select-group",props:{label:{},width:{},height:{}},setup(t){const e=t,n=r.inject(ma,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)),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",BE,[r.createElementVNode("div",{class:"mc-select-group-label",style:r.normalizeStyle(s.value)},r.toDisplayString(t.label),5),r.createElementVNode("div",TE,[r.renderSlot(a.$slots,"default",{},void 0,!0)])],512)),[[r.vShow,o.value]])}}),[["__scopeId","data-v-ff3f5179"]])),s0="mc-select-option",OE={class:"mc-select-option-content"},_E=r.defineComponent({name:s0,__name:"mc-select-option",props:{value:{},label:{},width:{},height:{},_group:{},_vnode:{}},setup(t,{expose:e}){const n=r.ref(),o=t,i=r.inject(ma,void 0),s=r.inject(gd,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",OE,[r.renderSlot(h.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.label),1)],!0)])],6)):r.createCommentVNode("",!0)}}),a0=X(K(_E,[["__scopeId","data-v-8c13e012"]])),l0="mc-status",AE={class:"mc-status-icon"},VE={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",AE,[r.createVNode(r.unref(ce),{name:"Indicator",size:12})]),r.createElementVNode("p",VE,[r.renderSlot(e.$slots,"default",{},void 0,!0)])],2))}),[["__scopeId","data-v-25f8565f"]])),d0="mc-step",IE={class:"mc-step-number-container"},DE={class:"mc-step-item-number"},RE={key:0,class:"mc-step-item-number-text"},LE={class:"mc-step-item-content"},zE={key:0,class:"mc-step-item-content-title"},$E={class:"mc-step-item-label"},PE={class:"mc-step-item-desc"},jE={key:1,class:"mc-step-item-component"},FE={key:0,class:"mc-step-item-component"},HE=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,i=r.computed(()=>o.type==="vertical"),s=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(),s("change",w)},{flush:"post"});const h=r.ref(),f=(w=p.value)=>{h.value=w,s("success",w)},m=r.computed(()=>an(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,x=d.value;if(w<0)return void(x.style.height="0");const C=l.value,S=C.querySelectorAll(".mc-step-item");if(w+1>S.length-1)return void(x.style.height="100%");const E=S==null?void 0:S[w+1],M=C.getBoundingClientRect(),N=(E.getBoundingClientRect().top-M.top)/(M.height-24);x.style.height=100*N+"%"},v=()=>{var R,z;const w=l.value,x=c.value,C=w.querySelectorAll(".mc-step-item"),S=(R=C==null?void 0:C[0])==null?void 0:R.querySelector(".mc-step-item-number"),E=(z=C==null?void 0:C[C.length-1])==null?void 0:z.querySelector(".mc-step-item-number");if(!S||!E)return void(x.style.width="0px");const M=w.getBoundingClientRect(),N=S.getBoundingClientRect(),O=E.getBoundingClientRect();x.style.width=O.left-N.left-N.width+"px",x.style.left=`${N.left-M.left+N.width}px`},b=()=>{const w=d.value,x=m.value;if(x<0)return void(w.style.width="0");const C=(x+1)/(o.steps.length-1),S=C>1?1:C;w.style.width=100*S+"%"},y=w=>i.value&&w.component&&w.key===o.modelValue,k=r.computed(()=>{var w;return!i.value&&((w=Ro(o.steps,x=>x.key===o.modelValue))==null?void 0:w.component)});return r.watch(()=>h.value,()=>{i.value?g():b()}),Tp(zo(()=>{i.value?g():(v(),b())},50)),e({ref:a,setSuccessStep:f}),(w,x)=>(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,S)=>(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":S<=m.value}]),key:C.key},[r.createElementVNode("div",IE,[r.createElementVNode("div",DE,[S>m.value||C.disabled?(r.openBlock(),r.createElementBlock("span",RE,r.toDisplayString(S+1),1)):(r.openBlock(),r.createBlock(r.unref(so),{key:1}))])]),r.createElementVNode("div",LE,[C.label||C.desc?(r.openBlock(),r.createElementBlock("div",zE,[r.createElementVNode("h3",$E,r.toDisplayString(C.label),1),r.createElementVNode("p",PE,r.toDisplayString(C.desc),1)])):r.createCommentVNode("",!0),y(C)?(r.openBlock(),r.createElementBlock("div",jE,[(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",FE,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(k.value)))])):r.createCommentVNode("",!0)],2))}}),u0=X(K(HE,[["__scopeId","data-v-add0e313"]])),p0="mc-step-plus",vd="mc-step-item-plus",WE={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",WE))})),yd="mc-step-child-item-plus",KE={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",KE))})),qE={class:"mc-step-plus"},UE={class:"mc-step-container"},JE=["onClick"],GE={class:"mc-step-item-icon"},YE={key:0,class:"mc-step-item-icon-number"},XE={key:1,class:"mc-step-item-icon-point"},ZE={class:"mc-step-item-content"},QE={class:"mc-step-item-content-title"},eM={class:"mc-step-item-label"},tM={key:1,class:"mc-step-item-label-title"},nM={class:"mc-step-item-desc"},oM={key:1,class:"mc-step-item-desc-title"},rM={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,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=(w=>{const x=[];let C=0,S=0;const E=(M,N)=>{de(M)&&M.forEach(O=>{var z,_,I,T,V,P,A,L,j,q,H,U,Y,G,Q,oe;const R=(z=(O==null?void 0:O.type)||{})==null?void 0:z.name;if(R===vd){const fe=Lo(O.children)||de(O.children)||!Ve((_=O.children)==null?void 0:_.default)?O.children:(I=O.children)==null?void 0:I.default(),le=O.children,me={parentIndex:C++,index:S++,step:((T=O.props)==null?void 0:T.step)||S,label:(V=O.props)==null?void 0:V.label,desc:(P=O.props)==null?void 0:P.desc,icon:(A=O.props)==null?void 0:A.icon,showContent:((L=O.props)==null?void 0:L.showContent)||((j=O.props)==null?void 0:j["show-content"]),success:(q=O.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};x.push(me),E(fe,me)}else if(R===yd){const fe=O.children,le={index:S++,step:(H=O.props)==null?void 0:H.step,label:(U=O.props)==null?void 0:U.label,desc:(Y=O.props)==null?void 0:Y.desc,parentStep:N,isChild:!0,showContent:((G=O.props)==null?void 0:G.showContent)||((Q=O.props)==null?void 0:Q["show-content"]),success:(oe=O.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)),x.push(le)}else Array.isArray(O.children)&&E(O.children,N)})};return E(w),x})((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 w,x;return!xe(k.index)&&!xe((w=v.value)==null?void 0:w.index)&&k.index<=((x=v.value)==null?void 0:x.index)},showStep:k=>{var w,x;return!k.isChild||!!((w=k.parentStep)!=null&&w.showContent)||!!k.parentStep&&v.value===k.parentStep||gt((x=k.parentStep)==null?void 0:x.childrenSteps,g.value)},isSuccessStep:k=>{var w,x,C,S,E,M;return!(!k.success&&!((w=k.parentStep)!=null&&w.success))||(y.value==="auto"?k.hasChildren?!xe(k.index)&&k.index+(((x=k.children)==null?void 0:x.length)??0)<(((C=v.value)==null?void 0:C.index)??-1):!xe(k.index)&&k.index<(((S=v.value)==null?void 0:S.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)&&!xe((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",qE,[r.createElementVNode("div",UE,[(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",GE,[g.isChild||r.unref(xe)(g.parentIndex)?(r.openBlock(),r.createElementBlock("div",XE)):(r.openBlock(),r.createElementBlock("div",YE,[r.unref(d)(g)?(r.openBlock(),r.createBlock(r.unref(so),{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,JE),r.createElementVNode("div",ZE,[r.createElementVNode("div",QE,[r.createElementVNode("div",eM,[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",tM,r.toDisplayString(g.label),1))]),r.createElementVNode("div",nM,[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",oM,r.toDisplayString(g.desc),1))])]),r.unref(u)(g)?(r.openBlock(),r.createElementBlock("div",rM,[(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"),iM={class:"mc-step-v2"},sM=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([]),i=r.ref(-1),s=l=>{l>-1?l>o.value.length-1?i.value=o.value.length-1:i.value=l:i.value=-1},a=()=>{const l=an(o.value,c=>c.name===n.modelValue);s(l-1)};return r.onMounted(()=>{a()}),r.watch(()=>n.modelValue,()=>{a()},{flush:"post"}),r.provide(g0,{successStepIndex:i,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:s,setSuccessStep:l=>{const c=an(o.value,d=>d.name===l);s(c)}}),(l,c)=>(r.openBlock(),r.createElementBlock("div",iM,[r.renderSlot(l.$slots,"default")]))}}),aM={class:"mc-step-item-step-bar-number"},lM={key:0,class:"mc-step-item-step-bar-number-text"},cM={key:0,class:"mc-step-item-label"},dM={class:"mc-step-item-label-title"},uM={class:"mc-step-item-label-desc"},pM={key:1,class:"mc-step-item-slot"},hM=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(),i=r.inject(g0,void 0);r.onMounted(()=>{i==null||i.addStepItem(e)}),r.onBeforeUnmount(()=>{i==null||i.removeStepItem(e)});const s=r.computed(()=>hp(i==null?void 0:i.stepItems,e)),a=r.computed(()=>{var p;return((p=i==null?void 0:i.activeStep)==null?void 0:p.value)===e.name}),l=r.computed(()=>{var p;return((p=i==null?void 0:i.showContent)==null?void 0:p.value)||e.showContent||a.value}),c=r.computed(()=>{var p,h,f;return xe((p=i==null?void 0:i.succeed)==null?void 0:p.value)?xe(e.succeed)?(((h=i==null?void 0:i.successStepIndex)==null?void 0:h.value)??-1)>=s.value:e.succeed:(f=i==null?void 0:i.succeed)==null?void 0:f.value}),d=r.computed(()=>{var p;return((p=i==null?void 0:i.stepItems)==null?void 0:p.length)===s.value+1});Po(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",aM,[c.value?(r.openBlock(),r.createBlock(r.unref(so),{key:1,class:"mc-step-item-step-bar-success-icon"})):(r.openBlock(),r.createElementBlock("div",lM,[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(s.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",cM,[r.renderSlot(p.$slots,"label",{},()=>[r.createElementVNode("span",dM,r.toDisplayString(t.label),1)],!0),r.renderSlot(p.$slots,"desc",{},()=>[r.createElementVNode("p",uM,r.toDisplayString(t.desc),1)],!0)])):r.createCommentVNode("",!0),l.value?(r.openBlock(),r.createElementBlock("div",pM,[r.renderSlot(p.$slots,"default",{},void 0,!0)])):r.createCommentVNode("",!0)],512)],6))}}),fM=K(hM,[["__scopeId","data-v-d41e82d5"]]),mM={class:"mc-step-child-item-content"},gM={key:0,class:"mc-step-child-item-label"},vM={class:"mc-step-child-item-label-title"},yM={class:"mc-step-child-item-label-desc"},bM={key:1,class:"mc-step-child-item-slot"},kM=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 s;return(s=n==null?void 0:n.actived)==null?void 0:s.value}),i=r.computed(()=>{var s,a;return(s=n==null?void 0:n.succeed)!=null&&s.value?(a=n==null?void 0:n.succeed)==null?void 0:a.value:e.succeed});return(s,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":i.value}])},[r.createElementVNode("div",mM,[t.label||t.desc?(r.openBlock(),r.createElementBlock("div",gM,[r.createElementVNode("span",vM,r.toDisplayString(t.label),1),r.createElementVNode("p",yM,r.toDisplayString(t.desc),1)])):r.createCommentVNode("",!0),s.$slots.default?(r.openBlock(),r.createElementBlock("div",bM,[r.renderSlot(s.$slots,"default",{},void 0,!0)])):r.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-f01aecff"]]),y0=X(sM),b0=X(fM),k0=X(kM),w0="mc-switch",x0="mc-switch-label",wM={class:"mc-switch-label-wrapper"},xM={class:"mc-switch-label"},CM={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",wM,[t.label||e.$slots.label?r.renderSlot(e.$slots,"label",{key:0},()=>[r.createElementVNode("span",xM,r.toDisplayString(t.label),1)],!0):r.createCommentVNode("",!0),t.helpText||e.$slots.help?r.renderSlot(e.$slots,"help",{key:1},()=>[r.createElementVNode("div",CM,[r.createVNode(r.unref(Jo),{"icon-name":t.helpIcon,content:t.helpText,"icon-size":22},null,8,["icon-name","content"])])],!0):r.createCommentVNode("",!0)]))}),[["__scopeId","data-v-52de74a9"]]),SM={class:"mc-switch"},EM=["id","disabled","value","onKeypress"],MM={class:"mc-switch-inner"},NM={class:"mc-switch-inner-text"},BM={class:"mc-switch-inner-text"},TM=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,i=r.useSlots(),{formId:s,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(()=>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",SM,[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(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,EM),r.createElementVNode("div",MM,[d.value?r.renderSlot(m.$slots,"active",{key:0},()=>[r.createElementVNode("span",NM,r.toDisplayString(t.activeText),1)],!0):r.renderSlot(m.$slots,"inactive",{key:1},()=>[r.createElementVNode("span",BM,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(TM,[["__scopeId","data-v-dc9c6820"]])),bd="mc-tab-item",OM={class:"mc-tab-item"},E0=X(r.defineComponent({name:bd,__name:"mc-tab-item",props:{name:{},label:{},disabled:{type:Boolean},count:{}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",OM,[r.renderSlot(e.$slots,"default")]))})),M0="mc-tab",_M=["onClick"],AM={key:0,class:"mc-tab-nav-item-count"},VM={class:"mc-tab-actived-component-wrapper"},IM=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,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=Mn(wr(v,b=>b.type.name===bd),b=>{var k,w,x;const y=b.props;return{_vnode:r.h("div",(x=(w=(k=b.children)==null?void 0:k.default)==null?void 0:w.call(k))==null?void 0:x[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 b=l.value,y=a.value,k=an(c.value,E=>E.name===v);if(k<0)return void(b.style.width="0");const w=Array.from(y.children)[k],{x,width:C}=w.getBoundingClientRect(),{x:S}=y.getBoundingClientRect();b.style.width=`${C}px`,b.style.transform=`translateX(${x-S}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:w=>(x=>{x.disabled||(i("update:modelValue",x.name),i("change",x.name))})(k)},[r.createElementVNode("span",null,r.toDisplayString(k.label),1),k.count?(r.openBlock(),r.createElementBlock("span",AM,r.toDisplayString(k.count),1)):r.createCommentVNode("",!0)],10,_M))),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",VM,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u.value._vnode),{key:u.value.name}))])],4)):r.createCommentVNode("",!0)],2)}}}),N0=X(K(IM,[["__scopeId","data-v-2c21b5ce"]])),DM=["rowspan","colspan"],RM=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}),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 w,x;if(!((w=e.pagination)!=null&&w.currentPage)||!((x=e.pagination)!=null&&x.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,DM)):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-3b2b75d3"]]),LM={class:"mc-table__body",cellspacing:"0",cellpadding:"0",border:"0"},zM={key:0,width:"50"},$M=["width"],PM=["onClick"],jM={key:0,class:"mc-table__selection-column"},FM={class:"mc-table__cell"},HM={key:1},WM=["colspan"],KM={key:1},qM=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,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",LM,[r.createElementVNode("colgroup",null,[t.selectable?(r.openBlock(),r.createElementBlock("col",zM)):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,$M))),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",jM,[r.createElementVNode("div",FM,[r.createVNode(r.unref(io),{"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(RM,{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(w=>[r.renderSlot(f.$slots,k,r.mergeProps({ref_for:!0},w),void 0,!0)])}))]),1032,["row","column","row-index","column-index","span-method","pagination"]))),128))],10,PM))),128)):(r.openBlock(),r.createElementBlock("tr",HM,[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",KM,r.toDisplayString(t.emptyText),1))],8,WM)]))])])],4))}}),[["__scopeId","data-v-f42c4de9"]]),UM={class:"mc-table__header",cellspacing:"0",cellpadding:"0",border:"0"},JM={key:0,width:"50"},GM=["width"],YM={key:0,class:"mc-table__selection-column"},XM={class:"mc-table__header-cell"},ZM=["onClick"],QM={class:"mc-table__header-label"},eN={key:0,class:"mc-table__sort-caret"},tN=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",UM,[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,GM))),128))]),r.createElementVNode("thead",null,[r.createElementVNode("tr",null,[t.selectable?(r.openBlock(),r.createElementBlock("th",YM,[r.createElementVNode("div",XM,[r.createVNode(r.unref(io),{"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",QM,[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",eN,[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,ZM))),128))])])])],512)):r.createCommentVNode("",!0)}}),nN=K(tN,[["__scopeId","data-v-990de870"]]),oN={class:"mc-table__loading-content"},rN={class:"mc-table__loading-spinner"},iN={key:0,class:"mc-table__spinner mc-table__spinner--default"},sN={key:1,class:"mc-table__spinner mc-table__spinner--circle"},aN={key:2,class:"mc-table__spinner mc-table__spinner--pulse"},lN=["innerHTML"],cN={key:0,class:"mc-table__loading-text"},dN=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 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",oN,[r.renderSlot(i.$slots,"loading",{loading:t.loading,text:n.value},()=>{var l;return[r.createElementVNode("div",rN,[(l=t.loadingConfig)!=null&&l.spinner&&t.loadingConfig.spinner!=="default"?t.loadingConfig.spinner==="circle"?(r.openBlock(),r.createElementBlock("div",sN)):t.loadingConfig.spinner==="pulse"?(r.openBlock(),r.createElementBlock("div",aN)):(r.openBlock(),r.createElementBlock("div",{key:3,class:"mc-table__spinner mc-table__spinner--custom",innerHTML:t.loadingConfig.spinner},null,8,lN)):(r.openBlock(),r.createElementBlock("div",iN,[...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",cN,r.toDisplayString(n.value),1)):r.createCommentVNode("",!0)]},!0)])],6)):r.createCommentVNode("",!0)}}}),[["__scopeId","data-v-0a275eb6"]]),uN={key:0,class:"mc-table__pagination"},pN={class:"mc-table__pagination-info"},hN={class:"mc-table__pagination-info-number"},fN={class:"mc-table__pagination-info-number"},mN={class:"mc-table__pagination-controls"},gN=["onClick"],vN={key:1,class:"mc-table__pagination-ellipsis"},yN={class:"mc-table__pagination-size"},bN={class:"mc-table-pagination-size-group"},kN=["onClick"],wN=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",uN,[r.createElementVNode("div",pN,[v[4]||(v[4]=r.createTextVNode(" Showing ",-1)),r.createElementVNode("span",hN,r.toDisplayString(c.value)+"-"+r.toDisplayString(d.value),1),v[5]||(v[5]=r.createTextVNode(" of ",-1)),r.createElementVNode("span",fN,r.toDisplayString(t.pagination.total),1)]),r.createElementVNode("div",mN,[r.createVNode(eo,{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(eo,{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,gN)):(r.openBlock(),r.createElementBlock("span",vN,"..."))],64))),128)),r.createVNode(eo,{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(eo,{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",yN,[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,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,kN))),128))])])])):r.createCommentVNode("",!0)}}),xN=K(wN,[["__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),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 T0(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 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: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 _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: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)),w=r.ref(i.value),x=n,C=r.ref(),S=r.ref(),E=r.ref(),{columnsWithFixed:M}=T0(s,S,E),{sortedData:N,handleSort:O,getSortOrder:R}=O0(w,M,p==null?void 0:p.value),{paginatedData:z,updatePagination:_}=B0(N,a,b),I=r.computed(()=>z.value),{internalSelectedRows:T,isAllSelected:V,isIndeterminate:P,toggleRowSelection:A,toggleAllSelection:L,clearSelection:j,getSelectedRows:q}=function(Z,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 Ce=ue=>re.value.some(ge=>ie.value?ge[ie.value]===ue[ie.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=>ie.value?we[ie.value]===ue[ie.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=>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=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 ie=r.ref(null);return{currentRow:ie,setCurrentRow:ae=>(ie.value=ae,ie.value),getRowClass:ae=>{const re=[];return Z.value&&ie.value===ae&&re.push("is-current"),re},clearCurrentRow:()=>{ie.value=null}}}(h);r.watch(()=>i.value,Z=>{w.value=Z},{deep:!0,immediate:!0});const Y=(Z,ie)=>{if(h.value){const ae=H(Z);x("current-change",ae)}if(m.value&&v.value){const ae=A(Z);me(Z,ae)}x("row-click",Z,ie)},G=(Z,ie)=>{x("header-click",Z,ie)},Q=Z=>{const ie=O(Z);ie&&x("sort-change",ie)},oe=(Z,ie)=>{const ae=A(Z,ie);me(Z,ae)},fe=Z=>{L(Z),me(null,Z)},le=async Z=>{_(Z),r.nextTick(()=>{var ie;(ie=E.value)!=null&&ie.bodyWrapper&&(E.value.bodyWrapper.scrollTop=0)}),x("page-change",Z),await Be()},me=(Z,ie)=>{x("update:selectedRows",[...T.value]),x("selection-change",[...T.value]),Z?x("select",Z,ie):x("select-all",ie)},Be=async()=>{if(o.isInitTableData&&o.initTableData&&typeof o.initTableData=="function"){const{data:Z,total:ie}=await o.initTableData({pageSize:a.value.pageSize||10,pageNum:a.value.currentPage||1});w.value=Z,a.value.total=ie}};return r.onMounted(()=>{Be()}),e({ref:C,clearSort:()=>{s.value.forEach(Z=>{Z.sortable&&(Z.sortOrder=null)})},toggleRowSelection:(Z,ie)=>{const ae=A(Z,ie);me(Z,ae)},refresh:async()=>{a.value.currentPage=1,await Be()},toggleAllSelection:Z=>{L(Z),me(null,Z)},clearSelection:()=>{j(),x("update:selectedRows",[]),x("selection-change",[])},getSelectedRows:q}),(Z,ie)=>{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(nN,{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:G,onSortChange:Q,onSelectAll:fe},r.createSlots({_:2},[r.renderList(k.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(qM,{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(T),"select-on-row-click":r.unref(v),onRowClick:Y,onSelect:oe},r.createSlots({_:2},[r.renderList(k.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(xN,{key:0,pagination:r.unref(a),onPageChange:le},null,8,["pagination"])):r.createCommentVNode("",!0),r.createVNode(dN,{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",dr={fixed:"none",sortable:!1,columnAlign:"left",rowAlign:"center",sortType:"string"},kd=Symbol("mc-table-context"),Jn=()=>{const t=r.inject(kd,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",CN={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",CN))})),SN=(t=ct)=>{switch(t){case"left":return"flex-start";case"center":return"center";case"right":return"flex-end"}},EN={key:0,class:"mc-table-row-tr mc-table-row-left"},MN={class:"mc-table-row-center-content"},NN={key:3,class:"mc-table-row-tr mc-table-row-right"},BN=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:i,leftWidth:s,rightWidth:a,centerWidth:l,viewWidth:c}=Jn();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=Ri(c.value)+Ri(o.value)+5<Ri(l.value);return e.leftColumns.length>0&&h}),p=h=>{n.value&&n.value.scrollTo({left:h})};return zi(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",EN,[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(Ya)(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",MN,[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(Ya)(r.unref(a))})},null,4)):r.createCommentVNode("",!0),t.rightColumns.length?(r.openBlock(),r.createElementBlock("tr",NN,[r.renderSlot(h.$slots,"right",{columns:t.rightColumns},void 0,!0)])):r.createCommentVNode("",!0)],2))}}),Cd=K(BN,[["__scopeId","data-v-07610e84"]]),TN=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"]]),ON={class:"mc-table-header-cell-title"},_N={class:"mc-table-header-cell-title-text"},AN={key:0,class:"mc-table-header-cell-sort"},VN={class:"mc-table-header-cell-desc"},IN={class:"mc-table-body-cell-value"},kn=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: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}=Jn(),y=be("column"),k=be("type"),w=be("width"),x=r.computed(()=>k.value==="header"),C=r.computed(()=>k.value==="body"),S=r.computed(()=>k.value==="expand"),E=r.computed(()=>k.value==="expand-icon"),M=r.computed(()=>{var T,V;const _=w.value?`${w.value}px`:u!=null&&u.value?`${u.value}px`:"auto";let I="default";return x.value&&((T=y==null?void 0:y.value)!=null&&T.sortable)&&(I="pointer"),{width:_,cursor:I,alignItems:E.value?"center":SN((V=y==null?void 0:y.value)==null?void 0:V.columnAlign)}});let N={},O={},R={};if(x.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 T;p(((T=y==null?void 0:y.value)==null?void 0:T.prop)||"",(V=>{switch(V){case"normal":return"desc";case"desc":return"asc";default:return"normal"}})(_.value))},500);zi(d,"click",I)}N={currentSort:_}}else if(E.value){const _=be("row"),I=be("rowIndex"),T=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(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;T.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:T,isExpanded:V}}else if(C.value){const _=be("row");O={displayValue:r.computed(()=>{var V,P;const I=((V=y==null?void 0:y.value)==null?void 0:V.defaultValue)||"--",T=(P=y==null?void 0:y.value)==null?void 0:P.prop;return xe(T)||xe(_==null?void 0:_.value)||xe(_.value[T])?I:_.value[T]})}}return{isHeader:x,isBody:C,isExpand:S,isExpandIcon:E,cellStyle:M,headerCtx:N,bodyCtx:O,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",ON,[r.createElementVNode("div",_N,[r.renderSlot(d.$slots,"title",{},()=>[r.createTextVNode(r.toDisplayString(t.column.label),1)],!0)]),t.column.sortable?(r.openBlock(),r.createElementBlock("div",AN,[r.createVNode(TN,{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",VN,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(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(s))},[r.renderSlot(d.$slots,"default",{},()=>{var p;return[r.createElementVNode("span",IN,r.toDisplayString((p=r.unref(l).displayValue)==null?void 0:p.value),1)]},!0)],6))}}),[["__scopeId","data-v-2ac704bd"]]),DN={class:"mc-table-header"},RN={class:"mc-table-header-thead"},LN=K(r.defineComponent({name:V0,__name:"mc-table-header",setup(t){const{leftColumns:e,rightColumns:n,centerColumns:o}=Jn();return(i,s)=>(r.openBlock(),r.createElementBlock("table",DN,[r.createElementVNode("thead",RN,[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(kn,{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(kn,{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(kn,{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"]]),zN={key:0,class:"mc-table-total"},$N={class:"mc-table-total-number"},PN={class:"mc-table-total-number"},jN=K(r.defineComponent({name:F0,__name:"mc-table-total",setup(t){const{pagination:e}=Jn(),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",zN,[i[0]||(i[0]=r.createElementVNode("span",null,"Showing",-1)),r.createElementVNode("span",$N,r.toDisplayString(n.value.range),1),i[1]||(i[1]=r.createElementVNode("span",null,"of",-1)),r.createElementVNode("span",PN,r.toDisplayString(n.value.total),1)])):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-f242f0b2"]]),FN={class:"mc-table-ellipsis"},HN=K(r.defineComponent({name:q0,__name:"mc-table-ellipsis",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",FN,[...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,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(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(HN,{key:5})):r.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-f2d32b30"]]),WN={key:0,class:"mc-table-pagination"},KN=r.defineComponent({name:W0,__name:"mc-table-pagination",setup(t){const{pagination:e,isLoading:n,handlePagination:o}=Jn(),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",WN,[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(s.value,v=>{var b;return r.openBlock(),r.createBlock(wn,{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(wn,{key:1,type:"ellipsis"})):r.createCommentVNode("",!0),r.createVNode(wn,{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(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"])]))}}}),qN=K(KN,[["__scopeId","data-v-df311846"]]),UN={class:"mc-table-page-size"},JN={class:"mc-table-page-size-group"},GN=["onClick"],YN=K(r.defineComponent({name:H0,__name:"mc-table-page-size",setup(t){const{pagination:e,isLoading:n,handlePagination:o}=Jn();return(i,s)=>{var a;return r.openBlock(),r.createElementBlock("div",UN,[s[0]||(s[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,GN)}),128))])])}}}),[["__scopeId","data-v-180a8b6e"]]),XN={class:"mc-table-footer"},ZN=K(r.defineComponent({name:j0,__name:"mc-table-footer",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",XN,[r.createVNode(jN),r.createVNode(qN),r.createVNode(YN)]))}),[["__scopeId","data-v-1fc62add"]]),QN={class:"mc-table-loading"},eB=K(r.defineComponent({name:$0,__name:"mc-table-loading",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",QN,[r.renderSlot(e.$slots,"default",{},()=>[r.createVNode(r.unref(wl),{loading:!0,type:"pulse",size:"small"})],!0)]))}),[["__scopeId","data-v-fb443fd0"]]),tB={class:"mc-table-body"},nB={class:"mc-table-body-tbody"},oB=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:i,isExpanded:s,getExpandData:a}=Jn();return(l,c)=>(r.openBlock(),r.createElementBlock("table",tB,[r.createElementVNode("tbody",nB,[(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(i)},{left:r.withCtx(({columns:p})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,h=>(r.openBlock(),r.createBlock(kn,{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(kn,{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(kn,{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(Cd,{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(kn,{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(kn,{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(kn,{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(eB,{key:0},{default:r.withCtx(()=>[r.renderSlot(l.$slots,"loading",{},void 0,!0)]),_:3})):r.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-68cb46c9"]]),rB={class:"mc-table-empty"},iB=K(r.defineComponent({name:z0,__name:"mc-table-empty",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",rB,[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"]]),sB=r.defineComponent({name:P0,__name:"mc-table-scroll",setup(t){const{scroll:e,centerWidth:n,viewWidth:o,tableWidth:i,setScroll:s}=Jn(),a=r.ref(),l=r.ref(),c=r.computed(()=>Au(o.value/n.value*100)),d=r.computed(()=>Ri(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 S,E;let k=y.clientX-h+f;k<0&&(k=0);const w=((E=(S=l.value)==null?void 0:S.getBoundingClientRect())==null?void 0:E.width)||0,x=i.value-w+2;k>x&&(k=x),p.value=k;const C=p.value*n.value/i.value;s(C)},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(Ya)(p.value)})`})},null,4)],544)):r.createCommentVNode("",!0)}}),aB=K(sB,[["__scopeId","data-v-3b46e14e"]]),lB=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,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([]),q=r.ref([]),H=r.ref([]),U=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 Z;const{columns:oe,columnWidthInfo:fe,leftColumns:le,centerColumns:me,rightColumns:Be}=(ie=>{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)||dr.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)||dr.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"])||dr.sortType,columnAlign:(D==null?void 0:D.columnAlign)||(D==null?void 0:D["column-align"])||dr.columnAlign,rowAlign:(D==null?void 0:D.rowAlign)||(D==null?void 0:D["row-align"])||dr.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(ie),{columns:ae,columnWidthInfo:Oe,leftColumns:re,centerColumns:Ce,rightColumns:nt}})((Z=G.default)==null?void 0:Z.call(G));L.value=oe,Y.fixedWidth=fe.fixedWidth,Y.restColumns=fe.restColumns,j.value=le,q.value=me,H.value=Be},{immediate:!0}),Po(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}})(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:w}=(()=>{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,G=j(Y),Q=H.sortType||"string";return G!=="normal"&&(Ve(Q)||(fe=Q==="number"?me=>Number(me[Y]):[Y],le=[G],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 Da(re,ae.length===1?ae[0]:ae)}:ae}):[Bo];var ie=-1;return Be=No(Be,Mi(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=Hb(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:++ie,value:ae}}))}(oe,fe,le)))),U;var oe,fe,le}}})(),{pagination:x,hasPagination:C,handlePagination:S}=(()=>{const A=be("pagination"),L=r.reactive({...wd});r.onMounted(()=>{j(A.value||wd)});const j=Y=>{Gy(L,{...Y})};r.watch(()=>A.value,Y=>{j(Y||wd)},{deep:!0});const q=r.getCurrentInstance(),H=Ii(()=>{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:O,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:T}=(A=>{const{leftColumns:L,rightColumns:j,centerColumns:q,tableWidth:H,columnWidth:U}=A,Y=le=>function(me,Be,Z){var ie=de(me)?fu:Jb,ae=arguments.length<3;return ie(me,En(Be),Z,ae,kr)}(le,(me,Be)=>me+(Be.width||U.value),0),G=r.computed(()=>Y(L.value)),Q=r.computed(()=>Y(j.value)),oe=r.computed(()=>Y(q.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(()=>C.value&&!V.value);return r.provide(kd,{data:l,tableWidth:h,isLoading:r.computed(()=>!!n.loading),columns:c,columnWidth:f,leftColumns:d,rightColumns:p,centerColumns:u,scroll:m,setScroll:g,pagination:x,handlePagination:S,handleSort:(A,L)=>{if(N(),b(A,L),n.sortType==="front"){const j=Ro(c.value,q=>q.prop===A);j&&(l.value=w(n.data,j))}else o("change:sort",A,L)},getCurrentSort:k,isExpanded:E,getExpandData:M,setExpandData:(A,L)=>{O(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:T}),(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(LN),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(oB,{key:0,loading:t.loading},null,8,["loading"]))]),r.createVNode(aB),P.value?(r.openBlock(),r.createBlock(ZN,{key:0})):r.createCommentVNode("",!0)],4))}}),J0=X(K(lB,[["__scopeId","data-v-acae2d99"]])),G0="mc-textarea",cB=["value","id","disabled","maxlength","placeholder"],dB={class:"mc-textarea-count"},uB=r.defineComponent({name:G0,__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:i,height:s}=$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 k=>{let w=k.target.value;n.maxLength>0&&w.length>n.maxLength&&(w=w.slice(0,n.maxLength)),o("update:modelValue",w),o("change",w),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,w)=>(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:w[0]||(w[0]=(...x)=>r.unref(d)&&r.unref(d)(...x)),onBlur:w[1]||(w[1]=(...x)=>r.unref(u)&&r.unref(u)(...x)),onInput:g},null,44,cB),b.value?r.renderSlot(k.$slots,"count",{key:0,maxLength:t.maxLength,currentLength:y.value},()=>[r.createElementVNode("div",dB,[r.createElementVNode("span",null,r.toDisplayString(`${y.value} / ${t.maxLength} characters`),1)])],!0):r.createCommentVNode("",!0)],6))}}),Y0=X(K(uB,[["__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"],pB={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.`},hB={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=be("lang");return{langMap:r.computed(()=>t.value==="zh"?hB:pB)}},fB={class:"mc-upload-dropzone-area"},mB={class:"mc-upload-dropzone-title"},gB={class:"mc-upload-dropzone-title-text"},vB={key:0,class:"mc-upload-dropzone-desc"},yB={key:0},bB={key:1},kB=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,i=n,{langMap:s}=Bd(),a=r.ref(),l=r.computed(()=>{var m;return(m=o.allowedFileTypes)!=null&&m.length?s.value.limit_type.replace(zt,Mn(o.allowedFileTypes,g=>g.toUpperCase()).join(", ")):void 0}),{isDragover:c}=((m,g)=>{const v=r.ref(!1),b=C=>{C!==v.value&&(v.value=C)},y=C=>{C.preventDefault(),b(!0),Ve(g.onDragEnter)&&g.onDragEnter(C)},k=C=>{C.preventDefault(),b(!1),Ve(g.onDragLeave)&&g.onDragLeave(C)},w=C=>{C.preventDefault(),Ve(g.onDragover)&&g.onDragover(C)},x=C=>{C.preventDefault(),b(!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",k),(E=m.value)==null||E.addEventListener("dragover",w),(M=m.value)==null||M.addEventListener("drop",x)}),r.onBeforeUnmount(()=>{var C,S,E,M;(C=m.value)==null||C.removeEventListener("dragenter",y),(S=m.value)==null||S.removeEventListener("dragleave",k),(E=m.value)==null||E.removeEventListener("dragover",w),(M=m.value)==null||M.removeEventListener("drop",x)}),{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=>{Md(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 w=!1;for(let x=0;x<b.length;x++){const C=b[x];C.size>k?(Md(y,C.name,{status:"failed",errorMessage:s.value.limit_size.replace(zt,`${Ed(k)}`)}),i("error:size",C.name)):w=!0}})(g,v),((b,y)=>{var C;const k=o.allowedFileTypes;if(!(k!=null&&k.length))return!0;let w=!1;const x=Mn(k,S=>S.toUpperCase());for(let S=0;S<b.length;S++)gt(x,((C=b[S].name.split(".").pop())==null?void 0:C.toUpperCase())??"--")?w=!0:(Md(y,b[S].name,{status:"failed",errorMessage:l.value}),i("error:type",b[S].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",fB,[r.renderSlot(m.$slots,"default",{},()=>[r.createElementVNode("div",mB,[r.renderSlot(m.$slots,"title",{},()=>[r.createVNode(r.unref(ce),{name:t.icon},null,8,["name"]),r.createElementVNode("span",gB,r.toDisplayString(t.title||r.unref(s).upload_note),1)],!0)]),t.hideDesc?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",vB,[r.renderSlot(m.$slots,"desc",{},()=>[t.fileSize>0?(r.openBlock(),r.createElementBlock("span",yB,r.toDisplayString(r.unref(s).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))}}),wB=K(kB,[["__scopeId","data-v-39652196"]]),ey="mc-file-list",xB={class:"mc-file-list-item-content"},CB={class:"mc-file-list-item-file mc-file-list-item-info"},SB=["onClick"],EB={class:"mc-file-list-item-file-name-text"},MB={class:"mc-file-list-item-file-desc"},NB={class:"mc-file-list-item-file-size-text"},BB={key:0,class:"mc-file-list-item-file-progress-bar"},TB={key:1,class:"mc-file-list-item-file-error"},OB={class:"mc-file-list-item-info"},_B={class:"mc-file-list-item-label"},AB={class:"mc-file-list-item-value"},VB={class:"mc-file-list-item-info"},IB={class:"mc-file-list-item-label"},DB={class:"mc-file-list-item-value"},RB={class:"mc-file-list-item-actions"},LB={class:"mc-file-list-item-compact-content"},zB={class:"mc-file-list-item-info"},$B={class:"mc-file-list-item-label"},PB={class:"mc-file-list-item-value"},jB={class:"mc-file-list-item-info"},FB={class:"mc-file-list-item-label"},HB={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:i}=Bd(),s=r.ref(!1),a=r.ref();Po(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",xB,[r.createElementVNode("div",CB,[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",EB,r.toDisplayString(u.name),1)],8,SB),r.createElementVNode("div",MB,[u.status!=="failed"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("span",NB,r.toDisplayString(u.size?r.unref(Ed)(u.size):"--"),1),u.status==="loading"?(r.openBlock(),r.createElementBlock("div",BB,[r.createVNode(r.unref(Cl),{percentage:u.progress,"transition-duration":1e3},null,8,["percentage"])])):r.createCommentVNode("",!0)],64)):(r.openBlock(),r.createElementBlock("span",TB,r.toDisplayString(u.errorMessage||"failed to upload"),1))])]),s.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("div",OB,[r.createElementVNode("span",_B,r.toDisplayString(r.unref(i).uploaded_by),1),r.createElementVNode("span",AB,r.toDisplayString(u.uploadBy||"--"),1)]),r.createElementVNode("div",VB,[r.createElementVNode("span",IB,r.toDisplayString(r.unref(i).uploaded_on),1),r.createElementVNode("span",DB,r.toDisplayString(r.unref(X0)(u.uploadTime)||"--"),1)])],64)),r.createElementVNode("div",RB,[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))])]),s.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createVNode(r.unref(vl)),r.createElementVNode("div",LB,[r.createElementVNode("div",zB,[r.createElementVNode("span",$B,r.toDisplayString(r.unref(i).uploaded_by),1),r.createElementVNode("span",PB,r.toDisplayString(u.uploadBy||"--"),1)]),r.createElementVNode("div",jB,[r.createElementVNode("span",FB,r.toDisplayString(r.unref(i).uploaded_on),1),r.createElementVNode("span",HB,r.toDisplayString(r.unref(X0)(u.uploadTime)||"--"),1)])])],64)):r.createCommentVNode("",!0)]))),128))],2))}}),[["__scopeId","data-v-df197365"]])),WB={key:0,class:"mc-upload-content"},KB={class:"mc-upload-content-icon"},qB={class:"mc-upload-content-text"},UB={class:"mc-upload-component"},JB={key:0,class:"mc-upload-dropzone-wrapper"},GB={class:"mc-upload-file-list-wrapper"},YB=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,i=n,{width:s}=$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 qi.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=>{i("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);i("update:modelValue",M),i("upload",M),i("change",M),x()},g=S=>{console.error("mc-upload: error:type:",S),i("error:type",S)},v=S=>{console.error("mc-upload: error:size:",S),i("error:size",S)},b=S=>{i("preview",S)},y=S=>{i("delete",S)},k=S=>{i("download",S)},w=S=>{i("cancel",S)},x=(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(),i("clear"),i("update:modelValue",[]),i("change",[])},downloadAllFiles:()=>{i("download:all",h(d))}}),(S,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",WB,[r.createElementVNode("div",KB,[t.succeed?(r.openBlock(),r.createBlock(r.unref(so),{key:1,width:"24px",height:"24px"})):(r.openBlock(),r.createBlock(r.unref(ce),{key:0,name:"Accept"}))]),r.createElementVNode("div",qB,[r.renderSlot(S.$slots,"content",{},void 0,!0)])])):r.createCommentVNode("",!0),r.createElementVNode("div",UB,[t.disabled?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",JB,[r.createVNode(wB,{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",GB,[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:b,onDelete:y,onDownload:k,onCancel:w},null,8,["model-value","allow-cancel","downloadable","lang","theme","deletable"])])])],2)],4))}}),ty=X(K(YB,[["__scopeId","data-v-92f6b3db"]])),XB=[Bp,to,io,uh,hh,vh,xh,Sh,Mh,vl,Dh,Go,ih,ah,ce,Bn,kl,$h,jh,wl,Ji,Kh,Uh,Ui,Wi,Cl,of,ef,tf,lf,sf,xl,yl,Qv,t0,o0,i0,a0,Jv,pd,ui,md,c0,u0,f0,h0,m0,k0,b0,y0,so,S0,N0,E0,_0,U0,J0,fa,Y0,Vr,bl,kh,Jo,Td,ty];console.info("contact us with ayachinenesanobauxichi@gmail.com");const ZB=(ny=XB,t=>Di(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=jo,B.FORM_ITEM_CTX_KEY=fl,B.INPUT_GROUP_INJECTION_KEY=Ir,B.MC_ALERT_MESSAGE=Np,B.MC_BUTTON=_p,B.MC_CHECKBOX=ch,B.MC_CHECKBOX_GROUP=dh,B.MC_COLLAPSE=ph,B.MC_COLLAPSE_ITEM=gh,B.MC_COPY=wh,B.MC_COUNT=Ch,B.MC_CURRENCY_ICON=Eh,B.MC_DIVIDER=Nh,B.MC_DRAWER=Ih,B.MC_FILE_LIST=ey,B.MC_FOOTER=Vh,B.MC_FORM=Ap,B.MC_FORM_ITEM=sh,B.MC_ICON=Mp,B.MC_ICON_PLUS=fh,B.MC_INPUT=zh,B.MC_INPUT_GROUP=Rh,B.MC_LIGHTBOX=Ph,B.MC_LOADING=Fh,B.MC_MODAL_HEADER=Ah,B.MC_MULTI_TAG=Wh,B.MC_OTP=qh,B.MC_OVERLAY=Bh,B.MC_POPPER=oh,B.MC_PROGRESS_BAR=Jh,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=Th,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=s0,B.MC_SELECT_OPTION_PLUS=hd,B.MC_SELECT_PLUS=Gv,B.MC_SELECT_PLUS_CTX=ha,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=Gh,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=kd,B.MC_TABLE_DEFAULT_PROPS=dr,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=bd,B.MC_TAG=Yv,B.MC_TEXTAREA=G0,B.MC_TITLE=_h,B.MC_TITLE_TOOL_BAR=Oh,B.MC_TOAST=yh,B.MC_TOOLTIP=rh,B.MC_UPLOAD=Z0,B.MC_UPLOAD_DROPZONE=Q0,B.McAlertMessage=Bp,B.McButton=to,B.McCheckbox=io,B.McCheckboxGroup=uh,B.McCollapse=hh,B.McCollapseItem=vh,B.McCopy=xh,B.McCount=Sh,B.McCurrencyIcon=Mh,B.McDivider=vl,B.McDrawer=Dh,B.McFileList=Td,B.McFooter=Go,B.McForm=ih,B.McFormItem=ah,B.McIcon=ce,B.McIconPlus=Bn,B.McInput=kl,B.McInputGroup=$h,B.McLightbox=jh,B.McLoading=wl,B.McModalHeader=Ji,B.McMultiTag=Kh,B.McOtp=Uh,B.McOverlay=Ui,B.McPopper=Wi,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=i0,B.McSelectGroupPlus=Jv,B.McSelectMultiOption=pd,B.McSelectOption=a0,B.McSelectOptionPlus=ui,B.McSelectPlus=md,B.McStatus=c0,B.McStep=u0,B.McStepChildItemPlus=f0,B.McStepChildItemV2=k0,B.McStepItemPlus=h0,B.McStepItemV2=b0,B.McStepPlus=m0,B.McStepV2=y0,B.McSuccessIcon=so,B.McSwitch=S0,B.McTab=N0,B.McTabItem=E0,B.McTable=_0,B.McTableColumnPlus=U0,B.McTablePlus=J0,B.McTag=fa,B.McTextarea=Y0,B.McTitle=Vr,B.McTitleToolBar=bl,B.McToast=kh,B.McTooltip=Jo,B.McUpload=ty,B.SELECT_GROUP_INJECTION_KEY=gd,B.SELECT_INJECTION_KEY=ma,B.TOOL_ICON=Ne,B.WILDCARD=zt,B.default=ZB,B.toast=qi,B.usePagination=B0,B.useTableScroll=T0,B.useTableSort=O0,Object.defineProperties(B,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|